You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#3032229154b Thanks @stipsan! - fix: use a literal @ instead of the percent-encoded %40 in the homepage links to the packages/@sanity/* directories, so the URLs read cleanly in the npm UI (GitHub resolves both forms)
#29597a1e207 Thanks @stipsan! - Add outDir: "${configDir}/dist" to the recommended preset
Emitting to dist is already the default in @sanity/pkg-utils and tsdown, but every repo extending these presets had to repeat it in their own tsconfig. Since ${configDir} resolves to the directory of the tsconfig that extends the preset, output now lands in the dist folder next to your package.json by default, and the manual declaration can be removed:
#325033e7b93 Thanks @stipsan! - Move the conditional CSS export from inject.nodeCompat to exports.nodeCompat, and give @tsdown/css output the same treatment.
nodeCompat configures how the CSS file is published, not how the import is injected, so it moves to a dedicated exports option. inject and exports are now independent: inject prepends an import of the CSS to entry chunks, while exports publishes it as the ./<fileName> export subpath (which also makes any injected import self-referential). exports: true declares a plain string export for browser-only packages; exports: {nodeCompat: true} declares the conditional export and emits the no-op JS shim plus its .d.ts. inject: {nodeCompat: true} keeps working, normalized to {inject: true, exports: {nodeCompat: true}} with a deprecation warning; an explicit exports wins over it.
@sanity/tsdown-config gains a css.exports option implementing the same pattern on top of @tsdown/css (an optional peer dependency), which compiles CSS but has no node-shim concept of its own — its inject emits a relative import that throws in runtimes that cannot load .css files.
@sanity/pkg-utils gains a css option, and builds a .css export subpath that declares a source:
pkg build compiles it to dist/ui/styles.css with the same minify and lowering settings vanillaExtract gets, emits the shim, and fills in the types/browser/style/node/default conditions. @sanity/parse-package-json exposes the new parseCssExports for reading those subpaths, and parseExports no longer returns them as JS entries.
#3253bc16006 Thanks @stipsan! - Suppress CIRCULAR_DEPENDENCY warnings from the declaration bundling pass by default, and add a suppressWarnings option.
defineConfig enables Rolldown's checks.circularDependency, which also reports cycles between the emitted .d.ts modules. Those imports are type-only and erased at runtime, so the cycles carry none of the hazards the check exists to surface, and they're unavoidable for mutually referencing public types — in sanity-io/sanity#13753 109 of 136 cycle warnings were declaration-only, drowning out the 27 real ones. The config now sets tsdown's suppressWarnings to drop warnings whose entire cycle consists of declaration files (.d.ts/.d.mts/.d.cts); a cycle that includes even one runtime module still warns. Consumers that filtered these out themselves (like @repo/tsdown.config in sanity-io/sanity) can drop their own predicate.
The new suppressWarnings option takes tsdown's own value shapes (strings matched with includes, regular expressions matched with test, or a predicate) and is OR'd with the built-in suppression, so per-package suppressions can't silently undo it. Merging suppressWarnings over the returned config still replaces the default entirely (mergeConfig replaces functions), which is the escape hatch for restoring every warning: mergeConfig(await defineConfig(), {suppressWarnings: () => false}).
tsdown added suppressWarnings in 0.22.7, so the tsdown peer range is raised from ^0.22.5 to ^0.22.7. On 0.22.5/0.22.6 the option is silently ignored (the cycle warnings keep appearing) and the UserConfig['suppressWarnings'] indexed access in the published declarations does not resolve.
#3246c1106f1 Thanks @stipsan! - Move the tsdoc feature (API Extractor TSDoc/release-tag checking) from @sanity/pkg-utils into @sanity/tsdown-config.
In @sanity/tsdown-config the option is false by default; set tsdoc: true (or an options object) to run the check after the build via tsdown's build:done hook. The checker lives at @sanity/tsdown-config/tsdoc and is lazy-loaded from the root config, so API Extractor is not part of the default entry's module graph. @sanity/pkg-utils continues enabling it by default (tsdoc: true) when composing the config, and still runs it during pkg check via checkTsdoc from @sanity/tsdown-config/tsdoc.
#3238e19e63e Thanks @stipsan! - Default exports.enabled to true instead of 'local-only'.
Gating on CI via 'local-only'/'ci-only' surprised environments that set CI=true without meaning "don't rewrite package.json" (notably Cursor Cloud and GitHub Copilot)
#3221125080f Thanks @stipsan! - Make defineConfig a composable base for programmatic hosts (like the upcoming tsdown-powered @sanity/pkg-utils):
New cwd option: forwarded to tsdown's own cwd, and used for the package-manager detection behind the devExports default instead of process.cwd() — so builds driven programmatically for a package in another directory resolve the right defaults.
Package-manager detection only runs when it can affect the outcome: it exists solely to decide the pnpm-gated devExports: true default, so it is skipped when the userland exports value replaces the defaults (false, true, a bare CI condition) or sets devExports explicitly. Explicit configs behave identically across package managers, with no filesystem probing.
The composition contract is now documented and covered by tests: defineConfig() output is a mergeConfig-safe base — plugins append (never clobbering the React Compiler / vanilla-extract plugins this config sets up), plain objects deep-merge, and scalars/non-plugin arrays replace.
Node 20 support is dropped: engines.node is now ^22.18.0 || >=24.11.0, matching tsdown's own requirement. The previous >=20.19 <22 range was unachievable in practice — this package only executes inside tsdown's process, which already requires Node ^22.18.0.
#31434a7b12d Thanks @stipsan! - Add reactServer to the reactCompiler options, for libraries that render in React Server Components. It's experimental (@alpha) and not covered by semver: it can change behavior or be removed entirely in a minor version.
React Server Components refuse to load React Compiler output (react/compiler-runtime throws in the react-server environment), so libraries that ship compiled code are expected to publish two entrypoints. reactServer: true bakes that pattern in: every entry is built twice from the same source, and the only difference is that React Compiler auto-memoization is applied to the non-react-server output. The uncompiled build lands next to the compiled one (dist/index.js ↔ dist/index.react-server.js), and when the exports feature is enabled every entry export gains a react-server condition:
Nothing is stripped from either output, so pair it with deleting manual useMemo/useCallback calls from the source: server components stop paying for memoization that cannot pay off (they render exactly once), and client components get the compiler's finer-grained auto-memoization instead.
#31224d1d32f Thanks @stipsan! - The default minify compress pass now preserves function and class names
(compress: {keepNames: {function: true, class: true}}, previously compress: true).
The compress pass strips otherwise-unreferenced names - most notably the inner name
in forwardRef(function Button(…) {…}), which React DevTools reads via Function.name. That
name is the tree-shakeable alternative to a top-level Button.displayName = '…' assignment (a
side effect that pins unused components into consumer bundles, see sanity-io/ui#2435), and once stripped at publish
time it is unrecoverable in userland. Keeping the names costs a fraction of a kilobyte in the
published dist and nothing in final app bundles - consumers' production builds minify node_modules again anyway (and can opt into their own keepNames/keep_fnames for readable
production profiling, which only works if the library kept the names in the first place).
Packages that already apply this override on top of defineConfig (like @sanity/ui) can
remove it. To restore the previous behavior, merge over the returned config:
#3086b900be5 Thanks @stipsan! - Stop emitting a redundant bundle.css.d.ts alongside the vanilla-extract CSS shim.
The conditional ./bundle.css export already has an explicit types condition pointing at bundle-css.d.ts, so TypeScript never needs a sibling declaration for the CSS file itself. Compat mode now emits only that one declaration (plus bundle-css.js and bundle.css).
cssFileDtsFileName is no longer exported from @sanity/vanilla-extract-rolldown-plugin (0.x breaking API change → minor).
#3058685f9c6 Thanks @stipsan! - Align every rolldown copy on the version vite 8 pins (1.1.5, via a pnpm override and ~1.1.5/1.1.5 ranges) so vite, tsdown, rolldown-plugin-dts, and the workspace packages all share one copy — and one Plugin type, making the cross-version @ts-expect-error suppressions from #3051 unnecessary. To be bumped when vite updates its pinned rolldown.
#3059b328999 Thanks @stipsan! - Enable Rolldown's checks.circularDependency warning by default (Rolldown itself defaults it to false), so import cycles surface during Sanity library builds. Override with mergeConfig(..., {checks: {circularDependency: false}}) if needed.
#30508aa451c Thanks @stipsan! - Expose tsdown's experimental css option on PackageOptions and forward it as-is (requires @tsdown/css in the project — this package does not depend on it). Safe to combine with vanillaExtract for packages that use both vanilla-extract and CSS modules; the pipelines write to bundle.css and style.css by default and do not collide.
#30486824773 Thanks @stipsan! - Expose tsdown's clean option on PackageOptions so packages can clean folders before build (prefer clean: ['dist', …] over a separate package.json"clean" script) without mergeConfig
#3043f076033 Thanks @stipsan! - Rename the vanilla-extract node/SSR CSS shim from bundle.css.js to bundle-css.js, and add an explicit types condition to the conditional ./bundle.css export.
bundle.css.js matches vanilla-extract's cssFileFilter (/\.css\.(js|…)$/), so Vite plugins (notably @sanity/vanilla-extract-vite-plugin via Vite's ModuleRunner) would try to evaluate the empty shim as .css.ts output and throw. The public ./bundle.css export subpath is unchanged; only the on-disk shim (and its node/default export targets) move to bundle-css.js, with matching bundle-css.d.ts / bundle.css.d.ts companions for both export targets.
Since the shim's basename no longer matches the CSS file's basename, TypeScript's extension-substitution fallback (stripping .js to find a sibling .d.ts) would now resolve a different file than before - and that fallback is being deprecated in TypeScript itself (microsoft/TypeScript#50762). The conditional export now points a types condition directly at the shim's declaration file instead of relying on it:
#3032229154b Thanks @stipsan! - feat: CSS syntax lowering and minification now follow the css defaults of @tsdown/css exactly, and the @sanity/browserslist-config opinion moved up into @sanity/tsdown-config:
@sanity/vanilla-extract-rolldown-plugin (and the tsdown plugin wrapping it) no longer depends on browserslist/@sanity/browserslist-config. Like css.target in @tsdown/css, syntax lowering is skipped when no target is configured anywhere (the option, or the host-resolved top-level target — e.g. derived from engines.node), or when the configured targets name no browsers (e.g. 'node20'); target: false stays the explicit off switch.
minify now defaults to false, matching css.minify in @tsdown/css (extracted CSS was previously minified by default).
New lightningcss option, like css.lightningcss in @tsdown/css: options passed through to lightningcss's transform(), where lightningcss.targets takes precedence over the esbuild-style target and the plugin-managed fields (minify, cssModules) win over their lightningcss counterparts. esbuildTargetToLightningCSS is exported for hosts that need to convert or inspect esbuild-style targets.
@sanity/tsdown-config preserves the Sanity-flavored defaults at its level (and now owns the browserslist, @sanity/browserslist-config, and lightningcss dependencies): when the effective CSS target (vanillaExtract.target, falling back to the top-level target) is undefined or names no browsers, the lowering targets are resolved from @sanity/browserslist-config and passed through lightningcss.targets. target: false (at either level) disables lowering entirely, and a user-provided lightningcss.targets wins over the fallback. vanillaExtract.minify keeps defaulting to true there — published Sanity libraries ship minified CSS, unlike the bare plugins — so nothing changes for @sanity/tsdown-config users.
Patch Changes
#3032229154b Thanks @stipsan! - fix: use a literal @ instead of the percent-encoded %40 in the homepage links to the packages/@sanity/* directories, so the URLs read cleanly in the npm UI (GitHub resolves both forms)
#3031944ae4d Thanks @stipsan! - Expose tsdown's sourcemap and deps options on PackageOptions, default sourcemap to true (matching @sanity/pkg-utils), and when platform is 'neutral' mark node: built-ins external and restore module/main resolve fallbacks so monorepo wrappers no longer need mergeConfig for those
#3029b50944c Thanks @stipsan! - Relax the tsdown peer dependency from an exact pin (0.22.5) to a range (^0.22.5), so newer tsdown patch releases like 0.22.7 no longer trigger unresolved peer dependency warnings on install.
#3027a16513b Thanks @stipsan! - Only enable devExports: true by default when the project package manager is detected as pnpm, preventing npm and other package managers from publishing source-only exports.
#3017e73018a Thanks @stipsan! - feat: expose tsdown's top-level target option, passed through as-is like format, dts and define. It downlevels JS syntax for the given runtimes and doubles as the default CSS syntax lowering target when vanillaExtract is enabled
#3017e73018a Thanks @stipsan! - feat: the vanillaExtract option is now powered by @sanity/vanilla-extract-tsdown-plugin instead of @vanilla-extract/rollup-plugin, so enabling it no longer pulls rollup (a peer dependency of the rollup plugin) into tsdown projects. The alpha vanillaExtract options are now modeled after the css options of @tsdown/css: extract.name is now fileName, browserslist is now the esbuild-style target (defaulting to tsdown's top-level target when it includes browsers, then @sanity/browserslist-config), extract.compatMode is now inject: {nodeCompat: true} (the default here - inject: true injects a plain relative CSS import instead), and CSS sourcemaps (extract.sourcemap) are no longer emitted, aligned with @tsdown/css. The cwd, esbuildOptions and unstable_injectFilescopes options have been removed
#3017e73018a Thanks @stipsan! - feat: forward tsdown's exports option with the Sanity defaults documented on PackageOptions (enabled: 'local-only' and devExports: true), applied with tsdown's mergeConfig semantics: an object deep-merges over the defaults, while any other value (false, a bare CI condition) replaces them. The tsconfig option no longer defaults to 'tsconfig.json' and is forwarded as-is, since tsdown auto-detects the project tsconfig. Options that aren't exposed on PackageOptions can be customized by merging over the returned config with tsdown's mergeConfig, now documented in the README
#3021acf844f Thanks @stipsan! - Rely on tsdown's default hashed chunk filenames ([name]-[hash].<ext>) instead of setting hash: false and emitting shared chunks into _chunks-es, _chunks-cjs and _chunks-dts folders.
The hash suffix keeps a shared (non-entry) chunk from ever taking an entry's filename, which is what the _chunks-* folders were guarding against: code shared between two entries forms a chunk that rolldown may name after one of the entries (e.g. theme), and without the hash the d.ts output could hand the entry's theme.d.ts filename to the chunk - which exports everything under minified aliases - breaking every named import from that entry with TS2460 (see sanity-io/ui#2262). Entries keep their stable, unhashed filenames, so public import paths are unaffected; only the internal chunk filenames change (e.g. _chunks-es/theme.js becomes theme-CYP9-xTb.js).
Opting out of the hashing is possible by merging {hash: false} over the returned config with tsdown's mergeConfig (at the risk of reintroducing the filename collision on multi-entry packages, unless outputOptions.chunkFileNames keeps chunks away from the entries).
Patch Changes
#301899bd418 Thanks @stipsan! - Remove outputOptions.hoistTransitiveImports: false, the option is not implemented in rolldown and has no effect
#29789caf824 Thanks @stipsan! - feat: support TypeScript 7 (the Go-native compiler), require TypeScript 6 or later
BREAKING: the typescript peer dependency range is now 6.x || 7.x — TypeScript 5.x is no longer supported. TypeScript 7 is not required yet, but 6.0 is the new minimum.
The classic JS compiler API (used for parsing tsconfig.json and the api-extractor dts pipeline) is now always loaded from the official @typescript/typescript6 compat package (a regular dependency), since TypeScript 7 no longer ships it. The installed typescript peer no longer affects that pipeline.
dts: 'rolldown' upgrades to rolldown-plugin-dts 0.27.x: with typescript v7 installed, type generation automatically uses the Go-native compiler (tsgo) from the typescript package itself, without needing @typescript/native-preview. With v6, the previous behavior is unchanged (tsgo is opt-in via the tsgo option or @typescript/native-preview in devDependencies, and tsgo: false still opts out).
#2967b5d524e Thanks @stipsan! - Emit shared (non-entry) chunks into _chunks-es, _chunks-cjs and _chunks-dts folders, following the same naming convention as @sanity/pkg-utils, instead of placing them at the root of dist next to the entries.
A chunk could otherwise take an entry's filename: code shared between two entries forms a chunk that rolldown may name after one of the entries (e.g. theme). The JS output deduplicates such filename collisions in favor of the entry, but the d.ts output could resolve them the other way around, handing the entry's .d.ts filename to the chunk - which exports everything under minified aliases like buildTheme as x - so every named import from that entry failed to type-check with TS2460 (see sanity-io/ui#2262). With chunks emitted into their own folders they can never collide with entry filenames.
#2961c32c11d Thanks @stipsan! - Add dts and define options, passed through to tsdown as-is.
The dts option customizes how .d.ts files are generated, for example to use tsgo for type generation (the same feature as the tsgo option in @sanity/pkg-utils, requires @typescript/native-preview to be installed):
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
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
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.
This PR contains the following updates:
^0.6.0→^0.7.0^2.30.0→^2.31.1^2.1.0→^2.2.1^0.5.8→^0.24.0^24.12.2→^24.13.3^4.1.2→^4.1.10^0.44.0→^0.63.0^1.59.0→^1.78.0^0.20.0→^0.25.04f9cc66→84c30a84d2d3a0→a311e91^0.21.7→^0.22.14^0.28.18→^0.28.20^4.1.2→^4.1.10Release Notes
changesets/changesets (@changesets/changelog-github)
v0.7.0Compare Source
Minor Changes
94578cfThanks @Kauhsa! - AddeddisableThanksoptionsanity-io/pkg-utils (@sanity/tsconfig)
v2.2.1Compare Source
Patch Changes
229154bThanks @stipsan! - fix: use a literal@instead of the percent-encoded%40in thehomepagelinks to thepackages/@sanity/*directories, so the URLs read cleanly in the npm UI (GitHub resolves both forms)v2.2.0Compare Source
Minor Changes
#2959
7a1e207Thanks @stipsan! - AddoutDir: "${configDir}/dist"to therecommendedpresetEmitting to
distis already the default in@sanity/pkg-utilsandtsdown, but every repo extending these presets had to repeat it in their own tsconfig. Since${configDir}resolves to the directory of the tsconfig that extends the preset, output now lands in thedistfolder next to yourpackage.jsonby default, and the manual declaration can be removed:{ "extends": "@sanity/tsconfig/strictest", - "compilerOptions": { - "outDir": "${configDir}/dist" - } }sanity-io/pkg-utils (@sanity/tsdown-config)
v0.24.0Compare Source
Minor Changes
#3250
33e7b93Thanks @stipsan! - Move the conditional CSS export frominject.nodeCompattoexports.nodeCompat, and give@tsdown/cssoutput the same treatment.nodeCompatconfigures how the CSS file is published, not how the import is injected, so it moves to a dedicatedexportsoption.injectandexportsare now independent:injectprepends an import of the CSS to entry chunks, whileexportspublishes it as the./<fileName>export subpath (which also makes any injected import self-referential).exports: truedeclares a plain string export for browser-only packages;exports: {nodeCompat: true}declares the conditional export and emits the no-op JS shim plus its.d.ts.inject: {nodeCompat: true}keeps working, normalized to{inject: true, exports: {nodeCompat: true}}with a deprecation warning; an explicitexportswins over it.@sanity/tsdown-configgains acss.exportsoption implementing the same pattern on top of@tsdown/css(an optional peer dependency), which compiles CSS but has no node-shim concept of its own — itsinjectemits a relative import that throws in runtimes that cannot load.cssfiles.@sanity/pkg-utilsgains acssoption, and builds a.cssexport subpath that declares asource:pkg buildcompiles it todist/ui/styles.csswith the same minify and lowering settingsvanillaExtractgets, emits the shim, and fills in thetypes/browser/style/node/defaultconditions.@sanity/parse-package-jsonexposes the newparseCssExportsfor reading those subpaths, andparseExportsno longer returns them as JS entries.#3253
bc16006Thanks @stipsan! - SuppressCIRCULAR_DEPENDENCYwarnings from the declaration bundling pass by default, and add asuppressWarningsoption.defineConfigenables Rolldown'schecks.circularDependency, which also reports cycles between the emitted.d.tsmodules. Those imports are type-only and erased at runtime, so the cycles carry none of the hazards the check exists to surface, and they're unavoidable for mutually referencing public types — in sanity-io/sanity#13753 109 of 136 cycle warnings were declaration-only, drowning out the 27 real ones. The config now sets tsdown'ssuppressWarningsto drop warnings whose entire cycle consists of declaration files (.d.ts/.d.mts/.d.cts); a cycle that includes even one runtime module still warns. Consumers that filtered these out themselves (like@repo/tsdown.configinsanity-io/sanity) can drop their own predicate.The new
suppressWarningsoption takes tsdown's own value shapes (strings matched withincludes, regular expressions matched withtest, or a predicate) and is OR'd with the built-in suppression, so per-package suppressions can't silently undo it. MergingsuppressWarningsover the returned config still replaces the default entirely (mergeConfigreplaces functions), which is the escape hatch for restoring every warning:mergeConfig(await defineConfig(), {suppressWarnings: () => false}).tsdown added
suppressWarningsin0.22.7, so thetsdownpeer range is raised from^0.22.5to^0.22.7. On0.22.5/0.22.6the option is silently ignored (the cycle warnings keep appearing) and theUserConfig['suppressWarnings']indexed access in the published declarations does not resolve.#3246
c1106f1Thanks @stipsan! - Move thetsdocfeature (API Extractor TSDoc/release-tag checking) from@sanity/pkg-utilsinto@sanity/tsdown-config.In
@sanity/tsdown-configthe option isfalseby default; settsdoc: true(or an options object) to run the check after the build via tsdown'sbuild:donehook. The checker lives at@sanity/tsdown-config/tsdocand is lazy-loaded from the root config, so API Extractor is not part of the default entry's module graph.@sanity/pkg-utilscontinues enabling it by default (tsdoc: true) when composing the config, and still runs it duringpkg checkviacheckTsdocfrom@sanity/tsdown-config/tsdoc.Patch Changes
#3252
d952984Thanks @squiggler-app! - fix(deps): update dependency publint to ^0.3.23Updated dependencies [
33e7b93,d952984]:v0.23.0Compare Source
Minor Changes
#3238
e19e63eThanks @stipsan! - Defaultexports.enabledtotrueinstead of'local-only'.Gating on
CIvia'local-only'/'ci-only'surprised environments that setCI=truewithout meaning "don't rewrite package.json" (notably Cursor Cloud and GitHub Copilot)Patch Changes
v0.22.0Compare Source
Minor Changes
#3221
125080fThanks @stipsan! - MakedefineConfiga composable base for programmatic hosts (like the upcoming tsdown-powered@sanity/pkg-utils):cwdoption: forwarded to tsdown's owncwd, and used for the package-manager detection behind thedevExportsdefault instead ofprocess.cwd()— so builds driven programmatically for a package in another directory resolve the right defaults.devExports: truedefault, so it is skipped when the userlandexportsvalue replaces the defaults (false,true, a bare CI condition) or setsdevExportsexplicitly. Explicit configs behave identically across package managers, with no filesystem probing.defineConfig()output is amergeConfig-safe base —pluginsappend (never clobbering the React Compiler / vanilla-extract plugins this config sets up), plain objects deep-merge, and scalars/non-plugin arrays replace.engines.nodeis now^22.18.0 || >=24.11.0, matching tsdown's own requirement. The previous>=20.19 <22range was unachievable in practice — this package only executes inside tsdown's process, which already requires Node^22.18.0.Patch Changes
v0.21.3Compare Source
Patch Changes
6b1d707Thanks @squiggler-app! - fix(deps): update dependency @vitejs/plugin-react to ^6.0.5v0.21.2Compare Source
Patch Changes
17cfcbe]:v0.21.1Compare Source
Patch Changes
#3132
e400791Thanks @squiggler-app! - fix(deps): update dependency browserslist to ^4.28.7#3133
d60da06Thanks @squiggler-app! - fix(deps): update dependency publint to ^0.3.22#3158
eaa211fThanks @squiggler-app! - fix(deps): update dependency package-manager-detector to ^1.8.0#3154
523fb8cThanks @stipsan! - fix(deps): update dependency tsdown to ^0.22.14Updated dependencies [
d60da06,523fb8c]:v0.21.0Compare Source
Minor Changes
#3143
4a7b12dThanks @stipsan! - AddreactServerto thereactCompileroptions, for libraries that render in React Server Components. It's experimental (@alpha) and not covered by semver: it can change behavior or be removed entirely in a minor version.React Server Components refuse to load React Compiler output (
react/compiler-runtimethrows in thereact-serverenvironment), so libraries that ship compiled code are expected to publish two entrypoints.reactServer: truebakes that pattern in: every entry is built twice from the same source, and the only difference is that React Compiler auto-memoization is applied to the non-react-serveroutput. The uncompiled build lands next to the compiled one (dist/index.js↔dist/index.react-server.js), and when theexportsfeature is enabled every entry export gains areact-servercondition:{ "exports": { ".": { "types": "./dist/index.d.ts", "react-server": "./dist/index.react-server.js", "default": "./dist/index.js" } } }Nothing is stripped from either output, so pair it with deleting manual
useMemo/useCallbackcalls from the source: server components stop paying for memoization that cannot pay off (they render exactly once), and client components get the compiler's finer-grained auto-memoization instead.Patch Changes
3dcad6cThanks @squiggler-app! - fix(deps): update dependency @vitejs/plugin-react to ^6.0.4v0.20.0Compare Source
Minor Changes
#3122
4d1d32fThanks @stipsan! - The defaultminifycompress pass now preserves function and class names(
compress: {keepNames: {function: true, class: true}}, previouslycompress: true).The compress pass strips otherwise-unreferenced names - most notably the inner name
in
forwardRef(function Button(…) {…}), which React DevTools reads viaFunction.name. Thatname is the tree-shakeable alternative to a top-level
Button.displayName = '…'assignment (aside effect that pins unused components into consumer bundles, see
sanity-io/ui#2435), and once stripped at publish
time it is unrecoverable in userland. Keeping the names costs a fraction of a kilobyte in the
published dist and nothing in final app bundles - consumers' production builds minify
node_modulesagain anyway (and can opt into their ownkeepNames/keep_fnamesfor readableproduction profiling, which only works if the library kept the names in the first place).
Packages that already apply this override on top of
defineConfig(like@sanity/ui) canremove it. To restore the previous behavior, merge over the returned config:
Patch Changes
#3113
dceee04Thanks @squiggler-app! - fix(deps): update dependency tsdown to ^0.22.13Updated dependencies [
dceee04]:v0.19.6Compare Source
Patch Changes
#3106
f180e02Thanks @copilot-swe-agent! - Updatelightningcssto^1.33.0andyuku-parserto^0.7.0.Updated dependencies []:
v0.19.5Compare Source
Patch Changes
#3096
aac3364Thanks @squiggler-app! - fix(deps): update dependency tsdown to ^0.22.12Updated dependencies [
aac3364]:v0.19.4Compare Source
Patch Changes
#3089
412881bThanks @squiggler-app! - fix(deps): update dependency tsdown to ^0.22.11#3086
b900be5Thanks @stipsan! - Stop emitting a redundantbundle.css.d.tsalongside the vanilla-extract CSS shim.The conditional
./bundle.cssexport already has an explicittypescondition pointing atbundle-css.d.ts, so TypeScript never needs a sibling declaration for the CSS file itself. Compat mode now emits only that one declaration (plusbundle-css.jsandbundle.css).cssFileDtsFileNameis no longer exported from@sanity/vanilla-extract-rolldown-plugin(0.x breaking API change → minor).Updated dependencies [
412881b,b900be5]:v0.19.3Compare Source
Patch Changes
v0.19.2Compare Source
Patch Changes
#3077
9ec6ff3Thanks @squiggler-app! - fix(deps): update dependency tsdown to ^0.22.9Updated dependencies [
9ec6ff3]:v0.19.1Compare Source
Patch Changes
#3058
685f9c6Thanks @stipsan! - Align every rolldown copy on the version vite 8 pins (1.1.5, via a pnpm override and~1.1.5/1.1.5ranges) so vite, tsdown, rolldown-plugin-dts, and the workspace packages all share one copy — and onePlugintype, making the cross-version@ts-expect-errorsuppressions from #3051 unnecessary. To be bumped when vite updates its pinned rolldown.#3045
3020923Thanks @squiggler-app! - fix(deps): update dependency rolldown to v1.2.0Updated dependencies [
685f9c6,3020923]:v0.19.0Compare Source
Minor Changes
#3059
b328999Thanks @stipsan! - Enable Rolldown'schecks.circularDependencywarning by default (Rolldown itself defaults it tofalse), so import cycles surface during Sanity library builds. Override withmergeConfig(..., {checks: {circularDependency: false}})if needed.#3050
8aa451cThanks @stipsan! - Expose tsdown's experimentalcssoption onPackageOptionsand forward it as-is (requires@tsdown/cssin the project — this package does not depend on it). Safe to combine withvanillaExtractfor packages that use both vanilla-extract and CSS modules; the pipelines write tobundle.cssandstyle.cssby default and do not collide.v0.18.0Compare Source
Minor Changes
6824773Thanks @stipsan! - Expose tsdown'scleanoption onPackageOptionsso packages can clean folders before build (preferclean: ['dist', …]over a separatepackage.json"clean"script) withoutmergeConfigv0.17.2Compare Source
Patch Changes
bfd86fa]:v0.17.1Compare Source
Patch Changes
#3043
f076033Thanks @stipsan! - Rename the vanilla-extract node/SSR CSS shim frombundle.css.jstobundle-css.js, and add an explicittypescondition to the conditional./bundle.cssexport.bundle.css.jsmatches vanilla-extract'scssFileFilter(/\.css\.(js|…)$/), so Vite plugins (notably@sanity/vanilla-extract-vite-pluginvia Vite'sModuleRunner) would try to evaluate the empty shim as.css.tsoutput and throw. The public./bundle.cssexport subpath is unchanged; only the on-disk shim (and itsnode/defaultexport targets) move tobundle-css.js, with matchingbundle-css.d.ts/bundle.css.d.tscompanions for both export targets.Since the shim's basename no longer matches the CSS file's basename, TypeScript's extension-substitution fallback (stripping
.jsto find a sibling.d.ts) would now resolve a different file than before - and that fallback is being deprecated in TypeScript itself (microsoft/TypeScript#50762). The conditional export now points atypescondition directly at the shim's declaration file instead of relying on it:Rebuilding a package with compat mode on rewrites
package.jsonautomatically.Updated dependencies [
f076033]:v0.17.0Compare Source
Minor Changes
#3032
229154bThanks @stipsan! - feat: CSS syntax lowering and minification now follow thecssdefaults of@tsdown/cssexactly, and the@sanity/browserslist-configopinion moved up into@sanity/tsdown-config:@sanity/vanilla-extract-rolldown-plugin(and the tsdown plugin wrapping it) no longer depends onbrowserslist/@sanity/browserslist-config. Likecss.targetin@tsdown/css, syntax lowering is skipped when notargetis configured anywhere (the option, or the host-resolved top-leveltarget— e.g. derived fromengines.node), or when the configured targets name no browsers (e.g.'node20');target: falsestays the explicit off switch.minifynow defaults tofalse, matchingcss.minifyin@tsdown/css(extracted CSS was previously minified by default).lightningcssoption, likecss.lightningcssin@tsdown/css: options passed through to lightningcss'stransform(), wherelightningcss.targetstakes precedence over the esbuild-styletargetand the plugin-managed fields (minify,cssModules) win over their lightningcss counterparts.esbuildTargetToLightningCSSis exported for hosts that need to convert or inspect esbuild-style targets.@sanity/tsdown-configpreserves the Sanity-flavored defaults at its level (and now owns thebrowserslist,@sanity/browserslist-config, andlightningcssdependencies): when the effective CSS target (vanillaExtract.target, falling back to the top-leveltarget) is undefined or names no browsers, the lowering targets are resolved from@sanity/browserslist-configand passed throughlightningcss.targets.target: false(at either level) disables lowering entirely, and a user-providedlightningcss.targetswins over the fallback.vanillaExtract.minifykeeps defaulting totruethere — published Sanity libraries ship minified CSS, unlike the bare plugins — so nothing changes for@sanity/tsdown-configusers.Patch Changes
#3032
229154bThanks @stipsan! - fix: use a literal@instead of the percent-encoded%40in thehomepagelinks to thepackages/@sanity/*directories, so the URLs read cleanly in the npm UI (GitHub resolves both forms)Updated dependencies [
229154b,229154b]:v0.16.0Compare Source
Minor Changes
97c95bcThanks @stipsan! - Expose tsdown'soutDiroption onPackageOptionsso packages can write to a non-distdirectory withoutmergeConfigv0.15.0Compare Source
Minor Changes
944ae4dThanks @stipsan! - Expose tsdown'ssourcemapanddepsoptions onPackageOptions, defaultsourcemaptotrue(matching@sanity/pkg-utils), and whenplatformis'neutral'marknode:built-ins external and restoremodule/mainresolve fallbacks so monorepo wrappers no longer needmergeConfigfor thosePatch Changes
#3034
86402faThanks @squiggler-app! - fix(deps): update dependency tsdown to ^0.22.8Updated dependencies [
fb9ba79,86402fa]:v0.14.2Compare Source
Patch Changes
#3026
04a6206Thanks @squiggler-app! - fix(deps): update dependency tsdown to ^0.22.7Updated dependencies [
04a6206]:v0.14.1Compare Source
Patch Changes
#3029
b50944cThanks @stipsan! - Relax thetsdownpeer dependency from an exact pin (0.22.5) to a range (^0.22.5), so newertsdownpatch releases like0.22.7no longer trigger unresolved peer dependency warnings on install.#3027
a16513bThanks @stipsan! - Only enabledevExports: trueby default when the project package manager is detected as pnpm, preventing npm and other package managers from publishing source-only exports.v0.14.0Compare Source
Minor Changes
#3017
e73018aThanks @stipsan! - feat: expose tsdown's top-leveltargetoption, passed through as-is likeformat,dtsanddefine. It downlevels JS syntax for the given runtimes and doubles as the default CSS syntax lowering target whenvanillaExtractis enabled#3017
e73018aThanks @stipsan! - feat: thevanillaExtractoption is now powered by@sanity/vanilla-extract-tsdown-plugininstead of@vanilla-extract/rollup-plugin, so enabling it no longer pullsrollup(a peer dependency of the rollup plugin) into tsdown projects. The alphavanillaExtractoptions are now modeled after thecssoptions of@tsdown/css:extract.nameis nowfileName,browserslistis now the esbuild-styletarget(defaulting to tsdown's top-leveltargetwhen it includes browsers, then@sanity/browserslist-config),extract.compatModeis nowinject: {nodeCompat: true}(the default here -inject: trueinjects a plain relative CSS import instead), and CSS sourcemaps (extract.sourcemap) are no longer emitted, aligned with@tsdown/css. Thecwd,esbuildOptionsandunstable_injectFilescopesoptions have been removed#3017
e73018aThanks @stipsan! - feat: forward tsdown'sexportsoption with the Sanity defaults documented onPackageOptions(enabled: 'local-only'anddevExports: true), applied with tsdown'smergeConfigsemantics: an object deep-merges over the defaults, while any other value (false, a bare CI condition) replaces them. Thetsconfigoption no longer defaults to'tsconfig.json'and is forwarded as-is, since tsdown auto-detects the project tsconfig. Options that aren't exposed onPackageOptionscan be customized by merging over the returned config with tsdown'smergeConfig, now documented in the README#3021
acf844fThanks @stipsan! - Rely on tsdown's default hashed chunk filenames ([name]-[hash].<ext>) instead of settinghash: falseand emitting shared chunks into_chunks-es,_chunks-cjsand_chunks-dtsfolders.The hash suffix keeps a shared (non-entry) chunk from ever taking an entry's filename, which is what the
_chunks-*folders were guarding against: code shared between two entries forms a chunk that rolldown may name after one of the entries (e.g.theme), and without the hash the d.ts output could hand the entry'stheme.d.tsfilename to the chunk - which exports everything under minified aliases - breaking every named import from that entry withTS2460(see sanity-io/ui#2262). Entries keep their stable, unhashed filenames, so public import paths are unaffected; only the internal chunk filenames change (e.g._chunks-es/theme.jsbecomestheme-CYP9-xTb.js).Opting out of the hashing is possible by merging
{hash: false}over the returned config with tsdown'smergeConfig(at the risk of reintroducing the filename collision on multi-entry packages, unlessoutputOptions.chunkFileNameskeeps chunks away from the entries).Patch Changes
#3018
99bd418Thanks @stipsan! - RemoveoutputOptions.hoistTransitiveImports: false, the option is not implemented in rolldown and has no effectUpdated dependencies [
e73018a]:v0.13.1Compare Source
Patch Changes
#3008
abd8c07Thanks @squiggler-app! - fix(deps): update dependency @vanilla-extract/rollup-plugin to ^1.5.4#3015
d619032Thanks @squiggler-app! - fix(deps): update dependency tsdown to v0.22.5v0.13.0Compare Source
Minor Changes
#2978
9caf824Thanks @stipsan! - feat: support TypeScript 7 (the Go-native compiler), require TypeScript 6 or laterBREAKING: the
typescriptpeer dependency range is now6.x || 7.x— TypeScript 5.x is no longer supported. TypeScript 7 is not required yet, but 6.0 is the new minimum.tsconfig.jsonand theapi-extractordts pipeline) is now always loaded from the official@typescript/typescript6compat package (a regular dependency), since TypeScript 7 no longer ships it. The installedtypescriptpeer no longer affects that pipeline.dts: 'rolldown'upgrades torolldown-plugin-dts0.27.x: withtypescriptv7 installed, type generation automatically uses the Go-native compiler (tsgo) from thetypescriptpackage itself, without needing@typescript/native-preview. With v6, the previous behavior is unchanged (tsgois opt-in via thetsgooption or@typescript/native-previewindevDependencies, andtsgo: falsestill opts out).v0.12.1Compare Source
Patch Changes
#2979
cc771d2Thanks @squiggler-app! - fix(deps): update dependency vitest to ^4.1.10#2987
9fe5a25Thanks @squiggler-app! - fix(deps): update dependency tsdown to v0.22.3#2990
f067d9aThanks @squiggler-app! - fix(deps): update dependency browserslist to ^4.28.5v0.12.0Compare Source
Minor Changes
#2967
b5d524eThanks @stipsan! - Emit shared (non-entry) chunks into_chunks-es,_chunks-cjsand_chunks-dtsfolders, following the same naming convention as@sanity/pkg-utils, instead of placing them at the root ofdistnext to the entries.A chunk could otherwise take an entry's filename: code shared between two entries forms a chunk that rolldown may name after one of the entries (e.g.
theme). The JS output deduplicates such filename collisions in favor of the entry, but the d.ts output could resolve them the other way around, handing the entry's.d.tsfilename to the chunk - which exports everything under minified aliases likebuildTheme as x- so every named import from that entry failed to type-check withTS2460(see sanity-io/ui#2262). With chunks emitted into their own folders they can never collide with entry filenames.v0.11.0Compare Source
Minor Changes
#2961
c32c11dThanks @stipsan! - Adddtsanddefineoptions, passed through totsdownas-is.The
dtsoption customizes how.d.tsfiles are generated, for example to usetsgofor type generation (the same feature as thetsgooption in@sanity/pkg-utils, requires@typescript/native-previewto be installed):The
defineoption replaces global identifiers with constant expressions at build time (the same feature as thedefineoption in@sanity/pkg-utils):v0.10.0[Compare Source](https://redirect.github.com/sanity-io/pkg-utils/compare/@sanity/tsdown-config@0.9.0...@sanity/tsd
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Mend Renovate using a curated preset maintained by
. View repository job log here