@modern-js/monorepo-tools 2.41.0 → 2.42.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.
Files changed (49) hide show
  1. package/dist/types/cli/build.d.ts +1 -1
  2. package/dist/types/cli/buildWatch.d.ts +1 -1
  3. package/dist/types/cli/clear.d.ts +1 -1
  4. package/dist/types/cli/deploy.d.ts +1 -1
  5. package/dist/types/cli/index.d.ts +1 -1
  6. package/dist/types/cli/install.d.ts +1 -1
  7. package/dist/types/cli/new.d.ts +1 -1
  8. package/dist/types/commands/build.d.ts +8 -8
  9. package/dist/types/commands/buildWatch.d.ts +3 -3
  10. package/dist/types/commands/clear.d.ts +2 -2
  11. package/dist/types/commands/deploy.d.ts +2 -2
  12. package/dist/types/commands/index.d.ts +1 -1
  13. package/dist/types/commands/install.d.ts +2 -2
  14. package/dist/types/constants.d.ts +7 -7
  15. package/dist/types/dag/create.d.ts +3 -3
  16. package/dist/types/dag/edgeManager.d.ts +7 -7
  17. package/dist/types/dag/index.d.ts +1 -1
  18. package/dist/types/dag/operator.d.ts +52 -58
  19. package/dist/types/dag/task.d.ts +13 -15
  20. package/dist/types/dag/utils.d.ts +1 -1
  21. package/dist/types/features/build/index.d.ts +7 -7
  22. package/dist/types/features/clear/index.d.ts +3 -3
  23. package/dist/types/features/deploy/index.d.ts +4 -4
  24. package/dist/types/features/dev/cmds.d.ts +1 -1
  25. package/dist/types/features/dev/createTask.d.ts +1 -1
  26. package/dist/types/features/dev/index.d.ts +12 -12
  27. package/dist/types/features/dev/watchProjectsState.d.ts +12 -12
  28. package/dist/types/features/install/index.d.ts +2 -2
  29. package/dist/types/hooks/index.d.ts +5 -5
  30. package/dist/types/index.d.ts +1 -1
  31. package/dist/types/locale/en.d.ts +15 -15
  32. package/dist/types/locale/index.d.ts +29 -29
  33. package/dist/types/locale/zh.d.ts +15 -15
  34. package/dist/types/log/error.d.ts +1 -1
  35. package/dist/types/log/multiTasksLog.d.ts +20 -20
  36. package/dist/types/log/time.d.ts +1 -1
  37. package/dist/types/log/utils.d.ts +1 -1
  38. package/dist/types/package/index.d.ts +8 -8
  39. package/dist/types/parse-config/index.d.ts +16 -16
  40. package/dist/types/parse-config/monorepo.d.ts +6 -6
  41. package/dist/types/projects/checkProjectChange.d.ts +1 -1
  42. package/dist/types/projects/clearMemoryFiles.d.ts +1 -1
  43. package/dist/types/projects/getProjects.d.ts +24 -24
  44. package/dist/types/projects/getProjectsByPackagesConfig.d.ts +1 -1
  45. package/dist/types/projects/getProjectsByWorkspaceFile.d.ts +5 -5
  46. package/dist/types/type.d.ts +5 -5
  47. package/dist/types/utils/install.d.ts +4 -7
  48. package/dist/types/utils/types.d.ts +1 -1
  49. package/package.json +11 -11
@@ -1,3 +1,3 @@
1
1
  import type { PluginAPI } from '@modern-js/core';
2
2
  import type { Command } from '@modern-js/utils';
3
- export declare const buildCli: (program: Command, api: PluginAPI) => void;
3
+ export declare const buildCli: (program: Command, api: PluginAPI) => void;
@@ -1,3 +1,3 @@
1
1
  import type { PluginAPI } from '@modern-js/core';
2
2
  import type { Command } from '@modern-js/utils';
3
- export declare const buildWatchCli: (program: Command, api: PluginAPI) => void;
3
+ export declare const buildWatchCli: (program: Command, api: PluginAPI) => void;
@@ -1,4 +1,4 @@
1
1
  import type { Command } from '@modern-js/utils';
2
2
  import type { PluginAPI } from '@modern-js/core';
3
3
  import { MonorepoTools } from '../type';
4
- export declare const clearCli: (program: Command, api: PluginAPI<MonorepoTools>) => void;
4
+ export declare const clearCli: (program: Command, api: PluginAPI<MonorepoTools>) => void;
@@ -1,4 +1,4 @@
1
1
  import type { Command } from '@modern-js/utils';
2
2
  import type { PluginAPI } from '@modern-js/core';
3
3
  import type { MonorepoTools } from '../type';
4
- export declare const deployCli: (program: Command, api: PluginAPI<MonorepoTools>) => void;
4
+ export declare const deployCli: (program: Command, api: PluginAPI<MonorepoTools>) => void;
@@ -3,4 +3,4 @@ export * from './deploy';
3
3
  export * from './build';
4
4
  export * from './buildWatch';
5
5
  export * from './clear';
6
- export * from './install';
6
+ export * from './install';
@@ -1,3 +1,3 @@
1
1
  import type { PluginAPI } from '@modern-js/core';
2
2
  import type { Command } from '@modern-js/utils';
3
- export declare const installCli: (program: Command, api: PluginAPI) => void;
3
+ export declare const installCli: (program: Command, api: PluginAPI) => void;
@@ -1,2 +1,2 @@
1
1
  import type { Command } from '@modern-js/utils';
