@modern-js/utils 0.0.0-canary-20211113104942 → 0.0.0-runtime-2021112115358
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +14 -6
- package/dist/js/modern/alias.js +10 -10
- package/dist/js/modern/constants.js +5 -1
- package/dist/js/modern/getEntryOptions.js +2 -2
- package/dist/js/modern/is/index.js +3 -2
- package/dist/js/modern/logger.js +2 -2
- package/dist/js/modern/monorepo.js +2 -2
- package/dist/js/node/alias.js +10 -10
- package/dist/js/node/constants.js +5 -1
- package/dist/js/node/getEntryOptions.js +2 -2
- package/dist/js/node/is/index.js +3 -2
- package/dist/js/node/logger.js +2 -2
- package/dist/js/node/monorepo.js +2 -2
- package/dist/js/treeshaking/alias.js +9 -9
- package/dist/js/treeshaking/constants.js +5 -1
- package/dist/js/treeshaking/formatWebpackMessages.js +1 -1
- package/dist/js/treeshaking/getEntryOptions.js +2 -2
- package/dist/js/treeshaking/is/index.js +4 -2
- package/dist/js/treeshaking/is/type.js +1 -1
- package/dist/js/treeshaking/logger.js +3 -3
- package/dist/js/treeshaking/monorepo.js +2 -2
- package/dist/types/constants.d.ts +1 -0
- package/package.json +2 -2
- package/src/alias.ts +7 -7
- package/src/constants.ts +2 -0
- package/src/is/index.ts +4 -2
package/CHANGELOG.md
CHANGED
@@ -1,14 +1,22 @@
|
|
1
1
|
# @modern-js/utils
|
2
2
|
|
3
|
-
## 0.0.0-
|
3
|
+
## 0.0.0-runtime-2021112115358
|
4
4
|
|
5
5
|
### Patch Changes
|
6
6
|
|
7
|
-
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
- a1795c10: feat: add exclude plugin
|
8
|
+
|
9
|
+
## 1.1.4
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- d927bc83: update plugins list
|
14
|
+
- d73ff455: support multi process product
|
15
|
+
- 9c1ab865: fix: filter invalid ts paths
|
16
|
+
- d73ff455: support multi process product
|
17
|
+
- d73ff455: support multi process product
|
18
|
+
- d73ff455: support multi process product
|
19
|
+
- d73ff455: support multi process product
|
12
20
|
|
13
21
|
## 1.1.3
|
14
22
|
|
package/dist/js/modern/alias.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
2
2
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
4
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
6
|
|
@@ -63,12 +63,12 @@ export const getAlias = (aliasOption, option) => {
|
|
63
63
|
}
|
64
64
|
|
65
65
|
return aliasConfig;
|
66
|
-
};
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
return userKeys.reduce((o, k) => {
|
66
|
+
}; // filter invalid ts paths that are not array
|
67
|
+
|
68
|
+
export const getUserAlias = (alias = {}) => Object.keys(alias).reduce((o, k) => {
|
69
|
+
if (Array.isArray(alias[k])) {
|
71
70
|
o[k] = alias[k];
|
72
|
-
|
73
|
-
|
74
|
-
|
71
|
+
}
|
72
|
+
|
73
|
+
return o;
|
74
|
+
}, {});
|
@@ -162,6 +162,9 @@ export const INTERNAL_PLUGINS = {
|
|
162
162
|
},
|
163
163
|
'@modern-js/plugin-multiprocess': {
|
164
164
|
cli: '@modern-js/plugin-multiprocess/cli'
|
165
|
+
},
|
166
|
+
'@modern-js/plugin-nocode': {
|
167
|
+
cli: '@modern-js/plugin-nocode/cli'
|
165
168
|
}
|
166
169
|
};
|
167
170
|
/**
|
@@ -307,5 +310,6 @@ export const PLUGIN_SCHEMAS = {
|
|
307
310
|
schema: {
|
308
311
|
type: ['object']
|
309
312
|
}
|
310
|
-
}]
|
313
|
+
}],
|
314
|
+
'@modern-js/plugin-nocode': []
|
311
315
|
};
|
@@ -1,6 +1,6 @@
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
2
2
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
4
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
6
|
|
@@ -14,9 +14,10 @@ export const isDepExists = (appDirectory, name) => {
|
|
14
14
|
|
15
15
|
const {
|
16
16
|
dependencies = {},
|
17
|
-
devDependencies = {}
|
17
|
+
devDependencies = {},
|
18
|
+
excludePlugin = {}
|
18
19
|
} = json;
|
19
|
-
return dependencies.hasOwnProperty(name) || devDependencies.hasOwnProperty(name);
|
20
|
+
return (dependencies.hasOwnProperty(name) || devDependencies.hasOwnProperty(name)) && !excludePlugin.hasOwnProperty(name);
|
20
21
|
};
|
21
22
|
/**
|
22
23
|
* Is typescript project.
|
package/dist/js/modern/logger.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
2
2
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
4
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
2
2
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
4
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
6
|
|
package/dist/js/node/alias.js
CHANGED
@@ -17,9 +17,9 @@ var _applyOptionsChain = require("./applyOptionsChain");
|
|
17
17
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
19
|
|
20
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
21
21
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
23
23
|
|
24
24
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
25
25
|
|
@@ -81,17 +81,17 @@ const getAlias = (aliasOption, option) => {
|
|
81
81
|
}
|
82
82
|
|
83
83
|
return aliasConfig;
|
84
|
-
};
|
84
|
+
}; // filter invalid ts paths that are not array
|
85
|
+
|
85
86
|
|
86
87
|
exports.getAlias = getAlias;
|
87
88
|
|
88
|
-
const getUserAlias = (alias = {}) => {
|
89
|
-
|
90
|
-
const userKeys = keys.filter(key => !key.includes('@modern-js/runtime'));
|
91
|
-
return userKeys.reduce((o, k) => {
|
89
|
+
const getUserAlias = (alias = {}) => Object.keys(alias).reduce((o, k) => {
|
90
|
+
if (Array.isArray(alias[k])) {
|
92
91
|
o[k] = alias[k];
|
93
|
-
|
94
|
-
|
95
|
-
|
92
|
+
}
|
93
|
+
|
94
|
+
return o;
|
95
|
+
}, {});
|
96
96
|
|
97
97
|
exports.getUserAlias = getUserAlias;
|
@@ -183,6 +183,9 @@ const INTERNAL_PLUGINS = {
|
|
183
183
|
},
|
184
184
|
'@modern-js/plugin-multiprocess': {
|
185
185
|
cli: '@modern-js/plugin-multiprocess/cli'
|
186
|
+
},
|
187
|
+
'@modern-js/plugin-nocode': {
|
188
|
+
cli: '@modern-js/plugin-nocode/cli'
|
186
189
|
}
|
187
190
|
};
|
188
191
|
/**
|
@@ -329,6 +332,7 @@ const PLUGIN_SCHEMAS = {
|
|
329
332
|
schema: {
|
330
333
|
type: ['object']
|
331
334
|
}
|
332
|
-
}]
|
335
|
+
}],
|
336
|
+
'@modern-js/plugin-nocode': []
|
333
337
|
};
|
334
338
|
exports.PLUGIN_SCHEMAS = PLUGIN_SCHEMAS;
|
@@ -9,9 +9,9 @@ var _is = require("./is");
|
|
9
9
|
|
10
10
|
var _constants = require("./constants");
|
11
11
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
12
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
13
13
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
15
15
|
|
16
16
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
17
17
|
|
package/dist/js/node/is/index.js
CHANGED
@@ -73,9 +73,10 @@ const isDepExists = (appDirectory, name) => {
|
|
73
73
|
|
74
74
|
const {
|
75
75
|
dependencies = {},
|
76
|
-
devDependencies = {}
|
76
|
+
devDependencies = {},
|
77
|
+
excludePlugin = {}
|
77
78
|
} = json;
|
78
|
-
return dependencies.hasOwnProperty(name) || devDependencies.hasOwnProperty(name);
|
79
|
+
return (dependencies.hasOwnProperty(name) || devDependencies.hasOwnProperty(name)) && !excludePlugin.hasOwnProperty(name);
|
79
80
|
};
|
80
81
|
/**
|
81
82
|
* Is typescript project.
|
package/dist/js/node/logger.js
CHANGED
@@ -9,9 +9,9 @@ var _chalk = _interopRequireDefault(require("chalk"));
|
|
9
9
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
11
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
12
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
13
13
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
15
15
|
|
16
16
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
17
17
|
|
package/dist/js/node/monorepo.js
CHANGED
@@ -15,9 +15,9 @@ var _yaml = _interopRequireDefault(require("yaml"));
|
|
15
15
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
17
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
19
19
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
21
21
|
|
22
22
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
23
23
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
2
2
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
4
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
6
|
|
@@ -58,15 +58,15 @@ export var getAlias = function getAlias(aliasOption, option) {
|
|
58
58
|
}
|
59
59
|
|
60
60
|
return aliasConfig;
|
61
|
-
};
|
61
|
+
}; // filter invalid ts paths that are not array
|
62
|
+
|
62
63
|
export var getUserAlias = function getUserAlias() {
|
63
64
|
var alias = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
o[k] = alias[k];
|
65
|
+
return Object.keys(alias).reduce(function (o, k) {
|
66
|
+
if (Array.isArray(alias[k])) {
|
67
|
+
o[k] = alias[k];
|
68
|
+
}
|
69
|
+
|
70
70
|
return o;
|
71
71
|
}, {});
|
72
72
|
};
|
@@ -164,6 +164,9 @@ export var INTERNAL_PLUGINS = {
|
|
164
164
|
},
|
165
165
|
'@modern-js/plugin-multiprocess': {
|
166
166
|
cli: '@modern-js/plugin-multiprocess/cli'
|
167
|
+
},
|
168
|
+
'@modern-js/plugin-nocode': {
|
169
|
+
cli: '@modern-js/plugin-nocode/cli'
|
167
170
|
}
|
168
171
|
};
|
169
172
|
/**
|
@@ -307,5 +310,6 @@ export var PLUGIN_SCHEMAS = {
|
|
307
310
|
schema: {
|
308
311
|
type: ['object']
|
309
312
|
}
|
310
|
-
}]
|
313
|
+
}],
|
314
|
+
'@modern-js/plugin-nocode': []
|
311
315
|
};
|
@@ -10,7 +10,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
10
10
|
|
11
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
12
12
|
|
13
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
13
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
14
14
|
|
15
15
|
/* eslint-disable no-param-reassign */
|
16
16
|
|
@@ -1,6 +1,6 @@
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
2
2
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
4
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
6
|
|
@@ -15,8 +15,10 @@ export var isDepExists = function isDepExists(appDirectory, name) {
|
|
15
15
|
var _json$dependencies = json.dependencies,
|
16
16
|
dependencies = _json$dependencies === void 0 ? {} : _json$dependencies,
|
17
17
|
_json$devDependencies = json.devDependencies,
|
18
|
-
devDependencies = _json$devDependencies === void 0 ? {} : _json$devDependencies
|
19
|
-
|
18
|
+
devDependencies = _json$devDependencies === void 0 ? {} : _json$devDependencies,
|
19
|
+
_json$excludePlugin = json.excludePlugin,
|
20
|
+
excludePlugin = _json$excludePlugin === void 0 ? {} : _json$excludePlugin;
|
21
|
+
return (dependencies.hasOwnProperty(name) || devDependencies.hasOwnProperty(name)) && !excludePlugin.hasOwnProperty(name);
|
20
22
|
};
|
21
23
|
/**
|
22
24
|
* Is typescript project.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
2
2
|
|
3
3
|
export function isString(str) {
|
4
4
|
return typeof str === 'string';
|
@@ -10,9 +10,9 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
10
10
|
|
11
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
12
12
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
14
14
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
16
16
|
|
17
17
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
18
18
|
|
@@ -20,7 +20,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
20
20
|
|
21
21
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
22
22
|
|
23
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
23
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
24
24
|
|
25
25
|
import chalk from 'chalk';
|
26
26
|
var grey = chalk.grey,
|
@@ -1,6 +1,6 @@
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
2
2
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
4
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
6
6
|
|
package/package.json
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
"modern",
|
12
12
|
"modern.js"
|
13
13
|
],
|
14
|
-
"version": "0.0.0-
|
14
|
+
"version": "0.0.0-runtime-2021112115358",
|
15
15
|
"jsnext:source": "./src/index.ts",
|
16
16
|
"types": "./dist/types/index.d.ts",
|
17
17
|
"main": "./dist/js/node/index.js",
|
@@ -66,7 +66,7 @@
|
|
66
66
|
"typescript": "^4",
|
67
67
|
"webpack": "^5.54.0",
|
68
68
|
"@modern-js/plugin-testing": "^1.1.1",
|
69
|
-
"@modern-js/module-tools": "^1.1.
|
69
|
+
"@modern-js/module-tools": "^1.1.2"
|
70
70
|
},
|
71
71
|
"peerDependencies": {
|
72
72
|
"typescript": "^4.4.3"
|
package/src/alias.ts
CHANGED
@@ -80,11 +80,11 @@ export const getAlias = (
|
|
80
80
|
return aliasConfig;
|
81
81
|
};
|
82
82
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
83
|
+
// filter invalid ts paths that are not array
|
84
|
+
export const getUserAlias = (alias: Record<string, string | string[]> = {}) =>
|
85
|
+
Object.keys(alias).reduce((o, k) => {
|
86
|
+
if (Array.isArray(alias[k])) {
|
87
|
+
o[k] = alias[k];
|
88
|
+
}
|
88
89
|
return o;
|
89
|
-
}, {});
|
90
|
-
};
|
90
|
+
}, {} as Record<string, string | string[]>);
|
package/src/constants.ts
CHANGED
@@ -123,6 +123,7 @@ export const INTERNAL_PLUGINS: {
|
|
123
123
|
'@modern-js/plugin-multiprocess': {
|
124
124
|
cli: '@modern-js/plugin-multiprocess/cli',
|
125
125
|
},
|
126
|
+
'@modern-js/plugin-nocode': { cli: '@modern-js/plugin-nocode/cli' },
|
126
127
|
};
|
127
128
|
|
128
129
|
/**
|
@@ -257,4 +258,5 @@ export const PLUGIN_SCHEMAS = {
|
|
257
258
|
schema: { type: ['object'] },
|
258
259
|
},
|
259
260
|
],
|
261
|
+
'@modern-js/plugin-nocode': [],
|
260
262
|
};
|
package/src/is/index.ts
CHANGED
@@ -12,10 +12,12 @@ import { isDev } from './node-env';
|
|
12
12
|
export const isDepExists = (appDirectory: string, name: string): boolean => {
|
13
13
|
const json = require(path.resolve(appDirectory, './package.json'));
|
14
14
|
|
15
|
-
const { dependencies = {}, devDependencies = {} } = json;
|
15
|
+
const { dependencies = {}, devDependencies = {}, excludePlugin = {} } = json;
|
16
16
|
|
17
17
|
return (
|
18
|
-
dependencies.hasOwnProperty(name) ||
|
18
|
+
(dependencies.hasOwnProperty(name) ||
|
19
|
+
devDependencies.hasOwnProperty(name)) &&
|
20
|
+
!excludePlugin.hasOwnProperty(name)
|
19
21
|
);
|
20
22
|
};
|
21
23
|
|