Skip to content

Commit

Permalink
Update package.jsons
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed Nov 3, 2024
1 parent b23f02e commit 4c2520d
Show file tree
Hide file tree
Showing 22 changed files with 128 additions and 94 deletions.
60 changes: 30 additions & 30 deletions bin/setup-bench.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -98,30 +98,6 @@ const EXPERIMENT_URL = `http://localhost:${EXPERIMENT_PORT}`;

// we can't do it in parallel on CI,

if (!REUSE_CONTROL) {
// setup control
await within(async () => {
await $`git fetch origin`;
const mainRef = await $`git rev-parse origin/main`;
await cd(CONTROL_DIR);
await $`git clone ${join(ROOT, '.git')} .`;
await $`git reset --hard ${mainRef}`;
await $`rm -rf ./benchmark`;
await $`cp -r ${BENCHMARK_FOLDER} ./benchmark`;

console.info(`$ pnpm install --no-frozen-lockfile ${chalk.gray('[control]')}`);

await $`pwd`;
await $`pnpm install --no-frozen-lockfile`;
await $`pnpm build`;

await rewritePackageJson();

await cd(CONTROL_BENCH_DIR);
await $`pnpm vite build`;
});
}

async function rewritePackageJson() {
const packages = await $`find ./packages/@glimmer -name 'package.json'`;

Expand All @@ -143,6 +119,13 @@ async function rewritePackageJson() {
}
}

console.info({
control: controlBranchName,
experiment: experimentRef,
EXPERIMENT_DIR,
CONTROL_DIR,
});

