Skip to content

Feature/auto version from env#163

Open
narendranathe wants to merge 4 commits intoandrewyng:mainfrom
narendranathe:feature/auto-version-from-env
Open

Feature/auto version from env#163
narendranathe wants to merge 4 commits intoandrewyng:mainfrom
narendranathe:feature/auto-version-from-env

Conversation

@narendranathe
Copy link

What

Adds environment-aware version detection to chub get. When --version is not
passed, the CLI reads the project's dependency manifest and auto-selects the
version pinned there.

Supported manifests

  • Python: requirements.txt, pyproject.toml (PEP 621 + Poetry), Pipfile
  • Node: package.json, package-lock.json

Behaviour

  • --version explicit flag always wins — no regression
  • Falls back to latest if no manifest or package not found
  • [env] notice printed to stderr (suppressed with --json)
  • Walks up from cwd to find the nearest manifest

Files

  • cli/src/lib/env-version.js — detection module
  • tests/lib/env-version.test.js — 20 vitest unit tests
  • cli/src/commands/get.js — 4-line integration

Closes #32

This file detects the version of a package from various dependency files in the project, allowing for automatic version selection.
This test file contains various tests for the environment version detection module, covering different manifest formats and scenarios.
Add auto-detection of environment version in get command.
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.

Auto-select documentation version from the current environment, not just latest

1 participant