Skip to content
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

Switch from Lerna+Yarn to Rush+pnpm #730

Merged
merged 32 commits into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c04e368
Adding Rush
dtinth Oct 28, 2021
5eae95a
Add Prettier autoinstaller
dtinth Oct 28, 2021
ae6d7fb
Rename to bemuse-linter
dtinth Oct 28, 2021
9466c70
Add lint command
dtinth Oct 28, 2021
f4edd10
Change "prepare" script to "build"
dtinth Oct 28, 2021
aa408a4
Make sure all subprojects are building properly (except bemuse)
dtinth Oct 28, 2021
565d33c
Make bemuse buildable in Rush
dtinth Oct 28, 2021
0498b7c
Make website project buildable
dtinth Oct 28, 2021
8ae769a
Remove Yarn and root package json
dtinth Oct 28, 2021
6811d9f
Make Danger run
dtinth Oct 28, 2021
e51ebbb
Fix testing
dtinth Oct 28, 2021
89491ee
Allow test warnings
dtinth Oct 28, 2021
9c12ffd
To typecheck dependencies would have to be built
dtinth Oct 28, 2021
334cae3
Fix native promise not having Bluebird methods
dtinth Oct 29, 2021
bb93d3c
Fix lint
dtinth Oct 29, 2021
0d602c4
Fix build script
dtinth Oct 29, 2021
ea59b40
Add e2e
dtinth Oct 29, 2021
dec70e6
Apparently `rush install` doesn’t support filtering
dtinth Oct 29, 2021
895f30c
Upgrade Node version
dtinth Oct 29, 2021
2a6ef34
Use available Node image
dtinth Oct 29, 2021
47baf52
Use `node common/scripts/install-run-rush.js` instead of `rush`
dtinth Oct 29, 2021
b2231e3
Fix type errors
dtinth Oct 29, 2021
102293e
Silence warnings in build scripts for now
dtinth Oct 29, 2021
970f941
Update Gitpod and VSCode config
dtinth Oct 29, 2021
b548be5
Update developer guide to use Rush instead of Yarn
dtinth Oct 29, 2021
11875d4
Remove Yarn config
dtinth Oct 29, 2021
6e99da5
Remove Lerna config
dtinth Oct 29, 2021
d7927ea
Update README to use Rush instead of Yarn
dtinth Oct 29, 2021
108ccec
Add format-readme command
dtinth Oct 29, 2021
9b920ea
Update Netlify config
dtinth Oct 29, 2021
837533e
Add change files
dtinth Oct 29, 2021
64d7e8e
Add netlify.toml
dtinth Oct 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 13 additions & 31 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,27 @@
version: 2
references:
restore_node_modules_cache: &restore_node_modules_cache
restore_cache:
keys:
- deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
- deps-{{ .Branch }}-
- deps-
bootstrap: &bootstrap
run:
name: lerna bootstrap
command: lerna bootstrap && lerna run prepare
save_node_modules_cache: &save_node_modules_cache
save_cache:
key: deps-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- ./packages/bemuse-indexer/node_modules
- ./packages/bemuse-notechart/node_modules
- ./packages/bemuse-tools/node_modules
- ./packages/bms/node_modules
- ./packages/bmson/node_modules
jobs:
build:
working_directory: ~/bemuse
environment:
FORCE_COLOR: '1'
docker:
- image: circleci/node:16.3.0-browsers
- image: circleci/node:16.12.0-browsers
steps:
- run: sudo npm i -g lerna
- checkout
- add_ssh_keys
- *restore_node_modules_cache
- *bootstrap
- *save_node_modules_cache
- run:
name: install deps
command: |
node common/scripts/install-run-rush.js install
- run:
name: build
command: |
rm -rf dist
node build-scripts build
- run:
name: checks
command: yarn pre-deploy
command: |
node build-scripts pre-deploy
- run:
name: deploy
command: |
Expand All @@ -58,19 +38,21 @@ jobs:
root: .
paths:
- dist
- node_modules
- e2e/node_modules
e2e:
working_directory: ~/bemuse
environment:
FORCE_COLOR: '1'
SCREENSHOT_DIR: /tmp/bemuse-e2e-screenshot
docker:
- image: circleci/node:16.3.0-browsers
- image: circleci/node:16.12.0-browsers
steps:
- checkout
- attach_workspace:
at: .
- run:
name: install deps
command: |
node common/scripts/install-run-rush.js install
- run:
name: Install HTTP server
command: |
Expand All @@ -85,7 +67,7 @@ jobs:
command: |
cd e2e
mkdir -p "$SCREENSHOT_DIR"
env BEMUSE_PORT=8089 yarn prescript tests/Gameplay-test.js
env BEMUSE_PORT=8089 npx prescript tests/Gameplay-test.js
no_output_timeout: 1m
- store_artifacts:
path: /tmp/bemuse-e2e-screenshot
Expand Down
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
**/dist/**/*
**/build/**/*
**/coverage/**/*
**/common/scripts/**/*
**/temp/**/*
**/tmp/**/*
**/.yarn/**/*
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,18 @@
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

