@modern-js/module-tools 1.21.3 → 2.0.0-beta.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 CHANGED
@@ -1,21 +1,43 @@
1
1
  # @modern-js/module-tools
2
2
 
3
- ## 1.21.3
4
-
5
- ### Patch Changes
6
-
7
- - @modern-js/upgrade@1.21.3
8
- - @modern-js/new-action@1.21.3
9
- - @modern-js/babel-preset-module@1.21.3
10
- - @modern-js/core@1.21.3
11
- - @modern-js/css-config@1.21.3
12
- - @modern-js/plugin-changeset@1.21.3
13
- - @modern-js/plugin-i18n@1.21.3
14
- - @modern-js/plugin-jarvis@1.21.3
15
- - @modern-js/babel-compiler@1.21.3
16
- - @modern-js/style-compiler@1.21.3
17
- - @modern-js/plugin@1.21.3
18
- - @modern-js/utils@1.21.3
3
+ ## 2.0.0-beta.0
4
+
5
+ ### Major Changes
6
+
7
+ - dda38c9: chore: v2
8
+
9
+ ### Patch Changes
10
+
11
+ - b8bbe036c: feat: export Hooks type
12
+ feat: 导出 Hooks 类型
13
+ - 14b712d: fix: use consistent alias type and default value across packages
14
+
15
+ fix: 在各个包中使用一致的 alias 类型定义和默认值
16
+
17
+ - Updated dependencies [c9e800d39]
18
+ - Updated dependencies [85edee8]
19
+ - Updated dependencies [edd1cfb1a]
20
+ - Updated dependencies [cc971eabf]
21
+ - Updated dependencies [5b9049f]
22
+ - Updated dependencies [b8bbe036c]
23
+ - Updated dependencies [d5a31df78]
24
+ - Updated dependencies [dda38c9]
25
+ - Updated dependencies [8b8e1bb57]
26
+ - Updated dependencies [3bbea92b2]
27
+ - Updated dependencies [abf3421]
28
+ - Updated dependencies [543be95]
29
+ - Updated dependencies [14b712d]
30
+ - @modern-js/core@2.0.0-beta.0
31
+ - @modern-js/utils@2.0.0-beta.0
32
+ - @modern-js/plugin@2.0.0-beta.0
33
+ - @modern-js/babel-preset-module@2.0.0-beta.0
34
+ - @modern-js/plugin-changeset@2.0.0-beta.0
35
+ - @modern-js/plugin-i18n@2.0.0-beta.0
36
+ - @modern-js/plugin-jarvis@2.0.0-beta.0
37
+ - @modern-js/new-action@2.0.0-beta.0
38
+ - @modern-js/babel-compiler@2.0.0-beta.0
39
+ - @modern-js/style-compiler@2.0.0-beta.0
40
+ - @modern-js/upgrade@2.0.0-beta.0
19
41
 
20
42
  ## 1.21.2
21
43
 
@@ -4,7 +4,6 @@ import * as os from 'os';
4
4
  import path from 'path';
5
5
  import { chalk, Import, fs } from '@modern-js/utils';
6
6
  const constants = Import.lazy('./constants', require);
7
- const cssConfig = Import.lazy('@modern-js/css-config', require);
8
7
  /**
9
8
  * 处理日志信息
10
9
  */
@@ -74,14 +73,19 @@ export const watchSectionTitle = (str, status) => {
74
73
  }
75
74
 
76
75
  return `${chalk.bgWhite.gray.underline(str)} ${chalk.blue.underline('Log')}`;
77
- };
78
- export const getPostcssOption = (appDirectory, modernConfig) => {
79
- var _postcssOption$postcs;
76
+ }; // eslint-disable-next-line @typescript-eslint/no-unused-vars
80
77
 
