@woodsportal/hubspot-kit 1.0.26 → 1.0.27

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.27 — 2026-06-07
4
+
5
+ ### Docs
6
+ - Expanded README: full command reference, workflows, project layout, documentation index
7
+ - Aligned `GETTING-STARTED.md` and `HUBSPOT-CLI-SETUP.md` (`defaultPortal` = portal name)
8
+
3
9
  ## 1.0.26 — 2026-06-07
4
10
 
5
11
  ### CLI
package/README.md CHANGED
@@ -1,64 +1,271 @@
1
1
  # WoodsCLI
2
2
 
3
- > HubSpot CMS dev kit by WoodsPortal — modules and themes.
4
- > `npm i @woodsportal/hubspot-kit` · `wp dev`
3
+ **HubSpot CMS dev kit by WoodsPortal**local preview, module field editing, Vite build pipelines, and HubSpot upload/watch for **custom modules** and **themes**.
5
4
 
6
- WoodsCLI (`wp`) is the development CLI for **HubSpot CMS custom modules** (React/JS + `fields.json`) and **themes** (templates, CSS, theme fields). It wraps `@hubspot/cli` for upload/watch and adds local preview, Content/Styles field editing (**Ctrl+Shift+Z**), and hybrid CDN or monolith build pipelines.
5
+ ```bash
6
+ npm i -D @woodsportal/hubspot-kit@^1.0.27
7
+ npx wp --version
8
+ ```
9
+
10
+ The `wp` CLI wraps [`@hubspot/cli`](https://developers.hubspot.com/docs/cms/developer-reference/local-development-cli) for CMS operations and adds WoodsPortal-specific tooling: hybrid CDN or monolith module builds, the **module-config overlay** (**Ctrl+Shift+Z** / **Cmd+Shift+Z**), and a `.wphs/` local workspace.
11
+
12
+ ---
13
+
14
+ ## What you get
15
+
16
+ | Capability | Command / artifact |
17
+ |------------|-------------------|
18
+ | Scaffold module or theme | `wp init` |
19
+ | Local SPA + field editor | `wp dev` (`wp local`) |
20
+ | HubSpot file sync | `wp watch`, `wp upload` |
21
+ | Full ship pipeline | `wp deploy` (build → CDN publish → upload) |
22
+ | Project health check | `wp doctor` |
23
+ | Portal switching | `wp portal use` |
24
+ | CI / regression gates | `wp examples smoke`, `wp regression smoke`, `wp audit *` |
25
+
26
+ **Reference implementation:** [woodsportal-client-frontend](https://github.com/Digital-Woods/digitalwoods.io-woodsportal-client-frontend) — advanced hybrid CDN module with a full app adapter.
27
+
28
+ ---
29
+
30
+ ## Prerequisites
31
+
32
+ | Requirement | Notes |
33
+ |-------------|--------|
34
+ | **Node.js 20+** | Enforced by `wp doctor` |
35
+ | **HubSpot CLI** | `npm i -g @hubspot/cli` — required for upload/watch/deploy |
36
+ | **HubSpot CMS portal** | Design Manager access; PAT or OAuth via `wp auth` |
37
+ | **Project config** | `woodscli.json` at repo root (created by `wp init` or `wp adopt`) |
7
38
 
8
- ## Two tracks
39
+ Local preview (`wp dev`) runs **without** HubSpot credentials. Upload, watch, and deploy need a valid project `hubspot.config.yml`.
9
40
 
10
- | Track | `projectType` | Quick start |
11
- |-------|---------------|-------------|
12
- | **Module (hybrid CDN)** | `module-hybrid-cdn` | `wp init -t module-hybrid-cdn` → `wp dev` → `wp deploy` |
13
- | **Module (monolith)** | `module-monolith` | `wp init -t module-monolith` → `wp dev` → `wp build --hubspot-only` |
14
- | **Theme** | `theme-starter` | `wp init -t theme-starter` → `wp dev` → `wp upload` |
41
+ ---
15
42
 
16
- WoodsPortal client-frontend is the **reference advanced module** (hybrid CDN + full app adapter).
43
+ ## Install
17
44
 
18
- ## Quick start
45
+ **New project** (scaffold includes the kit):
19
46
 
20
47
  ```bash
21
- npx wp init -t module-hybrid-cdn
22
- cd my-project && npm install
23
- wp setup # copy hubspot.config.yml, .env.*, CDN templates
48
+ npx wp init -t module-hybrid-cdn -n my-portal-module
49
+ cd my-portal-module && npm install
50
+ ```
51
+
52
+ **Existing consumer** (add dev dependency):
53
+
54
+ ```bash
55
+ npm i -D @woodsportal/hubspot-kit@^1.0.27
56
+ # or: yarn add -D @woodsportal/hubspot-kit@^1.0.26
57
+ ```
58
+
59
+ Use scripts that call `wp` directly, or rely on `node_modules/.bin/wp` after install.
60
+
61
+ ---
62
+
63
+ ## Project types
64
+
65
+ | Track | `projectType` | Build output | Typical ship flow |
66
+ |-------|---------------|--------------|-------------------|
67
+ | **Module (hybrid CDN)** | `module-hybrid-cdn` | `dist/cdn/*` + `module.outDir` | `wp deploy` |
68
+ | **Module (monolith)** | `module-monolith` | Single bundle in `module.outDir` | `wp build` → `wp upload` |
69
+ | **Theme** | `theme-starter` | Theme folder under `theme.srcDir` | `wp upload` |
70
+
71
+ Init templates live under `templates/` in this package. Hybrid CDN splits vendor/app chunks for jsDelivr; monolith sets `cdn.mode: none` and skips CDN publish on deploy.
72
+
73
+ ---
74
+
75
+ ## Quick start (greenfield)
76
+
77
+ ```bash
78
+ npx wp init -t module-hybrid-cdn -n my-portal-module
79
+ cd my-portal-module && npm install
80
+
81
+ wp setup # hubspot.config.yml, .env.*, CDN files, vite shims (never overwrites)
82
+ wp doctor # Node, config, .wphs/, HubSpot CLI
83
+ wp auth # HubSpot login — updates hubspot.config.yml
84
+ wp portal use # interactive default portal (or: wp portal use <name>)
85
+
86
+ wp dev # http://localhost:3000 — alias: wp local
87
+ ```
88
+
89
+ **Module overlay:** open the dev server, press **Ctrl+Shift+Z** (Windows/Linux) or **Cmd+Shift+Z** (macOS) to edit Content/Styles fields against `fields.json`.
90
+
91
+ ---
92
+
93
+ ## Existing repository
94
+
95
+ ```bash
96
+ wp adopt # detect module/theme layout, add woodscli.json + .wphs/
97
+ wp setup
98
+ wp migrate --yes # if you still have legacy .dev/ or woodsportal.hs.json
24
99
  wp doctor
25
- wp dev # alias: wp local
26
100
  ```
27
101
 
28
- Existing repo:
102
+ Legacy filename `woodsportal.hs.json` is **not** read — migrate to `woodscli.json` with `wp migrate --yes`.
103
+
104
+ ---
105
+
106
+ ## Day-to-day workflows
107
+
108
+ ### Local development
109
+
110
+ ```bash
111
+ wp dev # Vite HMR + module-config overlay
112
+ wp dev -p 3001 # custom port
113
+ ```
114
+
115
+ ### Watch HubSpot folder (CMS sync)
116
+
117
+ ```bash
118
+ wp watch # hs cms watch on module.outDir (builds if output missing)
119
+ wp watch --rebuild # rebuild on src/ + public/ changes, then watch
120
+ ```
121
+
122
+ `wp watch` does not use progress spinners so **Ctrl+C** and HubSpot TTY output stay reliable.
123
+
124
+ ### Build and ship
29
125
 
30
126
  ```bash
31
- wp adopt
32
- wp migrate --yes # if migrating from .dev/
127
+ wp build # default --tier dev
128
+ wp build --cdn-only # hybrid CDN chunks only
129
+ wp build --hubspot-only # module bundle only (monolith-friendly)
130
+
131
+ wp publish --tier dev # push CDN mirror (hybrid only)
132
+ wp upload --tier dev # hs cms upload
133
+ wp deploy --tier dev # build + publish + upload (skips CDN when cdn.mode: none)
33
134
  ```
34
135
 
35
- ## Commands
136
+ Tiers: `dev` | `stg` | `prod`. Production upload requires confirmation (`--yes` or `WP_HS_CONFIRM_PROD=1`). See [docs/BUILD-MODES.md](./docs/BUILD-MODES.md).
137
+
138
+ ---
139
+
140
+ ## HubSpot authentication
141
+
142
+ 1. `wp setup` copies `hubspot.config.yml.example` → `hubspot.config.yml` (gitignored).
143
+ 2. `wp auth` runs `hs auth` (browser / PAT flow).
144
+ 3. `wp portal list` shows configured portals; `wp portal use <name>` sets `defaultPortal`.
145
+
146
+ Run auth and portal commands from the **project root** so HubSpot CLI reads `./hubspot.config.yml`.
147
+
148
+ Full guide: [docs/HUBSPOT-CLI-SETUP.md](./docs/HUBSPOT-CLI-SETUP.md)
149
+
150
+ ---
151
+
152
+ ## Command reference
153
+
154
+ Global flags (all commands): `--project <path>`, `--ci`, `--json`, `--verbose`, `--quiet`, `--dry-run`, `-y/--yes`.
155
+
156
+ ### Project lifecycle
36
157
 
37
158
  | Command | Description |
38
159
  |---------|-------------|
39
- | `wp setup` | Copy missing `hubspot.config.yml`, `.env.*`, CDN config, vite shims |
40
- | `wp dev` | Local Vite server + CMS dev tool |
41
- | `wp build` | CDN + module (or theme no-op); default `--tier dev` |
42
- | `wp deploy` | Build, publish CDN, upload module; default `--tier dev` |
43
- | `wp adopt` | Detect module/theme and add config + `.wphs/` |
44
- | `wp migrate` | `.dev/` `.wphs/` |
45
- | `wp examples smoke` | Run examples matrix (CI) |
46
- | `wp audit secrets` | Scan for hardcoded credentials |
160
+ | `wp init [-t template] [-n name] [--router hash\|browser\|none]` | Scaffold `module-hybrid-cdn`, `module-monolith`, or `theme-starter` |
161
+ | `wp adopt` | Add WoodsCLI config to an existing module/theme repo |
162
+ | `wp migrate` | Move legacy `.dev/` / `woodsportal.hs.json` `.wphs/` + `woodscli.json` |
163
+ | `wp setup [--tier dev\|stg\|prod]` | Copy missing config, env, CDN, and vite shim files |
164
+ | `wp doctor` | Prerequisite checks (interactive progress on TTY) |
165
+ | `wp config validate` | Validate `woodscli.json` (zod) |
47
166
 
48
- See [docs/CLI-REFERENCE.md](./docs/CLI-REFERENCE.md), [docs/MODULES.md](./docs/MODULES.md), [docs/THEMES.md](./docs/THEMES.md), [docs/EXAMPLES.md](./docs/EXAMPLES.md).
167
+ ### HubSpot account
49
168
 
50
- ## Config
169
+ | Command | Description |
170
+ |---------|-------------|
171
+ | `wp auth` | `hs auth` — add or refresh portal credentials |
172
+ | `wp portal list` / `wp portal ls` | List `portals[]` and current `defaultPortal` |
173
+ | `wp portal use [name]` | `hs accounts use` — name or portalId; interactive if name omitted |
51
174
 
52
- **Config:** `woodscli.json` at project root. Legacy `woodsportal.hs.json` → run `wp migrate --yes`.
175
+ ### Develop and sync
53
176
 
54
- Local workspace: **`.wphs/`** only. Consumer hook: **`wphs.adapter.ts`**.
177
+ | Command | Description |
178
+ |---------|-------------|
179
+ | `wp dev` / `wp local` | Local Vite dev server + module-config UI |
180
+ | `wp watch [--rebuild] [--tier dev\|stg\|prod]` | `hs cms watch` on built module/theme output |
181
+ | `wp fields sync [--direction pull\|push]` | Sync `fields.json` with local cache |
55
182
 
56
- HubSpot upload/watch: **`hubspot.config.yml`** — [setup guide](./docs/HUBSPOT-CLI-SETUP.md).
183
+ ### Build and deploy
57
184
 
58
- ## Prerequisites
185
+ | Command | Description |
186
+ |---------|-------------|
187
+ | `wp build [--tier] [--cdn-only] [--hubspot-only] [--cdn-esm]` | CDN + module (or theme no-op) |
188
+ | `wp publish [--tier] [--dry-run]` | Verify CDN endpoint and push jsDelivr mirror |
189
+ | `wp upload [--tier]` | `hs cms upload` using paths from `woodscli.json` |
190
+ | `wp deploy [--tier] [--skip-publish]` | Full pipeline: build → publish → upload |
191
+
192
+ ### Quality and CI
193
+
194
+ | Command | Description |
195
+ |---------|-------------|
196
+ | `wp regression smoke [--skip-doctor]` | Config validate + consumer boundary checks |
197
+ | `wp examples list` | List scenarios from `examples/manifest.json` |
198
+ | `wp examples smoke [--scenario id] [--tier static\|live]` | Examples matrix (used in kit CI) |
199
+ | `wp audit ship-bundle` | Fail if dev-only strings appear in `dist/` |
200
+ | `wp audit parity [--baseline dir]` | Compare `dist/` to baseline snapshot |
201
+ | `wp audit baseline [--baseline dir]` | Capture parity baseline under `.wphs/` |
202
+ | `wp audit secrets` | Scan for hardcoded PATs / credentials |
203
+
204
+ Detailed flags and exit codes: [docs/CLI-REFERENCE.md](./docs/CLI-REFERENCE.md)
205
+
206
+ ---
207
+
208
+ ## Project layout
209
+
210
+ ```
211
+ my-project/
212
+ ├── woodscli.json # WoodsCLI project config (required)
213
+ ├── hubspot.config.yml # HubSpot CLI portals (gitignored; from wp setup)
214
+ ├── wphs.adapter.ts # Consumer adapter hook (modules)
215
+ ├── vite.config.dev.mjs # Re-exports kit dev preset
216
+ ├── vite.config.hubspot.mjs # or vite.config.monolith.mjs
217
+ ├── .wphs/ # Local workspace (module-config, cache, audit)
218
+ ├── src/ # App source
219
+ ├── public/ # fields.json, module.html (modules)
220
+ └── dist/ # Build output (cdn + module.outDir)
221
+ ```
222
+
223
+ | File / dir | Purpose |
224
+ |------------|---------|
225
+ | `woodscli.json` | `projectType`, module/theme paths, CDN mode, env tiers |
226
+ | `.wphs/` | Module-config overlay state, fixtures, audit baseline |
227
+ | `wphs.adapter.ts` | Bridge to your app (routing, API, HubSpot context) |
228
+ | `hubspot.config.yml` | Portal names, PATs, `defaultPortal` |
229
+
230
+ Config field reference: [docs/CONFIG-REFERENCE.md](./docs/CONFIG-REFERENCE.md)
231
+
232
+ ---
233
+
234
+ ## Documentation
235
+
236
+ | Doc | Topic |
237
+ |-----|--------|
238
+ | [GETTING-STARTED.md](./docs/GETTING-STARTED.md) | First-run walkthrough |
239
+ | [CLI-REFERENCE.md](./docs/CLI-REFERENCE.md) | All commands, flags, exit codes |
240
+ | [HUBSPOT-CLI-SETUP.md](./docs/HUBSPOT-CLI-SETUP.md) | PAT, auth, portals |
241
+ | [MODULES.md](./docs/MODULES.md) | Module build paths and overlay |
242
+ | [THEMES.md](./docs/THEMES.md) | Theme starter workflow |
243
+ | [BUILD-MODES.md](./docs/BUILD-MODES.md) | CDN vs monolith, tiers, prod guards |
244
+ | [ADAPTER.md](./docs/ADAPTER.md) | `wphs.adapter.ts` contract |
245
+ | [EXAMPLES.md](./docs/EXAMPLES.md) | Examples smoke matrix |
246
+ | [TROUBLESHOOTING.md](./docs/TROUBLESHOOTING.md) | Common failures |
247
+ | [RUNBOOK.md](./docs/RUNBOOK.md) | Ops and release notes |
248
+ | [CONTRIBUTING.md](./CONTRIBUTING.md) | PR and verify workflow |
249
+
250
+ ---
251
+
252
+ ## Develop the kit
253
+
254
+ ```bash
255
+ git clone https://github.com/Digital-Woods/digitalwoods.io-woodsportal-hubspot-kit.git
256
+ cd digitalwoods.io-woodsportal-hubspot-kit
257
+ npm ci
258
+ npm run verify # typecheck + test + examples smoke + build
259
+ ```
260
+
261
+ Link locally in a consumer:
262
+
263
+ ```bash
264
+ npm i -D @woodsportal/hubspot-kit@file:../digitalwoods.io-woodsportal-hubspot-kit
265
+ ```
59
266
 
60
- Node 20+, `@hubspot/cli`, HubSpot account with CMS.
267
+ ---
61
268
 
62
269
  ## License
63
270
 
64
- MIT — Digital Woods
271
+ MIT — [Digital Woods](https://github.com/Digital-Woods)
package/dist/cli.js CHANGED
@@ -520,7 +520,7 @@ var VITE_DEV_PEER_DEPS = {
520
520
  tailwindcss: "^4.0.6"
521
521
  };
522
522
  var KIT_DEV_DEP = "@woodsportal/hubspot-kit";
523
- var KIT_DEV_DEP_VERSION = "^1.0.26";
523
+ var KIT_DEV_DEP_VERSION = "^1.0.27";
524
524
  var MODULE_CONFIG_UI_DEPS = [
525
525
  "@dnd-kit/core",
526
526
  "@dnd-kit/sortable",