@starci/eslint-canon-fe 9.1.12 → 9.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -2
- package/README.md +5 -7
- package/button-intent.mjs +1 -1
- package/control-height.mjs +1 -1
- package/drawing.mjs +12 -6
- package/lint-escape-hatch.mjs +4 -8
- package/package.json +1 -1
- package/runtime/knowledge/grammars/index.yaml +12 -27
- package/runtime/knowledge/hfs/canon-pins.yaml +23 -23
- package/runtime/knowledge/hfs/fe-stack.yaml +1 -1
- package/runtime/scripts/hfs/rule-catalog.mjs +2 -2
- package/runtime/scripts/lib/grammar-lint.mjs +7 -27
- package/runtime/scripts/lib/package-at.mjs +5 -5
- package/surface-rules.mjs +1 -1
- package/ui-rulings.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 9.
|
|
3
|
+
## 9.3.0 - 2026-10-28
|
|
4
4
|
|
|
5
|
-
- Changed: owner ruling
|
|
5
|
+
- Changed (breaking for apps): owner ruling fe-shape-not-state. A pure half takes `{ shape?, props, on? }`; `base-props-atom` refuses the retired `state` key with a message naming the rename, and `no-data-status-shape` reads `XShape` unions (and still the old `XState` names, so a status word is caught during the rename).
|
|
6
|
+
- Changed: the bundled runtime copies follow the retirement of `@starci/cli`: the bundled canon pins replace the retired `@starci/cli` with `starci-harness` 1.1.0-alpha.1 (`source: cli/package.json`), the one command line a product installs for `starci app`, and follow the harness packages (Grammar family 0.14.0, hfs 4.9.0, canon-fe 9.3.0, canon-be 3.5.0); the runtime finds an app's `starci` bin in its installed `starci-harness`.
|
|
7
|
+
|
|
8
|
+
## 9.2.0 - 2026-10-27
|
|
9
|
+
|
|
10
|
+
- Changed: owner ruling two-grammars: the bundled Grammar catalog declares exactly two families, `core` (`@starci/eslint-grammar-core`, `coreGrammarConfig`) and `offset-pop`; `starci`, `starci-core` and `heritage` are refused. The Grammar entry checks (button intent, control height, surface rules, UI rulings) accept `@starci/grammar/<common|core|offset-pop>`. The bundled canon pins follow the harness packages (Grammar family 0.13.0, hfs 4.8.0, canon-fe 9.2.0, canon-be 3.4.57, stylelint-canon 2.1.0).
|
|
11
|
+
- Changed: the doc comment of `lint-escape-hatch.mjs` names the three patterns that own the refused spellings instead of spelling them again. No rule or behaviour changed.
|
|
6
12
|
|
|
7
13
|
## 9.1.11 - 2026-10-27
|
|
8
14
|
|
package/README.md
CHANGED
|
@@ -7,10 +7,10 @@ structure, typed contracts, token discipline and check integrity across Grammar
|
|
|
7
7
|
|
|
8
8
|
```js
|
|
9
9
|
import { loadHfs, starciFeConfig } from "@starci/eslint-canon-fe"
|
|
10
|
-
import {
|
|
10
|
+
import { coreGrammarConfig } from "@starci/eslint-grammar-core"
|
|
11
11
|
|
|
12
12
|
const hfs = loadHfs(import.meta.url)
|
|
13
|
-
export default [...starciFeConfig({ hfs }), ...
|
|
13
|
+
export default [...starciFeConfig({ hfs }), ...coreGrammarConfig({ hfs })]
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
`starci app sync` renders the selected family's managed flat config. Both factories cover every
|
|
@@ -19,7 +19,7 @@ Sonar rules run at error; the factory sets typed parsing and refuses inline lint
|
|
|
19
19
|
Generated wire types, dependencies and build outputs follow the shared source-scope contract.
|
|
20
20
|
|
|
21
21
|
Concrete Grammar component names, props, variants, scales and vendor recipes belong to
|
|
22
|
-
`@starci/eslint-grammar-
|
|
22
|
+
`@starci/eslint-grammar-core` or the selected family's package. The family rules keep their
|
|
23
23
|
bare IDs under the `starci-grammar` namespace. This package exports shared AST, binding, type,
|
|
24
24
|
slot and configuration infrastructure through `@starci/eslint-canon-fe/lib/*`; family packages
|
|
25
25
|
import those readers without copying them.
|
|
@@ -50,7 +50,5 @@ Regression specs belong to this package. Application front ends and Grammar libr
|
|
|
50
50
|
## The runtime copy
|
|
51
51
|
|
|
52
52
|
`runtime/` holds the StarCi runtime files the rules import (the slot manifest and view, the project graph and the
|
|
53
|
-
architecture machine it runs, the Sonar syntax rules), byte for byte at their runtime paths.
|
|
54
|
-
|
|
55
|
-
`scripts/hfs/sync-runtime.mjs` generates it; refresh it by running that generator there and copying
|
|
56
|
-
`packages/eslint/fe/runtime/` over this folder. Nothing in this package edits it.
|
|
53
|
+
architecture machine it runs, the Sonar syntax rules), byte for byte at their runtime paths. It is committed source of
|
|
54
|
+
this package, edited in place ([packages/README.md](../README.md) says how the bundled copies move together).
|
package/button-intent.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { functionOf, importOf, isFn, patternPath, unwrap, variableOf } from "./l
|
|
|
4
4
|
import { typedPropertyStrings } from "./lib/typed-class-values.mjs"
|
|
5
5
|
import ts from "typescript"
|
|
6
6
|
|
|
7
|
-
const GRAMMAR_ENTRY = /^@starci\/grammar(?:\/(?:common|core|
|
|
7
|
+
const GRAMMAR_ENTRY = /^@starci\/grammar(?:\/(?:common|core|offset-pop))?$/
|
|
8
8
|
const BUTTONS = new Set(["Button", "IconButton"])
|
|
9
9
|
const DIALOGS = new Set(["AlertDialog", "ConfirmDialog"])
|
|
10
10
|
const ITEMS = new Set(["CollectionItem", "ItemActions", "ListItem", "ListRow", "ListBox.Item", "GridList.Item", "Table.Row", "TableRow"])
|
package/control-height.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { attributeValue, stringOf } from "./lib/ast.mjs"
|
|
3
3
|
import { importOf } from "./lib/bindings.mjs"
|
|
4
4
|
|
|
5
|
-
const GRAMMAR_ENTRY = /^@starci\/grammar(?:\/(?:common|core|
|
|
5
|
+
const GRAMMAR_ENTRY = /^@starci\/grammar(?:\/(?:common|core|offset-pop))?$/
|
|
6
6
|
const CONTROLS = new Set(["Button", "IconButton", "Switch", "Input", "SearchField", "Select", "Tabs", "SegmentedControl", "Textarea", "NumberField", "ComboBox"])
|
|
7
7
|
/** A marketing hero call to action on a landing page is the one place the 48px step is allowed. */
|
|
8
8
|
const LANDING_PATH = /[\\/](?:landing|hero|marketing)[\\/]|(?:Landing|Hero)[^\\/]*[\\/]/
|
package/drawing.mjs
CHANGED
|
@@ -75,7 +75,7 @@ const keyOf = (member) => (member.key?.type === "Identifier" ? member.key.name :
|
|
|
75
75
|
export const basePropsAtom = {
|
|
76
76
|
meta: {
|
|
77
77
|
type: "problem",
|
|
78
|
-
docs: { description: "A pure `XBase` takes `
|
|
78
|
+
docs: { description: "A pure `XBase` takes `shape`, atom `props` and `on` actions; feature composition may receive named render callbacks in `props`." },
|
|
79
79
|
schema: [],
|
|
80
80
|
messages: {
|
|
81
81
|
tree:
|
|
@@ -85,7 +85,9 @@ export const basePropsAtom = {
|
|
|
85
85
|
onData:
|
|
86
86
|
"`on.{{key}}` is not an action. `on` holds functions only; data belongs in `props`.",
|
|
87
87
|
member:
|
|
88
|
-
"`{{key}}` is not part of the pure contract. A pure half takes `
|
|
88
|
+
"`{{key}}` is not part of the pure contract. A pure half takes `shape`, `props` and `on`{{children}}.",
|
|
89
|
+
renamed:
|
|
90
|
+
"`state` is the retired name of the drawn shape: rename it `shape` (owner ruling fe-shape-not-state).",
|
|
89
91
|
},
|
|
90
92
|
},
|
|
91
93
|
create(context) {
|
|
@@ -197,7 +199,11 @@ export const basePropsAtom = {
|
|
|
197
199
|
for (const member of membersOf(annotation, types)) {
|
|
198
200
|
const key = keyOf(member)
|
|
199
201
|
const type = member.typeAnnotation?.typeAnnotation
|
|
200
|
-
if (key === "
|
|
202
|
+
if (key === "shape") continue
|
|
203
|
+
if (key === "state") {
|
|
204
|
+
context.report({ node: member, messageId: "renamed" })
|
|
205
|
+
continue
|
|
206
|
+
}
|
|
201
207
|
if (key === "props") checkData(type, "props", new Set())
|
|
202
208
|
else if (key === "on") checkActions(type)
|
|
203
209
|
else if (key === "children" && tier === "layouts") continue
|
|
@@ -274,11 +280,11 @@ const DATA_STATUS = new Set([
|
|
|
274
280
|
"skeleton", "closed", "idle", "refreshing", "retrying",
|
|
275
281
|
])
|
|
276
282
|
|
|
277
|
-
/** A surface's `
|
|
283
|
+
/** A surface's `XShape` names shapes only. */
|
|
278
284
|
export const noDataStatusShape = {
|
|
279
285
|
meta: {
|
|
280
286
|
type: "problem",
|
|
281
|
-
docs: { description: "`
|
|
287
|
+
docs: { description: "`XShape` of a pure half names drawn shapes, never a data status or open/closed." },
|
|
282
288
|
schema: [],
|
|
283
289
|
messages: {
|
|
284
290
|
status:
|
|
@@ -298,7 +304,7 @@ export const noDataStatusShape = {
|
|
|
298
304
|
}
|
|
299
305
|
return {
|
|
300
306
|
TSTypeAliasDeclaration(node) {
|
|
301
|
-
if (/^[A-Z][A-Za-z0-9]*State$/.test(node.id.name)) check(node.id.name, node.typeAnnotation)
|
|
307
|
+
if (/^[A-Z][A-Za-z0-9]*(?:Shape|State)$/.test(node.id.name)) check(node.id.name, node.typeAnnotation)
|
|
302
308
|
},
|
|
303
309
|
}
|
|
304
310
|
},
|
package/lint-escape-hatch.mjs
CHANGED
|
@@ -3,14 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* NO LOCAL EXCEPTION, OF ANY SPELLING. A rule that a comment can switch off is a convention, and a
|
|
5
5
|
* codebase learns which conventions are real by which ones it can suppress. The spellings this law
|
|
6
|
-
* refuses are the ones an author actually reaches for:
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* the no-sonar word, @sonar-ignore - Sonar's own switches
|
|
11
|
-
* istanbul ignore, c8 ignore, v8 ignore - a line taken out of the coverage the gate reads
|
|
12
|
-
* prettier-ignore - a region taken out of the formatter
|
|
13
|
-
* stylelint-disable / -enable - a stylelint switch that reached a TS file
|
|
6
|
+
* refuses are the ones an author actually reaches for, and the three patterns below own them:
|
|
7
|
+
* ESLINT_DIRECTIVE (an ESLint switch or inline rule configuration), TS_DIRECTIVE (a TypeScript
|
|
8
|
+
* suppression) and TOOL_DIRECTIVE (Sonar's own switches, a line taken out of the coverage the gate
|
|
9
|
+
* reads, a region taken out of the formatter, a stylelint switch that reached a TS file).
|
|
14
10
|
*
|
|
15
11
|
* TWO LAYERS, BECAUSE ONE IS NOT ENOUGH. The flat-config fence (`noInlineConfig`) makes an ESLint
|
|
16
12
|
* directive INEFFECTIVE; this rule makes it a FINDING, so the attempt is named in the log instead of
|
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@ guidance:
|
|
|
24
24
|
Do not treat this catalog as selecting a default Grammar family. Family choice belongs to the
|
|
25
25
|
current design specification and its explicit sides.fe.grammar declaration.
|
|
26
26
|
rationale: |
|
|
27
|
-
Silent fallback to
|
|
27
|
+
Silent fallback to a family would invent product direction and override an absent/ambiguous design.
|
|
28
28
|
- id: verify-before-use
|
|
29
29
|
requirement: |
|
|
30
30
|
Before applying snapshot APIs or recorded gaps, inspect the selected repository's package
|
|
@@ -47,11 +47,11 @@ topics:
|
|
|
47
47
|
Generated DNA snapshot of the `@starci/grammar/common` public entry: custom properties,
|
|
48
48
|
the 110 renderers of its registry, their classes, stamped rule ids and recorded gaps. The DNA owns the observed package
|
|
49
49
|
version and source inventory. Common supplies anatomy, not colour. The snapshot is drift-checked.
|
|
50
|
-
- id:
|
|
51
|
-
path:
|
|
52
|
-
title:
|
|
50
|
+
- id: core
|
|
51
|
+
path: core/index.yaml
|
|
52
|
+
title: Core Grammar
|
|
53
53
|
summary: |
|
|
54
|
-
Historical snapshot of the
|
|
54
|
+
Historical snapshot of the core family — DNA, idioms, playbook (including composing the
|
|
55
55
|
0.5.0 forms, overlays and navigation chrome) and family boundaries.
|
|
56
56
|
- id: offset-pop
|
|
57
57
|
path: offset-pop/index.yaml
|
|
@@ -61,22 +61,7 @@ topics:
|
|
|
61
61
|
shadow, one pink decision accent with a text-safe accent for text — with DNA, idioms, a
|
|
62
62
|
mobile-first playbook for playful learning or consumer apps, and family boundaries including two
|
|
63
63
|
decisions flagged for the family owner.
|
|
64
|
-
- id: heritage
|
|
65
|
-
path: heritage/DNA.yaml
|
|
66
|
-
title: Heritage Grammar
|
|
67
|
-
summary: |
|
|
68
|
-
Generated snapshot of the Heritage family's parity declaration, arrangement, scoped tokens and Common renderers.
|
|
69
|
-
# The one alias table of Grammar family ids (ruling two-grammars, 2026-10-27): `core` is the canonical id of the
|
|
70
|
-
# legacy core grammar; the legacy catalog id `starci` and the DNA id `starci-core` are deprecated spellings that
|
|
71
|
-
# resolve to it. Every reader resolves a selection through scripts/lib/grammar-lint.mjs, never through its own list.
|
|
72
|
-
familyAliases:
|
|
73
|
-
starci: core
|
|
74
|
-
starci-core: core
|
|
75
64
|
families:
|
|
76
|
-
- id: heritage
|
|
77
|
-
title: heritage
|
|
78
|
-
contractRef: common
|
|
79
|
-
packageSnapshot: heritage/DNA.yaml
|
|
80
65
|
- id: common
|
|
81
66
|
title: common
|
|
82
67
|
componentContract:
|
|
@@ -95,14 +80,14 @@ families:
|
|
|
95
80
|
title: core
|
|
96
81
|
contractRef: common
|
|
97
82
|
lint:
|
|
98
|
-
package: '@starci/eslint-grammar-
|
|
99
|
-
factory:
|
|
83
|
+
package: '@starci/eslint-grammar-core'
|
|
84
|
+
factory: coreGrammarConfig
|
|
100
85
|
prefix: starci-grammar
|
|
101
|
-
authority:
|
|
102
|
-
packageSnapshot:
|
|
103
|
-
reusableStyle:
|
|
104
|
-
productComposition:
|
|
105
|
-
index:
|
|
86
|
+
authority: core/family.yaml
|
|
87
|
+
packageSnapshot: core/DNA.yaml
|
|
88
|
+
reusableStyle: core/idioms.yaml
|
|
89
|
+
productComposition: core/playbook.yaml
|
|
90
|
+
index: core/index.yaml
|
|
106
91
|
- id: offset-pop
|
|
107
92
|
title: offset-pop
|
|
108
93
|
contractRef: common
|
|
@@ -21,7 +21,7 @@ pins:
|
|
|
21
21
|
install: registry
|
|
22
22
|
side: fe
|
|
23
23
|
source: packages/heroicons/package.json
|
|
24
|
-
why: 'StarCi custom Heroicons-compatible cuts; eslint-grammar-
|
|
24
|
+
why: 'StarCi custom Heroicons-compatible cuts; eslint-grammar-core (icon.mjs) admits @starci/heroicons/24/outline and /16/solid as icon sources, so an app that uses them gets this exact version.'
|
|
25
25
|
'@starci/event-stream':
|
|
26
26
|
version: 0.1.0
|
|
27
27
|
group: starci
|
|
@@ -30,61 +30,61 @@ pins:
|
|
|
30
30
|
source: packages/event-stream/package.json
|
|
31
31
|
why: 'the one server-sent-events client of every front end (fe-stack event-stream, owner:event-stream-package): the transport client layer (modules/api/sse/clients) creates one instance for the app with the bearer token source and the stream operations follow on it; it carries Last-Event-ID resume, the capped doubling backoff, the heartbeat timeout, the single 401 renewal and the useSWRSubscription adapter, so no app keeps a hand-written reader.'
|
|
32
32
|
'@starci/grammar':
|
|
33
|
-
version: 0.
|
|
33
|
+
version: 0.14.0
|
|
34
34
|
group: starci
|
|
35
35
|
install: registry
|
|
36
36
|
side: fe
|
|
37
37
|
source: packages/grammar/package.json
|
|
38
38
|
why: 'the grammar front ends read: the brand layer sets `--font-sans` and `--font-mono` and the grammar reads them; it carries the Input tel kind, the copyable and read-only Input, the IconButton disclosure props and count badge, ChatBubble, FillViewport, Textarea mentions and Enter-to-send, the leading PrimaryRailLayout rail, the plate-less Image, ListRow, the soft Alert, Progress steps, the floating primary IconButton, FlowGraph, the STATE-8 loading views and the bordered selectable TagGroup chips. The runtime source version wins for a @starci package.'
|
|
39
39
|
'@starci/eslint-canon-be':
|
|
40
|
-
version: 3.
|
|
40
|
+
version: 3.5.0
|
|
41
41
|
group: starci
|
|
42
42
|
install: registry
|
|
43
43
|
side: be
|
|
44
|
-
source: packages/eslint
|
|
44
|
+
source: packages/eslint-canon-be/package.json
|
|
45
45
|
why: 'the back-end ESLint canon: `loadHfs(import.meta.url)` of be/eslint.config.mjs finds the app-root hfs.json (kind app) and gives every linted file the view of the be side, and the project graph is built per side; its bundled runtime copies (slots, canon-pins, failure codes, the architecture machine) put .starcistacks and .sops.yaml at the app root; `starciBeConfig({ hfs: loadHfs(import.meta.url) })` is the typed factory and the BE-CONVENTION laws are its rules.'
|
|
46
46
|
'@starci/eslint-canon-fe':
|
|
47
|
-
version: 9.
|
|
47
|
+
version: 9.3.0
|
|
48
48
|
group: starci
|
|
49
49
|
install: registry
|
|
50
50
|
side: fe
|
|
51
|
-
source: packages/eslint
|
|
51
|
+
source: packages/eslint-canon-fe/package.json
|
|
52
52
|
why: 'the front-end ESLint canon: `loadHfs(import.meta.url)` of fe/eslint.config.mjs finds the app-root hfs.json (kind app) and gives every linted file the view of the fe side, and the project graph is built per side; its bundled runtime copies (slots, canon-pins, failure codes, the architecture machine) put .starcistacks and .sops.yaml at the app root; the front end has no tests (FE_NO_TESTS R97 in hfs) and no-vietnamese-in-source (R91) applies.'
|
|
53
|
-
'@starci/eslint-grammar-
|
|
54
|
-
version: 0.
|
|
53
|
+
'@starci/eslint-grammar-core':
|
|
54
|
+
version: 0.14.0
|
|
55
55
|
group: starci
|
|
56
56
|
install: registry
|
|
57
57
|
side: fe
|
|
58
|
-
source: packages/eslint
|
|
58
|
+
source: packages/eslint-grammar-core/package.json
|
|
59
59
|
why: 'the StarCi Grammar component API lint, versioned with @starci/grammar; front ends compose this family package with the universal FE canon.'
|
|
60
60
|
'@starci/eslint-grammar-offset-pop':
|
|
61
|
-
version: 0.
|
|
61
|
+
version: 0.14.0
|
|
62
62
|
group: starci
|
|
63
63
|
install: registry
|
|
64
64
|
side: fe
|
|
65
|
-
source: packages/eslint
|
|
65
|
+
source: packages/eslint-grammar-offset-pop/package.json
|
|
66
66
|
why: 'the Offset Pop Grammar component API lint, versioned with @starci/grammar; its shared component contract comes from the StarCi family lint without copying rules.'
|
|
67
67
|
'@starci/stylelint-canon':
|
|
68
|
-
version: 2.0
|
|
68
|
+
version: 2.1.0
|
|
69
69
|
group: starci
|
|
70
70
|
install: registry
|
|
71
71
|
side: fe
|
|
72
|
-
source: packages/stylelint/package.json
|
|
72
|
+
source: packages/stylelint-canon/package.json
|
|
73
73
|
why: 'the front-end stylelint canon: no-class-selector refuses a compound class selector (`div.card`); the brand layer accepts `--font-sans` and `--font-mono`; status-contrast measures the HeroUI soft pairs per theme; brand-layer-shape reads the shared :root,.light,.dark block and the info soft pair; appTokens come from loadAppTokens(import.meta.url) for the managed one-line stylelint.config.mjs.'
|
|
74
74
|
'@starci/tsconfig':
|
|
75
|
-
version: 2.0.
|
|
75
|
+
version: 2.0.8
|
|
76
76
|
group: starci
|
|
77
77
|
install: registry
|
|
78
78
|
side: both
|
|
79
79
|
source: packages/tsconfig/package.json
|
|
80
80
|
'@starci/prettier-config':
|
|
81
|
-
version: 1.0.
|
|
81
|
+
version: 1.0.5
|
|
82
82
|
group: starci
|
|
83
83
|
install: registry
|
|
84
84
|
side: both
|
|
85
85
|
source: packages/prettier-config/package.json
|
|
86
86
|
'@starci/jest-preset':
|
|
87
|
-
version: 2.3.
|
|
87
|
+
version: 2.3.7
|
|
88
88
|
group: starci
|
|
89
89
|
install: registry
|
|
90
90
|
side: be
|
|
@@ -97,20 +97,20 @@ pins:
|
|
|
97
97
|
side: be
|
|
98
98
|
source: packages/test-world/package.json
|
|
99
99
|
why: 'the shared e2e library of every back end (R47, R48), a devDependency of every back end: the warm stack behind toxiproxy, the network-edge fakes, the Nest boot, the typed useTestWorld handle, useSandbox for contract specs and the outage lock. Kafka is real own infra (the one digest-pinned apache/kafka KRaft image, a broker listener and proxy per slot, slot-prefixed topics, consumer groups and client ids) and Postgres is schema-per-context (a schema and a login role per context in a shared database). Each worker has its own data slot (<ns>_w<k>) with its own databases, Keycloak realm, leased Redis DB, bucket/collection/topic prefixes, fakes host, toxiproxy proxies and outage lock; a run provisions min(jest workers, workers cap, default 2) slots, and state file protocol 2 pairs exactly with @starci/jest-preset (TEST_WORLD_PAIR_MISMATCH otherwise). A modules world boots real peer apps beside its modules, world.apps.<name>.during(fn) is the outage of a peer app, w.keycloak.clientSecret(client) answers the run-generated secret of a confidential realm client, world.keycloak.events/sessions read the realm user events and live sessions, world.infra.postgresql.connection(name) takes one database connection down while the others serve, and world.resolve and scope.resolve take any Nest token. Every path a declaration names (`stack`, seeds, the realm, Dockerfiles) resolves from the app root (the directory of hfs.json); the globalSetup registers the path aliases as TypeScript resolves them. Its CLI main is exported at ./cli for starci app stack.'
|
|
100
|
-
'
|
|
101
|
-
version: 1.
|
|
100
|
+
'starci-harness':
|
|
101
|
+
version: 1.1.0-alpha.1
|
|
102
102
|
group: starci
|
|
103
103
|
install: registry
|
|
104
104
|
side: both
|
|
105
|
-
source:
|
|
106
|
-
why: 'the
|
|
105
|
+
source: cli/package.json
|
|
106
|
+
why: 'the one StarCi command line (bins starci and starci-harness): a product repository installs it for starci app, which it runs in-process through its exact @starci/hfs dependency, and its codegen loads starci-harness/input-bounds.'
|
|
107
107
|
'@starci/hfs':
|
|
108
|
-
version: 4.
|
|
108
|
+
version: 4.9.0
|
|
109
109
|
group: starci
|
|
110
110
|
install: registry
|
|
111
111
|
side: both
|
|
112
112
|
source: packages/hfs/package.json
|
|
113
|
-
why: 'the
|
|
113
|
+
why: 'the app implementation starci-harness runs for starci app; it carries the generated runtime slice read by starci app commands.'
|
|
114
114
|
# --- tooling
|
|
115
115
|
typescript:
|
|
116
116
|
version: 5.9.3
|
|
@@ -406,7 +406,7 @@ pins:
|
|
|
406
406
|
version: 2.2.0
|
|
407
407
|
group: ui
|
|
408
408
|
side: fe
|
|
409
|
-
why: 'the base of the one application icon set (fe-stack icons, with @starci/heroicons for the glyphs it lacks); eslint-grammar-
|
|
409
|
+
why: 'the base of the one application icon set (fe-stack icons, with @starci/heroicons for the glyphs it lacks); eslint-grammar-core (icon.mjs) admits @heroicons/react/24/outline and /16/solid.'
|
|
410
410
|
'@dicebear/core':
|
|
411
411
|
version: 10.4.0
|
|
412
412
|
group: ui
|
|
@@ -251,7 +251,7 @@ concerns:
|
|
|
251
251
|
why: the canon lint and format configuration.
|
|
252
252
|
- id: grammar-lint
|
|
253
253
|
tier: opt
|
|
254
|
-
packages: ['@starci/eslint-grammar-
|
|
254
|
+
packages: ['@starci/eslint-grammar-core', '@starci/eslint-grammar-offset-pop']
|
|
255
255
|
home: [fe.source-root-pinned]
|
|
256
256
|
pattern: FE-RULE-OWNERSHIP
|
|
257
257
|
forbids: []
|
|
@@ -12,7 +12,7 @@ import { fail } from './slot-errors.mjs';
|
|
|
12
12
|
|
|
13
13
|
const HFS_RULES_FILE = 'knowledge/hfs/rules.yaml';
|
|
14
14
|
const RULE_GATES = Object.freeze(['pre-commit', 'pre-push', 'settle', 'land', 'ci', 'sonar', 'runtime']);
|
|
15
|
-
const ENFORCER_FAMILIES = Object.freeze(['eslint-be', 'eslint-fe', 'eslint-grammar-
|
|
15
|
+
const ENFORCER_FAMILIES = Object.freeze(['eslint-be', 'eslint-fe', 'eslint-grammar-core', 'stylelint', 'machine', 'hfs', 'work-validate', 'sonar', 'runtime']);
|
|
16
16
|
const RULE_KINDS = Object.freeze(['codemod', 'lint', 'check', 'design']);
|
|
17
17
|
const FINDING_CODE = /^[A-Z][A-Z0-9]*(_[A-Z0-9]+)+$/;
|
|
18
18
|
const ENFORCER_ID = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;
|
|
@@ -346,7 +346,7 @@ export function loadRuleCatalog({ root = skillRoot, file = path.join(root, HFS_R
|
|
|
346
346
|
/** The catalogued why code of a lint finding's rule id (`starci-be/<id>`, `starci-fe/<id>`), or undefined. */
|
|
347
347
|
lintCode: (ruleId) => {
|
|
348
348
|
const [plugin, id] = String(ruleId ?? '').split('/');
|
|
349
|
-
const kind = (plugin === 'starci-be' && 'eslint-be') || (plugin === 'starci-fe' && 'eslint-fe') || (plugin === 'starci-grammar' && 'eslint-grammar-
|
|
349
|
+
const kind = (plugin === 'starci-be' && 'eslint-be') || (plugin === 'starci-fe' && 'eslint-fe') || (plugin === 'starci-grammar' && 'eslint-grammar-core') || null;
|
|
350
350
|
return kind ? list.find((rule) => rule.enforcers.some((enforcer) => enforcer.kind === kind && enforcer.id === id))?.code : undefined;
|
|
351
351
|
},
|
|
352
352
|
/** The rules one enforcer judges, e.g. forEnforcer('eslint-be', 'error-home'). */
|
|
@@ -8,40 +8,21 @@ function readCatalog() {
|
|
|
8
8
|
return parseYamlCached(fs.readFileSync(CATALOG_FILE, 'utf8'));
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
/** The catalog's one alias table: a deprecated id names exactly one canonical family and is never itself a family. */
|
|
12
|
-
function aliasTarget(catalog, family) {
|
|
13
|
-
const aliases = catalog.familyAliases ?? {};
|
|
14
|
-
if (!Object.hasOwn(aliases, family)) return null;
|
|
15
|
-
const target = aliases[family];
|
|
16
|
-
if (typeof target !== 'string' || Object.hasOwn(aliases, target)
|
|
17
|
-
|| (catalog.families ?? []).some(entry => entry.id === family)) {
|
|
18
|
-
throw new Error(`Grammar family alias ${family} in knowledge/grammars/index.yaml must name one canonical family`);
|
|
19
|
-
}
|
|
20
|
-
return target;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
11
|
function selectedFamily(family) {
|
|
24
12
|
if (typeof family !== 'string' || !family.trim()) throw new Error('sides.fe.grammar must explicitly name the selected Grammar family');
|
|
25
13
|
const catalog = readCatalog();
|
|
26
|
-
const
|
|
27
|
-
const matches = (catalog.families ?? []).filter(entry => entry.id === id);
|
|
14
|
+
const matches = (catalog.families ?? []).filter(entry => entry.id === family);
|
|
28
15
|
if (matches.length !== 1) throw new Error(`Grammar family ${family} has no declared lint contract in knowledge/grammars/index.yaml`);
|
|
29
16
|
return { catalog, selected: matches[0] };
|
|
30
17
|
}
|
|
31
18
|
|
|
32
19
|
/**
|
|
33
|
-
* Resolve a selection to its
|
|
20
|
+
* Resolve a selection to its declared family id; only a catalog family id resolves, there are no aliases.
|
|
34
21
|
* @param {string} family - The id an app or caller names (sides.fe.grammar).
|
|
35
|
-
* @returns {{ id: string
|
|
22
|
+
* @returns {{ id: string }} The declared family id.
|
|
36
23
|
*/
|
|
37
24
|
export function resolveGrammarFamily(family) {
|
|
38
|
-
|
|
39
|
-
if (selected.id === family) return Object.freeze({ id: family, alias: null, note: null });
|
|
40
|
-
return Object.freeze({
|
|
41
|
-
id: selected.id,
|
|
42
|
-
alias: family,
|
|
43
|
-
note: `Grammar family id ${family} is a deprecated alias of ${selected.id}; write sides.fe.grammar: ${selected.id}`,
|
|
44
|
-
});
|
|
25
|
+
return Object.freeze({ id: selectedFamily(family).selected.id });
|
|
45
26
|
}
|
|
46
27
|
|
|
47
28
|
/** The explicitly selected authored family entry; callers share the catalog lookup rather than inferring a family. */
|
|
@@ -49,21 +30,20 @@ export function grammarFamilyFor(family) {
|
|
|
49
30
|
return Object.freeze(selectedFamily(family).selected);
|
|
50
31
|
}
|
|
51
32
|
|
|
52
|
-
/** The declared family's lint contract
|
|
33
|
+
/** The declared family's lint contract, including an explicit null package when that family has no rules. */
|
|
53
34
|
export function grammarLintFor(family) {
|
|
54
35
|
const { selected } = selectedFamily(family);
|
|
55
36
|
if (!selected.lint || !Object.hasOwn(selected.lint, 'package')) {
|
|
56
37
|
throw new Error(`Grammar family ${family} has no declared lint contract in knowledge/grammars/index.yaml`);
|
|
57
38
|
}
|
|
58
39
|
const lint = selected.lint;
|
|
59
|
-
|
|
60
|
-
if (lint.package === null) return Object.freeze({ family: canonical, package: null });
|
|
40
|
+
if (lint.package === null) return Object.freeze({ family: selected.id, package: null });
|
|
61
41
|
if (typeof lint.package !== 'string' || !lint.package.startsWith('@starci/eslint-grammar-')
|
|
62
42
|
|| typeof lint.factory !== 'string' || !/^[a-zA-Z][a-zA-Z0-9]*$/.test(lint.factory)
|
|
63
43
|
|| typeof lint.prefix !== 'string' || !/^[a-z][a-z0-9-]*$/.test(lint.prefix)) {
|
|
64
44
|
throw new Error(`Grammar family ${family} has an invalid lint contract in knowledge/grammars/index.yaml`);
|
|
65
45
|
}
|
|
66
|
-
return Object.freeze({ family:
|
|
46
|
+
return Object.freeze({ family: selected.id, package: lint.package, factory: lint.factory, prefix: lint.prefix });
|
|
67
47
|
}
|
|
68
48
|
|
|
69
49
|
/** The selected family's shared component/export contract, resolved through its catalog reference. */
|
|
@@ -13,9 +13,9 @@ export const packageAt = (dir, name) => {
|
|
|
13
13
|
/** This runtime's own `starci` bin (packages/cli is the only package that declares one). */
|
|
14
14
|
const RUNTIME_STARCI_BIN = path.join(skillRoot, 'packages', 'cli', 'bin', 'starci.mjs');
|
|
15
15
|
|
|
16
|
-
/** The `starci` bin of the
|
|
16
|
+
/** The `starci` bin of the starci-harness that `dir` installs (a product runs its own pinned CLI), else this runtime's own. */
|
|
17
17
|
function starciBin(dir) {
|
|
18
|
-
const packageFile = packageAt(dir, '
|
|
18
|
+
const packageFile = packageAt(dir, 'starci-harness');
|
|
19
19
|
if (packageFile) {
|
|
20
20
|
try {
|
|
21
21
|
const { bin } = JSON.parse(fs.readFileSync(packageFile, 'utf8'));
|
|
@@ -50,13 +50,13 @@ export const loadTypescript = (...dirs) => {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
|
-
* The app's command line and the app implementation behind it: `bin` the `starci` bin of the app's installed
|
|
53
|
+
* The app's command line and the app implementation behind it: `bin` the `starci` bin of the app's installed starci-harness, else
|
|
54
54
|
* this runtime's packages/cli/bin/starci.mjs (starciBin); `dir` the @starci/hfs that answers
|
|
55
|
-
* `starci app` - the app's own install, else the one beside its
|
|
55
|
+
* `starci app` - the app's own install, else the one beside its starci-harness, else this runtime's packages/hfs - whose runtime
|
|
56
56
|
* slice the gate's base lint (scripts/gates/gate.mjs) and the READ digest (scripts/gates/read-digest.mjs) load in-process.
|
|
57
57
|
*/
|
|
58
58
|
export function hfsEntry(root) {
|
|
59
|
-
const cli = packageAt(root, '
|
|
59
|
+
const cli = packageAt(root, 'starci-harness');
|
|
60
60
|
const manifest = packageAt(root, '@starci/hfs') ?? (cli && packageAt(path.dirname(cli), '@starci/hfs'));
|
|
61
61
|
return { dir: manifest ? path.dirname(manifest) : path.join(skillRoot, 'packages', 'hfs'), bin: starciBin(root) };
|
|
62
62
|
}
|
package/surface-rules.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { functionOf, importOf, isFn, patternPath, unwrap, variableOf } from "./l
|
|
|
4
4
|
import { typedClassStrings, typedPropertyStrings } from "./lib/typed-class-values.mjs"
|
|
5
5
|
import { reactHookOf } from "./lib/react.mjs"
|
|
6
6
|
|
|
7
|
-
const GRAMMAR_ENTRY = /^@starci\/grammar(?:\/(?:common|core|
|
|
7
|
+
const GRAMMAR_ENTRY = /^@starci\/grammar(?:\/(?:common|core|offset-pop))?$/
|
|
8
8
|
const SURFACES = new Set([
|
|
9
9
|
"SurfaceCard", "SurfaceListCard", "SurfaceAccordionCard", "Sidebar",
|
|
10
10
|
"Dialog", "Drawer", "AlertDialog", "Popover",
|
package/ui-rulings.mjs
CHANGED
|
@@ -12,7 +12,7 @@ const grammarComponent = (context, opening, expected) => {
|
|
|
12
12
|
const binding = importOf(context, root);
|
|
13
13
|
if (
|
|
14
14
|
!binding ||
|
|
15
|
-
!/^@starci\/grammar(?:\/(?:common|core|
|
|
15
|
+
!/^@starci\/grammar(?:\/(?:common|core|offset-pop))?$/.test(
|
|
16
16
|
binding.source,
|
|
17
17
|
)
|
|
18
18
|
)
|