{"_id":"@atinux/nitro-cloudflare-dev","name":"@atinux/nitro-cloudflare-dev","dist-tags":{"latest":"0.2.1"},"versions":{"0.2.1":{"name":"@atinux/nitro-cloudflare-dev","version":"0.2.1","description":"POC module to enable access to the Cloudflare runtime bindings in development server of Nitro and Nuxt","repository":{"type":"git","url":"git+https://github.com/pi0/nitro-cloudflare-dev.git"},"license":"MIT","sideEffects":false,"type":"module","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"./dist/runtime/*":{"types":"./dist/runtime/*.d.ts","default":"./dist/runtime/*.mjs"}},"main":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build":"unbuild","dev:nitro":"pnpm run -C examples/nitro dev","dev:nuxt":"pnpm run -C examples/nuxt dev","lint":"eslint --cache . && prettier -c src","lint:fix":"eslint --cache . --fix && prettier -c src -w","prepack":"pnpm run build","release":"pnpm test && pnpm build && changelogen --release && npm publish && git push --follow-tags","test":"pnpm lint && pnpm test:types","test:types":"tsc --noEmit --skipLibCheck"},"resolutions":{"nitro-cloudflare-dev":"workspace:*"},"dependencies":{"consola":"^3.2.3","mlly":"^1.7.2","pkg-types":"^1.2.1"},"devDependencies":{"@cloudflare/workers-types":"^4.20241011.0","@types/node":"^22.7.5","changelogen":"^0.5.7","eslint":"^9.12.0","eslint-config-unjs":"^0.4.1","h3":"^1.13.0","jiti":"^2.3.3","miniflare":"^3.20241004.0","nitropack":"^2.9.7","nuxt":"^3.13.2","prettier":"^3.3.3","typescript":"^5.6.3","unbuild":"^2.0.0","wrangler":"^3.80.4"},"packageManager":"pnpm@9.12.1","_id":"@atinux/nitro-cloudflare-dev@0.2.1","gitHead":"713c45e9431f206b543877bc1f4f1f58e71df664","bugs":{"url":"https://github.com/pi0/nitro-cloudflare-dev/issues"},"homepage":"https://github.com/pi0/nitro-cloudflare-dev#readme","_nodeVersion":"20.16.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-U/5IkTAO8mIBh9liiktMLAEeGj4UFQWnsl7UIMc3JFgXCiGWn3ntR/UtIH8ubhx3r+XJkShQn1JGqNzUjWZq8g==","shasum":"cbb3d7a7a6b13c2c13b92e8741e0fc0a0a334191","tarball":"https://registry.npmjs.org/@atinux/nitro-cloudflare-dev/-/nitro-cloudflare-dev-0.2.1.tgz","fileCount":8,"unpackedSize":11388,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBHNYkbic79YhVREFrjMDqOPwtJkpQsLFbAafIAe40IBAiEAkPajYbn+e44B605q4cn8G/yRJUVMV5HD07UJLsG9jS4="}]},"_npmUser":{"name":"atinux","email":"atinux@gmail.com"},"directories":{},"maintainers":[{"name":"atinux","email":"atinux@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nitro-cloudflare-dev_0.2.1_1729514818092_0.8880409537493756"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-21T12:46:57.941Z","0.2.1":"2024-10-21T12:46:58.303Z","modified":"2024-10-21T12:46:58.590Z"},"maintainers":[{"name":"atinux","email":"atinux@gmail.com"}],"description":"POC module to enable access to the Cloudflare runtime bindings in development server of Nitro and Nuxt","homepage":"https://github.com/pi0/nitro-cloudflare-dev#readme","repository":{"type":"git","url":"git+https://github.com/pi0/nitro-cloudflare-dev.git"},"bugs":{"url":"https://github.com/pi0/nitro-cloudflare-dev/issues"},"license":"MIT","readme":"# Cloudflare Platform for Nitro and Nuxt\n\nThis proof of concept module enables access to the Cloudflare runtime platform in the development server of [Nitro](https://nitro.unjs.io) and [Nuxt](https://nuxt.com) using the [new `getPlatformProxy` API](https://github.com/cloudflare/workers-sdk/pull/5002) exposed by [wrangler](https://developers.cloudflare.com/workers/wrangler/) and [miniflare](https://miniflare.dev/)\n\n> [!NOTE]\n> Nitro plans to introduce a new method to allow native dev presets, meaning you can natively run [miniflare](https://miniflare.dev/) as your development server without this module or a proxy in the future!\n\n## Usage\n\nFirst, install `nitro-cloudflare-dev` and `wrangler` packages as a dev dependency: ([unjs/nypm](https://nypm.unjs.io) will automatically detect your package manager!)\n\n```sh\nnpx nypm@latest add -D wrangler nitro-cloudflare-dev\n```\n\nFor **Nuxt** update `nuxt.config.ts`:\n\n```js\nexport default defineNuxtConfig({\n  modules: [\"nitro-cloudflare-dev\"],\n});\n```\n\nFor **Nitro** update `nitro.config.ts`:\n\n```js\nimport nitroCloudflareBindings from \"nitro-cloudflare-dev\";\n\nexport default defineNitroConfig({\n  modules: [nitroCloudflareBindings],\n});\n```\n\n## Configuration and persistence\n\nThis module automatically finds the closest [`wrangler.toml`](https://developers.cloudflare.com/workers/wrangler/configuration/) file for configuration.\n\nData is persisted `.wrangler/state/v3` directory. On first use of the module, it will be automatically added to the `.gitignore` file.\n\nYou can configure additional options using `cloudflareDev: { }` in `nitro.config` or `nitro: { cloudflareDev: {} }` in `nuxt.config`.\n\n### Available options\n\n- `persistDir`: Sets the persist dir (default `.wrangler/state/v3`).\n- `configPath`: Sets a custom path for `wrangler.toml` file.\n- `silent`: Hide initial banner.\n- `environment`: Sets specific environment (useful for multi-environment configurations)\n\n## Development\n\n- Clone this repository\n- Install the latest LTS version of [Node.js](https://nodejs.org/en/)\n- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`\n- Install dependencies using `pnpm install`\n- Build in stub mode using `pnpm build --stub`\n- Run Nitro playground using `pnpm dev:nitro` or Nuxt playground using `pnpm dev:nuxt`\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":"README.md"}