@estiva-app/ui 0.20.0 → 0.21.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/README.md +38 -2
- package/dist/gates/app-checks.d.ts +40 -0
- package/dist/gates/app-checks.d.ts.map +1 -0
- package/dist/gates/chunk-AUXD4GCY.js +478 -0
- package/dist/gates/chunk-AUXD4GCY.js.map +7 -0
- package/dist/gates/chunk-ZGJ2J5NU.js +754 -0
- package/dist/gates/chunk-ZGJ2J5NU.js.map +7 -0
- package/dist/gates/cli.d.ts +2 -0
- package/dist/gates/cli.d.ts.map +1 -0
- package/dist/gates/cli.js +46 -0
- package/dist/gates/cli.js.map +7 -0
- package/dist/gates/count.d.ts +20 -0
- package/dist/gates/count.d.ts.map +1 -0
- package/dist/gates/create-app-cli.d.ts +2 -0
- package/dist/gates/create-app-cli.d.ts.map +1 -0
- package/dist/gates/create-app.d.ts +23 -0
- package/dist/gates/create-app.d.ts.map +1 -0
- package/dist/gates/create-app.js +30 -0
- package/dist/gates/create-app.js.map +7 -0
- package/dist/gates/gate-config.d.ts +44 -0
- package/dist/gates/gate-config.d.ts.map +1 -0
- package/dist/gates/hook.d.ts +18 -0
- package/dist/gates/hook.d.ts.map +1 -0
- package/dist/gates/index.d.ts +30 -0
- package/dist/gates/index.d.ts.map +1 -0
- package/dist/gates/index.js +417 -0
- package/dist/gates/index.js.map +7 -0
- package/dist/gates/status.d.ts +88 -0
- package/dist/gates/status.d.ts.map +1 -0
- package/dist/gates/token-lint.d.ts +26 -0
- package/dist/gates/token-lint.d.ts.map +1 -0
- package/package.json +30 -4
- package/src/gates/app-checks.ts +226 -0
- package/src/gates/cli.ts +61 -0
- package/src/gates/count.ts +76 -0
- package/src/gates/create-app-cli.ts +25 -0
- package/src/gates/create-app.test.ts +72 -0
- package/src/gates/create-app.ts +797 -0
- package/src/gates/gate-config.ts +78 -0
- package/src/gates/gates.test.ts +194 -0
- package/src/gates/hook.ts +111 -0
- package/src/gates/index.ts +30 -0
- package/src/gates/status.ts +545 -0
- package/src/gates/token-lint.ts +231 -0
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
ENGINE,
|
|
4
|
+
helpers,
|
|
5
|
+
runHook,
|
|
6
|
+
runStatus,
|
|
7
|
+
writeGateCount
|
|
8
|
+
} from "./chunk-AUXD4GCY.js";
|
|
9
|
+
import {
|
|
10
|
+
appFiles,
|
|
11
|
+
askNpm,
|
|
12
|
+
createApp,
|
|
13
|
+
themes
|
|
14
|
+
} from "./chunk-ZGJ2J5NU.js";
|
|
15
|
+
|
|
16
|
+
// src/gates/token-lint.ts
|
|
17
|
+
import { createRequire } from "node:module";
|
|
18
|
+
import { fileURLToPath } from "node:url";
|
|
19
|
+
import betterTailwindcss from "eslint-plugin-better-tailwindcss";
|
|
20
|
+
import { getDefaultSelectors } from "eslint-plugin-better-tailwindcss/defaults";
|
|
21
|
+
import { parser as typescriptParser } from "typescript-eslint";
|
|
22
|
+
var TOKEN_LINT_IGNORES = ["dist/", "storybook-static/", "node_modules/"];
|
|
23
|
+
var CLASS_MAP_SELECTOR = {
|
|
24
|
+
kind: "variable",
|
|
25
|
+
name: "^(?:[A-Z][A-Z0-9_]*_(?:STYLES|CLASSES)|[a-z][a-zA-Z0-9]*(?:Styles|Classes))$",
|
|
26
|
+
match: [{ type: "strings" }, { type: "objectValues" }]
|
|
27
|
+
};
|
|
28
|
+
var WORDS = {
|
|
29
|
+
app: {
|
|
30
|
+
ramp: "Tailwind's type ramp is not a token. Use the ramp from the package: text-body-2, text-caption, text-h3, text-btn-default...",
|
|
31
|
+
palette: "Tailwind's palette is not a token. Use a colour from the package (bg-bg-surface, text-text-primary, border-border-subtle...); a colour with no token is a missing token.",
|
|
32
|
+
raw: "A raw colour is a missing token: add it to the package (tokens.css in every theme block, and the preset), or say why not in an eslint-disable comment.",
|
|
33
|
+
opacity: "An opacity modifier on a token colour compiles to nothing. A transparent colour is a token of its own (D16): add it to the package.",
|
|
34
|
+
type: "$0 is type written by hand. A token from the package sets the size, line height, letter spacing and weight together (text-body-2, text-caption, text-h5...); if none fits, add one to the package, or say why not in an eslint-disable comment.",
|
|
35
|
+
corner: "$0 is a corner written by hand, and no token has it. Use a corner from the package (rounded-sm 4px, rounded-md 6px, rounded-lg 8px...), or say why not in an eslint-disable comment.",
|
|
36
|
+
shadow: "$0 is a shadow written by hand. Use a shadow from the package (shadow-sm, shadow-md, shadow-focus-ring, drop-shadow-glow-success...); a shadow with no token is a missing token."
|
|
37
|
+
},
|
|
38
|
+
package: {
|
|
39
|
+
ramp: "Tailwind's type ramp is not a token. Use the ramp in tailwind-preset.js: text-body-2, text-caption, text-h3, text-btn-default...",
|
|
40
|
+
palette: "Tailwind's palette is not a token. Use a colour from tailwind-preset.js (bg-bg-surface, text-text-primary, border-border-subtle...); a colour with no token is a missing token.",
|
|
41
|
+
raw: "A raw colour is a missing token: add it to tokens.css in every theme block and to the preset, or say why not in an eslint-disable comment.",
|
|
42
|
+
opacity: "An opacity modifier on a token colour compiles to nothing. A transparent colour is a token of its own (D16): add it to tokens.css in every theme block and to the preset.",
|
|
43
|
+
type: "$0 is type written by hand. A token from tailwind-preset.js sets the size, line height, letter spacing and weight together (text-body-2, text-caption, text-h5...); if none fits, add one to the preset and to cn.ts, or say why not in an eslint-disable comment.",
|
|
44
|
+
corner: "$0 is a corner written by hand, and no token has it. Use a corner from tailwind-preset.js (rounded-sm 4px, rounded-md 6px, rounded-lg 8px...), or say why not in an eslint-disable comment.",
|
|
45
|
+
shadow: "$0 is a shadow written by hand. Use a shadow from tailwind-preset.js (shadow-sm, shadow-md, shadow-focus-ring, drop-shadow-glow-success...); a shadow with no token is a missing token."
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
function tokenLint({ tailwindConfig = "tailwind.config.js", audience = "app" } = {}) {
|
|
49
|
+
const words = WORDS[audience];
|
|
50
|
+
return {
|
|
51
|
+
files: ["**/*.{ts,tsx}"],
|
|
52
|
+
languageOptions: {
|
|
53
|
+
parser: typescriptParser,
|
|
54
|
+
parserOptions: { ecmaFeatures: { jsx: true } }
|
|
55
|
+
},
|
|
56
|
+
plugins: { "better-tailwindcss": betterTailwindcss },
|
|
57
|
+
settings: {
|
|
58
|
+
"better-tailwindcss": {
|
|
59
|
+
tailwindConfig,
|
|
60
|
+
selectors: [...getDefaultSelectors(), CLASS_MAP_SELECTOR]
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
rules: {
|
|
64
|
+
"better-tailwindcss/no-unknown-classes": "error",
|
|
65
|
+
"better-tailwindcss/no-restricted-classes": [
|
|
66
|
+
"error",
|
|
67
|
+
{
|
|
68
|
+
restrict: [
|
|
69
|
+
{ pattern: "^(?:[a-z0-9-]+:)*text-(?:xs|sm|base|lg|xl|[2-9]xl)$", message: words.ramp },
|
|
70
|
+
{
|
|
71
|
+
pattern: "^(?:[a-z0-9-]+:)*(?:text|bg|border|ring|outline|fill|stroke|decoration|divide|placeholder|from|via|to|accent|caret|shadow)-(?:black|white|slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)(?:-[0-9]{2,3})?(?:/[0-9]{1,3})?$",
|
|
72
|
+
message: words.palette
|
|
73
|
+
},
|
|
74
|
+
{ pattern: "^(?:[a-z0-9-]+:)*[a-z-]+-\\[[^\\]]*(?:#[0-9a-fA-F]{3}|rgba?\\(|hsla?\\(|oklch\\()", message: words.raw },
|
|
75
|
+
{
|
|
76
|
+
pattern: "^(?:[a-z0-9-]+:)*(?:text|bg|border|ring|outline|fill|stroke|decoration|divide|placeholder|from|via|to|accent|caret|shadow)-(?:bg|text|border|accent|info|warning|success|error)-[a-z-]+/[0-9]{1,3}$",
|
|
77
|
+
message: words.opacity
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
var V = "^(?:(?:[^:\\[\\]\\s]|\\[[^\\]]*\\])+:)*!?";
|
|
86
|
+
var NOT_COLOUR = "(?!color:|#|rgba?\\(|hsla?\\(|oklch\\(|var\\()";
|
|
87
|
+
var HAND_WRITTEN = {
|
|
88
|
+
type: `${V}(?:text-\\[${NOT_COLOUR}|text-\\[length:|leading-\\[|tracking-\\[)[^\\]]+\\](?:/\\S*)?$`,
|
|
89
|
+
corner: `${V}rounded(?:-(?:t|r|b|l|s|e|tl|tr|br|bl|ss|se|es|ee))?-\\[[^\\]]+\\]$`,
|
|
90
|
+
shadow: `${V}(?:shadow|drop-shadow)-\\[(?!color:)[^\\]]+\\]$`,
|
|
91
|
+
spacing: `${V}-?(?:w|h|size|min-w|min-h|max-w|max-h|p[xytrblse]?|m[xytrblse]?|gap(?:-[xy])?|space-[xy]|inset(?:-[xy])?|top|right|bottom|left|translate-[xy]|basis|indent|scroll-[mp][xytrblse]?|border-spacing(?:-[xy])?)-\\[[^\\]]+\\]$`,
|
|
92
|
+
width: `${V}(?:border(?:-[xytrblse])?|divide-[xy]|outline|ring|ring-offset)-\\[(?:length:)?-?[0-9.]+(?:px|rem|em)?\\]$`
|
|
93
|
+
};
|
|
94
|
+
var INLINE_STYLE_TOKEN_PROPERTIES = "/^(color|background|backgroundColor|backgroundImage|fill|stroke|fontSize|border|borderTop|borderRight|borderBottom|borderLeft|borderBlock|borderInline|borderStyle|boxShadow|textShadow)$|Color$/";
|
|
95
|
+
function loadPreset() {
|
|
96
|
+
const require2 = createRequire(import.meta.url);
|
|
97
|
+
const loadConfig = require2("tailwindcss/loadConfig");
|
|
98
|
+
return loadConfig(fileURLToPath(new URL("../../tailwind-preset.js", import.meta.url)));
|
|
99
|
+
}
|
|
100
|
+
function tokenValues({ audience = "app" } = {}) {
|
|
101
|
+
const words = WORDS[audience];
|
|
102
|
+
const preset = loadPreset();
|
|
103
|
+
const tokensBySize = {};
|
|
104
|
+
for (const [name, value] of Object.entries(preset.theme.extend.fontSize)) {
|
|
105
|
+
const size = Array.isArray(value) ? value[0] : value;
|
|
106
|
+
(tokensBySize[size] ??= []).push(`text-${name}`);
|
|
107
|
+
}
|
|
108
|
+
const cornersBySize = {};
|
|
109
|
+
for (const [name, size] of Object.entries(preset.theme.extend.borderRadius)) (cornersBySize[size] ??= []).push(name === "DEFAULT" ? "rounded" : `rounded-${name}`);
|
|
110
|
+
return {
|
|
111
|
+
files: ["**/*.{ts,tsx}"],
|
|
112
|
+
ignores: ["**/*.test.ts", "**/*.test.tsx"],
|
|
113
|
+
plugins: { "token-values": betterTailwindcss, "token-spacing": betterTailwindcss },
|
|
114
|
+
rules: {
|
|
115
|
+
"token-values/no-restricted-classes": [
|
|
116
|
+
"error",
|
|
117
|
+
{
|
|
118
|
+
restrict: [
|
|
119
|
+
...Object.entries(tokensBySize).map(([size, names]) => ({
|
|
120
|
+
pattern: `${V}text-\\[${size.replace(".", "\\.")}\\](?:/\\S*)?$`,
|
|
121
|
+
message: `$0 is the type ramp written by hand. Use ${names.join(" or ")}.`
|
|
122
|
+
})),
|
|
123
|
+
{
|
|
124
|
+
pattern: HAND_WRITTEN.type,
|
|
125
|
+
message: words.type
|
|
126
|
+
},
|
|
127
|
+
...Object.entries(cornersBySize).map(([size, names]) => ({
|
|
128
|
+
pattern: `${V}rounded(?:-(?:t|r|b|l|s|e|tl|tr|br|bl|ss|se|es|ee))?-\\[${size.replace(".", "\\.")}\\]$`,
|
|
129
|
+
message: `$0 is a corner written by hand. Use ${names.join(" or ")} (with the same side, if it has one).`
|
|
130
|
+
})),
|
|
131
|
+
{
|
|
132
|
+
pattern: HAND_WRITTEN.corner,
|
|
133
|
+
message: words.corner
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
pattern: HAND_WRITTEN.shadow,
|
|
137
|
+
message: words.shadow
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"token-spacing/no-restricted-classes": [
|
|
143
|
+
"warn",
|
|
144
|
+
{
|
|
145
|
+
restrict: [
|
|
146
|
+
{
|
|
147
|
+
pattern: HAND_WRITTEN.spacing,
|
|
148
|
+
message: "$0 is a size or a space written by hand. Use a step of the spacing scale (p-3, h-9, gap-2...) if one fits. Reported, not blocked."
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
pattern: HAND_WRITTEN.width,
|
|
152
|
+
message: "$0 is a border or ring width written by hand. Use border, border-2, ring-1... if one fits. Reported, not blocked."
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"no-restricted-syntax": [
|
|
158
|
+
"error",
|
|
159
|
+
{
|
|
160
|
+
selector: `JSXAttribute[name.name="style"] > JSXExpressionContainer > ObjectExpression > Property[key.name=${INLINE_STYLE_TOKEN_PROPERTIES}]`,
|
|
161
|
+
message: "An inline style that sets a colour, a font size, a border or a shadow is outside the token contract: use a token class. If the value is computed (a palette, a size from a prop), say why in an eslint-disable comment. Width, height and transforms are fine."
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// src/gates/gate-config.ts
|
|
169
|
+
import betterTailwindcss2 from "eslint-plugin-better-tailwindcss";
|
|
170
|
+
import { parser as typescriptParser2 } from "typescript-eslint";
|
|
171
|
+
import estiva from "../eslint/index.js";
|
|
172
|
+
function gateLint({ audience = "app" } = {}) {
|
|
173
|
+
return {
|
|
174
|
+
...audience === "package" ? estiva.configs.package : estiva.configs.recommended,
|
|
175
|
+
files: audience === "package" ? ["src/**/*.tsx"] : ["src/**/*.{ts,tsx}"],
|
|
176
|
+
ignores: ["**/*.test.ts", "**/*.test.tsx"],
|
|
177
|
+
languageOptions: {
|
|
178
|
+
parser: typescriptParser2,
|
|
179
|
+
parserOptions: { ecmaFeatures: { jsx: true } }
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
function gateConfig({ audience = "app", quiet = {}, ignores = [] } = {}) {
|
|
184
|
+
return [
|
|
185
|
+
{ ignores: [...TOKEN_LINT_IGNORES, ...ignores] },
|
|
186
|
+
{
|
|
187
|
+
plugins: {
|
|
188
|
+
...quiet,
|
|
189
|
+
"better-tailwindcss": betterTailwindcss2,
|
|
190
|
+
"token-values": betterTailwindcss2,
|
|
191
|
+
"token-spacing": betterTailwindcss2
|
|
192
|
+
},
|
|
193
|
+
// Every other config's directives are unused here, because their rules are
|
|
194
|
+
// off here. Reporting them would be this config complaining about the
|
|
195
|
+
// others' business.
|
|
196
|
+
linterOptions: { reportUnusedDisableDirectives: "off" }
|
|
197
|
+
},
|
|
198
|
+
gateLint({ audience })
|
|
199
|
+
];
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// src/gates/app-checks.ts
|
|
203
|
+
var APP_TICKET_TITLES = {
|
|
204
|
+
"UIG-2": "The tracking rails \u2014 GATES.md, the status script, the guide committed",
|
|
205
|
+
"UIG-3": "Tracer bullet \u2014 one rule, end to end, blocking in Peek",
|
|
206
|
+
"UIG-4": "The same chain, blocking in Ship",
|
|
207
|
+
"UIG-6": "Branch protection \u2014 the backstop, all three repos",
|
|
208
|
+
"UIG-7": "Lint rule \u2014 every remaining raw element",
|
|
209
|
+
"UIG-8": "Lint rule \u2014 forbid the reach",
|
|
210
|
+
"UIG-9": "Lint rule \u2014 the className allow-list",
|
|
211
|
+
"UIG-13": "The registry widens to Peek's 115 and Ship's 74, with classification",
|
|
212
|
+
"UIG-19": "Lock the contract in CI, and make the three Storybooks one search",
|
|
213
|
+
"UIG-20": "The Claude skill, reading the registry",
|
|
214
|
+
"UIG-21": "CLAUDE.md becomes an index, not a lecture",
|
|
215
|
+
"UIG-22": "Fingerprint \u2014 a hand-made header row",
|
|
216
|
+
"UIG-23": "Fingerprint \u2014 a hand-made empty state",
|
|
217
|
+
"UIG-24": "Fingerprint \u2014 a browser tooltip where ours belongs",
|
|
218
|
+
"UIG-25": "Fingerprint \u2014 a component copied out by hand",
|
|
219
|
+
"UIG-27": "The components the apps had to build themselves \u2014 Link, ProgressBar, EmptyState padding",
|
|
220
|
+
"UIG-28": "Close the two holes in the token contract \u2014 arbitrary values, and inline style",
|
|
221
|
+
"UIG-30": "RichText \u2014 one component that draws a message's text, for both apps",
|
|
222
|
+
"UIG-32": "Peek and Ship take their gate pieces from the package"
|
|
223
|
+
};
|
|
224
|
+
function all(h, steps, label) {
|
|
225
|
+
return async () => {
|
|
226
|
+
for (const step of steps) {
|
|
227
|
+
const r = await step();
|
|
228
|
+
if (r.result !== "pass") return r;
|
|
229
|
+
}
|
|
230
|
+
return h.PASS(label);
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
function appChecks(h, { app = ".", page, chain = { ref: "UIG-3", owner: false }, tokenConfigs = ["eslint.tokens.config.js", "eslint.config.js"], headers = ["ContainerHeader", "SectionHeader"] }) {
|
|
234
|
+
const WEB = app === "." ? "" : `${app.replace(/\/$/, "")}/`;
|
|
235
|
+
const cwd = app === "." ? void 0 : app;
|
|
236
|
+
const PROBE = "src/components/__gates_probe__.tsx";
|
|
237
|
+
const GATES = "eslint.gates.config.js";
|
|
238
|
+
const at = (rel) => `${WEB}${rel}`;
|
|
239
|
+
const probe = (code, expect, mentions, file = PROBE, config = GATES) => () => h.lint({ ...cwd ? { cwd } : {}, config, file, code, expect, mentions });
|
|
240
|
+
const component = (body) => `export function Probe() {
|
|
241
|
+
return ${body}
|
|
242
|
+
}
|
|
243
|
+
`;
|
|
244
|
+
const installed = at("node_modules/@estiva-app/ui/dist/index.d.ts");
|
|
245
|
+
const realPage = () => h.lint({ ...cwd ? { cwd } : {}, config: GATES, file: page, code: h.read(at(page)), expect: "none" });
|
|
246
|
+
const button = component('<button type="button">x</button>');
|
|
247
|
+
const ticket = (ref, checks, owner = false) => ({ ref, title: APP_TICKET_TITLES[ref], owner, checks });
|
|
248
|
+
const tokenProbe = (code, expect, mentions, file = PROBE) => all(h, tokenConfigs.map((config) => probe(code, expect, mentions, file, config)), `${tokenConfigs.join(" and ")}: as expected`);
|
|
249
|
+
return [
|
|
250
|
+
ticket("UIG-2", [
|
|
251
|
+
{ what: "npm run gates:status is wired", run: () => h.script("package.json", "gates:status") }
|
|
252
|
+
]),
|
|
253
|
+
ticket(chain.ref, [
|
|
254
|
+
{ what: "the gate lint config loads", run: () => h.loads(at(GATES)) },
|
|
255
|
+
{ what: `${at("package.json")} has lint:rules`, run: () => h.script(at("package.json"), "lint:rules") },
|
|
256
|
+
{ what: "CI runs lint:rules", run: () => h.ci("lint:rules") },
|
|
257
|
+
{ what: "the committed hook runs the gate lint", run: () => h.hook(".claude/settings.json", "gates") },
|
|
258
|
+
{ what: ".gates-count.json is committed and parses", run: () => h.json(h.exists(".gates-count.json") ? ".gates-count.json" : at(".gates-count.json")) },
|
|
259
|
+
{ what: "a raw <button> is an error naming Button", run: probe(button, "error", "Button") },
|
|
260
|
+
{ what: "the same in a story", run: probe(button, "error", "Button", "src/stories/__gates_probe__.stories.tsx") },
|
|
261
|
+
{ what: "a test file is not checked, while source is", run: async () => {
|
|
262
|
+
const source = await probe(button, "error", "Button")();
|
|
263
|
+
if (source.result !== "pass") return h.FAIL(`source is not checked yet, so this proves nothing: ${source.detail}`);
|
|
264
|
+
return probe(button, "none", void 0, "src/components/__gates_probe__.test.tsx")();
|
|
265
|
+
} },
|
|
266
|
+
{ what: "the debt list exists", run: () => h.file("docs/GATES-DEBT.md") }
|
|
267
|
+
], chain.owner),
|
|
268
|
+
ticket("UIG-6", [
|
|
269
|
+
{ what: "GitHub requires the check gate to merge into main", run: () => h.protectedBranch(/^gate$/) },
|
|
270
|
+
{ what: "CI's job gate runs lint:rules", run: () => h.ciJob("gate", "lint:rules") }
|
|
271
|
+
]),
|
|
272
|
+
ticket("UIG-7", [
|
|
273
|
+
{ what: "a raw <input> is an error naming TextInput", run: probe(component("<input />"), "error", "TextInput") },
|
|
274
|
+
{ what: "a raw <a> is an error naming Link", run: all(h, [probe(component('<a href="/topics">Topics</a>'), "error", "Link"), probe(component('<a href="/issues">Issues</a>'), "error", "Link")], "a raw <a> is an error naming Link") },
|
|
275
|
+
{ what: "a raw <form> is an error naming Form, and a file input one naming FilePicker", run: async () => {
|
|
276
|
+
const form = await probe(component("<form />"), "error", "`Form`")();
|
|
277
|
+
if (form.result !== "pass") return form;
|
|
278
|
+
return probe(component('<input type="file" />'), "error", "FilePicker")();
|
|
279
|
+
} },
|
|
280
|
+
{ what: "<textarea>, <select>, <dialog> and <label> name Textarea, Select, DialogShell and Field", run: async () => {
|
|
281
|
+
for (const [element, part] of [["textarea", "Textarea"], ["select", "Select"], ["dialog", "DialogShell"], ["label", "Field"]]) {
|
|
282
|
+
const one = await probe(component(`<${element} />`), "error", `\`${part}\``)();
|
|
283
|
+
if (one.result !== "pass") return one;
|
|
284
|
+
}
|
|
285
|
+
return h.PASS("all four are errors, each naming its part");
|
|
286
|
+
} },
|
|
287
|
+
{ what: "an element the package has no part for is an error that says to ask for one", run: probe(component('<iframe title="Map" />'), "error", "ask Katerina") },
|
|
288
|
+
{ what: "an escaped element is not an error, while the same element is", run: async () => {
|
|
289
|
+
const raw = await probe(component("<form />"), "error")();
|
|
290
|
+
if (raw.result !== "pass") return h.FAIL(`a raw <form> is not caught yet, so this proves nothing: ${raw.detail}`);
|
|
291
|
+
return probe("export function Probe() {\n return (\n // @estiva-escape: a probe that keeps its element on purpose\n <form />\n )\n}\n", "none")();
|
|
292
|
+
} },
|
|
293
|
+
{ what: "a real page, full of elements that are not controls, gets no error", run: realPage }
|
|
294
|
+
]),
|
|
295
|
+
ticket("UIG-8", [
|
|
296
|
+
{ what: "a Base UI import is an error naming the part built on it", run: probe("import { Popover } from '@base-ui/react/popover'\nexport const Probe = Popover\n", "error", "`Popover`") },
|
|
297
|
+
{ what: "createPortal is an error naming the floating parts", run: probe("import { createPortal } from 'react-dom'\nexport const Probe = (to: HTMLElement) => createPortal(<span />, to)\n", "error", "`DialogShell`") },
|
|
298
|
+
{ what: "a key listener on the whole page is an error, in a .ts file too", run: probe("export function listen() {\n window.addEventListener('keydown', () => {})\n}\n", "error", "`DialogShell`", "src/lib/__gates_probe__.ts") },
|
|
299
|
+
{ what: "arrow keys by hand are an error; Enter in a field is not", run: async () => {
|
|
300
|
+
const arrows = await probe("export const onKeyDown = (e: KeyboardEvent) => e.key === 'ArrowDown'\n", "error", "`Menu`", "src/lib/__gates_probe__.ts")();
|
|
301
|
+
if (arrows.result !== "pass") return arrows;
|
|
302
|
+
return probe("export const onKeyDown = (e: KeyboardEvent) => e.key === 'Enter'\n", "none", void 0, "src/lib/__gates_probe__.ts")();
|
|
303
|
+
} },
|
|
304
|
+
{ what: 'a hand-written role="option" is an error naming Select', run: probe(component('<div role="option" />'), "error", "`Select`") },
|
|
305
|
+
{ what: "tabIndex={0} on a div is an error; tabIndex={-1} is not", run: async () => {
|
|
306
|
+
const zero = await probe(component("<div tabIndex={0} />"), "error", "`Button`")();
|
|
307
|
+
if (zero.result !== "pass") return h.FAIL(`tabIndex={0} is not caught yet, so this proves nothing: ${zero.detail}`);
|
|
308
|
+
return probe(component("<div tabIndex={-1} />"), "none")();
|
|
309
|
+
} },
|
|
310
|
+
{ what: "overflow-y-auto is an error naming ScrollArea", run: probe(component('<div className="h-64 overflow-y-auto" />'), "error", "`ScrollArea`") },
|
|
311
|
+
{ what: "an escaped listener is not an error, while the same listener is", run: async () => {
|
|
312
|
+
const raw = await probe("export function listen() {\n document.addEventListener('mousedown', () => {})\n}\n", "error", void 0, "src/lib/__gates_probe__.ts")();
|
|
313
|
+
if (raw.result !== "pass") return h.FAIL(`a page listener is not caught yet, so this proves nothing: ${raw.detail}`);
|
|
314
|
+
return probe("export function listen() {\n // @estiva-escape: a probe that keeps its listener on purpose\n document.addEventListener('mousedown', () => {})\n}\n", "none", void 0, "src/lib/__gates_probe__.ts")();
|
|
315
|
+
} },
|
|
316
|
+
{ what: "a real page gets no error", run: realPage }
|
|
317
|
+
]),
|
|
318
|
+
ticket("UIG-9", [
|
|
319
|
+
{ what: "a border passed into Button is an error naming Button", run: probe(`import { Button } from '@estiva-app/ui'
|
|
320
|
+
${component('<Button className="border">x</Button>')}`, "error", "on `Button` changes how it looks") },
|
|
321
|
+
{ what: "placement passed into Button is not", run: probe(`import { Button } from '@estiva-app/ui'
|
|
322
|
+
${component('<Button className="mt-2 w-full flex-1 relative">x</Button>')}`, "none") },
|
|
323
|
+
{ what: "an escaped look is not an error, while the same look is", run: async () => {
|
|
324
|
+
const raw = await probe(`import { Link } from '@estiva-app/ui'
|
|
325
|
+
${component('<Link href="/x" className="after:absolute after:inset-0">x</Link>')}`, "error", "`Link`")();
|
|
326
|
+
if (raw.result !== "pass") return h.FAIL(`a restyled part is not caught yet, so this proves nothing: ${raw.detail}`);
|
|
327
|
+
return probe(`import { Link } from '@estiva-app/ui'
|
|
328
|
+
export function Probe() {
|
|
329
|
+
return (
|
|
330
|
+
// @estiva-escape: a probe that keeps its row link on purpose
|
|
331
|
+
<Link href="/x" className="after:absolute after:inset-0">x</Link>
|
|
332
|
+
)
|
|
333
|
+
}
|
|
334
|
+
`, "none")();
|
|
335
|
+
} },
|
|
336
|
+
{ what: "a real page gets no error", run: realPage }
|
|
337
|
+
]),
|
|
338
|
+
ticket("UIG-13", [
|
|
339
|
+
{ what: "registry.json is committed and has entries", run: () => h.json(h.exists("registry.json") ? "registry.json" : at("registry.json"), (d) => (d.entries ?? d.components ?? []).length > 0, "registry.json has entries") }
|
|
340
|
+
]),
|
|
341
|
+
ticket("UIG-19", [
|
|
342
|
+
{ what: "the usage-page contract runs in CI", run: () => h.ci(/[\w:-]*contract[\w:-]*/) }
|
|
343
|
+
]),
|
|
344
|
+
ticket("UIG-20", [
|
|
345
|
+
{ what: "a committed skill runs ui:find", run: () => h.listFiles(".claude/skills", (n) => n === "SKILL.md").some((f) => h.read(f).includes("ui:find")) ? h.PASS("a skill runs ui:find") : h.FAIL("no skill in .claude/skills runs ui:find") }
|
|
346
|
+
]),
|
|
347
|
+
ticket("UIG-21", [
|
|
348
|
+
{ what: "path-scoped instructions exist", run: () => h.listFiles(".claude/rules", (n) => n.endsWith(".md")).some((f) => /^paths:/m.test(h.read(f))) ? h.PASS(".claude/rules has paths: instructions") : h.FAIL("no .claude/rules file with paths:") }
|
|
349
|
+
]),
|
|
350
|
+
ticket("UIG-22", [
|
|
351
|
+
{ what: "a hand-made header row is an error naming the header part", run: all(h, headers.map((name) => probe(component(`<section className="flex flex-col"><div className="flex items-center px-3 py-2"><span>${name === "SectionHeader" ? "Issues" : "Folders"}</span></div><div /></section>`), "error", name)), "a hand-made header row is an error naming the header part") }
|
|
352
|
+
]),
|
|
353
|
+
ticket("UIG-23", [
|
|
354
|
+
{ what: "a hand-made empty line is an error naming EmptyState", run: probe('export function Probe({ items }: { items: string[] }) {\n return <div>{items.length === 0 ? <p className="text-text-secondary">Nothing here</p> : items.map((i) => <span key={i}>{i}</span>)}</div>\n}\n', "error", "EmptyState") }
|
|
355
|
+
]),
|
|
356
|
+
ticket("UIG-24", [
|
|
357
|
+
{ what: "a title= is an error naming WithTooltip", run: probe(`import { Button } from '@estiva-app/ui'
|
|
358
|
+
${component('<Button title="Delete">x</Button>')}`, "error", "WithTooltip") }
|
|
359
|
+
]),
|
|
360
|
+
ticket("UIG-25", [
|
|
361
|
+
{ what: "SectionLabel's class list, typed by hand, is a warning", run: probe(component('<span className="text-[10px] uppercase tracking-wide text-text-muted">Label</span>'), "warning", "SectionLabel") }
|
|
362
|
+
]),
|
|
363
|
+
ticket("UIG-27", [
|
|
364
|
+
{ what: "the installed package has Link", run: () => h.contains(installed, /\bLink\b/, "the installed @estiva-app/ui exports Link") },
|
|
365
|
+
{ what: "the installed package has ProgressBar", run: () => h.contains(installed, /\bProgressBar\b/, "the installed @estiva-app/ui exports ProgressBar") }
|
|
366
|
+
]),
|
|
367
|
+
ticket("UIG-28", [
|
|
368
|
+
{ what: "text-[14px] is an error", run: tokenProbe(component('<div className="text-[14px]">x</div>'), "error") },
|
|
369
|
+
{ what: "a colour in an inline style is an error", run: tokenProbe(component("<div style={{ backgroundColor: '#ff0000' }}>x</div>"), "error") },
|
|
370
|
+
{ what: "h-[240px] is a warning", run: tokenProbe(component('<div className="h-[240px]">x</div>'), "warning") },
|
|
371
|
+
{ what: "h-[240px] is not an error", run: tokenProbe(component('<div className="h-[240px]">x</div>'), "none") },
|
|
372
|
+
{ what: "a hand-written line height behind an arbitrary variant is an error", run: tokenProbe(component('<div className="[&_p]:leading-[1.4]">x</div>'), "error") },
|
|
373
|
+
{ what: "a raw colour in a class is an error (the pattern that matched nothing, R1)", run: tokenProbe(component('<div className="bg-[#5c69dc]">x</div>'), "error", "raw colour") },
|
|
374
|
+
{ what: "a width and height from a prop pass", run: tokenProbe("export function Probe({ size }: { size: number }) {\n return <div style={{ width: size, height: size }}>x</div>\n}\n", "none") },
|
|
375
|
+
{ what: "a test file is not checked for hand-written values, while source is", run: all(h, tokenConfigs.map((config) => async () => {
|
|
376
|
+
const code = component(`<div className="text-[14px]" style={{ color: 'red' }}>x</div>`);
|
|
377
|
+
const source = await probe(code, "error", void 0, PROBE, config)();
|
|
378
|
+
if (source.result !== "pass") return h.FAIL(`source is not checked yet, so this proves nothing: ${source.detail}`);
|
|
379
|
+
return probe(code, "none", void 0, "src/components/__gates_probe__.test.tsx", config)();
|
|
380
|
+
}), "a test file is not checked for hand-written values, while source is") }
|
|
381
|
+
]),
|
|
382
|
+
ticket("UIG-30", [
|
|
383
|
+
{ what: "the installed package has RichText", run: () => h.contains(installed, /\bRichText\b/, "the installed @estiva-app/ui exports RichText") }
|
|
384
|
+
]),
|
|
385
|
+
// Katerina's ruling of 17 September (docs/GATES.md §23): one copy, in the package. An app made
|
|
386
|
+
// by create-estiva-app passes this from its first commit; Peek and Ship do once UIG-32 lands.
|
|
387
|
+
ticket("UIG-32", [
|
|
388
|
+
{ what: "the gate pieces come from the package, and no repo keeps a copy", run: all(h, [
|
|
389
|
+
() => h.contains(at("eslint.gates.config.js"), /from '@estiva-app\/ui\/gates'/, "the gate config imports @estiva-app/ui/gates"),
|
|
390
|
+
() => h.hook(".claude/settings.json", "@estiva-app/ui/dist/gates/cli.js"),
|
|
391
|
+
// `estiva-gates status` where npm can find the command; by path where it cannot,
|
|
392
|
+
// because the install is in the app's folder and the script is in the repo's top one (Ship).
|
|
393
|
+
() => h.contains("package.json", /"gates:status":\s*"[^"]*(?:estiva-gates|@estiva-app\/ui\/dist\/gates\/cli\.js)[^"]*status/, "gates:status runs the package's engine"),
|
|
394
|
+
() => h.exists("scripts/gates-status.mjs") ? h.FAIL("scripts/gates-status.mjs is a copy of the status engine: run estiva-gates status instead") : h.PASS("no copy of the status engine")
|
|
395
|
+
], "the gate config, the hook and gates:status are the package's; no copy of the engine") }
|
|
396
|
+
])
|
|
397
|
+
];
|
|
398
|
+
}
|
|
399
|
+
export {
|
|
400
|
+
APP_TICKET_TITLES,
|
|
401
|
+
ENGINE,
|
|
402
|
+
TOKEN_LINT_IGNORES,
|
|
403
|
+
appChecks,
|
|
404
|
+
appFiles,
|
|
405
|
+
askNpm,
|
|
406
|
+
createApp,
|
|
407
|
+
gateConfig,
|
|
408
|
+
gateLint,
|
|
409
|
+
helpers,
|
|
410
|
+
runHook,
|
|
411
|
+
runStatus,
|
|
412
|
+
themes,
|
|
413
|
+
tokenLint,
|
|
414
|
+
tokenValues,
|
|
415
|
+
writeGateCount
|
|
416
|
+
};
|
|
417
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/gates/token-lint.ts", "../../src/gates/gate-config.ts", "../../src/gates/app-checks.ts"],
|
|
4
|
+
"sourcesContent": ["/// <reference types=\"node\" />\n/**\n * The token contract as lint settings, written once (docs/GATES.md \u00A723).\n *\n * Until UIG-10 this block was pasted into every repo: `eslint.config.js` here,\n * `eslint.tokens.js` in Peek, `eslint.config.js` in Ship. Katerina ruled on 17 September that a\n * gate piece ships in the package and an app imports it, so this is that one\n * copy. Peek and Ship move onto it in UIG-32.\n *\n * Two configs, as the copies had:\n *\n * - `tokenLint` \u2014 a class Tailwind does not generate (the doubled token name,\n * `bg-bg-surface`), Tailwind's own type ramp or palette, a raw colour, an\n * opacity modifier on a token colour.\n * - `tokenValues` \u2014 UIG-28: type, corners and shadows written by hand, and an\n * inline style that sets a colour (errors); heights, spacing and border\n * widths written by hand (warnings, never blocking).\n *\n * The patterns are the same for everyone. Only the words differ: an app is told\n * to use \"the package\", the package is told to add the token to `tokens.css`.\n * Measured on 17 September: the UIG-28 block was byte for byte the same in Peek\n * and Ship, and this repository's had the same patterns with seven messages\n * worded for the package.\n *\n * Where the plugin looks: every `className`, every `cn()` / `clsx()` argument,\n * and the values of a class map whose name ends in `Styles` / `_STYLES` or\n * `Classes` / `_CLASSES`. A class map named any other way is invisible to it.\n *\n * Tests are out of `tokenValues` (ruling of 13 September): a test mounts markup\n * to test it. A kept hand-written value says why:\n * `// eslint-disable-next-line <rule> -- @estiva-escape: <reason>` (A2).\n */\nimport { createRequire } from 'node:module'\nimport { fileURLToPath } from 'node:url'\nimport type { Linter } from 'eslint'\nimport betterTailwindcss from 'eslint-plugin-better-tailwindcss'\nimport { getDefaultSelectors } from 'eslint-plugin-better-tailwindcss/defaults'\nimport { parser as typescriptParser } from 'typescript-eslint'\n\n/** Who reads the messages. */\nexport type TokenAudience = 'app' | 'package'\n\nexport interface TokenLintOptions {\n /** The Tailwind config the unknown-class rule reads, relative to where ESLint runs. */\n tailwindConfig?: string\n /** `app` (the default) names the package; `package` names `tokens.css` and the preset. */\n audience?: TokenAudience\n}\n\n/** What the token lint never reads: build output. */\nexport const TOKEN_LINT_IGNORES = ['dist/', 'storybook-static/', 'node_modules/']\n\nconst CLASS_MAP_SELECTOR = {\n kind: 'variable',\n name: '^(?:[A-Z][A-Z0-9_]*_(?:STYLES|CLASSES)|[a-z][a-zA-Z0-9]*(?:Styles|Classes))$',\n match: [{ type: 'strings' }, { type: 'objectValues' }],\n}\n\nconst WORDS = {\n app: {\n ramp: \"Tailwind's type ramp is not a token. Use the ramp from the package: text-body-2, text-caption, text-h3, text-btn-default...\",\n palette: \"Tailwind's palette is not a token. Use a colour from the package (bg-bg-surface, text-text-primary, border-border-subtle...); a colour with no token is a missing token.\",\n raw: 'A raw colour is a missing token: add it to the package (tokens.css in every theme block, and the preset), or say why not in an eslint-disable comment.',\n opacity: 'An opacity modifier on a token colour compiles to nothing. A transparent colour is a token of its own (D16): add it to the package.',\n type: '$0 is type written by hand. A token from the package sets the size, line height, letter spacing and weight together (text-body-2, text-caption, text-h5...); if none fits, add one to the package, or say why not in an eslint-disable comment.',\n corner: '$0 is a corner written by hand, and no token has it. Use a corner from the package (rounded-sm 4px, rounded-md 6px, rounded-lg 8px...), or say why not in an eslint-disable comment.',\n shadow: '$0 is a shadow written by hand. Use a shadow from the package (shadow-sm, shadow-md, shadow-focus-ring, drop-shadow-glow-success...); a shadow with no token is a missing token.',\n },\n package: {\n ramp: \"Tailwind's type ramp is not a token. Use the ramp in tailwind-preset.js: text-body-2, text-caption, text-h3, text-btn-default...\",\n palette: \"Tailwind's palette is not a token. Use a colour from tailwind-preset.js (bg-bg-surface, text-text-primary, border-border-subtle...); a colour with no token is a missing token.\",\n raw: 'A raw colour is a missing token: add it to tokens.css in every theme block and to the preset, or say why not in an eslint-disable comment.',\n opacity: 'An opacity modifier on a token colour compiles to nothing. A transparent colour is a token of its own (D16): add it to tokens.css in every theme block and to the preset.',\n type: '$0 is type written by hand. A token from tailwind-preset.js sets the size, line height, letter spacing and weight together (text-body-2, text-caption, text-h5...); if none fits, add one to the preset and to cn.ts, or say why not in an eslint-disable comment.',\n corner: '$0 is a corner written by hand, and no token has it. Use a corner from tailwind-preset.js (rounded-sm 4px, rounded-md 6px, rounded-lg 8px...), or say why not in an eslint-disable comment.',\n shadow: '$0 is a shadow written by hand. Use a shadow from tailwind-preset.js (shadow-sm, shadow-md, shadow-focus-ring, drop-shadow-glow-success...); a shadow with no token is a missing token.',\n },\n} satisfies Record<TokenAudience, Record<string, string>>\n\n/**\n * The class rules. `no-unknown-classes` reads the app's own Tailwind config, so\n * it knows exactly what the preset and the app generate.\n */\nexport function tokenLint({ tailwindConfig = 'tailwind.config.js', audience = 'app' }: TokenLintOptions = {}): Linter.Config {\n const words = WORDS[audience]\n return {\n files: ['**/*.{ts,tsx}'],\n languageOptions: {\n parser: typescriptParser,\n parserOptions: { ecmaFeatures: { jsx: true } },\n },\n plugins: { 'better-tailwindcss': betterTailwindcss },\n settings: {\n 'better-tailwindcss': {\n tailwindConfig,\n selectors: [...getDefaultSelectors(), CLASS_MAP_SELECTOR],\n },\n },\n rules: {\n 'better-tailwindcss/no-unknown-classes': 'error',\n 'better-tailwindcss/no-restricted-classes': [\n 'error',\n {\n restrict: [\n { pattern: '^(?:[a-z0-9-]+:)*text-(?:xs|sm|base|lg|xl|[2-9]xl)$', message: words.ramp },\n {\n pattern:\n '^(?:[a-z0-9-]+:)*(?:text|bg|border|ring|outline|fill|stroke|decoration|divide|placeholder|from|via|to|accent|caret|shadow)-(?:black|white|slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)(?:-[0-9]{2,3})?(?:/[0-9]{1,3})?$',\n message: words.palette,\n },\n { pattern: '^(?:[a-z0-9-]+:)*[a-z-]+-\\\\[[^\\\\]]*(?:#[0-9a-fA-F]{3}|rgba?\\\\(|hsla?\\\\(|oklch\\\\()', message: words.raw },\n {\n pattern: '^(?:[a-z0-9-]+:)*(?:text|bg|border|ring|outline|fill|stroke|decoration|divide|placeholder|from|via|to|accent|caret|shadow)-(?:bg|text|border|accent|info|warning|success|error)-[a-z-]+/[0-9]{1,3}$',\n message: words.opacity,\n },\n ],\n },\n ],\n },\n }\n}\n\n// UIG-28's patterns. The variant part reads arbitrary variants too\n// (`[&_pre]:`, `data-[state]:`, `group-hover/row:`). A colour inside `text-[\u2026]`\n// is left to the raw-colour rule of `tokenLint`.\nconst V = '^(?:(?:[^:\\\\[\\\\]\\\\s]|\\\\[[^\\\\]]*\\\\])+:)*!?'\nconst NOT_COLOUR = '(?!color:|#|rgba?\\\\(|hsla?\\\\(|oklch\\\\(|var\\\\()'\nconst HAND_WRITTEN = {\n type: `${V}(?:text-\\\\[${NOT_COLOUR}|text-\\\\[length:|leading-\\\\[|tracking-\\\\[)[^\\\\]]+\\\\](?:/\\\\S*)?$`,\n corner: `${V}rounded(?:-(?:t|r|b|l|s|e|tl|tr|br|bl|ss|se|es|ee))?-\\\\[[^\\\\]]+\\\\]$`,\n shadow: `${V}(?:shadow|drop-shadow)-\\\\[(?!color:)[^\\\\]]+\\\\]$`,\n spacing: `${V}-?(?:w|h|size|min-w|min-h|max-w|max-h|p[xytrblse]?|m[xytrblse]?|gap(?:-[xy])?|space-[xy]|inset(?:-[xy])?|top|right|bottom|left|translate-[xy]|basis|indent|scroll-[mp][xytrblse]?|border-spacing(?:-[xy])?)-\\\\[[^\\\\]]+\\\\]$`,\n width: `${V}(?:border(?:-[xytrblse])?|divide-[xy]|outline|ring|ring-offset)-\\\\[(?:length:)?-?[0-9.]+(?:px|rem|em)?\\\\]$`,\n}\n\nconst INLINE_STYLE_TOKEN_PROPERTIES =\n '/^(color|background|backgroundColor|backgroundImage|fill|stroke|fontSize|border|borderTop|borderRight|borderBottom|borderLeft|borderBlock|borderInline|borderStyle|boxShadow|textShadow)$|Color$/'\n\ninterface Preset {\n theme: { extend: { fontSize: Record<string, string | [string, unknown]>; borderRadius: Record<string, string> } }\n}\n\n/**\n * The preset, loaded the way Tailwind loads it: it imports `tailwindcss/plugin`,\n * which a plain `import` cannot resolve. Read from beside this module, so an app\n * and this repository read the one preset the package ships.\n */\nfunction loadPreset(): Preset {\n const require = createRequire(import.meta.url)\n const loadConfig = require('tailwindcss/loadConfig') as (path: string) => Preset\n return loadConfig(fileURLToPath(new URL('../../tailwind-preset.js', import.meta.url)))\n}\n\n/**\n * UIG-28: the values the tokens already name, written by hand (Katerina's\n * rulings B11, B12, C3 of 13 September and R2 of 15 September). Register it\n * after `tokenLint`, whose parser and plugin settings it borrows. Under its own\n * rule names, `token-values` and `token-spacing` (the same plugin twice, so one\n * runs as errors and one as warnings): an escape for a hand-written size then\n * cannot also silence a raw colour on the same line.\n */\nexport function tokenValues({ audience = 'app' }: Pick<TokenLintOptions, 'audience'> = {}): Linter.Config {\n const words = WORDS[audience]\n const preset = loadPreset()\n // `text-[14px]` names the token of that size, read from the preset, so the\n // message stays true when the ramp changes.\n const tokensBySize: Record<string, string[]> = {}\n for (const [name, value] of Object.entries(preset.theme.extend.fontSize)) {\n const size = Array.isArray(value) ? value[0] : value\n ;(tokensBySize[size] ??= []).push(`text-${name}`)\n }\n const cornersBySize: Record<string, string[]> = {}\n for (const [name, size] of Object.entries(preset.theme.extend.borderRadius)) (cornersBySize[size] ??= []).push(name === 'DEFAULT' ? 'rounded' : `rounded-${name}`)\n\n return {\n files: ['**/*.{ts,tsx}'],\n ignores: ['**/*.test.ts', '**/*.test.tsx'],\n plugins: { 'token-values': betterTailwindcss, 'token-spacing': betterTailwindcss },\n rules: {\n 'token-values/no-restricted-classes': [\n 'error',\n {\n restrict: [\n ...Object.entries(tokensBySize).map(([size, names]) => ({\n pattern: `${V}text-\\\\[${size.replace('.', '\\\\.')}\\\\](?:/\\\\S*)?$`,\n message: `$0 is the type ramp written by hand. Use ${names.join(' or ')}.`,\n })),\n {\n pattern: HAND_WRITTEN.type,\n message: words.type,\n },\n ...Object.entries(cornersBySize).map(([size, names]) => ({\n pattern: `${V}rounded(?:-(?:t|r|b|l|s|e|tl|tr|br|bl|ss|se|es|ee))?-\\\\[${size.replace('.', '\\\\.')}\\\\]$`,\n message: `$0 is a corner written by hand. Use ${names.join(' or ')} (with the same side, if it has one).`,\n })),\n {\n pattern: HAND_WRITTEN.corner,\n message: words.corner,\n },\n {\n pattern: HAND_WRITTEN.shadow,\n message: words.shadow,\n },\n ],\n },\n ],\n 'token-spacing/no-restricted-classes': [\n 'warn',\n {\n restrict: [\n {\n pattern: HAND_WRITTEN.spacing,\n message: '$0 is a size or a space written by hand. Use a step of the spacing scale (p-3, h-9, gap-2...) if one fits. Reported, not blocked.',\n },\n {\n pattern: HAND_WRITTEN.width,\n message: '$0 is a border or ring width written by hand. Use border, border-2, ring-1... if one fits. Reported, not blocked.',\n },\n ],\n },\n ],\n 'no-restricted-syntax': [\n 'error',\n {\n selector: `JSXAttribute[name.name=\"style\"] > JSXExpressionContainer > ObjectExpression > Property[key.name=${INLINE_STYLE_TOKEN_PROPERTIES}]`,\n message: 'An inline style that sets a colour, a font size, a border or a shadow is outside the token contract: use a token class. If the value is computed (a palette, a size from a prop), say why in an eslint-disable comment. Width, height and transforms are fine.',\n },\n ],\n },\n }\n}\n", "/// <reference types=\"node\" />\n/**\n * Where the UI Guardrails' rules apply, written once (docs/GATES.md \u00A723).\n *\n * Until UIG-10 every repo wrote this itself: `eslint.gates.js` (the rules and\n * where they apply) and `eslint.gates.config.js` (the gate: those rules alone)\n * in Peek, in Ship's `web/`, and here pointed inward. The rules were always the\n * package's; these two files were copies. Now they are two functions.\n *\n * Where: every `.ts` and `.tsx` under `src`, stories included (a story is what\n * people read and copy), tests not (a test mounts markup to test it) \u2014\n * Katerina's rulings of 13 September; `.ts` since UIG-8. This package's own\n * inward set reads `.tsx` only, as it always has.\n *\n * A place that keeps something says why, on the line above:\n * `// @estiva-escape: <reason>`, or `{/* @estiva-escape: <reason> *\\/}` as a\n * JSX child. Never `eslint-disable`: the count refuses it.\n */\nimport type { ESLint, Linter } from 'eslint'\nimport betterTailwindcss from 'eslint-plugin-better-tailwindcss'\nimport { parser as typescriptParser } from 'typescript-eslint'\nimport estiva from '../eslint/index'\nimport { TOKEN_LINT_IGNORES } from './token-lint'\n\nexport interface GateConfigOptions {\n /** `app` (the default) runs `configs.recommended`; `package` runs this package's inward set. */\n audience?: 'app' | 'package'\n /**\n * Plugins whose `eslint-disable` directives appear in the source, registered\n * here with every rule off. ESLint refuses a directive for a rule it does not\n * know, so without them the gate would fail on another lint's comments.\n * The token lint's names are registered already.\n */\n quiet?: Record<string, ESLint.Plugin>\n /** Folders the gate never reads, beside build output. */\n ignores?: string[]\n}\n\n/**\n * The rules and where they apply \u2014 one config object, to add beside\n * everything else an app's `eslint.config.js` runs, so an editor shows a\n * refusal where the element is typed.\n */\nexport function gateLint({ audience = 'app' }: Pick<GateConfigOptions, 'audience'> = {}): Linter.Config {\n return {\n ...(audience === 'package' ? estiva.configs.package : estiva.configs.recommended),\n files: audience === 'package' ? ['src/**/*.tsx'] : ['src/**/*.{ts,tsx}'],\n ignores: ['**/*.test.ts', '**/*.test.tsx'],\n languageOptions: {\n parser: typescriptParser,\n parserOptions: { ecmaFeatures: { jsx: true } },\n },\n }\n}\n\n/**\n * The gate: the rules on their own \u2014 `npm run lint:rules`, CI's job `gate`, and\n * the config the editor hook lints a proposed write with. It fails on a gate\n * rule and on nothing else, so a backlog in the full lint never blocks it.\n */\nexport function gateConfig({ audience = 'app', quiet = {}, ignores = [] }: GateConfigOptions = {}): Linter.Config[] {\n return [\n { ignores: [...TOKEN_LINT_IGNORES, ...ignores] },\n {\n plugins: {\n ...quiet,\n 'better-tailwindcss': betterTailwindcss,\n 'token-values': betterTailwindcss,\n 'token-spacing': betterTailwindcss,\n },\n // Every other config's directives are unused here, because their rules are\n // off here. Reporting them would be this config complaining about the\n // others' business.\n linterOptions: { reportUnusedDisableDirectives: 'off' },\n },\n gateLint({ audience }),\n ]\n}\n", "/// <reference types=\"node\" />\n/**\n * The gate checks every app runs, written once (docs/GATES.md \u00A723).\n *\n * Until UIG-10 Peek and Ship each wrote them into their own\n * `scripts/gates-checks.mjs`. 65 different checks for finished tickets, counted\n * on 17 September: 28 were identical in both, 21 were the same check written two\n * ways, 2 read each app's real page, and 14 read code only one app has. This is\n * the first three groups as one list. The fourth stays in the app's own checks\n * file, beside this list.\n *\n * Where Peek and Ship wrote one check two ways, the check here runs both, so it\n * passes wherever either did: the raw-link probe with both of their texts, the\n * token probes against each token config the app has.\n *\n * `scripts/gates-compare.mjs` holds this list to Peek's and Ship's: every check\n * of theirs must be here, or be about code only that app has, or the comparison\n * fails and names it.\n *\n * A check for a ticket not built yet is a first guess at the evidence, taken\n * from the ticket's own text; the ticket that builds it changes it here.\n */\nimport type { CheckResult, GateCheck, GateHelpers, GateTicket } from './status'\n\nexport interface AppCheckOptions {\n /** Where the app is inside the repository: `web` in Ship, `.` elsewhere. */\n app?: string\n /** A real page of the app, relative to the app, full of elements that are not controls. */\n page: string\n /** The ticket the gate chain is listed under, and whether this repo owns it: UIG-3 in Peek, UIG-4 in Ship. */\n chain?: { ref: string; owner: boolean }\n /** The token lint configs the app has, relative to the app. */\n tokenConfigs?: string[]\n /** The name of the app's header component a hand-made header row should name (UIG-22's first guess). */\n headers?: string[]\n}\n\nexport const APP_TICKET_TITLES: Record<string, string> = {\n 'UIG-2': 'The tracking rails \u2014 GATES.md, the status script, the guide committed',\n 'UIG-3': 'Tracer bullet \u2014 one rule, end to end, blocking in Peek',\n 'UIG-4': 'The same chain, blocking in Ship',\n 'UIG-6': 'Branch protection \u2014 the backstop, all three repos',\n 'UIG-7': 'Lint rule \u2014 every remaining raw element',\n 'UIG-8': 'Lint rule \u2014 forbid the reach',\n 'UIG-9': 'Lint rule \u2014 the className allow-list',\n 'UIG-13': \"The registry widens to Peek's 115 and Ship's 74, with classification\",\n 'UIG-19': 'Lock the contract in CI, and make the three Storybooks one search',\n 'UIG-20': 'The Claude skill, reading the registry',\n 'UIG-21': 'CLAUDE.md becomes an index, not a lecture',\n 'UIG-22': 'Fingerprint \u2014 a hand-made header row',\n 'UIG-23': 'Fingerprint \u2014 a hand-made empty state',\n 'UIG-24': 'Fingerprint \u2014 a browser tooltip where ours belongs',\n 'UIG-25': 'Fingerprint \u2014 a component copied out by hand',\n 'UIG-27': 'The components the apps had to build themselves \u2014 Link, ProgressBar, EmptyState padding',\n 'UIG-28': 'Close the two holes in the token contract \u2014 arbitrary values, and inline style',\n 'UIG-30': 'RichText \u2014 one component that draws a message\\'s text, for both apps',\n 'UIG-32': 'Peek and Ship take their gate pieces from the package',\n}\n\n/** Run several checks as one: the first that does not pass is the answer. */\nfunction all(h: GateHelpers, steps: (() => CheckResult | Promise<CheckResult>)[], label: string): () => Promise<CheckResult> {\n return async () => {\n for (const step of steps) {\n const r = await step()\n if (r.result !== 'pass') return r\n }\n return h.PASS(label)\n }\n}\n\nexport function appChecks(h: GateHelpers, { app = '.', page, chain = { ref: 'UIG-3', owner: false }, tokenConfigs = ['eslint.tokens.config.js', 'eslint.config.js'], headers = ['ContainerHeader', 'SectionHeader'] }: AppCheckOptions): GateTicket[] {\n const WEB = app === '.' ? '' : `${app.replace(/\\/$/, '')}/`\n const cwd = app === '.' ? undefined : app\n const PROBE = 'src/components/__gates_probe__.tsx'\n const GATES = 'eslint.gates.config.js'\n const at = (rel: string) => `${WEB}${rel}`\n const probe = (code: string, expect: 'error' | 'warning' | 'none', mentions?: string, file = PROBE, config = GATES) => () =>\n h.lint({ ...(cwd ? { cwd } : {}), config, file, code, expect, mentions })\n const component = (body: string) => `export function Probe() {\\n return ${body}\\n}\\n`\n const installed = at('node_modules/@estiva-app/ui/dist/index.d.ts')\n const realPage = (): Promise<CheckResult> => h.lint({ ...(cwd ? { cwd } : {}), config: GATES, file: page, code: h.read(at(page)), expect: 'none' })\n const button = component('<button type=\"button\">x</button>')\n const ticket = (ref: string, checks: GateCheck[], owner = false): GateTicket => ({ ref, title: APP_TICKET_TITLES[ref], owner, checks })\n\n const tokenProbe = (code: string, expect: 'error' | 'warning' | 'none', mentions?: string, file = PROBE) =>\n all(h, tokenConfigs.map((config) => probe(code, expect, mentions, file, config)), `${tokenConfigs.join(' and ')}: as expected`)\n\n return [\n ticket('UIG-2', [\n { what: 'npm run gates:status is wired', run: () => h.script('package.json', 'gates:status') },\n ]),\n ticket(chain.ref, [\n { what: 'the gate lint config loads', run: () => h.loads(at(GATES)) },\n { what: `${at('package.json')} has lint:rules`, run: () => h.script(at('package.json'), 'lint:rules') },\n { what: 'CI runs lint:rules', run: () => h.ci('lint:rules') },\n { what: 'the committed hook runs the gate lint', run: () => h.hook('.claude/settings.json', 'gates') },\n { what: '.gates-count.json is committed and parses', run: () => h.json(h.exists('.gates-count.json') ? '.gates-count.json' : at('.gates-count.json')) },\n { what: 'a raw <button> is an error naming Button', run: probe(button, 'error', 'Button') },\n { what: 'the same in a story', run: probe(button, 'error', 'Button', 'src/stories/__gates_probe__.stories.tsx') },\n { what: 'a test file is not checked, while source is', run: async () => {\n const source = await probe(button, 'error', 'Button')()\n if (source.result !== 'pass') return h.FAIL(`source is not checked yet, so this proves nothing: ${source.detail}`)\n return probe(button, 'none', undefined, 'src/components/__gates_probe__.test.tsx')()\n } },\n { what: 'the debt list exists', run: () => h.file('docs/GATES-DEBT.md') },\n ], chain.owner),\n ticket('UIG-6', [\n { what: 'GitHub requires the check gate to merge into main', run: () => h.protectedBranch(/^gate$/) },\n { what: \"CI's job gate runs lint:rules\", run: () => h.ciJob('gate', 'lint:rules') },\n ]),\n ticket('UIG-7', [\n { what: 'a raw <input> is an error naming TextInput', run: probe(component('<input />'), 'error', 'TextInput') },\n { what: 'a raw <a> is an error naming Link', run: all(h, [probe(component('<a href=\"/topics\">Topics</a>'), 'error', 'Link'), probe(component('<a href=\"/issues\">Issues</a>'), 'error', 'Link')], 'a raw <a> is an error naming Link') },\n { what: 'a raw <form> is an error naming Form, and a file input one naming FilePicker', run: async () => {\n const form = await probe(component('<form />'), 'error', '`Form`')()\n if (form.result !== 'pass') return form\n return probe(component('<input type=\"file\" />'), 'error', 'FilePicker')()\n } },\n { what: '<textarea>, <select>, <dialog> and <label> name Textarea, Select, DialogShell and Field', run: async () => {\n for (const [element, part] of [['textarea', 'Textarea'], ['select', 'Select'], ['dialog', 'DialogShell'], ['label', 'Field']]) {\n const one = await probe(component(`<${element} />`), 'error', `\\`${part}\\``)()\n if (one.result !== 'pass') return one\n }\n return h.PASS('all four are errors, each naming its part')\n } },\n { what: 'an element the package has no part for is an error that says to ask for one', run: probe(component('<iframe title=\"Map\" />'), 'error', 'ask Katerina') },\n { what: 'an escaped element is not an error, while the same element is', run: async () => {\n const raw = await probe(component('<form />'), 'error')()\n if (raw.result !== 'pass') return h.FAIL(`a raw <form> is not caught yet, so this proves nothing: ${raw.detail}`)\n return probe('export function Probe() {\\n return (\\n // @estiva-escape: a probe that keeps its element on purpose\\n <form />\\n )\\n}\\n', 'none')()\n } },\n { what: 'a real page, full of elements that are not controls, gets no error', run: realPage },\n ]),\n ticket('UIG-8', [\n { what: 'a Base UI import is an error naming the part built on it', run: probe(\"import { Popover } from '@base-ui/react/popover'\\nexport const Probe = Popover\\n\", 'error', '`Popover`') },\n { what: 'createPortal is an error naming the floating parts', run: probe(\"import { createPortal } from 'react-dom'\\nexport const Probe = (to: HTMLElement) => createPortal(<span />, to)\\n\", 'error', '`DialogShell`') },\n { what: 'a key listener on the whole page is an error, in a .ts file too', run: probe(\"export function listen() {\\n window.addEventListener('keydown', () => {})\\n}\\n\", 'error', '`DialogShell`', 'src/lib/__gates_probe__.ts') },\n { what: 'arrow keys by hand are an error; Enter in a field is not', run: async () => {\n const arrows = await probe(\"export const onKeyDown = (e: KeyboardEvent) => e.key === 'ArrowDown'\\n\", 'error', '`Menu`', 'src/lib/__gates_probe__.ts')()\n if (arrows.result !== 'pass') return arrows\n return probe(\"export const onKeyDown = (e: KeyboardEvent) => e.key === 'Enter'\\n\", 'none', undefined, 'src/lib/__gates_probe__.ts')()\n } },\n { what: 'a hand-written role=\"option\" is an error naming Select', run: probe(component('<div role=\"option\" />'), 'error', '`Select`') },\n { what: 'tabIndex={0} on a div is an error; tabIndex={-1} is not', run: async () => {\n const zero = await probe(component('<div tabIndex={0} />'), 'error', '`Button`')()\n if (zero.result !== 'pass') return h.FAIL(`tabIndex={0} is not caught yet, so this proves nothing: ${zero.detail}`)\n return probe(component('<div tabIndex={-1} />'), 'none')()\n } },\n { what: 'overflow-y-auto is an error naming ScrollArea', run: probe(component('<div className=\"h-64 overflow-y-auto\" />'), 'error', '`ScrollArea`') },\n { what: 'an escaped listener is not an error, while the same listener is', run: async () => {\n const raw = await probe(\"export function listen() {\\n document.addEventListener('mousedown', () => {})\\n}\\n\", 'error', undefined, 'src/lib/__gates_probe__.ts')()\n if (raw.result !== 'pass') return h.FAIL(`a page listener is not caught yet, so this proves nothing: ${raw.detail}`)\n return probe(\"export function listen() {\\n // @estiva-escape: a probe that keeps its listener on purpose\\n document.addEventListener('mousedown', () => {})\\n}\\n\", 'none', undefined, 'src/lib/__gates_probe__.ts')()\n } },\n { what: 'a real page gets no error', run: realPage },\n ]),\n ticket('UIG-9', [\n { what: 'a border passed into Button is an error naming Button', run: probe(`import { Button } from '@estiva-app/ui'\\n${component('<Button className=\"border\">x</Button>')}`, 'error', 'on `Button` changes how it looks') },\n { what: 'placement passed into Button is not', run: probe(`import { Button } from '@estiva-app/ui'\\n${component('<Button className=\"mt-2 w-full flex-1 relative\">x</Button>')}`, 'none') },\n { what: 'an escaped look is not an error, while the same look is', run: async () => {\n const raw = await probe(`import { Link } from '@estiva-app/ui'\\n${component('<Link href=\"/x\" className=\"after:absolute after:inset-0\">x</Link>')}`, 'error', '`Link`')()\n if (raw.result !== 'pass') return h.FAIL(`a restyled part is not caught yet, so this proves nothing: ${raw.detail}`)\n return probe(`import { Link } from '@estiva-app/ui'\\nexport function Probe() {\\n return (\\n // @estiva-escape: a probe that keeps its row link on purpose\\n <Link href=\"/x\" className=\"after:absolute after:inset-0\">x</Link>\\n )\\n}\\n`, 'none')()\n } },\n { what: 'a real page gets no error', run: realPage },\n ]),\n ticket('UIG-13', [\n { what: 'registry.json is committed and has entries', run: () => h.json(h.exists('registry.json') ? 'registry.json' : at('registry.json'), (d) => ((d as { entries?: unknown[]; components?: unknown[] }).entries ?? (d as { components?: unknown[] }).components ?? []).length > 0, 'registry.json has entries') },\n ]),\n ticket('UIG-19', [\n { what: 'the usage-page contract runs in CI', run: () => h.ci(/[\\w:-]*contract[\\w:-]*/) },\n ]),\n ticket('UIG-20', [\n { what: 'a committed skill runs ui:find', run: () => (h.listFiles('.claude/skills', (n) => n === 'SKILL.md').some((f) => h.read(f).includes('ui:find')) ? h.PASS('a skill runs ui:find') : h.FAIL('no skill in .claude/skills runs ui:find')) },\n ]),\n ticket('UIG-21', [\n { what: 'path-scoped instructions exist', run: () => (h.listFiles('.claude/rules', (n) => n.endsWith('.md')).some((f) => /^paths:/m.test(h.read(f))) ? h.PASS('.claude/rules has paths: instructions') : h.FAIL('no .claude/rules file with paths:')) },\n ]),\n ticket('UIG-22', [\n { what: 'a hand-made header row is an error naming the header part', run: all(h, headers.map((name) => probe(component(`<section className=\"flex flex-col\"><div className=\"flex items-center px-3 py-2\"><span>${name === 'SectionHeader' ? 'Issues' : 'Folders'}</span></div><div /></section>`), 'error', name)), 'a hand-made header row is an error naming the header part') },\n ]),\n ticket('UIG-23', [\n { what: 'a hand-made empty line is an error naming EmptyState', run: probe(\"export function Probe({ items }: { items: string[] }) {\\n return <div>{items.length === 0 ? <p className=\\\"text-text-secondary\\\">Nothing here</p> : items.map((i) => <span key={i}>{i}</span>)}</div>\\n}\\n\", 'error', 'EmptyState') },\n ]),\n ticket('UIG-24', [\n { what: 'a title= is an error naming WithTooltip', run: probe(`import { Button } from '@estiva-app/ui'\\n${component('<Button title=\"Delete\">x</Button>')}`, 'error', 'WithTooltip') },\n ]),\n ticket('UIG-25', [\n { what: \"SectionLabel's class list, typed by hand, is a warning\", run: probe(component('<span className=\"text-[10px] uppercase tracking-wide text-text-muted\">Label</span>'), 'warning', 'SectionLabel') },\n ]),\n ticket('UIG-27', [\n { what: 'the installed package has Link', run: () => h.contains(installed, /\\bLink\\b/, 'the installed @estiva-app/ui exports Link') },\n { what: 'the installed package has ProgressBar', run: () => h.contains(installed, /\\bProgressBar\\b/, 'the installed @estiva-app/ui exports ProgressBar') },\n ]),\n ticket('UIG-28', [\n { what: 'text-[14px] is an error', run: tokenProbe(component('<div className=\"text-[14px]\">x</div>'), 'error') },\n { what: 'a colour in an inline style is an error', run: tokenProbe(component(\"<div style={{ backgroundColor: '#ff0000' }}>x</div>\"), 'error') },\n { what: 'h-[240px] is a warning', run: tokenProbe(component('<div className=\"h-[240px]\">x</div>'), 'warning') },\n { what: 'h-[240px] is not an error', run: tokenProbe(component('<div className=\"h-[240px]\">x</div>'), 'none') },\n { what: 'a hand-written line height behind an arbitrary variant is an error', run: tokenProbe(component('<div className=\"[&_p]:leading-[1.4]\">x</div>'), 'error') },\n { what: 'a raw colour in a class is an error (the pattern that matched nothing, R1)', run: tokenProbe(component('<div className=\"bg-[#5c69dc]\">x</div>'), 'error', 'raw colour') },\n { what: 'a width and height from a prop pass', run: tokenProbe(\"export function Probe({ size }: { size: number }) {\\n return <div style={{ width: size, height: size }}>x</div>\\n}\\n\", 'none') },\n { what: 'a test file is not checked for hand-written values, while source is', run: all(h, tokenConfigs.map((config) => async () => {\n const code = component(\"<div className=\\\"text-[14px]\\\" style={{ color: 'red' }}>x</div>\")\n const source = await probe(code, 'error', undefined, PROBE, config)()\n if (source.result !== 'pass') return h.FAIL(`source is not checked yet, so this proves nothing: ${source.detail}`)\n return probe(code, 'none', undefined, 'src/components/__gates_probe__.test.tsx', config)()\n }), 'a test file is not checked for hand-written values, while source is') },\n ]),\n ticket('UIG-30', [\n { what: 'the installed package has RichText', run: () => h.contains(installed, /\\bRichText\\b/, 'the installed @estiva-app/ui exports RichText') },\n ]),\n // Katerina's ruling of 17 September (docs/GATES.md \u00A723): one copy, in the package. An app made\n // by create-estiva-app passes this from its first commit; Peek and Ship do once UIG-32 lands.\n ticket('UIG-32', [\n { what: 'the gate pieces come from the package, and no repo keeps a copy', run: all(h, [\n () => h.contains(at('eslint.gates.config.js'), /from '@estiva-app\\/ui\\/gates'/, 'the gate config imports @estiva-app/ui/gates'),\n () => h.hook('.claude/settings.json', '@estiva-app/ui/dist/gates/cli.js'),\n // `estiva-gates status` where npm can find the command; by path where it cannot,\n // because the install is in the app's folder and the script is in the repo's top one (Ship).\n () => h.contains('package.json', /\"gates:status\":\\s*\"[^\"]*(?:estiva-gates|@estiva-app\\/ui\\/dist\\/gates\\/cli\\.js)[^\"]*status/, \"gates:status runs the package's engine\"),\n () => (h.exists('scripts/gates-status.mjs') ? h.FAIL('scripts/gates-status.mjs is a copy of the status engine: run estiva-gates status instead') : h.PASS('no copy of the status engine')),\n ], 'the gate config, the hook and gates:status are the package\\'s; no copy of the engine') },\n ]),\n ]\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAgCA,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAE9B,OAAO,uBAAuB;AAC9B,SAAS,2BAA2B;AACpC,SAAS,UAAU,wBAAwB;AAapC,IAAM,qBAAqB,CAAC,SAAS,qBAAqB,eAAe;AAEhF,IAAM,qBAAqB;AAAA,EACzB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO,CAAC,EAAE,MAAM,UAAU,GAAG,EAAE,MAAM,eAAe,CAAC;AACvD;AAEA,IAAM,QAAQ;AAAA,EACZ,KAAK;AAAA,IACH,MAAM;AAAA,IACN,SAAS;AAAA,IACT,KAAK;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,SAAS;AAAA,IACP,MAAM;AAAA,IACN,SAAS;AAAA,IACT,KAAK;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AACF;AAMO,SAAS,UAAU,EAAE,iBAAiB,sBAAsB,WAAW,MAAM,IAAsB,CAAC,GAAkB;AAC3H,QAAM,QAAQ,MAAM,QAAQ;AAC5B,SAAO;AAAA,IACL,OAAO,CAAC,eAAe;AAAA,IACvB,iBAAiB;AAAA,MACf,QAAQ;AAAA,MACR,eAAe,EAAE,cAAc,EAAE,KAAK,KAAK,EAAE;AAAA,IAC/C;AAAA,I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+CAA+C,EAAE;AAAA,IAClJ,CAAC;AAAA;AAAA;AAAA,IAGD,OAAO,UAAU;AAAA,MACf,EAAE,MAAM,mEAAmE,KAAK,IAAI,GAAG;AAAA,QACrF,MAAM,EAAE,SAAS,GAAG,wBAAwB,GAAG,iCAAiC,8CAA8C;AAAA,QAC9H,MAAM,EAAE,KAAK,yBAAyB,kCAAkC;AAAA;AAAA;AAAA,QAGxE,MAAM,EAAE,SAAS,gBAAgB,6FAA6F,wCAAwC;AAAA,QACtK,MAAO,EAAE,OAAO,0BAA0B,IAAI,EAAE,KAAK,0FAA0F,IAAI,EAAE,KAAK,8BAA8B;AAAA,MAC1L,GAAG,qFAAsF,EAAE;AAAA,IAC7F,CAAC;AAAA,EACH;AACF;",
|
|
6
|
+
"names": ["require", "betterTailwindcss", "typescriptParser", "typescriptParser", "betterTailwindcss"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export type CheckResult = {
|
|
2
|
+
result: 'pass' | 'fail' | 'part' | 'unknown';
|
|
3
|
+
detail: string;
|
|
4
|
+
};
|
|
5
|
+
type Maybe<T> = T | Promise<T>;
|
|
6
|
+
export interface LintProbe {
|
|
7
|
+
/** The folder ESLint runs from, relative to the repo: `web` in Ship. */
|
|
8
|
+
cwd?: string;
|
|
9
|
+
/** The config file, relative to `cwd`. */
|
|
10
|
+
config: string;
|
|
11
|
+
/** The path the text is linted as, relative to `cwd`. Nothing is written. */
|
|
12
|
+
file: string;
|
|
13
|
+
code: string;
|
|
14
|
+
expect: 'error' | 'warning' | 'none';
|
|
15
|
+
/** Words the expected message must contain. */
|
|
16
|
+
mentions?: string;
|
|
17
|
+
}
|
|
18
|
+
/** The helpers a checks file is written with. */
|
|
19
|
+
export interface GateHelpers {
|
|
20
|
+
PASS(detail: string): CheckResult;
|
|
21
|
+
FAIL(detail: string): CheckResult;
|
|
22
|
+
PART(detail: string): CheckResult;
|
|
23
|
+
UNKNOWN(detail: string): CheckResult;
|
|
24
|
+
exists(rel: string): boolean;
|
|
25
|
+
read(rel: string): string;
|
|
26
|
+
listFiles(rel: string, test: (name: string, path: string) => boolean): string[];
|
|
27
|
+
file(rel: string): CheckResult;
|
|
28
|
+
committed(rel: string): CheckResult;
|
|
29
|
+
contains(rel: string, needle: string | RegExp, label?: string): CheckResult;
|
|
30
|
+
lacks(rel: string, needle: string | RegExp, label?: string): CheckResult;
|
|
31
|
+
script(pkgRel: string, name: string): CheckResult;
|
|
32
|
+
loads(rel: string): Promise<CheckResult>;
|
|
33
|
+
ci(script: string | RegExp): CheckResult;
|
|
34
|
+
ciJob(job: string, script: string): CheckResult;
|
|
35
|
+
hook(settingsRel: string, needle: string): CheckResult;
|
|
36
|
+
json(rel: string, test?: (data: unknown) => boolean, label?: string): CheckResult;
|
|
37
|
+
lint(probe: LintProbe): Promise<CheckResult>;
|
|
38
|
+
protectedBranch(pattern: RegExp): CheckResult;
|
|
39
|
+
gh(args: string[], label: string): CheckResult;
|
|
40
|
+
share(files: string[], test: (file: string) => boolean, label: string): CheckResult;
|
|
41
|
+
}
|
|
42
|
+
export interface GateCheck {
|
|
43
|
+
what: string;
|
|
44
|
+
run: () => Maybe<CheckResult>;
|
|
45
|
+
aggregate?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface GateTicket {
|
|
48
|
+
ref: string;
|
|
49
|
+
title?: string;
|
|
50
|
+
owner: boolean;
|
|
51
|
+
checks: GateCheck[];
|
|
52
|
+
}
|
|
53
|
+
export interface TicketListEntry {
|
|
54
|
+
ref: string;
|
|
55
|
+
owner: string;
|
|
56
|
+
title: string;
|
|
57
|
+
parts?: string[];
|
|
58
|
+
aggregate?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface GateSpec {
|
|
61
|
+
repo: string;
|
|
62
|
+
tickets: GateTicket[];
|
|
63
|
+
/** estiva-ui only: every ticket, and the repos it joins in. */
|
|
64
|
+
all?: TicketListEntry[];
|
|
65
|
+
/** estiva-ui only: the repos beside it. `app` is the folder its app sits in: `web` in Ship. */
|
|
66
|
+
siblings?: {
|
|
67
|
+
name: string;
|
|
68
|
+
path: string;
|
|
69
|
+
env: string;
|
|
70
|
+
app?: string;
|
|
71
|
+
}[];
|
|
72
|
+
}
|
|
73
|
+
/** What a report says ran it. A copy of the old script reports a hash instead. */
|
|
74
|
+
export declare const ENGINE: string;
|
|
75
|
+
/** The helpers, bound to one repository. */
|
|
76
|
+
export declare function helpers(ROOT: string): GateHelpers;
|
|
77
|
+
export interface StatusOptions {
|
|
78
|
+
/** The repository to report on. */
|
|
79
|
+
root?: string;
|
|
80
|
+
/** The folder that holds the app, relative to `root`: `web` in Ship, `.` elsewhere. */
|
|
81
|
+
app?: string;
|
|
82
|
+
json?: boolean;
|
|
83
|
+
detail?: boolean;
|
|
84
|
+
}
|
|
85
|
+
/** Print where the project stands. Returns what was printed, or the JSON report. */
|
|
86
|
+
export declare function runStatus({ root, app, json, detail }?: StatusOptions): Promise<string>;
|
|
87
|
+
export {};
|
|
88
|
+
//# sourceMappingURL=status.d.ts.map
|