@modern-js/utils 2.0.0-beta.6 → 2.0.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 +42 -0
- package/dist/alias.d.ts +2 -2
- package/dist/chainId.d.ts +7 -3
- package/dist/chainId.js +6 -2
- package/dist/constants.js +2 -0
- package/dist/generateMetaTags.d.ts +1 -1
- package/dist/logger.d.ts +4 -4
- package/dist/pathSerializer.d.ts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/watch.d.ts +2 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,47 @@
|
|
1
1
|
# @modern-js/utils
|
2
2
|
|
3
|
+
## 2.0.0
|
4
|
+
|
5
|
+
### Major Changes
|
6
|
+
|
7
|
+
- dda38c9c3e: chore: v2
|
8
|
+
|
9
|
+
### Minor Changes
|
10
|
+
|
11
|
+
- edd1cfb1af: feat: modernjs Access builder compiler
|
12
|
+
feat: modernjs 接入 builder 构建
|
13
|
+
- bbe4c4ab64: feat: add @modern-js/plugin-swc
|
14
|
+
|
15
|
+
feat: 新增 @modern-js/plugin-swc 插件
|
16
|
+
|
17
|
+
### Patch Changes
|
18
|
+
|
19
|
+
- ffb2ed4: feat:
|
20
|
+
|
21
|
+
1. change storybook runtime logic
|
22
|
+
2. export runtime api define from runtime module
|
23
|
+
3. refactor defineConfig in module-tools
|
24
|
+
|
25
|
+
feat:
|
26
|
+
|
27
|
+
1. 更改 Storybook 对于 Runtime API 的处理逻辑
|
28
|
+
2. 从 @modern-js/runtime 导出 Runtime API 的用户配置
|
29
|
+
3. 重构 module-tools 的 defineConfig
|
30
|
+
|
31
|
+
## 2.0.0-beta.7
|
32
|
+
|
33
|
+
### Major Changes
|
34
|
+
|
35
|
+
- dda38c9c3e: chore: v2
|
36
|
+
|
37
|
+
### Minor Changes
|
38
|
+
|
39
|
+
- edd1cfb1af: feat: modernjs Access builder compiler
|
40
|
+
feat: modernjs 接入 builder 构建
|
41
|
+
- bbe4c4ab64: feat: add @modern-js/plugin-swc
|
42
|
+
|
43
|
+
feat: 新增 @modern-js/plugin-swc 插件
|
44
|
+
|
3
45
|
## 2.0.0-beta.6
|
4
46
|
|
5
47
|
### Major Changes
|
package/dist/alias.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
export
|
2
|
-
export
|
1
|
+
export type Alias = Record<string, string | string[]>;
|
2
|
+
export type AliasOption = Alias | ((aliases: Alias) => Alias | void);
|
3
3
|
interface NormalizedConfig {
|
4
4
|
source: {
|
5
5
|
alias?: AliasOption | Array<AliasOption>;
|
package/dist/chainId.d.ts
CHANGED
@@ -23,6 +23,8 @@ export declare const CHAIN_ID: {
|
|
23
23
|
readonly LESS: "less";
|
24
24
|
/** Rule for sass */
|
25
25
|
readonly SASS: "sass";
|
26
|
+
/** Rule for stylus */
|
27
|
+
readonly STYLUS: "stylus";
|
26
28
|
/** Rule for svg */
|
27
29
|
readonly SVG: "svg";
|
28
30
|
/** Rule for pug */
|
@@ -68,6 +70,8 @@ export declare const CHAIN_ID: {
|
|
68
70
|
readonly SASS: "sass";
|
69
71
|
/** less-loader */
|
70
72
|
readonly LESS: "less";
|
73
|
+
/** stylus-loader */
|
74
|
+
readonly STYLUS: "stylus";
|
71
75
|
/** url-loader */
|
72
76
|
readonly URL: "url";
|
73
77
|
/** pug-loader */
|
@@ -155,8 +159,8 @@ export declare const CHAIN_ID: {
|
|
155
159
|
readonly AUTO_SET_ROOT_SIZE: "auto-set-root-size";
|
156
160
|
/** HtmlAsyncChunkPlugin */
|
157
161
|
readonly HTML_ASYNC_CHUNK: "html-async-chunk";
|
158
|
-
/**
|
159
|
-
readonly
|
162
|
+
/** SWC_POLYFILL_CHECKER */
|
163
|
+
readonly SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin";
|
160
164
|
};
|
161
165
|
/** Predefined minimizers */
|
162
166
|
readonly MINIMIZER: {
|
@@ -177,4 +181,4 @@ export declare const CHAIN_ID: {
|
|
177
181
|
readonly TS_CONFIG_PATHS: "ts-config-paths";
|
178
182
|
};
|
179
183
|
};
|
180
|
-
export
|
184
|
+
export type ChainIdentifier = typeof CHAIN_ID;
|
package/dist/chainId.js
CHANGED
@@ -26,6 +26,8 @@ exports.CHAIN_ID = {
|
|
26
26
|
LESS: 'less',
|
27
27
|
/** Rule for sass */
|
28
28
|
SASS: 'sass',
|
29
|
+
/** Rule for stylus */
|
30
|
+
STYLUS: 'stylus',
|
29
31
|
/** Rule for svg */
|
30
32
|
SVG: 'svg',
|
31
33
|
/** Rule for pug */
|
@@ -71,6 +73,8 @@ exports.CHAIN_ID = {
|
|
71
73
|
SASS: 'sass',
|
72
74
|
/** less-loader */
|
73
75
|
LESS: 'less',
|
76
|
+
/** stylus-loader */
|
77
|
+
STYLUS: 'stylus',
|
74
78
|
/** url-loader */
|
75
79
|
URL: 'url',
|
76
80
|
/** pug-loader */
|
@@ -158,8 +162,8 @@ exports.CHAIN_ID = {
|
|
158
162
|
AUTO_SET_ROOT_SIZE: 'auto-set-root-size',
|
159
163
|
/** HtmlAsyncChunkPlugin */
|
160
164
|
HTML_ASYNC_CHUNK: 'html-async-chunk',
|
161
|
-
/**
|
162
|
-
|
165
|
+
/** SWC_POLYFILL_CHECKER */
|
166
|
+
SWC_POLYFILL_CHECKER: 'swc-polyfill-checker-plugin',
|
163
167
|
},
|
164
168
|
/** Predefined minimizers */
|
165
169
|
MINIMIZER: {
|
package/dist/constants.js
CHANGED
@@ -100,6 +100,8 @@ exports.INTERNAL_MODULE_TOOLS_PLUGINS = {
|
|
100
100
|
'@modern-js/plugin-tailwindcss': '@modern-js/plugin-tailwindcss/cli',
|
101
101
|
// TODO: Maybe can remove it
|
102
102
|
'@modern-js/plugin-nocode': '@modern-js/plugin-nocode/cli',
|
103
|
+
// legacy router (inner react-router-dom v5)
|
104
|
+
'@modern-js/plugin-router-legacy': '@modern-js/plugin-router-legacy/cli',
|
103
105
|
};
|
104
106
|
/**
|
105
107
|
* Internal monorepo-tools plugins that work as soon as they are installed.
|
@@ -7,7 +7,7 @@
|
|
7
7
|
*
|
8
8
|
* Modified from https://github.com/jantimon/html-webpack-plugin/blob/2f5de7ab9e8bca60e9e200f2e4b4cfab90db28d4/index.js#L800
|
9
9
|
*/
|
10
|
-
export
|
10
|
+
export type MetaAttributes = {
|
11
11
|
[attributeName: string]: string | boolean;
|
12
12
|
};
|
13
13
|
export interface MetaOptions {
|
package/dist/logger.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Color } from '../compiled/chalk';
|
2
|
-
|
3
|
-
|
2
|
+
type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
3
|
+
type LogMsg = number | string | Error | null;
|
4
4
|
interface LoggerConfiguration {
|
5
5
|
color?: typeof Color;
|
6
6
|
label?: string;
|
@@ -15,7 +15,7 @@ interface ConstructorOptions {
|
|
15
15
|
level?: string;
|
16
16
|
types?: Record<string, LoggerConfiguration>;
|
17
17
|
}
|
18
|
-
|
18
|
+
type LoggerFunction = (message?: LogMsg, ...args: any[]) => void;
|
19
19
|
declare const LOG_TYPES: {
|
20
20
|
error: {
|
21
21
|
color: string;
|
@@ -56,7 +56,7 @@ declare class Logger {
|
|
56
56
|
private _log;
|
57
57
|
private getLongestLabel;
|
58
58
|
}
|
59
|
-
|
59
|
+
type LoggerInterface = {
|
60
60
|
[key in keyof typeof LOG_TYPES]: LoggerFunction;
|
61
61
|
};
|
62
62
|
declare const logger: Logger & LoggerInterface;
|
package/dist/pathSerializer.d.ts
CHANGED
package/dist/types.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export
|
1
|
+
export type Falsy = false | null | undefined | 0 | '';
|
package/dist/watch.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
export
|
1
|
+
export type WatchChangeTypeValueT = 'add' | 'unlink' | 'change';
|
2
2
|
export declare const WatchChangeType: Record<'ADD' | 'UNLINK' | 'CHANGE', WatchChangeTypeValueT>;
|
3
|
-
|
3
|
+
type RunTaskType = (option: {
|
4
4
|
changedFilePath: string;
|
5
5
|
changeType: WatchChangeTypeValueT;
|
6
6
|
}) => void | Promise<void>;
|
package/package.json
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
"modern",
|
12
12
|
"modern.js"
|
13
13
|
],
|
14
|
-
"version": "2.0.0
|
14
|
+
"version": "2.0.0",
|
15
15
|
"jsnext:source": "./src/index.ts",
|
16
16
|
"types": "./dist/index.d.ts",
|
17
17
|
"main": "./dist/index.js",
|
@@ -131,12 +131,12 @@
|
|
131
131
|
"devDependencies": {
|
132
132
|
"@types/jest": "^27",
|
133
133
|
"@types/node": "^14",
|
134
|
-
"typescript": "^4",
|
135
134
|
"jest": "^27",
|
135
|
+
"typescript": "^4",
|
136
136
|
"webpack": "^5.75.0",
|
137
|
-
"@modern-js/types": "2.0.0
|
138
|
-
"@scripts/jest-config": "2.0.0
|
139
|
-
"@scripts/build": "2.0.0
|
137
|
+
"@modern-js/types": "2.0.0",
|
138
|
+
"@scripts/jest-config": "2.0.0",
|
139
|
+
"@scripts/build": "2.0.0"
|
140
140
|
},
|
141
141
|
"sideEffects": false,
|
142
142
|
"scripts": {
|