@modern-js/server-core 2.0.0-beta.1 → 2.0.0-beta.3
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 +72 -0
- package/dist/js/modern/index.js +2 -1
- package/dist/js/modern/types/config/bff.js +0 -0
- package/dist/js/modern/types/config/html.js +0 -0
- package/dist/js/modern/types/config/index.js +7 -0
- package/dist/js/modern/types/config/output.js +0 -0
- package/dist/js/modern/types/config/server.js +0 -0
- package/dist/js/modern/types/config/share.js +0 -0
- package/dist/js/modern/types/config/source.js +0 -0
- package/dist/js/modern/types/config/tools.js +1 -0
- package/dist/js/node/index.js +11 -0
- package/dist/js/node/types/config/bff.js +0 -0
- package/dist/js/node/types/config/html.js +0 -0
- package/dist/js/node/types/config/index.js +71 -0
- package/dist/js/node/types/config/output.js +0 -0
- package/dist/js/node/types/config/server.js +0 -0
- package/dist/js/node/types/config/share.js +0 -0
- package/dist/js/node/types/config/source.js +0 -0
- package/dist/js/node/types/config/tools.js +5 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/loadPlugins.d.ts +2 -61
- package/dist/types/plugin.d.ts +2 -14
- package/dist/types/types/config/bff.d.ts +5 -0
- package/dist/types/types/config/html.d.ts +5 -0
- package/dist/types/types/config/index.d.ts +34 -0
- package/dist/types/types/config/output.d.ts +17 -0
- package/dist/types/types/config/server.d.ts +27 -0
- package/dist/types/types/config/share.d.ts +3 -0
- package/dist/types/types/config/source.d.ts +15 -0
- package/dist/types/types/config/tools.d.ts +9 -0
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,77 @@
|
|
|
1
1
|
# @modern-js/server-plugin
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.3
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- dda38c9c3e: chore: v2
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 543be9558e: feat: compile server loader and support handle loader request
|
|
12
|
+
feat: 编译 server loader 并支持处理 loader 的请求
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 15bf09d9c8: feat: support completely custom server, export render() api for render single page
|
|
17
|
+
feat: 支持完全自定义 Server,导出 render() 方法用来渲染单个页面
|
|
18
|
+
- cc971eabfc: refactor: move server plugin load logic in `@modern-js/core`
|
|
19
|
+
refactor:移除在 `@modern-js/core` 中的 server 插件加载逻辑
|
|
20
|
+
- Updated dependencies [6aca875]
|
|
21
|
+
- Updated dependencies [2e60319]
|
|
22
|
+
- Updated dependencies [92f0eade39]
|
|
23
|
+
- Updated dependencies [edd1cfb1af]
|
|
24
|
+
- Updated dependencies [cc971eabfc]
|
|
25
|
+
- Updated dependencies [5b9049f2e9]
|
|
26
|
+
- Updated dependencies [92004d1906]
|
|
27
|
+
- Updated dependencies [b8bbe036c7]
|
|
28
|
+
- Updated dependencies [d5a31df781]
|
|
29
|
+
- Updated dependencies [dda38c9c3e]
|
|
30
|
+
- Updated dependencies [3bbea92b2a]
|
|
31
|
+
- Updated dependencies [b710adb]
|
|
32
|
+
- Updated dependencies [f179749375]
|
|
33
|
+
- Updated dependencies [ea7cf06]
|
|
34
|
+
- Updated dependencies [bbe4c4a]
|
|
35
|
+
- Updated dependencies [e4558a0]
|
|
36
|
+
- Updated dependencies [abf3421a75]
|
|
37
|
+
- Updated dependencies [543be9558e]
|
|
38
|
+
- Updated dependencies [14b712da84]
|
|
39
|
+
- @modern-js/utils@2.0.0-beta.3
|
|
40
|
+
- @modern-js/plugin@2.0.0-beta.3
|
|
41
|
+
|
|
42
|
+
## 2.0.0-beta.2
|
|
43
|
+
|
|
44
|
+
### Major Changes
|
|
45
|
+
|
|
46
|
+
- dda38c9c3e: chore: v2
|
|
47
|
+
|
|
48
|
+
### Minor Changes
|
|
49
|
+
|
|
50
|
+
- 543be9558e: feat: compile server loader and support handle loader request
|
|
51
|
+
feat: 编译 server loader 并支持处理 loader 的请求
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- 15bf09d9c8: feat: support completely custom server, export render() api for render single page
|
|
56
|
+
feat: 支持完全自定义 Server,导出 render() 方法用来渲染单个页面
|
|
57
|
+
- cc971eabfc: refactor: move server plugin load logic in `@modern-js/core`
|
|
58
|
+
refactor:移除在 `@modern-js/core` 中的 server 插件加载逻辑
|
|
59
|
+
- Updated dependencies [92f0ead]
|
|
60
|
+
- Updated dependencies [edd1cfb1af]
|
|
61
|
+
- Updated dependencies [cc971eabfc]
|
|
62
|
+
- Updated dependencies [5b9049f2e9]
|
|
63
|
+
- Updated dependencies [92004d1]
|
|
64
|
+
- Updated dependencies [b8bbe036c7]
|
|
65
|
+
- Updated dependencies [d5a31df781]
|
|
66
|
+
- Updated dependencies [dda38c9c3e]
|
|
67
|
+
- Updated dependencies [3bbea92b2a]
|
|
68
|
+
- Updated dependencies [f179749]
|
|
69
|
+
- Updated dependencies [abf3421a75]
|
|
70
|
+
- Updated dependencies [543be9558e]
|
|
71
|
+
- Updated dependencies [14b712da84]
|
|
72
|
+
- @modern-js/utils@2.0.0-beta.2
|
|
73
|
+
- @modern-js/plugin@2.0.0-beta.2
|
|
74
|
+
|
|
3
75
|
## 2.0.0-beta.1
|
|
4
76
|
|
|
5
77
|
### Major Changes
|
package/dist/js/modern/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/js/node/index.js
CHANGED
|
@@ -35,4 +35,15 @@ Object.keys(_loadPlugins).forEach(function (key) {
|
|
|
35
35
|
return _loadPlugins[key];
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
+
});
|
|
39
|
+
var _config = require("./types/config");
|
|
40
|
+
Object.keys(_config).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _config[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _config[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
38
49
|
});
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _bff = require("./bff");
|
|
7
|
+
Object.keys(_bff).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _bff[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _bff[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _html = require("./html");
|
|
18
|
+
Object.keys(_html).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _html[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _html[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _output = require("./output");
|
|
29
|
+
Object.keys(_output).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _output[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _output[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _server = require("./server");
|
|
40
|
+
Object.keys(_server).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _server[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _server[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _source = require("./source");
|
|
51
|
+
Object.keys(_source).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _source[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _source[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var _tools = require("./tools");
|
|
62
|
+
Object.keys(_tools).forEach(function (key) {
|
|
63
|
+
if (key === "default" || key === "__esModule") return;
|
|
64
|
+
if (key in exports && exports[key] === _tools[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () {
|
|
68
|
+
return _tools[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,64 +1,5 @@
|
|
|
1
1
|
import { InternalPlugins } from '@modern-js/types';
|
|
2
|
-
import { ServerPlugin } from './plugin';
|
|
2
|
+
import { createPlugin, ServerPlugin } from './plugin';
|
|
3
3
|
export declare const loadPlugins: (appDirectory: string, configPlugins: ServerPlugin[], options: {
|
|
4
4
|
internalPlugins?: InternalPlugins;
|
|
5
|
-
}) =>
|
|
6
|
-
gather: import("@modern-js/plugin").ParallelWorkflow<{
|
|
7
|
-
addWebMiddleware: (_input: any) => void;
|
|
8
|
-
addAPIMiddleware: (_input: any) => void;
|
|
9
|
-
}, unknown>;
|
|
10
|
-
config: import("@modern-js/plugin").Waterfall<import("./plugin").ServerConfig>;
|
|
11
|
-
prepare: import("@modern-js/plugin").Waterfall<void>;
|
|
12
|
-
preparebeforeRouteHandler: import("@modern-js/plugin").AsyncPipeline<{
|
|
13
|
-
serverRoutes: import("@modern-js/types").ServerRoute[];
|
|
14
|
-
distDir: string;
|
|
15
|
-
}, import("./plugin").BeforeRouteHandler>;
|
|
16
|
-
prepareWebServer: import("@modern-js/plugin").AsyncPipeline<import("./plugin").WebServerStartInput, import("./plugin").WebAdapter>;
|
|
17
|
-
prepareApiServer: import("@modern-js/plugin").AsyncPipeline<import("./plugin").APIServerStartInput, import("./plugin").Adapter>;
|
|
18
|
-
onApiChange: import("@modern-js/plugin").Waterfall<{
|
|
19
|
-
filename: string;
|
|
20
|
-
event: "add" | "unlink" | "change";
|
|
21
|
-
}[]>;
|
|
22
|
-
beforeDevServer: import("@modern-js/plugin").ParallelWorkflow<import("./plugin").ServerOptions, any>;
|
|
23
|
-
setupCompiler: import("@modern-js/plugin").ParallelWorkflow<Record<string, unknown>, any[]>;
|
|
24
|
-
afterDevServer: import("@modern-js/plugin").ParallelWorkflow<import("./plugin").ServerOptions, any>;
|
|
25
|
-
beforeRouteSet: import("@modern-js/plugin").AsyncPipeline<import("./plugin").Route[], import("./plugin").Route[]>;
|
|
26
|
-
afterRouteSet: import("@modern-js/plugin").AsyncPipeline<unknown, unknown>;
|
|
27
|
-
beforeProdServer: import("@modern-js/plugin").ParallelWorkflow<import("./plugin").ServerOptions, any>;
|
|
28
|
-
afterProdServer: import("@modern-js/plugin").ParallelWorkflow<import("./plugin").ServerOptions, any>;
|
|
29
|
-
listen: import("@modern-js/plugin").ParallelWorkflow<{
|
|
30
|
-
ip: string;
|
|
31
|
-
port: number;
|
|
32
|
-
}, any[]>;
|
|
33
|
-
beforeServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
34
|
-
afterServerReset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
35
|
-
extendSSRContext: import("@modern-js/plugin").AsyncWaterfall<import("@modern-js/types").BaseSSRServerContext>;
|
|
36
|
-
extendContext: import("@modern-js/plugin").AsyncPipeline<import("@modern-js/types").ModernServerContext, import("@modern-js/types").ModernServerContext>;
|
|
37
|
-
handleError: import("@modern-js/plugin").ParallelWorkflow<{
|
|
38
|
-
error: Error;
|
|
39
|
-
}, unknown>;
|
|
40
|
-
beforeMatch: import("@modern-js/plugin").AsyncPipeline<{
|
|
41
|
-
context: import("@modern-js/types").ModernServerContext;
|
|
42
|
-
}, any>;
|
|
43
|
-
afterMatch: import("@modern-js/plugin").AsyncPipeline<import("@modern-js/types").AfterMatchContext, any>;
|
|
44
|
-
prefetch: import("@modern-js/plugin").ParallelWorkflow<{
|
|
45
|
-
context: import("./plugin").SSRServerContext;
|
|
46
|
-
}, unknown>;
|
|
47
|
-
renderToString: import("@modern-js/plugin").AsyncPipeline<{
|
|
48
|
-
App: import("react").Component<{}, {}, any>;
|
|
49
|
-
context: import("./plugin").RenderContext;
|
|
50
|
-
}, string>;
|
|
51
|
-
beforeRender: import("@modern-js/plugin").AsyncPipeline<{
|
|
52
|
-
context: import("@modern-js/types").ModernServerContext;
|
|
53
|
-
}, any>;
|
|
54
|
-
afterRender: import("@modern-js/plugin").AsyncPipeline<import("@modern-js/types").AfterRenderContext, any>;
|
|
55
|
-
beforeSend: import("@modern-js/plugin").AsyncPipeline<import("@modern-js/types").ModernServerContext, import("./plugin").RequestResult>;
|
|
56
|
-
afterSend: import("@modern-js/plugin").ParallelWorkflow<{
|
|
57
|
-
context: import("@modern-js/types").ModernServerContext;
|
|
58
|
-
}, unknown>;
|
|
59
|
-
reset: import("@modern-js/plugin").ParallelWorkflow<void, unknown>;
|
|
60
|
-
}, {
|
|
61
|
-
useAppContext: () => import("@modern-js/types").ISAppContext;
|
|
62
|
-
useConfigContext: () => import("@modern-js/core").UserConfig;
|
|
63
|
-
setAppContext: (value: import("@modern-js/types").ISAppContext) => void;
|
|
64
|
-
}>[];
|
|
5
|
+
}) => ReturnType<typeof createPlugin>[];
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -3,20 +3,8 @@ import { IncomingMessage, ServerResponse } from 'http';
|
|
|
3
3
|
import type { Component } from 'react';
|
|
4
4
|
import { CommonAPI, ToThreads, AsyncSetup, PluginOptions } from '@modern-js/plugin';
|
|
5
5
|
import type { ModernServerContext, BaseSSRServerContext, AfterMatchContext, AfterRenderContext, MiddlewareContext, ISAppContext, ServerRoute } from '@modern-js/types';
|
|
6
|
-
import type { NormalizedConfig, UserConfig } from '@modern-js/core';
|
|
7
6
|
import type { Options } from 'http-proxy-middleware';
|
|
8
|
-
|
|
9
|
-
export declare type ServerOptions = {
|
|
10
|
-
output: Pick<NormalizedConfig['output'], 'path' | 'assetPrefix'>;
|
|
11
|
-
source: Pick<NormalizedConfig['source'], 'alias' | 'envVars' | 'globalVars'>;
|
|
12
|
-
tools: {
|
|
13
|
-
babel: NormalizedConfig['tools']['babel'];
|
|
14
|
-
};
|
|
15
|
-
server: NormalizedConfig['server'];
|
|
16
|
-
runtime: NormalizedConfig['runtime'];
|
|
17
|
-
bff: NormalizedConfig['bff'];
|
|
18
|
-
plugins: NormalizedConfig['plugins'];
|
|
19
|
-
};
|
|
7
|
+
import type { ServerOptions, UserConfig } from './types/config';
|
|
20
8
|
export declare type WebAdapter = (ctx: MiddlewareContext) => void | Promise<void>;
|
|
21
9
|
export declare type Adapter = (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
|
|
22
10
|
export declare type WebServerStartInput = {
|
|
@@ -402,7 +390,7 @@ export declare const createPlugin: (setup?: AsyncSetup<{
|
|
|
402
390
|
useAppContext: () => ISAppContext;
|
|
403
391
|
useConfigContext: () => UserConfig;
|
|
404
392
|
setAppContext: (value: ISAppContext) => void;
|
|
405
|
-
}>, Record<string, unknown
|
|
393
|
+
}>, Record<string, unknown>, any, any> | undefined) => import("@modern-js/plugin").AsyncPlugin<{
|
|
406
394
|
gather: import("@modern-js/plugin").ParallelWorkflow<{
|
|
407
395
|
addWebMiddleware: (_input: any) => void;
|
|
408
396
|
addAPIMiddleware: (_input: any) => void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BffNormalizedConfig, BffUserConfig } from './bff';
|
|
2
|
+
import { HtmlNormalizedConfig, HtmlUserConfig } from './html';
|
|
3
|
+
import { OutputNormalizedConfig, OutputUserConfig } from './output';
|
|
4
|
+
import { ServerNormalizedConfig, ServerUserConfig } from './server';
|
|
5
|
+
import { SourceNormalizedConfig, SourceUserConfig } from './source';
|
|
6
|
+
import { ToolsNormalizedConfig, ToolsUserConfig } from './tools';
|
|
7
|
+
export * from './bff';
|
|
8
|
+
export * from './html';
|
|
9
|
+
export * from './output';
|
|
10
|
+
export * from './server';
|
|
11
|
+
export * from './source';
|
|
12
|
+
export * from './tools';
|
|
13
|
+
interface RuntimeUserConfig {
|
|
14
|
+
[property: string]: any;
|
|
15
|
+
}
|
|
16
|
+
declare type RuntimeNormalizedConfig = RuntimeUserConfig;
|
|
17
|
+
export interface UserConfig {
|
|
18
|
+
output?: OutputUserConfig;
|
|
19
|
+
source?: SourceUserConfig;
|
|
20
|
+
tools?: ToolsUserConfig;
|
|
21
|
+
server?: ServerUserConfig;
|
|
22
|
+
runtime?: RuntimeUserConfig;
|
|
23
|
+
html?: HtmlUserConfig;
|
|
24
|
+
bff?: BffUserConfig;
|
|
25
|
+
}
|
|
26
|
+
export declare type ServerOptions = {
|
|
27
|
+
output: OutputNormalizedConfig;
|
|
28
|
+
source: SourceNormalizedConfig;
|
|
29
|
+
tools: ToolsNormalizedConfig;
|
|
30
|
+
server: ServerNormalizedConfig;
|
|
31
|
+
runtime: RuntimeNormalizedConfig;
|
|
32
|
+
html: HtmlNormalizedConfig;
|
|
33
|
+
bff: BffNormalizedConfig;
|
|
34
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface OutputUserConfig {
|
|
2
|
+
distPath?: {
|
|
3
|
+
root?: string;
|
|
4
|
+
js?: string;
|
|
5
|
+
css?: string;
|
|
6
|
+
svg?: string;
|
|
7
|
+
font?: string;
|
|
8
|
+
html?: string;
|
|
9
|
+
image?: string;
|
|
10
|
+
media?: string;
|
|
11
|
+
server?: string;
|
|
12
|
+
};
|
|
13
|
+
path?: string;
|
|
14
|
+
assetPrefix?: string;
|
|
15
|
+
polyfill?: 'entry' | 'usage' | 'ua' | 'off';
|
|
16
|
+
}
|
|
17
|
+
export declare type OutputNormalizedConfig = OutputUserConfig;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { WatchOptions } from '@modern-js/utils';
|
|
2
|
+
declare type Route = string | string[] | {
|
|
3
|
+
route?: string | string[];
|
|
4
|
+
disableSpa?: boolean;
|
|
5
|
+
resHeaders?: Record<string, unknown>;
|
|
6
|
+
};
|
|
7
|
+
export declare type Routes = Record<string, Route>;
|
|
8
|
+
export declare type SSR = boolean | {
|
|
9
|
+
mode?: 'string' | 'stream';
|
|
10
|
+
};
|
|
11
|
+
export declare type SSRByEntries = Record<string, SSR>;
|
|
12
|
+
export interface ServerUserConfig {
|
|
13
|
+
routes?: Routes;
|
|
14
|
+
publicRoutes?: Record<string, string>;
|
|
15
|
+
ssr?: SSR;
|
|
16
|
+
ssrByEntries?: SSRByEntries;
|
|
17
|
+
baseUrl?: string | string[];
|
|
18
|
+
port?: number;
|
|
19
|
+
logger?: boolean | Record<string, any>;
|
|
20
|
+
metrics?: boolean | Record<string, any>;
|
|
21
|
+
enableMicroFrontendDebug?: boolean;
|
|
22
|
+
watchOptions?: WatchOptions;
|
|
23
|
+
compiler?: 'babel' | 'typescript';
|
|
24
|
+
disableFrameworkExt?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare type ServerNormalizedConfig = ServerUserConfig;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Alias } from '@modern-js/utils';
|
|
2
|
+
import type { ChainedConfig } from './share';
|
|
3
|
+
declare type JSONPrimitive = string | number | boolean | null;
|
|
4
|
+
declare type JSONArray = Array<JSONValue>;
|
|
5
|
+
declare type JSONObject = {
|
|
6
|
+
[key: string]: JSONValue;
|
|
7
|
+
};
|
|
8
|
+
declare type JSONValue = JSONPrimitive | JSONObject | JSONArray;
|
|
9
|
+
export interface SourceUserConfig {
|
|
10
|
+
alias?: ChainedConfig<Alias>;
|
|
11
|
+
define?: Record<string, any>;
|
|
12
|
+
globalVars?: Record<string, JSONValue>;
|
|
13
|
+
}
|
|
14
|
+
export declare type SourceNormalizedConfig = SourceUserConfig;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BabelConfigUtils } from '@modern-js/babel-preset-app';
|
|
2
|
+
import { BabelTransformOptions } from '@modern-js/types/common';
|
|
3
|
+
import { ChainedConfig } from './share';
|
|
4
|
+
declare type ToolsBabelConfig = ChainedConfig<BabelTransformOptions, BabelConfigUtils>;
|
|
5
|
+
export interface ToolsUserConfig {
|
|
6
|
+
babel?: ToolsBabelConfig;
|
|
7
|
+
}
|
|
8
|
+
export declare type ToolsNormalizedConfig = ToolsUserConfig;
|
|
9
|
+
export {};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.0.0-beta.
|
|
14
|
+
"version": "2.0.0-beta.3",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@modern-js/plugin": "2.0.0-beta.
|
|
33
|
-
"@modern-js/utils": "2.0.0-beta.
|
|
32
|
+
"@modern-js/plugin": "2.0.0-beta.3",
|
|
33
|
+
"@modern-js/utils": "2.0.0-beta.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/jest": "^27",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"jest": "^27",
|
|
40
40
|
"ts-jest": "^27.0.4",
|
|
41
41
|
"typescript": "^4",
|
|
42
|
-
"@modern-js/
|
|
43
|
-
"@modern-js/
|
|
44
|
-
"@scripts/build": "2.0.0-beta.
|
|
45
|
-
"@scripts/jest-config": "2.0.0-beta.
|
|
42
|
+
"@modern-js/types": "2.0.0-beta.3",
|
|
43
|
+
"@modern-js/babel-preset-app": "2.0.0-beta.3",
|
|
44
|
+
"@scripts/build": "2.0.0-beta.3",
|
|
45
|
+
"@scripts/jest-config": "2.0.0-beta.3"
|
|
46
46
|
},
|
|
47
47
|
"sideEffects": false,
|
|
48
48
|
"modernConfig": {
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
|
-
"new": "modern new",
|
|
59
|
-
"dev": "modern build --watch",
|
|
60
|
-
"build": "modern build",
|
|
58
|
+
"new": "modern-lib new",
|
|
59
|
+
"dev": "modern-lib build --watch",
|
|
60
|
+
"build": "modern-lib build",
|
|
61
61
|
"test": "jest --passWithNoTests"
|
|
62
62
|
}
|
|
63
63
|
}
|