Skip to content

fix: multi-file install, refs/heads URLs, integration test - #22

Merged
dsiddharth2 merged 2 commits into
mainfrom
fix/multi-file-tracking
Apr 18, 2026
Merged

dsiddharth2 merged 2 commits into
mainfrom
fix/multi-file-tracking

Conversation

@dsiddharth2

Copy link
Copy Markdown
Owner

Summary

  • Fix prefix-stripping bug where community packages with absolute file paths in files array caused path doubling in download URLs and local destinations
  • Add toRefBranch() helper to normalize branch names to refs/heads/ format in all raw.githubusercontent.com URLs (fetcher, registry, community index URL)
  • Add community-install integration test that downloads real packages and validates file placement

Changes

  • plug/src/constants.js — toRefBranch() helper, COMMUNITY_INDEX_URL updated to refs/heads/main
  • plug/src/utils/fetcher.js — URL construction uses toRefBranch(branch)
  • plug/src/utils/registry.js — URL construction uses toRefBranch(branch)
  • plug/src/commands/install.js — prefix-stripping for community package file paths
  • plug/tests/community-install-integration.test.js — new integration test (supports LIMIT, FILTER, LOCAL_INDEX, OUTPUT_DIR env vars)
  • plug/tests/install.test.js — new multi-file community package test
  • plug/tests/fetcher.test.js — updated URL assertion

Test plan

  • 300 unit tests pass
  • Integration test: LIMIT=5 npx vitest run tests/community-install-integration.test.js passes
  • Brainstorm installs 1 file (not 3) with rebuilt community index
  • Changelog installs 1 file (not 30) with rebuilt community index

Note: Companion PR in plugvault for community-index builder fix: file scoping, nested entry detection, auto-child deps

This commit ensures that all files installed by a package are tracked in installed.json and correctly cleaned up during removal or update. Also includes a helper to remove empty parent directories recursively.
… and integration test

- Fix prefix-stripping for community packages with absolute file paths in
  files array (prevents path doubling in download URLs and local destinations)
- Add toRefBranch() helper to normalize branch to refs/heads/ format in all
  raw.githubusercontent.com URLs (fetcher, registry, community index)
- Update COMMUNITY_INDEX_URL to use refs/heads/main
- Add community-install-integration test that downloads real packages and
  validates file placement (supports LIMIT, FILTER, LOCAL_INDEX, OUTPUT_DIR)
- Add test-output/ to .gitignore
@dsiddharth2
dsiddharth2 merged commit 58dfb9c into main Apr 18, 2026
2 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