@behivetech/styles 0.0.0-stage → 1.0.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 (3) hide show
  1. package/README.md +22 -2
  2. package/dist/index.css +3459 -0
  3. package/package.json +75 -3
package/README.md CHANGED
@@ -1,3 +1,23 @@
1
- # Temporary Holding Version
1
+ # @behivetech/styles
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ One stylesheet with the CSS of every styled `@behivetech` registry component, so an app imports a single file instead of one `styles.css` per package.
4
+
5
+ ## Use it
6
+
7
+ ```ts
8
+ import "@behivetech/styles/index.css";
9
+ ```
10
+
11
+ Import it once, in the app's root layout, next to the design tokens (`@behivetech/cms.base-styles`). The packages' own `styles.css` entries keep working, so an app that lists them one by one does not have to change.
12
+
13
+ ## How it is built
14
+
15
+ `pnpm build` runs `src/build.ts` after every dependency has built. It reads the stylesheet each styled registry package lists in `dependencies` and joins them in category order (icons, atoms, forms, molecules, organisms, templates, then by name), each under a comment naming its package. The build fails if the result does not parse or if a declared styled package has no built stylesheet. The styled packages are `devDependencies`, so installing this package pulls only the CSS, not the components. Changesets therefore does not release it for them; `pnpm test:scripts` does the checking instead (see the rule below). One writer produces the file, so the cjs/esm CSS race that a package's own build guards against cannot reach the bundle.
16
+
17
+ ## Adding a styled package
18
+
19
+ A new registry package that exports `./styles.css` must be added to this package's `devDependencies` (`"@behivetech/<category>.<name>": "workspace:*"`). `pnpm test:scripts` fails naming any styled package that is missing.
20
+
21
+ ## Releasing
22
+
23
+ A release that includes a styled component, directly or as a dependent, also releases `@behivetech/styles` (add `"@behivetech/styles": patch` to it), so the published CSS never lags the components. `pnpm test:scripts` fails, naming the packages, when the release plan of the pending changesets (dependents included) releases a styled package and not this one.