@modern-js/new-action 1.3.11 → 1.15.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/CHANGELOG.md +49 -0
- package/dist/js/modern/monorepo.js +16 -2
- package/dist/js/node/monorepo.js +20 -3
- package/dist/types/monorepo.d.ts +1 -1
- package/package.json +9 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# @modern-js/new-action
|
|
2
2
|
|
|
3
|
+
## 1.15.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [8658a78]
|
|
8
|
+
- Updated dependencies [05d4a4f]
|
|
9
|
+
- Updated dependencies [ad05af9]
|
|
10
|
+
- Updated dependencies [5d53d1c]
|
|
11
|
+
- Updated dependencies [9e6a0aa]
|
|
12
|
+
- Updated dependencies [37cd159]
|
|
13
|
+
- @modern-js/generator-common@2.2.1
|
|
14
|
+
- @modern-js/utils@1.15.0
|
|
15
|
+
- @modern-js/generator-utils@2.2.1
|
|
16
|
+
|
|
17
|
+
## 1.4.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- 52374e3: chore(generator): use module-tools bundle function to bundle generator package
|
|
22
|
+
|
|
23
|
+
chore(generator): 使用 module-tools 的 bundle 功能实现生成器打包
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- 281edd5: fix: monorepo new command plugin path
|
|
28
|
+
|
|
29
|
+
fix: 修复 monorepo tools new 命令计算插件路径
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [4fc801f]
|
|
32
|
+
- Updated dependencies [c8614b8]
|
|
33
|
+
- Updated dependencies [52374e3]
|
|
34
|
+
- @modern-js/utils@1.8.0
|
|
35
|
+
- @modern-js/generator-common@1.6.0
|
|
36
|
+
- @modern-js/generator-utils@1.4.0
|
|
37
|
+
|
|
38
|
+
## 1.3.12
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- 74e74ee: fix: monorepo-tools new command plugin params not work
|
|
43
|
+
|
|
44
|
+
fix: 修复 monorepo-tools new 命令 plugin 参数不生效问题
|
|
45
|
+
|
|
46
|
+
- Updated dependencies [72907b2]
|
|
47
|
+
- Updated dependencies [33cebd2]
|
|
48
|
+
- @modern-js/generator-common@1.5.0
|
|
49
|
+
- @modern-js/generator-utils@1.3.0
|
|
50
|
+
- @modern-js/utils@1.7.12
|
|
51
|
+
|
|
3
52
|
## 1.3.11
|
|
4
53
|
|
|
5
54
|
### Patch Changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import path from 'path';
|
|
1
2
|
import { merge } from '@modern-js/utils/lodash';
|
|
2
3
|
import { CodeSmith } from '@modern-js/codesmith';
|
|
3
4
|
import { i18n } from '@modern-js/generator-common';
|
|
@@ -11,7 +12,7 @@ export const MonorepoNewAction = async options => {
|
|
|
11
12
|
debug = false,
|
|
12
13
|
registry = '',
|
|
13
14
|
config = '{}',
|
|
14
|
-
|
|
15
|
+
plugin = [],
|
|
15
16
|
cwd = process.cwd()
|
|
16
17
|
} = options;
|
|
17
18
|
let UserConfig = {};
|
|
@@ -32,8 +33,21 @@ export const MonorepoNewAction = async options => {
|
|
|
32
33
|
|
|
33
34
|
if (!alreadyRepo(cwd)) {
|
|
34
35
|
smith.logger.warn('not valid modern.js repo');
|
|
35
|
-
}
|
|
36
|
+
} // Determine if the plugin is a Monorepo dependency
|
|
37
|
+
|
|
36
38
|
|
|
39
|
+
const plugins = plugin.map(plugin => {
|
|
40
|
+
try {
|
|
41
|
+
return path.join(require.resolve(plugin), '../../');
|
|
42
|
+
} catch (e) {
|
|
43
|
+
try {
|
|
44
|
+
// 兼容旧版打包路径
|
|
45
|
+
return path.join(require.resolve(plugin), '../../../../');
|
|
46
|
+
} catch (e) {
|
|
47
|
+
return plugin;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
37
51
|
const finalConfig = merge(UserConfig, {
|
|
38
52
|
locale: UserConfig.locale || locale,
|
|
39
53
|
packageManager: UserConfig.packageManager || (await getPackageManager(cwd)),
|
package/dist/js/node/monorepo.js
CHANGED
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.MonorepoNewAction = void 0;
|
|
7
7
|
|
|
8
|
+
var _path = _interopRequireDefault(require("path"));
|
|
9
|
+
|
|
8
10
|
var _lodash = require("@modern-js/utils/lodash");
|
|
9
11
|
|
|
10
12
|
var _codesmith = require("@modern-js/codesmith");
|
|
@@ -15,6 +17,8 @@ var _generatorUtils = require("@modern-js/generator-utils");
|
|
|
15
17
|
|
|
16
18
|
var _utils = require("./utils");
|
|
17
19
|
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
18
22
|
const REPO_GENERATOR = '@modern-js/repo-generator';
|
|
19
23
|
|
|
20
24
|
const MonorepoNewAction = async options => {
|
|
@@ -24,7 +28,7 @@ const MonorepoNewAction = async options => {
|
|
|
24
28
|
debug = false,
|
|
25
29
|
registry = '',
|
|
26
30
|
config = '{}',
|
|
27
|
-
|
|
31
|
+
plugin = [],
|
|
28
32
|
cwd = process.cwd()
|
|
29
33
|
} = options;
|
|
30
34
|
let UserConfig = {};
|
|
@@ -46,8 +50,21 @@ const MonorepoNewAction = async options => {
|
|
|
46
50
|
|
|
47
51
|
if (!(0, _utils.alreadyRepo)(cwd)) {
|
|
48
52
|
smith.logger.warn('not valid modern.js repo');
|
|
49
|
-
}
|
|
50
|
-
|
|
53
|
+
} // Determine if the plugin is a Monorepo dependency
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
const plugins = plugin.map(plugin => {
|
|
57
|
+
try {
|
|
58
|
+
return _path.default.join(require.resolve(plugin), '../../');
|
|
59
|
+
} catch (e) {
|
|
60
|
+
try {
|
|
61
|
+
// 兼容旧版打包路径
|
|
62
|
+
return _path.default.join(require.resolve(plugin), '../../../../');
|
|
63
|
+
} catch (e) {
|
|
64
|
+
return plugin;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
51
68
|
const finalConfig = (0, _lodash.merge)(UserConfig, {
|
|
52
69
|
locale: UserConfig.locale || locale,
|
|
53
70
|
packageManager: UserConfig.packageManager || (await (0, _generatorUtils.getPackageManager)(cwd)),
|
package/dist/types/monorepo.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -11,11 +11,10 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.
|
|
14
|
+
"version": "1.15.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
18
|
-
"module": "./dist/js/treeshaking/index.js",
|
|
19
18
|
"jsnext:modern": "./dist/js/modern/index.js",
|
|
20
19
|
"exports": {
|
|
21
20
|
".": {
|
|
@@ -24,24 +23,24 @@
|
|
|
24
23
|
"import": "./dist/js/modern/index.js",
|
|
25
24
|
"require": "./dist/js/node/index.js"
|
|
26
25
|
},
|
|
27
|
-
"default": "./dist/js/
|
|
26
|
+
"default": "./dist/js/node/index.js"
|
|
28
27
|
}
|
|
29
28
|
},
|
|
30
29
|
"dependencies": {
|
|
31
30
|
"@babel/runtime": "^7.18.0",
|
|
32
|
-
"@modern-js/codesmith": "^1.
|
|
33
|
-
"@modern-js/codesmith-api-app": "^1.
|
|
34
|
-
"@modern-js/generator-common": "
|
|
35
|
-
"@modern-js/generator-utils": "
|
|
36
|
-
"@modern-js/utils": "
|
|
31
|
+
"@modern-js/codesmith": "^1.4.0",
|
|
32
|
+
"@modern-js/codesmith-api-app": "^1.3.0",
|
|
33
|
+
"@modern-js/generator-common": "2.2.1",
|
|
34
|
+
"@modern-js/generator-utils": "2.2.1",
|
|
35
|
+
"@modern-js/utils": "1.15.0"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
38
|
"@types/jest": "^27",
|
|
40
39
|
"@types/node": "^14",
|
|
41
40
|
"typescript": "^4",
|
|
42
|
-
"@scripts/build": "
|
|
41
|
+
"@scripts/build": "1.15.0",
|
|
43
42
|
"jest": "^27",
|
|
44
|
-
"@scripts/jest-config": "
|
|
43
|
+
"@scripts/jest-config": "1.15.0"
|
|
45
44
|
},
|
|
46
45
|
"sideEffects": false,
|
|
47
46
|
"modernConfig": {
|