@chuckcchen/vite-plugin 1.0.18 → 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.
Files changed (59) hide show
  1. package/dist/bundler.d.ts +5 -18
  2. package/dist/bundler.d.ts.map +1 -1
  3. package/dist/bundler.js +43 -30
  4. package/dist/bundler.js.map +1 -1
  5. package/dist/core.d.ts +2 -18
  6. package/dist/core.d.ts.map +1 -1
  7. package/dist/core.js +109 -248
  8. package/dist/core.js.map +1 -1
  9. package/dist/factory/detectors.d.ts +5 -15
  10. package/dist/factory/detectors.d.ts.map +1 -1
  11. package/dist/factory/detectors.js +8 -22
  12. package/dist/factory/detectors.js.map +1 -1
  13. package/dist/factory/hooks.d.ts +4 -59
  14. package/dist/factory/hooks.d.ts.map +1 -1
  15. package/dist/factory/hooks.js +18 -117
  16. package/dist/factory/hooks.js.map +1 -1
  17. package/dist/factory/index.d.ts +7 -51
  18. package/dist/factory/index.d.ts.map +1 -1
  19. package/dist/factory/index.js +10 -55
  20. package/dist/factory/index.js.map +1 -1
  21. package/dist/factory/presets.d.ts +16 -121
  22. package/dist/factory/presets.d.ts.map +1 -1
  23. package/dist/factory/presets.js +143 -174
  24. package/dist/factory/presets.js.map +1 -1
  25. package/dist/index.d.ts +6 -6
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +6 -35
  28. package/dist/index.js.map +1 -1
  29. package/dist/route/index.d.ts +1 -1
  30. package/dist/route/index.d.ts.map +1 -1
  31. package/dist/route/index.js +1 -3
  32. package/dist/route/index.js.map +1 -1
  33. package/dist/route/parser.d.ts +0 -37
  34. package/dist/route/parser.d.ts.map +1 -1
  35. package/dist/route/parser.js +11 -124
  36. package/dist/route/parser.js.map +1 -1
  37. package/dist/route/regex.d.ts +15 -80
  38. package/dist/route/regex.d.ts.map +1 -1
  39. package/dist/route/regex.js +65 -169
  40. package/dist/route/regex.js.map +1 -1
  41. package/dist/route/regex.test.d.ts +7 -0
  42. package/dist/route/regex.test.d.ts.map +1 -0
  43. package/dist/route/regex.test.js +662 -0
  44. package/dist/route/regex.test.js.map +1 -0
  45. package/dist/route/types.d.ts +0 -58
  46. package/dist/route/types.d.ts.map +1 -1
  47. package/dist/types.d.ts +36 -147
  48. package/dist/types.d.ts.map +1 -1
  49. package/dist/types.js +0 -3
  50. package/dist/types.js.map +1 -1
  51. package/dist/utils.d.ts +1 -78
  52. package/dist/utils.d.ts.map +1 -1
  53. package/dist/utils.js +11 -144
  54. package/dist/utils.js.map +1 -1
  55. package/dist/vite-config-parser.d.ts +4 -141
  56. package/dist/vite-config-parser.d.ts.map +1 -1
  57. package/dist/vite-config-parser.js +25 -235
  58. package/dist/vite-config-parser.js.map +1 -1
  59. package/package.json +1 -1
package/dist/bundler.d.ts CHANGED
@@ -1,25 +1,12 @@
1
- /**
2
- * EdgeOne Vite Plugin Adapter - Server Bundling Module
3
- *
4
- * Handles server-side code bundling using esbuild:
5
- * - Bundle framework's server build artifacts into a single file
6
- * - Generate HTTP request handling wrapper code
7
- */
8
1
  import * as esbuild from "esbuild";
9
2
  import type { BuildContext, ServerBundleConfig, ServerWrapperConfig } from "./types.js";
10
- /**
11
- * Bundle server code using esbuild
12
- */
3
+ export interface EsmInteropPluginOptions {
4
+ mappings: Record<string, string>;
5
+ searchDirs?: string[];
6
+ }
7
+ export declare function createEsmInteropPlugin(options: EsmInteropPluginOptions): esbuild.Plugin;
13
8
  export declare function bundleServerCode(context: BuildContext, config: ServerBundleConfig): Promise<esbuild.BuildResult>;
