@chuckcchen/vite-plugin 1.0.2 → 1.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 +2 -44
- package/dist/bundler.d.ts.map +1 -1
- package/dist/bundler.js +29 -170
- package/dist/bundler.js.map +1 -1
- package/dist/factory.d.ts +16 -43
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +89 -89
- package/dist/factory.js.map +1 -1
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -6
- package/dist/index.js.map +1 -1
- package/dist/utils.d.ts +57 -125
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +182 -170
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/factory.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Adapter Factory - Simplifies the creation of framework adapters
|
|
3
3
|
*
|
|
4
|
-
* Provides factory functions and preset configurations to reduce boilerplate code
|
|
4
|
+
* Provides factory functions and preset configurations to reduce boilerplate code
|
|
5
5
|
*/
|
|
6
6
|
import path from "path";
|
|
7
|
-
import { detectConfigFile, detectBuildDir, detectServerEntry, generateServerWrapperCode, createDefaultMeta, logBuildArtifacts, } from "./
|
|
8
|
-
import { pathExists } from "./utils.js";
|
|
7
|
+
import { pathExists, readFile, detectConfigFile, detectBuildDir, detectServerEntry, generateServerWrapperCode, createDefaultMeta, logBuildArtifacts, } from "./utils.js";
|
|
9
8
|
/**
|
|
10
9
|
* Built-in server wrapper presets
|
|
11
10
|
*/
|
|
@@ -54,27 +53,49 @@ const buildConfig = {
|
|
|
54
53
|
const requestHandler = createRequestHandler(buildConfig);`.trim(),
|
|
55
54
|
handlerCall: "requestHandler(webRequest, ...args)",
|
|
56
55
|
},
|
|
56
|
+
/** Vite SSR - standard Vite SSR with render function */
|
|
57
|
+
viteSSR: {
|
|
58
|
+
requiresHtmlTemplate: true,
|
|
59
|
+
handlerSetup: `
|
|
60
|
+
const renderFn = typeof render === 'function'
|
|
61
|
+
? render
|
|
62
|
+
: (typeof module !== 'undefined' && typeof module.render === 'function' ? module.render : null);
|
|
63
|
+
|
|
64
|
+
if (!renderFn) {
|
|
65
|
+
throw new Error('No render function found in server build. Expected export: render(url)');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function handleSSRRequest(request) {
|
|
69
|
+
const url = new URL(request.url);
|
|
70
|
+
const pathname = url.pathname;
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
const rendered = await renderFn(pathname);
|
|
74
|
+
let html = __HTML_TEMPLATE__
|
|
75
|
+
.replace('<!--app-head-->', rendered.head ?? '')
|
|
76
|
+
.replace('<!--app-html-->', rendered.html ?? '');
|
|
77
|
+
|
|
78
|
+
return new Response(html, {
|
|
79
|
+
status: 200,
|
|
80
|
+
headers: { 'Content-Type': 'text/html; charset=utf-8' }
|
|
81
|
+
});
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error('SSR render error:', error);
|
|
84
|
+
return new Response('Internal Server Error: ' + error.message, {
|
|
85
|
+
status: 500,
|
|
86
|
+
headers: { 'Content-Type': 'text/plain' }
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}`.trim(),
|
|
90
|
+
handlerCall: "handleSSRRequest(webRequest)",
|
|
91
|
+
},
|
|
57
92
|
};
|
|
58
93
|
/**
|
|
59
94
|
* Create a framework adapter
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* ```ts
|
|
63
|
-
* const adapter = createFrameworkAdapter({
|
|
64
|
-
* name: "my-framework",
|
|
65
|
-
* configFiles: ["my-framework.config.ts", "my-framework.config.js"],
|
|
66
|
-
* buildDirs: {
|
|
67
|
-
* client: ["dist/client", "dist"],
|
|
68
|
-
* server: ["dist/server"],
|
|
69
|
-
* },
|
|
70
|
-
* serverWrapper: "generic",
|
|
71
|
-
* });
|
|
72
|
-
* ```
|
|
73
95
|
*/
|
|
74
96
|
export function createFrameworkAdapter(config, options = {}, overrides) {
|
|
75
|
-
const { name, configFiles, buildDirs, serverEntryFiles = ["index.js", "index.mjs", "entry.js", "main.js"], serverWrapper = "generic", defaultRoutes = ["/"], ssrExtraRoutes = [], ssr404, } = config;
|
|
97
|
+
const { name, configFiles, buildDirs, serverEntryFiles = ["index.js", "index.mjs", "entry.js", "main.js"], serverWrapper = "generic", defaultRoutes = ["/"], ssrExtraRoutes = [], ssr404, htmlTemplatePaths = ["dist/client/index.html", "dist/index.html"], } = config;
|
|
76
98
|
const { clientBuildDir, serverBuildDir, serverEntry, routes = defaultRoutes, } = options;
|
|
77
|
-
// Resolve server wrapper configuration
|
|
78
99
|
const wrapperConfig = typeof serverWrapper === "string"
|
|
79
100
|
? SERVER_WRAPPER_PRESETS[serverWrapper]
|
|
80
101
|
: serverWrapper;
|
|
@@ -86,18 +107,13 @@ export function createFrameworkAdapter(config, options = {}, overrides) {
|
|
|
86
107
|
},
|
|
87
108
|
async getBuildArtifacts(context) {
|
|
88
109
|
const { projectRoot, isSSR, logger } = context;
|
|
89
|
-
// Detect client directory
|
|
90
110
|
let clientDir = null;
|
|
91
111
|
if (clientBuildDir) {
|
|
92
112
|
clientDir = path.join(projectRoot, clientBuildDir);
|
|
93
113
|
}
|
|
94
114
|
else {
|
|
95
|
-
|
|
96
|
-
? buildDirs.client
|
|
97
|
-
: buildDirs.client;
|
|
98
|
-
clientDir = await detectBuildDir(projectRoot, candidates);
|
|
115
|
+
clientDir = await detectBuildDir(projectRoot, buildDirs.client);
|
|
99
116
|
}
|
|
100
|
-
// Detect server directory and entry
|
|
101
117
|
let serverDir = null;
|
|
102
118
|
let serverEntryPath = null;
|
|
103
119
|
if (isSSR && buildDirs.server) {
|
|
@@ -133,7 +149,6 @@ export function createFrameworkAdapter(config, options = {}, overrides) {
|
|
|
133
149
|
isStatic: !context.isSSR,
|
|
134
150
|
srcRoute: route,
|
|
135
151
|
}));
|
|
136
|
-
// Add extra routes for SSR mode
|
|
137
152
|
if (context.isSSR && ssrExtraRoutes.length > 0) {
|
|
138
153
|
ssrExtraRoutes.forEach((route) => {
|
|
139
154
|
routeList.push({ path: route, isStatic: false, srcRoute: route });
|
|
@@ -143,7 +158,6 @@ export function createFrameworkAdapter(config, options = {}, overrides) {
|
|
|
143
158
|
},
|
|
144
159
|
async generateMeta(context, routeList) {
|
|
145
160
|
const meta = createDefaultMeta(routeList, { isSSR: context.isSSR });
|
|
146
|
-
// Custom ssr404 handling
|
|
147
161
|
if (ssr404 !== undefined) {
|
|
148
162
|
meta.conf.ssr404 = typeof ssr404 === "function"
|
|
149
163
|
? ssr404(context.isSSR)
|
|
@@ -151,93 +165,92 @@ export function createFrameworkAdapter(config, options = {}, overrides) {
|
|
|
151
165
|
}
|
|
152
166
|
return meta;
|
|
153
167
|
},
|
|
154
|
-
async generateServerWrapper(
|
|
168
|
+
async generateServerWrapper(context, wrapperCfg) {
|
|
169
|
+
let handlerSetup = wrapperConfig.handlerSetup;
|
|
170
|
+
if (wrapperConfig.requiresHtmlTemplate) {
|
|
171
|
+
const { projectRoot, outputDir, logger } = context;
|
|
172
|
+
let htmlTemplate = "";
|
|
173
|
+
const templateCandidates = [
|
|
174
|
+
...htmlTemplatePaths.map(p => path.join(projectRoot, p)),
|
|
175
|
+
path.join(projectRoot, outputDir, "assets/index.html"),
|
|
176
|
+
];
|
|
177
|
+
for (const templatePath of templateCandidates) {
|
|
178
|
+
if (await pathExists(templatePath)) {
|
|
179
|
+
htmlTemplate = await readFile(templatePath);
|
|
180
|
+
logger.verbose(`Found HTML template: ${templatePath}`);
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (!htmlTemplate) {
|
|
185
|
+
logger.warn("HTML template not found, using default template");
|
|
186
|
+
htmlTemplate = "<!DOCTYPE html><html><head><!--app-head--></head><body><div id=\"app\"><!--app-html--></div></body></html>";
|
|
187
|
+
}
|
|
188
|
+
const escapedTemplate = JSON.stringify(htmlTemplate);
|
|
189
|
+
handlerSetup = `const __HTML_TEMPLATE__ = ${escapedTemplate};\n\n${handlerSetup}`;
|
|
190
|
+
}
|
|
155
191
|
return generateServerWrapperCode({
|
|
156
|
-
serverEntryPath:
|
|
192
|
+
serverEntryPath: wrapperCfg.serverEntryPath,
|
|
157
193
|
imports: wrapperConfig.imports,
|
|
158
|
-
handlerSetup
|
|
194
|
+
handlerSetup,
|
|
159
195
|
handlerCall: wrapperConfig.handlerCall,
|
|
160
196
|
});
|
|
161
197
|
},
|
|
162
198
|
},
|
|
163
199
|
};
|
|
164
|
-
// Merge user overrides
|
|
165
200
|
if (overrides) {
|
|
166
|
-
return
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
* Merge adapter configurations
|
|
172
|
-
*/
|
|
173
|
-
function mergeAdapter(base, overrides) {
|
|
174
|
-
const merged = {
|
|
175
|
-
...base,
|
|
176
|
-
...overrides,
|
|
177
|
-
name: overrides.name || base.name,
|
|
178
|
-
};
|
|
179
|
-
// Merge hooks
|
|
180
|
-
if (base.hooks || overrides.hooks) {
|
|
181
|
-
merged.hooks = {
|
|
182
|
-
...base.hooks,
|
|
183
|
-
...overrides.hooks,
|
|
201
|
+
return {
|
|
202
|
+
...baseAdapter,
|
|
203
|
+
...overrides,
|
|
204
|
+
name: overrides.name || baseAdapter.name,
|
|
205
|
+
hooks: { ...baseAdapter.hooks, ...overrides.hooks },
|
|
184
206
|
};
|
|
185
207
|
}
|
|
186
|
-
return
|
|
208
|
+
return baseAdapter;
|
|
187
209
|
}
|
|
188
210
|
/**
|
|
189
|
-
* Create a stateful adapter
|
|
190
|
-
* Used for complex adapters that need to share state between different hooks
|
|
211
|
+
* Create a stateful adapter (for complex adapters needing shared state)
|
|
191
212
|
*/
|
|
192
213
|
export function createStatefulAdapter(initialState, factory) {
|
|
193
|
-
|
|
194
|
-
return factory(state);
|
|
214
|
+
return factory({ ...initialState });
|
|
195
215
|
}
|
|
196
216
|
/**
|
|
197
|
-
*
|
|
217
|
+
* Combine multiple detector functions (returns true if any matches)
|
|
198
218
|
*/
|
|
199
|
-
export function
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
219
|
+
export function combineDetectors(...detectors) {
|
|
220
|
+
return async (context) => {
|
|
221
|
+
for (const detector of detectors) {
|
|
222
|
+
if (await detector(context)) {
|
|
223
|
+
return true;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return false;
|
|
227
|
+
};
|
|
207
228
|
}
|
|
208
229
|
/**
|
|
209
|
-
* Create
|
|
230
|
+
* Create detector based on config files
|
|
210
231
|
*/
|
|
211
232
|
export function createConfigDetector(configFiles) {
|
|
212
233
|
return async (context) => {
|
|
213
|
-
|
|
214
|
-
return configPath !== null;
|
|
234
|
+
return (await detectConfigFile(context.projectRoot, configFiles)) !== null;
|
|
215
235
|
};
|
|
216
236
|
}
|
|
217
237
|
/**
|
|
218
|
-
* Create
|
|
238
|
+
* Create detector based on build directories
|
|
219
239
|
*/
|
|
220
240
|
export function createBuildDirDetector(buildDirs) {
|
|
221
241
|
return async (context) => {
|
|
222
|
-
|
|
223
|
-
if (await pathExists(path.join(context.projectRoot, dir))) {
|
|
224
|
-
return true;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
return false;
|
|
242
|
+
return (await detectBuildDir(context.projectRoot, buildDirs)) !== null;
|
|
228
243
|
};
|
|
229
244
|
}
|
|
230
245
|
/**
|
|
231
|
-
* Create
|
|
246
|
+
* Create detector based on package.json dependencies
|
|
232
247
|
*/
|
|
233
248
|
export function createDependencyDetector(dependencies) {
|
|
234
249
|
return async (context) => {
|
|
235
250
|
const packageJsonPath = path.join(context.projectRoot, "package.json");
|
|
236
|
-
if (!await pathExists(packageJsonPath))
|
|
251
|
+
if (!await pathExists(packageJsonPath))
|
|
237
252
|
return false;
|
|
238
|
-
}
|
|
239
253
|
try {
|
|
240
|
-
const { readFile } = await import("./utils.js");
|
|
241
254
|
const content = await readFile(packageJsonPath);
|
|
242
255
|
const packageJson = JSON.parse(content);
|
|
243
256
|
const deps = { ...packageJson.dependencies, ...packageJson.devDependencies };
|
|
@@ -248,17 +261,4 @@ export function createDependencyDetector(dependencies) {
|
|
|
248
261
|
}
|
|
249
262
|
};
|
|
250
263
|
}
|
|
251
|
-
/**
|
|
252
|
-
* Combine multiple detector functions (returns true if any matches)
|
|
253
|
-
*/
|
|
254
|
-
export function combineDetectors(...detectors) {
|
|
255
|
-
return async (context) => {
|
|
256
|
-
for (const detector of detectors) {
|
|
257
|
-
if (await detector(context)) {
|
|
258
|
-
return true;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
return false;
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
264
|
//# sourceMappingURL=factory.js.map
|
package/dist/factory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AASxB,OAAO,EACL,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAYpB;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,0DAA0D;IAC1D,OAAO,EAAE;QACP,YAAY,EAAE;;;;;;;EAOhB,CAAC,IAAI,EAAE;QACL,WAAW,EAAE,8BAA8B;KAC5C;IAED,sCAAsC;IACtC,IAAI,EAAE;QACJ,YAAY,EAAE;;;;;;;oCAOkB,CAAC,IAAI,EAAE;QACvC,WAAW,EAAE,oCAAoC;KACl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,GAAG,EAAE,GAAG,WAAW,CAAC,YAAY,EAAE,GAAG,WAAW,CAAC,eAAe,EAAE,CAAC;YAC7E,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC;QACjD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
* Core adapter plugin for EdgeOne platform
|
|
4
4
|
*/
|
|
5
5
|
export { createCoreAdapter, default } from "./core.js";
|
|
6
|
-
export { bundleServerCode, createServerWrapper, cleanupWrapper,
|
|
7
|
-
export { createLogger,
|
|
8
|
-
export {
|
|
9
|
-
export { createFrameworkAdapter, createStatefulAdapter, composeHooks, createConfigDetector, createBuildDirDetector, createDependencyDetector, combineDetectors, SERVER_WRAPPER_PRESETS, } from "./factory.js";
|
|
6
|
+
export { bundleServerCode, createServerWrapper, cleanupWrapper, } from "./bundler.js";
|
|
7
|
+
export { createLogger, logBuildArtifacts, pathExists, copyDirectory, ensureDirectory, readFile, writeFile, deleteFile, listFiles, detectConfigFile, detectBuildDir, detectServerEntry, loadConfigFile, normalizeRoutePath, createDefaultMeta, NODE_REQUEST_CONVERTER_CODE, generateServerWrapperCode, } from "./utils.js";
|
|
8
|
+
export { createFrameworkAdapter, createStatefulAdapter, combineDetectors, createConfigDetector, createBuildDirDetector, createDependencyDetector, SERVER_WRAPPER_PRESETS, } from "./factory.js";
|
|
10
9
|
export type { RouteInfo, MetaConfig, HeaderRule, RedirectRule, RewriteRule, CacheRule, BuildContext, Logger, BuildArtifacts, ServerWrapperConfig, ServerBundleConfig, BeforeBuildHook, AfterBuildHook, BeforeBundleHook, AfterBundleHook, GenerateRoutesHook, GenerateMetaHook, GenerateServerWrapperHook, AdapterHooks, FrameworkAdapter, CoreAdapterOptions, ViteAdapterOptions, ReactRouterAdapterOptions, TanStackStartAdapterOptions, CreateAdapterPlugin, } from "./types.js";
|
|
11
|
-
export type { ServerWrapperGeneratorOptions } from "./
|
|
10
|
+
export type { ServerWrapperGeneratorOptions } from "./utils.js";
|
|
12
11
|
export type { ServerWrapperPreset, BuildDirConfig, AdapterFactoryConfig, AdapterFactoryOptions, } from "./factory.js";
|
|
13
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGvD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGvD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,GACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EAEL,YAAY,EACZ,iBAAiB,EAEjB,UAAU,EACV,aAAa,EACb,eAAe,EACf,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS,EAET,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,cAAc,EAEd,kBAAkB,EAElB,iBAAiB,EAEjB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,SAAS,EACT,YAAY,EACZ,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,yBAAyB,EACzB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAEhE,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,11 +5,21 @@
|
|
|
5
5
|
// Core
|
|
6
6
|
export { createCoreAdapter, default } from "./core.js";
|
|
7
7
|
// Bundler
|
|
8
|
-
export { bundleServerCode, createServerWrapper, cleanupWrapper,
|
|
9
|
-
// Utils
|
|
10
|
-
export {
|
|
11
|
-
//
|
|
12
|
-
|
|
8
|
+
export { bundleServerCode, createServerWrapper, cleanupWrapper, } from "./bundler.js";
|
|
9
|
+
// Utils (merged from helpers.js)
|
|
10
|
+
export {
|
|
11
|
+
// Logging
|
|
12
|
+
createLogger, logBuildArtifacts,
|
|
13
|
+
// File system
|
|
14
|
+
pathExists, copyDirectory, ensureDirectory, readFile, writeFile, deleteFile, listFiles,
|
|
15
|
+
// Detection
|
|
16
|
+
detectConfigFile, detectBuildDir, detectServerEntry, loadConfigFile,
|
|
17
|
+
// Route helpers
|
|
18
|
+
normalizeRoutePath,
|
|
19
|
+
// Meta
|
|
20
|
+
createDefaultMeta,
|
|
21
|
+
// Server wrapper
|
|
22
|
+
NODE_REQUEST_CONVERTER_CODE, generateServerWrapperCode, } from "./utils.js";
|
|
13
23
|
// Factory
|
|
14
|
-
export { createFrameworkAdapter, createStatefulAdapter,
|
|
24
|
+
export { createFrameworkAdapter, createStatefulAdapter, combineDetectors, createConfigDetector, createBuildDirDetector, createDependencyDetector, SERVER_WRAPPER_PRESETS, } from "./factory.js";
|
|
15
25
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO;AACP,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEvD,UAAU;AACV,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO;AACP,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEvD,UAAU;AACV,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,iCAAiC;AACjC,OAAO;AACL,UAAU;AACV,YAAY,EACZ,iBAAiB;AACjB,cAAc;AACd,UAAU,EACV,aAAa,EACb,eAAe,EACf,QAAQ,EACR,SAAS,EACT,UAAU,EACV,SAAS;AACT,YAAY;AACZ,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,cAAc;AACd,gBAAgB;AAChB,kBAAkB;AAClB,OAAO;AACP,iBAAiB;AACjB,iBAAiB;AACjB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AAEpB,UAAU;AACV,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,cAAc,CAAC"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,164 +1,96 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* EdgeOne Vite Plugin Adapter - Utility Functions Module
|
|
3
3
|
*
|
|
4
|
-
* This module provides
|
|
4
|
+
* This module provides utility functions for:
|
|
5
5
|
* - Logging
|
|
6
|
-
* - File system operations
|
|
6
|
+
* - File system operations
|
|
7
7
|
* - Path detection
|
|
8
|
-
* -
|
|
9
|
-
* -
|
|
8
|
+
* - Config file loading
|
|
9
|
+
* - Server wrapper generation
|
|
10
|
+
* - Meta configuration
|
|
10
11
|
*/
|
|
11
|
-
import type { Logger } from "./types.js";
|
|
12
|
+
import type { Logger, RouteInfo, MetaConfig } from "./types.js";
|
|
12
13
|
/**
|
|
13
14
|
* Create logger instance
|
|
14
|
-
*
|
|
15
|
-
* @param verbose - Enable verbose logging mode, default is false
|
|
16
|
-
* @returns Logger object with log, verbose, warn, error methods
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* const logger = createLogger(true);
|
|
20
|
-
* logger.verbose("This message only shows in verbose mode");
|
|
21
|
-
* logger.warn("This is a warning message");
|
|
22
15
|
*/
|
|
23
16
|
export declare function createLogger(verbose?: boolean): Logger;
|
|
24
17
|
/**
|
|
25
18
|
* Check if specified path exists
|
|
26
|
-
*
|
|
27
|
-
* @param filePath - File or directory path to check
|
|
28
|
-
* @returns True if path exists, false otherwise
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* if (await pathExists('/path/to/file')) {
|
|
32
|
-
* console.log('File exists');
|
|
33
|
-
* }
|
|
34
19
|
*/
|
|
35
20
|
export declare function pathExists(filePath: string): Promise<boolean>;
|
|
36
|
-
/**
|
|
37
|
-
* Find first existing path from candidate list
|
|
38
|
-
*
|
|
39
|
-
* @param candidates - Candidate paths array, sorted by priority
|
|
40
|
-
* @returns First existing path, or null if none exist
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* const buildDir = await findExistingPath([
|
|
44
|
-
* '/project/dist',
|
|
45
|
-
* '/project/build',
|
|
46
|
-
* '/project/output'
|
|
47
|
-
* ]);
|
|
48
|
-
*/
|
|
49
|
-
export declare function findExistingPath(candidates: string[]): Promise<string | null>;
|
|
50
21
|
/**
|
|
51
22
|
* Recursively copy directory
|
|
52
|
-
* Copy all contents from source directory to destination directory
|
|
53
|
-
*
|
|
54
|
-
* @param src - Source directory path
|
|
55
|
-
* @param dest - Destination directory path
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* await copyDirectory('dist/client', '.edgeone/assets');
|
|
59
23
|
*/
|
|
60
24
|
export declare function copyDirectory(src: string, dest: string): Promise<void>;
|
|
61
25
|
/**
|
|
62
|
-
*
|
|
63
|
-
* Used to ensure directory is in a clean empty state
|
|
64
|
-
*
|
|
65
|
-
* @param dir - Directory path to clean
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* await cleanDirectory('.edgeone');
|
|
69
|
-
*/
|
|
70
|
-
export declare function cleanDirectory(dir: string): Promise<void>;
|
|
71
|
-
/**
|
|
72
|
-
* Ensure directory exists
|
|
73
|
-
* Recursively create if directory doesn't exist
|
|
74
|
-
*
|
|
75
|
-
* @param dir - Directory path
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* await ensureDirectory('.edgeone/server-handler');
|
|
26
|
+
* Ensure directory exists (creates recursively if needed)
|
|
79
27
|
*/
|
|
80
28
|
export declare function ensureDirectory(dir: string): Promise<void>;
|
|
81
29
|
/**
|
|
82
30
|
* Read file content as string
|
|
83
|
-
*
|
|
84
|
-
* @param filePath - File path
|
|
85
|
-
* @returns File content string (UTF-8 encoded)
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* const content = await readFile('dist/server/index.js');
|
|
89
31
|
*/
|
|
90
32
|
export declare function readFile(filePath: string): Promise<string>;
|
|
91
33
|
/**
|
|
92
|
-
* Write content to file
|
|
93
|
-
* Automatically creates parent directory if it doesn't exist
|
|
94
|
-
*
|
|
95
|
-
* @param filePath - File path
|
|
96
|
-
* @param content - Content to write
|
|
97
|
-
*
|
|
98
|
-
* @example
|
|
99
|
-
* await writeFile('.edgeone/meta.json', JSON.stringify(config));
|
|
34
|
+
* Write content to file (auto-creates parent directory)
|
|
100
35
|
*/
|
|
101
36
|
export declare function writeFile(filePath: string, content: string): Promise<void>;
|
|
102
37
|
/**
|
|
103
38
|
* Delete file
|
|
104
|
-
*
|
|
105
|
-
* @param filePath - File path to delete
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
* await deleteFile('server-wrapper.temp.js');
|
|
109
39
|
*/
|
|
110
40
|
export declare function deleteFile(filePath: string): Promise<void>;
|
|
111
41
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* @param bytes - Number of bytes
|
|
115
|
-
* @returns Formatted string, e.g. "1.5 KB", "2.3 MB"
|
|
116
|
-
*
|
|
117
|
-
* @example
|
|
118
|
-
* formatSize(1536); // "1.5 KB"
|
|
119
|
-
* formatSize(2457600); // "2.34 MB"
|
|
42
|
+
* List files in directory
|
|
120
43
|
*/
|
|
121
|
-
export declare function
|
|
44
|
+
export declare function listFiles(dir: string): Promise<string[]>;
|
|
122
45
|
/**
|
|
123
|
-
*
|
|
124
|
-
* Used to wait for async operations to complete, like file writes
|
|
125
|
-
*
|
|
126
|
-
* @param condition - Async condition function returning boolean
|
|
127
|
-
* @param options - Configuration options
|
|
128
|
-
* @param options.maxRetries - Maximum retry count, default 15
|
|
129
|
-
* @param options.delay - Delay between retries in milliseconds, default 300ms
|
|
130
|
-
* @returns True if condition met, false if timeout
|
|
131
|
-
*
|
|
132
|
-
* @example
|
|
133
|
-
* const ready = await waitFor(
|
|
134
|
-
* async () => await pathExists('dist/index.html'),
|
|
135
|
-
* { maxRetries: 10, delay: 500 }
|
|
136
|
-
* );
|
|
137
|
-
*/
|
|
138
|
-
export declare function waitFor(condition: () => Promise<boolean>, options?: {
|
|
139
|
-
maxRetries?: number;
|
|
140
|
-
delay?: number;
|
|
141
|
-
}): Promise<boolean>;
|
|
142
|
-
/**
|
|
143
|
-
* List files and subdirectory names in directory
|
|
144
|
-
*
|
|
145
|
-
* @param dir - Directory path
|
|
146
|
-
* @returns Array of file and directory names, empty array if directory doesn't exist
|
|
147
|
-
*
|
|
148
|
-
* @example
|
|
149
|
-
* const files = await listFiles('dist/client');
|
|
150
|
-
* // ['index.html', 'assets', 'favicon.ico']
|
|
46
|
+
* Detect config file from candidate list
|
|
151
47
|
*/
|
|
152
|
-
export declare function
|
|
48
|
+
export declare function detectConfigFile(projectRoot: string, patterns: string[]): Promise<string | null>;
|
|
153
49
|
/**
|
|
154
|
-
*
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
*
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
50
|
+
* Detect build directory from candidate list
|
|
51
|
+
*/
|
|
52
|
+
export declare function detectBuildDir(projectRoot: string, candidates: string[]): Promise<string | null>;
|
|
53
|
+
/**
|
|
54
|
+
* Detect server entry file from candidate list
|
|
55
|
+
*/
|
|
56
|
+
export declare function detectServerEntry(serverDir: string, candidates?: string[]): Promise<string | null>;
|
|
57
|
+
/**
|
|
58
|
+
* Dynamically import config file
|
|
59
|
+
*/
|
|
60
|
+
export declare function loadConfigFile<T = unknown>(configPath: string): Promise<T | null>;
|
|
61
|
+
/**
|
|
62
|
+
* Normalize route path
|
|
63
|
+
*/
|
|
64
|
+
export declare function normalizeRoutePath(routePath: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* Create default meta configuration
|
|
67
|
+
*/
|
|
68
|
+
export declare function createDefaultMeta(routes: RouteInfo[], options?: {
|
|
69
|
+
isSSR?: boolean;
|
|
70
|
+
has404?: boolean;
|
|
71
|
+
}): MetaConfig;
|
|
72
|
+
/** Node.js IncomingMessage to Web Request converter code */
|
|
73
|
+
export declare const NODE_REQUEST_CONVERTER_CODE: string;
|
|
74
|
+
/** Server wrapper generator options */
|
|
75
|
+
export interface ServerWrapperGeneratorOptions {
|
|
76
|
+
serverEntryPath: string;
|
|
77
|
+
handlerSetup?: string;
|
|
78
|
+
handlerCall: string;
|
|
79
|
+
imports?: string;
|
|
80
|
+
needsNodeRequestConversion?: boolean;
|
|
81
|
+
mode?: "inline" | "import";
|
|
82
|
+
additionalExports?: string[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Generate server wrapper code
|
|
86
|
+
*/
|
|
87
|
+
export declare function generateServerWrapperCode(options: ServerWrapperGeneratorOptions): Promise<string>;
|
|
88
|
+
/**
|
|
89
|
+
* Log build artifacts info
|
|
162
90
|
*/
|
|
163
|
-
export declare function
|
|
91
|
+
export declare function logBuildArtifacts(logger: Logger, adapterName: string, artifacts: {
|
|
92
|
+
clientDir?: string | null;
|
|
93
|
+
serverDir?: string | null;
|
|
94
|
+
serverEntry?: string | null;
|
|
95
|
+
}): void;
|
|
164
96
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAMhE;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,OAAe,GAAG,MAAM,CAiB7D;AAMD;;GAEG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOnE;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5E;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhE;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEhE;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,QA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