@bino0216/nitro-cloudflare-dev 0.2.6 → 0.2.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.
package/README.md CHANGED
@@ -17,18 +17,18 @@ For **Nuxt** update `nuxt.config.ts`:
17
17
 
18
18
  ```js
19
19
  export default defineNuxtConfig({
20
- modules: ["nitro-cloudflare-dev"],
21
- });
20
+ modules: ['nitro-cloudflare-dev'],
21
+ })
22
22
  ```
23
23
 
24
24
  For **Nitro** update `nitro.config.ts`:
25
25
 
26
26
  ```js
27
- import nitroCloudflareBindings from "nitro-cloudflare-dev";
27
+ import nitroCloudflareBindings from 'nitro-cloudflare-dev'
28
28
 
29
29
  export default defineNitroConfig({
30
30
  modules: [nitroCloudflareBindings],
31
- });
31
+ })
32
32
  ```
33
33
 
34
34
  ## Configuration and persistence
package/dist/index.d.mts CHANGED
@@ -1,20 +1,20 @@
1
1
  import { PlatformProxy } from 'wrangler';
2
2
 
3
- declare module "h3" {
3
+ declare module 'h3' {
4
4
  interface H3EventContext {
5
- cf: PlatformProxy["cf"];
5
+ cf: PlatformProxy['cf'];
6
6
  cloudflare: {
7
7
  request: Request & {
8
- cf: PlatformProxy["cf"];
8
+ cf: PlatformProxy['cf'];
9
9
  };
10
- env: PlatformProxy["env"];
11
- context: PlatformProxy["ctx"];
10
+ env: PlatformProxy['env'];
11
+ context: PlatformProxy['ctx'];
12
12
  };
13
13
  }
14
14
  }
15
15
 
16
16
  interface RemoteBinding {
17
- type: "r2" | "kv" | "d1";
17
+ type: 'r2' | 'kv' | 'd1';
18
18
  name: string;
19
19
  bucketName?: string;
20
20
  databaseId?: string;
@@ -34,7 +34,7 @@ interface CloudflareDevOptions {
34
34
  };
35
35
  };
36
36
  }
37
- declare module "nitropack" {
37
+ declare module 'nitropack' {
38
38
  interface NitroOptions {
39
39
  cloudflareDev?: CloudflareDevOptions;
40
40
  }
package/dist/index.d.ts CHANGED
@@ -1,20 +1,20 @@
1
1
  import { PlatformProxy } from 'wrangler';
2
2
 
3
- declare module "h3" {
3
+ declare module 'h3' {
4
4
  interface H3EventContext {
5
- cf: PlatformProxy["cf"];
5
+ cf: PlatformProxy['cf'];
6
6
  cloudflare: {
7
7
  request: Request & {
8
- cf: PlatformProxy["cf"];
8
+ cf: PlatformProxy['cf'];
9
9
  };
10
- env: PlatformProxy["env"];
11
- context: PlatformProxy["ctx"];
10
+ env: PlatformProxy['env'];
11
+ context: PlatformProxy['ctx'];
12
12
  };
13
13
  }
14
14
  }
15
15
 
16
16
  interface RemoteBinding {
17
- type: "r2" | "kv" | "d1";
17
+ type: 'r2' | 'kv' | 'd1';
18
18
  name: string;
19
19
  bucketName?: string;
20
20
  databaseId?: string;
@@ -34,7 +34,7 @@ interface CloudflareDevOptions {
34
34
  };
35
35
  };
36
36
  }
37
- declare module "nitropack" {
37
+ declare module 'nitropack' {
38
38
  interface NitroOptions {
39
39
  cloudflareDev?: CloudflareDevOptions;
40
40
  }
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { resolve, relative } from 'node:path';
2
1
  import { promises } from 'node:fs';
3
- import { fileURLToPath } from 'mlly';
2
+ import { resolve, relative } from 'node:path';
4
3
  import { consola } from 'consola';
5
4
  import { colorize } from 'consola/utils';
5
+ import { fileURLToPath } from 'mlly';
6
6
  import { findFile } from 'pkg-types';
7
7
 
8
8
  function parseTomlBindings(content, key) {
@@ -150,7 +150,9 @@ async function nitroModule(nitro) {
150
150
  if (gitIgnorePath && persistDir === ".wrangler/state/v3") {
151
151
  const gitIgnore = await promises.readFile(gitIgnorePath, "utf8");
152
152
  if (!gitIgnore.includes(".wrangler/state/v3")) {
153
- await promises.writeFile(gitIgnorePath, gitIgnore + "\n.wrangler/state/v3\n").catch(() => {
153
+ await promises.writeFile(gitIgnorePath, `${gitIgnore}
154
+ .wrangler/state/v3
155
+ `).catch(() => {
154
156
  });
155
157
  addedToGitIgnore = true;
156
158
  }
@@ -1,3 +1,3 @@
1
- import type { NitroAppPlugin } from "nitropack";
1
+ import type { NitroAppPlugin } from 'nitropack';
2
2
  declare const _default: NitroAppPlugin;
3
3
  export default _default;
@@ -1,4 +1,4 @@
1
- import { useRuntimeConfig, getRequestURL } from "#imports";
1
+ import { getRequestURL, useRuntimeConfig } from "#imports";
2
2
  const _proxy = _getPlatformProxy().catch((error) => {
3
3
  console.error("Failed to initialize wrangler bindings proxy", error);
4
4
  return _createStubProxy();
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bino0216/nitro-cloudflare-dev",
3
+ "type": "module",
4
+ "version": "0.2.7",
3
5
  "private": false,
4
- "version": "0.2.6",
5
6
  "description": "POC module to enable access to the Cloudflare runtime bindings in development server of Nitro and Nuxt",
6
- "repository": "pi0/nitro-cloudflare-dev",
7
7
  "license": "MIT",
8
+ "repository": "pi0/nitro-cloudflare-dev",
8
9
  "sideEffects": false,
9
- "type": "module",
10
10
  "exports": {
11
11
  ".": {
12
12
  "types": "./dist/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "consola": "^3.4.0",
27
27
  "mlly": "^1.7.4",
28
28
  "pkg-types": "^2.1.0",
29
- "openwrangler": "0.0.4"
29
+ "openwrangler": "0.0.5"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@cloudflare/workers-types": "^4.20250303.0",