@starci/hfs 5.0.7 → 5.1.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.
Files changed (204) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +7 -8
  3. package/cache/fake-session.mjs +1 -1
  4. package/cache/hfs-family.mjs +22 -9
  5. package/cache/import-graph.d.mts +32 -4
  6. package/cache/import-graph.mjs +88 -11
  7. package/cache/lint-family.d.mts +10 -3
  8. package/cache/lint-family.mjs +65 -37
  9. package/cache/records.d.mts +7 -0
  10. package/cache/records.mjs +17 -1
  11. package/cache/run.d.mts +1 -1
  12. package/cache/session.mjs +6 -2
  13. package/cache/side-key.d.mts +2 -0
  14. package/cache/side-key.mjs +5 -1
  15. package/cache/structure-memo.d.mts +34 -0
  16. package/cache/structure-memo.mjs +150 -0
  17. package/cache/types.d.mts +6 -2
  18. package/cache/wiring-family.mjs +1 -1
  19. package/codemod/directive-first.d.mts +48 -0
  20. package/codemod/directive-first.mjs +136 -0
  21. package/codemod/explicit-surface-edit.d.mts +14 -0
  22. package/codemod/explicit-surface-edit.mjs +57 -0
  23. package/codemod/explicit-surface-names.d.mts +30 -0
  24. package/codemod/explicit-surface-names.mjs +135 -0
  25. package/codemod/explicit-surface-render.d.mts +29 -0
  26. package/codemod/explicit-surface-render.mjs +197 -0
  27. package/codemod/explicit-surface.d.mts +50 -0
  28. package/codemod/explicit-surface.mjs +374 -0
  29. package/codemod/main.d.mts +7 -5
  30. package/codemod/main.mjs +37 -16
  31. package/codemod/small-renames.mjs +22 -2
  32. package/codemod/source-tree.d.mts +8 -0
  33. package/codemod/source-tree.mjs +23 -0
  34. package/lint/eslint-list.cjs +55 -0
  35. package/lint/run.d.mts +35 -61
  36. package/lint/run.mjs +91 -288
  37. package/package.json +1 -1
  38. package/release/lint-report.d.mts +1 -1
  39. package/release/lint-report.mjs +3 -3
  40. package/report/sonar.d.mts +1 -1
  41. package/report/sonar.mjs +3 -3
  42. package/report/stylelint-findings.d.mts +23 -0
  43. package/report/stylelint-findings.mjs +9 -0
  44. package/runtime/knowledge/hfs/canon-pins.yaml +8 -8
  45. package/runtime/knowledge/hfs/ci-standard.yaml +2 -2
  46. package/runtime/knowledge/hfs/rules.yaml +56 -5
  47. package/runtime/knowledge/hfs/slots.yaml +1 -1
  48. package/runtime/knowledge/sonar-gate.yaml +2 -2
  49. package/runtime/modules/kernel/failure-codes.yaml +4 -4
  50. package/runtime/scripts/api/node/run-node.d.mts +5 -0
  51. package/runtime/scripts/hfs/architecture/test-world-files.d.mts +4 -3
  52. package/runtime/scripts/hfs/architecture/test-world-files.mjs +26 -7
  53. package/runtime/scripts/hfs/check.d.mts +16 -1
  54. package/runtime/scripts/hfs/check.mjs +18 -7
  55. package/runtime/scripts/hfs/explicit-surface-rule.d.mts +58 -0
  56. package/runtime/scripts/hfs/explicit-surface-rule.mjs +59 -0
  57. package/runtime/scripts/hfs/gate-threshold.mjs +1 -1
  58. package/runtime/scripts/hfs/rule-memo.d.mts +30 -0
  59. package/runtime/scripts/hfs/rule-memo.mjs +24 -0
  60. package/runtime/scripts/hfs/rules/a15-findings.d.mts +6 -0
  61. package/runtime/scripts/hfs/rules/a15-findings.mjs +11 -2
  62. package/runtime/scripts/hfs/rules/ci-standard.mjs +2 -2
  63. package/runtime/scripts/hfs/rules/monorepo.d.mts +1 -3
  64. package/runtime/scripts/hfs/rules/monorepo.mjs +9 -11
  65. package/runtime/scripts/hfs/rules/pipeline.mjs +13 -9
  66. package/runtime/scripts/hfs/rules/read.d.mts +5 -0
  67. package/runtime/scripts/hfs/rules/read.mjs +13 -0
  68. package/runtime/scripts/hfs/rules/secrets.d.mts +2 -0
  69. package/runtime/scripts/hfs/rules/secrets.mjs +4 -1
  70. package/runtime/scripts/hfs/rules/stacks-release.mjs +35 -21
  71. package/runtime/scripts/lib/declaration-surface.d.mts +35 -0
  72. package/runtime/scripts/lib/declaration-surface.mjs +112 -0
  73. package/runtime/scripts/lib/worktree-exclude.mjs +1 -1
  74. package/scaffold/app.mjs +3 -3
  75. package/src/check-cache-structure-support.d.mts +52 -0
  76. package/src/main.d.mts +3 -2
  77. package/src/main.mjs +123 -109
  78. package/sync/ci-commands.d.mts +2 -1
  79. package/sync/ci-commands.mjs +19 -20
  80. package/sync/index.mjs +2 -2
  81. package/templates/app/package-scripts/core.json +2 -2
  82. package/templates/app/task-graph/turbo.json +0 -3
  83. package/templates/be/inbox/delivery-recorded.event.ts.tpl +2 -2
  84. package/templates/be/inbox/entities.index.ts.tpl +1 -1
  85. package/templates/be/inbox/module-definition.ts.tpl +8 -2
  86. package/templates/be/inbox/platform/event-bus/event-bus.module-definition.ts.tpl +10 -2
  87. package/templates/be/inbox/platform/inbox/inbox.module-definition.ts.tpl +8 -2
  88. package/templates/be/patterns/api/feature.module-definition.ts.tpl +9 -3
  89. package/templates/be/patterns/api/graphql.module-definition.ts.tpl +9 -3
  90. package/templates/be/patterns/cli/group.module-definition.ts.tpl +9 -3
  91. package/templates/be/patterns/event-bus/platform/event-bus.module-definition.ts.tpl +8 -3
  92. package/templates/be/patterns/event-bus/platform/persistence/connection.ts.tpl +3 -2
  93. package/templates/be/patterns/event-bus/platform/persistence/event-bus.sql.ts.tpl +4 -3
  94. package/templates/be/patterns/idempotency/platform/inbox/inbox.module-definition.ts.tpl +8 -3
  95. package/templates/be/patterns/idempotency/platform/inbox/persistence/connection.ts.tpl +3 -2
  96. package/templates/be/patterns/idempotency/platform/inbox/persistence/inbox.sql.ts.tpl +7 -6
  97. package/templates/be/patterns/jobs/job.module-definition.ts.tpl +9 -3
  98. package/templates/be/patterns/jobs/job.processor.ts.tpl +1 -1
  99. package/templates/be/patterns/jobs/job.queue.module-definition.ts.tpl +9 -3
  100. package/templates/be/patterns/jobs/platform/jobs.module-definition.ts.tpl +8 -3
  101. package/templates/be/patterns/jobs/platform/persistence.connection.ts.tpl +3 -2
  102. package/templates/be/patterns/jobs/platform/persistence.jobs.sql.ts.tpl +5 -4
  103. package/templates/be/patterns/projections/persistence.connection.ts.tpl +3 -2
  104. package/templates/be/patterns/projections/projection.module-definition.ts.tpl +8 -3
  105. package/templates/be/patterns/queues/platform/persistence.connection.ts.tpl +3 -2
  106. package/templates/be/patterns/queues/platform/persistence.queue.sql.ts.tpl +4 -3
  107. package/templates/be/patterns/queues/platform/queue.module-definition.ts.tpl +8 -3
  108. package/templates/be/patterns/queues/queue.module-definition.ts.tpl +9 -3
  109. package/templates/be/patterns/reactors/consumer.ts.tpl +1 -1
  110. package/templates/be/patterns/reactors/message.module-definition.ts.tpl +9 -3
  111. package/templates/be/patterns/reactors/reactor.module-definition.ts.tpl +9 -3
  112. package/templates/be/patterns/realtime/channel.graphql.module-definition.ts.tpl +9 -3
  113. package/templates/be/patterns/realtime/channel.sse.module-definition.ts.tpl +9 -3
  114. package/templates/be/patterns/realtime/channel.websocket.module-definition.ts.tpl +9 -3
  115. package/templates/be/patterns/saga/saga.done.consumer.ts.tpl +1 -1
  116. package/templates/be/patterns/saga/saga.failed.consumer.ts.tpl +1 -1
  117. package/templates/be/patterns/saga/saga.message.module-definition.ts.tpl +9 -3
  118. package/templates/be/patterns/saga/saga.module-definition.ts.tpl +9 -3
  119. package/templates/be/patterns/webhooks/webhook.http.module-definition.ts.tpl +9 -3
  120. package/templates/be/platform/graphql/graphql.module-definition.ts +8 -3
  121. package/templates/be/skeleton/src/features/api/system-health/system-health.module-definition.ts +9 -3
  122. package/templates/be/skeleton/src/features/api/system-health/transport/http/system-health-http.module-definition.ts +9 -3
  123. package/templates/be/skeleton/src/features/cli/cli.module-definition.ts +9 -3
  124. package/templates/be/skeleton/src/features/cli/migrate/migrate.module-definition.ts +9 -3
  125. package/templates/be/skeleton/src/features/cli/seed/seed.module-definition.ts +9 -3
  126. package/templates/be/skeleton/src/modules/domain/identity/identity.module-definition.ts +8 -3
  127. package/templates/be/skeleton/src/modules/domain/liveness/liveness.module-definition.ts +8 -3
  128. package/templates/be/skeleton/src/modules/domain/note/note.module-definition.ts +8 -3
  129. package/templates/be/skeleton/src/modules/domain/note/persistence/connection.ts +3 -2
  130. package/templates/be/skeleton/src/modules/domain/note/persistence/note.sql.ts +2 -1
  131. package/templates/be/skeleton/src/modules/platform/clock/clock.module-definition.ts +8 -3
  132. package/templates/be/skeleton/src/modules/platform/cqrs/cqrs.module-definition.ts +8 -3
  133. package/templates/be/skeleton/src/modules/platform/database/database.module-definition.ts +8 -3
  134. package/templates/be/skeleton/src/modules/platform/database/index.ts +1 -0
  135. package/templates/be/skeleton/src/modules/platform/errors/errors.module-definition.ts +10 -4
  136. package/templates/be/skeleton/src/modules/platform/http/http.module-definition.ts +8 -4
  137. package/templates/be/skeleton/src/modules/platform/http-security/http-security.module-definition.ts +10 -4
  138. package/templates/be/skeleton/src/modules/platform/http-security/persistence/connection.ts +3 -2
  139. package/templates/be/skeleton/src/modules/platform/http-security/persistence/rate-limit.sql.ts +3 -2
  140. package/templates/be/skeleton/src/modules/platform/i18n/i18n.module-definition.ts +10 -4
  141. package/templates/be/skeleton/src/modules/platform/ids/ids.module-definition.ts +8 -3
  142. package/templates/be/skeleton/src/modules/platform/logging/logging.module-definition.ts +8 -3
  143. package/templates/be/skeleton/src/modules/platform/retry/retry.module-definition.ts +8 -3
  144. package/templates/be/skeleton-lite/src/modules/domain/identity/identity.decorators.ts +1 -1
  145. package/templates/be/skeleton-lite/src/modules/integrations/passport/strategies/google.strategy.ts +5 -1
  146. package/templates/be/skeleton-lite/src/modules/integrations/passport/strategies/local.strategy.ts +5 -1
  147. package/templates/be/skeleton-lite/src/modules/platform/database/database.port.ts +1 -1
  148. package/templates/be/skeleton-lite/src/modules/platform/http-security/persistence/entities/index.ts +1 -1
  149. package/templates/be/skeleton-lite/src/tests/fixtures/builders/api.builder.ts +7 -1
  150. package/templates/be/skeleton-lite/src/tests/fixtures/builders/cli.builder.ts +7 -1
  151. package/templates/be/table/api/feature.module-definition.ts.tpl +9 -3
  152. package/templates/be/table/api/graphql.module-definition.ts.tpl +9 -3
  153. package/templates/be/table/entities.index.ts.tpl +1 -1
  154. package/templates/be/table/module-definition.ts.tpl +8 -3
  155. package/templates/be/test-world/fixtures/migrations.sql.ts.tpl +1 -0
  156. package/templates/be/test-world/world/test-world.config.ts.tpl +8 -1
  157. package/templates/fe/common/app-layout.tsx.partial +1 -1
  158. package/templates/fe/skeleton/apps/__app__/src/hooks/auth/useSession.ts +2 -1
  159. package/templates/fe/skeleton/apps/__app__/src/hooks/auth/useSignIn.ts +11 -3
  160. package/templates/fe/skeleton/apps/__app__/src/hooks/auth/useSignOut.ts +8 -2
  161. package/templates/fe/skeleton/apps/__app__/src/hooks/zustand/appGuide/store.ts +2 -1
  162. package/templates/fe/skeleton/apps/__app__/src/modules/toast/hooks.ts +1 -1
  163. package/templates/fe/skeleton/apps/__app__/src/modules/toast/toast.tsx +4 -1
  164. package/templates/fe/skeleton/apps/__app__/src/redux/hooks.ts +3 -2
  165. package/templates/fe/skeleton/apps/__app__/src/redux/index.ts +1 -0
  166. package/templates/fe/skeleton/apps/__app__/src/redux/slices/session.ts +12 -4
  167. package/templates/fe/skeleton/apps/__app__/src/redux/store.ts +8 -3
  168. package/templates/fe/skeleton/apps/app/src/app/[locale]/layout.tsx +4 -3
  169. package/templates/fe/skeleton/apps/app/src/features/layouts/AppLayout/index.tsx +1 -1
  170. package/templates/fe/skeleton/apps/app/src/features/pages/AppHomePage/index.tsx +2 -1
  171. package/templates/fe/skeleton/apps/app/src/features/pages/AppLoadingPage/index.tsx +2 -1
  172. package/templates/fe/skeleton/apps/app/src/features/pages/AppNotFoundPage/index.tsx +2 -1
  173. package/templates/fe/skeleton/apps/app/src/modules/i18n/index.ts +2 -1
  174. package/templates/fe/skeleton/apps/app/src/modules/i18n/request.ts +4 -1
  175. package/templates/fe/skeleton/apps/landing/src/app/[locale]/layout.tsx +4 -3
  176. package/templates/fe/skeleton/apps/landing/src/features/layouts/LandingLayout/index.tsx +2 -2
  177. package/templates/fe/skeleton/apps/landing/src/features/pages/LandingLoadingPage/index.tsx +2 -1
  178. package/templates/fe/skeleton/apps/landing/src/features/pages/LandingNotFoundPage/index.tsx +2 -1
  179. package/templates/fe/skeleton/apps/landing/src/features/pages/LandingPage/index.tsx +2 -1
  180. package/templates/fe/skeleton/apps/landing/src/modules/i18n/index.ts +2 -1
  181. package/templates/fe/skeleton/apps/landing/src/modules/i18n/request.ts +4 -1
  182. package/templates/fe/skeleton/packages/__project__-i18n/src/index.ts +19 -1
  183. package/templates/fe/skeleton/packages/__project__-i18n/src/proxy.ts +1 -1
  184. package/templates/fe/skeleton/packages/__project__-i18n/src/routing.ts +5 -1
  185. package/templates/fe/skeleton-lite/apps/web/src/app/[locale]/layout.tsx +4 -3
  186. package/templates/fe/skeleton-lite/apps/web/src/features/layouts/AppLayout/index.tsx +2 -2
  187. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppHomePage/index.tsx +2 -1
  188. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppLoadingPage/index.tsx +2 -1
  189. package/templates/fe/skeleton-lite/apps/web/src/features/pages/AppNotFoundPage/index.tsx +2 -1
  190. package/templates/fe/skeleton-lite/apps/web/src/modules/i18n/request.ts +3 -1
  191. package/templates/fe/skeleton-lite/apps/web/src/modules/i18n/routing.ts +5 -1
  192. package/templates/fe/table/graphql/useMutateSwr.ts.tpl +2 -1
  193. package/templates/fe/table/graphql/useQuerySwr.ts.tpl +2 -1
  194. package/templates/fe/transport/graphql/clients/clients/auth.ts +1 -1
  195. package/templates/fe/transport/graphql/clients/clients/no-auth.ts +1 -1
  196. package/templates/fe/transport/graphql/clients/links/attach-access-token.ts +1 -1
  197. package/templates/fe/transport/graphql/clients/links/error.ts +1 -1
  198. package/templates/fe/transport/graphql/clients/links/http.ts +1 -1
  199. package/templates/fe/transport/graphql/clients/links/locale.ts +1 -1
  200. package/templates/fe/transport/graphql/clients/links/refresh-token.ts +1 -1
  201. package/templates/fe/transport/graphql/clients/links/retry.ts +1 -1
  202. package/templates/fe/transport/graphql/clients/links/timeout.ts +1 -1
  203. package/templates/fe/units/page/index.tsx.tpl +3 -2
  204. package/templates/fe/units/slot/SlotView.tsx.tpl +1 -1
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
3
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
4
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
5
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
6
+ });
7
+ }
8
+ return path;
9
+ };
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ // eslint-list.cts - ESLint over a list of files in ONE process, through the app's own install (the Node API of the ESLint the side's folder resolves).
12
+ //
13
+ // The CLI of ESLint takes its files as arguments, and a diff of hundreds of long paths outgrows the Windows command line (32,767 characters), which
14
+ // used to cut the list into chunks that each built the whole TypeScript program again. This runner reads the list from a JSON file named by its one
15
+ // argument ({ files, fix }), lints it once from its working directory (the side folder) and prints the results as the `--format json` of the CLI
16
+ // does (the list of result objects), so the launcher validates them the same way. Its exit code is the CLI's: 0 clean of errors, 1 at least one
17
+ // error, 2 the run could not complete (the message is on stderr). It stays CommonJS like bound-sys.cts, which may be preloaded in front of it.
18
+ //
19
+ // The project graph the canon's graph rules read is built in this process, once per side. When the job names the canons (`graph.canons`, the entry file
20
+ // of each installed canon) and a file (`graph.out`), the runner asks each canon for the snapshot of the graph it built (`projectGraphSnapshot`) after
21
+ // the lint and writes `{ snapshots }` there, so the cache keeps the graph findings without building the graph a second time in the CLI. A canon that
22
+ // cannot answer leaves its snapshot out; the report and the exit code are never affected.
23
+ const fs = require('node:fs');
24
+ const path = require('node:path');
25
+ const { createRequire } = require('node:module');
26
+ const { pathToFileURL } = require('node:url');
27
+ /** Writes the snapshot of the graph each named canon built in this process; a canon that cannot answer is left out. */
28
+ async function handOutGraph(handoff, repoRoot) {
29
+ const snapshots = {};
30
+ for (const { name, entry } of handoff.canons) {
31
+ try {
32
+ const canon = await import(__rewriteRelativeImportExtension(pathToFileURL(entry).href));
33
+ if (typeof canon.projectGraphSnapshot === 'function')
34
+ snapshots[name] = canon.projectGraphSnapshot({ repoRoot });
35
+ }
36
+ catch { /* the cache builds this canon's graph itself */ }
37
+ }
38
+ fs.writeFileSync(handoff.out, JSON.stringify({ snapshots }));
39
+ }
40
+ async function main() {
41
+ const job = JSON.parse(fs.readFileSync(String(process.argv[2]), 'utf8'));
42
+ const cwd = process.cwd();
43
+ const { ESLint } = createRequire(path.join(cwd, 'package.json'))('eslint');
44
+ const results = await new ESLint({ cwd, fix: job.fix }).lintFiles(job.files);
45
+ if (job.fix)
46
+ await ESLint.outputFixes(results);
47
+ if (job.graph !== undefined)
48
+ await handOutGraph(job.graph, cwd);
49
+ process.stdout.write(JSON.stringify(results));
50
+ return results.some((result) => result.errorCount > 0 || result.fatalErrorCount > 0) ? 1 : 0;
51
+ }
52
+ main().then((code) => { process.exitCode = code; }, (error) => {
53
+ process.stderr.write(`${String(error?.stack ?? error)}\n`);
54
+ process.exitCode = 2;
55
+ });
package/lint/run.d.mts CHANGED
@@ -1,34 +1,40 @@
1
1
  import { type HeavyNodeRun } from '../runtime/scripts/api/node/run-node.mjs';
