@forthtilliath/forth-ui 0.4.1 → 0.5.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.
package/README.md CHANGED
@@ -300,29 +300,28 @@ base file overrides the default colors via normal CSS cascade:
300
300
  ```css
301
301
  @import "@forthtilliath/shadcn-ui/styles/globals-static.css";
302
302
  @import "@forthtilliath/shadcn-ui/styles/themes/rose.css";
303
-
304
- @source "../node_modules/@forthtilliath/*/dist/**/*.js";
303
+ @import "@forthtilliath/forth-ui/styles/sources.css";
305
304
  ```
306
305
 
307
306
  Don't add your own `@import "tailwindcss";` — `globals-static.css` already
308
307
  does that internally.
309
308
 
310
- **What that `@source` line does, and why it's needed:** Tailwind only
311
- generates CSS for class names it can actually find, as literal text, in
312
- the files it scans — by default your own project source, honoring
313
- `.gitignore` (which is why `node_modules` is skipped: scanning every
314
- dependency would be slow and mostly pointless). But forth-ui and shadcn-ui
315
- ship pre-built, and their component code — the literal `"bg-primary"`,
316
- `"rounded-md"`, etc. strings — only exists inside their already-compiled
317
- `node_modules/@forthtilliath/*/dist/**/*.js` files. Without pointing
318
- Tailwind at them explicitly, none of those classes would be generated and
319
- every forth-ui/shadcn-ui component would render completely unstyled. This
320
- one line, with a wildcard for the package name, covers both packages (and
321
- any other `@forthtilliath/*` package added later) — confirmed to produce
322
- the exact same generated CSS as listing each package's path separately.
323
- This isn't a workaround specific to forth-ui: it's the
324
- [documented, standard way](https://tailwindcss.com/docs/detecting-classes-in-source-files#explicitly-registering-sources)
325
- Tailwind v4 expects any npm-distributed component library to be consumed.
309
+ **What `sources.css` does, and why it's needed:** Tailwind only generates
310
+ CSS for class names it can actually find, as literal text, in the files it
311
+ scans — by default your own project source, honoring `.gitignore` (which is
312
+ why `node_modules` is skipped). But forth-ui and shadcn-ui ship pre-built:
313
+ their component code — the literal `"bg-primary"`, `"rounded-md"`, etc.
314
+ strings — only exists in their compiled `dist/` files. Without registering
315
+ them explicitly, none of those classes would be generated and the
316
+ components would render unstyled. `sources.css` does that with
317
+ [`@source`](https://tailwindcss.com/docs/detecting-classes-in-source-files#explicitly-registering-sources)
318
+ for forth-ui's components and, through shadcn-ui's own `sources.css`, for
319
+ the shadcn-ui ones they're built on.
320
+
321
+ Its paths are relative to the package itself, so it works whatever the
322
+ `node_modules` layout. Don't write the `@source` yourself with a glob such as
323
+ `../node_modules/@forthtilliath/*/dist/**/*.js`: under pnpm (packages are
324
+ symlinks — junctions on Windows) that pattern silently matches nothing.
326
325
 
327
326
  ### Available themes
328
327
 
@@ -0,0 +1,8 @@
1
+ /* Registers forth-ui's components, and the shadcn-ui ones they're built on,
2
+ with the consumer's Tailwind build: import this file from your CSS entry
3
+ point. The path is relative to this file, so it holds both in src/ (this
4
+ monorepo) and in the published dist/styles/, whatever the node_modules
5
+ layout (npm, or pnpm symlinks). Copied to dist/ by `build:css`. */
6
+ @import "@forthtilliath/shadcn-ui/styles/sources.css";
7
+
8
+ @source "../components";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forthtilliath/forth-ui",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -28,8 +28,8 @@
28
28
  "lucide-react": "^1.31.0",
29
29
  "qrcode": "^1.5.4",
30
30
  "shiki": "^4.4.3",
31
+ "@forthtilliath/shadcn-ui": "^0.4.0",
31
32
  "@forthtilliath/react-kit": "^0.6.0",
32
- "@forthtilliath/shadcn-ui": "^0.3.0",
33
33
  "@forthtilliath/ts-types": "^0.3.0"
34
34
  },
35
35
  "peerDependencies": {
@@ -68,7 +68,8 @@
68
68
  "exports": {
69
69
  "./components/*": "./dist/components/*/index.js",
70
70
  "./locale": "./dist/locale/index.js",
71
- "./styles/globals.css": "./dist/globals.css"
71
+ "./styles/globals.css": "./dist/globals.css",
72
+ "./styles/sources.css": "./dist/styles/sources.css"
72
73
  },
73
74
  "size-limit": [
74
75
  {
@@ -89,9 +90,10 @@
89
90
  "dev": "concurrently \"pnpm:dev:ts\" \"pnpm:dev:tw\"",
90
91
  "dev:ts": "tsc --watch",
91
92
  "dev:tw": "pnpm run build:tw --watch",
92
- "build": "pnpm run clean && pnpm run build:ts && pnpm run build:tw",
93
+ "build": "pnpm run clean && pnpm run build:ts && pnpm run build:tw && pnpm run build:css",
93
94
  "build:ts": "tsc",
94
95
  "build:tw": "tailwindcss -i ./src/styles/globals.css -o ./dist/globals.css",
96
+ "build:css": "node -e \"require('node:fs').cpSync('src/styles/sources.css', 'dist/styles/sources.css')\"",
95
97
  "size": "size-limit"
96
98
  }
97
99
  }