Skip to content

Commit

Permalink
Add default “npm run build” for project
Browse files Browse the repository at this point in the history
Our default build is to prepare the review app for launch

1. Build `govuk-frontend` package
2. Build `govuk-frontend-review` assets
  • Loading branch information
colinrotherham committed Jun 1, 2023
1 parent 716d154 commit 596b797
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions docs/contributing/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ npm scripts are defined in `package.json`. These trigger a number of Gulp tasks.

**`npm start` will trigger `npm run dev` that will:**

- runs tasks from `npm run build:package`
- runs tasks from `npm run build:app`
- runs `npm run build`
- starts the review app, restarting when `.mjs`, `.json` or `.yaml` files change
- compile again when frontend `.mjs` and `.scss` files change

Expand All @@ -21,9 +20,10 @@ npm scripts are defined in `package.json`. These trigger a number of Gulp tasks.
- run JavaScript tests on the review app
- run accessibility and HTML validation tests

**`npm run serve --workspace govuk-frontend-review` will do the following:**
**`npm run build` will do the following:**

- start the review app, restarting when `.mjs`, `.json` or `.yaml` files change
- run tasks from `npm run build:package`
- run tasks from `npm run build:app`

**`npm run build:app` will trigger `npm run build --workspace govuk-frontend-review` that will:**

Expand Down Expand Up @@ -96,4 +96,4 @@ This task will:

## Review app only

To start the Express.js review app without Gulp tasks being triggered, run `npm run serve`.
After building the project with `npm run build` the Express.js review app can be started with `npm start --workspace govuk-frontend-review`. This prevents the Gulp tasks triggered by `npm start` from running.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@
"build-release": "./bin/build-release.sh",
"publish-release": "./bin/publish-release.sh",
"pre-release": "./bin/pre-release.sh",
"predev": "npm run build --workspace govuk-frontend",
"predev": "npm run build",
"dev": "concurrently \"npm run dev --workspace govuk-frontend-review\" \"npm run dev --workspace govuk-frontend\" --kill-others --names \"app,pkg\" --prefix-colors \"red.dim,blue.dim\"",
"build": "npm run build --workspace govuk-frontend --workspace govuk-frontend-review",
"build:app": "npm run build --workspace govuk-frontend-review",
"build:package": "npm run build:package --workspace govuk-frontend",
"build:release": "npm run build:release --workspace govuk-frontend",
"build:types": "tsc --build tsconfig.json tsconfig.build.json",
"postbuild:package": "jest --color --selectProjects \"Build tasks\" --testMatch \"**/*package.test*\"",
"postbuild:release": "jest --color --selectProjects \"Build tasks\" --testMatch \"**/*release.test*\"",
"heroku-postbuild": "npm run build --workspace govuk-frontend --workspace govuk-frontend-review",
"heroku-postbuild": "npm run build",
"postheroku-postbuild": "NPM_CONFIG_PRODUCTION=true npm ci --ignore-scripts --omit=optional --workspace govuk-frontend-review",
"pretest": "npm run build --workspace govuk-frontend --workspace govuk-frontend-review",
"pretest": "npm run build",
"test": "jest --color --ignoreProjects \"Build tasks\" --maxWorkers=50%",
"lint": "npm run lint:editorconfig && npm run lint:prettier && npm run lint:js && npm run lint:scss",
"lint:editorconfig": "npm run lint:editorconfig:cli",
Expand Down
1 change: 0 additions & 1 deletion packages/govuk-frontend-review/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
},
"license": "MIT",
"scripts": {
"predev": "npm run build",
"dev": "gulp dev --color",
"build": "gulp build --color",
"build:sassdoc": "sassdoc --config sassdoc.config.yaml ../govuk-frontend/src/govuk",
Expand Down

0 comments on commit 596b797

Please sign in to comment.