From cf4f84d0ecf9f9253c599ea4704c6408d002019c Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 22 Jan 2024 18:17:21 +0100 Subject: [PATCH] chore: update readme --- README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f107258..266ea1d 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,16 @@ -# Cloudflare Bindings for Nitro and Nuxt Dev Server +# Cloudflare Bindings for Nitro and Nuxt -This is a proof of concept module to enable access to the Cloudflare runtime bindings in development server of [Nitro](https://nitro.unjs.io) and [Nuxt](https://nuxt.com) using new `getBindingsProxy` api exposed by wrangler. +This is a proof of concept module to enable access to the Cloudflare runtime bindings in the development server of [Nitro](https://nitro.unjs.io) and [Nuxt](https://nuxt.com) using the new `getBindingsProxy` API exposed by wrangler and [miniflare](https://miniflare.dev/) -> [!WARNING] > `getBindingsProxy` is not yet part of wrangler, we are just using the prerelease from: https://github.com/cloudflare/workers-sdk/pull/4523. The utility's API can still change +> [!WARNING] +> `getBindingsProxy` is not yet part of the wrangler, we are just using the prerelease from: https://github.com/cloudflare/workers-sdk/pull/4523. The utility's API can still change > [!NOTE] > Nitro project 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. ## Usage -1. Install `nitro-cloudflare-bindings` and `wrangler` packages as dev dependency +First, install `nitro-cloudflare-bindings` and `wrangler` packages as a dev dependency ```sh npx nypm i -D wrangler nitro-cloudflare-bindings @@ -17,7 +18,7 @@ npx nypm i -D wrangler nitro-cloudflare-bindings (universal script uses [unjs/nypm](https://github.com/unjs/nypm) to automatically detect your package manager) -2. Add module +Then configure the module **For [Nuxt](https://nuxt.com) projects:** @@ -37,10 +38,14 @@ export default defineNitroConfig({ }); ``` +## Configuration and persistence + +This module automatically finds the closest [`wrangler.toml`](https://developers.cloudflare.com/workers/wrangler/configuration/) file for configuration. + ## Development - Clone this repository -- Install latest LTS version of [Node.js](https://nodejs.org/en/) +- Install the latest LTS version of [Node.js](https://nodejs.org/en/) - Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` - Install dependencies using `pnpm install` - Run Nitro playground using `pnpm dev:nitro` or Nuxt playground using `pnpm dev:nuxt`