# Don't allow people to merge changes to these generated files, because the result
# may be invalid. You need to run "rush update" again.
pnpm-lock.yaml merge=binary
shrinkwrap.yaml merge=binary
npm-shrinkwrap.json merge=binary
yarn.lock merge=binary

# Rush's JSON config files use JavaScript-style code comments. The rule below prevents pedantic
# syntax highlighters such as GitHub's from highlighting these comments as errors. Your text editor
# may also require a special configuration to allow comments in JSON.
#
# For more information, see this issue: https://github.com/microsoft/rushstack/issues/1088
#
*.json linguist-language=JSON-with-Comments
24 changes: 16 additions & 8 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Install Deps
run: yarn install && yarn lerna run prepare
run: node common/scripts/install-run-rush.js install
- name: Lint
run: yarn danger ci
run: node common/scripts/install-run-rush.js danger-ci
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Type Check
run: yarn workspace bemuse tsc
- name: Build dependencies
run: node common/scripts/install-run-rush.js build --to-except bemuse
- name: Typecheck
run: node ../common/scripts/install-run-rushx.js typecheck
working-directory: bemuse
test:
runs-on: ubuntu-latest
steps:
Expand All @@ -38,9 +41,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Install Deps
run: yarn install && yarn lerna run prepare
run: node common/scripts/install-run-rush.js install
- name: Build
run: node common/scripts/install-run-rush.js build --to-except bemuse
- name: Test
run: yarn test
run: node ../common/scripts/install-run-rushx.js test
working-directory: bemuse
- uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -53,9 +59,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Install Deps
run: yarn install && yarn lerna run prepare
run: node common/scripts/install-run-rush.js install
- name: Build
run: node common/scripts/install-run-rush.js build --to-except bemuse
- name: Test Packages
run: yarn lerna run test
run: node common/scripts/install-run-rush.js test --to-except bemuse
- uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ Icon
/.otto/
/packages/*/lib/
.nyc_output

# Rush temporary files
common/deploy/
common/temp/
common/autoinstallers/*/.npmrc
**/.rush/temp/
6 changes: 4 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
tasks:
- init: nvm i && yarn && yarn lerna run prepare
command: nvm i && yarn start
- init: |
npm install --global @microsoft/rush && rush install && rush build --to-except bemuse
command: |
rush dev
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.3.0
16.13.0
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
**/node_modules/**/*
**/public/**/*
**/vendor/**/*
**/lib/**/*
**/dist/**/*
**/build/**/*
**/coverage/**/*
**/.nyc_output/**/*
**/.yarn/**/*
common/changes/**/*
common/temp/**/*
common/scripts/**/*
common/config/**/*
pnpm-lock.yaml
yarn.lock
package-lock.json
shrinkwrap.json
**/*.md
26 changes: 15 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,19 @@
"editor.formatOnSave": true,
"cSpell.words": [
"AGPL",
"BGAs",
"Bemuse's",
"Browserslist",
"Bugfixes",
"Cachier",
"IIDX",
"IPFS",
"JKOC",
"METTATUNES",
"Pangsakulyanont",
"autoinstaller",
"autoplay",
"baconjs",
"Bemuse's",
"bemusegame",
"bemusic",
"BGAs",
"bmson",
"bmspec",
"Browserslist",
"bson",
"Bugfixes",
"Cachier",
"chardet",
"codebases",
"codecov",
Expand All @@ -39,7 +35,10 @@
"gameplay",
"gmail",
"hardcoded",
"IIDX",
"interop",
"IPFS",
"JKOC",
"joezeng",
"kbps",
"keycode",
Expand All @@ -50,12 +49,14 @@
"keytime",
"laggy",
"lerna",
"METTATUNES",
"module",
"monorepo",
"netlify",
"notechart",
"notecharts",
"objectid",
"Pangsakulyanont",
"pegjs",
"pixi",
"pixijs",
Expand All @@ -80,5 +81,8 @@
"updeep",
"workspaces"
],
"eslint.enable": true
"eslint.enable": true,
"search.exclude": {
"**/.yarn": true
}
}
3 changes: 3 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"label": "Run Bemuse development server",
"type": "npm",
"script": "start",
"options": {
"cwd": "${workspaceFolder}/bemuse"
},
"group": {
"kind": "build",
"isDefault": true
Expand Down
Loading