81
- const postcssOption = cssConfig.getPostcssConfig(appDirectory, modernConfig, false);
78
+ export const getPostcssOption = (...args) => {
79
+ // const postcssOption: any = cssConfig.getPostcssConfig(
80
+ // appDirectory,
81
+ // modernConfig,
82
+ // false,
83
+ // );
82
84
  return {
83
- plugins: (postcssOption === null || postcssOption === void 0 ? void 0 : (_postcssOption$postcs = postcssOption.postcssOptions) === null || _postcssOption$postcs === void 0 ? void 0 : _postcssOption$postcs.plugins) || [],
84
- enableSourceMap: (postcssOption === null || postcssOption === void 0 ? void 0 : postcssOption.sourceMap) || false,
85
+ plugins: [],
86
+ enableSourceMap: false,
87
+ // plugins: postcssOption?.postcssOptions?.plugins || [],
88
+ // enableSourceMap: (postcssOption as any)?.sourceMap || false,
85
89
  options: {}
86
90
  };
87
91
  };
@@ -6,9 +6,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
6
6
 
7
7
  import path from 'path';
8
8
  import { getBabelConfig, applyUserBabelConfig } from '@modern-js/babel-preset-module';
9
- import { applyOptionsChain, getAlias, isUseSSRBundle } from '@modern-js/utils';
9
+ import { getAliasConfig, isUseSSRBundle, applyOptionsChain } from '@modern-js/utils';
10
10
  export const getFinalAlias = (modernConfig, option) => {
11
- const aliasConfig = getAlias(modernConfig.source.alias, option); // 排除内部别名,因为不需要处理
11
+ const aliasConfig = getAliasConfig(modernConfig.source.alias, option); // 排除内部别名,因为不需要处理
12
12
 
13
13
  const finalPaths = {};
14
14
  const internalAliasPrefix = '@modern-js/runtime';
@@ -20,8 +20,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
20
20
  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; }
21
21
 
22
22
  const constants = _utils.Import.lazy('./constants', require);
23
-
24
- const cssConfig = _utils.Import.lazy('@modern-js/css-config', require);
25
23
  /**
26
24
  * 处理日志信息
27
25
  */
@@ -98,17 +96,22 @@ const watchSectionTitle = (str, status) => {
98
96
  }
99
97
 
100
98
  return `${_utils.chalk.bgWhite.gray.underline(str)} ${_utils.chalk.blue.underline('Log')}`;
101
- };
99
+ }; // eslint-disable-next-line @typescript-eslint/no-unused-vars
102
100
 
103
- exports.watchSectionTitle = watchSectionTitle;
104
101
 
105
- const getPostcssOption = (appDirectory, modernConfig) => {
106
- var _postcssOption$postcs;
102
+ exports.watchSectionTitle = watchSectionTitle;
107
103
 
108
- const postcssOption = cssConfig.getPostcssConfig(appDirectory, modernConfig, false);
104
+ const getPostcssOption = (...args) => {
105
+ // const postcssOption: any = cssConfig.getPostcssConfig(
106
+ // appDirectory,
107
+ // modernConfig,
108
+ // false,
109
+ // );
109
110
  return {
110
- plugins: (postcssOption === null || postcssOption === void 0 ? void 0 : (_postcssOption$postcs = postcssOption.postcssOptions) === null || _postcssOption$postcs === void 0 ? void 0 : _postcssOption$postcs.plugins) || [],
111
- enableSourceMap: (postcssOption === null || postcssOption === void 0 ? void 0 : postcssOption.sourceMap) || false,
111
+ plugins: [],
112
+ enableSourceMap: false,
113
+ // plugins: postcssOption?.postcssOptions?.plugins || [],
114
+ // enableSourceMap: (postcssOption as any)?.sourceMap || false,
112
115
  options: {}
113
116
  };
114
117
  };
@@ -20,7 +20,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
20
20
  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; }
21
21
 
22
22
  const getFinalAlias = (modernConfig, option) => {
23
- const aliasConfig = (0, _utils.getAlias)(modernConfig.source.alias, option); // 排除内部别名,因为不需要处理
23
+ const aliasConfig = (0, _utils.getAliasConfig)(modernConfig.source.alias, option); // 排除内部别名,因为不需要处理
24
24
 
25
25
  const finalPaths = {};
26
26
  const internalAliasPrefix = '@modern-js/runtime';
@@ -1,4 +1,3 @@
1
- import type { NormalizedConfig } from '@modern-js/core';
2
1
  import type { PostcssOption } from '@modern-js/style-compiler';
3
2
  /**
4
3
  * 处理日志信息
@@ -34,5 +33,5 @@ export declare enum SectionTitleStatus {
34
33
  Log = 2,
35
34
  }
36
35
  export declare const watchSectionTitle: (str: string, status: SectionTitleStatus) => string;
37
- export declare const getPostcssOption: (appDirectory: string, modernConfig: NormalizedConfig) => PostcssOption;
36
+ export declare const getPostcssOption: (...args: any[]) => PostcssOption;
38
37
  export declare const getAllDeps: <T>(appDirectory: string) => string[];
@@ -26,4 +26,5 @@ export declare const hooks: {
26
26
  moduleTailwindConfig: import("@modern-js/plugin").AsyncPipeline<{
27
27
  modernConfig: import("@modern-js/core").NormalizedConfig;
28
28
  }, any>;
29
- };
29
+ };
30
+ export declare type ModuleHooks = typeof hooks;
@@ -1,5 +1,7 @@
1
1
  import type { CliPlugin } from '@modern-js/core';
2
+ import { ModuleHooks } from './hooks';
2
3
  export * from './types';
4
+ export type { ModuleHooks, CliPlugin };
3
5
  export { defineConfig } from '@modern-js/core';
4
6
 
5
7
  declare const _default: () => CliPlugin;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.21.3",
14
+ "version": "2.0.0-beta.0",
15
15
  "bin": {
16
16
  "modern": "./bin/modern.js"
17
17
  },
@@ -54,18 +54,18 @@
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": "1.21.3",
58
- "@modern-js/babel-preset-module": "1.21.3",
59
- "@modern-js/core": "1.21.3",
60
- "@modern-js/css-config": "1.21.3",
61
- "@modern-js/new-action": "1.21.3",
62
- "@modern-js/upgrade": "1.21.3",
63
- "@modern-js/plugin": "1.21.3",
64
- "@modern-js/plugin-changeset": "1.21.3",
65
- "@modern-js/plugin-i18n": "1.21.3",
66
- "@modern-js/plugin-jarvis": "1.21.3",
67
- "@modern-js/style-compiler": "1.21.3",
68
- "@modern-js/utils": "1.21.3",
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
+ "@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
69
  "@rollup/plugin-json": "~4.1.0",
70
70
  "@speedy-js/speedy-types": "0.13.2-modern.1",
71
71
  "@speedy-js/speedy-core": "0.13.2-modern.1",
@@ -79,8 +79,8 @@
79
79
  "signal-exit": "^3.0.7"
80
80
  },
81
81
  "devDependencies": {
82
- "@scripts/build": "1.21.3",
83
- "@scripts/jest-config": "1.21.3",
82
+ "@scripts/build": "2.0.0-beta.0",
83
+ "@scripts/jest-config": "2.0.0-beta.0",
84
84
  "@types/babel__core": "^7.1.15",
85
85
  "@types/babel__generator": "^7.6.3",
86
86
  "@types/babel__traverse": "^7.14.2",
@@ -104,34 +104,10 @@
104
104
  "registry": "https://registry.npmjs.org/",
105
105
  "access": "public"
106
106
  },
107
- "wireit": {
108
- "build": {
109
- "command": "modern build",
110
- "files": [
111
- "src/**/*",
112
- "tsconfig.json",
113
- "package.json",
114
- "./modern.config.js"
115
- ],
116
- "output": [
117
- "dist/**/*"
118
- ]
119
- },
120
- "test": {
121
- "command": "jest --passWithNoTests",
122
- "files": [
123
- "src/**/*",
124
- "tsconfig.json",
125
- "package.json",
126
- "tests/**/*"
127
- ],
128
- "output": []
129
- }
130
- },
131
107
  "scripts": {
132
108
  "new": "modern new",
133
- "build": "wireit",
134
- "test": "wireit",
109
+ "build": "modern build",
110
+ "test": "jest --passWithNoTests",
135
111
  "dev": "modern build --watch"
136
112
  }
137
113
  }