2
- export declare const newCli: (program: Command, locale?: string) => void;
2
+ export declare const newCli: (program: Command, locale?: string) => void;
@@ -1,11 +1,11 @@
1
1
  import type { PluginAPI } from '@modern-js/core';
2
2
  export interface IBuildCommandOption {
3
- self?: boolean;
4
- dept?: boolean;
5
- deps?: boolean;
6
- onlySelf: boolean;
7
- all: boolean;
8
- contentHash?: boolean;
9
- gitHash?: boolean;
3
+ self?: boolean;
4
+ dept?: boolean;
5
+ deps?: boolean;
6
+ onlySelf: boolean;
7
+ all: boolean;
8
+ contentHash?: boolean;
9
+ gitHash?: boolean;
10
10
  }
11
- export declare const build: (targetProjectName: string, option: IBuildCommandOption, api: PluginAPI) => Promise<void>;
11
+ export declare const build: (targetProjectName: string, option: IBuildCommandOption, api: PluginAPI) => Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import type { PluginAPI } from '@modern-js/core';
2
2
  export interface IBuildWatchCommandOption {
3
- onlySelf?: boolean;
4
- init?: boolean;
3
+ onlySelf?: boolean;
4
+ init?: boolean;
5
5
  }
6
- export declare const buildWatch: (targetProjectName: string, option: IBuildWatchCommandOption, api: PluginAPI) => Promise<void>;
6
+ export declare const buildWatch: (targetProjectName: string, option: IBuildWatchCommandOption, api: PluginAPI) => Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import type { PluginAPI } from '@modern-js/core';
2
2
  import type { MonorepoTools } from '../type';
3
3
  export interface IClearCommandOption {
4
- removeDirs?: string[];
4
+ removeDirs?: string[];
5
5
  }
6
- export declare const clear: (projectNames: string[], option: IClearCommandOption, api: PluginAPI<MonorepoTools>) => Promise<void>;
6
+ export declare const clear: (projectNames: string[], option: IClearCommandOption, api: PluginAPI<MonorepoTools>) => Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import type { PluginAPI } from '@modern-js/core';
2
2
  import { MonorepoTools } from '../type';
3
3
  export interface IDeployCommandOption {
4
- deployPath?: string;
4
+ deployPath?: string;
5
5
  }
6
- export declare const deploy: (api: PluginAPI<MonorepoTools>, deployProjectNames: string[], option: IDeployCommandOption, ignoreMatchs?: string[]) => Promise<void>;
6
+ export declare const deploy: (api: PluginAPI<MonorepoTools>, deployProjectNames: string[], option: IDeployCommandOption, ignoreMatchs?: string[]) => Promise<void>;
@@ -2,4 +2,4 @@ export * from './deploy';
2
2
  export * from './build';
3
3
  export * from './buildWatch';
4
4
  export * from './clear';
5
- export * from './install';
5
+ export * from './install';
@@ -1,5 +1,5 @@
1
1
  import type { PluginAPI } from '@modern-js/core';
2
2
  export interface IInstallCommandOption {
3
- auto?: boolean;
3
+ auto?: boolean;
4
4
  }
5
- export declare const install: (projectNames: string[] | undefined, option: IInstallCommandOption, api: PluginAPI) => Promise<void>;
5
+ export declare const install: (projectNames: string[] | undefined, option: IInstallCommandOption, api: PluginAPI) => Promise<void>;
@@ -1,10 +1,10 @@
1
1
  export declare const WORKSPACE_FILE: {
2
- LERNA: string;
3
- YARN: string;
4
- PNPM: string;
2
+ LERNA: string;
3
+ YARN: string;
4
+ PNPM: string;
5
5
  };
6
6
  export declare const LOCK_FILE: {
7
- YARN: string;
8
- PNPM: string;
9
- NPM: string;
10
- };
7
+ YARN: string;
8
+ PNPM: string;
9
+ NPM: string;
10
+ };
@@ -1,5 +1,5 @@
1
1
  import { IProjectNode } from '../projects/getProjects';
2
2
  export declare const create: (projects: IProjectNode[]) => {
3
- projectsMap: Map<any, any>;
4
- projectList: string[];
5
- };
3
+ projectsMap: Map<any, any>;
4
+ projectList: string[];
5
+ };
@@ -1,9 +1,9 @@
1
1
  import { IProjectNode } from '../projects/getProjects';
2
2
  export declare class EdgeManager {
3
- private _dependencyEdgeHash;
4
- constructor();
5
- reduceOneEdge(project: IProjectNode): void;
6
- reduceEdges(project: IProjectNode, edges: number): void;
7
- getEdge(project: IProjectNode): number;
8
- setEdge(project: IProjectNode): void;
9
- }
3
+ private _dependencyEdgeHash;
4
+ constructor();
5
+ reduceOneEdge(project: IProjectNode): void;
6
+ reduceEdges(project: IProjectNode, edges: number): void;
7
+ getEdge(project: IProjectNode): number;
8
+ setEdge(project: IProjectNode): void;
9
+ }
@@ -1,3 +1,3 @@
1
1
  import { IProjectNode } from '../projects/getProjects';
2
2
  import { DagOperator } from './operator';
3
- export declare const initDAG: (projects: IProjectNode[]) => DagOperator;
3
+ export declare const initDAG: (projects: IProjectNode[]) => DagOperator;
@@ -1,63 +1,57 @@
1
1
  import { IProjectNode } from '../projects/getProjects';
2
2
  export type Task = (currentProject: IProjectNode, currentProjectPreviousProjects: IProjectNode[], earlyFinishFun: () => void) => Promise<void>;
