@modern-js/app-tools 2.49.1-alpha.5 → 2.49.1-alpha.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -62,6 +62,11 @@ var deploy_default = () => ({
|
|
62
62
|
}
|
63
63
|
if (deployTarget === "vercel") {
|
64
64
|
outputDirectory = import_path.default.join(appDirectory, ".vercel/output");
|
65
|
+
const config2 = {
|
66
|
+
version: 3
|
67
|
+
};
|
68
|
+
await import_utils.fs.ensureDir(outputDirectory);
|
69
|
+
await import_utils.fs.writeJSON(import_path.default.join(outputDirectory, "config.json"), config2);
|
65
70
|
funcsDirectory = import_path.default.join(outputDirectory, "functions", "index.func");
|
66
71
|
staticDirectory = import_path.default.join(outputDirectory, "static");
|
67
72
|
await import_utils.fs.ensureDir(funcsDirectory);
|
@@ -15,7 +15,7 @@ function deploy_default() {
|
|
15
15
|
return {
|
16
16
|
beforeDeploy: function beforeDeploy() {
|
17
17
|
return _async_to_generator(function() {
|
18
|
-
var deployTarget, appContext, appDirectory, distDirectory, serverInternalPlugins, sharedDirectory, apiDirectory, lambdaDirectory, metaName, configContext, outputDirectory, funcsDirectory, staticDirectory, bff,
|
18
|
+
var deployTarget, appContext, appDirectory, distDirectory, serverInternalPlugins, sharedDirectory, apiDirectory, lambdaDirectory, metaName, configContext, outputDirectory, funcsDirectory, staticDirectory, config, bff, config1, plugins, serverAppContext, code, genNodeEntry, genVercelEntry, genNetlifyEntry, _getProjectUsage, useSSR, useAPI, useWebServer, entryFilePath;
|
19
19
|
return _ts_generator(this, function(_state) {
|
20
20
|
switch (_state.label) {
|
21
21
|
case 0:
|
@@ -53,16 +53,31 @@ function deploy_default() {
|
|
53
53
|
if (!(deployTarget === "vercel"))
|
54
54
|
return [
|
55
55
|
3,
|
56
|
-
|
56
|
+
10
|
57
57
|
];
|
58
58
|
outputDirectory = path.join(appDirectory, ".vercel/output");
|
59
|
+
config = {
|
60
|
+
version: 3
|
61
|
+
};
|
62
|
+
return [
|
63
|
+
4,
|
64
|
+
fse.ensureDir(outputDirectory)
|
65
|
+
];
|
66
|
+
case 4:
|
67
|
+
_state.sent();
|
68
|
+
return [
|
69
|
+
4,
|
70
|
+
fse.writeJSON(path.join(outputDirectory, "config.json"), config)
|
71
|
+
];
|
72
|
+
case 5:
|
73
|
+
_state.sent();
|
59
74
|
funcsDirectory = path.join(outputDirectory, "functions", "index.func");
|
60
75
|
staticDirectory = path.join(outputDirectory, "static");
|
61
76
|
return [
|
62
77
|
4,
|
63
78
|
fse.ensureDir(funcsDirectory)
|
64
79
|
];
|
65
|
-
case
|
80
|
+
case 6:
|
66
81
|
_state.sent();
|
67
82
|
return [
|
68
83
|
4,
|
@@ -73,13 +88,13 @@ function deploy_default() {
|
|
73
88
|
}
|
74
89
|
})
|
75
90
|
];
|
76
|
-
case
|
91
|
+
case 7:
|
77
92
|
_state.sent();
|
78
93
|
return [
|
79
94
|
4,
|
80
95
|
fse.copy(path.join(distDirectory, "static"), staticDirectory)
|
81
96
|
];
|
82
|
-
case
|
97
|
+
case 8:
|
83
98
|
_state.sent();
|
84
99
|
return [
|
85
100
|
4,
|
@@ -91,12 +106,12 @@ function deploy_default() {
|
|
91
106
|
supportsResponseStreaming: true
|
92
107
|
})
|
93
108
|
];
|
94
|
-
case
|
109
|
+
case 9:
|
95
110
|
_state.sent();
|
96
|
-
_state.label =
|
97
|
-
case
|
111
|
+
_state.label = 10;
|
112
|
+
case 10:
|
98
113
|
bff = configContext.bff;
|
99
|
-
|
114
|
+
config1 = {
|
100
115
|
output: {
|
101
116
|
path: "."
|
102
117
|
},
|
@@ -115,99 +130,99 @@ function deploy_default() {
|
|
115
130
|
case "node":
|
116
131
|
return [
|
117
132
|
3,
|
118
|
-
|
133
|
+
11
|
119
134
|
];
|
120
135
|
case "vercel":
|
121
136
|
return [
|
122
137
|
3,
|
123
|
-
|
138
|
+
13
|
124
139
|
];
|
125
140
|
case "netlify":
|
126
141
|
return [
|
127
142
|
3,
|
128
|
-
|
143
|
+
15
|
129
144
|
];
|
130
145
|
}
|
131
146
|
return [
|
132
147
|
3,
|
133
|
-
|
148
|
+
17
|
134
149
|
];
|
135
|
-
case
|
150
|
+
case 11:
|
136
151
|
return [
|
137
152
|
4,
|
138
153
|
import("./entrys/node")
|
139
154
|
];
|
140
|
-
case
|
155
|
+
case 12:
|
141
156
|
genNodeEntry = _state.sent().genNodeEntry;
|
142
157
|
code = genNodeEntry({
|
143
158
|
plugins,
|
144
|
-
config,
|
159
|
+
config: config1,
|
145
160
|
appContext: serverAppContext
|
146
161
|
});
|
147
162
|
return [
|
148
163
|
3,
|
149
|
-
|
164
|
+
18
|
150
165
|
];
|
151
|
-
case
|
166
|
+
case 13:
|
152
167
|
return [
|
153
168
|
4,
|
154
169
|
import("./entrys/vercel")
|
155
170
|
];
|
156
|
-
case
|
171
|
+
case 14:
|
157
172
|
genVercelEntry = _state.sent().genVercelEntry;
|
158
173
|
code = genVercelEntry({
|
159
174
|
plugins,
|
160
|
-
config,
|
175
|
+
config: config1,
|
161
176
|
appContext: serverAppContext
|
162
177
|
});
|
163
178
|
return [
|
164
179
|
3,
|
165
|
-
|
180
|
+
18
|
166
181
|
];
|
167
|
-
case
|
182
|
+
case 15:
|
168
183
|
return [
|
169
184
|
4,
|
170
185
|
import("./entrys/netlify")
|
171
186
|
];
|
172
|
-
case
|
187
|
+
case 16:
|
173
188
|
genNetlifyEntry = _state.sent().genNetlifyEntry;
|
174
189
|
code = genNetlifyEntry({
|
175
190
|
plugins,
|
176
|
-
config,
|
191
|
+
config: config1,
|
177
192
|
appContext: serverAppContext
|
178
193
|
});
|
179
194
|
return [
|
180
195
|
3,
|
181
|
-
|
196
|
+
18
|
182
197
|
];
|
183
|
-
case
|
198
|
+
case 17:
|
184
199
|
{
|
185
200
|
code = 'throw new Error("unknown deploy target, MODERNJS_DEPLOY should be set");';
|
186
201
|
}
|
187
|
-
_state.label =
|
188
|
-
case
|
202
|
+
_state.label = 18;
|
203
|
+
case 18:
|
189
204
|
_getProjectUsage = getProjectUsage(appDirectory, distDirectory), useSSR = _getProjectUsage.useSSR, useAPI = _getProjectUsage.useAPI, useWebServer = _getProjectUsage.useWebServer;
|
190
205
|
entryFilePath = path.join(funcsDirectory, "index.js");
|
191
206
|
if (!(useSSR || useAPI || useWebServer))
|
192
207
|
return [
|
193
208
|
3,
|
194
|
-
|
209
|
+
20
|
195
210
|
];
|
196
211
|
return [
|
197
212
|
4,
|
198
213
|
fse.writeFile(entryFilePath, code)
|
199
214
|
];
|
200
|
-
case
|
215
|
+
case 19:
|
201
216
|
_state.sent();
|
202
|
-
_state.label =
|
203
|
-
case
|
217
|
+
_state.label = 20;
|
218
|
+
case 20:
|
204
219
|
return [
|
205
220
|
4,
|
206
221
|
handleDependencies(appDirectory, funcsDirectory, [
|
207
222
|
"@modern-js/prod-server"
|
208
223
|
])
|
209
224
|
];
|
210
|
-
case
|
225
|
+
case 21:
|
211
226
|
_state.sent();
|
212
227
|
return [
|
213
228
|
2
|
@@ -29,6 +29,11 @@ var deploy_default = () => ({
|
|
29
29
|
}
|
30
30
|
if (deployTarget === "vercel") {
|
31
31
|
outputDirectory = path.join(appDirectory, ".vercel/output");
|
32
|
+
const config2 = {
|
33
|
+
version: 3
|
34
|
+
};
|
35
|
+
await fse.ensureDir(outputDirectory);
|
36
|
+
await fse.writeJSON(path.join(outputDirectory, "config.json"), config2);
|
32
37
|
funcsDirectory = path.join(outputDirectory, "functions", "index.func");
|
33
38
|
staticDirectory = path.join(outputDirectory, "static");
|
34
39
|
await fse.ensureDir(funcsDirectory);
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.49.1-alpha.
|
18
|
+
"version": "2.49.1-alpha.6",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/index.d.ts",
|
21
21
|
"main": "./dist/cjs/index.js",
|
@@ -79,20 +79,20 @@
|
|
79
79
|
"esbuild-register": "^3.5.0",
|
80
80
|
"mlly": "^1.6.1",
|
81
81
|
"pkg-types": "^1.1.0",
|
82
|
-
"@modern-js/plugin": "2.49.0",
|
83
82
|
"@modern-js/core": "2.49.0",
|
83
|
+
"@modern-js/plugin": "2.49.0",
|
84
84
|
"@modern-js/plugin-i18n": "2.49.0",
|
85
|
-
"@modern-js/node-bundle-require": "2.49.0",
|
86
85
|
"@modern-js/plugin-lint": "2.49.0",
|
87
|
-
"@modern-js/prod-server": "2.49.0",
|
88
|
-
"@modern-js/rsbuild-plugin-esbuild": "2.49.1",
|
89
86
|
"@modern-js/server": "2.49.0",
|
87
|
+
"@modern-js/prod-server": "2.49.0",
|
90
88
|
"@modern-js/server-core": "2.49.0",
|
91
89
|
"@modern-js/server-utils": "2.49.0",
|
92
|
-
"@modern-js/uni-builder": "2.49.0",
|
93
|
-
"@modern-js/utils": "2.49.0",
|
94
90
|
"@modern-js/types": "2.49.0",
|
95
|
-
"@modern-js/plugin-
|
91
|
+
"@modern-js/rsbuild-plugin-esbuild": "2.49.1",
|
92
|
+
"@modern-js/utils": "2.49.0",
|
93
|
+
"@modern-js/node-bundle-require": "2.49.0",
|
94
|
+
"@modern-js/plugin-data-loader": "2.49.0",
|
95
|
+
"@modern-js/uni-builder": "2.49.0"
|
96
96
|
},
|
97
97
|
"devDependencies": {
|
98
98
|
"@rsbuild/plugin-swc": "0.6.4",
|