limina 0.0.6 → 0.1.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/index.d.ts CHANGED
@@ -1,169 +1,686 @@
1
- import { BuiltinCheckerPreset, BuiltinTaskName, CheckerConfig, CheckerExecutionKind, CheckerPreset, GraphConditionDomain, GraphConfig, GraphRule, GraphRuleAllowConfig, GraphRuleDenyConfig, GraphRuleDepDenyEntry, GraphRuleRefAllowEntry, GraphRuleRefDenyEntry, LiminaCommand, LiminaConfig, LiminaConfigEnv, LiminaConfigExport, LiminaConfigFn, LiminaConfigFnObject, LiminaConfigFnPromise, LoadConfigOptions, PackageAttwCheckConfig, PackageAttwIgnoreRule, PackageAttwLevel, PackageAttwProfile, PackageBoundaryCheckConfig, PackageCheckTool, PackageCheckToolSelection, PackageConfig, PackageEntry, PackagePublintCheckConfig, PackagePublintLevel, PipelineStep, ProofAllowlistEntry, ProofConfig, ResolvedCheckerConfig, ResolvedLiminaConfig, RuntimeEnvironment, SharedLiminaConfig, SourceBoundaryConfig, SourceCheckConfig, SourceKnipCheckConfig, SourceKnipEntryConfig, SourceKnipIgnoredDependencyConfig, SourceKnipIgnoredFileConfig, SourceKnipWorkspaceConfig, defineConfig, getActiveCheckerExtensions, getActiveCheckers, loadConfig, validateLiminaConfig } from "./config.js";
2
- //#region src/flow.d.ts
3
- interface ClackLogAdapter {
4
- error: (message: string) => void;
5
- info: (message: string) => void;
6
- step: (message: string) => void;
7
- success: (message: string) => void;
8
- warn: (message: string) => void;
9
- }
10
- interface ClackAdapter {
11
- intro: (message: string) => void;
12
- log: ClackLogAdapter;
13
- outro: (message: string) => void;
14
- }
15
- interface FlowOutput {
16
- write: (message: string) => void;
17
- }
18
- interface FlowWriteStream {
19
- columns?: number;
20
- isTTY?: boolean;
21
- write?: unknown;
22
- }
23
- interface LiminaFlowReporterOptions {
24
- clack?: ClackAdapter;
25
- env?: NodeJS.ProcessEnv;
26
- forceTty?: boolean;
27
- output?: FlowOutput;
28
- stderr?: FlowWriteStream;
29
- stdout?: FlowWriteStream;
30
- }
31
- interface LiminaFlowMessageOptions {
32
- collapseOnSuccess?: boolean;
33
- depth?: number;
34
- elapsedTimeMs?: number;
35
- }
36
- interface LiminaFlowFailureOptions extends LiminaFlowMessageOptions {
37
- error?: unknown;
38
- }
39
- interface LiminaFlowTask {
40
- fail: (message?: string, options?: LiminaFlowFailureOptions) => void;
41
- info: (message: string, options?: LiminaFlowMessageOptions) => void;
42
- pass: (message?: string, options?: LiminaFlowMessageOptions) => void;
43
- skip: (message?: string, options?: LiminaFlowMessageOptions) => void;
44
- warn: (message: string, options?: LiminaFlowMessageOptions) => void;
45
- }
46
- interface LiminaFlowOutputOptions {
47
- stream?: "stderr" | "stdout";
48
- }
49
- declare class LiminaFlowReporter {
50
- #private;
51
- constructor(options?: LiminaFlowReporterOptions);
52
- get interactive(): boolean;
53
- intro(message: string): void;
54
- outro(message: string): void;
55
- start(message: string, options?: LiminaFlowMessageOptions): LiminaFlowTask;
56
- fail(message: string, options?: LiminaFlowFailureOptions): void;
57
- info(message: string, options?: LiminaFlowMessageOptions): void;
58
- pass(message: string, options?: LiminaFlowMessageOptions): void;
59
- skip(message: string, options?: LiminaFlowMessageOptions): void;
60
- warn(message: string, options?: LiminaFlowMessageOptions): void;
61
- writeOutput(message: string | Uint8Array, options?: LiminaFlowOutputOptions): void;
62
- }
63
- declare function createLiminaFlowReporter(options?: LiminaFlowReporterOptions): LiminaFlowReporter;
1
+ //#region src/execution/config.d.ts
2
+ type ExecutionConcurrency = number | "auto";
3
+ interface ExecutionConfig {
4
+ checkerBuild?: ExecutionConcurrency;
5
+ checkerTypecheck?: ExecutionConcurrency;
6
+ failFast?: boolean;
7
+ packageEntries?: ExecutionConcurrency;
8
+ releaseEntries?: ExecutionConcurrency;
9
+ tasks?: ExecutionConcurrency;
10
+ }
64
11
  //#endregion