3
3
  export interface ITraverseConfig {
4
- withSelf?: boolean;
5
- runTaskConcurrency?: number;
4
+ withSelf?: boolean;
5
+ runTaskConcurrency?: number;
6
6
  }
7
7
  export declare class DagOperator {
8
- _projects: IProjectNode[];
9
- _projectsMap: Map<string, IProjectNode>;
10
- _sortedProjects: IProjectNode[][];
11
- constructor(projects: IProjectNode[], projectsMap: Map<string, IProjectNode>);
12
- checkNodeDataExist(name: string): boolean;
13
- getNodeData(name: string, option: {
14
- checkExist: true;
15
- }): IProjectNode;
16
- getNodeData(name: string): IProjectNode | undefined;
17
- getNodeDependencyData(name: string): IProjectNode[];
18
- getNodeDependentData(name: string): IProjectNode[];
19
- getNodeAllDependencyData(name: string, option?: {
20
- skipCircleCheck: boolean;
21
- }): IProjectNode[];
22
- setNodeData(name: string, task: (project: IProjectNode) => void): void;
23
- traverseAllNodes(task: Task): Promise<void>;
24
- checkCircle(): void;
25
- traverseDependenciesToProjectToDependent(name: string, task: Task, config?: ITraverseConfig): Promise<void>;
26
- /**
27
- * 1. 把目标节点当做叶子节点集合 A 中的元素
28
- * 2. 当叶子节点集合中某个 a 元素结束任务的时候进行如下操作:
29
- * 2.1 剪(去额外的)枝:获取 a 元素的 dependent集合,将该集合中元素的依赖列表进行过滤,过滤条件为:排除 a 以及 a 元素的 dependent集合以外的元素。
30
- * 2.2 入度减一:对 a 元素的 dependent 集合元素的 dependencyEdge 减一
31
- * 3. 检查是否存在 dependencyEdge === 0 的节点,加入叶子节点集合 A中。
32
- * 4. 根据情况(是否存在空闲的进程)选择是否执行新加入的节点对应的任务。
33
- */
34
- traverseProjectToDependent(name: string, task: Task, {
35
- withSelf,
36
- runTaskConcurrency
37
- }?: ITraverseConfig): Promise<void>;
38
- /**
39
- * 1. 找到叶子节点集合 A
40
- * 2. 找到直接连接叶子节点的节点集合 B
41
- * 3. 当有某个叶子节点结束任务,则对该节点的直接连接的节点(或者理解成dependent)的枝数(或者叫入度)减一。
42
- * 4. 检查 B 集合中是否存在入度为0的节点,则此节点为叶子节点,并加入叶子节点集合 A
43
- * 5. 根据情况(是否存在空闲的进程)选择是否执行新加入的节点对应的任务。
44
- */
45
- traverseDependenciesToProject(name: string, task: Task, {
46
- withSelf,
47
- runTaskConcurrency
48
- }?: ITraverseConfig): Promise<void>;
49
- /**
50
- * Copyright (c) Microsoft Corporation. All rights reserved.
51
- *
52
- * This source code is licensed under the MIT license found in the
53
- * LICENSE file at
54
- * https://github.com/microsoft/rushstack/blob/master/apps/rush-lib/LICENSE
55
- *
56
- /**
57
- * Checks for projects that indirectly depend on themselves.
58
- */
59
- private _checkForCyclicDependencies;
60
- private _getDependencyLeafNodes;
61
- private readonly _createTask;
62
- private _getProjectPreviousNode;
63
- }
8
+ _projects: IProjectNode[];
9
+ _projectsMap: Map<string, IProjectNode>;
10
+ _sortedProjects: IProjectNode[][];
11
+ constructor(projects: IProjectNode[], projectsMap: Map<string, IProjectNode>);
12
+ checkNodeDataExist(name: string): boolean;
13
+ getNodeData(name: string, option: {
14
+ checkExist: true;
15
+ }): IProjectNode;
16
+ getNodeData(name: string): IProjectNode | undefined;
17
+ getNodeDependencyData(name: string): IProjectNode[];
18
+ getNodeDependentData(name: string): IProjectNode[];
19
+ getNodeAllDependencyData(name: string, option?: {
20
+ skipCircleCheck: boolean;
21
+ }): IProjectNode[];
22
+ setNodeData(name: string, task: (project: IProjectNode) => void): void;
23
+ traverseAllNodes(task: Task): Promise<void>;
24
+ checkCircle(): void;
25
+ traverseDependenciesToProjectToDependent(name: string, task: Task, config?: ITraverseConfig): Promise<void>;
26
+ /**
27
+ * 1. 把目标节点当做叶子节点集合 A 中的元素
28
+ * 2. 当叶子节点集合中某个 a 元素结束任务的时候进行如下操作:
29
+ * 2.1 剪(去额外的)枝:获取 a 元素的 dependent集合,将该集合中元素的依赖列表进行过滤,过滤条件为:排除 a 以及 a 元素的 dependent集合以外的元素。
30
+ * 2.2 入度减一:对 a 元素的 dependent 集合元素的 dependencyEdge 减一
31
+ * 3. 检查是否存在 dependencyEdge === 0 的节点,加入叶子节点集合 A中。
32
+ * 4. 根据情况(是否存在空闲的进程)选择是否执行新加入的节点对应的任务。
33
+ */
34
+ traverseProjectToDependent(name: string, task: Task, { withSelf, runTaskConcurrency }?: ITraverseConfig): Promise<void>;
35
+ /**
36
+ * 1. 找到叶子节点集合 A
37
+ * 2. 找到直接连接叶子节点的节点集合 B
38
+ * 3. 当有某个叶子节点结束任务,则对该节点的直接连接的节点(或者理解成dependent)的枝数(或者叫入度)减一。
39
+ * 4. 检查 B 集合中是否存在入度为0的节点,则此节点为叶子节点,并加入叶子节点集合 A
40
+ * 5. 根据情况(是否存在空闲的进程)选择是否执行新加入的节点对应的任务。
41
+ */
42
+ traverseDependenciesToProject(name: string, task: Task, { withSelf, runTaskConcurrency }?: ITraverseConfig): Promise<void>;
43
+ /**
44
+ * Copyright (c) Microsoft Corporation. All rights reserved.
45
+ *
46
+ * This source code is licensed under the MIT license found in the
47
+ * LICENSE file at
48
+ * https://github.com/microsoft/rushstack/blob/master/apps/rush-lib/LICENSE
49
+ *
50
+ /**
51
+ * Checks for projects that indirectly depend on themselves.
52
+ */
53
+ private _checkForCyclicDependencies;
54
+ private _getDependencyLeafNodes;
55
+ private readonly _createTask;
56
+ private _getProjectPreviousNode;
57
+ }
@@ -1,21 +1,19 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'events';
3
3
  export interface ITaskRunnerConfig {
4
- concurrency?: number;
4
+ concurrency?: number;
5
5
  }
