@modern-js/app-tools 2.57.1-alpha.0 → 2.57.1-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/builder/builder-webpack/index.js +1 -1
- package/dist/cjs/builder/generator/index.js +2 -2
- package/dist/cjs/builder/index.js +2 -2
- package/dist/cjs/commands/build.js +19 -0
- package/dist/cjs/commands/dev.js +9 -0
- package/dist/cjs/commands/index.js +8 -8
- package/dist/cjs/esm/esbuild-loader.mjs +20 -0
- package/dist/cjs/esm/register-esm.mjs +65 -0
- package/dist/cjs/esm/ts-node-loader.mjs +21 -0
- package/dist/cjs/esm/utils.mjs +28 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/plugins/analyze/index.js +3 -3
- package/dist/cjs/plugins/deploy/dependencies/index.js +4 -3
- package/dist/cjs/plugins/deploy/dependencies/utils.js +12 -10
- package/dist/cjs/plugins/deploy/platforms/netlify-entry-cjs.js +1 -0
- package/dist/cjs/plugins/deploy/platforms/netlify-entry-mjs.js +10 -0
- package/dist/cjs/plugins/deploy/platforms/netlify.js +9 -2
- package/dist/cjs/plugins/deploy/platforms/netlifyEntry.js +26 -0
- package/dist/cjs/plugins/deploy/platforms/node.js +9 -2
- package/dist/cjs/utils/loadPlugins.js +1 -1
- package/dist/cjs/utils/register.js +38 -22
- package/dist/esm/builder/generator/getBuilderEnvironments.js +0 -2
- package/dist/esm/builder/generator/index.js +1 -1
- package/dist/esm/builder/index.js +2 -2
- package/dist/esm/builder/shared/builderPlugins/adapterBasic.js +1 -1
- package/dist/esm/commands/build.js +9 -16
- package/dist/esm/commands/dev.js +37 -55
- package/dist/esm/commands/index.js +6 -6
- package/dist/esm/custom-loader.mjs +41 -0
- package/dist/esm/index.js +42 -1
- package/dist/esm/plugins/analyze/index.js +4 -3
- package/dist/esm/plugins/deploy/dependencies/index.js +5 -6
- package/dist/esm/plugins/deploy/dependencies/utils.js +0 -8
- package/dist/esm/register-esm.mjs +22 -0
- package/dist/esm/utils/createServer.js +1 -1
- package/dist/esm-node/builder/generator/getBuilderEnvironments.js +1 -1
- package/dist/esm-node/builder/generator/index.js +1 -1
- package/dist/esm-node/builder/index.js +2 -2
- package/dist/esm-node/builder/shared/builderPlugins/adapterBasic.js +1 -1
- package/dist/esm-node/commands/build.js +0 -3
- package/dist/esm-node/commands/dev.js +16 -24
- package/dist/esm-node/commands/index.js +6 -6
- package/dist/esm-node/esm/esbuild-loader.js +39 -0
- package/dist/esm-node/esm/register-esm.js +39 -0
- package/dist/esm-node/esm/ts-node-loader.js +42 -0
- package/dist/esm-node/index.js +17 -1
- package/dist/esm-node/plugins/analyze/index.js +4 -3
- package/dist/esm-node/plugins/deploy/dependencies/index.js +4 -5
- package/dist/esm-node/plugins/deploy/dependencies/utils.js +0 -8
- package/dist/esm-node/utils/createServer.js +1 -1
- package/dist/types/builder/index.d.ts +1 -1
- package/dist/types/esm/esbuild-loader.d.mts +6 -0
- package/dist/types/esm/register-esm.d.mts +5 -0
- package/dist/types/esm/ts-node-loader.d.mts +6 -0
- package/dist/types/esm/utils.d.mts +6 -0
- package/dist/types/plugins/deploy/dependencies/utils.d.ts +0 -1
- package/dist/types/plugins/deploy/platforms/netlify-entry-cjs.d.ts +0 -0
- package/dist/types/plugins/deploy/platforms/netlify-entry-mjs.d.ts +1 -0
- package/dist/types/plugins/deploy/platforms/netlifyEntry.d.ts +1 -2
- package/package.json +8 -8
@@ -1,23 +1,27 @@
|
|
1
1
|
import path from "node:path";
|
2
2
|
import { ResolvedConfigContext } from "@modern-js/core";
|
3
|
-
import { DEFAULT_DEV_HOST, SERVER_DIR, getMeta
|
3
|
+
import { DEFAULT_DEV_HOST, SERVER_DIR, getMeta } from "@modern-js/utils";
|
4
4
|
import { createDevServer } from "@modern-js/server";
|
5
5
|
import { applyPlugins } from "@modern-js/prod-server";
|
6
6
|
import { loadServerPlugins } from "../utils/loadPlugins";
|
7
|
-
import { registerCompiler } from "../utils/register";
|
8
7
|
import { printInstructions } from "../utils/printInstructions";
|
9
8
|
import { setServer } from "../utils/createServer";
|
10
9
|
import { generateRoutes } from "../utils/routes";
|
11
10
|
import { buildServerConfig } from "../utils/config";
|
12
|
-
const dev = async (api, options, devServerOptions) => {
|
13
|
-
var _normalizedConfig_source, _normalizedConfig_tools
|
11
|
+
const dev = async (api, options, devServerOptions = {}) => {
|
12
|
+
var _normalizedConfig_source, _normalizedConfig_tools;
|
14
13
|
if (options.analyze) {
|
15
14
|
process.env.BUNDLE_ANALYZE = "true";
|
16
15
|
}
|
17
16
|
let normalizedConfig = api.useResolvedConfigContext();
|
18
17
|
const appContext = api.useAppContext();
|
19
18
|
const hookRunners = api.useHookRunners();
|
20
|
-
|
19
|
+
const { registerEsm } = await import("../esm/register-esm.mjs");
|
20
|
+
await registerEsm({
|
21
|
+
appDir: appContext.appDirectory,
|
22
|
+
distDir: appContext.distDirectory,
|
23
|
+
alias: (_normalizedConfig_source = normalizedConfig.source) === null || _normalizedConfig_source === void 0 ? void 0 : _normalizedConfig_source.alias
|
24
|
+
});
|
21
25
|
normalizedConfig = {
|
22
26
|
...normalizedConfig,
|
23
27
|
cliOptions: options
|
@@ -60,32 +64,20 @@ const dev = async (api, options, devServerOptions) => {
|
|
60
64
|
plugins: pluginInstances,
|
61
65
|
...devServerOptions
|
62
66
|
};
|
63
|
-
const host = ((_normalizedConfig_dev = normalizedConfig.dev) === null || _normalizedConfig_dev === void 0 ? void 0 : _normalizedConfig_dev.host) || DEFAULT_DEV_HOST;
|
64
67
|
if (apiOnly) {
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
server.listen({
|
68
|
+
var _normalizedConfig_dev;
|
69
|
+
const app = await createDevServer(serverOptions, applyPlugins);
|
70
|
+
const host = ((_normalizedConfig_dev = normalizedConfig.dev) === null || _normalizedConfig_dev === void 0 ? void 0 : _normalizedConfig_dev.host) || DEFAULT_DEV_HOST;
|
71
|
+
app.listen({
|
70
72
|
port,
|
71
73
|
host
|
72
74
|
}, () => {
|
73
75
|
printInstructions(hookRunners, appContext, normalizedConfig);
|
74
76
|
});
|
75
77
|
} else {
|
76
|
-
const { server
|
77
|
-
|
78
|
-
|
79
|
-
}, (devServerOptions === null || devServerOptions === void 0 ? void 0 : devServerOptions.applyPlugins) || applyPlugins);
|
80
|
-
server.listen({
|
81
|
-
port,
|
82
|
-
host
|
83
|
-
}, async (err) => {
|
84
|
-
if (err) {
|
85
|
-
logger.error("Occur error %s, when start dev server", err);
|
86
|
-
}
|
87
|
-
logger.debug("listen dev server done");
|
88
|
-
await afterListen();
|
78
|
+
const { server } = await appContext.builder.startDevServer({
|
79
|
+
serverOptions,
|
80
|
+
applyPlugins
|
89
81
|
});
|
90
82
|
setServer(server);
|
91
83
|
}
|
@@ -5,7 +5,7 @@ const devCommand = async (program, api) => {
|
|
5
5
|
const runner = api.useHookRunners();
|
6
6
|
const devToolMetas = await runner.registerDev();
|
7
7
|
const 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(async (options) => {
|
8
|
-
const { dev } = await import("./dev");
|
8
|
+
const { dev } = await import("./dev.js");
|
9
9
|
await dev(api, options);
|
10
10
|
});
|
11
11
|
for (const meta of devToolMetas) {
|
@@ -28,7 +28,7 @@ const buildCommand = async (program, api) => {
|
|
28
28
|
const runner = api.useHookRunners();
|
29
29
|
const platformBuilders = await runner.registerBuildPlatform();
|
30
30
|
const 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(async (options) => {
|
31
|
-
const { build } = await import("./build");
|
31
|
+
const { build } = await import("./build.js");
|
32
32
|
await build(api, options);
|
33
33
|
});
|
34
34
|
for (const platformBuilder of platformBuilders) {
|
@@ -47,17 +47,17 @@ const buildCommand = async (program, api) => {
|
|
47
47
|
};
|
48
48
|
const serverCommand = (program, api) => {
|
49
49
|
program.command("serve").usage("[options]").description(i18n.t(localeKeys.command.serve.describe)).option("--api-only", i18n.t(localeKeys.command.dev.apiOnly)).option("-c --config <config>", i18n.t(localeKeys.command.shared.config)).action(async () => {
|
50
|
-
const { start } = await import("./serve");
|
50
|
+
const { start } = await import("./serve.js");
|
51
51
|
await start(api);
|
52
52
|
});
|
53
53
|
};
|
54
54
|
const deployCommand = (program, api) => {
|
55
55
|
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(async (options) => {
|
56
56
|
if (!options.skipBuild) {
|
57
|
-
const { build } = await import("./build");
|
57
|
+
const { build } = await import("./build.js");
|
58
58
|
await build(api);
|
59
59
|
}
|
60
|
-
const { deploy } = await import("./deploy");
|
60
|
+
const { deploy } = await import("./deploy.js");
|
61
61
|
await deploy(api, options);
|
62
62
|
process.exit(0);
|
63
63
|
});
|
@@ -72,7 +72,7 @@ const newCommand = (program, locale) => {
|
|
72
72
|
};
|
73
73
|
const inspectCommand = (program, api) => {
|
74
74
|
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(async (options) => {
|
75
|
-
const { inspect } = await import("./inspect");
|
75
|
+
const { inspect } = await import("./inspect.js");
|
76
76
|
inspect(api, options);
|
77
77
|
});
|
78
78
|
};
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { pathToFileURL } from "url";
|
2
|
+
import * as tsConfigPaths from "@modern-js/utils/tsconfig-paths";
|
3
|
+
import { getAliasConfig } from "@modern-js/utils";
|
4
|
+
import path from "path";
|
5
|
+
let matchPath;
|
6
|
+
function initialize({ appDir, alias }) {
|
7
|
+
const TS_CONFIG_FILENAME = `tsconfig.json`;
|
8
|
+
const aliasConfig = getAliasConfig(alias, {
|
9
|
+
appDirectory: appDir,
|
10
|
+
tsconfigPath: path.resolve(appDir, TS_CONFIG_FILENAME)
|
11
|
+
});
|
12
|
+
const { paths = {}, absoluteBaseUrl = "./" } = aliasConfig;
|
13
|
+
const tsPaths = Object.keys(paths).reduce((o, key) => {
|
14
|
+
let tsPath = paths[key];
|
15
|
+
if (typeof tsPath === "string" && path.isAbsolute(tsPath)) {
|
16
|
+
tsPath = path.relative(absoluteBaseUrl, tsPath);
|
17
|
+
}
|
18
|
+
if (typeof tsPath === "string") {
|
19
|
+
tsPath = [
|
20
|
+
tsPath
|
21
|
+
];
|
22
|
+
}
|
23
|
+
return {
|
24
|
+
...o,
|
25
|
+
[`${key}`]: tsPath
|
26
|
+
};
|
27
|
+
}, {});
|
28
|
+
matchPath = tsConfigPaths.createMatchPath(absoluteBaseUrl, tsPaths);
|
29
|
+
}
|
30
|
+
function resolve(specifier, context, defaultResolve) {
|
31
|
+
const match = matchPath(specifier);
|
32
|
+
return match ? defaultResolve(pathToFileURL(match).href, context) : defaultResolve(specifier, context);
|
33
|
+
}
|
34
|
+
import { load } from "esbuild-register/loader";
|
35
|
+
export {
|
36
|
+
initialize,
|
37
|
+
load,
|
38
|
+
resolve
|
39
|
+
};
|
@@ -0,0 +1,39 @@
|
|
1
|
+
const import_meta = {};
|
2
|
+
import { register } from "node:module";
|
3
|
+
import path from "node:path";
|
4
|
+
const checkDep = async (dep) => {
|
5
|
+
try {
|
6
|
+
await import(dep);
|
7
|
+
return true;
|
8
|
+
} catch (error) {
|
9
|
+
return false;
|
10
|
+
}
|
11
|
+
};
|
12
|
+
const registerEsm = async ({ appDir, distDir, alias }) => {
|
13
|
+
const hasTsNode = await checkDep("ts-node");
|
14
|
+
if (hasTsNode) {
|
15
|
+
process.env.TS_NODE_TRANSPILE_ONLY = true;
|
16
|
+
process.env.TS_NODE_PROJECT = path.join(appDir, "tsconfig.json");
|
17
|
+
process.env.TS_NODE_SCOPE = true;
|
18
|
+
process.env.TS_NODE_FILES = true;
|
19
|
+
process.env.TS_NODE_IGNORE = `(?:^|/)node_modules/,(?:^|/)${path.relative(appDir, distDir)}/`;
|
20
|
+
register("./ts-node-loader.mjs", import_meta.url, {
|
21
|
+
data: {
|
22
|
+
appDir,
|
23
|
+
distDir,
|
24
|
+
alias
|
25
|
+
}
|
26
|
+
});
|
27
|
+
} else {
|
28
|
+
register("./esbuild-loader.mjs", import_meta.url, {
|
29
|
+
data: {
|
30
|
+
appDir,
|
31
|
+
distDir,
|
32
|
+
alias
|
33
|
+
}
|
34
|
+
});
|
35
|
+
}
|
36
|
+
};
|
37
|
+
export {
|
38
|
+
registerEsm
|
39
|
+
};
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { pathToFileURL } from "url";
|
2
|
+
import { resolve as tsNodeResolve } from "ts-node/esm";
|
3
|
+
import * as tsConfigPaths from "@modern-js/utils/tsconfig-paths";
|
4
|
+
import { getAliasConfig } from "@modern-js/utils";
|
5
|
+
import path from "path";
|
6
|
+
console.log("ttttttttttttt", tsConfigPaths);
|
7
|
+
let matchPath;
|
8
|
+
function initialize({ appDir, alias }) {
|
9
|
+
const TS_CONFIG_FILENAME = `tsconfig.json`;
|
10
|
+
const aliasConfig = getAliasConfig(alias, {
|
11
|
+
appDirectory: appDir,
|
12
|
+
tsconfigPath: path.resolve(appDir, TS_CONFIG_FILENAME)
|
13
|
+
});
|
14
|
+
const { paths = {}, absoluteBaseUrl = "./" } = aliasConfig;
|
15
|
+
const tsPaths = Object.keys(paths).reduce((o, key) => {
|
16
|
+
let tsPath = paths[key];
|
17
|
+
if (typeof tsPath === "string" && path.isAbsolute(tsPath)) {
|
18
|
+
tsPath = path.relative(absoluteBaseUrl, tsPath);
|
19
|
+
}
|
20
|
+
if (typeof tsPath === "string") {
|
21
|
+
tsPath = [
|
22
|
+
tsPath
|
23
|
+
];
|
24
|
+
}
|
25
|
+
return {
|
26
|
+
...o,
|
27
|
+
[`${key}`]: tsPath
|
28
|
+
};
|
29
|
+
}, {});
|
30
|
+
matchPath = tsConfigPaths.createMatchPath(absoluteBaseUrl, tsPaths);
|
31
|
+
}
|
32
|
+
function resolve(specifier, context, defaultResolve) {
|
33
|
+
const match = matchPath(specifier);
|
34
|
+
return match ? tsNodeResolve(pathToFileURL(match).href, context, defaultResolve) : tsNodeResolve(specifier, context, defaultResolve);
|
35
|
+
}
|
36
|
+
import { transformSource, load } from "ts-node/esm";
|
37
|
+
export {
|
38
|
+
initialize,
|
39
|
+
load,
|
40
|
+
resolve,
|
41
|
+
transformSource
|
42
|
+
};
|
package/dist/esm-node/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import path from "path";
|
2
2
|
import { lintPlugin } from "@modern-js/plugin-lint";
|
3
|
-
import { cleanRequireCache, emptyDir, getCommand, getArgv } from "@modern-js/utils";
|
3
|
+
import { cleanRequireCache, emptyDir, getCommand, getArgv, fs, NESTED_ROUTE_SPEC_FILE } from "@modern-js/utils";
|
4
4
|
import { getLocaleLanguage } from "@modern-js/plugin-i18n/language-detector";
|
5
5
|
import initializePlugin from "./plugins/initialize";
|
6
6
|
import analyzePlugin from "./plugins/analyze";
|
@@ -47,6 +47,7 @@ const appTools = (options = {
|
|
47
47
|
...appContext,
|
48
48
|
toolsType: "app-tools"
|
49
49
|
});
|
50
|
+
const nestedRoutes = {};
|
50
51
|
const locale = getLocaleLanguage();
|
51
52
|
i18n.changeLanguage({
|
52
53
|
locale
|
@@ -111,6 +112,21 @@ const appTools = (options = {
|
|
111
112
|
cleanRequireCache([
|
112
113
|
require.resolve("./plugins/analyze")
|
113
114
|
]);
|
115
|
+
},
|
116
|
+
async modifyFileSystemRoutes({ entrypoint, routes }) {
|
117
|
+
nestedRoutes[entrypoint.entryName] = routes;
|
118
|
+
return {
|
119
|
+
entrypoint,
|
120
|
+
routes
|
121
|
+
};
|
122
|
+
},
|
123
|
+
async beforeGenerateRoutes({ entrypoint, code }) {
|
124
|
+
const { distDirectory } = api.useAppContext();
|
125
|
+
await fs.outputJSON(path.resolve(distDirectory, NESTED_ROUTE_SPEC_FILE), nestedRoutes);
|
126
|
+
return {
|
127
|
+
entrypoint,
|
128
|
+
code
|
129
|
+
};
|
114
130
|
}
|
115
131
|
};
|
116
132
|
}
|
@@ -7,6 +7,7 @@ import { getSelectedEntries } from "../../utils/getSelectedEntries";
|
|
7
7
|
import { initialNormalizedConfig } from "../../config";
|
8
8
|
import { createBuilderGenerator } from "../../builder";
|
9
9
|
import { checkIsBuildCommands } from "./utils";
|
10
|
+
import { compatibleRequire } from "@modern-js/utils";
|
10
11
|
const debug = createDebugger("plugin-analyze");
|
11
12
|
var analyze_default = ({ bundler }) => ({
|
12
13
|
name: "@modern-js/plugin-analyze",
|
@@ -44,9 +45,9 @@ var analyze_default = ({ bundler }) => ({
|
|
44
45
|
return;
|
45
46
|
}
|
46
47
|
const [{ getBundleEntry }, { getServerRoutes }, { getHtmlTemplate }] = await Promise.all([
|
47
|
-
|
48
|
-
|
49
|
-
|
48
|
+
compatibleRequire(path.join(__dirname, "./getBundleEntry.js")),
|
49
|
+
compatibleRequire(path.join(__dirname, "./getServerRoutes.js")),
|
50
|
+
compatibleRequire(path.join(__dirname, "./getHtmlTemplate.js"))
|
50
51
|
]);
|
51
52
|
const { entrypoints } = await hookRunners.modifyEntrypoints({
|
52
53
|
entrypoints: await getBundleEntry(hookRunners, appContext, resolvedConfig)
|
@@ -2,13 +2,12 @@ import path from "node:path";
|
|
2
2
|
import { fs as fse, pkgUp, semver } from "@modern-js/utils";
|
3
3
|
import { readPackageJSON } from "pkg-types";
|
4
4
|
import { parseNodeModulePath } from "mlly";
|
5
|
-
import { linkPackage, writePackage, isFile, findEntryFiles, traceFiles as defaultTraceFiles, findPackageParents, resolveTracedPath, readDirRecursive
|
5
|
+
import { linkPackage, writePackage, isFile, findEntryFiles, traceFiles as defaultTraceFiles, findPackageParents, resolveTracedPath, readDirRecursive } from "./utils";
|
6
6
|
const handleDependencies = async ({ appDir, serverRootDir, includeEntries, traceFiles = defaultTraceFiles, entryFilter, modifyPackageJson, copyWholePackage }) => {
|
7
7
|
const base = "/";
|
8
8
|
const entryFiles = await findEntryFiles(serverRootDir, entryFilter);
|
9
9
|
const fileTrace = await traceFiles(entryFiles.concat(includeEntries), serverRootDir, base);
|
10
10
|
const currentProjectModules = path.join(appDir, "node_modules");
|
11
|
-
const dependencySearchRoot = path.resolve(appDir, "../../../../../../");
|
12
11
|
const tracedFiles = Object.fromEntries(await Promise.all([
|
13
12
|
...fileTrace.reasons.entries()
|
14
13
|
].map(async ([_path, reasons]) => {
|
@@ -16,7 +15,7 @@ const handleDependencies = async ({ appDir, serverRootDir, includeEntries, trace
|
|
16
15
|
return;
|
17
16
|
}
|
18
17
|
const filePath = await resolveTracedPath(base, _path);
|
19
|
-
if (
|
18
|
+
if (filePath.startsWith(serverRootDir) || filePath.startsWith(appDir) && !filePath.startsWith(currentProjectModules)) {
|
20
19
|
return;
|
21
20
|
}
|
22
21
|
if (!await isFile(filePath)) {
|
@@ -39,7 +38,7 @@ const handleDependencies = async ({ appDir, serverRootDir, includeEntries, trace
|
|
39
38
|
const packageJsonPath = match ? path.join(match[0], "package.json") : await pkgUp({
|
40
39
|
cwd: path.dirname(filePath)
|
41
40
|
});
|
42
|
-
if (packageJsonPath
|
41
|
+
if (packageJsonPath) {
|
43
42
|
const packageJson = await fse.readJSON(packageJsonPath);
|
44
43
|
pkgPath = baseDir = path.dirname(packageJsonPath);
|
45
44
|
subpath = path.relative(baseDir, filePath);
|
@@ -56,7 +55,7 @@ const handleDependencies = async ({ appDir, serverRootDir, includeEntries, trace
|
|
56
55
|
path: filePath,
|
57
56
|
parents,
|
58
57
|
isDirectDep: parents.some((parent) => {
|
59
|
-
return
|
58
|
+
return parent.startsWith(appDir) && !parent.startsWith(currentProjectModules);
|
60
59
|
}),
|
61
60
|
subpath,
|
62
61
|
pkgName,
|
@@ -105,18 +105,10 @@ const traceFiles = async (entryFiles, serverRootDir, base = "/") => {
|
|
105
105
|
});
|
106
106
|
};
|
107
107
|
const resolveTracedPath = async (base, p) => fse.realpath(path.resolve(base, p));
|
108
|
-
const isSubPath = (parentPath, childPath) => {
|
109
|
-
if (!parentPath || !childPath) {
|
110
|
-
return false;
|
111
|
-
}
|
112
|
-
const relative = path.relative(parentPath, childPath);
|
113
|
-
return relative && !relative.startsWith("..");
|
114
|
-
};
|
115
108
|
export {
|
116
109
|
findEntryFiles,
|
117
110
|
findPackageParents,
|
118
111
|
isFile,
|
119
|
-
isSubPath,
|
120
112
|
linkPackage,
|
121
113
|
readDirRecursive,
|
122
114
|
resolveTracedPath,
|
@@ -1 +1 @@
|
|
1
|
-
export declare function createBuilderGenerator(bundler: 'webpack' | 'rspack'): Promise<typeof import("./builder-rspack").createRspackBuilderForModern>;
|
1
|
+
export declare function createBuilderGenerator(bundler: 'webpack' | 'rspack'): Promise<typeof import("./builder-rspack/index.js").createRspackBuilderForModern>;
|
@@ -34,5 +34,4 @@ export declare const findEntryFiles: (rootDir: string, entryFilter?: ((filePath:
|
|
34
34
|
export declare const findPackageParents: (pkg: TracedPackage, version: string, tracedFiles: Record<string, TracedFile>) => string[];
|
35
35
|
export declare const traceFiles: (entryFiles: string[], serverRootDir: string, base?: string) => Promise<import("@vercel/nft").NodeFileTraceResult>;
|
36
36
|
export declare const resolveTracedPath: (base: string, p: string) => Promise<string>;
|
37
|
-
export declare const isSubPath: (parentPath: string, childPath: string) => boolean | "";
|
38
37
|
export {};
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
export default _default;
|
1
|
+
export function createHandler(): Promise<any>;
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.57.1-alpha.
|
18
|
+
"version": "2.57.1-alpha.1",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -88,25 +88,25 @@
|
|
88
88
|
"pkg-types": "^1.1.0",
|
89
89
|
"std-env": "^3.7.0",
|
90
90
|
"@modern-js/core": "2.57.0",
|
91
|
+
"@modern-js/node-bundle-require": "2.57.0",
|
91
92
|
"@modern-js/plugin": "2.57.0",
|
92
93
|
"@modern-js/plugin-i18n": "2.57.0",
|
93
94
|
"@modern-js/prod-server": "2.57.0",
|
95
|
+
"@modern-js/rsbuild-plugin-esbuild": "2.57.0",
|
94
96
|
"@modern-js/server": "2.57.0",
|
97
|
+
"@modern-js/plugin-lint": "2.57.0",
|
95
98
|
"@modern-js/server-core": "2.57.0",
|
96
|
-
"@modern-js/node-bundle-require": "2.57.0",
|
97
99
|
"@modern-js/server-utils": "2.57.0",
|
98
|
-
"@modern-js/plugin-lint": "2.57.0",
|
99
|
-
"@modern-js/rsbuild-plugin-esbuild": "2.57.0",
|
100
|
-
"@modern-js/uni-builder": "2.57.0",
|
101
100
|
"@modern-js/types": "2.57.0",
|
102
|
-
"@modern-js/
|
103
|
-
"@modern-js/
|
101
|
+
"@modern-js/utils": "2.57.0",
|
102
|
+
"@modern-js/uni-builder": "2.57.0",
|
103
|
+
"@modern-js/plugin-data-loader": "2.57.0"
|
104
104
|
},
|
105
105
|
"devDependencies": {
|
106
106
|
"@rsbuild/plugin-swc": "1.0.1-beta.3",
|
107
107
|
"@types/babel__traverse": "7.18.5",
|
108
108
|
"@types/jest": "^29",
|
109
|
-
"@types/node": "^
|
109
|
+
"@types/node": "^16",
|
110
110
|
"jest": "^29",
|
111
111
|
"ts-node": "^10.9.1",
|
112
112
|
"tsconfig-paths": "^4.2.0",
|