@modern-js/app-tools 2.49.3-alpha.19 → 2.49.3-alpha.20
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/netlify.js +4 -0
- package/dist/cjs/plugins/deploy/platforms/vercel.js +2 -0
- package/dist/esm/plugins/deploy/platforms/netlify.js +21 -1
- package/dist/esm/plugins/deploy/platforms/vercel.js +13 -1
- package/dist/esm-node/plugins/deploy/platforms/netlify.js +4 -0
- package/dist/esm-node/plugins/deploy/platforms/vercel.js +2 -0
- package/package.json +10 -10
|
@@ -104,9 +104,13 @@ const createNetlifyPreset = (appContext, modernConfig, needModernServer) => {
|
|
|
104
104
|
const serverAppContext = (0, import_utils2.serverAppContenxtTemplate)(appContext);
|
|
105
105
|
entryCode = entryCode.replace("p_genPluginImportsCode", pluginImportCode).replace("p_ROUTE_SPEC_FILE", `"${import_utils.ROUTE_SPEC_FILE}"`).replace("p_dynamicProdOptions", JSON.stringify(dynamicProdOptions)).replace("p_sharedDirectory", serverAppContext.sharedDirectory).replace("p_apiDirectory", serverAppContext.apiDirectory).replace("p_lambdaDirectory", serverAppContext.lambdaDirectory);
|
|
106
106
|
await import_utils.fs.writeFile(entryFilePath, entryCode);
|
|
107
|
+
},
|
|
108
|
+
async end() {
|
|
107
109
|
await (0, import_dependencies.handleDependencies)(appDirectory, funcsDirectory, [
|
|
108
110
|
"@modern-js/prod-server"
|
|
109
111
|
]);
|
|
112
|
+
const netlifyNodeModules = import_node_path.default.join(netlifyOutput, "node_modules");
|
|
113
|
+
await import_utils.fs.move(import_node_path.default.join(funcsDirectory, "node_modules"), netlifyNodeModules);
|
|
110
114
|
}
|
|
111
115
|
};
|
|
112
116
|
};
|
|
@@ -131,6 +131,8 @@ const createVercelPreset = (appContext, modernConfig, needModernServer) => {
|
|
|
131
131
|
let entryCode = (await import_utils.fs.readFile(import_node_path.default.join(__dirname, "./vercelEntry.js"))).toString();
|
|
132
132
|
entryCode = entryCode.replace("p_genPluginImportsCode", pluginImportCode).replace("p_ROUTE_SPEC_FILE", `"${import_utils.ROUTE_SPEC_FILE}"`).replace("p_dynamicProdOptions", JSON.stringify(dynamicProdOptions)).replace("p_sharedDirectory", serverAppContext.sharedDirectory).replace("p_apiDirectory", serverAppContext.apiDirectory).replace("p_lambdaDirectory", serverAppContext.lambdaDirectory);
|
|
133
133
|
await import_utils.fs.writeFile(entryFilePath, entryCode);
|
|
134
|
+
},
|
|
135
|
+
async end() {
|
|
134
136
|
await (0, import_dependencies.handleDependencies)(appDirectory, funcsDirectory, [
|
|
135
137
|
"@modern-js/prod-server"
|
|
136
138
|
]);
|
|
@@ -140,13 +140,33 @@ var createNetlifyPreset = function(appContext, modernConfig, needModernServer) {
|
|
|
140
140
|
];
|
|
141
141
|
case 2:
|
|
142
142
|
_state.sent();
|
|
143
|
+
return [
|
|
144
|
+
2
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
})();
|
|
149
|
+
},
|
|
150
|
+
end: function end() {
|
|
151
|
+
return _async_to_generator(function() {
|
|
152
|
+
var netlifyNodeModules;
|
|
153
|
+
return _ts_generator(this, function(_state) {
|
|
154
|
+
switch (_state.label) {
|
|
155
|
+
case 0:
|
|
143
156
|
return [
|
|
144
157
|
4,
|
|
145
158
|
handleDependencies(appDirectory, funcsDirectory, [
|
|
146
159
|
"@modern-js/prod-server"
|
|
147
160
|
])
|
|
148
161
|
];
|
|
149
|
-
case
|
|
162
|
+
case 1:
|
|
163
|
+
_state.sent();
|
|
164
|
+
netlifyNodeModules = path.join(netlifyOutput, "node_modules");
|
|
165
|
+
return [
|
|
166
|
+
4,
|
|
167
|
+
fse.move(path.join(funcsDirectory, "node_modules"), netlifyNodeModules)
|
|
168
|
+
];
|
|
169
|
+
case 2:
|
|
150
170
|
_state.sent();
|
|
151
171
|
return [
|
|
152
172
|
2
|
|
@@ -186,13 +186,25 @@ var createVercelPreset = function(appContext, modernConfig, needModernServer) {
|
|
|
186
186
|
];
|
|
187
187
|
case 2:
|
|
188
188
|
_state.sent();
|
|
189
|
+
return [
|
|
190
|
+
2
|
|
191
|
+
];
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
})();
|
|
195
|
+
},
|
|
196
|
+
end: function end() {
|
|
197
|
+
return _async_to_generator(function() {
|
|
198
|
+
return _ts_generator(this, function(_state) {
|
|
199
|
+
switch (_state.label) {
|
|
200
|
+
case 0:
|
|
189
201
|
return [
|
|
190
202
|
4,
|
|
191
203
|
handleDependencies(appDirectory, funcsDirectory, [
|
|
192
204
|
"@modern-js/prod-server"
|
|
193
205
|
])
|
|
194
206
|
];
|
|
195
|
-
case
|
|
207
|
+
case 1:
|
|
196
208
|
_state.sent();
|
|
197
209
|
return [
|
|
198
210
|
2
|
|
@@ -71,9 +71,13 @@ const createNetlifyPreset = (appContext, modernConfig, needModernServer) => {
|
|
|
71
71
|
const serverAppContext = serverAppContenxtTemplate(appContext);
|
|
72
72
|
entryCode = entryCode.replace("p_genPluginImportsCode", pluginImportCode).replace("p_ROUTE_SPEC_FILE", `"${ROUTE_SPEC_FILE}"`).replace("p_dynamicProdOptions", JSON.stringify(dynamicProdOptions)).replace("p_sharedDirectory", serverAppContext.sharedDirectory).replace("p_apiDirectory", serverAppContext.apiDirectory).replace("p_lambdaDirectory", serverAppContext.lambdaDirectory);
|
|
73
73
|
await fse.writeFile(entryFilePath, entryCode);
|
|
74
|
+
},
|
|
75
|
+
async end() {
|
|
74
76
|
await handleDependencies(appDirectory, funcsDirectory, [
|
|
75
77
|
"@modern-js/prod-server"
|
|
76
78
|
]);
|
|
79
|
+
const netlifyNodeModules = path.join(netlifyOutput, "node_modules");
|
|
80
|
+
await fse.move(path.join(funcsDirectory, "node_modules"), netlifyNodeModules);
|
|
77
81
|
}
|
|
78
82
|
};
|
|
79
83
|
};
|
|
@@ -98,6 +98,8 @@ const createVercelPreset = (appContext, modernConfig, needModernServer) => {
|
|
|
98
98
|
let entryCode = (await fse.readFile(path.join(__dirname, "./vercelEntry.js"))).toString();
|
|
99
99
|
entryCode = entryCode.replace("p_genPluginImportsCode", pluginImportCode).replace("p_ROUTE_SPEC_FILE", `"${ROUTE_SPEC_FILE}"`).replace("p_dynamicProdOptions", JSON.stringify(dynamicProdOptions)).replace("p_sharedDirectory", serverAppContext.sharedDirectory).replace("p_apiDirectory", serverAppContext.apiDirectory).replace("p_lambdaDirectory", serverAppContext.lambdaDirectory);
|
|
100
100
|
await fse.writeFile(entryFilePath, entryCode);
|
|
101
|
+
},
|
|
102
|
+
async end() {
|
|
101
103
|
await handleDependencies(appDirectory, funcsDirectory, [
|
|
102
104
|
"@modern-js/prod-server"
|
|
103
105
|
]);
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.49.3-alpha.
|
|
18
|
+
"version": "2.49.3-alpha.20",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -80,20 +80,20 @@
|
|
|
80
80
|
"mlly": "^1.6.1",
|
|
81
81
|
"pkg-types": "^1.1.0",
|
|
82
82
|
"std-env": "^3.7.0",
|
|
83
|
-
"@modern-js/
|
|
84
|
-
"@modern-js/plugin-data-loader": "2.49.3",
|
|
83
|
+
"@modern-js/plugin": "2.49.3",
|
|
85
84
|
"@modern-js/plugin-i18n": "2.49.3",
|
|
86
85
|
"@modern-js/core": "2.49.3",
|
|
87
|
-
"@modern-js/
|
|
88
|
-
"@modern-js/
|
|
86
|
+
"@modern-js/plugin-lint": "2.49.3",
|
|
87
|
+
"@modern-js/prod-server": "2.49.4-alpha.1",
|
|
89
88
|
"@modern-js/server-core": "2.49.3",
|
|
89
|
+
"@modern-js/rsbuild-plugin-esbuild": "2.49.3",
|
|
90
90
|
"@modern-js/node-bundle-require": "2.49.3",
|
|
91
|
-
"@modern-js/server": "2.49.3",
|
|
92
|
-
"@modern-js/uni-builder": "2.49.3",
|
|
93
|
-
"@modern-js/plugin-lint": "2.49.3",
|
|
94
|
-
"@modern-js/server-utils": "2.49.3",
|
|
95
91
|
"@modern-js/types": "2.49.3",
|
|
96
|
-
"@modern-js/utils": "2.49.3"
|
|
92
|
+
"@modern-js/server-utils": "2.49.3",
|
|
93
|
+
"@modern-js/uni-builder": "2.49.3",
|
|
94
|
+
"@modern-js/utils": "2.49.3",
|
|
95
|
+
"@modern-js/plugin-data-loader": "2.49.3",
|
|
96
|
+
"@modern-js/server": "2.49.3"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@rsbuild/plugin-swc": "0.6.15",
|