6
6
  export type TaskFunType<T = undefined> = (stopTask?: () => void) => Promise<T>;
7
7
  export declare class TaskRunner<S> extends EventEmitter {
8
- static DefaultConcurrency: number;
9
- static TASK_FINISH: string;
10
- _tasks: TaskFunType<S>[];
11
- _concurrency: number;
12
- _usableConcurrency: number;
13
- private _stopFlag;
14
- constructor(tasks: TaskFunType<S>[], {
15
- concurrency
16
- }: ITaskRunnerConfig);
17
- run(): Promise<void>;
18
- addTask(task: TaskFunType<S>): void;
19
- private _runTask;
20
- private _stopTask;
21
- }
8
+ static DefaultConcurrency: number;
9
+ static TASK_FINISH: string;
10
+ _tasks: TaskFunType<S>[];
11
+ _concurrency: number;
12
+ _usableConcurrency: number;
13
+ private _stopFlag;
14
+ constructor(tasks: TaskFunType<S>[], { concurrency }: ITaskRunnerConfig);
15
+ run(): Promise<void>;
16
+ addTask(task: TaskFunType<S>): void;
17
+ private _runTask;
18
+ private _stopTask;
19
+ }
@@ -6,4 +6,4 @@ import { IProjectNode } from '../projects/getProjects';
6
6
  export declare const calculateCriticalPaths: (project: IProjectNode) => number;
7
7
  export declare const recursiveGetDependency: (project: IProjectNode, skipCircleProjects?: boolean) => IProjectNode[];
8
8
  export declare const sortProjects: (projects: IProjectNode[]) => IProjectNode[][];
9
- export declare const findCircle: (projects: IProjectNode[]) => void;
9
+ export declare const findCircle: (projects: IProjectNode[]) => void;
@@ -1,12 +1,12 @@
1
1
  import type { ICommandConfig } from '../../type';
2
2
  import { DagOperator } from '../../dag/operator';
3
3
  export interface IBuildConfig extends ICommandConfig {
4
- withSelf?: boolean;
5
- onlySelf?: boolean;
6
- withDept?: boolean;
7
- disableWithDeps?: boolean;
8
- disableContentHash?: boolean;
9
- enableGitHash?: boolean;
4
+ withSelf?: boolean;
5
+ onlySelf?: boolean;
6
+ withDept?: boolean;
7
+ disableWithDeps?: boolean;
8
+ disableContentHash?: boolean;
9
+ enableGitHash?: boolean;
10
10
  }
11
11
  export declare const runBuildTask: (projectName: string, operator: DagOperator, config: IBuildConfig, taskCmds?: string[]) => Promise<void>;
12
- export declare const runAllBuildTask: (operator: DagOperator, config: IBuildConfig, taskCmds?: string[]) => Promise<void>;
12
+ export declare const runAllBuildTask: (operator: DagOperator, config: IBuildConfig, taskCmds?: string[]) => Promise<void>;
@@ -1,7 +1,7 @@
1
1
  import { IProjectNode } from '../../projects/getProjects';
2
2
  export interface IClearConfig {
3
- rootPath: string;
4
- removeDirs?: string[];
3
+ rootPath: string;
4
+ removeDirs?: string[];
5
5
  }
6
6
  export declare const defaultRemoveDirs: string[];
7
- export declare const runClearTask: (projectNames: string[], projects: IProjectNode[], config: IClearConfig) => void;
7
+ export declare const runClearTask: (projectNames: string[], projects: IProjectNode[], config: IClearConfig) => void;
@@ -1,9 +1,9 @@
1
1
  import { DagOperator } from '../../dag/operator';
2
2
  import { PackageManagerType } from '../../parse-config';
3
3
  interface IDeployConfig {
4
- rootPath: string;
5
- packageManager: PackageManagerType;
6
- deployPath?: string;
4
+ rootPath: string;
5
+ packageManager: PackageManagerType;
6
+ deployPath?: string;
7
7
  }
8
8
  export declare const deploy: (deployProjectNames: string[], operator: DagOperator, config: IDeployConfig) => Promise<void>;
9
- export {};
9
+ export {};
@@ -1,3 +1,3 @@
1
1
  import { IProjectNode } from '../../projects/getProjects';
2
2
  export type BuildWatchCmdsType = [string] | [string, string] | [string, (project: IProjectNode) => string[]];
