posthog-js 1.131.4 → 1.132.1

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 CHANGED
@@ -49,15 +49,25 @@ You can use the create react app setup in `playground/nextjs` to test posthog-js
49
49
 
50
50
  ## Developing together with another project
51
51
 
52
- Install pnpm to link a local version of `posthog-js` in another JS project: `npm install -g pnpm`
52
+ Install pnpm to link a local version of `posthog-js` in another JS project: `npm install -g pnpm`
53
53
 
54
- #### Run this to link the local version
54
+ ### Run this to link the local version
55
55
 
56
+ We have 2 options for linking this project to your local version: via [pnpm link](https://docs.npmjs.com/cli/v8/commands/npm-link) or via [local paths](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#local-paths)
57
+
58
+ #### local paths (preferred)
59
+
60
+ - from whichever repo needs to require `posthog-js`, go to the `package.json` of that file, and replace the `posthog-js` dependency version number with `file:<relative_or_absolute_path_to_local_module>`
61
+ - e.g. from the `package.json` within `posthog`, replace `"posthog-js": "1.131.4"` with `"posthog-js": "file:../posthog-js"`
62
+ - run `pnpm install` from the root of the project in which you just created a local path
63
+
64
+ Then, once this link has been created, any time you need to make a change to `posthog-js`, you can run `pnpm build` from the `posthog-js` root and the changes will appear in the other repo.
65
+
66
+ #### `pnpm link`
56
67
 
57
68
  - In the `posthog-js` directory: `pnpm link --global`
58
69
  - (for `posthog` this means: `pnpm link --global posthog-js && pnpm i && pnpm copy-scripts`)
59
- - You can then remove the link with `pnpm link --global posthog-js
60
-
70
+ - You can then remove the link by, e.g., running `pnpm link --global posthog-js` from within `posthog`
61
71
 
62
72
  ## Releasing a new version
63
73
 
@@ -73,9 +83,11 @@ To release an alpha or beta version, you'll need to use the CLI locally:
73
83
  2. Make sure you're logged into the npm CLI (`npm login`).
74
84
  3. Check out your work-in-progress branch (do not release an alpha/beta from `main`).
75
85
  4. Run the following commands, using the same bump level (major/minor/patch) as your PR:
86
+
76
87
  ```bash
77
88
  npm version [premajor | preminor | prepatch] --preid=beta
78
89
  npm publish --tag beta
79
90
  git push --tags
80
91
  ```
92
+
81
93
  5. Enjoy the new prerelease version. You can now use it locally, in a dummy app, or in the [main repo](https://github.com/posthog/PostHog).