v11y-check 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,19 +3,13 @@
3
3
  Wraps [audit-ci](https://github.com/IBM/audit-ci) with a richer config model, typed JSON source of truth, and a sync workflow that automates allowlist management.
4
4
 
5
5
  <!-- section:release-notes -->
6
- ## Release notes — v0.9.0 (2026-06-30)
6
+ ## Release notes — v0.10.0 (2026-07-01)
7
7
 
8
8
  ### 🎉 Features
9
9
 
10
- - 🚨 **Breaking:** Auto-activate integration test variant from config presence (#448)
10
+ - 🚨 **Breaking:** Rebuild nmr-compile on a unified tsc emit (#455)
11
11
 
12
- A package can now separate its integration tests from its standalone suite simply by including a `vitest.integration.config.ts` (alongside a `vitest.standalone.config.ts`). The `--int-test` flag that previously enabled this is removed — that config-file pairing is now the only way to activate the separation. In such a package, `test` and `test:coverage` run only the standalone suite and skip integration tests, while a new `test:all` runs both suites together. The separation now holds even when tests run across every package at once, so a full-workspace `test` run still keeps integration tests out of the default suite. Packages that previously hand-copied these test scripts no longer need to.
13
-
14
- ### 🐛 Bug fixes
15
-
16
- - Prevent CLI output truncation when piped before exit (#446)
17
-
18
- Fixes an issue where large output from the `nmr` and `v11y` commands could be truncated when captured through a pipe — for example, by a CI job.
12
+ `nmr` now compiles a package's JavaScript and type declarations in one step, rewriting every import form — static, re-export, dynamic `import()`, bare side-effect, and tsconfig `paths` aliases — to runnable `.js` in both outputs. It now requires TypeScript 5.7 or newer as a peer dependency.
19
13
  <!-- /section:release-notes -->
20
14
 
21
15
  ## Installation
package/dist/esm/.cache CHANGED
@@ -1 +1 @@
1
- 3212b9610d8d35e990af90c896cc18411959dd3c5885a72d641764a6d054b814
1
+ d32d9586bf4dd951e3fa117d2712ec09488bb0d025fa16d5daf7c659b885db79
@@ -1,11 +1,11 @@
1
- import { parseArgs, readPackageVersion, reportError } from "@williamthorsen/nmr-core";
1
+ import { parseArgs, readPackageVersion, reportError } from '@williamthorsen/nmr-core';
2
2
  import { auditCommand, checkCommand, extractMessage, syncCommand } from "../cli.js";
3
3
  import { initCommand } from "../init/initCommand.js";
4
4
  const VERSION = readPackageVersion(import.meta.url);
5
- const SUBCOMMANDS = ["check", "init", "sync"];
5
+ const SUBCOMMANDS = ['check', 'init', 'sync'];
6
6
  const MIN_PREFIX_LENGTH = 3;
7
7
  function showHelp() {
8
- console.info(`
8
+ console.info(`
9
9
  Usage: v11y [options]
10
10
  v11y <command> [options]
11
11
 
@@ -28,7 +28,7 @@ Other options:
28
28
  `);
29
29
  }
30
30
  function showInitHelp() {
31
- console.info(`
31
+ console.info(`
32
32
  Usage: v11y init [options]
33
33
 
34
34
  Scaffold a starter config file and GitHub Actions workflow.
@@ -40,7 +40,7 @@ Options:
40
40
  `);
41
41
  }
42
42
  function showSyncHelp() {
43
- console.info(`
43
+ console.info(`
44
44
  Usage: v11y sync [options]
45
45
 
46
46
  Synchronize allowlists with current audit findings.
@@ -56,109 +56,111 @@ Other options:
56
56
  `);
57
57
  }
58
58
  function parseSharedFlags(flags) {
59
- const flagSchema = {
60
- config: { long: "--config", type: "string" },
61
- dev: { long: "--dev", type: "boolean" },
62
- json: { long: "--json", type: "boolean", short: "-j" },
63
- prod: { long: "--prod", type: "boolean" },
64
- verbose: { long: "--verbose", type: "boolean", short: "-v" }
65
- };
66
- const { flags: parsed } = parseArgs(flags, flagSchema);
67
- if (parsed.dev && parsed.prod) {
68
- throw new Error("Cannot specify both --dev and --prod");
69
- }
70
- const scopes = [];
71
- if (parsed.dev) scopes.push("dev");
72
- if (parsed.prod) scopes.push("prod");
73
- return {
74
- configPath: parsed.config,
75
- json: parsed.json,
76
- scopes,
77
- verbose: parsed.verbose
78
- };
59
+ const flagSchema = {
60
+ config: { long: '--config', type: 'string' },
61
+ dev: { long: '--dev', type: 'boolean' },
62
+ json: { long: '--json', type: 'boolean', short: '-j' },
63
+ prod: { long: '--prod', type: 'boolean' },
64
+ verbose: { long: '--verbose', type: 'boolean', short: '-v' },
65
+ };
66
+ const { flags: parsed } = parseArgs(flags, flagSchema);
67
+ if (parsed.dev && parsed.prod) {
68
+ throw new Error('Cannot specify both --dev and --prod');
69
+ }
70
+ const scopes = [];
71
+ if (parsed.dev)
72
+ scopes.push('dev');
73
+ if (parsed.prod)
74
+ scopes.push('prod');
75
+ return {
76
+ configPath: parsed.config,
77
+ json: parsed.json,
78
+ scopes,
79
+ verbose: parsed.verbose,
80
+ };
79
81
  }
80
82
  function findTypoMatch(input) {
81
- if (input.length < MIN_PREFIX_LENGTH || input.startsWith("-")) {
82
- return void 0;
83
- }
84
- for (const cmd of SUBCOMMANDS) {
85
- if (cmd !== input && cmd.startsWith(input)) {
86
- return cmd;
87
- }
88
- }
89
- return void 0;
83
+ if (input.length < MIN_PREFIX_LENGTH || input.startsWith('-')) {
84
+ return undefined;
85
+ }
86
+ for (const cmd of SUBCOMMANDS) {
87
+ if (cmd !== input && cmd.startsWith(input)) {
88
+ return cmd;
89
+ }
90
+ }
91
+ return undefined;
90
92
  }
91
- async function routeCommand(args) {
92
- const command = args[0];
93
- if (command === "--help" || command === "-h") {
94
- showHelp();
95
- return 0;
96
- }
97
- if (command === "--version" || command === "-V") {
98
- console.info(VERSION);
99
- return 0;
100
- }
101
- if (command === "check") {
102
- return handleSubcommand(args.slice(1), checkCommand);
103
- }
104
- if (command === "init") {
105
- return handleInit(args.slice(1));
106
- }
107
- if (command === "sync") {
108
- return handleSubcommand(args.slice(1), syncCommand, showSyncHelp);
109
- }
110
- if (command !== void 0 && !command.startsWith("-")) {
111
- const typoMatch = findTypoMatch(command);
112
- if (typoMatch !== void 0) {
113
- reportError(`Unknown command '${command}'. Did you mean 'v11y ${typoMatch}'?`);
114
- return 1;
115
- }
116
- reportError(`Unknown command '${command}'.`);
117
- return 1;
118
- }
119
- if (args.includes("--raw")) {
120
- const filteredArgs = args.filter((a) => a !== "--raw");
121
- return handleSubcommand(filteredArgs, auditCommand);
122
- }
123
- return handleSubcommand(args, checkCommand);
93
+ export async function routeCommand(args) {
94
+ const command = args[0];
95
+ if (command === '--help' || command === '-h') {
96
+ showHelp();
97
+ return 0;
98
+ }
99
+ if (command === '--version' || command === '-V') {
100
+ console.info(VERSION);
101
+ return 0;
102
+ }
103
+ if (command === 'check') {
104
+ return handleSubcommand(args.slice(1), checkCommand);
105
+ }
106
+ if (command === 'init') {
107
+ return handleInit(args.slice(1));
108
+ }
109
+ if (command === 'sync') {
110
+ return handleSubcommand(args.slice(1), syncCommand, showSyncHelp);
111
+ }
112
+ if (command !== undefined && !command.startsWith('-')) {
113
+ const typoMatch = findTypoMatch(command);
114
+ if (typoMatch !== undefined) {
115
+ reportError(`Unknown command '${command}'. Did you mean 'v11y ${typoMatch}'?`);
116
+ return 1;
117
+ }
118
+ reportError(`Unknown command '${command}'.`);
119
+ return 1;
120
+ }
121
+ if (args.includes('--raw')) {
122
+ const filteredArgs = args.filter((a) => a !== '--raw');
123
+ return handleSubcommand(filteredArgs, auditCommand);
124
+ }
125
+ return handleSubcommand(args, checkCommand);
124
126
  }
125
127
  async function handleSubcommand(flags, handler, helpFn = showHelp) {
126
- if (flags.some((f) => f === "--help" || f === "-h")) {
127
- helpFn();
128
- return 0;
129
- }
130
- let options;
131
- try {
132
- options = parseSharedFlags(flags);
133
- } catch (error) {
134
- reportError(extractMessage(error));
135
- return 1;
136
- }
137
- try {
138
- return await handler(options);
139
- } catch (error) {
140
- reportError(extractMessage(error));
141
- return 1;
142
- }
128
+ if (flags.some((f) => f === '--help' || f === '-h')) {
129
+ helpFn();
130
+ return 0;
131
+ }
132
+ let options;
133
+ try {
134
+ options = parseSharedFlags(flags);
135
+ }
136
+ catch (error) {
137
+ reportError(extractMessage(error));
138
+ return 1;
139
+ }
140
+ try {
141
+ return await handler(options);
142
+ }
143
+ catch (error) {
144
+ reportError(extractMessage(error));
145
+ return 1;
146
+ }
143
147
  }
144
148
  function handleInit(flags) {
145
- if (flags.some((f) => f === "--help" || f === "-h")) {
146
- showInitHelp();
147
- return 0;
148
- }
149
- const initFlagSchema = {
150
- dryRun: { long: "--dry-run", type: "boolean", short: "-n" },
151
- force: { long: "--force", type: "boolean", short: "-f" }
152
- };
153
- let parsed;
154
- try {
155
- parsed = parseArgs(flags, initFlagSchema);
156
- } catch (error) {
157
- reportError(extractMessage(error));
158
- return 1;
159
- }
160
- return initCommand({ dryRun: parsed.flags.dryRun, force: parsed.flags.force });
149
+ if (flags.some((f) => f === '--help' || f === '-h')) {
150
+ showInitHelp();
151
+ return 0;
152
+ }
153
+ const initFlagSchema = {
154
+ dryRun: { long: '--dry-run', type: 'boolean', short: '-n' },
155
+ force: { long: '--force', type: 'boolean', short: '-f' },
156
+ };
157
+ let parsed;
158
+ try {
159
+ parsed = parseArgs(flags, initFlagSchema);
160
+ }
161
+ catch (error) {
162
+ reportError(extractMessage(error));
163
+ return 1;
164
+ }
165
+ return initCommand({ dryRun: parsed.flags.dryRun, force: parsed.flags.force });
161
166
  }
162
- export {
163
- routeCommand
164
- };
@@ -1,12 +1,12 @@
1
- import process from "node:process";
1
+ import process from 'node:process';
2
2
  import { routeCommand } from "./route.js";
3
3
  let exitCode;
4
4
  try {
5
- exitCode = await routeCommand(process.argv.slice(2));
6
- } catch (error) {
7
- const message = error instanceof Error ? error.message : String(error);
8
- process.stderr.write(`v11y: unexpected error: ${message}
9
- `);
10
- exitCode = 1;
5
+ exitCode = await routeCommand(process.argv.slice(2));
6
+ }
7
+ catch (error) {
8
+ const message = error instanceof Error ? error.message : String(error);
9
+ process.stderr.write(`v11y: unexpected error: ${message}\n`);
10
+ exitCode = 1;
11
11
  }
12
12
  process.exitCode = exitCode;
package/dist/esm/cli.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { CommandOptions } from './types.ts';
1
+ import type { CommandOptions } from './types.js';
2
2
  export declare function extractMessage(error: unknown): string;
3
3
  export declare function auditCommand(options: CommandOptions): Promise<number>;
4
4
  export declare function checkCommand(options: CommandOptions): Promise<number>;