@chuckcchen/vite-plugin 1.0.3 → 1.0.5
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 -45
- package/dist/bundler.d.ts.map +1 -1
- package/dist/bundler.js +30 -172
- package/dist/bundler.js.map +1 -1
- package/dist/core.d.ts +0 -8
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +15 -56
- package/dist/core.js.map +1 -1
- package/dist/factory.d.ts +51 -45
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +215 -184
- package/dist/factory.js.map +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -6
- package/dist/index.js.map +1 -1
- package/dist/route-parser.d.ts +141 -0
- package/dist/route-parser.d.ts.map +1 -0
- package/dist/route-parser.js +293 -0
- package/dist/route-parser.js.map +1 -0
- package/dist/types.d.ts +0 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +64 -125
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +230 -168
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/bundler.d.ts
CHANGED
|
@@ -1,66 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* EdgeOne Vite Plugin Adapter - Server Bundling Module
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Handles server-side code bundling using esbuild:
|
|
5
5
|
* - Bundle framework's server build artifacts into a single file
|
|
6
6
|
* - Generate HTTP request handling wrapper code
|
|
7
|
-
* - Handle Node.js request to Web API Request conversion
|
|
8
7
|
*/
|
|
9
8
|
import * as esbuild from "esbuild";
|
|
10
9
|
import type { BuildContext, ServerBundleConfig, ServerWrapperConfig } from "./types.js";
|
|
11
10
|
/**
|
|
12
11
|
* Bundle server code using esbuild
|
|
13
|
-
*
|
|
14
|
-
* Bundle server entry file and all dependencies into a single JavaScript file
|
|
15
|
-
* for running in EdgeOne edge function environment
|
|
16
|
-
*
|
|
17
|
-
* @param context - Build context containing project root and logger
|
|
18
|
-
* @param config - Bundle configuration including entry points, output path, etc.
|
|
19
|
-
* @returns esbuild build result containing metadata info
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* await bundleServerCode(context, {
|
|
23
|
-
* entryPoints: ['server-wrapper.temp.js'],
|
|
24
|
-
* outfile: '.edgeone/server-handler/handler.js'
|
|
25
|
-
* });
|
|
26
12
|
*/
|
|
27
13
|
export declare function bundleServerCode(context: BuildContext, config: ServerBundleConfig): Promise<esbuild.BuildResult>;
|
|
28
14
|
/**
|
|
29
15
|
* Create server wrapper file
|
|
30
16
|
*
|
|
31
|
-
*
|
|
32
|
-
* The wrapper is responsible for:
|
|
33
|
-
* 1. Converting Node.js IncomingMessage to Web API Request object
|
|
34
|
-
* 2. Calling framework's request handler function
|
|
35
|
-
* 3. Exporting unified request handling interface
|
|
36
|
-
*
|
|
37
|
-
* @param context - Build context
|
|
38
|
-
* @param config - Wrapper configuration
|
|
39
|
-
* @returns Path to generated temporary wrapper file
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* const wrapperPath = await createServerWrapper(context, {
|
|
43
|
-
* serverEntryPath: 'build/server/index.js'
|
|
44
|
-
* });
|
|
17
|
+
* Wraps framework's server build into a unified HTTP request handler.
|
|
45
18
|
*/
|
|
46
19
|
export declare function createServerWrapper(context: BuildContext, config: ServerWrapperConfig): Promise<string>;
|
|
47
20
|
/**
|
|
48
21
|
* Cleanup temporary wrapper file
|
|
49
|
-
* Delete temporarily generated wrapper file after bundling completes
|
|
50
|
-
*
|
|
51
|
-
* @param wrapperPath - Wrapper file path
|
|
52
|
-
*/
|
|
53
|
-
export declare function cleanupWrapper(wrapperPath: string): Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* Get bundle result file size
|
|
56
|
-
*
|
|
57
|
-
* @param result - esbuild build result
|
|
58
|
-
* @returns Bundled file size in bytes, returns 0 if unavailable
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* const result = await bundleServerCode(context, config);
|
|
62
|
-
* const size = getBundleSize(result);
|
|
63
|
-
* console.log(`Bundle size: ${formatSize(size)}`);
|
|
64
22
|
*/
|
|
65
|
-
export declare function
|
|
23
|
+
export declare function cleanupWrapper(wrapperPath: string, logger?: {
|
|
24
|
+
verbose?: (msg: string) => void;
|
|
25
|
+
}): Promise<void>;
|
|
66
26
|
//# sourceMappingURL=bundler.d.ts.map
|
package/dist/bundler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../src/bundler.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../src/bundler.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAYxF;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CA6B9B;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,MAAM,CAAC,CA+BjB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAMrH"}
|
package/dist/bundler.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* EdgeOne Vite Plugin Adapter - Server Bundling Module
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Handles server-side code bundling using esbuild:
|
|
5
5
|
* - Bundle framework's server build artifacts into a single file
|
|
6
6
|
* - Generate HTTP request handling wrapper code
|
|
7
|
-
* - Handle Node.js request to Web API Request conversion
|
|
8
7
|
*/
|
|
9
8
|
import * as esbuild from "esbuild";
|
|
10
9
|
import path from "path";
|
|
11
|
-
import {
|
|
10
|
+
import { writeFile, deleteFile, ensureDirectory, generateServerWrapperCode, readFile } from "./utils.js";
|
|
12
11
|
/**
|
|
13
12
|
* Default ESM compatibility banner code
|
|
14
13
|
* Provides CommonJS require, __filename, __dirname support in ESM modules
|
|
15
|
-
* This is because some dependencies may still use CommonJS syntax
|
|
16
14
|
*/
|
|
17
15
|
const DEFAULT_BANNER = `import { createRequire } from 'node:module';
|
|
18
16
|
const require = createRequire(import.meta.url);
|
|
@@ -20,43 +18,28 @@ const __filename = new URL('', import.meta.url).pathname;
|
|
|
20
18
|
const __dirname = new URL('.', import.meta.url).pathname;`;
|
|
21
19
|
/**
|
|
22
20
|
* Bundle server code using esbuild
|
|
23
|
-
*
|
|
24
|
-
* Bundle server entry file and all dependencies into a single JavaScript file
|
|
25
|
-
* for running in EdgeOne edge function environment
|
|
26
|
-
*
|
|
27
|
-
* @param context - Build context containing project root and logger
|
|
28
|
-
* @param config - Bundle configuration including entry points, output path, etc.
|
|
29
|
-
* @returns esbuild build result containing metadata info
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* await bundleServerCode(context, {
|
|
33
|
-
* entryPoints: ['server-wrapper.temp.js'],
|
|
34
|
-
* outfile: '.edgeone/server-handler/handler.js'
|
|
35
|
-
* });
|
|
36
21
|
*/
|
|
37
22
|
export async function bundleServerCode(context, config) {
|
|
38
23
|
const { projectRoot, logger } = context;
|
|
39
24
|
logger.verbose("Bundling server code...");
|
|
40
|
-
// Ensure output directory exists
|
|
41
25
|
await ensureDirectory(path.dirname(config.outfile));
|
|
42
|
-
// Bundle using esbuild
|
|
43
26
|
const result = await esbuild.build({
|
|
44
|
-
entryPoints: config.entryPoints,
|
|
45
|
-
bundle: true,
|
|
46
|
-
platform: "node",
|
|
47
|
-
target: "node18",
|
|
48
|
-
format: "esm",
|
|
49
|
-
outfile: config.outfile,
|
|
50
|
-
minify: false,
|
|
51
|
-
treeShaking: true,
|
|
52
|
-
external: ["node:*", ...(config.external || [])],
|
|
53
|
-
metafile: true,
|
|
54
|
-
logLevel: "warning",
|
|
55
|
-
absWorkingDir: projectRoot,
|
|
27
|
+
entryPoints: config.entryPoints,
|
|
28
|
+
bundle: true,
|
|
29
|
+
platform: "node",
|
|
30
|
+
target: "node18",
|
|
31
|
+
format: "esm",
|
|
32
|
+
outfile: config.outfile,
|
|
33
|
+
minify: false,
|
|
34
|
+
treeShaking: true,
|
|
35
|
+
external: ["node:*", ...(config.external || [])],
|
|
36
|
+
metafile: true,
|
|
37
|
+
logLevel: "warning",
|
|
38
|
+
absWorkingDir: projectRoot,
|
|
56
39
|
banner: {
|
|
57
|
-
js: DEFAULT_BANNER,
|
|
40
|
+
js: DEFAULT_BANNER,
|
|
58
41
|
},
|
|
59
|
-
...config.esbuildOptions,
|
|
42
|
+
...config.esbuildOptions,
|
|
60
43
|
});
|
|
61
44
|
logger.verbose(`Server code bundled to: ${config.outfile}`);
|
|
62
45
|
return result;
|
|
@@ -64,37 +47,27 @@ export async function bundleServerCode(context, config) {
|
|
|
64
47
|
/**
|
|
65
48
|
* Create server wrapper file
|
|
66
49
|
*
|
|
67
|
-
*
|
|
68
|
-
* The wrapper is responsible for:
|
|
69
|
-
* 1. Converting Node.js IncomingMessage to Web API Request object
|
|
70
|
-
* 2. Calling framework's request handler function
|
|
71
|
-
* 3. Exporting unified request handling interface
|
|
72
|
-
*
|
|
73
|
-
* @param context - Build context
|
|
74
|
-
* @param config - Wrapper configuration
|
|
75
|
-
* @returns Path to generated temporary wrapper file
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* const wrapperPath = await createServerWrapper(context, {
|
|
79
|
-
* serverEntryPath: 'build/server/index.js'
|
|
80
|
-
* });
|
|
50
|
+
* Wraps framework's server build into a unified HTTP request handler.
|
|
81
51
|
*/
|
|
82
52
|
export async function createServerWrapper(context, config) {
|
|
83
53
|
const { projectRoot, logger } = context;
|
|
84
54
|
logger.verbose("Creating server wrapper...");
|
|
85
|
-
// Read original server build content
|
|
86
|
-
const serverBuildContent = await readFile(config.serverEntryPath);
|
|
87
|
-
// Generate wrapper content
|
|
88
55
|
let wrapperContent;
|
|
89
56
|
if (config.wrapperTemplate) {
|
|
90
|
-
// Use custom template
|
|
57
|
+
// Use custom template
|
|
58
|
+
const serverBuildContent = await readFile(config.serverEntryPath);
|
|
91
59
|
wrapperContent = config.wrapperTemplate.replace("{{SERVER_BUILD_CONTENT}}", serverBuildContent);
|
|
92
60
|
}
|
|
93
61
|
else {
|
|
94
|
-
// Use
|
|
95
|
-
wrapperContent =
|
|
62
|
+
// Use generateServerWrapperCode from utils
|
|
63
|
+
wrapperContent = await generateServerWrapperCode({
|
|
64
|
+
serverEntryPath: config.serverEntryPath,
|
|
65
|
+
handlerSetup: config.banner || "",
|
|
66
|
+
handlerCall: "handler(webRequest, ...args)",
|
|
67
|
+
mode: "inline",
|
|
68
|
+
additionalExports: config.exports,
|
|
69
|
+
});
|
|
96
70
|
}
|
|
97
|
-
// Write to temporary file
|
|
98
71
|
const tempPath = path.join(projectRoot, "server-wrapper.temp.js");
|
|
99
72
|
await writeFile(tempPath, wrapperContent);
|
|
100
73
|
logger.verbose("Server wrapper created");
|
|
@@ -102,128 +75,13 @@ export async function createServerWrapper(context, config) {
|
|
|
102
75
|
}
|
|
103
76
|
/**
|
|
104
77
|
* Cleanup temporary wrapper file
|
|
105
|
-
* Delete temporarily generated wrapper file after bundling completes
|
|
106
|
-
*
|
|
107
|
-
* @param wrapperPath - Wrapper file path
|
|
108
78
|
*/
|
|
109
|
-
export async function cleanupWrapper(wrapperPath) {
|
|
79
|
+
export async function cleanupWrapper(wrapperPath, logger) {
|
|
110
80
|
try {
|
|
111
81
|
await deleteFile(wrapperPath);
|
|
112
82
|
}
|
|
113
|
-
catch {
|
|
114
|
-
|
|
83
|
+
catch (error) {
|
|
84
|
+
logger?.verbose?.(`Failed to cleanup wrapper file ${wrapperPath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
115
85
|
}
|
|
116
86
|
}
|
|
117
|
-
/**
|
|
118
|
-
* Generate default server wrapper code
|
|
119
|
-
*
|
|
120
|
-
* Wrapper code contains:
|
|
121
|
-
* 1. Original server build content
|
|
122
|
-
* 2. Node.js request to Web Request conversion function
|
|
123
|
-
* 3. Unified request handler export
|
|
124
|
-
*
|
|
125
|
-
* @param serverBuildContent - Original server build code content
|
|
126
|
-
* @param config - Wrapper configuration
|
|
127
|
-
* @returns Generated wrapper code string
|
|
128
|
-
*/
|
|
129
|
-
function generateDefaultWrapper(serverBuildContent, config) {
|
|
130
|
-
const banner = config.banner || "";
|
|
131
|
-
const exports = config.exports || [];
|
|
132
|
-
// Build export statement
|
|
133
|
-
const exportsStr = exports.length > 0
|
|
134
|
-
? exports.join(", ")
|
|
135
|
-
: "default as handler";
|
|
136
|
-
return `// ========== Server Build Content ==========
|
|
137
|
-
${serverBuildContent}
|
|
138
|
-
|
|
139
|
-
// ========== HTTP Server Wrapper ==========
|
|
140
|
-
${banner}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Convert Node.js IncomingMessage to Web API Request
|
|
144
|
-
*
|
|
145
|
-
* EdgeOne edge functions use Web API standard Request/Response,
|
|
146
|
-
* but some framework server builds may expect Node.js style request objects.
|
|
147
|
-
* This function handles the conversion.
|
|
148
|
-
*
|
|
149
|
-
* @param nodeReq - Node.js IncomingMessage object
|
|
150
|
-
* @returns Web API Request object
|
|
151
|
-
*/
|
|
152
|
-
function nodeRequestToWebRequest(nodeReq) {
|
|
153
|
-
// Build complete URL
|
|
154
|
-
// Determine protocol based on whether connection is encrypted
|
|
155
|
-
const protocol = nodeReq.connection?.encrypted ? 'https' : 'http';
|
|
156
|
-
const host = nodeReq.headers.host || 'localhost';
|
|
157
|
-
const url = \`\${protocol}://\${host}\${nodeReq.url}\`;
|
|
158
|
-
|
|
159
|
-
// Convert request headers
|
|
160
|
-
// Node.js headers are plain objects, need to convert to Headers instance
|
|
161
|
-
const headers = new Headers();
|
|
162
|
-
for (const [key, value] of Object.entries(nodeReq.headers)) {
|
|
163
|
-
if (value) {
|
|
164
|
-
if (Array.isArray(value)) {
|
|
165
|
-
// Multi-value headers (like Set-Cookie) need multiple appends
|
|
166
|
-
value.forEach(v => headers.append(key, v));
|
|
167
|
-
} else {
|
|
168
|
-
headers.set(key, value);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// Build Request init options
|
|
174
|
-
const init = {
|
|
175
|
-
method: nodeReq.method,
|
|
176
|
-
headers: headers,
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
// Add request body for non-GET/HEAD requests
|
|
180
|
-
// GET and HEAD requests should not have body
|
|
181
|
-
if (nodeReq.method !== 'GET' && nodeReq.method !== 'HEAD') {
|
|
182
|
-
init.body = nodeReq;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return new Request(url, init);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Node.js request handler wrapper function
|
|
190
|
-
*
|
|
191
|
-
* This is the main entry exported for EdgeOne edge functions to call.
|
|
192
|
-
* Responsible for converting Node.js request before passing to framework handler.
|
|
193
|
-
*
|
|
194
|
-
* @param nodeReq - Node.js request object
|
|
195
|
-
* @param args - Other arguments (e.g. env variables, context, etc.)
|
|
196
|
-
* @returns Framework handler return value (usually Response object)
|
|
197
|
-
*/
|
|
198
|
-
async function nodeRequestHandler(nodeReq, ...args) {
|
|
199
|
-
const webRequest = nodeRequestToWebRequest(nodeReq);
|
|
200
|
-
return handler(webRequest, ...args);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export default nodeRequestHandler;
|
|
204
|
-
export { ${exportsStr} };
|
|
205
|
-
`;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Get bundle result file size
|
|
209
|
-
*
|
|
210
|
-
* @param result - esbuild build result
|
|
211
|
-
* @returns Bundled file size in bytes, returns 0 if unavailable
|
|
212
|
-
*
|
|
213
|
-
* @example
|
|
214
|
-
* const result = await bundleServerCode(context, config);
|
|
215
|
-
* const size = getBundleSize(result);
|
|
216
|
-
* console.log(`Bundle size: ${formatSize(size)}`);
|
|
217
|
-
*/
|
|
218
|
-
export function getBundleSize(result) {
|
|
219
|
-
// Need metafile to get size info
|
|
220
|
-
if (!result.metafile)
|
|
221
|
-
return 0;
|
|
222
|
-
const outputs = result.metafile.outputs;
|
|
223
|
-
const outputKeys = Object.keys(outputs);
|
|
224
|
-
if (outputKeys.length === 0)
|
|
225
|
-
return 0;
|
|
226
|
-
// Return size of first output file
|
|
227
|
-
return outputs[outputKeys[0]].bytes;
|
|
228
|
-
}
|
|
229
87
|
//# sourceMappingURL=bundler.js.map
|
package/dist/bundler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["../src/bundler.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["../src/bundler.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEzG;;;GAGG;AACH,MAAM,cAAc,GAAG;;;0DAGmC,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAqB,EACrB,MAA0B;IAE1B,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO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;IACJ,CAAC;SAAM,CAAC;QACN,2CAA2C;QAC3C,cAAc,GAAG,MAAM,yBAAyB,CAAC;YAC/C,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,YAAY,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;YACjC,WAAW,EAAE,8BAA8B;YAC3C,IAAI,EAAE,QAAQ;YACd,iBAAiB,EAAE,MAAM,CAAC,OAAO;SAClC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,wBAAwB,CAAC,CAAC;IAClE,MAAM,SAAS,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAE1C,MAAM,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAEzC,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,WAAmB,EAAE,MAA4C;IACpG,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,WAAW,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,EAAE,OAAO,EAAE,CAAC,kCAAkC,WAAW,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAChI,CAAC;AACH,CAAC"}
|
package/dist/core.d.ts
CHANGED
|
@@ -20,15 +20,7 @@ import type { CoreAdapterOptions } from "./types.js";
|
|
|
20
20
|
* @returns Vite plugin instance
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
|
-
* // Basic usage
|
|
24
23
|
* createCoreAdapter({ verbose: true })
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* // Using framework adapter
|
|
28
|
-
* createCoreAdapter({
|
|
29
|
-
* adapter: myFrameworkAdapter,
|
|
30
|
-
* outputDir: '.edgeone'
|
|
31
|
-
* })
|
|
32
24
|
*/
|
|
33
25
|
export declare function createCoreAdapter(options?: CoreAdapterOptions): Plugin;
|
|
34
26
|
export default createCoreAdapter;
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAC;AAEnD,OAAO,KAAK,EACV,kBAAkB,EAOnB,MAAM,YAAY,CAAC;AAepB
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAC;AAEnD,OAAO,KAAK,EACV,kBAAkB,EAOnB,MAAM,YAAY,CAAC;AAepB;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,MAAM,CAqI1E;AA8RD,eAAe,iBAAiB,CAAC"}
|
package/dist/core.js
CHANGED
|
@@ -22,25 +22,17 @@ import fs from "fs/promises";
|
|
|
22
22
|
* @returns Vite plugin instance
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
|
-
* // Basic usage
|
|
26
25
|
* createCoreAdapter({ verbose: true })
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* // Using framework adapter
|
|
30
|
-
* createCoreAdapter({
|
|
31
|
-
* adapter: myFrameworkAdapter,
|
|
32
|
-
* outputDir: '.edgeone'
|
|
33
|
-
* })
|
|
34
26
|
*/
|
|
35
27
|
export function createCoreAdapter(options = {}) {
|
|
36
28
|
// Destructure config options with defaults
|
|
37
29
|
const { verbose = false, // Enable verbose logging
|
|
38
|
-
outputDir = ".edgeone", // Output directory
|
|
39
|
-
cleanOutput = true, // Clean output directory before build
|
|
40
30
|
adapter, // Framework adapter instance
|
|
41
31
|
hooks = {}, // Custom hook functions
|
|
42
32
|
ssr: ssrOption, // SSR mode configuration
|
|
43
33
|
} = options;
|
|
34
|
+
// Fixed output directory
|
|
35
|
+
const outputDir = ".edgeone";
|
|
44
36
|
// Create logger instance
|
|
45
37
|
const logger = createLogger(verbose);
|
|
46
38
|
// Plugin state variables
|
|
@@ -78,23 +70,11 @@ export function createCoreAdapter(options = {}) {
|
|
|
78
70
|
logger.verbose("SSR mode:", isSSR);
|
|
79
71
|
},
|
|
80
72
|
/**
|
|
81
|
-
* Hook called after build
|
|
82
|
-
*
|
|
73
|
+
* Hook called after entire build process completes
|
|
74
|
+
* Using closeBundle instead of writeBundle to ensure all files are generated
|
|
75
|
+
* (including prerendered pages which may be generated in later stages)
|
|
83
76
|
*/
|
|
84
|
-
async
|
|
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
|
|
94
|
-
if (isSSR && !isBuildingForSSR) {
|
|
95
|
-
logger.verbose("Skipping processing (waiting for SSR build to complete)");
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
77
|
+
async closeBundle() {
|
|
98
78
|
// Prevent duplicate processing
|
|
99
79
|
if (hasProcessed) {
|
|
100
80
|
logger.verbose("Skipping processing (already processed)");
|
|
@@ -136,9 +116,7 @@ export function createCoreAdapter(options = {}) {
|
|
|
136
116
|
await hooks.afterBuild(context, artifacts);
|
|
137
117
|
}
|
|
138
118
|
// Clean output directory
|
|
139
|
-
|
|
140
|
-
await cleanOutputDir(context);
|
|
141
|
-
}
|
|
119
|
+
await cleanOutputDir(context);
|
|
142
120
|
// Copy static assets
|
|
143
121
|
if (artifacts.clientDir) {
|
|
144
122
|
await copyStaticAssets(context, artifacts.clientDir);
|
|
@@ -147,8 +125,10 @@ export function createCoreAdapter(options = {}) {
|
|
|
147
125
|
if (isSSR && artifacts.serverEntry) {
|
|
148
126
|
await bundleServer(context, artifacts, adapter);
|
|
149
127
|
}
|
|
150
|
-
// Generate meta.json config file
|
|
151
|
-
|
|
128
|
+
// Generate meta.json config file (only for SSR mode with server entry)
|
|
129
|
+
if (artifacts.serverEntry) {
|
|
130
|
+
await generateMetaJson(context, adapter);
|
|
131
|
+
}
|
|
152
132
|
logger.verbose("EdgeOne adapter processing complete");
|
|
153
133
|
}
|
|
154
134
|
catch (error) {
|
|
@@ -158,25 +138,6 @@ export function createCoreAdapter(options = {}) {
|
|
|
158
138
|
},
|
|
159
139
|
};
|
|
160
140
|
}
|
|
161
|
-
/**
|
|
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
141
|
/**
|
|
181
142
|
* Detect build artifacts using default paths
|
|
182
143
|
*
|
|
@@ -399,12 +360,10 @@ async function generateMetaJson(context, adapter) {
|
|
|
399
360
|
}
|
|
400
361
|
// Convert config to JSON string
|
|
401
362
|
const metaContent = JSON.stringify(metaConfig, null, 2);
|
|
402
|
-
//
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
}
|
|
407
|
-
// Write meta.json in output root directory
|
|
363
|
+
// Write meta.json in server-handler directory (for SSR runtime)
|
|
364
|
+
const serverMetaPath = path.join(projectRoot, outputDir, "server-handler", "meta.json");
|
|
365
|
+
await writeFile(serverMetaPath, metaContent);
|
|
366
|
+
// Write meta.json in output root directory (for deployment)
|
|
408
367
|
const rootMetaPath = path.join(projectRoot, outputDir, "meta.json");
|
|
409
368
|
await writeFile(rootMetaPath, metaContent);
|
|
410
369
|
logger.verbose(`meta.json generated with ${routes.length} routes`);
|
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
|
|
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;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAA8B,EAA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