@modern-js/monorepo-tools 2.35.1 → 2.37.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 (95) hide show
  1. package/dist/cjs/cli/build.js +26 -9
  2. package/dist/cjs/cli/buildWatch.js +26 -9
  3. package/dist/cjs/cli/clear.js +26 -9
  4. package/dist/cjs/cli/deploy.js +26 -9
  5. package/dist/cjs/cli/index.js +30 -9
  6. package/dist/cjs/cli/install.js +26 -9
  7. package/dist/cjs/cli/new.js +29 -12
  8. package/dist/cjs/commands/build.js +33 -16
  9. package/dist/cjs/commands/buildWatch.js +32 -15
  10. package/dist/cjs/commands/clear.js +30 -13
  11. package/dist/cjs/commands/deploy.js +34 -17
  12. package/dist/cjs/commands/index.js +28 -8
  13. package/dist/cjs/commands/install.js +32 -15
  14. package/dist/cjs/constants.js +25 -15
  15. package/dist/cjs/dag/create.js +24 -7
  16. package/dist/cjs/dag/edgeManager.js +26 -9
  17. package/dist/cjs/dag/index.js +28 -11
  18. package/dist/cjs/dag/operator.js +58 -32
  19. package/dist/cjs/dag/task.js +46 -20
  20. package/dist/cjs/dag/utils.js +33 -25
  21. package/dist/cjs/features/build/index.js +51 -32
  22. package/dist/cjs/features/clear/index.js +47 -28
  23. package/dist/cjs/features/deploy/index.js +65 -39
  24. package/dist/cjs/features/dev/cmds.js +24 -7
  25. package/dist/cjs/features/dev/createTask.js +50 -31
  26. package/dist/cjs/features/dev/index.js +47 -21
  27. package/dist/cjs/features/dev/watchProjectsState.js +43 -17
  28. package/dist/cjs/features/install/index.js +53 -27
  29. package/dist/cjs/hooks/index.js +26 -9
  30. package/dist/cjs/index.js +45 -35
  31. package/dist/cjs/locale/en.js +24 -7
  32. package/dist/cjs/locale/index.js +31 -21
  33. package/dist/cjs/locale/zh.js +24 -7
  34. package/dist/cjs/log/error.js +24 -7
  35. package/dist/cjs/log/multiTasksLog.js +33 -16
  36. package/dist/cjs/log/time.js +29 -20
  37. package/dist/cjs/log/utils.js +24 -7
  38. package/dist/cjs/package/index.js +28 -11
  39. package/dist/cjs/parse-config/index.js +39 -13
  40. package/dist/cjs/parse-config/monorepo.js +55 -39
  41. package/dist/cjs/projects/checkProjectChange.js +65 -50
  42. package/dist/cjs/projects/clearMemoryFiles.js +39 -13
  43. package/dist/cjs/projects/getProjects.js +37 -27
  44. package/dist/cjs/projects/getProjectsByPackagesConfig.js +51 -33
  45. package/dist/cjs/projects/getProjectsByWorkspaceFile.js +59 -40
  46. package/dist/cjs/type.js +15 -3
  47. package/dist/cjs/utils/install.js +43 -24
  48. package/dist/cjs/utils/types.js +15 -3
  49. package/dist/esm/cli/build.js +4 -1
  50. package/dist/esm/cli/buildWatch.js +4 -1
  51. package/dist/esm/cli/clear.js +4 -1
  52. package/dist/esm/cli/deploy.js +4 -1
  53. package/dist/esm/cli/install.js +4 -1
  54. package/dist/esm/cli/new.js +4 -1
  55. package/dist/esm/commands/build.js +4 -1
  56. package/dist/esm/commands/buildWatch.js +4 -1
  57. package/dist/esm/commands/clear.js +4 -1
  58. package/dist/esm/commands/deploy.js +4 -1
  59. package/dist/esm/commands/install.js +4 -1
  60. package/dist/esm/constants.js +6 -2
  61. package/dist/esm/dag/create.js +4 -1
  62. package/dist/esm/dag/edgeManager.js +4 -1
  63. package/dist/esm/dag/index.js +4 -1
  64. package/dist/esm/dag/operator.js +4 -1
  65. package/dist/esm/dag/task.js +4 -1
  66. package/dist/esm/dag/utils.js +10 -4
  67. package/dist/esm/features/build/index.js +6 -2
  68. package/dist/esm/features/clear/index.js +6 -2
  69. package/dist/esm/features/deploy/index.js +4 -1
  70. package/dist/esm/features/dev/cmds.js +4 -1
  71. package/dist/esm/features/dev/createTask.js +6 -2
  72. package/dist/esm/features/dev/index.js +4 -1
  73. package/dist/esm/features/dev/watchProjectsState.js +4 -1
  74. package/dist/esm/features/install/index.js +4 -1
  75. package/dist/esm/hooks/index.js +4 -1
  76. package/dist/esm/index.js +6 -2
  77. package/dist/esm/locale/en.js +4 -1
  78. package/dist/esm/locale/index.js +4 -1
  79. package/dist/esm/locale/zh.js +4 -1
  80. package/dist/esm/log/error.js +4 -1
  81. package/dist/esm/log/multiTasksLog.js +4 -1
  82. package/dist/esm/log/time.js +8 -3
  83. package/dist/esm/log/utils.js +4 -1
  84. package/dist/esm/package/index.js +4 -1
  85. package/dist/esm/parse-config/index.js +4 -1
  86. package/dist/esm/parse-config/monorepo.js +12 -5
  87. package/dist/esm/projects/checkProjectChange.js +12 -5
  88. package/dist/esm/projects/clearMemoryFiles.js +4 -1
  89. package/dist/esm/projects/getProjects.js +6 -2
  90. package/dist/esm/projects/getProjectsByPackagesConfig.js +6 -2
  91. package/dist/esm/projects/getProjectsByWorkspaceFile.js +6 -2
  92. package/dist/esm/type.js +0 -1
  93. package/dist/esm/utils/install.js +6 -2
  94. package/dist/esm/utils/types.js +0 -1
  95. package/package.json +11 -11
