limina 0.0.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/bin/limina.js +25 -0
- package/chunks/dep-DoSHsBSP.js +2026 -0
- package/chunks/dep-jgc7X0zw.js +377 -0
- package/chunks/dep-lkQg1P9Q.js +3 -0
- package/cli.js +2287 -0
- package/config.d.ts +483 -0
- package/config.js +4 -0
- package/index.d.ts +144 -0
- package/index.js +5 -0
- package/package.json +56 -0
package/config.d.ts
ADDED
|
@@ -0,0 +1,483 @@
|
|
|
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`, or `vue-tsc`.
|
|
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" | "package:check" | "proof:check" | "source:check";
|
|
59
|
+
type BuiltinCheckerPreset = "svelte-check" | "tsc" | "vue-tsc";
|
|
60
|
+
type CheckerPreset = BuiltinCheckerPreset | (string & {});
|
|
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`, `vue-tsc`, 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
|
+
* Source file suffixes covered by this checker.
|
|
76
|
+
*
|
|
77
|
+
* Built-in presets may omit this and use their default suffixes.
|
|
78
|
+
*/
|
|
79
|
+
extensions?: string[];
|
|
80
|
+
}
|
|
81
|
+
interface ResolvedCheckerConfig {
|
|
82
|
+
entry: string;
|
|
83
|
+
extensions: string[];
|
|
84
|
+
name: string;
|
|
85
|
+
preset: CheckerPreset;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Source boundary that must be covered by checker entries or allowlist proof.
|
|
89
|
+
*/
|
|
90
|
+
interface SourceBoundaryConfig {
|
|
91
|
+
/**
|
|
92
|
+
* Glob patterns for source files that need proof coverage.
|
|
93
|
+
*
|
|
94
|
+
* When omitted, Limina derives the source boundary from configured checker
|
|
95
|
+
* extensions and then applies `exclude`.
|
|
96
|
+
*/
|
|
97
|
+
include?: string[];
|
|
98
|
+
/**
|
|
99
|
+
* Glob patterns or directory shorthands to omit from proof coverage.
|
|
100
|
+
*
|
|
101
|
+
* @default: [
|
|
102
|
+
* "node_modules",
|
|
103
|
+
* "dist",
|
|
104
|
+
* ".git",
|
|
105
|
+
* ".tsbuild",
|
|
106
|
+
* "coverage",
|
|
107
|
+
* "**\/tsconfig*.json",
|
|
108
|
+
* "**\/package.json",
|
|
109
|
+
* ".prettierrc.json",
|
|
110
|
+
* ".markdownlint.json",
|
|
111
|
+
* "vercel.json",
|
|
112
|
+
* ]
|
|
113
|
+
*/
|
|
114
|
+
exclude?: string[];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Shared project facts used by graph, paths, proof, and related checks.
|
|
118
|
+
*/
|
|
119
|
+
interface SharedLiminaConfig {
|
|
120
|
+
/**
|
|
121
|
+
* Checker capabilities shared by graph, proof, paths, and tsc tasks.
|
|
122
|
+
*/
|
|
123
|
+
checkers?: Record<string, CheckerConfig>;
|
|
124
|
+
/**
|
|
125
|
+
* Source file boundary used by coverage proof.
|
|
126
|
+
*/
|
|
127
|
+
source?: SourceBoundaryConfig;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Options for generated TypeScript `paths` compatibility files.
|
|
131
|
+
*/
|
|
132
|
+
interface PathsConfig {
|
|
133
|
+
/**
|
|
134
|
+
* Directory names treated as build artifacts when mapping package exports
|
|
135
|
+
* back to source files.
|
|
136
|
+
*/
|
|
137
|
+
artifactDirectories?: string[];
|
|
138
|
+
/**
|
|
139
|
+
* Export condition priority when resolving package exports.
|
|
140
|
+
*
|
|
141
|
+
* Put more specific conditions earlier when your package exports use several
|
|
142
|
+
* entries such as `types`, `import`, `node`, or `default`.
|
|
143
|
+
*/
|
|
144
|
+
conditionPriority?: string[];
|
|
145
|
+
/**
|
|
146
|
+
* File name used for generated path mapping configs.
|
|
147
|
+
*
|
|
148
|
+
* @default "tsconfig.dts.paths.generated.json"
|
|
149
|
+
*/
|
|
150
|
+
generatedFileName?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Header marker written into generated files.
|
|
153
|
+
*
|
|
154
|
+
* Limina uses this to know which files it is allowed to refresh.
|
|
155
|
+
*/
|
|
156
|
+
generatedFileMarker?: string;
|
|
157
|
+
/**
|
|
158
|
+
* Source extensions tried when replacing artifact exports with source files.
|
|
159
|
+
*/
|
|
160
|
+
sourceExtensions?: string[];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Declaration leaf boundary denied to projects with a matching Limina label.
|
|
164
|
+
*/
|
|
165
|
+
interface GraphRuleRefDenyEntry {
|
|
166
|
+
/**
|
|
167
|
+
* Target `tsconfig*.dts.json` path, relative to the inferred workspace root.
|
|
168
|
+
*/
|
|
169
|
+
path: string;
|
|
170
|
+
/**
|
|
171
|
+
* Human-readable explanation shown when the rule fails.
|
|
172
|
+
*/
|
|
173
|
+
reason: string;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Workspace package dependency denied to projects with a matching Limina label.
|
|
177
|
+
*/
|
|
178
|
+
interface GraphRuleDepDenyEntry {
|
|
179
|
+
/**
|
|
180
|
+
* Target workspace package name.
|
|
181
|
+
*
|
|
182
|
+
* @deprecated Use `workspaceDeps` for new configs.
|
|
183
|
+
*/
|
|
184
|
+
name: string;
|
|
185
|
+
/**
|
|
186
|
+
* Human-readable explanation shown when the rule fails.
|
|
187
|
+
*/
|
|
188
|
+
reason: string;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Workspace package dependency denied to projects with a matching Limina label.
|
|
192
|
+
*/
|
|
193
|
+
interface GraphRuleWorkspaceDepDenyEntry {
|
|
194
|
+
/**
|
|
195
|
+
* Target workspace package name.
|
|
196
|
+
*/
|
|
197
|
+
name: string;
|
|
198
|
+
/**
|
|
199
|
+
* Human-readable explanation shown when the rule fails.
|
|
200
|
+
*/
|
|
201
|
+
reason: string;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Node builtin denied to source files with a matching Limina label.
|
|
205
|
+
*/
|
|
206
|
+
interface GraphRuleNodeBuiltinDenyEntry {
|
|
207
|
+
/**
|
|
208
|
+
* Target Node builtin name, such as `fs`, `node:fs`, or `node:*`.
|
|
209
|
+
*/
|
|
210
|
+
name: string;
|
|
211
|
+
/**
|
|
212
|
+
* Human-readable explanation shown when the rule fails.
|
|
213
|
+
*/
|
|
214
|
+
reason: string;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Deny lists for a Limina graph label.
|
|
218
|
+
*/
|
|
219
|
+
interface GraphRuleDenyConfig {
|
|
220
|
+
/**
|
|
221
|
+
* Declaration leaf boundaries that matching projects must not reference or import.
|
|
222
|
+
*/
|
|
223
|
+
refs?: GraphRuleRefDenyEntry[];
|
|
224
|
+
/**
|
|
225
|
+
* Workspace packages that matching projects must not reference or import.
|
|
226
|
+
*
|
|
227
|
+
* @deprecated Use `workspaceDeps` for new configs.
|
|
228
|
+
*/
|
|
229
|
+
deps?: GraphRuleDepDenyEntry[];
|
|
230
|
+
/**
|
|
231
|
+
* Node builtins that matching projects must not import.
|
|
232
|
+
*/
|
|
233
|
+
nodeBuiltins?: GraphRuleNodeBuiltinDenyEntry[];
|
|
234
|
+
/**
|
|
235
|
+
* Workspace packages that matching projects must not reference or import.
|
|
236
|
+
*/
|
|
237
|
+
workspaceDeps?: GraphRuleWorkspaceDepDenyEntry[];
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Package-level graph governance rule keyed by a label declared in
|
|
241
|
+
* `tsconfig*.dts.json`.
|
|
242
|
+
*/
|
|
243
|
+
interface GraphRule {
|
|
244
|
+
/**
|
|
245
|
+
* Denied graph boundaries and workspace package dependencies.
|
|
246
|
+
*/
|
|
247
|
+
deny?: GraphRuleDenyConfig;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* TypeScript project graph policy.
|
|
251
|
+
*/
|
|
252
|
+
interface GraphConfig {
|
|
253
|
+
/**
|
|
254
|
+
* Label-based package and build-boundary access rules.
|
|
255
|
+
*
|
|
256
|
+
* A `tsconfig*.dts.json` can opt into one rule by declaring
|
|
257
|
+
* `"limina": "<label>"`.
|
|
258
|
+
*/
|
|
259
|
+
rules?: Record<string, GraphRule>;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Explicit exception for a source file that is intentionally not covered by the
|
|
263
|
+
* normal proof rules.
|
|
264
|
+
*/
|
|
265
|
+
interface ProofAllowlistEntry {
|
|
266
|
+
/**
|
|
267
|
+
* File path to allow, relative to the inferred workspace root.
|
|
268
|
+
*/
|
|
269
|
+
file: string;
|
|
270
|
+
/**
|
|
271
|
+
* Why this file is safe to exclude from normal proof coverage.
|
|
272
|
+
*/
|
|
273
|
+
reason: string;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Typecheck coverage proof settings.
|
|
277
|
+
*/
|
|
278
|
+
interface ProofConfig {
|
|
279
|
+
/**
|
|
280
|
+
* Intentional file-level exceptions.
|
|
281
|
+
*/
|
|
282
|
+
allowlist?: ProofAllowlistEntry[];
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Package check tools that can run against a built package output.
|
|
286
|
+
*/
|
|
287
|
+
type PackageCheckTool = "attw" | "boundary" | "publint";
|
|
288
|
+
/**
|
|
289
|
+
* CLI package check tool selection.
|
|
290
|
+
*/
|
|
291
|
+
type PackageCheckToolSelection = PackageCheckTool | "all";
|
|
292
|
+
/**
|
|
293
|
+
* Are The Types Wrong profile used for package type resolution checks.
|
|
294
|
+
*/
|
|
295
|
+
type PackageAttwProfile = "esm-only" | "node16" | "strict";
|
|
296
|
+
/**
|
|
297
|
+
* publint package check settings.
|
|
298
|
+
*/
|
|
299
|
+
interface PackagePublintCheckConfig {
|
|
300
|
+
/**
|
|
301
|
+
* Whether publint should run in strict mode.
|
|
302
|
+
*
|
|
303
|
+
* @default true
|
|
304
|
+
*/
|
|
305
|
+
strict?: boolean;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Are The Types Wrong package check settings.
|
|
309
|
+
*/
|
|
310
|
+
interface PackageAttwCheckConfig {
|
|
311
|
+
/**
|
|
312
|
+
* Problem profile to enforce.
|
|
313
|
+
*
|
|
314
|
+
* `esm-only` ignores CJS resolution failures for pure ESM packages.
|
|
315
|
+
*
|
|
316
|
+
* @default "esm-only"
|
|
317
|
+
*/
|
|
318
|
+
profile?: PackageAttwProfile;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Built package import boundary settings.
|
|
322
|
+
*/
|
|
323
|
+
interface PackageBoundaryCheckConfig {
|
|
324
|
+
/**
|
|
325
|
+
* Runtime environment for each emitted file.
|
|
326
|
+
*
|
|
327
|
+
* Use a string when the whole package has one environment, or a function when
|
|
328
|
+
* different files have different environments.
|
|
329
|
+
*/
|
|
330
|
+
environment?: RuntimeEnvironment | ((relativeFilePath: string) => RuntimeEnvironment);
|
|
331
|
+
/**
|
|
332
|
+
* External package imports that are intentionally allowed even when they are
|
|
333
|
+
* not listed in the built package manifest.
|
|
334
|
+
*/
|
|
335
|
+
ignoredExternalPackages?: string[];
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* One published package output to check.
|
|
339
|
+
*/
|
|
340
|
+
interface PackageCheckTarget {
|
|
341
|
+
/**
|
|
342
|
+
* Built package directory to scan, relative to the inferred workspace root.
|
|
343
|
+
*/
|
|
344
|
+
outDir: string;
|
|
345
|
+
/**
|
|
346
|
+
* Package check tools enabled for this target.
|
|
347
|
+
*
|
|
348
|
+
* @default ["publint", "attw", "boundary"]
|
|
349
|
+
*/
|
|
350
|
+
checks?: PackageCheckTool[];
|
|
351
|
+
/**
|
|
352
|
+
* publint settings for this package output.
|
|
353
|
+
*/
|
|
354
|
+
publint?: PackagePublintCheckConfig;
|
|
355
|
+
/**
|
|
356
|
+
* Are The Types Wrong settings for this package output.
|
|
357
|
+
*/
|
|
358
|
+
attw?: PackageAttwCheckConfig;
|
|
359
|
+
/**
|
|
360
|
+
* Built package import boundary settings.
|
|
361
|
+
*/
|
|
362
|
+
boundary?: PackageBoundaryCheckConfig;
|
|
363
|
+
/**
|
|
364
|
+
* Friendly target name used by CLI filters and reports.
|
|
365
|
+
*
|
|
366
|
+
* Defaults to the `outDir` path.
|
|
367
|
+
*/
|
|
368
|
+
name?: string;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Published package check settings.
|
|
372
|
+
*/
|
|
373
|
+
interface PackageChecksConfig {
|
|
374
|
+
/**
|
|
375
|
+
* Built package outputs to check.
|
|
376
|
+
*/
|
|
377
|
+
targets?: PackageCheckTarget[];
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Limina user config.
|
|
381
|
+
*/
|
|
382
|
+
interface LiminaConfig {
|
|
383
|
+
/**
|
|
384
|
+
* Shared project facts, such as checker entries and source boundary.
|
|
385
|
+
*/
|
|
386
|
+
config?: SharedLiminaConfig;
|
|
387
|
+
/**
|
|
388
|
+
* TypeScript project graph and architecture rules.
|
|
389
|
+
*/
|
|
390
|
+
graph?: GraphConfig;
|
|
391
|
+
/**
|
|
392
|
+
* Rules for checking built package outputs before publishing.
|
|
393
|
+
*/
|
|
394
|
+
packageChecks?: PackageChecksConfig;
|
|
395
|
+
/**
|
|
396
|
+
* Options for generating TypeScript source `paths` compatibility files.
|
|
397
|
+
*/
|
|
398
|
+
paths?: PathsConfig;
|
|
399
|
+
/**
|
|
400
|
+
* Named command pipelines runnable through `limina check <name>`.
|
|
401
|
+
*/
|
|
402
|
+
pipelines?: Record<string, PipelineStep[]>;
|
|
403
|
+
/**
|
|
404
|
+
* Rules that prove source files are covered by graph or checker entries.
|
|
405
|
+
*/
|
|
406
|
+
proof?: ProofConfig;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* CLI command currently loading the config.
|
|
410
|
+
*/
|
|
411
|
+
type LiminaCommand = "check" | "graph" | "package" | "paths" | "proof" | "source" | (string & {});
|
|
412
|
+
/**
|
|
413
|
+
* Environment passed to function-style configs.
|
|
414
|
+
*/
|
|
415
|
+
interface LiminaConfigEnv {
|
|
416
|
+
/**
|
|
417
|
+
* CLI command family, such as `check`, `graph`, or `paths`.
|
|
418
|
+
*/
|
|
419
|
+
command: LiminaCommand;
|
|
420
|
+
/**
|
|
421
|
+
* Mode passed through `--mode`.
|
|
422
|
+
*
|
|
423
|
+
* Defaults to `process.env.NODE_ENV`, then `default`.
|
|
424
|
+
*/
|
|
425
|
+
mode: string;
|
|
426
|
+
}
|
|
427
|
+
type LiminaConfigFnObject = (env: LiminaConfigEnv) => LiminaConfig;
|
|
428
|
+
type LiminaConfigFnPromise = (env: LiminaConfigEnv) => Promise<LiminaConfig>;
|
|
429
|
+
type LiminaConfigFn = (env: LiminaConfigEnv) => LiminaConfig | Promise<LiminaConfig>;
|
|
430
|
+
type LiminaConfigExport = LiminaConfig | Promise<LiminaConfig> | LiminaConfigFnObject | LiminaConfigFnPromise | LiminaConfigFn;
|
|
431
|
+
interface ResolvedLiminaConfig extends LiminaConfig {
|
|
432
|
+
/**
|
|
433
|
+
* Absolute path to the loaded config file.
|
|
434
|
+
*/
|
|
435
|
+
configPath: string;
|
|
436
|
+
/**
|
|
437
|
+
* Absolute workspace root inferred from `cwd` and its parent directories.
|
|
438
|
+
*/
|
|
439
|
+
rootDir: string;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Type helper for limina.config.mjs.
|
|
443
|
+
*
|
|
444
|
+
* Accepts a direct config object, a Promise, or a function that receives the
|
|
445
|
+
* current {@link LiminaConfigEnv}.
|
|
446
|
+
*/
|
|
447
|
+
declare function defineConfig(config: LiminaConfig): LiminaConfig;
|
|
448
|
+
declare function defineConfig(config: Promise<LiminaConfig>): Promise<LiminaConfig>;
|
|
449
|
+
declare function defineConfig(config: LiminaConfigFnObject): LiminaConfigFnObject;
|
|
450
|
+
declare function defineConfig(config: LiminaConfigFnPromise): LiminaConfigFnPromise;
|
|
451
|
+
declare function defineConfig(config: LiminaConfigFn): LiminaConfigFn;
|
|
452
|
+
declare function validateLiminaConfig(config: LiminaConfig): void;
|
|
453
|
+
declare function getActiveCheckers(config: LiminaConfig): ResolvedCheckerConfig[];
|
|
454
|
+
declare function getActiveCheckerExtensions(config: LiminaConfig): string[];
|
|
455
|
+
interface LoadConfigOptions {
|
|
456
|
+
/**
|
|
457
|
+
* Command family to expose to function-style configs.
|
|
458
|
+
*/
|
|
459
|
+
command?: LiminaCommand;
|
|
460
|
+
/**
|
|
461
|
+
* Config file path, resolved from `cwd`. When omitted, Limina searches for
|
|
462
|
+
* the nearest `limina.config.mjs` from `cwd` upward to the inferred pnpm
|
|
463
|
+
* workspace root.
|
|
464
|
+
*
|
|
465
|
+
* @default nearest "limina.config.mjs" in `cwd` or workspace parents
|
|
466
|
+
*/
|
|
467
|
+
configPath?: string;
|
|
468
|
+
/**
|
|
469
|
+
* Directory used to resolve `configPath`.
|
|
470
|
+
*
|
|
471
|
+
* @default process.cwd()
|
|
472
|
+
*/
|
|
473
|
+
cwd?: string;
|
|
474
|
+
/**
|
|
475
|
+
* Mode exposed to function-style configs.
|
|
476
|
+
*
|
|
477
|
+
* @default process.env.NODE_ENV ?? "default"
|
|
478
|
+
*/
|
|
479
|
+
mode?: string;
|
|
480
|
+
}
|
|
481
|
+
declare function loadConfig(options?: LoadConfigOptions): Promise<ResolvedLiminaConfig>;
|
|
482
|
+
//#endregion
|
|
483
|
+
export { BuiltinCheckerPreset, BuiltinTaskName, CheckerConfig, CheckerExecutionKind, CheckerPreset, GraphConfig, GraphRule, GraphRuleDenyConfig, GraphRuleDepDenyEntry, GraphRuleNodeBuiltinDenyEntry, GraphRuleRefDenyEntry, GraphRuleWorkspaceDepDenyEntry, LiminaCommand, LiminaConfig, LiminaConfigEnv, LiminaConfigExport, LiminaConfigFn, LiminaConfigFnObject, LiminaConfigFnPromise, LoadConfigOptions, PackageAttwCheckConfig, PackageAttwProfile, PackageBoundaryCheckConfig, PackageCheckTarget, PackageCheckTool, PackageCheckToolSelection, PackageChecksConfig, PackagePublintCheckConfig, PathsConfig, PipelineStep, ProofAllowlistEntry, ProofConfig, ResolvedCheckerConfig, ResolvedLiminaConfig, RuntimeEnvironment, SharedLiminaConfig, SourceBoundaryConfig, defineConfig, getActiveCheckerExtensions, getActiveCheckers, loadConfig, validateLiminaConfig };
|
package/config.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "./chunks/dep-lkQg1P9Q.js";
|
|
2
|
+
import { a as validateLiminaConfig, i as loadConfig, n as getActiveCheckerExtensions, r as getActiveCheckers, t as defineConfig } from "./chunks/dep-jgc7X0zw.js";
|
|
3
|
+
|
|
4
|
+
export { defineConfig, getActiveCheckerExtensions, getActiveCheckers, loadConfig, validateLiminaConfig };
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { BuiltinCheckerPreset, BuiltinTaskName, CheckerConfig, CheckerExecutionKind, CheckerPreset, GraphConfig, GraphRule, GraphRuleDenyConfig, GraphRuleDepDenyEntry, GraphRuleNodeBuiltinDenyEntry, GraphRuleRefDenyEntry, GraphRuleWorkspaceDepDenyEntry, LiminaCommand, LiminaConfig, LiminaConfigEnv, LiminaConfigExport, LiminaConfigFn, LiminaConfigFnObject, LiminaConfigFnPromise, LoadConfigOptions, PackageAttwCheckConfig, PackageAttwProfile, PackageBoundaryCheckConfig, PackageCheckTarget, PackageCheckTool, PackageCheckToolSelection, PackageChecksConfig, PackagePublintCheckConfig, PathsConfig, PipelineStep, ProofAllowlistEntry, ProofConfig, ResolvedCheckerConfig, ResolvedLiminaConfig, RuntimeEnvironment, SharedLiminaConfig, SourceBoundaryConfig, 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;
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/commands/source.d.ts
|
|
66
|
+
interface RunSourceCheckOptions {
|
|
67
|
+
clearScreen?: boolean;
|
|
68
|
+
flow?: LiminaFlowReporter;
|
|
69
|
+
flowDepth?: number;
|
|
70
|
+
}
|
|
71
|
+
declare function runSourceCheck(config: ResolvedLiminaConfig, options?: RunSourceCheckOptions): Promise<boolean>;
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/checkers.d.ts
|
|
74
|
+
type CheckerPackageResolver = (options: {
|
|
75
|
+
packageName: string;
|
|
76
|
+
projectRootDir: string;
|
|
77
|
+
}) => string | undefined;
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/commands/typecheck.d.ts
|
|
80
|
+
interface TypecheckTarget {
|
|
81
|
+
args: string[];
|
|
82
|
+
checkerName?: string;
|
|
83
|
+
configPath: string;
|
|
84
|
+
cwd: string;
|
|
85
|
+
command: string;
|
|
86
|
+
executionKind?: CheckerExecutionKind;
|
|
87
|
+
label?: string;
|
|
88
|
+
}
|
|
89
|
+
interface TypecheckTargetResult {
|
|
90
|
+
configPath: string;
|
|
91
|
+
error?: Error;
|
|
92
|
+
status: number;
|
|
93
|
+
}
|
|
94
|
+
type TypecheckRunner = (target: TypecheckTarget) => Promise<TypecheckTargetResult> | TypecheckTargetResult;
|
|
95
|
+
interface RunCheckerTypecheckOptions {
|
|
96
|
+
clearScreen?: boolean;
|
|
97
|
+
config: ResolvedLiminaConfig;
|
|
98
|
+
concurrency?: number;
|
|
99
|
+
cwd?: string;
|
|
100
|
+
flow?: LiminaFlowReporter;
|
|
101
|
+
flowDepth?: number;
|
|
102
|
+
checkerPackageResolver?: CheckerPackageResolver;
|
|
103
|
+
runner?: TypecheckRunner;
|
|
104
|
+
tscCommand?: string;
|
|
105
|
+
}
|
|
106
|
+
interface RunCheckerTypecheckResult {
|
|
107
|
+
passed: boolean;
|
|
108
|
+
projectRootDir: string;
|
|
109
|
+
results: TypecheckTargetResult[];
|
|
110
|
+
rootConfigPaths: string[];
|
|
111
|
+
targetProjectPaths: string[];
|
|
112
|
+
}
|
|
113
|
+
declare function runCheckerTypecheck(options: RunCheckerTypecheckOptions): Promise<RunCheckerTypecheckResult>;
|
|
114
|
+
interface RunCheckerBuildOptions {
|
|
115
|
+
clearScreen?: boolean;
|
|
116
|
+
config: ResolvedLiminaConfig;
|
|
117
|
+
cwd?: string;
|
|
118
|
+
flow?: LiminaFlowReporter;
|
|
119
|
+
flowDepth?: number;
|
|
120
|
+
checkerPackageResolver?: CheckerPackageResolver;
|
|
121
|
+
runner?: TypecheckRunner;
|
|
122
|
+
tscCommand?: string;
|
|
123
|
+
}
|
|
124
|
+
interface RunCheckerBuildResult {
|
|
125
|
+
passed: boolean;
|
|
126
|
+
projectRootDir: string;
|
|
127
|
+
rootConfigPaths: string[];
|
|
128
|
+
}
|
|
129
|
+
declare function runCheckerBuild(options: RunCheckerBuildOptions): Promise<RunCheckerBuildResult>;
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/tsconfig.d.ts
|
|
132
|
+
interface CollectTypecheckTargetProjectPathsOptions {
|
|
133
|
+
rootConfigPath: string;
|
|
134
|
+
rootDir: string;
|
|
135
|
+
}
|
|
136
|
+
interface CollectTypecheckTargetProjectPathsResult {
|
|
137
|
+
problems: string[];
|
|
138
|
+
projectPaths: string[];
|
|
139
|
+
targetProjectPaths: string[];
|
|
140
|
+
}
|
|
141
|
+
declare function isOrdinaryTypecheckConfigPath(configPath: string): boolean;
|
|
142
|
+
declare function collectTypecheckTargetProjectPaths(options: CollectTypecheckTargetProjectPathsOptions): CollectTypecheckTargetProjectPathsResult;
|
|
143
|
+
//#endregion
|
|
144
|
+
export { type BuiltinCheckerPreset, type BuiltinTaskName, type CheckerConfig, type CheckerExecutionKind, type CheckerPreset, type CollectTypecheckTargetProjectPathsOptions, type CollectTypecheckTargetProjectPathsResult, type GraphConfig, type GraphRule, type GraphRuleDenyConfig, type GraphRuleDepDenyEntry, type GraphRuleNodeBuiltinDenyEntry, type GraphRuleRefDenyEntry, type GraphRuleWorkspaceDepDenyEntry, 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 PackageAttwProfile, type PackageBoundaryCheckConfig, type PackageCheckTarget, type PackageCheckTool, type PackageCheckToolSelection, type PackageChecksConfig, type PackagePublintCheckConfig, type PathsConfig, type PipelineStep, type ProofAllowlistEntry, type ProofConfig, type ResolvedCheckerConfig, type ResolvedLiminaConfig, type RunCheckerBuildOptions, type RunCheckerBuildResult, type RunCheckerTypecheckOptions, type RunCheckerTypecheckResult, type RunSourceCheckOptions, type RuntimeEnvironment, type SharedLiminaConfig, type SourceBoundaryConfig, type TypecheckRunner, type TypecheckTarget, type TypecheckTargetResult, collectTypecheckTargetProjectPaths, createLiminaFlowReporter, defineConfig, getActiveCheckerExtensions, getActiveCheckers, isOrdinaryTypecheckConfigPath, loadConfig, runCheckerBuild, runCheckerTypecheck, runSourceCheck, validateLiminaConfig };
|
package/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "./chunks/dep-lkQg1P9Q.js";
|
|
2
|
+
import { a as validateLiminaConfig, i as loadConfig, n as getActiveCheckerExtensions, r as getActiveCheckers, t as defineConfig } from "./chunks/dep-jgc7X0zw.js";
|
|
3
|
+
import { G as isOrdinaryTypecheckConfigPath, R as collectTypecheckTargetProjectPaths, a as runSourceCheck, i as runCheckerTypecheck, n as createLiminaFlowReporter, r as runCheckerBuild, t as LiminaFlowReporter } from "./chunks/dep-DoSHsBSP.js";
|
|
4
|
+
|
|
5
|
+
export { LiminaFlowReporter, collectTypecheckTargetProjectPaths, createLiminaFlowReporter, defineConfig, getActiveCheckerExtensions, getActiveCheckers, isOrdinaryTypecheckConfigPath, loadConfig, runCheckerBuild, runCheckerTypecheck, runSourceCheck, validateLiminaConfig };
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "limina",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Senao Xi",
|
|
7
|
+
"description": "Configurable monorepo architecture and TypeScript graph governance CLI",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"monorepo",
|
|
10
|
+
"typescript",
|
|
11
|
+
"project-references",
|
|
12
|
+
"workspace",
|
|
13
|
+
"architecture"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
17
|
+
},
|
|
18
|
+
"bin": {
|
|
19
|
+
"limina": "./bin/limina.js"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@arethetypeswrong/core": "^0.18.2",
|
|
23
|
+
"@clack/prompts": "^1.4.0",
|
|
24
|
+
"@docs-islands/logger": "0.0.5",
|
|
25
|
+
"@publint/pack": "^0.1.4",
|
|
26
|
+
"cac": "^6.7.14",
|
|
27
|
+
"es-module-lexer": "^2.0.0",
|
|
28
|
+
"publint": "^0.3.17",
|
|
29
|
+
"tinyglobby": "^0.2.15",
|
|
30
|
+
"yaml": "^2.8.3",
|
|
31
|
+
"zod": "^4.3.6"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"svelte-check": "^4.4.7",
|
|
35
|
+
"typescript": "~5.9.3",
|
|
36
|
+
"vue-tsc": "~3.2.4"
|
|
37
|
+
},
|
|
38
|
+
"peerDependenciesMeta": {
|
|
39
|
+
"svelte-check": {
|
|
40
|
+
"optional": true
|
|
41
|
+
},
|
|
42
|
+
"typescript": {
|
|
43
|
+
"optional": true
|
|
44
|
+
},
|
|
45
|
+
"vue-tsc": {
|
|
46
|
+
"optional": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"types": "./index.d.ts",
|
|
50
|
+
"exports": {
|
|
51
|
+
".": "./index.js",
|
|
52
|
+
"./config": "./config.js",
|
|
53
|
+
"./package.json": "./package.json"
|
|
54
|
+
},
|
|
55
|
+
"sideEffects": false
|
|
56
|
+
}
|