3
- export declare const defaultBuildWatchCmds: BuildWatchCmdsType;
3
+ export declare const defaultBuildWatchCmds: BuildWatchCmdsType;
@@ -3,4 +3,4 @@ import type { MultitasksLogger } from '../../log/multiTasksLog';
3
3
  import { BuildWatchCmdsType } from './cmds';
4
4
  import type { IBuildWatchConfig } from '.';
5
5
  export declare const createDependenciesTask: (config: IBuildWatchConfig, taskCmds: BuildWatchCmdsType | undefined, taskLogger: MultitasksLogger) => (project: IProjectNode) => Promise<void>;
6
- export declare const createDevTask: (config: IBuildWatchConfig, taskCmds: BuildWatchCmdsType | undefined, taskLogger: MultitasksLogger) => (project: IProjectNode) => Promise<void>;
6
+ export declare const createDevTask: (config: IBuildWatchConfig, taskCmds: BuildWatchCmdsType | undefined, taskLogger: MultitasksLogger) => (project: IProjectNode) => Promise<void>;
@@ -5,18 +5,18 @@ import { IProjectNode } from '../../projects/getProjects';
5
5
  import { Argu } from '../../utils/types';
6
6
  import { BuildWatchCmdsType } from './cmds';
7
7
  export interface IBuildWatchConfig extends ICommandConfig {
8
- onlySelf?: boolean;
9
- ignoreMaybeChanged?: Argu<typeof anymatch>;
10
- needInit?: boolean;
8
+ onlySelf?: boolean;
9
+ ignoreMaybeChanged?: Argu<typeof anymatch>;
10
+ needInit?: boolean;
11
11
  }
12
12
  export interface IProjectChangeResult {
13
- /**
14
- * The set of projects that have changed since the last iteration
15
- */
16
- changedProjects: Readonly<IProjectNode[]>;
17
- /**
18
- * Contains the git hashes for all tracked files in the repo
19
- */
20
- state: any;
13
+ /**
14
+ * The set of projects that have changed since the last iteration
15
+ */
16
+ changedProjects: Readonly<IProjectNode[]>;
17
+ /**
18
+ * Contains the git hashes for all tracked files in the repo
19
+ */
20
+ state: any;
21
21
  }
22
- export declare const runBuildWatchTask: (projectName: string, operator: DagOperator, config: IBuildWatchConfig, taskCmds?: BuildWatchCmdsType) => Promise<void>;
22
+ export declare const runBuildWatchTask: (projectName: string, operator: DagOperator, config: IBuildWatchConfig, taskCmds?: BuildWatchCmdsType) => Promise<void>;
@@ -1,15 +1,15 @@
1
1
  import { IProjectNode } from '../../projects/getProjects';
2
2
  import { IBuildWatchConfig } from '.';
3
3
  export declare class WatchedProjectsState {
4
- private readonly _config;
5
- private readonly _fromNodes;
6
- private _watchProjects;
7
- private readonly _projectsFileMap;
8
- constructor(fromNodes: IProjectNode[], config: IBuildWatchConfig);
9
- private _initState;
10
- getChangedProject(changedFilPath: string): IProjectNode | undefined;
11
- getWatchedProjectsPath(): string[];
12
- updateState(): void;
13
- get watchProjects(): Record<string, IProjectNode>;
14
- get watchProjectsName(): string[];
15
- }
4
+ private readonly _config;
5
+ private readonly _fromNodes;
6
+ private _watchProjects;
7
+ private readonly _projectsFileMap;
8
+ constructor(fromNodes: IProjectNode[], config: IBuildWatchConfig);
9
+ private _initState;
10
+ getChangedProject(changedFilPath: string): IProjectNode | undefined;
11
+ getWatchedProjectsPath(): string[];
12
+ updateState(): void;
13
+ get watchProjects(): Record<string, IProjectNode>;
14
+ get watchProjectsName(): string[];
15
+ }
@@ -1,6 +1,6 @@
1
1
  import type { ICommandConfig } from '../../type';
2
2
  import type { DagOperator } from '../../dag/operator';
3
3
  export interface IInstallConfig extends ICommandConfig {
4
- auto?: boolean;
4
+ auto?: boolean;
5
5
  }
6
- export declare const runInstallTask: (projectNames: string[], operator: DagOperator, config: IInstallConfig) => Promise<void>;
6
+ export declare const runInstallTask: (projectNames: string[], operator: DagOperator, config: IInstallConfig) => Promise<void>;
@@ -1,7 +1,7 @@
1
1
  import type { DagOperator } from '../dag/operator';
2
2
  export declare const hooks: {
3
- afterMonorepoDeploy: import("@modern-js/plugin").AsyncWorkflow<{
4
- operator: DagOperator;
5
- deployProjectNames: string[];
6
- }, void>;
7
- };
3
+ afterMonorepoDeploy: import("@modern-js/plugin").AsyncWorkflow<{
4
+ operator: DagOperator;
5
+ deployProjectNames: string[];
6
+ }, void>;
7
+ };
@@ -2,4 +2,4 @@ import type { CliPlugin } from '@modern-js/core';
2
2
  import { MonorepoTools } from './type';
3
3
  export * from './projects/getProjects';
4
4
  export declare const monorepoTools: () => CliPlugin<MonorepoTools>;