// setup experiment
await within(async () => {
await cd(EXPERIMENT_DIR);
Expand All @@ -161,12 +144,29 @@ await within(async () => {
await $`pnpm vite build`;
});

console.info({
control: controlBranchName,
experiment: experimentRef,
EXPERIMENT_DIR,
CONTROL_DIR,
});
if (!REUSE_CONTROL) {
// setup control
await within(async () => {
await $`git fetch origin`;
const mainRef = await $`git rev-parse origin/main`;
await cd(CONTROL_DIR);
await $`git clone ${join(ROOT, '.git')} .`;
await $`git reset --hard ${mainRef}`;
await $`rm -rf ./benchmark`;
await $`cp -r ${BENCHMARK_FOLDER} ./benchmark`;

console.info(`$ pnpm install --no-frozen-lockfile ${chalk.gray('[control]')}`);

await $`pwd`;
await $`pnpm install --no-frozen-lockfile`;
await $`pnpm build`;

await rewritePackageJson();

await cd(CONTROL_BENCH_DIR);
await $`pnpm vite build`;
});
}

// start build assets
$`cd ${CONTROL_BENCH_DIR} && pnpm vite preview --port ${CONTROL_PORT}`;
Expand Down
4 changes: 2 additions & 2 deletions packages/@glimmer/compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
"import": "./dist/dev/index.js"
},
"require": "./dist/dev/index.cjs",
"import": "./dist/dev/index.js"
"import": "./dist/prod/index.js"
}
},
"main": null,
"module": "dist/dev/index.js"
"module": "dist/prod/index.js"
},
"files": [
"dist"
Expand Down
20 changes: 0 additions & 20 deletions packages/@glimmer/constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,6 @@
"type": "module",
"main": "index.ts",
"types": "index.ts",
"publishConfig": {
"access": "public",
"types": "dist/dev/index.d.ts",
"exports": {
".": {
"types": "./dist/dev/index.d.ts",
"development": {
"require": "./dist/dev/index.cjs",
"import": "./dist/dev/index.js"
},
"require": "./dist/dev/index.cjs",
"import": "./dist/prod/index.js"
}
},
"main": null,
"module": "dist/dev/index.js"
},
"files": [
"dist"
],
"scripts": {
"test:lint": "eslint .",
"test:publint": "publint",
Expand Down
20 changes: 0 additions & 20 deletions packages/@glimmer/debug-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,6 @@
"main": "index.ts",
"types": "index.ts",
"module": "index.ts",
"publishConfig": {
"access": "public",
"types": "dist/dev/index.d.ts",
"exports": {
".": {
"types": "./dist/dev/index.d.ts",
"development": {
"require": "./dist/dev/index.cjs",
"import": "./dist/dev/index.js"
},
"require": "./dist/dev/index.cjs",
"import": "./dist/prod/index.js"
}
},
"main": null,
"module": "dist/dev/index.js"
},
"files": [
"dist"
],
"scripts": {
"test:lint": "eslint .",
"test:publint": "publint",
Expand Down
3 changes: 0 additions & 3 deletions packages/@glimmer/debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"type": "module",
"main": "index.ts",
"types": "index.ts",
"files": [
"dist"
],
"scripts": {
"test:lint": "eslint .",
"test:types": "tsc --noEmit -p ../tsconfig.json"
Expand Down
7 changes: 6 additions & 1 deletion packages/@glimmer/destroyable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"type": "module",
"main": "index.ts",
"types": "index.ts",
"exports": {
"types": "./index.ts",
"development": "./index.ts",
"import": "./dist/prod/index.js"
},
"publishConfig": {
"access": "public",
"types": "dist/dev/index.d.ts",
Expand All @@ -20,7 +25,7 @@
}
},
"main": null,
"module": "dist/dev/index.js"
"module": "dist/prod/index.js"
},
"files": [
"dist"
Expand Down
7 changes: 6 additions & 1 deletion packages/@glimmer/encoder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"type": "module",
"main": "index.ts",
"types": "index.ts",
"exports": {
"types": "./index.ts",
"development": "./index.ts",
"import": "./dist/prod/index.js"
},
"publishConfig": {
"access": "public",
"types": "dist/dev/index.d.ts",
Expand All @@ -21,7 +26,7 @@
}
},
"main": null,
"module": "dist/dev/index.js"
"module": "dist/prod/index.js"
},
"files": [
"dist"
Expand Down
7 changes: 6 additions & 1 deletion packages/@glimmer/global-context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"type": "module",
"main": "index.ts",
"types": "index.ts",
"exports": {
"types": "./index.ts",
"development": "./index.ts",
"import": "./dist/prod/index.js"
},
"publishConfig": {
"access": "public",
"types": "./dist/dev/index.d.ts",
Expand All @@ -21,7 +26,7 @@
}
},
"main": null,
"module": "dist/dev/index.js"
"module": "dist/prod/index.js"
},
"files": [
"dist"
Expand Down
3 changes: 0 additions & 3 deletions packages/@glimmer/interfaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
"exports": {
"types": "./index.d.ts"
},
"publishConfig": {
"access": "public"
},
"files": [
"lib",
"index.d.ts"
Expand Down
7 changes: 6 additions & 1 deletion packages/@glimmer/manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"type": "module",
"main": "index.ts",
"types": "index.ts",
"exports": {
"types": "./index.ts",
"development": "./index.ts",
"import": "./dist/prod/index.js"
},
"publishConfig": {
"access": "public",
"types": "dist/dev/index.d.ts",
Expand All @@ -21,7 +26,7 @@
}
},
"main": null,
"module": "dist/dev/index.js"
"module": "dist/prod/index.js"
},
"files": [
"dist"
Expand Down
7 changes: 6 additions & 1 deletion packages/@glimmer/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"type": "module",
"main": "index.ts",
"types": "index.ts",
"exports": {
"types": "./index.ts",
"development": "./index.ts",
"import": "./dist/prod/index.js"
},
"publishConfig": {
"access": "public",
"types": "dist/dev/index.d.ts",
Expand All @@ -21,7 +26,7 @@
}
},
"main": null,
"module": "dist/dev/index.js"
"module": "dist/prod/index.js"
},
"files": [
"dist"
Expand Down
7 changes: 6 additions & 1 deletion packages/@glimmer/opcode-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"type": "module",
"main": "index.ts",
"types": "index.ts",
"exports": {
"types": "./index.ts",
"development": "./index.ts",
"import": "./dist/prod/index.js"
},
"publishConfig": {
"access": "public",
"types": "dist/dev/index.d.ts",
Expand All @@ -21,7 +26,7 @@
}
},
"main": null,
"module": "dist/dev/index.js"
"module": "dist/prod/index.js"
},
"files": [
"dist"
Expand Down
7 changes: 6 additions & 1 deletion packages/@glimmer/owner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"type": "module",
"main": "index.ts",
"types": "index.ts",
"exports": {
"types": "./index.ts",
"development": "./index.ts",
"import": "./dist/prod/index.js"
},
"publishConfig": {
"access": "public",
"types": "dist/dev/index.d.ts",
Expand All @@ -22,7 +27,7 @@
}
},
"main": null,
"module": "dist/dev/index.js"
"module": "dist/prod/index.js"
},
"files": [
"dist"
Expand Down
7 changes: 6 additions & 1 deletion packages/@glimmer/program/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"type": "module",
"main": "index.ts",
"types": "index.ts",
"exports": {
"types": "./index.ts",
"development": "./index.ts",
"import": "./dist/prod/index.js"
},
"publishConfig": {
"access": "public",
"types": "dist/dev/index.d.ts",
Expand All @@ -21,7 +26,7 @@
}
},
"main": null,
"module": "dist/dev/index.js"
"module": "dist/prod/index.js"
},
"files": [
"dist"
Expand Down
7 changes: 6 additions & 1 deletion packages/@glimmer/reference/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"type": "module",
"main": "index.ts",
"types": "index.ts",
"exports": {
"types": "./index.ts",
"development": "./index.ts",
"import": "./dist/prod/index.js"
},
"publishConfig": {
"access": "public",
"types": "dist/dev/index.d.ts",
Expand All @@ -26,7 +31,7 @@
}
},
"main": null,
"module": "dist/dev/index.js"
"module": "dist/prod/index.js"
},
"files": [
"dist"
Expand Down
7 changes: 6 additions & 1 deletion packages/@glimmer/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"type": "module",
"main": "index.ts",
"types": "index.ts",
"exports": {
"types": "./index.ts",
"development": "./index.ts",
"import": "./dist/prod/index.js"
},
"publishConfig": {
"access": "public",
"types": "dist/dev/index.d.ts",
Expand All @@ -20,7 +25,7 @@
}
},
"main": null,
"module": "dist/dev/index.js"
"module": "dist/prod/index.js"
},
"files": [
"dist"
Expand Down
7 changes: 6 additions & 1 deletion packages/@glimmer/syntax/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"type": "module",
"main": "index.ts",
"types": "index.ts",
"exports": {
"types": "./index.ts",
"development": "./index.ts",
"import": "./dist/prod/index.js"
},
"publishConfig": {
"access": "public",
"types": "dist/dev/index.d.ts",
Expand All @@ -21,7 +26,7 @@
}
},
"main": null,
"module": "dist/dev/index.js"
"module": "dist/prod/index.js"
},
"files": [
"dist"
Expand Down
Loading

0 comments on commit 4c2520d

Please sign in to comment.