fix: refresh root deps during deploy

Add a root bun install after git pull so file: dependencies are refreshed before build and runtime verification.
This commit is contained in:
Eyejoker
2026-05-29 23:52:32 +09:00
committed by GitHub
parent d0ca76f776
commit 5fa5b2f684
2 changed files with 28 additions and 1 deletions

27
src/deploy-script.test.ts Normal file
View File

@@ -0,0 +1,27 @@
import fs from 'fs';
import path from 'path';
import { describe, expect, it } from 'vitest';
type PackageJson = {
scripts?: Record<string, string>;
};
describe('deploy script', () => {
it('refreshes root file dependencies after pulling before building', () => {
const packageJson = JSON.parse(
fs.readFileSync(
path.resolve(import.meta.dirname, '../package.json'),
'utf8',
),
) as PackageJson;
const deploy = packageJson.scripts?.deploy ?? '';
const pullIndex = deploy.indexOf('git pull --ff-only');
const rootInstallIndex = deploy.indexOf('bun install --frozen-lockfile');
const buildIndex = deploy.indexOf('bun run build:all');
expect(pullIndex).toBeGreaterThanOrEqual(0);
expect(rootInstallIndex).toBeGreaterThan(pullIndex);
expect(rootInstallIndex).toBeLessThan(buildIndex);
});
});