@modern-js/monorepo-tools 2.58.0 → 2.58.2

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.
@@ -25,7 +25,7 @@ var import_install = require("../features/install");
25
25
  var import_monorepo = require("../parse-config/monorepo");
26
26
  var import_getProjects = require("../projects/getProjects");
27
27
  var import_dag = require("../dag");
28
- const install = async (projectNames = [], option, api) => {
28
+ const install = async (projectNames, option, api) => {
29
29
  const { appDirectory } = api.useAppContext();
30
30
  const { auto } = option;
31
31
  const projects = await (0, import_getProjects.getProjects)({
@@ -89,19 +89,14 @@ class DagOperator {
89
89
  if (earlyFinish) {
90
90
  break;
91
91
  }
92
- await (0, import_p_map.default)(
93
- projects,
94
- // eslint-disable-next-line @typescript-eslint/no-loop-func
95
- async (project) => {
96
- if (!finishTaskHash[project.name]) {
97
- finishTaskHash[project.name] = true;
98
- await task(project, this._getProjectPreviousNode(project.dependent || [], preNodes), () => earlyFinish = true);
99
- }
100
- },
101
- {
102
- concurrency: projects.length
92
+ await (0, import_p_map.default)(projects, async (project) => {
93
+ if (!finishTaskHash[project.name]) {
94
+ finishTaskHash[project.name] = true;
95
+ await task(project, this._getProjectPreviousNode(project.dependent || [], preNodes), () => earlyFinish = true);
103
96
  }
104
- );
97
+ }, {
98
+ concurrency: projects.length
99
+ });
105
100
  preNodes = [
106
101
  ...projects
107
102
  ];
@@ -37,7 +37,7 @@ var import_utils = require("@modern-js/utils");
37
37
  var import_checkProjectChange = require("../../projects/checkProjectChange");
38
38
  var import_error = require("../../log/error");
39
39
  var import_multiTasksLog = require("../../log/multiTasksLog");
40
- const createTask = (config, taskCmds = defaultBuildCmds, taskLogger) => {
40
+ const createTask = (config, taskCmds, taskLogger) => {
41
41
  const { rootPath, packageManager, disableContentHash = false, enableGitHash = false } = config;
42
42
  const task = async (project) => {
43
43
  console.info("run ", project.name);
@@ -55,7 +55,7 @@ const getFinalTaskCmds = (taskCmds, project) => {
55
55
  }
56
56
  return finalTaskCmds;
57
57
  };
58
- const createDependenciesTask = (config, taskCmds = import_cmds.defaultBuildWatchCmds, taskLogger) => {
58
+ const createDependenciesTask = (config, taskCmds, taskLogger) => {
59
59
  const { packageManager } = config;
60
60
  const timelogInstance = timeLog.initTimeLog();
61
61
  const task = async (project) => {
@@ -2,7 +2,7 @@ import { runInstallTask } from "../features/install";
2
2
  import { getMonorepoBaseData } from "../parse-config/monorepo";
3
3
  import { getProjects } from "../projects/getProjects";
4
4
  import { initDAG } from "../dag";
5
- const install = async (projectNames = [], option, api) => {
5
+ const install = async (projectNames, option, api) => {
6
6
  const { appDirectory } = api.useAppContext();
7
7
  const { auto } = option;
8
8
  const projects = await getProjects({
@@ -56,19 +56,14 @@ class DagOperator {
56
56
  if (earlyFinish) {
57
57
  break;
58
58
  }
59
- await pMap(
60
- projects,
61
- // eslint-disable-next-line @typescript-eslint/no-loop-func
62
- async (project) => {
63
- if (!finishTaskHash[project.name]) {
64
- finishTaskHash[project.name] = true;
65
- await task(project, this._getProjectPreviousNode(project.dependent || [], preNodes), () => earlyFinish = true);
66
- }
67
- },
68
- {
69
- concurrency: projects.length
59
+ await pMap(projects, async (project) => {
60
+ if (!finishTaskHash[project.name]) {
61
+ finishTaskHash[project.name] = true;
62
+ await task(project, this._getProjectPreviousNode(project.dependent || [], preNodes), () => earlyFinish = true);
70
63
  }
71
- );
64
+ }, {
65
+ concurrency: projects.length
66
+ });
72
67
  preNodes = [
73
68
  ...projects
74
69
  ];
@@ -3,7 +3,7 @@ import { execa, signale } from "@modern-js/utils";
3
3
  import { checkProjectChangeByGit, checkProjectChangeByContent } from "../../projects/checkProjectChange";
4
4
  import { errorLog } from "../../log/error";
5
5
  import { MultitasksLogger } from "../../log/multiTasksLog";
6
- const createTask = (config, taskCmds = defaultBuildCmds, taskLogger) => {
6
+ const createTask = (config, taskCmds, taskLogger) => {
7
7
  const { rootPath, packageManager, disableContentHash = false, enableGitHash = false } = config;
8
8
  const task = async (project) => {
9
9
  console.info("run ", project.name);
@@ -21,7 +21,7 @@ const getFinalTaskCmds = (taskCmds, project) => {
21
21
  }
22
22
  return finalTaskCmds;
23
23
  };
24
- const createDependenciesTask = (config, taskCmds = defaultBuildWatchCmds, taskLogger) => {
24
+ const createDependenciesTask = (config, taskCmds, taskLogger) => {
25
25
  const { packageManager } = config;
26
26
  const timelogInstance = timeLog.initTimeLog();
27
27
  const task = async (project) => {
@@ -1,4 +1,4 @@
1
1
  import type { Command } from '@modern-js/utils';
2
2
  import type { PluginAPI } from '@modern-js/core';
3
- import { MonorepoTools } from '../type';
3
+ import type { MonorepoTools } from '../type';
4
4
  export declare const clearCli: (program: Command, api: PluginAPI<MonorepoTools>) => void;
@@ -1,5 +1,5 @@
1
1
  import type { PluginAPI } from '@modern-js/core';
2
- import { MonorepoTools } from '../type';
2
+ import type { MonorepoTools } from '../type';
3
3
  export interface IDeployCommandOption {
4
4
  deployPath?: string;
5
5
  }
@@ -2,4 +2,4 @@ import type { PluginAPI } from '@modern-js/core';
2
2
  export interface IInstallCommandOption {
3
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[], option: IInstallCommandOption, api: PluginAPI) => Promise<void>;
@@ -1,4 +1,4 @@
1
- import { IProjectNode } from '../projects/getProjects';
1
+ import type { IProjectNode } from '../projects/getProjects';
2
2
  export declare const create: (projects: IProjectNode[]) => {
3
3
  projectsMap: Map<any, any>;
4
4
  projectList: string[];
@@ -1,4 +1,4 @@
1
- import { IProjectNode } from '../projects/getProjects';
1
+ import type { IProjectNode } from '../projects/getProjects';
2
2
  export declare class EdgeManager {
3
3
  private _dependencyEdgeHash;
4
4
  constructor();
@@ -1,3 +1,3 @@
1
- import { IProjectNode } from '../projects/getProjects';
1
+ import type { IProjectNode } from '../projects/getProjects';
2
2
  import { DagOperator } from './operator';
3
3
  export declare const initDAG: (projects: IProjectNode[]) => DagOperator;
@@ -1,4 +1,4 @@
1
- import { IProjectNode } from '../projects/getProjects';
1
+ import type { IProjectNode } from '../projects/getProjects';
2
2
  export type Task = (currentProject: IProjectNode, currentProjectPreviousProjects: IProjectNode[], earlyFinishFun: () => void) => Promise<void>;
3
3
  export interface ITraverseConfig {
4
4
  withSelf?: boolean;
@@ -1,4 +1,4 @@
1
- import { IProjectNode } from '../projects/getProjects';
1
+ import type { IProjectNode } from '../projects/getProjects';
2
2
  /**
3
3
  * Calculate the number of packages which must be built before we reach
4
4
  * the furthest away "root" node
@@ -1,5 +1,5 @@
1
1
  import type { ICommandConfig } from '../../type';
2
- import { DagOperator } from '../../dag/operator';
2
+ import type { DagOperator } from '../../dag/operator';
3
3
  export interface IBuildConfig extends ICommandConfig {
4
4
  withSelf?: boolean;
5
5
  onlySelf?: boolean;
@@ -1,4 +1,4 @@
1
- import { IProjectNode } from '../../projects/getProjects';
1
+ import type { IProjectNode } from '../../projects/getProjects';
2
2
  export interface IClearConfig {
3
3
  rootPath: string;
4
4
  removeDirs?: string[];
@@ -1,5 +1,5 @@
1
- import { DagOperator } from '../../dag/operator';
2
- import { PackageManagerType } from '../../parse-config';
1
+ import type { DagOperator } from '../../dag/operator';
2
+ import type { PackageManagerType } from '../../parse-config';
3
3
  interface IDeployConfig {
4
4
  rootPath: string;
5
5
  packageManager: PackageManagerType;
@@ -1,3 +1,3 @@
1
- import { IProjectNode } from '../../projects/getProjects';
1
+ import type { IProjectNode } from '../../projects/getProjects';
2
2
  export type BuildWatchCmdsType = [string] | [string, string] | [string, (project: IProjectNode) => string[]];
3
3
  export declare const defaultBuildWatchCmds: BuildWatchCmdsType;
@@ -1,6 +1,6 @@
1
1
  import type { IProjectNode } from '../../projects/getProjects';
2
2
  import type { MultitasksLogger } from '../../log/multiTasksLog';
3
- import { BuildWatchCmdsType } from './cmds';
3
+ import { type BuildWatchCmdsType } from './cmds';
4
4
  import type { IBuildWatchConfig } from '.';
5
- export declare const createDependenciesTask: (config: IBuildWatchConfig, taskCmds: BuildWatchCmdsType | undefined, taskLogger: MultitasksLogger) => (project: IProjectNode) => Promise<void>;
5
+ export declare const createDependenciesTask: (config: IBuildWatchConfig, taskCmds: BuildWatchCmdsType, taskLogger: MultitasksLogger) => (project: IProjectNode) => Promise<void>;
6
6
  export declare const createDevTask: (config: IBuildWatchConfig, taskCmds: BuildWatchCmdsType | undefined, taskLogger: MultitasksLogger) => (project: IProjectNode) => Promise<void>;
@@ -1,9 +1,9 @@
1
1
  import anymatch from 'anymatch';
2
- import { ICommandConfig } from '../../type';
3
- import { DagOperator } from '../../dag/operator';
4
- import { IProjectNode } from '../../projects/getProjects';
5
- import { Argu } from '../../utils/types';
6
- import { BuildWatchCmdsType } from './cmds';
2
+ import type { ICommandConfig } from '../../type';
3
+ import type { DagOperator } from '../../dag/operator';
4
+ import type { IProjectNode } from '../../projects/getProjects';
5
+ import type { Argu } from '../../utils/types';
6
+ import { type BuildWatchCmdsType } from './cmds';
7
7
  export interface IBuildWatchConfig extends ICommandConfig {
8
8
  onlySelf?: boolean;
9
9
  ignoreMaybeChanged?: Argu<typeof anymatch>;
@@ -1,5 +1,5 @@
1
- import { IProjectNode } from '../../projects/getProjects';
2
- import { IBuildWatchConfig } from '.';
1
+ import type { IProjectNode } from '../../projects/getProjects';
2
+ import type { IBuildWatchConfig } from '.';
3
3
  export declare class WatchedProjectsState {
4
4
  private readonly _config;
5
5
  private readonly _fromNodes;
@@ -1,5 +1,5 @@
1
1
  import type { CliPlugin } from '@modern-js/core';
2
- import { MonorepoTools } from './type';
2
+ import type { MonorepoTools } from './type';
3
3
  export * from './projects/getProjects';
4
4
  export declare const monorepoTools: () => CliPlugin<MonorepoTools>;
5
5
  export default monorepoTools;
@@ -1,4 +1,4 @@
1
- import { Signale, SignaleOptions } from '@modern-js/utils';
1
+ import { Signale, type 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
4
  export declare const endTime: (signaleInstance: Signale, prefix?: string) => void;
@@ -1,4 +1,4 @@
1
- import { IProjectNode } from './getProjects';
1
+ import type { IProjectNode } from './getProjects';
2
2
  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";
@@ -1,2 +1,2 @@
1
- import { IProjectNode } from './getProjects';
1
+ import type { IProjectNode } from './getProjects';
2
2
  export declare const clearProjectsMemoryFile: (projects: IProjectNode[]) => void;
@@ -1,5 +1,5 @@
1
- import { PackageManagerType } from './parse-config';
2
- import { hooks } from './hooks';
1
+ import type { PackageManagerType } from './parse-config';
2
+ import type { hooks } from './hooks';
3
3
  export interface IPnpmWorkSpace {
4
4
  packages: string[];
5
5
  }
@@ -1,4 +1,4 @@
1
- import { PackageManagerType } from '../parse-config';
1
+ import type { PackageManagerType } from '../parse-config';
2
2
  export declare const removeLockFile: (rootPath: string, packageManager: PackageManagerType) => void;
3
3
  export declare const installByPackageManager: (packageManager: PackageManagerType, { rootPath, removeLock }: {
4
4
  rootPath: string;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.58.0",
18
+ "version": "2.58.2",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -39,16 +39,16 @@
39
39
  "dependencies": {
40
40
  "@rushstack/node-core-library": "^3.39.1",
41
41
  "@rushstack/package-deps-hash": "^3.0.54",
42
+ "@swc/helpers": "0.5.3",
42
43
  "anymatch": "^3.1.2",
43
44
  "md5": "^2.3.0",
44
45
  "p-map": "4.0.0",
45
- "@swc/helpers": "0.5.3",
46
- "@modern-js/core": "2.58.0",
47
- "@modern-js/plugin-changeset": "2.58.0",
48
- "@modern-js/plugin-i18n": "2.58.0",
49
- "@modern-js/plugin": "2.58.0",
50
- "@modern-js/plugin-lint": "2.58.0",
51
- "@modern-js/utils": "2.58.0"
46
+ "@modern-js/core": "2.58.2",
47
+ "@modern-js/plugin-changeset": "2.58.2",
48
+ "@modern-js/plugin-i18n": "2.58.2",
49
+ "@modern-js/plugin": "2.58.2",
50
+ "@modern-js/plugin-lint": "2.58.2",
51
+ "@modern-js/utils": "2.58.2"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/jest": "^29",
@@ -56,8 +56,8 @@
56
56
  "@types/node": "^14",
57
57
  "jest": "^29",
58
58
  "typescript": "^5",
59
- "@scripts/jest-config": "2.58.0",
60
- "@scripts/build": "2.58.0"
59
+ "@scripts/jest-config": "2.58.2",
60
+ "@scripts/build": "2.58.2"
61
61
  },
62
62
  "sideEffects": false,
63
63
  "publishConfig": {