create-dokio 0.1.14 → 0.1.16

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 +95 -65
  2. package/dist/index.js +7 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,57 +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
6
 
7
- ```bash
8
- # Interactive — prompts for everything
9
- npx create-dokio
7
+ ## Getting started
10
8
 
11
- # Pre-fill the template name
12
- npx create-dokio pool-care
13
- ```
9
+ Run from your **repos workspace folder** — the folder where all your hub repos live (e.g. `~/Projects/dokio/`).
14
10
 
15
- > Using pnpm? `pnpm dlx create-dokio`
11
+ No install needed. Just run:
16
12
 
17
- Run from your **repos workspace folder** — the folder where all your hub repos live (e.g. `~/Projects/dokio/`).
13
+ ```bash
14
+ npx --yes create-dokio@latest
15
+ ```
18
16
 
19
- ---
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.
20
18
 
21
- ## Keeping up to date
19
+ ---
22
20
 
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
- npx create-dokio@latest
26
+ npx --yes create-dokio@latest
29
27
  ```
30
28
 
31
- **Check what version you're running:**
29
+ Prompts you to choose between creating a Template or a Hub.
30
+
31
+ ### Direct commands
32
32
 
33
33
  ```bash
34
- npx create-dokio@latest --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
35
39
  ```
36
40
 
37
- **Check what version is available on npm:**
41
+ ### Check version
38
42
 
39
43
  ```bash
40
- npm show create-dokio version
44
+ npx --yes create-dokio@latest --version
41
45
  ```
42
46
 
43
- > If Jake tells you there's an update, just swap `npx create-dokio` → `npx create-dokio@latest` and you're on the new version immediately. No install step needed.
47
+ ### Using pnpm instead of npx
48
+
49
+ ```bash
50
+ pnpm dlx create-dokio
51
+ ```
44
52
 
45
53
  ---
46
54
 
47
55
  ## Commands
48
56
 
49
- ### `create-dokio hub`
57
+ ### `create-dokio template`
50
58
 
51
- 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.
52
60
 
53
- ```bash
54
- npx create-dokio hub
55
- ```
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.
56
77
 
57
78
  **Prompts:**
58
79
  - Hub ID (kebab-case, e.g. `bupa-sam`)
@@ -80,7 +101,8 @@ bupa-sam-templates/
80
101
 
81
102
  ```bash
82
103
  cd bupa-sam-templates
83
- # Create GitHub repo at github.com/dokioco/bupa-sam-templates
104
+
105
+ # Create the GitHub repo at github.com/dokioco/bupa-sam-templates, then:
84
106
  git remote add origin https://github.com/dokioco/bupa-sam-templates
85
107
  git push -u origin main
86
108
 
@@ -91,33 +113,14 @@ cp tools/changelog/.env.example tools/changelog/.env
91
113
 
92
114
  ---
93
115
 
94
- ### `create-dokio template`
95
-
96
- Scaffolds a new template inside an existing hub repo. Clones the hub if not found locally.
97
-
98
- ```bash
99
- npx create-dokio template
100
- # or just:
101
- npx create-dokio
102
- ```
103
-
104
- **Prompts:**
105
- - Template ID (e.g. `HW485`)
106
- - Template name (e.g. `My Cool Template`)
107
- - Template type (PDF / General / Email / Video)
108
- - Hub selection
109
-
110
- If the hub repo exists locally, it pulls latest. If not, it clones it.
111
-
112
- If the hub is missing any tooling (changelog script, hooks, `.vscode`, `.gitignore`, `README.md`), it adds them automatically.
113
-
114
- ---
115
-
116
116
  ## Template types
117
117
 
118
118
  ### PDF
119
119
  PrinceXML-rendered print documents. Supports multi-page, resizable layouts, orderable exports, and proof downloads.
120
120
 
121
+ **Prompts:** page dimensions (mm), page count, PrinceXML version (11 or 15), resizable, proof downloads, orderable export.
122
+
123
+ **Generates:**
121
124
  ```
122
125
  HW485-my-cool-template/
123
126
  ├── CHANGELOG.md
@@ -137,8 +140,6 @@ HW485-my-cool-template/
137
140
  └── _page2.scss
138
141
  ```
139
142
 
140
- **Prompts:** page dimensions (mm), page count, PrinceXML version (11 or 15), resizable, proof downloads, orderable export.
141
-
142
143
  ---
143
144
 
144
145
  ### General (image)
@@ -160,30 +161,17 @@ HTML email scaffold. Includes Outlook conditional comments, `{{{___assembled_css
160
161
 
161
162
  ---
162
163
 
163
- ## Changelog generator
164
-
165
- Each template has its own `CHANGELOG.md`. After every commit that touches a template folder, the `post-commit` hook automatically:
166
-
167
- 1. Detects which templates changed
168
- 2. Logs the commit to each affected template's `CHANGELOG.md` (author, date, branch, title, files with status labels)
169
- 3. Amends the commit silently to include the changelog update
170
-
171
- **Description generation:**
172
- - If `tools/changelog/.env` exists with a valid `ANTHROPIC_API_KEY` → Claude Haiku generates a description
173
- - If no key → falls back to `TODO - INTEGRATE WITH AI (JAKE TASK)`
174
-
175
- ---
176
-
177
164
  ## After scaffolding a template
178
165
 
179
166
  ```bash
167
+ # Navigate to the template folder
180
168
  cd bupa-sam-templates/templates/HW485-my-cool-template
181
169
 
182
- # 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
183
171
  # 2. Add assets to assets/
184
172
  # 3. Edit partials/
185
173
 
186
- # When ready to commit (from hub root):
174
+ # When ready to commit go back to the hub root first:
187
175
  cd ../../
188
176
  git add templates/HW485-my-cool-template/
189
177
  git commit -m "feat: add My Cool Template"
@@ -192,6 +180,48 @@ git push
192
180
 
193
181
  ---
194
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
+
195
225
  ## Development
196
226
 
197
227
  ```bash
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  // src/index.ts
4
4
  import prompts3 from "prompts";
5
5
  import kleur6 from "kleur";
6
+ import { createRequire } from "module";
6
7
 
7
8
  // src/template.ts
8
9
  import { join as join3 } from "path";
@@ -1306,7 +1307,13 @@ Run \`create-dokio template\` from inside this repo.
1306
1307
  }
1307
1308
 
1308
1309
  // src/index.ts
1310
+ var require2 = createRequire(import.meta.url);
1309
1311
  async function main(argv) {
1312
+ if (argv.includes("--version") || argv.includes("-v")) {
1313
+ const { version } = require2("../package.json");
1314
+ console.log(version);
1315
+ process.exit(0);
1316
+ }
1310
1317
  const subcommand = argv[0];
1311
1318
  if (subcommand === "template") {
1312
1319
  return runTemplate(argv[1]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-dokio",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "CLI scaffold for Dokio templates",
5
5
  "type": "module",
6
6
  "bin": {