From e3d02dbac11ae342cc4ad5df17759638e15e92d0 Mon Sep 17 00:00:00 2001 From: Eyejoker Date: Sat, 30 May 2026 00:18:33 +0900 Subject: [PATCH] fix: refresh root deps after runner build (#197) --- package.json | 2 +- src/deploy-script.test.ts | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6c16267..ed154a6 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "build:all": "bun run build && bun run dashboard:build && bun run build:runners", "build:runtime": "bun run build:all", "verify:dist": "bash scripts/check-dist-fresh.sh", - "deploy": "git pull --ff-only && bun install --frozen-lockfile && bun run build:all && bun run verify:dist && bun setup/index.ts --step migrate-room-registrations && systemctl --user restart ejclaw", + "deploy": "git pull --ff-only && bun install --frozen-lockfile && bun run build:all && bun install --frozen-lockfile && bun run verify:dist && bun setup/index.ts --step migrate-room-registrations && systemctl --user restart ejclaw", "start": "bun dist/index.js", "dev": "bun --watch src/index.ts", "test": "vitest run", diff --git a/src/deploy-script.test.ts b/src/deploy-script.test.ts index b05110f..5a0d3fa 100644 --- a/src/deploy-script.test.ts +++ b/src/deploy-script.test.ts @@ -7,7 +7,7 @@ type PackageJson = { }; describe('deploy script', () => { - it('refreshes root file dependencies after pulling before building', () => { + it('refreshes root file dependencies after pulling and after building shared dist', () => { const packageJson = JSON.parse( fs.readFileSync( path.resolve(import.meta.dirname, '../package.json'), @@ -17,11 +17,20 @@ describe('deploy script', () => { const deploy = packageJson.scripts?.deploy ?? ''; const pullIndex = deploy.indexOf('git pull --ff-only'); - const rootInstallIndex = deploy.indexOf('bun install --frozen-lockfile'); + const firstRootInstallIndex = deploy.indexOf( + 'bun install --frozen-lockfile', + ); const buildIndex = deploy.indexOf('bun run build:all'); + const secondRootInstallIndex = deploy.indexOf( + 'bun install --frozen-lockfile', + firstRootInstallIndex + 1, + ); + const verifyIndex = deploy.indexOf('bun run verify:dist'); expect(pullIndex).toBeGreaterThanOrEqual(0); - expect(rootInstallIndex).toBeGreaterThan(pullIndex); - expect(rootInstallIndex).toBeLessThan(buildIndex); + expect(firstRootInstallIndex).toBeGreaterThan(pullIndex); + expect(firstRootInstallIndex).toBeLessThan(buildIndex); + expect(secondRootInstallIndex).toBeGreaterThan(buildIndex); + expect(secondRootInstallIndex).toBeLessThan(verifyIndex); }); });