@chuckcchen/vite-plugin 0.0.2 → 0.0.4
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/bundler.d.ts +27 -27
- package/dist/bundler.js +89 -89
- package/dist/bundler.js.map +1 -1
- package/dist/core.d.ts +14 -14
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +179 -150
- package/dist/core.js.map +1 -1
- package/dist/factory.d.ts +124 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +264 -0
- package/dist/factory.js.map +1 -0
- package/dist/helpers.d.ts +40 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +166 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +8 -75
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -56
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +113 -113
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -3
- package/dist/utils.d.ts +56 -56
- package/dist/utils.js +68 -68
- package/dist/utils.js.map +1 -1
- package/package.json +2 -1
package/dist/core.js
CHANGED
|
@@ -1,101 +1,111 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* EdgeOne Vite Plugin Adapter -
|
|
2
|
+
* EdgeOne Vite Plugin Adapter - Core Plugin Module
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* -
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
9
|
-
* - Meta.json
|
|
4
|
+
* This module is the core of the adapter system, responsible for:
|
|
5
|
+
* - Build artifacts detection: Auto-detect client and server build outputs
|
|
6
|
+
* - Static assets copying: Copy client build artifacts to deployment directory
|
|
7
|
+
* - Server code bundling: Bundle server code into a single file
|
|
8
|
+
* - Route config generation: Generate route info based on framework features
|
|
9
|
+
* - Meta.json generation: Generate configuration file for EdgeOne deployment
|
|
10
10
|
*/
|
|
11
11
|
import path from "path";
|
|
12
12
|
import { createLogger, pathExists, copyDirectory, ensureDirectory, writeFile, } from "./utils.js";
|
|
13
13
|
import { bundleServerCode, createServerWrapper, cleanupWrapper, } from "./bundler.js";
|
|
14
14
|
import fs from "fs/promises";
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Create EdgeOne core adapter plugin
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* This is the main entry function for creating adapters, returns a Vite plugin instance.
|
|
19
|
+
* The plugin executes after Vite build completes, processing build artifacts and generating deployment config.
|
|
20
20
|
*
|
|
21
|
-
* @param options -
|
|
22
|
-
* @returns Vite
|
|
21
|
+
* @param options - Adapter configuration options
|
|
22
|
+
* @returns Vite plugin instance
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
|
-
* //
|
|
25
|
+
* // Basic usage
|
|
26
26
|
* createCoreAdapter({ verbose: true })
|
|
27
27
|
*
|
|
28
28
|
* @example
|
|
29
|
-
* //
|
|
29
|
+
* // Using framework adapter
|
|
30
30
|
* createCoreAdapter({
|
|
31
31
|
* adapter: myFrameworkAdapter,
|
|
32
32
|
* outputDir: '.edgeone'
|
|
33
33
|
* })
|
|
34
34
|
*/
|
|
35
35
|
export function createCoreAdapter(options = {}) {
|
|
36
|
-
//
|
|
37
|
-
const { verbose = false, //
|
|
38
|
-
outputDir = ".edgeone", //
|
|
39
|
-
cleanOutput = true, //
|
|
40
|
-
adapter, //
|
|
41
|
-
hooks = {}, //
|
|
42
|
-
ssr: ssrOption, // SSR
|
|
36
|
+
// Destructure config options with defaults
|
|
37
|
+
const { verbose = false, // Enable verbose logging
|
|
38
|
+
outputDir = ".edgeone", // Output directory
|
|
39
|
+
cleanOutput = true, // Clean output directory before build
|
|
40
|
+
adapter, // Framework adapter instance
|
|
41
|
+
hooks = {}, // Custom hook functions
|
|
42
|
+
ssr: ssrOption, // SSR mode configuration
|
|
43
43
|
} = options;
|
|
44
|
-
//
|
|
44
|
+
// Create logger instance
|
|
45
45
|
const logger = createLogger(verbose);
|
|
46
|
-
//
|
|
47
|
-
let projectRoot; //
|
|
48
|
-
let viteConfig; // Vite
|
|
49
|
-
let isSSR = false; //
|
|
50
|
-
|
|
46
|
+
// Plugin state variables
|
|
47
|
+
let projectRoot; // Project root directory
|
|
48
|
+
let viteConfig; // Vite resolved config
|
|
49
|
+
let isSSR = false; // Whether in SSR mode
|
|
50
|
+
// Track whether we've already processed (to avoid duplicate processing)
|
|
51
|
+
let hasProcessed = false;
|
|
51
52
|
return {
|
|
52
|
-
//
|
|
53
|
+
// Plugin name for debugging and logging
|
|
53
54
|
name: "vite-plugin-edgeone-adapter",
|
|
54
|
-
//
|
|
55
|
+
// Only apply this plugin during build
|
|
55
56
|
apply: "build",
|
|
56
|
-
//
|
|
57
|
+
// Execute after other plugins (post phase)
|
|
57
58
|
enforce: "post",
|
|
58
59
|
/**
|
|
59
|
-
* Vite
|
|
60
|
-
*
|
|
60
|
+
* Hook called after Vite config is resolved
|
|
61
|
+
* Captures project config and detects SSR mode here
|
|
61
62
|
*/
|
|
62
63
|
configResolved(config) {
|
|
63
64
|
projectRoot = config.root;
|
|
64
65
|
viteConfig = config;
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
isBuildingForSSR =
|
|
68
|
-
config.build.ssr !== false && config.build.ssr !== undefined;
|
|
69
|
-
// 确定最终的 SSR 状态
|
|
70
|
-
// 优先使用显式配置,否则从 Vite 配置自动检测
|
|
66
|
+
// Determine final SSR state
|
|
67
|
+
// Prefer explicit config, otherwise auto-detect from Vite config
|
|
71
68
|
if (ssrOption !== undefined) {
|
|
72
69
|
isSSR = ssrOption;
|
|
73
70
|
}
|
|
74
71
|
else {
|
|
75
|
-
|
|
72
|
+
// Auto-detect SSR mode from Vite config
|
|
73
|
+
const traditionalSSR = config.build.ssr !== false && config.build.ssr !== undefined;
|
|
74
|
+
isSSR = traditionalSSR;
|
|
76
75
|
}
|
|
77
|
-
//
|
|
78
|
-
logger.verbose("
|
|
79
|
-
logger.verbose("
|
|
80
|
-
logger.verbose("SSR 模式:", isSSR);
|
|
76
|
+
// Output debug info
|
|
77
|
+
logger.verbose("Project root:", projectRoot);
|
|
78
|
+
logger.verbose("SSR mode:", isSSR);
|
|
81
79
|
},
|
|
82
80
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
81
|
+
* Hook called after build artifacts are written
|
|
82
|
+
* This is where the main adapter processing logic resides
|
|
85
83
|
*/
|
|
86
|
-
async writeBundle() {
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
|
|
84
|
+
async writeBundle(options, _bundle) {
|
|
85
|
+
// Get the actual output directory from writeBundle options
|
|
86
|
+
// This is more reliable than viteConfig.build.outDir in Vite 7 environment mode
|
|
87
|
+
const actualOutDir = options.dir || viteConfig.build.outDir;
|
|
88
|
+
// Detect if current build is SSR build based on output directory
|
|
89
|
+
const isBuildingForSSR = detectSSRBuildFromOutDir(actualOutDir);
|
|
90
|
+
logger.verbose("Build type:", isBuildingForSSR ? "SSR" : "Client");
|
|
91
|
+
logger.verbose("Build outDir:", actualOutDir);
|
|
92
|
+
// If in SSR mode but currently building client, skip
|
|
93
|
+
// Wait for SSR build to complete before processing
|
|
90
94
|
if (isSSR && !isBuildingForSSR) {
|
|
91
|
-
logger.verbose("
|
|
95
|
+
logger.verbose("Skipping processing (waiting for SSR build to complete)");
|
|
92
96
|
return;
|
|
93
97
|
}
|
|
94
|
-
//
|
|
98
|
+
// Prevent duplicate processing
|
|
99
|
+
if (hasProcessed) {
|
|
100
|
+
logger.verbose("Skipping processing (already processed)");
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
hasProcessed = true;
|
|
104
|
+
// Brief delay to ensure all files are written to disk
|
|
95
105
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
96
106
|
try {
|
|
97
|
-
//
|
|
98
|
-
//
|
|
107
|
+
// Create build context object
|
|
108
|
+
// This object is passed to all hooks and adapter methods
|
|
99
109
|
const context = {
|
|
100
110
|
projectRoot,
|
|
101
111
|
outputDir,
|
|
@@ -103,74 +113,93 @@ export function createCoreAdapter(options = {}) {
|
|
|
103
113
|
viteConfig,
|
|
104
114
|
logger,
|
|
105
115
|
};
|
|
106
|
-
//
|
|
116
|
+
// Call beforeBuild hook
|
|
107
117
|
if (hooks.beforeBuild) {
|
|
108
118
|
await hooks.beforeBuild(context);
|
|
109
119
|
}
|
|
110
|
-
//
|
|
120
|
+
// Detect build artifacts
|
|
111
121
|
let artifacts;
|
|
112
122
|
if (adapter) {
|
|
113
|
-
//
|
|
123
|
+
// Use framework adapter for detection
|
|
114
124
|
const shouldUse = await adapter.detect(context);
|
|
115
125
|
if (!shouldUse) {
|
|
116
|
-
logger.warn(
|
|
126
|
+
logger.warn(`Adapter ${adapter.name} detection failed, using default config`);
|
|
117
127
|
}
|
|
118
128
|
artifacts = await adapter.getBuildArtifacts(context);
|
|
119
129
|
}
|
|
120
130
|
else {
|
|
121
|
-
//
|
|
131
|
+
// Use default detection logic
|
|
122
132
|
artifacts = await detectBuildArtifacts(context);
|
|
123
133
|
}
|
|
124
|
-
//
|
|
134
|
+
// Call afterBuild hook
|
|
125
135
|
if (hooks.afterBuild) {
|
|
126
136
|
await hooks.afterBuild(context, artifacts);
|
|
127
137
|
}
|
|
128
|
-
//
|
|
138
|
+
// Clean output directory
|
|
129
139
|
if (cleanOutput) {
|
|
130
140
|
await cleanOutputDir(context);
|
|
131
141
|
}
|
|
132
|
-
//
|
|
142
|
+
// Copy static assets
|
|
133
143
|
if (artifacts.clientDir) {
|
|
134
144
|
await copyStaticAssets(context, artifacts.clientDir);
|
|
135
145
|
}
|
|
136
|
-
//
|
|
146
|
+
// Bundle server code (SSR mode only)
|
|
137
147
|
if (isSSR && artifacts.serverEntry) {
|
|
138
148
|
await bundleServer(context, artifacts, adapter);
|
|
139
149
|
}
|
|
140
|
-
//
|
|
150
|
+
// Generate meta.json config file
|
|
141
151
|
await generateMetaJson(context, adapter);
|
|
142
|
-
logger.verbose("EdgeOne
|
|
152
|
+
logger.verbose("EdgeOne adapter processing complete");
|
|
143
153
|
}
|
|
144
154
|
catch (error) {
|
|
145
|
-
logger.error("EdgeOne
|
|
155
|
+
logger.error("EdgeOne adapter processing failed:", error);
|
|
146
156
|
throw error;
|
|
147
157
|
}
|
|
148
158
|
},
|
|
149
159
|
};
|
|
150
160
|
}
|
|
151
161
|
/**
|
|
152
|
-
*
|
|
162
|
+
* Detect if current build is SSR build based on output directory
|
|
163
|
+
*
|
|
164
|
+
* @param outDir - Output directory path
|
|
165
|
+
* @returns Whether this is an SSR build
|
|
166
|
+
*/
|
|
167
|
+
function detectSSRBuildFromOutDir(outDir) {
|
|
168
|
+
if (!outDir)
|
|
169
|
+
return false;
|
|
170
|
+
// Normalize path separators
|
|
171
|
+
const normalizedOutDir = outDir.replace(/\\/g, "/");
|
|
172
|
+
// Check if output directory indicates server/SSR build
|
|
173
|
+
return (normalizedOutDir.endsWith("/server") ||
|
|
174
|
+
normalizedOutDir === "dist/server" ||
|
|
175
|
+
normalizedOutDir === "server" ||
|
|
176
|
+
normalizedOutDir.includes("/server/") ||
|
|
177
|
+
normalizedOutDir.endsWith("/ssr") ||
|
|
178
|
+
normalizedOutDir === "ssr");
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Detect build artifacts using default paths
|
|
153
182
|
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
183
|
+
* When no framework adapter is provided, use this function to auto-detect
|
|
184
|
+
* common build output paths. Supports detection of dist, build, etc.
|
|
156
185
|
*
|
|
157
|
-
* @param context -
|
|
158
|
-
* @returns
|
|
186
|
+
* @param context - Build context
|
|
187
|
+
* @returns Detected build artifacts info
|
|
159
188
|
*/
|
|
160
189
|
async function detectBuildArtifacts(context) {
|
|
161
190
|
const { projectRoot, logger } = context;
|
|
162
|
-
//
|
|
191
|
+
// Common client build output paths (sorted by priority)
|
|
163
192
|
const clientPaths = [
|
|
164
|
-
path.join(projectRoot, "dist"), // Vite
|
|
165
|
-
path.join(projectRoot, "build/client"), // React Router
|
|
166
|
-
path.join(projectRoot, "build"), // Create React App
|
|
193
|
+
path.join(projectRoot, "dist"), // Vite default
|
|
194
|
+
path.join(projectRoot, "build/client"), // React Router and other frameworks
|
|
195
|
+
path.join(projectRoot, "build"), // Create React App, etc.
|
|
167
196
|
];
|
|
168
|
-
//
|
|
197
|
+
// Common server build output paths
|
|
169
198
|
const serverPaths = [
|
|
170
199
|
path.join(projectRoot, "dist/server"),
|
|
171
200
|
path.join(projectRoot, "build/server"),
|
|
172
201
|
];
|
|
173
|
-
//
|
|
202
|
+
// Common server entry file paths
|
|
174
203
|
const serverEntryPaths = [
|
|
175
204
|
path.join(projectRoot, "dist/server/index.js"),
|
|
176
205
|
path.join(projectRoot, "build/server/index.js"),
|
|
@@ -178,27 +207,27 @@ async function detectBuildArtifacts(context) {
|
|
|
178
207
|
let clientDir = null;
|
|
179
208
|
let serverDir = null;
|
|
180
209
|
let serverEntry = null;
|
|
181
|
-
//
|
|
210
|
+
// Find client build directory
|
|
182
211
|
for (const p of clientPaths) {
|
|
183
212
|
if (await pathExists(p)) {
|
|
184
213
|
clientDir = p;
|
|
185
|
-
logger.verbose(
|
|
214
|
+
logger.verbose(`Found client build directory: ${p}`);
|
|
186
215
|
break;
|
|
187
216
|
}
|
|
188
217
|
}
|
|
189
|
-
//
|
|
218
|
+
// Find server build directory
|
|
190
219
|
for (const p of serverPaths) {
|
|
191
220
|
if (await pathExists(p)) {
|
|
192
221
|
serverDir = p;
|
|
193
|
-
logger.verbose(
|
|
222
|
+
logger.verbose(`Found server build directory: ${p}`);
|
|
194
223
|
break;
|
|
195
224
|
}
|
|
196
225
|
}
|
|
197
|
-
//
|
|
226
|
+
// Find server entry file
|
|
198
227
|
for (const p of serverEntryPaths) {
|
|
199
228
|
if (await pathExists(p)) {
|
|
200
229
|
serverEntry = p;
|
|
201
|
-
logger.verbose(
|
|
230
|
+
logger.verbose(`Found server entry file: ${p}`);
|
|
202
231
|
break;
|
|
203
232
|
}
|
|
204
233
|
}
|
|
@@ -206,179 +235,179 @@ async function detectBuildArtifacts(context) {
|
|
|
206
235
|
clientDir,
|
|
207
236
|
serverDir,
|
|
208
237
|
serverEntry,
|
|
209
|
-
assetsDir: clientDir, //
|
|
238
|
+
assetsDir: clientDir, // Assets directory is usually same as client directory
|
|
210
239
|
};
|
|
211
240
|
}
|
|
212
241
|
/**
|
|
213
|
-
*
|
|
242
|
+
* Clean output directory
|
|
214
243
|
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
244
|
+
* Clean previous output before each build to ensure clean output directory.
|
|
245
|
+
* Only cleans specific subdirectories, not the entire output directory.
|
|
217
246
|
*
|
|
218
|
-
* @param context -
|
|
247
|
+
* @param context - Build context
|
|
219
248
|
*/
|
|
220
249
|
async function cleanOutputDir(context) {
|
|
221
250
|
const { projectRoot, outputDir, logger } = context;
|
|
222
251
|
const outputPath = path.join(projectRoot, outputDir);
|
|
223
|
-
//
|
|
252
|
+
// Paths to clean
|
|
224
253
|
const pathsToClean = [
|
|
225
|
-
path.join(outputPath, "assets"), //
|
|
226
|
-
path.join(outputPath, "server-handler"), //
|
|
227
|
-
path.join(outputPath, "meta.json"), //
|
|
254
|
+
path.join(outputPath, "assets"), // Static assets directory
|
|
255
|
+
path.join(outputPath, "server-handler"), // Server handler directory
|
|
256
|
+
path.join(outputPath, "meta.json"), // Metadata config file
|
|
228
257
|
];
|
|
229
|
-
//
|
|
258
|
+
// Delete each path
|
|
230
259
|
for (const p of pathsToClean) {
|
|
231
260
|
try {
|
|
232
261
|
await fs.rm(p, { recursive: true, force: true });
|
|
233
262
|
}
|
|
234
263
|
catch {
|
|
235
|
-
//
|
|
264
|
+
// Ignore delete errors (e.g. path doesn't exist)
|
|
236
265
|
}
|
|
237
266
|
}
|
|
238
|
-
//
|
|
267
|
+
// Ensure output directory exists
|
|
239
268
|
await ensureDirectory(outputPath);
|
|
240
|
-
logger.verbose("
|
|
269
|
+
logger.verbose("Output directory cleaned");
|
|
241
270
|
}
|
|
242
271
|
/**
|
|
243
|
-
*
|
|
272
|
+
* Copy static assets to output directory
|
|
244
273
|
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
274
|
+
* Copy client build artifacts (HTML, CSS, JS, images, etc.) to deployment directory.
|
|
275
|
+
* These assets will be served directly by EdgeOne CDN.
|
|
247
276
|
*
|
|
248
|
-
* @param context -
|
|
249
|
-
* @param clientDir -
|
|
277
|
+
* @param context - Build context
|
|
278
|
+
* @param clientDir - Client build directory path
|
|
250
279
|
*/
|
|
251
280
|
async function copyStaticAssets(context, clientDir) {
|
|
252
281
|
const { projectRoot, outputDir, logger } = context;
|
|
253
|
-
//
|
|
282
|
+
// Target path: .edgeone/assets
|
|
254
283
|
const targetPath = path.join(projectRoot, outputDir, "assets");
|
|
255
284
|
await copyDirectory(clientDir, targetPath);
|
|
256
|
-
logger.verbose(
|
|
285
|
+
logger.verbose(`Static assets copied to ${outputDir}/assets`);
|
|
257
286
|
}
|
|
258
287
|
/**
|
|
259
|
-
*
|
|
288
|
+
* Bundle server code
|
|
260
289
|
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
290
|
+
* Bundle framework's server build artifacts into a single JavaScript file
|
|
291
|
+
* for running in EdgeOne edge function environment.
|
|
263
292
|
*
|
|
264
|
-
*
|
|
265
|
-
* 1.
|
|
266
|
-
* 2.
|
|
267
|
-
* 3.
|
|
293
|
+
* Processing flow:
|
|
294
|
+
* 1. Create server wrapper (handles request conversion)
|
|
295
|
+
* 2. Bundle with esbuild
|
|
296
|
+
* 3. Cleanup temporary files
|
|
268
297
|
*
|
|
269
|
-
* @param context -
|
|
270
|
-
* @param artifacts -
|
|
271
|
-
* @param adapter -
|
|
298
|
+
* @param context - Build context
|
|
299
|
+
* @param artifacts - Build artifacts info
|
|
300
|
+
* @param adapter - Framework adapter (optional)
|
|
272
301
|
*/
|
|
273
302
|
async function bundleServer(context, artifacts, adapter) {
|
|
274
303
|
const { projectRoot, outputDir, logger } = context;
|
|
275
|
-
//
|
|
304
|
+
// Check if server entry exists
|
|
276
305
|
if (!artifacts.serverEntry) {
|
|
277
|
-
logger.warn("
|
|
306
|
+
logger.warn("Server entry file not found, skipping server bundling");
|
|
278
307
|
return;
|
|
279
308
|
}
|
|
280
|
-
//
|
|
309
|
+
// Output path configuration
|
|
281
310
|
const outputPath = path.join(projectRoot, outputDir, "server-handler");
|
|
282
311
|
const outputFile = path.join(outputPath, "handler.js");
|
|
283
|
-
//
|
|
312
|
+
// Get adapter hooks
|
|
284
313
|
const adapterHooks = adapter?.hooks || {};
|
|
285
|
-
//
|
|
314
|
+
// Wrapper configuration
|
|
286
315
|
const wrapperConfig = {
|
|
287
316
|
serverEntryPath: artifacts.serverEntry,
|
|
288
317
|
};
|
|
289
|
-
//
|
|
318
|
+
// Create server wrapper
|
|
290
319
|
let wrapperPath;
|
|
291
320
|
if (adapterHooks.generateServerWrapper) {
|
|
292
|
-
//
|
|
321
|
+
// Use adapter's custom wrapper generation logic
|
|
293
322
|
const wrapperContent = await adapterHooks.generateServerWrapper(context, wrapperConfig);
|
|
294
323
|
wrapperPath = path.join(projectRoot, "server-wrapper.temp.js");
|
|
295
324
|
await writeFile(wrapperPath, wrapperContent);
|
|
296
325
|
}
|
|
297
326
|
else {
|
|
298
|
-
//
|
|
327
|
+
// Use default wrapper
|
|
299
328
|
wrapperPath = await createServerWrapper(context, wrapperConfig);
|
|
300
329
|
}
|
|
301
|
-
//
|
|
330
|
+
// Prepare bundle configuration
|
|
302
331
|
let bundleConfig = {
|
|
303
332
|
entryPoints: [wrapperPath],
|
|
304
333
|
outfile: outputFile,
|
|
305
334
|
};
|
|
306
|
-
//
|
|
335
|
+
// Call beforeBundle hook, allows config modification
|
|
307
336
|
if (context.viteConfig && adapterHooks.beforeBundle) {
|
|
308
337
|
bundleConfig = await adapterHooks.beforeBundle(context, bundleConfig);
|
|
309
338
|
}
|
|
310
|
-
//
|
|
339
|
+
// Execute bundling
|
|
311
340
|
await bundleServerCode(context, bundleConfig);
|
|
312
|
-
//
|
|
341
|
+
// Cleanup temporary wrapper file
|
|
313
342
|
await cleanupWrapper(wrapperPath);
|
|
314
|
-
//
|
|
343
|
+
// Call afterBundle hook
|
|
315
344
|
if (adapterHooks.afterBundle) {
|
|
316
345
|
await adapterHooks.afterBundle(context, outputFile);
|
|
317
346
|
}
|
|
318
|
-
logger.verbose(
|
|
347
|
+
logger.verbose(`Server code bundled to ${outputDir}/server-handler/handler.js`);
|
|
319
348
|
}
|
|
320
349
|
/**
|
|
321
|
-
*
|
|
350
|
+
* Generate meta.json configuration file
|
|
322
351
|
*
|
|
323
|
-
* meta.json
|
|
324
|
-
* -
|
|
325
|
-
* - HTTP
|
|
326
|
-
* - 404
|
|
352
|
+
* meta.json is the core configuration file for EdgeOne deployment, containing:
|
|
353
|
+
* - Route info: Tells EdgeOne which paths need SSR, which are static assets
|
|
354
|
+
* - HTTP config: Response headers, redirects, rewrites, cache rules
|
|
355
|
+
* - 404 handling configuration
|
|
327
356
|
*
|
|
328
|
-
* @param context -
|
|
329
|
-
* @param adapter -
|
|
357
|
+
* @param context - Build context
|
|
358
|
+
* @param adapter - Framework adapter (optional)
|
|
330
359
|
*/
|
|
331
360
|
async function generateMetaJson(context, adapter) {
|
|
332
361
|
const { projectRoot, outputDir, isSSR, logger } = context;
|
|
333
|
-
//
|
|
362
|
+
// Generate route info
|
|
334
363
|
let routes = [];
|
|
335
364
|
const adapterHooks = adapter?.hooks || {};
|
|
336
365
|
if (adapterHooks.generateRoutes) {
|
|
337
|
-
//
|
|
366
|
+
// Use adapter's route generation logic
|
|
338
367
|
routes = await adapterHooks.generateRoutes(context);
|
|
339
368
|
}
|
|
340
369
|
else {
|
|
341
|
-
//
|
|
370
|
+
// Default: single root route
|
|
342
371
|
routes = [
|
|
343
372
|
{
|
|
344
373
|
path: "/",
|
|
345
|
-
isStatic: !isSSR, // SSR
|
|
374
|
+
isStatic: !isSSR, // Not static route in SSR mode
|
|
346
375
|
srcRoute: "/",
|
|
347
376
|
},
|
|
348
377
|
];
|
|
349
378
|
}
|
|
350
|
-
//
|
|
379
|
+
// Generate metadata config
|
|
351
380
|
let metaConfig;
|
|
352
381
|
if (adapterHooks.generateMeta) {
|
|
353
|
-
//
|
|
382
|
+
// Use adapter's metadata generation logic
|
|
354
383
|
metaConfig = await adapterHooks.generateMeta(context, routes);
|
|
355
384
|
}
|
|
356
385
|
else {
|
|
357
|
-
//
|
|
386
|
+
// Use default config
|
|
358
387
|
metaConfig = {
|
|
359
388
|
conf: {
|
|
360
|
-
headers: [], // HTTP
|
|
361
|
-
redirects: [], //
|
|
362
|
-
rewrites: [], // URL
|
|
363
|
-
caches: [], //
|
|
364
|
-
has404: false, //
|
|
365
|
-
ssr404: isSSR, // 404
|
|
389
|
+
headers: [], // HTTP response header rules
|
|
390
|
+
redirects: [], // Redirect rules
|
|
391
|
+
rewrites: [], // URL rewrite rules
|
|
392
|
+
caches: [], // Cache rules
|
|
393
|
+
has404: false, // Whether custom 404 page exists
|
|
394
|
+
ssr404: isSSR, // Whether 404 uses SSR
|
|
366
395
|
},
|
|
367
396
|
has404: false,
|
|
368
397
|
frameworkRoutes: routes,
|
|
369
398
|
};
|
|
370
399
|
}
|
|
371
|
-
//
|
|
400
|
+
// Convert config to JSON string
|
|
372
401
|
const metaContent = JSON.stringify(metaConfig, null, 2);
|
|
373
|
-
// SSR
|
|
402
|
+
// In SSR mode, also write a copy in server-handler directory
|
|
374
403
|
if (isSSR) {
|
|
375
404
|
const serverMetaPath = path.join(projectRoot, outputDir, "server-handler", "meta.json");
|
|
376
405
|
await writeFile(serverMetaPath, metaContent);
|
|
377
406
|
}
|
|
378
|
-
//
|
|
407
|
+
// Write meta.json in output root directory
|
|
379
408
|
const rootMetaPath = path.join(projectRoot, outputDir, "meta.json");
|
|
380
409
|
await writeFile(rootMetaPath, metaContent);
|
|
381
|
-
logger.verbose(`meta.json
|
|
410
|
+
logger.verbose(`meta.json generated with ${routes.length} routes`);
|
|
382
411
|
}
|
|
383
412
|
export default createCoreAdapter;
|
|
384
413
|
//# sourceMappingURL=core.js.map
|
package/dist/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,IAAI,MAAM,MAAM,CAAC;AAUxB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,aAAa,EACb,eAAe,EACf,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,MAAM,aAAa,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAA8B,EAAE;IAChE,
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,IAAI,MAAM,MAAM,CAAC;AAUxB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,aAAa,EACb,eAAe,EACf,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,MAAM,aAAa,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAA8B,EAAE;IAChE,2CAA2C;IAC3C,MAAM,EACJ,OAAO,GAAG,KAAK,EAAY,yBAAyB;IACpD,SAAS,GAAG,UAAU,EAAK,mBAAmB;IAC9C,WAAW,GAAG,IAAI,EAAS,sCAAsC;IACjE,OAAO,EAAoB,6BAA6B;IACxD,KAAK,GAAG,EAAE,EAAiB,wBAAwB;IACnD,GAAG,EAAE,SAAS,EAAa,yBAAyB;MACrD,GAAG,OAAO,CAAC;IAEZ,yBAAyB;IACzB,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,CA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