@modern-js/app-tools 3.1.0 → 3.1.1
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/plugins/deploy/platforms/templates/netlify-entry.cjs +1 -1
- package/dist/cjs/plugins/deploy/utils/generator.js +4 -3
- package/dist/esm/builder/generator/createCopyPattern.mjs +1 -1
- package/dist/esm/builder/index.mjs +3 -3
- package/dist/esm/builder/shared/loaders/serverModuleLoader.mjs +1 -1
- package/dist/esm/index.mjs +9 -8
- package/dist/esm/plugins/analyze/index.mjs +2 -2
- package/dist/esm/plugins/deploy/index.mjs +1 -1
- package/dist/esm/plugins/deploy/platforms/templates/netlify-entry.cjs +1 -1
- package/dist/esm/plugins/deploy/utils/generator.mjs +4 -3
- package/dist/esm/plugins/initialize/index.mjs +1 -1
- package/dist/esm/plugins/serverBuild.mjs +1 -1
- package/dist/esm/plugins/serverRuntime.mjs +1 -1
- package/dist/esm-node/builder/generator/createCopyPattern.mjs +1 -1
- package/dist/esm-node/builder/index.mjs +3 -3
- package/dist/esm-node/builder/shared/loaders/serverModuleLoader.mjs +1 -1
- package/dist/esm-node/index.mjs +9 -8
- package/dist/esm-node/plugins/analyze/index.mjs +1 -1
- package/dist/esm-node/plugins/deploy/index.mjs +1 -1
- package/dist/esm-node/plugins/deploy/platforms/templates/netlify-entry.cjs +1 -1
- package/dist/esm-node/plugins/deploy/utils/generator.mjs +4 -3
- package/dist/esm-node/plugins/initialize/index.mjs +1 -1
- package/dist/esm-node/plugins/serverBuild.mjs +1 -1
- package/dist/esm-node/plugins/serverRuntime.mjs +1 -1
- package/dist/types/plugins/deploy/platforms/templates/netlify-entry.d.cts +2 -1
- package/package.json +12 -12
- package/{rstest.config.ts → rstest.config.mts} +0 -4
|
@@ -46,10 +46,11 @@ const lodash_namespaceObject = require("@modern-js/utils/lodash");
|
|
|
46
46
|
const external_index_js_namespaceObject = require("./index.js");
|
|
47
47
|
const serverAppContextTemplate = (appContext)=>{
|
|
48
48
|
const { appDirectory, sharedDirectory, apiDirectory, lambdaDirectory, metaName, bffRuntimeFramework } = appContext;
|
|
49
|
+
const getRelativePathTemplate = (targetDirectory)=>`path.join(__dirname, ${JSON.stringify((0, external_index_js_namespaceObject.normalizePath)(external_node_path_default().relative(appDirectory, targetDirectory)))})`;
|
|
49
50
|
return {
|
|
50
|
-
sharedDirectory:
|
|
51
|
-
apiDirectory:
|
|
52
|
-
lambdaDirectory:
|
|
51
|
+
sharedDirectory: getRelativePathTemplate(sharedDirectory),
|
|
52
|
+
apiDirectory: getRelativePathTemplate(apiDirectory),
|
|
53
|
+
lambdaDirectory: getRelativePathTemplate(lambdaDirectory),
|
|
53
54
|
metaName,
|
|
54
55
|
bffRuntimeFramework: bffRuntimeFramework || 'hono'
|
|
55
56
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { parseRspackConfig } from "@modern-js/builder";
|
|
2
|
-
import { builderPluginAdapterBasic, builderPluginAdapterHooks } from "./shared/builderPlugins/index.mjs";
|
|
3
1
|
async function createBuilderGenerator() {
|
|
4
2
|
const { createRspackBuilderForModern } = await import("./builder-rspack/index.mjs");
|
|
5
3
|
return createRspackBuilderForModern;
|
|
6
4
|
}
|
|
7
|
-
export {
|
|
5
|
+
export { parseRspackConfig } from "@modern-js/builder";
|
|
6
|
+
export { builderPluginAdapterBasic, builderPluginAdapterHooks } from "./shared/builderPlugins/index.mjs";
|
|
7
|
+
export { createBuilderGenerator };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from "./defineConfig.mjs";
|
|
2
|
+
export * from "./types/index.mjs";
|
|
1
3
|
import path from "path";
|
|
2
4
|
import { castArray } from "@modern-js/builder";
|
|
3
5
|
import { getLocaleLanguage } from "@modern-js/i18n-utils/language-detector";
|
|
@@ -15,13 +17,6 @@ import serverRuntime from "./plugins/serverRuntime.mjs";
|
|
|
15
17
|
import { generateWatchFiles } from "./utils/generateWatchFiles.mjs";
|
|
16
18
|
import { initAppContext } from "./utils/initAppContext.mjs";
|
|
17
19
|
import { restart } from "./utils/restart.mjs";
|
|
18
|
-
import { defineConfig } from "./defineConfig.mjs";
|
|
19
|
-
import { dev } from "./commands/dev.mjs";
|
|
20
|
-
import { serve } from "./commands/serve.mjs";
|
|
21
|
-
import { resolveModernRsbuildConfig } from "./rsbuild.mjs";
|
|
22
|
-
import { mergeConfig } from "@modern-js/plugin/cli";
|
|
23
|
-
export * from "./defineConfig.mjs";
|
|
24
|
-
export * from "./types/index.mjs";
|
|
25
20
|
const appTools = ()=>({
|
|
26
21
|
name: '@modern-js/app-tools',
|
|
27
22
|
usePlugins: [
|
|
@@ -120,4 +115,10 @@ const appTools = ()=>({
|
|
|
120
115
|
}
|
|
121
116
|
});
|
|
122
117
|
const src = appTools;
|
|
123
|
-
export {
|
|
118
|
+
export { defineConfig } from "./defineConfig.mjs";
|
|
119
|
+
export { dev } from "./commands/dev.mjs";
|
|
120
|
+
export { serve } from "./commands/serve.mjs";
|
|
121
|
+
export { resolveModernRsbuildConfig } from "./rsbuild.mjs";
|
|
122
|
+
export { mergeConfig } from "@modern-js/plugin/cli";
|
|
123
|
+
export default src;
|
|
124
|
+
export { appTools, generateWatchFiles, initAppContext };
|
|
@@ -174,7 +174,7 @@ const analyze = ()=>({
|
|
|
174
174
|
const getFlattenedPlugins = async (pluginOptions)=>{
|
|
175
175
|
let plugins = pluginOptions;
|
|
176
176
|
do plugins = (await Promise.all(plugins)).flat(1 / 0);
|
|
177
|
-
while (plugins.some((v)=>isPromise(v)))
|
|
177
|
+
while (plugins.some((v)=>isPromise(v)))
|
|
178
178
|
return plugins;
|
|
179
179
|
};
|
|
180
180
|
if (resolvedConfig.builderPlugins) {
|
|
@@ -200,4 +200,4 @@ const analyze = ()=>({
|
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
202
|
});
|
|
203
|
-
export
|
|
203
|
+
export default analyze;
|
|
@@ -4,10 +4,11 @@ import { merge } from "@modern-js/utils/lodash";
|
|
|
4
4
|
import { normalizePath } from "./index.mjs";
|
|
5
5
|
const serverAppContextTemplate = (appContext)=>{
|
|
6
6
|
const { appDirectory, sharedDirectory, apiDirectory, lambdaDirectory, metaName, bffRuntimeFramework } = appContext;
|
|
7
|
+
const getRelativePathTemplate = (targetDirectory)=>`path.join(__dirname, ${JSON.stringify(normalizePath(node_path.relative(appDirectory, targetDirectory)))})`;
|
|
7
8
|
return {
|
|
8
|
-
sharedDirectory:
|
|
9
|
-
apiDirectory:
|
|
10
|
-
lambdaDirectory:
|
|
9
|
+
sharedDirectory: getRelativePathTemplate(sharedDirectory),
|
|
10
|
+
apiDirectory: getRelativePathTemplate(apiDirectory),
|
|
11
|
+
lambdaDirectory: getRelativePathTemplate(lambdaDirectory),
|
|
11
12
|
metaName,
|
|
12
13
|
bffRuntimeFramework: bffRuntimeFramework || 'hono'
|
|
13
14
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import { parseRspackConfig } from "@modern-js/builder";
|
|
3
|
-
import { builderPluginAdapterBasic, builderPluginAdapterHooks } from "./shared/builderPlugins/index.mjs";
|
|
4
2
|
async function createBuilderGenerator() {
|
|
5
3
|
const { createRspackBuilderForModern } = await import("./builder-rspack/index.mjs");
|
|
6
4
|
return createRspackBuilderForModern;
|
|
7
5
|
}
|
|
8
|
-
export {
|
|
6
|
+
export { parseRspackConfig } from "@modern-js/builder";
|
|
7
|
+
export { builderPluginAdapterBasic, builderPluginAdapterHooks } from "./shared/builderPlugins/index.mjs";
|
|
8
|
+
export { createBuilderGenerator };
|
package/dist/esm-node/index.mjs
CHANGED
|
@@ -1,5 +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
|
+
export * from "./defineConfig.mjs";
|
|
4
|
+
export * from "./types/index.mjs";
|
|
3
5
|
import path from "path";
|
|
4
6
|
import { castArray } from "@modern-js/builder";
|
|
5
7
|
import { getLocaleLanguage } from "@modern-js/i18n-utils/language-detector";
|
|
@@ -17,13 +19,6 @@ import serverRuntime from "./plugins/serverRuntime.mjs";
|
|
|
17
19
|
import { generateWatchFiles } from "./utils/generateWatchFiles.mjs";
|
|
18
20
|
import { initAppContext } from "./utils/initAppContext.mjs";
|
|
19
21
|
import { restart } from "./utils/restart.mjs";
|
|
20
|
-
import { defineConfig } from "./defineConfig.mjs";
|
|
21
|
-
import { dev } from "./commands/dev.mjs";
|
|
22
|
-
import { serve } from "./commands/serve.mjs";
|
|
23
|
-
import { resolveModernRsbuildConfig } from "./rsbuild.mjs";
|
|
24
|
-
import { mergeConfig } from "@modern-js/plugin/cli";
|
|
25
|
-
export * from "./defineConfig.mjs";
|
|
26
|
-
export * from "./types/index.mjs";
|
|
27
22
|
const appTools = ()=>({
|
|
28
23
|
name: '@modern-js/app-tools',
|
|
29
24
|
usePlugins: [
|
|
@@ -122,4 +117,10 @@ const appTools = ()=>({
|
|
|
122
117
|
}
|
|
123
118
|
});
|
|
124
119
|
const src = appTools;
|
|
125
|
-
export {
|
|
120
|
+
export { defineConfig } from "./defineConfig.mjs";
|
|
121
|
+
export { dev } from "./commands/dev.mjs";
|
|
122
|
+
export { serve } from "./commands/serve.mjs";
|
|
123
|
+
export { resolveModernRsbuildConfig } from "./rsbuild.mjs";
|
|
124
|
+
export { mergeConfig } from "@modern-js/plugin/cli";
|
|
125
|
+
export default src;
|
|
126
|
+
export { appTools, generateWatchFiles, initAppContext };
|
|
@@ -5,10 +5,11 @@ import { merge } from "@modern-js/utils/lodash";
|
|
|
5
5
|
import { normalizePath } from "./index.mjs";
|
|
6
6
|
const serverAppContextTemplate = (appContext)=>{
|
|
7
7
|
const { appDirectory, sharedDirectory, apiDirectory, lambdaDirectory, metaName, bffRuntimeFramework } = appContext;
|
|
8
|
+
const getRelativePathTemplate = (targetDirectory)=>`path.join(__dirname, ${JSON.stringify(normalizePath(node_path.relative(appDirectory, targetDirectory)))})`;
|
|
8
9
|
return {
|
|
9
|
-
sharedDirectory:
|
|
10
|
-
apiDirectory:
|
|
11
|
-
lambdaDirectory:
|
|
10
|
+
sharedDirectory: getRelativePathTemplate(sharedDirectory),
|
|
11
|
+
apiDirectory: getRelativePathTemplate(apiDirectory),
|
|
12
|
+
lambdaDirectory: getRelativePathTemplate(lambdaDirectory),
|
|
12
13
|
metaName,
|
|
13
14
|
bffRuntimeFramework: bffRuntimeFramework || 'hono'
|
|
14
15
|
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export default handler;
|
|
2
|
+
declare function handler(request: any, context: any): Promise<any>;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.1.
|
|
18
|
+
"version": "3.1.1",
|
|
19
19
|
"types": "./dist/types/index.d.ts",
|
|
20
20
|
"main": "./dist/cjs/index.js",
|
|
21
21
|
"exports": {
|
|
@@ -94,19 +94,19 @@
|
|
|
94
94
|
"ndepe": "^0.1.13",
|
|
95
95
|
"pkg-types": "^1.3.1",
|
|
96
96
|
"std-env": "^3.10.0",
|
|
97
|
-
"@modern-js/builder": "3.1.
|
|
98
|
-
"@modern-js/i18n-utils": "3.1.
|
|
99
|
-
"@modern-js/plugin": "3.1.
|
|
100
|
-
"@modern-js/plugin-data-loader": "3.1.
|
|
101
|
-
"@modern-js/prod-server": "3.1.
|
|
102
|
-
"@modern-js/server": "3.1.
|
|
103
|
-
"@modern-js/server-utils": "3.1.
|
|
104
|
-
"@modern-js/server-core": "3.1.
|
|
105
|
-
"@modern-js/
|
|
106
|
-
"@modern-js/
|
|
97
|
+
"@modern-js/builder": "3.1.1",
|
|
98
|
+
"@modern-js/i18n-utils": "3.1.1",
|
|
99
|
+
"@modern-js/plugin": "3.1.1",
|
|
100
|
+
"@modern-js/plugin-data-loader": "3.1.1",
|
|
101
|
+
"@modern-js/prod-server": "3.1.1",
|
|
102
|
+
"@modern-js/server": "3.1.1",
|
|
103
|
+
"@modern-js/server-utils": "3.1.1",
|
|
104
|
+
"@modern-js/server-core": "3.1.1",
|
|
105
|
+
"@modern-js/utils": "3.1.1",
|
|
106
|
+
"@modern-js/types": "3.1.1"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@rslib/core": "0.
|
|
109
|
+
"@rslib/core": "0.20.0",
|
|
110
110
|
"@types/babel__traverse": "7.28.0",
|
|
111
111
|
"@types/node": "^20",
|
|
112
112
|
"ts-node": "^10.9.2",
|