@modern-js/app-tools 2.53.1-alpha.4 → 2.54.1-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/bin/modern.js +0 -2
- package/dist/cjs/builder/shared/builderPlugins/adapterHtml.js +2 -1
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +2 -2
- package/dist/cjs/commands/build.js +2 -0
- package/dist/cjs/commands/deploy.js +2 -2
- package/dist/cjs/commands/dev.js +19 -5
- package/dist/cjs/commands/index.js +113 -7
- package/dist/cjs/commands/serve.js +19 -5
- package/dist/cjs/hooks.js +5 -0
- package/dist/cjs/index.js +14 -83
- package/dist/cjs/plugins/analyze/constants.js +56 -0
- package/dist/cjs/{analyze → plugins/analyze}/generateCode.js +11 -84
- package/dist/cjs/{analyze → plugins/analyze}/getBundleEntry.js +11 -20
- package/dist/cjs/{analyze → plugins/analyze}/getFileSystemEntry.js +33 -47
- package/dist/cjs/{analyze → plugins/analyze}/getServerRoutes.js +1 -1
- package/dist/cjs/{analyze → plugins/analyze}/index.js +9 -24
- package/dist/cjs/plugins/analyze/templates.js +101 -0
- package/dist/cjs/{analyze → plugins/analyze}/utils.js +12 -55
- package/dist/cjs/plugins/deploy/platforms/netlify.js +2 -2
- package/dist/cjs/plugins/deploy/platforms/node.js +2 -2
- package/dist/cjs/plugins/deploy/platforms/vercel.js +2 -2
- package/dist/cjs/{initialize → plugins/initialize}/index.js +1 -1
- package/dist/cjs/plugins/serverBuild.js +10 -4
- package/dist/cjs/utils/createServer.js +1 -1
- package/dist/cjs/utils/{getServerInternalPlugins.js → loadPlugins.js} +18 -11
- package/dist/esm/builder/shared/builderPlugins/adapterHtml.js +4 -1
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.js +2 -2
- package/dist/esm/commands/build.js +16 -9
- package/dist/esm/commands/deploy.js +2 -2
- package/dist/esm/commands/dev.js +13 -9
- package/dist/esm/commands/index.js +411 -3
- package/dist/esm/commands/serve.js +12 -8
- package/dist/esm/hooks.js +5 -0
- package/dist/esm/index.js +12 -394
- package/dist/esm/plugins/analyze/constants.js +24 -0
- package/dist/esm/{analyze → plugins/analyze}/generateCode.js +27 -169
- package/dist/esm/plugins/analyze/getBundleEntry.js +101 -0
- package/dist/esm/plugins/analyze/getFileSystemEntry.js +195 -0
- package/dist/esm/{analyze → plugins/analyze}/getServerRoutes.js +1 -1
- package/dist/esm/{analyze → plugins/analyze}/index.js +42 -70
- package/dist/esm/plugins/analyze/templates.js +22 -0
- package/dist/esm/{analyze → plugins/analyze}/utils.js +13 -135
- package/dist/esm/plugins/deploy/platforms/netlify.js +5 -3
- package/dist/esm/plugins/deploy/platforms/node.js +5 -3
- package/dist/esm/plugins/deploy/platforms/vercel.js +5 -3
- package/dist/esm/{initialize → plugins/initialize}/index.js +1 -1
- package/dist/esm/plugins/serverBuild.js +13 -6
- package/dist/esm/utils/createServer.js +2 -2
- package/dist/esm/utils/loadPlugins.js +64 -0
- package/dist/esm-node/builder/shared/builderPlugins/adapterHtml.js +2 -1
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.js +2 -2
- package/dist/esm-node/commands/build.js +2 -0
- package/dist/esm-node/commands/deploy.js +2 -2
- package/dist/esm-node/commands/dev.js +11 -7
- package/dist/esm-node/commands/index.js +92 -3
- package/dist/esm-node/commands/serve.js +10 -6
- package/dist/esm-node/hooks.js +5 -0
- package/dist/esm-node/index.js +12 -79
- package/dist/esm-node/plugins/analyze/constants.js +24 -0
- package/dist/esm-node/{analyze → plugins/analyze}/generateCode.js +14 -87
- package/dist/esm-node/{analyze → plugins/analyze}/getBundleEntry.js +11 -20
- package/dist/esm-node/plugins/analyze/getFileSystemEntry.js +75 -0
- package/dist/esm-node/{analyze → plugins/analyze}/getServerRoutes.js +1 -1
- package/dist/esm-node/{analyze → plugins/analyze}/index.js +10 -25
- package/dist/esm-node/plugins/analyze/templates.js +75 -0
- package/dist/esm-node/{analyze → plugins/analyze}/utils.js +13 -52
- package/dist/esm-node/plugins/deploy/platforms/netlify.js +3 -3
- package/dist/esm-node/plugins/deploy/platforms/node.js +3 -3
- package/dist/esm-node/plugins/deploy/platforms/vercel.js +3 -3
- package/dist/esm-node/{initialize → plugins/initialize}/index.js +1 -1
- package/dist/esm-node/plugins/serverBuild.js +11 -5
- package/dist/esm-node/utils/createServer.js +2 -2
- package/dist/esm-node/utils/loadPlugins.js +21 -0
- package/dist/types/builder/builder-webpack/createCopyPattern.d.ts +2 -2
- package/dist/types/commands/index.d.ts +10 -3
- package/dist/types/config/initialize/inits.d.ts +1 -1
- package/dist/types/exports/server.d.ts +4 -0
- package/dist/types/index.d.ts +2 -5
- package/dist/types/plugins/analyze/constants.d.ts +9 -0
- package/dist/types/{analyze → plugins/analyze}/generateCode.d.ts +1 -1
- package/dist/types/plugins/analyze/getBundleEntry.d.ts +4 -0
- package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +5 -0
- package/dist/types/{analyze → plugins/analyze}/getHtmlTemplate.d.ts +1 -1
- package/dist/types/{analyze → plugins/analyze}/getServerRoutes.d.ts +1 -1
- package/dist/types/{analyze → plugins/analyze}/index.d.ts +1 -1
- package/dist/types/plugins/analyze/templates.d.ts +19 -0
- package/dist/types/{analyze → plugins/analyze}/utils.d.ts +4 -6
- package/dist/types/{initialize → plugins/initialize}/index.d.ts +1 -1
- package/dist/types/types/hooks.d.ts +11 -1
- package/dist/types/utils/loadPlugins.d.ts +5 -0
- package/package.json +22 -22
- package/dist/cjs/analyze/constants.js +0 -122
- package/dist/cjs/analyze/getClientRoutes/getRoutes.js +0 -197
- package/dist/cjs/analyze/getClientRoutes/getRoutesLegacy.js +0 -195
- package/dist/cjs/analyze/getClientRoutes/index.js +0 -31
- package/dist/cjs/analyze/getClientRoutes/utils.js +0 -59
- package/dist/cjs/analyze/makeLegalIdentifier.js +0 -37
- package/dist/cjs/analyze/nestedRoutes.js +0 -295
- package/dist/cjs/analyze/templates.js +0 -444
- package/dist/esm/analyze/constants.js +0 -76
- package/dist/esm/analyze/getBundleEntry.js +0 -75
- package/dist/esm/analyze/getClientRoutes/getRoutes.js +0 -185
- package/dist/esm/analyze/getClientRoutes/getRoutesLegacy.js +0 -183
- package/dist/esm/analyze/getClientRoutes/index.js +0 -6
- package/dist/esm/analyze/getClientRoutes/utils.js +0 -28
- package/dist/esm/analyze/getFileSystemEntry.js +0 -113
- package/dist/esm/analyze/makeLegalIdentifier.js +0 -15
- package/dist/esm/analyze/nestedRoutes.js +0 -398
- package/dist/esm/analyze/templates.js +0 -435
- package/dist/esm/utils/getServerInternalPlugins.js +0 -40
- package/dist/esm-node/analyze/constants.js +0 -76
- package/dist/esm-node/analyze/getClientRoutes/getRoutes.js +0 -163
- package/dist/esm-node/analyze/getClientRoutes/getRoutesLegacy.js +0 -161
- package/dist/esm-node/analyze/getClientRoutes/index.js +0 -6
- package/dist/esm-node/analyze/getClientRoutes/utils.js +0 -22
- package/dist/esm-node/analyze/getFileSystemEntry.js +0 -89
- package/dist/esm-node/analyze/makeLegalIdentifier.js +0 -13
- package/dist/esm-node/analyze/nestedRoutes.js +0 -259
- package/dist/esm-node/analyze/templates.js +0 -405
- package/dist/esm-node/utils/getServerInternalPlugins.js +0 -15
- package/dist/types/analyze/constants.d.ts +0 -42
- package/dist/types/analyze/getBundleEntry.d.ts +0 -3
- package/dist/types/analyze/getClientRoutes/getRoutes.d.ts +0 -8
- package/dist/types/analyze/getClientRoutes/getRoutesLegacy.d.ts +0 -9
- package/dist/types/analyze/getClientRoutes/index.d.ts +0 -2
- package/dist/types/analyze/getClientRoutes/utils.d.ts +0 -5
- package/dist/types/analyze/getFileSystemEntry.d.ts +0 -4
- package/dist/types/analyze/makeLegalIdentifier.d.ts +0 -1
- package/dist/types/analyze/nestedRoutes.d.ts +0 -7
- package/dist/types/analyze/templates.d.ts +0 -30
- package/dist/types/utils/getServerInternalPlugins.d.ts +0 -2
- /package/dist/cjs/{analyze → plugins/analyze}/getHtmlTemplate.js +0 -0
- /package/dist/cjs/{analyze → plugins/analyze}/isDefaultExportFunction.js +0 -0
- /package/dist/esm/{analyze → plugins/analyze}/getHtmlTemplate.js +0 -0
- /package/dist/esm/{analyze → plugins/analyze}/isDefaultExportFunction.js +0 -0
- /package/dist/esm-node/{analyze → plugins/analyze}/getHtmlTemplate.js +0 -0
- /package/dist/esm-node/{analyze → plugins/analyze}/isDefaultExportFunction.js +0 -0
- /package/dist/types/{analyze → plugins/analyze}/isDefaultExportFunction.d.ts +0 -0
package/dist/esm/index.js
CHANGED
@@ -4,273 +4,21 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
4
4
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
5
5
|
import path from "path";
|
6
6
|
import { lintPlugin } from "@modern-js/plugin-lint";
|
7
|
-
import { cleanRequireCache, emptyDir, getCommand, getArgv, fs, NESTED_ROUTE_SPEC_FILE
|
8
|
-
import { castArray } from "@modern-js/utils/lodash";
|
7
|
+
import { cleanRequireCache, emptyDir, getCommand, getArgv, fs, NESTED_ROUTE_SPEC_FILE } from "@modern-js/utils";
|
9
8
|
import { getLocaleLanguage } from "@modern-js/plugin-i18n/language-detector";
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import { hooks } from "./hooks";
|
13
|
-
import { i18n, localeKeys } from "./locale";
|
9
|
+
import initializePlugin from "./plugins/initialize";
|
10
|
+
import analyzePlugin from "./plugins/analyze";
|
14
11
|
import serverBuildPlugin from "./plugins/serverBuild";
|
15
12
|
import deployPlugin from "./plugins/deploy";
|
13
|
+
import { hooks } from "./hooks";
|
14
|
+
import { i18n } from "./locale";
|
16
15
|
import { restart } from "./utils/restart";
|
17
16
|
import { generateWatchFiles } from "./utils/generateWatchFiles";
|
17
|
+
import { buildCommand, deployCommand, devCommand, inspectCommand, newCommand, serverCommand, upgradeCommand } from "./commands";
|
18
|
+
import { dev } from "./commands/dev";
|
18
19
|
import { mergeConfig } from "@modern-js/core";
|
19
|
-
import { dev } from "./commands";
|
20
20
|
export * from "./defineConfig";
|
21
21
|
export * from "./types";
|
22
|
-
var devCommand = function() {
|
23
|
-
var _ref = _async_to_generator(function(program, api) {
|
24
|
-
var runner, devToolMetas, devProgram, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, meta, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, subCmd;
|
25
|
-
return _ts_generator(this, function(_state) {
|
26
|
-
switch (_state.label) {
|
27
|
-
case 0:
|
28
|
-
runner = api.useHookRunners();
|
29
|
-
return [
|
30
|
-
4,
|
31
|
-
runner.registerDev()
|
32
|
-
];
|
33
|
-
case 1:
|
34
|
-
devToolMetas = _state.sent();
|
35
|
-
devProgram = program.command("dev").alias("start").usage("[options]").description(i18n.t(localeKeys.command.dev.describe)).option("-c --config <config>", i18n.t(localeKeys.command.shared.config)).option("-e --entry [entry...]", i18n.t(localeKeys.command.dev.entry)).option("--analyze", i18n.t(localeKeys.command.shared.analyze)).option("--api-only", i18n.t(localeKeys.command.dev.apiOnly)).option("--web-only", i18n.t(localeKeys.command.dev.webOnly)).action(function() {
|
36
|
-
var _ref2 = _async_to_generator(function(options) {
|
37
|
-
var dev2;
|
38
|
-
return _ts_generator(this, function(_state2) {
|
39
|
-
switch (_state2.label) {
|
40
|
-
case 0:
|
41
|
-
return [
|
42
|
-
4,
|
43
|
-
import("./commands/dev")
|
44
|
-
];
|
45
|
-
case 1:
|
46
|
-
dev2 = _state2.sent().dev;
|
47
|
-
return [
|
48
|
-
4,
|
49
|
-
dev2(api, options)
|
50
|
-
];
|
51
|
-
case 2:
|
52
|
-
_state2.sent();
|
53
|
-
return [
|
54
|
-
2
|
55
|
-
];
|
56
|
-
}
|
57
|
-
});
|
58
|
-
});
|
59
|
-
return function(options) {
|
60
|
-
return _ref2.apply(this, arguments);
|
61
|
-
};
|
62
|
-
}());
|
63
|
-
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
64
|
-
try {
|
65
|
-
for (_iterator = devToolMetas[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
66
|
-
meta = _step.value;
|
67
|
-
if (!meta.subCommands) {
|
68
|
-
continue;
|
69
|
-
}
|
70
|
-
_iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
71
|
-
try {
|
72
|
-
for (_iterator1 = meta.subCommands[Symbol.iterator](); !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
73
|
-
subCmd = _step1.value;
|
74
|
-
devProgram.command(subCmd).action(/* @__PURE__ */ _async_to_generator(function() {
|
75
|
-
var options, appDirectory, isTypescript;
|
76
|
-
var _arguments = arguments;
|
77
|
-
return _ts_generator(this, function(_state2) {
|
78
|
-
switch (_state2.label) {
|
79
|
-
case 0:
|
80
|
-
options = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {};
|
81
|
-
appDirectory = api.useAppContext().appDirectory;
|
82
|
-
return [
|
83
|
-
4,
|
84
|
-
import("@modern-js/utils")
|
85
|
-
];
|
86
|
-
case 1:
|
87
|
-
isTypescript = _state2.sent().isTypescript;
|
88
|
-
return [
|
89
|
-
4,
|
90
|
-
runner.beforeDevTask(meta)
|
91
|
-
];
|
92
|
-
case 2:
|
93
|
-
_state2.sent();
|
94
|
-
return [
|
95
|
-
4,
|
96
|
-
meta.action(options, {
|
97
|
-
isTsProject: isTypescript(appDirectory)
|
98
|
-
})
|
99
|
-
];
|
100
|
-
case 3:
|
101
|
-
_state2.sent();
|
102
|
-
return [
|
103
|
-
2
|
104
|
-
];
|
105
|
-
}
|
106
|
-
});
|
107
|
-
}));
|
108
|
-
}
|
109
|
-
} catch (err) {
|
110
|
-
_didIteratorError1 = true;
|
111
|
-
_iteratorError1 = err;
|
112
|
-
} finally {
|
113
|
-
try {
|
114
|
-
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
115
|
-
_iterator1.return();
|
116
|
-
}
|
117
|
-
} finally {
|
118
|
-
if (_didIteratorError1) {
|
119
|
-
throw _iteratorError1;
|
120
|
-
}
|
121
|
-
}
|
122
|
-
}
|
123
|
-
}
|
124
|
-
} catch (err) {
|
125
|
-
_didIteratorError = true;
|
126
|
-
_iteratorError = err;
|
127
|
-
} finally {
|
128
|
-
try {
|
129
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
130
|
-
_iterator.return();
|
131
|
-
}
|
132
|
-
} finally {
|
133
|
-
if (_didIteratorError) {
|
134
|
-
throw _iteratorError;
|
135
|
-
}
|
136
|
-
}
|
137
|
-
}
|
138
|
-
return [
|
139
|
-
2
|
140
|
-
];
|
141
|
-
}
|
142
|
-
});
|
143
|
-
});
|
144
|
-
return function devCommand2(program, api) {
|
145
|
-
return _ref.apply(this, arguments);
|
146
|
-
};
|
147
|
-
}();
|
148
|
-
var buildCommand = function() {
|
149
|
-
var _ref = _async_to_generator(function(program, api) {
|
150
|
-
var runner, platformBuilders, buildProgram, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _loop, _iterator, _step;
|
151
|
-
return _ts_generator(this, function(_state) {
|
152
|
-
switch (_state.label) {
|
153
|
-
case 0:
|
154
|
-
runner = api.useHookRunners();
|
155
|
-
return [
|
156
|
-
4,
|
157
|
-
runner.registerBuildPlatform()
|
158
|
-
];
|
159
|
-
case 1:
|
160
|
-
platformBuilders = _state.sent();
|
161
|
-
buildProgram = program.command("build").usage("[options]").description(i18n.t(localeKeys.command.build.describe)).option("-c --config <config>", i18n.t(localeKeys.command.shared.config)).option("--analyze", i18n.t(localeKeys.command.shared.analyze)).action(function() {
|
162
|
-
var _ref2 = _async_to_generator(function(options) {
|
163
|
-
var build;
|
164
|
-
return _ts_generator(this, function(_state2) {
|
165
|
-
switch (_state2.label) {
|
166
|
-
case 0:
|
167
|
-
return [
|
168
|
-
4,
|
169
|
-
import("./commands/build")
|
170
|
-
];
|
171
|
-
case 1:
|
172
|
-
build = _state2.sent().build;
|
173
|
-
return [
|
174
|
-
4,
|
175
|
-
build(api, options)
|
176
|
-
];
|
177
|
-
case 2:
|
178
|
-
_state2.sent();
|
179
|
-
return [
|
180
|
-
2
|
181
|
-
];
|
182
|
-
}
|
183
|
-
});
|
184
|
-
});
|
185
|
-
return function(options) {
|
186
|
-
return _ref2.apply(this, arguments);
|
187
|
-
};
|
188
|
-
}());
|
189
|
-
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
190
|
-
try {
|
191
|
-
_loop = function() {
|
192
|
-
var platformBuilder = _step.value;
|
193
|
-
var platforms = castArray(platformBuilder.platform);
|
194
|
-
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
195
|
-
try {
|
196
|
-
var _loop2 = function() {
|
197
|
-
var platform = _step1.value;
|
198
|
-
buildProgram.command(platform).action(/* @__PURE__ */ _async_to_generator(function() {
|
199
|
-
var appDirectory, isTypescript;
|
200
|
-
return _ts_generator(this, function(_state2) {
|
201
|
-
switch (_state2.label) {
|
202
|
-
case 0:
|
203
|
-
appDirectory = api.useAppContext().appDirectory;
|
204
|
-
return [
|
205
|
-
4,
|
206
|
-
import("@modern-js/utils")
|
207
|
-
];
|
208
|
-
case 1:
|
209
|
-
isTypescript = _state2.sent().isTypescript;
|
210
|
-
return [
|
211
|
-
4,
|
212
|
-
runner.beforeBuildPlatform(platformBuilders)
|
213
|
-
];
|
214
|
-
case 2:
|
215
|
-
_state2.sent();
|
216
|
-
return [
|
217
|
-
4,
|
218
|
-
platformBuilder.build(platform, {
|
219
|
-
isTsProject: isTypescript(appDirectory)
|
220
|
-
})
|
221
|
-
];
|
222
|
-
case 3:
|
223
|
-
_state2.sent();
|
224
|
-
return [
|
225
|
-
2
|
226
|
-
];
|
227
|
-
}
|
228
|
-
});
|
229
|
-
}));
|
230
|
-
};
|
231
|
-
for (var _iterator2 = platforms[Symbol.iterator](), _step1; !(_iteratorNormalCompletion2 = (_step1 = _iterator2.next()).done); _iteratorNormalCompletion2 = true)
|
232
|
-
_loop2();
|
233
|
-
} catch (err) {
|
234
|
-
_didIteratorError2 = true;
|
235
|
-
_iteratorError2 = err;
|
236
|
-
} finally {
|
237
|
-
try {
|
238
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
239
|
-
_iterator2.return();
|
240
|
-
}
|
241
|
-
} finally {
|
242
|
-
if (_didIteratorError2) {
|
243
|
-
throw _iteratorError2;
|
244
|
-
}
|
245
|
-
}
|
246
|
-
}
|
247
|
-
};
|
248
|
-
for (_iterator = platformBuilders[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)
|
249
|
-
_loop();
|
250
|
-
} catch (err) {
|
251
|
-
_didIteratorError = true;
|
252
|
-
_iteratorError = err;
|
253
|
-
} finally {
|
254
|
-
try {
|
255
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
256
|
-
_iterator.return();
|
257
|
-
}
|
258
|
-
} finally {
|
259
|
-
if (_didIteratorError) {
|
260
|
-
throw _iteratorError;
|
261
|
-
}
|
262
|
-
}
|
263
|
-
}
|
264
|
-
return [
|
265
|
-
2
|
266
|
-
];
|
267
|
-
}
|
268
|
-
});
|
269
|
-
});
|
270
|
-
return function buildCommand2(program, api) {
|
271
|
-
return _ref.apply(this, arguments);
|
272
|
-
};
|
273
|
-
}();
|
274
22
|
var appTools = function() {
|
275
23
|
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
276
24
|
bundler: "webpack"
|
@@ -345,139 +93,11 @@ var appTools = function() {
|
|
345
93
|
];
|
346
94
|
case 2:
|
347
95
|
_state.sent();
|
348
|
-
program
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
return [
|
354
|
-
4,
|
355
|
-
import("./commands/serve")
|
356
|
-
];
|
357
|
-
case 1:
|
358
|
-
start = _state2.sent().start;
|
359
|
-
return [
|
360
|
-
4,
|
361
|
-
start(api)
|
362
|
-
];
|
363
|
-
case 2:
|
364
|
-
_state2.sent();
|
365
|
-
return [
|
366
|
-
2
|
367
|
-
];
|
368
|
-
}
|
369
|
-
});
|
370
|
-
}));
|
371
|
-
program.command("deploy").usage("[options]").option("-c --config <config>", i18n.t(localeKeys.command.shared.config)).option("-s --skip-build", i18n.t(localeKeys.command.shared.skipBuild)).description(i18n.t(localeKeys.command.deploy.describe)).action(function() {
|
372
|
-
var _ref = _async_to_generator(function(options2) {
|
373
|
-
var build, deploy;
|
374
|
-
return _ts_generator(this, function(_state2) {
|
375
|
-
switch (_state2.label) {
|
376
|
-
case 0:
|
377
|
-
if (!!options2.skipBuild)
|
378
|
-
return [
|
379
|
-
3,
|
380
|
-
3
|
381
|
-
];
|
382
|
-
return [
|
383
|
-
4,
|
384
|
-
import("./commands/build")
|
385
|
-
];
|
386
|
-
case 1:
|
387
|
-
build = _state2.sent().build;
|
388
|
-
return [
|
389
|
-
4,
|
390
|
-
build(api)
|
391
|
-
];
|
392
|
-
case 2:
|
393
|
-
_state2.sent();
|
394
|
-
_state2.label = 3;
|
395
|
-
case 3:
|
396
|
-
return [
|
397
|
-
4,
|
398
|
-
import("./commands/deploy")
|
399
|
-
];
|
400
|
-
case 4:
|
401
|
-
deploy = _state2.sent().deploy;
|
402
|
-
return [
|
403
|
-
4,
|
404
|
-
deploy(api, options2)
|
405
|
-
];
|
406
|
-
case 5:
|
407
|
-
_state2.sent();
|
408
|
-
process.exit(0);
|
409
|
-
return [
|
410
|
-
2
|
411
|
-
];
|
412
|
-
}
|
413
|
-
});
|
414
|
-
});
|
415
|
-
return function(options2) {
|
416
|
-
return _ref.apply(this, arguments);
|
417
|
-
};
|
418
|
-
}());
|
419
|
-
program.command("new").usage("[options]").description(i18n.t(localeKeys.command.new.describe)).option("--config-file <configFile>", i18n.t(localeKeys.command.shared.config)).option("--lang <lang>", i18n.t(localeKeys.command.new.lang)).option("-c, --config <config>", i18n.t(localeKeys.command.new.config)).option("-d, --debug", i18n.t(localeKeys.command.new.debug), false).option("--dist-tag <tag>", i18n.t(localeKeys.command.new.distTag)).option("--registry", i18n.t(localeKeys.command.new.registry)).option("--no-need-install", i18n.t(localeKeys.command.shared.noNeedInstall)).action(function() {
|
420
|
-
var _ref = _async_to_generator(function(options2) {
|
421
|
-
return _ts_generator(this, function(_state2) {
|
422
|
-
switch (_state2.label) {
|
423
|
-
case 0:
|
424
|
-
return [
|
425
|
-
4,
|
426
|
-
newAction(_object_spread_props(_object_spread({}, options2), {
|
427
|
-
locale: options2.lang || locale
|
428
|
-
}), "mwa")
|
429
|
-
];
|
430
|
-
case 1:
|
431
|
-
_state2.sent();
|
432
|
-
return [
|
433
|
-
2
|
434
|
-
];
|
435
|
-
}
|
436
|
-
});
|
437
|
-
});
|
438
|
-
return function(options2) {
|
439
|
-
return _ref.apply(this, arguments);
|
440
|
-
};
|
441
|
-
}());
|
442
|
-
program.command("inspect").description("inspect the internal configs").option("--env <env>", i18n.t(localeKeys.command.inspect.env), "development").option("--output <output>", i18n.t(localeKeys.command.inspect.output), "/").option("--verbose", i18n.t(localeKeys.command.inspect.verbose)).option("-c --config <config>", i18n.t(localeKeys.command.shared.config)).action(function() {
|
443
|
-
var _ref = _async_to_generator(function(options2) {
|
444
|
-
var inspect;
|
445
|
-
return _ts_generator(this, function(_state2) {
|
446
|
-
switch (_state2.label) {
|
447
|
-
case 0:
|
448
|
-
return [
|
449
|
-
4,
|
450
|
-
import("./commands/inspect")
|
451
|
-
];
|
452
|
-
case 1:
|
453
|
-
inspect = _state2.sent().inspect;
|
454
|
-
inspect(api, options2);
|
455
|
-
return [
|
456
|
-
2
|
457
|
-
];
|
458
|
-
}
|
459
|
-
});
|
460
|
-
});
|
461
|
-
return function(options2) {
|
462
|
-
return _ref.apply(this, arguments);
|
463
|
-
};
|
464
|
-
}());
|
465
|
-
program.command("upgrade").allowUnknownOption().option("-h --help", "Show help").action(/* @__PURE__ */ _async_to_generator(function() {
|
466
|
-
return _ts_generator(this, function(_state2) {
|
467
|
-
switch (_state2.label) {
|
468
|
-
case 0:
|
469
|
-
return [
|
470
|
-
4,
|
471
|
-
upgradeAction()
|
472
|
-
];
|
473
|
-
case 1:
|
474
|
-
_state2.sent();
|
475
|
-
return [
|
476
|
-
2
|
477
|
-
];
|
478
|
-
}
|
479
|
-
});
|
480
|
-
}));
|
96
|
+
serverCommand(program, api);
|
97
|
+
deployCommand(program, api);
|
98
|
+
newCommand(program, locale);
|
99
|
+
inspectCommand(program, api);
|
100
|
+
upgradeCommand(program);
|
481
101
|
return [
|
482
102
|
2
|
483
103
|
];
|
@@ -654,9 +274,7 @@ var appTools = function() {
|
|
654
274
|
var src_default = appTools;
|
655
275
|
export {
|
656
276
|
appTools,
|
657
|
-
buildCommand,
|
658
277
|
src_default as default,
|
659
278
|
dev,
|
660
|
-
devCommand,
|
661
279
|
mergeConfig
|
662
280
|
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
var INDEX_FILE_NAME = "index";
|
2
|
+
var FILE_SYSTEM_ROUTES_FILE_NAME = "routes.js";
|
3
|
+
var ENTRY_POINT_FILE_NAME = "index.jsx";
|
4
|
+
var ENTRY_BOOTSTRAP_FILE_NAME = "bootstrap.jsx";
|
5
|
+
var HTML_PARTIALS_FOLDER = "html";
|
6
|
+
var HTML_PARTIALS_EXTENSIONS = [
|
7
|
+
".htm",
|
8
|
+
".html",
|
9
|
+
".ejs"
|
10
|
+
];
|
11
|
+
var APP_CONFIG_NAME = "config";
|
12
|
+
var APP_INIT_EXPORTED = "init";
|
13
|
+
var APP_INIT_IMPORTED = "appInit";
|
14
|
+
export {
|
15
|
+
APP_CONFIG_NAME,
|
16
|
+
APP_INIT_EXPORTED,
|
17
|
+
APP_INIT_IMPORTED,
|
18
|
+
ENTRY_BOOTSTRAP_FILE_NAME,
|
19
|
+
ENTRY_POINT_FILE_NAME,
|
20
|
+
FILE_SYSTEM_ROUTES_FILE_NAME,
|
21
|
+
HTML_PARTIALS_EXTENSIONS,
|
22
|
+
HTML_PARTIALS_FOLDER,
|
23
|
+
INDEX_FILE_NAME
|
24
|
+
};
|