@ksmv/ui-checks 0.1.0 → 0.1.1
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/CHANGELOG.md +6 -0
- package/dist/cli.js +40 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.1 - 2026-09-27
|
|
4
|
+
|
|
5
|
+
- A CLI responde a `--help`/`-h` e a `--version`/`-v` antes de ler qualquer configuração, com código de saída 0. Na 0.1.0 essas opções caíam no carregamento da configuração e terminavam com código 2, e `-h` era interpretado como caminho de arquivo de configuração.
|
|
6
|
+
- A ajuda lista os comandos de análise e de baseline, as opções que cada um aceita e os três códigos de saída.
|
|
7
|
+
- Sem configuração e sem essas opções, a CLI continua falhando fechada com código 2.
|
|
8
|
+
|
|
3
9
|
## 0.1.0 - 2026-09-22
|
|
4
10
|
|
|
5
11
|
- Primeira versão pública das verificações de contrato e acessibilidade.
|
package/dist/cli.js
CHANGED
|
@@ -6,6 +6,28 @@ import { approveBaselineGrowth, baselineFor, validateBaseline, writeBaselineFile
|
|
|
6
6
|
import { applyConfiguredSuppressions } from "./governance.js";
|
|
7
7
|
import { formatHumanReport, formatJsonReport, } from "./result.js";
|
|
8
8
|
import { runChecks } from "./scan.js";
|
|
9
|
+
const usage = `Usage:
|
|
10
|
+
ksmv-ui-checks [config] [--json | --format=json]
|
|
11
|
+
ksmv-ui-checks baseline [config] --write --first-seen-version=<version>
|
|
12
|
+
--owner-role=<role> --reduction-target=<YYYY-MM-DD>
|
|
13
|
+
[--allow-growth --reason-file=<path>]
|
|
14
|
+
ksmv-ui-checks --help | -h
|
|
15
|
+
ksmv-ui-checks --version | -v
|
|
16
|
+
|
|
17
|
+
[config] defaults to ksmv-ui.config.js in the current directory.
|
|
18
|
+
|
|
19
|
+
Exit codes:
|
|
20
|
+
0 analysis complete, no new violations
|
|
21
|
+
1 a new violation, or a regression against the baseline
|
|
22
|
+
2 invalid configuration, a failed read or operation, no files found,
|
|
23
|
+
or mandatory coverage left unresolved
|
|
24
|
+
`;
|
|
25
|
+
// The manifest sits one level above both src/ and the published dist/, so the
|
|
26
|
+
// same relative URL resolves in the repository and in an installed package.
|
|
27
|
+
async function packageVersion() {
|
|
28
|
+
const manifest = JSON.parse(await readFile(new URL("../package.json", import.meta.url), "utf8"));
|
|
29
|
+
return manifest.version;
|
|
30
|
+
}
|
|
9
31
|
function optionValue(argv, name) {
|
|
10
32
|
return argv
|
|
11
33
|
.find((argument) => argument.startsWith(`--${name}=`))
|
|
@@ -94,6 +116,24 @@ async function runBaselineWrite(config, argv) {
|
|
|
94
116
|
return 0;
|
|
95
117
|
}
|
|
96
118
|
export async function main(argv = process.argv.slice(2)) {
|
|
119
|
+
// Answered before anything else, and before any configuration is read. In
|
|
120
|
+
// 0.1.0 both flags fell through to configuration loading and failed with
|
|
121
|
+
// exit code 2, and `-h`, which does not start with `--`, was taken for a
|
|
122
|
+
// configuration path.
|
|
123
|
+
if (argv.some((argument) => argument === "--help" || argument === "-h")) {
|
|
124
|
+
process.stdout.write(usage);
|
|
125
|
+
return 0;
|
|
126
|
+
}
|
|
127
|
+
if (argv.some((argument) => argument === "--version" || argument === "-v")) {
|
|
128
|
+
try {
|
|
129
|
+
process.stdout.write(`${await packageVersion()}\n`);
|
|
130
|
+
return 0;
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
process.stderr.write("ksmv-ui-checks: unable to read the package version.\n");
|
|
134
|
+
return 2;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
97
137
|
const useJson = argv.includes("--json") || argv.includes("--format=json");
|
|
98
138
|
const baselineCommand = argv[0] === "baseline";
|
|
99
139
|
const commandArguments = baselineCommand ? argv.slice(1) : argv;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ksmv/ui-checks",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Static and computed quality checks for semantic UI token contracts.",
|
|
5
5
|
"keywords": ["accessibility", "design-tokens", "quality", "static-analysis"],
|
|
6
6
|
"license": "Apache-2.0",
|