@vite-hub/kv 0.3.1 → 0.5.0

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 (50) hide show
  1. package/README.md +19 -13
  2. package/dist/{cli-DpPhz_Ek.d.ts → cli-CLomw9ml.d.ts} +1 -0
  3. package/dist/cli.d.ts +1 -1
  4. package/dist/cli.js +24 -12
  5. package/dist/{cloudflare-env-lOtHHsgP.js → cloudflare-env-Dl349h_9.js} +2 -1
  6. package/dist/{cloudflare-kv-BIEUFzRT.js → cloudflare-kv-DQJhmGof.js} +22 -10
  7. package/dist/{cloudflare-kv-local-BBw3ZT1K.js → cloudflare-kv-local-COjgHweC.js} +3 -7
  8. package/dist/{config-BXEVoZE3.js → config-pfyPiPrI.js} +65 -28
  9. package/dist/{create-storage-BGsrQKw3.js → create-storage-DQ1BbFqH.js} +5 -5
  10. package/dist/{cursor-history-BqIQePNP.js → cursor-history-CAT4mpP1.js} +7 -3
  11. package/dist/{deno-kv-BM9mYdUp.js → deno-kv-Cf0ZveeN.js} +43 -7
  12. package/dist/driver-Du6Eh9p2.d.ts +47 -0
  13. package/dist/{error-diagnostics-BxqvtEIb.js → error-diagnostics-C4VTHInS.js} +16 -4
  14. package/dist/errors-BpiM-Vmh.js +125 -0
  15. package/dist/errors.d.ts +13 -1
  16. package/dist/errors.js +2 -2
  17. package/dist/{fs-lite-BLZId9_P.js → fs-lite-BTcBUP6B.js} +1 -1
  18. package/dist/fs-lite-C8yXCVDM.js +2 -0
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.js +39 -52
  21. package/dist/{operation-definition-8gOe-ubD.d.ts → operation-definition-CI2PJGqu.d.ts} +13 -2
  22. package/dist/{operations-Ch-gKaey.js → operations-CqKs7Ykc.js} +24 -45
  23. package/dist/{operations-B-WZ7P1h.js → operations-nAaONxzh.js} +273 -231
  24. package/dist/operations.d.ts +2 -2
  25. package/dist/operations.js +4 -3
  26. package/dist/out-BbXG-yVX.js +21755 -0
  27. package/dist/{redis-shared-E5mahECF.js → redis-shared-1M0IaguQ.js} +1 -1
  28. package/dist/request-log-Dj9Vw7qG.js +105 -0
  29. package/dist/{results-p7nPCnaJ.js → results-D6jfPtCk.js} +0 -1
  30. package/dist/runtime/cloudflare-kv.d.ts +1 -1
  31. package/dist/runtime/cloudflare-kv.js +1 -1
  32. package/dist/runtime/cloudflare-request-env.js +1 -1
  33. package/dist/runtime/database.d.ts +2 -0
  34. package/dist/{database-72Jk3VVk.js → runtime/database.js} +68 -37
  35. package/dist/runtime/nitro-plugin.js +12 -5
  36. package/dist/runtime/redis-driver.d.ts +2 -2
  37. package/dist/runtime/redis-driver.js +2 -5
  38. package/dist/runtime/unstorage-driver.js +6 -2
  39. package/dist/runtime/upstash-driver.d.ts +2 -2
  40. package/dist/runtime/upstash-driver.js +2 -6
  41. package/dist/{types-DEiKew_3.d.ts → types-Cp6IBhSN.d.ts} +36 -37
  42. package/dist/{upstash-DDlqTttY.js → upstash-5sTbIR35.js} +2 -2
  43. package/dist/virtual-module.d.ts +1 -0
  44. package/dist/vite.d.ts +21 -6
  45. package/dist/vite.js +2738 -415
  46. package/package.json +10 -5
  47. package/dist/driver-BwxgaQ-f.d.ts +0 -15
  48. package/dist/errors-DbwufFZp.js +0 -60
  49. package/dist/fs-lite-RAoxu8L0.js +0 -2
  50. package/dist/main-F3Y22_uV.js +0 -2353
