create-dokio 0.1.15 → 0.1.17

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 +92 -64
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,59 +2,78 @@
2
2
 
3
3
  CLI scaffold for Dokio hub repos and templates. Generates correct file structure, `data.yaml`, HTML boilerplate, SCSS partials, and auto-wires changelog tooling.
4
4
 
5
- ## Usage
5
+ ---
6
+
7
+ ## Getting started
8
+
9
+ Run from your **repos workspace folder** — the folder where all your hub repos live (e.g. `~/Projects/dokio/`).
10
+
11
+ No install needed. Just run:
6
12
 
7
13
  ```bash
8
- # Interactive — prompts for everything
9
14
  npx --yes create-dokio@latest
10
-
11
- # Pre-fill the template name
12
- npx --yes create-dokio@latest pool-care
13
15
  ```
14
16
 
15
- > Using pnpm? `pnpm dlx create-dokio`
16
-
17
- Run from your **repos workspace folder** — the folder where all your hub repos live (e.g. `~/Projects/dokio/`).
17
+ The `--yes` flag skips the "Ok to proceed?" prompt. The `@latest` tag ensures you always run the newest version — no separate update step needed.
18
18
 
19
19
  ---
20
20
 
21
- ## Keeping up to date
22
-
23
- `npx` caches packages locally, so `npx create-dokio` may run an old version even after an update is published.
21
+ ## Running the CLI
24
22
 
25
- **Always use `@latest` to get the newest version:**
23
+ ### Interactive (recommended)
26
24
 
27
25
  ```bash
28
26
  npx --yes create-dokio@latest
29
27
  ```
30
28
 
31
- The `--yes` flag skips the "Ok to proceed?" install prompt.
29
+ Prompts you to choose between creating a Template or a Hub.
32
30
 
33
- **Check what version is available on npm:**
31
+ ### Direct commands
34
32
 
35
33
  ```bash
36
- npm show create-dokio version
34
+ # Go straight to template creation
35
+ npx --yes create-dokio@latest template
36
+
37
+ # Go straight to hub creation
38
+ npx --yes create-dokio@latest hub
37
39
  ```
38
40
 
39
- **Check what version you have cached:**
41
+ ### Check version
40
42
 
41
43
  ```bash
42
- npx create-dokio@latest --version
44
+ npx --yes create-dokio@latest --version
43
45
  ```
44
46
 
45
- > If Jake tells you there's an update, run `npx --yes create-dokio@latest` and you're on the new version immediately.
47
+ ### Using pnpm instead of npx
48
+
49
+ ```bash
50
+ pnpm dlx create-dokio
51
+ ```
46
52
 
47
53
  ---
48
54
 
49
55
  ## Commands
50
56
 
51
- ### `create-dokio hub`
57
+ ### `create-dokio template`
52
58
 
53
- Creates a new hub repository locally with full structure ready to push.
59
+ Scaffolds a new template inside an existing hub repo. Automatically clones the hub if not found locally, or pulls latest if it is.
54
60
 
55
- ```bash
56
- npx create-dokio hub
57
- ```
61
+ **Prompts:**
62
+ - Template ID (e.g. `HW485`)
63
+ - Template name (e.g. `My Cool Template`)
64
+ - Template type — PDF, General, Email, or Video
65
+ - Hub selection
66
+
67
+ **What it does:**
68
+ - Clones or pulls the hub repo
69
+ - Scaffolds the template folder inside `<hub-id>-templates/templates/`
70
+ - Auto-repairs any missing hub tooling (changelog script, hooks, `.vscode`, `.gitignore`, `README.md`)
71
+
72
+ ---
73
+
74
+ ### `create-dokio hub`
75
+
76
+ Creates a new hub repository locally with full structure, ready to push to GitHub.
58
77
 
59
78
  **Prompts:**
60
79
  - Hub ID (kebab-case, e.g. `bupa-sam`)
@@ -82,7 +101,8 @@ bupa-sam-templates/
82
101
 
