mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-10 08:05:14 +02:00
chore(deps): refresh workspace dependencies (#43)
* chore(deps): refresh workspace dependencies * Fix pnpm artifact smoke build approvals
This commit is contained in:
parent
17a2fee69a
commit
85fc408054
19 changed files with 1274 additions and 1153 deletions
|
|
@ -9,6 +9,7 @@ import { join } from 'node:path';
|
|||
import { pathToFileURL } from 'node:url';
|
||||
import {
|
||||
npmSmokePackageJson,
|
||||
npmSmokePnpmWorkspaceYaml,
|
||||
packageArtifactLayout,
|
||||
} from './package-artifacts.mjs';
|
||||
|
||||
|
|
@ -280,6 +281,7 @@ async function prepareCleanInstall(layout, cleanInstallDir) {
|
|||
await assertPathExists(layout.cliTarball, '@ktx/cli tarball');
|
||||
await mkdir(cleanInstallDir, { recursive: true });
|
||||
await writeFile(join(cleanInstallDir, 'package.json'), `${JSON.stringify(npmSmokePackageJson(layout), null, 2)}\n`);
|
||||
await writeFile(join(cleanInstallDir, 'pnpm-workspace.yaml'), npmSmokePnpmWorkspaceYaml());
|
||||
await run('pnpm', ['install'], { cwd: cleanInstallDir, timeout: 120_000 }).then((result) =>
|
||||
requireSuccess('pnpm install clean artifact project', result),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import {
|
|||
PUBLIC_NPM_PACKAGE_NAME,
|
||||
PUBLIC_NPM_PACKAGE_VERSION,
|
||||
} from './build-public-npm-package.mjs';
|
||||
import { npmSmokePnpmWorkspaceYaml } from './package-artifacts.mjs';
|
||||
|
||||
const execFileAsync = promisify(execFile);
|
||||
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url));
|
||||
|
|
@ -249,6 +250,7 @@ async function writeSmokePackage(projectDir, tarballPath) {
|
|||
2,
|
||||
)}\n`,
|
||||
);
|
||||
await writeFile(join(projectDir, 'pnpm-workspace.yaml'), npmSmokePnpmWorkspaceYaml());
|
||||
}
|
||||
|
||||
export async function runLocalEmbeddingsRuntimeSmoke(options = {}) {
|
||||
|
|
|
|||
|
|
@ -462,12 +462,13 @@ export function npmSmokePackageJson(layout) {
|
|||
devDependencies: {
|
||||
'better-sqlite3': '^12.6.2',
|
||||
},
|
||||
pnpm: {
|
||||
onlyBuiltDependencies: ['better-sqlite3'],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function npmSmokePnpmWorkspaceYaml() {
|
||||
return ['packages:', ' - "."', 'allowBuilds:', ' better-sqlite3: true', ''].join('\n');
|
||||
}
|
||||
|
||||
export function npmVerifySource() {
|
||||
return `
|
||||
const cli = await import('@kaelio/ktx');
|
||||
|
|
@ -1111,6 +1112,7 @@ async function verifyNpmArtifacts(layout, tmpRoot) {
|
|||
join(projectDir, 'package.json'),
|
||||
`${JSON.stringify(npmSmokePackageJson(layout), null, 2)}\n`,
|
||||
);
|
||||
await writeFile(join(projectDir, 'pnpm-workspace.yaml'), npmSmokePnpmWorkspaceYaml());
|
||||
await writeFile(join(projectDir, 'verify-npm.mjs'), npmVerifySource());
|
||||
await writeFile(join(projectDir, 'verify-installed-cli.mjs'), npmRuntimeSmokeSource());
|
||||
await writeFile(join(projectDir, 'verify-installed-cli-commands.mjs'), npmCliSmokeSource());
|
||||
|
|
@ -1131,6 +1133,7 @@ async function verifyNpmCliArtifacts(layout, tmpRoot) {
|
|||
const projectDir = join(tmpRoot, 'npm-cli-clean-install');
|
||||
await mkdir(projectDir, { recursive: true });
|
||||
await writeFile(join(projectDir, 'package.json'), `${JSON.stringify(npmSmokePackageJson(layout), null, 2)}\n`);
|
||||
await writeFile(join(projectDir, 'pnpm-workspace.yaml'), npmSmokePnpmWorkspaceYaml());
|
||||
await writeFile(join(projectDir, 'verify-installed-cli-commands.mjs'), npmCliSmokeSource());
|
||||
|
||||
await runCommand('pnpm', ['install'], { cwd: projectDir });
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import {
|
|||
npmCliSmokeSource,
|
||||
npmRuntimeSmokeSource,
|
||||
npmSmokePackageJson,
|
||||
npmSmokePnpmWorkspaceYaml,
|
||||
npmVerifySource,
|
||||
packageArtifactLayout,
|
||||
packageReleaseMetadata,
|
||||
|
|
@ -422,6 +423,10 @@ describe('verification snippets', () => {
|
|||
assert.deepEqual(packageJson.devDependencies, {
|
||||
'better-sqlite3': '^12.6.2',
|
||||
});
|
||||
assert.equal(
|
||||
npmSmokePnpmWorkspaceYaml(),
|
||||
['packages:', ' - "."', 'allowBuilds:', ' better-sqlite3: true', ''].join('\n'),
|
||||
);
|
||||
});
|
||||
|
||||
it('exposes manifest verification as a package artifact command', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue