From 1461b5224e71a70a5e317a63c8588b72259d31c2 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Tue, 10 Mar 2026 22:25:30 -0700 Subject: [PATCH 01/24] Install `@npmcli/config` --- package.json | 1 + yarn.lock | 227 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 228 insertions(+) diff --git a/package.json b/package.json index 5987b2f3..c2f3556f 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "test": "npm run check-version && jasmine --config=./spec/jasmine.json" }, "dependencies": { + "@npmcli/config": "^10.7.1", "asar-require": "0.3.0", "async": "^3.2.0", "colors": "~1.4.0", diff --git a/yarn.lock b/yarn.lock index d34f3b39..36e3502b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,13 @@ # yarn lockfile v1 +"@gar/promise-retry@^1.0.0": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@gar/promise-retry/-/promise-retry-1.0.2.tgz#90d01966a7fcb270ce6fb4211405ab828ae6e036" + integrity sha512-Lm/ZLhDZcBECta3TmCQSngiQykFdfw+QtI1/GYMsZd4l3nG+P8WLB16XuS7WaBGLQ+9E+cOcWQsth9cayuGt8g== + dependencies: + retry "^0.13.1" + "@iarna/cli@^2.1.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@iarna/cli/-/cli-2.1.0.tgz#f830356d54c72c804bd7afc43999de31e40fc3d6" @@ -33,6 +40,20 @@ lru-cache "^10.0.1" socks-proxy-agent "^8.0.3" +"@npmcli/config@^10.7.1": + version "10.7.1" + resolved "https://registry.yarnpkg.com/@npmcli/config/-/config-10.7.1.tgz#be9617bc8d785c4e7b840f3ce7e5c2a4d28fe35c" + integrity sha512-lh0eZYOknIpIKYKxbQKX7xFmb4FbmrOHUD25+0iEo3djRQP6YleHwBFgjH3X7QvUVM4t+Xm7rGsjDwJp63WkAg== + dependencies: + "@npmcli/map-workspaces" "^5.0.0" + "@npmcli/package-json" "^7.0.0" + ci-info "^4.0.0" + ini "^6.0.0" + nopt "^9.0.0" + proc-log "^6.0.0" + semver "^7.3.5" + walk-up-path "^4.0.0" + "@npmcli/fs@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-3.1.0.tgz#233d43a25a91d68c3a863ba0da6a3f00924a173e" @@ -40,6 +61,55 @@ dependencies: semver "^7.3.5" +"@npmcli/git@^7.0.0": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@npmcli/git/-/git-7.0.2.tgz#680c3271fe51401c07ee41076be678851e600ff0" + integrity sha512-oeolHDjExNAJAnlYP2qzNjMX/Xi9bmu78C9dIGr4xjobrSKbuMYCph8lTzn4vnW3NjIqVmw/f8BCfouqyJXlRg== + dependencies: + "@gar/promise-retry" "^1.0.0" + "@npmcli/promise-spawn" "^9.0.0" + ini "^6.0.0" + lru-cache "^11.2.1" + npm-pick-manifest "^11.0.1" + proc-log "^6.0.0" + semver "^7.3.5" + which "^6.0.0" + +"@npmcli/map-workspaces@^5.0.0": + version "5.0.3" + resolved "https://registry.yarnpkg.com/@npmcli/map-workspaces/-/map-workspaces-5.0.3.tgz#5b887ec0b535a2ba64d1d338867326a2b9c041d1" + integrity sha512-o2grssXo1e774E5OtEwwrgoszYRh0lqkJH+Pb9r78UcqdGJRDRfhpM8DvZPjzNLLNYeD/rNbjOKM3Ss5UABROw== + dependencies: + "@npmcli/name-from-folder" "^4.0.0" + "@npmcli/package-json" "^7.0.0" + glob "^13.0.0" + minimatch "^10.0.3" + +"@npmcli/name-from-folder@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@npmcli/name-from-folder/-/name-from-folder-4.0.0.tgz#b4d516ae4fab5ed4e8e8032abff3488703fc24a3" + integrity sha512-qfrhVlOSqmKM8i6rkNdZzABj8MKEITGFAY+4teqBziksCQAOLutiAxM1wY2BKEd8KjUSpWmWCYxvXr0y4VTlPg== + +"@npmcli/package-json@^7.0.0": + version "7.0.5" + resolved "https://registry.yarnpkg.com/@npmcli/package-json/-/package-json-7.0.5.tgz#e29481dfc586d1625a6553799e6bec52ae0487a5" + integrity sha512-iVuTlG3ORq2iaVa1IWUxAO/jIp77tUKBhoMjuzYW2kL4MLN1bi/ofqkZ7D7OOwh8coAx1/S2ge0rMdGv8sLSOQ== + dependencies: + "@npmcli/git" "^7.0.0" + glob "^13.0.0" + hosted-git-info "^9.0.0" + json-parse-even-better-errors "^5.0.0" + proc-log "^6.0.0" + semver "^7.5.3" + spdx-expression-parse "^4.0.0" + +"@npmcli/promise-spawn@^9.0.0": + version "9.0.1" + resolved "https://registry.yarnpkg.com/@npmcli/promise-spawn/-/promise-spawn-9.0.1.tgz#20e80cbdd2f24ad263a15de3ebbb1673cb82005b" + integrity sha512-OLUaoqBuyxeTqUvjA3FZFiXUfYC1alp3Sa99gW3EUDz3tZ3CbXDdcZ7qWKBzicrJleIgucoWamWH1saAmH/l2Q== + dependencies: + which "^6.0.0" + "@pkgjs/parseargs@^0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" @@ -121,6 +191,11 @@ abbrev@^2.0.0: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-2.0.0.tgz#cf59829b8b4f03f89dda2771cb7f3653828c89bf" integrity sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ== +abbrev@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-4.0.0.tgz#ec933f0e27b6cd60e89b5c6b2a304af42209bb05" + integrity sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA== + accepts@~1.3.8: version "1.3.8" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" @@ -367,6 +442,11 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +balanced-match@^4.0.2: + version "4.0.4" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-4.0.4.tgz#bfb10662feed8196a2c62e7c68e17720c274179a" + integrity sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA== + base64-js@^1.3.1, base64-js@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" @@ -459,6 +539,13 @@ brace-expansion@^2.0.1: dependencies: balanced-match "^1.0.0" +brace-expansion@^5.0.2: + version "5.0.4" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-5.0.4.tgz#614daaecd0a688f660bbbc909a8748c3d80d4336" + integrity sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg== + dependencies: + balanced-match "^4.0.2" + buffer-from@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" @@ -639,6 +726,11 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== +ci-info@^4.0.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-4.4.0.tgz#7d54eff9f54b45b62401c26032696eb59c8bd18c" + integrity sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg== + cidr-regex@^2.0.10: version "2.0.10" resolved "https://registry.yarnpkg.com/cidr-regex/-/cidr-regex-2.0.10.tgz#af13878bd4ad704de77d6dc800799358b3afa70d" @@ -1851,6 +1943,15 @@ glob@^10.3.10: package-json-from-dist "^1.0.0" path-scurry "^1.11.1" +glob@^13.0.0: + version "13.0.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-13.0.6.tgz#078666566a425147ccacfbd2e332deb66a2be71d" + integrity sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw== + dependencies: + minimatch "^10.2.2" + minipass "^7.1.3" + path-scurry "^2.0.2" + glob@^6.0.1, glob@^6.0.4: version "6.0.4" resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" @@ -2010,6 +2111,13 @@ hosted-git-info@^3.0.7: dependencies: lru-cache "^6.0.0" +hosted-git-info@^9.0.0: + version "9.0.2" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-9.0.2.tgz#b38c8a802b274e275eeeccf9f4a1b1a0a8557ada" + integrity sha512-M422h7o/BR3rmCQ8UHi7cyyMqKltdP9Uo+J2fXK+RSAY+wTcKOIRyhTuKv4qn+DJf3g+PL890AzId5KZpX+CBg== + dependencies: + lru-cache "^11.1.0" + http-cache-semantics@^3.8.1, http-cache-semantics@^4.0.0, http-cache-semantics@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" @@ -2173,6 +2281,11 @@ ini@^1.3.4, ini@^1.3.5, ini@^1.3.8, ini@~1.3.0: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== +ini@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/ini/-/ini-6.0.0.tgz#efc7642b276f6a37d22fdf56ef50889d7146bf30" + integrity sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ== + init-package-json@^1.10.3: version "1.10.3" resolved "https://registry.yarnpkg.com/init-package-json/-/init-package-json-1.10.3.tgz#45ffe2f610a8ca134f2bd1db5637b235070f6cbe" @@ -2424,6 +2537,11 @@ isexe@^3.1.1: resolved "https://registry.yarnpkg.com/isexe/-/isexe-3.1.1.tgz#4a407e2bd78ddfb14bea0c27c6f7072dde775f0d" integrity sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ== +isexe@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-4.0.0.tgz#48f6576af8e87a18feb796b7ed5e2e5903b43dca" + integrity sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw== + isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -2485,6 +2603,11 @@ json-parse-even-better-errors@^2.3.0: resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== +json-parse-even-better-errors@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-5.0.0.tgz#93c89f529f022e5dadc233409324f0167b1e903e" + integrity sha512-ZF1nxZ28VhQouRWhUcVlUIN3qwSgPuswK05s/HIaoetAoE/9tngVmCHjSxmSQPav1nd+lPtTL0YZ/2AFdR/iYQ== + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -2782,6 +2905,11 @@ lru-cache@^10.0.1, lru-cache@^10.2.0: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== +lru-cache@^11.0.0, lru-cache@^11.1.0, lru-cache@^11.2.1: + version "11.2.6" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.2.6.tgz#356bf8a29e88a7a2945507b31f6429a65a192c58" + integrity sha512-ESL2CrkS/2wTPfuend7Zhkzo2u0daGJ/A2VucJOgQ/C48S/zB8MMeMHSGKYpXhIjbPxfuezITkaBH1wqv00DDQ== + lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" @@ -2910,6 +3038,13 @@ mimic-response@^3.1.0: dependencies: brace-expansion "^1.1.7" +minimatch@^10.0.3, minimatch@^10.2.2: + version "10.2.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.2.4.tgz#465b3accbd0218b8281f5301e27cedc697f96fde" + integrity sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg== + dependencies: + brace-expansion "^5.0.2" + minimatch@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.1.tgz#8a555f541cf976c622daf078bb28f29fb927c253" @@ -2998,6 +3133,11 @@ minipass@^5.0.0: resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== +minipass@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.3.tgz#79389b4eb1bb2d003a9bba87d492f2bd37bdc65b" + integrity sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A== + minizlib@^2.1.1, minizlib@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" @@ -3193,6 +3333,13 @@ nopt@^7.0.0: dependencies: abbrev "^2.0.0" +nopt@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-9.0.0.tgz#6bff0836b2964d24508b6b41b5a9a49c4f4a1f96" + integrity sha512-Zhq3a+yFKrYwSBluL4H9XP3m3y5uvQkB/09CwDruCiRmR/UJYnn9W4R48ry0uGC70aeTPKLynBtscP9efFFcPw== + dependencies: + abbrev "^4.0.0" + nopt@~1.0.10: version "1.0.10" resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" @@ -3242,6 +3389,13 @@ npm-install-checks@^3.0.2: dependencies: semver "^2.3.0 || 3.x || 4 || 5" +npm-install-checks@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/npm-install-checks/-/npm-install-checks-8.0.0.tgz#f5d18e909bb8318d85093e9d8f36ac427c1cbe30" + integrity sha512-ScAUdMpyzkbpxoNekQ3tNRdFI8SJ86wgKZSQZdUxT+bj0wVFpsEMWnkXP0twVe1gJyNF5apBWDJhhIbgrIViRA== + dependencies: + semver "^7.1.1" + "npm-lifecycle@https://github.com/pulsar-edit/npm-lifecycle/archive/7d7d20ffbb596602c2ef6caaad9356413aa586ba.tar.gz": version "3.1.6-pulsar1" resolved "https://github.com/pulsar-edit/npm-lifecycle/archive/7d7d20ffbb596602c2ef6caaad9356413aa586ba.tar.gz#a0162e7a6019a62c2c257249018cbbf0f3a342de" @@ -3265,6 +3419,21 @@ npm-normalize-package-bin@^1.0.0, npm-normalize-package-bin@^1.0.1: resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2" integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== +npm-normalize-package-bin@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-5.0.0.tgz#2b207ff260f2e525ddce93356614e2f736728f89" + integrity sha512-CJi3OS4JLsNMmr2u07OJlhcrPxCeOeP/4xq67aWNai6TNWWbTrlNDgl8NcFKVlcBKp18GPj+EzbNIgrBfZhsag== + +npm-package-arg@^13.0.0: + version "13.0.2" + resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-13.0.2.tgz#72a80f2afe8329860e63854489415e9e9a2f78a7" + integrity sha512-IciCE3SY3uE84Ld8WZU23gAPPV9rIYod4F+rc+vJ7h7cwAJt9Vk6TVsK60ry7Uj3SRS3bqRRIGuTp9YVlk6WNA== + dependencies: + hosted-git-info "^9.0.0" + proc-log "^6.0.0" + semver "^7.3.5" + validate-npm-package-name "^7.0.0" + "npm-package-arg@^4.0.0 || ^5.0.0 || ^6.0.0", npm-package-arg@^6.0.0, npm-package-arg@^6.1.0, npm-package-arg@^6.1.1: version "6.1.1" resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-6.1.1.tgz#02168cb0a49a2b75bf988a28698de7b529df5cb7" @@ -3284,6 +3453,16 @@ npm-packlist@^1.1.12, npm-packlist@^1.4.8: npm-bundled "^1.0.1" npm-normalize-package-bin "^1.0.1" +npm-pick-manifest@^11.0.1: + version "11.0.3" + resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-11.0.3.tgz#76cf6593a351849006c36b38a7326798e2a76d13" + integrity sha512-buzyCfeoGY/PxKqmBqn1IUJrZnUi1VVJTdSSRPGI60tJdUhUoSQFhs0zycJokDdOznQentgrpf8LayEHyyYlqQ== + dependencies: + npm-install-checks "^8.0.0" + npm-normalize-package-bin "^5.0.0" + npm-package-arg "^13.0.0" + semver "^7.3.5" + npm-pick-manifest@^3.0.0, npm-pick-manifest@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz#f4d9e5fd4be2153e5f4e5f9b7be8dc419a99abb7" @@ -3742,6 +3921,14 @@ path-scurry@^1.7.0: lru-cache "^9.1.1" minipass "^5.0.0 || ^6.0.2" +path-scurry@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-2.0.2.tgz#6be0d0ee02a10d9e0de7a98bae65e182c9061f85" + integrity sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg== + dependencies: + lru-cache "^11.0.0" + minipass "^7.1.2" + path-to-regexp@0.1.10: version "0.1.10" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" @@ -3794,6 +3981,11 @@ proc-log@^4.1.0, proc-log@^4.2.0: resolved "https://registry.yarnpkg.com/proc-log/-/proc-log-4.2.0.tgz#b6f461e4026e75fdfe228b265e9f7a00779d7034" integrity sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA== +proc-log@^6.0.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/proc-log/-/proc-log-6.1.0.tgz#18519482a37d5198e231133a70144a50f21f0215" + integrity sha512-iG+GYldRf2BQ0UDUAd6JQ/RwzaQy6mXmsk/IzlYyal4A4SNFw54MeH4/tLkF4I5WoWG9SQwuqWzS99jaFQHBuQ== + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -4192,6 +4384,11 @@ retry@^0.12.0: resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== +retry@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" + integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== + rimraf@^2.2.8, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@^2.7.1: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" @@ -4277,6 +4474,11 @@ semver-diff@^2.0.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== +semver@^7.1.1, semver@^7.5.3: + version "7.7.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.4.tgz#28464e36060e991fa7a11d0279d2d3f3b57a7e8a" + integrity sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA== + semver@^7.3.4, semver@^7.3.5, semver@^7.3.8: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" @@ -4516,6 +4718,14 @@ spdx-expression-parse@^3.0.0: spdx-exceptions "^2.1.0" spdx-license-ids "^3.0.0" +spdx-expression-parse@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz#a23af9f3132115465dac215c099303e4ceac5794" + integrity sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + spdx-license-ids@^3.0.0: version "3.0.12" resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz#69077835abe2710b65f03969898b6637b505a779" @@ -5057,6 +5267,11 @@ validate-npm-package-name@^3.0.0, validate-npm-package-name@~3.0.0: dependencies: builtins "^1.0.3" +validate-npm-package-name@^7.0.0: + version "7.0.2" + resolved "https://registry.yarnpkg.com/validate-npm-package-name/-/validate-npm-package-name-7.0.2.tgz#e57c3d721a4c8bbff454a246e7f7da811559ea0d" + integrity sha512-hVDIBwsRruT73PbK7uP5ebUt+ezEtCmzZz3F59BSr2F6OVFnJ/6h8liuvdLrQ88Xmnk6/+xGGuq+pG9WwTuy3A== + vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" @@ -5084,6 +5299,11 @@ vscode-oniguruma@^1.7.0: resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz#439bfad8fe71abd7798338d1cd3dc53a8beea94b" integrity sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA== +walk-up-path@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/walk-up-path/-/walk-up-path-4.0.0.tgz#590666dcf8146e2d72318164f1f2ac6ef51d4198" + integrity sha512-3hu+tD8YzSLGuFYtPRb48vdhKMi0KQV5sn+uWr8+7dMEq/2G/dtLrdDinkLjqq5TIbIBjYJ4Ax/n3YiaW7QM8A== + wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" @@ -5128,6 +5348,13 @@ which@^4.0.0: dependencies: isexe "^3.1.1" +which@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/which/-/which-6.0.1.tgz#021642443a198fb93b784a5606721cb18cfcbfce" + integrity sha512-oGLe46MIrCRqX7ytPUf66EAYvdeMIZYn3WaocqqKZAxrBpkqHfL/qvTyJ/bTk5+AqHCjXmrv3CEWgy368zhRUg== + dependencies: + isexe "^4.0.0" + wide-align@^1.1.0: version "1.1.5" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" From 963561600214211707220d39816b7f9294c85ffa Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Tue, 10 Mar 2026 22:25:59 -0700 Subject: [PATCH 02/24] Migrate `config` to use `@npmcli/config` --- spec/config-spec.js | 8 ++--- src/config.js | 80 ++++++++++++++++++++++++++++++++------------- 2 files changed, 62 insertions(+), 26 deletions(-) diff --git a/spec/config-spec.js b/spec/config-spec.js index 6a9d19c2..a421a4ac 100644 --- a/spec/config-spec.js +++ b/spec/config-spec.js @@ -10,7 +10,7 @@ describe('apm config', () => { silenceOutput(); const atomHome = temp.mkdirSync('apm-home-dir-'); process.env.ATOM_HOME = atomHome; - userConfigPath = path.join(atomHome, '.apmrc'); + userConfigPath = path.join(atomHome, '.apm', '.apmrc'); // Make sure the cache used is the one for the test env delete process.env.npm_config_cache; }); @@ -19,7 +19,7 @@ describe('apm config', () => { it('reads the value from the global config when there is no user config', async () => { await apmRun(['config', 'get', 'cache']); expect( - process.stdout.write.calls.argsFor(0)[0].trim() + console.log.calls.mostRecent().args[0] ).toBe(path.join(process.env.ATOM_HOME, '.apm')); }); }); @@ -31,8 +31,8 @@ describe('apm config', () => { expect(fs.isFileSync(userConfigPath)).toBe(true); await apmRun(['config', 'get', 'foo']); expect( - process.stdout.write.calls.argsFor(0)[0].trim() - ).toBe('bar'); + console.log.calls.mostRecent().args[0] + ).toBe("bar"); }); }); }); diff --git a/src/config.js b/src/config.js index 0efa78fe..81e97325 100644 --- a/src/config.js +++ b/src/config.js @@ -1,6 +1,8 @@ const path = require('path'); const yargs = require('yargs'); +const npmConfig = require('@npmcli/config'); +const defs = require("@npmcli/config/lib/definitions"); const apm = require('./apm'); const Command = require('./command'); @@ -33,27 +35,61 @@ Usage: ppm config set run(options) { options = this.parseOptions(options.commandArgs); - let configArgs = ['--globalconfig', apm.getGlobalConfigPath(), '--userconfig', apm.getUserConfigPath(), 'config']; - configArgs = configArgs.concat(options.argv._); - - const env = { - ...process.env, - HOME: this.atomNodeDirectory, - RUSTUP_HOME: apm.getRustupHomeDirPath() - }; - const configOptions = {env}; - - return new Promise((resolve, _reject) => - void this.fork(this.atomNpmPath, configArgs, configOptions, (code, stderr, stdout) => { - stderr ??= ''; - stdout ??= ''; - if (code === 0) { - if (stdout) { process.stdout.write(stdout); } - return void resolve(); - } - if (stderr) { process.stdout.write(stderr); } - return void resolve(new Error(`npm config failed: ${code}`)); - }) - ); + let configArgs = ['--globalconfig', apm.getGlobalConfigPath(), '--userconfig', apm.getUserConfigPath() ]; + + const conf = new npmConfig({ + npmPath: "", + definitions: { + ...defs.definitions, + // Define any default overrides + cache: { ...defs.definitions.cache, default: path.join(process.env.ATOM_HOME, ".apm") } + }, + shorthands: defs.shorthands, + flatten: defs.flatten, + argv: configArgs, + env: { + // TODO: Do we need to include anything else from the env? + // previously used `...process.env` but it lead to lots of useless warnings + HOME: this.atomNodeDirectory, + RUSTUP_HOME: apm.getRustupHomeDirPath() + } + }); + + // re-route process object log events to console + process.on("log", (level, ...args) => { + console.log(level, ...args); + }); + + return new Promise((resolve, reject) => { + try { + conf.load().then(() => { + conf.validate(); + + const action = options.argv._[0]; + const key = options.argv._[1]; + const value = options.argv._[2]; + + if (action === "get") { + console.log(conf.get(key)); + resolve(); + } else if (action === "set") { + conf.set(key, value, "user"); + conf.save("user"); + resolve(); + } else if (action === "delete") { + resolve(conf.delete(key)); + } else if (action === "list") { + reject("TODO: 501"); + } else if (action === "edit") { + reject("TODO: 501"); + } + + }).catch((err) => { + console.error(err); + reject(err); + }); + } catch(err) { console.error(err); reject(err); } + }); + } } From 5c75867d0ec10a20a1f33971291b643b89305428 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Tue, 10 Mar 2026 22:29:47 -0700 Subject: [PATCH 03/24] `@npmcli/config` doesn't want to install on older node --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f54dff72..00954689 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -62,7 +62,7 @@ jobs: - name: Install dependencies if: ${{ matrix.node_version != 14 }} - run: yarn install + run: yarn install --ignore-engines - name: Install dependencies (NodeJS v14) # node-gyp v10+'s `engines` field dropped support for Node 14... Ignore and install anyway. From 585653ab314de44c63831bc837284773fe38257a Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Fri, 13 Mar 2026 20:14:05 -0700 Subject: [PATCH 04/24] Move `@npmcli/config` to `apm.getNpmConfig()` --- src/apm.js | 46 ++++++++++++++++++++++++++++++++++++++++++++++ src/config.js | 48 +++++++++--------------------------------------- 2 files changed, 55 insertions(+), 39 deletions(-) diff --git a/src/apm.js b/src/apm.js index f6e9954b..ccbd3752 100644 --- a/src/apm.js +++ b/src/apm.js @@ -2,6 +2,8 @@ const child_process = require('child_process'); const fs = require('./fs'); const path = require('path'); const npm = require('npm'); +const npmConfig = require("@npmcli/config"); +const npmDefs = require("@npmcli/config/lib/definitions"); let asarPath = null; module.exports = { @@ -165,6 +167,50 @@ module.exports = { return npm.config.get(key); }, + async getNpmConfig() { + const configArgs = + [ + "--globalconfig", this.getGlobalConfigPath(), + "--userconfig", this.getUserConfigPath() + ]; + + const conf = new npmConfig({ + npmPath: "", + definitions: { + ...npmDefs.definitions, + // Define any default overrides + cache: { ...npmDefs.definitions.cache, default: this.getCacheDirectory() } + }, + shorthands: npmDefs.shorthands, + flatten: npmDefs.flatten, + argv: configArgs, + env: { + // TODO: Do we need to include anything else from the env? + // previously used `...process.env` but it lead to lots of useless warnings. + HOME: path.join(this.getAtomDirectory(), ".node-gyp"), + RUSTUP_HOME: this.getRustupHomeDirPath() + } + }); + + // re-route process object log events to console + process.on("log", (level, ...args) => { + console.log(level, ...args); + }); + + return new Promise((resolve, reject) => { + try { + conf.load().then(() => { + conf.validate(); + resolve(conf); + }).catch((err) => { + reject(err); + }); + } catch(err) { + reject(err); + } + }); + }, + setupApmRcFile() { try { return fs.writeFileSync(this.getGlobalConfigPath(), `\ diff --git a/src/config.js b/src/config.js index 81e97325..d0d76a9b 100644 --- a/src/config.js +++ b/src/config.js @@ -1,8 +1,6 @@ const path = require('path'); const yargs = require('yargs'); -const npmConfig = require('@npmcli/config'); -const defs = require("@npmcli/config/lib/definitions"); const apm = require('./apm'); const Command = require('./command'); @@ -35,60 +33,32 @@ Usage: ppm config set run(options) { options = this.parseOptions(options.commandArgs); - let configArgs = ['--globalconfig', apm.getGlobalConfigPath(), '--userconfig', apm.getUserConfigPath() ]; - - const conf = new npmConfig({ - npmPath: "", - definitions: { - ...defs.definitions, - // Define any default overrides - cache: { ...defs.definitions.cache, default: path.join(process.env.ATOM_HOME, ".apm") } - }, - shorthands: defs.shorthands, - flatten: defs.flatten, - argv: configArgs, - env: { - // TODO: Do we need to include anything else from the env? - // previously used `...process.env` but it lead to lots of useless warnings - HOME: this.atomNodeDirectory, - RUSTUP_HOME: apm.getRustupHomeDirPath() - } - }); - - // re-route process object log events to console - process.on("log", (level, ...args) => { - console.log(level, ...args); - }); - - return new Promise((resolve, reject) => { + return new Promise(async (resolve, reject) => { try { - conf.load().then(() => { - conf.validate(); + const npmConf = await apm.getNpmConfig(); const action = options.argv._[0]; const key = options.argv._[1]; const value = options.argv._[2]; if (action === "get") { - console.log(conf.get(key)); + console.log(npmConf.get(key)); resolve(); } else if (action === "set") { - conf.set(key, value, "user"); - conf.save("user"); + npmConf.set(key, value, "user"); + npmConf.save("user"); resolve(); } else if (action === "delete") { - resolve(conf.delete(key)); + resolve(npmConf.delete(key)); } else if (action === "list") { reject("TODO: 501"); } else if (action === "edit") { reject("TODO: 501"); } - - }).catch((err) => { + } catch(err) { console.error(err); - reject(err); - }); - } catch(err) { console.error(err); reject(err); } + return err; + } }); } From 2cf9624a622e1d76e775358563697011f2d88c55 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Fri, 13 Mar 2026 20:14:37 -0700 Subject: [PATCH 05/24] Remove no-longer used dep in `config.js` --- src/config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/config.js b/src/config.js index d0d76a9b..13d43d25 100644 --- a/src/config.js +++ b/src/config.js @@ -1,5 +1,4 @@ -const path = require('path'); const yargs = require('yargs'); const apm = require('./apm'); const Command = require('./command'); From d739fa90a0512e66ee88a953edb62b5831385f96 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Fri, 13 Mar 2026 20:21:01 -0700 Subject: [PATCH 06/24] Make `git.js` use `apm.getNpmConfig()` --- src/git.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/git.js b/src/git.js index c0f6902d..a1af45ea 100644 --- a/src/git.js +++ b/src/git.js @@ -61,13 +61,11 @@ exports.addGitToEnv = env => { }; exports.getGitVersion = () => { - const npmOptions = { - userconfig: config.getUserConfigPath(), - globalconfig: config.getGlobalConfigPath() - }; - return new Promise((resolve, _reject) => { - npm.load(npmOptions, () => { - const git = npm.config.get('git') ?? 'git'; + return new Promise(async (resolve, reject) => { + try { + const npmConf = await config.getNpmConfig(); + + const git = npmConf.get("git") ?? "git"; exports.addGitToEnv(process.env); const spawned = spawn(git, ['--version']); const outputChunks = []; @@ -83,6 +81,8 @@ exports.getGitVersion = () => { } resolve(version); }); - }); + } catch(err) { + reject(err); + } }); }; From 07365a73f4d860163e7609ba3d2de908468eac24 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Fri, 13 Mar 2026 20:34:51 -0700 Subject: [PATCH 07/24] Whoops, module is still used --- src/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.js b/src/config.js index 13d43d25..94456dc8 100644 --- a/src/config.js +++ b/src/config.js @@ -1,4 +1,4 @@ - +const path = require('path'); const yargs = require('yargs'); const apm = require('./apm'); const Command = require('./command'); From f107cfe8a7b59ba1619e0a06cd8b63bac2f1be45 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Fri, 13 Mar 2026 23:27:53 -0700 Subject: [PATCH 08/24] Stop logging `silly` logs by default --- src/apm.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/apm.js b/src/apm.js index ccbd3752..5fbc32b6 100644 --- a/src/apm.js +++ b/src/apm.js @@ -194,7 +194,9 @@ module.exports = { // re-route process object log events to console process.on("log", (level, ...args) => { - console.log(level, ...args); + if (level !== "silly") { + console.log(level, ...args); + } }); return new Promise((resolve, reject) => { From cee7d14f25b108756126194d2b5b5ffdef6953cb Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sat, 14 Mar 2026 14:34:00 -0700 Subject: [PATCH 09/24] Make `apm-cli.js` use `apm.getNpmConfig()` --- src/apm-cli.js | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/apm-cli.js b/src/apm-cli.js index 347728c6..58fca28a 100644 --- a/src/apm-cli.js +++ b/src/apm-cli.js @@ -166,38 +166,39 @@ async function getAtomVersion() { } function getPythonVersion() { - return new Promise((resolve, _reject) => { - const npmOptions = { - userconfig: config.getUserConfigPath(), - globalconfig: config.getGlobalConfigPath() - }; - npm.load(npmOptions, () => { - let python = npm.config.get("python") ?? process.env.PYTHON; + return new Promise(async (resolve, reject) => { + try { + const npmConf = await config.getNpmConfig(); + + let python = npmConf.get("python") ?? process.env.PYTHON; if (config.isWin32() && !python) { - let rootDir = process.env.SystemDrive ??= 'C:\\'; - if (rootDir[rootDir.length - 1] !== '\\') { rootDir += '\\'; } - const pythonExe = path.resolve(rootDir, 'Python27', 'python.exe'); + let rootDir = process.env.SystemDrive ??= "C:\\"; + if (rootDir[rootDir.length -1] !== "\\") { rootDir += "\\"; } + const pythonExe = path.resolve(rootDir, "Python27", "python.exe"); if (fs.isFileSync(pythonExe)) { python = pythonExe; } } - python ??= 'python'; + python ??= "python"; - const spawned = spawn(python, ['--version']); + const spawned = spawn(python, ["--version"]); const outputChunks = []; - spawned.stderr.on('data', chunk => outputChunks.push(chunk)); - spawned.stdout.on('data', chunk => outputChunks.push(chunk)); - spawned.on('error', () => {}); - return spawned.on('close', code => { + spawned.stderr.on("data", chunk => outputChunks.push(chunk)); + spawned.stdout.on("data", chunk => outputChunks.push(chunk)); + spawned.on("error", () => {}); + return spawned.on("close", code => { let version, name; if (code === 0) { - [name, version] = Buffer.concat(outputChunks).toString().split(' '); + [name, version] = Buffer.concat(outputChunks).toString().split(" "); version = version?.trim(); } return resolve(version); - }); - }); + }) + } catch(err) { + console.error(err); + reject(err); + } }); -}; +} module.exports = { run(args, callback) { From 12c158270d12c23379cde41851cb91ed8d78abd8 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sat, 14 Mar 2026 14:58:35 -0700 Subject: [PATCH 10/24] Update `apm.getSetting()` --- src/apm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apm.js b/src/apm.js index 5fbc32b6..4e14fc93 100644 --- a/src/apm.js +++ b/src/apm.js @@ -163,8 +163,8 @@ module.exports = { }, async getSetting(key) { - await this.loadNpm(); - return npm.config.get(key); + const conf = await this.getNpmConfig(); + return conf.get(key); }, async getNpmConfig() { From 52ed0ad932fc44cda1974308c73979bd031dd29f Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sat, 14 Mar 2026 14:58:55 -0700 Subject: [PATCH 11/24] Use `apm.getSetting()` in `apm-cli.js` --- src/apm-cli.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/apm-cli.js b/src/apm-cli.js index 58fca28a..5e0818b9 100644 --- a/src/apm-cli.js +++ b/src/apm-cli.js @@ -168,9 +168,8 @@ async function getAtomVersion() { function getPythonVersion() { return new Promise(async (resolve, reject) => { try { - const npmConf = await config.getNpmConfig(); - - let python = npmConf.get("python") ?? process.env.PYTHON; + let pythonNpmConf = await config.getSetting("python"); + let python = pythonNpmConf ?? process.env.PYTHON; if (config.isWin32() && !python) { let rootDir = process.env.SystemDrive ??= "C:\\"; if (rootDir[rootDir.length -1] !== "\\") { rootDir += "\\"; } From 64ac4bbcc7145989de0a75259256d57d469165d2 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sat, 14 Mar 2026 15:00:01 -0700 Subject: [PATCH 12/24] Use `apm.getSetting()` in `git.js` --- src/git.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/git.js b/src/git.js index a1af45ea..f3eb4815 100644 --- a/src/git.js +++ b/src/git.js @@ -63,9 +63,9 @@ exports.addGitToEnv = env => { exports.getGitVersion = () => { return new Promise(async (resolve, reject) => { try { - const npmConf = await config.getNpmConfig(); + const gitNpmConf = await config.getSetting("git"); - const git = npmConf.get("git") ?? "git"; + const git = gitNpmConf ?? "git"; exports.addGitToEnv(process.env); const spawned = spawn(git, ['--version']); const outputChunks = []; From ac558323ea7b4e8011a8180684b68d20b64f54d5 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sat, 14 Mar 2026 15:01:12 -0700 Subject: [PATCH 13/24] Make sure to save value deletion in `config.js` --- src/config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config.js b/src/config.js index 94456dc8..4c57cf3a 100644 --- a/src/config.js +++ b/src/config.js @@ -48,7 +48,9 @@ Usage: ppm config set npmConf.save("user"); resolve(); } else if (action === "delete") { - resolve(npmConf.delete(key)); + npmConf.delete(key); + npmConf.save("user"); + resolve(); } else if (action === "list") { reject("TODO: 501"); } else if (action === "edit") { From b15d5f6be45b9cd1693572c2b71b3c25f92926d4 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sat, 14 Mar 2026 15:17:52 -0700 Subject: [PATCH 14/24] Add `@npmcli/arborist` --- package.json | 1 + yarn.lock | 519 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 513 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index c2f3556f..7397da7d 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "test": "npm run check-version && jasmine --config=./spec/jasmine.json" }, "dependencies": { + "@npmcli/arborist": "^9.4.1", "@npmcli/config": "^10.7.1", "asar-require": "0.3.0", "async": "^3.2.0", diff --git a/yarn.lock b/yarn.lock index 36e3502b..d0353f12 100644 --- a/yarn.lock +++ b/yarn.lock @@ -29,6 +29,18 @@ wrap-ansi "^8.1.0" wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" +"@isaacs/fs-minipass@^4.0.0": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz#2d59ae3ab4b38fb4270bfa23d30f8e2e86c7fe32" + integrity sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w== + dependencies: + minipass "^7.0.4" + +"@isaacs/string-locale-compare@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz#291c227e93fd407a96ecd59879a35809120e432b" + integrity sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ== + "@npmcli/agent@^2.0.0": version "2.2.2" resolved "https://registry.yarnpkg.com/@npmcli/agent/-/agent-2.2.2.tgz#967604918e62f620a648c7975461c9c9e74fc5d5" @@ -40,6 +52,57 @@ lru-cache "^10.0.1" socks-proxy-agent "^8.0.3" +"@npmcli/agent@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@npmcli/agent/-/agent-4.0.0.tgz#2bb2b1c0a170940511554a7986ae2a8be9fedcce" + integrity sha512-kAQTcEN9E8ERLVg5AsGwLNoFb+oEG6engbqAU2P43gD4JEIkNGMHdVQ096FsOAAYpZPB0RSt0zgInKIAS1l5QA== + dependencies: + agent-base "^7.1.0" + http-proxy-agent "^7.0.0" + https-proxy-agent "^7.0.1" + lru-cache "^11.2.1" + socks-proxy-agent "^8.0.3" + +"@npmcli/arborist@^9.4.1": + version "9.4.1" + resolved "https://registry.yarnpkg.com/@npmcli/arborist/-/arborist-9.4.1.tgz#acb5cc91378d1eaf65a0d363c70661660b778dc9" + integrity sha512-SaXiFtYcAbzPI+VmuI+O6hii9fEVe36vm6XRAu0QcvCR9YphHfNF8PIDeDapVkE+LJ0c7BN7uPGd3plbh9zbrw== + dependencies: + "@gar/promise-retry" "^1.0.0" + "@isaacs/string-locale-compare" "^1.1.0" + "@npmcli/fs" "^5.0.0" + "@npmcli/installed-package-contents" "^4.0.0" + "@npmcli/map-workspaces" "^5.0.0" + "@npmcli/metavuln-calculator" "^9.0.2" + "@npmcli/name-from-folder" "^4.0.0" + "@npmcli/node-gyp" "^5.0.0" + "@npmcli/package-json" "^7.0.0" + "@npmcli/query" "^5.0.0" + "@npmcli/redact" "^4.0.0" + "@npmcli/run-script" "^10.0.0" + bin-links "^6.0.0" + cacache "^20.0.1" + common-ancestor-path "^2.0.0" + hosted-git-info "^9.0.0" + json-stringify-nice "^1.1.4" + lru-cache "^11.2.1" + minimatch "^10.0.3" + nopt "^9.0.0" + npm-install-checks "^8.0.0" + npm-package-arg "^13.0.0" + npm-pick-manifest "^11.0.1" + npm-registry-fetch "^19.0.0" + pacote "^21.0.2" + parse-conflict-json "^5.0.1" + proc-log "^6.0.0" + proggy "^4.0.0" + promise-all-reject-late "^1.0.0" + promise-call-limit "^3.0.1" + semver "^7.3.7" + ssri "^13.0.0" + treeverse "^3.0.0" + walk-up-path "^4.0.0" + "@npmcli/config@^10.7.1": version "10.7.1" resolved "https://registry.yarnpkg.com/@npmcli/config/-/config-10.7.1.tgz#be9617bc8d785c4e7b840f3ce7e5c2a4d28fe35c" @@ -61,6 +124,13 @@ dependencies: semver "^7.3.5" +"@npmcli/fs@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-5.0.0.tgz#674619771907342b3d1ac197aaf1deeb657e3539" + integrity sha512-7OsC1gNORBEawOa5+j2pXN9vsicaIOH5cPXxoR6fJOmH6/EXpJB2CajXOu1fPRFun2m1lktEFX11+P89hqO/og== + dependencies: + semver "^7.3.5" + "@npmcli/git@^7.0.0": version "7.0.2" resolved "https://registry.yarnpkg.com/@npmcli/git/-/git-7.0.2.tgz#680c3271fe51401c07ee41076be678851e600ff0" @@ -75,6 +145,14 @@ semver "^7.3.5" which "^6.0.0" +"@npmcli/installed-package-contents@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@npmcli/installed-package-contents/-/installed-package-contents-4.0.0.tgz#18e5070704cfe0278f9ae48038558b6efd438426" + integrity sha512-yNyAdkBxB72gtZ4GrwXCM0ZUedo9nIbOMKfGjt6Cu6DXf0p8y1PViZAKDC8q8kv/fufx0WTjRBdSlyrvnP7hmA== + dependencies: + npm-bundled "^5.0.0" + npm-normalize-package-bin "^5.0.0" + "@npmcli/map-workspaces@^5.0.0": version "5.0.3" resolved "https://registry.yarnpkg.com/@npmcli/map-workspaces/-/map-workspaces-5.0.3.tgz#5b887ec0b535a2ba64d1d338867326a2b9c041d1" @@ -85,11 +163,27 @@ glob "^13.0.0" minimatch "^10.0.3" +"@npmcli/metavuln-calculator@^9.0.2": + version "9.0.3" + resolved "https://registry.yarnpkg.com/@npmcli/metavuln-calculator/-/metavuln-calculator-9.0.3.tgz#57b330f3fb8ca34db2782ad5349ea4384bed9c96" + integrity sha512-94GLSYhLXF2t2LAC7pDwLaM4uCARzxShyAQKsirmlNcpidH89VA4/+K1LbJmRMgz5gy65E/QBBWQdUvGLe2Frg== + dependencies: + cacache "^20.0.0" + json-parse-even-better-errors "^5.0.0" + pacote "^21.0.0" + proc-log "^6.0.0" + semver "^7.3.5" + "@npmcli/name-from-folder@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@npmcli/name-from-folder/-/name-from-folder-4.0.0.tgz#b4d516ae4fab5ed4e8e8032abff3488703fc24a3" integrity sha512-qfrhVlOSqmKM8i6rkNdZzABj8MKEITGFAY+4teqBziksCQAOLutiAxM1wY2BKEd8KjUSpWmWCYxvXr0y4VTlPg== +"@npmcli/node-gyp@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@npmcli/node-gyp/-/node-gyp-5.0.0.tgz#35475a58b5d791764a7252231197a14deefe8e47" + integrity sha512-uuG5HZFXLfyFKqg8QypsmgLQW7smiRjVc45bqD/ofZZcR/uxEjgQU8qDPv0s9TEeMUiAAU/GC5bR6++UdTirIQ== + "@npmcli/package-json@^7.0.0": version "7.0.5" resolved "https://registry.yarnpkg.com/@npmcli/package-json/-/package-json-7.0.5.tgz#e29481dfc586d1625a6553799e6bec52ae0487a5" @@ -110,11 +204,80 @@ dependencies: which "^6.0.0" +"@npmcli/query@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@npmcli/query/-/query-5.0.0.tgz#c8cb9ec42c2ef149077282e948dc068ecc79ee11" + integrity sha512-8TZWfTQOsODpLqo9SVhVjHovmKXNpevHU0gO9e+y4V4fRIOneiXy0u0sMP9LmS71XivrEWfZWg50ReH4WRT4aQ== + dependencies: + postcss-selector-parser "^7.0.0" + +"@npmcli/redact@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@npmcli/redact/-/redact-4.0.0.tgz#c91121e02b7559a997614a2c1057cd7fc67608c4" + integrity sha512-gOBg5YHMfZy+TfHArfVogwgfBeQnKbbGo3pSUyK/gSI0AVu+pEiDVcKlQb0D8Mg1LNRZILZ6XG8I5dJ4KuAd9Q== + +"@npmcli/run-script@^10.0.0": + version "10.0.4" + resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-10.0.4.tgz#99cddae483ce3dbf1a10f5683a4e6aaa02345ac0" + integrity sha512-mGUWr1uMnf0le2TwfOZY4SFxZGXGfm4Jtay/nwAa2FLNAKXUoUwaGwBMNH36UHPtinWfTSJ3nqFQr0091CxVGg== + dependencies: + "@npmcli/node-gyp" "^5.0.0" + "@npmcli/package-json" "^7.0.0" + "@npmcli/promise-spawn" "^9.0.0" + node-gyp "^12.1.0" + proc-log "^6.0.0" + "@pkgjs/parseargs@^0.11.0": version "0.11.0" resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== +"@sigstore/bundle@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@sigstore/bundle/-/bundle-4.0.0.tgz#854eda43eb6a59352037e49000177c8904572f83" + integrity sha512-NwCl5Y0V6Di0NexvkTqdoVfmjTaQwoLM236r89KEojGmq/jMls8S+zb7yOwAPdXvbwfKDlP+lmXgAL4vKSQT+A== + dependencies: + "@sigstore/protobuf-specs" "^0.5.0" + +"@sigstore/core@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@sigstore/core/-/core-3.1.0.tgz#b418de73f56333ad9e369b915173d8c98e9b96d5" + integrity sha512-o5cw1QYhNQ9IroioJxpzexmPjfCe7gzafd2RY3qnMpxr4ZEja+Jad/U8sgFpaue6bOaF+z7RVkyKVV44FN+N8A== + +"@sigstore/protobuf-specs@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@sigstore/protobuf-specs/-/protobuf-specs-0.5.0.tgz#e5f029edcb3a4329853a09b603011e61043eb005" + integrity sha512-MM8XIwUjN2bwvCg1QvrMtbBmpcSHrkhFSCu1D11NyPvDQ25HEc4oG5/OcQfd/Tlf/OxmKWERDj0zGE23jQaMwA== + +"@sigstore/sign@^4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@sigstore/sign/-/sign-4.1.0.tgz#63df15a137337b29f463a1d1c51e1f7d4c1db2f1" + integrity sha512-Vx1RmLxLGnSUqx/o5/VsCjkuN5L7y+vxEEwawvc7u+6WtX2W4GNa7b9HEjmcRWohw/d6BpATXmvOwc78m+Swdg== + dependencies: + "@sigstore/bundle" "^4.0.0" + "@sigstore/core" "^3.1.0" + "@sigstore/protobuf-specs" "^0.5.0" + make-fetch-happen "^15.0.3" + proc-log "^6.1.0" + promise-retry "^2.0.1" + +"@sigstore/tuf@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@sigstore/tuf/-/tuf-4.0.1.tgz#9b080390936d79ea3b6a893b64baf3123e92d6d3" + integrity sha512-OPZBg8y5Vc9yZjmWCHrlWPMBqW5yd8+wFNl+thMdtcWz3vjVSoJQutF8YkrzI0SLGnkuFof4HSsWUhXrf219Lw== + dependencies: + "@sigstore/protobuf-specs" "^0.5.0" + tuf-js "^4.1.0" + +"@sigstore/verify@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@sigstore/verify/-/verify-3.1.0.tgz#4046d4186421db779501fe87fa5acaa5d4d21b08" + integrity sha512-mNe0Iigql08YupSOGv197YdHpPPr+EzDZmfCgMc7RPNaZTw5aLN01nBl6CHJOh3BGtnMIj83EeN4butBchc8Ag== + dependencies: + "@sigstore/bundle" "^4.0.0" + "@sigstore/core" "^3.1.0" + "@sigstore/protobuf-specs" "^0.5.0" + "@sindresorhus/is@^4.0.0": version "4.6.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" @@ -132,6 +295,19 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== +"@tufjs/canonical-json@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tufjs/canonical-json/-/canonical-json-2.0.0.tgz#a52f61a3d7374833fca945b2549bc30a2dd40d0a" + integrity sha512-yVtV8zsdo8qFHe+/3kw81dSLyF7D576A5cCFCi4X7B39tWT7SekaEFUnvnWJHz+9qO7qJTah1JbrDjWKqFtdWA== + +"@tufjs/models@4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@tufjs/models/-/models-4.1.0.tgz#494b39cf5e2f6855d80031246dd236d8086069b3" + integrity sha512-Y8cK9aggNRsqJVaKUlEYs4s7CvQ1b1ta2DVPyAimb0I2qhzjNk+A+mxvll/klL0RlfuIUei8BF7YWiua4kQqww== + dependencies: + "@tufjs/canonical-json" "2.0.0" + minimatch "^10.1.1" + "@types/cacheable-request@^6.0.1": version "6.0.3" resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.3.tgz#a430b3260466ca7b5ca5bfd735693b36e7a9d183" @@ -471,6 +647,17 @@ bin-links@^1.1.2, bin-links@^1.1.8: npm-normalize-package-bin "^1.0.0" write-file-atomic "^2.3.0" +bin-links@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/bin-links/-/bin-links-6.0.0.tgz#0245114374463a694e161a1e65417e7939ab2eba" + integrity sha512-X4CiKlcV2GjnCMwnKAfbVWpHa++65th9TuzAEYtZoATiOE2DQKhSp4CJlyLoTqdhBKlXjpXjCTYPNNFS33Fi6w== + dependencies: + cmd-shim "^8.0.0" + npm-normalize-package-bin "^5.0.0" + proc-log "^6.0.0" + read-cmd-shim "^6.0.0" + write-file-atomic "^7.0.0" + binary@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/binary/-/binary-0.3.0.tgz#9f60553bc5ce8c3386f3b553cff47462adecaa79" @@ -623,6 +810,23 @@ cacache@^18.0.0: tar "^6.1.11" unique-filename "^3.0.0" +cacache@^20.0.0, cacache@^20.0.1: + version "20.0.3" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-20.0.3.tgz#bd65205d5e6d86e02bbfaf8e4ce6008f1b81d119" + integrity sha512-3pUp4e8hv07k1QlijZu6Kn7c9+ZpWWk4j3F8N3xPuCExULobqJydKYOTj1FTq58srkJsXvO7LbGAH4C0ZU3WGw== + dependencies: + "@npmcli/fs" "^5.0.0" + fs-minipass "^3.0.0" + glob "^13.0.0" + lru-cache "^11.1.0" + minipass "^7.0.3" + minipass-collect "^2.0.1" + minipass-flush "^1.0.5" + minipass-pipeline "^1.2.4" + p-map "^7.0.2" + ssri "^13.0.0" + unique-filename "^5.0.0" + cacheable-lookup@^5.0.3: version "5.0.4" resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" @@ -711,6 +915,11 @@ chownr@^2.0.0: resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== +chownr@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-3.0.0.tgz#9855e64ecd240a9cc4267ce8a4aa5d24a1da15e4" + integrity sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g== + chromium-pickle-js@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/chromium-pickle-js/-/chromium-pickle-js-0.1.0.tgz#1d48b107d82126a2f3e211c2ea25f803ba551b21" @@ -804,6 +1013,11 @@ cmd-shim@^3.0.0, cmd-shim@^3.0.3: graceful-fs "^4.1.2" mkdirp "~0.5.0" +cmd-shim@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-8.0.0.tgz#5be238f22f40faf3f7e8c92edc3f5d354f7657b2" + integrity sha512-Jk/BK6NCapZ58BKUxlSI+ouKRbjH1NLZCgJkYoab+vEHUY3f6OzpNBN9u7HFSv9J6TRDGs4PLOHezoKGaFRSCA== + code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" @@ -863,6 +1077,11 @@ commander@^2.9.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +common-ancestor-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/common-ancestor-path/-/common-ancestor-path-2.0.0.tgz#f1d361aea9236aad5b92a0ff5b9df1422dd360ff" + integrity sha512-dnN3ibLeoRf2HNC+OlCiNc5d2zxbLJXOtiZUudNFSXZrNSydxcCsSpRzXwfu7BBWCIfHPw+xTayeBvJCP/D8Ng== + component-emitter@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" @@ -987,6 +1206,11 @@ cson-parser@^1.3.0: dependencies: coffee-script "^1.10.0" +cssesc@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" + integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== + cuint@^0.2.1: version "0.2.2" resolved "https://registry.yarnpkg.com/cuint/-/cuint-0.2.2.tgz#408086d409550c2631155619e9fa7bcadc3b991b" @@ -1052,6 +1276,13 @@ debug@^3.1.0: dependencies: ms "^2.1.1" +debug@^4.4.3: + version "4.4.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.3.tgz#c6ae432d9bd9662582fce08709b038c58e9e3d6a" + integrity sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA== + dependencies: + ms "^2.1.3" + debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" @@ -1584,6 +1815,11 @@ fast-safe-stringify@^2.1.1: resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== +fdir@^6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.5.0.tgz#ed2ab967a331ade62f18d077dae192684d50d350" + integrity sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg== + figgy-pudding@^3.4.1, figgy-pudding@^3.5.1, figgy-pudding@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e" @@ -2221,6 +2457,13 @@ iconv-lite@^0.6.2: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" +iconv-lite@^0.7.2: + version "0.7.2" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.7.2.tgz#d0bdeac3f12b4835b7359c2ad89c422a4d1cc72e" + integrity sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + ieee754@^1.1.13: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" @@ -2243,6 +2486,13 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" +ignore-walk@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-8.0.0.tgz#380c173badc3a18c57ff33440753f0052f572b14" + integrity sha512-FCeMZT4NiRQGh+YkeKMtWrOmBgWjHjMJ26WQWrRQyoyzqevdaGSakUaJW5xQYmjLlUVk2qUnCjYVBax9EKKg8A== + dependencies: + minimatch "^10.0.3" + import-lazy@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" @@ -2618,6 +2868,11 @@ json-schema@0.4.0: resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== +json-stringify-nice@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/json-stringify-nice/-/json-stringify-nice-1.1.4.tgz#2c937962b80181d3f317dd39aa323e14f5a60a67" + integrity sha512-5Z5RFW63yxReJ7vANgW6eZFGWaQvnPE3WNmZoOJrSkGju2etKA2L5rrOa1sm877TVTFt57A80BH1bArcmlLfPw== + json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" @@ -2637,7 +2892,7 @@ jsonfile@^4.0.0: optionalDependencies: graceful-fs "^4.1.6" -jsonparse@^1.2.0: +jsonparse@^1.2.0, jsonparse@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== @@ -2652,6 +2907,16 @@ jsprim@^1.2.2: json-schema "0.4.0" verror "1.10.0" +just-diff-apply@^5.2.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/just-diff-apply/-/just-diff-apply-5.5.0.tgz#771c2ca9fa69f3d2b54e7c3f5c1dfcbcc47f9f0f" + integrity sha512-OYTthRfSh55WOItVqwpefPtNt2VdKsq5AnAK6apdtR6yCH8pr0CmSr710J0Mf+WdQy7K/OzMy7K2MgAfdQURDw== + +just-diff@^6.0.0: + version "6.0.2" + resolved "https://registry.yarnpkg.com/just-diff/-/just-diff-6.0.2.tgz#03b65908543ac0521caf6d8eb85035f7d27ea285" + integrity sha512-S59eriX5u3/QhMNq3v/gm8Kd0w8OS6Tz2FS1NG4blv+z0MuQcBRJyFWjdovM0Rad4/P4aUPFtnkNjMjyMlMSYA== + keytar@^7.7.0: version "7.9.0" resolved "https://registry.yarnpkg.com/keytar/-/keytar-7.9.0.tgz#4c6225708f51b50cbf77c5aae81721964c2918cb" @@ -2962,6 +3227,23 @@ make-fetch-happen@^13.0.0: promise-retry "^2.0.1" ssri "^10.0.0" +make-fetch-happen@^15.0.0, make-fetch-happen@^15.0.1, make-fetch-happen@^15.0.3: + version "15.0.4" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-15.0.4.tgz#6ff007b6d5f7b75c4cc26ec2d4adbfe05d6c0921" + integrity sha512-vM2sG+wbVeVGYcCm16mM3d5fuem9oC28n436HjsGO3LcxoTI8LNVa4rwZDn3f76+cWyT4GGJDxjTYU1I2nr6zw== + dependencies: + "@gar/promise-retry" "^1.0.0" + "@npmcli/agent" "^4.0.0" + cacache "^20.0.1" + http-cache-semantics "^4.1.1" + minipass "^7.0.2" + minipass-fetch "^5.0.0" + minipass-flush "^1.0.5" + minipass-pipeline "^1.2.4" + negotiator "^1.0.0" + proc-log "^6.0.0" + ssri "^13.0.0" + make-fetch-happen@^5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz#aa8387104f2687edca01c8687ee45013d02d19bd" @@ -3038,7 +3320,7 @@ mimic-response@^3.1.0: dependencies: brace-expansion "^1.1.7" -minimatch@^10.0.3, minimatch@^10.2.2: +minimatch@^10.0.3, minimatch@^10.1.1, minimatch@^10.2.2: version "10.2.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.2.4.tgz#465b3accbd0218b8281f5301e27cedc697f96fde" integrity sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg== @@ -3082,6 +3364,17 @@ minipass-fetch@^3.0.0: optionalDependencies: encoding "^0.1.13" +minipass-fetch@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-5.0.2.tgz#3973a605ddfd8abb865e50d6fc634853c8239729" + integrity sha512-2d0q2a8eCi2IRg/IGubCNRJoYbA1+YPXAzQVRFmB45gdGZafyivnZ5YSEfo3JikbjGxOdntGFvBQGqaSMXlAFQ== + dependencies: + minipass "^7.0.3" + minipass-sized "^2.0.0" + minizlib "^3.0.1" + optionalDependencies: + iconv-lite "^0.7.2" + minipass-flush@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/minipass-flush/-/minipass-flush-1.0.5.tgz#82e7135d7e89a50ffe64610a787953c4c4cbb373" @@ -3103,6 +3396,13 @@ minipass-sized@^1.0.3: dependencies: minipass "^3.0.0" +minipass-sized@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/minipass-sized/-/minipass-sized-2.0.0.tgz#2228ee97e3f74f6b22ba6d1319addb7621534306" + integrity sha512-zSsHhto5BcUVM2m1LurnXY6M//cGhVaegT71OfOXoprxT6o780GZd792ea6FfrQkuU4usHZIUczAQMRUE2plzA== + dependencies: + minipass "^7.1.2" + minipass@^2.3.5: version "2.9.0" resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" @@ -3133,7 +3433,7 @@ minipass@^5.0.0: resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== -minipass@^7.1.3: +minipass@^7.0.4, minipass@^7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.3.tgz#79389b4eb1bb2d003a9bba87d492f2bd37bdc65b" integrity sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A== @@ -3146,6 +3446,13 @@ minizlib@^2.1.1, minizlib@^2.1.2: minipass "^3.0.0" yallist "^4.0.0" +minizlib@^3.0.1, minizlib@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-3.1.0.tgz#6ad76c3a8f10227c9b51d1c9ac8e30b27f5a251c" + integrity sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw== + dependencies: + minipass "^7.1.2" + mississippi@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" @@ -3220,7 +3527,7 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@2.1.3, ms@^2.0.0, ms@^2.1.1: +ms@2.1.3, ms@^2.0.0, ms@^2.1.1, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -3264,6 +3571,11 @@ negotiator@0.6.3, negotiator@^0.6.3: resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== +negotiator@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-1.0.0.tgz#b6c91bb47172d69f93cfd7c357bbb529019b5f6a" + integrity sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg== + netmask@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/netmask/-/netmask-2.0.2.tgz#8b01a07644065d536383835823bc52004ebac5e7" @@ -3311,6 +3623,22 @@ node-gyp@^10.2.0, "node-gyp@https://github.com/nodejs/node-gyp/archive/d3615c66f tar "^6.2.1" which "^4.0.0" +node-gyp@^12.1.0: + version "12.2.0" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-12.2.0.tgz#ff73f6f509e33d8b7e768f889ffc9738ad117b07" + integrity sha512-q23WdzrQv48KozXlr0U1v9dwO/k59NHeSzn6loGcasyf0UnSrtzs8kRxM+mfwJSf0DkX0s43hcqgnSO4/VNthQ== + dependencies: + env-paths "^2.2.0" + exponential-backoff "^3.1.1" + graceful-fs "^4.2.6" + make-fetch-happen "^15.0.0" + nopt "^9.0.0" + proc-log "^6.0.0" + semver "^7.3.5" + tar "^7.5.4" + tinyglobby "^0.2.12" + which "^6.0.0" + nopt@^3.0.1: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -3377,6 +3705,13 @@ npm-bundled@^1.0.1: dependencies: npm-normalize-package-bin "^1.0.1" +npm-bundled@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-5.0.0.tgz#5025d847cfd06c7b8d9432df01695d0133d9ee80" + integrity sha512-JLSpbzh6UUXIEoqPsYBvVNVmyrjVZ1fzEFbqxKkTJQkWBO3xFzFT+KDnSKQWwOQNbuWRwt5LSD6HOTLGIWzfrw== + dependencies: + npm-normalize-package-bin "^5.0.0" + npm-cache-filename@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/npm-cache-filename/-/npm-cache-filename-1.0.2.tgz#ded306c5b0bfc870a9e9faf823bc5f283e05ae11" @@ -3453,6 +3788,14 @@ npm-packlist@^1.1.12, npm-packlist@^1.4.8: npm-bundled "^1.0.1" npm-normalize-package-bin "^1.0.1" +npm-packlist@^10.0.1: + version "10.0.4" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-10.0.4.tgz#aa2e0e4daf910eae8c5745c2645cf8bb8813de01" + integrity sha512-uMW73iajD8hiH4ZBxEV3HC+eTnppIqwakjOYuvgddnalIw2lJguKviK1pcUJDlIWm1wSJkchpDZDSVVsZEYRng== + dependencies: + ignore-walk "^8.0.0" + proc-log "^6.0.0" + npm-pick-manifest@^11.0.1: version "11.0.3" resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-11.0.3.tgz#76cf6593a351849006c36b38a7326798e2a76d13" @@ -3481,6 +3824,20 @@ npm-profile@^4.0.2, npm-profile@^4.0.4: figgy-pudding "^3.4.1" npm-registry-fetch "^4.0.0" +npm-registry-fetch@^19.0.0: + version "19.1.1" + resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-19.1.1.tgz#51e96d21f409a9bc4f96af218a8603e884459024" + integrity sha512-TakBap6OM1w0H73VZVDf44iFXsOS3h+L4wVMXmbWOQroZgFhMch0juN6XSzBNlD965yIKvWg2dfu7NSiaYLxtw== + dependencies: + "@npmcli/redact" "^4.0.0" + jsonparse "^1.3.1" + make-fetch-happen "^15.0.0" + minipass "^7.0.2" + minipass-fetch "^5.0.0" + minizlib "^3.0.1" + npm-package-arg "^13.0.0" + proc-log "^6.0.0" + npm-registry-fetch@^4.0.0, npm-registry-fetch@^4.0.7: version "4.0.7" resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-4.0.7.tgz#57951bf6541e0246b34c9f9a38ab73607c9449d7" @@ -3781,6 +4138,11 @@ p-map@^4.0.0: dependencies: aggregate-error "^3.0.0" +p-map@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-7.0.4.tgz#b81814255f542e252d5729dca4d66e5ec14935b8" + integrity sha512-tkAQEw8ysMzmkhgw8k+1U/iPhWNhykKnSk4Rd5zLoPJCuJaGRPo6YposrZgaxHKzDHdDWWZvE/Sk7hsL2X/CpQ== + p-try@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" @@ -3825,6 +4187,29 @@ package-json@^4.0.0: registry-url "^3.0.3" semver "^5.1.0" +pacote@^21.0.0, pacote@^21.0.2: + version "21.5.0" + resolved "https://registry.yarnpkg.com/pacote/-/pacote-21.5.0.tgz#475fe00db73585dec296590bec484109522e9e6f" + integrity sha512-VtZ0SB8mb5Tzw3dXDfVAIjhyVKUHZkS/ZH9/5mpKenwC9sFOXNI0JI7kEF7IMkwOnsWMFrvAZHzx1T5fmrp9FQ== + dependencies: + "@gar/promise-retry" "^1.0.0" + "@npmcli/git" "^7.0.0" + "@npmcli/installed-package-contents" "^4.0.0" + "@npmcli/package-json" "^7.0.0" + "@npmcli/promise-spawn" "^9.0.0" + "@npmcli/run-script" "^10.0.0" + cacache "^20.0.0" + fs-minipass "^3.0.0" + minipass "^7.0.2" + npm-package-arg "^13.0.0" + npm-packlist "^10.0.1" + npm-pick-manifest "^11.0.1" + npm-registry-fetch "^19.0.0" + proc-log "^6.0.0" + sigstore "^4.0.0" + ssri "^13.0.0" + tar "^7.4.3" + pacote@^9.1.0, pacote@^9.5.12, pacote@^9.5.3: version "9.5.12" resolved "https://registry.yarnpkg.com/pacote/-/pacote-9.5.12.tgz#1e11dd7a8d736bcc36b375a9804d41bb0377bf66" @@ -3870,6 +4255,15 @@ parallel-transform@^1.1.0: inherits "^2.0.3" readable-stream "^2.1.5" +parse-conflict-json@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/parse-conflict-json/-/parse-conflict-json-5.0.1.tgz#db4acd7472fb400c9808eb86611c2ff72f4c84ba" + integrity sha512-ZHEmNKMq1wyJXNwLxyHnluPfRAFSIliBvbK/UiOceROt4Xh9Pz0fq49NytIaeaCUf5VR86hwQ/34FCcNU5/LKQ== + dependencies: + json-parse-even-better-errors "^5.0.0" + just-diff "^6.0.0" + just-diff-apply "^5.2.0" + parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -3939,6 +4333,11 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== +picomatch@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.3.tgz#796c76136d1eead715db1e7bad785dedd695a042" + integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q== + pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" @@ -3953,6 +4352,14 @@ plist@3: base64-js "^1.5.1" xmlbuilder "^15.1.1" +postcss-selector-parser@^7.0.0: + version "7.1.1" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-7.1.1.tgz#e75d2e0d843f620e5df69076166f4e16f891cb9f" + integrity sha512-orRsuYpJVw8LdAwqqLykBj9ecS5/cRHlI5+nvTo8LcCKmzDmqVORXtOIYEEQuL9D4BxtA1lm5isAqzQZCoQ6Eg== + dependencies: + cssesc "^3.0.0" + util-deprecate "^1.0.2" + prebuild-install@^7.0.1: version "7.1.1" resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.1.1.tgz#de97d5b34a70a0c81334fd24641f2a1702352e45" @@ -3981,7 +4388,7 @@ proc-log@^4.1.0, proc-log@^4.2.0: resolved "https://registry.yarnpkg.com/proc-log/-/proc-log-4.2.0.tgz#b6f461e4026e75fdfe228b265e9f7a00779d7034" integrity sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA== -proc-log@^6.0.0: +proc-log@^6.0.0, proc-log@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/proc-log/-/proc-log-6.1.0.tgz#18519482a37d5198e231133a70144a50f21f0215" integrity sha512-iG+GYldRf2BQ0UDUAd6JQ/RwzaQy6mXmsk/IzlYyal4A4SNFw54MeH4/tLkF4I5WoWG9SQwuqWzS99jaFQHBuQ== @@ -3991,6 +4398,21 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== +proggy@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/proggy/-/proggy-4.0.0.tgz#85fa89d7c81bc3fb77992a80f47bb1e17c610fa3" + integrity sha512-MbA4R+WQT76ZBm/5JUpV9yqcJt92175+Y0Bodg3HgiXzrmKu7Ggq+bpn6y6wHH+gN9NcyKn3yg1+d47VaKwNAQ== + +promise-all-reject-late@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/promise-all-reject-late/-/promise-all-reject-late-1.0.1.tgz#f8ebf13483e5ca91ad809ccc2fcf25f26f8643c2" + integrity sha512-vuf0Lf0lOxyQREH7GDIOUMLS7kz+gs8i6B+Yi8dC68a2sychGrHTJYghMBD6k7eUcH0H5P73EckCA48xijWqXw== + +promise-call-limit@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/promise-call-limit/-/promise-call-limit-3.0.2.tgz#524b7f4b97729ff70417d93d24f46f0265efa4f9" + integrity sha512-mRPQO2T1QQVw11E7+UdCJu7S61eJVWknzml9sC1heAdj1jxl0fWMBypIt9ZOcLFf8FkG995ZD7RnVk7HH72fZw== + promise-inflight@^1.0.1, promise-inflight@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" @@ -4192,6 +4614,11 @@ read-cmd-shim@^1.0.1, read-cmd-shim@^1.0.5: dependencies: graceful-fs "^4.1.2" +read-cmd-shim@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-6.0.0.tgz#98f5c8566e535829f1f8afb1595aaf05fd0f3970" + integrity sha512-1zM5HuOfagXCBWMN83fuFI/x+T/UhZ7k+KIzhrHXcQoeX5+7gmaDYjELQHmmzIodumBHeByBJT4QYS7ufAgs7A== + read-installed@~4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/read-installed/-/read-installed-4.0.3.tgz#ff9b8b67f187d1e4c29b9feb31f6b223acd19067" @@ -4474,7 +4901,7 @@ semver-diff@^2.0.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@^7.1.1, semver@^7.5.3: +semver@^7.1.1, semver@^7.3.7, semver@^7.5.3: version "7.7.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.4.tgz#28464e36060e991fa7a11d0279d2d3f3b57a7e8a" integrity sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA== @@ -4605,6 +5032,18 @@ signal-exit@^4.0.1: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.0.2.tgz#ff55bb1d9ff2114c13b400688fa544ac63c36967" integrity sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q== +sigstore@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/sigstore/-/sigstore-4.1.0.tgz#d34b92a544a05e003a2430209d26d8dfafd805a0" + integrity sha512-/fUgUhYghuLzVT/gaJoeVehLCgZiUxPCPMcyVNY0lIf/cTCz58K/WTI7PefDarXxp9nUKpEwg1yyz3eSBMTtgA== + dependencies: + "@sigstore/bundle" "^4.0.0" + "@sigstore/core" "^3.1.0" + "@sigstore/protobuf-specs" "^0.5.0" + "@sigstore/sign" "^4.1.0" + "@sigstore/tuf" "^4.0.1" + "@sigstore/verify" "^3.1.0" + simple-concat@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" @@ -4763,6 +5202,13 @@ ssri@^10.0.0: dependencies: minipass "^5.0.0" +ssri@^13.0.0: + version "13.0.1" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-13.0.1.tgz#2d8946614d33f4d0c84946bb370dce7a9379fd18" + integrity sha512-QUiRf1+u9wPTL/76GTYlKttDEBWV1ga9ZXW8BG6kfdeyyM8LGPix9gROyg9V2+P0xNyF3X2Go526xKFdMZrHSQ== + dependencies: + minipass "^7.0.3" + ssri@^6.0.0, ssri@^6.0.1, ssri@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.2.tgz#157939134f20464e7301ddba3e90ffa8f7728ac5" @@ -5003,6 +5449,17 @@ tar@^4.4.10, tar@^4.4.19, tar@^6.0.5, tar@^6.1.11, tar@^6.1.2, tar@^6.2.1: mkdirp "^1.0.3" yallist "^4.0.0" +tar@^7.4.3, tar@^7.5.4: + version "7.5.11" + resolved "https://registry.yarnpkg.com/tar/-/tar-7.5.11.tgz#1250fae45d98806b36d703b30973fa8e0a6d8868" + integrity sha512-ChjMH33/KetonMTAtpYdgUFr0tbz69Fp2v7zWxQfYZX4g5ZN2nOBXm1R2xyA+lMIKrLKIoKAwFj93jE/avX9cQ== + dependencies: + "@isaacs/fs-minipass" "^4.0.0" + chownr "^3.0.0" + minipass "^7.1.2" + minizlib "^3.1.0" + yallist "^5.0.0" + temp@^0.9.4: version "0.9.4" resolved "https://registry.yarnpkg.com/temp/-/temp-0.9.4.tgz#cd20a8580cb63635d0e4e9d4bd989d44286e7620" @@ -5041,6 +5498,14 @@ tiny-relative-date@^1.3.0: resolved "https://registry.yarnpkg.com/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07" integrity sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A== +tinyglobby@^0.2.12: + version "0.2.15" + resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.15.tgz#e228dd1e638cea993d2fdb4fcd2d4602a79951c2" + integrity sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ== + dependencies: + fdir "^6.5.0" + picomatch "^4.0.3" + tmp@0.0.28: version "0.0.28" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.28.tgz#172735b7f614ea7af39664fa84cf0de4e515d120" @@ -5073,11 +5538,25 @@ tough-cookie@~2.5.0: resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9" integrity sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ== +treeverse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/treeverse/-/treeverse-3.0.0.tgz#dd82de9eb602115c6ebd77a574aae67003cb48c8" + integrity sha512-gcANaAnd2QDZFmHFEOF4k7uc1J/6a6z3DJMd/QwEyxLoKGiptJRwid582r7QIsFlFMIZ3SnxfS52S4hm2DHkuQ== + tslib@^2.0.1: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== +tuf-js@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/tuf-js/-/tuf-js-4.1.0.tgz#ae4ef9afa456fcb4af103dc50a43bc031f066603" + integrity sha512-50QV99kCKH5P/Vs4E2Gzp7BopNV+KzTXqWeaxrfu5IQJBOULRsTIS9seSsOVT8ZnGXzCyx55nYWAi4qJzpZKEQ== + dependencies: + "@tufjs/models" "4.1.0" + debug "^4.4.3" + make-fetch-happen "^15.0.1" + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -5171,6 +5650,13 @@ unique-filename@^3.0.0: dependencies: unique-slug "^4.0.0" +unique-filename@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-5.0.0.tgz#8b17bbde1a7ca322dd1a1d23fe17c2b798c43f8f" + integrity sha512-2RaJTAvAb4owyjllTfXzFClJ7WsGxlykkPvCr9pA//LD9goVq+m4PPAeBgNodGZ7nSrntT/auWpJ6Y5IFXcfjg== + dependencies: + unique-slug "^6.0.0" + unique-slug@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.2.tgz#baabce91083fc64e945b0f3ad613e264f7cd4e6c" @@ -5185,6 +5671,13 @@ unique-slug@^4.0.0: dependencies: imurmurhash "^0.1.4" +unique-slug@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-6.0.0.tgz#f46fd688a9bd972fd356c23d95812a3a4862ed88" + integrity sha512-4Lup7Ezn8W3d52/xBhZBVdx323ckxa7DEvd9kPQHppTkLoJXw6ltrBCyj5pnrxj0qKDxYMJ56CoxNuFCscdTiw== + dependencies: + imurmurhash "^0.1.4" + unique-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" @@ -5225,7 +5718,7 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -util-deprecate@^1.0.1, util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== @@ -5445,6 +5938,13 @@ write-file-atomic@^2.0.0, write-file-atomic@^2.3.0, write-file-atomic@^2.4.3: imurmurhash "^0.1.4" signal-exit "^3.0.2" +write-file-atomic@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-7.0.1.tgz#0e2a450ab5aa306bcfcd3aed61833b10cc4fb885" + integrity sha512-OTIk8iR8/aCRWBqvxrzxR0hgxWpnYBblY1S5hDWBQfk/VFmJwzmJgQFN3WsoUKHISv2eAwe+PpbUzyL1CKTLXg== + dependencies: + signal-exit "^4.0.1" + xdg-basedir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" @@ -5490,6 +5990,11 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yallist@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-5.0.0.tgz#00e2de443639ed0d78fd87de0d27469fbcffb533" + integrity sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw== + yargs-parser@^15.0.1: version "15.0.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-15.0.3.tgz#316e263d5febe8b38eef61ac092b33dfcc9b1115" From 5511bb7e5b0600f972a16b241daa086c8b3119f7 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sat, 14 Mar 2026 17:14:20 -0700 Subject: [PATCH 15/24] Migrate `clean.js` to Arborist; Add logging utility for Arborist --- package.json | 1 + src/clean.js | 31 ++++++++++++----- src/command.js | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 7397da7d..dfc6fdf6 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "superagent-proxy": "^3.0.0", "tar": "^6.0.5", "temp": "^0.9.4", + "treeverse": "^3.0.0", "underscore-plus": "1.x", "wordwrap": "1.0.0", "wrench": "~1.5.1", diff --git a/src/clean.js b/src/clean.js index 8a5fca7d..b4f18f64 100644 --- a/src/clean.js +++ b/src/clean.js @@ -1,6 +1,6 @@ - +const { performance } = require("node:perf_hooks"); const yargs = require('yargs'); - +const Arborist = require("@npmcli/arborist"); const Command = require('./command'); module.exports = @@ -9,7 +9,6 @@ class Clean extends Command { constructor() { super(); - this.atomNpmPath = require.resolve('npm/bin/npm-cli'); } parseOptions(argv) { @@ -26,11 +25,25 @@ as a dependency in the package.json file.\ } run(_options) { - process.stdout.write("Removing extraneous modules "); - return new Promise((resolve, reject) => - void this.fork(this.atomNpmPath, ['prune'], (...args) => - void this.logCommandResults(...args).then(resolve, reject) - ) - ); + process.stdout.write("Removing extraneous modules\n"); + + // Process here is modeled after the NPM CLI v11.11.1 + // https://github.com/npm/cli/blob/v11.11.1/lib/commands/prune.js + const started = performance.now(); + const arb = new Arborist({ + registry: process.env.npm_config_registry ?? "https://registry.npmjs.org" + }); + return new Promise(async (resolve, reject) => { + try { + await arb.prune(); + this.logArboristResults(arb, started); + this.logSuccess(); + resolve(); + } catch(err) { + console.error(err); + this.logFailure(); + reject(err); + } + }); } }; diff --git a/src/command.js b/src/command.js index 68c19e6f..6c2ebb0b 100644 --- a/src/command.js +++ b/src/command.js @@ -1,7 +1,9 @@ const child_process = require('child_process'); +const { performance } = require("node:perf_hooks"); const path = require('path'); const semver = require('semver'); +const { depth } = require("treeverse"); const config = require('./apm'); const git = require('./git'); @@ -88,6 +90,97 @@ class Command { } } + logArboristResults(arb, startTime) { + // Logging of Arborist data modeled after NPM v11.11.1 + // https://github.com/npm/cli/blob/v11.11.1/lib/utils/reify-output.js + const { diff, actualTree } = arb; + + const summary = { + add: [], + added: 0, + change: [], + changed: 0, + remove: [], + removed: 0 + }; + + if (diff) { + depth({ + tree: diff, + visit: d => { + switch(d.action) { + case "REMOVE": + summary.removed++; + summary.remove.push({ + name: d.actual.name, + version: d.actual.package.version, + path: d.actual.path + }); + break; + case "ADD": + if (actualTree.inventory.has(d.ideal)) { + summary.added++; + summary.add.push({ + name: d.ideal.name, + version: d.ideal.package.version, + path: d.ideal.path + }); + } + break; + case "CHANGE": + summary.changed++; + summary.change.push({ + from: { + name: d.actual.name, + version: d.actual.package.version, + path: d.actual.path + }, + to: { + name: d.ideal.name, + version: d.ideal.package.version, + path: d.ideal.path + } + }); + break; + default: + return; + } + }, + getChildren: d => d.children + }) + } + + // Print out the message + const msg = ["\n"]; + if (summary.added === 0 && summary.removed === 0 && summary.changed === 0) { + msg.push("up to date"); + } else { + if (summary.added) { + msg.push(`added ${summary.added} package${summary.added === 1 ? "" : "s"}`); + } + + if (summary.removed) { + if (summary.added) { + msg.push(", "); + } + msg.push(`removed ${summary.removed} package${summary.removed === 1 ? "" : "s"}`); + } + + if (summary.changed) { + if (summary.added || summary.removed) { + msg.push(", "); + } + msg.push(`changed ${summary.changed} package${summary.changed === 1 ? "" : "s"}`); + } + } + + if (startTime) { + msg.push(` in ${(performance.now() - startTime).toFixed(2)}ms`); + } + + console.log(msg.join("")); + } + normalizeVersion(version) { if (typeof version === 'string') { // Remove commit SHA suffix From 76517994f011b3f52be658a4a3adfbff98186546 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sat, 14 Mar 2026 19:55:33 -0700 Subject: [PATCH 16/24] Migrate `request.js` to `apm.getNpmConfig()` --- src/request.js | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/request.js b/src/request.js index c9f1dd88..336f72b7 100644 --- a/src/request.js +++ b/src/request.js @@ -1,5 +1,4 @@ -const npm = require("npm"); const superagent = require("superagent"); require("superagent-proxy")(superagent); @@ -10,23 +9,13 @@ const config = require("./apm.js"); // So we have to specifically say these are valid, or otherwise redo a lot of our logic const OK_STATUS_CODES = [200, 201, 204, 404]; -function loadNpm() { - const npmOptions = { - userconfig: config.getUserConfigPath(), - globalconfig: config.getGlobalConfigPath() - }; - return new Promise((resolve, reject) => - void npm.load(npmOptions, (error, value) => void(error != null ? reject(error) : resolve(value))) - ); -}; - async function configureRequest(requestOptions){ - await loadNpm(); - requestOptions.proxy ??= npm.config.get("https-proxy") ?? npm.config.get("proxy") ?? process.env.HTTPS_PROXY ?? process.env.HTTP_PROXY; - requestOptions.strictSSL ??= npm.config.get("strict-ssl") ?? true; + const npmConf = await config.getNpmConfig(); + requestOptions.proxy ??= npmConf.get("https-proxy") ?? npmConf.get("proxy") ?? process.env.HTTPS_PROXY ?? process.env.HTTP_PROXY; + requestOptions.strictSSL ??= npmConf.get("strict-ssl") ?? true; requestOptions.headers ??= {}; - requestOptions.headers["User-Agent"] ??= npm.config.get("user-agent") ?? `PulsarPpm/${require("../package.json").version}`; + requestOptions.headers["User-Agent"] ??= npmConf.get("user-agent") ?? `PulsarPpm/${require("../package.json").version}`; if (requestOptions.json) { requestOptions.headers["Accept"] = "application/json"; From 453137e325c438df6ca646f1ec3efd1946f8d261 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sat, 14 Mar 2026 22:26:20 -0700 Subject: [PATCH 17/24] Migrate `dedupe.js` to Arborist In doing so, I've removed support for defining a package name in the command. It now does what it says on the tin of just deduping the current directory. --- src/dedupe.js | 55 ++++++++++++++++++++------------------------------- 1 file changed, 21 insertions(+), 34 deletions(-) diff --git a/src/dedupe.js b/src/dedupe.js index 3670f74d..4e63366f 100644 --- a/src/dedupe.js +++ b/src/dedupe.js @@ -1,8 +1,7 @@ - +const { performance } = require("node:perf_hooks"); const path = require('path'); - +const Arborist = require("@npmcli/arborist"); const yargs = require('yargs'); - const config = require('./apm'); const Command = require('./command'); const fs = require('./fs'); @@ -14,16 +13,14 @@ class Dedupe extends Command { constructor() { super(); this.atomDirectory = config.getAtomDirectory(); - this.atomPackagesDirectory = path.join(this.atomDirectory, 'packages'); this.atomNodeDirectory = path.join(this.atomDirectory, '.node-gyp'); - this.atomNpmPath = require.resolve('npm/bin/npm-cli'); } parseOptions(argv) { const options = yargs(argv).wrap(Math.min(100, yargs.terminalWidth())); options.usage(`\ -Usage: ppm dedupe [...] +Usage: ppm dedupe Reduce duplication in the node_modules folder in the current directory. @@ -33,42 +30,32 @@ This command is experimental.\ return options.alias('h', 'help').describe('help', 'Print this usage message'); } - dedupeModules(options) { + async dedupeModules(options) { process.stdout.write('Deduping modules '); - return new Promise((resolve, reject) => { - this.forkDedupeCommand(options, (...args) => { - this.logCommandResults(...args).then(resolve, reject); - }); + // Process here is modeled after the NPM CLI v11.11.1 + // https://github.com/npm/cli/blob/v11.11.1/lib/commands/dedupe.js + const started = performance.now(); + const arb = new Arborist({ + registry: process.env.npm_config_registry ?? "https://registry.npmjs.org", + save: false }); - } - forkDedupeCommand(options, callback) { - const dedupeArgs = ['--globalconfig', config.getGlobalConfigPath(), '--userconfig', config.getUserConfigPath(), 'dedupe']; - dedupeArgs.push(...this.getNpmBuildFlags()); - if (options.argv.silent) { dedupeArgs.push('--silent'); } - if (options.argv.quiet) { dedupeArgs.push('--quiet'); } - - for (let packageName of Array.from(options.argv._)) { dedupeArgs.push(packageName); } - - fs.makeTreeSync(this.atomDirectory); - - const env = { - ...process.env, - HOME: this.atomNodeDirectory, - RUSTUP_HOME: config.getRustupHomeDirPath() - }; - this.addBuildEnvVars(env); - - const dedupeOptions = {env}; - if (options.cwd) { dedupeOptions.cwd = options.cwd; } - - return this.fork(this.atomNpmPath, dedupeArgs, dedupeOptions, callback); + try { + await arb.dedupe(); + this.logArboristResults(arb, started); + this.logSuccess(); + return; + } catch(err) { + console.error(err); + this.logFailure(); + throw err; + } } createAtomDirectories() { fs.makeTreeSync(this.atomDirectory); - return fs.makeTreeSync(this.atomNodeDirectory); + fs.makeTreeSync(this.atomNodeDirectory); } async run(options) { From cb4234dfbf3c840a4bb542d72270b7a3f4a123ee Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sun, 15 Mar 2026 01:21:32 -0700 Subject: [PATCH 18/24] Get `ci.js` ALMOST working --- package.json | 1 + src/ci.js | 113 ++++++++++++++++++++++++++++++++++++++------------- yarn.lock | 2 +- 3 files changed, 86 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index dfc6fdf6..c88c03b3 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "dependencies": { "@npmcli/arborist": "^9.4.1", "@npmcli/config": "^10.7.1", + "@npmcli/run-script": "^10.0.4", "asar-require": "0.3.0", "async": "^3.2.0", "colors": "~1.4.0", diff --git a/src/ci.js b/src/ci.js index 22631817..15ef278d 100644 --- a/src/ci.js +++ b/src/ci.js @@ -1,8 +1,9 @@ - +const { performance } = require("node:perf_hooks"); const path = require('path'); const fs = require('./fs'); const yargs = require('yargs'); - +const Arborist = require("@npmcli/arborist"); +const runScript = require("@npmcli/run-script"); const config = require('./apm'); const Command = require('./command'); @@ -14,7 +15,6 @@ class Ci extends Command { super(); this.atomDirectory = config.getAtomDirectory(); this.atomNodeDirectory = path.join(this.atomDirectory, '.node-gyp'); - this.atomNpmPath = require.resolve('npm/bin/npm-cli'); } parseOptions(argv) { @@ -35,45 +35,100 @@ but cannot be used to install new packages or dependencies.\ return options.boolean('verbose').default('verbose', false).describe('verbose', 'Show verbose debug information'); } - installModules(options) { - process.stdout.write('Installing locked modules'); - if (options.argv.verbose) { - process.stdout.write('\n'); - } else { - process.stdout.write(' '); - } + async installModules(options) { + process.stdout.write('Installing locked modules\n'); - const installArgs = [ - 'ci', - '--globalconfig', config.getGlobalConfigPath(), - '--userconfig', config.getUserConfigPath(), - ...this.getNpmBuildFlags() - ]; - if (options.argv.verbose) { installArgs.push('--verbose'); } + // Process here is modeled after the NPM CLI v11.11.1 + // https://github.com/npm/cli/blob/v11.11.1/lib/commands/ci.js fs.makeTreeSync(this.atomDirectory); - const env = { - ...process.env, - HOME: this.atomNodeDirectory, - RUSTUP_HOME: config.getRustupHomeDirPath() + const started = performance.now(); + const arbOpts = { + registry: process.env.npm_config_registry ?? "https://registry.npmjs.org", + save: false, // ppm ci should never modify the lockfile or package.json + packageLock: true, // ppm ci should never skip lock files + cache: config.getCacheDirectory(), + path: process.cwd(), + // TODO: Options that `npm ci` doesn't use, but I needed to make specs happy + legacyPeerDeps: true, + packageLockOnly: true, + preferFrozenLockfile: true }; - this.addBuildEnvVars(env); - const installOptions = {env, streaming: options.argv.verbose}; + // Generate an inventory from the virtual tree in the lockfile + const virtualArb = new Arborist(arbOpts); + try { + await virtualArb.loadVirtual(); + } catch(err) { + console.error(err); + throw "ppm ci requires an existing lockfile. Please generate on then try again."; + } + const virtualInventory = new Map(virtualArb.virtualTree.inventory); + + const arb = new Arborist(arbOpts); + await arb.buildIdealTree(); + + //const errors = this.validateLockfile(virtualInventory, arb.idealTree.inventory); + const errors = []; // TODO: Why doesn't `arb.buildIdealTree` have an inventory with versions??? + if (errors.length > 0) { + console.error(errors.join("\n")); + throw "ppm ci can only install packages when your package.json and lockfile are in sync."; + } + + // NPM CI now deletes all node_modules, it seems to be a performance trick, + // Lets skip it and see if it's something we need. + + await arb.reify(arbOpts); + + // Run the same set of scripts that `ppm install` runs + const scripts = [ + "preinstall", + "install", + "postinstall", + "preprepare", + "prepare", + "postprepare" + ]; + const scriptShell = await config.getSetting("script-shell") || undefined; + for (const event of scripts) { + await runScript({ + path: process.cwd(), + args: [], + scriptShell, + stdio: "inherit", + event + }); + } + + this.logArboristResults(arb, started); + this.logSuccess(); + } + + validateLockfile(virtualTree, idealTree) { + const errors = []; + + for (const [key, entry] of idealTree.entries()) { + const lock = virtualTree.get(key); + + if (!lock) { + errors.push(`Missing: ${entry.name}@${entry.version} from lock file`); + continue; + } + + if (entry.version !== lock.version) { + console.log(entry); + errors.push(`Invalid: lock file's ${lock.name}@${lock.version} does not satisfy ${entry.name}@${entry.version}`); + } + } - return new Promise((resolve, reject) => - void this.fork(this.atomNpmPath, installArgs, installOptions, (...args) => - void this.logCommandResults(...args).then(resolve, reject) - ) - ) + return errors; } async run(options) { const opts = this.parseOptions(options.commandArgs); try { - this.npm = await config.loadNpm(); await this.loadInstalledAtomMetadata(); await this.installModules(opts); } catch(err) { diff --git a/yarn.lock b/yarn.lock index d0353f12..4d444388 100644 --- a/yarn.lock +++ b/yarn.lock @@ -216,7 +216,7 @@ resolved "https://registry.yarnpkg.com/@npmcli/redact/-/redact-4.0.0.tgz#c91121e02b7559a997614a2c1057cd7fc67608c4" integrity sha512-gOBg5YHMfZy+TfHArfVogwgfBeQnKbbGo3pSUyK/gSI0AVu+pEiDVcKlQb0D8Mg1LNRZILZ6XG8I5dJ4KuAd9Q== -"@npmcli/run-script@^10.0.0": +"@npmcli/run-script@^10.0.0", "@npmcli/run-script@^10.0.4": version "10.0.4" resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-10.0.4.tgz#99cddae483ce3dbf1a10f5683a4e6aaa02345ac0" integrity sha512-mGUWr1uMnf0le2TwfOZY4SFxZGXGfm4Jtay/nwAa2FLNAKXUoUwaGwBMNH36UHPtinWfTSJ3nqFQr0091CxVGg== From d919504a879971f8754cbfd2f4a492d6b1c60808 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sun, 15 Mar 2026 13:15:45 -0700 Subject: [PATCH 19/24] Revert "Get `ci.js` ALMOST working" This reverts commit cb4234dfbf3c840a4bb542d72270b7a3f4a123ee. --- package.json | 1 - src/ci.js | 113 +++++++++++++-------------------------------------- yarn.lock | 2 +- 3 files changed, 30 insertions(+), 86 deletions(-) diff --git a/package.json b/package.json index c88c03b3..dfc6fdf6 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "dependencies": { "@npmcli/arborist": "^9.4.1", "@npmcli/config": "^10.7.1", - "@npmcli/run-script": "^10.0.4", "asar-require": "0.3.0", "async": "^3.2.0", "colors": "~1.4.0", diff --git a/src/ci.js b/src/ci.js index 15ef278d..22631817 100644 --- a/src/ci.js +++ b/src/ci.js @@ -1,9 +1,8 @@ -const { performance } = require("node:perf_hooks"); + const path = require('path'); const fs = require('./fs'); const yargs = require('yargs'); -const Arborist = require("@npmcli/arborist"); -const runScript = require("@npmcli/run-script"); + const config = require('./apm'); const Command = require('./command'); @@ -15,6 +14,7 @@ class Ci extends Command { super(); this.atomDirectory = config.getAtomDirectory(); this.atomNodeDirectory = path.join(this.atomDirectory, '.node-gyp'); + this.atomNpmPath = require.resolve('npm/bin/npm-cli'); } parseOptions(argv) { @@ -35,100 +35,45 @@ but cannot be used to install new packages or dependencies.\ return options.boolean('verbose').default('verbose', false).describe('verbose', 'Show verbose debug information'); } - async installModules(options) { - process.stdout.write('Installing locked modules\n'); - - // Process here is modeled after the NPM CLI v11.11.1 - // https://github.com/npm/cli/blob/v11.11.1/lib/commands/ci.js - - fs.makeTreeSync(this.atomDirectory); - - const started = performance.now(); - const arbOpts = { - registry: process.env.npm_config_registry ?? "https://registry.npmjs.org", - save: false, // ppm ci should never modify the lockfile or package.json - packageLock: true, // ppm ci should never skip lock files - cache: config.getCacheDirectory(), - path: process.cwd(), - // TODO: Options that `npm ci` doesn't use, but I needed to make specs happy - legacyPeerDeps: true, - packageLockOnly: true, - preferFrozenLockfile: true - }; - - // Generate an inventory from the virtual tree in the lockfile - const virtualArb = new Arborist(arbOpts); - try { - await virtualArb.loadVirtual(); - } catch(err) { - console.error(err); - throw "ppm ci requires an existing lockfile. Please generate on then try again."; - } - const virtualInventory = new Map(virtualArb.virtualTree.inventory); - - const arb = new Arborist(arbOpts); - await arb.buildIdealTree(); - - //const errors = this.validateLockfile(virtualInventory, arb.idealTree.inventory); - const errors = []; // TODO: Why doesn't `arb.buildIdealTree` have an inventory with versions??? - if (errors.length > 0) { - console.error(errors.join("\n")); - throw "ppm ci can only install packages when your package.json and lockfile are in sync."; + installModules(options) { + process.stdout.write('Installing locked modules'); + if (options.argv.verbose) { + process.stdout.write('\n'); + } else { + process.stdout.write(' '); } - // NPM CI now deletes all node_modules, it seems to be a performance trick, - // Lets skip it and see if it's something we need. - - await arb.reify(arbOpts); - - // Run the same set of scripts that `ppm install` runs - const scripts = [ - "preinstall", - "install", - "postinstall", - "preprepare", - "prepare", - "postprepare" + const installArgs = [ + 'ci', + '--globalconfig', config.getGlobalConfigPath(), + '--userconfig', config.getUserConfigPath(), + ...this.getNpmBuildFlags() ]; - const scriptShell = await config.getSetting("script-shell") || undefined; - for (const event of scripts) { - await runScript({ - path: process.cwd(), - args: [], - scriptShell, - stdio: "inherit", - event - }); - } + if (options.argv.verbose) { installArgs.push('--verbose'); } - this.logArboristResults(arb, started); - this.logSuccess(); - } - - validateLockfile(virtualTree, idealTree) { - const errors = []; - - for (const [key, entry] of idealTree.entries()) { - const lock = virtualTree.get(key); + fs.makeTreeSync(this.atomDirectory); - if (!lock) { - errors.push(`Missing: ${entry.name}@${entry.version} from lock file`); - continue; - } + const env = { + ...process.env, + HOME: this.atomNodeDirectory, + RUSTUP_HOME: config.getRustupHomeDirPath() + }; + this.addBuildEnvVars(env); - if (entry.version !== lock.version) { - console.log(entry); - errors.push(`Invalid: lock file's ${lock.name}@${lock.version} does not satisfy ${entry.name}@${entry.version}`); - } - } + const installOptions = {env, streaming: options.argv.verbose}; - return errors; + return new Promise((resolve, reject) => + void this.fork(this.atomNpmPath, installArgs, installOptions, (...args) => + void this.logCommandResults(...args).then(resolve, reject) + ) + ) } async run(options) { const opts = this.parseOptions(options.commandArgs); try { + this.npm = await config.loadNpm(); await this.loadInstalledAtomMetadata(); await this.installModules(opts); } catch(err) { diff --git a/yarn.lock b/yarn.lock index 4d444388..d0353f12 100644 --- a/yarn.lock +++ b/yarn.lock @@ -216,7 +216,7 @@ resolved "https://registry.yarnpkg.com/@npmcli/redact/-/redact-4.0.0.tgz#c91121e02b7559a997614a2c1057cd7fc67608c4" integrity sha512-gOBg5YHMfZy+TfHArfVogwgfBeQnKbbGo3pSUyK/gSI0AVu+pEiDVcKlQb0D8Mg1LNRZILZ6XG8I5dJ4KuAd9Q== -"@npmcli/run-script@^10.0.0", "@npmcli/run-script@^10.0.4": +"@npmcli/run-script@^10.0.0": version "10.0.4" resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-10.0.4.tgz#99cddae483ce3dbf1a10f5683a4e6aaa02345ac0" integrity sha512-mGUWr1uMnf0le2TwfOZY4SFxZGXGfm4Jtay/nwAa2FLNAKXUoUwaGwBMNH36UHPtinWfTSJ3nqFQr0091CxVGg== From 12fd71c3cac5dff4bde1c6bf7dfad2476ee6f1cb Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sun, 15 Mar 2026 13:18:16 -0700 Subject: [PATCH 20/24] `yarn install` to cleanup lockfile --- yarn.lock | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/yarn.lock b/yarn.lock index 246d1dea..1d1ee159 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2179,6 +2179,15 @@ glob@^10.3.10: package-json-from-dist "^1.0.0" path-scurry "^1.11.1" +glob@^13.0.0: + version "13.0.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-13.0.6.tgz#078666566a425147ccacfbd2e332deb66a2be71d" + integrity sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw== + dependencies: + minimatch "^10.2.2" + minipass "^7.1.3" + path-scurry "^2.0.2" + glob@^6.0.4: version "6.0.4" resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" @@ -5217,7 +5226,7 @@ strict-uri-encode@^2.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -5235,15 +5244,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^2.0.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" @@ -5312,7 +5312,7 @@ stringify-package@^1.0.0, stringify-package@^1.0.1: resolved "https://registry.yarnpkg.com/stringify-package/-/stringify-package-1.0.1.tgz#e5aa3643e7f74d0f28628b72f3dad5cecfc3ba85" integrity sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -5340,13 +5340,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" From 5b575985005dd1c12f97c665856d80071f84cc8f Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sun, 15 Mar 2026 16:37:54 -0700 Subject: [PATCH 21/24] Add `npm-package-arg` --- package.json | 1 + yarn.lock | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b236bb9f..eee10896 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "hosted-git-info": "^3.0.7", "keytar": "^7.7.0", "npm": "https://github.com/pulsar-edit/npm-cli/releases/download/v6.14.19-pulsar2/npm-6.14.19-pulsar2.tgz", + "npm-package-arg": "^13.0.2", "open": "7.3.0", "plist": "3", "read": "^3", diff --git a/yarn.lock b/yarn.lock index 1d1ee159..e99763fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3745,7 +3745,7 @@ npm-normalize-package-bin@^5.0.0: resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-5.0.0.tgz#2b207ff260f2e525ddce93356614e2f736728f89" integrity sha512-CJi3OS4JLsNMmr2u07OJlhcrPxCeOeP/4xq67aWNai6TNWWbTrlNDgl8NcFKVlcBKp18GPj+EzbNIgrBfZhsag== -npm-package-arg@^13.0.0: +npm-package-arg@^13.0.0, npm-package-arg@^13.0.2: version "13.0.2" resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-13.0.2.tgz#72a80f2afe8329860e63854489415e9e9a2f78a7" integrity sha512-IciCE3SY3uE84Ld8WZU23gAPPV9rIYod4F+rc+vJ7h7cwAJt9Vk6TVsK60ry7Uj3SRS3bqRRIGuTp9YVlk6WNA== @@ -5227,6 +5227,7 @@ strict-uri-encode@^2.0.0: integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== "string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0: + name string-width-cjs version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -5313,6 +5314,7 @@ stringify-package@^1.0.0, stringify-package@^1.0.1: integrity sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg== "strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: + name strip-ansi-cjs version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== From f6f5e7e2267f2397068d381aa743067c0c6cc637 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sun, 15 Mar 2026 16:38:10 -0700 Subject: [PATCH 22/24] Add `apm.getArboristConfig()` to reduce duplication --- src/apm.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/apm.js b/src/apm.js index 4e14fc93..82634aa5 100644 --- a/src/apm.js +++ b/src/apm.js @@ -213,6 +213,31 @@ module.exports = { }); }, + getArboristConfig() { + // Provides the options that should be passed to arborist on creation. + // Provided the defaults, with our default overrides from `getNpmConfig()` + // As well as some special options for arborist in our environment + return new Promise(async (resolve, reject) => { + try { + const npmConf = await this.getNpmConfig(); + const { flat } = npmConf; + + // Values set in NPM: https://github.com/npm/cli/blob/v11.11.1/lib/npm.js + flat.nodeVersion = process.version; + + // Values for arborist + flat.registry = process.env.npm_config_registry ?? "https://registry.npmjs.org"; + flat.cpu = this.getElectronArch(); + flat.nodeGyp = path.join(this.getAtomDirectory(), ".node-gyp"); + + resolve(flat); + } catch(err) { + console.error(err); + reject(err); + } + }); + }, + setupApmRcFile() { try { return fs.writeFileSync(this.getGlobalConfigPath(), `\ From b91b9a01596c32843cd09ca83d98231d202e1210 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sun, 15 Mar 2026 16:38:21 -0700 Subject: [PATCH 23/24] Migrate `rebuild` to `Arborist` --- src/rebuild.js | 85 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 56 insertions(+), 29 deletions(-) diff --git a/src/rebuild.js b/src/rebuild.js index 901ad872..c4ad571f 100644 --- a/src/rebuild.js +++ b/src/rebuild.js @@ -1,8 +1,9 @@ - +const { performance } = require("node:perf_hooks"); const path = require('path'); - +const Arborist = require("@npmcli/arborist"); const yargs = require('yargs'); - +const semver = require("semver"); +const npa = require("npm-package-arg"); const config = require('./apm'); const Command = require('./command'); const fs = require('./fs'); @@ -13,9 +14,6 @@ class Rebuild extends Command { constructor() { super(); - this.atomDirectory = config.getAtomDirectory(); - this.atomNodeDirectory = path.join(this.atomDirectory, '.node-gyp'); - this.atomNpmPath = require.resolve('npm/bin/npm-cli'); } parseOptions(argv) { @@ -33,39 +31,68 @@ All the modules will be rebuilt if no module names are specified.\ return options.alias('h', 'help').describe('help', 'Print this usage message'); } - forkNpmRebuild(options) { - process.stdout.write('Rebuilding modules '); - - const rebuildArgs = ['--globalconfig', config.getGlobalConfigPath(), '--userconfig', config.getUserConfigPath(), 'rebuild']; - rebuildArgs.push(...this.getNpmBuildFlags()); - rebuildArgs.push(...options.argv._); + async forkNpmRebuild(options) { + process.stdout.write('Rebuilding modules\n'); + // Process here is modeled after the NPM CLI v11.11.1 + // https://github.com/npm/cli/blob/v11.11.1/lib/commands/rebuild.js fs.makeTreeSync(this.atomDirectory); - const env = { - ...process.env, - HOME: this.atomNodeDirectory, - RUSTUP_HOME: config.getRustupHomeDirPath() - }; - this.addBuildEnvVars(env); - - return new Promise((resolve, reject) => - void this.fork(this.atomNpmPath, rebuildArgs, {env}, (code, stderr) => { - if (code !== 0) { - reject(stderr ?? `Unknown error while invoking npm: code ${code}`); - return; + const started = performance.now(); + const arb = new Arborist({ + ...config.getArboristConfig(), + legacyPeerDeps: true + }); + + if (options.argv._.length > 0) { + // get the set of nodes matching the name that we want rebuilt + const tree = await arb.loadActual(); + const specs = options.argv._.map(arg => { + const spec = npa(arg); + + if (spec.rawSpec === "*") { + return spec; } - resolve(); - }) - ); + if (spec.type !== "range" && spec.type !== "version" && spec.type !== "directory") { + throw new Error("`ppm rebuild` only supports SemVer version/range specifiers"); + } + + return spec; + }); + + const nodes = tree.inventory.filter(node => this.isNode(specs, node)); + + await arb.rebuild({ nodes }); + } else { + await arb.rebuild(); + } + + this.logArboristResults(arb, started); + } + + isNode(specs, node) { + return specs.some(spec => { + if (spec.type === "directory") { + return node.path === spec.fetchSpec; + } + + if (spec.name !== node.name) { + return false; + } + + if (spec.rawSpec === "" || spec.rawSpec === "*") { + return true; + } + + const { version } = node.package; + return semver.satisfies(version, spec.fetchSpec); + }); } async run(options) { options = this.parseOptions(options.commandArgs); - const npm = await config.loadNpm(); - this.npm = npm; try { await this.loadInstalledAtomMetadata(); await this.forkNpmRebuild(options); From f076e47289c2d9f93f821125fa1bbe55f8551cf5 Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Sun, 15 Mar 2026 16:43:20 -0700 Subject: [PATCH 24/24] Use `apm` directly for now deleted variable `this.atomDirectory` in `rebuild.js` --- src/rebuild.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rebuild.js b/src/rebuild.js index c4ad571f..53f3e621 100644 --- a/src/rebuild.js +++ b/src/rebuild.js @@ -36,7 +36,7 @@ All the modules will be rebuilt if no module names are specified.\ // Process here is modeled after the NPM CLI v11.11.1 // https://github.com/npm/cli/blob/v11.11.1/lib/commands/rebuild.js - fs.makeTreeSync(this.atomDirectory); + fs.makeTreeSync(config.getAtomDirectory()); const started = performance.now(); const arb = new Arborist({