Skip to content

Commit 3f2be97

Browse files
runspiredgitKrystan
authored andcommitted
chore: make diagnostic shutdown safer, use bun for holodeck server (#9705)
* refactor diagnostic for safer teardown * make holodeck cleanup appropriately * fix request test and improve diagnostic a little bit * fix more tests * cleanup config * cleanup dependencies for fastboot scenario * fix types * fixup more tests * fixup more tests * dont launch holodeck for main test app (yet) * ensure less noise in CI * some improvements * a new approach * attempt no sync * use internal sync * more cleanup * fix sync * fix install * fix more missing peers * more vite cleanup * fix more tests, make diagnostic easier to launch * disable caching * try something * fix no-cache * fix missing testem * try fastboot again * cleanup * cleanup * try * updated lockfile with new npmrc settings * fixup comment * fixup fastboot * fix prod tests * restore settings * fix deprecation test * make nicer? * keep some changes * fix it * fix newline * dont use turbo * fixup more commands? * maybe * fixup * still use exec * fix scneario * update npmrc text * fix quote mark
1 parent 91c6d50 commit 3f2be97

File tree

93 files changed

+2287
-1997
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2287
-1997
lines changed

.github/actions/setup/action.yml

+5
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ runs:
101101
sudo apt install libnss3-tools
102102
brew install mkcert
103103
104+
- name: 'Setup DBus for Chrome'
105+
shell: bash
106+
run: |
107+
echo "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus" >> $GITHUB_ENV
108+
104109
- name: Configure Parallel Builds
105110
if: ${{ inputs.parallel-build == 'true' }}
106111
shell: bash

.github/workflows/compat-tests.yml

+18-12
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,24 @@ jobs:
5454
repo-token: ${{ secrets.GITHUB_TOKEN }}
5555
- name: Run Tests
5656
run: pnpm test:vite
57-
floating-dependencies:
58-
timeout-minutes: 9
59-
runs-on: ubuntu-latest
60-
steps:
61-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
62-
- uses: ./.github/actions/setup
63-
with:
64-
repo-token: ${{ secrets.GITHUB_TOKEN }}
65-
- name: Install dependencies w/o lockfile
66-
run: pnpm install --no-lockfile
67-
- name: Basic Tests
68-
run: pnpm test
57+
###
58+
# This Test No Longer Works Because pnpm install --no-lockfile
59+
# returns exit code 1 whenever there is a lockfile present and
60+
# changes are made to node_modules. This is probably a bug in pnpm.
61+
###
62+
#
63+
# floating-dependencies:
64+
# timeout-minutes: 9
65+
# runs-on: ubuntu-latest
66+
# steps:
67+
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
68+
# - uses: ./.github/actions/setup
69+
# with:
70+
# repo-token: ${{ secrets.GITHUB_TOKEN }}
71+
# - name: Install dependencies w/o lockfile
72+
# run: pnpm install --no-lockfile
73+
# - name: Basic Tests
74+
# run: pnpm test
6975
node-version-test:
7076
name: Use Node.js ${{ matrix.node-version }}
7177
timeout-minutes: 10

.github/workflows/main.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,11 @@ jobs:
174174
timeout-minutes: 12
175175
env:
176176
CI: true
177-
run: pnpm test:try-one ${{ matrix.scenario }} -- ember test --test-port=0
177+
run: |
178+
cd tests/main;
179+
pnpm exec ember try:one ${{ matrix.scenario }} --skip-cleanup;
180+
pnpm build:tests;
181+
pnpm run test;
178182
179183
releases:
180184
timeout-minutes: 12
@@ -201,4 +205,8 @@ jobs:
201205
- name: Basic tests with ${{ matrix.release }}
202206
env:
203207
CI: true
204-
run: pnpm test:try-one ${{ matrix.release }} -- ember test --test-port=0
208+
run: |
209+
cd tests/main;
210+
pnpm exec ember try:one ${{ matrix.release }} --skip-cleanup;
211+
pnpm build:tests;
212+
pnpm run test;

.npmrc

+150-25
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,156 @@
1-
# package-import-method=hardlink
2-
# module-exists will report false answers for the test apps
3-
# unless we avoid hoisting
4-
# while this is "true" this actually sets hoisting to "false"
5-
# because we have a hoist-pattern. This basically just lets us
6-
# use the very narrowly scoped hoist-pattern.
7-
hoist=true
8-
# Fastboot Doesnt respect node_modules resolution for whitelisted deps
9-
# https://github.com/ember-fastboot/ember-cli-fastboot/issues/901
10-
hoist-pattern[]=*node-fetch*
11-
12-
# we want true but cannot use true until the below issue is fixed
13-
# https://github.com/pnpm/pnpm/issues/5340
14-
strict-peer-dependencies=true
15-
auto-install-peers=false # probably apps should set this to true, but we need to test with it false to be sure we aren't the bad citizen
16-
dedupe-peer-dependents=false # this currently introduces more bugs than it fixes
17-
resolve-peers-from-workspace-root=false # if its not declared we don't want it resolved: ensure tests are truly isolated
1+
## Woo! A Config File!
2+
##
3+
## This file is used to configure the behavior of pnpm.
4+
## If adjusting settings, please document the "why" in comments.
5+
##
6+
## It may also be good to understand that we intentionally are
7+
## not using `hoisting` and using `injected` workspace packages
8+
## to ensure properly isolated dep trees for test apps.
9+
#
10+
## things like `moduleExists` from @embroider/macros will report false answers
11+
## for the test apps unless we avoid hoisting.
12+
##
13+
## Note, if we ever need to hoist something, we can use hoist-pattern[]=""
14+
## For instance: hoist-pattern[]=*node-fetch*
15+
## to hoist the specific thing we need and set this to `true`. When true
16+
## and a hoist-pattern is present only the hoist-pattern will be hoisted.
17+
#
18+
hoist=false
19+
20+
## We should consider removing these
21+
## But historically this was the default for pnpm
22+
## and there is cleanup to do to make things work
23+
## without these
24+
## Its also just useful to have these tools top-level
25+
#
26+
public-hoist-pattern[]=*eslint*
27+
public-hoist-pattern[]=*prettier*
28+
29+
## Ideally this would be dynamic as in CI we only have 4 CPUs
30+
## While locally we have 10-16 CPUs. The more CPUs we use during
31+
## install, generally the faster the install will be.
32+
##
33+
child-concurrency=10
34+
35+
## This is the default but its good to be explicit
36+
## This helps us to ensure we are using the workspace
37+
## version of a package.
38+
##
1839
save-workspace-protocol=rolling
40+
41+
## The current default is "highest" but we want to be explicit
42+
## Since we also just want to ensure we are always using the
43+
## latest versions of things we can.
44+
##
1945
resolution-mode=highest
20-
dedupe-direct-deps=true
21-
child-concurrency=10
22-
ignore-dep-scripts=true
23-
dedupe-injected-deps=false
24-
link-workspace-packages=deep
25-
hoist-workspace-packages=false
46+
47+
## This is documented in a slightly different place in the pnpm
48+
## docs. If this setting is true (the default) then pnpm will
49+
## run the pre* and post* versions of a script when running other
50+
## scripts. For instance running "build" would also run "prebuild"
51+
## and "postbuild". This is not the behavior we want.
52+
##
2653
enable-pre-post-scripts=false
54+
55+
## We use volta to manage our node and pnpm versions, so we do not
56+
## want pnpm to manage these for us.
57+
##
2758
manage-package-manager-versions=false
59+
60+
## This is now the default but we want to be explicit
61+
## This prevents security exploits from packages running
62+
## arbitrary code during install. It also speeds up install times.
63+
## Our own packages will still run their installation scripts
64+
##
65+
ignore-dep-scripts=true
66+
67+
## Make sure we don't troll ourselves when updating deps
68+
##
69+
verify-deps-before-run=true
70+
71+
## We do not want to auto-install peers because
72+
## We want to ensure we understand what is actually required
73+
## So that if a consuming app uses strict mode things will work
74+
##
75+
## This said, Apps should probably set this to true
76+
##
77+
auto-install-peers=false
78+
79+
## We want to error if we did not setup required peers correctly
80+
## However, this pnpm bug prevents us using this as it will
81+
## error when using `--no-lockfile` without reporting any errors
82+
## https://github.com/pnpm/pnpm/issues/8382
83+
##
84+
strict-peer-dependencies=false
85+
86+
## We use so many similarly grouped peers, we want to make the
87+
## peer-groups easier to distinguish.
88+
## This forces a shorter sha for all groups (vs the default of 1000)
89+
##
90+
peers-suffix-max-length=40
91+
virtual-store-dir-max-length=40
92+
93+
## If a dependency is not declared, we do not want to accidentally
94+
## resolve it from the workspace root. This is a common source of
95+
## bugs in monorepos.
96+
##
97+
resolve-peers-from-workspace-root=false
98+
99+
## Our Workspace Packages are "injected" so prevent
100+
## devDependencies from being exposed and to allow
101+
## for us to test optional peerDependencies.
102+
##
28103
inject-workspace-packages=true
29104

30-
public-hoist-pattern[]=*eslint*
31-
public-hoist-pattern[]=*prettier*
105+
## This also means we do not want to hoist them to the root
106+
## As this would both expose them to all other packages AND
107+
## results in them using symlinks instead of hardlinks
108+
##
109+
hoist-workspace-packages=false
110+
111+
## We use the `workspace:*` protocol for all workspace
112+
## packages.
113+
## In theory it would be nice to use `deep` here just in case
114+
## we missed something so that we could tell pnpm to use the
115+
## workspace version of a package if it exists. At any depth.
116+
##
117+
## However, it seems that deep/true result in workspace packages
118+
## that are dependencies being symlinked instead of hardlinked
119+
## more often, even at the top-level of a package, which is not
120+
## what we want.
121+
##
122+
link-workspace-packages=false # deep
123+
124+
## Update injected dependencies when needed
125+
## This will rerun after various "build" scripts
126+
## In our published packages.
127+
##
128+
## Unfortunately, this does not run after scripts in
129+
## the monorepo root, so we have added a special "sync"
130+
## script to handle this.
131+
##
132+
sync-injected-deps-after-scripts[]=build:pkg
133+
sync-injected-deps-after-scripts[]=build:infra
134+
sync-injected-deps-after-scripts[]=build:glint
135+
sync-injected-deps-after-scripts[]=sync
136+
137+
## In keeping with our "no hoisting" and "no auto-peers" and
138+
## "isolated dep trees", we also want to avoid other things
139+
## that lead to reliance on hoisting.
140+
## In general, deduping leads to hoisting. This particular
141+
## setting causes direct-dependencies to resolve from the
142+
## workspace root if already in root. We don't want this.
143+
##
144+
dedupe-direct-deps=false
145+
146+
## We do not want to dedupe peer dependencies as this
147+
## results in hoisting and violates optional peer isolation.
148+
##
149+
dedupe-peer-dependents=false
150+
151+
## We do not want to dedupe injected dependencies as this
152+
## results in hoisting and violates optional peer isolation.
153+
##
154+
dedupe-injected-deps=false
155+
156+
## Fin

package.json

+16-11
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,23 @@
99
},
1010
"scripts": {
1111
"takeoff": "FORCE_COLOR=2 pnpm install --prefer-offline --reporter=append-only",
12-
"prepare": "turbo run build:infra; pnpm --filter './packages/*' run --parallel --if-present sync-hardlinks; turbo run build:pkg; pnpm run prepare:types; pnpm run _task:sync-hardlinks;",
13-
"prepare:types": "tsc --build --force; turbo run build:glint;",
12+
"prepare": "export TURBO_FORCE=true; turbo run build:pkg; pnpm run prepare:types;",
13+
"prepare:types": "export TURBO_FORCE=true; tsc --build --force; turbo run build:glint;",
1414
"release": "./release/index.ts",
1515
"build": "turbo _build --log-order=stream --filter=./packages/* --concurrency=10;",
16-
"_task:sync-hardlinks": "pnpm run -r --parallel --if-present sync-hardlinks;",
16+
"sync": "pnpm --filter './packages/*' run --parallel --if-present sync",
1717
"build:docs": "mkdir -p packages/-ember-data/dist && cd ./docs-generator && node ./compile-docs.js",
1818
"lint:tests": "turbo --log-order=stream lint --filter=./tests/* --continue --concurrency=10",
1919
"lint:pkg": "turbo --log-order=stream lint --filter=./packages/* --continue --concurrency=10",
20-
"lint": "pnpm run _task:sync-hardlinks; turbo --log-order=stream lint --continue --concurrency=10",
21-
"lint:fix": "pnpm run _task:sync-hardlinks; turbo --log-order=stream lint --continue --concurrency=10 -- --fix",
20+
"lint": "turbo --log-order=stream lint --continue --concurrency=10",
21+
"lint:fix": "turbo --log-order=stream lint --continue --concurrency=10 -- --fix",
2222
"lint:prettier": "prettier --check --cache --cache-location=.prettier-cache --log-level=warn .",
2323
"lint:prettier:fix": "prettier --write --cache --cache-location=.prettier-cache --log-level=warn .",
2424
"preinstall": "npx only-allow pnpm",
2525
"check:test-types": "turbo --log-order=stream check:types --filter=./{tests,config}/* --continue --concurrency=10",
26-
"check:types": "pnpm run _task:sync-hardlinks; bun run check:test-types",
27-
"test": "pnpm run _task:sync-hardlinks; pnpm turbo test --concurrency=1",
28-
"test:production": "pnpm run _task:sync-hardlinks; pnpm turbo test:production --concurrency=1",
29-
"test:try-one": "pnpm --filter main-test-app run test:try-one",
26+
"check:types": "bun run check:test-types",
27+
"test": "pnpm turbo test --concurrency=1",
28+
"test:production": "pnpm turbo test:production --concurrency=1",
3029
"test:docs": "FORCE_COLOR=2 pnpm build:docs && pnpm run -r --workspace-concurrency=-1 --if-present --reporter=append-only --reporter-hide-prefix test:docs",
3130
"test:blueprints": "pnpm run -r --workspace-concurrency=-1 --if-present test:blueprints",
3231
"test:fastboot": "pnpm run -r --workspace-concurrency=-1 --if-present test:fastboot",
@@ -135,6 +134,13 @@
135134
"@glimmer/component": "*"
136135
}
137136
},
137+
"ember-exam": {
138+
"peerDependencies": {
139+
"ember-cli": "*",
140+
"ember-qunit": "*",
141+
"qunit": "*"
142+
}
143+
},
138144
"@ember/test-helpers": {
139145
"dependencies": {
140146
"webpack": "*"
@@ -174,8 +180,7 @@
174180
"testem@3.11.0": "patches/testem@3.11.0.patch",
175181
"@ember/test-helpers@3.3.0": "patches/@ember__test-helpers@3.3.0.patch",
176182
"@ember/test-helpers@4.0.4": "patches/@ember__test-helpers@4.0.4.patch",
177-
"@ember/test-helpers@5.1.0": "patches/@ember__test-helpers@5.1.0.patch",
178-
"pnpm-sync-dependencies-meta-injected": "patches/pnpm-sync-dependencies-meta-injected.patch"
183+
"@ember/test-helpers@5.1.0": "patches/@ember__test-helpers@5.1.0.patch"
179184
}
180185
}
181186
}

