@chuckcchen/vite-plugin 1.0.19 → 1.0.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/bundler.d.ts +5 -18
- package/dist/bundler.d.ts.map +1 -1
- package/dist/bundler.js +43 -30
- package/dist/bundler.js.map +1 -1
- package/dist/core.d.ts +2 -18
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +109 -248
- package/dist/core.js.map +1 -1
- package/dist/factory/detectors.d.ts +5 -15
- package/dist/factory/detectors.d.ts.map +1 -1
- package/dist/factory/detectors.js +8 -22
- package/dist/factory/detectors.js.map +1 -1
- package/dist/factory/hooks.d.ts +4 -59
- package/dist/factory/hooks.d.ts.map +1 -1
- package/dist/factory/hooks.js +18 -117
- package/dist/factory/hooks.js.map +1 -1
- package/dist/factory/index.d.ts +7 -51
- package/dist/factory/index.d.ts.map +1 -1
- package/dist/factory/index.js +10 -55
- package/dist/factory/index.js.map +1 -1
- package/dist/factory/presets.d.ts +16 -121
- package/dist/factory/presets.d.ts.map +1 -1
- package/dist/factory/presets.js +143 -174
- package/dist/factory/presets.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -35
- package/dist/index.js.map +1 -1
- package/dist/route/index.d.ts +1 -1
- package/dist/route/index.d.ts.map +1 -1
- package/dist/route/index.js +1 -3
- package/dist/route/index.js.map +1 -1
- package/dist/route/parser.d.ts +0 -37
- package/dist/route/parser.d.ts.map +1 -1
- package/dist/route/parser.js +11 -124
- package/dist/route/parser.js.map +1 -1
- package/dist/route/regex.d.ts +15 -80
- package/dist/route/regex.d.ts.map +1 -1
- package/dist/route/regex.js +65 -169
- package/dist/route/regex.js.map +1 -1
- package/dist/route/regex.test.d.ts +7 -0
- package/dist/route/regex.test.d.ts.map +1 -0
- package/dist/route/regex.test.js +662 -0
- package/dist/route/regex.test.js.map +1 -0
- package/dist/route/types.d.ts +0 -58
- package/dist/route/types.d.ts.map +1 -1
- package/dist/types.d.ts +36 -147
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -3
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +1 -78
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +11 -144
- package/dist/utils.js.map +1 -1
- package/dist/vite-config-parser.d.ts +4 -141
- package/dist/vite-config-parser.d.ts.map +1 -1
- package/dist/vite-config-parser.js +25 -235
- package/dist/vite-config-parser.js.map +1 -1
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* EdgeOne Vite Plugin Adapter - Core Plugin Module
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
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
|
|
4
|
+
* Handles build artifact detection, static asset copying, server code bundling,
|
|
5
|
+
* route config generation, and meta.json generation for EdgeOne deployment.
|
|
10
6
|
*/
|
|
11
7
|
import path from "path";
|
|
12
8
|
import { createLogger, pathExists, copyDirectory, ensureDirectory, writeFile, detectServerEntry, } from "./utils.js";
|
|
@@ -14,95 +10,44 @@ import { ViteConfigParser } from "./vite-config-parser.js";
|
|
|
14
10
|
import { bundleServerCode, createServerWrapper, cleanupWrapper, } from "./bundler.js";
|
|
15
11
|
import { addRegexToRoutes, convertRoutesToMetaFormat } from "./route/index.js";
|
|
16
12
|
import fs from "fs/promises";
|
|
17
|
-
/**
|
|
18
|
-
* Create EdgeOne core adapter plugin
|
|
19
|
-
*
|
|
20
|
-
* This is the main entry function for creating adapters, returns a Vite plugin instance.
|
|
21
|
-
* The plugin executes after Vite build completes, processing build artifacts and generating deployment config.
|
|
22
|
-
*
|
|
23
|
-
* @param options - Adapter configuration options
|
|
24
|
-
* @returns Vite plugin instance
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* createCoreAdapter({ verbose: true })
|
|
28
|
-
*/
|
|
29
13
|
export function createCoreAdapter(options = {}) {
|
|
30
|
-
|
|
31
|
-
const { verbose = false, // Enable verbose logging
|
|
32
|
-
adapter, // Framework adapter instance
|
|
33
|
-
hooks = {}, // Custom hook functions
|
|
34
|
-
ssr: ssrOption, // SSR mode configuration
|
|
35
|
-
} = options;
|
|
36
|
-
// Fixed output directory
|
|
14
|
+
const { verbose = false, adapter, hooks = {}, ssr: ssrOption } = options;
|
|
37
15
|
const outputDir = ".edgeone";
|
|
38
|
-
// Create logger instance
|
|
39
16
|
const logger = createLogger(verbose);
|
|
40
|
-
|
|
41
|
-
let
|
|
42
|
-
let
|
|
43
|
-
let isSSR = false; // Whether in SSR mode
|
|
44
|
-
// Track whether we've already processed (to avoid duplicate processing)
|
|
17
|
+
let projectRoot;
|
|
18
|
+
let viteConfig;
|
|
19
|
+
let isSSR = false;
|
|
45
20
|
let hasProcessed = false;
|
|
46
21
|
return {
|
|
47
|
-
// Plugin name for debugging and logging
|
|
48
22
|
name: "vite-plugin-edgeone-adapter",
|
|
49
|
-
// Only apply this plugin during build
|
|
50
23
|
apply: "build",
|
|
51
|
-
// Execute after other plugins (post phase)
|
|
52
24
|
enforce: "post",
|
|
53
|
-
/**
|
|
54
|
-
* Hook called after Vite config is resolved
|
|
55
|
-
* Captures project config and detects SSR mode here
|
|
56
|
-
*/
|
|
57
25
|
configResolved(config) {
|
|
58
26
|
projectRoot = config.root;
|
|
59
27
|
viteConfig = config;
|
|
60
|
-
// Determine final SSR state
|
|
61
|
-
// Prefer explicit config, otherwise auto-detect from Vite config
|
|
62
28
|
if (ssrOption !== undefined) {
|
|
63
29
|
logger.verbose("SSR mode configured:", ssrOption);
|
|
64
30
|
isSSR = ssrOption;
|
|
65
31
|
}
|
|
66
32
|
else {
|
|
67
|
-
// Auto-detect SSR mode from Vite config
|
|
68
33
|
logger.verbose("Auto-detecting SSR mode from Vite config", config.build.ssr);
|
|
69
|
-
|
|
70
|
-
isSSR = traditionalSSR;
|
|
34
|
+
isSSR = config.build.ssr !== false && config.build.ssr !== undefined;
|
|
71
35
|
}
|
|
72
|
-
// Output debug info
|
|
73
36
|
logger.verbose("Project root:", projectRoot);
|
|
74
37
|
logger.verbose("SSR mode:", isSSR);
|
|
75
38
|
},
|
|
76
|
-
/**
|
|
77
|
-
* Hook called after entire build process completes
|
|
78
|
-
* Using closeBundle instead of writeBundle to ensure all files are generated
|
|
79
|
-
* (including prerendered pages which may be generated in later stages)
|
|
80
|
-
*/
|
|
81
39
|
async closeBundle() {
|
|
82
|
-
// Prevent duplicate processing
|
|
83
40
|
if (hasProcessed) {
|
|
84
41
|
logger.verbose("Skipping processing (already processed)");
|
|
85
42
|
return;
|
|
86
43
|
}
|
|
87
44
|
hasProcessed = true;
|
|
88
45
|
try {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const context = {
|
|
92
|
-
projectRoot,
|
|
93
|
-
outputDir,
|
|
94
|
-
isSSR,
|
|
95
|
-
viteConfig,
|
|
96
|
-
logger,
|
|
97
|
-
};
|
|
98
|
-
// Call beforeBuild hook
|
|
99
|
-
if (hooks.beforeBuild) {
|
|
46
|
+
const context = { projectRoot, outputDir, isSSR, viteConfig, logger };
|
|
47
|
+
if (hooks.beforeBuild)
|
|
100
48
|
await hooks.beforeBuild(context);
|
|
101
|
-
}
|
|
102
|
-
// Detect build artifacts
|
|
103
49
|
let artifacts;
|
|
104
50
|
if (adapter) {
|
|
105
|
-
// Use framework adapter for detection
|
|
106
51
|
const shouldUse = await adapter.detect(context);
|
|
107
52
|
if (!shouldUse) {
|
|
108
53
|
logger.warn(`Adapter ${adapter.name} detection failed, using default config`);
|
|
@@ -110,28 +55,18 @@ export function createCoreAdapter(options = {}) {
|
|
|
110
55
|
artifacts = await adapter.getBuildArtifacts(context);
|
|
111
56
|
}
|
|
112
57
|
else {
|
|
113
|
-
// Use default detection logic
|
|
114
58
|
artifacts = await detectBuildArtifacts(context);
|
|
115
59
|
}
|
|
116
|
-
|
|
117
|
-
if (hooks.afterBuild) {
|
|
60
|
+
if (hooks.afterBuild)
|
|
118
61
|
await hooks.afterBuild(context, artifacts);
|
|
119
|
-
}
|
|
120
62
|
logger.verbose("artifacts", artifacts);
|
|
121
|
-
// Clean output directory
|
|
122
63
|
await cleanOutputDir(context);
|
|
123
|
-
|
|
124
|
-
if (artifacts.clientDir) {
|
|
64
|
+
if (artifacts.clientDir)
|
|
125
65
|
await copyStaticAssets(context, artifacts.clientDir);
|
|
126
|
-
|
|
127
|
-
// Bundle server code (SSR mode only)
|
|
128
|
-
if (isSSR && artifacts.serverEntry) {
|
|
66
|
+
if (isSSR && artifacts.serverEntry)
|
|
129
67
|
await bundleServer(context, artifacts, adapter);
|
|
130
|
-
|
|
131
|
-
// Generate meta.json config file (only for SSR mode with server entry)
|
|
132
|
-
if (artifacts.serverEntry) {
|
|
68
|
+
if (artifacts.serverEntry)
|
|
133
69
|
await generateMetaJson(context, adapter);
|
|
134
|
-
}
|
|
135
70
|
logger.verbose("EdgeOne adapter processing complete");
|
|
136
71
|
}
|
|
137
72
|
catch (error) {
|
|
@@ -141,54 +76,22 @@ export function createCoreAdapter(options = {}) {
|
|
|
141
76
|
},
|
|
142
77
|
};
|
|
143
78
|
}
|
|
144
|
-
/**
|
|
145
|
-
* Detect build artifacts using default paths
|
|
146
|
-
*
|
|
147
|
-
* When no framework adapter is provided, use this function to auto-detect
|
|
148
|
-
* common build output paths. Now uses ViteConfigParser for comprehensive
|
|
149
|
-
* Vite configuration support.
|
|
150
|
-
*
|
|
151
|
-
* @param context - Build context
|
|
152
|
-
* @returns Detected build artifacts info
|
|
153
|
-
*/
|
|
154
79
|
async function detectBuildArtifacts(context) {
|
|
155
80
|
const { projectRoot, logger, viteConfig, isSSR } = context;
|
|
156
81
|
let clientDir = null;
|
|
157
82
|
let serverDir = null;
|
|
158
83
|
let serverEntry = null;
|
|
159
|
-
// Default server entry file candidates
|
|
160
84
|
const serverEntryCandidates = [
|
|
161
|
-
"index.js",
|
|
162
|
-
"index.mjs",
|
|
163
|
-
"entry-server.js",
|
|
164
|
-
"entry-server.mjs",
|
|
165
|
-
"server.js",
|
|
166
|
-
"server.mjs",
|
|
85
|
+
"index.js", "index.mjs", "entry-server.js", "entry-server.mjs", "server.js", "server.mjs",
|
|
167
86
|
];
|
|
168
|
-
// Use ViteConfigParser if viteConfig is available
|
|
169
87
|
if (viteConfig) {
|
|
170
|
-
const configParser = new ViteConfigParser(viteConfig, projectRoot, {
|
|
171
|
-
logger,
|
|
172
|
-
serverEntryCandidates,
|
|
173
|
-
});
|
|
174
|
-
// Parse full config info
|
|
88
|
+
const configParser = new ViteConfigParser(viteConfig, projectRoot, { logger, serverEntryCandidates });
|
|
175
89
|
const configInfo = await configParser.parse();
|
|
176
|
-
logger.verbose("Vite config parsed:", {
|
|
177
|
-
outDir: configInfo.outDir,
|
|
178
|
-
isSSR: configInfo.isSSR,
|
|
179
|
-
ssrEntry: configInfo.ssrEntry,
|
|
180
|
-
});
|
|
181
|
-
// Determine client directory
|
|
182
|
-
// For SSR builds, client is typically in outDir/client or just outDir
|
|
90
|
+
logger.verbose("Vite config parsed:", { outDir: configInfo.outDir, isSSR: configInfo.isSSR, ssrEntry: configInfo.ssrEntry });
|
|
183
91
|
if (configInfo.isSSR) {
|
|
184
|
-
|
|
185
|
-
const clientCandidates = [
|
|
186
|
-
path.join(configInfo.absoluteOutDir, "client"),
|
|
187
|
-
configInfo.absoluteOutDir,
|
|
188
|
-
];
|
|
92
|
+
const clientCandidates = [path.join(configInfo.absoluteOutDir, "client"), configInfo.absoluteOutDir];
|
|
189
93
|
for (const candidate of clientCandidates) {
|
|
190
94
|
if (await pathExists(candidate)) {
|
|
191
|
-
// Verify it's the client dir by checking for HTML or assets
|
|
192
95
|
const hasHtml = await pathExists(path.join(candidate, "index.html"));
|
|
193
96
|
const hasAssets = await pathExists(path.join(candidate, "assets"));
|
|
194
97
|
if (hasHtml || hasAssets) {
|
|
@@ -200,33 +103,26 @@ async function detectBuildArtifacts(context) {
|
|
|
200
103
|
}
|
|
201
104
|
}
|
|
202
105
|
else {
|
|
203
|
-
// SPA mode - output dir is the client dir
|
|
204
106
|
if (await pathExists(configInfo.absoluteOutDir)) {
|
|
205
107
|
clientDir = configInfo.absoluteOutDir;
|
|
206
108
|
logger.verbose(`Found client directory (SPA): ${clientDir}`);
|
|
207
109
|
}
|
|
208
110
|
}
|
|
209
|
-
// Determine server directory and entry (SSR only)
|
|
210
111
|
if (isSSR) {
|
|
211
112
|
serverDir = configInfo.serverDir;
|
|
212
113
|
serverEntry = configInfo.serverEntryPath;
|
|
213
|
-
// If no server entry found from config, try detection
|
|
214
114
|
if (!serverEntry && serverDir) {
|
|
215
|
-
serverEntry = await detectServerEntry(serverDir, serverEntryCandidates, {
|
|
216
|
-
recursive: true,
|
|
217
|
-
logger,
|
|
218
|
-
});
|
|
115
|
+
serverEntry = await detectServerEntry(serverDir, serverEntryCandidates, { recursive: true, logger });
|
|
219
116
|
}
|
|
220
117
|
}
|
|
221
118
|
}
|
|
222
|
-
// Fallback
|
|
119
|
+
// Fallback detection
|
|
223
120
|
if (!clientDir) {
|
|
224
|
-
// Common client build output paths (sorted by priority)
|
|
225
121
|
const clientPaths = [
|
|
226
|
-
path.join(projectRoot, "dist"),
|
|
227
|
-
path.join(projectRoot, "dist/client"),
|
|
228
|
-
path.join(projectRoot, "build/client"),
|
|
229
|
-
path.join(projectRoot, "build"),
|
|
122
|
+
path.join(projectRoot, "dist"),
|
|
123
|
+
path.join(projectRoot, "dist/client"),
|
|
124
|
+
path.join(projectRoot, "build/client"),
|
|
125
|
+
path.join(projectRoot, "build"),
|
|
230
126
|
];
|
|
231
127
|
for (const p of clientPaths) {
|
|
232
128
|
if (await pathExists(p)) {
|
|
@@ -237,11 +133,7 @@ async function detectBuildArtifacts(context) {
|
|
|
237
133
|
}
|
|
238
134
|
}
|
|
239
135
|
if (isSSR && !serverDir) {
|
|
240
|
-
|
|
241
|
-
const serverPaths = [
|
|
242
|
-
path.join(projectRoot, "dist/server"),
|
|
243
|
-
path.join(projectRoot, "build/server"),
|
|
244
|
-
];
|
|
136
|
+
const serverPaths = [path.join(projectRoot, "dist/server"), path.join(projectRoot, "build/server")];
|
|
245
137
|
for (const p of serverPaths) {
|
|
246
138
|
if (await pathExists(p)) {
|
|
247
139
|
serverDir = p;
|
|
@@ -251,202 +143,171 @@ async function detectBuildArtifacts(context) {
|
|
|
251
143
|
}
|
|
252
144
|
}
|
|
253
145
|
if (isSSR && serverDir && !serverEntry) {
|
|
254
|
-
|
|
255
|
-
serverEntry = await detectServerEntry(serverDir, serverEntryCandidates, {
|
|
256
|
-
recursive: true,
|
|
257
|
-
logger,
|
|
258
|
-
});
|
|
146
|
+
serverEntry = await detectServerEntry(serverDir, serverEntryCandidates, { recursive: true, logger });
|
|
259
147
|
}
|
|
260
|
-
return {
|
|
261
|
-
clientDir,
|
|
262
|
-
serverDir,
|
|
263
|
-
serverEntry,
|
|
264
|
-
assetsDir: clientDir, // Assets directory is usually same as client directory
|
|
265
|
-
};
|
|
148
|
+
return { clientDir, serverDir, serverEntry, assetsDir: clientDir };
|
|
266
149
|
}
|
|
267
|
-
/**
|
|
268
|
-
* Clean output directory
|
|
269
|
-
*
|
|
270
|
-
* Clean previous output before each build to ensure clean output directory.
|
|
271
|
-
* Only cleans specific subdirectories, not the entire output directory.
|
|
272
|
-
*
|
|
273
|
-
* @param context - Build context
|
|
274
|
-
*/
|
|
275
150
|
async function cleanOutputDir(context) {
|
|
276
151
|
const { projectRoot, outputDir, logger } = context;
|
|
277
152
|
const outputPath = path.join(projectRoot, outputDir);
|
|
278
|
-
// Paths to clean
|
|
279
153
|
const pathsToClean = [
|
|
280
|
-
path.join(outputPath, "assets"),
|
|
281
|
-
path.join(outputPath, "server-handler"),
|
|
282
|
-
path.join(outputPath, "meta.json"),
|
|
154
|
+
path.join(outputPath, "assets"),
|
|
155
|
+
path.join(outputPath, "server-handler"),
|
|
156
|
+
path.join(outputPath, "meta.json"),
|
|
283
157
|
];
|
|
284
|
-
// Delete each path
|
|
285
158
|
for (const p of pathsToClean) {
|
|
286
159
|
try {
|
|
287
160
|
await fs.rm(p, { recursive: true, force: true });
|
|
288
161
|
}
|
|
289
162
|
catch {
|
|
290
|
-
// Ignore
|
|
163
|
+
// Ignore errors
|
|
291
164
|
}
|
|
292
165
|
}
|
|
293
|
-
// Ensure output directory exists
|
|
294
166
|
await ensureDirectory(outputPath);
|
|
295
167
|
logger.verbose("Output directory cleaned");
|
|
296
168
|
}
|
|
297
|
-
/**
|
|
298
|
-
* Copy static assets to output directory
|
|
299
|
-
*
|
|
300
|
-
* Copy client build artifacts (HTML, CSS, JS, images, etc.) to deployment directory.
|
|
301
|
-
* These assets will be served directly by EdgeOne CDN.
|
|
302
|
-
*
|
|
303
|
-
* @param context - Build context
|
|
304
|
-
* @param clientDir - Client build directory path
|
|
305
|
-
*/
|
|
306
169
|
async function copyStaticAssets(context, clientDir) {
|
|
307
170
|
const { projectRoot, outputDir, logger } = context;
|
|
308
|
-
// Target path: .edgeone/assets
|
|
309
171
|
const targetPath = path.join(projectRoot, outputDir, "assets");
|
|
310
172
|
await copyDirectory(clientDir, targetPath);
|
|
311
173
|
logger.verbose(`Static assets copied to ${outputDir}/assets`);
|
|
312
174
|
}
|
|
313
|
-
/**
|
|
314
|
-
* Bundle server code
|
|
315
|
-
*
|
|
316
|
-
* Bundle framework's server build artifacts into a single JavaScript file
|
|
317
|
-
* for running in EdgeOne edge function environment.
|
|
318
|
-
*
|
|
319
|
-
* Processing flow:
|
|
320
|
-
* 1. Create server wrapper (handles request conversion)
|
|
321
|
-
* 2. Bundle with esbuild
|
|
322
|
-
* 3. Cleanup temporary files
|
|
323
|
-
*
|
|
324
|
-
* @param context - Build context
|
|
325
|
-
* @param artifacts - Build artifacts info
|
|
326
|
-
* @param adapter - Framework adapter (optional)
|
|
327
|
-
*/
|
|
328
175
|
async function bundleServer(context, artifacts, adapter) {
|
|
329
176
|
const { projectRoot, outputDir, logger } = context;
|
|
330
|
-
// Check if server entry exists
|
|
331
177
|
if (!artifacts.serverEntry) {
|
|
332
178
|
logger.warn("Server entry file not found, skipping server bundling");
|
|
333
179
|
return;
|
|
334
180
|
}
|
|
335
|
-
// Output path configuration
|
|
336
181
|
const outputPath = path.join(projectRoot, outputDir, "server-handler");
|
|
337
182
|
const outputFile = path.join(outputPath, "handler.js");
|
|
338
|
-
// Get adapter hooks
|
|
339
183
|
const adapterHooks = adapter?.hooks || {};
|
|
340
|
-
|
|
341
|
-
const wrapperConfig = {
|
|
342
|
-
serverEntryPath: artifacts.serverEntry,
|
|
343
|
-
};
|
|
344
|
-
// Determine the server directory for proper relative path resolution
|
|
345
|
-
// This is crucial for dynamic imports with relative paths (e.g., "./assets/...")
|
|
184
|
+
const wrapperConfig = { serverEntryPath: artifacts.serverEntry };
|
|
346
185
|
const serverDir = artifacts.serverDir || path.dirname(artifacts.serverEntry);
|
|
347
|
-
// Create server wrapper
|
|
348
|
-
// IMPORTANT: Place the wrapper file in the server directory so that
|
|
349
|
-
// relative imports in the server build (e.g., "./assets/xxx.js") can be resolved correctly
|
|
350
186
|
let wrapperPath;
|
|
351
187
|
if (adapterHooks.generateServerWrapper) {
|
|
352
|
-
// Use adapter's custom wrapper generation logic
|
|
353
188
|
const wrapperContent = await adapterHooks.generateServerWrapper(context, wrapperConfig);
|
|
354
|
-
// Place wrapper in server directory for correct relative path resolution
|
|
355
189
|
wrapperPath = path.join(serverDir, "server-wrapper.temp.js");
|
|
356
190
|
await writeFile(wrapperPath, wrapperContent);
|
|
357
191
|
}
|
|
358
192
|
else {
|
|
359
|
-
// Use default wrapper
|
|
360
193
|
wrapperPath = await createServerWrapper(context, wrapperConfig);
|
|
361
194
|
}
|
|
362
|
-
// Prepare bundle configuration
|
|
363
|
-
// Set absWorkingDir to server directory to resolve relative imports correctly
|
|
364
195
|
let bundleConfig = {
|
|
365
196
|
entryPoints: [wrapperPath],
|
|
366
197
|
outfile: outputFile,
|
|
367
|
-
esbuildOptions: {
|
|
368
|
-
absWorkingDir: serverDir,
|
|
369
|
-
},
|
|
198
|
+
esbuildOptions: { absWorkingDir: serverDir },
|
|
370
199
|
};
|
|
371
|
-
// Call beforeBundle hook, allows config modification
|
|
372
200
|
if (context.viteConfig && adapterHooks.beforeBundle) {
|
|
373
201
|
bundleConfig = await adapterHooks.beforeBundle(context, bundleConfig);
|
|
374
202
|
}
|
|
375
|
-
|
|
376
|
-
await bundleServerCode(context, bundleConfig);
|
|
377
|
-
// Cleanup temporary wrapper file
|
|
203
|
+
const bundleResult = await bundleServerCode(context, bundleConfig);
|
|
378
204
|
await cleanupWrapper(wrapperPath);
|
|
379
|
-
//
|
|
205
|
+
// Extract bundled files from metafile to avoid copying already-inlined files
|
|
206
|
+
const bundledFiles = getBundledFiles(bundleResult.metafile, serverDir);
|
|
207
|
+
// Copy only server-side files that were NOT inlined into handler.js
|
|
208
|
+
await copyServerAssets(serverDir, outputPath, artifacts.serverEntry, bundledFiles, logger);
|
|
380
209
|
if (adapterHooks.afterBundle) {
|
|
381
210
|
await adapterHooks.afterBundle(context, outputFile);
|
|
382
211
|
}
|
|
383
212
|
logger.verbose(`Server code bundled to ${outputDir}/server-handler/handler.js`);
|
|
384
213
|
}
|
|
385
214
|
/**
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
215
|
+
* Extract the set of files that were bundled/inlined into handler.js from esbuild metafile.
|
|
216
|
+
* Returns a Set of absolute file paths that are already included in the bundle.
|
|
217
|
+
*/
|
|
218
|
+
function getBundledFiles(metafile, serverDir) {
|
|
219
|
+
const bundledFiles = new Set();
|
|
220
|
+
if (!metafile?.inputs) {
|
|
221
|
+
return bundledFiles;
|
|
222
|
+
}
|
|
223
|
+
for (const inputPath of Object.keys(metafile.inputs)) {
|
|
224
|
+
// esbuild metafile uses relative paths from absWorkingDir
|
|
225
|
+
// Convert to absolute path for comparison
|
|
226
|
+
const absolutePath = path.isAbsolute(inputPath)
|
|
227
|
+
? inputPath
|
|
228
|
+
: path.resolve(serverDir, inputPath);
|
|
229
|
+
bundledFiles.add(absolutePath);
|
|
230
|
+
}
|
|
231
|
+
return bundledFiles;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Copy server build files to server-handler directory.
|
|
235
|
+
* Only copies files that are NOT already bundled into handler.js.
|
|
236
|
+
* This ensures files needed at runtime (non-JS assets, dynamic imports, etc.) are available.
|
|
395
237
|
*/
|
|
238
|
+
async function copyServerAssets(serverDir, outputPath, serverEntry, bundledFiles, logger) {
|
|
239
|
+
const serverEntryFileName = path.basename(serverEntry);
|
|
240
|
+
let copiedCount = 0;
|
|
241
|
+
let skippedCount = 0;
|
|
242
|
+
async function copyRecursive(srcDir, destDir, relativePath = "") {
|
|
243
|
+
const entries = await fs.readdir(srcDir, { withFileTypes: true });
|
|
244
|
+
for (const entry of entries) {
|
|
245
|
+
const srcPath = path.join(srcDir, entry.name);
|
|
246
|
+
const destPath = path.join(destDir, entry.name);
|
|
247
|
+
const currentRelativePath = relativePath ? `${relativePath}/${entry.name}` : entry.name;
|
|
248
|
+
// Skip the main server entry file (already bundled into handler.js)
|
|
249
|
+
if (relativePath === "" && entry.name === serverEntryFileName)
|
|
250
|
+
continue;
|
|
251
|
+
// Skip temporary files generated during build
|
|
252
|
+
if (entry.name.endsWith(".temp.js") || entry.name.endsWith(".temp.mjs"))
|
|
253
|
+
continue;
|
|
254
|
+
if (entry.isDirectory()) {
|
|
255
|
+
// Recursively process directories
|
|
256
|
+
await copyRecursive(srcPath, destPath, currentRelativePath);
|
|
257
|
+
}
|
|
258
|
+
else if (entry.isFile()) {
|
|
259
|
+
// Check if this file was already bundled into handler.js
|
|
260
|
+
const absoluteSrcPath = path.resolve(srcPath);
|
|
261
|
+
if (bundledFiles.has(absoluteSrcPath)) {
|
|
262
|
+
skippedCount++;
|
|
263
|
+
logger.verbose(`Skipped (already bundled): ${currentRelativePath}`);
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
// Copy the file
|
|
267
|
+
try {
|
|
268
|
+
await ensureDirectory(destDir);
|
|
269
|
+
await fs.copyFile(srcPath, destPath);
|
|
270
|
+
copiedCount++;
|
|
271
|
+
logger.verbose(`Copied server file: ${currentRelativePath}`);
|
|
272
|
+
}
|
|
273
|
+
catch (error) {
|
|
274
|
+
logger.verbose(`Failed to copy ${currentRelativePath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
await copyRecursive(serverDir, outputPath);
|
|
280
|
+
if (copiedCount > 0 || skippedCount > 0) {
|
|
281
|
+
logger.verbose(`Server assets: copied ${copiedCount}, skipped ${skippedCount} (already bundled)`);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
396
284
|
async function generateMetaJson(context, adapter) {
|
|
397
285
|
const { projectRoot, outputDir, isSSR, logger } = context;
|
|
398
|
-
// Generate route info
|
|
399
286
|
let routes = [];
|
|
400
287
|
const adapterHooks = adapter?.hooks || {};
|
|
401
288
|
if (adapterHooks.generateRoutes) {
|
|
402
|
-
// Use adapter's route generation logic
|
|
403
289
|
routes = await adapterHooks.generateRoutes(context);
|
|
404
290
|
}
|
|
405
291
|
else {
|
|
406
|
-
|
|
407
|
-
routes = [
|
|
408
|
-
{
|
|
409
|
-
path: "/",
|
|
410
|
-
isStatic: !isSSR, // Not static route in SSR mode
|
|
411
|
-
srcRoute: "/",
|
|
412
|
-
},
|
|
413
|
-
];
|
|
292
|
+
routes = [{ path: "/", isStatic: !isSSR, srcRoute: "/" }];
|
|
414
293
|
}
|
|
415
|
-
// Convert routes to simplified meta format (regexPath + isStatic only)
|
|
416
294
|
const metaRoutes = convertRoutesToMetaFormat(routes);
|
|
417
|
-
// Generate metadata config
|
|
418
295
|
let metaConfig;
|
|
419
296
|
if (adapterHooks.generateMeta) {
|
|
420
|
-
// Use adapter's metadata generation logic
|
|
421
|
-
// Note: adapter receives original routes with regex, we'll override frameworkRoutes
|
|
422
297
|
const routesWithRegex = addRegexToRoutes(routes);
|
|
423
298
|
metaConfig = await adapterHooks.generateMeta(context, routesWithRegex);
|
|
424
|
-
// Override with simplified format
|
|
425
299
|
metaConfig.frameworkRoutes = metaRoutes;
|
|
426
300
|
}
|
|
427
301
|
else {
|
|
428
|
-
// Use default config
|
|
429
302
|
metaConfig = {
|
|
430
|
-
conf: {
|
|
431
|
-
headers: [], // HTTP response header rules
|
|
432
|
-
redirects: [], // Redirect rules
|
|
433
|
-
rewrites: [], // URL rewrite rules
|
|
434
|
-
caches: [], // Cache rules
|
|
435
|
-
has404: false, // Whether custom 404 page exists
|
|
436
|
-
ssr404: isSSR, // Whether 404 uses SSR
|
|
437
|
-
},
|
|
303
|
+
conf: { headers: [], redirects: [], rewrites: [], caches: [], has404: false, ssr404: isSSR },
|
|
438
304
|
has404: false,
|
|
439
305
|
frameworkRoutes: metaRoutes,
|
|
440
306
|
};
|
|
441
307
|
}
|
|
442
|
-
// Convert config to JSON string
|
|
443
308
|
const metaContent = JSON.stringify(metaConfig, null, 2);
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
await writeFile(serverMetaPath, metaContent);
|
|
447
|
-
// Write meta.json in output root directory (for deployment)
|
|
448
|
-
const rootMetaPath = path.join(projectRoot, outputDir, "meta.json");
|
|
449
|
-
await writeFile(rootMetaPath, metaContent);
|
|
309
|
+
await writeFile(path.join(projectRoot, outputDir, "server-handler", "meta.json"), metaContent);
|
|
310
|
+
await writeFile(path.join(projectRoot, outputDir, "meta.json"), metaContent);
|
|
450
311
|
logger.verbose(`meta.json generated with ${routes.length} routes`);
|
|
451
312
|
}
|
|
452
313
|
export default createCoreAdapter;
|
package/dist/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js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ectors
|
|
3
|
-
*
|
|
4
|
-
* Utilities for detecting frameworks based on config files, build directories, and dependencies
|
|
2
|
+
* Framework Detectors - Utilities for detecting frameworks
|
|
5
3
|
*/
|
|
6
4
|
import type { BuildContext } from "../types.js";
|
|
7
|
-
/**
|
|
8
|
-
* Combine multiple detector functions (returns true if any matches)
|
|
9
|
-
*/
|
|
5
|
+
/** Combine multiple detector functions (returns true if any matches) */
|
|
10
6
|
export declare function combineDetectors(...detectors: ((context: BuildContext) => Promise<boolean> | boolean)[]): (context: BuildContext) => Promise<boolean>;
|
|
11
|
-
/**
|
|
12
|
-
* Create detector based on config files
|
|
13
|
-
*/
|
|
7
|
+
/** Create detector based on config files */
|
|
14
8
|
export declare function createConfigDetector(configFiles: string[]): (context: BuildContext) => Promise<boolean>;
|
|
15
|
-
/**
|
|
16
|
-
* Create detector based on build directories
|
|
17
|
-
*/
|
|
9
|
+
/** Create detector based on build directories */
|
|
18
10
|
export declare function createBuildDirDetector(buildDirs: string[]): (context: BuildContext) => Promise<boolean>;
|
|
19
|
-
/**
|
|
20
|
-
* Create detector based on package.json dependencies
|
|
21
|
-
*/
|
|
11
|
+
/** Create detector based on package.json dependencies */
|
|
22
12
|
export declare function createDependencyDetector(dependencies: string[]): (context: BuildContext) => Promise<boolean>;
|
|
23
13
|
//# sourceMappingURL=detectors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detectors.d.ts","sourceRoot":"","sources":["../../src/factory/detectors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"detectors.d.ts","sourceRoot":"","sources":["../../src/factory/detectors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,wEAAwE;AACxE,wBAAgB,gBAAgB,CAC9B,GAAG,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,EAAE,IAEzD,SAAS,YAAY,KAAG,OAAO,CAAC,OAAO,CAAC,CAMvD;AAED,4CAA4C;AAC5C,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,IAC1C,SAAS,YAAY,KAAG,OAAO,CAAC,OAAO,CAAC,CAGvD;AAED,iDAAiD;AACjD,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,IAC1C,SAAS,YAAY,KAAG,OAAO,CAAC,OAAO,CAAC,CAGvD;AAED,yDAAyD;AACzD,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,MAAM,EAAE,IAC/C,SAAS,YAAY,KAAG,OAAO,CAAC,OAAO,CAAC,CAcvD"}
|