@rookcom/monarch-conformance 0.0.0-stage → 0.2.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +4 -2
  3. package/dist/check.d.ts +81 -0
  4. package/dist/check.d.ts.map +1 -0
  5. package/dist/check.js +350 -0
  6. package/dist/check.js.map +1 -0
  7. package/dist/cli.d.ts +3 -0
  8. package/dist/cli.d.ts.map +1 -0
  9. package/dist/cli.js +175 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/glob.d.ts +3 -0
  12. package/dist/glob.d.ts.map +1 -0
  13. package/dist/glob.js +70 -0
  14. package/dist/glob.js.map +1 -0
  15. package/dist/index.d.ts +9 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +8 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/monarch-components.d.ts +122 -0
  20. package/dist/monarch-components.d.ts.map +1 -0
  21. package/dist/monarch-components.js +47 -0
  22. package/dist/monarch-components.js.map +1 -0
  23. package/dist/registry.d.ts +77 -0
  24. package/dist/registry.d.ts.map +1 -0
  25. package/dist/registry.js +259 -0
  26. package/dist/registry.js.map +1 -0
  27. package/dist/report.d.ts +8 -0
  28. package/dist/report.d.ts.map +1 -0
  29. package/dist/report.js +122 -0
  30. package/dist/report.js.map +1 -0
  31. package/dist/rules.d.ts +149 -0
  32. package/dist/rules.d.ts.map +1 -0
  33. package/dist/rules.js +639 -0
  34. package/dist/rules.js.map +1 -0
  35. package/dist/schema.d.ts +24 -0
  36. package/dist/schema.d.ts.map +1 -0
  37. package/dist/schema.js +91 -0
  38. package/dist/schema.js.map +1 -0
  39. package/dist/semver.d.ts +27 -0
  40. package/dist/semver.d.ts.map +1 -0
  41. package/dist/semver.js +235 -0
  42. package/dist/semver.js.map +1 -0
  43. package/dist/types.d.ts +54 -0
  44. package/dist/types.d.ts.map +1 -0
  45. package/dist/types.js +2 -0
  46. package/dist/types.js.map +1 -0
  47. package/dist/version.d.ts +3 -0
  48. package/dist/version.d.ts.map +1 -0
  49. package/dist/version.js +10 -0
  50. package/dist/version.js.map +1 -0
  51. package/package.json +48 -4
