@modern-js/app-tools 2.57.2-alpha.0 → 2.58.0
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/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 +0 -19
- package/dist/cjs/commands/dev.js +0 -9
- package/dist/cjs/commands/index.js +8 -8
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/plugins/analyze/index.js +3 -3
- package/dist/cjs/plugins/deploy/dependencies/index.js +0 -1
- package/dist/cjs/plugins/deploy/dependencies/utils.js +0 -11
- package/dist/cjs/plugins/deploy/platforms/netlify.js +5 -14
- package/dist/cjs/plugins/deploy/platforms/{netlify-handler.js → netlifyEntry.js} +4 -6
- package/dist/cjs/plugins/deploy/platforms/node.js +4 -13
- package/dist/cjs/plugins/deploy/platforms/vercel.js +5 -14
- package/dist/cjs/plugins/deploy/platforms/{vercel-handler.js → vercelEntry.js} +1 -27
- package/dist/cjs/utils/config.js +1 -1
- package/dist/cjs/utils/loadPlugins.js +1 -1
- package/dist/cjs/utils/register.js +22 -49
- package/dist/esm/builder/builder-rspack/adapterCopy.js +4 -3
- package/dist/esm/builder/generator/getBuilderEnvironments.js +2 -0
- 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 +16 -9
- package/dist/esm/commands/dev.js +55 -37
- package/dist/esm/commands/index.js +7 -7
- package/dist/esm/index.js +1 -42
- package/dist/esm/plugins/analyze/index.js +10 -6
- package/dist/esm/plugins/deploy/dependencies/index.js +16 -8
- package/dist/esm/plugins/deploy/dependencies/utils.js +15 -7
- package/dist/esm/utils/createServer.js +1 -1
- package/dist/esm-node/builder/builder-rspack/adapterCopy.js +2 -2
- 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 +3 -0
- package/dist/esm-node/commands/dev.js +24 -16
- package/dist/esm-node/commands/index.js +7 -7
- package/dist/esm-node/index.js +1 -17
- package/dist/esm-node/plugins/analyze/index.js +7 -5
- package/dist/esm-node/plugins/deploy/dependencies/index.js +15 -7
- package/dist/esm-node/plugins/deploy/dependencies/utils.js +11 -2
- package/dist/esm-node/utils/createServer.js +1 -1
- package/dist/types/builder/index.d.ts +1 -1
- package/dist/types/plugins/deploy/platforms/netlifyEntry.d.ts +2 -0
- package/dist/types/plugins/deploy/platforms/vercelEntry.d.ts +2 -0
- package/package.json +18 -18
- package/dist/cjs/esm/esbuild-loader.mjs +0 -20
- package/dist/cjs/esm/register-esm.mjs +0 -65
- package/dist/cjs/esm/ts-node-loader.mjs +0 -21
- package/dist/cjs/esm/utils.mjs +0 -43
- package/dist/cjs/plugins/deploy/platforms/netlify-entry.js +0 -3
- package/dist/cjs/plugins/deploy/platforms/netlify-entry.mjs +0 -1
- package/dist/cjs/plugins/deploy/platforms/vercel-entry.js +0 -3
- package/dist/cjs/plugins/deploy/platforms/vercel-entry.mjs +0 -3
- package/dist/esm/custom-loader.mjs +0 -41
- package/dist/esm/register-esm.mjs +0 -22
- package/dist/esm-node/esm/esbuild-loader.js +0 -39
- package/dist/esm-node/esm/register-esm.js +0 -39
- package/dist/esm-node/esm/ts-node-loader.js +0 -42
- package/dist/types/esm/esbuild-loader.d.mts +0 -6
- package/dist/types/esm/register-esm.d.mts +0 -5
- package/dist/types/esm/ts-node-loader.d.mts +0 -6
- package/dist/types/esm/utils.d.mts +0 -6
- package/dist/types/plugins/deploy/platforms/netlify-entry.d.cts +0 -1
- package/dist/types/plugins/deploy/platforms/netlify-entry.d.mts +0 -1
- package/dist/types/plugins/deploy/platforms/netlify-handler.d.cts +0 -1
- package/dist/types/plugins/deploy/platforms/vercel-entry.d.cts +0 -2
- package/dist/types/plugins/deploy/platforms/vercel-entry.d.mts +0 -2
- package/dist/types/plugins/deploy/platforms/vercel-handler.d.cts +0 -1
- /package/dist/cjs/plugins/deploy/platforms/{node-entry.js → nodeEntry.js} +0 -0
- /package/dist/types/plugins/deploy/platforms/{node-entry.d.ts → nodeEntry.d.ts} +0 -0
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default handler;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { handler as default } from "./netlify-handler.cjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function handler(request: any, context: any): Promise<any>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function handler(req: any, res: any): Promise<any>;
|
|
File without changes
|
|
File without changes
|