Skip to content

Commit 69d9104

Browse files
committed
docs(installer): CHANGELOG + JSDoc + CLAUDE.md catch-up for installer-UX series
1 parent 797c45a commit 69d9104

4 files changed

Lines changed: 24 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@ release. Nothing has been published to npm yet — everything lives under
88

99
## [Unreleased]
1010

11+
### Changed (2026-05-08)
12+
13+
- **Default `--pm` flipped from `yarn``pnpm`.** The interactive package-manager select also reorders `pnpm` to first position; existing `--pm yarn` invocations and existing configs pinning `"packageManager": "yarn"` continue to work — only the default for new installs changes.
14+
15+
### Fixed (2026-05-08)
16+
17+
- **`--preset <directory>` no longer crashes with `EISDIR`.** `loadPreset` (`src/preset.ts`) now accepts both a path to a `preset.json` file AND a path to a directory containing one; `dir` correctly anchors at the preset folder, so downstream relative paths (`filesDir`, `seedFile`, `installerConfig`, `deployerExtras`) resolve as intended. Four new tests in `src/__tests__/preset.test.ts` lock the file/directory/missing-preset.json/seed-anchor behaviours.
18+
- **`--config <directory>` no longer crashes with `EISDIR`.** Same pattern applied to `loadConfigFile` (extracted to `src/utils/load-config.ts` so it can be tested in isolation; importing from `src/index.ts` would have triggered `program.parse()`) and `resolveTargetDir`. Three new tests in `src/utils/__tests__/load-config.test.ts`.
19+
20+
### Added (2026-05-08)
21+
22+
- **Per-option `hint` text in interactive prompts.** Package-manager, preset, and layout selects now show one-line hints next to each option (`@clack/prompts`'s `hint` field). Preset hints come from each `preset.json#description`; built-in preset descriptions were shortened to fit (the prior long-form text wasn't displayed anywhere).
23+
- **`PresetSummary` type exported from `src/preset.ts`.** `discoverPresets()` returns `Promise<PresetSummary[]>` (was `Promise<string[]>`) so each entry can carry an optional description for hint UX. Single consumer (`src/prompts.ts`) updated atomically.
24+
- **Clearer `--help` strings for `--pm`, `--preset`, `--config`, `--layout`** (`src/index.ts`). Each flag's purpose is now legible standalone — readers don't need the README to disambiguate `--config` from `--preset`.
25+
- **README explainer paragraph** above the Options table distinguishing `--preset` ("starting point — pre-fills some answers") from `--config` ("pins every answer; for CI"). Flag-table description cells rewritten to match.
26+
1127
### Added (2026-05-01)
1228

1329
- **Pipeline task: `Clear Redaxo cache`** (`src/tasks/clear-cache.ts`). Runs `php <console> cache:clear --no-interaction` between *Create remote git repository* (step 14) and *Open frontend and backend in browser* (step 16) so the just-opened browser doesn't show stale templates / modules / asset paths left behind by `setup:run`, addon install, `viterex:install-stubs`, or submodule activation. No skip predicate — `cache:clear` is idempotent and cheap; runs in both fresh and augment mode. Pipeline grew from 16 → 17 steps.

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Published usage: `npx create-viterex [project-name] [--flags]`
5858
- `--skip-db` — skip database creation
5959
- `--skip-addons` — skip addon installation
6060
- `--skip-git` — don't init git repo
61-
- `--pm <yarn|npm|pnpm>` — package manager (default: yarn)
61+
- `--pm <yarn|npm|pnpm>` — package manager (default: pnpm)
6262
- `--config <path>` — load config from JSON file, skip all prompts
6363

6464
## Templates

src/preset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export async function discoverPresets(): Promise<PresetSummary[]> {
4545
/**
4646
* Load a preset by ID.
4747
* - "custom" returns null (user configures everything manually)
48-
* - If presetId contains "/" or ends with ".json", treat as external file path
48+
* - If presetId contains "/" or ends with ".json", treat as external path (file or directory containing preset.json)
4949
* - Otherwise look up in built-in presets/ directory
5050
*
5151
* Filters out legacy `viterex` submodule entries with a warning — viterex is

src/utils/load-config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ import path from "node:path";
22
import fs from "fs-extra";
33
import type { Layout, ViterexConfig } from "../types.js";
44

5+
/**
6+
* Load a viterex config JSON, accepting either a file path or a directory
7+
* containing `viterex.json`. Backfills defaults for fields added in newer
8+
* installer versions (`templateReplacements`, `preset`, `layout`,
9+
* `installMode`, `redaxoLang`, `redaxoTimezone`, `addons`).
10+
*/
511
export async function loadConfigFile(
612
configPath: string,
713
defaultLayout: Layout,

0 commit comments

Comments
 (0)