@rookcom/monarch-conformance 0.0.0-stage → 0.3.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/CHANGELOG.md +21 -0
- package/README.md +4 -2
- package/dist/check.d.ts +81 -0
- package/dist/check.d.ts.map +1 -0
- package/dist/check.js +350 -0
- package/dist/check.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +175 -0
- package/dist/cli.js.map +1 -0
- package/dist/glob.d.ts +3 -0
- package/dist/glob.d.ts.map +1 -0
- package/dist/glob.js +70 -0
- package/dist/glob.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/monarch-components.d.ts +122 -0
- package/dist/monarch-components.d.ts.map +1 -0
- package/dist/monarch-components.js +47 -0
- package/dist/monarch-components.js.map +1 -0
- package/dist/registry.d.ts +77 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +259 -0
- package/dist/registry.js.map +1 -0
- package/dist/report.d.ts +8 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +122 -0
- package/dist/report.js.map +1 -0
- package/dist/rules.d.ts +155 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +685 -0
- package/dist/rules.js.map +1 -0
- package/dist/schema.d.ts +24 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +91 -0
- package/dist/schema.js.map +1 -0
- package/dist/semver.d.ts +27 -0
- package/dist/semver.d.ts.map +1 -0
- package/dist/semver.js +235 -0
- package/dist/semver.js.map +1 -0
- package/dist/types.d.ts +54 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +10 -0
- package/dist/version.js.map +1 -0
- package/package.json +48 -4
package/dist/cli.js
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, join, resolve } from 'node:path';
|
|
4
|
+
import { check, loadConfig, makeBaseline, readJson } from './check.js';
|
|
5
|
+
import { loadCompatibility, loadDeprecations, loadProducts, statusMarkdown, validateRegistry, verifyProduct, } from './registry.js';
|
|
6
|
+
import { toJson, toSarif, toText } from './report.js';
|
|
7
|
+
import { VERSION } from './version.js';
|
|
8
|
+
const HELP = `monarch ${VERSION}: Rook Monarch conformance
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
monarch check [--root DIR] [--config FILE] [--product ID --registry DIR]
|
|
12
|
+
[--format text|json|sarif] [--out FILE]
|
|
13
|
+
[--baseline FILE] [--write-baseline FILE]
|
|
14
|
+
monarch registry validate --registry DIR
|
|
15
|
+
monarch registry verify --registry DIR (--product ID --checkout DIR | --all --checkouts FILE)
|
|
16
|
+
monarch registry report --registry DIR [--out FILE]
|
|
17
|
+
|
|
18
|
+
Exit codes: 0 pass, 1 new error-severity findings or invalid registry, 2 usage error.`;
|
|
19
|
+
function parse(argv) {
|
|
20
|
+
const positional = [];
|
|
21
|
+
const flags = {};
|
|
22
|
+
for (let i = 0; i < argv.length; i++) {
|
|
23
|
+
const a = argv[i];
|
|
24
|
+
if (a.startsWith('--')) {
|
|
25
|
+
const [k, v] = a.slice(2).split('=', 2);
|
|
26
|
+
if (v !== undefined)
|
|
27
|
+
flags[k] = v;
|
|
28
|
+
else if (argv[i + 1] !== undefined && !argv[i + 1].startsWith('--'))
|
|
29
|
+
flags[k] = argv[++i];
|
|
30
|
+
else
|
|
31
|
+
flags[k] = true;
|
|
32
|
+
}
|
|
33
|
+
else
|
|
34
|
+
positional.push(a);
|
|
35
|
+
}
|
|
36
|
+
return { positional, flags };
|
|
37
|
+
}
|
|
38
|
+
class UsageError extends Error {
|
|
39
|
+
}
|
|
40
|
+
function str(flags, key) {
|
|
41
|
+
const v = flags[key];
|
|
42
|
+
if (v === true)
|
|
43
|
+
throw new UsageError(`--${key} needs a value`);
|
|
44
|
+
return v;
|
|
45
|
+
}
|
|
46
|
+
function need(flags, key) {
|
|
47
|
+
const v = str(flags, key);
|
|
48
|
+
if (!v)
|
|
49
|
+
throw new UsageError(`--${key} is required`);
|
|
50
|
+
return v;
|
|
51
|
+
}
|
|
52
|
+
function emit(content, out) {
|
|
53
|
+
if (out) {
|
|
54
|
+
mkdirSync(dirname(resolve(out)), { recursive: true });
|
|
55
|
+
writeFileSync(out, content);
|
|
56
|
+
}
|
|
57
|
+
else
|
|
58
|
+
process.stdout.write(content);
|
|
59
|
+
}
|
|
60
|
+
function runCheck(flags) {
|
|
61
|
+
const root = resolve(str(flags, 'root') ?? '.');
|
|
62
|
+
const config = loadConfig(resolve(root, str(flags, 'config') ?? 'monarch.config.json'));
|
|
63
|
+
const registry = str(flags, 'registry');
|
|
64
|
+
const productId = str(flags, 'product') ?? config?.product;
|
|
65
|
+
const product = registry && productId
|
|
66
|
+
? loadProducts(resolve(registry)).find((p) => p.id === productId)
|
|
67
|
+
: undefined;
|
|
68
|
+
if (registry && productId && !product)
|
|
69
|
+
throw new UsageError(`Unknown product "${productId}" in ${registry}`);
|
|
70
|
+
const compat = registry ? loadCompatibility(resolve(registry)) : undefined;
|
|
71
|
+
const baselinePath = str(flags, 'baseline');
|
|
72
|
+
const result = check({
|
|
73
|
+
root,
|
|
74
|
+
include: config?.include ?? product?.source.paths ?? ['.'],
|
|
75
|
+
exclude: config?.exclude ?? [],
|
|
76
|
+
rules: config?.rules ?? {},
|
|
77
|
+
exceptions: product?.exceptions ?? [],
|
|
78
|
+
deprecations: registry ? loadDeprecations(resolve(registry)) : [],
|
|
79
|
+
...(compat ? { compatibility: compat } : {}),
|
|
80
|
+
...(productId ? { product: productId } : {}),
|
|
81
|
+
...(baselinePath ? { baseline: readJson(resolve(baselinePath)) } : {}),
|
|
82
|
+
});
|
|
83
|
+
const writeBaseline = str(flags, 'write-baseline');
|
|
84
|
+
if (writeBaseline) {
|
|
85
|
+
emit(JSON.stringify(makeBaseline(result), null, 2) + '\n', writeBaseline);
|
|
86
|
+
process.stderr.write(`baseline written to ${writeBaseline}\n`);
|
|
87
|
+
}
|
|
88
|
+
const format = str(flags, 'format') ?? 'text';
|
|
89
|
+
if (!['text', 'json', 'sarif'].includes(format))
|
|
90
|
+
throw new UsageError(`Unknown --format ${format}`);
|
|
91
|
+
emit(format === 'json' ? toJson(result) : format === 'sarif' ? toSarif(result) : toText(result), str(flags, 'out'));
|
|
92
|
+
return writeBaseline ? 0 : result.exitCode;
|
|
93
|
+
}
|
|
94
|
+
function runRegistry(sub, flags) {
|
|
95
|
+
const registry = resolve(need(flags, 'registry'));
|
|
96
|
+
switch (sub) {
|
|
97
|
+
case 'validate': {
|
|
98
|
+
const { products, errors } = validateRegistry(registry);
|
|
99
|
+
if (errors.length) {
|
|
100
|
+
for (const e of errors)
|
|
101
|
+
process.stderr.write(`✗ ${e}\n`);
|
|
102
|
+
process.stderr.write(`${errors.length} problem(s) in ${products} product file(s)\n`);
|
|
103
|
+
return 1;
|
|
104
|
+
}
|
|
105
|
+
process.stdout.write(`registry valid: ${products} products\n`);
|
|
106
|
+
return 0;
|
|
107
|
+
}
|
|
108
|
+
case 'verify': {
|
|
109
|
+
const jobs = [];
|
|
110
|
+
if (flags.all) {
|
|
111
|
+
const map = readJson(resolve(need(flags, 'checkouts')));
|
|
112
|
+
for (const p of loadProducts(registry)) {
|
|
113
|
+
const path = map[p.id];
|
|
114
|
+
if (path)
|
|
115
|
+
jobs.push({ id: p.id, path });
|
|
116
|
+
else
|
|
117
|
+
process.stderr.write(`skip ${p.id}: no checkout in map\n`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
else
|
|
121
|
+
jobs.push({ id: need(flags, 'product'), path: need(flags, 'checkout') });
|
|
122
|
+
let failed = 0;
|
|
123
|
+
for (const j of jobs) {
|
|
124
|
+
try {
|
|
125
|
+
const { status } = verifyProduct({
|
|
126
|
+
registry,
|
|
127
|
+
productId: j.id,
|
|
128
|
+
checkout: resolve(j.path),
|
|
129
|
+
});
|
|
130
|
+
const c = status.conformance;
|
|
131
|
+
process.stdout.write(`${j.id.padEnd(12)} ${status.adoption.status.padEnd(12)} ${status.compatibility.status.padEnd(16)} ${String(c.filesScanned).padStart(5)} files ${c.bySeverity.error} errors ${c.bySeverity.warn} warnings\n`);
|
|
132
|
+
}
|
|
133
|
+
catch (e) {
|
|
134
|
+
failed++;
|
|
135
|
+
process.stderr.write(`✗ ${j.id}: ${e.message}\n`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
process.stdout.write(`status written to ${join(registry, 'status')}\n`);
|
|
139
|
+
return failed ? 1 : 0;
|
|
140
|
+
}
|
|
141
|
+
case 'report':
|
|
142
|
+
emit(statusMarkdown(registry), str(flags, 'out'));
|
|
143
|
+
return 0;
|
|
144
|
+
default:
|
|
145
|
+
throw new UsageError(`Unknown registry command ${sub ?? ''}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
export function main(argv) {
|
|
149
|
+
const { positional, flags } = parse(argv);
|
|
150
|
+
try {
|
|
151
|
+
if (flags.version) {
|
|
152
|
+
process.stdout.write(VERSION + '\n');
|
|
153
|
+
return 0;
|
|
154
|
+
}
|
|
155
|
+
if (flags.help || positional.length === 0) {
|
|
156
|
+
process.stdout.write(HELP + '\n');
|
|
157
|
+
return positional.length === 0 && !flags.help ? 2 : 0;
|
|
158
|
+
}
|
|
159
|
+
if (positional[0] === 'check')
|
|
160
|
+
return runCheck(flags);
|
|
161
|
+
if (positional[0] === 'registry')
|
|
162
|
+
return runRegistry(positional[1], flags);
|
|
163
|
+
throw new UsageError(`Unknown command ${positional[0]}`);
|
|
164
|
+
}
|
|
165
|
+
catch (e) {
|
|
166
|
+
if (e instanceof UsageError) {
|
|
167
|
+
process.stderr.write(`${e.message}\n\n${HELP}\n`);
|
|
168
|
+
return 2;
|
|
169
|
+
}
|
|
170
|
+
process.stderr.write(`monarch: ${e.message}\n`);
|
|
171
|
+
return 1;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
process.exitCode = main(process.argv.slice(2));
|
|
175
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AACtF,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,IAAI,GAAG,WAAW,OAAO;;;;;;;;;;sFAUuD,CAAC;AAIvF,SAAS,KAAK,CAAC,IAAc;IAC3B,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,MAAM,KAAK,GAAU,EAAE,CAAC;IACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAW,CAAC;QAC5B,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACvB,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,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tD,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU;YAAE,OAAO,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAC3E,MAAM,IAAI,UAAU,CAAC,mBAAmB,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC3D,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,UAAU,EAAE,CAAC;YAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,OAAO,IAAI,IAAI,CAAC,CAAC;YAClD,OAAO,CAAC,CAAC;QACX,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YAAa,CAAW,CAAC,OAAO,IAAI,CAAC,CAAC;QAC3D,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC;AAED,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/glob.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../src/glob.ts"],"names":[],"mappings":"AAMA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkDjD;AAMD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAE1E"}
|
package/dist/glob.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal glob matching for include/exclude and exception paths.
|
|
3
|
+
* Supports `**`, `*`, `?` and `{a,b}`. Paths use forward slashes.
|
|
4
|
+
*/
|
|
5
|
+
const cache = new Map();
|
|
6
|
+
export function globToRegExp(glob) {
|
|
7
|
+
const hit = cache.get(glob);
|
|
8
|
+
if (hit)
|
|
9
|
+
return hit;
|
|
10
|
+
let re = '';
|
|
11
|
+
let i = 0;
|
|
12
|
+
const g = glob.replace(/^\.\//, '');
|
|
13
|
+
while (i < g.length) {
|
|
14
|
+
const ch = g[i];
|
|
15
|
+
if (ch === '*') {
|
|
16
|
+
if (g[i + 1] === '*') {
|
|
17
|
+
// `**/` matches zero or more directories; trailing `**` matches everything.
|
|
18
|
+
if (g[i + 2] === '/') {
|
|
19
|
+
re += '(?:.*/)?';
|
|
20
|
+
i += 3;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
re += '.*';
|
|
24
|
+
i += 2;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
re += '[^/]*';
|
|
29
|
+
i += 1;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else if (ch === '?') {
|
|
33
|
+
re += '[^/]';
|
|
34
|
+
i += 1;
|
|
35
|
+
}
|
|
36
|
+
else if (ch === '{') {
|
|
37
|
+
const end = g.indexOf('}', i);
|
|
38
|
+
if (end === -1) {
|
|
39
|
+
re += '\\{';
|
|
40
|
+
i += 1;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
re +=
|
|
44
|
+
'(?:' +
|
|
45
|
+
g
|
|
46
|
+
.slice(i + 1, end)
|
|
47
|
+
.split(',')
|
|
48
|
+
.map(escape)
|
|
49
|
+
.join('|') +
|
|
50
|
+
')';
|
|
51
|
+
i = end + 1;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
re += escape(ch);
|
|
56
|
+
i += 1;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// A bare directory pattern ("src/legacy") also matches everything inside it.
|
|
60
|
+
const out = new RegExp(`^${re}(?:/.*)?$`);
|
|
61
|
+
cache.set(glob, out);
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
function escape(s) {
|
|
65
|
+
return s.replace(/[.+^${}()|[\]\\]/g, '\\$&');
|
|
66
|
+
}
|
|
67
|
+
export function matchesAny(path, globs) {
|
|
68
|
+
return globs.some((g) => globToRegExp(g).test(path));
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=glob.js.map
|
package/dist/glob.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../src/glob.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;AAExC,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5B,IAAI,GAAG;QAAE,OAAO,GAAG,CAAC;IACpB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;QACpB,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAW,CAAC;QAC1B,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACf,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;gBACrB,4EAA4E;gBAC5E,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;oBACrB,EAAE,IAAI,UAAU,CAAC;oBACjB,CAAC,IAAI,CAAC,CAAC;gBACT,CAAC;qBAAM,CAAC;oBACN,EAAE,IAAI,IAAI,CAAC;oBACX,CAAC,IAAI,CAAC,CAAC;gBACT,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,EAAE,IAAI,OAAO,CAAC;gBACd,CAAC,IAAI,CAAC,CAAC;YACT,CAAC;QACH,CAAC;aAAM,IAAI,EAAE,KAAK,GAAG,EAAE,CAAC;YACtB,EAAE,IAAI,MAAM,CA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line, walk, type CheckOptions, type CheckResult, type Baseline, type ExceptionReport, } from './check.js';
|
|
2
|
+
export { RULES, RULE_IDS, scanFile, readSuppressions, type RuleId } from './rules.js';
|
|
3
|
+
export { toJson, toSarif, toText } from './report.js';
|
|
4
|
+
export { validateRegistry, verifyProduct, classifyAdoption, classifyCompatibility, detectFramework, statusMarkdown, loadProducts, type Product, type ProductStatus, type AdoptionStatus, type CompatibilityStatus, } from './registry.js';
|
|
5
|
+
export { satisfies, minVersion, parseVersion, parseRange } from './semver.js';
|
|
6
|
+
export { MONARCH_COMPONENTS } from './monarch-components.js';
|
|
7
|
+
export { VERSION } from './version.js';
|
|
8
|
+
export type * from './types.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,mBAAmB,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { check, makeBaseline, walk, } from './check.js';
|
|
2
|
+
export { RULES, RULE_IDS, scanFile, readSuppressions } from './rules.js';
|
|
3
|
+
export { toJson, toSarif, toText } from './report.js';
|
|
4
|
+
export { validateRegistry, verifyProduct, classifyAdoption, classifyCompatibility, detectFramework, statusMarkdown, loadProducts, } from './registry.js';
|
|
5
|
+
export { satisfies, minVersion, parseVersion, parseRange } from './semver.js';
|
|
6
|
+
export { MONARCH_COMPONENTS } from './monarch-components.js';
|
|
7
|
+
export { VERSION } from './version.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,YAAY,EACZ,IAAI,GAKL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAe,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,YAAY,GAKb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public components shipped by @rookcom/monarch-react. A local file with one of
|
|
3
|
+
* these stems under components/ui (or primitives/common) is a duplicate.
|
|
4
|
+
* Keep in sync with packages/react/src/index.ts.
|
|
5
|
+
*/
|
|
6
|
+
export declare const MONARCH_COMPONENTS: readonly [{
|
|
7
|
+
readonly name: "Button";
|
|
8
|
+
readonly stem: "button";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "IconButton";
|
|
11
|
+
readonly stem: "icon-button";
|
|
12
|
+
}, {
|
|
13
|
+
readonly name: "Spinner";
|
|
14
|
+
readonly stem: "spinner";
|
|
15
|
+
}, {
|
|
16
|
+
readonly name: "VisuallyHidden";
|
|
17
|
+
readonly stem: "visually-hidden";
|
|
18
|
+
}, {
|
|
19
|
+
readonly name: "Kbd";
|
|
20
|
+
readonly stem: "kbd";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "Field";
|
|
23
|
+
readonly stem: "field";
|
|
24
|
+
}, {
|
|
25
|
+
readonly name: "Input";
|
|
26
|
+
readonly stem: "input";
|
|
27
|
+
}, {
|
|
28
|
+
readonly name: "Textarea";
|
|
29
|
+
readonly stem: "textarea";
|
|
30
|
+
}, {
|
|
31
|
+
readonly name: "Checkbox";
|
|
32
|
+
readonly stem: "checkbox";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "Switch";
|
|
35
|
+
readonly stem: "switch";
|
|
36
|
+
}, {
|
|
37
|
+
readonly name: "Select";
|
|
38
|
+
readonly stem: "select";
|
|
39
|
+
}, {
|
|
40
|
+
readonly name: "Badge";
|
|
41
|
+
readonly stem: "badge";
|
|
42
|
+
}, {
|
|
43
|
+
readonly name: "Avatar";
|
|
44
|
+
readonly stem: "avatar";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "Card";
|
|
47
|
+
readonly stem: "card";
|
|
48
|
+
}, {
|
|
49
|
+
readonly name: "Skeleton";
|
|
50
|
+
readonly stem: "skeleton";
|
|
51
|
+
}, {
|
|
52
|
+
readonly name: "EmptyState";
|
|
53
|
+
readonly stem: "empty-state";
|
|
54
|
+
}, {
|
|
55
|
+
readonly name: "Alert";
|
|
56
|
+
readonly stem: "alert";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "Dialog";
|
|
59
|
+
readonly stem: "dialog";
|
|
60
|
+
}, {
|
|
61
|
+
readonly name: "DropdownMenu";
|
|
62
|
+
readonly stem: "dropdown-menu";
|
|
63
|
+
}, {
|
|
64
|
+
readonly name: "Tooltip";
|
|
65
|
+
readonly stem: "tooltip";
|
|
66
|
+
}, {
|
|
67
|
+
readonly name: "Popover";
|
|
68
|
+
readonly stem: "popover";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "Tabs";
|
|
71
|
+
readonly stem: "tabs";
|
|
72
|
+
}, {
|
|
73
|
+
readonly name: "Toast";
|
|
74
|
+
readonly stem: "toast";
|
|
75
|
+
}, {
|
|
76
|
+
readonly name: "Table";
|
|
77
|
+
readonly stem: "table";
|
|
78
|
+
}, {
|
|
79
|
+
readonly name: "Breadcrumb";
|
|
80
|
+
readonly stem: "breadcrumb";
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "Pagination";
|
|
83
|
+
readonly stem: "pagination";
|
|
84
|
+
}, {
|
|
85
|
+
readonly name: "Combobox";
|
|
86
|
+
readonly stem: "combobox";
|
|
87
|
+
}, {
|
|
88
|
+
readonly name: "Separator";
|
|
89
|
+
readonly stem: "separator";
|
|
90
|
+
}, {
|
|
91
|
+
readonly name: "Progress";
|
|
92
|
+
readonly stem: "progress";
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "Link";
|
|
95
|
+
readonly stem: "link";
|
|
96
|
+
}, {
|
|
97
|
+
readonly name: "PageHeader";
|
|
98
|
+
readonly stem: "page-header";
|
|
99
|
+
}, {
|
|
100
|
+
readonly name: "Toolbar";
|
|
101
|
+
readonly stem: "toolbar";
|
|
102
|
+
}, {
|
|
103
|
+
readonly name: "FilterBar";
|
|
104
|
+
readonly stem: "filter-bar";
|
|
105
|
+
}, {
|
|
106
|
+
readonly name: "SettingsSection";
|
|
107
|
+
readonly stem: "settings";
|
|
108
|
+
}, {
|
|
109
|
+
readonly name: "DescriptionList";
|
|
110
|
+
readonly stem: "description-list";
|
|
111
|
+
}, {
|
|
112
|
+
readonly name: "SplitLayout";
|
|
113
|
+
readonly stem: "split-layout";
|
|
114
|
+
}, {
|
|
115
|
+
readonly name: "StatCard";
|
|
116
|
+
readonly stem: "stat-card";
|
|
117
|
+
}, {
|
|
118
|
+
readonly name: "ErrorState";
|
|
119
|
+
readonly stem: "states";
|
|
120
|
+
}];
|
|
121
|
+
export declare const MONARCH_COMPONENT_STEMS: ReadonlyMap<string, string>;
|
|
122
|
+
//# sourceMappingURL=monarch-components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monarch-components.d.ts","sourceRoot":"","sources":["../src/monarch-components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCrB,CAAC;AAEX,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAE/D,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public components shipped by @rookcom/monarch-react. A local file with one of
|
|
3
|
+
* these stems under components/ui (or primitives/common) is a duplicate.
|
|
4
|
+
* Keep in sync with packages/react/src/index.ts.
|
|
5
|
+
*/
|
|
6
|
+
export const MONARCH_COMPONENTS = [
|
|
7
|
+
{ name: 'Button', stem: 'button' },
|
|
8
|
+
{ name: 'IconButton', stem: 'icon-button' },
|
|
9
|
+
{ name: 'Spinner', stem: 'spinner' },
|
|
10
|
+
{ name: 'VisuallyHidden', stem: 'visually-hidden' },
|
|
11
|
+
{ name: 'Kbd', stem: 'kbd' },
|
|
12
|
+
{ name: 'Field', stem: 'field' },
|
|
13
|
+
{ name: 'Input', stem: 'input' },
|
|
14
|
+
{ name: 'Textarea', stem: 'textarea' },
|
|
15
|
+
{ name: 'Checkbox', stem: 'checkbox' },
|
|
16
|
+
{ name: 'Switch', stem: 'switch' },
|
|
17
|
+
{ name: 'Select', stem: 'select' },
|
|
18
|
+
{ name: 'Badge', stem: 'badge' },
|
|
19
|
+
{ name: 'Avatar', stem: 'avatar' },
|
|
20
|
+
{ name: 'Card', stem: 'card' },
|
|
21
|
+
{ name: 'Skeleton', stem: 'skeleton' },
|
|
22
|
+
{ name: 'EmptyState', stem: 'empty-state' },
|
|
23
|
+
{ name: 'Alert', stem: 'alert' },
|
|
24
|
+
{ name: 'Dialog', stem: 'dialog' },
|
|
25
|
+
{ name: 'DropdownMenu', stem: 'dropdown-menu' },
|
|
26
|
+
{ name: 'Tooltip', stem: 'tooltip' },
|
|
27
|
+
{ name: 'Popover', stem: 'popover' },
|
|
28
|
+
{ name: 'Tabs', stem: 'tabs' },
|
|
29
|
+
{ name: 'Toast', stem: 'toast' },
|
|
30
|
+
{ name: 'Table', stem: 'table' },
|
|
31
|
+
{ name: 'Breadcrumb', stem: 'breadcrumb' },
|
|
32
|
+
{ name: 'Pagination', stem: 'pagination' },
|
|
33
|
+
{ name: 'Combobox', stem: 'combobox' },
|
|
34
|
+
{ name: 'Separator', stem: 'separator' },
|
|
35
|
+
{ name: 'Progress', stem: 'progress' },
|
|
36
|
+
{ name: 'Link', stem: 'link' },
|
|
37
|
+
{ name: 'PageHeader', stem: 'page-header' },
|
|
38
|
+
{ name: 'Toolbar', stem: 'toolbar' },
|
|
39
|
+
{ name: 'FilterBar', stem: 'filter-bar' },
|
|
40
|
+
{ name: 'SettingsSection', stem: 'settings' },
|
|
41
|
+
{ name: 'DescriptionList', stem: 'description-list' },
|
|
42
|
+
{ name: 'SplitLayout', stem: 'split-layout' },
|
|
43
|
+
{ name: 'StatCard', stem: 'stat-card' },
|
|
44
|
+
{ name: 'ErrorState', stem: 'states' },
|
|
45
|
+
];
|
|
46
|
+
export const MONARCH_COMPONENT_STEMS = new Map(MONARCH_COMPONENTS.map((c) => [c.stem, c.name]));
|
|
47
|
+
//# sourceMappingURL=monarch-components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monarch-components.js","sourceRoot":"","sources":["../src/monarch-components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;IAClC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE;IAC3C,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;IACpC,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACnD,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE;IAC5B,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE;IAChC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE;IAChC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE;IACtC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE;IACtC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;IAClC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;IAClC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE;IAChC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;IAClC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;IAC9B,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE;IACtC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EA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,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE;IACvC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE;CAC9B,CAAC;AAEX,MAAM,CAAC,MAAM,uBAAuB,GAAgC,IAAI,GAAG,CACzE,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAChD,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type CheckResult } from './check.js';
|
|
2
|
+
import type { Compatibility, Deprecation, ProductException, Severity } from './types.js';
|
|
3
|
+
export interface Product {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly kind: 'application' | 'marketing' | 'public-surface';
|
|
7
|
+
readonly repository: string;
|
|
8
|
+
readonly domain: string;
|
|
9
|
+
readonly theme: {
|
|
10
|
+
readonly accent: string;
|
|
11
|
+
readonly schemes: readonly ('light' | 'dark')[];
|
|
12
|
+
};
|
|
13
|
+
readonly source: {
|
|
14
|
+
readonly paths: readonly string[];
|
|
15
|
+
};
|
|
16
|
+
readonly exceptions?: readonly ProductException[];
|
|
17
|
+
}
|
|
18
|
+
export interface RegistryValidation {
|
|
19
|
+
readonly products: number;
|
|
20
|
+
readonly errors: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
export declare function loadProducts(registry: string): Product[];
|
|
23
|
+
export declare function loadCompatibility(registry: string): Compatibility | undefined;
|
|
24
|
+
export declare function loadDeprecations(registry: string): Deprecation[];
|
|
25
|
+
export declare function validateRegistry(registry: string): RegistryValidation;
|
|
26
|
+
export type AdoptionStatus = 'not-adopted' | 'partial' | 'adopted';
|
|
27
|
+
export type CompatibilityStatus = 'compatible' | 'needs-migration' | 'unknown';
|
|
28
|
+
export interface ProductStatus {
|
|
29
|
+
readonly product: string;
|
|
30
|
+
readonly verifiedAt: string;
|
|
31
|
+
readonly verifiedBy: string;
|
|
32
|
+
readonly tool: string;
|
|
33
|
+
readonly checkout: {
|
|
34
|
+
readonly commit: string | null;
|
|
35
|
+
readonly dirty: boolean | null;
|
|
36
|
+
};
|
|
37
|
+
readonly framework: {
|
|
38
|
+
readonly name: string;
|
|
39
|
+
readonly versions: Readonly<Record<string, string>>;
|
|
40
|
+
};
|
|
41
|
+
readonly monarch: {
|
|
42
|
+
readonly packages: Readonly<Record<string, string>>;
|
|
43
|
+
};
|
|
44
|
+
readonly adoption: {
|
|
45
|
+
readonly status: AdoptionStatus;
|
|
46
|
+
readonly evidence: readonly string[];
|
|
47
|
+
};
|
|
48
|
+
readonly compatibility: {
|
|
49
|
+
readonly status: CompatibilityStatus;
|
|
50
|
+
readonly notes: readonly string[];
|
|
51
|
+
};
|
|
52
|
+
readonly conformance: {
|
|
53
|
+
readonly paths: readonly string[];
|
|
54
|
+
readonly filesScanned: number;
|
|
55
|
+
readonly linesScanned: number;
|
|
56
|
+
readonly byRule: Readonly<Record<string, number>>;
|
|
57
|
+
readonly bySeverity: Readonly<Record<Severity, number>>;
|
|
58
|
+
readonly exceptions: number;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export declare function detectFramework(checkout: string): ProductStatus['framework'];
|
|
62
|
+
export declare function classifyCompatibility(versions: Readonly<Record<string, string>>, compat: Compatibility | undefined): ProductStatus['compatibility'];
|
|
63
|
+
export declare function classifyAdoption(monarchPkgs: Readonly<Record<string, string>>, result: Pick<CheckResult, 'counts' | 'monarchCssImports'>): ProductStatus['adoption'];
|
|
64
|
+
export interface VerifyOptions {
|
|
65
|
+
readonly registry: string;
|
|
66
|
+
readonly productId: string;
|
|
67
|
+
readonly checkout: string;
|
|
68
|
+
readonly write?: boolean;
|
|
69
|
+
readonly now?: Date;
|
|
70
|
+
}
|
|
71
|
+
export declare function verifyProduct(opts: VerifyOptions): {
|
|
72
|
+
status: ProductStatus;
|
|
73
|
+
result: CheckResult;
|
|
74
|
+
};
|
|
75
|
+
export declare function loadStatuses(registry: string): ProductStatus[];
|
|
76
|
+
export declare function statusMarkdown(registry: string): string;
|
|
77
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGzF,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,WAAW,GAAG,gBAAgB,CAAC;IAC9D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC,EAAE,CAAA;KAAE,CAAC;IAC7F,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC;IACvD,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACnD;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,EAAE,CAMxD;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,GA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