-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9aefdef
commit e4b3a3c
Showing
14 changed files
with
4,059 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Publish to npm | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
cache: 'npm' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Publish to npm | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
npm version patch | ||
npm publish | ||
- name: Create GitHub Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
dist/** | ||
package.json | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/node_modules/ | ||
/node_modules/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// -- Vars | ||
const path = require("path"), | ||
fs = require("fs"); | ||
|
||
// -- Main function | ||
async function main() { | ||
|
||
// -- Create the object to be write in the file | ||
const json = { | ||
coreDependencies: { | ||
"modernizr": "//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js", | ||
"respond": "//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js", | ||
"jquery": "//cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js", | ||
"underscore": "//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.6/underscore-min.js" | ||
}, | ||
dependencies: {}, | ||
styles: {}, | ||
fonts: {}, | ||
anims: {} | ||
}; | ||
//console.log(json); | ||
console.log("Creating the package.json file..."); | ||
|
||
// -- Create the file | ||
await createFileIfnotExists(JSON.stringify(json, null, 2)); | ||
} | ||
|
||
// -- Step 0 | ||
async function createFileIfnotExists(content) { | ||
|
||
const fileName = 'vanillaJet.package.json'; | ||
const filePath = path.join(processCwd(), '/' + fileName); | ||
const exists = await fs.promises.access(filePath, fs.constants.F_OK).then(() => true).catch(() => false); | ||
|
||
if (!exists) { | ||
// -- Create the file with the json content | ||
fs.writeFileSync(filePath, content, 'utf8'); | ||
} | ||
} | ||
|
||
// -- Helpers | ||
function processCwd() { | ||
return process.cwd() | ||
.replace('/.grunt', '') | ||
.replace('/.scripts', ''); | ||
} | ||
|
||
module.exports = main; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.