14
- /**
15
- * Create server wrapper file
16
- *
17
- * Wraps framework's server build into a unified HTTP request handler.
18
- */
19
9
  export declare function createServerWrapper(context: BuildContext, config: ServerWrapperConfig): Promise<string>;
20
- /**
21
- * Cleanup temporary wrapper file
22
- */
23
10
  export declare function cleanupWrapper(wrapperPath: string, logger?: {
24
11
  verbose?: (msg: string) => void;
25
12
  }): Promise<void>;
@@ -1 +1 @@
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,CAiC9B;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,MAAM,CAAC,CA6BjB;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"}
1
+ {"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../src/bundler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAQxF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAsCvF;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CA+B9B;AAED,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAsBjB;AAED,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,30 +1,55 @@
1
- /**
2
- * EdgeOne Vite Plugin Adapter - Server Bundling Module
3
- *
4
- * Handles server-side code bundling using esbuild:
5
- * - Bundle framework's server build artifacts into a single file
6
- * - Generate HTTP request handling wrapper code
7
- */
8
1
  import * as esbuild from "esbuild";
9
2
  import path from "path";
3
+ import fs from "fs";
10
4
  import { writeFile, deleteFile, ensureDirectory, generateServerWrapperCode, readFile } from "./utils.js";
11
- /**
12
- * Default ESM compatibility banner code
13
- * Provides CommonJS require, __filename, __dirname support in ESM modules
14
- */
15
5
  const DEFAULT_BANNER = `import { createRequire } from 'node:module';
16
6
  const require = createRequire(import.meta.url);
17
7
  const __filename = new URL('', import.meta.url).pathname;
18
8
  const __dirname = new URL('.', import.meta.url).pathname;`;
19
- /**
20
- * Bundle server code using esbuild
21
- */
9
+ export function createEsmInteropPlugin(options) {
10
+ const { mappings, searchDirs = [] } = options;
11
+ return {
12
+ name: "esm-interop",
13
+ setup(build) {
14
+ // Build search paths for node_modules
15
+ const buildSearchDirs = (baseDir) => {
16
+ const dirs = [baseDir, process.cwd(), ...searchDirs];
17
+ // Add parent directories for monorepo support
18
+ let current = baseDir;
19
+ for (let i = 0; i < 5; i++) {
20
+ if (!dirs.includes(current))
21
+ dirs.push(current);
22
+ const parent = path.dirname(current);
23
+ if (parent === current)
24
+ break;
25
+ current = parent;
26
+ }
27
+ return dirs;
28
+ };
29
+ // Create resolver for each mapping
30
+ for (const [from, to] of Object.entries(mappings)) {
31
+ const filter = new RegExp(`^${from.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}$`);
32
+ build.onResolve({ filter }, (args) => {
33
+ const searchDirList = buildSearchDirs(args.resolveDir || process.cwd());
34
+ for (const baseDir of searchDirList) {
35
+ const searchPath = path.join(baseDir, "node_modules", to);
36
+ if (fs.existsSync(searchPath)) {
37
+ return { path: searchPath, external: false };
38
+ }
39
+ }
40
+ return null; // Let esbuild handle it
41
+ });
42
+ }
43
+ },
44
+ };
45
+ }
22
46
  export async function bundleServerCode(context, config) {
23
47
  const { projectRoot, logger } = context;
24
48
  logger.verbose("Bundling server code...");
25
49
  await ensureDirectory(path.dirname(config.outfile));
26
- // Use absWorkingDir from esbuildOptions if provided, otherwise fallback to projectRoot
27
50
  const absWorkingDir = config.esbuildOptions?.absWorkingDir || projectRoot;
51
+ // Extract plugins from esbuildOptions (adapter can pass custom plugins here)
52
+ const { plugins: customPlugins, ...restOptions } = config.esbuildOptions || {};
28
53
  const result = await esbuild.build({
29
54
  entryPoints: config.entryPoints,
30
55
  bundle: true,
@@ -37,32 +62,23 @@ export async function bundleServerCode(context, config) {
37
62
  external: ["node:*", ...(config.external || [])],
38
63
  metafile: true,
39
64
  logLevel: "warning",
40
- banner: {
41
- js: DEFAULT_BANNER,
42
- },
43
- ...config.esbuildOptions,
44
- // Ensure absWorkingDir is set correctly (override any from esbuildOptions spread)
65
+ banner: { js: DEFAULT_BANNER },
66
+ plugins: Array.isArray(customPlugins) ? customPlugins : [],
67
+ ...restOptions,
45
68
  absWorkingDir,
46
69
  });
47
70
  logger.verbose(`Server code bundled to: ${config.outfile}`);
48
71
  return result;
49
72
  }
50
- /**
51
- * Create server wrapper file
52
- *
53
- * Wraps framework's server build into a unified HTTP request handler.
54
- */
55
73
  export async function createServerWrapper(context, config) {
56
74
  const { projectRoot, logger } = context;
57
75
  logger.verbose("Creating server wrapper...");
58
76
  let wrapperContent;
59
77
  if (config.wrapperTemplate) {
60
- // Use custom template
61
78
  const serverBuildContent = await readFile(config.serverEntryPath);
62
79
  wrapperContent = config.wrapperTemplate.replace("{{SERVER_BUILD_CONTENT}}", serverBuildContent);
63
80
  }
64
81
  else {
65
- // Use generateServerWrapperCode from utils (now sync, uses import instead of inline)
66
82
  wrapperContent = generateServerWrapperCode({
67
83
  serverEntryPath: config.serverEntryPath,
68
84
  handlerSetup: config.banner || "",
@@ -74,9 +90,6 @@ export async function createServerWrapper(context, config) {
74
90
  logger.verbose("Server wrapper created");
75
91
  return tempPath;
76
92
  }
77
- /**
78
- * Cleanup temporary wrapper file
79
- */
80
93
  export async function cleanupWrapper(wrapperPath, logger) {
81
94
  try {
82
95
  await deleteFile(wrapperPath);
@@ -1 +1 @@
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,CAAC;IAExC,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAE1C,MAAM,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IAEpD,uFAAuF;IACvF,MAAM,aAAa,GAAI,MAAM,CAAC,cAAc,EAAE,aAAoC,IAAI,WAAW,CAAC;IAElG,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC;QACjC,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,MAAM;QAChB,MAAM,EAAE,QAAQ;QAChB,MAAM,E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AM,EAAE,GAAG,OAAO,CAAC;IAExC,MAAM,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAE7C,IAAI,cAAsB,CAAC;IAC3B,IAAI,MAAM,CAAC,eAAe,EAAE,CAAC;QAC3B,MAAM,kBAAkB,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;QAClE,cAAc,GAAG,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,0BAA0B,EAAE,kBAAkB,CAAC,CAAC;IAClG,CAAC;SAAM,CAAC;QACN,cAAc,GAAG,yBAAyB,CAAC;YACzC,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,YAAY,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;YACjC,WAAW,EAAE,oCAAoC;SAClD,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;IACzC,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,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
@@ -1,27 +1,11 @@
1
1
  /**
2
2
  * EdgeOne Vite Plugin Adapter - Core Plugin Module
3
3
  *
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
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 type { Plugin } from "vite";
12
8
  import type { CoreAdapterOptions } from "./types.js";
13
- /**
14
- * Create EdgeOne core adapter plugin
15
- *
16
- * This is the main entry function for creating adapters, returns a Vite plugin instance.
17
- * The plugin executes after Vite build completes, processing build artifacts and generating deployment config.
18
- *
19
- * @param options - Adapter configuration options
20
- * @returns Vite plugin instance
21
- *
22
- * @example
23
- * createCoreAdapter({ verbose: true })
24
- */
25
9
  export declare function createCoreAdapter(options?: CoreAdapterOptions): Plugin;
26
10
  export default createCoreAdapter;
27
11
  //# sourceMappingURL=core.d.ts.map
@@ -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;AAkBpB;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,MAAM,CAyI1E;AAkXD,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAC;AAEnD,OAAO,KAAK,EACV,kBAAkB,EAOnB,MAAM,YAAY,CAAC;AAkBpB,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,MAAM,CAqE1E;AA2RD,eAAe,iBAAiB,CAAC"}