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.
package/README.md CHANGED
@@ -1,30 +1,36 @@
1
1
  # limina
2
2
 
3
3
  <p align="center">
4
- <a href="https://docs.senao.me/docs-islands/limina" target="_blank" rel="noopener noreferrer">
4
+ <a href="https://docs.senao.me/docs-islands/limina/" target="_blank" rel="noopener noreferrer">
5
5
  <img width="180" src="https://docs.senao.me/docs-islands/limina/logo.svg" alt="limina logo">
6
6
  </a>
7
7
  </p>
8
+
8
9
  <p align="center">
9
10
  <a href="https://npmjs.com/package/limina"><img src="https://img.shields.io/npm/v/limina.svg" alt="npm package"></a>
10
11
  <a href="https://nodejs.org/en/about/previous-releases"><img src="https://img.shields.io/node/v/limina.svg" alt="node compatibility"></a>
11
- <a href="https://github.com/XiSenao/docs-islands/actions/workflows/ci.yml"><img src="https://github.com/XiSenao/docs-islands/actions/workflows/ci.yml/badge.svg?branch=main" alt="build status"></a>
12
- <a href="https://github.com/XiSenao/docs-islands/blob/main/packages/limina/LICENSE.md"><img src="https://img.shields.io/npm/l/limina.svg" alt="license"></a>
12
+ <a href="https://github.com/senaoxi/docs-islands/blob/main/packages/limina/LICENSE.md"><img src="https://img.shields.io/npm/l/limina.svg" alt="license"></a>
13
13
  </p>
14
14
 
15
15
  English | [简体中文](./README.zh-CN.md)
16
16
 
17
- > Architecture governance CLI for TypeScript monorepos
17
+ > Architecture governance for TypeScript monorepos.
18
+
19
+ Start with incremental type builds, then progressively enable architecture governance.
20
+
21
+ Limina is designed for large TypeScript monorepos where project references, source boundaries, check coverage, and release artifacts can drift over time. It builds on existing TypeScript configuration and source dependency relationships to generate reusable type-build configuration, then adds checks for dependency graphs, source boundaries, coverage, and release readiness.
22
+
23
+ ## What Limina does
18
24
 
19
- - Keep source dependency graphs aligned with type build graphs
20
- - Guard package, runtime, and workspace boundaries
21
- - Cover TypeScript and framework-specific checkers
22
- - Manage compatibility paths for workspace source dependencies
23
- - Validate package outputs before release
24
- - Compose checks for local development, CI, and publishing
25
+ - Adopts incremental type builds by generating reusable build configuration and deriving a build order from source dependencies.
26
+ - Governs the dependency graph by checking project references, access boundaries, and dependency declarations.
27
+ - Protects source boundaries by detecting cross-package relative imports, unauthorized imports, missing dependency declarations, and source ownership issues.
28
+ - Verifies check coverage by finding source files that are uncovered, covered more than once, or covered by a scope that does not match the source boundary.
29
+ - Composes check pipelines for local development, CI, and release workflows, with independent tasks running concurrently when dependencies allow.
30
+ - Adds release checks for package metadata, type entry points, build output, and packed package contents.
25
31
 
26
- Limina helps teams turn drifting TypeScript monorepo constraints into explicit, reviewable, runnable checks. It keeps source relationships, type coverage, build coordination, package metadata, and publishable outputs aligned across everyday development, code review, and pre-release workflows.
32
+ ## Non-goals
27
33
 
28
- Limina is not a bundler, test runner, or release tool, and it does not replace TypeScript or framework checkers. It runs those existing tools and verifies that the monorepo structure they rely on is still trustworthy.
34
+ Limina is not a bundler, a test framework, or a publishing tool. It does not replace TypeScript or framework-specific checkers. Instead, it runs alongside existing tools and verifies that the monorepo structure they depend on remains consistent and reviewable.
29
35
 