5
- export default monorepoTools;
5
+ export default monorepoTools;
@@ -1,17 +1,17 @@
1
1
  export declare const EN_LOCALE: {
2
- command: {
3
- shared: {
4
- config: string;
5
- noNeedInstall: string;
2
+ command: {
3
+ shared: {
4
+ config: string;
5
+ noNeedInstall: string;
6
+ };
7
+ new: {
8
+ describe: string;
9
+ debug: string;
10
+ config: string;
11
+ plugin: string;
12
+ distTag: string;
13
+ registry: string;
14
+ lang: string;
15
+ };
6
16
  };
7
- new: {
8
- describe: string;
9
- debug: string;
10
- config: string;
11
- plugin: string;
12
- distTag: string;
13
- registry: string;
14
- lang: string;
15
- };
16
- };
17
- };
17
+ };
@@ -1,36 +1,36 @@
1
1
  import { I18n } from '@modern-js/plugin-i18n';
2
2
  declare const i18n: I18n;
3
3
  declare const localeKeys: {
4
- command: {
5
- shared: {
6
- config: string;
7
- noNeedInstall: string;
4
+ command: {
5
+ shared: {
6
+ config: string;
7
+ noNeedInstall: string;
8
+ };
9
+ new: {
10
+ describe: string;
11
+ debug: string;
12
+ config: string;
13
+ plugin: string;
14
+ distTag: string;
15
+ registry: string;
16
+ lang: string;
17
+ };
8
18
  };
9
- new: {
10
- describe: string;
11
- debug: string;
12
- config: string;
13
- plugin: string;
14
- distTag: string;
15
- registry: string;
16
- lang: string;
17
- };
18
- };
19
19
  } | {
20
- command: {
21
- shared: {
22
- config: string;
23
- noNeedInstall: string;
24
- };
25
- new: {
26
- describe: string;
27
- debug: string;
28
- config: string;
29
- plugin: string;
30
- distTag: string;
31
- registry: string;
32
- lang: string;
20
+ command: {
21
+ shared: {
22
+ config: string;
23
+ noNeedInstall: string;
24
+ };
25
+ new: {
26
+ describe: string;
27
+ debug: string;
28
+ config: string;
29
+ plugin: string;
30
+ distTag: string;
31
+ registry: string;
32
+ lang: string;
33
+ };
33
34
  };
34
- };
35
35
  };
36
- export { i18n, localeKeys };
36
+ export { i18n, localeKeys };
@@ -1,17 +1,17 @@
1
1
  export declare const ZH_LOCALE: {
2
- command: {
3
- shared: {
4
- config: string;
5
- noNeedInstall: string;
2
+ command: {
3
+ shared: {
4
+ config: string;
5
+ noNeedInstall: string;
6
+ };
7
+ new: {
8
+ describe: string;
9
+ debug: string;
10
+ config: string;
11
+ plugin: string;
12
+ distTag: string;
13
+ registry: string;
14
+ lang: string;
15
+ };
6
16
  };
7
- new: {
8
- describe: string;
9
- debug: string;
10
- config: string;
11
- plugin: string;
12
- distTag: string;
13
- registry: string;
14
- lang: string;
15
- };
16
- };
17
- };
17
+ };
@@ -1 +1 @@
1
- export declare const errorLog: (...rest: string[]) => never;
1
+ export declare const errorLog: (...rest: string[]) => never;
@@ -2,25 +2,25 @@
2
2
  /// <reference types="node" />
3
3
  import type { ChildProcess } from 'child_process';
4
4
  export interface ITaskLogProviderConfig {
5
- stdout: ChildProcess['stdout'] | NodeJS.ReadStream;
6
- stderr: ChildProcess['stderr'] | NodeJS.ReadStream;
7
- logConfig: {
8
- label?: string;
9
- color?: string;
10
- badge?: string;
11
- header?: string;
12
- footer?: string;
13
- contentLength?: number;
14
- };
5
+ stdout: ChildProcess['stdout'] | NodeJS.ReadStream;
6
+ stderr: ChildProcess['stderr'] | NodeJS.ReadStream;
7
+ logConfig: {
8
+ label?: string;
9
+ color?: string;
10
+ badge?: string;
11
+ header?: string;
12
+ footer?: string;
13
+ contentLength?: number;
14
+ };
15
15
  }
16
16
  export declare class MultitasksLogger {
17
- private readonly _taskNameList;
18
- private readonly _taskStdoutListenerMap;
19
- private readonly _taskStderrListenerMap;
20
- private readonly _taskLogConfigMap;
21
- constructor();
22
- addLogProvider(name: string, config: ITaskLogProviderConfig): void;
23
- startListen(taskName: string): void;
24
- startListenAll(): void;
25
- finishListen(): void;
26
- }
17
+ private readonly _taskNameList;
18
+ private readonly _taskStdoutListenerMap;
19
+ private readonly _taskStderrListenerMap;
20
+ private readonly _taskLogConfigMap;
21
+ constructor();
22
+ addLogProvider(name: string, config: ITaskLogProviderConfig): void;
23
+ startListen(taskName: string): void;
24
+ startListenAll(): void;
25
+ finishListen(): void;
26
+ }
@@ -1,4 +1,4 @@
1
1
  import { Signale, SignaleOptions } from '@modern-js/utils';
2
2
  export declare const initTimeLog: (option?: SignaleOptions) => import("@modern-js/utils/compiled/signale").Signale<import("@modern-js/utils/compiled/signale").DefaultMethods>;
3
3
  export declare const startTime: (signaleInstance: Signale, prefix?: string) => void;
4
- export declare const endTime: (signaleInstance: Signale, prefix?: string) => void;
4
+ export declare const endTime: (signaleInstance: Signale, prefix?: string) => void;
@@ -1 +1 @@
1
- export declare const formatLog: (log: string) => string;
1
+ export declare const formatLog: (log: string) => string;
@@ -1,10 +1,10 @@
1
1
  import type { INodePackageJson } from '@rushstack/node-core-library';
2
2
  export declare class Package {
3
- json: INodePackageJson;
4
- configPath: string;
5
- rootPath: string;
6
- constructor(packageJson: INodePackageJson, packageConfigPath: string, rootPath: string);
7
- get name(): string;
8
- get path(): string;
9
- get(key: keyof INodePackageJson): string | boolean | Record<string, string> | import("@rushstack/node-core-library").IPackageJsonDependencyTable | import("@rushstack/node-core-library").IPackageJsonScriptTable | import("@rushstack/node-core-library").IPackageJsonRepository | import("@rushstack/node-core-library").IPeerDependenciesMetaTable | undefined;
10
- }
3
+ json: INodePackageJson;
4
+ configPath: string;
5
+ rootPath: string;
6
+ constructor(packageJson: INodePackageJson, packageConfigPath: string, rootPath: string);
7
+ get name(): string;
8
+ get path(): string;
9
+ get(key: keyof INodePackageJson): string | boolean | Record<string, string> | import("@rushstack/node-core-library").IPackageJsonDependencyTable | import("@rushstack/node-core-library").IPackageJsonScriptTable | import("@rushstack/node-core-library").IPackageJsonRepository | import("@rushstack/node-core-library").IPeerDependenciesMetaTable | undefined;
10
+ }
@@ -1,18 +1,18 @@
1
1
  export declare const getFinalConfig: (currentPath?: string) => Promise<{
2
- monorepo: {
3
- rootPath: string;
4
- packageManager: import("./monorepo").PackageManagerType;
5
- };
6
- config: {
7
- packagesMatchs?: string[] | {
8
- enableAutoFinder?: boolean | undefined;
9
- workspaceFile?: string | undefined;
10
- } | undefined;
11
- projectsConfig?: {
12
- name: string;
13
- path: string;
14
- }[] | undefined;
15
- packagesIgnoreMatchs?: string[] | undefined;
16
- };
2
+ monorepo: {
3
+ rootPath: string;
4
+ packageManager: import("./monorepo").PackageManagerType;
5
+ };
6
+ config: {
7
+ packagesMatchs?: string[] | {
8
+ enableAutoFinder?: boolean | undefined;
9
+ workspaceFile?: string | undefined;
10
+ } | undefined;
11
+ projectsConfig?: {
12
+ name: string;
13
+ path: string;
14
+ }[] | undefined;
15
+ packagesIgnoreMatchs?: string[] | undefined;
16
+ };
17
17
  }>;
