@modern-js/core 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 +49 -0
- package/dist/loadPlugins.d.ts +1 -1
- package/dist/types/config/index.d.ts +5 -5
- package/dist/types/config/testing.d.ts +3 -3
- package/dist/types/context.d.ts +1 -1
- package/dist/types/hooks.d.ts +3 -3
- package/dist/types/plugin.d.ts +5 -5
- package/dist/types/pluginAPI.d.ts +2 -2
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# @modern-js/core
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- dda38c9c3e: chore: v2
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- c9e800d39a: feat: support React18 streaming SSR
|
|
12
|
+
feat: 支持 React18 流式 SSR
|
|
13
|
+
- edd1cfb1af: feat: modernjs Access builder compiler
|
|
14
|
+
feat: modernjs 接入 builder 构建
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 8b8e1bb571: feat: support nested routes
|
|
19
|
+
feat: 支持嵌套路由
|
|
20
|
+
- Updated dependencies [edd1cfb1af]
|
|
21
|
+
- Updated dependencies [dda38c9c3e]
|
|
22
|
+
- Updated dependencies [ffb2ed4]
|
|
23
|
+
- Updated dependencies [bbe4c4ab64]
|
|
24
|
+
- @modern-js/utils@2.0.0
|
|
25
|
+
- @modern-js/node-bundle-require@2.0.0
|
|
26
|
+
- @modern-js/plugin@2.0.0
|
|
27
|
+
|
|
28
|
+
## 2.0.0-beta.7
|
|
29
|
+
|
|
30
|
+
### Major Changes
|
|
31
|
+
|
|
32
|
+
- dda38c9c3e: chore: v2
|
|
33
|
+
|
|
34
|
+
### Minor Changes
|
|
35
|
+
|
|
36
|
+
- c9e800d39a: feat: support React18 streaming SSR
|
|
37
|
+
feat: 支持 React18 流式 SSR
|
|
38
|
+
- edd1cfb1af: feat: modernjs Access builder compiler
|
|
39
|
+
feat: modernjs 接入 builder 构建
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- 8b8e1bb571: feat: support nested routes
|
|
44
|
+
feat: 支持嵌套路由
|
|
45
|
+
- Updated dependencies [edd1cfb1af]
|
|
46
|
+
- Updated dependencies [dda38c9c3e]
|
|
47
|
+
- Updated dependencies [bbe4c4ab64]
|
|
48
|
+
- @modern-js/utils@2.0.0-beta.7
|
|
49
|
+
- @modern-js/node-bundle-require@2.0.0-beta.7
|
|
50
|
+
- @modern-js/plugin@2.0.0-beta.7
|
|
51
|
+
|
|
3
52
|
## 2.0.0-beta.6
|
|
4
53
|
|
|
5
54
|
### Major Changes
|
package/dist/loadPlugins.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InternalPlugins } from '@modern-js/types';
|
|
2
2
|
import type { CliPlugin, UserConfig, OldPluginConfig, PluginConfig } from './types';
|
|
3
|
-
export
|
|
3
|
+
export type TransformPlugin = (plugin: PluginConfig, resolvedConfig: UserConfig, pluginOptions?: any) => PluginConfig;
|
|
4
4
|
export declare const isOldPluginConfig: (config?: PluginConfig) => config is OldPluginConfig;
|
|
5
5
|
/**
|
|
6
6
|
* Load internal plugins which in @modern-js scope and user's custom plugins.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PluginConfig } from '../plugin';
|
|
2
2
|
import type { BaseTestingNormalizedConfig, BaseTestingUserConfig } from './testing';
|
|
3
3
|
export type { Jest as JestConfig, BaseTestingUserConfig as TestConfig, } from './testing';
|
|
4
|
-
|
|
5
|
-
export
|
|
4
|
+
type DropUndefined<T> = T extends undefined ? never : T;
|
|
5
|
+
export type UserConfig<Extends extends {
|
|
6
6
|
hooks?: ExtendHooks;
|
|
7
7
|
userConfig?: ExtendUserConfig;
|
|
8
8
|
normalizedConfig?: ExtendNormalizedConfig;
|
|
@@ -19,7 +19,7 @@ export declare type UserConfig<Extends extends {
|
|
|
19
19
|
*/
|
|
20
20
|
autoLoadPlugins?: boolean;
|
|
21
21
|
} & Omit<Extends['userConfig'], 'plugins' | 'testing'>;
|
|
22
|
-
export
|
|
22
|
+
export type NormalizedConfig<Extends extends {
|
|
23
23
|
hooks?: ExtendHooks;
|
|
24
24
|
userConfig?: ExtendUserConfig;
|
|
25
25
|
normalizedConfig?: ExtendNormalizedConfig;
|
|
@@ -36,7 +36,7 @@ export declare type NormalizedConfig<Extends extends {
|
|
|
36
36
|
*/
|
|
37
37
|
autoLoadPlugins: boolean;
|
|
38
38
|
} & Omit<Extends['normalizedConfig'], 'plugins' | 'testing'>;
|
|
39
|
-
export
|
|
39
|
+
export type LoadedConfig<Extends extends {
|
|
40
40
|
hooks?: ExtendHooks;
|
|
41
41
|
userConfig?: ExtendUserConfig;
|
|
42
42
|
} = {}, ExtendHooks extends {} = {}, ExtendUserConfig extends Record<string, any> = {}> = {
|
|
@@ -46,4 +46,4 @@ export declare type LoadedConfig<Extends extends {
|
|
|
46
46
|
pkgConfig: UserConfig<Extends>;
|
|
47
47
|
jsConfig: UserConfig<Extends>;
|
|
48
48
|
};
|
|
49
|
-
export
|
|
49
|
+
export type ConfigParams = UserConfig | Promise<UserConfig> | ((env: any) => UserConfig | Promise<UserConfig>);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { JestConfigTypes, Merge } from '@modern-js/types';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type Jest = JestConfigTypes.InitialOptions;
|
|
3
|
+
export type BaseTestingUserConfig<ExtendTestingUserConfig = {}> = Merge<{
|
|
4
4
|
/**
|
|
5
5
|
* Decide which transformer will be used to compile file
|
|
6
6
|
* Default: babel-jest
|
|
@@ -12,4 +12,4 @@ export declare type BaseTestingUserConfig<ExtendTestingUserConfig = {}> = Merge<
|
|
|
12
12
|
*/
|
|
13
13
|
jest?: Jest | ((jestConfig: Jest) => Jest);
|
|
14
14
|
}, ExtendTestingUserConfig>;
|
|
15
|
-
export
|
|
15
|
+
export type BaseTestingNormalizedConfig<ExtendTestingNormailzedConfig = {}> = BaseTestingUserConfig<ExtendTestingNormailzedConfig>;
|
package/dist/types/context.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Entrypoint, InternalPlugins, ServerRoute, HtmlTemplates } from '@modern-js/types';
|
|
2
2
|
import { BuilderInstance } from '@modern-js/builder-shared';
|
|
3
|
-
export
|
|
3
|
+
export type ToolsType = 'app-tools' | 'module-tools' | 'doc-tools' | 'monorepo-tools';
|
|
4
4
|
export interface IAppContext {
|
|
5
5
|
metaName: string;
|
|
6
6
|
appDirectory: string;
|
package/dist/types/hooks.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ParallelWorkflow, AsyncWaterfall, AsyncWorkflow, ToRunners, ToThreads } from '@modern-js/plugin';
|
|
2
2
|
import type { Command } from '@modern-js/utils';
|
|
3
3
|
import type { UserConfig, NormalizedConfig } from './config';
|
|
4
|
-
export
|
|
4
|
+
export type BaseHooks<Extends extends {
|
|
5
5
|
hooks?: ExtendHooks;
|
|
6
6
|
userConfig?: ExtendUserConfig;
|
|
7
7
|
normalizedConfig?: ExtendNormalizedConfig;
|
|
@@ -18,12 +18,12 @@ export declare type BaseHooks<Extends extends {
|
|
|
18
18
|
beforeExit: AsyncWorkflow<void, void>;
|
|
19
19
|
addRuntimeExports: AsyncWaterfall<void>;
|
|
20
20
|
};
|
|
21
|
-
export
|
|
21
|
+
export type CliHooksRunner<Extends extends {
|
|
22
22
|
hooks?: ExtendHooks;
|
|
23
23
|
userConfig?: ExtendUserConfig;
|
|
24
24
|
normalizedConfig?: ExtendNormalizedConfig;
|
|
25
25
|
} = {}, ExtendHooks extends {} = {}, ExtendUserConfig extends Record<string, any> = {}, ExtendNormalizedConfig extends Record<string, any> = {}> = ToRunners<BaseHooks<Extends> & Extends['hooks']>;
|
|
26
|
-
export
|
|
26
|
+
export type CliHookCallbacks = ToThreads<BaseHooks<{}>>;
|
|
27
27
|
export interface DevToolData<DevOptions = any> {
|
|
28
28
|
name: string;
|
|
29
29
|
subCommands?: string[];
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -3,23 +3,23 @@ import { BaseHooks } from './hooks';
|
|
|
3
3
|
import { BasePluginAPI } from './pluginAPI';
|
|
4
4
|
export type { InternalPlugins } from '@modern-js/types';
|
|
5
5
|
/** Plugin options of a cli plugin. */
|
|
6
|
-
export
|
|
6
|
+
export type CliPlugin<Extends extends {
|
|
7
7
|
hooks?: ExtendHooks;
|
|
8
8
|
userConfig?: ExtendUserConfig;
|
|
9
9
|
normalizedConfig?: ExtendNormalizedConfig;
|
|
10
10
|
} = {}, ExtendHooks extends Record<string, any> = {}, ExtendUserConfig extends Record<string, any> = {}, ExtendNormalizedConfig extends Record<string, any> = {}> = PluginOptions<BaseHooks<Extends>, AsyncSetup<BaseHooks<Extends> & Extends['hooks'], BasePluginAPI<Extends>>, Extends['hooks']>;
|
|
11
|
-
export
|
|
11
|
+
export type PluginItem = string | [string, any];
|
|
12
12
|
/**
|
|
13
13
|
* @deprecated
|
|
14
14
|
* Using NewPluginConfig instead.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
17
|
-
export
|
|
16
|
+
export type OldPluginConfig = Array<PluginItem>;
|
|
17
|
+
export type NewPluginConfig<PluginTypes extends {
|
|
18
18
|
hooks?: Record<string, any>;
|
|
19
19
|
userConfig?: Record<string, any>;
|
|
20
20
|
normalizedConfig?: Record<string, any>;
|
|
21
21
|
}> = CliPlugin<PluginTypes>[];
|
|
22
|
-
export
|
|
22
|
+
export type PluginConfig<PluginTypes extends {
|
|
23
23
|
hooks?: Record<string, any>;
|
|
24
24
|
userConfig?: Record<string, any>;
|
|
25
25
|
normalizedConfig?: Record<string, any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CommonAPI } from '@modern-js/plugin';
|
|
2
2
|
import type { setAppContext, useAppContext, useResolvedConfigContext, useConfigContext } from '../context';
|
|
3
3
|
import { BaseHooks } from './hooks';
|
|
4
|
-
export
|
|
4
|
+
export type BasePluginAPI<Extends extends {
|
|
5
5
|
hooks?: ExtendHooks;
|
|
6
6
|
userConfig?: ExtendUserConfig;
|
|
7
7
|
normalizedConfig?: ExtendNormalizedConfig;
|
|
@@ -12,7 +12,7 @@ export declare type BasePluginAPI<Extends extends {
|
|
|
12
12
|
useResolvedConfigContext: typeof useResolvedConfigContext<Extends>;
|
|
13
13
|
};
|
|
14
14
|
/** all apis for cli plugin */
|
|
15
|
-
export
|
|
15
|
+
export type PluginAPI<Extends extends {
|
|
16
16
|
hooks?: ExtendHooks;
|
|
17
17
|
userConfig?: ExtendUserConfig;
|
|
18
18
|
} = {}, ExtendHooks extends {} = {}, ExtendUserConfig extends Record<string, any> = {}> = BasePluginAPI<Extends> & CommonAPI<BaseHooks<Extends> & Extends['hooks']>;
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"modern",
|
|
11
11
|
"modern.js"
|
|
12
12
|
],
|
|
13
|
-
"version": "2.0.0
|
|
13
|
+
"version": "2.0.0",
|
|
14
14
|
"jsnext:source": "./src/index.ts",
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"main": "./dist/index.js",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@modern-js/node-bundle-require": "2.0.0
|
|
55
|
-
"@modern-js/plugin": "2.0.0
|
|
56
|
-
"@modern-js/utils": "2.0.0
|
|
54
|
+
"@modern-js/node-bundle-require": "2.0.0",
|
|
55
|
+
"@modern-js/plugin": "2.0.0",
|
|
56
|
+
"@modern-js/utils": "2.0.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@jest/types": "^27.0.6",
|
|
@@ -72,11 +72,11 @@
|
|
|
72
72
|
"terser-webpack-plugin": "^5.1.4",
|
|
73
73
|
"typescript": "^4",
|
|
74
74
|
"webpack": "^5.75.0",
|
|
75
|
-
"@modern-js/builder-shared": "2.0.0
|
|
76
|
-
"@modern-js/babel-preset-app": "2.0.0
|
|
77
|
-
"@modern-js/types": "2.0.0
|
|
78
|
-
"@scripts/build": "2.0.0
|
|
79
|
-
"@scripts/jest-config": "2.0.0
|
|
75
|
+
"@modern-js/builder-shared": "2.0.0",
|
|
76
|
+
"@modern-js/babel-preset-app": "2.0.0",
|
|
77
|
+
"@modern-js/types": "2.0.0",
|
|
78
|
+
"@scripts/build": "2.0.0",
|
|
79
|
+
"@scripts/jest-config": "2.0.0"
|
|
80
80
|
},
|
|
81
81
|
"sideEffects": false,
|
|
82
82
|
"publishConfig": {
|