@troychaplin/component2block 0.1.2 → 0.1.3

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 +29 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -40,14 +40,39 @@ Your components always reference `--prefix--*` CSS variables. In Storybook, thos
40
40
 
41
41
  ## Getting Started
42
42
 
43
- Scaffold a config file, then generate:
43
+ ### 1. Install
44
44
 
45
45
  ```bash
46
- npx c2b init # creates c2b.config.json from the example template
47
- npx c2b generate # reads config and generates all output files
46
+ npm install @troychaplin/component2block --save-dev
48
47
  ```
49
48
 
50
- Edit `c2b.config.json` to match your project before generating.
49
+ ### 2. Create the config
50
+
51
+ ```bash
52
+ npx c2b init
53
+ ```
54
+
55
+ This creates `c2b.config.json` with sensible defaults. Edit it to match your project — at minimum, set the `prefix` to your library's namespace.
56
+
57
+ ### 3. Generate
58
+
59
+ ```bash
60
+ npx c2b generate
61
+ ```
62
+
63
+ ### 4. Add to your build
64
+
65
+ Add a script so tokens regenerate as part of your dev and build pipeline:
66
+
67
+ ```json
68
+ {
69
+ "scripts": {
70
+ "c2b": "c2b generate",
71
+ "dev": "npm run c2b && storybook dev -p 6006",
72
+ "build": "npm run c2b && npm run build:lib && npm run build:css"
73
+ }
74
+ }
75
+ ```
51
76
 
52
77
  ## Quick Example
53
78
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@troychaplin/component2block",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Generate WordPress theme.json and CSS token files from a single config for component libraries",
5
5
  "type": "module",
6
6
  "bin": {