Cleanup shared configs#62
Conversation
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. |
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.
c790ad4 to
f640036
Compare
Thought about this more and in hindsight, you are totally right. I am going to change this PR to be more focused on cleaning up duplicate configuration in the tsdown config. |
Summary
Reverses direction from the original "move
__VERSION__into root base configs" — instead, all@sigmacomputing/plugin-specific settings are pulled out of the shared root configs and pushed intopackages/plugin-sdk/. The root base configs now hold only settings that genuinely apply to every workspace package.Moved out of root base configs into
packages/plugin-sdk/:tsdown.base.ts→packages/plugin-sdk/tsdown.config.ts:__VERSION__define,inputOptions.transform.jsx: 'react', and the UMDoutputOptions(entryFileNames,globals.react,name).vitest.base.ts→packages/plugin-sdk/vitest.config.ts:__VERSION__define,oxc.jsx, and thereact/jsx-dev-runtimeoptimizeDepsentry.tsconfig.app.json→packages/plugin-sdk/tsconfig.app.json:"jsx": "react".Other tightening in the root bases:
vitest.base.tstest include narrowed fromsrc/**/*.test.{js,jsx,ts,tsx}tosrc/**/*.test.{ts,tsx}(no JS/JSX test files in workspace packages).Test plan
yarn turbo buildsucceeds and the UMD/ESM/CJS bundles still embed the correct version at__VERSION__(consumed inpackages/plugin-sdk/src/client/initialize.ts:54) and producesigmacomputing-plugin.umd.jswith theSigmaPluginglobal.yarn turbo testpasses —__VERSION__, JSX transform, andreact/jsx-dev-runtimeresolution still work from the package-local vitest config.yarn turbo types/tsc -bpasses —jsx: "react"is correctly picked up from the package'stsconfig.app.json.