Skip to content

Commit

Permalink
More bench fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed Nov 2, 2024
1 parent 36d541c commit c72b394
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions bin/setup-bench.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,23 @@ const EXPERIMENT_URL = `http://localhost:${EXPERIMENT_PORT}`;
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 fetch origin`;
await $`git checkout --force origin/${controlBranchName}`;
await $`git reset --hard ${mainRef}`;
await $`rm -rf ./benchmark`;
await $`cp -r ${BENCHMARK_FOLDER} ./benchmark`;

console.info(`$ pnpm install --frozen-lockfile ${chalk.gray('[control]')}`);
await spinner(async () => await $`pnpm install --no-frozen-lockfile`.pipe(process.stderr));
console.info(`$ pnpm install --no-frozen-lockfile ${chalk.gray('[control]')}`);

await $`pwd`;
const result = await $`pnpm install`;
console.log(result);

console.info(`$ pnpm build ${chalk.gray('[control]')}`);
await spinner(() => $`pnpm build`.pipe(process.stderr));

await $`pnpm build`;

if (isMacOs) {
await $`find ./packages -name 'package.json' -exec sed -i '' 's|"main": "index.ts",|"main": "./dist/prod/index.js","module": "./dist/prod/index.js",|g' {} \\;`;
Expand All @@ -133,7 +139,7 @@ await within(async () => {
await $`rm -rf ./benchmark`;
await $`cp -r ${BENCHMARK_FOLDER} ./benchmark`;

console.info(`$ pnpm install --frozen-lockfile ${chalk.gray('[experiment]')}`);
console.info(`$ pnpm install --no-frozen-lockfile ${chalk.gray('[experiment]')}`);
const install = () => $`pnpm install --no-frozen-lockfile`.pipe(process.stderr);
await spinner(install);
console.info(`$ pnpm build ${chalk.gray('[experiment]')}`);
Expand Down

0 comments on commit c72b394

Please sign in to comment.