@haus-tech/haus-workflow 0.20.0 → 0.22.0
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 +21 -0
- package/README.md +9 -6
- package/dist/cli.js +654 -448
- package/library/global/commands/haus-cloneandsetup.md +51 -0
- package/library/global/skills/haus-workflow/SKILL.md +20 -11
- package/package.json +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Clone a project's repos **and** set each one up locally — node version, dependencies, env scaffold. This is `project:clone` followed by a per-repo setup pass.
|
|
2
|
+
|
|
3
|
+
**Always ask before doing work — never assume.** Cloning and setup both run things that take time, hit the network, and need auth; confirm with the user before each phase, and respect repos they already have.
|
|
4
|
+
|
|
5
|
+
## Step 1 — Clone
|
|
6
|
+
|
|
7
|
+
Run the full `project:clone` flow first by following `~/.claude/commands/haus-clone.md` end to end — whichever mode applies:
|
|
8
|
+
|
|
9
|
+
- A **name** was given → it finds and clones that one repo from GitHub.
|
|
10
|
+
- **No name** → it clones the workspace's repos from `repos.manifest.json` (asking clean-clone vs reuse-local first).
|
|
11
|
+
|
|
12
|
+
When that finishes you have a set of repos on disk (freshly cloned and/or reused-local). Carry that list into Step 2.
|
|
13
|
+
|
|
14
|
+
## Step 2 — Confirm the setup pass
|
|
15
|
+
|
|
16
|
+
Before running any setup:
|
|
17
|
+
|
|
18
|
+
1. List the repos you're about to set up and what each will run (node version select, dependency install, etc.). Get a go-ahead. For repos that were **reused** from an existing local clone, ask whether to (re)run setup there too — they may already be set up.
|
|
19
|
+
2. Check `NODE_AUTH_TOKEN` is exported if any repo depends on private `@`-scoped packages (e.g. `@haus-storefront-*`, `@haus-tech/*`). If it's missing, tell the user to set it first — those installs will fail without it. Let them decide whether to continue or stop.
|
|
20
|
+
|
|
21
|
+
## Step 3 — Set up each repo
|
|
22
|
+
|
|
23
|
+
For each repo directory, run its setup **in that directory**, detecting what's needed from the repo's own files — don't assume a stack. Run a repo's steps in a single login shell so the selected node version stays active for the install. A robust pattern:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
bash -lc 'export NVM_DIR="$HOME/.nvm"; [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"; cd "<repo>" && nvm install && corepack enable && yarn install'
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Read the repo's own setup docs first — they win.** Before applying the file-heuristics below, look for the repo's canonical setup instructions: `docs/setup.md`, `CLAUDE.md`, `README.md` (or follow `docs/SUMMARY.md` to the setup page). If present, **follow them as authoritative** — they capture nested or non-standard builds a root file-scan can't see. Use the heuristics below only to fill gaps, or when the repo ships no setup doc. Example: a WordPress/Bedrock repo has **no root `package.json`** — its JS/theme build lives under `web/app/themes/<theme>` and is only described in the docs, so a root-only scan wrongly reports "no JS". When the docs point at a nested build, scan subdirectories for the relevant `package.json` / build script and run it.
|
|
30
|
+
|
|
31
|
+
Adjust per repo (gap-fill, or when no setup doc exists):
|
|
32
|
+
|
|
33
|
+
1. **Node version.** If `.nvmrc` (or `engines.node` in `package.json`) is present, select it with `nvm install` (reads `.nvmrc`, installs the version if missing, then switches to it). If the user uses `fnm` instead, `fnm use --install-if-missing`. If neither is available, tell the user the required version and continue on the current node.
|
|
34
|
+
2. **JS dependencies.** Enable the pinned package manager with `corepack enable`, then install based on what's present:
|
|
35
|
+
- `yarn.lock` or `packageManager: "yarn@…"` → `yarn install`
|
|
36
|
+
- `pnpm-lock.yaml` → `pnpm install`
|
|
37
|
+
- `package-lock.json` → `npm install`
|
|
38
|
+
- no JS manifest → skip
|
|
39
|
+
3. **PHP dependencies.** If `composer.json` is present and `composer` is installed → `composer install`. If composer is missing, note it and skip.
|
|
40
|
+
4. **Env scaffold.** If `.env.example` exists and `.env` does not → copy `.env.example` to `.env` (never overwrite an existing `.env`). Tell the user the real values still need filling.
|
|
41
|
+
|
|
42
|
+
If a repo's setup fails, report the error and **continue to the next repo** — don't abort the whole run.
|
|
43
|
+
|
|
44
|
+
## Step 4 — Report
|
|
45
|
+
|
|
46
|
+
Summarise per repo: node version used, dependency install result, composer (if any), env seeded. Then list what's still manual:
|
|
47
|
+
|
|
48
|
+
- Fill in each `.env` with real values (cross-repo values must match — see the workspace's environment docs).
|
|
49
|
+
- Start Docker services and dev servers in dependency order — see the workspace's local-development docs.
|
|
50
|
+
|
|
51
|
+
**Do not** start servers or run `docker compose up` / `yarn dev` — this command only prepares the repos.
|
|
@@ -21,16 +21,17 @@ The unprefixed verbs (`update`, `catalog`, `install`, `uninstall`) act on **this
|
|
|
21
21
|
haus install** (`~/.claude`, npm) — they manage the haus tool itself, like `npm install -g`.
|
|
22
22
|
The short legacy aliases still work but the names below are canonical.
|
|
23
23
|
|
|
24
|
-
| Task name (legacy aliases) | Command
|
|
25
|
-
| ----------------------------------------------------------------- |
|
|
26
|
-
| `project:init` (`setup`, `init`) | _Setup procedure below_
|
|
27
|
-
| `project:clone [name]` (`clone`) | _Clone procedure below_
|
|
28
|
-
| `project:
|
|
29
|
-
| `project:
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
| `
|
|
24
|
+
| Task name (legacy aliases) | Command | Scope | What it does |
|
|
25
|
+
| ----------------------------------------------------------------- | ------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
26
|
+
| `project:init` (`setup`, `init`) | _Setup procedure below_ | project | First-time setup of an **existing** repo: adds AI skills, commands, workflow + project docs |
|
|
27
|
+
| `project:clone [name]` (`clone`) | _Clone procedure below_ | project | No name: clone a **workspace**'s repos from `repos.manifest.json`. With a `name`: find & clone one repo by name from GitHub |
|
|
28
|
+
| `project:cloneandsetup [name]` (`cloneandsetup`) | _Clone & setup procedure below_ | project | Run `project:clone`, then set up each repo locally (node version, deps, `.env`) |
|
|
29
|
+
| `project:refresh` (`apply`, `refresh`, `claude-md`, `regenerate`) | `haus apply --write` | project | Re-run setup / refresh `.claude/` context + regenerate root `CLAUDE.md` import block |
|
|
30
|
+
| `project:doctor` (`doctor`, `check`) | `haus doctor` | project | Check for install drift |
|
|
31
|
+
| `update` (`upgrade`) | `haus update` | global | Update npm package + catalog + `~/.claude/` (also refreshes this project) |
|
|
32
|
+
| `catalog` | `haus update` | global | Fetch latest catalog (same command as update) |
|
|
33
|
+
| `install` (`global`) | `haus install` | global | Seed `~/.claude/` with haus-owned files |
|
|
34
|
+
| `uninstall` | `haus uninstall` | global | Remove all haus global files from `~/.claude/` |
|
|
34
35
|
|
|
35
36
|
## Step 1 — Determine the task
|
|
36
37
|
|
|
@@ -51,6 +52,8 @@ Options:
|
|
|
51
52
|
(haus update — same command; pulls latest workflow templates and lockfile)
|
|
52
53
|
5. [project] project:clone [name] — clone repos
|
|
53
54
|
(no name: clone a workspace from repos.manifest.json; with a name: find & clone one repo by name from GitHub)
|
|
55
|
+
6. [project] project:cloneandsetup [name] — clone repos, then set them up
|
|
56
|
+
(project:clone, then per-repo node version + dependency install + .env scaffold)
|
|
54
57
|
```
|
|
55
58
|
|
|
56
59
|
Map the user's selection to the command from the alias table, then continue to Step 2.
|
|
@@ -63,6 +66,8 @@ Run the mapped command via Bash. Quote the exact command you are running before
|
|
|
63
66
|
|
|
64
67
|
**Exception — `project:clone` (`clone`):** this asks the user a question before running, so it is a short procedure too. Skip to **Clone (`project:clone`)** under Step 3 and follow it.
|
|
65
68
|
|
|
69
|
+
**Exception — `project:cloneandsetup` (`cloneandsetup`):** clone followed by a per-repo setup pass, with confirmations. Skip to **Clone & setup (`project:cloneandsetup`)** under Step 3 and follow it.
|
|
70
|
+
|
|
66
71
|
## Step 3 — Post-run steps
|
|
67
72
|
|
|
68
73
|
After the command completes, follow the relevant post-run steps below.
|
|
@@ -74,7 +79,11 @@ After the command completes, follow the relevant post-run steps below.
|
|
|
74
79
|
|
|
75
80
|
### Clone (`project:clone`)
|
|
76
81
|
|
|
77
|
-
1. Open and follow `~/.claude/commands/haus-clone.md` — the installed `haus-clone` command. With a `name` argument it finds and clones one matching repo from GitHub; with no argument it clones a workspace's repos from `repos.manifest.json`.
|
|
82
|
+
1. Open and follow `~/.claude/commands/haus-clone.md` — the installed `haus-clone` command. With a `name` argument it finds and clones one matching repo from GitHub; with no argument it clones a workspace's repos from `repos.manifest.json`. This task only clones — to also install dependencies, use `project:cloneandsetup`.
|
|
83
|
+
|
|
84
|
+
### Clone & setup (`project:cloneandsetup`)
|
|
85
|
+
|
|
86
|
+
1. Open and follow `~/.claude/commands/haus-cloneandsetup.md` — it runs the full `project:clone` flow, then sets up each cloned repo locally: selects the node version (`nvm install` from `.nvmrc`), enables corepack, installs JS/PHP dependencies, and seeds `.env`, confirming before each phase. It does not start servers.
|
|
78
87
|
|
|
79
88
|
### After `haus apply --write`
|
|
80
89
|
|