build: fetch identitydb as remote dependency

This commit is contained in:
2026-05-11 19:06:50 +09:00
parent 6eb6024e51
commit 4bcd80c33d
5 changed files with 46 additions and 41 deletions

View File

@@ -0,0 +1,31 @@
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { describe, expect, it } from 'vitest';
describe('release config', () => {
it('depends on a remote IdentityDB package source instead of a local file path', () => {
const packageJson = JSON.parse(
readFileSync(join(process.cwd(), 'package.json'), 'utf8'),
) as {
dependencies?: Record<string, string>;
trustedDependencies?: string[];
};
expect(packageJson.dependencies?.identitydb).toMatch(
/^git\+https:\/\/git\.psw\.kr\/p-sw\/IdentityDB\.git#[0-9a-f]{40}$/,
);
expect(packageJson.trustedDependencies).toEqual(
expect.arrayContaining(['better-sqlite3', 'esbuild', 'identitydb']),
);
});
it('publishes without cloning a sibling IdentityDB repository first', () => {
const workflow = readFileSync(
join(process.cwd(), '.gitea/workflows/npm-release.yml'),
'utf8',
);
expect(workflow).not.toContain('Clone IdentityDB dependency');
expect(workflow).not.toContain('IDENTITYDB_URL');
});
});