@codefast/ui 0.3.11-canary.2 → 0.3.11

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 (3) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +34 -14
  3. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @codefast/ui
2
2
 
3
+ ## 0.3.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [`dd5130a`](https://github.com/codefastlabs/codefast/commit/dd5130adb5649dca6773614ffda262cdde732d8f) Thanks [@thevuong](https://github.com/thevuong)! - chore(deps): downgrade @rslib/core to 0.19.1 in package.json and pnpm-lock.yaml
8
+
9
+ - [`bec9cfa`](https://github.com/codefastlabs/codefast/commit/bec9cfab879d59c877db130eb2c2522b1453bc8f) Thanks [@thevuong](https://github.com/thevuong)! - refactor(theme): reorganize imports for improved readability
10
+
11
+ - [`135c6be`](https://github.com/codefastlabs/codefast/commit/135c6bed9d1bc1e96bad3173adab1bf32d74322f) Thanks [@thevuong](https://github.com/thevuong)! - chore: update linting and formatting scripts in package.json
12
+
13
+ - [`610cf7a`](https://github.com/codefastlabs/codefast/commit/610cf7a7f9b6e5b37be21e7675ea363ef1020639) Thanks [@thevuong](https://github.com/thevuong)! - fix(hooks): handle missing `navigator.clipboard.writeText` gracefully
14
+
15
+ - [`42758ab`](https://github.com/codefastlabs/codefast/commit/42758ab9d8f548ea9f4a806a7dbb7ed295fe2390) Thanks [@thevuong](https://github.com/thevuong)! - chore: update package configurations and TypeScript settings
16
+
17
+ - [`b1d23c2`](https://github.com/codefastlabs/codefast/commit/b1d23c27dffff6686193e3cbb3f848970e253493) Thanks [@thevuong](https://github.com/thevuong)! - refactor(chart): update ChartTooltip types for improved compatibility
18
+
19
+ - [`d2abc63`](https://github.com/codefastlabs/codefast/commit/d2abc636245526ec402811d8585d93684865dde6) Thanks [@thevuong](https://github.com/thevuong)! - chore(deps): update package versions and configurations
20
+
21
+ - [`3e90474`](https://github.com/codefastlabs/codefast/commit/3e90474fbbb9f8ac626c5949bfdbac2eaf1cb3e8) Thanks [@thevuong](https://github.com/thevuong)! - chore: update project configuration and dependencies
22
+
23
+ - [`92d1ed7`](https://github.com/codefastlabs/codefast/commit/92d1ed7650b19f91824cfb38ec238857a3d95876) Thanks [@thevuong](https://github.com/thevuong)! - build: replace rslib with tsdown in library packages
24
+
25
+ - [`5c09d4c`](https://github.com/codefastlabs/codefast/commit/5c09d4ce2df564dc7ac6727b00cfa668164a1af4) Thanks [@thevuong](https://github.com/thevuong)! - refactor(config): rename `check-types` to `typecheck` and update usage
26
+
27
+ - Updated dependencies [[`dd5130a`](https://github.com/codefastlabs/codefast/commit/dd5130adb5649dca6773614ffda262cdde732d8f), [`135c6be`](https://github.com/codefastlabs/codefast/commit/135c6bed9d1bc1e96bad3173adab1bf32d74322f), [`610cf7a`](https://github.com/codefastlabs/codefast/commit/610cf7a7f9b6e5b37be21e7675ea363ef1020639), [`42758ab`](https://github.com/codefastlabs/codefast/commit/42758ab9d8f548ea9f4a806a7dbb7ed295fe2390), [`d2abc63`](https://github.com/codefastlabs/codefast/commit/d2abc636245526ec402811d8585d93684865dde6), [`49df885`](https://github.com/codefastlabs/codefast/commit/49df8854d51bad598381be68b6e41096e7da814c), [`3e90474`](https://github.com/codefastlabs/codefast/commit/3e90474fbbb9f8ac626c5949bfdbac2eaf1cb3e8), [`92d1ed7`](https://github.com/codefastlabs/codefast/commit/92d1ed7650b19f91824cfb38ec238857a3d95876), [`5c09d4c`](https://github.com/codefastlabs/codefast/commit/5c09d4ce2df564dc7ac6727b00cfa668164a1af4)]:
28
+ - @codefast/tailwind-variants@0.3.11
29
+
3
30
  ## 0.3.11-canary.2
4
31
 
5
32
  ### Patch Changes
package/README.md CHANGED
@@ -162,34 +162,54 @@ import "@codefast/ui/css/style.css";
162
162
 
163
163
  #### SSR with Nitro (TanStack Start)
164
164
 
165
- When deploying with [Nitro](https://v3.nitro.build/) (Vercel, self-host Node.js, etc.), add this to your `vite.config.ts` to avoid a Rolldown CJS→ESM interop error with `tslib` (used by Radix UI):
165
+ Use this when you ship with **[Nitro](https://v3.nitro.build/)** (e.g. Vercel, Node) and **Vite 8** (Rolldown) via **TanStack Start**.
166
+
167
+ **If you see** a server `TypeError` about `__extends` and `__toESM(...).default` (sometimes minified as `__toESM$1`), often during SSR or route loaders, configure `vite.config.ts` as below.
168
+
169
+ ##### Recommended: `nitro.exportConditions`
170
+
171
+ Prefer ESM entry points from dependencies (`import` / `module` in `package.json` `exports`). That avoids pulling CommonJS builds that `require("tslib")`, which can trip Rolldown’s CJS→ESM interop. Nitro still merges in `production` / `development`, `node`, and related conditions.
166
172
 
167
173
  ```ts
168
174
  // vite.config.ts
169
175
  import { defineConfig } from "vite";
170
176
 
177
+ export default defineConfig({
178
+ nitro: {
179
+ exportConditions: ["import", "module", "default"],
180
+ },
181
+ // plugins: [ tanstackStart(), nitro(), … ]
182
+ });
183
+ ```
184
+
185
+ ##### Fallback: `resolve.alias`
186
+
187
+ If the error persists, point `tslib` at its ESM file:
188
+
189
+ ```ts
171
190
  export default defineConfig({
172
191
  resolve: {
173
- alias: {
174
- // Workaround: Rolldown mishandles tslib CJS; force ESM to avoid SSR 500.
175
- tslib: "tslib/tslib.es6.mjs",
176
- },
192
+ alias: { tslib: "tslib/tslib.es6.mjs" },
177
193
  },
178
- // ... other config
179
194
  });
180
195
  ```
181
196
 
182
- **Symptom without this:** `TypeError: Cannot destructure property '__extends' of '__toESM(...).default' as it is undefined` when serving SSR pages.
197
+ ##### Why it happens (short)
198
+
199
+ - **Bundler:** Rolldown may wrap `tslib`’s CJS build and read helpers from `.default` in a way that breaks when the module is marked `__esModule`.
200
+ - **Dependencies:** Overlay-related packages (Dialog, Sheet, Menu, …) often pull in utilities such as [`react-remove-scroll-bar`](https://www.npmjs.com/package/react-remove-scroll-bar). Their legacy CJS output can use `require("tslib")` even when your app source is ESM.
201
+
202
+ > **Note:** Don’t use `nitro.alias` for the bare specifier `tslib`. In Nitro v3 that option is for unenv-style path overrides, not npm package names, and can produce broken paths.
183
203
 
184
204
  ### Troubleshooting
185
205
 
186
- | Issue | Solution |
187
- | -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
188
- | Components look unstyled | Ensure CSS imports run before any component renders (entry point first). |
189
- | Duplicate Tailwind CSS | Use Option 1 (theme + preset only), **not** `style.css`. |
190
- | Dark mode not working | Add `class="dark"` to `<html>` when dark mode is active. |
191
- | Build: CSS not found | Verify path: `@codefast/ui/css/[theme].css` (e.g. `slate.css`). |
192
- | SSR 500: `Cannot destructure property '__extends'` | Add `resolve.alias: { tslib: 'tslib/tslib.es6.mjs' }` in `vite.config.ts` (see [SSR with Nitro](#ssr-with-nitro-tanstack-start)). |
206
+ | Issue | Solution |
207
+ | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
208
+ | Components look unstyled | Ensure CSS imports run before any component renders (entry point first). |
209
+ | Duplicate Tailwind CSS | Use Option 1 (theme + preset only), **not** `style.css`. |
210
+ | Dark mode not working | Add `class="dark"` to `<html>` when dark mode is active. |
211
+ | Build: CSS not found | Verify path: `@codefast/ui/css/[theme].css` (e.g. `slate.css`). |
212
+ | SSR / loaders: `Cannot destructure property '__extends'` | Set `nitro.exportConditions: ['import', 'module', 'default']`, or add `resolve.alias` for `tslib` (see [SSR with Nitro](#ssr-with-nitro-tanstack-start)). |
193
213
 
194
214
  ### Customizing Theme
195
215
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codefast/ui",
3
- "version": "0.3.11-canary.2",
3
+ "version": "0.3.11",
4
4
  "description": "Core UI components library built with React and Tailwind CSS",
5
5
  "keywords": [
6
6
  "components",
@@ -382,7 +382,7 @@
382
382
  "sonner": "^2.0.7",
383
383
  "tw-animate-css": "^1.4.0",
384
384
  "vaul": "^1.1.2",
385
- "@codefast/tailwind-variants": "0.3.11-canary.2"
385
+ "@codefast/tailwind-variants": "0.3.11"
386
386
  },
387
387
  "devDependencies": {
388
388
  "@swc/core": "^1.15.21",
@@ -401,9 +401,9 @@
401
401
  "postcss": "^8.5.8",
402
402
  "tailwindcss": "^4.2.2",
403
403
  "ts-node": "^10.9.2",
404
- "tsdown": "^0.21.6",
404
+ "tsdown": "^0.21.7",
405
405
  "typescript": "^6.0.2",
406
- "@codefast/typescript-config": "0.3.11-canary.2"
406
+ "@codefast/typescript-config": "0.3.11"
407
407
  },
408
408
  "peerDependencies": {
409
409
  "@types/react": "^19.0",