Skip to content

Commit c69939a

Browse files
committed
Update readme with local testing guidance
1 parent d5d7eb9 commit c69939a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,39 @@ Currently the wizard can be used for **React, NextJS, Svelte and React Native**
2121
projects. If you have other integrations you would like the wizard to support,
2222
please open a [GitHub issue](https://github.com/posthog/wizard/issues)!
2323

24+
## Testing Locally
25+
26+
To test your local changes to the wizard in a different project:
27+
28+
1. **Build the wizard:**
29+
Navigate to the root directory of this wizard project and build it:
30+
```bash
31+
pnpm build
32+
```
33+
This compiles the TypeScript code and prepares the `dist` directory. Run this command any time you make changes to the wizard's source code.
34+
35+
2. **Make the wizard available to other projects:**
36+
In the wizard's project directory, run:
37+
```bash
38+
pnpm link --global
39+
```
40+
This command makes your local version of the wizard available system-wide. You generally only need to do this once, or if you've unlinked it or made changes to `package.json` that affect the package's global registration.
41+
42+
4. **Run the Wizard:**
43+
Now, from the root directory of your test project, you can run the wizard using its command:
44+
```bash
45+
wizard [options]
46+
```
47+
For example:
48+
```bash
49+
wizard --integration nextjs
50+
```
51+
or simply:
52+
```bash
53+
wizard
54+
```
55+
The wizard will execute using your local code. Changes made in the wizard's source directory (and rebuilt with `pnpm build`) will be reflected immediately.
56+
2457
# Options
2558
2659
The following CLI arguments are available:

0 commit comments

Comments
 (0)