65
- //#region src/commands/graph.d.ts
66
- interface RunGraphCheckOptions {
67
- clearScreen?: boolean;
68
- flow?: LiminaFlowReporter;
69
- flowDepth?: number;
70
- }
71
- interface RunGraphSyncOptions {
72
- clearScreen?: boolean;
12
+ //#region src/config/runner.d.ts
13
+ /**
14
+ * Runtime label used by package boundary checks.
15
+ *
16
+ * Use `browser` for code that must stay free of Node.js runtime imports,
17
+ * `node` for server-only output, or a custom string when a package has its own
18
+ * environment naming.
19
+ */
20
+ type RuntimeEnvironment = "browser" | "node" | string;
21
+ /**
22
+ * One step in a named Limina pipeline.
23
+ *
24
+ * A string can be either a built-in task such as `graph:check`, or a command
25
+ * split on whitespace. Use the object form when you need args, cwd, or env to
26
+ * be unambiguous.
27
+ */
28
+ type PipelineStep = string | {
29
+ /**
30
+ * Arguments passed to the command.
31
+ *
32
+ * Prefer this over a single command string when an argument contains
33
+ * spaces or when you want the config to be easy to review.
34
+ */
35
+ args?: string[];
36
+ /**
37
+ * Executable name, for example `pnpm`, `tsc`, `tsgo`, `vue-tsc`, or `vue-tsgo`.
38
+ *
39
+ * The command runs from the inferred workspace root unless `cwd` is set.
40
+ */
41
+ command: string;
42
+ /**
43
+ * Working directory for this step, relative to the inferred workspace root.
44
+ */
73
45
  cwd?: string;
74
- entryPath?: string;
75
- flow?: LiminaFlowReporter;
76
- flowDepth?: number;
46
+ /**
47
+ * Extra environment variables for this step.
48
+ *
49
+ * Values are merged on top of `process.env`.
50
+ */
51
+ env?: Record<string, string>;
52
+ /**
53
+ * Marks this pipeline step as an external command.
54
+ */
55
+ type: "command";
56
+ } | {
57
+ /**
58
+ * Built-in Limina task to run.
59
+ */
60
+ name: BuiltinTaskName;
61
+ /**
62
+ * Marks this pipeline step as a built-in task.
63
+ */
64
+ type: "task";
65
+ };
66
+ /**
67
+ * Built-in task names understood by Limina pipelines.
68
+ */
69
+ type BuiltinTaskName = "checker:build" | "checker:typecheck" | "graph:prepare" | "graph:check" | "package:check" | "proof:check" | "release:check" | "source:check";
70
+ type BuiltinCheckerPreset = "svelte-check" | "tsc" | "tsgo" | "vue-tsc" | "vue-tsgo";
71
+ type CheckerPreset = BuiltinCheckerPreset;
72
+ type BuildCheckerPreset = Extract<BuiltinCheckerPreset, "tsc" | "tsgo" | "vue-tsc">;
73
+ type CheckerExecutionKind = "build" | "typecheck";
74
+ /**
75
+ * Checker capability for one source module family.
76
+ */
77
+ interface CheckerConfig {
78
+ /**
79
+ * Built-in checker preset, such as `tsc`, `tsgo`, `vue-tsc`, `vue-tsgo`, or `svelte-check`.
80
+ */
81
+ preset: CheckerPreset;
82
+ /**
83
+ * Source-level ordinary tsconfig selectors covered by this checker.
84
+ */
85
+ include: string[];
86
+ /**
87
+ * Optional source-level tsconfig exclusion patterns.
88
+ */
89
+ exclude?: string[];
77
90
  }
78
- interface RunGraphSyncResult {
79
- changed: boolean;
80
- projectCount: number;
91
+ interface AutoCheckerConfig {
92
+ /**
93
+ * Enables automatic checker discovery from ordinary source tsconfig.json
94
+ * scopes.
95
+ */
96
+ mode: "auto";
97
+ /**
98
+ * Optional source-level tsconfig exclusion patterns used during automatic
99
+ * checker discovery.
100
+ */
101
+ exclude?: string[];
81
102
  }
82
- declare function runGraphCheck(config: ResolvedLiminaConfig, options?: RunGraphCheckOptions): Promise<boolean>;
83
- declare function runGraphSync(config: ResolvedLiminaConfig, options?: RunGraphSyncOptions): Promise<RunGraphSyncResult>;
84
- //#endregion
85
- //#region src/commands/init.d.ts
86
- interface RunInitOptions {
87
- clearScreen?: boolean;
88
- cwd?: string;
89
- flow?: LiminaFlowReporter;
90
- flowDepth?: number;
91
- yes?: boolean;
92
- }
93
- interface RunInitResult {
94
- checkCommand: string;
95
- installRequired: boolean;
96
- rootDir: string;
97
- skippedFiles: string[];
98
- workspacePackageCount: number;
99
- writtenFiles: string[];
100
- }
101
- declare function runInit(options?: RunInitOptions): Promise<RunInitResult>;
102
- //#endregion
103
- //#region src/commands/source.d.ts
104
- interface RunSourceCheckOptions {
105
- clearScreen?: boolean;
106
- flow?: LiminaFlowReporter;
107
- flowDepth?: number;
103
+ type CheckerConfigMode = AutoCheckerConfig | Record<string, CheckerConfig>;
104
+ type VueImportParser = "compiler-sfc" | "heuristic";
105
+ /**
106
+ * Source import analysis settings shared by graph, proof, source, and checker
107
+ * tasks.
108
+ */
109
+ interface ImportAnalysisConfig {
110
+ /**
111
+ * Parser used to extract imports from Vue SFC script blocks.
112
+ *
113
+ * @default 'heuristic'
114
+ */
115
+ vue?: VueImportParser;
108
116
  }
109
- declare function runSourceCheck(config: ResolvedLiminaConfig, options?: RunSourceCheckOptions): Promise<boolean>;
110
- //#endregion
111
- //#region src/checkers.d.ts
112
- type CheckerPackageResolver = (options: {
113
- packageName: string;
114
- projectRootDir: string;
115
- }) => string | undefined;
116
- //#endregion
117
- //#region src/commands/typecheck.d.ts
118
- interface TypecheckTarget {
119
- args: string[];
120
- checkerName?: string;
121
- configPath: string;
122
- cwd: string;
123
- command: string;
124
- executionKind?: CheckerExecutionKind;
125
- label?: string;
126
- }
127
- interface TypecheckTargetResult {
128
- configPath: string;
129
- error?: Error;
130
- status: number;
131
- }
132
- type TypecheckRunner = (target: TypecheckTarget) => Promise<TypecheckTargetResult> | TypecheckTargetResult;
133
- interface RunCheckerBuildOptions {
134
- clearScreen?: boolean;
135
- config: ResolvedLiminaConfig;
136
- cwd?: string;
137
- flow?: LiminaFlowReporter;
138
- flowDepth?: number;
139
- checkerPackageResolver?: CheckerPackageResolver;
140
- runner?: TypecheckRunner;
141
- tscCommand?: string;
142
- }
143
- interface RunCheckerBuildResult {
144
- passed: boolean;
145
- projectRootDir: string;
146
- rootConfigPaths: string[];
147
- }
148
- interface RunCheckerTypecheckOptions {
149
- clearScreen?: boolean;
150
- config: ResolvedLiminaConfig;
151
- cwd?: string;
152
- flow?: LiminaFlowReporter;
153
- flowDepth?: number;
154
- checkerPackageResolver?: CheckerPackageResolver;
155
- runner?: TypecheckRunner;
156
- tscCommand?: string;
157
- }
158
- interface RunCheckerTypecheckResult {
159
- passed: boolean;
160
- projectRootDir: string;
161
- rootConfigPaths: string[];
162
- }
163
- declare function runCheckerBuild(options: RunCheckerBuildOptions): Promise<RunCheckerBuildResult>;
164
- declare function runCheckerTypecheck(options: RunCheckerTypecheckOptions): Promise<RunCheckerTypecheckResult>;
165
- //#endregion
166
- //#region src/tsconfig.d.ts
167
- declare function isOrdinaryTypecheckConfigPath(configPath: string): boolean;
117
+ /**
118
+ * Explicit exception for a declared workspace package dependency that is used
119
+ * through generated code, runtime strings, or another path that Knip
120
+ * dependency analysis cannot see.
121
+ */
122
+ interface SourceKnipIgnoredDependencyConfig {
123
+ /**
124
+ * Declared workspace dependency package name.
125
+ */
126
+ dep: string;
127
+ /**
128
+ * Why the dependency is safe to keep even when Knip cannot prove it is
129
+ * reachable from package entries, binaries, or scripts.
130
+ */
131
+ reason: string;
132
+ }
133
+ /**
134
+ * Explicit exception for a source module that is owned by a package but is
135
+ * intentionally not reachable from Knip's package entry graph.
136
+ */
137
+ interface SourceKnipIgnoredFileConfig {
138
+ /**
139
+ * Workspace-root-relative source module path.
140
+ */
141
+ file: string;
142
+ /**
143
+ * Why the source module is safe to keep even when Knip cannot prove it is
144
+ * reachable from package entries, binaries, or scripts.
145
+ */
146
+ reason: string;
147
+ }
148
+ /**
149
+ * Additional source module entries for Knip's source reachability graph.
150
+ *
151
+ * Default entries come from package exports, package binaries, package scripts,
152
+ * and Knip-supported plugin entries. Packages without package.json#exports are
153
+ * treated as application-style owners: Limina provides the full governed source
154
+ * module set as the entry surface and skips unused-file coverage for that
155
+ * package. Use this only for extra entry modules loaded by test runners, local
156
+ * tools, or build steps that should not become package exports.
157
+ */
158
+ interface SourceKnipEntryConfig {
159
+ /**
160
+ * Workspace-root-relative file or glob patterns that Knip should treat as
161
+ * additional entries for the keyed package.
162
+ */
163
+ files: string[];
164
+ /**
165
+ * Why these modules are legitimate entries even though they are not package
166
+ * exports, binaries, scripts, or plugin-discovered entries.
167
+ */
168
+ reason: string;
169
+ }
170
+ /**
171
+ * Package-level Knip source analysis config interpreted by Limina.
172
+ */
173
+ interface SourceKnipWorkspaceConfig {
174
+ /**
175
+ * Additional package-owned source modules Knip should treat as reachable
176
+ * roots. Limina disables Knip's implicit index/main/cli entry guessing by
177
+ * default; package manifest entries, scripts, plugin-discovered entries, and
178
+ * Limina virtual entries remain enabled.
179
+ */
180
+ entry?: SourceKnipEntryConfig[];
181
+ /**
182
+ * Declared workspace dependencies intentionally not visible through Knip's
183
+ * entry-reachable dependency graph.
184
+ */
185
+ ignoreDependencies?: SourceKnipIgnoredDependencyConfig[];
186
+ /**
187
+ * Package-owned source modules intentionally not visible through Knip's
188
+ * entry-reachable file graph.
189
+ */
190
+ ignoreFiles?: SourceKnipIgnoredFileConfig[];
191
+ }
192
+ /**
193
+ * Knip-backed source analysis config interpreted by Limina.
194
+ */
195
+ interface SourceKnipCheckConfig {
196
+ /**
197
+ * Package-specific Knip source analysis config keyed by workspace package
198
+ * name, such as "@example/app". Unknown package names fail source checks.
199
+ */
200
+ workspaces?: Record<string, SourceKnipWorkspaceConfig>;
201
+ }
202
+ /**
203
+ * Explicit bare-import authority rule for imports not fully authorized by the
204
+ * owning source package manifest.
205
+ */
206
+ interface SourceImportAuthorityAllowRule {
207
+ /**
208
+ * Workspace-root-relative source file globs where this authorization applies.
209
+ */
210
+ files: string[];
211
+ /**
212
+ * Package names or package-name globs whose declarations may also be read
213
+ * from the workspace root package.json when this rule matches.
214
+ */
215
+ packages?: string[];
216
+ /**
217
+ * Full import specifiers or specifier globs authorized by this rule.
218
+ */
219
+ specifiers?: string[];
220
+ /**
221
+ * Optional source owner identity. Named owners use their package name;
222
+ * nameless owners use their workspace-root-relative package directory.
223
+ */
224
+ owner?: string;
225
+ /**
226
+ * Why this import may use the matched authority rule.
227
+ */
228
+ reason: string;
229
+ }
230
+ /**
231
+ * Bare package import authority settings interpreted by source checks.
232
+ */
233
+ interface SourceImportAuthorityConfig {
234
+ /**
235
+ * Explicit import authority rules. `packages` makes the workspace root
236
+ * package.json an additional declaration candidate; `specifiers` authorizes
237
+ * exact import specifier exceptions.
238
+ */
239
+ allow?: SourceImportAuthorityAllowRule[];
240
+ }
241
+ /**
242
+ * Source-owned dependency usage check settings.
243
+ */
244
+ interface SourceCheckConfig {
245
+ /**
246
+ * Knip-backed unused dependency and unused source module analysis.
247
+ *
248
+ * `true` or omitted uses Limina's generated default config, `false` skips
249
+ * these Knip-backed checks, and an object configures Limina's semantic Knip
250
+ * source rules by workspace package name.
251
+ *
252
+ * @default true
253
+ */
254
+ knip?: boolean | SourceKnipCheckConfig;
255
+ /**
256
+ * Bare package import authorization rules.
257
+ */
258
+ importAuthority?: SourceImportAuthorityConfig;
259
+ }
260
+ /**
261
+ * Global source boundary used by proof checks.
262
+ */
263
+ interface SourceBoundaryConfig {
264
+ /**
265
+ * Glob patterns for source files that Limina should govern.
266
+ *
267
+ * When omitted, Limina uses TypeScript/JSON source defaults and adds
268
+ * framework extensions from configured checkers, such as `.vue` or
269
+ * `.svelte`.
270
+ */
271
+ include?: string[];
272
+ /**
273
+ * Glob patterns or directory shorthands to omit from source governance.
274
+ *
275
+ * When omitted, Limina reads the workspace root `.gitignore` and combines it
276
+ * with the built-in excludes below.
277
+ *
278
+ * @default: [
279
+ * "nx.json",
280
+ * "project.json",
281
+ * "tsconfig.json",
282
+ * "**\/tsconfig.*.json",
283
+ * "dist",
284
+ * ".nx",
285
+ * ".git",
286
+ * ".tsbuild",
287
+ * "coverage",
288
+ * "node_modules",
289
+ * ]
290
+ */
291
+ exclude?: string[];
292
+ }
293
+ /**
294
+ * Shared project facts used by graph, proof, and related checks.
295
+ */
296
+ interface SharedLiminaConfig {
297
+ /**
298
+ * Checker capabilities shared by graph, proof, and tsc tasks.
299
+ */
300
+ checkers?: CheckerConfigMode;
301
+ /**
302
+ * Source import analysis behavior shared by graph, proof, and source checks.
303
+ */
304
+ imports?: ImportAnalysisConfig;
305
+ /**
306
+ * Global source file boundary used by proof checks.
307
+ */
308
+ source?: SourceBoundaryConfig;
309
+ }
310
+ /**
311
+ * Declaration leaf boundary denied to projects with a matching Limina label.
312
+ */
313
+ interface GraphRuleRefDenyEntry {
314
+ /**
315
+ * Target `tsconfig*.dts.json` path, relative to the inferred workspace root.
316
+ */
317
+ path: string;
318
+ /**
319
+ * Human-readable explanation shown when the rule fails.
320
+ */
321
+ reason: string;
322
+ }
323
+ /**
324
+ * Declaration leaf boundary explicitly allowed for projects with a matching
325
+ * Limina graph rule when static import analysis cannot prove the edge.
326
+ */
327
+ interface GraphRuleRefAllowEntry {
328
+ /**
329
+ * Target `tsconfig*.dts.json` path, relative to the inferred workspace root.
330
+ */
331
+ path: string;
332
+ /**
333
+ * Human-readable explanation documenting why this extra reference is safe.
334
+ */
335
+ reason: string;
336
+ }
337
+ /**
338
+ * Dependency denied to projects with a matching Limina label.
339
+ */
340
+ interface GraphRuleDepDenyEntry {
341
+ /**
342
+ * Target package root, package.json imports specifier, or Node builtin name.
343
+ *
344
+ * Examples: `@acme/internal`, `zod`, `#internal/*`, `fs`, `node:fs`,
345
+ * or `node:*`.
346
+ */
347
+ name: string;
348
+ /**
349
+ * Human-readable explanation shown when the rule fails.
350
+ */
351
+ reason: string;
352
+ }
353
+ /**
354
+ * Deny lists for a Limina graph label.
355
+ */
356
+ interface GraphRuleDenyConfig {
357
+ /**
358
+ * Declaration leaf boundaries that matching projects must not reference or import.
359
+ */
360
+ refs?: GraphRuleRefDenyEntry[];
361
+ /**
362
+ * Packages, package imports, and Node builtins that matching projects must
363
+ * not reference or import.
364
+ */
365
+ deps?: GraphRuleDepDenyEntry[];
366
+ }
367
+ /**
368
+ * Allow lists for a Limina graph label.
369
+ */
370
+ interface GraphRuleAllowConfig {
371
+ /**
372
+ * Extra declaration leaf boundaries that matching projects may keep even
373
+ * when static import analysis cannot prove them.
374
+ */
375
+ refs?: GraphRuleRefAllowEntry[];
376
+ }
377
+ /**
378
+ * Package-level graph governance rule keyed by a label declared in
379
+ * `tsconfig*.dts.json`.
380
+ */
381
+ interface GraphRule {
382
+ /**
383
+ * Allowed graph boundaries that static analysis cannot prove.
384
+ */
385
+ allow?: GraphRuleAllowConfig;
386
+ /**
387
+ * Denied graph boundaries and workspace package dependencies.
388
+ */
389
+ deny?: GraphRuleDenyConfig;
390
+ }
391
+ /**
392
+ * TypeScript project graph policy.
393
+ */
394
+ interface GraphConditionDomain {
395
+ /**
396
+ * Human-readable domain name used in graph check reports.
397
+ */
398
+ name: string;
399
+ /**
400
+ * Domain entry `tsconfig*.dts.json` path, relative to the inferred workspace root.
401
+ */
402
+ entry: string;
403
+ /**
404
+ * Bundler/package condition names expected for this declaration reference tree.
405
+ */
406
+ customConditions: string[];
407
+ }
408
+ interface GraphConfig {
409
+ /**
410
+ * Real declaration resolution domains whose project references should share
411
+ * the configured custom conditions.
412
+ */
413
+ conditionDomains?: GraphConditionDomain[];
414
+ /**
415
+ * Label-based package and build-boundary access rules.
416
+ *
417
+ * A `tsconfig*.dts.json` can opt into one or more rules by declaring
418
+ * `liminaOptions.graphRules`.
419
+ */
420
+ rules?: Record<string, GraphRule>;
421
+ }
422
+ /**
423
+ * Explicit exception for a source file that is intentionally not covered by the
424
+ * normal proof rules.
425
+ */
426
+ interface ProofAllowlistEntry {
427
+ /**
428
+ * File path to allow, relative to the inferred workspace root.
429
+ */
430
+ file: string;
431
+ /**
432
+ * Why this file is safe to exclude from normal proof coverage.
433
+ */
434
+ reason: string;
435
+ }
436
+ /**
437
+ * Typecheck coverage proof settings.
438
+ */
439
+ interface ProofConfig {
440
+ /**
441
+ * Intentional file-level exceptions.
442
+ */
443
+ allowlist?: ProofAllowlistEntry[];
444
+ }
445
+ /**
446
+ * Package check tools that can run against a built package output.
447
+ */
448
+ type PackageCheckTool = "attw" | "boundary" | "publint";
449
+ /**
450
+ * CLI package check tool selection.
451
+ */
452
+ type PackageCheckToolSelection = PackageCheckTool | "all";
453
+ /**
454
+ * Are The Types Wrong profile used for package type resolution checks.
455
+ */
456
+ type PackageAttwProfile = "esm-only" | "node16" | "strict";
457
+ /**
458
+ * publint package check settings.
459
+ */
460
+ type PackagePublintLevel = "error" | "suggestion" | "warning";
461
+ interface PackagePublintCheckConfig {
462
+ /**
463
+ * Minimum publint message level to report.
464
+ */
465
+ level?: PackagePublintLevel;
466
+ /**
467
+ * Whether publint should run in strict mode.
468
+ *
469
+ * @default true
470
+ */
471
+ strict?: boolean;
472
+ }
473
+ /**
474
+ * Are The Types Wrong package check settings.
475
+ */
476
+ type PackageAttwLevel = "error" | "warn";
477
+ type PackageAttwIgnoreRule = "cjs-only-exports-default" | "cjs-resolves-to-esm" | "fallback-condition" | "false-cjs" | "false-esm" | "false-export-default" | "internal-resolution-error" | "missing-export-equals" | "named-exports" | "no-resolution" | "unexpected-module-syntax" | "untyped-resolution" | (string & {});
478
+ interface PackageAttwCheckConfig {
479
+ /**
480
+ * Exhaustive list of package entrypoints to check. The package root is ".".
481
+ */
482
+ entrypoints?: string[];
483
+ /**
484
+ * Whether ATTW should consider all published files as entrypoints when no
485
+ * other entrypoints are detected or configured.
486
+ */
487
+ entrypointsLegacy?: boolean;
488
+ /**
489
+ * Entrypoints to exclude from checking.
490
+ */
491
+ excludeEntrypoints?: (string | RegExp)[];
492
+ /**
493
+ * Problem rule names to ignore.
494
+ */
495
+ ignoreRules?: PackageAttwIgnoreRule[];
496
+ /**
497
+ * Entrypoints to check in addition to automatically discovered ones.
498
+ */
499
+ includeEntrypoints?: string[];
500
+ /**
501
+ * Whether ATTW findings fail the package check or are logged as warnings.
502
+ *
503
+ * @default "error"
504
+ */
505
+ level?: PackageAttwLevel;
506
+ /**
507
+ * Problem profile to enforce.
508
+ *
509
+ * `esm-only` ignores CJS resolution failures for pure ESM packages.
510
+ *
511
+ * @default "esm-only"
512
+ */
513
+ profile?: PackageAttwProfile;
514
+ }
515
+ /**
516
+ * Built package import boundary settings.
517
+ */
518
+ interface PackageBoundaryCheckConfig {
519
+ /**
520
+ * Runtime environment for each emitted file.
521
+ *
522
+ * Use a string when the whole package has one environment, or a function when
523
+ * different files have different environments.
524
+ */
525
+ environment?: RuntimeEnvironment | ((relativeFilePath: string) => RuntimeEnvironment);
526
+ /**
527
+ * External package imports that are intentionally allowed even when they are
528
+ * not listed in the built package manifest.
529
+ */
530
+ ignoredExternalPackages?: string[];
531
+ }
532
+ /**
533
+ * One published package output entry.
534
+ */
535
+ interface PackageEntry {
536
+ /**
537
+ * Package name used by CLI filters, reports, and cwd release matching.
538
+ */
539
+ name: string;
540
+ /**
541
+ * Built package directory to scan, relative to the inferred workspace root.
542
+ */
543
+ outDir: string;
544
+ /**
545
+ * Package check tools enabled for this entry.
546
+ *
547
+ * @default ["publint", "attw", "boundary"]
548
+ */
549
+ checks?: PackageCheckTool[];
550
+ /**
551
+ * publint settings for this package output.
552
+ */
553
+ publint?: boolean | PackagePublintCheckConfig;
554
+ /**
555
+ * Are The Types Wrong settings for this package output.
556
+ */
557
+ attw?: boolean | PackageAttwCheckConfig;
558
+ /**
559
+ * Built package import boundary settings.
560
+ */
561
+ boundary?: PackageBoundaryCheckConfig;
562
+ }
563
+ /**
564
+ * Published package settings.
565
+ */
566
+ interface PackageConfig {
567
+ /**
568
+ * Built package outputs to check.
569
+ */
570
+ entries?: PackageEntry[];
571
+ }
572
+ interface ReleaseContentHashConfigArgs {
573
+ /**
574
+ * Package currently being release-checked.
575
+ */
576
+ importerName: string;
577
+ /**
578
+ * Workspace dependency package being compared against npm.
579
+ */
580
+ dependencyName: string;
581
+ }
582
+ /**
583
+ * Release dependency artifact content hash settings.
584
+ */
585
+ interface ReleaseContentHashConfig {
586
+ /**
587
+ * npm dist-tag used as the online baseline for dependency package output.
588
+ *
589
+ * @default "latest"
590
+ */
591
+ baselineTag?: string | ((args: ReleaseContentHashConfigArgs) => string);
592
+ /**
593
+ * Use Limina's built-in dependency artifact ignore set as a fallback when
594
+ * `ignore` is omitted or returns `undefined`.
595
+ *
596
+ * @default false
597
+ */
598
+ builtinIgnore?: boolean;
599
+ /**
600
+ * Additional package-relative glob patterns ignored by dependency artifact
601
+ * content hashes.
602
+ */
603
+ ignore?: string[] | ((args: ReleaseContentHashConfigArgs) => string[] | undefined);
604
+ }
605
+ /**
606
+ * Release check settings.
607
+ */
608
+ interface ReleaseConfig {
609
+ /**
610
+ * Dependency artifact content hash comparison settings.
611
+ */
612
+ contentHash?: ReleaseContentHashConfig;
613
+ }
614
+ /**
615
+ * Limina user config.
616
+ */
617
+ interface LiminaConfig {
618
+ /**
619
+ * Shared project facts, such as checker entries and source boundary.
620
+ */
621
+ config?: SharedLiminaConfig;
622
+ /**
623
+ * Bounded execution settings for task, checker, package, and release work.
624
+ */
625
+ execution?: ExecutionConfig;
626
+ /**
627
+ * TypeScript project graph and architecture rules.
628
+ */
629
+ graph?: GraphConfig;
630
+ /**
631
+ * Rules for checking built package outputs before publishing.
632
+ */
633
+ package?: PackageConfig;
634
+ /**
635
+ * Named command pipelines runnable through `limina check <name>`.
636
+ */
637
+ pipelines?: Record<string, PipelineStep[]>;
638
+ /**
639
+ * Rules that prove source files are covered by graph or checker entries.
640
+ */
641
+ proof?: ProofConfig;
642
+ /**
643
+ * Rules for release dependency artifact comparisons.
644
+ */
645
+ release?: ReleaseConfig;
646
+ /**
647
+ * Rules for source-owned dependency usage checks.
648
+ */
649
+ source?: SourceCheckConfig;
650
+ }
651
+ /**
652
+ * CLI command currently loading the config.
653
+ */
654
+ type LiminaCommand = "check" | "graph" | "package" | "proof" | "release" | "source" | (string & {});
655
+ /**
656
+ * Environment passed to function-style configs.
657
+ */
658
+ interface LiminaConfigEnv {
659
+ /**
660
+ * CLI command family, such as `check`, `graph`, or `package`.
661
+ */
662
+ command: LiminaCommand;
663
+ /**
664
+ * Mode passed through `--mode`.
665
+ *
666
+ * Defaults to `process.env.NODE_ENV`, then `default`.
667
+ */
668
+ mode: string;
669
+ }
670
+ type LiminaConfigFnObject = (env: LiminaConfigEnv) => LiminaConfig;
671
+ type LiminaConfigFnPromise = (env: LiminaConfigEnv) => Promise<LiminaConfig>;
672
+ type LiminaConfigFn = (env: LiminaConfigEnv) => LiminaConfig | Promise<LiminaConfig>;
673
+ type LiminaConfigExport = LiminaConfig | Promise<LiminaConfig> | LiminaConfigFnObject | LiminaConfigFnPromise | LiminaConfigFn;
674
+ /**
675
+ * Type helper for limina.config.mjs.
676
+ *
677
+ * Accepts a direct config object, a Promise, or a function that receives the
678
+ * current {@link LiminaConfigEnv}.
679
+ */
680
+ declare function defineConfig(config: LiminaConfig): LiminaConfig;
681
+ declare function defineConfig(config: Promise<LiminaConfig>): Promise<LiminaConfig>;
682
+ declare function defineConfig(config: LiminaConfigFnObject): LiminaConfigFnObject;
683
+ declare function defineConfig(config: LiminaConfigFnPromise): LiminaConfigFnPromise;
684
+ declare function defineConfig(config: LiminaConfigFn): LiminaConfigFn;
168
685
  //#endregion
169
- export { type BuiltinCheckerPreset, type BuiltinTaskName, type CheckerConfig, type CheckerExecutionKind, type CheckerPreset, type GraphConditionDomain, type GraphConfig, type GraphRule, type GraphRuleAllowConfig, type GraphRuleDenyConfig, type GraphRuleDepDenyEntry, type GraphRuleRefAllowEntry, type GraphRuleRefDenyEntry, type LiminaCommand, type LiminaConfig, type LiminaConfigEnv, type LiminaConfigExport, type LiminaConfigFn, type LiminaConfigFnObject, type LiminaConfigFnPromise, type LiminaFlowFailureOptions, type LiminaFlowMessageOptions, type LiminaFlowOutputOptions, LiminaFlowReporter, type LiminaFlowReporterOptions, type LiminaFlowTask, type LoadConfigOptions, type PackageAttwCheckConfig, type PackageAttwIgnoreRule, type PackageAttwLevel, type PackageAttwProfile, type PackageBoundaryCheckConfig, type PackageCheckTool, type PackageCheckToolSelection, type PackageConfig, type PackageEntry, type PackagePublintCheckConfig, type PackagePublintLevel, type PipelineStep, type ProofAllowlistEntry, type ProofConfig, type ResolvedCheckerConfig, type ResolvedLiminaConfig, type RunCheckerBuildOptions, type RunCheckerBuildResult, type RunCheckerTypecheckOptions, type RunCheckerTypecheckResult, type RunGraphCheckOptions, type RunGraphSyncOptions, type RunGraphSyncResult, type RunInitOptions, type RunInitResult, type RunSourceCheckOptions, type RuntimeEnvironment, type SharedLiminaConfig, type SourceBoundaryConfig, type SourceCheckConfig, type SourceKnipCheckConfig, type SourceKnipEntryConfig, type SourceKnipIgnoredDependencyConfig, type SourceKnipIgnoredFileConfig, type SourceKnipWorkspaceConfig, type TypecheckRunner, type TypecheckTarget, type TypecheckTargetResult, createLiminaFlowReporter, defineConfig, getActiveCheckerExtensions, getActiveCheckers, isOrdinaryTypecheckConfigPath, loadConfig, runCheckerBuild, runCheckerTypecheck, runGraphCheck, runGraphSync, runInit, runSourceCheck, validateLiminaConfig };
686
+ export { type AutoCheckerConfig, type BuildCheckerPreset, type BuiltinCheckerPreset, type BuiltinTaskName, type CheckerConfig, type CheckerConfigMode, type CheckerExecutionKind, type CheckerPreset, type GraphConditionDomain, type GraphConfig, type GraphRule, type GraphRuleAllowConfig, type GraphRuleDenyConfig, type GraphRuleDepDenyEntry, type GraphRuleRefAllowEntry, type GraphRuleRefDenyEntry, type ImportAnalysisConfig, type LiminaCommand, type LiminaConfig, type LiminaConfigEnv, type LiminaConfigExport, type LiminaConfigFn, type LiminaConfigFnObject, type LiminaConfigFnPromise, type PackageAttwCheckConfig, type PackageAttwIgnoreRule, type PackageAttwLevel, type PackageAttwProfile, type PackageBoundaryCheckConfig, type PackageCheckTool, type PackageCheckToolSelection, type PackageConfig, type PackageEntry, type PackagePublintCheckConfig, type PackagePublintLevel, type PipelineStep, type ProofAllowlistEntry, type ProofConfig, type ReleaseConfig, type ReleaseContentHashConfig, type ReleaseContentHashConfigArgs, type RuntimeEnvironment, type SharedLiminaConfig, type SourceBoundaryConfig, type SourceCheckConfig, type SourceImportAuthorityAllowRule, type SourceImportAuthorityConfig, type SourceKnipCheckConfig, type SourceKnipEntryConfig, type SourceKnipIgnoredDependencyConfig, type SourceKnipIgnoredFileConfig, type SourceKnipWorkspaceConfig, type VueImportParser, defineConfig };