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:
27
src/deploy-script.test.ts
Normal file
27
src/deploy-script.test.ts
Normal 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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user