18
- export type { PackageManagerType } from './monorepo';
18
+ export type { PackageManagerType } from './monorepo';
@@ -2,12 +2,12 @@ export declare const findMonorepoRoot: (starFindPath: string) => string | undefi
2
2
  export declare const getWorkspaceFile: (startFindPath: string) => string;
3
3
  export type PackageManagerType = 'pnpm' | 'yarn' | 'npm';
4
4
  export declare const packageManagerFlag: {
5
- pnpm: string[];
6
- yarn: (string | ((monorepoRootPath: string) => boolean))[];
7
- npm: (() => boolean)[];
5
+ pnpm: string[];
6
+ yarn: (string | ((monorepoRootPath: string) => boolean))[];
7
+ npm: (() => boolean)[];
8
8
  };
9
9
  export declare const getPackageManager: (monorepoRootPath: string) => PackageManagerType;
10
10
  export declare const getMonorepoBaseData: (root?: string) => {
11
- rootPath: string;
12
- packageManager: PackageManagerType;
13
- };
11
+ rootPath: string;
12
+ packageManager: PackageManagerType;
13
+ };
@@ -3,4 +3,4 @@ export declare const PROJECT_CONTENT_FILE_NAME = "project-content.json";
3
3
  export declare const MONOREPO_GIT_FILE_NAME = "monorepo-git.json";
4
4
  export declare const PROJECT_MEMORY_PATH = ".project-memory";
5
5
  export declare const checkProjectChangeByGit: (project: IProjectNode, rootPath: string) => Promise<boolean>;
6
- export declare const checkProjectChangeByContent: (project: IProjectNode) => Promise<boolean>;
6
+ export declare const checkProjectChangeByContent: (project: IProjectNode) => Promise<boolean>;
@@ -1,2 +1,2 @@
1
1
  import { IProjectNode } from './getProjects';
2
- export declare const clearProjectsMemoryFile: (projects: IProjectNode[]) => void;
2
+ export declare const clearProjectsMemoryFile: (projects: IProjectNode[]) => void;
@@ -1,30 +1,30 @@
1
1
  export interface IFindSubProjectConfig {
2
- packagesMatchs?: string[] | {
3
- enableAutoFinder?: boolean;
4
- workspaceFile?: string;
5
- };
6
- projectsConfig?: {
7
- name: string;
8
- path: string;
9
- }[];
10
- /**
11
- * https://github.com/mrmlnc/fast-glob#ignore
12
- */
13
- packagesIgnoreMatchs?: string[];
2
+ packagesMatchs?: string[] | {
3
+ enableAutoFinder?: boolean;
4
+ workspaceFile?: string;
5
+ };
6
+ projectsConfig?: {
7
+ name: string;
8
+ path: string;
9
+ }[];
10
+ /**
11
+ * https://github.com/mrmlnc/fast-glob#ignore
12
+ */
13
+ packagesIgnoreMatchs?: string[];
14
14
  }