2
- import { type CanonDeclarations, type LintSideStats } from '../cache/lint-family.mjs';
2
+ import { type CanonDeclarations, type GraphSnapshot, type LintSideStats } from '../cache/lint-family.mjs';
3
3
  import type { CheckSession } from '../cache/types.mjs';
4
4
  type Dynamic = any;
5
- /** The parsed arguments of the lint verb. */
6
- export interface LintOptions {
7
- changed: string[] | null;
8
- fix: boolean;
9
- format: string;
10
- out: string | undefined;
11
- workspace: string | undefined;
12
- side?: string;
13
- full?: boolean;
14
- }
15
- /** The cache a lint run may use: the session of the check cache. The caller flushes it after the run. */
16
- export interface LintCache {
17
- session: CheckSession;
18
- }
19
- /** What a linter run answers: its json results, or why it could not complete (both when the run was partial). */
5
+ /**
6
+ * The project-graph findings of one canon, as its `projectGraphSnapshot` answers them: by side-relative posix path.
7
+ * The ESLint child builds this graph for the canon's graph rules, so it hands the snapshot out instead of the cache building the same graph again.
8
+ */
9
+ export type GraphSnapshotParts = Readonly<Record<string, GraphSnapshot>>;
10
+ /** What a linter run answers: its json results, or why it could not complete (both when the run was partial), and the graph snapshots its child handed out, by canon name. */
20
11
  export interface LinterRun {
21
12
  results?: Dynamic[];
22
13
  error?: string;
14
+ graph?: GraphSnapshotParts;
23
15
  }
