@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 +4 -4
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs +5 -3
- package/dist/runtime/plugin.dev.d.ts +1 -1
- package/dist/runtime/plugin.dev.mjs +1 -1
- package/package.json +4 -4
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: [
|
|
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
|
|
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
|
|
3
|
+
declare module 'h3' {
|
|
4
4
|
interface H3EventContext {
|
|
5
|
-
cf: PlatformProxy[
|
|
5
|
+
cf: PlatformProxy['cf'];
|
|
6
6
|
cloudflare: {
|
|
7
7
|
request: Request & {
|
|
8
|
-
cf: PlatformProxy[
|
|
8
|
+
cf: PlatformProxy['cf'];
|
|
9
9
|
};
|
|
10
|
-
env: PlatformProxy[
|
|
11
|
-
context: PlatformProxy[
|
|
10
|
+
env: PlatformProxy['env'];
|
|
11
|
+
context: PlatformProxy['ctx'];
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
interface RemoteBinding {
|
|
17
|
-
type:
|
|
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
|
|
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
|
|
3
|
+
declare module 'h3' {
|
|
4
4
|
interface H3EventContext {
|
|
5
|
-
cf: PlatformProxy[
|
|
5
|
+
cf: PlatformProxy['cf'];
|
|
6
6
|
cloudflare: {
|
|
7
7
|
request: Request & {
|
|
8
|
-
cf: PlatformProxy[
|
|
8
|
+
cf: PlatformProxy['cf'];
|
|
9
9
|
};
|
|
10
|
-
env: PlatformProxy[
|
|
11
|
-
context: PlatformProxy[
|
|
10
|
+
env: PlatformProxy['env'];
|
|
11
|
+
context: PlatformProxy['ctx'];
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
interface RemoteBinding {
|
|
17
|
-
type:
|
|
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
|
|
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 {
|
|
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
|
|
153
|
+
await promises.writeFile(gitIgnorePath, `${gitIgnore}
|
|
154
|
+
.wrangler/state/v3
|
|
155
|
+
`).catch(() => {
|
|
154
156
|
});
|
|
155
157
|
addedToGitIgnore = true;
|
|
156
158
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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.
|
|
29
|
+
"openwrangler": "0.0.5"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@cloudflare/workers-types": "^4.20250303.0",
|