Skip to content

feat: default baseDir to cwd#22

Merged
maastrich merged 1 commit intomainfrom
feat/default-basedir-to-cwd
Apr 24, 2026
Merged

feat: default baseDir to cwd#22
maastrich merged 1 commit intomainfrom
feat/default-basedir-to-cwd

Conversation

@maastrich
Copy link
Copy Markdown
Owner

Summary

Globs and relative entry paths in hashup.json now resolve against the current working directory by default, instead of the config file's directory.

Running hashup --cwd ./pkg or cd pkg && hashup both anchor src/**/*.ts at ./pkg/ — which is what most users expect when invoking from a subdirectory.

Behavior matrix

Setting Resolves against Unchanged from before?
baseDir not set (default) cwd No (was configDir)
Top-level baseDir in config configDir Yes
Per-entry entry.baseDir in config configDir Yes
--base-dir CLI flag cwd Yes

To keep the old config-relative behavior, add "baseDir": ".":

{ "baseDir": ".", "entries": { "app": { "entry": "src/**/*.ts" } } }

Test plan

  • New tests/cli/run-modes.test.ts cases:
    • Running with cwd = workDir + -c pkg/hashup.json matches files in workDir/src/, not workDir/pkg/src/
    • baseDir: "." in the config still anchors at configDir, recovering the old default
  • vp test — 123/123 passing
  • vp check clean

Docs

docs/guide/cli.md — rewrote the resolution-rules block to spell out the new default and the four precedence tiers.

🤖 Generated with Claude Code

Globs and relative entry paths in hashup.json now anchor at the
current working directory by default. Explicit baseDir values
(top-level or per-entry) still resolve against configDir, so users
who want the old behavior can set "baseDir": ".".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

📖 Docs preview: https://maastrich.github.io/hashup/branches/pr-22/

@maastrich maastrich merged commit 77e4fd6 into main Apr 24, 2026
3 checks passed
@maastrich maastrich deleted the feat/default-basedir-to-cwd branch April 24, 2026 13:19
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