v11y-check 0.15.1 → 0.15.3
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/.readyup/kits/default.js +2 -2
- package/.readyup/manifest.json +18 -2
- package/README.md +2 -0
- package/dist/esm/bin/route.js +5 -4
- package/dist/esm/bin/v11y.js +2 -1
- package/dist/esm/cli.d.ts +0 -1
- package/dist/esm/cli.js +7 -9
- package/dist/esm/init/initCommand.js +2 -2
- package/dist/esm/init/scaffold.js +3 -2
- package/dist/esm/sync.js +2 -2
- package/package.json +9 -3
package/.readyup/kits/default.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @noformat — @generated. Do not edit. Compiled by rdy. */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export const __readyupVersion = "0.
|
|
3
|
+
export const __readyupVersion = "0.28.0";
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
// .readyup/kits/default.ts
|
|
@@ -63,7 +63,7 @@ var default_default = defineRdyKit({
|
|
|
63
63
|
]
|
|
64
64
|
});
|
|
65
65
|
function getMinVersion() {
|
|
66
|
-
const picked = { "version": "0.15.
|
|
66
|
+
const picked = { "version": "0.15.3" };
|
|
67
67
|
if (typeof picked["version"] !== "string") {
|
|
68
68
|
throw new TypeError("v11y-check/package.json: 'version' must be a string");
|
|
69
69
|
}
|
package/.readyup/manifest.json
CHANGED
|
@@ -5,12 +5,28 @@
|
|
|
5
5
|
"checklists": [
|
|
6
6
|
"v11y-check"
|
|
7
7
|
],
|
|
8
|
+
"esbuildVersion": "0.28.1",
|
|
9
|
+
"inputs": [
|
|
10
|
+
{
|
|
11
|
+
"hash": "52754bbb",
|
|
12
|
+
"kind": "module",
|
|
13
|
+
"path": "kits/default.ts"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"hash": "961f9384",
|
|
17
|
+
"kind": "inline",
|
|
18
|
+
"path": "../package.json",
|
|
19
|
+
"paths": [
|
|
20
|
+
"version"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
],
|
|
8
24
|
"name": "default",
|
|
9
25
|
"path": "kits/default.js",
|
|
10
|
-
"readyupVersion": "0.
|
|
26
|
+
"readyupVersion": "0.28.0",
|
|
11
27
|
"source": "kits/default.ts",
|
|
12
28
|
"sourceHash": "52754bbb",
|
|
13
|
-
"targetHash": "
|
|
29
|
+
"targetHash": "6e05f53c"
|
|
14
30
|
}
|
|
15
31
|
]
|
|
16
32
|
}
|
package/README.md
CHANGED
|
@@ -125,6 +125,8 @@ Other options:
|
|
|
125
125
|
|
|
126
126
|
The scaffolded workflow triggers on pull requests to `main`/`next`, on a daily schedule, and on manual `workflow_dispatch`. Commit the file into your repository so the caller runs in CI. If the reusable workflow's caller-side requirements change (for example, the tag bumps), re-run `v11y init --force` to refresh the file.
|
|
127
127
|
|
|
128
|
+
The reusable workflow installs pnpm with [`pnpm/setup`](https://github.com/pnpm/setup), which installs pnpm 11 or newer only and reads the version from your `devEngines.packageManager` or `packageManager` field. A repository pinned below that cannot run it.
|
|
129
|
+
|
|
128
130
|
## Readiness checks
|
|
129
131
|
|
|
130
132
|
v11y-check publishes a [readyup](https://www.npmjs.com/package/readyup) kit that checks a consuming repo against the release it has installed: that v11y-check is a devDependency at or above the current version, that audit-ci configs sit under `.config/audit-ci/`, and that `.github/workflows/audit.yaml` matches the template this package scaffolds. The kit ships inside the package, so it checks against the version you installed rather than whatever a repository ref happens to point at.
|
package/dist/esm/bin/route.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { parseArgs, readPackageVersion, reportError } from '@williamthorsen/nmr-core';
|
|
2
|
-
import {
|
|
2
|
+
import { describeError } from '@williamthorsen/toolbelt.errors';
|
|
3
|
+
import { auditCommand, checkCommand, syncCommand } from "../cli.js";
|
|
3
4
|
import { initCommand } from "../init/initCommand.js";
|
|
4
5
|
const VERSION = readPackageVersion(import.meta.url);
|
|
5
6
|
const SUBCOMMANDS = ['check', 'init', 'sync'];
|
|
@@ -134,14 +135,14 @@ async function handleSubcommand(flags, handler, helpFn = showHelp) {
|
|
|
134
135
|
options = parseSharedFlags(flags);
|
|
135
136
|
}
|
|
136
137
|
catch (error) {
|
|
137
|
-
reportError(
|
|
138
|
+
reportError(describeError(error));
|
|
138
139
|
return 1;
|
|
139
140
|
}
|
|
140
141
|
try {
|
|
141
142
|
return await handler(options);
|
|
142
143
|
}
|
|
143
144
|
catch (error) {
|
|
144
|
-
reportError(
|
|
145
|
+
reportError(describeError(error));
|
|
145
146
|
return 1;
|
|
146
147
|
}
|
|
147
148
|
}
|
|
@@ -159,7 +160,7 @@ function handleInit(flags) {
|
|
|
159
160
|
parsed = parseArgs(flags, initFlagSchema);
|
|
160
161
|
}
|
|
161
162
|
catch (error) {
|
|
162
|
-
reportError(
|
|
163
|
+
reportError(describeError(error));
|
|
163
164
|
return 1;
|
|
164
165
|
}
|
|
165
166
|
return initCommand({ dryRun: parsed.flags.dryRun, force: parsed.flags.force });
|
package/dist/esm/bin/v11y.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import process from 'node:process';
|
|
2
|
+
import { describeError } from '@williamthorsen/toolbelt.errors';
|
|
2
3
|
import { routeCommand } from "./route.js";
|
|
3
4
|
let exitCode;
|
|
4
5
|
try {
|
|
5
6
|
exitCode = await routeCommand(process.argv.slice(2));
|
|
6
7
|
}
|
|
7
8
|
catch (error) {
|
|
8
|
-
const message =
|
|
9
|
+
const message = describeError(error);
|
|
9
10
|
process.stderr.write(`v11y: unexpected error: ${message}\n`);
|
|
10
11
|
exitCode = 1;
|
|
11
12
|
}
|
package/dist/esm/cli.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { CommandOptions } from './types.js';
|
|
2
|
-
export declare function extractMessage(error: unknown): string;
|
|
3
2
|
export declare function auditCommand(options: CommandOptions): Promise<number>;
|
|
4
3
|
export declare function checkCommand(options: CommandOptions): Promise<number>;
|
|
5
4
|
export declare function syncCommand(options: CommandOptions): Promise<number>;
|
package/dist/esm/cli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import process from 'node:process';
|
|
2
2
|
import { reportError } from '@williamthorsen/nmr-core';
|
|
3
|
+
import { describeError } from '@williamthorsen/toolbelt.errors';
|
|
3
4
|
import { loadConfig } from "./config.js";
|
|
4
5
|
import { formatCheckJson, formatCheckText } from "./format-check.js";
|
|
5
6
|
import { formatCheckVerboseText } from "./format-verbose.js";
|
|
@@ -9,16 +10,13 @@ import { parseAuditCiOutput, runAudit, runReport } from "./run-audit.js";
|
|
|
9
10
|
import { syncAllowlist } from "./sync.js";
|
|
10
11
|
import { withTempDir } from "./tmp.js";
|
|
11
12
|
import { AUDIT_SCOPES, isSeverityAtOrAbove } from "./types.js";
|
|
12
|
-
export function extractMessage(error) {
|
|
13
|
-
return error instanceof Error ? error.message : String(error);
|
|
14
|
-
}
|
|
15
13
|
export async function auditCommand(options) {
|
|
16
14
|
let loaded;
|
|
17
15
|
try {
|
|
18
16
|
loaded = await loadConfig(options.configPath);
|
|
19
17
|
}
|
|
20
18
|
catch (error) {
|
|
21
|
-
reportError(
|
|
19
|
+
reportError(describeError(error));
|
|
22
20
|
return 1;
|
|
23
21
|
}
|
|
24
22
|
const { config } = loaded;
|
|
@@ -66,7 +64,7 @@ export async function auditCommand(options) {
|
|
|
66
64
|
});
|
|
67
65
|
}
|
|
68
66
|
catch (error) {
|
|
69
|
-
reportError(
|
|
67
|
+
reportError(describeError(error));
|
|
70
68
|
return 1;
|
|
71
69
|
}
|
|
72
70
|
}
|
|
@@ -77,7 +75,7 @@ export async function checkCommand(options) {
|
|
|
77
75
|
loaded = await loadConfig(options.configPath);
|
|
78
76
|
}
|
|
79
77
|
catch (error) {
|
|
80
|
-
reportError(
|
|
78
|
+
reportError(describeError(error));
|
|
81
79
|
return 1;
|
|
82
80
|
}
|
|
83
81
|
const { config } = loaded;
|
|
@@ -144,7 +142,7 @@ export async function checkCommand(options) {
|
|
|
144
142
|
});
|
|
145
143
|
}
|
|
146
144
|
catch (error) {
|
|
147
|
-
reportError(
|
|
145
|
+
reportError(describeError(error));
|
|
148
146
|
return 1;
|
|
149
147
|
}
|
|
150
148
|
}
|
|
@@ -154,7 +152,7 @@ export async function syncCommand(options) {
|
|
|
154
152
|
loaded = await loadConfig(options.configPath);
|
|
155
153
|
}
|
|
156
154
|
catch (error) {
|
|
157
|
-
reportError(
|
|
155
|
+
reportError(describeError(error));
|
|
158
156
|
return 1;
|
|
159
157
|
}
|
|
160
158
|
const { configSource } = loaded;
|
|
@@ -198,7 +196,7 @@ export async function syncCommand(options) {
|
|
|
198
196
|
});
|
|
199
197
|
}
|
|
200
198
|
catch (error) {
|
|
201
|
-
reportError(
|
|
199
|
+
reportError(describeError(error));
|
|
202
200
|
return 1;
|
|
203
201
|
}
|
|
204
202
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { printError, printStep, reportWriteResult } from '@williamthorsen/nmr-core';
|
|
2
|
-
import {
|
|
2
|
+
import { describeError } from '@williamthorsen/toolbelt.errors';
|
|
3
3
|
import { scaffoldFiles } from "./scaffold.js";
|
|
4
4
|
export function initCommand({ dryRun, force }) {
|
|
5
5
|
if (dryRun) {
|
|
@@ -11,7 +11,7 @@ export function initCommand({ dryRun, force }) {
|
|
|
11
11
|
results = scaffoldFiles({ dryRun, force });
|
|
12
12
|
}
|
|
13
13
|
catch (error) {
|
|
14
|
-
printError(`Failed to scaffold files: ${
|
|
14
|
+
printError(`Failed to scaffold files: ${describeError(error)}`);
|
|
15
15
|
return 1;
|
|
16
16
|
}
|
|
17
17
|
for (const result of results) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
import { findPackageRoot, writeFileWithCheck } from '@williamthorsen/nmr-core';
|
|
4
|
+
import { describeError } from '@williamthorsen/toolbelt.errors';
|
|
4
5
|
import { v11yCheckConfigTemplate } from "./templates.js";
|
|
5
6
|
const CONFIG_PATH = '.config/v11y-check.config.json';
|
|
6
7
|
const WORKFLOW_PATH = '.github/workflows/audit.yaml';
|
|
@@ -14,7 +15,7 @@ export function copyWorkflowTemplate(dryRun, overwrite) {
|
|
|
14
15
|
root = findPackageRoot(import.meta.url);
|
|
15
16
|
}
|
|
16
17
|
catch (error) {
|
|
17
|
-
const message =
|
|
18
|
+
const message = describeError(error);
|
|
18
19
|
return { filePath: WORKFLOW_PATH, outcome: 'failed', error: `Failed to resolve package root: ${message}` };
|
|
19
20
|
}
|
|
20
21
|
const templatePath = resolve(root, 'templates', 'audit.yaml.template');
|
|
@@ -26,7 +27,7 @@ export function copyWorkflowTemplate(dryRun, overwrite) {
|
|
|
26
27
|
content = readFileSync(templatePath, 'utf8');
|
|
27
28
|
}
|
|
28
29
|
catch (error) {
|
|
29
|
-
const message =
|
|
30
|
+
const message = describeError(error);
|
|
30
31
|
return { filePath: WORKFLOW_PATH, outcome: 'failed', error: `Failed to read template ${templatePath}: ${message}` };
|
|
31
32
|
}
|
|
32
33
|
return writeFileWithCheck(WORKFLOW_PATH, content, { dryRun, overwrite });
|
package/dist/esm/sync.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { writeFile } from 'node:fs/promises';
|
|
2
|
+
import { chainError } from '@williamthorsen/toolbelt.errors/candidate';
|
|
2
3
|
export function formatUtcDatetime(date) {
|
|
3
4
|
return date.toISOString();
|
|
4
5
|
}
|
|
@@ -76,8 +77,7 @@ export async function syncAllowlist(config, scope, auditResults, configFilePath,
|
|
|
76
77
|
await writeFile(configFilePath, serializeConfig(updatedConfig), 'utf8');
|
|
77
78
|
}
|
|
78
79
|
catch (error) {
|
|
79
|
-
|
|
80
|
-
throw new Error(`Failed to write config file '${configFilePath}': ${message}`, { cause: error });
|
|
80
|
+
throw chainError(`Failed to write config file '${configFilePath}'`, error);
|
|
81
81
|
}
|
|
82
82
|
return {
|
|
83
83
|
syncResult: { added, kept, removed, scope },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "v11y-check",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Wrap audit-ci with a richer config model, typed JSON source of truth, and sync workflow",
|
|
6
6
|
"keywords": [
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
},
|
|
22
22
|
"license": "ISC",
|
|
23
23
|
"author": "William Thorsen <william@thorsen.dev> (https://github.com/williamthorsen)",
|
|
24
|
+
"sideEffects": [
|
|
25
|
+
"./dist/esm/bin/*.js"
|
|
26
|
+
],
|
|
24
27
|
"type": "module",
|
|
25
28
|
"exports": {
|
|
26
29
|
".": {
|
|
@@ -40,12 +43,15 @@
|
|
|
40
43
|
"templates"
|
|
41
44
|
],
|
|
42
45
|
"dependencies": {
|
|
46
|
+
"@williamthorsen/toolbelt.errors": "0.5.0",
|
|
43
47
|
"audit-ci": "7.1.0",
|
|
44
48
|
"zod": "4.4.3",
|
|
45
|
-
"@williamthorsen/nmr-core": "0.
|
|
49
|
+
"@williamthorsen/nmr-core": "0.10.1"
|
|
46
50
|
},
|
|
47
51
|
"devDependencies": {
|
|
48
|
-
"
|
|
52
|
+
"@williamthorsen/toolbelt.testing": "0.3.0",
|
|
53
|
+
"@williamthorsen/toolbelt.vitest": "0.4.0",
|
|
54
|
+
"readyup": "0.28.0"
|
|
49
55
|
},
|
|
50
56
|
"engines": {
|
|
51
57
|
"node": ">=24"
|