@modern-js/app-tools 2.0.0-beta.0 → 2.0.0-beta.2
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 +375 -0
- package/dist/js/modern/analyze/generateCode.js +30 -38
- package/dist/js/modern/analyze/getBundleEntry.js +5 -13
- package/dist/js/modern/analyze/getClientRoutes/getRoutes.js +5 -30
- package/dist/js/modern/analyze/getClientRoutes/getRoutesLegacy.js +5 -30
- package/dist/js/modern/analyze/getClientRoutes/utils.js +0 -3
- package/dist/js/modern/analyze/getFileSystemEntry.js +5 -18
- package/dist/js/modern/analyze/getHtmlTemplate.js +3 -10
- package/dist/js/modern/analyze/getServerRoutes.js +25 -38
- package/dist/js/modern/analyze/index.js +90 -48
- package/dist/js/modern/analyze/isDefaultExportFunction.js +0 -4
- package/dist/js/modern/analyze/makeLegalIdentifier.js +0 -2
- package/dist/js/modern/analyze/nestedRoutes.js +8 -33
- package/dist/js/modern/analyze/templates.js +22 -37
- package/dist/js/modern/analyze/utils.js +0 -7
- package/dist/js/modern/builder/builderPlugins/compatModern.js +41 -58
- package/dist/js/modern/builder/index.js +56 -37
- package/dist/js/modern/builder/share.js +1 -5
- package/dist/js/modern/builder/webpackPlugins/htmlAsyncChunkPlugin.js +0 -8
- package/dist/js/modern/builder/webpackPlugins/htmlBottomTemplate.js +2 -13
- package/dist/js/modern/builder/webpackPlugins/routerPlugin.js +97 -0
- package/dist/js/modern/commands/build.js +12 -46
- package/dist/js/modern/commands/dev.js +20 -23
- package/dist/js/modern/commands/inspect.js +4 -19
- package/dist/js/modern/commands/start.js +1 -2
- package/dist/js/modern/config/default.js +207 -0
- package/dist/js/modern/config/index.js +2 -0
- package/dist/js/modern/config/initial/createHtmlConfig.js +32 -0
- package/dist/js/modern/{builder → config/initial}/createOutputConfig.js +19 -18
- package/dist/js/modern/config/initial/createSourceConfig.js +32 -0
- package/dist/js/modern/config/initial/createToolsConfig.js +41 -0
- package/dist/js/modern/config/initial/index.js +11 -0
- package/dist/js/modern/config/initial/inits.js +117 -0
- package/dist/js/modern/config/initial/transformNormalizedConfig.js +40 -0
- package/dist/js/modern/defineConfig.js +12 -0
- package/dist/js/modern/hooks.js +23 -19
- package/dist/js/modern/index.js +12 -19
- package/dist/js/modern/initialize/index.js +72 -0
- package/dist/js/modern/schema/Schema.js +39 -0
- package/dist/js/modern/schema/index.js +139 -0
- package/dist/js/modern/schema/legacy.js +284 -0
- package/dist/js/modern/types/config/deploy.js +0 -0
- package/dist/js/modern/types/config/dev.js +0 -0
- package/dist/js/modern/types/config/experiments.js +0 -0
- package/dist/js/modern/types/config/html.js +0 -0
- package/dist/js/modern/types/config/index.js +2 -0
- package/dist/js/modern/types/config/output.js +0 -0
- package/dist/js/modern/types/config/performance.js +0 -0
- package/dist/js/modern/types/config/security.js +0 -0
- package/dist/js/modern/types/config/source.js +0 -0
- package/dist/js/modern/types/config/tools.js +0 -0
- package/dist/js/modern/types/hooks.js +0 -0
- package/dist/js/modern/types/index.js +4 -0
- package/dist/js/modern/types/legacyConfig/deploy.js +0 -0
- package/dist/js/modern/types/legacyConfig/dev.js +0 -0
- package/dist/js/modern/types/legacyConfig/index.js +0 -0
- package/dist/js/modern/types/legacyConfig/output.js +1 -0
- package/dist/js/modern/types/legacyConfig/source.js +0 -0
- package/dist/js/modern/types/legacyConfig/tools.js +0 -0
- package/dist/js/modern/utils/config.js +2 -13
- package/dist/js/modern/utils/createFileWatcher.js +82 -0
- package/dist/js/modern/utils/createServer.js +0 -5
- package/dist/js/modern/utils/getSpecifiedEntries.js +0 -6
- package/dist/js/modern/utils/printInstructions.js +2 -1
- package/dist/js/modern/utils/restart.js +17 -0
- package/dist/js/modern/utils/routes.js +0 -2
- package/dist/js/node/analyze/generateCode.js +30 -61
- package/dist/js/node/analyze/getBundleEntry.js +5 -19
- package/dist/js/node/analyze/getClientRoutes/getRoutes.js +5 -45
- package/dist/js/node/analyze/getClientRoutes/getRoutesLegacy.js +5 -45
- package/dist/js/node/analyze/getClientRoutes/index.js +0 -2
- package/dist/js/node/analyze/getClientRoutes/utils.js +0 -14
- package/dist/js/node/analyze/getFileSystemEntry.js +5 -26
- package/dist/js/node/analyze/getHtmlTemplate.js +3 -24
- package/dist/js/node/analyze/getServerRoutes.js +24 -46
- package/dist/js/node/analyze/index.js +91 -70
- package/dist/js/node/analyze/isDefaultExportFunction.js +0 -12
- package/dist/js/node/analyze/makeLegalIdentifier.js +0 -4
- package/dist/js/node/analyze/nestedRoutes.js +8 -41
- package/dist/js/node/analyze/templates.js +22 -47
- package/dist/js/node/analyze/utils.js +0 -20
- package/dist/js/node/builder/builderPlugins/compatModern.js +41 -69
- package/dist/js/node/builder/index.js +57 -51
- package/dist/js/node/builder/share.js +1 -13
- package/dist/js/node/builder/webpackPlugins/htmlAsyncChunkPlugin.js +0 -10
- package/dist/js/node/builder/webpackPlugins/htmlBottomTemplate.js +2 -15
- package/dist/js/node/builder/webpackPlugins/routerPlugin.js +105 -0
- package/dist/js/node/commands/build.js +10 -57
- package/dist/js/node/commands/deploy.js +0 -2
- package/dist/js/node/commands/dev.js +19 -34
- package/dist/js/node/commands/index.js +0 -6
- package/dist/js/node/commands/inspect.js +4 -26
- package/dist/js/node/commands/start.js +1 -11
- package/dist/js/node/config/default.js +214 -0
- package/dist/js/node/config/index.js +31 -0
- package/dist/js/node/config/initial/createHtmlConfig.js +38 -0
- package/dist/js/node/{builder → config/initial}/createOutputConfig.js +19 -20
- package/dist/js/node/config/initial/createSourceConfig.js +38 -0
- package/dist/js/node/config/initial/createToolsConfig.js +47 -0
- package/dist/js/node/config/initial/index.js +24 -0
- package/dist/js/node/config/initial/inits.js +127 -0
- package/dist/js/node/config/initial/transformNormalizedConfig.js +46 -0
- package/dist/js/node/defineConfig.js +20 -0
- package/dist/js/node/exports/server.js +0 -1
- package/dist/js/node/hooks.js +23 -30
- package/dist/js/node/index.js +35 -48
- package/dist/js/node/initialize/index.js +79 -0
- package/dist/js/node/locale/index.js +0 -4
- package/dist/js/node/schema/Schema.js +46 -0
- package/dist/js/node/schema/index.js +152 -0
- package/dist/js/node/schema/legacy.js +291 -0
- package/dist/js/node/types/config/deploy.js +0 -0
- package/dist/js/node/types/config/dev.js +0 -0
- package/dist/js/node/types/config/experiments.js +0 -0
- package/dist/js/node/types/config/html.js +0 -0
- package/dist/js/node/types/config/index.js +16 -0
- package/dist/js/node/types/config/output.js +0 -0
- package/dist/js/node/types/config/performance.js +0 -0
- package/dist/js/node/types/config/security.js +0 -0
- package/dist/js/node/types/config/source.js +0 -0
- package/dist/js/node/types/config/tools.js +0 -0
- package/dist/js/node/types/hooks.js +0 -0
- package/dist/js/node/types/index.js +38 -0
- package/dist/js/node/types/legacyConfig/deploy.js +0 -0
- package/dist/js/node/types/legacyConfig/dev.js +0 -0
- package/dist/js/node/types/legacyConfig/index.js +0 -0
- package/dist/js/node/types/legacyConfig/output.js +5 -0
- package/dist/js/node/types/legacyConfig/source.js +0 -0
- package/dist/js/node/types/legacyConfig/tools.js +0 -0
- package/dist/js/node/utils/commands.js +0 -2
- package/dist/js/node/utils/config.js +2 -26
- package/dist/js/node/utils/createFileWatcher.js +90 -0
- package/dist/js/node/utils/createServer.js +0 -15
- package/dist/js/node/utils/getSpecifiedEntries.js +0 -9
- package/dist/js/node/utils/language.js +0 -2
- package/dist/js/node/utils/printInstructions.js +2 -5
- package/dist/js/node/utils/restart.js +23 -0
- package/dist/js/node/utils/routes.js +0 -5
- package/dist/js/treeshaking/analyze/generateCode.js +58 -101
- package/dist/js/treeshaking/analyze/getBundleEntry.js +12 -20
- package/dist/js/treeshaking/analyze/getClientRoutes/getRoutes.js +16 -42
- package/dist/js/treeshaking/analyze/getClientRoutes/getRoutesLegacy.js +16 -42
- package/dist/js/treeshaking/analyze/getClientRoutes/utils.js +0 -3
- package/dist/js/treeshaking/analyze/getFileSystemEntry.js +5 -18
- package/dist/js/treeshaking/analyze/getHtmlTemplate.js +3 -27
- package/dist/js/treeshaking/analyze/getServerRoutes.js +29 -41
- package/dist/js/treeshaking/analyze/index.js +195 -91
- package/dist/js/treeshaking/analyze/isDefaultExportFunction.js +0 -4
- package/dist/js/treeshaking/analyze/makeLegalIdentifier.js +0 -2
- package/dist/js/treeshaking/analyze/nestedRoutes.js +9 -51
- package/dist/js/treeshaking/analyze/templates.js +31 -50
- package/dist/js/treeshaking/analyze/utils.js +7 -14
- package/dist/js/treeshaking/builder/builderPlugins/compatModern.js +50 -68
- package/dist/js/treeshaking/builder/index.js +69 -65
- package/dist/js/treeshaking/builder/share.js +1 -5
- package/dist/js/treeshaking/builder/webpackPlugins/htmlAsyncChunkPlugin.js +1 -13
- package/dist/js/treeshaking/builder/webpackPlugins/htmlBottomTemplate.js +2 -14
- package/dist/js/treeshaking/builder/webpackPlugins/routerPlugin.js +121 -0
- package/dist/js/treeshaking/commands/build.js +41 -116
- package/dist/js/treeshaking/commands/deploy.js +0 -3
- package/dist/js/treeshaking/commands/dev.js +38 -46
- package/dist/js/treeshaking/commands/inspect.js +9 -27
- package/dist/js/treeshaking/commands/start.js +1 -9
- package/dist/js/treeshaking/config/default.js +200 -0
- package/dist/js/treeshaking/config/index.js +2 -0
- package/dist/js/treeshaking/config/initial/createHtmlConfig.js +31 -0
- package/dist/js/treeshaking/config/initial/createOutputConfig.js +67 -0
- package/dist/js/treeshaking/config/initial/createSourceConfig.js +41 -0
- package/dist/js/treeshaking/config/initial/createToolsConfig.js +38 -0
- package/dist/js/treeshaking/config/initial/index.js +11 -0
- package/dist/js/treeshaking/config/initial/inits.js +114 -0
- package/dist/js/treeshaking/config/initial/transformNormalizedConfig.js +38 -0
- package/dist/js/treeshaking/defineConfig.js +14 -0
- package/dist/js/treeshaking/hooks.js +23 -19
- package/dist/js/treeshaking/index.js +8 -43
- package/dist/js/treeshaking/initialize/index.js +121 -0
- package/dist/js/treeshaking/schema/Schema.js +75 -0
- package/dist/js/treeshaking/schema/index.js +138 -0
- package/dist/js/treeshaking/schema/legacy.js +273 -0
- package/dist/js/treeshaking/types/config/deploy.js +0 -0
- package/dist/js/treeshaking/types/config/dev.js +0 -0
- package/dist/js/treeshaking/types/config/experiments.js +0 -0
- package/dist/js/treeshaking/types/config/html.js +0 -0
- package/dist/js/treeshaking/types/config/index.js +2 -0
- package/dist/js/treeshaking/types/config/output.js +0 -0
- package/dist/js/treeshaking/types/config/performance.js +0 -0
- package/dist/js/treeshaking/types/config/security.js +0 -0
- package/dist/js/treeshaking/types/config/source.js +0 -0
- package/dist/js/treeshaking/types/config/tools.js +0 -0
- package/dist/js/treeshaking/types/hooks.js +0 -0
- package/dist/js/treeshaking/types/index.js +4 -0
- package/dist/js/treeshaking/types/legacyConfig/deploy.js +0 -0
- package/dist/js/treeshaking/types/legacyConfig/dev.js +0 -0
- package/dist/js/treeshaking/types/legacyConfig/index.js +0 -0
- package/dist/js/treeshaking/types/legacyConfig/output.js +1 -0
- package/dist/js/treeshaking/types/legacyConfig/source.js +0 -0
- package/dist/js/treeshaking/types/legacyConfig/tools.js +0 -0
- package/dist/js/treeshaking/utils/config.js +2 -18
- package/dist/js/treeshaking/utils/createFileWatcher.js +123 -0
- package/dist/js/treeshaking/utils/createServer.js +0 -10
- package/dist/js/treeshaking/utils/getSpecifiedEntries.js +0 -10
- package/dist/js/treeshaking/utils/printInstructions.js +0 -5
- package/dist/js/treeshaking/utils/restart.js +45 -0
- package/dist/js/treeshaking/utils/routes.js +0 -4
- package/dist/types/analyze/generateCode.d.ts +3 -2
- package/dist/types/analyze/getBundleEntry.d.ts +2 -2
- package/dist/types/analyze/getFileSystemEntry.d.ts +2 -2
- package/dist/types/analyze/getHtmlTemplate.d.ts +3 -3
- package/dist/types/analyze/getServerRoutes.d.ts +3 -2
- package/dist/types/analyze/index.d.ts +3 -42
- package/dist/types/analyze/nestedRoutes.d.ts +1 -1
- package/dist/types/analyze/templates.d.ts +4 -2
- package/dist/types/analyze/utils.d.ts +1 -1
- package/dist/types/builder/builderPlugins/compatModern.d.ts +2 -3
- package/dist/types/builder/index.d.ts +7 -8
- package/dist/types/builder/share.d.ts +2 -2
- package/dist/types/builder/webpackPlugins/routerPlugin.d.ts +10 -0
- package/dist/types/commands/build.d.ts +2 -2
- package/dist/types/commands/deploy.d.ts +2 -2
- package/dist/types/commands/dev.d.ts +2 -2
- package/dist/types/commands/inspect.d.ts +6 -1
- package/dist/types/commands/start.d.ts +2 -2
- package/dist/types/config/default.d.ts +3 -0
- package/dist/types/config/index.d.ts +2 -0
- package/dist/types/config/initial/createHtmlConfig.d.ts +2 -0
- package/dist/types/config/initial/createOutputConfig.d.ts +2 -0
- package/dist/types/config/initial/createSourceConfig.d.ts +2 -0
- package/dist/types/config/initial/createToolsConfig.d.ts +2 -0
- package/dist/types/config/initial/index.d.ts +4 -0
- package/dist/types/config/initial/inits.d.ts +4 -0
- package/dist/types/config/initial/transformNormalizedConfig.d.ts +2 -0
- package/dist/types/defineConfig.d.ts +7 -0
- package/dist/types/hooks.d.ts +2 -42
- package/dist/types/index.d.ts +5 -7
- package/dist/types/initialize/index.d.ts +3 -0
- package/dist/types/schema/Schema.d.ts +14 -0
- package/dist/types/schema/index.d.ts +4 -0
- package/dist/types/schema/legacy.d.ts +3 -0
- package/dist/types/types/config/deploy.d.ts +9 -0
- package/dist/types/types/config/dev.d.ts +13 -0
- package/dist/types/types/config/experiments.d.ts +4 -0
- package/dist/types/types/config/html.d.ts +4 -0
- package/dist/types/types/config/index.d.ts +62 -0
- package/dist/types/types/config/output.d.ts +23 -0
- package/dist/types/types/config/performance.d.ts +4 -0
- package/dist/types/types/config/security.d.ts +4 -0
- package/dist/types/types/config/source.d.ts +22 -0
- package/dist/types/types/config/tools.d.ts +15 -0
- package/dist/types/types/hooks.d.ts +80 -0
- package/dist/types/types/index.d.ts +23 -0
- package/dist/types/types/legacyConfig/deploy.d.ts +8 -0
- package/dist/types/types/legacyConfig/dev.d.ts +12 -0
- package/dist/types/types/legacyConfig/index.d.ts +33 -0
- package/dist/types/types/legacyConfig/output.d.ts +51 -0
- package/dist/types/types/legacyConfig/source.d.ts +25 -0
- package/dist/types/types/legacyConfig/tools.d.ts +16 -0
- package/dist/types/utils/config.d.ts +2 -3
- package/dist/types/utils/createFileWatcher.d.ts +3 -0
- package/dist/types/utils/printInstructions.d.ts +3 -3
- package/dist/types/utils/restart.d.ts +3 -0
- package/package.json +26 -25
- package/dist/js/modern/builder/createHtmlConfig.js +0 -58
- package/dist/js/modern/builder/createSourceConfig.js +0 -85
- package/dist/js/modern/builder/createToolsConfig.js +0 -94
- package/dist/js/modern/utils/createCompiler.js +0 -58
- package/dist/js/node/builder/createHtmlConfig.js +0 -76
- package/dist/js/node/builder/createSourceConfig.js +0 -99
- package/dist/js/node/builder/createToolsConfig.js +0 -103
- package/dist/js/node/utils/createCompiler.js +0 -75
- package/dist/js/treeshaking/builder/createHtmlConfig.js +0 -59
- package/dist/js/treeshaking/builder/createOutputConfig.js +0 -67
- package/dist/js/treeshaking/builder/createSourceConfig.js +0 -100
- package/dist/js/treeshaking/builder/createToolsConfig.js +0 -90
- package/dist/js/treeshaking/utils/createCompiler.js +0 -117
- package/dist/types/builder/createHtmlConfig.d.ts +0 -6
- package/dist/types/builder/createOutputConfig.d.ts +0 -3
- package/dist/types/builder/createSourceConfig.d.ts +0 -5
- package/dist/types/builder/createToolsConfig.d.ts +0 -13
- package/dist/types/utils/createCompiler.d.ts +0 -12
|
@@ -4,23 +4,19 @@ import { prettyInstructions, logger } from '@modern-js/utils';
|
|
|
4
4
|
export var printInstructions = /*#__PURE__*/function () {
|
|
5
5
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(hookRunners, appContext, config) {
|
|
6
6
|
var message, _yield$hookRunners$be, instructions;
|
|
7
|
-
|
|
8
7
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9
8
|
while (1) {
|
|
10
9
|
switch (_context.prev = _context.next) {
|
|
11
10
|
case 0:
|
|
12
11
|
message = prettyInstructions(appContext, config); // call beforePrintInstructions hook.
|
|
13
|
-
|
|
14
12
|
_context.next = 3;
|
|
15
13
|
return hookRunners.beforePrintInstructions({
|
|
16
14
|
instructions: message
|
|
17
15
|
});
|
|
18
|
-
|
|
19
16
|
case 3:
|
|
20
17
|
_yield$hookRunners$be = _context.sent;
|
|
21
18
|
instructions = _yield$hookRunners$be.instructions;
|
|
22
19
|
logger.info(instructions);
|
|
23
|
-
|
|
24
20
|
case 6:
|
|
25
21
|
case "end":
|
|
26
22
|
return _context.stop();
|
|
@@ -28,7 +24,6 @@ export var printInstructions = /*#__PURE__*/function () {
|
|
|
28
24
|
}
|
|
29
25
|
}, _callee);
|
|
30
26
|
}));
|
|
31
|
-
|
|
32
27
|
return function printInstructions(_x, _x2, _x3) {
|
|
33
28
|
return _ref.apply(this, arguments);
|
|
34
29
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import { cli } from '@modern-js/core';
|
|
4
|
+
import { logger, program } from '@modern-js/utils';
|
|
5
|
+
export function restart(_x) {
|
|
6
|
+
return _restart.apply(this, arguments);
|
|
7
|
+
}
|
|
8
|
+
function _restart() {
|
|
9
|
+
_restart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(hooksRunner) {
|
|
10
|
+
var hasGetError;
|
|
11
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
12
|
+
while (1) {
|
|
13
|
+
switch (_context.prev = _context.next) {
|
|
14
|
+
case 0:
|
|
15
|
+
logger.info('Restart...\n');
|
|
16
|
+
hasGetError = false;
|
|
17
|
+
_context.next = 4;
|
|
18
|
+
return hooksRunner.beforeRestart();
|
|
19
|
+
case 4:
|
|
20
|
+
_context.prev = 4;
|
|
21
|
+
_context.next = 7;
|
|
22
|
+
return cli.init(cli.initOptions);
|
|
23
|
+
case 7:
|
|
24
|
+
_context.next = 13;
|
|
25
|
+
break;
|
|
26
|
+
case 9:
|
|
27
|
+
_context.prev = 9;
|
|
28
|
+
_context.t0 = _context["catch"](4);
|
|
29
|
+
console.error(_context.t0);
|
|
30
|
+
hasGetError = true;
|
|
31
|
+
case 13:
|
|
32
|
+
_context.prev = 13;
|
|
33
|
+
if (!hasGetError) {
|
|
34
|
+
program.parse(process.argv);
|
|
35
|
+
}
|
|
36
|
+
return _context.finish(13);
|
|
37
|
+
case 16:
|
|
38
|
+
case "end":
|
|
39
|
+
return _context.stop();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}, _callee, null, [[4, 9, 13, 16]]);
|
|
43
|
+
}));
|
|
44
|
+
return _restart.apply(this, arguments);
|
|
45
|
+
}
|
|
@@ -2,7 +2,6 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { fs, ROUTE_SPEC_FILE } from '@modern-js/utils';
|
|
5
|
-
|
|
6
5
|
var generateRoutes = /*#__PURE__*/function () {
|
|
7
6
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(appContext) {
|
|
8
7
|
var serverRoutes, distDirectory, output;
|
|
@@ -16,7 +15,6 @@ var generateRoutes = /*#__PURE__*/function () {
|
|
|
16
15
|
}, null, 2);
|
|
17
16
|
_context.next = 4;
|
|
18
17
|
return fs.outputFile(path.join(distDirectory, ROUTE_SPEC_FILE), output);
|
|
19
|
-
|
|
20
18
|
case 4:
|
|
21
19
|
case "end":
|
|
22
20
|
return _context.stop();
|
|
@@ -24,10 +22,8 @@ var generateRoutes = /*#__PURE__*/function () {
|
|
|
24
22
|
}
|
|
25
23
|
}, _callee);
|
|
26
24
|
}));
|
|
27
|
-
|
|
28
25
|
return function generateRoutes(_x) {
|
|
29
26
|
return _ref.apply(this, arguments);
|
|
30
27
|
};
|
|
31
28
|
}();
|
|
32
|
-
|
|
33
29
|
export { generateRoutes };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { IAppContext,
|
|
1
|
+
import { IAppContext, PluginAPI } from '@modern-js/core';
|
|
2
2
|
import type { Entrypoint } from '@modern-js/types';
|
|
3
|
+
import { AppNormalizedConfig, AppTools, ImportStatement } from '../types';
|
|
3
4
|
export declare const createImportStatements: (statements: ImportStatement[]) => string;
|
|
4
|
-
export declare const generateCode: (appContext: IAppContext, config:
|
|
5
|
+
export declare const generateCode: (appContext: IAppContext, config: AppNormalizedConfig, entrypoints: Entrypoint[], api: PluginAPI<AppTools>) => Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { IAppContext, NormalizedConfig } from '@modern-js/core';
|
|
2
1
|
import type { Entrypoint } from '@modern-js/types';
|
|
3
|
-
|
|
2
|
+
import type { AppNormalizedConfig, IAppContext } from '../types';
|
|
3
|
+
export declare const getBundleEntry: (appContext: IAppContext, config: AppNormalizedConfig) => Entrypoint[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NormalizedConfig, IAppContext } from '@modern-js/core';
|
|
2
1
|
import type { Entrypoint } from '@modern-js/types';
|
|
2
|
+
import type { AppNormalizedConfig, IAppContext } from '../types';
|
|
3
3
|
export type { Entrypoint };
|
|
4
|
-
export declare const getFileSystemEntry: (appContext: IAppContext, config:
|
|
4
|
+
export declare const getFileSystemEntry: (appContext: IAppContext, config: AppNormalizedConfig) => Entrypoint[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { IAppContext, NormalizedConfig, PluginAPI } from '@modern-js/core';
|
|
2
1
|
import type { Entrypoint, HtmlTemplates } from '@modern-js/types';
|
|
3
|
-
|
|
2
|
+
import type { AppNormalizedConfig, AppTools, IAppContext, PluginAPI } from '../types';
|
|
3
|
+
export declare const getHtmlTemplate: (entrypoints: Entrypoint[], api: PluginAPI<AppTools>, {
|
|
4
4
|
appContext,
|
|
5
5
|
config
|
|
6
6
|
}: {
|
|
7
7
|
appContext: IAppContext;
|
|
8
|
-
config:
|
|
8
|
+
config: AppNormalizedConfig;
|
|
9
9
|
}) => Promise<HtmlTemplates>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IAppContext } from '@modern-js/core';
|
|
2
2
|
import type { Entrypoint, ServerRoute } from '@modern-js/types';
|
|
3
|
+
import type { AppNormalizedConfig } from '../types';
|
|
3
4
|
export declare const getServerRoutes: (entrypoints: Entrypoint[], {
|
|
4
5
|
appContext,
|
|
5
6
|
config
|
|
6
7
|
}: {
|
|
7
8
|
appContext: IAppContext;
|
|
8
|
-
config:
|
|
9
|
+
config: AppNormalizedConfig;
|
|
9
10
|
}) => ServerRoute[];
|
|
@@ -1,43 +1,4 @@
|
|
|
1
|
-
import type { CliPlugin
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
imports: ImportStatement[];
|
|
5
|
-
entrypoint: Entrypoint;
|
|
6
|
-
}>;
|
|
7
|
-
export declare const modifyEntryExport: import("@modern-js/plugin").AsyncWaterfall<{
|
|
8
|
-
entrypoint: Entrypoint;
|
|
9
|
-
exportStatement: string;
|
|
10
|
-
}>;
|
|
11
|
-
export declare const addRuntimeExports: import("@modern-js/plugin").AsyncWaterfall<void>;
|
|
12
|
-
export declare const modifyEntryRuntimePlugins: import("@modern-js/plugin").AsyncWaterfall<{
|
|
13
|
-
entrypoint: Entrypoint;
|
|
14
|
-
plugins: RuntimePlugin[];
|
|
15
|
-
}>;
|
|
16
|
-
export declare const modifyEntryRenderFunction: import("@modern-js/plugin").AsyncWaterfall<{
|
|
17
|
-
entrypoint: Entrypoint;
|
|
18
|
-
code: string;
|
|
19
|
-
}>;
|
|
20
|
-
export declare const modifyAsyncEntry: import("@modern-js/plugin").AsyncWaterfall<{
|
|
21
|
-
entrypoint: Entrypoint;
|
|
22
|
-
code: string;
|
|
23
|
-
}>;
|
|
24
|
-
export declare const modifyFileSystemRoutes: import("@modern-js/plugin").AsyncWaterfall<{
|
|
25
|
-
entrypoint: Entrypoint;
|
|
26
|
-
routes: RouteLegacy[] | (NestedRoute | PageRoute)[];
|
|
27
|
-
}>;
|
|
28
|
-
export declare const modifyServerRoutes: import("@modern-js/plugin").AsyncWaterfall<{
|
|
29
|
-
routes: ServerRoute[];
|
|
30
|
-
}>;
|
|
31
|
-
export declare const htmlPartials: import("@modern-js/plugin").AsyncWaterfall<{
|
|
32
|
-
entrypoint: Entrypoint;
|
|
33
|
-
partials: HtmlPartials;
|
|
34
|
-
}>;
|
|
35
|
-
export declare const beforeGenerateRoutes: import("@modern-js/plugin").AsyncWaterfall<{
|
|
36
|
-
entrypoint: Entrypoint;
|
|
37
|
-
code: string;
|
|
38
|
-
}>;
|
|
39
|
-
export declare const addDefineTypes: import("@modern-js/plugin").AsyncWaterfall<void>;
|
|
40
|
-
|
|
41
|
-
declare const _default: () => CliPlugin;
|
|
42
|
-
|
|
1
|
+
import type { CliPlugin } from '@modern-js/core';
|
|
2
|
+
import { AppTools } from '../types';
|
|
3
|
+
declare const _default: () => CliPlugin<AppTools>;
|
|
43
4
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RuntimePlugin } from '@modern-js/core';
|
|
2
1
|
import type { Entrypoint, NestedRoute, PageRoute, RouteLegacy } from '@modern-js/types';
|
|
2
|
+
import type { RuntimePlugin } from '../types';
|
|
3
3
|
export declare const index: ({
|
|
4
4
|
mountId,
|
|
5
5
|
imports,
|
|
@@ -38,9 +38,11 @@ export declare const routesForServer: ({
|
|
|
38
38
|
export declare const fileSystemRoutes: ({
|
|
39
39
|
routes,
|
|
40
40
|
ssrMode,
|
|
41
|
-
nestedRoutesEntry
|
|
41
|
+
nestedRoutesEntry,
|
|
42
|
+
entryName
|
|
42
43
|
}: {
|
|
43
44
|
routes: RouteLegacy[] | (NestedRoute | PageRoute)[];
|
|
44
45
|
ssrMode: 'string' | 'stream' | false;
|
|
45
46
|
nestedRoutesEntry?: string | undefined;
|
|
47
|
+
entryName: string;
|
|
46
48
|
}) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Entrypoint } from '@modern-js/types';
|
|
2
|
-
import type { ImportStatement } from '
|
|
2
|
+
import type { ImportStatement } from '../types';
|
|
3
3
|
export declare const walkDirectory: (dir: string) => string[];
|
|
4
4
|
export declare const getDefaultImports: ({
|
|
5
5
|
entrypoint,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BuilderPlugin } from '@modern-js/builder-shared';
|
|
2
2
|
import type { BuilderPluginAPI } from '@modern-js/builder-webpack-provider';
|
|
3
|
-
import type { IAppContext,
|
|
3
|
+
import type { IAppContext, AppNormalizedConfig } from '../../types';
|
|
4
4
|
declare type Parameter<T extends (arg: any) => void> = Parameters<T>[0];
|
|
5
5
|
declare type FnParameter<T extends {
|
|
6
6
|
[p: string]: (arg: any) => void;
|
|
@@ -9,6 +9,5 @@ export declare type PluginCompatModernOptions = FnParameter<Partial<Pick<Builder
|
|
|
9
9
|
/**
|
|
10
10
|
* Provides default configuration consistent with `@modern-js/webpack`
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
export declare const PluginCompatModern: (appContext: IAppContext, modernConfig: NormalizedConfig, options?: PluginCompatModernOptions) => BuilderPlugin<BuilderPluginAPI>;
|
|
12
|
+
export declare const PluginCompatModern: (appContext: IAppContext, modernConfig: AppNormalizedConfig, options?: PluginCompatModernOptions) => BuilderPlugin<BuilderPluginAPI>;
|
|
14
13
|
export {};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { BuilderInstance, BuilderTarget, CreateBuilderOptions } from '@modern-js/builder';
|
|
2
|
-
import
|
|
2
|
+
import { BuilderConfig } from '@modern-js/builder-webpack-provider';
|
|
3
|
+
import type { IAppContext } from '@modern-js/core';
|
|
4
|
+
import type { AppNormalizedConfig } from '../types';
|
|
3
5
|
import { PluginCompatModernOptions } from './builderPlugins/compatModern';
|
|
4
6
|
export declare type BuilderOptions = {
|
|
5
7
|
target?: BuilderTarget | BuilderTarget[];
|
|
6
|
-
normalizedConfig:
|
|
8
|
+
normalizedConfig: AppNormalizedConfig;
|
|
7
9
|
appContext: IAppContext;
|
|
8
10
|
compatPluginConfig?: PluginCompatModernOptions;
|
|
9
11
|
};
|
|
10
|
-
|
|
11
|
-
declare const _default: ({
|
|
12
|
-
target,
|
|
12
|
+
export declare function createBuilderForEdenX({
|
|
13
13
|
normalizedConfig,
|
|
14
14
|
appContext,
|
|
15
15
|
compatPluginConfig
|
|
16
|
-
}: BuilderOptions)
|
|
17
|
-
|
|
18
|
-
export default _default;
|
|
16
|
+
}: BuilderOptions): Promise<BuilderInstance>;
|
|
17
|
+
export declare function createBuilderProviderConfig(normalizedConfig: AppNormalizedConfig, appContext: IAppContext): BuilderConfig;
|
|
19
18
|
export declare function createBuilderOptions(target: BuilderTarget | BuilderTarget[], appContext: IAppContext): CreateBuilderOptions;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { WebpackChain } from '@modern-js/builder-webpack-provider';
|
|
3
|
-
import {
|
|
4
|
-
export declare function createCopyPattern(appContext: IAppContext, config:
|
|
3
|
+
import { AppNormalizedConfig, IAppContext } from '../types';
|
|
4
|
+
export declare function createCopyPattern(appContext: IAppContext, config: AppNormalizedConfig, patternsType: 'upload' | 'public', chain?: WebpackChain): {
|
|
5
5
|
info: (file: {
|
|
6
6
|
sourceFilename: string;
|
|
7
7
|
}) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PluginAPI } from '@modern-js/core';
|
|
2
2
|
import type { BuildOptions } from '../utils/types';
|
|
3
|
-
import type {
|
|
4
|
-
export declare const build: (api: PluginAPI<
|
|
3
|
+
import type { AppTools } from '../types';
|
|
4
|
+
export declare const build: (api: PluginAPI<AppTools>, options?: BuildOptions) => Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { PluginAPI } from '@modern-js/core';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const deploy: (api: PluginAPI<
|
|
2
|
+
import type { AppTools } from '../types';
|
|
3
|
+
export declare const deploy: (api: PluginAPI<AppTools>, options: any) => Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PluginAPI } from '@modern-js/core';
|
|
2
2
|
import { DevOptions } from '../utils/types';
|
|
3
|
-
import type {
|
|
4
|
-
export declare const dev: (api: PluginAPI<
|
|
3
|
+
import type { AppTools } from '../types';
|
|
4
|
+
export declare const dev: (api: PluginAPI<AppTools>, options: DevOptions) => Promise<void>;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { PluginAPI } from '@modern-js/core';
|
|
2
2
|
import type { InspectOptions } from '../utils/types';
|
|
3
|
-
|
|
3
|
+
import type { AppTools } from '../types';
|
|
4
|
+
export declare const inspect: (api: PluginAPI<AppTools>, options: InspectOptions) => Promise<{
|
|
4
5
|
builderConfig: string;
|
|
5
6
|
bundlerConfigs: string[];
|
|
7
|
+
origin: {
|
|
8
|
+
builderConfig: Record<string, any>;
|
|
9
|
+
bundlerConfigs: Record<string, any>[];
|
|
10
|
+
};
|
|
6
11
|
}>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { PluginAPI } from '@modern-js/core';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const start: (api: PluginAPI<
|
|
2
|
+
import type { AppTools } from '../types';
|
|
3
|
+
export declare const start: (api: PluginAPI<AppTools>) => Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AppNormalizedConfig, IAppContext, AppLegacyUserConfig, AppUserConfig } from '../../types';
|
|
2
|
+
export { transformNormalizedConfig } from './transformNormalizedConfig';
|
|
3
|
+
export declare function checkIsLegacyConfig(config: AppLegacyUserConfig | AppUserConfig): config is AppLegacyUserConfig;
|
|
4
|
+
export declare function initialNormalizedConfig(config: AppNormalizedConfig, appContext: IAppContext): AppNormalizedConfig;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AppNormalizedConfig, IAppContext } from '../../types';
|
|
2
|
+
export declare function initHtmlConfig(config: AppNormalizedConfig, appContext: IAppContext): import("@modern-js/builder-shared").SharedHtmlConfig;
|
|
3
|
+
export declare function initSourceConfig(config: AppNormalizedConfig, appContext: IAppContext): void;
|
|
4
|
+
export declare function initToolsConfig(config: AppNormalizedConfig): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AppUserConfig, AppLegacyUserConfig } from './types';
|
|
2
|
+
export declare const defineConfig: (config: AppUserConfig) => AppUserConfig;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated
|
|
5
|
+
* Using defineConfig first.
|
|
6
|
+
*/
|
|
7
|
+
export declare const defineLegacyConfig: (config: AppLegacyUserConfig) => AppLegacyUserConfig;
|
package/dist/types/hooks.d.ts
CHANGED
|
@@ -1,42 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const afterDev: import("@modern-js/plugin").AsyncWorkflow<void, unknown>;
|
|
4
|
-
export declare const beforeCreateCompiler: import("@modern-js/plugin").AsyncWorkflow<{
|
|
5
|
-
bundlerConfigs: webpack.Configuration[];
|
|
6
|
-
}, unknown>;
|
|
7
|
-
export declare const afterCreateCompiler: import("@modern-js/plugin").AsyncWorkflow<{
|
|
8
|
-
compiler: webpack.Compiler | webpack.MultiCompiler | undefined;
|
|
9
|
-
}, unknown>;
|
|
10
|
-
export declare const beforePrintInstructions: import("@modern-js/plugin").AsyncWaterfall<{
|
|
11
|
-
instructions: string;
|
|
12
|
-
}>;
|
|
13
|
-
export declare const beforeBuild: import("@modern-js/plugin").AsyncWorkflow<{
|
|
14
|
-
bundlerConfigs?: webpack.Configuration[] | undefined;
|
|
15
|
-
}, unknown>;
|
|
16
|
-
export declare const afterBuild: import("@modern-js/plugin").AsyncWorkflow<{
|
|
17
|
-
stats?: webpack.Stats | webpack.MultiStats | undefined;
|
|
18
|
-
}, unknown>;
|
|
19
|
-
export declare const beforeDeploy: import("@modern-js/plugin").AsyncWorkflow<Record<string, any>, unknown>;
|
|
20
|
-
export declare const afterDeploy: import("@modern-js/plugin").AsyncWorkflow<Record<string, any>, unknown>;
|
|
21
|
-
export declare const hooks: {
|
|
22
|
-
beforeDev: import("@modern-js/plugin").AsyncWorkflow<void, unknown>;
|
|
23
|
-
afterDev: import("@modern-js/plugin").AsyncWorkflow<void, unknown>;
|
|
24
|
-
beforeCreateCompiler: import("@modern-js/plugin").AsyncWorkflow<{
|
|
25
|
-
bundlerConfigs: webpack.Configuration[];
|
|
26
|
-
}, unknown>;
|
|
27
|
-
afterCreateCompiler: import("@modern-js/plugin").AsyncWorkflow<{
|
|
28
|
-
compiler: webpack.Compiler | webpack.MultiCompiler | undefined;
|
|
29
|
-
}, unknown>;
|
|
30
|
-
beforePrintInstructions: import("@modern-js/plugin").AsyncWaterfall<{
|
|
31
|
-
instructions: string;
|
|
32
|
-
}>;
|
|
33
|
-
beforeBuild: import("@modern-js/plugin").AsyncWorkflow<{
|
|
34
|
-
bundlerConfigs?: webpack.Configuration[] | undefined;
|
|
35
|
-
}, unknown>;
|
|
36
|
-
afterBuild: import("@modern-js/plugin").AsyncWorkflow<{
|
|
37
|
-
stats?: webpack.Stats | webpack.MultiStats | undefined;
|
|
38
|
-
}, unknown>;
|
|
39
|
-
beforeDeploy: import("@modern-js/plugin").AsyncWorkflow<Record<string, any>, unknown>;
|
|
40
|
-
afterDeploy: import("@modern-js/plugin").AsyncWorkflow<Record<string, any>, unknown>;
|
|
41
|
-
};
|
|
42
|
-
export declare type AppHooks = typeof hooks;
|
|
1
|
+
import { AppToolsHooks } from './types/hooks';
|
|
2
|
+
export declare const hooks: AppToolsHooks;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
declare const _default: () => CliPlugin<AppHooks>;
|
|
7
|
-
|
|
1
|
+
import { CliPlugin } from '@modern-js/core';
|
|
2
|
+
import { AppTools } from './types';
|
|
3
|
+
export * from './defineConfig';
|
|
4
|
+
export * from './types';
|
|
5
|
+
declare const _default: () => CliPlugin<AppTools>;
|
|
8
6
|
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare type ValidateSchema = {
|
|
2
|
+
target: string;
|
|
3
|
+
schema: any;
|
|
4
|
+
};
|
|
5
|
+
export declare class Schema extends Map<string, any> {
|
|
6
|
+
private schema;
|
|
7
|
+
constructor(baseSchema?: Record<string, any>);
|
|
8
|
+
setSchema(key: string, object: Record<string, any>): this;
|
|
9
|
+
set(key: string, value: any): this;
|
|
10
|
+
has(key: string): boolean;
|
|
11
|
+
get(key: string): any;
|
|
12
|
+
delete(key: string): boolean;
|
|
13
|
+
generate(): ValidateSchema[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface MicroFrontend {
|
|
2
|
+
enableHtmlEntry?: boolean;
|
|
3
|
+
externalBasicLibrary?: boolean;
|
|
4
|
+
moduleApp?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DeployUserConfig {
|
|
7
|
+
microFrontend?: boolean | MicroFrontend;
|
|
8
|
+
}
|
|
9
|
+
export declare type DeployNormalizedConfig = DeployUserConfig;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BuilderConfig } from '@modern-js/builder-webpack-provider';
|
|
2
|
+
declare type BuilderEnvConfig = Required<BuilderConfig>['dev'];
|
|
3
|
+
export declare type DevProxyOptions = string | Record<string, string>;
|
|
4
|
+
export interface DevUserConfig extends Pick<BuilderEnvConfig, 'assetPrefix' | 'https'> {
|
|
5
|
+
/**
|
|
6
|
+
* The configuration of `dev.proxy` is provided by `proxy` plugin.
|
|
7
|
+
* Please use `yarn new` or `pnpm new` to enable the corresponding capability.
|
|
8
|
+
* @requires `proxy` plugin
|
|
9
|
+
*/
|
|
10
|
+
proxy?: string | Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
export declare type DevNormalizedConfig = DevUserConfig;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BuilderConfig } from '@modern-js/builder-webpack-provider';
|
|
2
|
+
export declare type BuilderExperimentsConfig = Required<BuilderConfig>['experiments'];
|
|
3
|
+
export declare type ExperimentsUserConfig = BuilderExperimentsConfig;
|
|
4
|
+
export declare type ExperimentsNormalizedConfig = ExperimentsUserConfig;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { UserConfig } from '@modern-js/core';
|
|
2
|
+
import type { ServerUserConfig, ServerNormalizedConfig, BffUserConfig, BffNormalizedConfig } from '@modern-js/server-core';
|
|
3
|
+
import type { AppToolsHooks } from '../hooks';
|
|
4
|
+
import type { OutputNormalizedConfig, OutputUserConfig } from './output';
|
|
5
|
+
import type { SourceNormalizedConfig, SourceUserConfig } from './source';
|
|
6
|
+
import type { DevNormalizedConfig, DevUserConfig } from './dev';
|
|
7
|
+
import type { ToolsNormalizedConfig, ToolsUserConfig } from './tools';
|
|
8
|
+
import type { HtmlNormalizedConfig, HtmlUserConfig } from './html';
|
|
9
|
+
import type { SecurityNormalizedConfig, SecurityUserConfig } from './security';
|
|
10
|
+
import type { DeployNormalizedConfig, DeployUserConfig } from './deploy';
|
|
11
|
+
import type { ExperimentsUserConfig, ExperimentsNormalizedConfig } from './experiments';
|
|
12
|
+
import type { PerformanceNormalizedConfig, PerformanceUserConfig } from './performance';
|
|
13
|
+
export * from './output';
|
|
14
|
+
export interface RuntimeUserConfig {
|
|
15
|
+
[name: string]: any;
|
|
16
|
+
}
|
|
17
|
+
export interface RuntimeByEntriesUserConfig {
|
|
18
|
+
[name: string]: RuntimeUserConfig;
|
|
19
|
+
}
|
|
20
|
+
export declare type RuntimeNormalizedConfig = RuntimeUserConfig;
|
|
21
|
+
export declare type RuntimeByEntriesNormalizedConfig = RuntimeByEntriesUserConfig;
|
|
22
|
+
export interface AppToolsUserConfig {
|
|
23
|
+
source?: SourceUserConfig;
|
|
24
|
+
output?: OutputUserConfig;
|
|
25
|
+
server?: ServerUserConfig;
|
|
26
|
+
dev?: DevUserConfig;
|
|
27
|
+
deploy?: DeployUserConfig;
|
|
28
|
+
html?: HtmlUserConfig;
|
|
29
|
+
tools?: ToolsUserConfig;
|
|
30
|
+
runtime?: RuntimeUserConfig;
|
|
31
|
+
security?: SecurityUserConfig;
|
|
32
|
+
runtimeByEntries?: RuntimeByEntriesUserConfig;
|
|
33
|
+
performance?: PerformanceUserConfig;
|
|
34
|
+
experiments?: ExperimentsUserConfig;
|
|
35
|
+
/**
|
|
36
|
+
* The configuration of `bff` is provided by `bff` plugin.
|
|
37
|
+
* Please use `yarn new` or `pnpm new` to enable the corresponding capability.
|
|
38
|
+
* @requires `bff` plugin
|
|
39
|
+
*/
|
|
40
|
+
bff?: BffUserConfig;
|
|
41
|
+
}
|
|
42
|
+
export declare type AppToolsNormalizedConfig = {
|
|
43
|
+
source: SourceNormalizedConfig;
|
|
44
|
+
bff: BffNormalizedConfig;
|
|
45
|
+
dev: DevNormalizedConfig;
|
|
46
|
+
deploy: DeployNormalizedConfig;
|
|
47
|
+
html: HtmlNormalizedConfig;
|
|
48
|
+
runtime: RuntimeNormalizedConfig;
|
|
49
|
+
runtimeByEntries: RuntimeByEntriesNormalizedConfig;
|
|
50
|
+
output: OutputNormalizedConfig;
|
|
51
|
+
security: SecurityNormalizedConfig;
|
|
52
|
+
server: ServerNormalizedConfig;
|
|
53
|
+
tools: ToolsNormalizedConfig;
|
|
54
|
+
performance: PerformanceNormalizedConfig;
|
|
55
|
+
experiments: ExperimentsNormalizedConfig;
|
|
56
|
+
cliOptions?: Record<string, any>;
|
|
57
|
+
_raw: UserConfig<{
|
|
58
|
+
hooks: AppToolsHooks;
|
|
59
|
+
userConfig: AppToolsUserConfig;
|
|
60
|
+
normalizedConfig: AppToolsNormalizedConfig;
|
|
61
|
+
}>;
|
|
62
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BuilderConfig } from '@modern-js/builder-webpack-provider';
|
|
2
|
+
export declare type BuilderOutputConfig = Required<BuilderConfig>['output'];
|
|
3
|
+
export interface OutputUserConfig extends BuilderOutputConfig {
|
|
4
|
+
ssg?: SSGConfig;
|
|
5
|
+
enableModernMode?: boolean;
|
|
6
|
+
disableNodePolyfill?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare type OutputNormalizedConfig = OutputUserConfig;
|
|
9
|
+
export declare type SSGRouteOptions = string | {
|
|
10
|
+
url: string;
|
|
11
|
+
output?: string;
|
|
12
|
+
params?: Record<string, any>[];
|
|
13
|
+
headers?: Record<string, any>;
|
|
14
|
+
};
|
|
15
|
+
export declare type SSGSingleEntryOptions = boolean | {
|
|
16
|
+
preventDefault?: string[];
|
|
17
|
+
headers?: Record<string, any>;
|
|
18
|
+
routes?: SSGRouteOptions[];
|
|
19
|
+
};
|
|
20
|
+
export declare type SSGMultiEntryOptions = Record<string, SSGSingleEntryOptions>;
|
|
21
|
+
export declare type SSGConfig = boolean | SSGSingleEntryOptions | SSGMultiEntryOptions | ((entryName: string, payload: {
|
|
22
|
+
baseUrl?: string;
|
|
23
|
+
}) => SSGSingleEntryOptions);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BuilderConfig } from '@modern-js/builder-webpack-provider';
|
|
2
|
+
export declare type BuilderPerformanceConfig = Required<BuilderConfig>['performance'];
|
|
3
|
+
export declare type PerformanceUserConfig = BuilderPerformanceConfig;
|
|
4
|
+
export declare type PerformanceNormalizedConfig = PerformanceUserConfig;
|