limina 0.0.5 → 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.
@@ -1,3 +0,0 @@
1
- import { createRequire } from "node:module";
2
-
3
- export { };
package/config.d.ts DELETED
@@ -1,631 +0,0 @@
1
- //#region src/config.d.ts
2
- /**
3
- * Runtime label used by package boundary checks.
4
- *
5
- * Use `browser` for code that must stay free of Node.js runtime imports,
6
- * `node` for server-only output, or a custom string when a package has its own
7
- * environment naming.
8
- */
9
- type RuntimeEnvironment = "browser" | "node" | string;
10
- /**
11
- * One step in a named Limina pipeline.
12
- *
13
- * A string can be either a built-in task such as `graph:check`, or a command
14
- * split on whitespace. Use the object form when you need args, cwd, or env to
15
- * be unambiguous.
16
- */
17
- type PipelineStep = string | {
18
- /**
19
- * Arguments passed to the command.
20
- *
21
- * Prefer this over a single command string when an argument contains
22
- * spaces or when you want the config to be easy to review.
23
- */
24
- args?: string[];
25
- /**
26
- * Executable name, for example `pnpm`, `tsc`, `tsgo`, `vue-tsc`, or `vue-tsgo`.
27
- *
28
- * The command runs from the inferred workspace root unless `cwd` is set.
29
- */
30
- command: string;
31
- /**
32
- * Working directory for this step, relative to the inferred workspace root.
33
- */
34
- cwd?: string;
35
- /**
36
- * Extra environment variables for this step.
37
- *
38
- * Values are merged on top of `process.env`.
39
- */
40
- env?: Record<string, string>;
41
- /**
42
- * Marks this pipeline step as an external command.
43
- */
44
- type: "command";
45
- } | {
46
- /**
47
- * Built-in Limina task to run.
48
- */
49
- name: BuiltinTaskName;
50
- /**
51
- * Marks this pipeline step as a built-in task.
52
- */
53
- type: "task";
54
- };
55
- /**
56
- * Built-in task names understood by Limina pipelines.
57
- */
58
- type BuiltinTaskName = "checker:build" | "checker:typecheck" | "graph:check" | "nx:check" | "package:check" | "proof:check" | "release:check" | "source:check";
59
- type BuiltinCheckerPreset = "svelte-check" | "tsc" | "tsgo" | "vue-tsc" | "vue-tsgo";
60
- type CheckerPreset = BuiltinCheckerPreset;
61
- type CheckerExecutionKind = "build" | "typecheck";
62
- /**
63
- * Checker capability for one source module family.
64
- */
65
- interface CheckerConfig {
66
- /**
67
- * Built-in checker preset, such as `tsc`, `tsgo`, `vue-tsc`, `vue-tsgo`, or `svelte-check`.
68
- */
69
- preset: CheckerPreset;
70
- /**
71
- * Checker entry project used by both build and typecheck execution modes.
72
- */
73
- entry: string;
74
- }
75
- interface ResolvedCheckerConfig {
76
- entry: string;
77
- extensions: string[];
78
- name: string;
79
- preset: CheckerPreset;
80
- }
81
- /**
82
- * Explicit exception for a declared workspace package dependency that is used
83
- * through generated code, runtime strings, or another path that Knip
84
- * dependency analysis cannot see.
85
- */
86
- interface SourceUnusedDependencyIgnoreEntry {
87
- /**
88
- * Importing package name from package.json.
89
- */
90
- importer: string;
91
- /**
92
- * Declared workspace dependency package name.
93
- */
94
- dependency: string;
95
- /**
96
- * Why the dependency is safe to keep even when Knip cannot prove it is
97
- * reachable from package entries, binaries, or scripts.
98
- */
99
- reason: string;
100
- }
101
- /**
102
- * Source dependency usage settings.
103
- */
104
- interface SourceUnusedDependenciesConfig {
105
- /**
106
- * Declared workspace dependencies intentionally not visible through Knip's
107
- * entry-reachable dependency graph.
108
- */
109
- ignore?: SourceUnusedDependencyIgnoreEntry[];
110
- }
111
- /**
112
- * Explicit exception for a source module that is owned by a package but is
113
- * intentionally not reachable from Knip's package entry graph.
114
- */
115
- interface SourceUnusedModuleIgnoreEntry {
116
- /**
117
- * Named package owner from package.json.
118
- */
119
- owner: string;
120
- /**
121
- * Workspace-root-relative source module path.
122
- */
123
- file: string;
124
- /**
125
- * Why the source module is safe to keep even when Knip cannot prove it is
126
- * reachable from package entries, binaries, or scripts.
127
- */
128
- reason: string;
129
- }
130
- /**
131
- * Additional source module entries for Knip's strict-mode reachability graph.
132
- */
133
- interface SourceUnusedModuleEntryConfig {
134
- /**
135
- * Named package owner from package.json.
136
- */
137
- owner: string;
138
- /**
139
- * Workspace-root-relative file or glob patterns that Knip should treat as
140
- * additional entries for this owner.
141
- */
142
- files: string[];
143
- /**
144
- * Why these modules are legitimate entries even though they are not package
145
- * exports, binaries, scripts, or plugin-discovered entries.
146
- */
147
- reason: string;
148
- }
149
- /**
150
- * Source module usage settings.
151
- */
152
- interface SourceUnusedModulesConfig {
153
- /**
154
- * Additional entry globs for source modules loaded by test runners or local
155
- * tooling rather than package exports.
156
- */
157
- entries?: SourceUnusedModuleEntryConfig[];
158
- /**
159
- * Package-owned source modules intentionally not visible through Knip's
160
- * entry-reachable file graph.
161
- */
162
- ignore?: SourceUnusedModuleIgnoreEntry[];
163
- }
164
- /**
165
- * Source-owned dependency usage check settings.
166
- */
167
- interface SourceCheckConfig {
168
- /**
169
- * Checks that workspace package dependencies declared in package.json are
170
- * reachable from package entries, binaries, or scripts owned by that package.
171
- */
172
- unusedDependencies?: SourceUnusedDependenciesConfig;
173
- /**
174
- * Strict-mode exceptions for package-owned source modules that are not
175
- * reachable from package entries, binaries, or scripts owned by that package.
176
- *
177
- * There is no enabled switch: strict: true enables unused module checks.
178
- */
179
- unusedModules?: SourceUnusedModulesConfig;
180
- }
181
- /**
182
- * Global source boundary used by proof checks.
183
- */
184
- interface SourceBoundaryConfig {
185
- /**
186
- * Glob patterns for source files that Limina should govern.
187
- *
188
- * When omitted, Limina derives the source boundary from configured checker
189
- * extensions and then applies `exclude`.
190
- */
191
- include?: string[];
192
- /**
193
- * Glob patterns or directory shorthands to omit from source governance.
194
- *
195
- * @default: [
196
- * "node_modules",
197
- * "dist",
198
- * ".git",
199
- * ".tsbuild",
200
- * "coverage",
201
- * "**\/tsconfig*.json",
202
- * "**\/package.json",
203
- * "**\/project.json",
204
- * ".prettierrc.json",
205
- * ".markdownlint.json",
206
- * "vercel.json",
207
- * ]
208
- */
209
- exclude?: string[];
210
- }
211
- /**
212
- * Shared project facts used by graph, paths, proof, and related checks.
213
- */
214
- interface SharedLiminaConfig {
215
- /**
216
- * Checker capabilities shared by graph, proof, paths, and tsc tasks.
217
- */
218
- checkers?: Record<string, CheckerConfig>;
219
- /**
220
- * Global source file boundary used by proof checks.
221
- */
222
- source?: SourceBoundaryConfig;
223
- }
224
- /**
225
- * Options for generated TypeScript `paths` compatibility files.
226
- */
227
- interface PathsConfig {
228
- /**
229
- * Directory names treated as build artifacts when mapping package exports
230
- * back to source files.
231
- */
232
- artifactDirectories?: string[];
233
- /**
234
- * Export condition priority when resolving package exports.
235
- *
236
- * Put more specific conditions earlier when your package exports use several
237
- * entries such as `types`, `import`, `node`, or `default`.
238
- */
239
- conditionPriority?: string[];
240
- /**
241
- * File name used for generated path mapping configs.
242
- *
243
- * @default "tsconfig.dts.paths.generated.json"
244
- */
245
- generatedFileName?: string;
246
- /**
247
- * Header marker written into generated files.
248
- *
249
- * Limina uses this to know which files it is allowed to refresh.
250
- */
251
- generatedFileMarker?: string;
252
- /**
253
- * Source extensions tried when replacing artifact exports with source files.
254
- */
255
- sourceExtensions?: string[];
256
- }
257
- /**
258
- * Declaration leaf boundary denied to projects with a matching Limina label.
259
- */
260
- interface GraphRuleRefDenyEntry {
261
- /**
262
- * Target `tsconfig*.dts.json` path, relative to the inferred workspace root.
263
- */
264
- path: string;
265
- /**
266
- * Human-readable explanation shown when the rule fails.
267
- */
268
- reason: string;
269
- }
270
- /**
271
- * Declaration leaf boundary explicitly allowed for projects with a matching
272
- * Limina graph rule when static import analysis cannot prove the edge.
273
- */
274
- interface GraphRuleRefAllowEntry {
275
- /**
276
- * Target `tsconfig*.dts.json` path, relative to the inferred workspace root.
277
- */
278
- path: string;
279
- /**
280
- * Human-readable explanation documenting why this extra reference is safe.
281
- */
282
- reason: string;
283
- }
284
- /**
285
- * Dependency denied to projects with a matching Limina label.
286
- */
287
- interface GraphRuleDepDenyEntry {
288
- /**
289
- * Target package root, package.json imports specifier, or Node builtin name.
290
- *
291
- * Examples: `@acme/internal`, `zod`, `#internal/*`, `fs`, `node:fs`,
292
- * or `node:*`.
293
- */
294
- name: string;
295
- /**
296
- * Human-readable explanation shown when the rule fails.
297
- */
298
- reason: string;
299
- }
300
- /**
301
- * Deny lists for a Limina graph label.
302
- */
303
- interface GraphRuleDenyConfig {
304
- /**
305
- * Declaration leaf boundaries that matching projects must not reference or import.
306
- */
307
- refs?: GraphRuleRefDenyEntry[];
308
- /**
309
- * Packages, package imports, and Node builtins that matching projects must
310
- * not reference or import.
311
- */
312
- deps?: GraphRuleDepDenyEntry[];
313
- }
314
- /**
315
- * Allow lists for a Limina graph label.
316
- */
317
- interface GraphRuleAllowConfig {
318
- /**
319
- * Extra declaration leaf boundaries that matching projects may keep even
320
- * when static import analysis cannot prove them.
321
- */
322
- refs?: GraphRuleRefAllowEntry[];
323
- }
324
- /**
325
- * Package-level graph governance rule keyed by a label declared in
326
- * `tsconfig*.dts.json`.
327
- */
328
- interface GraphRule {
329
- /**
330
- * Allowed graph boundaries that static analysis cannot prove.
331
- */
332
- allow?: GraphRuleAllowConfig;
333
- /**
334
- * Denied graph boundaries and workspace package dependencies.
335
- */
336
- deny?: GraphRuleDenyConfig;
337
- }
338
- /**
339
- * TypeScript project graph policy.
340
- */
341
- interface GraphConfig {
342
- /**
343
- * Label-based package and build-boundary access rules.
344
- *
345
- * A `tsconfig*.dts.json` can opt into one or more rules by declaring
346
- * `liminaOptions.graphRules`.
347
- */
348
- rules?: Record<string, GraphRule>;
349
- }
350
- /**
351
- * Explicit exception for a source file that is intentionally not covered by the
352
- * normal proof rules.
353
- */
354
- interface ProofAllowlistEntry {
355
- /**
356
- * File path to allow, relative to the inferred workspace root.
357
- */
358
- file: string;
359
- /**
360
- * Why this file is safe to exclude from normal proof coverage.
361
- */
362
- reason: string;
363
- }
364
- /**
365
- * Typecheck coverage proof settings.
366
- */
367
- interface ProofConfig {
368
- /**
369
- * Intentional file-level exceptions.
370
- */
371
- allowlist?: ProofAllowlistEntry[];
372
- }
373
- /**
374
- * Package check tools that can run against a built package output.
375
- */
376
- type PackageCheckTool = "attw" | "boundary" | "publint";
377
- /**
378
- * CLI package check tool selection.
379
- */
380
- type PackageCheckToolSelection = PackageCheckTool | "all";
381
- /**
382
- * Are The Types Wrong profile used for package type resolution checks.
383
- */
384
- type PackageAttwProfile = "esm-only" | "node16" | "strict";
385
- /**
386
- * publint package check settings.
387
- */
388
- interface PackagePublintCheckConfig {
389
- /**
390
- * Whether publint should run in strict mode.
391
- *
392
- * @default true
393
- */
394
- strict?: boolean;
395
- }
396
- /**
397
- * Are The Types Wrong package check settings.
398
- */
399
- interface PackageAttwCheckConfig {
400
- /**
401
- * Problem profile to enforce.
402
- *
403
- * `esm-only` ignores CJS resolution failures for pure ESM packages.
404
- *
405
- * @default "esm-only"
406
- */
407
- profile?: PackageAttwProfile;
408
- }
409
- /**
410
- * Built package import boundary settings.
411
- */
412
- interface PackageBoundaryCheckConfig {
413
- /**
414
- * Runtime environment for each emitted file.
415
- *
416
- * Use a string when the whole package has one environment, or a function when
417
- * different files have different environments.
418
- */
419
- environment?: RuntimeEnvironment | ((relativeFilePath: string) => RuntimeEnvironment);
420
- /**
421
- * External package imports that are intentionally allowed even when they are
422
- * not listed in the built package manifest.
423
- */
424
- ignoredExternalPackages?: string[];
425
- }
426
- /**
427
- * One published package output entry.
428
- */
429
- interface PackageEntry {
430
- /**
431
- * Package name used by CLI filters, reports, and cwd release matching.
432
- */
433
- name: string;
434
- /**
435
- * Built package directory to scan, relative to the inferred workspace root.
436
- */
437
- outDir: string;
438
- /**
439
- * Package check tools enabled for this entry.
440
- *
441
- * @default ["publint", "attw", "boundary"]
442
- */
443
- checks?: PackageCheckTool[];
444
- /**
445
- * publint settings for this package output.
446
- */
447
- publint?: PackagePublintCheckConfig;
448
- /**
449
- * Are The Types Wrong settings for this package output.
450
- */
451
- attw?: PackageAttwCheckConfig;
452
- /**
453
- * Built package import boundary settings.
454
- */
455
- boundary?: PackageBoundaryCheckConfig;
456
- }
457
- /**
458
- * Published package settings.
459
- */
460
- interface PackageConfig {
461
- /**
462
- * Built package outputs to check.
463
- */
464
- entries?: PackageEntry[];
465
- }
466
- interface ReleaseContentHashConfigArgs {
467
- /**
468
- * Package currently being release-checked.
469
- */
470
- importerName: string;
471
- /**
472
- * Workspace dependency package being compared against npm.
473
- */
474
- dependencyName: string;
475
- }
476
- /**
477
- * Release dependency artifact content hash settings.
478
- */
479
- interface ReleaseContentHashConfig {
480
- /**
481
- * npm dist-tag used as the online baseline for dependency package output.
482
- *
483
- * @default "latest"
484
- */
485
- baselineTag?: string | ((args: ReleaseContentHashConfigArgs) => string);
486
- /**
487
- * Use Limina's built-in dependency artifact ignore set as a fallback when
488
- * `ignore` is omitted or returns `undefined`.
489
- *
490
- * @default false
491
- */
492
- builtinIgnore?: boolean;
493
- /**
494
- * Additional package-relative glob patterns ignored by dependency artifact
495
- * content hashes.
496
- */
497
- ignore?: string[] | ((args: ReleaseContentHashConfigArgs) => string[] | undefined);
498
- }
499
- /**
500
- * Release check settings.
501
- */
502
- interface ReleaseConfig {
503
- /**
504
- * Dependency artifact content hash comparison settings.
505
- */
506
- contentHash?: ReleaseContentHashConfig;
507
- }
508
- /**
509
- * Limina user config.
510
- */
511
- interface LiminaConfig {
512
- /**
513
- * Enable strict workspace modeling rules.
514
- *
515
- * Strict mode keeps the existing command surface but makes graph, proof,
516
- * source, package, and release checks enforce the complete Limina workspace
517
- * model.
518
- *
519
- * @default false
520
- */
521
- strict?: boolean;
522
- /**
523
- * Shared project facts, such as checker entries and source boundary.
524
- */
525
- config?: SharedLiminaConfig;
526
- /**
527
- * TypeScript project graph and architecture rules.
528
- */
529
- graph?: GraphConfig;
530
- /**
531
- * Rules for checking built package outputs before publishing.
532
- */
533
- package?: PackageConfig;
534
- /**
535
- * Options for generating TypeScript source `paths` compatibility files.
536
- */
537
- paths?: PathsConfig;
538
- /**
539
- * Named command pipelines runnable through `limina check <name>`.
540
- */
541
- pipelines?: Record<string, PipelineStep[]>;
542
- /**
543
- * Rules that prove source files are covered by graph or checker entries.
544
- */
545
- proof?: ProofConfig;
546
- /**
547
- * Rules for release dependency artifact comparisons.
548
- */
549
- release?: ReleaseConfig;
550
- /**
551
- * Rules for source-owned dependency usage checks.
552
- */
553
- source?: SourceCheckConfig;
554
- }
555
- /**
556
- * CLI command currently loading the config.
557
- */
558
- type LiminaCommand = "check" | "graph" | "nx" | "package" | "paths" | "proof" | "release" | "source" | (string & {});
559
- /**
560
- * Environment passed to function-style configs.
561
- */
562
- interface LiminaConfigEnv {
563
- /**
564
- * CLI command family, such as `check`, `graph`, or `paths`.
565
- */
566
- command: LiminaCommand;
567
- /**
568
- * Mode passed through `--mode`.
569
- *
570
- * Defaults to `process.env.NODE_ENV`, then `default`.
571
- */
572
- mode: string;
573
- }
574
- type LiminaConfigFnObject = (env: LiminaConfigEnv) => LiminaConfig;
575
- type LiminaConfigFnPromise = (env: LiminaConfigEnv) => Promise<LiminaConfig>;
576
- type LiminaConfigFn = (env: LiminaConfigEnv) => LiminaConfig | Promise<LiminaConfig>;
577
- type LiminaConfigExport = LiminaConfig | Promise<LiminaConfig> | LiminaConfigFnObject | LiminaConfigFnPromise | LiminaConfigFn;
578
- interface ResolvedLiminaConfig extends LiminaConfig {
579
- /**
580
- * Absolute path to the loaded config file.
581
- */
582
- configPath: string;
583
- /**
584
- * Absolute workspace root inferred from `cwd` and its parent directories.
585
- */
586
- rootDir: string;
587
- }
588
- /**
589
- * Type helper for limina.config.mjs.
590
- *
591
- * Accepts a direct config object, a Promise, or a function that receives the
592
- * current {@link LiminaConfigEnv}.
593
- */
594
- declare function defineConfig(config: LiminaConfig): LiminaConfig;
595
- declare function defineConfig(config: Promise<LiminaConfig>): Promise<LiminaConfig>;
596
- declare function defineConfig(config: LiminaConfigFnObject): LiminaConfigFnObject;
597
- declare function defineConfig(config: LiminaConfigFnPromise): LiminaConfigFnPromise;
598
- declare function defineConfig(config: LiminaConfigFn): LiminaConfigFn;
599
- declare function validateLiminaConfig(config: LiminaConfig): void;
600
- declare function isStrictConfig(config: Pick<LiminaConfig, "strict">): boolean;
601
- declare function getActiveCheckers(config: LiminaConfig): ResolvedCheckerConfig[];
602
- declare function getActiveCheckerExtensions(config: LiminaConfig): string[];
603
- interface LoadConfigOptions {
604
- /**
605
- * Command family to expose to function-style configs.
606
- */
607
- command?: LiminaCommand;
608
- /**
609
- * Config file path, resolved from `cwd`. When omitted, Limina searches for
610
- * the nearest `limina.config.mjs` from `cwd` upward to the inferred pnpm
611
- * workspace root.
612
- *
613
- * @default nearest "limina.config.mjs" in `cwd` or workspace parents
614
- */
615
- configPath?: string;
616
- /**
617
- * Directory used to resolve `configPath`.
618
- *
619
- * @default process.cwd()
620
- */
621
- cwd?: string;
622
- /**
623
- * Mode exposed to function-style configs.
624
- *
625
- * @default process.env.NODE_ENV ?? "default"
626
- */
627
- mode?: string;
628
- }
629
- declare function loadConfig(options?: LoadConfigOptions): Promise<ResolvedLiminaConfig>;
630
- //#endregion
631
- export { BuiltinCheckerPreset, BuiltinTaskName, CheckerConfig, CheckerExecutionKind, CheckerPreset, GraphConfig, GraphRule, GraphRuleAllowConfig, GraphRuleDenyConfig, GraphRuleDepDenyEntry, GraphRuleRefAllowEntry, GraphRuleRefDenyEntry, LiminaCommand, LiminaConfig, LiminaConfigEnv, LiminaConfigExport, LiminaConfigFn, LiminaConfigFnObject, LiminaConfigFnPromise, LoadConfigOptions, PackageAttwCheckConfig, PackageAttwProfile, PackageBoundaryCheckConfig, PackageCheckTool, PackageCheckToolSelection, PackageConfig, PackageEntry, PackagePublintCheckConfig, PathsConfig, PipelineStep, ProofAllowlistEntry, ProofConfig, ReleaseConfig, ReleaseContentHashConfig, ReleaseContentHashConfigArgs, ResolvedCheckerConfig, ResolvedLiminaConfig, RuntimeEnvironment, SharedLiminaConfig, SourceBoundaryConfig, SourceCheckConfig, SourceUnusedDependenciesConfig, SourceUnusedDependencyIgnoreEntry, SourceUnusedModuleEntryConfig, SourceUnusedModuleIgnoreEntry, SourceUnusedModulesConfig, defineConfig, getActiveCheckerExtensions, getActiveCheckers, isStrictConfig, loadConfig, validateLiminaConfig };
package/config.js DELETED
@@ -1,4 +0,0 @@
1
- import "./chunks/dep-lkQg1P9Q.js";
2
- import { a as loadConfig, i as isStrictConfig, n as getActiveCheckerExtensions, o as validateLiminaConfig, r as getActiveCheckers, t as defineConfig } from "./chunks/dep-CBKvJc4Y.js";
3
-
4
- export { defineConfig, getActiveCheckerExtensions, getActiveCheckers, isStrictConfig, loadConfig, validateLiminaConfig };