Skip to content

fix(config): describe config paths as relative to the working directory (TSK-110) - #38

Merged
jmlweb merged 2 commits into
mainfrom
hustle/maintainer/task-2026-11-21
Nov 21, 2026
Merged

jmlweb merged 2 commits into
mainfrom
hustle/maintainer/task-2026-11-21

Conversation

@jmlweb

@jmlweb jmlweb commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Fixes RPT-016 / TSK-110. The config JSON Schema (sources, dir) and apps/site/src/content/docs/config.md:56 said config paths are relative to the config file. loadConfig resolves them against the working directory instead (the Vite root for svgworm/vite). That also applies to a --config sub/x.json file.

Decision

Keep cwd as the base and fix the text. Why:

  • ADR-0029 already says the default icons folder is relative to the working directory.
  • llms.txt, the skills and config.md:29 already said "current/project folder".
  • Existing --config users see no behaviour change during the 0.x adoption window.

Because nothing changes in behaviour, no ADR is needed.

What changed

  • packages/svgworm/src/core/config/schema.ts and the regenerated svgworm.schema.json: sources and dir are now described as "relative to the working directory (the Vite root for svgworm/vite), not to the config file".
  • apps/site/src/content/docs/config.md:
    • dir is described as relative to the project folder, not the config file.
    • The paths paragraph has an example: --config sub/svgworm.config.json reads ./icons, not sub/icons.
  • llms.txt and both skills/*/SKILL.md: say the same about a config in another folder.
  • resolve.test.ts: two new tests (config in another folder; schema wording).
  • Changeset .changeset/config-paths-relative-to-cwd.md (svgworm patch).
  • Backlog: TSK-110 moved to complete, and LRN-070 added.

Acceptance criteria

  1. Test in resolve.test.ts loads a config from another folder through configFile and states where sources, outDir and moduleDir resolve. It loads sub/svgworm.config.json. All three paths resolve under cwd, not sub/. The test passes.
  2. Schema descriptions, svgworm.schema.json and config.md say the paths are relative to the working directory. The schema-wording test failed against the old "relative to the config" text and passes after the fix. pnpm schema:generate regenerated the JSON (then oxfmt).
  3. ADR plus a Vite configFile test only if the base changes. Not applicable: the base did not change.
  4. llms.txt and the skills match the behaviour. Both updated. pnpm site:check exits 0.
  5. Changeset records the fix. .changeset/config-paths-relative-to-cwd.md.

Verification (local)

  • pnpm verify: exit 0 (942 tests passed, 6 skipped).
  • pnpm example:vite:check: exit 0.
  • pnpm site:check: exit 0.

🤖 Generated with Claude Code

…ry (TSK-110)

The config JSON Schema and the config docs said sources and dir are
relative to the config file, but svgworm resolves them, and outDir and
moduleDir, against the working directory (the Vite root for the plugin),
also for a --config file in another folder. Keep that behaviour, which
ADR-0029 and llms.txt already state, and fix the descriptions. A test
pins where a config from another folder resolves its paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jmlweb

jmlweb commented Nov 21, 2026

Copy link
Copy Markdown
Owner Author

🤖 hustle review: approve — Docs, schema descriptions and tests now match loadConfig's cwd-based resolution. All five acceptance criteria are met, the changeset is a patch, and there is no runtime change.

…k-2026-11-21

# Conflicts:
#	.backlog/tasks/index.md
@jmlweb

jmlweb commented Nov 21, 2026

Copy link
Copy Markdown
Owner Author

🤖 hustle review: approve — Docs-only fix to match cwd-based resolution; new tests cover config in another folder and the schema wording. Schema, JSON schema, config.md, llms.txt, skills and changeset are consistent with each other and with the acceptance criteria.

@jmlweb
jmlweb merged commit 413df5d into main Nov 21, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant