@modern-js/app-tools 2.54.1 → 2.54.2-alpha.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/commands/build.js +1 -1
- package/dist/cjs/commands/deploy.js +1 -2
- package/dist/cjs/commands/dev.js +1 -1
- package/dist/cjs/commands/serve.js +1 -1
- package/dist/cjs/plugins/deploy/dependencies/index.js +26 -17
- package/dist/cjs/plugins/deploy/dependencies/utils.js +14 -20
- package/dist/cjs/plugins/deploy/exports.js +28 -0
- package/dist/cjs/plugins/deploy/platforms/netlify.js +7 -3
- package/dist/cjs/plugins/deploy/platforms/node.js +8 -3
- package/dist/cjs/plugins/deploy/platforms/vercel.js +7 -3
- package/dist/cjs/utils/loadPlugins.js +5 -6
- package/dist/esm/commands/build.js +1 -1
- package/dist/esm/commands/deploy.js +2 -3
- package/dist/esm/commands/dev.js +1 -1
- package/dist/esm/commands/serve.js +1 -1
- package/dist/esm/plugins/deploy/dependencies/index.js +94 -69
- package/dist/esm/plugins/deploy/dependencies/utils.js +19 -39
- package/dist/esm/plugins/deploy/exports.js +4 -0
- package/dist/esm/plugins/deploy/platforms/netlify.js +7 -3
- package/dist/esm/plugins/deploy/platforms/node.js +8 -3
- package/dist/esm/plugins/deploy/platforms/vercel.js +7 -3
- package/dist/esm/utils/loadPlugins.js +6 -11
- package/dist/esm-node/commands/build.js +1 -1
- package/dist/esm-node/commands/deploy.js +1 -2
- package/dist/esm-node/commands/dev.js +1 -1
- package/dist/esm-node/commands/serve.js +1 -1
- package/dist/esm-node/plugins/deploy/dependencies/index.js +27 -18
- package/dist/esm-node/plugins/deploy/dependencies/utils.js +15 -21
- package/dist/esm-node/plugins/deploy/exports.js +4 -0
- package/dist/esm-node/plugins/deploy/platforms/netlify.js +7 -3
- package/dist/esm-node/plugins/deploy/platforms/node.js +8 -3
- package/dist/esm-node/plugins/deploy/platforms/vercel.js +7 -3
- package/dist/esm-node/utils/loadPlugins.js +5 -6
- package/dist/js/modern/analyze/constants.js +15 -0
- package/dist/js/modern/analyze/generateCode.js +179 -0
- package/dist/js/modern/analyze/getBundleEntry.js +75 -0
- package/dist/js/modern/analyze/getClientRoutes.js +219 -0
- package/dist/js/modern/analyze/getFileSystemEntry.js +74 -0
- package/dist/js/modern/analyze/getHtmlTemplate.js +82 -0
- package/dist/js/modern/analyze/getServerRoutes.js +192 -0
- package/dist/js/modern/analyze/index.js +148 -0
- package/dist/js/modern/analyze/isDefaultExportFunction.js +32 -0
- package/dist/js/modern/analyze/makeLegalIdentifier.js +16 -0
- package/dist/js/modern/analyze/templates.js +88 -0
- package/dist/js/modern/analyze/utils.js +92 -0
- package/dist/js/modern/commands/build.js +154 -0
- package/dist/js/modern/commands/deploy.js +5 -0
- package/dist/js/modern/commands/dev.js +95 -0
- package/dist/js/modern/commands/index.js +3 -0
- package/dist/js/modern/commands/inspect.js +69 -0
- package/dist/js/modern/commands/start.js +31 -0
- package/dist/js/modern/exports/server.js +1 -0
- package/dist/js/modern/hooks.js +21 -0
- package/dist/js/modern/index.js +109 -0
- package/dist/js/modern/locale/en.js +35 -0
- package/dist/js/modern/locale/index.js +9 -0
- package/dist/js/modern/locale/zh.js +35 -0
- package/dist/js/modern/utils/config.js +78 -0
- package/dist/js/modern/utils/createCompiler.js +61 -0
- package/dist/js/modern/utils/createServer.js +18 -0
- package/dist/js/modern/utils/getSpecifiedEntries.js +36 -0
- package/dist/js/modern/utils/language.js +5 -0
- package/dist/js/modern/utils/printInstructions.js +11 -0
- package/dist/js/modern/utils/routes.js +15 -0
- package/dist/js/modern/utils/types.js +0 -0
- package/dist/js/node/analyze/constants.js +36 -0
- package/dist/js/node/analyze/generateCode.js +208 -0
- package/dist/js/node/analyze/getBundleEntry.js +89 -0
- package/dist/js/node/analyze/getClientRoutes.js +241 -0
- package/dist/js/node/analyze/getFileSystemEntry.js +90 -0
- package/dist/js/node/analyze/getHtmlTemplate.js +106 -0
- package/dist/js/node/analyze/getServerRoutes.js +208 -0
- package/dist/js/node/analyze/index.js +178 -0
- package/dist/js/node/analyze/isDefaultExportFunction.js +50 -0
- package/dist/js/node/analyze/makeLegalIdentifier.js +24 -0
- package/dist/js/node/analyze/templates.js +106 -0
- package/dist/js/node/analyze/utils.js +113 -0
- package/dist/js/node/commands/build.js +174 -0
- package/dist/js/node/commands/deploy.js +14 -0
- package/dist/js/node/commands/dev.js +120 -0
- package/dist/js/node/commands/index.js +44 -0
- package/dist/js/node/commands/inspect.js +98 -0
- package/dist/js/node/commands/start.js +47 -0
- package/dist/js/node/exports/server.js +13 -0
- package/dist/js/node/hooks.js +39 -0
- package/dist/js/node/index.js +141 -0
- package/dist/js/node/locale/en.js +42 -0
- package/dist/js/node/locale/index.js +20 -0
- package/dist/js/node/locale/zh.js +42 -0
- package/dist/js/node/utils/config.js +103 -0
- package/dist/js/node/utils/createCompiler.js +81 -0
- package/dist/js/node/utils/createServer.js +35 -0
- package/dist/js/node/utils/getSpecifiedEntries.js +46 -0
- package/dist/js/node/utils/language.js +13 -0
- package/dist/js/node/utils/printInstructions.js +22 -0
- package/dist/js/node/utils/routes.js +25 -0
- package/dist/js/node/utils/types.js +0 -0
- package/dist/types/plugins/deploy/dependencies/index.d.ts +11 -1
- package/dist/types/plugins/deploy/dependencies/utils.d.ts +7 -1
- package/dist/types/plugins/deploy/exports.d.ts +1 -0
- package/dist/types/utils/loadPlugins.d.ts +2 -2
- package/package.json +14 -6
@@ -0,0 +1,103 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.safeReplacer = exports.emitResolvedConfig = exports.defineServerConfig = exports.buildServerConfig = void 0;
|
7
|
+
|
8
|
+
var path = _interopRequireWildcard(require("path"));
|
9
|
+
|
10
|
+
var _nodeBundleRequire = require("@modern-js/node-bundle-require");
|
11
|
+
|
12
|
+
var _utils = require("@modern-js/utils");
|
13
|
+
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
15
|
+
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
17
|
+
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
19
|
+
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
21
|
+
|
22
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
23
|
+
|
24
|
+
const defineServerConfig = config => config;
|
25
|
+
|
26
|
+
exports.defineServerConfig = defineServerConfig;
|
27
|
+
|
28
|
+
const buildServerConfig = async ({
|
29
|
+
appDirectory,
|
30
|
+
distDirectory,
|
31
|
+
configFile,
|
32
|
+
options
|
33
|
+
}) => {
|
34
|
+
const configFilePath = await (0, _utils.getServerConfig)(appDirectory, configFile);
|
35
|
+
|
36
|
+
const getOutputFile = async filepath => path.resolve(distDirectory, `${filepath.replace(new RegExp(_utils.CONFIG_FILE_EXTENSIONS.join('|')), '')}.js`);
|
37
|
+
|
38
|
+
if (configFilePath) {
|
39
|
+
const configHelperFilePath = path.normalize(path.join(distDirectory, './config-helper.js'));
|
40
|
+
const helperCode = `
|
41
|
+
export const defineConfig = (config) => config;
|
42
|
+
`;
|
43
|
+
await _utils.fs.ensureDir(distDirectory);
|
44
|
+
await _utils.fs.writeFile(configHelperFilePath, helperCode);
|
45
|
+
await (0, _nodeBundleRequire.bundle)(configFilePath, _objectSpread(_objectSpread({}, options), {}, {
|
46
|
+
getOutputFile,
|
47
|
+
esbuildPlugins: [{
|
48
|
+
name: 'native-build-config',
|
49
|
+
|
50
|
+
setup(ctx) {
|
51
|
+
ctx.onResolve({
|
52
|
+
filter: /app-tools\/server/
|
53
|
+
}, () => {
|
54
|
+
return {
|
55
|
+
path: configHelperFilePath
|
56
|
+
};
|
57
|
+
});
|
58
|
+
}
|
59
|
+
|
60
|
+
}]
|
61
|
+
}));
|
62
|
+
}
|
63
|
+
};
|
64
|
+
/**
|
65
|
+
*
|
66
|
+
* 处理循环引用的 replacer
|
67
|
+
*/
|
68
|
+
|
69
|
+
|
70
|
+
exports.buildServerConfig = buildServerConfig;
|
71
|
+
|
72
|
+
const safeReplacer = () => {
|
73
|
+
const cache = [];
|
74
|
+
const keyCache = [];
|
75
|
+
return function (key, value) {
|
76
|
+
if (typeof value === 'object' && value !== null) {
|
77
|
+
const index = cache.indexOf(value);
|
78
|
+
|
79
|
+
if (index !== -1) {
|
80
|
+
return `[Circular ${keyCache[index]}]`;
|
81
|
+
}
|
82
|
+
|
83
|
+
cache.push(value);
|
84
|
+
keyCache.push(key || 'root');
|
85
|
+
}
|
86
|
+
|
87
|
+
return value;
|
88
|
+
};
|
89
|
+
};
|
90
|
+
|
91
|
+
exports.safeReplacer = safeReplacer;
|
92
|
+
|
93
|
+
const emitResolvedConfig = async (appDirectory, resolvedConfig) => {
|
94
|
+
var _resolvedConfig$outpu;
|
95
|
+
|
96
|
+
const outputPath = path.join(appDirectory, (resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig$outpu = resolvedConfig.output) === null || _resolvedConfig$outpu === void 0 ? void 0 : _resolvedConfig$outpu.path) || './dist', _utils.OUTPUT_CONFIG_FILE);
|
97
|
+
await _utils.fs.writeJSON(outputPath, resolvedConfig, {
|
98
|
+
spaces: 2,
|
99
|
+
replacer: safeReplacer()
|
100
|
+
});
|
101
|
+
};
|
102
|
+
|
103
|
+
exports.emitResolvedConfig = emitResolvedConfig;
|
@@ -0,0 +1,81 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.createCompiler = void 0;
|
7
|
+
|
8
|
+
var _webpack = require("@modern-js/webpack");
|
9
|
+
|
10
|
+
var _utils = require("@modern-js/utils");
|
11
|
+
|
12
|
+
var _printInstructions = require("./printInstructions");
|
13
|
+
|
14
|
+
const createCompiler = async ({
|
15
|
+
api,
|
16
|
+
webpackConfigs,
|
17
|
+
// TODO: params
|
18
|
+
userConfig,
|
19
|
+
appContext
|
20
|
+
}) => {
|
21
|
+
try {
|
22
|
+
const hookRunners = api.useHookRunners();
|
23
|
+
await hookRunners.beforeCreateCompiler({
|
24
|
+
webpackConfigs
|
25
|
+
});
|
26
|
+
const compiler = (0, _webpack.webpack)(webpackConfigs);
|
27
|
+
await hookRunners.afterCreateCompiler({
|
28
|
+
compiler
|
29
|
+
});
|
30
|
+
let isFirstCompile = true;
|
31
|
+
compiler.hooks.invalid.tap('invalid', () => {
|
32
|
+
(0, _utils.clearConsole)();
|
33
|
+
|
34
|
+
_utils.logger.log('Compiling...');
|
35
|
+
});
|
36
|
+
compiler.hooks.done.tap('done', async stats => {
|
37
|
+
const statsData = stats.toJson({
|
38
|
+
preset: 'errors-warnings'
|
39
|
+
});
|
40
|
+
const {
|
41
|
+
errors,
|
42
|
+
warnings
|
43
|
+
} = (0, _utils.formatWebpackMessages)(statsData);
|
44
|
+
|
45
|
+
if (errors.length) {
|
46
|
+
_utils.logger.log(_utils.chalk.red(`Failed to compile.\n`));
|
47
|
+
|
48
|
+
_utils.logger.log(errors.join('\n\n'));
|
49
|
+
|
50
|
+
_utils.logger.log();
|
51
|
+
} else if (process.stdout.isTTY || isFirstCompile) {
|
52
|
+
await hookRunners.afterDev();
|
53
|
+
|
54
|
+
if (warnings.length) {
|
55
|
+
_utils.logger.log(_utils.chalk.yellow(`Compiled with warnings.\n`));
|
56
|
+
|
57
|
+
_utils.logger.log(warnings.join('\n\n'));
|
58
|
+
|
59
|
+
_utils.logger.log();
|
60
|
+
}
|
61
|
+
|
62
|
+
await (0, _printInstructions.printInstructions)(hookRunners, appContext, userConfig);
|
63
|
+
}
|
64
|
+
|
65
|
+
isFirstCompile = false;
|
66
|
+
});
|
67
|
+
return compiler;
|
68
|
+
} catch (err) {
|
69
|
+
_utils.logger.log(_utils.chalk.red(`Failed to compile.`));
|
70
|
+
|
71
|
+
_utils.logger.log();
|
72
|
+
|
73
|
+
_utils.logger.log(err); // FIXME: 这里最好抛出异常,执行 process.exit 的地方尽可能少或者控制在几个统一的地方比较合适
|
74
|
+
// eslint-disable-next-line no-process-exit
|
75
|
+
|
76
|
+
|
77
|
+
process.exit(1);
|
78
|
+
}
|
79
|
+
};
|
80
|
+
|
81
|
+
exports.createCompiler = createCompiler;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.getServer = exports.createServer = exports.closeServer = void 0;
|
7
|
+
|
8
|
+
var _server = require("@modern-js/server");
|
9
|
+
|
10
|
+
let server = null;
|
11
|
+
|
12
|
+
const getServer = () => server;
|
13
|
+
|
14
|
+
exports.getServer = getServer;
|
15
|
+
|
16
|
+
const closeServer = async () => {
|
17
|
+
if (server) {
|
18
|
+
await server.close();
|
19
|
+
server = null;
|
20
|
+
}
|
21
|
+
};
|
22
|
+
|
23
|
+
exports.closeServer = closeServer;
|
24
|
+
|
25
|
+
const createServer = async options => {
|
26
|
+
if (server) {
|
27
|
+
await server.close();
|
28
|
+
}
|
29
|
+
|
30
|
+
server = new _server.Server(options);
|
31
|
+
const app = await server.init();
|
32
|
+
return app;
|
33
|
+
};
|
34
|
+
|
35
|
+
exports.createServer = createServer;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.getSpecifiedEntries = void 0;
|
7
|
+
|
8
|
+
var _utils = require("@modern-js/utils");
|
9
|
+
|
10
|
+
const getSpecifiedEntries = async (entry, entrypoints) => {
|
11
|
+
const entryNames = entrypoints.map(e => e.entryName);
|
12
|
+
|
13
|
+
if (!entry) {
|
14
|
+
return entryNames;
|
15
|
+
}
|
16
|
+
|
17
|
+
if (typeof entry === 'boolean') {
|
18
|
+
const {
|
19
|
+
selected
|
20
|
+
} = await _utils.inquirer.prompt([{
|
21
|
+
type: 'checkbox',
|
22
|
+
name: 'selected',
|
23
|
+
choices: entryNames,
|
24
|
+
message: '请选择需要构建的入口',
|
25
|
+
|
26
|
+
validate(answer) {
|
27
|
+
if (answer.length < 1) {
|
28
|
+
return 'You must choose at least one topping.';
|
29
|
+
}
|
30
|
+
|
31
|
+
return true;
|
32
|
+
}
|
33
|
+
|
34
|
+
}]);
|
35
|
+
return selected;
|
36
|
+
}
|
37
|
+
|
38
|
+
entry.forEach(name => {
|
39
|
+
if (!entryNames.includes(name)) {
|
40
|
+
throw new Error(`can not found entry ${name}, compiler entry should in ${entryNames.join(', ')}`);
|
41
|
+
}
|
42
|
+
});
|
43
|
+
return entry;
|
44
|
+
};
|
45
|
+
|
46
|
+
exports.getSpecifiedEntries = getSpecifiedEntries;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.getLocaleLanguage = getLocaleLanguage;
|
7
|
+
|
8
|
+
var _languageDetector = require("@modern-js/plugin-i18n/language-detector");
|
9
|
+
|
10
|
+
function getLocaleLanguage() {
|
11
|
+
const detector = new _languageDetector.I18CLILanguageDetector();
|
12
|
+
return detector.detect();
|
13
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.printInstructions = void 0;
|
7
|
+
|
8
|
+
var _utils = require("@modern-js/utils");
|
9
|
+
|
10
|
+
const printInstructions = async (hookRunners, appContext, config) => {
|
11
|
+
const message = (0, _utils.prettyInstructions)(appContext, config); // call beforePrintInstructions hook.
|
12
|
+
|
13
|
+
const {
|
14
|
+
instructions
|
15
|
+
} = await hookRunners.beforePrintInstructions({
|
16
|
+
instructions: message
|
17
|
+
});
|
18
|
+
|
19
|
+
_utils.logger.log(instructions);
|
20
|
+
};
|
21
|
+
|
22
|
+
exports.printInstructions = printInstructions;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.generateRoutes = void 0;
|
7
|
+
|
8
|
+
var _path = _interopRequireDefault(require("path"));
|
9
|
+
|
10
|
+
var _utils = require("@modern-js/utils");
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
const generateRoutes = async appContext => {
|
15
|
+
const {
|
16
|
+
serverRoutes,
|
17
|
+
distDirectory
|
18
|
+
} = appContext;
|
19
|
+
const output = JSON.stringify({
|
20
|
+
routes: serverRoutes
|
21
|
+
}, null, 2);
|
22
|
+
await _utils.fs.outputFile(_path.default.join(distDirectory, _utils.ROUTE_SPEC_FILE), output);
|
23
|
+
};
|
24
|
+
|
25
|
+
exports.generateRoutes = generateRoutes;
|
File without changes
|
@@ -1 +1,11 @@
|
|
1
|
-
|
1
|
+
import type { PackageJson } from 'pkg-types';
|
2
|
+
import { traceFiles as defaultTraceFiles } from './utils';
|
3
|
+
export declare const handleDependencies: ({ appDir, serverRootDir, includeEntries, traceFiles, entryFilter, modifyPackageJson, copyWholePackage, }: {
|
4
|
+
appDir: string;
|
5
|
+
serverRootDir: string;
|
6
|
+
includeEntries: string[];
|
7
|
+
traceFiles?: ((entryFiles: string[], serverRootDir: string, base?: string) => Promise<import("@vercel/nft").NodeFileTraceResult>) | undefined;
|
8
|
+
entryFilter?: ((filePath: string) => boolean) | undefined;
|
9
|
+
modifyPackageJson?: ((pkgJson: PackageJson) => PackageJson) | undefined;
|
10
|
+
copyWholePackage?: ((pkgName: string) => boolean) | undefined;
|
11
|
+
}) => Promise<void>;
|
@@ -17,7 +17,13 @@ export type TracedFile = {
|
|
17
17
|
pkgName: string;
|
18
18
|
pkgVersion?: string;
|
19
19
|
};
|
20
|
-
|
20
|
+
interface WritePackageOptions {
|
21
|
+
pkg: TracedPackage;
|
22
|
+
version: string;
|
23
|
+
projectDir: string;
|
24
|
+
_pkgPath?: string;
|
25
|
+
}
|
26
|
+
export declare const writePackage: (options: WritePackageOptions) => Promise<void>;
|
21
27
|
export declare const linkPackage: (from: string, to: string, projectRootDir: string) => Promise<void>;
|
22
28
|
interface ReadDirOptions {
|
23
29
|
filter?: (filePath: string) => boolean;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { handleDependencies } from './dependencies';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ServerPlugin as ServerPluginInstance } from '@modern-js/server-core';
|
2
2
|
import { ServerPlugin } from '@modern-js/types';
|
3
3
|
import { AppTools, PluginAPI } from '../types';
|
4
|
-
export declare function getServerPlugins(api: PluginAPI<AppTools<'shared'
|
5
|
-
export declare function loadServerPlugins(api: PluginAPI<AppTools<'shared'>>, appDirectory: string
|
4
|
+
export declare function getServerPlugins(api: PluginAPI<AppTools<'shared'>>): Promise<ServerPlugin[]>;
|
5
|
+
export declare function loadServerPlugins(api: PluginAPI<AppTools<'shared'>>, appDirectory: string): Promise<ServerPluginInstance[]>;
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.54.
|
18
|
+
"version": "2.54.2-alpha.3",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -43,6 +43,11 @@
|
|
43
43
|
"types": "./dist/types/exports/server.d.ts",
|
44
44
|
"jsnext:source": "./src/exports/server.ts",
|
45
45
|
"default": "./dist/cjs/exports/server.js"
|
46
|
+
},
|
47
|
+
"./deploy": {
|
48
|
+
"types": "./dist/types/plugins/deploy/exports.d.ts",
|
49
|
+
"jsnext:source": "./src/plugins/deploy/exports.ts",
|
50
|
+
"default": "./dist/cjs/plugins/deploy/exports.js"
|
46
51
|
}
|
47
52
|
},
|
48
53
|
"engines": {
|
@@ -58,6 +63,9 @@
|
|
58
63
|
],
|
59
64
|
"server": [
|
60
65
|
"./dist/types/exports/server.d.ts"
|
66
|
+
],
|
67
|
+
"deploy": [
|
68
|
+
"./dist/types/plugins/deploy/exports.d.ts"
|
61
69
|
]
|
62
70
|
}
|
63
71
|
},
|
@@ -81,16 +89,16 @@
|
|
81
89
|
"pkg-types": "^1.1.0",
|
82
90
|
"std-env": "^3.7.0",
|
83
91
|
"@modern-js/core": "2.54.1",
|
84
|
-
"@modern-js/node-bundle-require": "2.54.1",
|
85
92
|
"@modern-js/plugin-data-loader": "2.54.1",
|
86
93
|
"@modern-js/plugin-i18n": "2.54.1",
|
87
|
-
"@modern-js/prod-server": "2.54.1",
|
88
|
-
"@modern-js/plugin": "2.54.1",
|
89
94
|
"@modern-js/plugin-lint": "2.54.1",
|
90
95
|
"@modern-js/rsbuild-plugin-esbuild": "2.54.1",
|
96
|
+
"@modern-js/prod-server": "2.54.1",
|
91
97
|
"@modern-js/server": "2.54.1",
|
92
98
|
"@modern-js/server-core": "2.54.1",
|
93
99
|
"@modern-js/server-utils": "2.54.1",
|
100
|
+
"@modern-js/node-bundle-require": "2.54.1",
|
101
|
+
"@modern-js/plugin": "2.54.1",
|
94
102
|
"@modern-js/uni-builder": "2.54.1",
|
95
103
|
"@modern-js/types": "2.54.1",
|
96
104
|
"@modern-js/utils": "2.54.1"
|
@@ -105,8 +113,8 @@
|
|
105
113
|
"tsconfig-paths": "^4.2.0",
|
106
114
|
"typescript": "^5",
|
107
115
|
"webpack": "^5.92.0",
|
108
|
-
"@scripts/
|
109
|
-
"@scripts/
|
116
|
+
"@scripts/build": "2.54.1",
|
117
|
+
"@scripts/jest-config": "2.54.1"
|
110
118
|
},
|
111
119
|
"sideEffects": false,
|
112
120
|
"publishConfig": {
|