Skip to content

fix: guard add and update outside project root#7

Open
2543679596-sketch wants to merge 1 commit into
StampUI:mainfrom
2543679596-sketch:fix/project-root-guard
Open

fix: guard add and update outside project root#7
2543679596-sketch wants to merge 1 commit into
StampUI:mainfrom
2543679596-sketch:fix/project-root-guard

Conversation

@2543679596-sketch

Copy link
Copy Markdown

Summary

  • Fail fast when stampui add or stampui update is run outside a project root without package.json
  • Add a --force escape hatch for intentional bare-directory use
  • Add a small hasPackageJson helper with tests
  • Document the behavior in README and CHANGELOG

Closes #3

Test Plan

  • npm test
  • npm run typecheck
  • npm run build
  • Manual check in a temp directory:
    • node dist/index.js add token-stream exits with No package.json found...
    • node dist/index.js update exits with No package.json found...
    • node dist/index.js update --force proceeds to the existing lock-file message

@2543679596-sketch 2543679596-sketch force-pushed the fix/project-root-guard branch from c0c0fb8 to 57bcfb9 Compare July 8, 2026 15:45
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.

Clearer error when run outside a project root

1 participant