Skip to content

Commit

Permalink
refactor(scripts): rename prepare-build to build:prepare (#6177)
Browse files Browse the repository at this point in the history
Co-authored-by: Schalk Neethling <[email protected]>
  • Loading branch information
caugner and Schalk Neethling authored May 6, 2022
1 parent 0890e01 commit c2b7cd5
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ jobs:
# Info about which CONTENT_* environment variables were set and to what.
echo "CONTENT_ROOT=$CONTENT_ROOT"
echo "CONTENT_TRANSLATED_ROOT=$CONTENT_TRANSLATED_ROOT"
yarn prepare-build
yarn build:prepare
# (July 15, 2021) This is a temporary solution. This should become an
# integrated part of 'prepare-build'.
# integrated part of 'build:prepare'.
# See https://github.com/mdn/yari/issues/4217
yarn tool popularities
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/developing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
# the content if loading this page fails.
ls "$CONTENT_ROOT/en-us/mdn/kitchensink"
yarn prepare-build
yarn build:prepare
yarn start > /tmp/stdout.log 2> /tmp/stderr.log &
- name: Wait for servers
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ jobs:
# whoami endpoint.
REACT_APP_DISABLE_AUTH: true

# The 'yarn prepare-build' command is going to try to build up a
# The 'yarn build:prepare' command is going to try to build up a
# file for the git history so it can have an index of each files.
# This makes sense in most of the cases where you have a CONTENT_ROOT
# which you'll want to build. But the CONTENT_ROOT can't be empty
# so you have to set it to something. So let's (ab)use the content
# we use for the end-to-end testing.
CONTENT_ROOT: testing/content/files
run: |
yarn prepare-build
yarn build:prepare
- name: Dry-run publish to see which files are included
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-published-simulation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
REACT_APP_DISABLE_AUTH: true
CONTENT_ROOT: testing/content/files
run: |
yarn prepare-build
yarn build:prepare
- name: Build and install tarball
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
# Google Analytics tag which is most realistic.
BUILD_GOOGLE_ANALYTICS_ACCOUNT: UA-00000000-0
run: |
yarn prepare-build
yarn build:prepare
# BUILD_FOLDERSEARCH=mdn/kitchensink yarn build
BUILD_FOLDERSEARCH=web/javascript/reference/global_objects/array/foreach yarn build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prod-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ jobs:
echo "CONTENT_ROOT=$CONTENT_ROOT"
echo "CONTENT_TRANSLATED_ROOT=$CONTENT_TRANSLATED_ROOT"
yarn build:sw
yarn prepare-build
yarn build:prepare
# (July 15, 2021) This is a temporary solution. This should become an
# integrated part of 'prepare-build'.
# integrated part of 'build:prepare'.
# See https://github.com/mdn/yari/issues/4217
yarn tool popularities
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ jobs:
echo "CONTENT_TRANSLATED_ROOT=$CONTENT_TRANSLATED_ROOT"
# Build the ServiceWorker first
yarn build:sw
yarn prepare-build
yarn build:prepare
# (July 15, 2021) This is a temporary solution. This should become an
# integrated part of 'prepare-build'.
# integrated part of 'build:prepare'.
# See https://github.com/mdn/yari/issues/4217
yarn tool popularities
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ jobs:
ENV_FILE: testing/.env
run: |
# because `yarn prepare-build` is a wrapper for `yarn build:client` and
# because `yarn build:prepare` is a wrapper for `yarn build:client` and
# `yarn build:client` can't respect the `$ENV_FILE` environment variable,
# because it has to build from the `./client/` directory, we have to
# manually copy the `testing/.env` file into `client/` so that when
# `yarn build:client` runs, it gets the same environment variables
# as you'd get when doing `yarn build:ssr`.
cp testing/.env client/
yarn prepare-build
yarn build:prepare
yarn build
yarn start:static-server > /tmp/stdout.log 2> /tmp/stderr.log &
Expand Down
2 changes: 1 addition & 1 deletion docs/npm-packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ First of all, make you relevant edits in `~/yari` then run:

export REACT_APP_DISABLE_AUTH=true
export REACT_APP_CRUD_MODE=true
yarn prepare-build
yarn build:prepare
echo .git/info/exclude >> .npmignore
echo .env >> .npmignore
npm pack
Expand Down
2 changes: 1 addition & 1 deletion docs/spas.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To build these you run:
yarn tool spas
```

The SPAs are also built when running `yarn prepare-build` or `yarn start`.
The SPAs are also built when running `yarn build:prepare` or `yarn start`.

Below we describe each SPA and this is a work in progress.

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"analyze:css": "source-map-explorer 'client/build/static/css/*.css'",
"build": "cross-env NODE_ENV=production node build/cli.js",
"build:client": "cd client && cross-env INLINE_RUNTIME_CHUNK=false react-scripts build",
"build:prepare": "yarn build:client && yarn build:ssr && yarn tool optimize-client-build && yarn tool google-analytics-code && yarn tool popularities && yarn tool spas && yarn tool gather-git-history && yarn tool build-robots-txt",
"build:ssr": "cd ssr && webpack --mode=production",
"build:sw": "cd client/pwa && yarn && yarn build:prod",
"build:sw-dev": "cd client/pwa && yarn && yarn build",
"dev": "yarn prepare-build && nf -j Procfile.dev start",
"dev": "yarn build:prepare && nf -j Procfile.dev start",
"eslint": "eslint .",
"filecheck": "cd filecheck && node cli.js",
"md": "ts-node markdown/cli.ts",
"prepare": "husky install",
"prepare-build": "yarn build:client && yarn build:ssr && yarn tool optimize-client-build && yarn tool google-analytics-code && yarn tool popularities && yarn tool spas && yarn tool gather-git-history && yarn tool build-robots-txt",
"prettier-check": "prettier --check .",
"prettier-format": "prettier --write .",
"start": "(test -f client/build/index.html || yarn build:client) && (test -f ssr/dist/main.js || yarn build:ssr) && (test -d client/build/en-us/_spas || yarn tool spas) && nf -j Procfile.start start",
Expand All @@ -32,7 +32,7 @@
"test:developing": "playwright test developing",
"test:headless": "playwright test headless",
"test:kumascript": "jest kumascript --env=node",
"test:prepare": "yarn prepare-build && yarn build && yarn start:static-server",
"test:prepare": "yarn build:prepare && yarn build && yarn start:static-server",
"test:testing": "jest --rootDir testing",
"tool": "node tool/cli.js",
"traits:build": "cd traits && node cli.js",
Expand Down
2 changes: 1 addition & 1 deletion testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To run these tests, first run:

```sh
export ENV_FILE=testing/.env
yarn prepare-build
yarn build:prepare
yarn build
yarn start:static-server
```
Expand Down
2 changes: 1 addition & 1 deletion testing/scripts/functional-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e

export ENV_FILE=testing/.env

yarn prepare-build
yarn build:prepare
yarn build

yarn test:testing $@

0 comments on commit c2b7cd5

Please sign in to comment.