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