Move __VERSION__ define into root base configs#62
Conversation
The root package.json and all workspace packages share the same version, so defining __VERSION__ once in tsdown.base.ts and vitest.base.ts removes the per-package override boilerplate.
rilescode
left a comment
There was a problem hiding this comment.
Would this be an issue if someone manually updates the version in plugin-sdk/package.json without using yarn bump? They could get out of sync
|
I'd rather have this just in the plugin-sdk package since it's the only one that needs the value injected |
This is prep work for splitting the package into multiple sub-packages. Should each one inject its own version thus requiring duplicated code for each package's tsdown config?
This would generally be a problem and that code should not be landed. The whole package should remain in sync. |
Summary
package.jsonand all workspace packages currently share the same version, so the per-package__VERSION__define was duplicating the root value.__VERSION__intotsdown.base.ts(already there) and added it tovitest.base.ts, then simplifiedpackages/plugin-sdk/{tsdown,vitest}.config.tsto just re-export the base config.Test plan
yarn turbo buildsucceeds and the built bundle still embeds the correct version string at__VERSION__(verified viapackages/plugin-sdk/src/client/initialize.ts).yarn turbo testpasses — the vitest browser env now picks up__VERSION__from the root base config.Generated by Claude Code