Skip to content

Commit

Permalink
feat: provide configurable npmPath
Browse files Browse the repository at this point in the history
closes #107
  • Loading branch information
antongolub committed May 1, 2021
1 parent cb242dc commit 5e29c23
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 57 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ jobs:
extends: |
@qiwi/semrel-config
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_EMAIL: '[email protected]'
GIT_COMMITTER_EMAIL: '[email protected]'
Expand Down
3 changes: 1 addition & 2 deletions src/main/ts/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ export const getNpm = (npmPath = 'local', isWin = isWindows()): string => {
return getClosestNpm(cmd)
}

// TODO support custom path to npm bin
throw new Error(`Unsupported npm path value: ${npmPath}`)
return npmPath
}

export const getWorkspaces = (
Expand Down
4 changes: 2 additions & 2 deletions src/test/ts/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ describe('util', () => {
const cases: [any, string?, string?][] = [
['local', localNpm],
['system', cmd],
['unknown', undefined, 'Unsupported npm path value: unknown'],
[NaN, undefined, 'Unsupported npm path value: NaN'],
[cmd, cmd],
[localNpm, localNpm],
]
cases.forEach(([npmPath, result, err]) => {
it(`resolves npm ref: npmPath=${npmPath}, isWin=${isWin}`, () => {
Expand Down
57 changes: 6 additions & 51 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -560,40 +560,7 @@
"@nodelib/fs.scandir" "2.1.4"
fastq "^1.6.0"

"@npmcli/arborist@^2.0.0", "@npmcli/arborist@^2.3.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@npmcli/arborist/-/arborist-2.4.0.tgz#34e7d7ead0140268ff7f9418b305993e8f2ce0d7"
integrity "sha1-NOfX6tAUAmj/f5QYswWZPo8s4Nc= sha512-rCoRrUSmXdBDBBgL/O0oehIR53ey99Pds8dId7gztARZmx6/NBoeiUOu9RnvXSe15XZLc3JSz9sHPcbQ9NQ53Q=="
dependencies:
"@npmcli/installed-package-contents" "^1.0.7"
"@npmcli/map-workspaces" "^1.0.2"
"@npmcli/metavuln-calculator" "^1.1.0"
"@npmcli/move-file" "^1.1.0"
"@npmcli/name-from-folder" "^1.0.1"
"@npmcli/node-gyp" "^1.0.1"
"@npmcli/run-script" "^1.8.2"
bin-links "^2.2.1"
cacache "^15.0.3"
common-ancestor-path "^1.0.1"
json-parse-even-better-errors "^2.3.1"
json-stringify-nice "^1.1.2"
mkdirp-infer-owner "^2.0.0"
npm-install-checks "^4.0.0"
npm-package-arg "^8.1.0"
npm-pick-manifest "^6.1.0"
npm-registry-fetch "^10.0.0"
pacote "^11.2.6"
parse-conflict-json "^1.1.1"
promise-all-reject-late "^1.0.0"
promise-call-limit "^1.0.1"
read-package-json-fast "^2.0.2"
readdir-scoped-modules "^1.1.0"
semver "^7.3.5"
tar "^6.1.0"
treeverse "^1.0.4"
walk-up-path "^1.0.0"

"@npmcli/arborist@^2.4.1":
"@npmcli/arborist@^2.0.0", "@npmcli/arborist@^2.3.0", "@npmcli/arborist@^2.4.1":
version "2.4.1"
resolved "https://registry.yarnpkg.com/@npmcli/arborist/-/arborist-2.4.1.tgz#e98c77f7e17924876b89907237516eb65d46005f"
integrity sha512-LivXfK+LjtvzFjnwK6E41Pkw1C8+MYrgdXinzqpDc8MDYp7gMT0nvGvnpQd47OV2GhLRyBkbUSEcLk6P1d1s0g==
Expand Down Expand Up @@ -4335,9 +4302,9 @@ libnpmdiff@^2.0.4:
tar "^6.1.0"

libnpmexec@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/libnpmexec/-/libnpmexec-1.0.1.tgz#a23f5bbe2bd4f8103a4f53eea8b113f7742f1903"
integrity sha512-YK2kEhZNCcaDEqOIUWjadhJl9MgS69YHgMmGD5P3yntF0UXNOQfEqABoMTZv9ngPOJTJQGlU4Dfp2xb3bpUKzw==
version "1.1.0"
resolved "https://registry.yarnpkg.com/libnpmexec/-/libnpmexec-1.1.0.tgz#daa79d4545e21d0eb6887a33e0bbc8ab466099b2"
integrity "sha1-2qedRUXiHQ62iHoz4LvIq0ZgmbI= sha512-OWpsPWtD6CAn66JouyjBfhQ9eS1mAtXgZXXd1SoAyUP3Mol+ao9IJ2THcJQcgX96keVmZkUA11uJS5ZNEd9DwA=="
dependencies:
"@npmcli/arborist" "^2.3.0"
"@npmcli/ci-detect" "^1.3.0"
Expand All @@ -4349,6 +4316,7 @@ libnpmexec@^1.0.1:
proc-log "^1.0.0"
read "^1.0.7"
read-package-json-fast "^2.0.2"
walk-up-path "^1.0.0"

libnpmfund@^1.0.2:
version "1.0.2"
Expand Down Expand Up @@ -4979,20 +4947,7 @@ npm-profile@^5.0.3:
dependencies:
npm-registry-fetch "^10.0.0"

npm-registry-fetch@^10.0.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-10.1.0.tgz#3b618126b1011af74c12e75d6077712bda411da4"
integrity sha512-XcKu0h6OuRTB7HO5uv8htavPQJ1dYTLAXLE5AMs4GFQ1LbY+LlHiNoqIbVshE3rk0vLk+nKxpA/4WJm1kE7eqg==
dependencies:
lru-cache "^6.0.0"
make-fetch-happen "^8.0.9"
minipass "^3.1.3"
minipass-fetch "^1.3.0"
minipass-json-stream "^1.0.1"
minizlib "^2.0.0"
npm-package-arg "^8.0.0"

npm-registry-fetch@^10.1.1:
npm-registry-fetch@^10.0.0, npm-registry-fetch@^10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-10.1.1.tgz#97bc7a0fca5e8f76cc5162185b8de8caa8bea639"
integrity sha512-F6a3l+ffCQ7hvvN16YG5bpm1rPZntCg66PLHDQ1apWJPOCUVHoKnL2w5fqEaTVhp42dmossTyXeR7hTGirfXrg==
Expand Down

0 comments on commit 5e29c23

Please sign in to comment.