Skip to content

feat: add proxyVarSubDir option to path extenders#26

Merged
zkochan merged 8 commits intomainfrom
support-subpath
Mar 20, 2026
Merged

feat: add proxyVarSubDir option to path extenders#26
zkochan merged 8 commits intomainfrom
support-subpath

Conversation

@zkochan
Copy link
Copy Markdown
Member

@zkochan zkochan commented Mar 20, 2026

Summary

  • Add proxyVarSubDir option to posix, windows, and main path extender interfaces
  • When set, the PATH entry uses a subdirectory of the proxy variable (e.g. $PNPM_HOME/bin instead of $PNPM_HOME)
  • Supports all shell types: bash/zsh (case statement), fish, nushell, and Windows registry
  • Validate proxyVarSubDir to reject unsafe values (leading slashes, .., shell metacharacters)
  • Remove pnpm.builder/policy component (scope has been removed from Bit)
  • Add @teambit/builder as explicit workspace dependency
  • Update CI Node.js matrix to 22 and 24

Test plan

  • Added bash/zsh test for proxyVarSubDir
  • Added fish test for proxyVarSubDir
  • Added nushell test for proxyVarSubDir
  • Verify existing tests still pass
  • Test on Windows with the new proxyVarSubDir option

🤖 Generated with Claude Code

zkochan and others added 4 commits March 20, 2026 14:22
Allow specifying a subdirectory of the proxy variable to add to PATH,
e.g. PNPM_HOME/bin instead of PNPM_HOME. Supports posix (bash, fish,
nushell) and windows shells.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Drop support for Node.js 16, 18, 20, and 21.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The pnpm.builder scope has been removed from Bit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously resolved transitively through the removed policy component.

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

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the PATH manipulation utilities to support adding a subdirectory of a proxy environment variable (e.g. $PNPM_HOME/bin / %PNPM_HOME%\bin) across POSIX shells and Windows, and wires the option through the shared addDirToEnvPath entrypoint.

Changes:

  • Add a new proxyVarSubDir option to POSIX + Windows path extender option types and implementations.
  • Update POSIX shell rendering (bash/zsh/ksh/sh, fish, nushell) and Windows registry PATH entry construction to use the proxy var subdirectory when set.
  • Update tests for POSIX bash path extender output with proxyVarSubDir: 'bin'.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
os/env/path-extender/path-extender.ts Passes the new proxyVarSubDir option through to the Windows implementation.
os/env/path-extender-posix/path-extender-posix.ts Adds proxyVarSubDir and uses it when generating PATH updates for sh-compatible shells, fish, and nushell.
os/env/path-extender-windows/path-extender-windows.ts Adds proxyVarSubDir and builds a %VAR%\subdir PATH entry when set.
os/env/path-extender-posix/path-extender-posix.spec.ts Adds a bash coverage test for the new $PNPM_HOME/bin behavior.
.github/workflows/ci.yml Changes CI Node.js matrix to only 22 and 24.
.bitmap + builder/policy/* deletions Removes the builder/policy Bit component from the workspace.
pnpm-lock.yaml Large lockfile rewrite, including new deprecation notices (e.g. basic-ftp@5.0.5, puppeteer@24.3.0).
.gitignore Adds .claude to ignored files.
Comments suppressed due to low confidence (1)

os/env/path-extender-posix/path-extender-posix.ts:24

  • The public options interface now includes proxyVarSubDir, but the package docs/examples (e.g. path-extender-posix.docs.mdx / path-extender-windows.docs.mdx) don’t describe this new option or its effect on PATH entries. Please update the documentation to include the new option and an example (like $PNPM_HOME/bin).
export interface AddDirToPosixEnvPathOpts {
  proxyVarName?: string
  proxyVarSubDir?: string
  overwrite?: boolean
  position?: AddingPosition
  configSectionName: string
}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +73 to +76
const pathEntry = opts.proxyVarSubDir
? `%${opts.proxyVarName}%${path.sep}${opts.proxyVarSubDir}`
: `%${opts.proxyVarName}%`
changes.push(await addToPath(registryOutput, pathEntry, opts.position))
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

New Windows behavior (proxyVarSubDir) is introduced here but isn't covered by path-extender-windows.spec.ts. Please add a unit test asserting the Path entry becomes something like %PNPM_HOME%\\bin when proxyVarSubDir: 'bin' is provided, including both prepend/append positions.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Windows path extender tests require registry access and can only run on Windows. Skipping for now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added Windows test for proxyVarSubDir.

zkochan and others added 2 commits March 20, 2026 14:46
- Validate proxyVarSubDir to reject dangerous values (leading slashes,
  .., shell metacharacters) in both posix and windows path extenders
- Quote pathRef in Fish shell string match when using proxyVarSubDir
- Add Fish and Nushell tests for proxyVarSubDir

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@zkochan zkochan merged commit 98af49e into main Mar 20, 2026
4 of 8 checks passed
@zkochan zkochan deleted the support-subpath branch March 20, 2026 14:33
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.

2 participants