packages/-ember-data/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
"scripts": {
1818
"lint": "eslint . --quiet --cache --cache-strategy=content",
1919
"build:pkg": "vite build;",
20-
"prepack": "bun run build:pkg",
21-
"sync-hardlinks": "bun run sync-dependencies-meta-injected"
20+
"prepack": "pnpm run build:pkg"
2221
},
2322
"ember-addon": {
2423
"main": "addon-main.cjs",
@@ -113,7 +112,6 @@
113112
"@warp-drive/internal-config": "workspace:*",
114113
"ember-source": "~5.12.0",
115114
"eslint": "^9.12.0",
116-
"pnpm-sync-dependencies-meta-injected": "0.0.14",
117115
"vite": "^5.2.11",
118116
"typescript": "^5.7.2",
119117
"qunit": "^2.18.0"

packages/active-record/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"scripts": {
3737
"lint": "eslint . --quiet --cache --cache-strategy=content",
3838
"build:pkg": "vite build;",
39-
"prepack": "bun run build:pkg",
40-
"sync-hardlinks": "bun run sync-dependencies-meta-injected"
39+
"prepack": "pnpm run build:pkg",
40+
"sync": "echo \"syncing\""
4141
},
4242
"ember-addon": {
4343
"main": "addon-main.cjs",
@@ -65,7 +65,6 @@
6565
"@warp-drive/core-types": "workspace:*",
6666
"@warp-drive/internal-config": "workspace:*",
6767
"ember-source": "~5.12.0",
68-
"pnpm-sync-dependencies-meta-injected": "0.0.14",
6968
"vite": "^5.2.11",
7069
"typescript": "^5.7.2"
7170
},

packages/adapter/package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
"scripts": {
1717
"lint": "eslint . --quiet --cache --cache-strategy=content",
1818
"build:pkg": "vite build;",
19-
"prepack": "bun run build:pkg",
20-
"sync-hardlinks": "bun run sync-dependencies-meta-injected"
19+
"prepack": "pnpm run build:pkg"
2120
},
2221
"ember-addon": {
2322
"main": "addon-main.cjs",
@@ -80,7 +79,6 @@
8079
"@warp-drive/core-types": "workspace:*",
8180
"@warp-drive/internal-config": "workspace:*",
8281
"ember-source": "~5.12.0",
83-
"pnpm-sync-dependencies-meta-injected": "0.0.14",
8482
"typescript": "^5.7.2",
8583
"vite": "^5.2.11"
8684
},

packages/build-config/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"author": "Chris Thoburn <runspired@users.noreply.github.com>",
1616
"scripts": {
1717
"build:infra": "vite build; vite build -c ./vite.config-cjs.mjs;",
18-
"prepack": "bun run build:infra"
18+
"prepack": "pnpm run build:infra",
19+
"sync": "echo \"syncing\""
1920
},
2021
"type": "module",
2122
"files": [
@@ -54,7 +55,6 @@
5455
"@babel/plugin-transform-typescript": "^7.24.5",
5556
"@babel/preset-typescript": "^7.24.1",
5657
"@babel/core": "^7.24.5",
57-
"pnpm-sync-dependencies-meta-injected": "0.0.14",
5858
"typescript": "^5.7.2",
5959
"bun-types": "^1.2.2",
6060
"vite": "^5.2.11"

0 commit comments

Comments
 (0)