@icebreakers/monorepo 5.5.10 → 5.6.0
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/dist/cli.mjs +33 -33
- package/dist/{commands-CIzCAxyY.mjs → commands-D4xZQ5t-.mjs} +83 -70
- package/dist/{create-flow-C811m80z.mjs → create-flow-CXRhfGbb.mjs} +16 -19
- package/dist/{index-DDQKKYet.d.mts → index-Bl_PB2Ch.d.mts} +54 -40
- package/dist/index.d.mts +15 -11
- package/dist/index.mjs +4 -3
- package/dist/tooling-entry.d.mts +1 -1
- package/dist/tooling-entry.mjs +2 -1
- package/dist/tsconfig-BrjI_5yI.mjs +75 -0
- package/dist/{types-m8JLwKzl.mjs → types-MAUIQpfp.mjs} +2 -2
- package/dist/{tooling-BfXlmCi-.mjs → vitest-Blzbh8xZ.mjs} +108 -167
- package/package.json +5 -5
- package/resources/skills/repoctl/SKILL.md +2 -2
- package/resources/skills/repoctl/references/templates.md +3 -2
|
@@ -120,6 +120,10 @@ declare const templateMap: {
|
|
|
120
120
|
readonly source: "cli";
|
|
121
121
|
readonly target: "apps/cli";
|
|
122
122
|
};
|
|
123
|
+
readonly nimbus: {
|
|
124
|
+
readonly source: "nimbus";
|
|
125
|
+
readonly target: "apps/docs";
|
|
126
|
+
};
|
|
123
127
|
};
|
|
124
128
|
type CreateNewProjectType = keyof typeof templateMap;
|
|
125
129
|
interface CreateNewProjectOptions {
|
|
@@ -682,7 +686,7 @@ interface MonorepoConfig {
|
|
|
682
686
|
tooling?: ToolingConfig;
|
|
683
687
|
}
|
|
684
688
|
//#endregion
|
|
685
|
-
//#region src/tooling/
|
|
689
|
+
//#region src/tooling/types.d.ts
|
|
686
690
|
/**
|
|
687
691
|
* `commitlint.config.*` 最终导出的配置类型。
|
|
688
692
|
*
|
|
@@ -789,21 +793,40 @@ interface DefineVitestProjectConfigOptions {
|
|
|
789
793
|
cwd?: string;
|
|
790
794
|
options?: MonorepoVitestProjectConfigOptions;
|
|
791
795
|
}
|
|
796
|
+
//#endregion
|
|
797
|
+
//#region src/tooling/lint-staged.d.ts
|
|
792
798
|
/**
|
|
793
|
-
*
|
|
799
|
+
* 创建适用于当前仓库约定的 `lint-staged` 配置。
|
|
794
800
|
*
|
|
795
|
-
*
|
|
796
|
-
*
|
|
801
|
+
* 默认行为:
|
|
802
|
+
* - `*.{js,jsx,mjs,ts,tsx,mts,cts}` 运行 `eslint --fix`
|
|
803
|
+
* - `*.vue` 同时运行 `eslint --fix` 与 `stylelint --fix --allow-empty-input`
|
|
804
|
+
* - TypeScript/Vue files and workspace `package.json` files share one
|
|
805
|
+
* `pnpm exec repo verify staged-typecheck` task to avoid concurrent builds
|
|
806
|
+
* - 样式文件运行 `stylelint --fix --allow-empty-input`
|
|
807
|
+
*
|
|
808
|
+
* @param options 可配置 `repoCommand`,默认值为 `pnpm exec repo`
|
|
809
|
+
* @returns 可直接导出的 `lint-staged` 配置对象
|
|
797
810
|
*
|
|
798
811
|
* @example
|
|
799
|
-
* ```
|
|
800
|
-
* import {
|
|
812
|
+
* ```js
|
|
813
|
+
* import { createMonorepoLintStagedConfig } from 'repoctl/tooling'
|
|
801
814
|
*
|
|
802
|
-
*
|
|
803
|
-
*
|
|
815
|
+
* export default createMonorepoLintStagedConfig({
|
|
816
|
+
* repoCommand: 'pnpm exec repo',
|
|
817
|
+
* })
|
|
804
818
|
* ```
|
|
805
819
|
*/
|
|
806
|
-
declare function
|
|
820
|
+
declare function createMonorepoLintStagedConfig(options?: MonorepoLintStagedConfigOptions): MonorepoLintStagedConfig;
|
|
821
|
+
/**
|
|
822
|
+
* 从 `repoctl.config.ts` 读取 `tooling.lintStaged`,并生成 `lint-staged` 配置。
|
|
823
|
+
*
|
|
824
|
+
* @param input `cwd` 用于指定配置文件解析起点,`options` 用于追加运行时覆盖项
|
|
825
|
+
* @returns 可直接导出的 `lint-staged` 配置对象
|
|
826
|
+
*/
|
|
827
|
+
declare function defineLintStagedConfig(input?: DefineConfigOptions<MonorepoLintStagedConfigOptions>): Promise<MonorepoLintStagedConfig>;
|
|
828
|
+
//#endregion
|
|
829
|
+
//#region src/tooling/linters.d.ts
|
|
807
830
|
/**
|
|
808
831
|
* 基于 `@icebreakers/commitlint-config` 创建 commitlint 配置。
|
|
809
832
|
*
|
|
@@ -890,6 +913,25 @@ declare function createMonorepoStylelintConfig(options?: StylelintToolingConfig)
|
|
|
890
913
|
* @returns 可直接导出的 Stylelint 配置对象
|
|
891
914
|
*/
|
|
892
915
|
declare function defineStylelintConfig(input?: DefineConfigOptions<StylelintToolingConfig>): Promise<MonorepoStylelintConfig>;
|
|
916
|
+
//#endregion
|
|
917
|
+
//#region src/tooling/shared.d.ts
|
|
918
|
+
/**
|
|
919
|
+
* 读取当前工作目录下的 `repoctl.config.*` 中 `tooling` 配置块。
|
|
920
|
+
*
|
|
921
|
+
* @param cwd 配置文件解析起点。默认使用 `process.cwd()`
|
|
922
|
+
* @returns 标准化后的 tooling 配置;未配置时返回空对象
|
|
923
|
+
*
|
|
924
|
+
* @example
|
|
925
|
+
* ```ts
|
|
926
|
+
* import { loadMonorepoToolingConfig } from 'repoctl/tooling'
|
|
927
|
+
*
|
|
928
|
+
* const tooling = await loadMonorepoToolingConfig()
|
|
929
|
+
* console.log(tooling.vitest?.includeWorkspaceRootConfig)
|
|
930
|
+
* ```
|
|
931
|
+
*/
|
|
932
|
+
declare function loadMonorepoToolingConfig(cwd?: string): Promise<NonNullable<ToolingConfig>>;
|
|
933
|
+
//#endregion
|
|
934
|
+
//#region src/tooling/tsconfig.d.ts
|
|
893
935
|
/**
|
|
894
936
|
* 创建 monorepo 内置的 TypeScript 基线配置。
|
|
895
937
|
*
|
|
@@ -904,36 +946,8 @@ declare function createMonorepoTsconfig(options?: TsconfigToolingConfig): Monore
|
|
|
904
946
|
* @returns 可直接写入或导出的 `tsconfig.json` 配置对象
|
|
905
947
|
*/
|
|
906
948
|
declare function defineTsconfigConfig(input?: DefineConfigOptions<TsconfigToolingConfig>): Promise<MonorepoTsconfig>;
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
*
|
|
910
|
-
* 默认行为:
|
|
911
|
-
* - `*.{js,jsx,mjs,ts,tsx,mts,cts}` 运行 `eslint --fix`
|
|
912
|
-
* - `*.vue` 同时运行 `eslint --fix` 与 `stylelint --fix --allow-empty-input`
|
|
913
|
-
* - TypeScript/Vue files and workspace `package.json` files share one
|
|
914
|
-
* `pnpm exec repo verify staged-typecheck` task to avoid concurrent builds
|
|
915
|
-
* - 样式文件运行 `stylelint --fix --allow-empty-input`
|
|
916
|
-
*
|
|
917
|
-
* @param options 可配置 `repoCommand`,默认值为 `pnpm exec repo`
|
|
918
|
-
* @returns 可直接导出的 `lint-staged` 配置对象
|
|
919
|
-
*
|
|
920
|
-
* @example
|
|
921
|
-
* ```js
|
|
922
|
-
* import { createMonorepoLintStagedConfig } from 'repoctl/tooling'
|
|
923
|
-
*
|
|
924
|
-
* export default createMonorepoLintStagedConfig({
|
|
925
|
-
* repoCommand: 'pnpm exec repo',
|
|
926
|
-
* })
|
|
927
|
-
* ```
|
|
928
|
-
*/
|
|
929
|
-
declare function createMonorepoLintStagedConfig(options?: MonorepoLintStagedConfigOptions): MonorepoLintStagedConfig;
|
|
930
|
-
/**
|
|
931
|
-
* 从 `repoctl.config.ts` 读取 `tooling.lintStaged`,并生成 `lint-staged` 配置。
|
|
932
|
-
*
|
|
933
|
-
* @param input `cwd` 用于指定配置文件解析起点,`options` 用于追加运行时覆盖项
|
|
934
|
-
* @returns 可直接导出的 `lint-staged` 配置对象
|
|
935
|
-
*/
|
|
936
|
-
declare function defineLintStagedConfig(input?: DefineConfigOptions<MonorepoLintStagedConfigOptions>): Promise<MonorepoLintStagedConfig>;
|
|
949
|
+
//#endregion
|
|
950
|
+
//#region src/tooling/vitest/index.d.ts
|
|
937
951
|
/**
|
|
938
952
|
* 创建 monorepo 根级 Vitest 配置。
|
|
939
953
|
*
|
|
@@ -1022,4 +1036,4 @@ declare function createMonorepoVitestProjectConfig(options?: MonorepoVitestProje
|
|
|
1022
1036
|
*/
|
|
1023
1037
|
declare function defineVitestProjectConfig(input?: DefineVitestProjectConfigOptions): Promise<MonorepoVitestProjectConfigResult>;
|
|
1024
1038
|
//#endregion
|
|
1025
|
-
export { init as $,
|
|
1039
|
+
export { init as $, MonorepoVitestProjectConfigResult as A, HuskyToolingConfig as B, MonorepoLintStagedConfigOptions as C, MonorepoVitestConfigOverrides as D, MonorepoVitestConfigOptions as E, CleanCommandConfig as F, StylelintToolingConfig as G, LintStagedToolingConfig as H, CommitlintToolingConfig as I, UpgradeCommandConfig as J, ToolingConfig as K, CreateChoiceOption as L, SimpleGit as M, SimpleGitOptions as N, MonorepoVitestConfigResult as O, AiCommandConfig as P, ReleaseCommandConfig as Q, CreateCommandConfig as R, MonorepoLintStagedConfig as S, MonorepoTsconfig as T, MirrorCommandConfig as U, InitCommandConfig as V, MonorepoConfig as W, VitestToolingConfig as X, VitestProjectToolingConfig as Y, ReleaseAfterPublishHookConfig as Z, DefineEslintConfigOptions as _, generateAgenticTemplates as _t, createMonorepoTsconfig as a, CreateNewProjectOptions as at, MonorepoCommitlintConfig as b, createMonorepoCommitlintConfig as c, getTemplateMap as ct, defineCommitlintConfig as d, AgenticTemplateFormat as dt, initMetadata as et, defineEslintConfig as f, AgenticTemplateTask as ft, DefineConfigOptions as g, generateAgenticTemplate as gt, defineLintStagedConfig as h, defaultAgenticBaseDir as ht, defineVitestProjectConfig as i, createNewProject as it, ConfigValues as j, MonorepoVitestProjectConfigOptions as k, createMonorepoEslintConfig as l, resolveCreateNewProjectPlan as lt, createMonorepoLintStagedConfig as m, createTimestampFolderName as mt, createMonorepoVitestProjectConfig as n, normalizeInitToolingTargets as nt, defineTsconfigConfig as o, CreateNewProjectPlan as ot, defineStylelintConfig as p, GenerateAgenticTemplateOptions as pt, TsconfigToolingConfig as q, defineVitestConfig as r, initToolingTargets as rt, loadMonorepoToolingConfig as s, getCreateChoices as st, createMonorepoVitestConfig as t, initTooling as tt, createMonorepoStylelintConfig as u, templateMap as ut, DefineVitestConfigOptions as v, loadAgenticTasks as vt, MonorepoStylelintConfig as w, MonorepoEslintConfig as x, DefineVitestProjectConfigOptions as y, CliOpts as yt, EslintToolingConfig as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as init, A as
|
|
1
|
+
import { $ as init, A as MonorepoVitestProjectConfigResult, B as HuskyToolingConfig, C as MonorepoLintStagedConfigOptions, D as MonorepoVitestConfigOverrides, E as MonorepoVitestConfigOptions, F as CleanCommandConfig, G as StylelintToolingConfig, H as LintStagedToolingConfig, I as CommitlintToolingConfig, J as UpgradeCommandConfig, K as ToolingConfig, L as CreateChoiceOption, M as SimpleGit, N as SimpleGitOptions, O as MonorepoVitestConfigResult, P as AiCommandConfig, Q as ReleaseCommandConfig, R as CreateCommandConfig, S as MonorepoLintStagedConfig, T as MonorepoTsconfig, U as MirrorCommandConfig, V as InitCommandConfig, W as MonorepoConfig, X as VitestToolingConfig, Y as VitestProjectToolingConfig, Z as ReleaseAfterPublishHookConfig, _ as DefineEslintConfigOptions, _t as generateAgenticTemplates, a as createMonorepoTsconfig, at as CreateNewProjectOptions, b as MonorepoCommitlintConfig, c as createMonorepoCommitlintConfig, ct as getTemplateMap, d as defineCommitlintConfig, dt as AgenticTemplateFormat, et as initMetadata, f as defineEslintConfig, ft as AgenticTemplateTask, g as DefineConfigOptions, gt as generateAgenticTemplate, h as defineLintStagedConfig, ht as defaultAgenticBaseDir, i as defineVitestProjectConfig, it as createNewProject, j as ConfigValues, k as MonorepoVitestProjectConfigOptions, l as createMonorepoEslintConfig, lt as resolveCreateNewProjectPlan, m as createMonorepoLintStagedConfig, mt as createTimestampFolderName, n as createMonorepoVitestProjectConfig, nt as normalizeInitToolingTargets, o as defineTsconfigConfig, ot as CreateNewProjectPlan, p as defineStylelintConfig, pt as GenerateAgenticTemplateOptions, q as TsconfigToolingConfig, r as defineVitestConfig, rt as initToolingTargets, s as loadMonorepoToolingConfig, st as getCreateChoices, t as createMonorepoVitestConfig, tt as initTooling, u as createMonorepoStylelintConfig, ut as templateMap, v as DefineVitestConfigOptions, vt as loadAgenticTasks, w as MonorepoStylelintConfig, x as MonorepoEslintConfig, y as DefineVitestProjectConfigOptions, yt as CliOpts, z as EslintToolingConfig } from "./index-Bl_PB2Ch.mjs";
|
|
2
2
|
import gitUrlParse from "git-url-parse";
|
|
3
3
|
import { mkdtemp, readFile, readdir, stat, writeFile } from "node:fs/promises";
|
|
4
4
|
import { execFileSync, spawnSync } from "node:child_process";
|
|
@@ -543,7 +543,7 @@ interface CheckTemplatesOptions {
|
|
|
543
543
|
}
|
|
544
544
|
export declare function checkTemplates(options?: CheckTemplatesOptions): Promise<TemplateHealthReport>;
|
|
545
545
|
//#endregion
|
|
546
|
-
//#region src/commands/verify/
|
|
546
|
+
//#region src/commands/verify/types.d.ts
|
|
547
547
|
interface VerifyCommandOptions {
|
|
548
548
|
/**
|
|
549
549
|
* 命令执行根目录。
|
|
@@ -599,6 +599,19 @@ interface PreCommitVerifyOptions extends VerifyCommandOptions {
|
|
|
599
599
|
*/
|
|
600
600
|
spawn?: typeof spawnSync;
|
|
601
601
|
}
|
|
602
|
+
//#endregion
|
|
603
|
+
//#region src/commands/verify/staged.d.ts
|
|
604
|
+
/**
|
|
605
|
+
* 对暂存区中涉及类型检查的文件,按最近的 workspace 归属执行 `typecheck`。
|
|
606
|
+
*
|
|
607
|
+
* 当前识别的扩展名:`.ts`、`.tsx`、`.mts`、`.cts`、`.vue`、`.astro`、`.mdx`。
|
|
608
|
+
*
|
|
609
|
+
* @param stagedFiles 暂存区文件路径列表
|
|
610
|
+
* @param options 运行参数
|
|
611
|
+
*/
|
|
612
|
+
export declare function verifyStagedTypecheck(stagedFiles: string[], options?: StagedTypecheckOptions): void;
|
|
613
|
+
//#endregion
|
|
614
|
+
//#region src/commands/verify/index.d.ts
|
|
602
615
|
/**
|
|
603
616
|
* 执行 pre-push 校验。
|
|
604
617
|
*
|
|
@@ -611,15 +624,6 @@ interface PreCommitVerifyOptions extends VerifyCommandOptions {
|
|
|
611
624
|
* @returns Promise<void>
|
|
612
625
|
*/
|
|
613
626
|
export declare function verifyPrePush(options?: PrePushVerifyOptions): Promise<void>;
|
|
614
|
-
/**
|
|
615
|
-
* 对暂存区中涉及类型检查的文件,按最近的 workspace 归属执行 `typecheck`。
|
|
616
|
-
*
|
|
617
|
-
* 当前识别的扩展名:`.ts`、`.tsx`、`.mts`、`.cts`、`.vue`。
|
|
618
|
-
*
|
|
619
|
-
* @param stagedFiles 暂存区文件路径列表
|
|
620
|
-
* @param options 运行参数
|
|
621
|
-
*/
|
|
622
|
-
export declare function verifyStagedTypecheck(stagedFiles: string[], options?: StagedTypecheckOptions): void;
|
|
623
627
|
/**
|
|
624
628
|
* 执行 commit-msg 校验。
|
|
625
629
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { $ as runRecommendedCheck, B as escapeStringRegexp, C as createContext, D as collectEnvSupportBundle, E as collectEnvSnapshot, F as inspectMonorepoConfig, G as isGitignoreFile, H as setByPath, I as cleanProjects, J as toWorkspaceGitignorePath, K as toPublishGitignorePath, L as getSkillTargetPaths, M as getTemplateMap, N as resolveCreateNewProjectPlan, O as runDoctor, P as templateMap, Q as resolveRecommendedCheckPlan, R as skillTargets, S as normalizeInitToolingTargets, T as collectEnvPaths, U as getFileHash, V as isMatch, W as isFileChanged, X as getKnownRepoCheckCommands, Y as updateIssueTemplateConfig, Z as resolveFullWorkspaceCheckPlan, _ as parsePublishSummary, a as createReleasePullRequest, at as defaultAgenticBaseDir, b as initMetadata, c as prepareStable, ct as loadAgenticTasks, d as reconcileRelease, et as verifyCommitMsg, f as enterPrerelease, g as GitHubApiError, h as GitHubClient, i as repairReleaseNotes, it as createTimestampFolderName, j as getCreateChoices, k as createNewProject, l as publishStable, lt as GitClient, m as releasePrerelease, n as upgradeMonorepo, nt as verifyPrePush, o as recoverUnpublished, ot as generateAgenticTemplate, p as exitPrerelease, q as toWorkspaceAssetPath, r as checkTemplates, rt as verifyStagedTypecheck, s as releaseCi, st as generateAgenticTemplates, tt as verifyPreCommit, u as releaseStable, v as setVscodeBinaryMirror, w as collectEnvInfo, x as initTooling, y as init, z as syncSkills } from "./commands-
|
|
1
|
+
import { $ as runRecommendedCheck, B as escapeStringRegexp, C as createContext, D as collectEnvSupportBundle, E as collectEnvSnapshot, F as inspectMonorepoConfig, G as isGitignoreFile, H as setByPath, I as cleanProjects, J as toWorkspaceGitignorePath, K as toPublishGitignorePath, L as getSkillTargetPaths, M as getTemplateMap, N as resolveCreateNewProjectPlan, O as runDoctor, P as templateMap, Q as resolveRecommendedCheckPlan, R as skillTargets, S as normalizeInitToolingTargets, T as collectEnvPaths, U as getFileHash, V as isMatch, W as isFileChanged, X as getKnownRepoCheckCommands, Y as updateIssueTemplateConfig, Z as resolveFullWorkspaceCheckPlan, _ as parsePublishSummary, a as createReleasePullRequest, at as defaultAgenticBaseDir, b as initMetadata, c as prepareStable, ct as loadAgenticTasks, d as reconcileRelease, et as verifyCommitMsg, f as enterPrerelease, g as GitHubApiError, h as GitHubClient, i as repairReleaseNotes, it as createTimestampFolderName, j as getCreateChoices, k as createNewProject, l as publishStable, lt as GitClient, m as releasePrerelease, n as upgradeMonorepo, nt as verifyPrePush, o as recoverUnpublished, ot as generateAgenticTemplate, p as exitPrerelease, q as toWorkspaceAssetPath, r as checkTemplates, rt as verifyStagedTypecheck, s as releaseCi, st as generateAgenticTemplates, tt as verifyPreCommit, u as releaseStable, v as setVscodeBinaryMirror, w as collectEnvInfo, x as initTooling, y as init, z as syncSkills } from "./commands-D4xZQ5t-.mjs";
|
|
2
2
|
import { i as getWorkspacePackages, n as getWorkspaceData, r as getWorkspacePackageSummaries, t as clearWorkspaceCache } from "./workspace-MCKewElu.mjs";
|
|
3
|
-
import { C as outputJson, D as remove, E as readJson, O as writeJSON, S as outputJSON, T as readJSON, _ as ensureFile, a as rootDir, b as isIgnorableFsError, g as ensureDir, h as copy, i as packageDir, k as writeJson, l as version, m as logger, n as assetsDir, o as templatesDir, r as cliName, s as name, t as initToolingTargets, v as exists, w as pathExists, x as outputFile } from "./types-
|
|
3
|
+
import { C as outputJson, D as remove, E as readJson, O as writeJSON, S as outputJSON, T as readJSON, _ as ensureFile, a as rootDir, b as isIgnorableFsError, g as ensureDir, h as copy, i as packageDir, k as writeJson, l as version, m as logger, n as assetsDir, o as templatesDir, r as cliName, s as name, t as initToolingTargets, v as exists, w as pathExists, x as outputFile } from "./types-MAUIQpfp.mjs";
|
|
4
4
|
import { a as loadMonorepoConfig, c as resolveToolingConfig, i as getRepoctlConfigCandidates, o as loadMonorepoConfigDetails, r as defineMonorepoConfig, s as resolveCommandConfig, t as configExtensions } from "./config-p842Knhq.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { i as loadMonorepoToolingConfig, n as defineTsconfigConfig, t as createMonorepoTsconfig } from "./tsconfig-BrjI_5yI.mjs";
|
|
6
|
+
import { a as createMonorepoCommitlintConfig, c as defineCommitlintConfig, d as createMonorepoLintStagedConfig, f as defineLintStagedConfig, i as defineVitestProjectConfig, l as defineEslintConfig, n as createMonorepoVitestProjectConfig, o as createMonorepoEslintConfig, r as defineVitestConfig, s as createMonorepoStylelintConfig, t as createMonorepoVitestConfig, u as defineStylelintConfig } from "./vitest-Blzbh8xZ.mjs";
|
|
6
7
|
export { GitClient, GitHubApiError, GitHubClient, assetsDir, checkTemplates, cleanProjects, clearWorkspaceCache, cliName, collectEnvInfo, collectEnvPaths, collectEnvSnapshot, collectEnvSupportBundle, configExtensions, copy, createContext, createMonorepoCommitlintConfig, createMonorepoEslintConfig, createMonorepoLintStagedConfig, createMonorepoStylelintConfig, createMonorepoTsconfig, createMonorepoVitestConfig, createMonorepoVitestProjectConfig, createNewProject, createReleasePullRequest, createTimestampFolderName, defaultAgenticBaseDir, defineCommitlintConfig, defineEslintConfig, defineLintStagedConfig, defineMonorepoConfig, defineStylelintConfig, defineTsconfigConfig, defineVitestConfig, defineVitestProjectConfig, ensureDir, ensureFile, enterPrerelease, escapeStringRegexp, exists, exitPrerelease, generateAgenticTemplate, generateAgenticTemplates, getCreateChoices, getFileHash, getKnownRepoCheckCommands, getRepoctlConfigCandidates, getSkillTargetPaths, getTemplateMap, getWorkspaceData, getWorkspacePackageSummaries, getWorkspacePackages, init, initMetadata, initTooling, initToolingTargets, inspectMonorepoConfig, isFileChanged, isGitignoreFile, isIgnorableFsError, isMatch, loadAgenticTasks, loadMonorepoConfig, loadMonorepoConfigDetails, loadMonorepoToolingConfig, logger, normalizeInitToolingTargets, outputFile, outputJSON, outputJson, packageDir, name as packageName, parsePublishSummary, pathExists, prepareStable, publishStable, readJSON, readJson, reconcileRelease, recoverUnpublished, releaseCi, releasePrerelease, releaseStable, remove, repairReleaseNotes, resolveCommandConfig, resolveCreateNewProjectPlan, resolveFullWorkspaceCheckPlan, resolveRecommendedCheckPlan, resolveToolingConfig, rootDir, runDoctor, runRecommendedCheck, setByPath, setVscodeBinaryMirror, skillTargets, syncSkills, templateMap, templatesDir, toPublishGitignorePath, toWorkspaceAssetPath, toWorkspaceGitignorePath, updateIssueTemplateConfig, upgradeMonorepo, verifyCommitMsg, verifyPreCommit, verifyPrePush, verifyStagedTypecheck, version, writeJSON, writeJson };
|
package/dist/tooling-entry.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as MonorepoVitestProjectConfigResult, C as MonorepoLintStagedConfigOptions, D as MonorepoVitestConfigOverrides, E as MonorepoVitestConfigOptions, O as MonorepoVitestConfigResult, S as MonorepoLintStagedConfig, T as MonorepoTsconfig, _ as DefineEslintConfigOptions, a as createMonorepoTsconfig, b as MonorepoCommitlintConfig, c as createMonorepoCommitlintConfig, d as defineCommitlintConfig, f as defineEslintConfig, g as DefineConfigOptions, h as defineLintStagedConfig, i as defineVitestProjectConfig, k as MonorepoVitestProjectConfigOptions, l as createMonorepoEslintConfig, m as createMonorepoLintStagedConfig, n as createMonorepoVitestProjectConfig, o as defineTsconfigConfig, p as defineStylelintConfig, r as defineVitestConfig, s as loadMonorepoToolingConfig, t as createMonorepoVitestConfig, u as createMonorepoStylelintConfig, v as DefineVitestConfigOptions, w as MonorepoStylelintConfig, x as MonorepoEslintConfig, y as DefineVitestProjectConfigOptions } from "./index-Bl_PB2Ch.mjs";
|
|
2
2
|
export { DefineConfigOptions, DefineEslintConfigOptions, DefineVitestConfigOptions, DefineVitestProjectConfigOptions, MonorepoCommitlintConfig, MonorepoEslintConfig, MonorepoLintStagedConfig, MonorepoLintStagedConfigOptions, MonorepoStylelintConfig, MonorepoTsconfig, MonorepoVitestConfigOptions, MonorepoVitestConfigOverrides, MonorepoVitestConfigResult, MonorepoVitestProjectConfigOptions, MonorepoVitestProjectConfigResult, createMonorepoCommitlintConfig, createMonorepoEslintConfig, createMonorepoLintStagedConfig, createMonorepoStylelintConfig, createMonorepoTsconfig, createMonorepoVitestConfig, createMonorepoVitestProjectConfig, defineCommitlintConfig, defineEslintConfig, defineLintStagedConfig, defineStylelintConfig, defineTsconfigConfig, defineVitestConfig, defineVitestProjectConfig, loadMonorepoToolingConfig };
|
package/dist/tooling-entry.mjs
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as loadMonorepoToolingConfig, n as defineTsconfigConfig, t as createMonorepoTsconfig } from "./tsconfig-BrjI_5yI.mjs";
|
|
2
|
+
import { a as createMonorepoCommitlintConfig, c as defineCommitlintConfig, d as createMonorepoLintStagedConfig, f as defineLintStagedConfig, i as defineVitestProjectConfig, l as defineEslintConfig, n as createMonorepoVitestProjectConfig, o as createMonorepoEslintConfig, r as defineVitestConfig, s as createMonorepoStylelintConfig, t as createMonorepoVitestConfig, u as defineStylelintConfig } from "./vitest-Blzbh8xZ.mjs";
|
|
2
3
|
export { createMonorepoCommitlintConfig, createMonorepoEslintConfig, createMonorepoLintStagedConfig, createMonorepoStylelintConfig, createMonorepoTsconfig, createMonorepoVitestConfig, createMonorepoVitestProjectConfig, defineCommitlintConfig, defineEslintConfig, defineLintStagedConfig, defineStylelintConfig, defineTsconfigConfig, defineVitestConfig, defineVitestProjectConfig, loadMonorepoToolingConfig };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { a as loadMonorepoConfig } from "./config-p842Knhq.mjs";
|
|
2
|
+
import process from "node:process";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { parse } from "comment-json";
|
|
6
|
+
//#region src/tooling/shared.ts
|
|
7
|
+
/**
|
|
8
|
+
* 读取当前工作目录下的 `repoctl.config.*` 中 `tooling` 配置块。
|
|
9
|
+
*
|
|
10
|
+
* @param cwd 配置文件解析起点。默认使用 `process.cwd()`
|
|
11
|
+
* @returns 标准化后的 tooling 配置;未配置时返回空对象
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { loadMonorepoToolingConfig } from 'repoctl/tooling'
|
|
16
|
+
*
|
|
17
|
+
* const tooling = await loadMonorepoToolingConfig()
|
|
18
|
+
* console.log(tooling.vitest?.includeWorkspaceRootConfig)
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
async function loadMonorepoToolingConfig(cwd = process.cwd()) {
|
|
22
|
+
return (await loadMonorepoConfig(cwd)).tooling ?? {};
|
|
23
|
+
}
|
|
24
|
+
async function loadToolingSection(key, cwd = process.cwd()) {
|
|
25
|
+
return (await loadMonorepoToolingConfig(cwd))[key];
|
|
26
|
+
}
|
|
27
|
+
function resolveConfigInput(input) {
|
|
28
|
+
return {
|
|
29
|
+
cwd: input?.cwd ?? process.cwd(),
|
|
30
|
+
options: input?.options
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function isDefineConfigWrapper(input) {
|
|
34
|
+
if (input === null || typeof input !== "object" || Array.isArray(input)) return false;
|
|
35
|
+
return "cwd" in input || "options" in input;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/tooling/tsconfig.ts
|
|
39
|
+
const monorepoTsconfigPath = fileURLToPath(import.meta.resolve("@icebreakers/monorepo/tsconfig"));
|
|
40
|
+
function mergeTsconfig(base, override) {
|
|
41
|
+
if (!override) return base;
|
|
42
|
+
return {
|
|
43
|
+
...base,
|
|
44
|
+
...override,
|
|
45
|
+
...base.compilerOptions || override.compilerOptions ? { compilerOptions: {
|
|
46
|
+
...base.compilerOptions ?? {},
|
|
47
|
+
...override.compilerOptions ?? {}
|
|
48
|
+
} } : {}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function loadBundledTsconfig() {
|
|
52
|
+
const configContent = fs.readFileSync(monorepoTsconfigPath, "utf8");
|
|
53
|
+
return parse(configContent);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* 创建 monorepo 内置的 TypeScript 基线配置。
|
|
57
|
+
*
|
|
58
|
+
* @param options 额外覆盖项,会与包内置 `tsconfig.base.json` 合并
|
|
59
|
+
* @returns 可直接写入或二次扩展的 `tsconfig.json` 配置对象
|
|
60
|
+
*/
|
|
61
|
+
function createMonorepoTsconfig(options = {}) {
|
|
62
|
+
return mergeTsconfig(loadBundledTsconfig(), options);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 从 `repoctl.config.ts` 读取 `tooling.tsconfig`,并生成最终的 TypeScript 配置对象。
|
|
66
|
+
*
|
|
67
|
+
* @param input `cwd` 用于指定配置文件解析起点,`options` 用于追加运行时覆盖项
|
|
68
|
+
* @returns 可直接写入或导出的 `tsconfig.json` 配置对象
|
|
69
|
+
*/
|
|
70
|
+
async function defineTsconfigConfig(input = {}) {
|
|
71
|
+
const resolved = resolveConfigInput(input);
|
|
72
|
+
return createMonorepoTsconfig(mergeTsconfig(await loadToolingSection("tsconfig", resolved.cwd) ?? {}, resolved.options));
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { loadToolingSection as a, loadMonorepoToolingConfig as i, defineTsconfigConfig as n, resolveConfigInput as o, isDefineConfigWrapper as r, createMonorepoTsconfig as t };
|
|
@@ -343,7 +343,7 @@ function message(key, values = {}) {
|
|
|
343
343
|
//#endregion
|
|
344
344
|
//#region package.json
|
|
345
345
|
var name = "@icebreakers/monorepo";
|
|
346
|
-
var version = "5.
|
|
346
|
+
var version = "5.6.0";
|
|
347
347
|
var package_default = {
|
|
348
348
|
name,
|
|
349
349
|
type: "module",
|
|
@@ -428,7 +428,7 @@ var package_default = {
|
|
|
428
428
|
"@pnpm/find-workspace-dir": "^1000.1.5",
|
|
429
429
|
"@pnpm/logger": "^1100.0.0",
|
|
430
430
|
"@pnpm/types": "^1102.1.1",
|
|
431
|
-
"@pnpm/worker": "^1100.4.
|
|
431
|
+
"@pnpm/worker": "^1100.4.6",
|
|
432
432
|
"@pnpm/workspace.find-packages": "^1000.0.65",
|
|
433
433
|
"@pnpm/workspace.read-manifest": "^1000.3.1",
|
|
434
434
|
"c12": "^3.3.4",
|