83
102
  ```bash
84
103
  cd bupa-sam-templates
85
- # Create GitHub repo at github.com/dokioco/bupa-sam-templates
104
+
105
+ # Create the GitHub repo at github.com/dokioco/bupa-sam-templates, then:
86
106
  git remote add origin https://github.com/dokioco/bupa-sam-templates
87
107
  git push -u origin main
88
108
 
@@ -93,33 +113,14 @@ cp tools/changelog/.env.example tools/changelog/.env
93
113
 
94
114
  ---
95
115
 
96
- ### `create-dokio template`
97
-
98
- Scaffolds a new template inside an existing hub repo. Clones the hub if not found locally.
99
-
100
- ```bash
101
- npx create-dokio template
102
- # or just:
103
- npx create-dokio
104
- ```
105
-
106
- **Prompts:**
107
- - Template ID (e.g. `HW485`)
108
- - Template name (e.g. `My Cool Template`)
109
- - Template type (PDF / General / Email / Video)
110
- - Hub selection
111
-
112
- If the hub repo exists locally, it pulls latest. If not, it clones it.
113
-
114
- If the hub is missing any tooling (changelog script, hooks, `.vscode`, `.gitignore`, `README.md`), it adds them automatically.
115
-
116
- ---
117
-
118
116
  ## Template types
119
117
 
120
118
  ### PDF
121
119
  PrinceXML-rendered print documents. Supports multi-page, resizable layouts, orderable exports, and proof downloads.
122
120
 
121
+ **Prompts:** page dimensions (mm), page count, PrinceXML version (11 or 15), resizable, proof downloads, orderable export.
122
+
123
+ **Generates:**
123
124
  ```
124
125
  HW485-my-cool-template/
125
126
  ├── CHANGELOG.md
@@ -139,8 +140,6 @@ HW485-my-cool-template/
139
140
  └── _page2.scss
140
141
  ```
141
142
 
142
- **Prompts:** page dimensions (mm), page count, PrinceXML version (11 or 15), resizable, proof downloads, orderable export.
143
-
144
143
  ---
145
144
 
146
145
  ### General (image)
@@ -162,30 +161,17 @@ HTML email scaffold. Includes Outlook conditional comments, `{{{___assembled_css
162
161
 
163
162
  ---
164
163
 
165
- ## Changelog generator
166
-
167
- Each template has its own `CHANGELOG.md`. After every commit that touches a template folder, the `post-commit` hook automatically:
168
-
169
- 1. Detects which templates changed
170
- 2. Logs the commit to each affected template's `CHANGELOG.md` (author, date, branch, title, files with status labels)
171
- 3. Amends the commit silently to include the changelog update
172
-
173
- **Description generation:**
174
- - If `tools/changelog/.env` exists with a valid `ANTHROPIC_API_KEY` → Claude Haiku generates a description
175
- - If no key → falls back to `TODO - INTEGRATE WITH AI (JAKE TASK)`
176
-
177
- ---
178
-
179
164
  ## After scaffolding a template
180
165
 
181
166
  ```bash
167
+ # Navigate to the template folder
182
168
  cd bupa-sam-templates/templates/HW485-my-cool-template
183
169
 
184
- # 1. Check data.yaml — name and subdomain are auto-set
170
+ # 1. Check data.yaml — name and subdomain are auto-set, verify they're correct
185
171
  # 2. Add assets to assets/
186
172
  # 3. Edit partials/
187
173
 
188
- # When ready to commit (from hub root):
174
+ # When ready to commit go back to the hub root first:
189
175
  cd ../../
190
176
  git add templates/HW485-my-cool-template/
191
177
  git commit -m "feat: add My Cool Template"
@@ -194,6 +180,48 @@ git push
194
180
 
195
181
  ---
196
182
 
183
+ ## Changelog generator
184
+
185
+ Each template has its own `CHANGELOG.md`. The `post-commit` hook runs automatically after every commit and:
186
+
187
+ 1. Detects which template folders changed
188
+ 2. Logs the commit to each affected template's `CHANGELOG.md` (author, date, branch, title, files with Added/Modified/Deleted labels)
189
+ 3. Amends the commit silently to include the changelog update
190
+
191
+ **AI descriptions:**
192
+ - With `ANTHROPIC_API_KEY` in `tools/changelog/.env` → Claude Haiku generates a summary
193
+ - Without key → entry is logged without a description
194
+
195
+ ---
196
+
197
+ ## Updating
198
+
199
+ Always use `@latest` when running the CLI — you're always on the newest version automatically. No separate update step.
200
+
201
+ ```bash
202
+ npx --yes create-dokio@latest
203
+ ```
204
+
205
+ **Check what version is on npm:**
206
+
207
+ ```bash
208
+ npm show create-dokio version
209
+ ```
210
+
211
+ ---
212
+
213
+ ## Removing
214
+
215
+ If you ever installed `create-dokio` globally (via `npm install -g`), remove it with:
216
+
217
+ ```bash
218
+ npm uninstall -g create-dokio
219
+ ```
220
+
221
+ npx users have nothing to uninstall — npx doesn't permanently install packages.
222
+
223
+ ---
224
+
197
225
  ## Development
198
226
 
199
227
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-dokio",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "CLI scaffold for Dokio templates",
5
5
  "type": "module",
6
6
  "bin": {