Skip to content

chore(deps): remove hosted-git-info, meow, try-resolve - #25

Merged
azu merged 3 commits into
masterfrom
claude/peaceful-euler-e8xsgh
Oct 19, 2026
Merged

azu merged 3 commits into
masterfrom
claude/peaceful-euler-e8xsgh

Conversation

@azu

@azu azu commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Summary

Remove three runtime dependencies and replace them with small built-in alternatives. Runtime dependencies are now only git-remote-origin-url and github-label-sync.

  • hosted-git-info → small regexp parseGitHubRepository in src/github-label-setup.ts that extracts owner/repo from a GitHub remote URL (SSH, HTTPS, ssh://, git+https://, URLs with credentials, repo names containing dots). Non-GitHub URLs return undefined (this tool targets GitHub only). @types/hosted-git-info is removed too.
  • try-resolve (deprecated on npm: "Package no longer supported") → require.resolve wrapped in try/catch, using the existing createRequire.
  • meow → node:util parseArgs in bin/cmd.mjs. parseArgs is stable since Node.js v20.0.0, and CI covers Node.js 20 / 22 / 24.
    • Existing options keep working: --dry-run/-d, --labels/-l, --token, --allow-added-labels/-A, --addReleaseYml, --addReleaseYmlOutputPath, --help/-h, --version.
    • The camelCase forms --dryRun / --allowAddedLabels that meow accepted still work.

Behavior change

Unknown options now print an error plus the help text and exit with code 2. Before, meow silently ignored them.

Test

  • pnpm run build passes
  • parseGitHubRepository checked against SSH / HTTPS / ssh:// / git+https:// / token-in-URL / GitLab / dotted repo name
  • CLI smoke test: --help, --version, an unknown option, -d -l labels.json (the labels file and the repo resolve, then it stops at the missing token), -l nope.json (label-file-not-found error), --addReleaseYml --addReleaseYmlOutputPath <path>
  • Not run: an actual label sync against GitHub with a real token

Note

github-label-sync (both 2.3.1 and 3.0.0) is marked deprecated on npm, and all pnpm audit findings come from its dependency tree (octonode → request, …). That is out of scope for this PR.


Generated by Claude Code

- Parse "owner/repo" from GitHub remote URL with a small regexp instead of hosted-git-info
- Use require.resolve instead of deprecated try-resolve
- Use node:util parseArgs instead of meow
  - Keep existing options (--dry-run/-d, --labels/-l, --token, --allow-added-labels/-A, --addReleaseYml, --addReleaseYmlOutputPath)
  - Also accept camelCase --dryRun/--allowAddedLabels as meow did

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HgKh95YqMvG1Q3AQ2aaqjN
Copilot AI balanced review requested due to automatic review settings October 19, 2026 14:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

devin-ai-integration[bot]

This comment was marked as resolved.

- Use URL API for URL-style remotes so ports, www.github.com, query and fragment are handled
- Keep a separate branch for SCP-like remotes (git@github.com:owner/repo.git)
- Enable parseArgs allowNegative to accept --no-dry-run / --no-allow-added-labels

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HgKh95YqMvG1Q3AQ2aaqjN
devin-ai-integration[bot]

This comment was marked as resolved.

Rewrite --dryRun / --allowAddedLabels (and --no-* forms) to dashed names before parseArgs,
instead of defining them as separate options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HgKh95YqMvG1Q3AQ2aaqjN
@azu azu added the Type: Refactoring A code change that neither fixes a bug nor adds a feature label Oct 19, 2026
@azu
azu merged commit 297db4a into master Oct 19, 2026
7 checks passed
@azu
azu deleted the claude/peaceful-euler-e8xsgh branch October 19, 2026 14:09
@github-actions github-actions Bot mentioned this pull request Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Refactoring A code change that neither fixes a bug nor adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants