@icebreakers/monorepo 5.6.0 → 5.7.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.
Files changed (50) hide show
  1. package/README.md +2 -0
  2. package/dist/baseline-CRCTiMNM.mjs +146 -0
  3. package/dist/bundle-B9vRch4R.mjs +49 -0
  4. package/dist/catalog-D0Sk385O.mjs +299 -0
  5. package/dist/cli.mjs +1487 -156
  6. package/dist/commands-Bj0sX3R9.mjs +13849 -0
  7. package/dist/config-Dg-voj8q.mjs +66 -0
  8. package/dist/{create-flow-CXRhfGbb.mjs → create-flow-BWFWDWR4.mjs} +90 -24
  9. package/dist/deps-BbykICqB.mjs +47 -0
  10. package/dist/execute-D2GlX018.mjs +68 -0
  11. package/dist/execute-DI1mgVLv.mjs +663 -0
  12. package/dist/format-Dbs0fupU.mjs +28 -0
  13. package/dist/index-CoCTFWZJ.d.mts +2150 -0
  14. package/dist/index.d.mts +1738 -112
  15. package/dist/index.mjs +60 -7
  16. package/dist/inputs-BKtLcrQ9.mjs +50 -0
  17. package/dist/npm-Bh6HBy5V.mjs +82 -0
  18. package/dist/plan-CxySMaLN.mjs +75 -0
  19. package/dist/run-D_bceMqf.mjs +165 -0
  20. package/dist/save-DzIWKs0T.mjs +79 -0
  21. package/dist/scan-B_-E6BWh.mjs +293 -0
  22. package/dist/template-drift-D0hKxixr.mjs +2740 -0
  23. package/dist/tooling-entry.d.mts +1 -1
  24. package/dist/tooling-entry.mjs +2 -2
  25. package/dist/transaction-DFam8_dp.mjs +168 -0
  26. package/dist/tsconfig-BZ6E1fBA.mjs +1483 -0
  27. package/dist/{vitest-Blzbh8xZ.mjs → vitest-XbNmiloj.mjs} +1 -1
  28. package/dist/workspace-tasks-C5W-QwWj.mjs +4435 -0
  29. package/package.json +22 -4
  30. package/resources/api-report/runner.cjs +76 -0
  31. package/resources/devcontainer/setup.mjs +36 -0
  32. package/resources/knip/reporter.mjs +46 -0
  33. package/resources/maintenance/migration-lanes.mjs +141 -0
  34. package/resources/maintenance/migration-lock.mjs +119 -0
  35. package/resources/maintenance/migrations.mjs +215 -0
  36. package/resources/maintenance/presets.mjs +130 -0
  37. package/resources/maintenance/validate.mjs +233 -0
  38. package/resources/maintenance/workflow.yml +151 -0
  39. package/resources/skills/repoctl/SKILL.md +2 -0
  40. package/resources/skills/repoctl/references/commands.md +224 -13
  41. package/resources/skills/repoctl/references/config.md +70 -6
  42. package/resources/skills/repoctl/references/dependencies.md +37 -0
  43. package/resources/skills/repoctl/references/knip.md +34 -0
  44. package/resources/skills/repoctl/references/templates.md +23 -0
  45. package/dist/commands-D4xZQ5t-.mjs +0 -5685
  46. package/dist/config-p842Knhq.mjs +0 -114
  47. package/dist/index-Bl_PB2Ch.d.mts +0 -1039
  48. package/dist/tsconfig-BrjI_5yI.mjs +0 -75
  49. package/dist/types-MAUIQpfp.mjs +0 -499
  50. package/dist/workspace-MCKewElu.mjs +0 -123
@@ -1,114 +0,0 @@
1
- import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
2
- import path from "pathe";
3
- import { realpath } from "node:fs/promises";
4
- import fs from "node:fs";
5
- import { loadConfig } from "c12";
6
- //#region src/core/config.ts
7
- var config_exports = /* @__PURE__ */ __exportAll({
8
- configExtensions: () => configExtensions,
9
- defineMonorepoConfig: () => defineMonorepoConfig,
10
- getRepoctlConfigCandidates: () => getRepoctlConfigCandidates,
11
- loadMonorepoConfig: () => loadMonorepoConfig,
12
- loadMonorepoConfigDetails: () => loadMonorepoConfigDetails,
13
- resolveCommandConfig: () => resolveCommandConfig,
14
- resolveToolingConfig: () => resolveToolingConfig
15
- });
16
- /**
17
- * 简单的内存缓存,避免同一次命令中重复走磁盘加载配置。
18
- */
19
- const cache = /* @__PURE__ */ new Map();
20
- const configExtensions = [
21
- "ts",
22
- "mts",
23
- "cts",
24
- "js",
25
- "mjs",
26
- "cjs"
27
- ];
28
- function getRepoctlConfigCandidates(cwd) {
29
- return configExtensions.map((ext) => path.resolve(cwd, `repoctl.config.${ext}`));
30
- }
31
- function findConfigFiles(cwd) {
32
- return getRepoctlConfigCandidates(cwd).filter((file) => fs.existsSync(file));
33
- }
34
- /**
35
- * 基于 c12 的通用配置加载逻辑,支持多种配置文件格式。
36
- */
37
- async function loadConfigInternal(cwd) {
38
- const { config, configFile } = await loadConfig({
39
- name: "repoctl",
40
- cwd,
41
- rcFile: false,
42
- defaults: {},
43
- globalRc: false,
44
- packageJson: false
45
- });
46
- const matchedConfigFile = configFile && fs.existsSync(configFile) ? findConfigFiles(cwd).find((file) => path.basename(file).toLowerCase() === path.basename(configFile).toLowerCase()) : void 0;
47
- return {
48
- file: matchedConfigFile ? await realpath(matchedConfigFile) : configFile && fs.existsSync(configFile) ? await realpath(configFile) : null,
49
- config: config ?? {}
50
- };
51
- }
52
- /**
53
- * 为 `repoctl.config.ts` 提供类型提示的辅助函数。
54
- *
55
- * 推荐在用户项目中这样写:
56
- *
57
- * @example
58
- * ```ts
59
- * import { defineMonorepoConfig } from 'repoctl'
60
- *
61
- * export default defineMonorepoConfig({
62
- * tooling: {
63
- * vitest: {
64
- * includeWorkspaceRootConfig: false,
65
- * },
66
- * },
67
- * })
68
- * ```
69
- */
70
- function defineMonorepoConfig(config) {
71
- return config;
72
- }
73
- /**
74
- * 加载配置对象和实际命中的配置文件路径,供诊断和脚本集成使用。
75
- *
76
- * @param cwd 配置文件解析起点
77
- * @returns 配置文件路径和解析后的配置对象;未找到时 file 为 null、config 为空对象
78
- */
79
- async function loadMonorepoConfigDetails(cwd) {
80
- const key = path.resolve(cwd);
81
- if (!cache.has(key)) cache.set(key, loadConfigInternal(key));
82
- return cache.get(key);
83
- }
84
- /**
85
- * 加载指定目录的 `repoctl.config.*`,并在当前进程内做内存缓存。
86
- *
87
- * @param cwd 配置文件解析起点
88
- * @returns 解析后的配置对象;未找到时返回空对象
89
- */
90
- async function loadMonorepoConfig(cwd) {
91
- const { config } = await loadMonorepoConfigDetails(cwd);
92
- return config;
93
- }
94
- /**
95
- * 获取单个命令对应的配置块。
96
- *
97
- * @param name 命令名称,对应 `repoctl.config.ts -> commands.<name>`
98
- * @param cwd 配置文件解析起点
99
- * @returns 对应命令配置;未配置时返回空对象
100
- */
101
- async function resolveCommandConfig(name, cwd) {
102
- return ((await loadMonorepoConfig(cwd)).commands ?? {})[name] ?? {};
103
- }
104
- /**
105
- * 获取 `repoctl.config.ts` 中完整的 `tooling` 配置块。
106
- *
107
- * @param cwd 配置文件解析起点
108
- * @returns `tooling` 配置;未配置时返回空对象
109
- */
110
- async function resolveToolingConfig(cwd) {
111
- return (await loadMonorepoConfig(cwd)).tooling ?? {};
112
- }
113
- //#endregion
114
- export { loadMonorepoConfig as a, resolveToolingConfig as c, getRepoctlConfigCandidates as i, config_exports as n, loadMonorepoConfigDetails as o, defineMonorepoConfig as r, resolveCommandConfig as s, configExtensions as t };