feat: Add Support for Proxy Based Npm Interceptor (#87)

* feat: Add experimental proxy based npm interceptor

* refactor: Analysis cache

* ci: Add E2E for npm proxy

* fix: Handle dry-run in proxy flow

* fix: Handle special case for scope package name

* fix: Misc fixes

* fix: Code review fixes

* fix: Code review fixes

* refactor: Reusable code into base registry interceptor

* Pause npm process during user confirmation (#90)

* pause npm process when prompting user for confirmation

* disable progress bar

* fix logging and close chan on return

* update use of deprecated field

* refactor: Separation of concerns for handling process state

* fix: Safe permission for cert file

* fix: Handle nil check for interaction hook

* fix: Add test for base registry

* Fix goreleaser for windows build (#93)

* introduce platform specific process control

* rename common.go to common_flow.go

* feat: Add support for pause resume on windows

* fix: Code review fixes

* test: Add confirmation handler tests

---------

Co-authored-by: Sahil Bansal <bansalsahil315@gmail.com>
This commit is contained in:
Abhisek Datta
2026-01-07 13:22:08 +05:30
committed by GitHub
co-authored by Sahil Bansal
parent 20c854e473
commit 779deeb23d
24 changed files with 2373 additions and 116 deletions
+43
View File
@@ -101,6 +101,49 @@ jobs:
test -d node_modules/lodash
cd .. && rm -rf npm-test
- name: Test NPM - Experimental Proxy Mode
run: |
echo "Testing NPM with experimental proxy-based interception..."
mkdir npm-proxy-test && cd npm-proxy-test
pmg npm init -y
echo "Testing proxy mode single package installation..."
pmg --experimental-proxy-mode npm install express@5.2.1
pmg --experimental-proxy-mode npm install lodash@4.17.21
# Verification: packages installed via proxy mode
test -d node_modules/express
test -d node_modules/lodash
grep -q '"express"' package.json
grep -q '"lodash"' package.json
echo "Testing proxy mode manifest installation..."
rm -rf node_modules package-lock.json
pmg --experimental-proxy-mode npm install
# Verification: manifest install via proxy mode works
test -f package-lock.json
test -d node_modules/express
test -d node_modules/lodash
echo "Testing proxy mode with scoped package..."
pmg --experimental-proxy-mode npm install @types/node@18.0.0
# Verification: scoped package installed via proxy
test -d node_modules/@types
test -d node_modules/@types/node
grep -q '"@types/node"' package.json
echo "Testing proxy mode dry-run (should not create files)..."
rm -rf node_modules package-lock.json
pmg --experimental-proxy-mode --dry-run npm install
# Verification: dry-run doesn't create files even in proxy mode
test ! -d node_modules
test ! -f package-lock.json
cd .. && rm -rf npm-proxy-test
- name: Test PNPM - Single Package & Manifest
run: |
echo "Testing PNPM single package installation..."