@bleedingdev/modern-js-app-tools 3.9.0-ultramodern.9 → 3.9.3-ultramodern.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/bin/modern-bundle-docs.js +2 -2
- package/bin/modern.js +2 -2
- package/dist/cjs/builder/generator/adapterCopy.js +26 -0
- package/dist/cjs/builder/generator/createCopyPattern.js +2 -1
- package/dist/cjs/builder/index.js +4 -0
- package/dist/cjs/builder/shared/builderPlugins/adapterHtml.js +2 -1
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +11 -6
- package/dist/cjs/builder/shared/lazyCompilation.js +26 -0
- package/dist/cjs/commands/build.js +1 -2
- package/dist/cjs/commands/deploy.js +1 -3
- package/dist/cjs/commands/index.js +10 -2
- package/dist/cjs/compat/hooks.js +1 -1
- package/dist/cjs/esm/ts-paths-loader.js +5 -4
- package/dist/cjs/esm/ts-paths-loader.mjs +5 -4
- package/dist/cjs/index.js +73 -99
- package/dist/cjs/plugins/analyze/getFileSystemEntry.js +1 -1
- package/dist/cjs/plugins/analyze/getServerRoutes.js +1 -1
- package/dist/cjs/plugins/analyze/index.js +2 -2
- package/dist/cjs/plugins/analyze/utils.js +6 -6
- package/dist/cjs/plugins/deploy/index.js +7 -28
- package/dist/cjs/plugins/deploy/platforms/netlify.js +2 -1
- package/dist/cjs/plugins/deploy/platforms/node.js +12 -3
- package/dist/cjs/plugins/deploy/platforms/templates/node-entry.cjs +3 -2
- package/dist/cjs/plugins/deploy/platforms/templates/node-entry.mjs +3 -2
- package/dist/cjs/plugins/deploy/platforms/vercel.js +2 -1
- package/dist/cjs/plugins/deploy/utils/index.js +15 -12
- package/dist/cjs/plugins/initialize/index.js +6 -5
- package/dist/cjs/plugins/serverBuild.js +0 -2
- package/dist/cjs/run/index.js +5 -5
- package/dist/cjs/types/config/base.js +62 -0
- package/dist/cjs/types/plugin-base.js +18 -0
- package/dist/cjs/types/plugin.js +46 -2
- package/dist/cjs/utils/initAppContext.js +1 -1
- package/dist/cjs/utils/loadPlugins.js +13 -7
- package/dist/cjs/utils/register.js +1 -1
- package/dist/esm/builder/generator/adapterCopy.mjs +23 -1
- package/dist/esm/builder/generator/createCopyPattern.mjs +2 -1
- package/dist/esm/builder/index.mjs +1 -0
- package/dist/esm/builder/shared/builderPlugins/adapterHtml.mjs +2 -1
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.mjs +9 -7
- package/dist/esm/builder/shared/lazyCompilation.mjs +14 -1
- package/dist/esm/commands/build.mjs +1 -2
- package/dist/esm/commands/deploy.mjs +1 -3
- package/dist/esm/commands/index.mjs +10 -2
- package/dist/esm/compat/hooks.mjs +1 -1
- package/dist/esm/esm/ts-paths-loader.mjs +5 -4
- package/dist/esm/index.mjs +9 -18
- package/dist/esm/plugins/analyze/getFileSystemEntry.mjs +1 -1
- package/dist/esm/plugins/analyze/getServerRoutes.mjs +1 -1
- package/dist/esm/plugins/analyze/index.mjs +2 -2
- package/dist/esm/plugins/analyze/utils.mjs +7 -7
- package/dist/esm/plugins/deploy/index.mjs +5 -21
- package/dist/esm/plugins/deploy/platforms/netlify.mjs +2 -1
- package/dist/esm/plugins/deploy/platforms/node.mjs +12 -3
- package/dist/esm/plugins/deploy/platforms/templates/node-entry.cjs +3 -2
- package/dist/esm/plugins/deploy/platforms/templates/node-entry.mjs +3 -2
- package/dist/esm/plugins/deploy/platforms/vercel.mjs +2 -1
- package/dist/esm/plugins/deploy/utils/index.mjs +17 -14
- package/dist/esm/plugins/initialize/index.mjs +6 -5
- package/dist/esm/plugins/serverBuild.mjs +0 -2
- package/dist/esm/run/index.mjs +5 -5
- package/dist/esm/types/config/base.mjs +1 -0
- package/dist/esm/types/plugin-base.mjs +0 -0
- package/dist/esm/types/plugin.mjs +1 -0
- package/dist/esm/utils/initAppContext.mjs +2 -2
- package/dist/esm/utils/loadPlugins.mjs +4 -8
- package/dist/esm/utils/register.mjs +1 -1
- package/dist/esm-node/builder/generator/adapterCopy.mjs +23 -1
- package/dist/esm-node/builder/generator/createCopyPattern.mjs +2 -1
- package/dist/esm-node/builder/index.mjs +1 -0
- package/dist/esm-node/builder/shared/builderPlugins/adapterHtml.mjs +2 -1
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.mjs +9 -7
- package/dist/esm-node/builder/shared/lazyCompilation.mjs +14 -1
- package/dist/esm-node/commands/build.mjs +1 -2
- package/dist/esm-node/commands/deploy.mjs +1 -3
- package/dist/esm-node/commands/index.mjs +10 -2
- package/dist/esm-node/compat/hooks.mjs +1 -1
- package/dist/esm-node/esm/ts-paths-loader.mjs +5 -4
- package/dist/esm-node/index.mjs +10 -20
- package/dist/esm-node/plugins/analyze/getFileSystemEntry.mjs +1 -1
- package/dist/esm-node/plugins/analyze/getServerRoutes.mjs +1 -1
- package/dist/esm-node/plugins/analyze/index.mjs +2 -2
- package/dist/esm-node/plugins/analyze/utils.mjs +7 -7
- package/dist/esm-node/plugins/deploy/index.mjs +5 -21
- package/dist/esm-node/plugins/deploy/platforms/netlify.mjs +2 -1
- package/dist/esm-node/plugins/deploy/platforms/node.mjs +12 -3
- package/dist/esm-node/plugins/deploy/platforms/templates/node-entry.cjs +3 -2
- package/dist/esm-node/plugins/deploy/platforms/templates/node-entry.mjs +3 -2
- package/dist/esm-node/plugins/deploy/platforms/vercel.mjs +2 -1
- package/dist/esm-node/plugins/deploy/utils/index.mjs +17 -15
- package/dist/esm-node/plugins/initialize/index.mjs +6 -5
- package/dist/esm-node/plugins/serverBuild.mjs +0 -2
- package/dist/esm-node/run/index.mjs +5 -5
- package/dist/esm-node/types/config/base.mjs +2 -0
- package/dist/esm-node/types/plugin-base.mjs +1 -0
- package/dist/esm-node/types/plugin.mjs +1 -0
- package/dist/esm-node/utils/initAppContext.mjs +2 -2
- package/dist/esm-node/utils/loadPlugins.mjs +4 -8
- package/dist/esm-node/utils/register.mjs +1 -1
- package/dist/types/builder/generator/adapterCopy.d.ts +13 -1
- package/dist/types/builder/index.d.ts +1 -0
- package/dist/types/builder/shared/builderPlugins/adapterBasic.d.ts +4 -2
- package/dist/types/builder/shared/builderPlugins/adapterSSR.d.ts +2 -1
- package/dist/types/builder/shared/builderPlugins/builderHooks.d.ts +10 -2
- package/dist/types/builder/shared/lazyCompilation.d.ts +15 -0
- package/dist/types/compat/hooks.d.ts +3 -2
- package/dist/types/index.d.ts +1 -3
- package/dist/types/plugins/analyze/getBundleEntry.d.ts +5 -4
- package/dist/types/plugins/analyze/getFileSystemEntry.d.ts +5 -4
- package/dist/types/plugins/analyze/utils.d.ts +2 -2
- package/dist/types/plugins/deploy/index.d.ts +1 -4
- package/dist/types/plugins/deploy/utils/index.d.ts +1 -1
- package/dist/types/run/index.d.ts +1 -1
- package/dist/types/types/config/base.d.ts +58 -0
- package/dist/types/types/config/deploy.d.ts +2 -50
- package/dist/types/types/config/dev.d.ts +1 -1
- package/dist/types/types/config/index.d.ts +18 -42
- package/dist/types/types/config/output.d.ts +2 -2
- package/dist/types/types/config/testing.d.ts +1 -1
- package/dist/types/types/config/tools.d.ts +1 -1
- package/dist/types/types/plugin-base.d.ts +188 -0
- package/dist/types/types/plugin.d.ts +9 -183
- package/dist/types/utils/initAppContext.d.ts +1 -1
- package/docs/apis/app/commands.md +1 -0
- package/docs/configure/app/bff/effect.md +5 -12
- package/docs/configure/app/output/disable-svgr.md +4 -0
- package/docs/configure/app/output/svg-default-export.md +4 -0
- package/docs/configure/app/source/react-compiler.md +2 -0
- package/docs/configure/app/tools/less.md +94 -19
- package/docs/configure/app/tools/sass.md +87 -18
- package/docs/configure/app/tools/svgr.md +91 -0
- package/docs/configure/app/tools/ts-checker.md +7 -21
- package/docs/guides/basic-features/render/ssr-cache.md +14 -1
- package/docs/guides/basic-features/static-assets/svg-assets.md +29 -17
- package/docs/guides/basic-features/testing/rstest.md +0 -2
- package/docs/guides/get-started/quick-start.md +1 -1
- package/docs/guides/get-started/ultramodern.md +45 -14
- package/docs/llms.txt +4 -3
- package/docs/plugin/introduction.md +10 -10
- package/docs/plugin/server-plugins/api.md +1 -0
- package/package.json +59 -30
- package/dist/cjs/plugins/serverRuntime.js +0 -53
- package/dist/esm/plugins/serverRuntime.mjs +0 -15
- package/dist/esm-node/plugins/serverRuntime.mjs +0 -16
- package/dist/types/plugins/serverRuntime.d.ts +0 -3
package/dist/esm-node/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { resolveDeployTarget } from "@modern-js/app-tools-extensions/deploy-output/target";
|
|
3
3
|
import { createPolicyDefaultsPlugin } from "@modern-js/app-tools-extensions/policy-defaults";
|
|
4
4
|
import { castArray } from "@modern-js/builder";
|
|
5
5
|
import { getLocaleLanguage } from "@modern-js/i18n-utils/language-detector";
|
|
6
6
|
import { createAsyncHook } from "@modern-js/plugin";
|
|
7
|
-
import {
|
|
7
|
+
import { deprecatedCommands, emptyDir, getArgv, getCommand } from "@modern-js/utils";
|
|
8
8
|
import path from "path";
|
|
9
9
|
import { buildCommand, deployCommand, devCommand, infoCommand, inspectCommand, serverCommand } from "./commands/index.mjs";
|
|
10
10
|
import { compatPlugin } from "./compat/index.mjs";
|
|
@@ -14,7 +14,6 @@ import analyze from "./plugins/analyze/index.mjs";
|
|
|
14
14
|
import deploy from "./plugins/deploy/index.mjs";
|
|
15
15
|
import initialize from "./plugins/initialize/index.mjs";
|
|
16
16
|
import serverBuild from "./plugins/serverBuild.mjs";
|
|
17
|
-
import serverRuntime from "./plugins/serverRuntime.mjs";
|
|
18
17
|
import { generateWatchFiles } from "./utils/generateWatchFiles.mjs";
|
|
19
18
|
import { initAppContext } from "./utils/initAppContext.mjs";
|
|
20
19
|
import { restart } from "./utils/restart.mjs";
|
|
@@ -23,7 +22,6 @@ export * from "./types/index.mjs";
|
|
|
23
22
|
const appTools = (options = {})=>({
|
|
24
23
|
name: '@modern-js/app-tools',
|
|
25
24
|
usePlugins: [
|
|
26
|
-
serverRuntime(),
|
|
27
25
|
compatPlugin(),
|
|
28
26
|
initialize(),
|
|
29
27
|
analyze(),
|
|
@@ -76,6 +74,11 @@ const appTools = (options = {})=>({
|
|
|
76
74
|
deprecatedCommands(program);
|
|
77
75
|
});
|
|
78
76
|
api.onPrepare(async ()=>{
|
|
77
|
+
api.updateAppContext({
|
|
78
|
+
deployTarget: resolveDeployTarget({
|
|
79
|
+
configTarget: api.getNormalizedConfig().deploy?.target
|
|
80
|
+
})
|
|
81
|
+
});
|
|
79
82
|
const command = getCommand();
|
|
80
83
|
if ('deploy' === command) {
|
|
81
84
|
const isSkipBuild = [
|
|
@@ -84,18 +87,12 @@ const appTools = (options = {})=>({
|
|
|
84
87
|
].some((tag)=>getArgv().includes(tag));
|
|
85
88
|
if (isSkipBuild) return;
|
|
86
89
|
}
|
|
87
|
-
|
|
88
|
-
const shouldClean = [
|
|
90
|
+
if ([
|
|
89
91
|
'dev',
|
|
90
92
|
'start',
|
|
91
93
|
'build',
|
|
92
94
|
'deploy'
|
|
93
|
-
].includes(command)
|
|
94
|
-
'dev',
|
|
95
|
-
'start',
|
|
96
|
-
'build'
|
|
97
|
-
].includes(contextCommand);
|
|
98
|
-
if (shouldClean) {
|
|
95
|
+
].includes(command)) {
|
|
99
96
|
const resolvedConfig = api.getNormalizedConfig();
|
|
100
97
|
if (resolvedConfig.output.cleanDistPath) {
|
|
101
98
|
const appContext = api.getAppContext();
|
|
@@ -126,17 +123,10 @@ const appTools = (options = {})=>({
|
|
|
126
123
|
await restart(api.getHooks(), filename);
|
|
127
124
|
}
|
|
128
125
|
});
|
|
129
|
-
api.onBeforeRestart(()=>{
|
|
130
|
-
cleanRequireCache([
|
|
131
|
-
require.resolve('./plugins/analyze')
|
|
132
|
-
]);
|
|
133
|
-
});
|
|
134
126
|
}
|
|
135
127
|
});
|
|
136
128
|
const src = appTools;
|
|
137
129
|
export { defineConfig } from "./defineConfig.mjs";
|
|
138
|
-
export { build } from "./commands/build.mjs";
|
|
139
|
-
export { deploy } from "./commands/deploy.mjs";
|
|
140
130
|
export { dev } from "./commands/dev.mjs";
|
|
141
131
|
export { serve } from "./commands/serve.mjs";
|
|
142
132
|
export { resolveModernRsbuildConfig } from "./rsbuild.mjs";
|
|
@@ -62,6 +62,6 @@ const getFileSystemEntry = async (hooks, appContext, config)=>{
|
|
|
62
62
|
}));
|
|
63
63
|
return scanDir(hooks, dirs);
|
|
64
64
|
} else throw Error("source.entriesDir accept a directory.");
|
|
65
|
-
throw Error(`src dir ${entriesDir} not found.`);
|
|
65
|
+
else throw Error(`src dir ${entriesDir} not found.`);
|
|
66
66
|
};
|
|
67
67
|
export { getFileSystemEntry, hasEntry, hasServerEntry };
|
|
@@ -24,7 +24,7 @@ const analyze = ()=>({
|
|
|
24
24
|
const resolvedConfig = api.getNormalizedConfig();
|
|
25
25
|
const hooks = api.getHooks();
|
|
26
26
|
try {
|
|
27
|
-
if (checkIsBuildCommands(
|
|
27
|
+
if (checkIsBuildCommands()) fs.emptydirSync(appContext.internalDirectory);
|
|
28
28
|
} catch {}
|
|
29
29
|
const apiOnly = await isApiOnly(appContext.appDirectory, resolvedConfig.source?.entriesDir, appContext.apiDirectory);
|
|
30
30
|
const [{ getProdEntrypoints, getProdServerRoutes }] = await Promise.all([
|
|
@@ -126,7 +126,7 @@ const analyze = ()=>({
|
|
|
126
126
|
htmlTemplates
|
|
127
127
|
};
|
|
128
128
|
api.updateAppContext(appContext);
|
|
129
|
-
if (checkIsBuildCommands(
|
|
129
|
+
if (checkIsBuildCommands()) {
|
|
130
130
|
await hooks.generateEntryCode.call({
|
|
131
131
|
entrypoints
|
|
132
132
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { JS_EXTENSIONS, getCommand, normalizeToPosixPath } from "@modern-js/utils";
|
|
3
|
-
import { parse } from "es-module-lexer";
|
|
3
|
+
import { init, parse } from "es-module-lexer";
|
|
4
4
|
import { transform } from "esbuild";
|
|
5
5
|
import fs from "fs";
|
|
6
6
|
import path from "path";
|
|
@@ -10,14 +10,14 @@ const walkDirectory = (dir)=>fs.readdirSync(dir).reduce((previous, filename)=>{
|
|
|
10
10
|
...previous,
|
|
11
11
|
...walkDirectory(filePath)
|
|
12
12
|
];
|
|
13
|
-
return [
|
|
13
|
+
else return [
|
|
14
14
|
...previous,
|
|
15
15
|
filePath
|
|
16
16
|
];
|
|
17
17
|
}, []);
|
|
18
18
|
const replaceWithAlias = (base, filePath, alias)=>{
|
|
19
19
|
if (filePath.includes(base)) return normalizeToPosixPath(path.join(alias, path.relative(base, filePath)));
|
|
20
|
-
return filePath;
|
|
20
|
+
else return filePath;
|
|
21
21
|
};
|
|
22
22
|
const parseModule = async ({ source, filename })=>{
|
|
23
23
|
let content = source;
|
|
@@ -36,10 +36,11 @@ const parseModule = async ({ source, filename })=>{
|
|
|
36
36
|
});
|
|
37
37
|
content = result.code;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
await init();
|
|
40
|
+
return parse(content);
|
|
40
41
|
};
|
|
41
42
|
const getServerCombinedModuleFile = (internalDirectory, entryName)=>path.join(internalDirectory, entryName, 'server-loader-combined.js');
|
|
42
|
-
const checkIsBuildCommands = (
|
|
43
|
+
const checkIsBuildCommands = ()=>{
|
|
43
44
|
const buildCommands = [
|
|
44
45
|
'dev',
|
|
45
46
|
'start',
|
|
@@ -49,8 +50,7 @@ const checkIsBuildCommands = (contextCommand)=>{
|
|
|
49
50
|
'dev-worker'
|
|
50
51
|
];
|
|
51
52
|
const command = getCommand();
|
|
52
|
-
|
|
53
|
-
return 'dev' === contextCommand || 'start' === contextCommand || 'build' === contextCommand || 'deploy' === contextCommand;
|
|
53
|
+
return buildCommands.includes(command);
|
|
54
54
|
};
|
|
55
55
|
const checkIsServeCommand = ()=>{
|
|
56
56
|
const command = getCommand();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { createCloudflarePreset } from "@modern-js/app-tools-extensions/cloudflare";
|
|
3
|
-
import {
|
|
3
|
+
import { getDeployingTarget } from "@modern-js/app-tools-extensions/deploy-output/target";
|
|
4
4
|
import { createGhPagesPreset } from "./platforms/gh-pages.mjs";
|
|
5
5
|
import { createNetlifyPreset } from "./platforms/netlify.mjs";
|
|
6
6
|
import { createNodePreset } from "./platforms/node.mjs";
|
|
@@ -13,24 +13,11 @@ const deployPresets = {
|
|
|
13
13
|
ghPages: createGhPagesPreset,
|
|
14
14
|
cloudflare: createCloudflarePreset
|
|
15
15
|
};
|
|
16
|
-
const getSupportedDeployTargets = ()=>Object.keys(deployPresets);
|
|
17
|
-
const isDeployTarget = (target)=>Object.prototype.hasOwnProperty.call(deployPresets, target);
|
|
18
|
-
const providerDeployTargets = {
|
|
19
|
-
vercel: 'vercel',
|
|
20
|
-
netlify: 'netlify',
|
|
21
|
-
cloudflare: 'cloudflare',
|
|
22
|
-
cloudflare_pages: 'cloudflare',
|
|
23
|
-
cloudflare_workers: 'cloudflare'
|
|
24
|
-
};
|
|
25
|
-
const normalizeDetectedProvider = (value)=>value ? providerDeployTargets[value] : void 0;
|
|
26
|
-
const resolveDeployTarget = (modernConfig, envDeployTarget = process.env.MODERNJS_DEPLOY, detectedProvider = provider)=>modernConfig.deploy?.target || envDeployTarget || normalizeDetectedProvider(detectedProvider) || 'node';
|
|
27
16
|
async function getDeployPreset(appContext, modernConfig, deployTarget, api) {
|
|
28
17
|
const { appDirectory, distDirectory, metaName } = appContext;
|
|
29
18
|
const { useSSR, useAPI, useWebServer } = getProjectUsage(appDirectory, distDirectory, metaName);
|
|
30
19
|
const needModernServer = useSSR || useAPI || useWebServer;
|
|
31
|
-
|
|
32
|
-
const createPreset = deployPresets[deployTarget];
|
|
33
|
-
return createPreset({
|
|
20
|
+
return deployPresets[deployTarget]({
|
|
34
21
|
appContext,
|
|
35
22
|
modernConfig,
|
|
36
23
|
needModernServer,
|
|
@@ -42,11 +29,9 @@ const deploy = ()=>({
|
|
|
42
29
|
setup: (api)=>{
|
|
43
30
|
api.deploy(async ()=>{
|
|
44
31
|
const appContext = api.getAppContext();
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
if ('modern-js' !== metaName && !modernConfig.deploy?.target && !process.env.MODERNJS_DEPLOY) return;
|
|
49
|
-
const deployPreset = await getDeployPreset(appContext, modernConfig, deployTarget, api);
|
|
32
|
+
const deployTarget = getDeployingTarget(appContext);
|
|
33
|
+
if (!deployTarget) return;
|
|
34
|
+
const deployPreset = await getDeployPreset(appContext, api.getNormalizedConfig(), deployTarget, api);
|
|
50
35
|
deployPreset?.prepare && await deployPreset?.prepare();
|
|
51
36
|
deployPreset?.writeOutput && await deployPreset?.writeOutput();
|
|
52
37
|
deployPreset?.genEntry && await deployPreset?.genEntry();
|
|
@@ -55,4 +40,3 @@ const deploy = ()=>({
|
|
|
55
40
|
}
|
|
56
41
|
});
|
|
57
42
|
export default deploy;
|
|
58
|
-
export { getSupportedDeployTargets, resolveDeployTarget };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import __rslib_shim_module__ from "node:module";
|
|
2
2
|
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(/*#__PURE__*/ (()=>import.meta.url)());
|
|
3
3
|
import node_path from "node:path";
|
|
4
|
+
import { traceDeployFiles } from "@modern-js/app-tools-extensions/deploy-output/trace-files";
|
|
4
5
|
import { fs, removeModuleSyncFromExports } from "@modern-js/utils";
|
|
5
6
|
import { nodeDepEmit } from "ndepe";
|
|
6
7
|
import { isMainEntry } from "../../../utils/routes.mjs";
|
|
@@ -73,8 +74,8 @@ const createNetlifyPreset = ({ appContext, modernConfig, needModernServer })=>{
|
|
|
73
74
|
if (!needModernServer) return;
|
|
74
75
|
const entry = isEsmProject ? await resolveESMDependency('@modern-js/prod-server') : require.resolve('@modern-js/prod-server');
|
|
75
76
|
const netlifyEntry = isEsmProject ? await resolveESMDependency('@modern-js/prod-server/netlify') : require.resolve('@modern-js/prod-server/netlify');
|
|
76
|
-
if (!entry || !netlifyEntry) throw new Error('Cannot find @modern-js/prod-server');
|
|
77
77
|
await nodeDepEmit({
|
|
78
|
+
traceFiles: traceDeployFiles,
|
|
78
79
|
appDir: appDirectory,
|
|
79
80
|
sourceDir: funcsDirectory,
|
|
80
81
|
includeEntries: [
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import __rslib_shim_module__ from "node:module";
|
|
2
2
|
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(/*#__PURE__*/ (()=>import.meta.url)());
|
|
3
|
+
import { createRequire } from "node:module";
|
|
3
4
|
import node_path from "node:path";
|
|
5
|
+
import { traceDeployFiles } from "@modern-js/app-tools-extensions/deploy-output/trace-files";
|
|
4
6
|
import { chalk, fs, removeModuleSyncFromExports } from "@modern-js/utils";
|
|
5
7
|
import { nodeDepEmit } from "ndepe";
|
|
6
8
|
import { readTemplate, resolveESMDependency } from "../utils/index.mjs";
|
|
7
9
|
import { generateHandler } from "../utils/generator.mjs";
|
|
8
10
|
const createNodePreset = ({ appContext, modernConfig })=>{
|
|
9
|
-
const { appDirectory, distDirectory, moduleType } = appContext;
|
|
11
|
+
const { appDirectory, distDirectory, moduleType, serverPlugins } = appContext;
|
|
10
12
|
const isEsmProject = 'module' === moduleType;
|
|
11
13
|
const outputDirectory = node_path.join(appDirectory, '.output');
|
|
12
14
|
const staticDirectory = node_path.join(outputDirectory, 'static');
|
|
@@ -36,12 +38,19 @@ const createNodePreset = ({ appContext, modernConfig })=>{
|
|
|
36
38
|
async end () {
|
|
37
39
|
const filter = (filePath)=>!filePath.startsWith(staticDirectory) && !filePath.endsWith('.map');
|
|
38
40
|
const entry = isEsmProject ? await resolveESMDependency('@modern-js/prod-server') : require.resolve('@modern-js/prod-server');
|
|
39
|
-
|
|
41
|
+
const requireFromApp = createRequire(node_path.join(appDirectory, 'package.json'));
|
|
42
|
+
const pluginEntries = new Set();
|
|
43
|
+
for (const plugin of serverPlugins)for (const specifier of plugin.includeEntries ?? []){
|
|
44
|
+
pluginEntries.add(requireFromApp.resolve(specifier));
|
|
45
|
+
if (isEsmProject) pluginEntries.add(await resolveESMDependency(specifier, appDirectory));
|
|
46
|
+
}
|
|
40
47
|
await nodeDepEmit({
|
|
48
|
+
traceFiles: traceDeployFiles,
|
|
41
49
|
appDir: appDirectory,
|
|
42
50
|
sourceDir: outputDirectory,
|
|
43
51
|
includeEntries: [
|
|
44
|
-
entry
|
|
52
|
+
entry,
|
|
53
|
+
...pluginEntries
|
|
45
54
|
],
|
|
46
55
|
copyWholePackage (pkgName) {
|
|
47
56
|
return '@modern-js/utils' === pkgName;
|
|
@@ -35,10 +35,11 @@ async function main() {
|
|
|
35
35
|
const app = await createProdServer(prodServerOptions);
|
|
36
36
|
const port = process.env.PORT || 8080;
|
|
37
37
|
app.listen({
|
|
38
|
-
host: '::',
|
|
39
38
|
port
|
|
40
39
|
}, ()=>{
|
|
41
|
-
|
|
40
|
+
const address = app.address();
|
|
41
|
+
const loopback = 'IPv6' === address.family ? '[::1]' : '127.0.0.1';
|
|
42
|
+
console.log(`\x1b[32mServer is listening on http://${loopback}:${address.port}`, '\x1b[0m');
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
main();
|
|
@@ -37,10 +37,11 @@ async function main() {
|
|
|
37
37
|
const app = await createProdServer(prodServerOptions);
|
|
38
38
|
const port = process.env.PORT || 8080;
|
|
39
39
|
app.listen({
|
|
40
|
-
host: '::',
|
|
41
40
|
port
|
|
42
41
|
}, ()=>{
|
|
43
|
-
|
|
42
|
+
const address = app.address();
|
|
43
|
+
const loopback = 'IPv6' === address.family ? '[::1]' : '127.0.0.1';
|
|
44
|
+
console.log(`\x1b[32mServer is listening on http://${loopback}:${address.port}`, '\x1b[0m');
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
47
|
main();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import __rslib_shim_module__ from "node:module";
|
|
2
2
|
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(/*#__PURE__*/ (()=>import.meta.url)());
|
|
3
3
|
import node_path from "node:path";
|
|
4
|
+
import { traceDeployFiles } from "@modern-js/app-tools-extensions/deploy-output/trace-files";
|
|
4
5
|
import { fs, removeModuleSyncFromExports } from "@modern-js/utils";
|
|
5
6
|
import { nodeDepEmit } from "ndepe";
|
|
6
7
|
import { isMainEntry } from "../../../utils/routes.mjs";
|
|
@@ -93,8 +94,8 @@ const createVercelPreset = ({ appContext, modernConfig, needModernServer })=>{
|
|
|
93
94
|
async end () {
|
|
94
95
|
if (!needModernServer) return;
|
|
95
96
|
const entry = isEsmProject ? await resolveESMDependency('@modern-js/prod-server') : require.resolve('@modern-js/prod-server');
|
|
96
|
-
if (!entry) throw new Error('Cannot find @modern-js/prod-server');
|
|
97
97
|
await nodeDepEmit({
|
|
98
|
+
traceFiles: traceDeployFiles,
|
|
98
99
|
appDir: appDirectory,
|
|
99
100
|
sourceDir: funcsDirectory,
|
|
100
101
|
includeEntries: [
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
3
|
+
import { ROUTE_SPEC_FILE, SERVER_DIR, fs, getMeta } from "@modern-js/utils";
|
|
4
|
+
import { moduleResolve } from "import-meta-resolve";
|
|
5
5
|
import path from "path";
|
|
6
6
|
import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
|
|
7
7
|
import { dirname as __rspack_dirname } from "node:path";
|
|
8
8
|
var __rspack_import_meta_dirname__ = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
|
|
9
|
-
var __rspack_import_meta_filename__ = __rspack_fileURLToPath(import.meta.url);
|
|
10
9
|
const normalizePath = (filePath)=>filePath.replace(/\\/g, '/');
|
|
11
10
|
const getProjectUsage = (appDirectory, distDirectory, metaName)=>{
|
|
12
11
|
const routeJSON = path.join(distDirectory, ROUTE_SPEC_FILE);
|
|
@@ -31,17 +30,20 @@ const getProjectUsage = (appDirectory, distDirectory, metaName)=>{
|
|
|
31
30
|
};
|
|
32
31
|
const getTemplatePath = (file)=>path.join(__rspack_import_meta_dirname__, '../platforms/templates', file);
|
|
33
32
|
const readTemplate = async (file)=>(await fs.readFile(getTemplatePath(file))).toString();
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
const DEPLOY_CONDITIONS = [
|
|
34
|
+
'node',
|
|
35
|
+
'import',
|
|
36
|
+
'module',
|
|
37
|
+
'default'
|
|
38
|
+
];
|
|
39
|
+
const resolveESMDependency = async (entry, fromDirectory)=>{
|
|
40
|
+
const base = fromDirectory ? pathToFileURL(path.join(fromDirectory, 'package.json')) : pathToFileURL(`${__rspack_import_meta_dirname__}/`);
|
|
41
41
|
try {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
return normalizePath(fileURLToPath(moduleResolve(entry, base, new Set(DEPLOY_CONDITIONS), false)));
|
|
43
|
+
} catch (cause) {
|
|
44
|
+
throw new Error(`Cannot resolve "${entry}" with conditions [${DEPLOY_CONDITIONS.join(', ')}] from ${base.href}: ${cause.message}`, {
|
|
45
|
+
cause
|
|
46
|
+
});
|
|
47
|
+
}
|
|
46
48
|
};
|
|
47
49
|
export { getProjectUsage, getTemplatePath, normalizePath, readTemplate, resolveESMDependency };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { ensureAbsolutePath, getPort, isDev, isDevCommand } from "@modern-js/utils";
|
|
3
|
+
import { buildDefaultLazyCompilationTest } from "../../builder/shared/lazyCompilation.mjs";
|
|
3
4
|
import { createDefaultConfig, isLazyCompilationSafeByDefault } from "../../config/index.mjs";
|
|
4
5
|
const initialize = ()=>({
|
|
5
6
|
name: '@modern-js/plugin-initialize',
|
|
@@ -18,7 +19,8 @@ const initialize = ()=>({
|
|
|
18
19
|
...defaultConfig.dev,
|
|
19
20
|
lazyCompilation: {
|
|
20
21
|
imports: true,
|
|
21
|
-
entries: false
|
|
22
|
+
entries: false,
|
|
23
|
+
test: buildDefaultLazyCompilationTest(appContext.appDirectory, appContext.internalDirectory)
|
|
22
24
|
}
|
|
23
25
|
};
|
|
24
26
|
return defaultConfig;
|
|
@@ -26,7 +28,7 @@ const initialize = ()=>({
|
|
|
26
28
|
api.modifyResolvedConfig(async (resolved)=>{
|
|
27
29
|
let appContext = api.getAppContext();
|
|
28
30
|
const userConfig = api.getConfig();
|
|
29
|
-
const port = await getServerPort(resolved
|
|
31
|
+
const port = await getServerPort(resolved);
|
|
30
32
|
appContext = {
|
|
31
33
|
...appContext,
|
|
32
34
|
port,
|
|
@@ -61,10 +63,9 @@ function stabilizeConfig(resolve, config, keys) {
|
|
|
61
63
|
resolve[key] = config[key] || {};
|
|
62
64
|
});
|
|
63
65
|
}
|
|
64
|
-
async function getServerPort(config
|
|
66
|
+
async function getServerPort(config) {
|
|
65
67
|
const prodPort = Number(process.env.PORT) || config.server.port || 8080;
|
|
66
|
-
|
|
67
|
-
if (isDev() && (isDevCommand() || isProgrammaticDev)) return getPort(Number(process.env.PORT) || prodPort);
|
|
68
|
+
if (isDev() && isDevCommand()) return getPort(Number(process.env.PORT) || prodPort);
|
|
68
69
|
return prodPort;
|
|
69
70
|
}
|
|
70
71
|
export default initialize;
|
|
@@ -30,10 +30,8 @@ const serverBuild = ()=>({
|
|
|
30
30
|
sourceDirs.push(serverDir);
|
|
31
31
|
if (fs.existsSync(sharedDir)) sourceDirs.push(sharedDir);
|
|
32
32
|
}
|
|
33
|
-
const { server } = modernConfig;
|
|
34
33
|
const { alias } = modernConfig.source;
|
|
35
34
|
if (sourceDirs.length > 0) await compile(appDirectory, {
|
|
36
|
-
server,
|
|
37
35
|
alias
|
|
38
36
|
}, {
|
|
39
37
|
sourceDirs,
|
|
@@ -8,21 +8,21 @@ import { loadInternalPlugins } from "../utils/loadPlugins.mjs";
|
|
|
8
8
|
async function createRunOptions({ cwd, initialLog, metaName = 'modern-js', version, internalPlugins, configFile }) {
|
|
9
9
|
const nodeVersion = process.versions.node;
|
|
10
10
|
const versionArr = nodeVersion.split('.').map(Number);
|
|
11
|
-
if (versionArr[0] < 26 || 26 === versionArr[0] && versionArr[1] <
|
|
11
|
+
if (versionArr[0] < 26 || 26 === versionArr[0] && versionArr[1] < 10) throw new Error(`
|
|
12
12
|
${chalk.bgRed.white.bold(' UNSUPPORTED NODE.JS RUNTIME ')}
|
|
13
13
|
|
|
14
|
-
${chalk.red.bold(`UltraModern.js requires Node.js >=26.
|
|
14
|
+
${chalk.red.bold(`UltraModern.js requires Node.js >=26.10.0; detected v${nodeVersion}.`)}
|
|
15
15
|
${chalk.red('- Legacy Node runtimes and TypeScript transpiler fallbacks are unsupported.')}
|
|
16
16
|
|
|
17
17
|
${chalk.yellow('▸ Detected Runtime:')} ${chalk.yellow.bold(`Node.js v${nodeVersion}`)}
|
|
18
|
-
${chalk.green('▸ Required Minimum:')} ${chalk.green.bold('Node.js v26.
|
|
19
|
-
${chalk.green('▸ Pinned Runtime:')} ${chalk.green.bold('Node.js v26.
|
|
18
|
+
${chalk.green('▸ Required Minimum:')} ${chalk.green.bold('Node.js v26.10.0 or higher')}
|
|
19
|
+
${chalk.green('▸ Pinned Runtime:')} ${chalk.green.bold('Node.js v26.10.0')}
|
|
20
20
|
|
|
21
21
|
${chalk.cyan('Immediate Action Required:')}
|
|
22
22
|
${chalk.gray('├──')} ${chalk.yellow('Recommended Upgrade')}
|
|
23
23
|
${chalk.bold('mise install && mise exec -- node --version')}
|
|
24
24
|
${chalk.gray('├──')} ${chalk.yellow('Manual Installation')}
|
|
25
|
-
${chalk.underline('https://nodejs.org/download/release/v26.
|
|
25
|
+
${chalk.underline('https://nodejs.org/download/release/v26.10.0/')}
|
|
26
26
|
${chalk.gray('└──')} ${chalk.yellow('Environment Verification')}
|
|
27
27
|
${chalk.bold('node -v && npm -v')}
|
|
28
28
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "node:module";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import {
|
|
2
|
+
import { fs, ip } from "@modern-js/utils";
|
|
3
3
|
import path from "path";
|
|
4
4
|
function isSymlinkedNodeModules(appDirectory) {
|
|
5
5
|
try {
|
|
@@ -18,7 +18,7 @@ const initAppContext = ({ metaName, appDirectory, runtimeConfigFile, options, te
|
|
|
18
18
|
const moduleType = fs.existsSync(pkgPath) ? fs.readJSONSync(pkgPath).type || 'commonjs' : 'commonjs';
|
|
19
19
|
return {
|
|
20
20
|
runtimeConfigFile,
|
|
21
|
-
ip:
|
|
21
|
+
ip: ip(),
|
|
22
22
|
port: 0,
|
|
23
23
|
moduleType,
|
|
24
24
|
apiDirectory: path.resolve(appDirectory, apiDir),
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
+
import node_path from "node:path";
|
|
2
3
|
import { loadServerPlugins } from "@modern-js/server-core/node";
|
|
3
|
-
import { compatibleRequire, createDebugger,
|
|
4
|
+
import { compatibleRequire, createDebugger, getInternalPlugins, tryResolve } from "@modern-js/utils";
|
|
4
5
|
const debug = createDebugger('load-plugins');
|
|
5
6
|
async function getServerPlugins(api, metaName = 'modern-js') {
|
|
6
7
|
const hooks = api.getHooks();
|
|
7
8
|
const { plugins } = await hooks._internalServerPlugins.call({
|
|
8
9
|
plugins: []
|
|
9
10
|
});
|
|
10
|
-
const filtedPlugins = plugins.filter((plugin)=>plugin.name.includes(metaName));
|
|
11
|
+
const filtedPlugins = plugins.filter((plugin)=>node_path.isAbsolute(plugin.name) || plugin.name.includes(metaName));
|
|
11
12
|
api.updateAppContext({
|
|
12
13
|
serverPlugins: filtedPlugins
|
|
13
14
|
});
|
|
@@ -22,12 +23,7 @@ const resolveCliPlugin = async (p, appDirectory)=>{
|
|
|
22
23
|
const pkg = 'string' == typeof p ? p : p[0];
|
|
23
24
|
const pluginOptions = 'string' == typeof p ? void 0 : p[1];
|
|
24
25
|
const path = tryResolve(pkg, appDirectory);
|
|
25
|
-
|
|
26
|
-
try {
|
|
27
|
-
module = await compatibleRequire(path);
|
|
28
|
-
} catch (e) {
|
|
29
|
-
({ default: module } = await dynamicImport(path));
|
|
30
|
-
}
|
|
26
|
+
const module = await compatibleRequire(path);
|
|
31
27
|
if ('function' == typeof module) {
|
|
32
28
|
const result = module(pluginOptions);
|
|
33
29
|
return result;
|
|
@@ -59,7 +59,7 @@ const resolveTsRuntimeRegisterMode = ()=>{
|
|
|
59
59
|
return 'unsupported';
|
|
60
60
|
};
|
|
61
61
|
const setupTsRuntime = async (appDir, distDir, alias, options = {})=>{
|
|
62
|
-
if ('unsupported' === resolveTsRuntimeRegisterMode()) throw new Error(`UltraModern.js requires Node.js >=26.
|
|
62
|
+
if ('unsupported' === resolveTsRuntimeRegisterMode()) throw new Error(`UltraModern.js requires Node.js >=26.10.0 with native TypeScript support; detected v${process.versions.node}. Legacy TypeScript runtime transpilers are unsupported.`);
|
|
63
63
|
const tsconfigPath = resolveServerTsconfig(appDir, options.tsconfigPath);
|
|
64
64
|
const isTsProject = await fs.pathExists(tsconfigPath);
|
|
65
65
|
if (!isTsProject) return;
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
import type { RsbuildPlugin } from '@modern-js/builder';
|
|
1
|
+
import type { RsbuildPlugin, Rspack } from '@modern-js/builder';
|
|
2
2
|
import type { BuilderOptions } from '../shared/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* The copy plugin registers each pattern context as a context dependency even
|
|
5
|
+
* when the directory is absent. The watcher reports an absent context as
|
|
6
|
+
* removed right after the first build, which rebuilds every dev session once.
|
|
7
|
+
* Watch an absent context, and its absent parents, as missing instead: their
|
|
8
|
+
* later creation still rebuilds and copies.
|
|
9
|
+
*/
|
|
10
|
+
export declare class MissingCopyContextPlugin {
|
|
11
|
+
private readonly contexts;
|
|
12
|
+
constructor(contexts: readonly string[]);
|
|
13
|
+
apply(compiler: Rspack.Compiler): void;
|
|
14
|
+
}
|
|
3
15
|
export declare const builderPluginAdapterCopy: (options: BuilderOptions) => RsbuildPlugin;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare function createBuilderGenerator(): Promise<typeof import("./builder-rspack/index.js").createRspackBuilderForModern>;
|
|
2
2
|
export { parseRspackConfig } from '@modern-js/builder';
|
|
3
|
+
export { getBundleEntry } from '../plugins/analyze/getBundleEntry.js';
|
|
3
4
|
export { builderPluginAdapterBasic, builderPluginAdapterHooks, } from './shared/builderPlugins/index.js';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { AppContext, CLIPluginExtends } from '@modern-js/plugin/cli';
|
|
1
2
|
import type { RsbuildPlugin } from '@rsbuild/core';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
export declare const builderPluginAdapterBasic: <Options extends {
|
|
4
|
+
appContext: Pick<AppContext<CLIPluginExtends>, 'metaName'>;
|
|
5
|
+
}>(options: Options) => RsbuildPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Rspack } from '@modern-js/builder';
|
|
2
|
-
import { type RsbuildPlugin } from '@rsbuild/core';
|
|
2
|
+
import { type RsbuildPlugin, type RspackChain } from '@rsbuild/core';
|
|
3
3
|
import type { AppNormalizedConfig } from '../../../types/index.js';
|
|
4
4
|
import type { AppToolsContext } from '../../../types/plugin.js';
|
|
5
5
|
import type { BuilderOptions } from '../types.js';
|
|
@@ -12,3 +12,4 @@ export declare const builderPluginAdapterSSR: (options: BuilderOptions) => Rsbui
|
|
|
12
12
|
* so the caller leaves the config untouched.
|
|
13
13
|
*/
|
|
14
14
|
export declare function getSSRLazyCompilation(current: unknown, normalizedConfig: AppNormalizedConfig, appContext: AppToolsContext, eagerRouteComponentFilesByEntry: BuilderOptions['eagerRouteComponentFilesByEntry']): Rspack.LazyCompilationOptions | undefined;
|
|
15
|
+
export declare function applySSRLoaderEntry(chain: RspackChain, optinos: BuilderOptions, isServer: boolean, isServiceWorker: boolean): Promise<void>;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import type { Hooks } from '@modern-js/plugin/cli';
|
|
1
2
|
import type { RsbuildPlugin } from '@rsbuild/core';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
export declare const builderPluginAdapterHooks: <Options extends {
|
|
4
|
+
appContext: {
|
|
5
|
+
_internalContext: {
|
|
6
|
+
pluginAPI?: {
|
|
7
|
+
getHooks(): Readonly<Pick<Hooks<{}, {}, {}, {}>, 'modifyBundlerChain' | 'modifyRsbuildConfig' | 'modifyRspackConfig'>>;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
}>(options: Options) => RsbuildPlugin;
|
|
@@ -26,6 +26,21 @@ export declare function aggregateEagerRouteComponentFiles(byEntry: EagerRouteCom
|
|
|
26
26
|
* (defaulting to lazy when the user did not provide one).
|
|
27
27
|
*/
|
|
28
28
|
export declare function buildSSRLazyCompilationTest(eagerRouteFiles: Set<string>, userTest?: LazyCompilationTest): LazyCompilationTestFn;
|
|
29
|
+
/**
|
|
30
|
+
* Build the default dev `lazyCompilation.test`: a dynamic import is lazy only
|
|
31
|
+
* when it targets the app's own source. Everything else compiles eagerly:
|
|
32
|
+
* - the generated `<internalDirectory>/<entry>/index.jsx`, which
|
|
33
|
+
* `bootstrap.jsx` imports as the async entry boundary Module Federation
|
|
34
|
+
* needs to initialize shared scopes, not a code-split point;
|
|
35
|
+
* - framework and dependency modules (outside `appDirectory` or under
|
|
36
|
+
* `node_modules`), such as plugin-i18n's backend, utils and react-i18next.
|
|
37
|
+
* Each lazy module costs one on-demand compile and HMR cycle on the first page
|
|
38
|
+
* load. Back-to-back cycles for framework imports raced on loaded CI runners
|
|
39
|
+
* ("Cannot read properties of undefined (reading 'call')"), and the app never
|
|
40
|
+
* rendered.
|
|
41
|
+
* Typed `object` so it is assignable to Rspack's `(module: Module) => boolean`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildDefaultLazyCompilationTest(appDirectory: string, internalDirectory: string): (m: object) => boolean;
|
|
29
44
|
export type SSRLazyPlan = {
|
|
30
45
|
apply: false;
|
|
31
46
|
unresolvedByEntry?: Map<string, string[]>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { InternalContext } from '@modern-js/plugin';
|
|
2
|
-
import type { AppTools } from '../types/index.js';
|
|
2
|
+
import type { AppTools } from '../types/config/index.js';
|
|
3
|
+
import type { AppToolsHookRunners } from '../types/plugin-base.js';
|
|
3
4
|
/**
|
|
4
5
|
* old plugin useHookRunners function result
|
|
5
6
|
*/
|
|
6
|
-
export declare function getHookRunners(context: InternalContext<AppTools>):
|
|
7
|
+
export declare function getHookRunners(context: InternalContext<AppTools>): AppToolsHookRunners;
|
|
7
8
|
export declare function handleSetupResult(setupResult: Record<string, (...args: any) => any>, api: Record<string, any>): void;
|