fix: suppress ExperimentalWarning in tests via NODE_NO_WARNINGS env
- Use NODE_NO_WARNINGS=1 in execFileSync env instead of --no-warnings flag
- Remove overly broad process.removeAllListeners('warning') from CLI entry
- Add engines field requiring Node >=22.5.0 (node:sqlite availability)
- Update proman to 0.4.2
This commit is contained in:
+4
-1
@@ -3,7 +3,7 @@
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.4.16",
|
||||
"@shazhou/proman": "0.4.1",
|
||||
"@shazhou/proman": "0.4.2",
|
||||
"@types/node": "^25.9.1",
|
||||
"tsx": "^4.22.4",
|
||||
"typescript": "^6.0.3",
|
||||
@@ -22,6 +22,9 @@
|
||||
"url": "https://github.com/shazhou-ww/ocas.git"
|
||||
},
|
||||
"homepage": "https://github.com/shazhou-ww/ocas",
|
||||
"engines": {
|
||||
"node": ">=22.5.0"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/shazhou-ww/ocas/issues"
|
||||
},
|
||||
|
||||
@@ -373,11 +373,7 @@ exports[`Phase 3: Variable System > 3.10 var delete removes variable 1`] = `
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Phase 3: Variable System > 3.11 var get deleted variable returns not found 1`] = `
|
||||
"(node:651685) ExperimentalWarning: SQLite is an experimental feature and might change at any time
|
||||
(Use \`node --trace-warnings ...\` to show where the warning was created)
|
||||
Error: Variable not found: name=@myapp/config, schema=FRBAB1BF0ZBCS"
|
||||
`;
|
||||
exports[`Phase 3: Variable System > 3.11 var get deleted variable returns not found 1`] = `"Error: Variable not found: name=@myapp/config, schema=FRBAB1BF0ZBCS"`;
|
||||
|
||||
exports[`Phase 4: Template System > 4.1 template set registers template 1`] = `
|
||||
{
|
||||
@@ -417,29 +413,13 @@ exports[`Phase 4: Template System > 4.4 template delete removes template 1`] = `
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Phase 4: Template System > 4.5 template get deleted template returns not found 1`] = `
|
||||
"(node:651720) ExperimentalWarning: SQLite is an experimental feature and might change at any time
|
||||
(Use \`node --trace-warnings ...\` to show where the warning was created)
|
||||
Error: Template not found for schema: FRBAB1BF0ZBCS"
|
||||
`;
|
||||
exports[`Phase 4: Template System > 4.5 template get deleted template returns not found 1`] = `"Error: Template not found for schema: FRBAB1BF0ZBCS"`;
|
||||
|
||||
exports[`Phase 7: Edge Cases > 7.1 get non-existent hash errors gracefully 1`] = `
|
||||
"(node:651545) ExperimentalWarning: SQLite is an experimental feature and might change at any time
|
||||
(Use \`node --trace-warnings ...\` to show where the warning was created)
|
||||
Node not found: AAAAAAAAAAAAA"
|
||||
`;
|
||||
exports[`Phase 7: Edge Cases > 7.1 get non-existent hash errors gracefully 1`] = `"Node not found: AAAAAAAAAAAAA"`;
|
||||
|
||||
exports[`Phase 7: Edge Cases > 7.3 var set empty name errors 1`] = `
|
||||
"(node:651559) ExperimentalWarning: SQLite is an experimental feature and might change at any time
|
||||
(Use \`node --trace-warnings ...\` to show where the warning was created)
|
||||
Usage: ocas var set <name> <hash> [--tag <tag>...]"
|
||||
`;
|
||||
exports[`Phase 7: Edge Cases > 7.3 var set empty name errors 1`] = `"Usage: ocas var set <name> <hash> [--tag <tag>...]"`;
|
||||
|
||||
exports[`Phase 7: Edge Cases > 7.4 var set name with invalid chars errors 1`] = `
|
||||
"(node:651566) ExperimentalWarning: SQLite is an experimental feature and might change at any time
|
||||
(Use \`node --trace-warnings ...\` to show where the warning was created)
|
||||
Error: Invalid variable name "invalid name!": Name must follow @scope/name format (e.g. @myapp/config)"
|
||||
`;
|
||||
exports[`Phase 7: Edge Cases > 7.4 var set name with invalid chars errors 1`] = `"Error: Invalid variable name "invalid name!": Name must follow @scope/name format (e.g. @myapp/config)"`;
|
||||
|
||||
exports[`Phase 7: Edge Cases > 7.5 no subcommand shows help text 1`] = `
|
||||
"Usage: ocas [--home <path>] [--json] <command> [args]
|
||||
@@ -486,5 +466,5 @@ Flags:
|
||||
--epsilon <n> Cutoff threshold for render (default: 0.01)
|
||||
--pipe, -p Read from stdin (put/hash: raw JSON payload; render: { type, value } envelope)
|
||||
|
||||
Agent: If you have not installed the ocas skill for this version (0.2.2), run \`ocas prompt setup\` and follow the instructions."
|
||||
Agent: If you have not installed the ocas skill for this version (0.3.0), run \`ocas prompt setup\` and follow the instructions."
|
||||
`;
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
||||
|
||||
exports[`Phase 2: Schema Validation > 2.3 put against non-existent schema hash fails 1`] = `
|
||||
"(node:651513) ExperimentalWarning: SQLite is an experimental feature and might change at any time
|
||||
(Use \`node --trace-warnings ...\` to show where the warning was created)
|
||||
Schema not found: AAAAAAAAAAAAA"
|
||||
`;
|
||||
exports[`Phase 2: Schema Validation > 2.3 put against non-existent schema hash fails 1`] = `"Schema not found: AAAAAAAAAAAAA"`;
|
||||
|
||||
@@ -47,6 +47,8 @@ export async function putSchemaFile(
|
||||
return hash;
|
||||
}
|
||||
|
||||
const quietEnv = { ...process.env, NODE_NO_WARNINGS: "1" };
|
||||
|
||||
/**
|
||||
* Run CLI command. Accepts either a string[] or ...string[] (rest args).
|
||||
* If first arg is an array, uses that as args. Otherwise treats all args as the command.
|
||||
@@ -59,9 +61,10 @@ export function runCli(
|
||||
? [entrypoint, "--home", storePath, ...args]
|
||||
: [entrypoint, ...args];
|
||||
try {
|
||||
const stdout = execFileSync("node", ["--no-warnings", ...finalArgs], {
|
||||
const stdout = execFileSync("node", finalArgs, {
|
||||
encoding: "utf-8",
|
||||
timeout: 10000,
|
||||
env: quietEnv,
|
||||
});
|
||||
return { stdout, stderr: "", exitCode: 0 };
|
||||
} catch (e: unknown) {
|
||||
@@ -81,10 +84,11 @@ export function runCliWithStdin(
|
||||
): { stdout: string; stderr: string; exitCode: number } {
|
||||
const finalArgs = [entrypoint, "--home", storePath, ...args];
|
||||
try {
|
||||
const stdout = execFileSync("node", ["--no-warnings", ...finalArgs], {
|
||||
const stdout = execFileSync("node", finalArgs, {
|
||||
input: stdin,
|
||||
encoding: "utf-8",
|
||||
timeout: 10000,
|
||||
env: quietEnv,
|
||||
});
|
||||
return { stdout, stderr: "", exitCode: 0 };
|
||||
} catch (e: unknown) {
|
||||
|
||||
Generated
+5
-5
@@ -12,8 +12,8 @@ importers:
|
||||
specifier: ^2.4.16
|
||||
version: 2.4.16
|
||||
'@shazhou/proman':
|
||||
specifier: 0.4.1
|
||||
version: 0.4.1(@biomejs/biome@2.4.16)(typescript@6.0.3)(vite@8.0.16(@types/node@25.9.1)(esbuild@0.28.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@25.9.1)(vite@8.0.16(@types/node@25.9.1)(esbuild@0.28.0)(tsx@4.22.4)(yaml@2.9.0)))(wrangler@3.114.17)
|
||||
specifier: 0.4.2
|
||||
version: 0.4.2(@biomejs/biome@2.4.16)(typescript@6.0.3)(vite@8.0.16(@types/node@25.9.1)(esbuild@0.28.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@25.9.1)(vite@8.0.16(@types/node@25.9.1)(esbuild@0.28.0)(tsx@4.22.4)(yaml@2.9.0)))(wrangler@3.114.17)
|
||||
'@types/node':
|
||||
specifier: ^25.9.1
|
||||
version: 25.9.1
|
||||
@@ -729,8 +729,8 @@ packages:
|
||||
'@rolldown/pluginutils@1.0.1':
|
||||
resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==}
|
||||
|
||||
'@shazhou/proman@0.4.1':
|
||||
resolution: {integrity: sha512-QQJDGQpSwDxcyBY8bUjuBWO18YCOTSd+37xF/bKMEUBo2+6YJBBIS6FZBpUVVBuqWu360ihmAqnbTdB70FTsEw==}
|
||||
'@shazhou/proman@0.4.2':
|
||||
resolution: {integrity: sha512-WGTUBH34xa26YR+M1lYP+tt1bO6a+7L06OFNwrAUfwaVyI0d+yvfx6Qh0FfLhkPgNoVjGpaOjrDZaAmz4LBYoQ==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
'@biomejs/biome': ^2.0.0
|
||||
@@ -1679,7 +1679,7 @@ snapshots:
|
||||
|
||||
'@rolldown/pluginutils@1.0.1': {}
|
||||
|
||||
'@shazhou/proman@0.4.1(@biomejs/biome@2.4.16)(typescript@6.0.3)(vite@8.0.16(@types/node@25.9.1)(esbuild@0.28.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@25.9.1)(vite@8.0.16(@types/node@25.9.1)(esbuild@0.28.0)(tsx@4.22.4)(yaml@2.9.0)))(wrangler@3.114.17)':
|
||||
'@shazhou/proman@0.4.2(@biomejs/biome@2.4.16)(typescript@6.0.3)(vite@8.0.16(@types/node@25.9.1)(esbuild@0.28.0)(tsx@4.22.4)(yaml@2.9.0))(vitest@4.1.8(@types/node@25.9.1)(vite@8.0.16(@types/node@25.9.1)(esbuild@0.28.0)(tsx@4.22.4)(yaml@2.9.0)))(wrangler@3.114.17)':
|
||||
dependencies:
|
||||
'@biomejs/biome': 2.4.16
|
||||
typescript: 6.0.3
|
||||
|
||||
Reference in New Issue
Block a user