@sanity/tsdown-config 0.28.8 → 0.29.0

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.
Files changed (2) hide show
  1. package/README.md +17 -0
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -222,6 +222,23 @@ without importing it automatically (for packages whose consumers import the subp
222
222
  > and still works, with a warning: `nodeCompat` configures how the CSS file is published, not how
223
223
  > the import is injected, so it moved to `exports`.
224
224
 
225
+ The default `identifiers: 'short'` names each style after a hash of the package name and the
226
+ file path, plus a counter of the styles before it in the file. A release that reorders a file's
227
+ styles therefore reuses its class names for different rules, and pages that load the CSS of two
228
+ releases (e.g. an app bundling a design system next to a CDN-served Studio bundling another
229
+ release of it) style one release's markup with the other's rules. Opt in to `'safe'` to keep
230
+ releases apart: it is `'short'` with the package version also hashed in, so every release gets
231
+ its own class names, and the same release always builds the same ones:
232
+
233
+ ```ts
234
+ import {defineConfig} from '@sanity/tsdown-config'
235
+
236
+ export default defineConfig({
237
+ tsconfig: 'tsconfig.dist.json',
238
+ vanillaExtract: {identifiers: 'safe'},
239
+ })
240
+ ```
241
+
225
242
  Two Sanity-flavored defaults diverge from the bare plugins (which match `@tsdown/css` exactly):
226
243
 
227
244
  - `minify` defaults to `true` - published Sanity libraries ship minified CSS. Set
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/tsdown-config",
3
- "version": "0.28.8",
3
+ "version": "0.29.0",
4
4
  "description": "Shared configuration for tsdown",
5
5
  "keywords": [
6
6
  "sanity-io",
@@ -39,7 +39,7 @@
39
39
  "@microsoft/api-extractor": "^7.59.4",
40
40
  "@microsoft/tsdoc-config": "^0.18.3",
41
41
  "@sanity/browserslist-config": "^1.0.5",
42
- "@sanity/vanilla-extract-tsdown-plugin": "^0.4.8",
42
+ "@sanity/vanilla-extract-tsdown-plugin": "^0.5.0",
43
43
  "@typescript/typescript6": "^6.0.2",
44
44
  "@vitejs/plugin-react": "^6.1.2",
45
45
  "browserslist": "^4.29.3",
@@ -52,12 +52,12 @@
52
52
  "devDependencies": {
53
53
  "@babel/core": "^7.29.7",
54
54
  "@rolldown/plugin-babel": "^0.2.4",
55
- "@sanity/pkg-utils": "^13.0.9",
55
+ "@sanity/pkg-utils": "^13.0.11",
56
56
  "@sanity/tsconfig": "^2.2.1",
57
57
  "@tsdown/css": "^0.23.1",
58
58
  "@types/babel__core": "^7.20.5",
59
59
  "babel-plugin-react-compiler": "^1.0.0",
60
- "oxc-transform-react": "^0.153.0",
60
+ "oxc-transform-react": "^0.154.0",
61
61
  "tinyexec": "^1.3.1",
62
62
  "tsdown": "^0.23.1",
63
63
  "typescript": "7.0.2",