@socketsecurity/lib 0.0.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +270 -0
- package/LICENSE +21 -0
- package/README.md +80 -2
- package/data/extensions.json +28 -0
- package/dist/abort.d.ts +11 -0
- package/dist/abort.js +62 -0
- package/dist/abort.js.map +7 -0
- package/dist/agent.d.ts +102 -0
- package/dist/agent.js +288 -0
- package/dist/agent.js.map +7 -0
- package/dist/ansi.d.ts +29 -0
- package/dist/ansi.js +62 -0
- package/dist/ansi.js.map +7 -0
- package/dist/argv/flags.d.ts +199 -0
- package/dist/argv/flags.js +284 -0
- package/dist/argv/flags.js.map +7 -0
- package/dist/argv/parse.d.ts +76 -0
- package/dist/argv/parse.js +173 -0
- package/dist/argv/parse.js.map +7 -0
- package/dist/arrays.d.ts +29 -0
- package/dist/arrays.js +87 -0
- package/dist/arrays.js.map +7 -0
- package/dist/bin.d.ts +50 -0
- package/dist/bin.js +405 -0
- package/dist/bin.js.map +7 -0
- package/dist/cacache.d.ts +86 -0
- package/dist/cacache.js +140 -0
- package/dist/cacache.js.map +7 -0
- package/dist/cache-with-ttl.d.ts +133 -0
- package/dist/cache-with-ttl.js +225 -0
- package/dist/cache-with-ttl.js.map +7 -0
- package/dist/constants/agents.d.ts +37 -0
- package/dist/constants/agents.js +128 -0
- package/dist/constants/agents.js.map +7 -0
- package/dist/constants/core.d.ts +22 -0
- package/dist/constants/core.js +59 -0
- package/dist/constants/core.js.map +7 -0
- package/dist/constants/encoding.d.ts +13 -0
- package/dist/constants/encoding.js +50 -0
- package/dist/constants/encoding.js.map +7 -0
- package/dist/constants/github.d.ts +7 -0
- package/dist/constants/github.js +32 -0
- package/dist/constants/github.js.map +7 -0
- package/dist/constants/licenses.d.ts +8 -0
- package/dist/constants/licenses.js +68 -0
- package/dist/constants/licenses.js.map +7 -0
- package/dist/constants/node.d.ts +29 -0
- package/dist/constants/node.js +173 -0
- package/dist/constants/node.js.map +7 -0
- package/dist/constants/packages.d.ts +19 -0
- package/dist/constants/packages.js +130 -0
- package/dist/constants/packages.js.map +7 -0
- package/dist/constants/paths.d.ts +51 -0
- package/dist/constants/paths.js +152 -0
- package/dist/constants/paths.js.map +7 -0
- package/dist/constants/platform.d.ts +6 -0
- package/dist/constants/platform.js +43 -0
- package/dist/constants/platform.js.map +7 -0
- package/dist/constants/process.d.ts +7 -0
- package/dist/constants/process.js +54 -0
- package/dist/constants/process.js.map +7 -0
- package/dist/constants/socket.d.ts +29 -0
- package/dist/constants/socket.js +83 -0
- package/dist/constants/socket.js.map +7 -0
- package/dist/constants/testing.d.ts +9 -0
- package/dist/constants/testing.js +38 -0
- package/dist/constants/testing.js.map +7 -0
- package/dist/constants/time.d.ts +11 -0
- package/dist/constants/time.js +41 -0
- package/dist/constants/time.js.map +7 -0
- package/dist/constants/typescript.d.ts +6 -0
- package/dist/constants/typescript.js +56 -0
- package/dist/constants/typescript.js.map +7 -0
- package/dist/cover/code.d.ts +8 -0
- package/dist/cover/code.js +137 -0
- package/dist/cover/code.js.map +7 -0
- package/dist/cover/formatters.d.ts +9 -0
- package/dist/cover/formatters.js +103 -0
- package/dist/cover/formatters.js.map +7 -0
- package/dist/cover/type.d.ts +7 -0
- package/dist/cover/type.js +65 -0
- package/dist/cover/type.js.map +7 -0
- package/dist/cover/types.d.ts +70 -0
- package/dist/cover/types.js +17 -0
- package/dist/cover/types.js.map +7 -0
- package/dist/debug.d.ts +99 -0
- package/dist/debug.js +345 -0
- package/dist/debug.js.map +7 -0
- package/dist/dlx-binary.d.ts +49 -0
- package/dist/dlx-binary.js +261 -0
- package/dist/dlx-binary.js.map +7 -0
- package/dist/dlx.d.ts +64 -0
- package/dist/dlx.js +168 -0
- package/dist/dlx.js.map +7 -0
- package/dist/download-lock.d.ts +48 -0
- package/dist/download-lock.js +139 -0
- package/dist/download-lock.js.map +7 -0
- package/dist/effects/pulse-frames.d.ts +23 -0
- package/dist/effects/pulse-frames.js +66 -0
- package/dist/effects/pulse-frames.js.map +7 -0
- package/dist/effects/text-shimmer.d.ts +37 -0
- package/dist/effects/text-shimmer.js +175 -0
- package/dist/effects/text-shimmer.js.map +7 -0
- package/dist/effects/types.d.ts +41 -0
- package/dist/effects/types.js +17 -0
- package/dist/effects/types.js.map +7 -0
- package/dist/effects/ultra.d.ts +16 -0
- package/dist/effects/ultra.js +63 -0
- package/dist/effects/ultra.js.map +7 -0
- package/dist/env/appdata.d.ts +1 -0
- package/dist/env/appdata.js +30 -0
- package/dist/env/appdata.js.map +7 -0
- package/dist/env/ci.d.ts +1 -0
- package/dist/env/ci.js +31 -0
- package/dist/env/ci.js.map +7 -0
- package/dist/env/comspec.d.ts +1 -0
- package/dist/env/comspec.js +30 -0
- package/dist/env/comspec.js.map +7 -0
- package/dist/env/debug.d.ts +1 -0
- package/dist/env/debug.js +30 -0
- package/dist/env/debug.js.map +7 -0
- package/dist/env/getters.d.ts +40 -0
- package/dist/env/getters.js +283 -0
- package/dist/env/getters.js.map +7 -0
- package/dist/env/github-api-url.d.ts +1 -0
- package/dist/env/github-api-url.js +30 -0
- package/dist/env/github-api-url.js.map +7 -0
- package/dist/env/github-base-ref.d.ts +1 -0
- package/dist/env/github-base-ref.js +30 -0
- package/dist/env/github-base-ref.js.map +7 -0
- package/dist/env/github-ref-name.d.ts +1 -0
- package/dist/env/github-ref-name.js +30 -0
- package/dist/env/github-ref-name.js.map +7 -0
- package/dist/env/github-ref-type.d.ts +1 -0
- package/dist/env/github-ref-type.js +30 -0
- package/dist/env/github-ref-type.js.map +7 -0
- package/dist/env/github-repository.d.ts +1 -0
- package/dist/env/github-repository.js +30 -0
- package/dist/env/github-repository.js.map +7 -0
- package/dist/env/github-server-url.d.ts +1 -0
- package/dist/env/github-server-url.js +30 -0
- package/dist/env/github-server-url.js.map +7 -0
- package/dist/env/github-token.d.ts +1 -0
- package/dist/env/github-token.js +30 -0
- package/dist/env/github-token.js.map +7 -0
- package/dist/env/helpers.d.ts +6 -0
- package/dist/env/helpers.js +49 -0
- package/dist/env/helpers.js.map +7 -0
- package/dist/env/home.d.ts +1 -0
- package/dist/env/home.js +30 -0
- package/dist/env/home.js.map +7 -0
- package/dist/env/jest-worker-id.d.ts +1 -0
- package/dist/env/jest-worker-id.js +30 -0
- package/dist/env/jest-worker-id.js.map +7 -0
- package/dist/env/lang.d.ts +1 -0
- package/dist/env/lang.js +30 -0
- package/dist/env/lang.js.map +7 -0
- package/dist/env/lc-all.d.ts +1 -0
- package/dist/env/lc-all.js +30 -0
- package/dist/env/lc-all.js.map +7 -0
- package/dist/env/lc-messages.d.ts +1 -0
- package/dist/env/lc-messages.js +30 -0
- package/dist/env/lc-messages.js.map +7 -0
- package/dist/env/localappdata.d.ts +1 -0
- package/dist/env/localappdata.js +30 -0
- package/dist/env/localappdata.js.map +7 -0
- package/dist/env/node-auth-token.d.ts +1 -0
- package/dist/env/node-auth-token.js +30 -0
- package/dist/env/node-auth-token.js.map +7 -0
- package/dist/env/node-env.d.ts +1 -0
- package/dist/env/node-env.js +30 -0
- package/dist/env/node-env.js.map +7 -0
- package/dist/env/npm-config-registry.d.ts +1 -0
- package/dist/env/npm-config-registry.js +30 -0
- package/dist/env/npm-config-registry.js.map +7 -0
- package/dist/env/npm-config-user-agent.d.ts +1 -0
- package/dist/env/npm-config-user-agent.js +30 -0
- package/dist/env/npm-config-user-agent.js.map +7 -0
- package/dist/env/npm-lifecycle-event.d.ts +1 -0
- package/dist/env/npm-lifecycle-event.js +30 -0
- package/dist/env/npm-lifecycle-event.js.map +7 -0
- package/dist/env/npm-registry.d.ts +1 -0
- package/dist/env/npm-registry.js +30 -0
- package/dist/env/npm-registry.js.map +7 -0
- package/dist/env/npm-token.d.ts +1 -0
- package/dist/env/npm-token.js +30 -0
- package/dist/env/npm-token.js.map +7 -0
- package/dist/env/path.d.ts +1 -0
- package/dist/env/path.js +30 -0
- package/dist/env/path.js.map +7 -0
- package/dist/env/pre-commit.d.ts +1 -0
- package/dist/env/pre-commit.js +31 -0
- package/dist/env/pre-commit.js.map +7 -0
- package/dist/env/shell.d.ts +1 -0
- package/dist/env/shell.js +30 -0
- package/dist/env/shell.js.map +7 -0
- package/dist/env/socket-accept-risks.d.ts +1 -0
- package/dist/env/socket-accept-risks.js +31 -0
- package/dist/env/socket-accept-risks.js.map +7 -0
- package/dist/env/socket-api-base-url.d.ts +1 -0
- package/dist/env/socket-api-base-url.js +30 -0
- package/dist/env/socket-api-base-url.js.map +7 -0
- package/dist/env/socket-api-proxy.d.ts +1 -0
- package/dist/env/socket-api-proxy.js +30 -0
- package/dist/env/socket-api-proxy.js.map +7 -0
- package/dist/env/socket-api-timeout.d.ts +1 -0
- package/dist/env/socket-api-timeout.js +31 -0
- package/dist/env/socket-api-timeout.js.map +7 -0
- package/dist/env/socket-api-token.d.ts +1 -0
- package/dist/env/socket-api-token.js +30 -0
- package/dist/env/socket-api-token.js.map +7 -0
- package/dist/env/socket-cacache-dir.d.ts +1 -0
- package/dist/env/socket-cacache-dir.js +30 -0
- package/dist/env/socket-cacache-dir.js.map +7 -0
- package/dist/env/socket-cli-accept-risks.d.ts +1 -0
- package/dist/env/socket-cli-accept-risks.js +33 -0
- package/dist/env/socket-cli-accept-risks.js.map +7 -0
- package/dist/env/socket-cli-api-base-url.d.ts +1 -0
- package/dist/env/socket-cli-api-base-url.js +30 -0
- package/dist/env/socket-cli-api-base-url.js.map +7 -0
- package/dist/env/socket-cli-api-proxy.d.ts +1 -0
- package/dist/env/socket-cli-api-proxy.js +30 -0
- package/dist/env/socket-cli-api-proxy.js.map +7 -0
- package/dist/env/socket-cli-api-timeout.d.ts +1 -0
- package/dist/env/socket-cli-api-timeout.js +31 -0
- package/dist/env/socket-cli-api-timeout.js.map +7 -0
- package/dist/env/socket-cli-api-token.d.ts +1 -0
- package/dist/env/socket-cli-api-token.js +30 -0
- package/dist/env/socket-cli-api-token.js.map +7 -0
- package/dist/env/socket-cli-config.d.ts +1 -0
- package/dist/env/socket-cli-config.js +30 -0
- package/dist/env/socket-cli-config.js.map +7 -0
- package/dist/env/socket-cli-fix.d.ts +1 -0
- package/dist/env/socket-cli-fix.js +30 -0
- package/dist/env/socket-cli-fix.js.map +7 -0
- package/dist/env/socket-cli-no-api-token.d.ts +1 -0
- package/dist/env/socket-cli-no-api-token.js +33 -0
- package/dist/env/socket-cli-no-api-token.js.map +7 -0
- package/dist/env/socket-cli-optimize.d.ts +1 -0
- package/dist/env/socket-cli-optimize.js +31 -0
- package/dist/env/socket-cli-optimize.js.map +7 -0
- package/dist/env/socket-cli-org-slug.d.ts +1 -0
- package/dist/env/socket-cli-org-slug.js +30 -0
- package/dist/env/socket-cli-org-slug.js.map +7 -0
- package/dist/env/socket-cli-shadow-accept-risks.d.ts +1 -0
- package/dist/env/socket-cli-shadow-accept-risks.js +33 -0
- package/dist/env/socket-cli-shadow-accept-risks.js.map +7 -0
- package/dist/env/socket-cli-shadow-api-token.d.ts +1 -0
- package/dist/env/socket-cli-shadow-api-token.js +30 -0
- package/dist/env/socket-cli-shadow-api-token.js.map +7 -0
- package/dist/env/socket-cli-shadow-bin.d.ts +1 -0
- package/dist/env/socket-cli-shadow-bin.js +30 -0
- package/dist/env/socket-cli-shadow-bin.js.map +7 -0
- package/dist/env/socket-cli-shadow-progress.d.ts +1 -0
- package/dist/env/socket-cli-shadow-progress.js +33 -0
- package/dist/env/socket-cli-shadow-progress.js.map +7 -0
- package/dist/env/socket-cli-shadow-silent.d.ts +1 -0
- package/dist/env/socket-cli-shadow-silent.js +33 -0
- package/dist/env/socket-cli-shadow-silent.js.map +7 -0
- package/dist/env/socket-cli-view-all-risks.d.ts +1 -0
- package/dist/env/socket-cli-view-all-risks.js +33 -0
- package/dist/env/socket-cli-view-all-risks.js.map +7 -0
- package/dist/env/socket-config.d.ts +1 -0
- package/dist/env/socket-config.js +30 -0
- package/dist/env/socket-config.js.map +7 -0
- package/dist/env/socket-debug.d.ts +1 -0
- package/dist/env/socket-debug.js +30 -0
- package/dist/env/socket-debug.js.map +7 -0
- package/dist/env/socket-home.d.ts +1 -0
- package/dist/env/socket-home.js +30 -0
- package/dist/env/socket-home.js.map +7 -0
- package/dist/env/socket-no-api-token.d.ts +1 -0
- package/dist/env/socket-no-api-token.js +31 -0
- package/dist/env/socket-no-api-token.js.map +7 -0
- package/dist/env/socket-npm-registry.d.ts +1 -0
- package/dist/env/socket-npm-registry.js +30 -0
- package/dist/env/socket-npm-registry.js.map +7 -0
- package/dist/env/socket-org-slug.d.ts +1 -0
- package/dist/env/socket-org-slug.js +30 -0
- package/dist/env/socket-org-slug.js.map +7 -0
- package/dist/env/socket-registry-url.d.ts +1 -0
- package/dist/env/socket-registry-url.js +30 -0
- package/dist/env/socket-registry-url.js.map +7 -0
- package/dist/env/socket-view-all-risks.d.ts +1 -0
- package/dist/env/socket-view-all-risks.js +31 -0
- package/dist/env/socket-view-all-risks.js.map +7 -0
- package/dist/env/temp.d.ts +1 -0
- package/dist/env/temp.js +30 -0
- package/dist/env/temp.js.map +7 -0
- package/dist/env/term.d.ts +1 -0
- package/dist/env/term.js +30 -0
- package/dist/env/term.js.map +7 -0
- package/dist/env/tmp.d.ts +1 -0
- package/dist/env/tmp.js +30 -0
- package/dist/env/tmp.js.map +7 -0
- package/dist/env/tmpdir.d.ts +1 -0
- package/dist/env/tmpdir.js +30 -0
- package/dist/env/tmpdir.js.map +7 -0
- package/dist/env/userprofile.d.ts +1 -0
- package/dist/env/userprofile.js +30 -0
- package/dist/env/userprofile.js.map +7 -0
- package/dist/env/vitest.d.ts +1 -0
- package/dist/env/vitest.js +31 -0
- package/dist/env/vitest.js.map +7 -0
- package/dist/env/xdg-cache-home.d.ts +1 -0
- package/dist/env/xdg-cache-home.js +30 -0
- package/dist/env/xdg-cache-home.js.map +7 -0
- package/dist/env/xdg-config-home.d.ts +1 -0
- package/dist/env/xdg-config-home.js +30 -0
- package/dist/env/xdg-config-home.js.map +7 -0
- package/dist/env/xdg-data-home.d.ts +1 -0
- package/dist/env/xdg-data-home.js +30 -0
- package/dist/env/xdg-data-home.js.map +7 -0
- package/dist/env.d.ts +15 -0
- package/dist/env.js +63 -0
- package/dist/env.js.map +7 -0
- package/dist/external/@inquirer/checkbox.js +4 -0
- package/dist/external/@inquirer/confirm.js +22 -0
- package/dist/external/@inquirer/core.js +4 -0
- package/dist/external/@inquirer/input.js +1 -0
- package/dist/external/@inquirer/password.js +1 -0
- package/dist/external/@inquirer/prompts.js +4 -0
- package/dist/external/@inquirer/search.js +1 -0
- package/dist/external/@inquirer/select.js +25 -0
- package/dist/external/@npmcli/package-json/index.js +1 -0
- package/dist/external/@npmcli/package-json/lib/read-package.js +1 -0
- package/dist/external/@npmcli/package-json/lib/sort.js +1 -0
- package/dist/external/@npmcli/promise-spawn.js +5 -0
- package/dist/external/@socketregistry/is-unicode-supported.d.ts +2 -0
- package/dist/external/@socketregistry/is-unicode-supported.js +5 -0
- package/dist/external/@socketregistry/packageurl-js.js +34 -0
- package/dist/external/@socketregistry/yocto-spinner.d.ts +12 -0
- package/dist/external/@socketregistry/yocto-spinner.js +8 -0
- package/dist/external/@yarnpkg/extensions.d.ts +5 -0
- package/dist/external/@yarnpkg/extensions.js +5 -0
- package/dist/external/cacache.d.ts +93 -0
- package/dist/external/cacache.js +32 -0
- package/dist/external/debug.d.ts +25 -0
- package/dist/external/debug.js +9 -0
- package/dist/external/del.d.ts +1 -0
- package/dist/external/del.js +54 -0
- package/dist/external/fast-glob.js +54 -0
- package/dist/external/fast-sort.d.ts +4 -0
- package/dist/external/fast-sort.js +5 -0
- package/dist/external/get-east-asian-width.d.ts +5 -0
- package/dist/external/get-east-asian-width.js +5 -0
- package/dist/external/libnpmpack.d.ts +3 -0
- package/dist/external/libnpmpack.js +225 -0
- package/dist/external/make-fetch-happen.d.ts +16 -0
- package/dist/external/make-fetch-happen.js +69 -0
- package/dist/external/normalize-package-data.js +6 -0
- package/dist/external/npm-package-arg.js +6 -0
- package/dist/external/pacote.d.ts +19 -0
- package/dist/external/pacote.js +105 -0
- package/dist/external/picomatch.js +5 -0
- package/dist/external/semver.d.ts +3 -0
- package/dist/external/semver.js +5 -0
- package/dist/external/spdx-correct.js +5 -0
- package/dist/external/spdx-expression-parse.js +5 -0
- package/dist/external/streaming-iterables.js +5 -0
- package/dist/external/validate-npm-package-name.js +5 -0
- package/dist/external/which.js +5 -0
- package/dist/external/yargs-parser.d.ts +3 -0
- package/dist/external/yargs-parser.js +26 -0
- package/dist/external/yoctocolors-cjs.d.ts +38 -0
- package/dist/external/yoctocolors-cjs.js +5 -0
- package/dist/external/zod.d.ts +1 -0
- package/dist/external/zod.js +27 -0
- package/dist/fs.d.ts +184 -0
- package/dist/fs.js +610 -0
- package/dist/fs.js.map +7 -0
- package/dist/functions.d.ts +27 -0
- package/dist/functions.js +70 -0
- package/dist/functions.js.map +7 -0
- package/dist/git.d.ts +93 -0
- package/dist/git.js +321 -0
- package/dist/git.js.map +7 -0
- package/dist/github.d.ts +121 -0
- package/dist/github.js +203 -0
- package/dist/github.js.map +7 -0
- package/dist/globs.d.ts +46 -0
- package/dist/globs.js +154 -0
- package/dist/globs.js.map +7 -0
- package/dist/http-request.d.ts +53 -0
- package/dist/http-request.js +315 -0
- package/dist/http-request.js.map +7 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +64 -0
- package/dist/index.js.map +7 -0
- package/dist/ipc.d.ts +366 -0
- package/dist/ipc.js +234 -0
- package/dist/ipc.js.map +7 -0
- package/dist/json.d.ts +23 -0
- package/dist/json.js +75 -0
- package/dist/json.js.map +7 -0
- package/dist/logger.d.ts +183 -0
- package/dist/logger.js +653 -0
- package/dist/logger.js.map +7 -0
- package/dist/maintained-node-versions.d.ts +7 -0
- package/dist/maintained-node-versions.js +37 -0
- package/dist/maintained-node-versions.js.map +7 -0
- package/dist/memoization.d.ts +142 -0
- package/dist/memoization.js +212 -0
- package/dist/memoization.js.map +7 -0
- package/dist/objects.d.ts +146 -0
- package/dist/objects.js +321 -0
- package/dist/objects.js.map +7 -0
- package/dist/packages/editable.d.ts +107 -0
- package/dist/packages/editable.js +358 -0
- package/dist/packages/editable.js.map +7 -0
- package/dist/packages/exports.d.ts +30 -0
- package/dist/packages/exports.js +164 -0
- package/dist/packages/exports.js.map +7 -0
- package/dist/packages/isolation.d.ts +22 -0
- package/dist/packages/isolation.js +197 -0
- package/dist/packages/isolation.js.map +7 -0
- package/dist/packages/licenses.d.ts +68 -0
- package/dist/packages/licenses.js +216 -0
- package/dist/packages/licenses.js.map +7 -0
- package/dist/packages/manifest.d.ts +16 -0
- package/dist/packages/manifest.js +192 -0
- package/dist/packages/manifest.js.map +7 -0
- package/dist/packages/normalize.d.ts +21 -0
- package/dist/packages/normalize.js +122 -0
- package/dist/packages/normalize.js.map +7 -0
- package/dist/packages/operations.d.ts +54 -0
- package/dist/packages/operations.js +306 -0
- package/dist/packages/operations.js.map +7 -0
- package/dist/packages/paths.d.ts +10 -0
- package/dist/packages/paths.js +55 -0
- package/dist/packages/paths.js.map +7 -0
- package/dist/packages/provenance.d.ts +10 -0
- package/dist/packages/provenance.js +180 -0
- package/dist/packages/provenance.js.map +7 -0
- package/dist/packages/registry.d.ts +8 -0
- package/dist/packages/registry.js +30 -0
- package/dist/packages/registry.js.map +7 -0
- package/dist/packages/specs.d.ts +28 -0
- package/dist/packages/specs.js +85 -0
- package/dist/packages/specs.js.map +7 -0
- package/dist/packages/validation.d.ts +15 -0
- package/dist/packages/validation.js +53 -0
- package/dist/packages/validation.js.map +7 -0
- package/dist/packages.d.ts +154 -0
- package/dist/packages.js +131 -0
- package/dist/packages.js.map +7 -0
- package/dist/path.d.ts +74 -0
- package/dist/path.js +442 -0
- package/dist/path.js.map +7 -0
- package/dist/paths.d.ts +42 -0
- package/dist/paths.js +145 -0
- package/dist/paths.js.map +7 -0
- package/dist/performance.d.ts +178 -0
- package/dist/performance.js +219 -0
- package/dist/performance.js.map +7 -0
- package/dist/promise-queue.d.ts +35 -0
- package/dist/promise-queue.js +111 -0
- package/dist/promise-queue.js.map +7 -0
- package/dist/promises.d.ts +67 -0
- package/dist/promises.js +268 -0
- package/dist/promises.js.map +7 -0
- package/dist/prompts.d.ts +27 -0
- package/dist/prompts.js +60 -0
- package/dist/prompts.js.map +7 -0
- package/dist/regexps.d.ts +13 -0
- package/dist/regexps.js +32 -0
- package/dist/regexps.js.map +7 -0
- package/dist/sea.d.ts +10 -0
- package/dist/sea.js +46 -0
- package/dist/sea.js.map +7 -0
- package/dist/shadow.d.ts +17 -0
- package/dist/shadow.js +60 -0
- package/dist/shadow.js.map +7 -0
- package/dist/signal-exit.d.ts +23 -0
- package/dist/signal-exit.js +250 -0
- package/dist/signal-exit.js.map +7 -0
- package/dist/sorts.d.ts +28 -0
- package/dist/sorts.js +96 -0
- package/dist/sorts.js.map +7 -0
- package/dist/spawn.d.ts +207 -0
- package/dist/spawn.js +201 -0
- package/dist/spawn.js.map +7 -0
- package/dist/spinner.d.ts +208 -0
- package/dist/spinner.js +729 -0
- package/dist/spinner.js.map +7 -0
- package/dist/ssri.d.ts +95 -0
- package/dist/ssri.js +73 -0
- package/dist/ssri.js.map +7 -0
- package/dist/stdio/clear.d.ts +40 -0
- package/dist/stdio/clear.js +84 -0
- package/dist/stdio/clear.js.map +7 -0
- package/dist/stdio/divider.d.ts +48 -0
- package/dist/stdio/divider.js +81 -0
- package/dist/stdio/divider.js.map +7 -0
- package/dist/stdio/footer.d.ts +25 -0
- package/dist/stdio/footer.js +96 -0
- package/dist/stdio/footer.js.map +7 -0
- package/dist/stdio/header.d.ts +25 -0
- package/dist/stdio/header.js +102 -0
- package/dist/stdio/header.js.map +7 -0
- package/dist/stdio/mask.d.ts +72 -0
- package/dist/stdio/mask.js +187 -0
- package/dist/stdio/mask.js.map +7 -0
- package/dist/stdio/progress.d.ts +51 -0
- package/dist/stdio/progress.js +171 -0
- package/dist/stdio/progress.js.map +7 -0
- package/dist/stdio/prompts.d.ts +46 -0
- package/dist/stdio/prompts.js +90 -0
- package/dist/stdio/prompts.js.map +7 -0
- package/dist/stdio/stderr.d.ts +48 -0
- package/dist/stdio/stderr.js +91 -0
- package/dist/stdio/stderr.js.map +7 -0
- package/dist/stdio/stdout.d.ts +48 -0
- package/dist/stdio/stdout.js +105 -0
- package/dist/stdio/stdout.js.map +7 -0
- package/dist/streams.d.ts +20 -0
- package/dist/streams.js +80 -0
- package/dist/streams.js.map +7 -0
- package/dist/strings.d.ts +139 -0
- package/dist/strings.js +253 -0
- package/dist/strings.js.map +7 -0
- package/dist/suppress-warnings.d.ts +66 -0
- package/dist/suppress-warnings.js +100 -0
- package/dist/suppress-warnings.js.map +7 -0
- package/dist/tables.d.ts +69 -0
- package/dist/tables.js +130 -0
- package/dist/tables.js.map +7 -0
- package/dist/temporary-executor.d.ts +9 -0
- package/dist/temporary-executor.js +54 -0
- package/dist/temporary-executor.js.map +7 -0
- package/dist/types.d.ts +65 -0
- package/dist/types.js +74 -0
- package/dist/types.js.map +7 -0
- package/dist/url.d.ts +60 -0
- package/dist/url.js +144 -0
- package/dist/url.js.map +7 -0
- package/dist/utils/get-ipc.d.ts +16 -0
- package/dist/utils/get-ipc.js +60 -0
- package/dist/utils/get-ipc.js.map +7 -0
- package/dist/validation/json-parser.d.ts +10 -0
- package/dist/validation/json-parser.js +129 -0
- package/dist/validation/json-parser.js.map +7 -0
- package/dist/validation/types.d.ts +40 -0
- package/dist/validation/types.js +17 -0
- package/dist/validation/types.js.map +7 -0
- package/dist/versions.d.ts +87 -0
- package/dist/versions.js +155 -0
- package/dist/versions.js.map +7 -0
- package/dist/words.d.ts +22 -0
- package/dist/words.js +52 -0
- package/dist/words.js.map +7 -0
- package/dist/zod.d.ts +5 -0
- package/dist/zod.js +29 -0
- package/dist/zod.js.map +7 -0
- package/package.json +856 -7
package/dist/arrays.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* Socket Lib - Built with esbuild */
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var arrays_exports = {};
|
|
20
|
+
__export(arrays_exports, {
|
|
21
|
+
arrayChunk: () => arrayChunk,
|
|
22
|
+
arrayUnique: () => arrayUnique,
|
|
23
|
+
isArray: () => isArray,
|
|
24
|
+
joinAnd: () => joinAnd,
|
|
25
|
+
joinOr: () => joinOr
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(arrays_exports);
|
|
28
|
+
let _conjunctionFormatter;
|
|
29
|
+
// @__NO_SIDE_EFFECTS__
|
|
30
|
+
function getConjunctionFormatter() {
|
|
31
|
+
if (_conjunctionFormatter === void 0) {
|
|
32
|
+
_conjunctionFormatter = new Intl.ListFormat("en", {
|
|
33
|
+
style: "long",
|
|
34
|
+
// "and" lists.
|
|
35
|
+
type: "conjunction"
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return _conjunctionFormatter;
|
|
39
|
+
}
|
|
40
|
+
let _disjunctionFormatter;
|
|
41
|
+
// @__NO_SIDE_EFFECTS__
|
|
42
|
+
function getDisjunctionFormatter() {
|
|
43
|
+
if (_disjunctionFormatter === void 0) {
|
|
44
|
+
_disjunctionFormatter = new Intl.ListFormat("en", {
|
|
45
|
+
style: "long",
|
|
46
|
+
// "or" lists.
|
|
47
|
+
type: "disjunction"
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return _disjunctionFormatter;
|
|
51
|
+
}
|
|
52
|
+
// @__NO_SIDE_EFFECTS__
|
|
53
|
+
function arrayChunk(arr, size) {
|
|
54
|
+
const chunkSize = size ?? 2;
|
|
55
|
+
if (chunkSize <= 0) {
|
|
56
|
+
throw new Error("Chunk size must be greater than 0");
|
|
57
|
+
}
|
|
58
|
+
const { length } = arr;
|
|
59
|
+
const actualChunkSize = Math.min(length, chunkSize);
|
|
60
|
+
const chunks = [];
|
|
61
|
+
for (let i = 0; i < length; i += actualChunkSize) {
|
|
62
|
+
chunks.push(arr.slice(i, i + actualChunkSize));
|
|
63
|
+
}
|
|
64
|
+
return chunks;
|
|
65
|
+
}
|
|
66
|
+
// @__NO_SIDE_EFFECTS__
|
|
67
|
+
function arrayUnique(arr) {
|
|
68
|
+
return [...new Set(arr)];
|
|
69
|
+
}
|
|
70
|
+
const isArray = Array.isArray;
|
|
71
|
+
// @__NO_SIDE_EFFECTS__
|
|
72
|
+
function joinAnd(arr) {
|
|
73
|
+
return (/* @__PURE__ */ getConjunctionFormatter()).format(arr);
|
|
74
|
+
}
|
|
75
|
+
// @__NO_SIDE_EFFECTS__
|
|
76
|
+
function joinOr(arr) {
|
|
77
|
+
return (/* @__PURE__ */ getDisjunctionFormatter()).format(arr);
|
|
78
|
+
}
|
|
79
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
+
0 && (module.exports = {
|
|
81
|
+
arrayChunk,
|
|
82
|
+
arrayUnique,
|
|
83
|
+
isArray,
|
|
84
|
+
joinAnd,
|
|
85
|
+
joinOr
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=arrays.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/arrays.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @fileoverview Array utility functions for formatting lists and collections.\n * Provides conjunction and disjunction formatters using Intl.ListFormat.\n */\n\nlet _conjunctionFormatter: Intl.ListFormat | undefined\n/**\n * Get a cached Intl.ListFormat instance for conjunction (and) formatting.\n * @private\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getConjunctionFormatter() {\n if (_conjunctionFormatter === undefined) {\n _conjunctionFormatter = new Intl.ListFormat('en', {\n style: 'long',\n // \"and\" lists.\n type: 'conjunction',\n })\n }\n return _conjunctionFormatter\n}\n\nlet _disjunctionFormatter: Intl.ListFormat | undefined\n/**\n * Get a cached Intl.ListFormat instance for disjunction (or) formatting.\n * @private\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getDisjunctionFormatter() {\n if (_disjunctionFormatter === undefined) {\n _disjunctionFormatter = new Intl.ListFormat('en', {\n style: 'long',\n // \"or\" lists.\n type: 'disjunction',\n })\n }\n return _disjunctionFormatter\n}\n\n/**\n * Split an array into chunks of a specified size.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function arrayChunk<T>(\n arr: T[] | readonly T[],\n size?: number | undefined,\n): T[][] {\n const chunkSize = size ?? 2\n if (chunkSize <= 0) {\n throw new Error('Chunk size must be greater than 0')\n }\n const { length } = arr\n const actualChunkSize = Math.min(length, chunkSize)\n const chunks = []\n for (let i = 0; i < length; i += actualChunkSize) {\n chunks.push(arr.slice(i, i + actualChunkSize) as T[])\n }\n return chunks\n}\n\n/**\n * Get unique values from an array.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function arrayUnique<T>(arr: T[] | readonly T[]): T[] {\n return [...new Set(arr)]\n}\n\n// IMPORTANT: Do not use destructuring here - use direct assignment instead.\n// tsgo has a bug that incorrectly transpiles destructured exports, resulting in\n// `exports.SomeName = void 0;` which causes runtime errors.\n// See: https://github.com/SocketDev/socket-packageurl-js/issues/3\n\n/**\n * Alias for native Array.isArray.\n * Determines whether the passed value is an array.\n */\nexport const isArray = Array.isArray\n\n/**\n * Join array elements with proper \"and\" conjunction formatting.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function joinAnd(arr: string[] | readonly string[]): string {\n return getConjunctionFormatter().format(arr)\n}\n\n/**\n * Join array elements with proper \"or\" disjunction formatting.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function joinOr(arr: string[] | readonly string[]): string {\n return getDisjunctionFormatter().format(arr)\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,IAAI;AAAA;AAMJ,SAAS,0BAA0B;AACjC,MAAI,0BAA0B,QAAW;AACvC,4BAAwB,IAAI,KAAK,WAAW,MAAM;AAAA,MAChD,OAAO;AAAA;AAAA,MAEP,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAEA,IAAI;AAAA;AAMJ,SAAS,0BAA0B;AACjC,MAAI,0BAA0B,QAAW;AACvC,4BAAwB,IAAI,KAAK,WAAW,MAAM;AAAA,MAChD,OAAO;AAAA;AAAA,MAEP,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAAA;AAMO,SAAS,WACd,KACA,MACO;AACP,QAAM,YAAY,QAAQ;AAC1B,MAAI,aAAa,GAAG;AAClB,UAAM,IAAI,MAAM,mCAAmC;AAAA,EACrD;AACA,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,kBAAkB,KAAK,IAAI,QAAQ,SAAS;AAClD,QAAM,SAAS,CAAC;AAChB,WAAS,IAAI,GAAG,IAAI,QAAQ,KAAK,iBAAiB;AAChD,WAAO,KAAK,IAAI,MAAM,GAAG,IAAI,eAAe,CAAQ;AAAA,EACtD;AACA,SAAO;AACT;AAAA;AAMO,SAAS,YAAe,KAA8B;AAC3D,SAAO,CAAC,GAAG,IAAI,IAAI,GAAG,CAAC;AACzB;AAWO,MAAM,UAAU,MAAM;AAAA;AAMtB,SAAS,QAAQ,KAA2C;AACjE,UAAO,wCAAwB,GAAE,OAAO,GAAG;AAC7C;AAAA;AAMO,SAAS,OAAO,KAA2C;AAChE,UAAO,wCAAwB,GAAE,OAAO,GAAG;AAC7C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execute a binary with the given arguments.
|
|
3
|
+
*/
|
|
4
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
5
|
+
export declare function execBin(binPath: string, args?: string[], options?: import('./spawn').SpawnOptions): Promise<{
|
|
6
|
+
cmd: string;
|
|
7
|
+
args: string[] | readonly string[];
|
|
8
|
+
code: number;
|
|
9
|
+
signal: NodeJS.Signals;
|
|
10
|
+
stdout: string | Buffer<ArrayBufferLike>;
|
|
11
|
+
stderr: string | Buffer<ArrayBufferLike>;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Find and resolve a binary in the system PATH asynchronously.
|
|
15
|
+
* @template {import('which').Options} T
|
|
16
|
+
* @throws {Error} If the binary is not found and nothrow is false.
|
|
17
|
+
*/
|
|
18
|
+
export declare function whichBin(binName: string, options?: import('which').Options): Promise<string | string[] | undefined>;
|
|
19
|
+
/**
|
|
20
|
+
* Find and resolve a binary in the system PATH synchronously.
|
|
21
|
+
* @template {import('which').Options} T
|
|
22
|
+
* @throws {Error} If the binary is not found and nothrow is false.
|
|
23
|
+
*/
|
|
24
|
+
export declare function whichBinSync(binName: string, options?: import('which').Options): string | string[] | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Check if a directory path contains any shadow bin patterns.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isShadowBinPath(dirPath: string | undefined): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Find the real executable for a binary, bypassing shadow bins.
|
|
31
|
+
*/
|
|
32
|
+
export declare function findRealBin(binName: string, commonPaths?: string[]): string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Find the real npm executable, bypassing any aliases and shadow bins.
|
|
35
|
+
*/
|
|
36
|
+
export declare function findRealNpm(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Find the real pnpm executable, bypassing any aliases and shadow bins.
|
|
39
|
+
*/
|
|
40
|
+
export declare function findRealPnpm(): string;
|
|
41
|
+
/**
|
|
42
|
+
* Find the real yarn executable, bypassing any aliases and shadow bins.
|
|
43
|
+
*/
|
|
44
|
+
export declare function findRealYarn(): string;
|
|
45
|
+
/*@__NO_SIDE_EFFECTS__*/
|
|
46
|
+
/**
|
|
47
|
+
* Resolve a binary path to its actual executable file.
|
|
48
|
+
* Handles Windows .cmd wrappers and Unix shell scripts.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolveBinPathSync(binPath: string): string;
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
/* Socket Lib - Built with esbuild */
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var bin_exports = {};
|
|
20
|
+
__export(bin_exports, {
|
|
21
|
+
execBin: () => execBin,
|
|
22
|
+
findRealBin: () => findRealBin,
|
|
23
|
+
findRealNpm: () => findRealNpm,
|
|
24
|
+
findRealPnpm: () => findRealPnpm,
|
|
25
|
+
findRealYarn: () => findRealYarn,
|
|
26
|
+
isShadowBinPath: () => isShadowBinPath,
|
|
27
|
+
resolveBinPathSync: () => resolveBinPathSync,
|
|
28
|
+
whichBin: () => whichBin,
|
|
29
|
+
whichBinSync: () => whichBinSync
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(bin_exports);
|
|
32
|
+
var import_appdata = require("#env/appdata");
|
|
33
|
+
var import_home = require("#env/home");
|
|
34
|
+
var import_localappdata = require("#env/localappdata");
|
|
35
|
+
var import_xdg_data_home = require("#env/xdg-data-home");
|
|
36
|
+
var import_fs = require("./fs");
|
|
37
|
+
var import_objects = require("./objects");
|
|
38
|
+
var import_path = require("./path");
|
|
39
|
+
var import_spawn = require("./spawn");
|
|
40
|
+
let _fs;
|
|
41
|
+
// @__NO_SIDE_EFFECTS__
|
|
42
|
+
function getFs() {
|
|
43
|
+
if (_fs === void 0) {
|
|
44
|
+
_fs = require("node:fs");
|
|
45
|
+
}
|
|
46
|
+
return _fs;
|
|
47
|
+
}
|
|
48
|
+
let _path;
|
|
49
|
+
// @__NO_SIDE_EFFECTS__
|
|
50
|
+
function getPath() {
|
|
51
|
+
if (_path === void 0) {
|
|
52
|
+
_path = require("node:path");
|
|
53
|
+
}
|
|
54
|
+
return _path;
|
|
55
|
+
}
|
|
56
|
+
let _which;
|
|
57
|
+
// @__NO_SIDE_EFFECTS__
|
|
58
|
+
function getWhich() {
|
|
59
|
+
if (_which === void 0) {
|
|
60
|
+
_which = require("../external/which");
|
|
61
|
+
}
|
|
62
|
+
return _which;
|
|
63
|
+
}
|
|
64
|
+
// @__NO_SIDE_EFFECTS__
|
|
65
|
+
async function execBin(binPath, args, options) {
|
|
66
|
+
const resolvedPath = (0, import_path.isPath)(binPath) ? /* @__PURE__ */ resolveBinPathSync(binPath) : await whichBin(binPath);
|
|
67
|
+
if (!resolvedPath) {
|
|
68
|
+
const error = new Error(`Binary not found: ${binPath}`);
|
|
69
|
+
error.code = "ENOENT";
|
|
70
|
+
throw error;
|
|
71
|
+
}
|
|
72
|
+
const binCommand = Array.isArray(resolvedPath) ? (
|
|
73
|
+
// biome-ignore lint/style/noNonNullAssertion: which always returns non-empty array.
|
|
74
|
+
resolvedPath[0]
|
|
75
|
+
) : resolvedPath;
|
|
76
|
+
return await (0, import_spawn.spawn)(binCommand, args ?? [], options);
|
|
77
|
+
}
|
|
78
|
+
async function whichBin(binName, options) {
|
|
79
|
+
const which = /* @__PURE__ */ getWhich();
|
|
80
|
+
const opts = { nothrow: true, ...options };
|
|
81
|
+
const result = await which?.(binName, opts);
|
|
82
|
+
if (options?.all) {
|
|
83
|
+
const paths = Array.isArray(result) ? result : typeof result === "string" ? [result] : void 0;
|
|
84
|
+
return paths?.length ? paths.map((p) => /* @__PURE__ */ resolveBinPathSync(p)) : paths;
|
|
85
|
+
}
|
|
86
|
+
if (!result) {
|
|
87
|
+
return void 0;
|
|
88
|
+
}
|
|
89
|
+
return /* @__PURE__ */ resolveBinPathSync(result);
|
|
90
|
+
}
|
|
91
|
+
function whichBinSync(binName, options) {
|
|
92
|
+
const opts = { nothrow: true, ...options };
|
|
93
|
+
const result = (/* @__PURE__ */ getWhich())?.sync(binName, opts);
|
|
94
|
+
if ((0, import_objects.getOwn)(options, "all")) {
|
|
95
|
+
const paths = Array.isArray(result) ? result : typeof result === "string" ? [result] : void 0;
|
|
96
|
+
return paths?.length ? paths.map((p) => /* @__PURE__ */ resolveBinPathSync(p)) : paths;
|
|
97
|
+
}
|
|
98
|
+
if (!result) {
|
|
99
|
+
return void 0;
|
|
100
|
+
}
|
|
101
|
+
return /* @__PURE__ */ resolveBinPathSync(result);
|
|
102
|
+
}
|
|
103
|
+
function isShadowBinPath(dirPath) {
|
|
104
|
+
if (!dirPath) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
const normalized = dirPath.replace(/\\/g, "/");
|
|
108
|
+
return normalized.includes("node_modules/.bin");
|
|
109
|
+
}
|
|
110
|
+
function findRealBin(binName, commonPaths = []) {
|
|
111
|
+
const fs = /* @__PURE__ */ getFs();
|
|
112
|
+
const path = /* @__PURE__ */ getPath();
|
|
113
|
+
const which = /* @__PURE__ */ getWhich();
|
|
114
|
+
for (const binPath2 of commonPaths) {
|
|
115
|
+
if (fs?.existsSync(binPath2)) {
|
|
116
|
+
return binPath2;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const binPath = which?.sync(binName, { nothrow: true });
|
|
120
|
+
if (binPath) {
|
|
121
|
+
const binDir = path?.dirname(binPath);
|
|
122
|
+
if (isShadowBinPath(binDir)) {
|
|
123
|
+
const allPaths = which?.sync(binName, { all: true, nothrow: true }) || [];
|
|
124
|
+
const pathsArray = Array.isArray(allPaths) ? allPaths : typeof allPaths === "string" ? [allPaths] : [];
|
|
125
|
+
for (const altPath of pathsArray) {
|
|
126
|
+
const altDir = path?.dirname(altPath);
|
|
127
|
+
if (!isShadowBinPath(altDir)) {
|
|
128
|
+
return altPath;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return binPath;
|
|
133
|
+
}
|
|
134
|
+
return void 0;
|
|
135
|
+
}
|
|
136
|
+
function findRealNpm() {
|
|
137
|
+
const fs = /* @__PURE__ */ getFs();
|
|
138
|
+
const path = /* @__PURE__ */ getPath();
|
|
139
|
+
const nodeDir = path?.dirname(process.execPath);
|
|
140
|
+
const npmInNodeDir = path?.join(nodeDir, "npm");
|
|
141
|
+
if (fs?.existsSync(npmInNodeDir)) {
|
|
142
|
+
return npmInNodeDir;
|
|
143
|
+
}
|
|
144
|
+
const commonPaths = ["/usr/local/bin/npm", "/usr/bin/npm"];
|
|
145
|
+
const result = findRealBin("npm", commonPaths);
|
|
146
|
+
if (result && fs?.existsSync(result)) {
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
149
|
+
const npmPath = whichBinSync("npm", { nothrow: true });
|
|
150
|
+
if (npmPath && typeof npmPath === "string" && fs?.existsSync(npmPath)) {
|
|
151
|
+
return npmPath;
|
|
152
|
+
}
|
|
153
|
+
return "npm";
|
|
154
|
+
}
|
|
155
|
+
function findRealPnpm() {
|
|
156
|
+
const WIN32 = require("../constants/platform").WIN32;
|
|
157
|
+
const path = /* @__PURE__ */ getPath();
|
|
158
|
+
const commonPaths = WIN32 ? [
|
|
159
|
+
// Windows common paths.
|
|
160
|
+
path?.join(import_appdata.APPDATA, "npm", "pnpm.cmd"),
|
|
161
|
+
path?.join(import_appdata.APPDATA, "npm", "pnpm"),
|
|
162
|
+
path?.join(import_localappdata.LOCALAPPDATA, "pnpm", "pnpm.cmd"),
|
|
163
|
+
path?.join(import_localappdata.LOCALAPPDATA, "pnpm", "pnpm"),
|
|
164
|
+
"C:\\Program Files\\nodejs\\pnpm.cmd",
|
|
165
|
+
"C:\\Program Files\\nodejs\\pnpm"
|
|
166
|
+
].filter(Boolean) : [
|
|
167
|
+
// Unix common paths.
|
|
168
|
+
"/usr/local/bin/pnpm",
|
|
169
|
+
"/usr/bin/pnpm",
|
|
170
|
+
path?.join(
|
|
171
|
+
import_xdg_data_home.XDG_DATA_HOME || `${import_home.HOME}/.local/share`,
|
|
172
|
+
"pnpm/pnpm"
|
|
173
|
+
),
|
|
174
|
+
path?.join(import_home.HOME, ".pnpm/pnpm")
|
|
175
|
+
].filter(Boolean);
|
|
176
|
+
return findRealBin("pnpm", commonPaths) ?? "";
|
|
177
|
+
}
|
|
178
|
+
function findRealYarn() {
|
|
179
|
+
const path = /* @__PURE__ */ getPath();
|
|
180
|
+
const commonPaths = [
|
|
181
|
+
"/usr/local/bin/yarn",
|
|
182
|
+
"/usr/bin/yarn",
|
|
183
|
+
path?.join(import_home.HOME, ".yarn/bin/yarn"),
|
|
184
|
+
path?.join(import_home.HOME, ".config/yarn/global/node_modules/.bin/yarn")
|
|
185
|
+
].filter(Boolean);
|
|
186
|
+
return findRealBin("yarn", commonPaths) ?? "";
|
|
187
|
+
}
|
|
188
|
+
// @__NO_SIDE_EFFECTS__
|
|
189
|
+
function resolveBinPathSync(binPath) {
|
|
190
|
+
const fs = /* @__PURE__ */ getFs();
|
|
191
|
+
const path = /* @__PURE__ */ getPath();
|
|
192
|
+
if (!path?.isAbsolute(binPath)) {
|
|
193
|
+
try {
|
|
194
|
+
const resolved = whichBinSync(binPath);
|
|
195
|
+
if (resolved) {
|
|
196
|
+
binPath = resolved;
|
|
197
|
+
}
|
|
198
|
+
} catch {
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
binPath = (0, import_path.normalizePath)(binPath);
|
|
202
|
+
if (binPath === ".") {
|
|
203
|
+
return binPath;
|
|
204
|
+
}
|
|
205
|
+
const ext = path?.extname(binPath);
|
|
206
|
+
const extLowered = ext.toLowerCase();
|
|
207
|
+
const basename = path?.basename(binPath, ext);
|
|
208
|
+
const voltaIndex = basename === "node" ? -1 : /(?<=\/)\.volta\//i.exec(binPath)?.index ?? -1;
|
|
209
|
+
if (voltaIndex !== -1) {
|
|
210
|
+
const voltaPath = binPath.slice(0, voltaIndex);
|
|
211
|
+
const voltaToolsPath = path?.join(voltaPath, "tools");
|
|
212
|
+
const voltaImagePath = path?.join(voltaToolsPath, "image");
|
|
213
|
+
const voltaUserPath = path?.join(voltaToolsPath, "user");
|
|
214
|
+
const voltaPlatform = (0, import_fs.readJsonSync)(
|
|
215
|
+
path?.join(voltaUserPath, "platform.json"),
|
|
216
|
+
{ throws: false }
|
|
217
|
+
);
|
|
218
|
+
const voltaNodeVersion = voltaPlatform?.node?.runtime;
|
|
219
|
+
const voltaNpmVersion = voltaPlatform?.node?.npm;
|
|
220
|
+
let voltaBinPath = "";
|
|
221
|
+
if (basename === "npm" || basename === "npx") {
|
|
222
|
+
if (voltaNpmVersion) {
|
|
223
|
+
const relCliPath = `bin/${basename}-cli.js`;
|
|
224
|
+
voltaBinPath = path?.join(
|
|
225
|
+
voltaImagePath,
|
|
226
|
+
`npm/${voltaNpmVersion}/${relCliPath}`
|
|
227
|
+
);
|
|
228
|
+
if (voltaNodeVersion && !fs?.existsSync(voltaBinPath)) {
|
|
229
|
+
voltaBinPath = path?.join(
|
|
230
|
+
voltaImagePath,
|
|
231
|
+
`node/${voltaNodeVersion}/lib/node_modules/npm/${relCliPath}`
|
|
232
|
+
);
|
|
233
|
+
if (!fs?.existsSync(voltaBinPath)) {
|
|
234
|
+
voltaBinPath = "";
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
} else {
|
|
239
|
+
const voltaUserBinPath = path?.join(voltaUserPath, "bin");
|
|
240
|
+
const binInfo = (0, import_fs.readJsonSync)(
|
|
241
|
+
path?.join(voltaUserBinPath, `${basename}.json`),
|
|
242
|
+
{ throws: false }
|
|
243
|
+
);
|
|
244
|
+
const binPackage = binInfo?.package;
|
|
245
|
+
if (binPackage) {
|
|
246
|
+
voltaBinPath = path?.join(
|
|
247
|
+
voltaImagePath,
|
|
248
|
+
`packages/${binPackage}/bin/${basename}`
|
|
249
|
+
);
|
|
250
|
+
if (!fs?.existsSync(voltaBinPath)) {
|
|
251
|
+
voltaBinPath = `${voltaBinPath}.cmd`;
|
|
252
|
+
if (!fs?.existsSync(voltaBinPath)) {
|
|
253
|
+
voltaBinPath = "";
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
if (voltaBinPath) {
|
|
259
|
+
try {
|
|
260
|
+
return (0, import_path.normalizePath)(fs?.realpathSync.native(voltaBinPath));
|
|
261
|
+
} catch {
|
|
262
|
+
}
|
|
263
|
+
return voltaBinPath;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
const WIN32 = require("../constants/platform").WIN32;
|
|
267
|
+
if (WIN32) {
|
|
268
|
+
const hasKnownExt = extLowered === "" || extLowered === ".cmd" || extLowered === ".exe" || extLowered === ".ps1";
|
|
269
|
+
const isNpmOrNpx = basename === "npm" || basename === "npx";
|
|
270
|
+
const isPnpmOrYarn = basename === "pnpm" || basename === "yarn";
|
|
271
|
+
if (hasKnownExt && isNpmOrNpx) {
|
|
272
|
+
const quickPath = path?.join(
|
|
273
|
+
path?.dirname(binPath),
|
|
274
|
+
`node_modules/npm/bin/${basename}-cli.js`
|
|
275
|
+
);
|
|
276
|
+
if (fs?.existsSync(quickPath)) {
|
|
277
|
+
try {
|
|
278
|
+
return fs?.realpathSync.native(quickPath);
|
|
279
|
+
} catch {
|
|
280
|
+
}
|
|
281
|
+
return quickPath;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
let relPath = "";
|
|
285
|
+
if (hasKnownExt && // Only parse shell scripts and batch files, not actual executables.
|
|
286
|
+
// .exe files are already executables and don't need path resolution from wrapper scripts.
|
|
287
|
+
extLowered !== ".exe" && // Check if file exists before attempting to read it to avoid ENOENT errors.
|
|
288
|
+
fs?.existsSync(binPath)) {
|
|
289
|
+
const source = fs?.readFileSync(binPath, "utf8");
|
|
290
|
+
if (isNpmOrNpx) {
|
|
291
|
+
if (extLowered === ".cmd") {
|
|
292
|
+
relPath = basename === "npm" ? /(?<="NPM_CLI_JS=%~dp0\\).*(?=")/.exec(source)?.[0] || "" : /(?<="NPX_CLI_JS=%~dp0\\).*(?=")/.exec(source)?.[0] || "";
|
|
293
|
+
} else if (extLowered === "") {
|
|
294
|
+
relPath = basename === "npm" ? /(?<=NPM_CLI_JS="\$CLI_BASEDIR\/).*(?=")/.exec(source)?.[0] || "" : /(?<=NPX_CLI_JS="\$CLI_BASEDIR\/).*(?=")/.exec(source)?.[0] || "";
|
|
295
|
+
} else if (extLowered === ".ps1") {
|
|
296
|
+
relPath = basename === "npm" ? /(?<=\$NPM_CLI_JS="\$PSScriptRoot\/).*(?=")/.exec(
|
|
297
|
+
source
|
|
298
|
+
)?.[0] || "" : /(?<=\$NPX_CLI_JS="\$PSScriptRoot\/).*(?=")/.exec(
|
|
299
|
+
source
|
|
300
|
+
)?.[0] || "";
|
|
301
|
+
}
|
|
302
|
+
} else if (isPnpmOrYarn) {
|
|
303
|
+
if (extLowered === ".cmd") {
|
|
304
|
+
relPath = /(?<=node\s+")%~dp0\\([^"]+)(?="\s+%\*)/.exec(source)?.[1] || "";
|
|
305
|
+
if (!relPath) {
|
|
306
|
+
relPath = /(?<="%~dp0\\[^"]*node[^"]*"\s+")%~dp0\\([^"]+)(?="\s+%\*)/.exec(
|
|
307
|
+
source
|
|
308
|
+
)?.[1] || "";
|
|
309
|
+
}
|
|
310
|
+
if (!relPath) {
|
|
311
|
+
relPath = /(?<="%dp0%\\).*(?=" %\*\r\n)/.exec(source)?.[0] || "";
|
|
312
|
+
}
|
|
313
|
+
} else if (extLowered === "") {
|
|
314
|
+
relPath = /(?<="\$basedir\/)\.tools\/pnpm\/[^"]+(?="\s+"\$@")/.exec(
|
|
315
|
+
source
|
|
316
|
+
)?.[0] || "";
|
|
317
|
+
if (!relPath) {
|
|
318
|
+
relPath = /(?<=exec\s+node\s+"\$basedir\/)\.tools\/pnpm\/[^"]+(?="\s+"\$@")/.exec(
|
|
319
|
+
source
|
|
320
|
+
)?.[0] || "";
|
|
321
|
+
}
|
|
322
|
+
if (!relPath) {
|
|
323
|
+
relPath = /(?<="\$basedir\/).*(?=" "\$@"\n)/.exec(source)?.[0] || "";
|
|
324
|
+
}
|
|
325
|
+
} else if (extLowered === ".ps1") {
|
|
326
|
+
relPath = /(?<="\$basedir\/).*(?=" $args\n)/.exec(source)?.[0] || "";
|
|
327
|
+
}
|
|
328
|
+
} else if (extLowered === ".cmd") {
|
|
329
|
+
relPath = /(?<="%dp0%\\).*(?=" %\*\r\n)/.exec(source)?.[0] || "";
|
|
330
|
+
} else if (extLowered === "") {
|
|
331
|
+
relPath = /(?<="$basedir\/).*(?=" "\$@"\n)/.exec(source)?.[0] || "";
|
|
332
|
+
} else if (extLowered === ".ps1") {
|
|
333
|
+
relPath = /(?<="\$basedir\/).*(?=" $args\n)/.exec(source)?.[0] || "";
|
|
334
|
+
}
|
|
335
|
+
if (relPath) {
|
|
336
|
+
binPath = (0, import_path.normalizePath)(path?.resolve(path?.dirname(binPath), relPath));
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
} else {
|
|
340
|
+
let hasNoExt = extLowered === "";
|
|
341
|
+
const isPnpmOrYarn = basename === "pnpm" || basename === "yarn";
|
|
342
|
+
const isNpmOrNpx = basename === "npm" || basename === "npx";
|
|
343
|
+
if (isPnpmOrYarn && binPath.includes("/.bin/pnpm/bin/")) {
|
|
344
|
+
const binIndex = binPath.indexOf("/.bin/pnpm");
|
|
345
|
+
if (binIndex !== -1) {
|
|
346
|
+
const baseBinPath = binPath.slice(0, binIndex + "/.bin/pnpm".length);
|
|
347
|
+
try {
|
|
348
|
+
const stats = fs?.statSync(baseBinPath);
|
|
349
|
+
if (stats.isFile()) {
|
|
350
|
+
binPath = (0, import_path.normalizePath)(baseBinPath);
|
|
351
|
+
hasNoExt = !path?.extname(binPath);
|
|
352
|
+
}
|
|
353
|
+
} catch {
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
if (hasNoExt && (isPnpmOrYarn || isNpmOrNpx) && // For extensionless files (Unix shell scripts), verify existence before reading.
|
|
358
|
+
// This prevents ENOENT errors when the bin path doesn't exist.
|
|
359
|
+
fs?.existsSync(binPath)) {
|
|
360
|
+
const source = fs?.readFileSync(binPath, "utf8");
|
|
361
|
+
let relPath = "";
|
|
362
|
+
if (isPnpmOrYarn) {
|
|
363
|
+
relPath = /(?<="\$basedir\/)\.tools\/[^"]+(?="\s+"\$@")/.exec(source)?.[0] || "";
|
|
364
|
+
if (!relPath) {
|
|
365
|
+
relPath = /(?<="\$basedir\/)[^"]+(?="\s+"\$@")/.exec(source)?.[0] || "";
|
|
366
|
+
}
|
|
367
|
+
if (!relPath) {
|
|
368
|
+
const match = /exec\s+node\s+"?\$basedir\/([^"]+)"?\s+"\$@"/.exec(
|
|
369
|
+
source
|
|
370
|
+
);
|
|
371
|
+
if (match) {
|
|
372
|
+
relPath = match[1] || "";
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
if (relPath && basename === "pnpm" && relPath.startsWith("pnpm/")) {
|
|
376
|
+
relPath = `../${relPath}`;
|
|
377
|
+
}
|
|
378
|
+
} else if (isNpmOrNpx) {
|
|
379
|
+
relPath = basename === "npm" ? /(?<=NPM_CLI_JS="\$CLI_BASEDIR\/).*(?=")/.exec(source)?.[0] || "" : /(?<=NPX_CLI_JS="\$CLI_BASEDIR\/).*(?=")/.exec(source)?.[0] || "";
|
|
380
|
+
}
|
|
381
|
+
if (relPath) {
|
|
382
|
+
binPath = (0, import_path.normalizePath)(path?.resolve(path?.dirname(binPath), relPath));
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
try {
|
|
387
|
+
const realPath = fs?.realpathSync.native(binPath);
|
|
388
|
+
return (0, import_path.normalizePath)(realPath);
|
|
389
|
+
} catch {
|
|
390
|
+
}
|
|
391
|
+
return (0, import_path.normalizePath)(binPath);
|
|
392
|
+
}
|
|
393
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
394
|
+
0 && (module.exports = {
|
|
395
|
+
execBin,
|
|
396
|
+
findRealBin,
|
|
397
|
+
findRealNpm,
|
|
398
|
+
findRealPnpm,
|
|
399
|
+
findRealYarn,
|
|
400
|
+
isShadowBinPath,
|
|
401
|
+
resolveBinPathSync,
|
|
402
|
+
whichBin,
|
|
403
|
+
whichBinSync
|
|
404
|
+
});
|
|
405
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/bin.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @fileoverview Binary path resolution and execution utilities for package managers.\n * Provides cross-platform bin path lookup, command execution, and path normalization.\n */\n\nimport { APPDATA } from '#env/appdata'\nimport { HOME } from '#env/home'\nimport { LOCALAPPDATA } from '#env/localappdata'\nimport { XDG_DATA_HOME } from '#env/xdg-data-home'\n\nimport { readJsonSync } from './fs'\nimport { getOwn } from './objects'\nimport { isPath, normalizePath } from './path'\nimport { spawn } from './spawn'\n\nlet _fs: typeof import('node:fs') | undefined\n/**\n * Lazily load the fs module to avoid Webpack errors.\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getFs() {\n if (_fs === undefined) {\n // Use non-'node:' prefixed require to avoid Webpack errors.\n\n _fs = /*@__PURE__*/ require('node:fs')\n }\n // biome-ignore lint/style/noNonNullAssertion: Initialized above.\n return _fs!\n}\n\nlet _path: typeof import('node:path') | undefined\n/**\n * Lazily load the path module to avoid Webpack errors.\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getPath() {\n if (_path === undefined) {\n // Use non-'node:' prefixed require to avoid Webpack errors.\n\n _path = /*@__PURE__*/ require('node:path')\n }\n // biome-ignore lint/style/noNonNullAssertion: Initialized above.\n return _path!\n}\n\nlet _which: typeof import('which') | undefined\n/**\n * Lazily load the which module for finding executables.\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getWhich() {\n if (_which === undefined) {\n _which = /*@__PURE__*/ require('../external/which')\n }\n // biome-ignore lint/style/noNonNullAssertion: Initialized above.\n return _which!\n}\n\n/**\n * Execute a binary with the given arguments.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport async function execBin(\n binPath: string,\n args?: string[],\n options?: import('./spawn').SpawnOptions,\n) {\n // Resolve the binary path.\n const resolvedPath = isPath(binPath)\n ? resolveBinPathSync(binPath)\n : await whichBin(binPath)\n\n if (!resolvedPath) {\n const error = new Error(`Binary not found: ${binPath}`) as Error & {\n code: string\n }\n error.code = 'ENOENT'\n throw error\n }\n\n // Execute the binary directly.\n const binCommand = Array.isArray(resolvedPath)\n ? // biome-ignore lint/style/noNonNullAssertion: which always returns non-empty array.\n resolvedPath[0]!\n : resolvedPath\n return await spawn(binCommand, args ?? [], options)\n}\n\n/**\n * Find and resolve a binary in the system PATH asynchronously.\n * @template {import('which').Options} T\n * @throws {Error} If the binary is not found and nothrow is false.\n */\nexport async function whichBin(\n binName: string,\n options?: import('which').Options,\n): Promise<string | string[] | undefined> {\n const which = getWhich()\n // Default to nothrow: true if not specified to return undefined instead of throwing\n const opts = { nothrow: true, ...options }\n // Depending on options `which` may throw if `binName` is not found.\n // With nothrow: true, it returns null when `binName` is not found.\n const result = await which?.(binName, opts)\n\n // When 'all: true' is specified, ensure we always return an array.\n if (options?.all) {\n const paths = Array.isArray(result)\n ? result\n : typeof result === 'string'\n ? [result]\n : undefined\n // If all is true and we have paths, resolve each one.\n return paths?.length ? paths.map(p => resolveBinPathSync(p)) : paths\n }\n\n // If result is undefined (binary not found), return undefined\n if (!result) {\n return undefined\n }\n\n return resolveBinPathSync(result)\n}\n\n/**\n * Find and resolve a binary in the system PATH synchronously.\n * @template {import('which').Options} T\n * @throws {Error} If the binary is not found and nothrow is false.\n */\nexport function whichBinSync(\n binName: string,\n options?: import('which').Options,\n): string | string[] | undefined {\n // Default to nothrow: true if not specified to return undefined instead of throwing\n const opts = { nothrow: true, ...options }\n // Depending on options `which` may throw if `binName` is not found.\n // With nothrow: true, it returns null when `binName` is not found.\n const result = getWhich()?.sync(binName, opts)\n\n // When 'all: true' is specified, ensure we always return an array.\n if (getOwn(options, 'all')) {\n const paths = Array.isArray(result)\n ? result\n : typeof result === 'string'\n ? [result]\n : undefined\n // If all is true and we have paths, resolve each one.\n return paths?.length ? paths.map(p => resolveBinPathSync(p)) : paths\n }\n\n // If result is undefined (binary not found), return undefined\n if (!result) {\n return undefined\n }\n\n return resolveBinPathSync(result)\n}\n\n/**\n * Check if a directory path contains any shadow bin patterns.\n */\nexport function isShadowBinPath(dirPath: string | undefined): boolean {\n if (!dirPath) {\n return false\n }\n // Check for node_modules/.bin pattern (Unix and Windows)\n const normalized = dirPath.replace(/\\\\/g, '/')\n return normalized.includes('node_modules/.bin')\n}\n\n/**\n * Find the real executable for a binary, bypassing shadow bins.\n */\nexport function findRealBin(\n binName: string,\n commonPaths: string[] = [],\n): string | undefined {\n const fs = getFs()\n const path = getPath()\n const which = getWhich()\n\n // Try common locations first.\n for (const binPath of commonPaths) {\n if (fs?.existsSync(binPath)) {\n return binPath\n }\n }\n\n // Fall back to which.sync if no direct path found.\n const binPath = which?.sync(binName, { nothrow: true })\n if (binPath) {\n const binDir = path?.dirname(binPath)\n\n if (isShadowBinPath(binDir)) {\n // This is likely a shadowed binary, try to find the real one.\n const allPaths = which?.sync(binName, { all: true, nothrow: true }) || []\n // Ensure allPaths is an array.\n const pathsArray = Array.isArray(allPaths)\n ? allPaths\n : typeof allPaths === 'string'\n ? [allPaths]\n : []\n\n for (const altPath of pathsArray) {\n const altDir = path?.dirname(altPath)\n if (!isShadowBinPath(altDir)) {\n return altPath\n }\n }\n }\n return binPath\n }\n // If all else fails, return undefined to indicate binary not found.\n return undefined\n}\n\n/**\n * Find the real npm executable, bypassing any aliases and shadow bins.\n */\nexport function findRealNpm(): string {\n const fs = getFs()\n const path = getPath()\n\n // Try to find npm in the same directory as the node executable.\n const nodeDir = path?.dirname(process.execPath)\n const npmInNodeDir = path?.join(nodeDir, 'npm')\n\n if (fs?.existsSync(npmInNodeDir)) {\n return npmInNodeDir\n }\n\n // Try common npm locations.\n const commonPaths = ['/usr/local/bin/npm', '/usr/bin/npm']\n const result = findRealBin('npm', commonPaths)\n\n // If we found a valid path, return it.\n if (result && fs?.existsSync(result)) {\n return result\n }\n\n // As a last resort, try to use whichBinSync to find npm.\n // This handles cases where npm is installed in non-standard locations.\n const npmPath = whichBinSync('npm', { nothrow: true })\n if (npmPath && typeof npmPath === 'string' && fs?.existsSync(npmPath)) {\n return npmPath\n }\n\n // Return the basic 'npm' and let the system resolve it.\n return 'npm'\n}\n\n/**\n * Find the real pnpm executable, bypassing any aliases and shadow bins.\n */\nexport function findRealPnpm(): string {\n const WIN32 = require('../constants/platform').WIN32\n const path = getPath()\n\n // Try common pnpm locations.\n const commonPaths = WIN32\n ? [\n // Windows common paths.\n path?.join(APPDATA as string, 'npm', 'pnpm.cmd'),\n path?.join(APPDATA as string, 'npm', 'pnpm'),\n path?.join(LOCALAPPDATA as string, 'pnpm', 'pnpm.cmd'),\n path?.join(LOCALAPPDATA as string, 'pnpm', 'pnpm'),\n 'C:\\\\Program Files\\\\nodejs\\\\pnpm.cmd',\n 'C:\\\\Program Files\\\\nodejs\\\\pnpm',\n ].filter(Boolean)\n : [\n // Unix common paths.\n '/usr/local/bin/pnpm',\n '/usr/bin/pnpm',\n path?.join(\n (XDG_DATA_HOME as string) || `${HOME as string}/.local/share`,\n 'pnpm/pnpm',\n ),\n path?.join(HOME as string, '.pnpm/pnpm'),\n ].filter(Boolean)\n\n return findRealBin('pnpm', commonPaths) ?? ''\n}\n\n/**\n * Find the real yarn executable, bypassing any aliases and shadow bins.\n */\nexport function findRealYarn(): string {\n const path = getPath()\n\n // Try common yarn locations.\n const commonPaths = [\n '/usr/local/bin/yarn',\n '/usr/bin/yarn',\n path?.join(HOME as string, '.yarn/bin/yarn'),\n path?.join(HOME as string, '.config/yarn/global/node_modules/.bin/yarn'),\n ].filter(Boolean)\n\n return findRealBin('yarn', commonPaths) ?? ''\n}\n\n/*@__NO_SIDE_EFFECTS__*/\n/**\n * Resolve a binary path to its actual executable file.\n * Handles Windows .cmd wrappers and Unix shell scripts.\n */\nexport function resolveBinPathSync(binPath: string): string {\n const fs = getFs()\n const path = getPath()\n\n // If it's not an absolute path, try to find it in PATH first\n if (!path?.isAbsolute(binPath)) {\n try {\n const resolved = whichBinSync(binPath)\n if (resolved) {\n // biome-ignore lint/style/noParameterAssign: Reassigning for normalization.\n binPath = resolved as string\n }\n } catch {}\n }\n\n // Normalize the path once for consistent pattern matching.\n // biome-ignore lint/style/noParameterAssign: Normalizing path for consistent handling.\n binPath = normalizePath(binPath)\n\n // Handle empty string that normalized to '.' (current directory)\n if (binPath === '.') {\n return binPath\n }\n\n const ext = path?.extname(binPath)\n const extLowered = ext.toLowerCase()\n const basename = path?.basename(binPath, ext)\n const voltaIndex =\n basename === 'node' ? -1 : (/(?<=\\/)\\.volta\\//i.exec(binPath)?.index ?? -1)\n if (voltaIndex !== -1) {\n const voltaPath = binPath.slice(0, voltaIndex)\n const voltaToolsPath = path?.join(voltaPath, 'tools')\n const voltaImagePath = path?.join(voltaToolsPath, 'image')\n const voltaUserPath = path?.join(voltaToolsPath, 'user')\n const voltaPlatform = readJsonSync(\n path?.join(voltaUserPath, 'platform.json'),\n { throws: false },\n ) as\n // biome-ignore lint/suspicious/noExplicitAny: Volta platform config structure is dynamic.\n any\n const voltaNodeVersion = voltaPlatform?.node?.runtime\n const voltaNpmVersion = voltaPlatform?.node?.npm\n let voltaBinPath = ''\n if (basename === 'npm' || basename === 'npx') {\n if (voltaNpmVersion) {\n const relCliPath = `bin/${basename}-cli.js`\n voltaBinPath = path?.join(\n voltaImagePath,\n `npm/${voltaNpmVersion}/${relCliPath}`,\n )\n if (voltaNodeVersion && !fs?.existsSync(voltaBinPath)) {\n voltaBinPath = path?.join(\n voltaImagePath,\n `node/${voltaNodeVersion}/lib/node_modules/npm/${relCliPath}`,\n )\n if (!fs?.existsSync(voltaBinPath)) {\n voltaBinPath = ''\n }\n }\n }\n } else {\n const voltaUserBinPath = path?.join(voltaUserPath, 'bin')\n const binInfo = readJsonSync(\n path?.join(voltaUserBinPath, `${basename}.json`),\n { throws: false },\n ) as\n // biome-ignore lint/suspicious/noExplicitAny: Volta bin info structure is dynamic.\n any\n const binPackage = binInfo?.package\n if (binPackage) {\n voltaBinPath = path?.join(\n voltaImagePath,\n `packages/${binPackage}/bin/${basename}`,\n )\n if (!fs?.existsSync(voltaBinPath)) {\n voltaBinPath = `${voltaBinPath}.cmd`\n if (!fs?.existsSync(voltaBinPath)) {\n voltaBinPath = ''\n }\n }\n }\n }\n if (voltaBinPath) {\n try {\n return normalizePath(fs?.realpathSync.native(voltaBinPath))\n } catch {}\n return voltaBinPath\n }\n }\n const WIN32 = require('../constants/platform').WIN32\n if (WIN32) {\n const hasKnownExt =\n extLowered === '' ||\n extLowered === '.cmd' ||\n extLowered === '.exe' ||\n extLowered === '.ps1'\n const isNpmOrNpx = basename === 'npm' || basename === 'npx'\n const isPnpmOrYarn = basename === 'pnpm' || basename === 'yarn'\n if (hasKnownExt && isNpmOrNpx) {\n // The quick route assumes a bin path like: C:\\Program Files\\nodejs\\npm.cmd\n const quickPath = path?.join(\n path?.dirname(binPath),\n `node_modules/npm/bin/${basename}-cli.js`,\n )\n if (fs?.existsSync(quickPath)) {\n try {\n return fs?.realpathSync.native(quickPath)\n } catch {}\n return quickPath\n }\n }\n let relPath = ''\n if (\n hasKnownExt &&\n // Only parse shell scripts and batch files, not actual executables.\n // .exe files are already executables and don't need path resolution from wrapper scripts.\n extLowered !== '.exe' &&\n // Check if file exists before attempting to read it to avoid ENOENT errors.\n fs?.existsSync(binPath)\n ) {\n const source = fs?.readFileSync(binPath, 'utf8')\n if (isNpmOrNpx) {\n if (extLowered === '.cmd') {\n // \"npm.cmd\" and \"npx.cmd\" defined by\n // https://github.com/npm/cli/blob/v11.4.2/bin/npm.cmd\n // https://github.com/npm/cli/blob/v11.4.2/bin/npx.cmd\n relPath =\n basename === 'npm'\n ? /(?<=\"NPM_CLI_JS=%~dp0\\\\).*(?=\")/.exec(source)?.[0] || ''\n : /(?<=\"NPX_CLI_JS=%~dp0\\\\).*(?=\")/.exec(source)?.[0] || ''\n } else if (extLowered === '') {\n // Extensionless \"npm\" and \"npx\" defined by\n // https://github.com/npm/cli/blob/v11.4.2/bin/npm\n // https://github.com/npm/cli/blob/v11.4.2/bin/npx\n relPath =\n basename === 'npm'\n ? /(?<=NPM_CLI_JS=\"\\$CLI_BASEDIR\\/).*(?=\")/.exec(source)?.[0] ||\n ''\n : /(?<=NPX_CLI_JS=\"\\$CLI_BASEDIR\\/).*(?=\")/.exec(source)?.[0] ||\n ''\n } else if (extLowered === '.ps1') {\n // \"npm.ps1\" and \"npx.ps1\" defined by\n // https://github.com/npm/cli/blob/v11.4.2/bin/npm.ps1\n // https://github.com/npm/cli/blob/v11.4.2/bin/npx.ps1\n relPath =\n basename === 'npm'\n ? /(?<=\\$NPM_CLI_JS=\"\\$PSScriptRoot\\/).*(?=\")/.exec(\n source,\n )?.[0] || ''\n : /(?<=\\$NPX_CLI_JS=\"\\$PSScriptRoot\\/).*(?=\")/.exec(\n source,\n )?.[0] || ''\n }\n } else if (isPnpmOrYarn) {\n if (extLowered === '.cmd') {\n // pnpm.cmd and yarn.cmd can have different formats depending on installation method\n // Common formats include:\n // 1. Setup-pnpm action format: node \"%~dp0\\..\\pnpm\\bin\\pnpm.cjs\" %*\n // 2. npm install -g pnpm format: similar to cmd-shim\n // 3. Standalone installer format: various patterns\n\n // Try setup-pnpm/setup-yarn action format first\n relPath =\n /(?<=node\\s+\")%~dp0\\\\([^\"]+)(?=\"\\s+%\\*)/.exec(source)?.[1] || ''\n\n // Try alternative format: \"%~dp0\\node.exe\" \"%~dp0\\..\\package\\bin\\binary.js\" %*\n if (!relPath) {\n relPath =\n /(?<=\"%~dp0\\\\[^\"]*node[^\"]*\"\\s+\")%~dp0\\\\([^\"]+)(?=\"\\s+%\\*)/.exec(\n source,\n )?.[1] || ''\n }\n\n // Try cmd-shim format as fallback\n if (!relPath) {\n relPath = /(?<=\"%dp0%\\\\).*(?=\" %\\*\\r\\n)/.exec(source)?.[0] || ''\n }\n } else if (extLowered === '') {\n // Extensionless pnpm/yarn - try common shebang formats\n // Handle pnpm installed via standalone installer or global install\n // Format: exec \"$basedir/node\" \"$basedir/.tools/pnpm/VERSION/...\" \"$@\"\n // Note: may have multiple spaces between arguments\n relPath =\n /(?<=\"\\$basedir\\/)\\.tools\\/pnpm\\/[^\"]+(?=\"\\s+\"\\$@\")/.exec(\n source,\n )?.[0] || ''\n if (!relPath) {\n // Also try: exec node \"$basedir/.tools/pnpm/VERSION/...\" \"$@\"\n relPath =\n /(?<=exec\\s+node\\s+\"\\$basedir\\/)\\.tools\\/pnpm\\/[^\"]+(?=\"\\s+\"\\$@\")/.exec(\n source,\n )?.[0] || ''\n }\n if (!relPath) {\n // Try standard cmd-shim format: exec node \"$basedir/../package/bin/binary.js\" \"$@\"\n relPath = /(?<=\"\\$basedir\\/).*(?=\" \"\\$@\"\\n)/.exec(source)?.[0] || ''\n }\n } else if (extLowered === '.ps1') {\n // PowerShell format\n relPath = /(?<=\"\\$basedir\\/).*(?=\" $args\\n)/.exec(source)?.[0] || ''\n }\n } else if (extLowered === '.cmd') {\n // \"bin.CMD\" generated by\n // https://github.com/npm/cmd-shim/blob/v7.0.0/lib/index.js#L98:\n //\n // @ECHO off\n // GOTO start\n // :find_dp0\n // SET dp0=%~dp0\n // EXIT /b\n // :start\n // SETLOCAL\n // CALL :find_dp0\n //\n // IF EXIST \"%dp0%\\node.exe\" (\n // SET \"_prog=%dp0%\\node.exe\"\n // ) ELSE (\n // SET \"_prog=node\"\n // SET PATHEXT=%PATHEXT:;.JS;=;%\n // )\n //\n // endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & \"%_prog%\" \"%dp0%\\..\\<PACKAGE_NAME>\\path\\to\\bin.js\" %*\n relPath = /(?<=\"%dp0%\\\\).*(?=\" %\\*\\r\\n)/.exec(source)?.[0] || ''\n } else if (extLowered === '') {\n // Extensionless \"bin\" generated by\n // https://github.com/npm/cmd-shim/blob/v7.0.0/lib/index.js#L138:\n //\n // #!/bin/sh\n // basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\n //\n // case `uname` in\n // *CYGWIN*|*MINGW*|*MSYS*)\n // if command -v cygpath > /dev/null 2>&1; then\n // basedir=`cygpath -w \"$basedir\"`\n // fi\n // ;;\n // esac\n //\n // if [ -x \"$basedir/node\" ]; then\n // exec \"$basedir/node\" \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" \"$@\"\n // else\n // exec node \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" \"$@\"\n // fi\n relPath = /(?<=\"$basedir\\/).*(?=\" \"\\$@\"\\n)/.exec(source)?.[0] || ''\n } else if (extLowered === '.ps1') {\n // \"bin.PS1\" generated by\n // https://github.com/npm/cmd-shim/blob/v7.0.0/lib/index.js#L192:\n //\n // #!/usr/bin/env pwsh\n // $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\n //\n // $exe=\"\"\n // if ($PSVersionTable.PSVersion -lt \"6.0\" -or $IsWindows) {\n // # Fix case when both the Windows and Linux builds of Node\n // # are installed in the same directory\n // $exe=\".exe\"\n // }\n // $ret=0\n // if (Test-Path \"$basedir/node$exe\") {\n // # Support pipeline input\n // if ($MyInvocation.ExpectingInput) {\n // $input | & \"$basedir/node$exe\" \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" $args\n // } else {\n // & \"$basedir/node$exe\" \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" $args\n // }\n // $ret=$LASTEXITCODE\n // } else {\n // # Support pipeline input\n // if ($MyInvocation.ExpectingInput) {\n // $input | & \"node$exe\" \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" $args\n // } else {\n // & \"node$exe\" \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" $args\n // }\n // $ret=$LASTEXITCODE\n // }\n // exit $ret\n relPath = /(?<=\"\\$basedir\\/).*(?=\" $args\\n)/.exec(source)?.[0] || ''\n }\n if (relPath) {\n // biome-ignore lint/style/noParameterAssign: Resolving wrapper script target.\n binPath = normalizePath(path?.resolve(path?.dirname(binPath), relPath))\n }\n }\n } else {\n // Handle Unix shell scripts (non-Windows platforms)\n let hasNoExt = extLowered === ''\n const isPnpmOrYarn = basename === 'pnpm' || basename === 'yarn'\n const isNpmOrNpx = basename === 'npm' || basename === 'npx'\n\n // Handle special case where pnpm path in CI has extra segments.\n // In setup-pnpm GitHub Action, the path might be malformed like:\n // /home/runner/setup-pnpm/node_modules/.bin/pnpm/bin/pnpm.cjs\n // This happens when the shell script contains a relative path that\n // when resolved, creates an invalid nested structure.\n if (isPnpmOrYarn && binPath.includes('/.bin/pnpm/bin/')) {\n // Extract the correct pnpm bin path.\n const binIndex = binPath.indexOf('/.bin/pnpm')\n if (binIndex !== -1) {\n // Get the base path up to /.bin/pnpm.\n const baseBinPath = binPath.slice(0, binIndex + '/.bin/pnpm'.length)\n // Check if the original shell script exists.\n try {\n const stats = fs?.statSync(baseBinPath)\n // Only use this path if it's a file (the shell script).\n if (stats.isFile()) {\n // biome-ignore lint/style/noParameterAssign: Fixing pnpm nested bin structure.\n binPath = normalizePath(baseBinPath)\n // Recompute hasNoExt since we changed the path.\n hasNoExt = !path?.extname(binPath)\n }\n } catch {\n // If stat fails, continue with the original path.\n }\n }\n }\n\n if (\n hasNoExt &&\n (isPnpmOrYarn || isNpmOrNpx) &&\n // For extensionless files (Unix shell scripts), verify existence before reading.\n // This prevents ENOENT errors when the bin path doesn't exist.\n fs?.existsSync(binPath)\n ) {\n const source = fs?.readFileSync(binPath, 'utf8')\n let relPath = ''\n\n if (isPnpmOrYarn) {\n // Handle pnpm/yarn Unix shell scripts.\n // Format: exec \"$basedir/node\" \"$basedir/.tools/pnpm/VERSION/...\" \"$@\"\n // or: exec node \"$basedir/.tools/pnpm/VERSION/...\" \"$@\"\n relPath =\n /(?<=\"\\$basedir\\/)\\.tools\\/[^\"]+(?=\"\\s+\"\\$@\")/.exec(source)?.[0] || ''\n if (!relPath) {\n // Try standard cmd-shim format: exec node \"$basedir/../package/bin/binary.js\" \"$@\"\n // Example: exec node \"$basedir/../pnpm/bin/pnpm.cjs\" \"$@\"\n // ^^^^^^^^^^^^^^^^^^^^^ captures this part\n // This regex needs to be more careful to not match \"$@\" at the end.\n relPath =\n /(?<=\"\\$basedir\\/)[^\"]+(?=\"\\s+\"\\$@\")/.exec(source)?.[0] || ''\n }\n // Special case for setup-pnpm GitHub Action which may use a different format.\n // The setup-pnpm action creates a shell script that references ../pnpm/bin/pnpm.cjs\n if (!relPath) {\n // Try to match: exec node \"$basedir/../pnpm/bin/pnpm.cjs\" \"$@\"\n const match = /exec\\s+node\\s+\"?\\$basedir\\/([^\"]+)\"?\\s+\"\\$@\"/.exec(\n source,\n )\n if (match) {\n relPath = match[1] || ''\n }\n }\n // Check if the extracted path looks wrong (e.g., pnpm/bin/pnpm.cjs without ../).\n // This happens with setup-pnpm action when it creates a malformed shell script.\n if (relPath && basename === 'pnpm' && relPath.startsWith('pnpm/')) {\n // The path should be ../pnpm/... not pnpm/...\n // Prepend ../ to fix the relative path.\n relPath = `../${relPath}`\n }\n } else if (isNpmOrNpx) {\n // Handle npm/npx Unix shell scripts\n relPath =\n basename === 'npm'\n ? /(?<=NPM_CLI_JS=\"\\$CLI_BASEDIR\\/).*(?=\")/.exec(source)?.[0] || ''\n : /(?<=NPX_CLI_JS=\"\\$CLI_BASEDIR\\/).*(?=\")/.exec(source)?.[0] || ''\n }\n\n if (relPath) {\n // Resolve the relative path to handle .. segments properly.\n // biome-ignore lint/style/noParameterAssign: Resolving shell script target.\n binPath = normalizePath(path?.resolve(path?.dirname(binPath), relPath))\n }\n }\n }\n try {\n const realPath = fs?.realpathSync.native(binPath)\n return normalizePath(realPath)\n } catch {}\n // Return normalized path even if realpath fails.\n return normalizePath(binPath)\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,qBAAwB;AACxB,kBAAqB;AACrB,0BAA6B;AAC7B,2BAA8B;AAE9B,gBAA6B;AAC7B,qBAAuB;AACvB,kBAAsC;AACtC,mBAAsB;AAEtB,IAAI;AAAA;AAKJ,SAAS,QAAQ;AACf,MAAI,QAAQ,QAAW;AAGrB,UAAoB,QAAQ,SAAS;AAAA,EACvC;AAEA,SAAO;AACT;AAEA,IAAI;AAAA;AAKJ,SAAS,UAAU;AACjB,MAAI,UAAU,QAAW;AAGvB,YAAsB,QAAQ,WAAW;AAAA,EAC3C;AAEA,SAAO;AACT;AAEA,IAAI;AAAA;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