Skip to content

Commit

Permalink
Updating with packed build
Browse files Browse the repository at this point in the history
  • Loading branch information
lupestro committed Feb 3, 2024
1 parent b10bbde commit 64d62fe
Show file tree
Hide file tree
Showing 18 changed files with 5,007 additions and 15 deletions.
11 changes: 11 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": ["@babel/syntax-dynamic-import"],
"presets": [
[
"@babel/preset-env",
{
"modules": false
}
]
]
}
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ jobs:
pnpm lint
pnpm build
pnpm test
mv --force dist/torch.bundle.js torch.js
# Create a zip file with all files required by the module to add to the release
- name: Zip It
run: |
zip ${{steps.name_zip.outputs.ZIP_NAME}} -r *.js lang torch.css module.json sources.json README.md
cd dist
zip ${{steps.name_zip.outputs.ZIP_NAME}} -r torch.js torch.css lang module.json sources.json README.md
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ jobs:
run: |
pnpm install
pnpm build
mv --force fudge-compiled.mjs fudge.mjs
mv --force dist/torch.bundle.js torch.js
# Create a zip file with all files required by the module to add to the release
- name: Zip It
run: |
cd dist
zip ${{steps.get_vars.outputs.ZIP_NAME}} -r *.js lang torch.css module.json sources.json README.md
# Create a release for this specific version
Expand All @@ -101,6 +102,6 @@ jobs:
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './module.json, ./${{steps.get_vars.outputs.ZIP_NAME}}'
artifacts: 'dist/module.json, dist/${{steps.get_vars.outputs.ZIP_NAME}}'
tag: ${{steps.get_vars.outputs.TAG_NAME}}
body: 'Please copy/paste the current release data from CHANGELOG.md into this field'
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.vscode/*
.vscode/*
node_modules/*
dist/*
37 changes: 30 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
{
"name": "torch",
"version": "2.12.0",
"description": "",
"main": "index.js",
"name": "my-webpack-project",
"version": "1.0.0",
"description": "My webpack project",
"main": "src/torch.js",
"scripts": {
"lint": "echo \"No lint supplied yet\"",
"build": "echo \"No build supplied yet\"",
"test": "echo \"Error: no test automation supplied yet\""
"copy-dist": "npm-run-all copy:dist*",
"copy:dist1": "npx cpy ./torch.css dist/",
"copy:dist2": "npx cpy ./sources.json dist/",
"copy:dist3": "npx cpy ./lang/ dist/",
"copy:dist4": "npx cpy ./module.json dist/",
"copy:dist5": "npx cpy ./README.md dist/",
"build": "npm-run-all build:prod copy-dist",
"test": "echo \"Error: no test automation supplied yet\"",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
"serve": "webpack serve"
},
"keywords": [],
"contributors": [
Expand All @@ -20,5 +30,18 @@
"flags": {}
}
],
"license": "SEE LICENSE IN README.md"
"license": "SEE LICENSE IN README.md",
"devDependencies": {
"@babel/core": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"babel-loader": "^9.1.3",
"babel-preset-es2015": "^6.24.1",
"cpy-cli":"^5.0.0",
"npm-run-all":"^4.1.5",
"mini-css-extract-plugin":"^2.8.0",
"prettier": "^3.2.4",
"webpack": "^5.90.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
}
}
Loading

0 comments on commit 64d62fe

Please sign in to comment.