Skip to content

Commit

Permalink
Improve build (#329)
Browse files Browse the repository at this point in the history
This re-orders the npm scripts and makes use of pre- and post- scripts
to improve the structure of the build process.
Also rename the deploy script to build as this better reflects what it does.

Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 authored Apr 26, 2024
1 parent 6ee15f8 commit 4247b0b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci

- run: npm run deploy
- run: npm run build

- name: Publish Docs
if: github.ref == 'refs/heads/main'
Expand Down
2 changes: 1 addition & 1 deletion DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ We have a GitHub action which will publish this library automatically when a ver
Use the [npm version](https://docs.npmjs.com/cli/v9/commands/npm-version) command to bump the version, commit and tag:

```bash
npm run deploy # Perform tests, test JSDoc deployment, webpack build, update and test type definitions
npm run build # Perform a local build: Lint, run tests, bundle with webpack, update & test type definitions, build JSDoc
npm version [major | minor | patch] --no-git-tag-version # Select one of the commands
```

Expand Down
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@
"parse-duration": "^0.1.1"
},
"scripts": {
"test:mocha": "mocha test/**/*.test.js",
"test:jest": "jest --config test/jest.config.js",
"test": "npm run lint && npm run test:mocha && npm run test:jest",
"docs": "rm -Rf ./docs/* && jsdoc --configure build/jsdoc.conf.json",
"deploy": "npm test && npm run docs && npm run webpack && npm run types && npm run types:test",
"lint": "npx eslint src",
"lint:fix": "npx eslint --fix src",
"webpack": "webpack -c build/webpack.config.js && webpack -c build/@globals-webpack.config.js",
"pretest": "npm run lint",
"test:mocha": "mocha test/**/*.test.js",
"test:jest": "jest --config test/jest.config.js",
"test": "npm run test:mocha && npm run test:jest",
"types": "tsc --project ./build/tsconfig.json",
"types:test": "tsc --project ./build/tsconfig.test.json"
"types:test": "tsc --project ./build/tsconfig.test.json",
"webpack": "webpack -c build/webpack.config.js && webpack -c build/@globals-webpack.config.js",
"docs": "rm -Rf ./docs/* && jsdoc --configure build/jsdoc.conf.json",
"prebuild": "npm run test",
"build": "npm run webpack && npm run types && npm run types:test",
"postbuild": "npm run docs"
},
"devDependencies": {
"@types/jest": "^29.5.12",
Expand Down

0 comments on commit 4247b0b

Please sign in to comment.