@modern-js/app-tools 2.0.0-beta.4 → 2.0.0-beta.7
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 +366 -0
- package/bin/modern.js +2 -0
- package/dist/js/modern/analyze/constants.js +10 -0
- package/dist/js/modern/analyze/generateCode.js +7 -9
- package/dist/js/modern/analyze/getBundleEntry.js +2 -1
- package/dist/js/modern/analyze/getClientRoutes/getRoutes.js +9 -6
- package/dist/js/modern/analyze/getFileSystemEntry.js +11 -3
- package/dist/js/modern/analyze/index.js +7 -5
- package/dist/js/modern/analyze/nestedRoutes.js +29 -22
- package/dist/js/modern/analyze/templates.js +8 -1
- package/dist/js/modern/analyze/utils.js +21 -4
- package/dist/js/modern/builder/builderPlugins/compatModern.js +8 -2
- package/dist/js/modern/builder/index.js +9 -9
- package/dist/js/modern/commands/dev.js +6 -9
- package/dist/js/modern/commands/index.js +1 -1
- package/dist/js/modern/commands/{start.js → serve.js} +3 -1
- package/dist/js/modern/config/default.js +38 -61
- package/dist/js/modern/config/initial/createOutputConfig.js +1 -3
- package/dist/js/modern/config/initial/createSourceConfig.js +5 -1
- package/dist/js/modern/config/initial/transformNormalizedConfig.js +5 -1
- package/dist/js/modern/hooks.js +1 -0
- package/dist/js/modern/index.js +5 -5
- package/dist/js/modern/initialize/index.js +5 -4
- package/dist/js/modern/locale/en.js +1 -1
- package/dist/js/modern/locale/zh.js +1 -1
- package/dist/js/modern/schema/index.js +5 -7
- package/dist/js/modern/schema/legacy.js +1 -2
- package/dist/js/modern/utils/commands.js +6 -1
- package/dist/js/modern/utils/getServerInternalPlugins.js +58 -0
- package/dist/js/node/analyze/Builder.js +14 -8
- package/dist/js/node/analyze/constants.js +35 -3
- package/dist/js/node/analyze/generateCode.js +27 -24
- package/dist/js/node/analyze/getBundleEntry.js +9 -4
- package/dist/js/node/analyze/getClientRoutes/getRoutes.js +33 -28
- package/dist/js/node/analyze/getClientRoutes/getRoutesLegacy.js +24 -22
- package/dist/js/node/analyze/getClientRoutes/index.js +8 -3
- package/dist/js/node/analyze/getClientRoutes/utils.js +10 -3
- package/dist/js/node/analyze/getFileSystemEntry.js +18 -6
- package/dist/js/node/analyze/getHtmlTemplate.js +18 -14
- package/dist/js/node/analyze/getServerRoutes.js +36 -34
- package/dist/js/node/analyze/index.js +45 -59
- package/dist/js/node/analyze/isDefaultExportFunction.js +7 -3
- package/dist/js/node/analyze/makeLegalIdentifier.js +7 -3
- package/dist/js/node/analyze/nestedRoutes.js +58 -49
- package/dist/js/node/analyze/templates.js +45 -32
- package/dist/js/node/analyze/utils.js +41 -18
- package/dist/js/node/builder/builderPlugins/compatModern.js +32 -24
- package/dist/js/node/builder/index.js +38 -49
- package/dist/js/node/builder/loaders/routerLoader.js +5 -3
- package/dist/js/node/builder/loaders/serverModuleLoader.js +5 -3
- package/dist/js/node/builder/share.js +7 -3
- package/dist/js/node/builder/webpackPlugins/htmlAsyncChunkPlugin.js +7 -3
- package/dist/js/node/builder/webpackPlugins/htmlBottomTemplate.js +7 -3
- package/dist/js/node/builder/webpackPlugins/routerPlugin.js +9 -7
- package/dist/js/node/commands/build.js +30 -28
- package/dist/js/node/commands/deploy.js +9 -5
- package/dist/js/node/commands/dev.js +39 -40
- package/dist/js/node/commands/index.js +5 -5
- package/dist/js/node/commands/inspect.js +10 -6
- package/dist/js/node/commands/{start.js → serve.js} +16 -10
- package/dist/js/node/config/default.js +44 -64
- package/dist/js/node/config/index.js +10 -3
- package/dist/js/node/config/initial/createHtmlConfig.js +7 -3
- package/dist/js/node/config/initial/createOutputConfig.js +8 -6
- package/dist/js/node/config/initial/createSourceConfig.js +12 -4
- package/dist/js/node/config/initial/createToolsConfig.js +7 -3
- package/dist/js/node/config/initial/index.js +9 -3
- package/dist/js/node/config/initial/inits.js +26 -22
- package/dist/js/node/config/initial/transformNormalizedConfig.js +12 -4
- package/dist/js/node/defineConfig.js +25 -22
- package/dist/js/node/exports/server.js +7 -3
- package/dist/js/node/hooks.js +8 -3
- package/dist/js/node/index.js +56 -69
- package/dist/js/node/initialize/index.js +33 -32
- package/dist/js/node/locale/en.js +8 -4
- package/dist/js/node/locale/index.js +8 -3
- package/dist/js/node/locale/zh.js +8 -4
- package/dist/js/node/schema/Schema.js +7 -3
- package/dist/js/node/schema/index.js +13 -10
- package/dist/js/node/schema/legacy.js +6 -5
- package/dist/js/node/types/config/deploy.js +15 -0
- package/dist/js/node/types/config/dev.js +15 -0
- package/dist/js/node/types/config/experiments.js +15 -0
- package/dist/js/node/types/config/html.js +15 -0
- package/dist/js/node/types/config/index.js +3 -3
- package/dist/js/node/types/config/output.js +15 -0
- package/dist/js/node/types/config/performance.js +15 -0
- package/dist/js/node/types/config/security.js +15 -0
- package/dist/js/node/types/config/source.js +15 -0
- package/dist/js/node/types/config/tools.js +15 -0
- package/dist/js/node/types/hooks.js +15 -0
- package/dist/js/node/types/index.js +5 -5
- package/dist/js/node/types/legacyConfig/deploy.js +15 -0
- package/dist/js/node/types/legacyConfig/dev.js +15 -0
- package/dist/js/node/types/legacyConfig/index.js +15 -0
- package/dist/js/node/types/legacyConfig/output.js +15 -0
- package/dist/js/node/types/legacyConfig/source.js +15 -0
- package/dist/js/node/types/legacyConfig/tools.js +15 -0
- package/dist/js/node/utils/commands.js +14 -4
- package/dist/js/node/utils/config.js +35 -30
- package/dist/js/node/utils/createFileWatcher.js +15 -10
- package/dist/js/node/utils/createServer.js +35 -29
- package/dist/js/node/utils/getServerInternalPlugins.js +79 -0
- package/dist/js/node/utils/getSpecifiedEntries.js +10 -6
- package/dist/js/node/utils/language.js +7 -3
- package/dist/js/node/utils/printInstructions.js +10 -6
- package/dist/js/node/utils/restart.js +11 -7
- package/dist/js/node/utils/routes.js +11 -7
- package/dist/js/node/utils/types.js +15 -0
- package/dist/js/treeshaking/analyze/constants.js +10 -1
- package/dist/js/treeshaking/analyze/generateCode.js +7 -11
- package/dist/js/treeshaking/analyze/getBundleEntry.js +2 -1
- package/dist/js/treeshaking/analyze/getClientRoutes/getRoutes.js +9 -6
- package/dist/js/treeshaking/analyze/getFileSystemEntry.js +11 -3
- package/dist/js/treeshaking/analyze/index.js +7 -4
- package/dist/js/treeshaking/analyze/nestedRoutes.js +30 -23
- package/dist/js/treeshaking/analyze/templates.js +6 -1
- package/dist/js/treeshaking/analyze/utils.js +14 -4
- package/dist/js/treeshaking/builder/builderPlugins/compatModern.js +6 -2
- package/dist/js/treeshaking/builder/index.js +4 -9
- package/dist/js/treeshaking/commands/dev.js +19 -24
- package/dist/js/treeshaking/commands/index.js +1 -1
- package/dist/js/treeshaking/commands/{start.js → serve.js} +10 -3
- package/dist/js/treeshaking/config/default.js +53 -56
- package/dist/js/treeshaking/config/initial/createOutputConfig.js +1 -3
- package/dist/js/treeshaking/config/initial/createSourceConfig.js +5 -1
- package/dist/js/treeshaking/config/initial/transformNormalizedConfig.js +5 -1
- package/dist/js/treeshaking/hooks.js +1 -0
- package/dist/js/treeshaking/index.js +5 -5
- package/dist/js/treeshaking/initialize/index.js +6 -5
- package/dist/js/treeshaking/locale/en.js +1 -1
- package/dist/js/treeshaking/locale/zh.js +1 -1
- package/dist/js/treeshaking/schema/index.js +10 -11
- package/dist/js/treeshaking/schema/legacy.js +0 -3
- package/dist/js/treeshaking/utils/commands.js +5 -1
- package/dist/js/treeshaking/utils/getServerInternalPlugins.js +210 -0
- package/dist/types/analyze/constants.d.ts +10 -1
- package/dist/types/analyze/utils.d.ts +2 -1
- package/dist/types/commands/index.d.ts +1 -1
- package/dist/types/commands/{start.d.ts → serve.d.ts} +0 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/locale/en.d.ts +1 -1
- package/dist/types/locale/index.d.ts +2 -2
- package/dist/types/locale/zh.d.ts +1 -1
- package/dist/types/types/config/index.d.ts +3 -0
- package/dist/types/types/config/source.d.ts +2 -1
- package/dist/types/types/hooks.d.ts +3 -0
- package/dist/types/types/legacyConfig/source.d.ts +0 -1
- package/dist/types/utils/commands.d.ts +2 -1
- package/dist/types/utils/getServerInternalPlugins.d.ts +2 -0
- package/package.json +25 -22
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
|
+
try {
|
|
3
|
+
var info = gen[key](arg);
|
|
4
|
+
var value = info.value;
|
|
5
|
+
} catch (error) {
|
|
6
|
+
reject(error);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (info.done) {
|
|
10
|
+
resolve(value);
|
|
11
|
+
} else {
|
|
12
|
+
Promise.resolve(value).then(_next, _throw);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function _asyncToGenerator(fn) {
|
|
16
|
+
return function() {
|
|
17
|
+
var self = this, args = arguments;
|
|
18
|
+
return new Promise(function(resolve, reject) {
|
|
19
|
+
var gen = fn.apply(self, args);
|
|
20
|
+
function _next(value) {
|
|
21
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
22
|
+
}
|
|
23
|
+
function _throw(err) {
|
|
24
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
25
|
+
}
|
|
26
|
+
_next(undefined);
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function _defineProperty(obj, key, value) {
|
|
31
|
+
if (key in obj) {
|
|
32
|
+
Object.defineProperty(obj, key, {
|
|
33
|
+
value: value,
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
writable: true
|
|
37
|
+
});
|
|
38
|
+
} else {
|
|
39
|
+
obj[key] = value;
|
|
40
|
+
}
|
|
41
|
+
return obj;
|
|
42
|
+
}
|
|
43
|
+
function _objectSpread(target) {
|
|
44
|
+
for(var i = 1; i < arguments.length; i++){
|
|
45
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
46
|
+
var ownKeys = Object.keys(source);
|
|
47
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
48
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
49
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
ownKeys.forEach(function(key) {
|
|
53
|
+
_defineProperty(target, key, source[key]);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return target;
|
|
57
|
+
}
|
|
58
|
+
function ownKeys(object, enumerableOnly) {
|
|
59
|
+
var keys = Object.keys(object);
|
|
60
|
+
if (Object.getOwnPropertySymbols) {
|
|
61
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
62
|
+
if (enumerableOnly) {
|
|
63
|
+
symbols = symbols.filter(function(sym) {
|
|
64
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
keys.push.apply(keys, symbols);
|
|
68
|
+
}
|
|
69
|
+
return keys;
|
|
70
|
+
}
|
|
71
|
+
function _objectSpreadProps(target, source) {
|
|
72
|
+
source = source != null ? source : {};
|
|
73
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
74
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
75
|
+
} else {
|
|
76
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
77
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return target;
|
|
81
|
+
}
|
|
82
|
+
var __generator = this && this.__generator || function(thisArg, body) {
|
|
83
|
+
var f, y, t, g, _ = {
|
|
84
|
+
label: 0,
|
|
85
|
+
sent: function() {
|
|
86
|
+
if (t[0] & 1) throw t[1];
|
|
87
|
+
return t[1];
|
|
88
|
+
},
|
|
89
|
+
trys: [],
|
|
90
|
+
ops: []
|
|
91
|
+
};
|
|
92
|
+
return g = {
|
|
93
|
+
next: verb(0),
|
|
94
|
+
"throw": verb(1),
|
|
95
|
+
"return": verb(2)
|
|
96
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
97
|
+
return this;
|
|
98
|
+
}), g;
|
|
99
|
+
function verb(n) {
|
|
100
|
+
return function(v) {
|
|
101
|
+
return step([
|
|
102
|
+
n,
|
|
103
|
+
v
|
|
104
|
+
]);
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function step(op) {
|
|
108
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
109
|
+
while(_)try {
|
|
110
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
111
|
+
if (y = 0, t) op = [
|
|
112
|
+
op[0] & 2,
|
|
113
|
+
t.value
|
|
114
|
+
];
|
|
115
|
+
switch(op[0]){
|
|
116
|
+
case 0:
|
|
117
|
+
case 1:
|
|
118
|
+
t = op;
|
|
119
|
+
break;
|
|
120
|
+
case 4:
|
|
121
|
+
_.label++;
|
|
122
|
+
return {
|
|
123
|
+
value: op[1],
|
|
124
|
+
done: false
|
|
125
|
+
};
|
|
126
|
+
case 5:
|
|
127
|
+
_.label++;
|
|
128
|
+
y = op[1];
|
|
129
|
+
op = [
|
|
130
|
+
0
|
|
131
|
+
];
|
|
132
|
+
continue;
|
|
133
|
+
case 7:
|
|
134
|
+
op = _.ops.pop();
|
|
135
|
+
_.trys.pop();
|
|
136
|
+
continue;
|
|
137
|
+
default:
|
|
138
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
139
|
+
_ = 0;
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
143
|
+
_.label = op[1];
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
147
|
+
_.label = t[1];
|
|
148
|
+
t = op;
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
if (t && _.label < t[2]) {
|
|
152
|
+
_.label = t[2];
|
|
153
|
+
_.ops.push(op);
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
if (t[2]) _.ops.pop();
|
|
157
|
+
_.trys.pop();
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
op = body.call(thisArg, _);
|
|
161
|
+
} catch (e) {
|
|
162
|
+
op = [
|
|
163
|
+
6,
|
|
164
|
+
e
|
|
165
|
+
];
|
|
166
|
+
y = 0;
|
|
167
|
+
} finally{
|
|
168
|
+
f = t = 0;
|
|
169
|
+
}
|
|
170
|
+
if (op[0] & 5) throw op[1];
|
|
171
|
+
return {
|
|
172
|
+
value: op[0] ? op[1] : void 0,
|
|
173
|
+
done: true
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
function getServerInternalPlugins(api) {
|
|
178
|
+
return _getServerInternalPlugins.apply(this, arguments);
|
|
179
|
+
}
|
|
180
|
+
function _getServerInternalPlugins() {
|
|
181
|
+
_getServerInternalPlugins = _asyncToGenerator(function(api) {
|
|
182
|
+
var hookRunners, ref, serverPlugins, serverInternalPlugins;
|
|
183
|
+
return __generator(this, function(_state) {
|
|
184
|
+
switch(_state.label){
|
|
185
|
+
case 0:
|
|
186
|
+
hookRunners = api.useHookRunners();
|
|
187
|
+
return [
|
|
188
|
+
4,
|
|
189
|
+
hookRunners.collectServerPlugins({
|
|
190
|
+
plugins: []
|
|
191
|
+
})
|
|
192
|
+
];
|
|
193
|
+
case 1:
|
|
194
|
+
ref = _state.sent(), serverPlugins = ref.plugins;
|
|
195
|
+
serverInternalPlugins = serverPlugins.reduce(function(result, plugin) {
|
|
196
|
+
return Object.assign(result, plugin);
|
|
197
|
+
}, {});
|
|
198
|
+
api.setAppContext(_objectSpreadProps(_objectSpread({}, api.useAppContext()), {
|
|
199
|
+
serverInternalPlugins: serverInternalPlugins
|
|
200
|
+
}));
|
|
201
|
+
return [
|
|
202
|
+
2,
|
|
203
|
+
serverInternalPlugins
|
|
204
|
+
];
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
return _getServerInternalPlugins.apply(this, arguments);
|
|
209
|
+
}
|
|
210
|
+
export { getServerInternalPlugins };
|
|
@@ -15,4 +15,13 @@ export declare const FILE_SYSTEM_ROUTES_INDEX = "index";
|
|
|
15
15
|
export declare const FILE_SYSTEM_ROUTES_IGNORED_REGEX: RegExp;
|
|
16
16
|
export declare const HTML_PARTIALS_FOLDER = "html";
|
|
17
17
|
export declare const HTML_PARTIALS_EXTENSIONS: string[];
|
|
18
|
-
export declare const FILE_SYSTEM_ROUTES_COMPONENTS_DIR = "internal_components";
|
|
18
|
+
export declare const FILE_SYSTEM_ROUTES_COMPONENTS_DIR = "internal_components";
|
|
19
|
+
export declare const NESTED_ROUTE: {
|
|
20
|
+
LAYOUT_FILE: string;
|
|
21
|
+
LAYOUT_LOADER_FILE: string;
|
|
22
|
+
PAGE_FILE: string;
|
|
23
|
+
PAGE_LOADER_FILE: string;
|
|
24
|
+
LOADING_FILE: string;
|
|
25
|
+
ERROR_FILE: string;
|
|
26
|
+
LOADER_FILE: string;
|
|
27
|
+
};
|
|
@@ -14,7 +14,8 @@ export declare const getDefaultImports: ({
|
|
|
14
14
|
internalDirAlias: string;
|
|
15
15
|
internalDirectory: string;
|
|
16
16
|
}) => ImportStatement[];
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const isPageComponentFile: (filePath: string) => boolean;
|
|
18
|
+
export declare const isNestedRouteComponent: (nestedRouteEntries: string[], absoluteFilePath: string) => boolean;
|
|
18
19
|
export declare const replaceWithAlias: (base: string, filePath: string, alias: string) => string;
|
|
19
20
|
export declare const parseModule: ({
|
|
20
21
|
source,
|
|
File without changes
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { CliPlugin, PluginAPI } from '@modern-js/core';
|
|
|
3
3
|
import { AppTools } from './types';
|
|
4
4
|
export * from './defineConfig';
|
|
5
5
|
export * from './types';
|
|
6
|
+
export type { RuntimeUserConfig } from './types/config';
|
|
6
7
|
export declare const devCommand: (program: Command, api: PluginAPI<AppTools>) => Promise<void>;
|
|
7
8
|
export declare const buildCommand: (program: Command, api: PluginAPI<AppTools>) => Promise<void>;
|
|
8
9
|
|
|
@@ -14,7 +14,7 @@ declare const localeKeys: {
|
|
|
14
14
|
build: {
|
|
15
15
|
describe: string;
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
serve: {
|
|
18
18
|
describe: string;
|
|
19
19
|
};
|
|
20
20
|
deploy: {
|
|
@@ -47,7 +47,7 @@ declare const localeKeys: {
|
|
|
47
47
|
build: {
|
|
48
48
|
describe: string;
|
|
49
49
|
};
|
|
50
|
-
|
|
50
|
+
serve: {
|
|
51
51
|
describe: string;
|
|
52
52
|
};
|
|
53
53
|
deploy: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { UserConfig } from '@modern-js/core';
|
|
2
2
|
import type { ServerUserConfig, ServerNormalizedConfig, BffUserConfig, BffNormalizedConfig } from '@modern-js/server-core';
|
|
3
|
+
import type { BuilderPlugin } from '@modern-js/builder-webpack-provider';
|
|
3
4
|
import type { AppToolsHooks } from '../hooks';
|
|
4
5
|
import type { OutputNormalizedConfig, OutputUserConfig } from './output';
|
|
5
6
|
import type { SourceNormalizedConfig, SourceUserConfig } from './source';
|
|
@@ -32,6 +33,7 @@ export interface AppToolsUserConfig {
|
|
|
32
33
|
runtimeByEntries?: RuntimeByEntriesUserConfig;
|
|
33
34
|
performance?: PerformanceUserConfig;
|
|
34
35
|
experiments?: ExperimentsUserConfig;
|
|
36
|
+
builderPlugins?: BuilderPlugin[];
|
|
35
37
|
/**
|
|
36
38
|
* The configuration of `bff` is provided by `bff` plugin.
|
|
37
39
|
* Please use `yarn new` or `pnpm new` to enable the corresponding capability.
|
|
@@ -54,6 +56,7 @@ export declare type AppToolsNormalizedConfig = {
|
|
|
54
56
|
tools: ToolsNormalizedConfig;
|
|
55
57
|
performance: PerformanceNormalizedConfig;
|
|
56
58
|
experiments: ExperimentsNormalizedConfig;
|
|
59
|
+
builderPlugins: BuilderPlugin[];
|
|
57
60
|
cliOptions?: Record<string, any>;
|
|
58
61
|
_raw: UserConfig<{
|
|
59
62
|
hooks: AppToolsHooks;
|
|
@@ -2,8 +2,8 @@ import type { BuilderConfig } from '@modern-js/builder-webpack-provider';
|
|
|
2
2
|
export declare type BuilderSourceConfig = Required<BuilderConfig>['source'];
|
|
3
3
|
export declare type Entry = string | {
|
|
4
4
|
entry: string;
|
|
5
|
-
enableFileSystemRoutes?: boolean;
|
|
6
5
|
disableMount?: boolean;
|
|
6
|
+
customBootstrap?: string;
|
|
7
7
|
};
|
|
8
8
|
export declare type Entries = Record<string, Entry>;
|
|
9
9
|
export interface SourceUserConfig extends BuilderSourceConfig {
|
|
@@ -11,6 +11,7 @@ export interface SourceUserConfig extends BuilderSourceConfig {
|
|
|
11
11
|
enableAsyncEntry?: boolean;
|
|
12
12
|
disableDefaultEntries?: boolean;
|
|
13
13
|
entriesDir?: string;
|
|
14
|
+
disableEntryDirs?: string[];
|
|
14
15
|
configDir?: string;
|
|
15
16
|
/**
|
|
16
17
|
* The configuration of `source.designSystem` is provided by `tailwindcss` plugin.
|
|
@@ -54,6 +54,9 @@ export declare type AppToolsHooks = {
|
|
|
54
54
|
code: string;
|
|
55
55
|
}>;
|
|
56
56
|
addDefineTypes: AsyncWaterfall<void>;
|
|
57
|
+
collectServerPlugins: AsyncWaterfall<{
|
|
58
|
+
plugins: Array<Record<string, string>>;
|
|
59
|
+
}>;
|
|
57
60
|
beforeDev: AsyncWorkflow<void, unknown>;
|
|
58
61
|
afterDev: AsyncWorkflow<void, unknown>;
|
|
59
62
|
beforeCreateCompiler: AsyncWorkflow<{
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const getCommand: () => string;
|
|
1
|
+
export declare const getCommand: () => string;
|
|
2
|
+
export declare const isDevCommand: () => boolean;
|
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.7",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -38,6 +38,9 @@
|
|
|
38
38
|
"default": "./dist/js/node/exports/server.js"
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=14.17.6"
|
|
43
|
+
},
|
|
41
44
|
"typesVersions": {
|
|
42
45
|
"*": {
|
|
43
46
|
".": [
|
|
@@ -62,23 +65,23 @@
|
|
|
62
65
|
"@babel/types": "^7.18.0",
|
|
63
66
|
"es-module-lexer": "^1.1.0",
|
|
64
67
|
"esbuild": "0.15.7",
|
|
65
|
-
"@modern-js/builder": "2.0.0-beta.
|
|
66
|
-
"@modern-js/builder-plugin-esbuild": "2.0.0-beta.
|
|
67
|
-
"@modern-js/builder-plugin-node-polyfill": "2.0.0-beta.
|
|
68
|
-
"@modern-js/builder-shared": "2.0.0-beta.
|
|
69
|
-
"@modern-js/builder-webpack-provider": "2.0.0-beta.
|
|
70
|
-
"@modern-js/core": "2.0.0-beta.
|
|
71
|
-
"@modern-js/new-action": "2.0.0-beta.
|
|
72
|
-
"@modern-js/node-bundle-require": "2.0.0-beta.
|
|
73
|
-
"@modern-js/plugin": "2.0.0-beta.
|
|
74
|
-
"@modern-js/plugin-data-loader": "2.0.0-beta.
|
|
75
|
-
"@modern-js/plugin-i18n": "2.0.0-beta.
|
|
76
|
-
"@modern-js/plugin-lint": "2.0.0-beta.
|
|
77
|
-
"@modern-js/prod-server": "2.0.0-beta.
|
|
78
|
-
"@modern-js/server": "2.0.0-beta.
|
|
79
|
-
"@modern-js/types": "2.0.0-beta.
|
|
80
|
-
"@modern-js/upgrade": "2.0.0-beta.
|
|
81
|
-
"@modern-js/utils": "2.0.0-beta.
|
|
68
|
+
"@modern-js/builder": "2.0.0-beta.7",
|
|
69
|
+
"@modern-js/builder-plugin-esbuild": "2.0.0-beta.7",
|
|
70
|
+
"@modern-js/builder-plugin-node-polyfill": "2.0.0-beta.7",
|
|
71
|
+
"@modern-js/builder-shared": "2.0.0-beta.7",
|
|
72
|
+
"@modern-js/builder-webpack-provider": "2.0.0-beta.7",
|
|
73
|
+
"@modern-js/core": "2.0.0-beta.7",
|
|
74
|
+
"@modern-js/new-action": "2.0.0-beta.7",
|
|
75
|
+
"@modern-js/node-bundle-require": "2.0.0-beta.7",
|
|
76
|
+
"@modern-js/plugin": "2.0.0-beta.7",
|
|
77
|
+
"@modern-js/plugin-data-loader": "2.0.0-beta.7",
|
|
78
|
+
"@modern-js/plugin-i18n": "2.0.0-beta.7",
|
|
79
|
+
"@modern-js/plugin-lint": "2.0.0-beta.7",
|
|
80
|
+
"@modern-js/prod-server": "2.0.0-beta.7",
|
|
81
|
+
"@modern-js/server": "2.0.0-beta.7",
|
|
82
|
+
"@modern-js/types": "2.0.0-beta.7",
|
|
83
|
+
"@modern-js/upgrade": "2.0.0-beta.7",
|
|
84
|
+
"@modern-js/utils": "2.0.0-beta.7"
|
|
82
85
|
},
|
|
83
86
|
"devDependencies": {
|
|
84
87
|
"@types/babel__traverse": "^7.14.2",
|
|
@@ -87,10 +90,10 @@
|
|
|
87
90
|
"jest": "^27",
|
|
88
91
|
"typescript": "^4",
|
|
89
92
|
"webpack": "^5.75.0",
|
|
90
|
-
"@modern-js/builder-plugin-swc": "2.0.0-beta.
|
|
91
|
-
"@modern-js/server-core": "2.0.0-beta.
|
|
92
|
-
"@scripts/
|
|
93
|
-
"@scripts/
|
|
93
|
+
"@modern-js/builder-plugin-swc": "2.0.0-beta.7",
|
|
94
|
+
"@modern-js/server-core": "2.0.0-beta.7",
|
|
95
|
+
"@scripts/jest-config": "2.0.0-beta.7",
|
|
96
|
+
"@scripts/build": "2.0.0-beta.7"
|
|
94
97
|
},
|
|
95
98
|
"sideEffects": false,
|
|
96
99
|
"publishConfig": {
|