24
- /** The seam that runs a linter through the app's own install from cwd. */
25
- export type LinterRunner = (spec: {
16
+ /**
17
+ * What a linter run is asked for. `list` is the files an ESLint run lints (cwd-relative, posix) when they are named one by one: they go to the child
18
+ * through a file, never the command line, and `args` then holds the options alone. `files` is the number of source files the run judges, which the
19
+ * heavy-command budget of the ESLint kind scales with (a list names its own count).
20
+ */
21
+ export interface LinterSpec {
26
22
  cwd: string;
27
23
  pkg: string;
28
24
  bin: string;
29
25
  args: string[];
30
26
  bound?: string | null;
31
- }) => Promise<LinterRun>;
27
+ list?: readonly string[] | undefined;
28
+ files?: number | undefined;
29
+ graph?: readonly GraphCanon[] | undefined;
30
+ }
31
+ /** An installed canon whose graph snapshot the ESLint child hands out: its package name and the entry file the child imports. */
32
+ export interface GraphCanon {
33
+ name: string;
34
+ entry: string;
35
+ }
36
+ /** The seam that runs a linter through the app's own install from cwd. */
37
+ export type LinterRunner = (spec: LinterSpec) => Promise<LinterRun>;
32
38
  /** One finding of the lint report. */
33
39
  export interface LintFinding {
34
40
  engine: string;
@@ -39,17 +45,9 @@ export interface LintFinding {
39
45
  line: number | null;
40
46
  column: number | null;
41
47
  message: string;
42
- titleVi?: string;
43
- nextStepVi?: string;
44
48
  }
45
49
  /** The app declaration the slot machine returns (readRepoDeclaration): sides are present at an app root. */
46
50
  type RepoDeclaration = Dynamic;
47
- export declare const LINT_SCHEMA = "starci/lint@1";
48
- /** The app-relative workspace of `opts.workspace` (already app-relative), or a refusal when it is not one folder of fe/apps or fe/packages. */
49
- export declare function workspaceOf(workspace: string): string;
50
- /** The flags of `starci app lint`; `--changed` takes every argument up to the next flag, and a repeated `--changed` adds to the list (the
51
- * catalog's list flag, `--changed a --changed b`, as the CLI dispatcher passes it through). */
52
- export declare function parseLintArgs(argv: readonly string[]): LintOptions;
53
51
  /**
54
52
  * The heap of the ESLint child in MiB: the starci CLI sets it from its one owner, the eslint memory of ops/liveness.yaml `heavy` (a typed whole-side
55
53
  * lint of a large app outgrows node's default heap). Unset, ESLint runs on node's default.
@@ -57,13 +55,7 @@ export declare function parseLintArgs(argv: readonly string[]): LintOptions;
57
55
  export declare const ESLINT_HEAP_ENV = "STARCI_ESLINT_HEAP_MB";
58
56
  export declare function eslintHeapArgs(env?: NodeJS.ProcessEnv): string[];
59
57
  /** A linter's json results through the app's own install, run from `cwd` (a side folder): `{ results }` or `{ error }`. The child runs while the caller goes on. */
60
- export declare function runLinter({ cwd, pkg, bin, args, bound }: {
61
- cwd: string;
62
- pkg: string;
63
- bin: string;
64
- args: string[];
65
- bound?: string | null;
66
- }, execute?: HeavyNodeRun): Promise<LinterRun>;
58
+ export declare function runLinter({ cwd, pkg, bin, args, bound, list, files, graph }: LinterSpec, execute?: HeavyNodeRun): Promise<LinterRun>;
67
59
  /**
68
60
  * The lint scope a flat config declares: `ignored(file)` for its global ignores (a block holding only `ignores` and `name`), which prune
69
61
  * the walk, and `source(file)` for a file some block's `files` select while that block's own `ignores` do not (standard flat-config
@@ -85,8 +77,8 @@ export declare function installedLintConfig({ repoRoot, cwd, side }: {
85
77
  cwd: string;
86
78
  side: string;
87
79
  }): Promise<Dynamic[]>;
88
- /** Execute each side's installed ESLint config once; check and lint share scope, coverage and tool-failure judgment. */
89
- export declare function eslintRepository({ repoRoot, app, opts, changed, existing, workspace, onFe, run }: {
80
+ /** Execute each side's installed ESLint config once, whole or over a named list; the cached and the cacheless run share scope, coverage and tool-failure judgment. */
81
+ export declare function eslintRepository({ repoRoot, app, opts, changed, existing, run, scopes, handOutGraph }: {
90
82
  repoRoot: string;
91
83
  app?: RepoDeclaration;
92
84
  opts?: {
@@ -95,9 +87,9 @@ export declare function eslintRepository({ repoRoot, app, opts, changed, existin
95
87
  };
96
88
  changed?: readonly string[] | null;
97
89
  existing?: readonly string[];
98
- workspace?: string | null;
99
- onFe?: string | null;
100
90
  run?: LinterRunner | undefined;
91
+ scopes?: Readonly<Record<string, readonly string[]>> | undefined;
92
+ handOutGraph?: boolean | undefined;
101
93
  }): Promise<{
102
94
  findings: LintFinding[];
103
95
  errors: string[];
@@ -108,6 +100,7 @@ export declare function eslintRepository({ repoRoot, app, opts, changed, existin
108
100
  skipped?: string;
109
101
  }>;
110
102
  };
103
+ graphs: Record<string, GraphSnapshotParts>;
111
104
  }>;
112
105
  /** What the cache reads of the canons a side lints with: the ESLint canon (which publishes the project-graph rules) and the grammar family of the fe side. */
113
106
  export declare function canonDeclarations({ repoRoot, cwd, side }: {
@@ -122,7 +115,7 @@ export declare function canonDeclarations({ repoRoot, cwd, side }: {
122
115
  export declare function gitBaseToken(repoRoot: string): string;
123
116
  /** What the cached linters answer: the ESLint answer in the shape of eslintRepository's, the stylelint results, and each side's counts. */
124
117
  export interface CachedLinters {
125
- eslint: Awaited<ReturnType<typeof eslintRepository>>;
118
+ eslint: Omit<Awaited<ReturnType<typeof eslintRepository>>, 'graphs'>;
126
119
  stylelint: {
127
120
  results: Dynamic[];
128
121
  errors: string[];
@@ -138,30 +131,11 @@ export interface CachedLinters {
138
131
  * validation of a full run (eslintRepository), the rest take their records. The answer has the shape of eslintRepository's, plus the stylelint
139
132
  * results, so the lint report is built the same way from either.
140
133
  */
141
- export declare function cachedLinters({ repoRoot, app, opts, workspace, onFe, run, cache }: {
134
+ export declare function cachedLinters({ repoRoot, app, side: only, run, session }: {
142
135
  repoRoot: string;
143
136
  app: RepoDeclaration;
144
- opts: LintOptions;
145
- workspace: string | null;
146
- onFe: string | null;
137
+ side?: string | undefined;
147
138
  run?: LinterRunner | undefined;
148
- cache: LintCache;
139
+ session: CheckSession;
149
140
  }): Promise<CachedLinters>;
150
- /**
151
- * Run the whole lint of the app at `repoRoot`. `hfsCheck(repoRoot)` returns the `starci app check` result (`{ findings, tracked }`); the CLI
152
- * injects it. Returns `{ report, sonar, exit }`; `sonar` is the merged Generic Issue Import document.
153
- */
154
- export declare function lintRepository({ repoRoot, opts, hfsCheck, trackedFiles, runLinter: linter, cache }: {
155
- repoRoot: string;
156
- opts: LintOptions;
157
- hfsCheck: (repoRoot: string) => Dynamic;
158
- trackedFiles?: (repoRoot: string) => string[];
159
- runLinter?: LinterRunner | undefined;
160
- cache?: LintCache | undefined;
161
- }): Promise<{
162
- report: Dynamic;
163
- sonar: Dynamic;
164
- exit: number;
165
- }>;
166
- export declare function printLintText(report: Dynamic, out: (text: string) => unknown): void;
167
141
  export {};