rsbuild-plugin-cloudflare 0.0.5 → 0.0.7

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.
@@ -0,0 +1,8 @@
1
+ import { randomUUID } from "node:crypto";
2
+ // ../../workers-sdk/packages/vite-plugin-cloudflare/src/constants.ts
3
+ const ROUTER_WORKER_NAME = "__router-worker__";
4
+ const ASSET_WORKER_NAME = "__asset-worker__";
5
+ const VITE_PROXY_WORKER_NAME = "__vite_proxy_worker__";
6
+ const PROXY_SHARED_SECRET = randomUUID();
7
+ const kRequestType = Symbol("kRequestType");
8
+ export { kRequestType as a, VITE_PROXY_WORKER_NAME as i, PROXY_SHARED_SECRET as n, ROUTER_WORKER_NAME as r, ASSET_WORKER_NAME as t };
package/dist/index.d.mts CHANGED
@@ -1,12 +1,11 @@
1
- import { InputWorkerConfig, ParsedInputConfig, ParsedInputWorkerConfig, WorkerConfig } from "@cloudflare/config";
1
+ import { ParsedCloudflareConfig, ParsedWorkerConfig } from "@cloudflare/config";
2
2
  import { RsbuildPlugin } from "@rsbuild/core";
3
-
4
- //#region ../../workers-sdk/packages/vite-plugin-cloudflare/src/plugin-config.d.ts
5
-
6
3
  /** Parsed configuration with the entry Worker required by the Vite plugin. */
7
- type CloudflareConfig = Omit<ParsedInputConfig, "worker"> & {
8
- worker: ParsedInputWorkerConfig;
4
+ type CloudflareConfig = Omit<ParsedCloudflareConfig, "worker"> & {
5
+ worker: ParsedWorkerConfig;
9
6
  };
7
+ /** Parsed Worker configuration, as used by auxiliary and prerender Worker `config`. */
8
+ type WorkerConfig = CloudflareConfig["worker"];
10
9
  type PersistState = boolean | {
11
10
  path: string;
12
11
  };
@@ -66,9 +65,9 @@ interface Experimental {
66
65
  /** Experimental support for handling the _headers and _redirects files during Vite dev mode. */
67
66
  headersAndRedirectsDevModeSupport?: boolean;
68
67
  }
69
- type WorkerConfigProvider = InputWorkerConfig | ((options: {
70
- entryWorkerConfig: ParsedInputWorkerConfig;
71
- }) => InputWorkerConfig);
68
+ type WorkerConfigProvider = WorkerConfig | ((options: {
69
+ entryWorkerConfig: WorkerConfig;
70
+ }) => WorkerConfig);
72
71
  interface PluginConfig$1 extends EntryWorkerOptions {
73
72
  /**
74
73
  * Customize the loaded configuration before development or building.
@@ -91,8 +90,6 @@ interface PluginConfig$1 extends EntryWorkerOptions {
91
90
  types?: TypeGenerationOptions;
92
91
  experimental?: Experimental;
93
92
  }
94
- //#endregion
95
- //#region src/index.d.ts
96
93
  /** Options for the Rsbuild environment that builds a Worker. */
97
94
  interface RsbuildEnvironmentOptions {
98
95
  /**
@@ -128,5 +125,4 @@ interface PluginConfig extends RsbuildWorkerOptions<Omit<PluginConfig$1, "tunnel
128
125
  * @returns An Rsbuild plugin.
129
126
  */
130
127
  declare function cloudflare(options?: PluginConfig): RsbuildPlugin;
131
- //#endregion
132
128
  export { type CloudflareConfig, PluginConfig, type WorkerConfig, cloudflare };