@starci/eslint-canon-fe 8.4.19 → 8.4.21
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
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 8.4.21 - 2026-10-20
|
|
4
|
+
- Changed: republished for the complete 1.7.14 cohort; 8.4.20 was published while @starci/hfs 4.7.14 and @starci/cli 1.7.14 stopped at their clean proof, so it is a superseded orphan and is not used. Content equals 8.4.20 apart from the canon pins.
|
|
5
|
+
|
|
6
|
+
## 8.4.20 - 2026-10-20
|
|
7
|
+
- Changed: bundled runtime copies carry the HFS hooks-installed check (`HFS_HOOKS_NOT_INSTALLED`); lint behavior is unchanged; canon pins follow the matching package cohort.
|
|
8
|
+
|
|
3
9
|
## 8.4.19 - 2026-10-20
|
|
4
10
|
- Fixed: bundled runtime source clears the SonarCloud code smells of alpha.23 (regex complexity, concise classes, string prefix and suffix checks, block braces, optional chaining, export-from, default parameters, synchronous awaits, dead stores) without behavior change; canon pins follow the matching package cohort.
|
|
5
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starci/eslint-canon-fe",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.21",
|
|
4
4
|
"description": "The StarCi front-end lint canon: every rule its laws publish, gathered as one flat-config plugin and attached by one factory.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,14 +29,14 @@ pins:
|
|
|
29
29
|
source: packages/grammar/package.json
|
|
30
30
|
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.'
|
|
31
31
|
'@starci/eslint-canon-be':
|
|
32
|
-
version: 3.4.
|
|
32
|
+
version: 3.4.22
|
|
33
33
|
group: starci
|
|
34
34
|
install: registry
|
|
35
35
|
side: be
|
|
36
36
|
source: packages/eslint/be/package.json
|
|
37
37
|
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.'
|
|
38
38
|
'@starci/eslint-canon-fe':
|
|
39
|
-
version: 8.4.
|
|
39
|
+
version: 8.4.21
|
|
40
40
|
group: starci
|
|
41
41
|
install: registry
|
|
42
42
|
side: fe
|
|
@@ -76,14 +76,14 @@ pins:
|
|
|
76
76
|
source: packages/test-world/package.json
|
|
77
77
|
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.'
|
|
78
78
|
'@starci/cli':
|
|
79
|
-
version: 1.7.
|
|
79
|
+
version: 1.7.14
|
|
80
80
|
group: starci
|
|
81
81
|
install: registry
|
|
82
82
|
side: both
|
|
83
83
|
source: packages/cli/package.json
|
|
84
84
|
why: 'the only StarCi command package; product repositories install it for starci app, while @starci/hfs remains its pinned transitive implementation.'
|
|
85
85
|
'@starci/hfs':
|
|
86
|
-
version: 4.7.
|
|
86
|
+
version: 4.7.14
|
|
87
87
|
group: starci
|
|
88
88
|
install: registry
|
|
89
89
|
side: both
|
|
@@ -2,6 +2,7 @@ import fs from 'node:fs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { lsFiles } from '../../api/git/ls-files.mjs'; import { revParseQuery } from '../../api/git/rev-parse-query.mjs'; import { configGet } from '../../api/git/config-get.mjs'; import { gitOutputOf } from '../../lib/git.mjs';
|
|
4
4
|
import { braceVariants } from '../../lib/glob.mjs';
|
|
5
|
+
import { hooksDirState } from '../../lib/git-hooks-dir.mjs';
|
|
5
6
|
import { createSlotResolver, loadSlotManifest, openHfs } from '../slots.mjs';
|
|
6
7
|
import { isFeTestPath } from '../rules/fe-no-tests.mjs';
|
|
7
8
|
import { byCodeUnit } from '../../lib/list.mjs';
|
|
@@ -21,6 +22,7 @@ export const HFS_RULE_IDS = [
|
|
|
21
22
|
'HFS_APPS_REQUIRED',
|
|
22
23
|
'HFS_APP_LAYOUT_INVALID',
|
|
23
24
|
'HFS_E2E_IN_AUTOMATIC_GATE',
|
|
25
|
+
'HFS_HOOKS_NOT_INSTALLED',
|
|
24
26
|
'HFS_HOOKS_PATH_REDIRECTED',
|
|
25
27
|
'HFS_MODULE_TIER_INVALID',
|
|
26
28
|
'HFS_PACKAGE_MANAGER_MIXED',
|
|
@@ -114,15 +116,28 @@ function ownsGitTopLevel(root) {
|
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
118
|
|
|
117
|
-
/**
|
|
119
|
+
/**
|
|
120
|
+
* The hooks of the checked root: core.hooksPath stays husky's (HFS_HOOKS_PATH_REDIRECTED), and the folder it names holds
|
|
121
|
+
* installed hooks in this checkout (HFS_HOOKS_NOT_INSTALLED, scripts/lib/git-hooks-dir.mjs). An unset key judges nothing: a CI
|
|
122
|
+
* checkout installs without hooks. A directory that is not the top level of its own work tree has no hooks of its own: the
|
|
123
|
+
* check is not applicable there.
|
|
124
|
+
*/
|
|
118
125
|
function hooksPathNotRedirected({ root, finding }) {
|
|
119
126
|
if (!ownsGitTopLevel(root)) return { status: 'not-applicable', reason: 'the checked root is not the top level of its own Git work tree, so it has no hooks of its own' };
|
|
120
127
|
const set = configGet(root, 'core.hooksPath', { local: true });
|
|
121
128
|
if (!set.ok) return { status: 'checked' }; // key not set: nothing is redirected
|
|
122
|
-
const value = set.stdout;
|
|
123
|
-
if (value
|
|
129
|
+
const value = String(set.stdout ?? '').trim();
|
|
130
|
+
if (!value) return { status: 'checked' };
|
|
131
|
+
if (!HUSKY_HOOKS_PATH.test(value.replaceAll('\\', '/'))) {
|
|
124
132
|
finding('HFS_HOOKS_PATH_REDIRECTED', '.git/config', `core.hooksPath is set to ${value} in this clone. Unset it (git config --local --unset core.hooksPath) and let husky own the hooks; a redirected path skips the pre-commit and pre-push gates.`);
|
|
125
|
-
|
|
133
|
+
return { status: 'checked' };
|
|
134
|
+
}
|
|
135
|
+
const hooks = hooksDirState(root, value);
|
|
136
|
+
if (hooks.state !== 'installed') {
|
|
137
|
+
const what = { missing: 'does not exist', empty: 'holds no installed hook (husky never ran here)', unreadable: `cannot be read (${hooks.error})` }[hooks.state];
|
|
138
|
+
finding('HFS_HOOKS_NOT_INSTALLED', value, `core.hooksPath is ${value}, but that folder ${what} in this checkout, so git runs no pre-commit or pre-push gate and a commit skips lint and specs. Install the hooks before committing: run \`starci npm ci\` at the app root (it runs the app's hook installer \`npm run prepare\` even when lifecycle scripts are ignored), or \`npm run prepare\`; an install with --ignore-scripts alone never installs them.`);
|
|
139
|
+
}
|
|
140
|
+
return { status: 'checked', hooks: hooks.state };
|
|
126
141
|
}
|
|
127
142
|
|
|
128
143
|
/** The tracked paths under the given root, relative to it: the pathspec keeps a nested directory from listing the paths of its enclosing clone. */
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// git-hooks-dir.mjs - whether a checkout's hooks folder holds installed hooks. The one judgement read by `starci npm ci` and
|
|
2
|
+
// `starci npm install` (scripts/machine/npm-hooks.mjs, which runs the app's hook installer when it fails) and by the HFS check
|
|
3
|
+
// HFS_HOOKS_NOT_INSTALLED (scripts/hfs/architecture/hfs.mjs). husky's `.husky/_` is generated per checkout: a linked worktree or
|
|
4
|
+
// an install whose lifecycle scripts were ignored has none, or only the runtime's own wrapped hooks, so git runs no pre-commit gate.
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
|
|
8
|
+
/** husky's generated hooks folder; every hook file in it sources the dispatcher `h`, which runs the tracked `.husky/<hook>`. */
|
|
9
|
+
const HUSKY_GENERATED = /^\.husky\/_\/?$/u;
|
|
10
|
+
const HUSKY_DISPATCHER = 'h';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The state of the hooks folder `hooksPath` (a core.hooksPath value, relative to the checkout `root` or absolute):
|
|
14
|
+
* `{ state, dir }` with state `installed`, `missing` (no such folder), `empty` (no hook file; for husky's `.husky/_`, no
|
|
15
|
+
* dispatcher `h`) or `unreadable` (with `error`).
|
|
16
|
+
*/
|
|
17
|
+
export function hooksDirState(root, hooksPath) {
|
|
18
|
+
const value = String(hooksPath ?? '').trim().replaceAll('\\', '/');
|
|
19
|
+
const dir = path.resolve(root, value);
|
|
20
|
+
let entries;
|
|
21
|
+
try {
|
|
22
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
23
|
+
} catch (error) {
|
|
24
|
+
if (error?.code === 'ENOENT' || error?.code === 'ENOTDIR') return { state: 'missing', dir };
|
|
25
|
+
return { state: 'unreadable', dir, error: String(error?.message ?? error) };
|
|
26
|
+
}
|
|
27
|
+
const files = entries.filter((entry) => entry.isFile() && entry.name !== '.gitignore').map((entry) => entry.name);
|
|
28
|
+
const installed = HUSKY_GENERATED.test(value) ? files.includes(HUSKY_DISPATCHER) : files.length > 0;
|
|
29
|
+
return { state: installed ? 'installed' : 'empty', dir };
|
|
30
|
+
}
|