30
36
  [Read the Docs to Learn More](https://docs.senao.me/docs-islands/limina/)
package/README.zh-CN.md CHANGED
@@ -5,26 +5,32 @@
5
5
  <img width="180" src="https://docs.senao.me/docs-islands/limina/logo.svg" alt="limina logo">
6
6
  </a>
7
7
  </p>
8
+
8
9
  <p align="center">
9
10
  <a href="https://npmjs.com/package/limina"><img src="https://img.shields.io/npm/v/limina.svg" alt="npm package"></a>
10
11
  <a href="https://nodejs.org/en/about/previous-releases"><img src="https://img.shields.io/node/v/limina.svg" alt="node compatibility"></a>
11
- <a href="https://github.com/XiSenao/docs-islands/actions/workflows/ci.yml"><img src="https://github.com/XiSenao/docs-islands/actions/workflows/ci.yml/badge.svg?branch=main" alt="build status"></a>
12
- <a href="https://github.com/XiSenao/docs-islands/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/limina.svg" alt="license"></a>
12
+ <a href="https://github.com/senaoxi/docs-islands/blob/main/packages/limina/LICENSE.md"><img src="https://img.shields.io/npm/l/limina.svg" alt="license"></a>
13
13
  </p>
14
14
 
15
15
  [English](./README.md) | 简体中文
16
16
 
17
- > TypeScript monorepo 的架构治理 CLI
17
+ > TypeScript 单体仓库架构治理工具。
18
+
19
+ 先接入增量构建,再逐步打开架构治理。
20
+
21
+ Limina 面向大型 TypeScript monorepo,帮助团队把容易漂移的工程约束变成显式、可审查、可运行的检查。它基于现有 TypeScript 配置和源码依赖关系生成可复用的类型构建配置,并逐步覆盖依赖图、源码边界、检查覆盖和发布前校验。
22
+
23
+ ## 能力概览
18
24
 
19
- - 保持源码依赖图与类型构建图一致
20
- - 守住 package、运行时与工程边界
21
- - 覆盖 TypeScript 与框架专属 checker
22
- - 管理 workspace 源码依赖的兼容路径
23
- - 验证发布前 package 产物
24
- - 组合适合本地、CI 与发布流程的检查
25
+ - 接入增量类型构建,生成可复用的构建配置并安排合理的构建顺序。
26
+ - 治理项目依赖图,检查项目引用、访问边界和依赖声明是否一致。
27
+ - 保护源码边界,发现跨包相对导入、未授权导入、漏写依赖和源码归属问题。
28
+ - 确认检查覆盖,找出未覆盖、重复覆盖或检查范围不一致的源码文件。
29
+ - 编排检查流程,将构建、依赖图、源码边界和检查覆盖组合进本地开发、CI 或发布流程。
30
+ - 补充发布前检查,验证 package metadata、类型入口、发布产物和打包内容。
25
31
 
26
- Limina 帮助团队把 TypeScript monorepo 中容易漂移的工程约束变成显式、可审查、可运行的检查。它让源码关系、类型覆盖、构建协作、package metadata 和发布产物保持一致,适合放进日常开发、代码审查和发布前流程。
32
+ ## Limina 不是什么
27
33
 
28
- Limina 不是 bundler、测试框架或发布工具,也不会替代 TypeScript / framework checker。它调用这些已有工具,并验证它们依赖的 monorepo 结构是否仍然可靠。
34
+ Limina 不是 bundler、测试框架或发布工具,也不会替代 TypeScript 或框架专属 checker。它调用已有工具,并验证这些工具依赖的 monorepo 结构是否仍然可靠。
29
35
 
30
36
  [阅读文档了解更多](https://docs.senao.me/docs-islands/limina/zh/)
package/bin/limina.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { spawnSync } from 'node:child_process';
3
3
  import { existsSync } from 'node:fs';
4
+ import path from 'node:path';
4
5
  import { fileURLToPath, pathToFileURL } from 'node:url';
5
- import path from 'pathe';
6
6
 
7
7
  const packageDir = path.resolve(fileURLToPath(new URL('..', import.meta.url)));
8
8
  const distCliPath = path.join(packageDir, 'cli.js');
@@ -30,7 +30,8 @@ if (existsSync(sourceCliPath)) {
30
30
 
31
31
  process.exit(result.status ?? 1);
32
32
  } else if (existsSync(distCliPath)) {
33
- await import(pathToFileURL(distCliPath).href);
33
+ const { runCli } = await import(pathToFileURL(distCliPath).href);
34
+ await runCli(process.argv);
34
35
  } else {
35
36
  throw new Error(`Unable to find limina CLI entry. Expected ${distCliPath}.`);
36
37
  }
@@ -0,0 +1,114 @@
1
+ import { createRequire } from "node:module";
2
+
3
+ //#region \0rolldown/runtime.js
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
11
+ var __exportAll = (all, no_symbols) => {
12
+ let target = {};
13
+ for (var name in all) {
14
+ __defProp(target, name, {
15
+ get: all[name],
16
+ enumerable: true
17
+ });
18
+ }
19
+ if (!no_symbols) {
20
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
21
+ }
22
+ return target;
23
+ };
24
+ var __copyProps = (to, from, except, desc) => {
25
+ if (from && typeof from === "object" || typeof from === "function") {
26
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
27
+ key = keys[i];
28
+ if (!__hasOwnProp.call(to, key) && key !== except) {
29
+ __defProp(to, key, {
30
+ get: ((k) => from[k]).bind(null, key),
31
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
32
+ });
33
+ }
34
+ }
35
+ }
36
+ return to;
37
+ };
38
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
39
+ value: mod,
40
+ enumerable: true
41
+ }) : target, mod));
42
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
43
+
44
+ //#endregion
45
+ //#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
46
+ var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
47
+ let p = process || {}, argv = p.argv || [], env = p.env || {};
48
+ let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
49
+ let formatter = (open, close, replace = open) => (input) => {
50
+ let string = "" + input, index = string.indexOf(close, open.length);
51
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
52
+ };
53
+ let replaceClose = (string, close, replace, index) => {
54
+ let result = "", cursor = 0;
55
+ do {
56
+ result += string.substring(cursor, index) + replace;
57
+ cursor = index + close.length;
58
+ index = string.indexOf(close, cursor);
59
+ } while (~index);
60
+ return result + string.substring(cursor);
61
+ };
62
+ let createColors = (enabled = isColorSupported) => {
63
+ let f = enabled ? formatter : () => String;
64
+ return {
65
+ isColorSupported: enabled,
66
+ reset: f("\x1B[0m", "\x1B[0m"),
67
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
68
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
69
+ italic: f("\x1B[3m", "\x1B[23m"),
70
+ underline: f("\x1B[4m", "\x1B[24m"),
71
+ inverse: f("\x1B[7m", "\x1B[27m"),
72
+ hidden: f("\x1B[8m", "\x1B[28m"),
73
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
74
+ black: f("\x1B[30m", "\x1B[39m"),
75
+ red: f("\x1B[31m", "\x1B[39m"),
76
+ green: f("\x1B[32m", "\x1B[39m"),
77
+ yellow: f("\x1B[33m", "\x1B[39m"),
78
+ blue: f("\x1B[34m", "\x1B[39m"),
79
+ magenta: f("\x1B[35m", "\x1B[39m"),
80
+ cyan: f("\x1B[36m", "\x1B[39m"),
81
+ white: f("\x1B[37m", "\x1B[39m"),
82
+ gray: f("\x1B[90m", "\x1B[39m"),
83
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
84
+ bgRed: f("\x1B[41m", "\x1B[49m"),
85
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
86
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
87
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
88
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
89
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
90
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
91
+ blackBright: f("\x1B[90m", "\x1B[39m"),
92
+ redBright: f("\x1B[91m", "\x1B[39m"),
93
+ greenBright: f("\x1B[92m", "\x1B[39m"),
94
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
95
+ blueBright: f("\x1B[94m", "\x1B[39m"),
96
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
97
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
98
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
99
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
100
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
101
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
102
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
103
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
104
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
105
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
106
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
107
+ };
108
+ };
109
+ module.exports = createColors();
110
+ module.exports.createColors = createColors;
111
+ }));
112
+
113
+ //#endregion
114
+ export { __toESM as a, __require as i, __commonJSMin as n, __exportAll as r, require_picocolors as t };