refactor: extract CLI/sourcemap utilities from @posthog/core into @posthog/plugin-utils#3309
Merged
marandaneto merged 7 commits intomainfrom Apr 1, 2026
Merged
Conversation
…sthog/plugin-utils
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Prompt To Fix All With AIThis is a comment left during a code review.
Path: README.md
Line: 30
Comment:
**Missing `README.md` file for `plugin-utils`**
This link points to `./packages/plugin-utils/README.md`, but that file does not exist in this PR. The link will be broken for anyone navigating the repository. A minimal `README.md` should be added to `packages/plugin-utils/` before merging.
The same issue applies to `CHANGELOG.md` — `./packages/plugin-utils/CHANGELOG.md` is also missing (see the parallel addition in `CHANGELOG.md` line 14).
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: packages/core/package.json
Line: 60
Comment:
**Superfluous empty `dependencies` field**
After removing `cross-spawn`, the `dependencies` key was left as an empty object rather than being removed entirely. Per the repo's own "no superfluous parts" simplicity rule, this field adds noise without meaning.
```suggestion
}
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "chore: add changeset for plugin-utils ex..." | Re-trigger Greptile |
Contributor
Member
Author
|
i have to run https://posthog.com/handbook/engineering/sdks/releases#npm-packages-set-up-trusted-publishing-before-enabling-the-workflow before merging this |
Contributor
|
Size Change: -20.4 kB (-0.31%) Total Size: 6.65 MB
ℹ️ View Unchanged
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
@posthog/corecontained CLI and sourcemap processing utilities (runSourcemapCli,spawnLocal,resolveBinaryPath, config resolution) along with thecross-spawndependency. These are only used by build plugins (webpack-plugin, rollup-plugin, nextjs-config, nuxt) and have no place in core.This is problematic because packages like
posthog-react-nativedepend on@posthog/core, which meanscross-spawn(a Node.js CLI utility) ends up in the React Native dependency tree where it does not belong.Changes
@posthog/plugin-utilspackage containing all CLI/sourcemap utilities previously in@posthog/core/process:cli.ts—runSourcemapCli,buildSourcemapCliArgs,buildCliEnvconfig.ts—PluginConfig,ResolvedPluginConfig,resolveConfigspawn-local.ts—spawnLocalutils.ts—resolveBinaryPath,buildLocalBinaryPathscross-spawndependency from@posthog/coreto@posthog/plugin-utils./processexport from@posthog/core@posthog/plugin-utilsinstead of@posthog/core/process:@posthog/rollup-plugin@posthog/webpack-plugin@posthog/nextjs-config@posthog/nuxt@posthog/plugin-utilsto README.md, AGENTS.md, CHANGELOG.md, and the release workflowRelease info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
pnpm changesetto generate a changeset file