@starci/eslint-canon-be 3.18.4 → 3.19.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 +8 -0
- package/README.md +1 -1
- package/dist/comments.js +1 -1
- package/dist/explicit-surface.js +1 -1
- package/dist/index.js +1 -1
- package/dist/jwt-alg.js +1 -1
- package/dist/lib/edition.d.ts +1 -1
- package/dist/lib/edition.js +1 -1
- package/dist/lib/hfs-view.d.ts +5 -0
- package/dist/lib/hfs.d.ts +0 -6
- package/dist/lib/hfs.js +7 -5
- package/dist/lib/runtime-root.d.ts +6 -1
- package/dist/lib/runtime-root.js +8 -2
- package/dist/lib/subject-values.js +1 -1
- package/dist/module-layering.js +2 -2
- package/dist/project-graph.js +1 -1
- package/dist/schema-authority.js +66 -2
- package/dist/third-party-owner.js +1 -1
- package/package.json +3 -1
- package/runtime/bundle.json +1 -190
- package/runtime/scripts/api/git/recorded-lines.mjs +5 -5
- package/runtime/scripts/hfs/project-graph.mjs +6 -6
- package/runtime/scripts/hfs/project-rule.mjs +3 -3
- package/runtime/config.example.yaml +0 -194
- package/runtime/engine/by-code-unit.mjs +0 -12
- package/runtime/engine/config.mjs +0 -461
- package/runtime/engine/invalid-config.mjs +0 -15
- package/runtime/engine/model-config.mjs +0 -112
- package/runtime/engine/orca-config.mjs +0 -34
- package/runtime/engine/plain-object.mjs +0 -5
- package/runtime/engine/release-config.mjs +0 -32
- package/runtime/engine/removed-vocabulary.mjs +0 -27
- package/runtime/engine/resources-config.mjs +0 -59
- package/runtime/engine/runtime-root.mjs +0 -138
- package/runtime/engine/secrets.mjs +0 -202
- package/runtime/engine/sonar-config.mjs +0 -24
- package/runtime/engine/temp-root.mjs +0 -26
- package/runtime/engine/yaml.mjs +0 -161
- package/runtime/knowledge/grammars/index.yaml +0 -114
- package/runtime/knowledge/hfs/canon-pins.yaml +0 -720
- package/runtime/knowledge/hfs/fe-stack.yaml +0 -272
- package/runtime/knowledge/hfs/rules.yaml +0 -6760
- package/runtime/knowledge/hfs/slots.yaml +0 -2783
- package/runtime/knowledge/patterns/fe/folder.yaml +0 -425
- package/runtime/knowledge/sonar-gate.yaml +0 -151
- package/runtime/modules/kernel/removed-vocabulary.yaml +0 -458
- package/runtime/modules/models/registry.yaml +0 -221
- package/runtime/modules/models/runtimes.yaml +0 -556
- package/runtime/modules/models/tiers.yaml +0 -66
- package/runtime/scripts/api/git/cat-file.mjs +0 -4
- package/runtime/scripts/api/git/config-get.mjs +0 -9
- package/runtime/scripts/api/git/diff.mjs +0 -4
- package/runtime/scripts/api/git/lib.mjs +0 -80
- package/runtime/scripts/api/git/ls-files.mjs +0 -5
- package/runtime/scripts/api/git/ls-tree.mjs +0 -4
- package/runtime/scripts/api/git/merge-base.mjs +0 -8
- package/runtime/scripts/api/git/remote.mjs +0 -4
- package/runtime/scripts/api/git/rev-parse-query.mjs +0 -4
- package/runtime/scripts/api/git/show.mjs +0 -5
- package/runtime/scripts/api/git/tag.mjs +0 -4
- package/runtime/scripts/hfs/allows.mjs +0 -77
- package/runtime/scripts/hfs/architecture/ast-walks.mjs +0 -250
- package/runtime/scripts/hfs/architecture/automatic-gates.mjs +0 -103
- package/runtime/scripts/hfs/architecture/backend-app-files.mjs +0 -114
- package/runtime/scripts/hfs/architecture/backend.mjs +0 -462
- package/runtime/scripts/hfs/architecture/background-unowned.mjs +0 -254
- package/runtime/scripts/hfs/architecture/canon-clones.mjs +0 -291
- package/runtime/scripts/hfs/architecture/canon-jsx-clones.mjs +0 -224
- package/runtime/scripts/hfs/architecture/client-reaches-server.mjs +0 -102
- package/runtime/scripts/hfs/architecture/clones.mjs +0 -287
- package/runtime/scripts/hfs/architecture/component-tiers.mjs +0 -161
- package/runtime/scripts/hfs/architecture/config-unread.mjs +0 -16
- package/runtime/scripts/hfs/architecture/config.mjs +0 -407
- package/runtime/scripts/hfs/architecture/connection-map.mjs +0 -350
- package/runtime/scripts/hfs/architecture/constructor-deps.mjs +0 -115
- package/runtime/scripts/hfs/architecture/context-coupling.mjs +0 -117
- package/runtime/scripts/hfs/architecture/context-map.mjs +0 -355
- package/runtime/scripts/hfs/architecture/context-owner.mjs +0 -102
- package/runtime/scripts/hfs/architecture/context-platform-tables.mjs +0 -65
- package/runtime/scripts/hfs/architecture/context-transaction.mjs +0 -75
- package/runtime/scripts/hfs/architecture/contract-bounds.mjs +0 -72
- package/runtime/scripts/hfs/architecture/contract-fixture-guard.mjs +0 -177
- package/runtime/scripts/hfs/architecture/contracts-readonly.mjs +0 -360
- package/runtime/scripts/hfs/architecture/contracts.mjs +0 -489
- package/runtime/scripts/hfs/architecture/cross-app-duplicate.mjs +0 -81
- package/runtime/scripts/hfs/architecture/dead-exports-bindings.mjs +0 -173
- package/runtime/scripts/hfs/architecture/dead-exports.mjs +0 -420
- package/runtime/scripts/hfs/architecture/default-deny.mjs +0 -175
- package/runtime/scripts/hfs/architecture/doc-language.mjs +0 -45
- package/runtime/scripts/hfs/architecture/entity-registry.mjs +0 -51
- package/runtime/scripts/hfs/architecture/entrypoint.mjs +0 -75
- package/runtime/scripts/hfs/architecture/error-codes.mjs +0 -54
- package/runtime/scripts/hfs/architecture/error-masked.mjs +0 -78
- package/runtime/scripts/hfs/architecture/fe-slot-allows.mjs +0 -44
- package/runtime/scripts/hfs/architecture/feature-shape.mjs +0 -60
- package/runtime/scripts/hfs/architecture/framework-pinned.mjs +0 -41
- package/runtime/scripts/hfs/architecture/frontend-block-render.mjs +0 -112
- package/runtime/scripts/hfs/architecture/frontend-grammar.mjs +0 -193
- package/runtime/scripts/hfs/architecture/frontend-routing.mjs +0 -198
- package/runtime/scripts/hfs/architecture/frontend-world-render.mjs +0 -368
- package/runtime/scripts/hfs/architecture/frontend-world.mjs +0 -374
- package/runtime/scripts/hfs/architecture/frontend.mjs +0 -248
- package/runtime/scripts/hfs/architecture/function-spec-providers.mjs +0 -185
- package/runtime/scripts/hfs/architecture/hfs-graph.mjs +0 -77
- package/runtime/scripts/hfs/architecture/hfs.mjs +0 -394
- package/runtime/scripts/hfs/architecture/hooks-are-hooks.mjs +0 -118
- package/runtime/scripts/hfs/architecture/i18n-keys.mjs +0 -213
- package/runtime/scripts/hfs/architecture/identity.mjs +0 -121
- package/runtime/scripts/hfs/architecture/index.mjs +0 -402
- package/runtime/scripts/hfs/architecture/injection-token-exported.mjs +0 -69
- package/runtime/scripts/hfs/architecture/jwt-ast.mjs +0 -231
- package/runtime/scripts/hfs/architecture/machine-ast.mjs +0 -232
- package/runtime/scripts/hfs/architecture/managed-scripts.mjs +0 -32
- package/runtime/scripts/hfs/architecture/module-per-transport.mjs +0 -237
- package/runtime/scripts/hfs/architecture/next-data-contract.mjs +0 -126
- package/runtime/scripts/hfs/architecture/next-data-inference.mjs +0 -192
- package/runtime/scripts/hfs/architecture/next-data-key.mjs +0 -374
- package/runtime/scripts/hfs/architecture/next-data-symbols.mjs +0 -26
- package/runtime/scripts/hfs/architecture/next-data.mjs +0 -425
- package/runtime/scripts/hfs/architecture/operation-contract-roots.mjs +0 -55
- package/runtime/scripts/hfs/architecture/owners.mjs +0 -142
- package/runtime/scripts/hfs/architecture/package-shape.mjs +0 -92
- package/runtime/scripts/hfs/architecture/presentation.mjs +0 -173
- package/runtime/scripts/hfs/architecture/reachability.mjs +0 -330
- package/runtime/scripts/hfs/architecture/register-once.mjs +0 -212
- package/runtime/scripts/hfs/architecture/registration.mjs +0 -372
- package/runtime/scripts/hfs/architecture/render-graph.mjs +0 -449
- package/runtime/scripts/hfs/architecture/render-prop-across-server.mjs +0 -58
- package/runtime/scripts/hfs/architecture/required-files.mjs +0 -237
- package/runtime/scripts/hfs/architecture/root-packages.mjs +0 -78
- package/runtime/scripts/hfs/architecture/route-files-thin.mjs +0 -133
- package/runtime/scripts/hfs/architecture/schema-owner.mjs +0 -288
- package/runtime/scripts/hfs/architecture/server-action.mjs +0 -78
- package/runtime/scripts/hfs/architecture/side-boundary.mjs +0 -13
- package/runtime/scripts/hfs/architecture/source-names-shape.mjs +0 -320
- package/runtime/scripts/hfs/architecture/source-names.mjs +0 -393
- package/runtime/scripts/hfs/architecture/sql-keys.mjs +0 -344
- package/runtime/scripts/hfs/architecture/sql-owner.mjs +0 -291
- package/runtime/scripts/hfs/architecture/sql-returning.mjs +0 -76
- package/runtime/scripts/hfs/architecture/sql-token-forms.mjs +0 -117
- package/runtime/scripts/hfs/architecture/sql-tokens.mjs +0 -587
- package/runtime/scripts/hfs/architecture/staged-consumers.mjs +0 -42
- package/runtime/scripts/hfs/architecture/surface-nesting.mjs +0 -127
- package/runtime/scripts/hfs/architecture/surface.mjs +0 -88
- package/runtime/scripts/hfs/architecture/symbols.mjs +0 -273
- package/runtime/scripts/hfs/architecture/test-world-files.mjs +0 -263
- package/runtime/scripts/hfs/architecture/tiers.mjs +0 -256
- package/runtime/scripts/hfs/architecture/transport-owner.mjs +0 -248
- package/runtime/scripts/hfs/architecture/type-context.mjs +0 -335
- package/runtime/scripts/hfs/architecture/typescript.mjs +0 -477
- package/runtime/scripts/hfs/architecture/unit-spec-providers.mjs +0 -165
- package/runtime/scripts/hfs/declaration-shape.mjs +0 -196
- package/runtime/scripts/hfs/declaration-slots.mjs +0 -89
- package/runtime/scripts/hfs/edition-slots.mjs +0 -80
- package/runtime/scripts/hfs/explicit-surface-rule.mjs +0 -59
- package/runtime/scripts/hfs/linear-text.mjs +0 -30
- package/runtime/scripts/hfs/manifest-shape.mjs +0 -474
- package/runtime/scripts/hfs/param-names.mjs +0 -13
- package/runtime/scripts/hfs/path-findings.mjs +0 -167
- package/runtime/scripts/hfs/repo-identity.mjs +0 -89
- package/runtime/scripts/hfs/rule-catalog.mjs +0 -458
- package/runtime/scripts/hfs/rule-params-shape.mjs +0 -103
- package/runtime/scripts/hfs/rules/database-constants.mjs +0 -25
- package/runtime/scripts/hfs/rules/database-migrations.mjs +0 -684
- package/runtime/scripts/hfs/rules/fe-no-tests.mjs +0 -68
- package/runtime/scripts/hfs/rules/read.mjs +0 -45
- package/runtime/scripts/hfs/rules/secrets.mjs +0 -79
- package/runtime/scripts/hfs/rules/spec-placement.mjs +0 -28
- package/runtime/scripts/hfs/slot-app-view.mjs +0 -97
- package/runtime/scripts/hfs/slot-classify.mjs +0 -69
- package/runtime/scripts/hfs/slot-errors.mjs +0 -12
- package/runtime/scripts/hfs/slot-imports.mjs +0 -98
- package/runtime/scripts/hfs/slot-manifest-shape.mjs +0 -111
- package/runtime/scripts/hfs/slot-match.mjs +0 -164
- package/runtime/scripts/hfs/slot-path.mjs +0 -6
- package/runtime/scripts/hfs/slot-required.mjs +0 -95
- package/runtime/scripts/hfs/slot-semantic-problems.mjs +0 -175
- package/runtime/scripts/hfs/slot-side-problems.mjs +0 -32
- package/runtime/scripts/hfs/slots.mjs +0 -306
- package/runtime/scripts/hfs/test-world-slot.mjs +0 -5
- package/runtime/scripts/hfs/trailing-slashes.mjs +0 -8
- package/runtime/scripts/hfs/typescript-programs.mjs +0 -95
- package/runtime/scripts/hfs/view.mjs +0 -180
- package/runtime/scripts/lib/declaration-surface.mjs +0 -166
- package/runtime/scripts/lib/dockerfile.mjs +0 -164
- package/runtime/scripts/lib/env.mjs +0 -18
- package/runtime/scripts/lib/event-contract.mjs +0 -102
- package/runtime/scripts/lib/git-hooks-dir.mjs +0 -30
- package/runtime/scripts/lib/git.mjs +0 -35
- package/runtime/scripts/lib/glob.mjs +0 -32
- package/runtime/scripts/lib/grammar-lint.mjs +0 -57
- package/runtime/scripts/lib/i18n.mjs +0 -82
- package/runtime/scripts/lib/in-order.mjs +0 -90
- package/runtime/scripts/lib/json-clone.mjs +0 -70
- package/runtime/scripts/lib/json.mjs +0 -44
- package/runtime/scripts/lib/language.mjs +0 -233
- package/runtime/scripts/lib/list.mjs +0 -26
- package/runtime/scripts/lib/mutation-fence.mjs +0 -20
- package/runtime/scripts/lib/package-at.mjs +0 -62
- package/runtime/scripts/lib/path-key.mjs +0 -124
- package/runtime/scripts/lib/read-text.mjs +0 -47
- package/runtime/scripts/lib/regex.mjs +0 -3
- package/runtime/scripts/lib/rule-packs.mjs +0 -243
- package/runtime/scripts/lib/same-text.mjs +0 -4
- package/runtime/scripts/lib/secret-patterns.mjs +0 -230
- package/runtime/scripts/lib/sops-envelope.mjs +0 -212
- package/runtime/scripts/lib/stack-services.mjs +0 -191
- package/runtime/scripts/lib/ts-analysis.mjs +0 -39
- package/runtime/scripts/lib/ts-ast.mjs +0 -63
- package/runtime/scripts/lib/walk.mjs +0 -45
- package/runtime/scripts/lib/yaml-cached.mjs +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.19.1 - 2026-11-05
|
|
4
|
+
|
|
5
|
+
- Added (HR-CORE-BE-3, R34 `BE_SCHEMA_AUTHORITY`, `no-runtime-schema`): a root-package file hfs.json `sides.be.ddlRenderers` lists (`{ path, reason }`, app-root relative, a `*` only in the file name; the hfs runtime merges it into `ruleParams.ddlRenderers`) may hold DDL text, so the renderer `cli entities plan --write` uses to write NEW migration files is no longer flagged. It may only build and return the text: in that file a database client import (typeorm, pg, ...) is refused (`rendererClient`) and so is a `.query/.execute/.exec/.raw/.unsafe` call (`rendererExecutes`); DDL text in any other file, including the rest of the same package and every file of the be side, is still refused; and a file that is neither the cli nor a root package and imports (or re-exports) a symbol the renderer declares, directly or through a package barrel, is refused (`rendererImported`; type-only imports are not). Needs @starci/hfs 5.13.2.
|
|
6
|
+
|
|
7
|
+
## 3.19.0 - 2026-11-05
|
|
8
|
+
|
|
9
|
+
- Changed (decision release-only-what-changed): the canon reads the @starci/hfs runtime (slots, rule catalog, canon pins, failure codes, the architecture machine) from the installed hfs at run time, which it peers by `~5.13.0`, and bundles no copy; `runtime/` keeps only the project graph rule, the jsdoc and sonar helpers and the package-scripts template. The stale forks it kept (slots 3.13.0) are gone, so it lints with the manifest hfs ships.
|
|
10
|
+
|
|
3
11
|
## 3.18.4 - 2026-11-05
|
|
4
12
|
|
|
5
13
|
- Changed: the runtime copy of the canon pins gives the Grammar family its same-minor range (decision grammar-patch-range) and names `@starci/hfs` 5.12.0 and the Grammar family 0.22.0; the runtime copy of R15 reads the range.
|
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ A sample, not the list:
|
|
|
38
38
|
| Area | What the rules hold |
|
|
39
39
|
|---|---|
|
|
40
40
|
| **Errors** | A `catch` rethrows, calls a method on a `Logger` receiver (typed, from `platform/logging`) or returns an outcome carrying its cause; a `DomainError` subclass lives only in `errors/<capability>.error.ts` of its owner, and that file is one code enum, one `Record<Code, ErrorKind>` table and one empty class; a `throw` throws a `DomainError`, never a bare `Error`, a framework exception or a platform error out of a domain; a root workspace package throws the error base its `package.json` declares (`starci.errorBase`) (`catch-must-account`, `error-home`, `throw-domain-error`, `error-family-shape`) |
|
|
41
|
-
| **Schema authority** | Migrations only: every DataSource or TypeORM options object states the literal `synchronize: false` (found by the contextual type), no `migrationsRun`, no DDL string outside a migration, no entity glob; no `@Entity` type reachable from a transport signature, a handler `execute`, a contract or a message, and no GraphQL or validator import in an entity file (`no-runtime-schema`, `no-entity-in-contract`) |
|
|
41
|
+
| **Schema authority** | Migrations only: every DataSource or TypeORM options object states the literal `synchronize: false` (found by the contextual type), no `migrationsRun`, no DDL string outside a migration (but the renderer files hfs.json `sides.be.ddlRenderers` declares, which only build and return DDL text and are not reachable from run-time code), no entity glob; no `@Entity` type reachable from a transport signature, a handler `execute`, a contract or a message, and no GraphQL or validator import in an entity file (`no-runtime-schema`, `no-entity-in-contract`) |
|
|
42
42
|
| **Config and secrets** | `process.env` (any form) is allowed in the `platform/config` file declaring `EnvSource`, the test world (slot `be.tests.world`) and the app bootstrap roles `apps/<app>/src/main.ts` and its matching `<app>.env.ts`; only those two app roles may read `EnvSource` or capability parse helpers. Compose groups and `<app>.options.ts` never read `process.env` or `EnvSource`. `@nestjs/config` and `dotenv` are forbidden config paths. A function exported by a `<capability>.config.ts` keeps its existing name and is called only from these bootstrap roles, its own config file or spec, the test world and a provider contract spec (`config-parsed-in-main`). Secrets use `EnvSource.secret()`: `<NAME>_FILE` takes priority for `.starcistacks` custody, and plain `<NAME>` is read only when the file key is absent; a declared file supplies exact contents and an empty or unreadable path fails startup without fallback. No default of any kind for a value typed `Secret` or `Url`; secrets compare with `timingSafeEqual` (`no-direct-env-read`, `config-parsed-in-main`, `no-secret-default`, `secret-compare-timing-safe`) |
|
|
43
43
|
| **Model calls** (R326, R327, R344) | Every model call goes through the `@starci/ai-router` gateway: an upstream provider key variable (`PROVIDER_KEY_VARIABLES` of `src/ai-gateway.ts`, with its `_FILE` twin) is named only in the gateway's custody owner `integrations/ai-gateway`, specs and the test world included; code builds only `ChatOpenAI` and `OpenAIEmbeddings` of `@langchain/openai`, each from an inline options object whose `configuration.baseURL` is read from a `<c>.options.ts` type and whose `apiKey` is a `platform/config` `Secret` revealed; `integrations/ai` reads exactly `STARCI_AI_KEY`, the one virtual key of every client, and the custody owner passes the gateway no `adminToken`. Which owner may import LangChain, `openai`, a provider SDK or an agent framework is the infrastructure table (`provider-key-custody`, `ai-client-through-gateway`, `ai-virtual-key-name`, `infra-import-owner`) |
|
|
44
44
|
| **Ambient ids** (R142) | `randomUUID` of Node's crypto (named, namespace or global), the `v1`, `v4`, `v6` and `v7` generators of `uuid`, `nanoid` and `ulid` are used only inside `platform/ids`, specs included: code asks the injected `Ids` port and a spec provides `fakeIds()`; the generators are found by the module they are imported from, never by a local name (`no-ambient-id`) |
|
package/dist/comments.js
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import { nameOrValue } from "./lib/ast.js";
|
|
26
26
|
import { hfsOf } from "./lib/hfs.js";
|
|
27
27
|
import { normalizePath } from "./lib/path.js";
|
|
28
|
-
import { hasSecondLanguage } from "
|
|
28
|
+
import { hasSecondLanguage } from "@starci/hfs/runtime/scripts/lib/language.mjs";
|
|
29
29
|
import { jsdocBefore, jsdocDescription } from "../runtime/scripts/lib/jsdoc.mjs";
|
|
30
30
|
/** The slots of the per-owner message catalogs: the only source files that may hold Vietnamese. */
|
|
31
31
|
const CATALOG_SLOTS = new Set(["be.domain.messages", "be.feature.messages"]);
|
package/dist/explicit-surface.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* cache reads (`declarationSurface` of the bundled runtime), so the rule reports exactly the files the cache counts as open.
|
|
9
9
|
*/
|
|
10
10
|
import ts from "typescript";
|
|
11
|
-
import { explicitSurfaceRule } from "
|
|
11
|
+
import { explicitSurfaceRule } from "@starci/hfs/runtime/scripts/hfs/explicit-surface-rule.mjs";
|
|
12
12
|
/** The rules this law contributes to the plugin. */
|
|
13
13
|
export const rules = {
|
|
14
14
|
"explicit-export-surface": explicitSurfaceRule({ ts }),
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* every conversation about the failure. Aliasing one here to match a target's older spelling would
|
|
17
17
|
* leave two names for one rule and no way to tell which a message came from.
|
|
18
18
|
*/
|
|
19
|
-
import { packEslintConfigs } from "
|
|
19
|
+
import { packEslintConfigs } from "@starci/hfs/runtime/scripts/lib/rule-packs.mjs";
|
|
20
20
|
import { buildBeConfig, buildBePackagesConfig } from "./lib/config.js";
|
|
21
21
|
import { pluginForEdition } from "./lib/edition.js";
|
|
22
22
|
import { recommended as aiGatewayRecommended, rules as aiGatewayRules } from "./ai-gateway.js";
|
package/dist/jwt-alg.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import ts from "typescript";
|
|
3
3
|
import { typed } from "./lib/types.js";
|
|
4
4
|
import { isDeclarationFile } from "./lib/path.js";
|
|
5
|
-
import { jwtPolicyProblems } from "
|
|
5
|
+
import { jwtPolicyProblems } from "@starci/hfs/runtime/scripts/hfs/architecture/jwt-ast.mjs";
|
|
6
6
|
/** The text of a module specifier (a string literal), or undefined for any other expression. */
|
|
7
7
|
const specifierText = (specifier) => ("text" in specifier ? specifier.text : undefined);
|
|
8
8
|
/** Recognize jose imports and aliases through their declarations, including namespace imports. */
|
package/dist/lib/edition.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* returns no listeners. The plugin wiring therefore has one generic gate instead of edition checks
|
|
7
7
|
* scattered through rule bodies.
|
|
8
8
|
*/
|
|
9
|
-
import { type RuleCatalog } from "
|
|
9
|
+
import { type RuleCatalog } from "@starci/hfs/runtime/scripts/hfs/rule-catalog.mjs";
|
|
10
10
|
import type { CanonPlugin } from "./config.js";
|
|
11
11
|
/**
|
|
12
12
|
* The plugin view for one HFS edition.
|
package/dist/lib/edition.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* returns no listeners. The plugin wiring therefore has one generic gate instead of edition checks
|
|
7
7
|
* scattered through rule bodies.
|
|
8
8
|
*/
|
|
9
|
-
import { loadRuleCatalog } from "
|
|
9
|
+
import { loadRuleCatalog } from "@starci/hfs/runtime/scripts/hfs/rule-catalog.mjs";
|
|
10
10
|
import { RUNTIME_ROOT as RUNTIME } from "./runtime-root.js";
|
|
11
11
|
let catalogCache;
|
|
12
12
|
/** The bundled rule catalog, loaded once per lint process. */
|
package/dist/lib/hfs-view.d.ts
CHANGED
|
@@ -114,6 +114,11 @@ export interface HfsRuleParams {
|
|
|
114
114
|
readonly file: string;
|
|
115
115
|
readonly reason: string;
|
|
116
116
|
}[];
|
|
117
|
+
/** The root-package files that render DDL text only to return it, app-root-relative with a reason (hfs.json `sides.be.ddlRenderers`). */
|
|
118
|
+
readonly ddlRenderers?: readonly {
|
|
119
|
+
readonly path: string;
|
|
120
|
+
readonly reason: string;
|
|
121
|
+
}[];
|
|
117
122
|
}
|
|
118
123
|
/** The frozen view of one side of an app. */
|
|
119
124
|
export interface HfsView {
|
package/dist/lib/hfs.d.ts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import type { HfsView } from "./hfs-view.js";
|
|
2
2
|
import type { Context } from "./rule.js";
|
|
3
3
|
export type { HfsAllowsVerdict, HfsApp, HfsClassification, HfsConnection, HfsPackageContract, HfsPackageDeclaredType, HfsParamName, HfsRuleParams, HfsSlot, HfsSpecDouble, HfsUnitRole, HfsView, } from "./hfs-view.js";
|
|
4
|
-
/**
|
|
5
|
-
* The HFS view of the side whose `eslint.config.mjs` (in be/) calls this.
|
|
6
|
-
*
|
|
7
|
-
* @param configUrl - `import.meta.url` of the repository's `eslint.config.mjs`.
|
|
8
|
-
* @returns The frozen HFS view (profile, apps, connections, ruleParams, slotOf, tierOf, ownerOf).
|
|
9
|
-
*/
|
|
10
4
|
export declare const loadHfs: (configUrl: string) => HfsView;
|
|
11
5
|
/**
|
|
12
6
|
* The HFS view of the root workspace packages of an app, judged by the laws of the be side: the managed root `eslint.config.mjs`
|
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, declaredPackagesHfsView, openHfsView, openPackagesHfsView } from "
|
|
16
|
+
import { declaredHfsView, declaredPackagesHfsView, openHfsView, openPackagesHfsView } from "@starci/hfs/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.
|
|
@@ -21,7 +21,9 @@ import { RUNTIME_ROOT as RUNTIME } from "./runtime-root.js";
|
|
|
21
21
|
* @param configUrl - `import.meta.url` of the repository's `eslint.config.mjs`.
|
|
22
22
|
* @returns The frozen HFS view (profile, apps, connections, ruleParams, slotOf, tierOf, ownerOf).
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
/** The view @starci/hfs returns, read through this package's own HfsView type (the runtime object is the same; the types are declared here). */
|
|
25
|
+
const asView = (view) => view;
|
|
26
|
+
export const loadHfs = (configUrl) => asView(openHfsView({ runtimeRoot: RUNTIME, repoRoot: dirname(fileURLToPath(configUrl)) }));
|
|
25
27
|
/**
|
|
26
28
|
* The HFS view of the root workspace packages of an app, judged by the laws of the be side: the managed root `eslint.config.mjs`
|
|
27
29
|
* (`packages/*` of the app root) calls this. Paths are the app's own; a package file is of the tier `package` and its owner is its folder.
|
|
@@ -29,7 +31,7 @@ export const loadHfs = (configUrl) => openHfsView({ runtimeRoot: RUNTIME, repoRo
|
|
|
29
31
|
* @param configUrl - `import.meta.url` of the app root's `eslint.config.mjs`.
|
|
30
32
|
* @returns The frozen HFS view (profile be over the paths of the app root).
|
|
31
33
|
*/
|
|
32
|
-
export const loadPackagesHfs = (configUrl) => openPackagesHfsView({ runtimeRoot: RUNTIME, repoRoot: dirname(fileURLToPath(configUrl)), side: "be" });
|
|
34
|
+
export const loadPackagesHfs = (configUrl) => asView(openPackagesHfsView({ runtimeRoot: RUNTIME, repoRoot: dirname(fileURLToPath(configUrl)), side: "be" }));
|
|
33
35
|
/**
|
|
34
36
|
* The HFS view of the root packages of an in-memory app declaration, for rule tests.
|
|
35
37
|
*
|
|
@@ -37,7 +39,7 @@ export const loadPackagesHfs = (configUrl) => openPackagesHfsView({ runtimeRoot:
|
|
|
37
39
|
* @param repoRoot - The absolute app root the linted filenames live under.
|
|
38
40
|
* @returns The frozen HFS view.
|
|
39
41
|
*/
|
|
40
|
-
export const packagesHfsFromDeclaration = (declaration, repoRoot) => declaredPackagesHfsView({ runtimeRoot: RUNTIME, declaration, repoRoot, side: "be" });
|
|
42
|
+
export const packagesHfsFromDeclaration = (declaration, repoRoot) => asView(declaredPackagesHfsView({ runtimeRoot: RUNTIME, declaration, repoRoot, side: "be" }));
|
|
41
43
|
/**
|
|
42
44
|
* The HFS view of the be side of an in-memory app declaration, for rule tests: no file is read except the shipped manifest.
|
|
43
45
|
*
|
|
@@ -45,7 +47,7 @@ export const packagesHfsFromDeclaration = (declaration, repoRoot) => declaredPac
|
|
|
45
47
|
* @param repoRoot - The absolute be side folder the linted filenames live under.
|
|
46
48
|
* @returns The frozen HFS view.
|
|
47
49
|
*/
|
|
48
|
-
export const hfsFromDeclaration = (declaration, repoRoot) => declaredHfsView({ runtimeRoot: RUNTIME, declaration, repoRoot, side: "be" });
|
|
50
|
+
export const hfsFromDeclaration = (declaration, repoRoot) => asView(declaredHfsView({ runtimeRoot: RUNTIME, declaration, repoRoot, side: "be" }));
|
|
49
51
|
/** Whether a settings value is an HFS view (it answers `slotOf`). */
|
|
50
52
|
const isHfsView = (value) => typeof value === "object" && value !== null && "slotOf" in value && typeof value.slotOf === "function";
|
|
51
53
|
/** The `settings.starci.hfs` value of a rule context, if any. */
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
/** The package root: the folder holding package.json, runtime/ and fixtures/. */
|
|
2
2
|
export declare const PACKAGE_ROOT: string;
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* The runtime of the installed @starci/hfs (its peer, a same-minor range): the slot manifest, the rule catalog, the canon pins and the architecture
|
|
5
|
+
* machine are read from it at run time, never from a copy bundled here, so an hfs data change releases hfs alone (decision release-only-what-changed).
|
|
6
|
+
*/
|
|
4
7
|
export declare const RUNTIME_ROOT: string;
|
|
8
|
+
/** The files this package keeps of its own in runtime/ (the project graph rule, the jsdoc and sonar helpers, the package-scripts template). */
|
|
9
|
+
export declare const OWN_RUNTIME_ROOT: string;
|
package/dist/lib/runtime-root.js
CHANGED
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
* The package root and its bundled `runtime/` folder. `src/` (run by the specs) and `dist/` (published) both sit one level below the
|
|
3
3
|
* package root, so the same relative step finds the runtime from either.
|
|
4
4
|
*/
|
|
5
|
+
import { createRequire } from "node:module";
|
|
5
6
|
import { dirname, join } from "node:path";
|
|
6
7
|
import { fileURLToPath } from "node:url";
|
|
7
8
|
/** The package root: the folder holding package.json, runtime/ and fixtures/. */
|
|
8
9
|
export const PACKAGE_ROOT = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
9
|
-
/**
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The runtime of the installed @starci/hfs (its peer, a same-minor range): the slot manifest, the rule catalog, the canon pins and the architecture
|
|
12
|
+
* machine are read from it at run time, never from a copy bundled here, so an hfs data change releases hfs alone (decision release-only-what-changed).
|
|
13
|
+
*/
|
|
14
|
+
export const RUNTIME_ROOT = join(dirname(createRequire(import.meta.url).resolve("@starci/hfs/package.json")), "runtime");
|
|
15
|
+
/** The files this package keeps of its own in runtime/ (the project graph rule, the jsdoc and sonar helpers, the package-scripts template). */
|
|
16
|
+
export const OWN_RUNTIME_ROOT = join(PACKAGE_ROOT, "runtime");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import ts from "typescript";
|
|
4
|
-
import { functionSubjectExports, valueObjectSubjects } from "
|
|
4
|
+
import { functionSubjectExports, valueObjectSubjects } from "@starci/hfs/runtime/scripts/hfs/architecture/function-spec-providers.mjs";
|
|
5
5
|
import { importOf } from "./import-source.js";
|
|
6
6
|
import { typed } from "./types.js";
|
|
7
7
|
/** The exported real function of a function-only sibling subject, with aliases resolved by TypeScript. */
|
package/dist/module-layering.js
CHANGED
|
@@ -25,7 +25,7 @@ import { posix } from "node:path";
|
|
|
25
25
|
import { hfsOf } from "./lib/hfs.js";
|
|
26
26
|
import { baseName } from "./lib/ports.js";
|
|
27
27
|
import { resolveAlias } from "./lib/specifier.js";
|
|
28
|
-
import { ENTITY_REGISTRY_ROLE, registryImporter } from "
|
|
28
|
+
import { ENTITY_REGISTRY_ROLE, registryImporter } from "@starci/hfs/runtime/scripts/hfs/architecture/entity-registry.mjs";
|
|
29
29
|
/** The tiers whose files belong to an owner with a root `index.ts`. */
|
|
30
30
|
const OWNER_TIERS = new Set(["feature", "domain", "platform", "integrations"]);
|
|
31
31
|
/**
|
|
@@ -71,7 +71,7 @@ const indexExportBudget = (hfs, filename) => [hfs.slotOf(filename), `be.${hfs.ti
|
|
|
71
71
|
const importsRegistry = (hfs, filename, target) => {
|
|
72
72
|
const id = hfs.slotOf(`${target}.ts`);
|
|
73
73
|
const slot = id ? hfs.slot(id) : undefined;
|
|
74
|
-
return slot?.role === ENTITY_REGISTRY_ROLE && registryImporter(null, slot, hfs.relative(filename));
|
|
74
|
+
return slot?.role === ENTITY_REGISTRY_ROLE && registryImporter(null, { ...slot, importedBy: [...(slot.importedBy ?? [])] }, hfs.relative(filename));
|
|
75
75
|
};
|
|
76
76
|
/**
|
|
77
77
|
* A cross-owner import targets the owner's public entry: the alias and the owner, nothing deeper. A same-owner import
|
package/dist/project-graph.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* rules and their codes is `LINT_ENFORCERS` of the machine (scripts/hfs/architecture/surface.mjs); `starci app check` keeps the
|
|
8
8
|
* findings that have no TypeScript file to sit on. A graph that cannot be built stops the run with the machine's message.
|
|
9
9
|
*/
|
|
10
|
-
import { LINT_ENFORCERS, belongsTo, codeOf } from "
|
|
10
|
+
import { LINT_ENFORCERS, belongsTo, codeOf } from "@starci/hfs/runtime/scripts/hfs/architecture/surface.mjs";
|
|
11
11
|
import { projectGraph as buildProjectGraph, resetProjectGraphs } from "../runtime/scripts/hfs/project-graph.mjs";
|
|
12
12
|
import { projectRule } from "../runtime/scripts/hfs/project-rule.mjs";
|
|
13
13
|
import { hfsOf } from "./lib/hfs.js";
|
package/dist/schema-authority.js
CHANGED
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
* `@Entity` (a per-entity switch is a second authority); a lifecycle hook (`onModuleInit`, `onApplicationBootstrap`) that
|
|
14
14
|
* writes rows through an `EntityManager` or `DataSource` (seeding is a cli command); a DDL statement in any string
|
|
15
15
|
* outside the migrations of `persistence/`; and an entity or migration glob. Only the cli (its migrate and seed commands) runs migrations and seeds.
|
|
16
|
+
* One declared exception: a root-package file hfs.json `sides.be.ddlRenderers` lists (the renderer a cli command uses to write NEW
|
|
17
|
+
* migration files) may hold DDL text, but only to build and return it: in that file a database client import (typeorm, pg, ...) and a
|
|
18
|
+
* `.query/.execute/.raw/.unsafe` call are refused, and a file outside the cli and the root packages that imports a symbol the
|
|
19
|
+
* renderer declares (directly or through a package barrel) is refused, so the text never reaches a run-time path.
|
|
16
20
|
* - `no-entity-in-contract` (R37 `BE_ENTITY_IN_CONTRACT`) keeps ORM entities out of the types that cross a boundary:
|
|
17
21
|
* any type whose declaration carries `@Entity` (from `typeorm`), reached through the type arguments and properties of
|
|
18
22
|
* a transport signature, the `execute` of a handler, or a `*.contracts.ts`, `*.command.ts` or `*.query.ts` file; and
|
|
@@ -21,6 +25,7 @@
|
|
|
21
25
|
* Where a file lives is asked of the slot view (`be.persistence` and its `migrations/` folder, the transport slots),
|
|
22
26
|
* never of a path pattern.
|
|
23
27
|
*/
|
|
28
|
+
import path from "node:path";
|
|
24
29
|
import ts from "typescript";
|
|
25
30
|
import { isTransportSlot } from "./lib/transport-slots.js";
|
|
26
31
|
import { keyName, walk } from "./lib/ast.js";
|
|
@@ -47,6 +52,21 @@ const WRITE_METHODS = new Set(["insert", "save", "upsert", "update", "delete", "
|
|
|
47
52
|
const WRITE_SQL = /\b(?:INSERT\s+INTO|UPDATE\s+\S+\s+SET|DELETE\s+FROM|MERGE\s+INTO)\b/i;
|
|
48
53
|
/** The Nest lifecycle hooks that run at boot in every process that composes the provider. */
|
|
49
54
|
const BOOT_HOOKS = new Set(["onModuleInit", "onApplicationBootstrap"]);
|
|
55
|
+
/** Packages whose import in a DDL renderer would let it run the text it builds. */
|
|
56
|
+
const DATABASE_CLIENTS = ["typeorm", "@nestjs/typeorm", "pg", "pg-promise", "postgres", "slonik", "knex", "kysely", "mysql2", "better-sqlite3", "drizzle-orm"];
|
|
57
|
+
/** Calls that run SQL text. */
|
|
58
|
+
const EXECUTING_CALLS = new Set(["query", "execute", "exec", "raw", "unsafe"]);
|
|
59
|
+
/** Whether `rel` (forward slashes) matches a declared renderer path, a `*` only in the file name. */
|
|
60
|
+
const matchesRenderer = (rel, patterns) => patterns.some((pattern) => {
|
|
61
|
+
const cut = pattern.lastIndexOf("/");
|
|
62
|
+
if (rel.slice(0, cut + 1) !== pattern.slice(0, cut + 1))
|
|
63
|
+
return false;
|
|
64
|
+
const name = pattern.slice(cut + 1);
|
|
65
|
+
const expression = new RegExp(`^${name.split("*").map((part) => part.replace(/[.+?^${}()|[\]\\]/g, "\\$&")).join("[^/]*")}$`);
|
|
66
|
+
return expression.test(rel.slice(cut + 1));
|
|
67
|
+
});
|
|
68
|
+
/** The app-root-relative paths a declaration file can have under this view (a package view is rooted at the app root, the be view one level below). */
|
|
69
|
+
const appRelatives = (hfs, file) => [path.relative(hfs.repoRoot, file), path.relative(path.dirname(hfs.repoRoot), file)].map((text) => text.split(path.sep).join("/"));
|
|
50
70
|
const isFalse = (node) => node?.type === "Literal" && node.value === false;
|
|
51
71
|
/** The text of every string literal and template chunk under `node`. */
|
|
52
72
|
const stringsUnder = (node) => {
|
|
@@ -137,6 +157,9 @@ export const noRuntimeSchema = {
|
|
|
137
157
|
entitySynchronize: "`synchronize` is set in the options of `@Entity`. A per-entity switch is a second schema authority next to the connection's literal `false`; delete the key.",
|
|
138
158
|
bootSeed: "`{{hook}}` writes rows (`{{call}}`), so every process that composes this provider seeds at boot. Seeding is a cli command, run once per connection.",
|
|
139
159
|
ddl: "A schema-changing statement (`CREATE|ALTER|DROP ...`) outside `persistence/migrations/`. Schema-changing SQL belongs in a migration.",
|
|
160
|
+
rendererClient: "A declared DDL renderer imports `{{source}}`, a database client. A renderer only builds DDL text and returns it; the cli writes it as a new migration file and the migrate command runs it.",
|
|
161
|
+
rendererExecutes: "A declared DDL renderer calls `.{{name}}(...)`, which runs SQL text. A renderer only builds and returns DDL; it is never executed at run time.",
|
|
162
|
+
rendererImported: "`{{name}}` is declared in a DDL renderer (hfs.json sides.be.ddlRenderers) and this file is neither the cli nor a root package. DDL text is rendered by the cli entities command and written as a new migration file, never reached from run-time code.",
|
|
140
163
|
glob: "`{{key}}` is found by glob. List the entities and migrations explicitly from each capability's `index.ts` so what runs is what was reviewed.",
|
|
141
164
|
},
|
|
142
165
|
},
|
|
@@ -147,7 +170,46 @@ export const noRuntimeSchema = {
|
|
|
147
170
|
const hfs = hfsOf(context);
|
|
148
171
|
const migration = isMigrationFile(hfs, filename);
|
|
149
172
|
const migrationHost = isMigrationHost(hfs, filename);
|
|
173
|
+
const patterns = (hfs.ruleParams.ddlRenderers ?? []).map((entry) => entry.path);
|
|
174
|
+
const renderer = patterns.length > 0 && matchesRenderer(hfs.relative(filename), patterns);
|
|
175
|
+
// a file may reach a renderer's symbols only from the cli and from the root packages (the renderer's own package, its barrel and specs)
|
|
176
|
+
const mayReachRenderer = renderer || inCli(hfs, filename) || hfs.tierOf(filename) === "package";
|
|
177
|
+
/** Reports an import or re-export of a symbol a declared renderer declares, from a file that may not reach it. */
|
|
178
|
+
const checkRendererImport = (node) => {
|
|
179
|
+
if (patterns.length === 0 || mayReachRenderer || !node.source)
|
|
180
|
+
return;
|
|
181
|
+
if ((node.type === "ImportDeclaration" && node.importKind === "type") || (node.type === "ExportNamedDeclaration" && node.exportKind === "type"))
|
|
182
|
+
return;
|
|
183
|
+
const { checker, toTs } = typed(context);
|
|
184
|
+
const tsNode = toTs(node);
|
|
185
|
+
const specifier = tsNode && (ts.isImportDeclaration(tsNode) || ts.isExportDeclaration(tsNode)) ? tsNode.moduleSpecifier : undefined;
|
|
186
|
+
const moduleSymbol = specifier ? checker.getSymbolAtLocation(specifier) : undefined;
|
|
187
|
+
if (!moduleSymbol)
|
|
188
|
+
return;
|
|
189
|
+
const declaredIn = (symbol) => {
|
|
190
|
+
const target = (symbol.flags & ts.SymbolFlags.Alias) !== 0 ? checker.getAliasedSymbol(symbol) : symbol;
|
|
191
|
+
return (target.declarations ?? []).some((declaration) => matchesRenderer(appRelatives(hfs, declaration.getSourceFile().fileName).find((text) => text.startsWith("packages/")) ?? "", patterns));
|
|
192
|
+
};
|
|
193
|
+
const exported = checker.getExportsOfModule(moduleSymbol);
|
|
194
|
+
const named = node.type === "ImportDeclaration"
|
|
195
|
+
? node.specifiers.filter((item) => !(item.type === "ImportSpecifier" && item.importKind === "type")).flatMap((item) => (item.type === "ImportSpecifier" ? [item.imported.type === "Identifier" ? item.imported.name : String(item.imported.value)] : item.type === "ImportDefaultSpecifier" ? ["default"] : null))
|
|
196
|
+
: node.type === "ExportNamedDeclaration" ? node.specifiers.map((item) => (item.local.type === "Identifier" ? item.local.name : String(item.local.value))) : null;
|
|
197
|
+
const hits = named === null || named.includes(null)
|
|
198
|
+
? exported.filter(declaredIn)
|
|
199
|
+
: exported.filter((symbol) => named.includes(symbol.name) && declaredIn(symbol));
|
|
200
|
+
const first = hits[0];
|
|
201
|
+
if (first)
|
|
202
|
+
context.report({ node, messageId: "rendererImported", data: { name: first.name } });
|
|
203
|
+
};
|
|
150
204
|
return {
|
|
205
|
+
ImportDeclaration(node) {
|
|
206
|
+
if (renderer && DATABASE_CLIENTS.some((client) => String(node.source.value) === client || String(node.source.value).startsWith(`${client}/`))) {
|
|
207
|
+
context.report({ node, messageId: "rendererClient", data: { source: String(node.source.value) } });
|
|
208
|
+
}
|
|
209
|
+
checkRendererImport(node);
|
|
210
|
+
},
|
|
211
|
+
ExportNamedDeclaration: checkRendererImport,
|
|
212
|
+
ExportAllDeclaration: checkRendererImport,
|
|
151
213
|
ObjectExpression(node) {
|
|
152
214
|
if (isOptionsObject(context, node) && !hasKey(node, "synchronize"))
|
|
153
215
|
context.report({ node, messageId: "synchronizeMissing" });
|
|
@@ -196,6 +258,8 @@ export const noRuntimeSchema = {
|
|
|
196
258
|
if (callee.type !== "MemberExpression" || callee.computed || callee.property.type !== "Identifier")
|
|
197
259
|
return;
|
|
198
260
|
const name = callee.property.name;
|
|
261
|
+
if (renderer && EXECUTING_CALLS.has(name))
|
|
262
|
+
context.report({ node, messageId: "rendererExecutes", data: { name } });
|
|
199
263
|
if (SCHEMA_OPERATIONS.has(name)) {
|
|
200
264
|
if (isPackageType(context, callee.object, "DataSource", "typeorm"))
|
|
201
265
|
context.report({ node, messageId: "synchronizeCall", data: { name } });
|
|
@@ -214,11 +278,11 @@ export const noRuntimeSchema = {
|
|
|
214
278
|
}
|
|
215
279
|
},
|
|
216
280
|
Literal(node) {
|
|
217
|
-
if (!migration && typeof node.value === "string" && DDL.test(node.value))
|
|
281
|
+
if (!migration && !renderer && typeof node.value === "string" && DDL.test(node.value))
|
|
218
282
|
context.report({ node, messageId: "ddl" });
|
|
219
283
|
},
|
|
220
284
|
TemplateElement(node) {
|
|
221
|
-
if (!migration && DDL.test(node.value.cooked ?? ""))
|
|
285
|
+
if (!migration && !renderer && DDL.test(node.value.cooked ?? ""))
|
|
222
286
|
context.report({ node, messageId: "ddl" });
|
|
223
287
|
},
|
|
224
288
|
};
|
|
@@ -10,7 +10,7 @@ import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
|
10
10
|
import { isBuiltin } from "node:module";
|
|
11
11
|
import { dirname, join, resolve } from "node:path";
|
|
12
12
|
import ts from "typescript";
|
|
13
|
-
import { rootPackageNames } from "
|
|
13
|
+
import { rootPackageNames } from "@starci/hfs/runtime/scripts/hfs/architecture/root-packages.mjs";
|
|
14
14
|
import { hfsOf, inTestWorld } from "./lib/hfs.js";
|
|
15
15
|
import { moduleReferences } from "./lib/import-source.js";
|
|
16
16
|
import { isSpecFile } from "./lib/path.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starci/eslint-canon-be",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.19.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",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"node": ">=22.13.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
+
"@starci/hfs": "~5.13.0",
|
|
43
44
|
"eslint": ">=9",
|
|
44
45
|
"typescript": ">=5.9"
|
|
45
46
|
},
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
"eslint-plugin-unicorn": "65.0.0"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
70
|
+
"@starci/hfs": "file:../hfs",
|
|
69
71
|
"@starci/tsconfig": "file:../tsconfig",
|
|
70
72
|
"@types/node": "24.19.2",
|
|
71
73
|
"eslint": "^9.18.0",
|
package/runtime/bundle.json
CHANGED
|
@@ -1,201 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generated": [
|
|
3
|
-
"config.example.yaml",
|
|
4
|
-
"engine/by-code-unit.mjs",
|
|
5
|
-
"engine/model-config.mjs",
|
|
6
|
-
"engine/orca-config.mjs",
|
|
7
|
-
"engine/plain-object.mjs",
|
|
8
|
-
"engine/release-config.mjs",
|
|
9
|
-
"engine/removed-vocabulary.mjs",
|
|
10
|
-
"engine/resources-config.mjs",
|
|
11
|
-
"engine/runtime-root.mjs",
|
|
12
|
-
"engine/secrets.mjs",
|
|
13
|
-
"engine/sonar-config.mjs",
|
|
14
|
-
"engine/temp-root.mjs",
|
|
15
|
-
"engine/yaml.mjs",
|
|
16
|
-
"knowledge/grammars/index.yaml",
|
|
17
|
-
"knowledge/hfs/canon-pins.yaml",
|
|
18
|
-
"knowledge/hfs/fe-stack.yaml",
|
|
19
|
-
"knowledge/hfs/rules.yaml",
|
|
20
|
-
"knowledge/patterns/fe/folder.yaml",
|
|
21
|
-
"knowledge/sonar-gate.yaml",
|
|
22
|
-
"modules/kernel/removed-vocabulary.yaml",
|
|
23
|
-
"modules/models/registry.yaml",
|
|
24
|
-
"modules/models/runtimes.yaml",
|
|
25
|
-
"modules/models/tiers.yaml",
|
|
26
|
-
"scripts/api/git/cat-file.mjs",
|
|
27
|
-
"scripts/api/git/config-get.mjs",
|
|
28
|
-
"scripts/api/git/diff.mjs",
|
|
29
|
-
"scripts/api/git/lib.mjs",
|
|
30
|
-
"scripts/api/git/ls-files.mjs",
|
|
31
|
-
"scripts/api/git/ls-tree.mjs",
|
|
32
|
-
"scripts/api/git/merge-base.mjs",
|
|
33
|
-
"scripts/api/git/remote.mjs",
|
|
34
|
-
"scripts/api/git/rev-parse-query.mjs",
|
|
35
|
-
"scripts/api/git/show.mjs",
|
|
36
|
-
"scripts/api/git/tag.mjs",
|
|
37
|
-
"scripts/hfs/allows.mjs",
|
|
38
|
-
"scripts/hfs/architecture/ast-walks.mjs",
|
|
39
|
-
"scripts/hfs/architecture/automatic-gates.mjs",
|
|
40
|
-
"scripts/hfs/architecture/backend-app-files.mjs",
|
|
41
|
-
"scripts/hfs/architecture/backend.mjs",
|
|
42
|
-
"scripts/hfs/architecture/background-unowned.mjs",
|
|
43
|
-
"scripts/hfs/architecture/canon-clones.mjs",
|
|
44
|
-
"scripts/hfs/architecture/canon-jsx-clones.mjs",
|
|
45
|
-
"scripts/hfs/architecture/client-reaches-server.mjs",
|
|
46
|
-
"scripts/hfs/architecture/clones.mjs",
|
|
47
|
-
"scripts/hfs/architecture/component-tiers.mjs",
|
|
48
|
-
"scripts/hfs/architecture/config-unread.mjs",
|
|
49
|
-
"scripts/hfs/architecture/config.mjs",
|
|
50
|
-
"scripts/hfs/architecture/connection-map.mjs",
|
|
51
|
-
"scripts/hfs/architecture/constructor-deps.mjs",
|
|
52
|
-
"scripts/hfs/architecture/context-coupling.mjs",
|
|
53
|
-
"scripts/hfs/architecture/context-map.mjs",
|
|
54
|
-
"scripts/hfs/architecture/context-owner.mjs",
|
|
55
|
-
"scripts/hfs/architecture/context-platform-tables.mjs",
|
|
56
|
-
"scripts/hfs/architecture/context-transaction.mjs",
|
|
57
|
-
"scripts/hfs/architecture/contract-bounds.mjs",
|
|
58
|
-
"scripts/hfs/architecture/contract-fixture-guard.mjs",
|
|
59
|
-
"scripts/hfs/architecture/contracts-readonly.mjs",
|
|
60
|
-
"scripts/hfs/architecture/contracts.mjs",
|
|
61
|
-
"scripts/hfs/architecture/cross-app-duplicate.mjs",
|
|
62
|
-
"scripts/hfs/architecture/dead-exports-bindings.mjs",
|
|
63
|
-
"scripts/hfs/architecture/dead-exports.mjs",
|
|
64
|
-
"scripts/hfs/architecture/default-deny.mjs",
|
|
65
|
-
"scripts/hfs/architecture/doc-language.mjs",
|
|
66
|
-
"scripts/hfs/architecture/entity-registry.mjs",
|
|
67
|
-
"scripts/hfs/architecture/entrypoint.mjs",
|
|
68
|
-
"scripts/hfs/architecture/error-codes.mjs",
|
|
69
|
-
"scripts/hfs/architecture/error-masked.mjs",
|
|
70
|
-
"scripts/hfs/architecture/fe-slot-allows.mjs",
|
|
71
|
-
"scripts/hfs/architecture/feature-shape.mjs",
|
|
72
|
-
"scripts/hfs/architecture/framework-pinned.mjs",
|
|
73
|
-
"scripts/hfs/architecture/frontend-block-render.mjs",
|
|
74
|
-
"scripts/hfs/architecture/frontend-grammar.mjs",
|
|
75
|
-
"scripts/hfs/architecture/frontend-routing.mjs",
|
|
76
|
-
"scripts/hfs/architecture/frontend-world-render.mjs",
|
|
77
|
-
"scripts/hfs/architecture/frontend-world.mjs",
|
|
78
|
-
"scripts/hfs/architecture/frontend.mjs",
|
|
79
|
-
"scripts/hfs/architecture/function-spec-providers.mjs",
|
|
80
|
-
"scripts/hfs/architecture/hfs-graph.mjs",
|
|
81
|
-
"scripts/hfs/architecture/hooks-are-hooks.mjs",
|
|
82
|
-
"scripts/hfs/architecture/i18n-keys.mjs",
|
|
83
|
-
"scripts/hfs/architecture/identity.mjs",
|
|
84
|
-
"scripts/hfs/architecture/index.mjs",
|
|
85
|
-
"scripts/hfs/architecture/injection-token-exported.mjs",
|
|
86
|
-
"scripts/hfs/architecture/jwt-ast.mjs",
|
|
87
|
-
"scripts/hfs/architecture/machine-ast.mjs",
|
|
88
|
-
"scripts/hfs/architecture/managed-scripts.mjs",
|
|
89
|
-
"scripts/hfs/architecture/module-per-transport.mjs",
|
|
90
|
-
"scripts/hfs/architecture/next-data-contract.mjs",
|
|
91
|
-
"scripts/hfs/architecture/next-data-inference.mjs",
|
|
92
|
-
"scripts/hfs/architecture/next-data-key.mjs",
|
|
93
|
-
"scripts/hfs/architecture/next-data-symbols.mjs",
|
|
94
|
-
"scripts/hfs/architecture/next-data.mjs",
|
|
95
|
-
"scripts/hfs/architecture/operation-contract-roots.mjs",
|
|
96
|
-
"scripts/hfs/architecture/owners.mjs",
|
|
97
|
-
"scripts/hfs/architecture/package-shape.mjs",
|
|
98
|
-
"scripts/hfs/architecture/presentation.mjs",
|
|
99
|
-
"scripts/hfs/architecture/reachability.mjs",
|
|
100
|
-
"scripts/hfs/architecture/register-once.mjs",
|
|
101
|
-
"scripts/hfs/architecture/registration.mjs",
|
|
102
|
-
"scripts/hfs/architecture/render-graph.mjs",
|
|
103
|
-
"scripts/hfs/architecture/render-prop-across-server.mjs",
|
|
104
|
-
"scripts/hfs/architecture/required-files.mjs",
|
|
105
|
-
"scripts/hfs/architecture/root-packages.mjs",
|
|
106
|
-
"scripts/hfs/architecture/route-files-thin.mjs",
|
|
107
|
-
"scripts/hfs/architecture/schema-owner.mjs",
|
|
108
|
-
"scripts/hfs/architecture/server-action.mjs",
|
|
109
|
-
"scripts/hfs/architecture/side-boundary.mjs",
|
|
110
|
-
"scripts/hfs/architecture/source-names-shape.mjs",
|
|
111
|
-
"scripts/hfs/architecture/source-names.mjs",
|
|
112
|
-
"scripts/hfs/architecture/sql-keys.mjs",
|
|
113
|
-
"scripts/hfs/architecture/sql-owner.mjs",
|
|
114
|
-
"scripts/hfs/architecture/sql-returning.mjs",
|
|
115
|
-
"scripts/hfs/architecture/sql-token-forms.mjs",
|
|
116
|
-
"scripts/hfs/architecture/sql-tokens.mjs",
|
|
117
|
-
"scripts/hfs/architecture/staged-consumers.mjs",
|
|
118
|
-
"scripts/hfs/architecture/surface-nesting.mjs",
|
|
119
|
-
"scripts/hfs/architecture/surface.mjs",
|
|
120
|
-
"scripts/hfs/architecture/symbols.mjs",
|
|
121
|
-
"scripts/hfs/architecture/test-world-files.mjs",
|
|
122
|
-
"scripts/hfs/architecture/tiers.mjs",
|
|
123
|
-
"scripts/hfs/architecture/transport-owner.mjs",
|
|
124
|
-
"scripts/hfs/architecture/type-context.mjs",
|
|
125
|
-
"scripts/hfs/architecture/typescript.mjs",
|
|
126
|
-
"scripts/hfs/architecture/unit-spec-providers.mjs",
|
|
127
|
-
"scripts/hfs/declaration-shape.mjs",
|
|
128
|
-
"scripts/hfs/declaration-slots.mjs",
|
|
129
|
-
"scripts/hfs/edition-slots.mjs",
|
|
130
|
-
"scripts/hfs/explicit-surface-rule.mjs",
|
|
131
|
-
"scripts/hfs/linear-text.mjs",
|
|
132
|
-
"scripts/hfs/param-names.mjs",
|
|
133
|
-
"scripts/hfs/path-findings.mjs",
|
|
134
|
-
"scripts/hfs/repo-identity.mjs",
|
|
135
|
-
"scripts/hfs/rule-catalog.mjs",
|
|
136
|
-
"scripts/hfs/rule-params-shape.mjs",
|
|
137
|
-
"scripts/hfs/rules/database-migrations.mjs",
|
|
138
|
-
"scripts/hfs/rules/fe-no-tests.mjs",
|
|
139
|
-
"scripts/hfs/rules/read.mjs",
|
|
140
|
-
"scripts/hfs/rules/spec-placement.mjs",
|
|
141
|
-
"scripts/hfs/slot-app-view.mjs",
|
|
142
|
-
"scripts/hfs/slot-classify.mjs",
|
|
143
|
-
"scripts/hfs/slot-errors.mjs",
|
|
144
|
-
"scripts/hfs/slot-imports.mjs",
|
|
145
|
-
"scripts/hfs/slot-manifest-shape.mjs",
|
|
146
|
-
"scripts/hfs/slot-match.mjs",
|
|
147
|
-
"scripts/hfs/slot-path.mjs",
|
|
148
|
-
"scripts/hfs/slot-required.mjs",
|
|
149
|
-
"scripts/hfs/slot-semantic-problems.mjs",
|
|
150
|
-
"scripts/hfs/slot-side-problems.mjs",
|
|
151
|
-
"scripts/hfs/slots.mjs",
|
|
152
|
-
"scripts/hfs/test-world-slot.mjs",
|
|
153
|
-
"scripts/hfs/trailing-slashes.mjs",
|
|
154
|
-
"scripts/hfs/typescript-programs.mjs",
|
|
155
|
-
"scripts/hfs/view.mjs",
|
|
156
|
-
"scripts/lib/declaration-surface.mjs",
|
|
157
|
-
"scripts/lib/dockerfile.mjs",
|
|
158
|
-
"scripts/lib/env.mjs",
|
|
159
|
-
"scripts/lib/event-contract.mjs",
|
|
160
|
-
"scripts/lib/git.mjs",
|
|
161
|
-
"scripts/lib/glob.mjs",
|
|
162
|
-
"scripts/lib/grammar-lint.mjs",
|
|
163
|
-
"scripts/lib/i18n.mjs",
|
|
164
|
-
"scripts/lib/in-order.mjs",
|
|
165
|
-
"scripts/lib/json-clone.mjs",
|
|
166
|
-
"scripts/lib/json.mjs",
|
|
167
|
-
"scripts/lib/language.mjs",
|
|
168
|
-
"scripts/lib/list.mjs",
|
|
169
|
-
"scripts/lib/mutation-fence.mjs",
|
|
170
|
-
"scripts/lib/path-key.mjs",
|
|
171
|
-
"scripts/lib/read-text.mjs",
|
|
172
|
-
"scripts/lib/regex.mjs",
|
|
173
|
-
"scripts/lib/rule-packs.mjs",
|
|
174
|
-
"scripts/lib/same-text.mjs",
|
|
175
|
-
"scripts/lib/sops-envelope.mjs",
|
|
176
|
-
"scripts/lib/stack-services.mjs",
|
|
177
|
-
"scripts/lib/ts-analysis.mjs",
|
|
178
|
-
"scripts/lib/ts-ast.mjs",
|
|
179
|
-
"scripts/lib/walk.mjs",
|
|
180
|
-
"scripts/lib/yaml-cached.mjs"
|
|
181
|
-
],
|
|
2
|
+
"generated": [],
|
|
182
3
|
"own": [
|
|
183
|
-
"engine/config.mjs",
|
|
184
|
-
"engine/invalid-config.mjs",
|
|
185
|
-
"knowledge/hfs/slots.yaml",
|
|
186
4
|
"packages/hfs/templates/app/package-scripts/package.json",
|
|
187
5
|
"scripts/api/git/recorded-lines.mjs",
|
|
188
|
-
"scripts/hfs/architecture/hfs.mjs",
|
|
189
|
-
"scripts/hfs/manifest-shape.mjs",
|
|
190
6
|
"scripts/hfs/project-graph.mjs",
|
|
191
7
|
"scripts/hfs/project-rule.mjs",
|
|
192
|
-
"scripts/hfs/rules/database-constants.mjs",
|
|
193
|
-
"scripts/hfs/rules/secrets.mjs",
|
|
194
|
-
"scripts/lib/git-hooks-dir.mjs",
|
|
195
8
|
"scripts/lib/jsdoc.mjs",
|
|
196
9
|
"scripts/lib/line-count.mjs",
|
|
197
|
-
"scripts/lib/package-at.mjs",
|
|
198
|
-
"scripts/lib/secret-patterns.mjs",
|
|
199
10
|
"scripts/lib/sonar-syntax-rules.mjs",
|
|
200
11
|
"scripts/lib/sonar-way.mjs"
|
|
201
12
|
]
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// size-growth rule compares the working file with.
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { existsSync } from 'node:fs';
|
|
5
|
-
import { runGit } from '
|
|
6
|
-
import { mergeBase } from '
|
|
7
|
-
import { withoutGitLocalEnv } from '
|
|
5
|
+
import { runGit } from '@starci/hfs/runtime/scripts/api/git/lib.mjs';
|
|
6
|
+
import { mergeBase } from '@starci/hfs/runtime/scripts/api/git/merge-base.mjs';
|
|
7
|
+
import { withoutGitLocalEnv } from '@starci/hfs/runtime/scripts/lib/git.mjs';
|
|
8
8
|
import { lineCount } from '../../lib/line-count.mjs';
|
|
9
|
-
import { readEnv } from '
|
|
10
|
-
import { folded } from '
|
|
9
|
+
import { readEnv } from '@starci/hfs/runtime/scripts/lib/env.mjs';
|
|
10
|
+
import { folded } from '@starci/hfs/runtime/scripts/lib/event-contract.mjs';
|
|
11
11
|
|
|
12
12
|
const ok = (result) => !result.error && result.status === 0;
|
|
13
13
|
const pathKey = (value) => process.platform === 'win32' ? value.toLowerCase() : value;
|