Skip to content

Commit 680caf9

Browse files
authored
Merge pull request #20590 from emberjs/yalc-shave
Restore a working linking setup for glimmer-vm packages
2 parents 069c970 + 758b71e commit 680caf9

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

bin/link-glimmer-vm-packages.mjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { readFileSync } from 'node:fs';
2+
import execa from 'execa';
3+
4+
const packageJsonPath = new URL('../package.json', import.meta.url).pathname;
5+
const packageJson = JSON.parse(await readFileSync(packageJsonPath, { encoding: 'utf8' }));
6+
7+
function shouldLink(dep) {
8+
return dep.startsWith('@glimmer/') && dep !== '@glimmer/component' && dep !== '@glimmer/env';
9+
}
10+
11+
for (const [dep] of Object.entries(packageJson.dependencies)) {
12+
if (shouldLink(dep)) {
13+
await execa('pnpm', ['link', '--global', dep], { stdio: 'inherit' });
14+
}
15+
}

broccoli/packages.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ function glimmerTrees(packageNames) {
225225
let pkg;
226226

227227
while ((pkg = queue.pop()) !== undefined) {
228-
if (seen.has(pkg)) {
228+
if (seen.has(pkg.name)) {
229229
continue;
230230
}
231-
seen.add(pkg);
231+
seen.add(pkg.name);
232232

233233
if (!pkg.name.startsWith('@glimmer/') && !pkg.name.startsWith('@simple-dom/')) {
234234
continue;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"build": "npm-run-all build:*",
3939
"docs": "ember ember-cli-yuidoc",
4040
"start": "ember serve",
41+
"link:glimmer-vm": "node bin/link-glimmer-vm-packages.mjs",
4142
"lint": "npm-run-all --continue-on-error --aggregate-output --parallel \"lint:!(fix)\"",
4243
"lint:docs": "qunit tests/docs/coverage-test.js",
4344
"lint:eslint": "eslint --report-unused-disable-directives --cache .",

0 commit comments

Comments
 (0)