@@ -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,CAAC,GAAG,EAAE,CAAC,CAAiC,CAAC;YACxE,IAAI,CAAC,KAAK,SAAS;gBAAE,KAAK,CAAC,C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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,3 @@
1
+ export declare function globToRegExp(glob: string): RegExp;
2
+ export declare function matchesAny(path: string, globs: readonly string[]): boolean;
3
+ //# sourceMappingURL=glob.d.ts.map
@@ -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
@@ -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,I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AC,CAAC;YACd,CAAC;QACH,CAAC;aAAM,CAAC;YACN,EAAE,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC;YACjB,CAAC,IAAI,CAAC,CAAC;QACT,CAAC;IACH,CAAC;IACD,6EAA6E;IAC7E,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC1C,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACrB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,MAAM,CAAC,CAAS;IACvB,OAAO,CAAC,CAAC,OAAO,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,KAAwB;IAC/D,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACvD,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { check, makeBaseline, 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,UAA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C,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;IAC9B,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE;IAC3C,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;IACpC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE;IACzC,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,UAAU,EAAE;IAC7C,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,kBAAkB,EAAE;IACrD,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE;IAC7C,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 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AAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA6CvD"}
@@ -0,0 +1,259 @@
1
+ import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ import { check, gitState, loadConfig, monarchDependencies, readJson, } from './check.js';
4
+ import { assertSupported, validate } from './schema.js';
5
+ import { minVersion, parseVersion, satisfies, format } from './semver.js';
6
+ import { TOOL_NAME, VERSION } from './version.js';
7
+ export function loadProducts(registry) {
8
+ const dir = join(registry, 'products');
9
+ return readdirSync(dir)
10
+ .filter((f) => f.endsWith('.json'))
11
+ .sort()
12
+ .map((f) => readJson(join(dir, f)));
13
+ }
14
+ export function loadCompatibility(registry) {
15
+ const p = join(registry, 'compatibility.json');
16
+ return existsSync(p) ? readJson(p) : undefined;
17
+ }
18
+ export function loadDeprecations(registry) {
19
+ const p = join(registry, 'deprecations.json');
20
+ return existsSync(p) ? readJson(p).deprecations : [];
21
+ }
22
+ export function validateRegistry(registry) {
23
+ const errors = [];
24
+ const schema = readJson(join(registry, 'product.schema.json'));
25
+ assertSupported(schema);
26
+ const dir = join(registry, 'products');
27
+ const files = readdirSync(dir)
28
+ .filter((f) => f.endsWith('.json'))
29
+ .sort();
30
+ const seen = {
31
+ id: new Map(),
32
+ domain: new Map(),
33
+ repository: new Map(),
34
+ };
35
+ for (const f of files) {
36
+ let data;
37
+ try {
38
+ data = JSON.parse(readFileSync(join(dir, f), 'utf8'));
39
+ }
40
+ catch (e) {
41
+ errors.push(`${f}: invalid JSON (${e.message})`);
42
+ continue;
43
+ }
44
+ for (const e of validate(data, schema))
45
+ errors.push(`${f}: ${e}`);
46
+ const p = data;
47
+ if (typeof p.id === 'string' && `${p.id}.json` !== f)
48
+ errors.push(`${f}: id "${p.id}" must match the file name`);
49
+ for (const key of ['id', 'domain', 'repository']) {
50
+ const v = p[key];
51
+ if (typeof v !== 'string')
52
+ continue;
53
+ const prev = seen[key].get(v);
54
+ if (prev)
55
+ errors.push(`${f}: ${key} "${v}" already used by ${prev}`);
56
+ else
57
+ seen[key].set(v, f);
58
+ }
59
+ }
60
+ const compat = loadCompatibility(registry);
61
+ if (compat) {
62
+ for (const [name, entry] of Object.entries(compat.packages)) {
63
+ if (!parseVersion(entry.current))
64
+ errors.push(`compatibility.json: ${name}.current is not a version`);
65
+ else if (!satisfies(entry.current, entry.supported))
66
+ errors.push(`compatibility.json: ${name}.current is outside its supported range`);
67
+ }
68
+ }
69
+ return { products: files.length, errors };
70
+ }
71
+ const TRACKED = ['next', 'react', 'react-dom', 'vite', 'tailwindcss', 'typescript'];
72
+ export function detectFramework(checkout) {
73
+ const pkgPath = join(checkout, 'package.json');
74
+ if (!existsSync(pkgPath))
75
+ return { name: 'unknown', versions: {} };
76
+ const pkg = readJson(pkgPath);
77
+ const deps = { ...pkg.devDependencies, ...pkg.dependencies };
78
+ const versions = {};
79
+ for (const k of TRACKED)
80
+ if (deps[k])
81
+ versions[k] = deps[k];
82
+ const name = deps.next
83
+ ? 'next'
84
+ : deps.vite && deps.react
85
+ ? 'vite-react'
86
+ : deps.react
87
+ ? 'react'
88
+ : 'unknown';
89
+ return { name, versions };
90
+ }
91
+ export function classifyCompatibility(versions, compat) {
92
+ if (!compat)
93
+ return { status: 'unknown', notes: ['registry/compatibility.json not found'] };
94
+ const notes = [];
95
+ let failed = false;
96
+ let unknown = !versions.react;
97
+ if (!versions.react)
98
+ notes.push('react not found in package.json');
99
+ for (const [peer, range] of Object.entries(compat.peers)) {
100
+ const spec = versions[peer];
101
+ if (!spec)
102
+ continue;
103
+ const min = minVersion(spec);
104
+ if (!min) {
105
+ unknown = true;
106
+ notes.push(`${peer}@${spec}: version spec not understood`);
107
+ continue;
108
+ }
109
+ if (!satisfies(min, range)) {
110
+ failed = true;
111
+ if (peer === 'tailwindcss' && min.major >= 4) {
112
+ notes.push(`tailwindcss@${spec}: the Monarch Tailwind preset targets v3. Use the CSS-only path (import @rookcom/monarch-tokens/css and the mn-* variables) or the v4 @theme mapping once it ships.`);
113
+ }
114
+ else {
115
+ notes.push(`${peer}@${spec} (min ${format(min)}) is outside the supported range ${range}`);
116
+ }
117
+ }
118
+ }
119
+ if (failed)
120
+ return { status: 'needs-migration', notes };
121
+ if (unknown)
122
+ return { status: 'unknown', notes };
123
+ return {
124
+ status: 'compatible',
125
+ notes: notes.length ? notes : ['react, next and tailwindcss are within Monarch peer ranges'],
126
+ };
127
+ }
128
+ export function classifyAdoption(monarchPkgs, result) {
129
+ const names = Object.keys(monarchPkgs);
130
+ const localTokens = result.counts.byRule['tokens/local-token-definitions'] ?? 0;
131
+ const duplicates = result.counts.byRule['components/duplicated-primitive'] ?? 0;
132
+ const cssImported = result.monarchCssImports.length > 0;
133
+ const evidence = [];
134
+ if (names.length === 0) {
135
+ evidence.push('no @rookcom/monarch-* dependency in package.json');
136
+ if (localTokens)
137
+ evidence.push(`${localTokens} local token definition block(s)`);
138
+ if (duplicates)
139
+ evidence.push(`${duplicates} local component file(s) duplicating Monarch`);
140
+ return { status: 'not-adopted', evidence };
141
+ }
142
+ evidence.push(`depends on ${names.map((n) => `${n}@${monarchPkgs[n]}`).join(', ')}`);
143
+ evidence.push(cssImported
144
+ ? `imports Monarch CSS in ${result.monarchCssImports.slice(0, 3).join(', ')}`
145
+ : 'does not import @rookcom/monarch-tokens/css');
146
+ if (localTokens)
147
+ evidence.push(`${localTokens} local token definition block(s) remain`);
148
+ if (duplicates)
149
+ evidence.push(`${duplicates} duplicated component file(s) remain`);
150
+ const adopted = cssImported && localTokens === 0 && duplicates === 0;
151
+ return { status: adopted ? 'adopted' : 'partial', evidence };
152
+ }
153
+ export function verifyProduct(opts) {
154
+ const product = loadProducts(opts.registry).find((p) => p.id === opts.productId);
155
+ if (!product)
156
+ throw new Error(`Unknown product "${opts.productId}" in ${opts.registry}`);
157
+ if (!existsSync(join(opts.checkout, 'package.json')))
158
+ throw new Error(`${opts.checkout} has no package.json`);
159
+ const compat = loadCompatibility(opts.registry);
160
+ const appConfig = loadConfig(join(opts.checkout, 'monarch.config.json'));
161
+ const include = product.source.paths.filter((p) => existsSync(join(opts.checkout, p)));
162
+ const result = check({
163
+ root: opts.checkout,
164
+ include,
165
+ exclude: appConfig?.exclude ?? [],
166
+ rules: appConfig?.rules ?? {},
167
+ exceptions: product.exceptions ?? [],
168
+ deprecations: loadDeprecations(opts.registry),
169
+ product: product.id,
170
+ ...(compat ? { compatibility: compat } : {}),
171
+ });
172
+ const framework = detectFramework(opts.checkout);
173
+ const deps = monarchDependencies(opts.checkout);
174
+ const packages = Object.fromEntries(Object.entries(deps).map(([k, v]) => [k, v.installed ?? v.spec]));
175
+ const status = {
176
+ product: product.id,
177
+ verifiedAt: (opts.now ?? new Date()).toISOString(),
178
+ verifiedBy: 'monarch registry verify',
179
+ tool: `${TOOL_NAME}@${VERSION}`,
180
+ checkout: gitState(opts.checkout),
181
+ framework,
182
+ monarch: { packages },
183
+ adoption: classifyAdoption(packages, result),
184
+ compatibility: classifyCompatibility(framework.versions, compat),
185
+ conformance: {
186
+ paths: include,
187
+ filesScanned: result.filesScanned,
188
+ linesScanned: result.linesScanned,
189
+ byRule: result.counts.byRule,
190
+ bySeverity: result.counts.bySeverity,
191
+ exceptions: result.suppressed.exceptions,
192
+ },
193
+ };
194
+ if (opts.write !== false) {
195
+ const out = join(opts.registry, 'status', `${product.id}.json`);
196
+ mkdirSync(dirname(out), { recursive: true });
197
+ writeFileSync(out, JSON.stringify(status, null, 2) + '\n');
198
+ }
199
+ return { status, result };
200
+ }
201
+ // ----------------------------------------------------------------- report
202
+ export function loadStatuses(registry) {
203
+ const dir = join(registry, 'status');
204
+ if (!existsSync(dir))
205
+ return [];
206
+ return readdirSync(dir)
207
+ .filter((f) => f.endsWith('.json'))
208
+ .sort()
209
+ .map((f) => readJson(join(dir, f)));
210
+ }
211
+ const A11Y = [
212
+ 'a11y/img-alt',
213
+ 'a11y/click-without-key',
214
+ 'a11y/positive-tabindex',
215
+ 'a11y/outline-none-without-ring',
216
+ ];
217
+ export function statusMarkdown(registry) {
218
+ const products = new Map(loadProducts(registry).map((p) => [p.id, p]));
219
+ const statuses = loadStatuses(registry);
220
+ const n = (s, r) => s.conformance.byRule[r] ?? 0;
221
+ const rows = statuses.map((s) => {
222
+ const p = products.get(s.product);
223
+ const fw = s.framework.versions;
224
+ const fwText = [
225
+ s.framework.name,
226
+ fw.next && `next ${fw.next}`,
227
+ fw.react && `react ${fw.react}`,
228
+ fw.tailwindcss && `tw ${fw.tailwindcss}`,
229
+ ]
230
+ .filter(Boolean)
231
+ .join(' · ');
232
+ const monarch = Object.entries(s.monarch.packages)
233
+ .map(([k, v]) => `${k.replace('@rookcom/monarch-', '')} ${v}`)
234
+ .join(', ') || '—';
235
+ const a11y = A11Y.reduce((acc, r) => acc + n(s, r), 0);
236
+ return `| ${p?.name ?? s.product} | ${p?.domain ?? '—'} | ${fwText} | ${monarch} | ${s.adoption.status} | ${s.compatibility.status} | ${s.conformance.filesScanned} | ${n(s, 'color/no-raw-palette')} | ${n(s, 'color/no-hard-coded-color')} | ${n(s, 'tokens/local-token-definitions')} | ${n(s, 'components/duplicated-primitive')} | ${a11y} | ${s.verifiedAt.slice(0, 10)} | ${s.checkout.commit ? '`' + s.checkout.commit.slice(0, 7) + '`' + (s.checkout.dirty ? ' (dirty)' : '') : '—'} |`;
237
+ });
238
+ const unverified = [...products.keys()].filter((id) => !statuses.some((s) => s.product === id));
239
+ return [
240
+ '# Monarch registry status',
241
+ '',
242
+ '<!-- Generated by `monarch registry report`. Do not edit by hand. -->',
243
+ '',
244
+ 'Numbers come from a static scan of each product at the commit shown (“dirty” means the checkout had uncommitted changes). They are counts, not scores. Adoption is decided by `monarch registry verify`; see [conformance guide](../guides/conformance.md#how-registry-verify-decides-adoption).',
245
+ '',
246
+ '| Product | Domain | Framework | Monarch | Adoption | Compatibility | Files | Palette | Colour literals | Local token blocks | Duplicated components | A11y | Verified | Commit |',
247
+ '| --- | --- | --- | --- | --- | --- | --: | --: | --: | --: | --: | --: | --- | --- |',
248
+ ...rows,
249
+ '',
250
+ ...(unverified.length ? [`Not yet verified: ${unverified.join(', ')}.`, ''] : []),
251
+ '## Compatibility notes',
252
+ '',
253
+ ...statuses
254
+ .filter((s) => s.compatibility.status !== 'compatible')
255
+ .map((s) => `- **${products.get(s.product)?.name ?? s.product}** (${s.compatibility.status}): ${s.compatibility.notes.join(' ')}`),
256
+ '',
257
+ ].join('\n');
258
+ }
259
+ //# sourceMappingURL=registry.js.map