create-contractor-site 2.3.0 → 2.3.1

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
@@ -1,146 +1,145 @@
1
- # create-contractor-site
2
-
3
- Scaffold a client contractor website from the [website-multipages](https://github.com/glacayo/website-multipages) Astro template.
4
-
5
- **Package version:** `2.3.0` · **Default template ref:** `v2.3.0` (`CREATE_CONTRACTOR_TEMPLATE_REF`)
6
-
7
- The CLI validates the target, copies the template, replaces placeholder values in `src/data/*.json`, installs with **pnpm**, validates data, builds, and initializes git **only after** success.
8
-
9
- ## What's new in 2.3.0
10
-
11
- - **Page-shell reuse** — shared page header shell extracted across about/contact/remaining pages, reducing duplicated layout markup.
12
- - **Isolated smart-image capsule** — optional image helpers live in a separate pnpm workspace at `tools/smart-image/`, outside the root dependency graph; root lockfile/workspace stay separate.
13
- - **Scaffold/state protections** — `CUSTOMER-IMAGES/` and `.img-ia/` are gitignored and scaffold-denied; capsule `node_modules/` stays ignored; no credential/state bytes reach `dist/`.
14
- - **Agent-owned image fulfillment** — `images:check` / `images:setup` / `images:run` wrappers; the active agent autonomously copies compliant candidates from `<image-root>/_out/` into `src/assets/images/` and updates JSON values + alt text (no human promotion step).
15
- - **pnpm/Corepack compatibility fix** — pnpm pinned for Corepack compatibility so `pnpm install` is deterministic across environments.
16
- - **Template clone default** — published fallback uses git ref **`v2.3.0`** unless you set `CREATE_CONTRACTOR_TEMPLATE_ROOT` or `CREATE_CONTRACTOR_TEMPLATE_REF`.
17
-
18
- Full release notes: repository root [`CHANGELOG.md`](../../CHANGELOG.md).
19
-
20
- ## Requirements
21
-
22
- - **Node.js** 22+
23
- - **pnpm** 11.1.2+
24
- - **git**
25
-
26
- ## Quick start
27
-
28
- ```bash
29
- pnpm create contractor-site my-client-site
30
- ```
31
-
32
- This downloads and runs `create-contractor-site` from npm. It is equivalent to the explicit `pnpm dlx` form below.
33
-
34
- ### Explicit command
35
-
36
- ```bash
37
- pnpm dlx create-contractor-site my-client-site
38
- ```
39
-
40
- ### Local / monorepo development
41
-
42
- From a checkout of this repository:
43
-
44
- ```bash
45
- node ./packages/create-contractor-site/bin/create-contractor-site.mjs ../my-client-site
46
- ```
47
-
48
- By default, the CLI prompts for client details. For a non-interactive smoke run, add `--yes`:
49
-
50
- ```bash
51
- node ./packages/create-contractor-site/bin/create-contractor-site.mjs --yes ../my-client-site
52
- ```
53
-
54
- Or use the published CLI while pointing it at a local template checkout:
55
-
56
- ```bash
57
- CREATE_CONTRACTOR_TEMPLATE_ROOT=/path/to/website-multipages \
58
- pnpm dlx create-contractor-site my-client-site
59
- ```
60
-
61
- ## What the CLI does
62
-
63
- 1. Checks that **pnpm** and **git** are available
64
- 2. Resolves the template source (see env vars below)
65
- 3. Validates the target directory and refuses targets equal to or inside the template root
66
- 4. Copies the template into the target directory (denylist excludes `node_modules`, `dist`, `.astro`, `.git`, `.codegraph`, `docs_trash`, `openspec`, `.atl`, `logs`, `*.log`, `.env*`, `package-lock.json`, and `packages/`)
67
- 5. Replaces **values only** in target `src/data/*.json` (schema/shape preserved)
68
- 6. Runs `pnpm install`
69
- 7. Runs `pnpm run validate:data`
70
- 8. Runs `pnpm run build`
71
- 9. Runs `git init` + initial commit **only after** validate and build succeed
72
-
73
- If install, validate, or build fails, git init is skipped so a broken scaffold is never committed.
74
-
75
- ### After scaffold
76
-
77
- In the generated client repo:
78
-
79
- - Treat `src/data/business.json` and `src/data/site.json` as **authoritative client identity**
80
- - Leftover masonry/hardscape services, blog posts, section copy, and demo assets are **expected seed content** — rewrite them for the real trade; do not treat them as a conflict
81
- - Keep replacing **values/copy/assets only**; preserve JSON shape and `_instructions`
82
- - Keep real client PII out of the shared template base (this repo)
83
-
84
- See the template root `AGENTS.md`, `SKILL.md`, and `README.md` for the full agent/developer workflow. Finish client customization with `pnpm run validate:data` and `pnpm run build`.
85
-
86
- ## Environment variables
87
-
88
- | Variable | Purpose |
89
- |----------|---------|
90
- | `CREATE_CONTRACTOR_SITE_ANSWERS_JSON` | JSON object with client answers for scripted/non-interactive scaffolds |
91
- | `CREATE_CONTRACTOR_TEMPLATE_ROOT` | Path to a local template checkout (preferred for monorepo/dev) |
92
- | `CREATE_CONTRACTOR_TEMPLATE_REPO` | Git URL for the published fallback clone (default: this template repo) |
93
- | `CREATE_CONTRACTOR_TEMPLATE_REF` | Git branch/tag/ref to clone (default: `v2.3.0`) |
94
-
95
- Template source precedence: `CREATE_CONTRACTOR_TEMPLATE_ROOT` → local monorepo discovery → temporary clone of repo @ ref.
96
-
97
- ### Scripted answers example
98
-
99
- Trust, payment, hours, social, directory, and website-type fields may be omitted/blank — `buildAnswers` fills defaults. `--yes` omits them for the same parity (including `site_type: multipage`).
100
-
101
- ```bash
102
- CREATE_CONTRACTOR_SITE_ANSWERS_JSON='{"businessName":"Acme Masonry","phone":"(757) 555-0199","email":"info@example.com","street":"123 Main St","city":"Virginia Beach","state":"VA","zip":"23451","serviceArea":"Virginia Beach, Norfolk, Chesapeake","primaryServices":["Masonry","Patios"]}' \
103
- pnpm dlx create-contractor-site my-client-site
104
- ```
105
-
106
- Compact payment/hours/social/directories + website type:
107
-
108
- ```bash
109
- CREATE_CONTRACTOR_SITE_ANSWERS_JSON='{"businessName":"Acme Masonry","primaryServices":["Masonry"],"paymentMethods":"Cash, Credit Card","hoursWeekday":"8:00 AM - 5:00 PM","hoursSaturday":"Closed","hoursSunday":"Closed","social":"facebook=https://facebook.com/acme,instagram=https://instagram.com/acme","directories":"Google Business|https://g.co/acme,BBB|https://bbb.org/acme","siteType":"one-page"}' \
110
- pnpm dlx create-contractor-site my-client-site
111
- ```
112
-
113
- All answer paths (`CREATE_CONTRACTOR_SITE_ANSWERS_JSON`, `--yes`, interactive) go through `buildAnswers`:
114
-
115
- | Field | JSON key | Blank / omitted |
116
- |-------|----------|-----------------|
117
- | Free-estimate wording | `freeEstimate` | `Free On-Site Estimate` |
118
- | Years of experience | `yearsExperience` | `10+` |
119
- | License | `license` | `Licensed & Insured` |
120
- | Insurance | `insurance` | Fully insured with general liability and workers' compensation. |
121
- | Founded year (optional) | `foundedYear` | `""` — key always written; never removed |
122
- | Payment methods | `paymentMethods` (CSV string or `string[]`) | `Cash`, `Check`, `Credit Card`, `Financing Available` — never `[]` |
123
- | Business hours | `hours` (`[{days,time}]` ×3) or compact `hoursWeekday` / `hoursSaturday` / `hoursSunday` | Mon–Fri `7:00 AM - 6:00 PM`, Sat `8:00 AM - 2:00 PM`, Sun `Closed` |
124
- | Social links | `social` (object or `network=url` CSV) | `{}`; blank keys omitted (`facebook`…`x`) |
125
- | Directories | `directories` (`[{name,url}]` or `Name\|url` CSV) | none → ≥1 placeholder + `enable_directories: false` (never `[]`) |
126
- | Website type | `siteType` (`one-page` \| `multipage` \| `seo`; aliases like `one page` / `single-page` / `multi page` / `multi` accepted) | `multipage` — always written to `site.json.site_type` as a canonical value |
127
-
128
- ## pnpm only
129
-
130
- This project and the scaffolded client sites use **pnpm only**.
131
-
132
- - Do **not** use `npm install` or `npx` for project setup
133
- - Package runners (`pnpm create`, `pnpm dlx`) may start the binary; install/build inside the scaffold always use pnpm
134
-
135
- ## Options
136
-
137
- ```text
138
- create-contractor-site [options] <target-dir>
139
-
140
- -y, --yes Non-interactive mode with built-in sample answers
141
- -h, --help Show help
142
- ```
143
-
144
- ## License
145
-
146
- ISC. See the [repository](https://github.com/glacayo/website-multipages) for full template documentation.
1
+ # create-contractor-site
2
+
3
+ Scaffold a client contractor website from the [website-multipages](https://github.com/glacayo/website-multipages) Astro template.
4
+
5
+ **Package version:** `2.3.1` · **Default template ref:** `v2.3.1` (`CREATE_CONTRACTOR_TEMPLATE_REF`)
6
+
7
+ The CLI validates the target, copies the template, replaces placeholder values in `src/data/*.json`, installs with **pnpm**, validates data, builds, and initializes git **only after** success.
8
+
9
+ ## What's new in 2.3.1
10
+
11
+ - **Supported Astro upgrade** — root `astro` range moved to `^7.3.2` with compatible `@lucide/astro`, `@tailwindcss/vite`, `alpinejs`, `tailwindcss`, `@astrojs/check`, `sharp` (`^0.35.4`), and `zod` refresh; lockfile and CLI smoke tests were updated together.
12
+ - **pnpm CI** — `.github/workflows/ci.yml` runs a frozen-lockfile install, `pnpm run build`, release-guard self-tests, and the capsule-free core CLI smoke on pull requests and `main`.
13
+ - **Trusted publishing infrastructure** — a manual `main`-only `publish.yml` release workflow with release identity/registry guards (`verify-release.mjs`, `test-release-guards.mjs`) and a `docs/releasing.md` runbook; the template root stays `private: true` so only this CLI package can publish.
14
+ - **Capsule-free smoke path** — `SKIP_CAPSULE_TESTS=1` runs the core suite without the optional `tools/smart-image/` capsule, and the smoke suite tolerates an absent capsule directory.
15
+ - **Template clone default** — published fallback uses git ref **`v2.3.1`** unless you set `CREATE_CONTRACTOR_TEMPLATE_ROOT` or `CREATE_CONTRACTOR_TEMPLATE_REF`.
16
+
17
+ Full release notes: repository root [`CHANGELOG.md`](../../CHANGELOG.md).
18
+
19
+ ## Requirements
20
+
21
+ - **Node.js** 22+
22
+ - **pnpm** 11.1.2+
23
+ - **git**
24
+
25
+ ## Quick start
26
+
27
+ ```bash
28
+ pnpm create contractor-site my-client-site
29
+ ```
30
+
31
+ This downloads and runs `create-contractor-site` from npm. It is equivalent to the explicit `pnpm dlx` form below.
32
+
33
+ ### Explicit command
34
+
35
+ ```bash
36
+ pnpm dlx create-contractor-site my-client-site
37
+ ```
38
+
39
+ ### Local / monorepo development
40
+
41
+ From a checkout of this repository:
42
+
43
+ ```bash
44
+ node ./packages/create-contractor-site/bin/create-contractor-site.mjs ../my-client-site
45
+ ```
46
+
47
+ By default, the CLI prompts for client details. For a non-interactive smoke run, add `--yes`:
48
+
49
+ ```bash
50
+ node ./packages/create-contractor-site/bin/create-contractor-site.mjs --yes ../my-client-site
51
+ ```
52
+
53
+ Or use the published CLI while pointing it at a local template checkout:
54
+
55
+ ```bash
56
+ CREATE_CONTRACTOR_TEMPLATE_ROOT=/path/to/website-multipages \
57
+ pnpm dlx create-contractor-site my-client-site
58
+ ```
59
+
60
+ ## What the CLI does
61
+
62
+ 1. Checks that **pnpm** and **git** are available
63
+ 2. Resolves the template source (see env vars below)
64
+ 3. Validates the target directory and refuses targets equal to or inside the template root
65
+ 4. Copies the template into the target directory (denylist excludes `node_modules`, `dist`, `.astro`, `.git`, `.codegraph`, `docs_trash`, `openspec`, `.atl`, `logs`, `*.log`, `.env*`, `package-lock.json`, and `packages/`)
66
+ 5. Replaces **values only** in target `src/data/*.json` (schema/shape preserved)
67
+ 6. Runs `pnpm install`
68
+ 7. Runs `pnpm run validate:data`
69
+ 8. Runs `pnpm run build`
70
+ 9. Runs `git init` + initial commit **only after** validate and build succeed
71
+
72
+ If install, validate, or build fails, git init is skipped so a broken scaffold is never committed.
73
+
74
+ ### After scaffold
75
+
76
+ In the generated client repo:
77
+
78
+ - Treat `src/data/business.json` and `src/data/site.json` as **authoritative client identity**
79
+ - Leftover masonry/hardscape services, blog posts, section copy, and demo assets are **expected seed content** — rewrite them for the real trade; do not treat them as a conflict
80
+ - Keep replacing **values/copy/assets only**; preserve JSON shape and `_instructions`
81
+ - Keep real client PII out of the shared template base (this repo)
82
+
83
+ See the template root `AGENTS.md`, `SKILL.md`, and `README.md` for the full agent/developer workflow. Finish client customization with `pnpm run validate:data` and `pnpm run build`.
84
+
85
+ ## Environment variables
86
+
87
+ | Variable | Purpose |
88
+ |----------|---------|
89
+ | `CREATE_CONTRACTOR_SITE_ANSWERS_JSON` | JSON object with client answers for scripted/non-interactive scaffolds |
90
+ | `CREATE_CONTRACTOR_TEMPLATE_ROOT` | Path to a local template checkout (preferred for monorepo/dev) |
91
+ | `CREATE_CONTRACTOR_TEMPLATE_REPO` | Git URL for the published fallback clone (default: this template repo) |
92
+ | `CREATE_CONTRACTOR_TEMPLATE_REF` | Git branch/tag/ref to clone (default: `v2.3.1`) |
93
+
94
+ Template source precedence: `CREATE_CONTRACTOR_TEMPLATE_ROOT` → local monorepo discovery → temporary clone of repo @ ref.
95
+
96
+ ### Scripted answers example
97
+
98
+ Trust, payment, hours, social, directory, and website-type fields may be omitted/blank — `buildAnswers` fills defaults. `--yes` omits them for the same parity (including `site_type: multipage`).
99
+
100
+ ```bash
101
+ CREATE_CONTRACTOR_SITE_ANSWERS_JSON='{"businessName":"Acme Masonry","phone":"(757) 555-0199","email":"info@example.com","street":"123 Main St","city":"Virginia Beach","state":"VA","zip":"23451","serviceArea":"Virginia Beach, Norfolk, Chesapeake","primaryServices":["Masonry","Patios"]}' \
102
+ pnpm dlx create-contractor-site my-client-site
103
+ ```
104
+
105
+ Compact payment/hours/social/directories + website type:
106
+
107
+ ```bash
108
+ CREATE_CONTRACTOR_SITE_ANSWERS_JSON='{"businessName":"Acme Masonry","primaryServices":["Masonry"],"paymentMethods":"Cash, Credit Card","hoursWeekday":"8:00 AM - 5:00 PM","hoursSaturday":"Closed","hoursSunday":"Closed","social":"facebook=https://facebook.com/acme,instagram=https://instagram.com/acme","directories":"Google Business|https://g.co/acme,BBB|https://bbb.org/acme","siteType":"one-page"}' \
109
+ pnpm dlx create-contractor-site my-client-site
110
+ ```
111
+
112
+ All answer paths (`CREATE_CONTRACTOR_SITE_ANSWERS_JSON`, `--yes`, interactive) go through `buildAnswers`:
113
+
114
+ | Field | JSON key | Blank / omitted |
115
+ |-------|----------|-----------------|
116
+ | Free-estimate wording | `freeEstimate` | `Free On-Site Estimate` |
117
+ | Years of experience | `yearsExperience` | `10+` |
118
+ | License | `license` | `Licensed & Insured` |
119
+ | Insurance | `insurance` | Fully insured with general liability and workers' compensation. |
120
+ | Founded year (optional) | `foundedYear` | `""` — key always written; never removed |
121
+ | Payment methods | `paymentMethods` (CSV string or `string[]`) | `Cash`, `Check`, `Credit Card`, `Financing Available` — never `[]` |
122
+ | Business hours | `hours` (`[{days,time}]` ×3) or compact `hoursWeekday` / `hoursSaturday` / `hoursSunday` | Mon–Fri `7:00 AM - 6:00 PM`, Sat `8:00 AM - 2:00 PM`, Sun `Closed` |
123
+ | Social links | `social` (object or `network=url` CSV) | `{}`; blank keys omitted (`facebook`…`x`) |
124
+ | Directories | `directories` (`[{name,url}]` or `Name\|url` CSV) | none → ≥1 placeholder + `enable_directories: false` (never `[]`) |
125
+ | Website type | `siteType` (`one-page` \| `multipage` \| `seo`; aliases like `one page` / `single-page` / `multi page` / `multi` accepted) | `multipage` — always written to `site.json.site_type` as a canonical value |
126
+
127
+ ## pnpm only
128
+
129
+ This project and the scaffolded client sites use **pnpm only**.
130
+
131
+ - Do **not** use `npm install` or `npx` for project setup
132
+ - Package runners (`pnpm create`, `pnpm dlx`) may start the binary; install/build inside the scaffold always use pnpm
133
+
134
+ ## Options
135
+
136
+ ```text
137
+ create-contractor-site [options] <target-dir>
138
+
139
+ -y, --yes Non-interactive mode with built-in sample answers
140
+ -h, --help Show help
141
+ ```
142
+
143
+ ## License
144
+
145
+ ISC. See the [repository](https://github.com/glacayo/website-multipages) for full template documentation.