From d6791fe7c374350ea1d1039b5016536db789c872 Mon Sep 17 00:00:00 2001 From: Quazia Date: Thu, 22 May 2025 15:58:55 -0400 Subject: [PATCH] chore: update local development readme section --- README.md | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4d79dd0..03dc5fc 100644 --- a/README.md +++ b/README.md @@ -44,10 +44,36 @@ The above command will generate a `.env` file based on the `.env.local` file and ## Developing Script Locally -This section is only for working on the script and template, if you simply want to create a mini-app and _use_ the template this section is not for you. +This section is only for working on the script and template. If you simply want to create a mini-app and _use_ the template, this section is not for you. -To run the script locally just run: -``` +### Recommended: Using `npm link` for Local Development + +To iterate on the CLI and test changes in a generated app without publishing to npm: + +1. In your installer/template repo (this repo), run: + ```bash + npm link + ``` + This makes your local version globally available as a symlinked package. + + +1. Now, when you run: + ```bash + npx @neynar/create-farcaster-mini-app + ``` + ...it will use your local changes (including any edits to `init.js` or other files) instead of the published npm version. + +### Alternative: Running the Script Directly + +You can also run the script directly for quick iteration: + +```bash node ./bin/index.js ``` +However, this does not fully replicate the npx install flow and may not catch all issues that would occur in a real user environment. + +### Environment Variables and Scripts + +If you update environment variable handling, remember to replicate any changes in the `dev`, `build`, and `deploy` scripts as needed. The `build` and `deploy` scripts may need further updates and are less critical for most development workflows. +