15
15
  export interface IProjectNode {
16
- name: string;
17
- dependency?: IProjectNode[];
18
- dependent?: IProjectNode[];
19
- extra: {
20
- path: string;
21
- } & Record<string, any>;
22
- dependencyEdge: number;
23
- dependentEdge: number;
24
- checkedCircle: boolean;
25
- circlePath: string[];
26
- criticalPathLength?: number;
16
+ name: string;
17
+ dependency?: IProjectNode[];
18
+ dependent?: IProjectNode[];
19
+ extra: {
20
+ path: string;
21
+ } & Record<string, any>;
22
+ dependencyEdge: number;
23
+ dependentEdge: number;
24
+ checkedCircle: boolean;
25
+ circlePath: string[];
26
+ criticalPathLength?: number;
27
27
  }
28
28
  export type IMonorepoSubProject = IProjectNode;
29
29
  export declare const getProjects: (config: IFindSubProjectConfig, currentDir?: string) => Promise<IMonorepoSubProject[]>;
30
- export declare const syncGetProjects: (config: IFindSubProjectConfig, currentDir?: string) => IMonorepoSubProject[];
30
+ export declare const syncGetProjects: (config: IFindSubProjectConfig, currentDir?: string) => IMonorepoSubProject[];
@@ -1,3 +1,3 @@
1
1
  import { Package } from '../package';
2
2
  export declare const getProjectsByPackageConfig: (rootPath: string, packagesConfig: string[], ignoreConfigs: string[]) => Promise<Package[]>;
3
- export declare const syncGetProjectsByPackageConfig: (rootPath: string, packagesConfig: string[], ignoreConfigs: string[]) => Package[];
3
+ export declare const syncGetProjectsByPackageConfig: (rootPath: string, packagesConfig: string[], ignoreConfigs: string[]) => Package[];
@@ -1,8 +1,8 @@
1
1
  export declare const getProjectsByWorkspaceFile: (rootPath: string, config: {
2
- enableAutoFinder?: boolean;
3
- workspaceFile?: string;
2
+ enableAutoFinder?: boolean;
3
+ workspaceFile?: string;
4
4
  }, ignoreConfigs: string[]) => Promise<import("../package").Package[]>;
5
5
  export declare const syncGetProjectsByWorkspaceFile: (rootPath: string, config: {
6
- enableAutoFinder?: boolean;
7
- workspaceFile?: string;
8
- }, ignoreConfigs: string[]) => import("../package").Package[];
6
+ enableAutoFinder?: boolean;
7
+ workspaceFile?: string;
8
+ }, ignoreConfigs: string[]) => import("../package").Package[];
@@ -1,12 +1,12 @@
1
1
  import { PackageManagerType } from './parse-config';
2
2
  import { hooks } from './hooks';
3
3
  export interface IPnpmWorkSpace {
4
- packages: string[];
4
+ packages: string[];
5
5
  }
6
6
  export interface ICommandConfig {
7
- rootPath: string;
8
- packageManager: PackageManagerType;
7
+ rootPath: string;
8
+ packageManager: PackageManagerType;
9
9
  }
10
10
  export type MonorepoTools = {
11
- hooks: typeof hooks;
12
- };
11
+ hooks: typeof hooks;
12
+ };
@@ -1,9 +1,6 @@
1
1
  import { PackageManagerType } from '../parse-config';
2
2
  export declare const removeLockFile: (rootPath: string, packageManager: PackageManagerType) => void;
3
- export declare const installByPackageManager: (packageManager: PackageManagerType, {
4
- rootPath,
5
- removeLock
6
- }: {
7
- rootPath: string;
8
- removeLock?: boolean | undefined;
9
- }) => Promise<void>;
3
+ export declare const installByPackageManager: (packageManager: PackageManagerType, { rootPath, removeLock }: {
4
+ rootPath: string;
5
+ removeLock?: boolean | undefined;
6
+ }) => Promise<void>;
@@ -1 +1 @@
1
- export type Argu<F extends (input: any) => any> = F extends (input: infer A) => any ? A : never;
1
+ export type Argu<F extends (input: any) => any> = F extends (input: infer A) => any ? A : never;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.41.0",
18
+ "version": "2.42.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -43,14 +43,14 @@
43
43
  "md5": "^2.3.0",
44
44
  "p-map": "4.0.0",
45
45
  "@swc/helpers": "0.5.3",
46
- "@modern-js/core": "2.41.0",
47
- "@modern-js/new-action": "2.41.0",
48
- "@modern-js/plugin": "2.41.0",
49
- "@modern-js/upgrade": "2.41.0",
50
- "@modern-js/plugin-changeset": "2.41.0",
51
- "@modern-js/plugin-lint": "2.41.0",
52
- "@modern-js/plugin-i18n": "2.41.0",
53
- "@modern-js/utils": "2.41.0"
46
+ "@modern-js/core": "2.42.0",
47
+ "@modern-js/new-action": "2.42.0",
48
+ "@modern-js/upgrade": "2.42.0",
49
+ "@modern-js/plugin-changeset": "2.42.0",
50
+ "@modern-js/plugin-i18n": "2.42.0",
51
+ "@modern-js/plugin": "2.42.0",
52
+ "@modern-js/plugin-lint": "2.42.0",
53
+ "@modern-js/utils": "2.42.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/jest": "^29",
@@ -58,8 +58,8 @@
58
58
  "@types/node": "^14",
59
59
  "jest": "^29",
60
60
  "typescript": "^5",
61
- "@scripts/build": "2.41.0",
62
- "@scripts/jest-config": "2.41.0"
61
+ "@scripts/build": "2.42.0",
62
+ "@scripts/jest-config": "2.42.0"
63
63
  },
64
64
  "sideEffects": false,
65
65
  "publishConfig": {