@modern-js/module-tools 2.0.0-beta.0 → 2.0.0-beta.1

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 (93) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/js/modern/cli/build.js +2 -1
  3. package/dist/js/modern/cli/dev.js +2 -2
  4. package/dist/js/modern/cli/new.js +0 -3
  5. package/dist/js/modern/commands/build.js +0 -4
  6. package/dist/js/modern/commands/dev.js +2 -5
  7. package/dist/js/modern/features/build/build-platform.js +11 -14
  8. package/dist/js/modern/features/build/bundle/runRollup.js +5 -18
  9. package/dist/js/modern/features/build/bundle/runSpeedy.js +4 -18
  10. package/dist/js/modern/features/build/bundleless/copy-assets.js +0 -8
  11. package/dist/js/modern/features/build/bundleless/generator-dts/index.js +7 -17
  12. package/dist/js/modern/features/build/bundleless/generator-dts/utils.js +6 -16
  13. package/dist/js/modern/features/build/bundleless/index.js +0 -2
  14. package/dist/js/modern/features/build/bundleless/runBabel.js +7 -34
  15. package/dist/js/modern/features/build/bundleless/style.js +1 -30
  16. package/dist/js/modern/features/build/constants.js +0 -3
  17. package/dist/js/modern/features/build/error.js +4 -27
  18. package/dist/js/modern/features/build/index.js +6 -15
  19. package/dist/js/modern/features/build/legacy-constants.js +8 -4
  20. package/dist/js/modern/features/build/logger/logText.js +0 -12
  21. package/dist/js/modern/features/build/logger/loggerManager.js +6 -19
  22. package/dist/js/modern/features/build/normalize.js +18 -43
  23. package/dist/js/modern/features/build/utils.js +5 -14
  24. package/dist/js/modern/features/dev/index.js +4 -9
  25. package/dist/js/modern/hooks/index.js +0 -3
  26. package/dist/js/modern/index.js +5 -9
  27. package/dist/js/modern/schema/build-config.js +2 -1
  28. package/dist/js/modern/schema/output.js +5 -10
  29. package/dist/js/modern/utils/babel.js +12 -14
  30. package/dist/js/modern/utils/copy.js +6 -15
  31. package/dist/js/modern/utils/init-env.js +0 -1
  32. package/dist/js/modern/utils/logger.js +1 -16
  33. package/dist/js/modern/utils/readline.js +2 -4
  34. package/dist/js/modern/utils/tsconfig.js +0 -1
  35. package/dist/js/modern/utils/tspaths-transform/constants.js +4 -2
  36. package/dist/js/modern/utils/tspaths-transform/index.js +2 -19
  37. package/dist/js/modern/utils/tspaths-transform/utils.js +0 -3
  38. package/dist/js/modern/utils/valide.js +2 -6
  39. package/dist/js/node/cli/build.js +2 -6
  40. package/dist/js/node/cli/dev.js +2 -7
  41. package/dist/js/node/cli/index.js +0 -6
  42. package/dist/js/node/cli/new.js +0 -8
  43. package/dist/js/node/commands/build.js +0 -19
  44. package/dist/js/node/commands/dev.js +2 -15
  45. package/dist/js/node/commands/index.js +0 -2
  46. package/dist/js/node/features/build/build-platform.js +11 -20
  47. package/dist/js/node/features/build/bundle/index.js +0 -6
  48. package/dist/js/node/features/build/bundle/runRollup.js +3 -32
  49. package/dist/js/node/features/build/bundle/runSpeedy.js +4 -32
  50. package/dist/js/node/features/build/bundleless/copy-assets.js +0 -20
  51. package/dist/js/node/features/build/bundleless/generator-dts/index.js +7 -27
  52. package/dist/js/node/features/build/bundleless/generator-dts/utils.js +6 -32
  53. package/dist/js/node/features/build/bundleless/index.js +0 -11
  54. package/dist/js/node/features/build/bundleless/runBabel.js +6 -60
  55. package/dist/js/node/features/build/bundleless/style.js +1 -50
  56. package/dist/js/node/features/build/constants.js +0 -11
  57. package/dist/js/node/features/build/error.js +4 -40
  58. package/dist/js/node/features/build/index.js +6 -38
  59. package/dist/js/node/features/build/legacy-constants.js +8 -4
  60. package/dist/js/node/features/build/logger/index.js +0 -4
  61. package/dist/js/node/features/build/logger/logText.js +0 -18
  62. package/dist/js/node/features/build/logger/loggerManager.js +5 -26
  63. package/dist/js/node/features/build/normalize.js +18 -61
  64. package/dist/js/node/features/build/utils.js +5 -30
  65. package/dist/js/node/features/dev/index.js +4 -17
  66. package/dist/js/node/hooks/build.js +0 -5
  67. package/dist/js/node/hooks/dev.js +0 -5
  68. package/dist/js/node/hooks/index.js +0 -10
  69. package/dist/js/node/index.js +6 -26
  70. package/dist/js/node/locale/index.js +0 -5
  71. package/dist/js/node/schema/build-config.js +2 -1
  72. package/dist/js/node/schema/index.js +0 -5
  73. package/dist/js/node/schema/output.js +5 -12
  74. package/dist/js/node/utils/babel.js +12 -22
  75. package/dist/js/node/utils/color.js +0 -3
  76. package/dist/js/node/utils/copy.js +6 -23
  77. package/dist/js/node/utils/init-env.js +0 -3
  78. package/dist/js/node/utils/json.js +0 -2
  79. package/dist/js/node/utils/language.js +0 -3
  80. package/dist/js/node/utils/logger.js +1 -26
  81. package/dist/js/node/utils/readline.js +0 -8
  82. package/dist/js/node/utils/tsconfig.js +0 -7
  83. package/dist/js/node/utils/tspaths-transform/constants.js +4 -2
  84. package/dist/js/node/utils/tspaths-transform/index.js +2 -34
  85. package/dist/js/node/utils/tspaths-transform/utils.js +0 -7
  86. package/dist/js/node/utils/valide.js +2 -11
  87. package/dist/types/commands/build.d.ts +0 -1
  88. package/dist/types/features/build/logger/loggerManager.d.ts +0 -1
  89. package/dist/types/features/build/utils.d.ts +0 -1
  90. package/dist/types/index.d.ts +0 -2
  91. package/dist/types/schema/types.d.ts +1 -3
  92. package/dist/types/types.d.ts +0 -1
  93. package/package.json +19 -19
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getLocaleLanguage = getLocaleLanguage;
7
-
8
7
  var _utils = require("@modern-js/utils");
9
-
10
8
  const i18n = _utils.Import.lazy('@modern-js/plugin-i18n/language-detector', require);
11
-
12
9
  function getLocaleLanguage() {
13
10
  const detector = new i18n.I18CLILanguageDetector();
14
11
  return detector.detect();
@@ -4,18 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.logTemplate = exports.clearFlag = exports.LoggerText = exports.LoggerManager = void 0;
7
-
8
7
  var _events = _interopRequireDefault(require("events"));
9
-
10
8
  var _utils = require("@modern-js/utils");
11
-
12
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
10
  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; }
15
-
16
11
  const clearFlag = '\x1Bc';
17
12
  exports.clearFlag = clearFlag;
18
-
19
13
  const logTemplate = (title, messageStack, maxLength, {
20
14
  noBottomBorder: _noBottomBorder = false,
21
15
  bottomBorderText: _bottomBorderText = '',
@@ -31,39 +25,29 @@ const logTemplate = (title, messageStack, maxLength, {
31
25
  .filter(s => s !== leftBorderFlag) // 过滤空字符串
32
26
  .slice(0, maxLength) // 控制长度
33
27
  .reverse(); // 调换顺序,最新的消息在最后面
34
-
35
28
  messageFragments[messageFragments.length - 1] = messageFragments[messageFragments.length - 1].trim();
36
29
  const template = `${title}:
37
30
  ${_contentColor(messageFragments.join(''))}${_noBottomBorder ? '' : `\n${_bottomBorderText}`}`;
38
31
  console.info('template', messageFragments);
39
32
  return template;
40
33
  };
41
-
42
34
  exports.logTemplate = logTemplate;
43
-
44
35
  class LoggerText {
45
36
  constructor(option) {
46
37
  _defineProperty(this, "messages", void 0);
47
-
48
38
  _defineProperty(this, "option", void 0);
49
-
50
39
  this.messages = [];
51
40
  this.option = option;
52
41
  }
53
-
54
42
  append(message) {
55
43
  var _this$option$contentC;
56
-
57
44
  const replace = ((_this$option$contentC = this.option.contentConfig) === null || _this$option$contentC === void 0 ? void 0 : _this$option$contentC.replace) || [];
58
45
  let content = message;
59
-
60
46
  for (const r of replace) {
61
47
  content = content.replace(new RegExp(r, 'g'), '');
62
48
  }
63
-
64
49
  this.messages.push(content);
65
50
  }
66
-
67
51
  get value() {
68
52
  const {
69
53
  title,
@@ -73,17 +57,14 @@ class LoggerText {
73
57
  const messages = [...new Set(this.messages)];
74
58
  return logTemplate(title, messages, maxLength, contentConfig);
75
59
  }
76
-
77
60
  }
78
-
79
61
  exports.LoggerText = LoggerText;
80
-
81
62
  class LoggerManager extends _events.default {
82
63
  // constructor() {}
64
+
83
65
  createLoggerText(option) {
84
66
  return new LoggerText(option);
85
67
  }
86
-
87
68
  addStdout(loggerText, stdout, config = {}) {
88
69
  const {
89
70
  event = {
@@ -96,7 +77,6 @@ class LoggerManager extends _events.default {
96
77
  warning: _utils.chalk.yellow
97
78
  }
98
79
  } = config;
99
-
100
80
  if (event.data) {
101
81
  stdout === null || stdout === void 0 ? void 0 : stdout.on('data', chunk => {
102
82
  const data = chunk.toString();
@@ -105,7 +85,6 @@ class LoggerManager extends _events.default {
105
85
  this.emit('data');
106
86
  });
107
87
  }
108
-
109
88
  if (event.error) {
110
89
  stdout === null || stdout === void 0 ? void 0 : stdout.on('error', error => {
111
90
  const data = error.message;
@@ -115,18 +94,14 @@ class LoggerManager extends _events.default {
115
94
  });
116
95
  }
117
96
  }
118
-
119
97
  addStderr(loggerText, stderr) {
120
98
  stderr === null || stderr === void 0 ? void 0 : stderr.on('data', chunk => {
121
99
  const data = chunk.toString();
122
100
  loggerText.append(data);
123
101
  });
124
102
  }
125
-
126
103
  show(loggerText) {
127
104
  console.info(loggerText.value);
128
105
  }
129
-
130
106
  }
131
-
132
107
  exports.LoggerManager = LoggerManager;
@@ -4,30 +4,22 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ReadlineUtils = void 0;
7
-
8
7
  var readline = _interopRequireWildcard(require("readline"));
9
-
10
8
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
-
12
9
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
-
14
10
  // eslint-disable-next-line @typescript-eslint/no-extraneous-class
15
11
  class ReadlineUtils {
16
12
  static clearPrevLine(output) {
17
13
  ReadlineUtils.clearLine(output, 1);
18
14
  }
19
-
20
15
  static clearLine(output, n = 1, dir = -1) {
21
16
  // -1 向上,1 向下
22
17
  const dx = dir === 1 ? 1 : -1;
23
-
24
18
  for (let i = 0; i < n; i++) {
25
19
  readline.moveCursor(output, 0, dx);
26
20
  readline.clearLine(output, 0);
27
21
  readline.cursorTo(output, 0);
28
22
  }
29
23
  }
30
-
31
24
  }
32
-
33
25
  exports.ReadlineUtils = ReadlineUtils;
@@ -4,25 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.readTsConfig = exports.existTsConfigFile = void 0;
7
-
8
7
  var _utils = require("@modern-js/utils");
9
-
10
8
  const readTsConfig = (tsconfigPath, noExistReturn = null) => {
11
9
  // 如果不存在,则返回 noExistReturn
12
10
  if (!_utils.fs.existsSync(tsconfigPath)) {
13
11
  return noExistReturn;
14
12
  }
15
-
16
13
  const content = _utils.fs.readFileSync(tsconfigPath, 'utf-8');
17
-
18
14
  return _utils.json5.parse(content);
19
15
  };
20
-
21
16
  exports.readTsConfig = readTsConfig;
22
-
23
17
  const existTsConfigFile = tsconfigAbsolutePath => {
24
18
  const tsconfig = readTsConfig(tsconfigAbsolutePath);
25
19
  return Boolean(tsconfig);
26
20
  };
27
-
28
21
  exports.existTsConfigFile = existTsConfigFile;
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.defaultTransformedFunctions = void 0;
7
- const defaultTransformedFunctions = ['require', 'require.resolve', 'System.import', // Jest methods
8
- 'jest.genMockFromModule', 'jest.mock', 'jest.unmock', 'jest.doMock', 'jest.dontMock', 'jest.setMock', 'jest.requireActual', 'jest.requireMock', // Older Jest methods
7
+ const defaultTransformedFunctions = ['require', 'require.resolve', 'System.import',
8
+ // Jest methods
9
+ 'jest.genMockFromModule', 'jest.mock', 'jest.unmock', 'jest.doMock', 'jest.dontMock', 'jest.setMock', 'jest.requireActual', 'jest.requireMock',
10
+ // Older Jest methods
9
11
  'require.requireActual', 'require.requireMock'];
10
12
  exports.defaultTransformedFunctions = defaultTransformedFunctions;
@@ -4,50 +4,32 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.transformDtsAlias = void 0;
7
-
8
7
  var path = _interopRequireWildcard(require("path"));
9
-
10
8
  var parser = _interopRequireWildcard(require("@babel/parser"));
11
-
12
9
  var _traverse = _interopRequireDefault(require("@babel/traverse"));
13
-
14
10
  var _generator = _interopRequireDefault(require("@babel/generator"));
15
-
16
11
  var t = _interopRequireWildcard(require("@babel/types"));
17
-
18
12
  var _tsconfigPaths = require("@modern-js/utils/tsconfig-paths");
19
-
20
13
  var _utils = require("@modern-js/utils");
21
-
22
14
  var _constants = require("./constants");
23
-
24
15
  var _utils2 = require("./utils");
25
-
26
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
-
28
17
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
-
30
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
-
32
19
  const getPathsMap = (paths, sourceDirName = 'src') => {
33
20
  const pathKeys = Object.keys(paths);
34
21
  const pathsMap = {};
35
-
36
22
  const replaceSrcToTypes = s => s.replace(sourceDirName, 'types');
37
-
38
23
  for (const key of pathKeys) {
39
24
  const p = paths[key];
40
-
41
25
  if (typeof p === 'string') {
42
26
  pathsMap[key] = [replaceSrcToTypes(p)];
43
27
  } else {
44
28
  pathsMap[key] = paths[key].map(sp => replaceSrcToTypes(sp));
45
29
  }
46
30
  }
47
-
48
31
  return pathsMap;
49
32
  };
50
-
51
33
  function mapPathString(nodePath, {
52
34
  filename,
53
35
  baseUrl,
@@ -56,7 +38,6 @@ function mapPathString(nodePath, {
56
38
  if (!t.isStringLiteral(nodePath)) {
57
39
  return;
58
40
  }
59
-
60
41
  const sourcePath = nodePath.node.value;
61
42
  const currentFile = filename;
62
43
  const pathsMap = getPathsMap(paths);
@@ -65,45 +46,36 @@ function mapPathString(nodePath, {
65
46
  if (!_utils.fs.existsSync(packageJsonPath)) {
66
47
  return undefined;
67
48
  }
68
-
69
49
  return _utils.fs.readJSONSync(packageJsonPath);
70
50
  }, filePath => _utils.fs.existsSync(filePath), ['.d.ts']);
71
-
72
51
  if (result) {
73
52
  const relativePath = path.relative(path.dirname(currentFile), path.dirname(result));
74
- const fileName = path.basename(result); // 如果是同级文件,则返回的是 ''
75
-
53
+ const fileName = path.basename(result);
54
+ // 如果是同级文件,则返回的是 ''
76
55
  const filePath = path.normalize(`${relativePath.length === 0 ? '.' : relativePath}/${fileName}`);
77
56
  const replaceString = filePath.startsWith('.') ? filePath : `./${filePath}`;
78
57
  nodePath.replaceWith(t.stringLiteral(replaceString));
79
58
  }
80
59
  }
81
-
82
60
  const transformCall = option => nodePath => {
83
61
  const calleePath = nodePath.get('callee');
84
-
85
62
  const isNormalCall = _constants.defaultTransformedFunctions.some(pattern => (0, _utils2.matchesPattern)(calleePath, pattern));
86
-
87
63
  if (isNormalCall || (0, _utils2.isImportCall)(nodePath)) {
88
64
  mapPathString(nodePath.get('arguments.0'), option);
89
65
  }
90
66
  };
91
-
92
67
  const transformImport = option => nodePath => {
93
68
  mapPathString(nodePath.get('source'), option);
94
69
  };
95
-
96
70
  const transformExport = option => nodePath => {
97
71
  mapPathString(nodePath.get('source'), option);
98
72
  };
99
-
100
73
  const transformSingleFileAlias = ({
101
74
  filename,
102
75
  baseUrl,
103
76
  paths
104
77
  }) => {
105
78
  const sourceCode = _utils.fs.readFileSync(filename, 'utf-8');
106
-
107
79
  const ast = parser.parse(sourceCode, {
108
80
  sourceType: 'module',
109
81
  errorRecovery: true,
@@ -129,7 +101,6 @@ const transformSingleFileAlias = ({
129
101
  });
130
102
  return (0, _generator.default)(ast).code;
131
103
  };
132
-
133
104
  const transformDtsAlias = option => {
134
105
  const {
135
106
  filenames = [],
@@ -137,7 +108,6 @@ const transformDtsAlias = option => {
137
108
  paths
138
109
  } = option;
139
110
  const transformResult = [];
140
-
141
111
  for (const filename of filenames) {
142
112
  transformResult.push({
143
113
  path: filename,
@@ -148,8 +118,6 @@ const transformDtsAlias = option => {
148
118
  })
149
119
  });
150
120
  }
151
-
152
121
  return transformResult;
153
122
  };
154
-
155
123
  exports.transformDtsAlias = transformDtsAlias;
@@ -5,28 +5,21 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.isImportCall = isImportCall;
7
7
  exports.matchesPattern = matchesPattern;
8
-
9
8
  var _utils = require("@modern-js/utils");
10
-
11
9
  const t = _utils.Import.lazy('@babel/types', require);
12
-
13
10
  function matchesPattern(calleePath, pattern) {
14
11
  const {
15
12
  node
16
13
  } = calleePath;
17
-
18
14
  if (t.isMemberExpression(node)) {
19
15
  return calleePath.matchesPattern(pattern);
20
16
  }
21
-
22
17
  if (!t.isIdentifier(node) || pattern.includes('.')) {
23
18
  return false;
24
19
  }
25
-
26
20
  const name = pattern.split('.')[0];
27
21
  return node.name === name;
28
22
  }
29
-
30
23
  function isImportCall(calleePath) {
31
24
  return t.isImport(calleePath.node.callee);
32
25
  }
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.valideBeforeTask = exports.modernConfigValid = void 0;
7
-
8
7
  var _utils = require("@modern-js/utils");
9
-
10
8
  const valideBeforeTask = ({
11
9
  modernConfig,
12
10
  tsconfigPath
@@ -14,28 +12,21 @@ const valideBeforeTask = ({
14
12
  const modernConfigValidResult = modernConfigValid(modernConfig, {
15
13
  tsconfigPath
16
14
  });
17
-
18
15
  if (modernConfigValidResult) {
19
- console.error(modernConfigValidResult); // eslint-disable-next-line no-process-exit
20
-
16
+ console.error(modernConfigValidResult);
17
+ // eslint-disable-next-line no-process-exit
21
18
  process.exit(0);
22
19
  }
23
20
  };
24
-
25
21
  exports.valideBeforeTask = valideBeforeTask;
26
-
27
22
  const modernConfigValid = (modernConfig, option) => {
28
23
  const valids = [_utils.validAlias];
29
-
30
24
  for (const validFn of valids) {
31
25
  const result = validFn(modernConfig, option);
32
-
33
26
  if (result) {
34
27
  return result;
35
28
  }
36
29
  }
37
-
38
30
  return null;
39
31
  };
40
-
41
32
  exports.modernConfigValid = modernConfigValid;
@@ -4,7 +4,6 @@ import type { Platform } from '../types';
4
4
  * init work before build task.
5
5
  * @param api
6
6
  */
7
-
8
7
  export declare const init: (api: PluginAPI) => void;
9
8
  export interface IBuildCommandOption {
10
9
  watch?: boolean;
@@ -1,7 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
3
  /// <reference types="node" />
4
-
5
4
  /**
6
5
  * 1. 注册构建任务
7
6
  * 2. 监听各个构建任务进程中的信息:process.stdout.on('data' | 'error')
@@ -2,7 +2,6 @@ import type { PostcssOption } from '@modern-js/style-compiler';
2
2
  /**
3
3
  * 处理日志信息
4
4
  */
5
-
6
5
  export declare class LogStack {
7
6
  private _codeLogStack;
8
7
  constructor();
@@ -3,7 +3,5 @@ import { ModuleHooks } from './hooks';
3
3
  export * from './types';
4
4
  export type { ModuleHooks, CliPlugin };
5
5
  export { defineConfig } from '@modern-js/core';
6
-
7
6
  declare const _default: () => CliPlugin;
8
-
9
7
  export default _default;
@@ -15,9 +15,7 @@ export declare type BundleOptions = {
15
15
  export declare type BundlelessOptions = {
16
16
  sourceDir?: string;
17
17
  style?: {
18
- compileMode?: 'all' | 'only-compiled-code' |
19
- /* may be will be deprecated */
20
- 'only-source-code' | false;
18
+ compileMode?: 'all' | 'only-compiled-code' | /* may be will be deprecated */'only-source-code' | false;
21
19
  path?: string;
22
20
  };
23
21
  static?: {
@@ -35,7 +35,6 @@ declare module '@modern-js/core' {
35
35
  /** @deprecated Use the `buildConfig.bundlelessOptions.static.path` instead . */
36
36
  assetsPath?: string;
37
37
  /** @deprecated Use the `buildConfig.sourceMap` instead */
38
-
39
38
  disableSourceMap?: boolean;
40
39
  buildPreset?: BuildPreset;
41
40
  buildConfig?: BuildConfig;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.0.0-beta.0",
14
+ "version": "2.0.0-beta.1",
15
15
  "bin": {
16
16
  "modern": "./bin/modern.js"
17
17
  },
@@ -54,33 +54,31 @@
54
54
  "@babel/runtime": "^7.18.0",
55
55
  "@babel/traverse": "^7.18.0",
56
56
  "@babel/types": "^7.18.0",
57
- "@modern-js/babel-compiler": "2.0.0-beta.0",
58
- "@modern-js/babel-preset-module": "2.0.0-beta.0",
59
- "@modern-js/core": "2.0.0-beta.0",
60
57
  "@modern-js/css-config": "1.21.1",
61
- "@modern-js/new-action": "2.0.0-beta.0",
62
- "@modern-js/upgrade": "2.0.0-beta.0",
63
- "@modern-js/plugin": "2.0.0-beta.0",
64
- "@modern-js/plugin-changeset": "2.0.0-beta.0",
65
- "@modern-js/plugin-i18n": "2.0.0-beta.0",
66
- "@modern-js/plugin-jarvis": "2.0.0-beta.0",
67
- "@modern-js/style-compiler": "2.0.0-beta.0",
68
- "@modern-js/utils": "2.0.0-beta.0",
69
58
  "@rollup/plugin-json": "~4.1.0",
70
- "@speedy-js/speedy-types": "0.13.2-modern.1",
71
- "@speedy-js/speedy-core": "0.13.2-modern.1",
72
- "@speedy-js/speedy-plugin-es5": "0.13.2-modern.1",
59
+ "@speedy-js/speedy-types": "0.13.2-modern.4",
60
+ "@speedy-js/speedy-core": "0.13.2-modern.4",
61
+ "@speedy-js/speedy-plugin-es5": "0.13.2-modern.4",
73
62
  "normalize-path": "^3.0.0",
74
63
  "p-map": "^4",
75
64
  "process.argv": "^0.6.0",
76
65
  "rollup": "^2.70.2",
77
66
  "rollup-plugin-dts": "^4.2.1",
78
67
  "rollup-plugin-hashbang": "^3.0.0",
79
- "signal-exit": "^3.0.7"
68
+ "signal-exit": "^3.0.7",
69
+ "@modern-js/babel-preset-module": "2.0.0-beta.1",
70
+ "@modern-js/core": "2.0.0-beta.1",
71
+ "@modern-js/new-action": "2.0.0-beta.1",
72
+ "@modern-js/upgrade": "2.0.0-beta.1",
73
+ "@modern-js/plugin": "2.0.0-beta.1",
74
+ "@modern-js/plugin-changeset": "2.0.0-beta.1",
75
+ "@modern-js/plugin-i18n": "2.0.0-beta.1",
76
+ "@modern-js/plugin-lint": "2.0.0-beta.1",
77
+ "@modern-js/style-compiler": "2.0.0-beta.1",
78
+ "@modern-js/utils": "2.0.0-beta.1",
79
+ "@modern-js/babel-compiler": "2.0.0-beta.1"
80
80
  },
81
81
  "devDependencies": {
82
- "@scripts/build": "2.0.0-beta.0",
83
- "@scripts/jest-config": "2.0.0-beta.0",
84
82
  "@types/babel__core": "^7.1.15",
85
83
  "@types/babel__generator": "^7.6.3",
86
84
  "@types/babel__traverse": "^7.14.2",
@@ -92,7 +90,9 @@
92
90
  "jest": "^27",
93
91
  "typescript": "^4",
94
92
  "ajv": "^8",
95
- "ajv-keywords": "^5"
93
+ "ajv-keywords": "^5",
94
+ "@scripts/build": "2.0.0-beta.1",
95
+ "@scripts/jest-config": "2.0.0-beta.1"
96
96
  },
97
97
  "sideEffects": false,
98
98
  "modernConfig": {