Skip to content

Commit 29146e4

Browse files
committed
feat: Force build before publishing
To avoid the common mistake of publishing before building, add `npm run build` to the `prepack` stage. This takes care of building before both `npm publish` and `npm pack`.
1 parent 4fe8787 commit 29146e4

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
- name: Install dependencies
2424
run: |
2525
npm ci
26-
npm run build
2726
npm run pack:local
2827
cd test-site
2928
npm i ../pack/openedx-frontend-base.tgz

nodemon.pack.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"ext": "ts,tsx,js,jsx,json,scss,css",
44
"ignore": ["node_modules/**", ".git/**", "pack/**"],
55
"delay": "250ms",
6-
"exec": "npm run build:pack"
6+
"exec": "npm run pack:local"
77
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
"build": "make build",
2525
"clean": "make clean",
2626
"dev": "npm run build && node ./dist/tools/cli/openedx.js dev:shell",
27+
"dev:pack": "nodemon --config nodemon.pack.json",
2728
"docs": "jsdoc -c jsdoc.json",
2829
"docs:watch": "nodemon -w runtime -w docs/template -w README.md -e js,jsx,ts,tsx --exec npm run docs",
2930
"lint": "eslint .; npm run lint:tools; npm --prefix ./test-site run lint",
3031
"lint:tools": "cd ./tools && eslint . && cd ..",
31-
"test": "jest",
3232
"pack:local": "mkdir -p pack && npm pack --silent --pack-destination pack >/dev/null && mv \"$(ls -t pack/*.tgz | head -n 1)\" pack/openedx-frontend-base.tgz",
33-
"build:pack": "make build && npm run pack:local",
34-
"dev:pack": "nodemon --config nodemon.pack.json"
33+
"prepack": "npm run build",
34+
"test": "jest"
3535
},
3636
"repository": {
3737
"type": "git",

0 commit comments

Comments
 (0)