-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default “npm run build” for project (with docs updates) #3725
Conversation
51277a1
to
d6915b8
Compare
d6915b8
to
7a071e4
Compare
"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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our default build is to prepare the review app for launch
- Build
govuk-frontend
package - Build
govuk-frontend-review
assets
But notice that the webpack example isn't included? For GitHub Actions Tests we instead run:
run: npm run build --workspaces --if-present |
By adding a new npm run build
we can run it before key scripts
E.g. Ensuring we have the govuk-frontend
package built before we import it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion Would it be worth invoking build:app
and build:package
here via concurrently
rather than use npm
to limit risks of the commands diverging if we update them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@romaricpascal Ah we can't I'm afraid, review app relies on govuk-frontend/dist/**
things
Any thoughts on using npm run build
(default) versus npm run build:package
(named)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's narrow it down when we add the stats package (also needs pre-building) in:
7a071e4
to
55f3c63
Compare
6e1e68f
to
f76fdbc
Compare
Or in full the “Express.js review app”
Our default build is to prepare the review app for launch 1. Build `govuk-frontend` package 2. Build `govuk-frontend-review` assets
55f3c63
to
596b797
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, especially in anticipation of building the stats. Just a little suggestion to reuse the existing tasks for avoiding future divergence, but I'm fine if it goes as is 😊
"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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion Would it be worth invoking build:app
and build:package
here via concurrently
rather than use npm
to limit risks of the commands diverging if we update them?
Our tasks.md docs talk about serving the review app directly with:
But we didn't explain that an MVB™ (minimum viable build 😆) was needed first:
npm run build:package
build Rollup stats YAML usingnpm run build:stats
in #3681npm run build:app
This PR adds a convenient
npm run build
script to solve this problem and was split out from: