@modern-js/utils 2.0.0-beta.7 → 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 +28 -0
- package/dist/alias.d.ts +2 -2
- package/dist/chainId.d.ts +3 -3
- package/dist/chainId.js +2 -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 +4 -4
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,33 @@
|
|
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
|
+
|
3
31
|
## 2.0.0-beta.7
|
4
32
|
|
5
33
|
### 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
@@ -159,8 +159,8 @@ export declare const CHAIN_ID: {
|
|
159
159
|
readonly AUTO_SET_ROOT_SIZE: "auto-set-root-size";
|
160
160
|
/** HtmlAsyncChunkPlugin */
|
161
161
|
readonly HTML_ASYNC_CHUNK: "html-async-chunk";
|
162
|
-
/**
|
163
|
-
readonly
|
162
|
+
/** SWC_POLYFILL_CHECKER */
|
163
|
+
readonly SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin";
|
164
164
|
};
|
165
165
|
/** Predefined minimizers */
|
166
166
|
readonly MINIMIZER: {
|
@@ -181,4 +181,4 @@ export declare const CHAIN_ID: {
|
|
181
181
|
readonly TS_CONFIG_PATHS: "ts-config-paths";
|
182
182
|
};
|
183
183
|
};
|
184
|
-
export
|
184
|
+
export type ChainIdentifier = typeof CHAIN_ID;
|
package/dist/chainId.js
CHANGED
@@ -162,8 +162,8 @@ exports.CHAIN_ID = {
|
|
162
162
|
AUTO_SET_ROOT_SIZE: 'auto-set-root-size',
|
163
163
|
/** HtmlAsyncChunkPlugin */
|
164
164
|
HTML_ASYNC_CHUNK: 'html-async-chunk',
|
165
|
-
/**
|
166
|
-
|
165
|
+
/** SWC_POLYFILL_CHECKER */
|
166
|
+
SWC_POLYFILL_CHECKER: 'swc-polyfill-checker-plugin',
|
167
167
|
},
|
168
168
|
/** Predefined minimizers */
|
169
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",
|
@@ -134,9 +134,9 @@
|
|
134
134
|
"jest": "^27",
|
135
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": {
|