@@ -87,7 +87,7 @@ const checkFindProjectsMode = (config) => {
87
87
  }
88
88
  errorLog("No `packagesMatchs` and `projectsConfig` configurations found");
89
89
  };
90
- export const getProjects = async (config, currentDir = process.cwd()) => {
90
+ const getProjects = async (config, currentDir = process.cwd()) => {
91
91
  const { rootPath } = getMonorepoBaseData(currentDir);
92
92
  const mode = checkFindProjectsMode(config);
93
93
  let projects = [];
@@ -98,7 +98,7 @@ export const getProjects = async (config, currentDir = process.cwd()) => {
98
98
  }
99
99
  return projects;
100
100
  };
101
- export const syncGetProjects = (config, currentDir = process.cwd()) => {
101
+ const syncGetProjects = (config, currentDir = process.cwd()) => {
102
102
  const { rootPath } = getMonorepoBaseData(currentDir);
103
103
  const mode = checkFindProjectsMode(config);
104
104
  let projects = [];
@@ -109,3 +109,7 @@ export const syncGetProjects = (config, currentDir = process.cwd()) => {
109
109
  }
110
110
  return projects;
111
111
  };
112
+ export {
113
+ getProjects,
114
+ syncGetProjects
115
+ };
@@ -45,7 +45,7 @@ const makeFileFinder = (rootPath, packageConfigs, ignoreConfigs = []) => {
45
45
  return results.reduce((acc, result) => acc.concat(result), []);
46
46
  };
47
47
  };
48
- export const getProjectsByPackageConfig = async (rootPath, packagesConfig, ignoreConfigs) => {
48
+ const getProjectsByPackageConfig = async (rootPath, packagesConfig, ignoreConfigs) => {
49
49
  const finder = makeFileFinder(rootPath, packagesConfig, ignoreConfigs);
50
50
  const fileName = "package.json";
51
51
  const mapper = (packageConfigPath) => {
@@ -77,7 +77,7 @@ const makeSyncFileFinder = (rootPath, packageConfigs, ignoreConfigs = []) => {
77
77
  return results.reduce((acc, result) => acc.concat(result), []);
78
78
  };
79
79
  };
80
- export const syncGetProjectsByPackageConfig = (rootPath, packagesConfig, ignoreConfigs) => {
80
+ const syncGetProjectsByPackageConfig = (rootPath, packagesConfig, ignoreConfigs) => {
81
81
  const finder = makeSyncFileFinder(rootPath, packagesConfig, ignoreConfigs);
82
82
  const fileName = "package.json";
83
83
  const mapper = (packageConfigPath) => {
@@ -90,3 +90,7 @@ export const syncGetProjectsByPackageConfig = (rootPath, packagesConfig, ignoreC
90
90
  const projects = finder(fileName, (filePaths) => filePaths.map((filePath) => mapper(filePath)), {});
91
91
  return projects;
92
92
  };
93
+ export {
94
+ getProjectsByPackageConfig,
95
+ syncGetProjectsByPackageConfig
96
+ };
@@ -4,7 +4,7 @@ import { fs, yaml } from "@modern-js/utils";
4
4
  import { getWorkspaceFile } from "../parse-config/monorepo";
5
5
  import { WORKSPACE_FILE } from "../constants";
6
6
  import { getProjectsByPackageConfig, syncGetProjectsByPackageConfig } from "./getProjectsByPackagesConfig";
7
- export const getProjectsByWorkspaceFile = async (rootPath, config, ignoreConfigs) => {
7
+ const getProjectsByWorkspaceFile = async (rootPath, config, ignoreConfigs) => {
8
8
  var _config_workspaceFile;
9
9
  let { workspaceFile } = config;
10
10
  if (!config.enableAutoFinder && (!("workspaceFile" in config) || ((_config_workspaceFile = config.workspaceFile) === null || _config_workspaceFile === void 0 ? void 0 : _config_workspaceFile.length) === 0)) {
@@ -30,7 +30,7 @@ export const getProjectsByWorkspaceFile = async (rootPath, config, ignoreConfigs
30
30
  const projects = await getProjectsByPackageConfig(rootPath, packagesConfig, ignoreConfigs);
31
31
  return projects;
32
32
  };
33
- export const syncGetProjectsByWorkspaceFile = (rootPath, config, ignoreConfigs) => {
33
+ const syncGetProjectsByWorkspaceFile = (rootPath, config, ignoreConfigs) => {
34
34
  var _config_workspaceFile;
35
35
  let { workspaceFile } = config;
36
36
  if (!config.enableAutoFinder && (!("workspaceFile" in config) || ((_config_workspaceFile = config.workspaceFile) === null || _config_workspaceFile === void 0 ? void 0 : _config_workspaceFile.length) === 0)) {
@@ -56,3 +56,7 @@ export const syncGetProjectsByWorkspaceFile = (rootPath, config, ignoreConfigs)
56
56
  const projects = syncGetProjectsByPackageConfig(rootPath, packagesConfig, ignoreConfigs);
57
57
  return projects;
58
58
  };
59
+ export {
60
+ getProjectsByWorkspaceFile,
61
+ syncGetProjectsByWorkspaceFile
62
+ };
package/dist/esm/type.js CHANGED
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +1,7 @@
1
1
  import * as path from "path";
2
2
  import { fs, execa } from "@modern-js/utils";
3
3
  import { LOCK_FILE } from "../constants";
4
- export const removeLockFile = (rootPath, packageManager) => {
4
+ const removeLockFile = (rootPath, packageManager) => {
5
5
  if (packageManager === "pnpm") {
6
6
  fs.removeSync(path.join(rootPath, LOCK_FILE.PNPM));
7
7
  } else if (packageManager === "yarn") {
@@ -10,7 +10,7 @@ export const removeLockFile = (rootPath, packageManager) => {
10
10
  fs.removeSync(path.join(rootPath, LOCK_FILE.NPM));
11
11
  }
12
12
  };
13
- export const installByPackageManager = async (packageManager, { rootPath, removeLock }) => {
13
+ const installByPackageManager = async (packageManager, { rootPath, removeLock }) => {
14
14
  if (removeLock) {
15
15
  removeLockFile(rootPath, packageManager);
16
16
  }
@@ -29,3 +29,7 @@ export const installByPackageManager = async (packageManager, { rootPath, remove
29
29
  });
30
30
  }
31
31
  };
32
+ export {
33
+ installByPackageManager,
34
+ removeLockFile
35
+ };
@@ -1 +0,0 @@
1
- export {};
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.35.1",
18
+ "version": "2.37.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.1",
46
- "@modern-js/core": "2.35.1",
47
- "@modern-js/new-action": "2.35.1",
48
- "@modern-js/upgrade": "2.35.1",
49
- "@modern-js/plugin": "2.35.1",
50
- "@modern-js/plugin-changeset": "2.35.1",
51
- "@modern-js/plugin-i18n": "2.35.1",
52
- "@modern-js/plugin-lint": "2.35.1",
53
- "@modern-js/utils": "2.35.1"
46
+ "@modern-js/core": "2.37.0",
47
+ "@modern-js/new-action": "2.37.0",
48
+ "@modern-js/upgrade": "2.37.0",
49
+ "@modern-js/plugin": "2.37.0",
50
+ "@modern-js/plugin-changeset": "2.37.0",
51
+ "@modern-js/plugin-i18n": "2.37.0",
52
+ "@modern-js/plugin-lint": "2.37.0",
53
+ "@modern-js/utils": "2.37.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.35.1",
62
- "@scripts/jest-config": "2.35.1"
61
+ "@scripts/build": "2.37.0",
62
+ "@scripts/jest-config": "2.37.0"
63
63
  },
64
64
  "sideEffects": false,
65
65
  "publishConfig": {