@starci/eslint-canon-be 3.6.0 → 3.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +3 -1
- package/dist/lib/hfs-view.d.ts +127 -0
- package/dist/lib/hfs-view.js +1 -0
- package/dist/lib/hfs.d.ts +2 -2
- package/dist/lib/hfs.js +1 -1
- package/package.json +7 -1
- package/runtime/knowledge/hfs/canon-pins.yaml +7 -7
- package/runtime/scripts/hfs/repo-identity.mjs +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.6.1 - 2026-10-28
|
|
4
|
+
|
|
5
|
+
- Fixed: the published declarations of `loadHfs` and `starciBeConfig` name the emitted `dist/lib/hfs-view.d.ts`, not the untyped `runtime/scripts/hfs/view.mjs`, so a consumer's typed lint of the managed `be/eslint.config.mjs` no longer reads an error type (`no-unsafe-assignment` at 3:33). The view's shapes live in `src/lib/hfs-view.ts`; the runtime functions are read through `#runtime/*`. Spec: `src/published-declarations.spec.ts`.
|
|
6
|
+
- Changed: the bundled runtime's `repo-identity.mjs` names a repository by its origin remote (hfs 4.9.2).
|
|
7
|
+
- Changed: the bundled canon pins follow release D (Grammar family 0.15.1, hfs 4.9.2, canon-fe 9.4.1, canon-be 3.6.1, starci-harness 1.1.0-alpha.2), so an app installs the released versions without pin drift.
|
|
8
|
+
|
|
3
9
|
## 3.6.0 - 2026-10-28
|
|
4
10
|
|
|
5
11
|
- Changed: the package is TypeScript built to JavaScript. Source and specs live in `src/*.ts` (strict, no `any`, no
|
package/README.md
CHANGED
|
@@ -148,7 +148,9 @@ The package is TypeScript: `src/*.ts` (one module per law, `src/lib/` for the sh
|
|
|
148
148
|
source) builds with `tsc -p tsconfig.build.json` into `dist/`, which is what `exports` and `files` publish, with `runtime/`.
|
|
149
149
|
`npm run typecheck` checks source and specs strictly (no `any`); `npm test` runs the specs straight from the TypeScript
|
|
150
150
|
(`node --test`, Node strips the types), so a spec needs no build. The bundled `runtime/` is untyped JavaScript; the parts
|
|
151
|
-
this package imports are declared in `src/types/runtime
|
|
151
|
+
this package imports are declared in `src/types/runtime/`, and the HFS view is imported through `#runtime/*` with its shapes
|
|
152
|
+
in `src/lib/hfs-view.ts`, which is emitted, so the published declarations of `loadHfs` and `starciBeConfig` name no
|
|
153
|
+
untyped runtime file. `fixtures/` is spec data and stays JavaScript with
|
|
152
154
|
`.d.mts` contracts, because the front-end canon and the Grammar lint families import its helpers by path.
|
|
153
155
|
|
|
154
156
|
## HFS rules and their why codes
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shapes of the HFS view `runtime/scripts/hfs/view.mjs` builds (a bundled copy of @starci/hfs's runtime, untyped JavaScript):
|
|
3
|
+
* the frozen object a lint factory puts in `settings.starci.hfs` and every path-scoped rule reads. The shapes are the slot
|
|
4
|
+
* manifest's (`runtime/knowledge/hfs/slots.yaml`) as this package reads them; this module is emitted, so the published
|
|
5
|
+
* declarations of `loadHfs` and `starciBeConfig` name a declared type.
|
|
6
|
+
*/
|
|
7
|
+
/** One app of a side (`hfs.json` sides.<side>.apps). */
|
|
8
|
+
export interface HfsApp {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly kind: string;
|
|
11
|
+
}
|
|
12
|
+
/** One declared database connection (`hfs.json` sides.be.connections). */
|
|
13
|
+
export interface HfsConnection {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly envPrefix: string;
|
|
16
|
+
readonly owner?: string;
|
|
17
|
+
readonly isolation?: string;
|
|
18
|
+
}
|
|
19
|
+
/** Where a path sits: its slot, root and bindings, or a status naming why no slot owns it. */
|
|
20
|
+
export interface HfsClassification {
|
|
21
|
+
readonly path: string;
|
|
22
|
+
readonly status: string;
|
|
23
|
+
readonly slot?: string;
|
|
24
|
+
readonly root?: string;
|
|
25
|
+
readonly bindings?: Readonly<Record<string, string>>;
|
|
26
|
+
readonly kind?: string;
|
|
27
|
+
readonly role?: string;
|
|
28
|
+
readonly presence?: string;
|
|
29
|
+
readonly goesTo?: string;
|
|
30
|
+
readonly code?: string;
|
|
31
|
+
/** For a path no slot owns: the slot it sits nearest to. */
|
|
32
|
+
readonly nearest?: {
|
|
33
|
+
readonly slot?: string;
|
|
34
|
+
} | null;
|
|
35
|
+
}
|
|
36
|
+
/** What the slot that owns a file says about it (its `allows` list). */
|
|
37
|
+
export interface HfsAllowsVerdict {
|
|
38
|
+
readonly slot: string;
|
|
39
|
+
readonly root: string;
|
|
40
|
+
readonly relative: string;
|
|
41
|
+
readonly allowed: boolean;
|
|
42
|
+
readonly entry?: string;
|
|
43
|
+
readonly forbiddenBy?: string;
|
|
44
|
+
readonly allows: readonly string[];
|
|
45
|
+
}
|
|
46
|
+
/** A slot definition of the manifest, by the fields the rules read. */
|
|
47
|
+
export interface HfsSlot {
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly tier?: string;
|
|
50
|
+
readonly budget?: Readonly<Record<string, number>>;
|
|
51
|
+
readonly trigger?: string;
|
|
52
|
+
readonly coverage?: string;
|
|
53
|
+
readonly allows?: readonly string[];
|
|
54
|
+
}
|
|
55
|
+
/** A unit-tested role (`ruleParams.be.unitRoles`). */
|
|
56
|
+
export interface HfsUnitRole {
|
|
57
|
+
readonly role: string;
|
|
58
|
+
readonly spec: string;
|
|
59
|
+
readonly slot?: string;
|
|
60
|
+
readonly exempt?: readonly string[];
|
|
61
|
+
}
|
|
62
|
+
/** A parameter-name rule (`ruleParams.be.paramNames`). */
|
|
63
|
+
export type HfsParamName = {
|
|
64
|
+
readonly type: string;
|
|
65
|
+
readonly typeSuffix?: undefined;
|
|
66
|
+
readonly names: readonly string[];
|
|
67
|
+
readonly nameSuffix?: string;
|
|
68
|
+
} | {
|
|
69
|
+
readonly type?: undefined;
|
|
70
|
+
readonly typeSuffix: string;
|
|
71
|
+
readonly names: readonly string[];
|
|
72
|
+
readonly nameSuffix?: string;
|
|
73
|
+
};
|
|
74
|
+
/** A spec double (`ruleParams.be.specDoubles.doubles`). */
|
|
75
|
+
export interface HfsSpecDouble {
|
|
76
|
+
readonly token: string;
|
|
77
|
+
readonly double: string;
|
|
78
|
+
readonly forms: readonly string[];
|
|
79
|
+
}
|
|
80
|
+
/** The rule parameters of the be profile (`ruleParams.common` merged with `ruleParams.be`), by the keys the rules read. */
|
|
81
|
+
export interface HfsRuleParams {
|
|
82
|
+
readonly functionLines?: number;
|
|
83
|
+
readonly fileLines: {
|
|
84
|
+
readonly soft: number;
|
|
85
|
+
readonly hardGrowth: boolean;
|
|
86
|
+
};
|
|
87
|
+
readonly infraOwners: Readonly<Record<string, readonly string[]>>;
|
|
88
|
+
readonly eventBus: {
|
|
89
|
+
readonly imports: Readonly<Record<string, readonly string[]>>;
|
|
90
|
+
readonly classes: Readonly<Record<string, readonly string[]>>;
|
|
91
|
+
};
|
|
92
|
+
readonly specDoubles: {
|
|
93
|
+
readonly kit: string;
|
|
94
|
+
readonly doubles: readonly HfsSpecDouble[];
|
|
95
|
+
};
|
|
96
|
+
readonly paramNames: readonly HfsParamName[];
|
|
97
|
+
readonly unitRoles?: readonly HfsUnitRole[];
|
|
98
|
+
readonly logicRoles?: readonly string[];
|
|
99
|
+
readonly valueRoles?: readonly string[];
|
|
100
|
+
readonly thinRoles?: readonly string[];
|
|
101
|
+
}
|
|
102
|
+
/** The frozen view of one side of an app. */
|
|
103
|
+
export interface HfsView {
|
|
104
|
+
readonly repoRoot: string;
|
|
105
|
+
readonly profile: string;
|
|
106
|
+
readonly side: string | null;
|
|
107
|
+
readonly edition: string;
|
|
108
|
+
readonly grammar?: string;
|
|
109
|
+
readonly apps: readonly HfsApp[];
|
|
110
|
+
readonly connections?: readonly HfsConnection[];
|
|
111
|
+
readonly patterns: readonly string[];
|
|
112
|
+
readonly ruleParams: HfsRuleParams;
|
|
113
|
+
/** The repository-relative, forward-slash form of a linted filename. */
|
|
114
|
+
relative(file: string): string;
|
|
115
|
+
/** The classification of a file. */
|
|
116
|
+
classify(file: string): HfsClassification;
|
|
117
|
+
/** The slot id that owns a file, or null. */
|
|
118
|
+
slotOf(file: string): string | null;
|
|
119
|
+
/** The tier of a file, or null. */
|
|
120
|
+
tierOf(file: string): string | null;
|
|
121
|
+
/** The owner root of a file, or null. */
|
|
122
|
+
ownerOf(file: string): string | null;
|
|
123
|
+
/** What the owning slot's `allows` says about a file, or null when it names none. */
|
|
124
|
+
allows(file: string): HfsAllowsVerdict | null;
|
|
125
|
+
/** A slot definition by id. */
|
|
126
|
+
slot(id: string): HfsSlot | undefined;
|
|
127
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/lib/hfs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { HfsView } from "./hfs-view.js";
|
|
2
2
|
import type { Context } from "./rule.js";
|
|
3
|
-
export type { HfsAllowsVerdict, HfsApp, HfsClassification, HfsConnection, HfsParamName, HfsRuleParams, HfsSlot, HfsSpecDouble, HfsUnitRole, HfsView, } from "
|
|
3
|
+
export type { HfsAllowsVerdict, HfsApp, HfsClassification, HfsConnection, HfsParamName, HfsRuleParams, HfsSlot, HfsSpecDouble, HfsUnitRole, HfsView, } from "./hfs-view.js";
|
|
4
4
|
/**
|
|
5
5
|
* The HFS view of the side whose `eslint.config.mjs` (in be/) calls this.
|
|
6
6
|
*
|
package/dist/lib/hfs.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { dirname } from "node:path";
|
|
15
15
|
import { fileURLToPath } from "node:url";
|
|
16
|
-
import { declaredHfsView, openHfsView } from "
|
|
16
|
+
import { declaredHfsView, openHfsView } from "#runtime/scripts/hfs/view.mjs";
|
|
17
17
|
import { RUNTIME_ROOT as RUNTIME } from "./runtime-root.js";
|
|
18
18
|
/**
|
|
19
19
|
* The HFS view of the side whose `eslint.config.mjs` (in be/) calls this.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starci/eslint-canon-be",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"description": "The StarCi back-end lint canon: every rule its laws publish, gathered as one flat-config plugin.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
"default": "./dist/index.js"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
|
+
"imports": {
|
|
25
|
+
"#runtime/*": {
|
|
26
|
+
"types": "./src/types/runtime/*",
|
|
27
|
+
"default": "./runtime/*"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
24
30
|
"main": "./dist/index.js",
|
|
25
31
|
"files": [
|
|
26
32
|
"LICENSE",
|
|
@@ -30,35 +30,35 @@ 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.15.
|
|
33
|
+
version: 0.15.1
|
|
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.6.
|
|
40
|
+
version: 3.6.1
|
|
41
41
|
group: starci
|
|
42
42
|
install: registry
|
|
43
43
|
side: be
|
|
44
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.4.
|
|
47
|
+
version: 9.4.1
|
|
48
48
|
group: starci
|
|
49
49
|
install: registry
|
|
50
50
|
side: fe
|
|
51
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
53
|
'@starci/eslint-grammar-core':
|
|
54
|
-
version: 0.15.
|
|
54
|
+
version: 0.15.1
|
|
55
55
|
group: starci
|
|
56
56
|
install: registry
|
|
57
57
|
side: fe
|
|
58
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.15.
|
|
61
|
+
version: 0.15.1
|
|
62
62
|
group: starci
|
|
63
63
|
install: registry
|
|
64
64
|
side: fe
|
|
@@ -105,14 +105,14 @@ pins:
|
|
|
105
105
|
source: packages/ai-router/package.json
|
|
106
106
|
why: 'the AI pool router of a back end: a NestJS module that routes OpenAI-compatible chat, stream and embeddings calls across keys, models and providers, with @starci/ai-router/testing for its specs; @starci/jest-preset compiles it as an ESM-only dependency.'
|
|
107
107
|
'starci-harness':
|
|
108
|
-
version: 1.1.0-alpha.
|
|
108
|
+
version: 1.1.0-alpha.2
|
|
109
109
|
group: starci
|
|
110
110
|
install: registry
|
|
111
111
|
side: both
|
|
112
112
|
source: cli/package.json
|
|
113
113
|
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.'
|
|
114
114
|
'@starci/hfs':
|
|
115
|
-
version: 4.9.
|
|
115
|
+
version: 4.9.2
|
|
116
116
|
group: starci
|
|
117
117
|
install: registry
|
|
118
118
|
side: both
|
|
@@ -42,13 +42,13 @@ function askGit(root) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* The product repository name: the
|
|
46
|
-
*
|
|
47
|
-
* (a nested product, an example) is named by
|
|
45
|
+
* The product repository name: the origin remote's repository name (one name for every clone and worktree, whatever
|
|
46
|
+
* folder holds it), else the main checkout's folder name (so a worktree and its main checkout agree), else package.json
|
|
47
|
+
* name outside Git, else the folder name. A folder inside a larger repository (a nested product, an example) is named by
|
|
48
|
+
* its own folder.
|
|
48
49
|
*/
|
|
49
50
|
export function repositoryName(root) {
|
|
50
51
|
const { inWorkTree, repositoryRoot, home } = identityOf(root);
|
|
51
|
-
if (home) return path.basename(home);
|
|
52
52
|
if (repositoryRoot) {
|
|
53
53
|
try {
|
|
54
54
|
const remote = trimTrailingSlashes(git(gitRemote, root, ['get-url', 'origin'])).replace(GIT_SUFFIX, '');
|
|
@@ -56,6 +56,7 @@ export function repositoryName(root) {
|
|
|
56
56
|
if (name) return name;
|
|
57
57
|
} catch { /* No origin remote. */ }
|
|
58
58
|
}
|
|
59
|
+
if (home) return path.basename(home);
|
|
59
60
|
if (inWorkTree && !repositoryRoot) return path.basename(root);
|
|
60
61
|
try {
|
|
61
62
|
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
|