@@ -1,5 +1,5 @@
1
- import { n as kvErrorDiagnostics } from "./error-diagnostics-BxqvtEIb.js";
2
- import { a as upstashUrlEnvNames, i as upstashTokenEnvNames, s as readEnv } from "./config-BXEVoZE3.js";
1
+ import { n as kvErrorDiagnostics } from "./error-diagnostics-C4VTHInS.js";
2
+ import { a as upstashUrlEnvNames, i as upstashTokenEnvNames, s as readEnv } from "./config-pfyPiPrI.js";
3
3
  //#region src/runtime/upstash.ts
4
4
  function isMaskedValue(value) {
5
5
  return !value || /^\*+$/.test(value);
@@ -1,6 +1,7 @@
1
1
  declare module "#vitehub/kv/config" {
2
2
  export const hosting: string | undefined
3
3
  export const kv: false | import("./index.js").ResolvedKVModuleOptions
4
+ export const durabilityReportsStores: boolean
4
5
  /** Loads the databases of the app. Set when a store uses the `database` driver. */
5
6
  export const loadDatabases: (() => Promise<Record<string, { db: object } | undefined>>) | undefined
6
7
  const config: { hosting?: string, kv: typeof kv }
package/dist/vite.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { C as KVOptions, F as ResolvedKVModuleOptions } from "./types-DEiKew_3.js";
2
- import { r as ViteHubCliPluginMetadata } from "./cli-DpPhz_Ek.js";
3
- import { n as OperationContributionEntry } from "./operation-definition-8gOe-ubD.js";
1
+ import { L as ResolvedKVModuleOptions, w as KVOptions } from "./types-Cp6IBhSN.js";
2
+ import { r as ViteHubCliPluginMetadata } from "./cli-CLomw9ml.js";
3
+ import { n as OperationContributionEntry } from "./operation-definition-CI2PJGqu.js";
4
+ import "nostics";
4
5
  import { Plugin } from "vite";
5
6
  //#region src/config.d.ts
6
7
  interface KVResolutionInput {
@@ -9,6 +10,7 @@ interface KVResolutionInput {
9
10
  * store falls back to `fs-lite` when the runtime has no binding. Builds leave it unset.
10
11
  */
11
12
  dev?: boolean;
13
+ prerender?: boolean;
12
14
  env?: Record<string, string | undefined>;
13
15
  hosting?: string;
14
16
  /**
@@ -81,6 +83,8 @@ interface ViteHubResourceSummary {
81
83
  owner: string;
82
84
  /** Absent when no id is known yet. */
83
85
  source?: ViteHubResourceIdSource;
86
+ /** The resource is in the Wrangler config of a standalone Provider Output Worker, not in Nitro's. */
87
+ standalone?: boolean;
84
88
  }
85
89
  interface ViteHubInspectionContributor {
86
90
  definitions?: readonly ViteHubDefinitionInspector[];
@@ -157,21 +161,32 @@ export interface KVVitePluginAPI {
157
161
  /** The variables that the KV stores read on the deployed host. See `kvDeploymentEnv()`. */
158
162
  deploymentEnv: DeploymentEnvContribution;
159
163
  getConfig: () => KVViteRuntimeConfig;
164
+ getBuildConfig: () => KVViteRuntimeConfig;
160
165
  }
161
166
  export type KVVitePlugin = Plugin & {
162
167
  api: KVVitePluginAPI;
163
168
  nitro: {
164
169
  name: string;
165
- setup: (nitro: {
166
- options: NitroCloudflareKVTarget;
167
- }) => void;
170
+ setup: (nitro: KVNitroBuild) => void;
168
171
  };
169
172
  vitehub: ViteHubCliPluginMetadata & ViteHubInspectionPluginMetadata & DurabilityPluginMetadata & {
170
173
  operations: readonly OperationContributionEntry[];
171
174
  };
172
175
  };
173
176
  export declare function hubKVOptionalPeerResolver(): Plugin;
177
+ interface KVPrerenderConfig {
178
+ virtual?: Record<string, string | (() => string)>;
179
+ }
180
+ interface KVNitroBuild {
181
+ hooks?: {
182
+ hook: (name: "prerender:config", callback: (config: KVPrerenderConfig) => void) => unknown;
183
+ };
184
+ options: NitroCloudflareKVTarget;
185
+ }
174
186
  interface NitroCloudflareKVTarget {
187
+ deps?: {
188
+ paths?: Record<string, string>;
189
+ };
175
190
  handlers?: unknown[];
176
191
  kv?: Record<string, unknown>;
177
192
  storage?: Record<string, unknown>;