@socketsecurity/lib 6.0.6 → 6.0.8
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 +46 -1
- package/README.md +1 -1
- package/dist/ai/agent-context.d.mts +103 -0
- package/dist/ai/agent-context.js +157 -0
- package/dist/ai/backends.d.mts +83 -0
- package/dist/ai/backends.js +173 -0
- package/dist/ai/credentials.d.mts +49 -0
- package/dist/ai/credentials.js +82 -0
- package/dist/ai/discover.d.mts +6 -2
- package/dist/ai/discover.js +4 -3
- package/dist/ai/exec.d.mts +52 -0
- package/dist/ai/exec.js +92 -0
- package/dist/ai/http.d.mts +132 -0
- package/dist/ai/http.js +130 -0
- package/dist/ai/profiles.d.mts +41 -6
- package/dist/ai/profiles.js +52 -10
- package/dist/ai/route.d.mts +69 -0
- package/dist/ai/route.js +156 -0
- package/dist/ai/spawn.d.mts +10 -2
- package/dist/ai/spawn.js +56 -31
- package/dist/ai/subagent-status.d.mts +48 -0
- package/dist/ai/subagent-status.js +57 -0
- package/dist/ai/tier.d.mts +60 -0
- package/dist/ai/tier.js +53 -0
- package/dist/ai/types.d.mts +31 -6
- package/dist/ai/worktree.d.mts +6 -6
- package/dist/ai/worktree.js +5 -1
- package/dist/ansi/strip.d.ts +1 -1
- package/dist/ansi/strip.js +0 -2
- package/dist/archives/_internal.js +7 -9
- package/dist/archives/extract.js +1 -1
- package/dist/archives/tar.js +7 -7
- package/dist/archives/zip.js +5 -7
- package/dist/argv/flag-predicates.d.ts +12 -12
- package/dist/argv/flag-predicates.js +17 -17
- package/dist/argv/flag-types.d.ts +18 -18
- package/dist/argv/flag-types.js +4 -4
- package/dist/argv/parse.d.ts +20 -3
- package/dist/argv/parse.js +1 -1
- package/dist/arrays/_internal.js +11 -12
- package/dist/arrays/chunk.js +0 -1
- package/dist/arrays/join.d.ts +37 -3
- package/dist/arrays/join.js +47 -7
- package/dist/arrays/unique.js +0 -1
- package/dist/bin/_internal.d.ts +1 -1
- package/dist/bin/_internal.js +1 -1
- package/dist/bin/exec.js +2 -3
- package/dist/bin/find.js +17 -17
- package/dist/bin/prim.cjs +36175 -35861
- package/dist/bin/resolve.js +13 -14
- package/dist/bin/which.js +8 -8
- package/dist/cache/ttl/store.js +6 -6
- package/dist/checks/primordials-defaults.d.ts +3 -3
- package/dist/checks/primordials-defaults.js +3 -3
- package/dist/checks/primordials.js +4 -3
- package/dist/{bin → cli}/check-primordials.d.ts +18 -13
- package/dist/{bin → cli}/check-primordials.js +58 -55
- package/dist/{bin → cli}/check.js +3 -3
- package/dist/{bin → cli}/socket-lib.d.ts +1 -1
- package/dist/{bin → cli}/socket-lib.js +4 -4
- package/dist/colors/socket-palette.js +7 -9
- package/dist/compression/_internal.d.ts +12 -12
- package/dist/compression/_internal.js +18 -18
- package/dist/compression/brotli.d.ts +26 -27
- package/dist/compression/brotli.js +39 -35
- package/dist/compression/gzip.d.ts +23 -23
- package/dist/compression/gzip.js +46 -42
- package/dist/constants/agents.d.ts +3 -1
- package/dist/constants/agents.js +15 -11
- package/dist/constants/licenses.js +3 -3
- package/dist/constants/node.d.ts +23 -0
- package/dist/constants/node.js +47 -15
- package/dist/constants/packages.d.ts +3 -0
- package/dist/constants/packages.js +24 -29
- package/dist/constants/platform.d.ts +30 -3
- package/dist/constants/platform.js +72 -12
- package/dist/constants/runtime.d.ts +22 -0
- package/dist/constants/runtime.js +32 -0
- package/dist/constants/socket.d.ts +2 -6
- package/dist/constants/socket.js +12 -14
- package/dist/cover/code.js +10 -10
- package/dist/cover/formatters.js +5 -5
- package/dist/crypto/hash.d.ts +30 -2
- package/dist/crypto/hash.js +47 -13
- package/dist/debug/_internal.js +4 -6
- package/dist/debug/caller-info.js +3 -4
- package/dist/debug/namespace.d.ts +7 -0
- package/dist/debug/namespace.js +21 -12
- package/dist/debug/output.js +21 -24
- package/dist/debug/types.d.ts +4 -4
- package/dist/dlx/arborist.js +18 -8
- package/dist/dlx/binary-cache.js +15 -15
- package/dist/dlx/binary-download.d.ts +1 -1
- package/dist/dlx/binary-download.js +11 -11
- package/dist/dlx/binary-resolution.js +17 -15
- package/dist/dlx/binary-types.d.ts +5 -5
- package/dist/dlx/binary.js +5 -5
- package/dist/dlx/cache.js +1 -1
- package/dist/dlx/detect.d.ts +42 -25
- package/dist/dlx/detect.js +86 -77
- package/dist/dlx/dir.js +2 -2
- package/dist/dlx/firewall.d.ts +9 -1
- package/dist/dlx/firewall.js +1 -1
- package/dist/dlx/lockfile.d.ts +19 -18
- package/dist/dlx/lockfile.js +19 -16
- package/dist/dlx/manifest.d.ts +6 -6
- package/dist/dlx/manifest.js +5 -5
- package/dist/dlx/package.d.ts +10 -10
- package/dist/dlx/package.js +20 -16
- package/dist/dlx/packages.js +4 -4
- package/dist/dlx/paths.js +7 -7
- package/dist/dlx/spec.js +1 -1
- package/dist/dlx/types.d.ts +28 -27
- package/dist/eco/cargo/parse-lockfile.d.ts +2 -3
- package/dist/eco/cargo/parse-lockfile.js +5 -5
- package/dist/eco/manifest/analyze-lockfile.js +2 -2
- package/dist/eco/manifest/detect-format.js +5 -5
- package/dist/eco/manifest/find-packages.js +2 -2
- package/dist/eco/manifest/get-package-versions.js +2 -2
- package/dist/eco/manifest/get-package.js +2 -2
- package/dist/eco/manifest/parse-lockfile.js +2 -2
- package/dist/eco/manifest/parse-manifest.js +2 -2
- package/dist/eco/manifest/parse.js +2 -2
- package/dist/eco/npm/npm/exec.js +2 -2
- package/dist/eco/npm/npm/flags.js +7 -12
- package/dist/eco/npm/npm/parse-lockfile.d.ts +17 -18
- package/dist/eco/npm/npm/parse-lockfile.js +4 -4
- package/dist/eco/npm/parse-package-json.d.ts +11 -0
- package/dist/eco/npm/parse-package-json.js +3 -3
- package/dist/eco/npm/pnpm/exec.d.ts +1 -1
- package/dist/eco/npm/pnpm/exec.js +5 -5
- package/dist/eco/npm/pnpm/flags.js +0 -3
- package/dist/eco/npm/pnpm/parse-lockfile.d.ts +6 -4
- package/dist/eco/npm/pnpm/parse-lockfile.js +7 -7
- package/dist/eco/npm/script.js +9 -6
- package/dist/eco/npm/yarnpkg/yarn/exec.js +4 -4
- package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.d.ts +3 -4
- package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.js +9 -9
- package/dist/effects/pulse-frames.d.ts +3 -1
- package/dist/effects/shimmer-keyframes.d.ts +1 -1
- package/dist/effects/shimmer-terminal.d.ts +1 -1
- package/dist/env/boolean.js +0 -1
- package/dist/env/ci.js +0 -1
- package/dist/env/debug.js +0 -1
- package/dist/env/github-status.d.ts +51 -0
- package/dist/env/github-status.js +90 -0
- package/dist/env/github.js +0 -8
- package/dist/env/home.js +0 -1
- package/dist/env/locale.js +0 -3
- package/dist/env/node-auth-token.js +0 -1
- package/dist/env/node-env.js +0 -1
- package/dist/env/node-version-managers.d.ts +53 -0
- package/dist/env/node-version-managers.js +90 -0
- package/dist/env/npm.js +0 -5
- package/dist/env/number.js +0 -1
- package/dist/env/package-manager.js +3 -6
- package/dist/env/path.js +0 -1
- package/dist/env/pre-commit.js +1 -2
- package/dist/env/proxy.js +1 -1
- package/dist/env/rewire.d.ts +8 -6
- package/dist/env/rewire.js +16 -17
- package/dist/env/shell.js +0 -1
- package/dist/env/socket-cli.js +5 -18
- package/dist/env/socket-mcp.d.ts +114 -0
- package/dist/env/socket-mcp.js +146 -0
- package/dist/env/socket.d.ts +8 -109
- package/dist/env/socket.js +22 -167
- package/dist/env/string.js +0 -1
- package/dist/env/temp-dir.js +0 -3
- package/dist/env/term.js +0 -1
- package/dist/env/test.js +3 -6
- package/dist/env/windows.js +0 -4
- package/dist/env/xdg.js +0 -3
- package/dist/errors/predicates.js +1 -1
- package/dist/events/exit/_internal.d.ts +11 -9
- package/dist/events/exit/_internal.js +31 -35
- package/dist/events/exit/handler.js +3 -4
- package/dist/events/exit/intercept.js +4 -6
- package/dist/events/exit/lifecycle.js +16 -18
- package/dist/events/exit/signals.js +1 -2
- package/dist/events/exit/types.d.ts +6 -5
- package/dist/external/@npmcli/package-json.js +2 -2
- package/dist/external/@npmcli/promise-spawn.js +3 -1
- package/dist/external/npm-pack.js +2 -2
- package/dist/external/pico-pack.js +4 -2
- package/dist/external/which.js +3 -1
- package/dist/external-tools/bazel/asset-names.d.ts +1 -1
- package/dist/external-tools/bazel/asset-names.js +5 -2
- package/dist/external-tools/bazel/from-download.d.ts +1 -1
- package/dist/external-tools/bazel/from-download.js +5 -2
- package/dist/external-tools/bazel/read-bazel-version-file.js +1 -1
- package/dist/external-tools/bazel/resolve-bazel-version.js +4 -0
- package/dist/external-tools/bazel/resolve.d.ts +3 -3
- package/dist/external-tools/bazel/resolve.js +16 -8
- package/dist/external-tools/bazel/types.d.ts +1 -1
- package/dist/external-tools/cdxgen/asset-names.d.ts +1 -1
- package/dist/external-tools/cdxgen/asset-names.js +5 -2
- package/dist/external-tools/cdxgen/from-download.d.ts +1 -1
- package/dist/external-tools/cdxgen/from-download.js +7 -4
- package/dist/external-tools/cdxgen/from-vfs.js +1 -1
- package/dist/external-tools/cdxgen/resolve.d.ts +3 -3
- package/dist/external-tools/cdxgen/resolve.js +16 -8
- package/dist/external-tools/cdxgen/types.d.ts +1 -1
- package/dist/external-tools/from-download.d.ts +3 -3
- package/dist/external-tools/from-download.js +12 -6
- package/dist/external-tools/from-pip-venv.d.ts +1 -1
- package/dist/external-tools/from-pip-venv.js +12 -5
- package/dist/external-tools/janus/asset-names.d.ts +1 -1
- package/dist/external-tools/janus/asset-names.js +5 -2
- package/dist/external-tools/janus/from-download.d.ts +1 -1
- package/dist/external-tools/janus/from-download.js +5 -2
- package/dist/external-tools/janus/from-vfs.js +1 -1
- package/dist/external-tools/janus/resolve.d.ts +3 -3
- package/dist/external-tools/janus/resolve.js +16 -8
- package/dist/external-tools/janus/types.d.ts +1 -1
- package/dist/external-tools/jre/asset-names.d.ts +1 -1
- package/dist/external-tools/jre/asset-names.js +5 -2
- package/dist/external-tools/jre/detect-platform-arch.d.ts +10 -6
- package/dist/external-tools/jre/detect-platform-arch.js +29 -14
- package/dist/external-tools/jre/from-download.d.ts +1 -1
- package/dist/external-tools/jre/from-download.js +7 -4
- package/dist/external-tools/jre/from-java-home.js +2 -2
- package/dist/external-tools/jre/from-vfs.js +3 -3
- package/dist/external-tools/jre/resolve.d.ts +3 -3
- package/dist/external-tools/jre/resolve.js +16 -8
- package/dist/external-tools/jre/types.d.ts +1 -1
- package/dist/external-tools/manifest.d.ts +25 -7
- package/dist/external-tools/manifest.js +13 -13
- package/dist/external-tools/opengrep/asset-names.d.ts +1 -1
- package/dist/external-tools/opengrep/asset-names.js +5 -2
- package/dist/external-tools/opengrep/from-download.d.ts +1 -1
- package/dist/external-tools/opengrep/from-download.js +5 -2
- package/dist/external-tools/opengrep/from-vfs.js +1 -1
- package/dist/external-tools/opengrep/resolve.d.ts +3 -3
- package/dist/external-tools/opengrep/resolve.js +16 -8
- package/dist/external-tools/opengrep/types.d.ts +1 -1
- package/dist/external-tools/python/asset-names.d.ts +76 -0
- package/dist/external-tools/python/asset-names.js +111 -0
- package/dist/external-tools/python/dlx.d.ts +80 -0
- package/dist/external-tools/python/dlx.js +98 -0
- package/dist/external-tools/python/from-download.d.ts +53 -0
- package/dist/external-tools/python/from-download.js +75 -0
- package/dist/external-tools/python/from-path.d.ts +7 -0
- package/dist/external-tools/python/from-path.js +23 -0
- package/dist/external-tools/python/pin.d.ts +121 -0
- package/dist/external-tools/python/pin.js +176 -0
- package/dist/external-tools/python/pip-install.d.ts +75 -0
- package/dist/external-tools/python/pip-install.js +142 -0
- package/dist/external-tools/python/resolve.d.ts +42 -0
- package/dist/external-tools/python/resolve.js +66 -0
- package/dist/external-tools/python/types.d.ts +49 -0
- package/dist/external-tools/sbt/asset-names.d.ts +1 -1
- package/dist/external-tools/sbt/asset-names.js +5 -2
- package/dist/external-tools/sbt/from-download.d.ts +1 -1
- package/dist/external-tools/sbt/from-download.js +5 -2
- package/dist/external-tools/sbt/from-vfs.js +1 -1
- package/dist/external-tools/sbt/resolve.d.ts +3 -3
- package/dist/external-tools/sbt/resolve.js +16 -8
- package/dist/external-tools/sbt/types.d.ts +1 -1
- package/dist/external-tools/skillspector/from-dlx.d.ts +1 -1
- package/dist/external-tools/skillspector/from-dlx.js +10 -3
- package/dist/external-tools/skillspector/from-path.js +3 -5
- package/dist/external-tools/skillspector/from-vfs.js +1 -1
- package/dist/external-tools/skillspector/resolve.d.ts +2 -2
- package/dist/external-tools/skillspector/resolve.js +14 -6
- package/dist/external-tools/synp/asset-names.d.ts +1 -1
- package/dist/external-tools/synp/asset-names.js +6 -2
- package/dist/external-tools/synp/from-download.d.ts +1 -1
- package/dist/external-tools/synp/from-download.js +7 -4
- package/dist/external-tools/synp/from-vfs.js +1 -1
- package/dist/external-tools/synp/resolve.d.ts +3 -3
- package/dist/external-tools/synp/resolve.js +16 -8
- package/dist/external-tools/trivy/asset-names.d.ts +1 -1
- package/dist/external-tools/trivy/asset-names.js +5 -2
- package/dist/external-tools/trivy/from-download.d.ts +1 -1
- package/dist/external-tools/trivy/from-download.js +7 -4
- package/dist/external-tools/trivy/from-vfs.js +1 -1
- package/dist/external-tools/trivy/resolve.d.ts +3 -3
- package/dist/external-tools/trivy/resolve.js +16 -8
- package/dist/external-tools/trivy/types.d.ts +1 -1
- package/dist/external-tools/trufflehog/asset-names.d.ts +1 -1
- package/dist/external-tools/trufflehog/asset-names.js +5 -2
- package/dist/external-tools/trufflehog/from-download.d.ts +1 -1
- package/dist/external-tools/trufflehog/from-download.js +7 -4
- package/dist/external-tools/trufflehog/from-vfs.js +1 -1
- package/dist/external-tools/trufflehog/resolve.d.ts +3 -3
- package/dist/external-tools/trufflehog/resolve.js +16 -8
- package/dist/external-tools/trufflehog/types.d.ts +1 -1
- package/dist/fs/_internal.d.ts +1 -1
- package/dist/fs/_internal.js +7 -7
- package/dist/fs/access.js +5 -9
- package/dist/fs/allowed-dirs-cache.d.ts +47 -0
- package/dist/fs/allowed-dirs-cache.js +69 -0
- package/dist/fs/encoding.js +5 -7
- package/dist/fs/{find-up.js → find.js} +12 -14
- package/dist/fs/inspect.js +7 -13
- package/dist/fs/read-dir.js +7 -10
- package/dist/fs/read-file.js +8 -14
- package/dist/fs/read-json-cache.d.ts +13 -4
- package/dist/fs/read-json-cache.js +9 -6
- package/dist/fs/read-json.js +4 -6
- package/dist/fs/resolve-module.js +7 -3
- package/dist/fs/safe.d.ts +1 -1
- package/dist/fs/safe.js +13 -14
- package/dist/fs/unique.js +4 -5
- package/dist/fs/validate.js +1 -2
- package/dist/fs/write-json.js +4 -5
- package/dist/git/_internal.js +11 -11
- package/dist/git/changed.js +4 -4
- package/dist/git/repo.js +5 -7
- package/dist/git/staged.js +12 -4
- package/dist/git/tracked.d.ts +84 -0
- package/dist/git/tracked.js +163 -0
- package/dist/git/unstaged.js +12 -4
- package/dist/github/ghsa.js +2 -2
- package/dist/github/refs-cache.d.ts +1 -1
- package/dist/github/refs-cache.js +5 -5
- package/dist/github/refs-graphql.js +4 -0
- package/dist/github/refs-rest.js +9 -5
- package/dist/github/refs.js +15 -10
- package/dist/github/{fetch.js → request.js} +13 -2
- package/dist/github/token.js +1 -1
- package/dist/github/types.d.ts +1 -1
- package/dist/globs/_internal.js +8 -10
- package/dist/globs/match.js +13 -7
- package/dist/globs/matcher.d.ts +3 -3
- package/dist/globs/matcher.js +16 -14
- package/dist/globs/stream.js +1 -2
- package/dist/globs/types.d.ts +24 -24
- package/dist/http-request/_internal.d.ts +1 -1
- package/dist/http-request/browser.js +10 -4
- package/dist/http-request/checksum-file.d.ts +55 -0
- package/dist/http-request/checksum-file.js +95 -0
- package/dist/http-request/download-types.d.ts +15 -23
- package/dist/http-request/download.js +3 -3
- package/dist/http-request/{browser-fetch.d.ts → fetch/browser.d.ts} +2 -2
- package/dist/http-request/{browser-fetch.js → fetch/browser.js} +4 -4
- package/dist/http-request/headers.js +1 -2
- package/dist/http-request/request-attempt.js +38 -34
- package/dist/http-request/request-types.d.ts +2 -2
- package/dist/http-request/request.js +1 -1
- package/dist/http-request/user-agent.js +4 -5
- package/dist/integrity.d.ts +92 -18
- package/dist/integrity.js +125 -30
- package/dist/ipc/directory.js +2 -2
- package/dist/ipc/paths.js +1 -1
- package/dist/ipc/write.js +1 -1
- package/dist/ipc-cli/get.js +12 -12
- package/dist/json/edit.js +51 -44
- package/dist/json/format.js +1 -1
- package/dist/json/parse.d.ts +1 -1
- package/dist/json/parse.js +3 -7
- package/dist/logger/_internal.d.ts +4 -4
- package/dist/logger/_internal.js +3 -3
- package/dist/logger/colors.js +4 -3
- package/dist/logger/console-methods.d.ts +132 -0
- package/dist/logger/console-methods.js +169 -0
- package/dist/logger/console.d.ts +12 -0
- package/dist/logger/console.js +42 -11
- package/dist/logger/indentation-methods.d.ts +81 -0
- package/dist/logger/indentation-methods.js +121 -0
- package/dist/logger/node.d.ts +16 -338
- package/dist/logger/node.js +75 -608
- package/dist/logger/options.d.ts +39 -0
- package/dist/logger/options.js +47 -0
- package/dist/logger/semantic-methods.d.ts +63 -0
- package/dist/logger/semantic-methods.js +108 -0
- package/dist/logger/stream-methods.d.ts +63 -0
- package/dist/logger/stream-methods.js +101 -0
- package/dist/logger/stream.d.ts +37 -0
- package/dist/logger/stream.js +42 -0
- package/dist/logger/symbols-builder.js +9 -9
- package/dist/logger/symbols.d.ts +2 -25
- package/dist/logger/symbols.js +53 -74
- package/dist/logger/types.d.ts +1 -1
- package/dist/memo/types.d.ts +6 -6
- package/dist/native-messaging/host.d.ts +20 -0
- package/dist/native-messaging/host.js +120 -0
- package/dist/native-messaging/index.d.ts +5 -0
- package/dist/native-messaging/index.js +22 -0
- package/dist/native-messaging/install.d.ts +60 -0
- package/dist/native-messaging/install.js +144 -0
- package/dist/native-messaging/rate-limit.d.ts +69 -0
- package/dist/native-messaging/rate-limit.js +119 -0
- package/dist/native-messaging/run.d.ts +10 -0
- package/dist/native-messaging/run.js +17 -0
- package/dist/node/async-hooks.js +4 -3
- package/dist/node/child-process.js +4 -3
- package/dist/node/crypto.js +4 -3
- package/dist/node/events.js +4 -3
- package/dist/node/fs-promises.js +4 -3
- package/dist/node/fs.d.ts +22 -6
- package/dist/node/fs.js +17 -3
- package/dist/node/http.js +4 -3
- package/dist/node/https.js +4 -3
- package/dist/node/module.js +10 -6
- package/dist/node/os.d.ts +10 -2
- package/dist/node/os.js +12 -4
- package/dist/node/path.d.ts +11 -2
- package/dist/node/path.js +18 -4
- package/dist/node/timers-promises.js +4 -3
- package/dist/node/url.js +4 -3
- package/dist/node/util.js +4 -3
- package/dist/objects/getters.js +6 -8
- package/dist/objects/inspect.js +1 -4
- package/dist/objects/mutate.js +4 -5
- package/dist/objects/predicates.js +1 -5
- package/dist/objects/sort.js +3 -7
- package/dist/packages/edit-class.d.ts +2 -3
- package/dist/packages/edit-class.js +53 -48
- package/dist/packages/edit.js +12 -14
- package/dist/packages/exports.js +15 -21
- package/dist/packages/fetch.d.ts +16 -0
- package/dist/packages/fetch.js +81 -0
- package/dist/packages/find.d.ts +55 -0
- package/dist/packages/find.js +65 -0
- package/dist/packages/isolation.js +14 -14
- package/dist/packages/licenses.js +18 -18
- package/dist/packages/manifest.js +16 -19
- package/dist/packages/metadata-extensions.d.ts +14 -0
- package/dist/packages/metadata-extensions.js +43 -0
- package/dist/packages/normalize.js +6 -10
- package/dist/packages/provenance.js +17 -19
- package/dist/packages/read.d.ts +29 -0
- package/dist/packages/read.js +66 -0
- package/dist/packages/specs.d.ts +48 -1
- package/dist/packages/specs.js +75 -12
- package/dist/packages/tarball.d.ts +24 -0
- package/dist/packages/tarball.js +81 -0
- package/dist/packages/types.d.ts +22 -22
- package/dist/packages/validation.js +0 -3
- package/dist/paths/_internal.d.ts +2 -1
- package/dist/paths/_internal.js +7 -19
- package/dist/paths/conversion.js +5 -9
- package/dist/paths/dirnames.d.ts +1 -0
- package/dist/paths/dirnames.js +2 -0
- package/dist/paths/filenames.d.ts +0 -1
- package/dist/paths/filenames.js +0 -2
- package/dist/paths/normalize.js +4 -5
- package/dist/paths/packages.js +4 -7
- package/dist/paths/predicates.js +9 -16
- package/dist/paths/resolve.js +17 -25
- package/dist/paths/rewire.d.ts +5 -0
- package/dist/paths/rewire.js +3 -3
- package/dist/paths/socket.d.ts +74 -111
- package/dist/paths/socket.js +106 -139
- package/dist/paths/walk.d.ts +1 -1
- package/dist/paths/walk.js +4 -4
- package/dist/perf/report.js +2 -2
- package/dist/perf/types.d.ts +1 -1
- package/dist/pkg-ext/data.js +1 -1
- package/dist/primordials/array.js +9 -9
- package/dist/primordials/date.js +2 -2
- package/dist/primordials/error.js +3 -3
- package/dist/primordials/headers.d.ts +10 -0
- package/dist/primordials/headers.js +23 -0
- package/dist/primordials/intl.d.ts +13 -0
- package/dist/primordials/intl.js +26 -0
- package/dist/primordials/math.js +33 -33
- package/dist/primordials/number.js +9 -9
- package/dist/primordials/object.js +5 -5
- package/dist/primordials/process.d.ts +88 -0
- package/dist/primordials/process.js +132 -0
- package/dist/primordials/string.d.ts +2 -2
- package/dist/primordials/string.js +6 -6
- package/dist/primordials/symbol.js +3 -3
- package/dist/primordials/uncurry.d.ts +1 -2
- package/dist/primordials/uncurry.js +9 -9
- package/dist/process/abort.js +3 -3
- package/dist/process/lock-manager.js +8 -8
- package/dist/process/spawn/_internal.js +6 -8
- package/dist/process/spawn/child.js +20 -14
- package/dist/process/spawn/errors.js +3 -5
- package/dist/process/spawn/kill-tree.d.ts +53 -0
- package/dist/process/spawn/kill-tree.js +85 -0
- package/dist/process/spawn/stdio.js +0 -1
- package/dist/process/spawn/types.d.ts +5 -5
- package/dist/process/transient.js +2 -2
- package/dist/promises/_internal.d.ts +2 -1
- package/dist/promises/_internal.js +2 -6
- package/dist/promises/iterate.js +11 -15
- package/dist/promises/options.js +3 -6
- package/dist/promises/retry.js +4 -5
- package/dist/promises/timers.d.ts +30 -0
- package/dist/promises/timers.js +48 -0
- package/dist/regexps/spec.js +1 -1
- package/dist/releases/github-archives.d.ts +6 -6
- package/dist/releases/github-archives.js +3 -3
- package/dist/releases/github-asset-url.d.ts +1 -1
- package/dist/releases/github-asset-url.js +5 -5
- package/dist/releases/github-downloads.d.ts +1 -1
- package/dist/releases/github-downloads.js +3 -3
- package/dist/releases/github-listing.d.ts +12 -4
- package/dist/releases/github-listing.js +20 -7
- package/dist/releases/github-retry-config.js +1 -1
- package/dist/releases/github-types.d.ts +6 -6
- package/dist/releases/socket-btm-binary-naming.d.ts +107 -0
- package/dist/releases/socket-btm-binary-naming.js +155 -0
- package/dist/releases/socket-btm.d.ts +8 -115
- package/dist/releases/socket-btm.js +16 -159
- package/dist/schema/types.d.ts +4 -5
- package/dist/schema/validate.js +1 -1
- package/dist/sea/detect.js +6 -6
- package/dist/secrets/_internal.d.ts +2 -2
- package/dist/secrets/_internal.js +2 -2
- package/dist/secrets/compare.d.ts +45 -0
- package/dist/secrets/compare.js +61 -0
- package/dist/secrets/find.d.ts +2 -2
- package/dist/secrets/find.js +10 -4
- package/dist/secrets/keychain.d.ts +1 -1
- package/dist/secrets/keychain.js +6 -4
- package/dist/secrets/linux.js +40 -52
- package/dist/secrets/macos.d.ts +2 -3
- package/dist/secrets/macos.js +24 -33
- package/dist/secrets/rc.d.ts +4 -4
- package/dist/secrets/rc.js +27 -17
- package/dist/secrets/socket-api-token.d.ts +4 -4
- package/dist/secrets/socket-api-token.js +26 -9
- package/dist/secrets/windows.js +32 -37
- package/dist/shadow/skip.js +2 -2
- package/dist/shell/parse.d.ts +32 -0
- package/dist/shell/parse.js +60 -0
- package/dist/smol/detect.js +9 -10
- package/dist/smol/http.js +6 -7
- package/dist/smol/https.js +6 -7
- package/dist/smol/manifest.d.ts +1 -1
- package/dist/smol/manifest.js +6 -7
- package/dist/smol/path.d.ts +1 -1
- package/dist/smol/path.js +7 -8
- package/dist/smol/primordial.d.ts +4 -0
- package/dist/smol/primordial.js +6 -7
- package/dist/smol/purl.d.ts +1 -1
- package/dist/smol/purl.js +7 -8
- package/dist/smol/versions.js +6 -7
- package/dist/smol/vfs.js +6 -7
- package/dist/sorts/_internal.js +6 -8
- package/dist/sorts/natural.js +10 -12
- package/dist/sorts/semver.js +1 -2
- package/dist/sorts/strings.js +0 -1
- package/dist/sorts/types.d.ts +1 -1
- package/dist/spinner/create-spinner-class.d.ts +38 -0
- package/dist/spinner/create-spinner-class.js +302 -0
- package/dist/spinner/default.js +8 -9
- package/dist/spinner/spinner-internals.d.ts +36 -0
- package/dist/spinner/spinner-internals.js +105 -0
- package/dist/spinner/spinner-shimmer-methods.d.ts +54 -0
- package/dist/spinner/spinner-shimmer-methods.js +143 -0
- package/dist/spinner/spinner-status-methods.d.ts +40 -0
- package/dist/spinner/spinner-status-methods.js +133 -0
- package/dist/spinner/spinner.d.ts +8 -5
- package/dist/spinner/spinner.js +19 -706
- package/dist/spinner/types.d.ts +3 -1
- package/dist/spinner/with.d.ts +10 -0
- package/dist/spinner/with.js +16 -2
- package/dist/stdio/divider.js +1 -1
- package/dist/stdio/footer.js +3 -3
- package/dist/stdio/header.js +4 -4
- package/dist/stdio/progress.js +10 -6
- package/dist/stdio/prompts.d.ts +7 -5
- package/dist/stdio/prompts.js +7 -8
- package/dist/stdio/stdout.js +3 -3
- package/dist/streams/parallel.js +3 -5
- package/dist/streams/transform.js +2 -3
- package/dist/strings/format.js +2 -6
- package/dist/strings/predicates.js +0 -2
- package/dist/strings/search.js +1 -2
- package/dist/strings/transform.js +0 -3
- package/dist/strings/width.js +9 -10
- package/dist/tables/bordered.js +4 -3
- package/dist/tables/padding.js +1 -1
- package/dist/tables/simple.js +8 -5
- package/dist/temporal/instant.js +1 -1
- package/dist/temporal/slots.js +6 -6
- package/dist/temporal/system.js +9 -9
- package/dist/themes/context.d.ts +3 -2
- package/dist/themes/context.js +4 -5
- package/dist/themes/themes.js +15 -15
- package/dist/themes/types.d.ts +3 -3
- package/dist/url/assert-safe.d.ts +29 -0
- package/dist/url/assert-safe.js +54 -0
- package/dist/url/parse.js +0 -2
- package/dist/url/predicates.d.ts +31 -1
- package/dist/url/predicates.js +43 -3
- package/dist/url/search-params.js +3 -9
- package/dist/url/types.d.ts +9 -5
- package/dist/versions/_internal.js +3 -3
- package/dist/words/article.js +0 -1
- package/dist/words/capitalize.js +0 -1
- package/dist/words/pluralize.js +15 -5
- package/package.json +419 -216
- package/dist/external-tools/uv/asset-names.d.ts +0 -36
- package/dist/external-tools/uv/asset-names.js +0 -70
- package/dist/external-tools/uv/from-download.d.ts +0 -17
- package/dist/external-tools/uv/from-download.js +0 -47
- package/dist/external-tools/uv/from-path.d.ts +0 -5
- package/dist/external-tools/uv/from-path.js +0 -22
- package/dist/external-tools/uv/from-vfs.d.ts +0 -7
- package/dist/external-tools/uv/from-vfs.js +0 -26
- package/dist/external-tools/uv/resolve.d.ts +0 -25
- package/dist/external-tools/uv/resolve.js +0 -53
- package/dist/external-tools/uv/types.d.ts +0 -24
- package/dist/fs/path-cache.d.ts +0 -21
- package/dist/fs/path-cache.js +0 -34
- package/dist/http-request/checksums.d.ts +0 -69
- package/dist/http-request/checksums.js +0 -108
- package/dist/http-request/http-request.d.ts +0 -12
- package/dist/http-request/http-request.js +0 -11
- package/dist/packages/operations.d.ts +0 -113
- package/dist/packages/operations.js +0 -304
- package/dist/ssri/convert.d.ts +0 -48
- package/dist/ssri/convert.js +0 -69
- package/dist/ssri/parse.d.ts +0 -27
- package/dist/ssri/parse.js +0 -41
- package/dist/ssri/validate.d.ts +0 -41
- package/dist/ssri/validate.js +0 -56
- /package/dist/{bin → cli}/check.d.ts +0 -0
- /package/dist/external-tools/{uv → python}/types.js +0 -0
- /package/dist/fs/{find-up.d.ts → find.d.ts} +0 -0
- /package/dist/github/{fetch.d.ts → request.d.ts} +0 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Socket Lib - Built with rolldown */
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_primordials_string = require('../primordials/string.js');
|
|
5
|
+
const require_paths_normalize = require('../paths/normalize.js');
|
|
6
|
+
const require_primordials_array = require('../primordials/array.js');
|
|
7
|
+
const require_node_path = require('../node/path.js');
|
|
8
|
+
const require_process_spawn_child = require('../process/spawn/child.js');
|
|
9
|
+
const require_git_repo = require('./repo.js');
|
|
10
|
+
|
|
11
|
+
//#region src/git/tracked.ts
|
|
12
|
+
/**
|
|
13
|
+
* @file Tracked-status + submodule-membership probes for a working-tree path.
|
|
14
|
+
* `isTracked` answers "does git track this exact path?"; `getSubmodulePaths`
|
|
15
|
+
* lists the repo's submodule mount points; `isInSubmodule` answers "does this
|
|
16
|
+
* path live inside one?"; `isUntrackedNonSubmodulePath` composes them into
|
|
17
|
+
* the safe-to-touch condition for cleanup tooling — never delete a tracked
|
|
18
|
+
* file or reach into a submodule's own tree (which would dirty it).
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* The repo's submodule mount points as normalized, repo-root-relative paths
|
|
22
|
+
* (e.g. `vendor/acorn`). Reads `git config` on `.gitmodules`, so it lists
|
|
23
|
+
* declared submodules whether or not they are initialized — the case a
|
|
24
|
+
* stderr-message check on `git ls-files` misses.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ;```typescript
|
|
28
|
+
* await getSubmodulePaths()
|
|
29
|
+
* // => ['packages/acorn/upstream/acorn', 'vendor/mbedtls']
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
async function getSubmodulePaths(options) {
|
|
33
|
+
const { cwd = require_git_repo.getCwd() } = {
|
|
34
|
+
__proto__: null,
|
|
35
|
+
...options
|
|
36
|
+
};
|
|
37
|
+
const lines = require_primordials_string.StringPrototypeSplit(await require_process_spawn_child.spawn("git", [
|
|
38
|
+
"config",
|
|
39
|
+
"--file",
|
|
40
|
+
".gitmodules",
|
|
41
|
+
"--get-regexp",
|
|
42
|
+
"path"
|
|
43
|
+
], {
|
|
44
|
+
cwd,
|
|
45
|
+
stdioString: true
|
|
46
|
+
}).then(
|
|
47
|
+
/* c8 ignore next - stdioString:true always yields a string stdout; the
|
|
48
|
+
?? '' is a defensive fallback that never fires on real spawn output. */
|
|
49
|
+
(result) => String(result?.stdout ?? ""),
|
|
50
|
+
() => ""
|
|
51
|
+
), "\n");
|
|
52
|
+
const paths = [];
|
|
53
|
+
for (let i = 0, { length } = lines; i < length; i += 1) {
|
|
54
|
+
const line = require_primordials_string.StringPrototypeTrim(lines[i]);
|
|
55
|
+
/* c8 ignore start - defensive parse guards: `git config --get-regexp`
|
|
56
|
+
always emits a `key value` line, so the blank-line and no-space skips
|
|
57
|
+
and the empty-value branch never fire on real git output. */
|
|
58
|
+
if (!line) continue;
|
|
59
|
+
const spaceIdx = line.indexOf(" ");
|
|
60
|
+
if (spaceIdx === -1) continue;
|
|
61
|
+
const rel = require_primordials_string.StringPrototypeTrim(line.slice(spaceIdx + 1));
|
|
62
|
+
if (!rel) continue;
|
|
63
|
+
/* c8 ignore stop */
|
|
64
|
+
paths.push(require_paths_normalize.normalizePath(rel));
|
|
65
|
+
}
|
|
66
|
+
return paths;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Whether `targetPath` lives inside one of the repo's submodules. Resolves the
|
|
70
|
+
* submodule list itself; for a batch sweep prefer `getSubmodulePaths` once plus
|
|
71
|
+
* `pathIsUnderSubmodule` per path.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ;```typescript
|
|
75
|
+
* await isInSubmodule('vendor/mbedtls/x.py') // => true
|
|
76
|
+
* await isInSubmodule('src/index.ts') // => false
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
async function isInSubmodule(targetPath, options) {
|
|
80
|
+
const submodulePaths = await getSubmodulePaths(options);
|
|
81
|
+
if (!submodulePaths.length) return false;
|
|
82
|
+
return pathIsUnderSubmodule(targetPath, submodulePaths);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Whether git tracks `targetPath` exactly. Uses `git ls-files --error-unmatch`,
|
|
86
|
+
* which exits non-zero for an untracked path. A path inside a submodule, or one
|
|
87
|
+
* git does not know, returns `false`.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ;```typescript
|
|
91
|
+
* await isTracked('src/index.ts') // => true
|
|
92
|
+
* await isTracked('.DS_Store') // => false
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
async function isTracked(targetPath, options) {
|
|
96
|
+
const { cwd = require_git_repo.getCwd() } = {
|
|
97
|
+
__proto__: null,
|
|
98
|
+
...options
|
|
99
|
+
};
|
|
100
|
+
return await require_process_spawn_child.spawn("git", [
|
|
101
|
+
"ls-files",
|
|
102
|
+
"--error-unmatch",
|
|
103
|
+
targetPath
|
|
104
|
+
], {
|
|
105
|
+
cwd,
|
|
106
|
+
stdioString: true
|
|
107
|
+
}).then(() => true, () => false);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Whether `targetPath` is git does NOT track AND does not live inside a
|
|
111
|
+
* submodule — the safe-to-touch condition for cleanup tooling. A tracked path
|
|
112
|
+
* is a deliberate file; a submodule-internal path belongs to that submodule's
|
|
113
|
+
* own git (touching it would dirty the submodule). Composes `isTracked` +
|
|
114
|
+
* `getSubmodulePaths`/`pathIsUnderSubmodule`. Fails closed — any check error
|
|
115
|
+
* resolves to `false`.
|
|
116
|
+
*
|
|
117
|
+
* For a batch sweep, call `getSubmodulePaths` once and compose `isTracked` +
|
|
118
|
+
* `pathIsUnderSubmodule` per path to avoid re-reading `.gitmodules` each time.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ;```typescript
|
|
122
|
+
* await isUntrackedNonSubmodulePath('.DS_Store') // => true
|
|
123
|
+
* await isUntrackedNonSubmodulePath('src/index.ts') // => false (tracked)
|
|
124
|
+
* await isUntrackedNonSubmodulePath('vendor/sub/x.pyc') // => false (submodule)
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
async function isUntrackedNonSubmodulePath(targetPath, options) {
|
|
128
|
+
const { cwd = require_git_repo.getCwd() } = {
|
|
129
|
+
__proto__: null,
|
|
130
|
+
...options
|
|
131
|
+
};
|
|
132
|
+
if (await isTracked(targetPath, { cwd }).catch(() => true)) return false;
|
|
133
|
+
const submodulePaths = await getSubmodulePaths({ cwd }).catch(() => []);
|
|
134
|
+
if (submodulePaths.length) {
|
|
135
|
+
const path = require_node_path.getNodePath();
|
|
136
|
+
if (pathIsUnderSubmodule(path.relative(cwd, path.resolve(cwd, targetPath)), submodulePaths)) return false;
|
|
137
|
+
}
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Whether `relativePath` (repo-root-relative) lies at or under any of
|
|
142
|
+
* `submodulePaths`. Pure — pass the result of `getSubmodulePaths` so the git
|
|
143
|
+
* read happens once for a whole sweep.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ;```typescript
|
|
147
|
+
* pathIsUnderSubmodule('vendor/mbedtls/scripts/__pycache__', ['vendor/mbedtls'])
|
|
148
|
+
* // => true
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
function pathIsUnderSubmodule(relativePath, submodulePaths) {
|
|
152
|
+
const normalized = require_paths_normalize.normalizePath(relativePath);
|
|
153
|
+
return require_primordials_array.ArrayPrototypeSome(submodulePaths, (sub) => {
|
|
154
|
+
return normalized === sub || require_primordials_string.StringPrototypeStartsWith(normalized, `${sub}/`) || require_primordials_string.StringPrototypeEndsWith(sub, normalized);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
//#endregion
|
|
159
|
+
exports.getSubmodulePaths = getSubmodulePaths;
|
|
160
|
+
exports.isInSubmodule = isInSubmodule;
|
|
161
|
+
exports.isTracked = isTracked;
|
|
162
|
+
exports.isUntrackedNonSubmodulePath = isUntrackedNonSubmodulePath;
|
|
163
|
+
exports.pathIsUnderSubmodule = pathIsUnderSubmodule;
|
package/dist/git/unstaged.js
CHANGED
|
@@ -44,6 +44,10 @@ const require_git__internal = require('./_internal.js');
|
|
|
44
44
|
* @returns Promise resolving to array of unstaged file paths.
|
|
45
45
|
*/
|
|
46
46
|
async function getUnstagedFiles(options) {
|
|
47
|
+
options = {
|
|
48
|
+
__proto__: null,
|
|
49
|
+
...options
|
|
50
|
+
};
|
|
47
51
|
const args = require_git__internal.getGitDiffSpawnArgs(options?.cwd).unstaged;
|
|
48
52
|
return await require_git__internal.innerDiff(args, options);
|
|
49
53
|
}
|
|
@@ -79,6 +83,10 @@ async function getUnstagedFiles(options) {
|
|
|
79
83
|
* @returns Array of unstaged file paths.
|
|
80
84
|
*/
|
|
81
85
|
function getUnstagedFilesSync(options) {
|
|
86
|
+
options = {
|
|
87
|
+
__proto__: null,
|
|
88
|
+
...options
|
|
89
|
+
};
|
|
82
90
|
const args = require_git__internal.getGitDiffSpawnArgs(options?.cwd).unstaged;
|
|
83
91
|
return require_git__internal.innerDiffSync(args, options);
|
|
84
92
|
}
|
|
@@ -123,11 +131,11 @@ async function isUnstaged(pathname, options) {
|
|
|
123
131
|
...options,
|
|
124
132
|
absolute: false
|
|
125
133
|
});
|
|
126
|
-
const path =
|
|
134
|
+
const path = require_node_path.getNodePath();
|
|
127
135
|
const resolvedPathname = require_git_repo.getCachedRealpath(pathname);
|
|
128
136
|
/* c8 ignore start */
|
|
129
137
|
const baseCwd = options?.cwd ? require_git_repo.getCachedRealpath(options["cwd"]) : require_git_repo.getCwd();
|
|
130
|
-
return require_primordials_array.ArrayPrototypeIncludes(files,
|
|
138
|
+
return require_primordials_array.ArrayPrototypeIncludes(files, require_paths_normalize.normalizePath(path.relative(baseCwd, resolvedPathname)));
|
|
131
139
|
}
|
|
132
140
|
/**
|
|
133
141
|
* Check if a file or directory has unstaged changes.
|
|
@@ -170,11 +178,11 @@ function isUnstagedSync(pathname, options) {
|
|
|
170
178
|
...options,
|
|
171
179
|
absolute: false
|
|
172
180
|
});
|
|
173
|
-
const path =
|
|
181
|
+
const path = require_node_path.getNodePath();
|
|
174
182
|
const resolvedPathname = require_git_repo.getCachedRealpath(pathname);
|
|
175
183
|
/* c8 ignore start */
|
|
176
184
|
const baseCwd = options?.cwd ? require_git_repo.getCachedRealpath(options["cwd"]) : require_git_repo.getCwd();
|
|
177
|
-
return require_primordials_array.ArrayPrototypeIncludes(files,
|
|
185
|
+
return require_primordials_array.ArrayPrototypeIncludes(files, require_paths_normalize.normalizePath(path.relative(baseCwd, resolvedPathname)));
|
|
178
186
|
}
|
|
179
187
|
|
|
180
188
|
//#endregion
|
package/dist/github/ghsa.js
CHANGED
|
@@ -8,7 +8,7 @@ const require_http_request_request = require('../http-request/request.js');
|
|
|
8
8
|
const require_github_constants = require('./constants.js');
|
|
9
9
|
const require_github_errors = require('./errors.js');
|
|
10
10
|
const require_github_token = require('./token.js');
|
|
11
|
-
const
|
|
11
|
+
const require_github_request = require('./request.js');
|
|
12
12
|
const require_github_refs_cache = require('./refs-cache.js');
|
|
13
13
|
let node_process = require("node:process");
|
|
14
14
|
node_process = require_runtime.__toESM(node_process);
|
|
@@ -111,7 +111,7 @@ async function fetchGhsaDetails(ghsaId, options) {
|
|
|
111
111
|
/* c8 ignore start - External GitHub API call */
|
|
112
112
|
const url = `https://api.github.com/advisories/${ghsaId}`;
|
|
113
113
|
try {
|
|
114
|
-
const data = await
|
|
114
|
+
const data = await require_github_request.fetchGitHub(url, options);
|
|
115
115
|
return {
|
|
116
116
|
ghsaId: data.ghsa_id,
|
|
117
117
|
summary: data.summary,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file TtlCache singleton for github/refs. Split out of `github/refs.ts` for
|
|
3
|
-
* size hygiene. Owns the lazy `
|
|
3
|
+
* size hygiene. Owns the lazy `githubCache` slot, the accessor
|
|
4
4
|
* (`getGithubCache`), and the in-memory-only clear (`clearRefCache`). Caching
|
|
5
5
|
* strategy:
|
|
6
6
|
*
|
|
@@ -7,7 +7,7 @@ const require_cache_ttl_store = require('../cache/ttl/store.js');
|
|
|
7
7
|
//#region src/github/refs-cache.ts
|
|
8
8
|
/**
|
|
9
9
|
* @file TtlCache singleton for github/refs. Split out of `github/refs.ts` for
|
|
10
|
-
* size hygiene. Owns the lazy `
|
|
10
|
+
* size hygiene. Owns the lazy `githubCache` slot, the accessor
|
|
11
11
|
* (`getGithubCache`), and the in-memory-only clear (`clearRefCache`). Caching
|
|
12
12
|
* strategy:
|
|
13
13
|
*
|
|
@@ -16,7 +16,7 @@ const require_cache_ttl_store = require('../cache/ttl/store.js');
|
|
|
16
16
|
* - Default TTL: 5 minutes
|
|
17
17
|
* - Disable everything with the `DISABLE_GITHUB_CACHE` env var
|
|
18
18
|
*/
|
|
19
|
-
let
|
|
19
|
+
let githubCache;
|
|
20
20
|
/**
|
|
21
21
|
* Clear the ref resolution cache (in-memory only). Clears the in-memory
|
|
22
22
|
* memoization cache without affecting the persistent disk cache. Useful for
|
|
@@ -37,7 +37,7 @@ let _githubCache;
|
|
|
37
37
|
* @returns Promise that resolves when cache is cleared
|
|
38
38
|
*/
|
|
39
39
|
async function clearRefCache() {
|
|
40
|
-
if (
|
|
40
|
+
if (githubCache) await githubCache.clear({ memoOnly: true });
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Get or create the GitHub cache instance. Lazy initializes the cache with
|
|
@@ -47,12 +47,12 @@ async function clearRefCache() {
|
|
|
47
47
|
* @returns The singleton cache instance
|
|
48
48
|
*/
|
|
49
49
|
function getGithubCache() {
|
|
50
|
-
if (
|
|
50
|
+
if (githubCache === void 0) githubCache = require_cache_ttl_store.createTtlCache({
|
|
51
51
|
memoize: true,
|
|
52
52
|
prefix: "github-refs",
|
|
53
53
|
ttl: require_github_constants.DEFAULT_CACHE_TTL_MS
|
|
54
54
|
});
|
|
55
|
-
return
|
|
55
|
+
return githubCache;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
//#endregion
|
|
@@ -48,6 +48,10 @@ const require_github_token = require('./token.js');
|
|
|
48
48
|
* error.
|
|
49
49
|
*/
|
|
50
50
|
async function fetchRefShaViaGraphQL(owner, repo, ref, options) {
|
|
51
|
+
options = {
|
|
52
|
+
__proto__: null,
|
|
53
|
+
...options
|
|
54
|
+
};
|
|
51
55
|
const token = options.token || require_github_token.getGitHubToken();
|
|
52
56
|
const headers = {
|
|
53
57
|
Accept: "application/vnd.github.v3+json",
|
package/dist/github/refs-rest.js
CHANGED
|
@@ -5,7 +5,7 @@ const require_primordials_error = require('../primordials/error.js');
|
|
|
5
5
|
const require_errors_message = require('../errors/message.js');
|
|
6
6
|
const require_github_constants = require('./constants.js');
|
|
7
7
|
const require_github_errors = require('./errors.js');
|
|
8
|
-
const
|
|
8
|
+
const require_github_request = require('./request.js');
|
|
9
9
|
const require_github_refs_graphql = require('./refs-graphql.js');
|
|
10
10
|
|
|
11
11
|
//#region src/github/refs-rest.ts
|
|
@@ -31,6 +31,10 @@ const require_github_refs_graphql = require('./refs-graphql.js');
|
|
|
31
31
|
* @throws {Error} When ref cannot be resolved after all strategies fail
|
|
32
32
|
*/
|
|
33
33
|
async function fetchRefSha(owner, repo, ref, options) {
|
|
34
|
+
options = {
|
|
35
|
+
__proto__: null,
|
|
36
|
+
...options
|
|
37
|
+
};
|
|
34
38
|
const fetchOptions = { token: options.token };
|
|
35
39
|
let sawEmptyBody = false;
|
|
36
40
|
const note404 = (e) => {
|
|
@@ -38,17 +42,17 @@ async function fetchRefSha(owner, repo, ref, options) {
|
|
|
38
42
|
return e;
|
|
39
43
|
};
|
|
40
44
|
try {
|
|
41
|
-
const tagData = await
|
|
42
|
-
if (tagData.object.type === "tag") return (await
|
|
45
|
+
const tagData = await require_github_request.fetchGitHub(`${require_github_constants.GITHUB_API_BASE_URL}/repos/${owner}/${repo}/git/refs/tags/${ref}`, fetchOptions);
|
|
46
|
+
if (tagData.object.type === "tag") return (await require_github_request.fetchGitHub(tagData.object.url, fetchOptions)).object.sha;
|
|
43
47
|
return tagData.object.sha;
|
|
44
48
|
} catch (e) {
|
|
45
49
|
note404(e);
|
|
46
50
|
try {
|
|
47
|
-
return (await
|
|
51
|
+
return (await require_github_request.fetchGitHub(`${require_github_constants.GITHUB_API_BASE_URL}/repos/${owner}/${repo}/git/refs/heads/${ref}`, fetchOptions)).object.sha;
|
|
48
52
|
} catch (e2) {
|
|
49
53
|
note404(e2);
|
|
50
54
|
try {
|
|
51
|
-
return (await
|
|
55
|
+
return (await require_github_request.fetchGitHub(`${require_github_constants.GITHUB_API_BASE_URL}/repos/${owner}/${repo}/commits/${ref}`, fetchOptions)).sha;
|
|
52
56
|
} catch (e3) {
|
|
53
57
|
note404(e3);
|
|
54
58
|
if (sawEmptyBody) {
|
package/dist/github/refs.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
|
-
const require_github_refs_graphql = require('./refs-graphql.js');
|
|
6
|
-
const require_github_refs_rest = require('./refs-rest.js');
|
|
7
4
|
const require_github_refs_cache = require('./refs-cache.js');
|
|
8
|
-
let node_process = require("node:process");
|
|
9
|
-
node_process = require_runtime.__toESM(node_process);
|
|
10
5
|
|
|
11
6
|
//#region src/github/refs.ts
|
|
12
7
|
/**
|
|
@@ -94,15 +89,25 @@ async function resolveRefToSha(owner, repo, ref, options) {
|
|
|
94
89
|
...options
|
|
95
90
|
};
|
|
96
91
|
const cacheKey = `${owner}/${repo}@${ref}`;
|
|
97
|
-
if (
|
|
98
|
-
return await
|
|
99
|
-
return await
|
|
92
|
+
if (process.env["DISABLE_GITHUB_CACHE"]) return await fetchRefSha$1(owner, repo, ref, opts);
|
|
93
|
+
return await getGithubCache$1().getOrFetch(cacheKey, async () => {
|
|
94
|
+
return await fetchRefSha$1(owner, repo, ref, opts);
|
|
100
95
|
});
|
|
101
96
|
}
|
|
102
97
|
|
|
103
98
|
//#endregion
|
|
104
99
|
exports.clearRefCache = require_github_refs_cache.clearRefCache;
|
|
105
|
-
exports
|
|
106
|
-
|
|
100
|
+
Object.defineProperty(exports, 'fetchRefSha', {
|
|
101
|
+
enumerable: true,
|
|
102
|
+
get: function () {
|
|
103
|
+
return fetchRefSha;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
Object.defineProperty(exports, 'fetchRefShaViaGraphQL', {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function () {
|
|
109
|
+
return fetchRefShaViaGraphQL;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
107
112
|
exports.getGithubCache = require_github_refs_cache.getGithubCache;
|
|
108
113
|
exports.resolveRefToSha = resolveRefToSha;
|
|
@@ -6,10 +6,11 @@ const require_primordials_date = require('../primordials/date.js');
|
|
|
6
6
|
const require_primordials_json = require('../primordials/json.js');
|
|
7
7
|
const require_errors_message = require('../errors/message.js');
|
|
8
8
|
const require_http_request_request = require('../http-request/request.js');
|
|
9
|
+
const require_env_github_status = require('../env/github-status.js');
|
|
9
10
|
const require_github_errors = require('./errors.js');
|
|
10
11
|
const require_github_token = require('./token.js');
|
|
11
12
|
|
|
12
|
-
//#region src/github/
|
|
13
|
+
//#region src/github/request.ts
|
|
13
14
|
/**
|
|
14
15
|
* @file Authenticated GitHub REST fetch. `fetchGitHub` is the single entry
|
|
15
16
|
* point that the rest of the github/ modules go through for REST calls. It
|
|
@@ -87,7 +88,7 @@ async function fetchGitHub(url, options) {
|
|
|
87
88
|
__proto__: null,
|
|
88
89
|
...options
|
|
89
90
|
};
|
|
90
|
-
const token = opts.token
|
|
91
|
+
const token = opts.token ?? require_github_token.getGitHubToken();
|
|
91
92
|
const headers = {
|
|
92
93
|
Accept: "application/vnd.github.v3+json",
|
|
93
94
|
"User-Agent": "socket-registry-github-client",
|
|
@@ -110,6 +111,16 @@ async function fetchGitHub(url, options) {
|
|
|
110
111
|
throw error;
|
|
111
112
|
}
|
|
112
113
|
}
|
|
114
|
+
if (response.status >= 500) {
|
|
115
|
+
/* c8 ignore start - External status probe, non-deterministic */
|
|
116
|
+
const ghStatus = await require_env_github_status.probeGitHubStatus(4e3).catch(() => void 0);
|
|
117
|
+
/* c8 ignore stop */
|
|
118
|
+
let statusNote = "";
|
|
119
|
+
if (ghStatus) if (ghStatus.status === "unknown") statusNote = " (githubstatus.com unreachable — could not confirm platform health)";
|
|
120
|
+
else if (ghStatus.degraded) statusNote = `\nGitHub platform status at time of failure:\n${ghStatus.components.map((c) => ` ${c.name}: ${c.status}`).join("\n")}`;
|
|
121
|
+
else statusNote = "\nGitHub platform status: all monitored components operational — this may be a transient issue or a request-specific error.";
|
|
122
|
+
throw new require_primordials_error.ErrorCtor(`GitHub API error ${response.status}: ${response.statusText}.${statusNote}`);
|
|
123
|
+
}
|
|
113
124
|
throw new require_primordials_error.ErrorCtor(`GitHub API error ${response.status}: ${response.statusText}`);
|
|
114
125
|
}
|
|
115
126
|
if (response.body.byteLength === 0) throw new require_github_errors.GitHubEmptyBodyError(url);
|
package/dist/github/token.js
CHANGED
|
@@ -34,7 +34,7 @@ const require_env_socket_cli = require('../env/socket-cli.js');
|
|
|
34
34
|
* @returns The first available GitHub token, or `undefined` if none found
|
|
35
35
|
*/
|
|
36
36
|
function getGitHubToken() {
|
|
37
|
-
return
|
|
37
|
+
return require_env_github.getGithubToken() || require_env_github.getGhToken() || require_env_socket_cli.getSocketCliGithubToken() || void 0;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Get GitHub authentication token from git config. Reads the `github.token`
|
package/dist/github/types.d.ts
CHANGED
package/dist/globs/_internal.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
4
5
|
const require_primordials_string = require('../primordials/string.js');
|
|
5
6
|
const require_paths_normalize = require('../paths/normalize.js');
|
|
6
7
|
const require_primordials_array = require('../primordials/array.js');
|
|
7
|
-
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
8
8
|
const require_node_fs = require('../node/fs.js');
|
|
9
9
|
const require_globs_defaults = require('./defaults.js');
|
|
10
10
|
const require_node_fs_promises = require('../node/fs-promises.js');
|
|
@@ -18,17 +18,15 @@ const require_node_fs_promises = require('../node/fs-promises.js');
|
|
|
18
18
|
*/
|
|
19
19
|
const MATCHER_CACHE_MAX_SIZE = 100;
|
|
20
20
|
const matcherCache = new require_primordials_map_set.MapCtor();
|
|
21
|
-
let
|
|
22
|
-
let
|
|
23
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
21
|
+
let cachedFastGlob;
|
|
22
|
+
let cachedPicomatch;
|
|
24
23
|
function getFastGlob() {
|
|
25
|
-
if (
|
|
26
|
-
return
|
|
24
|
+
if (cachedFastGlob === void 0) cachedFastGlob = /*@__PURE__*/ require("../external/fast-glob.js");
|
|
25
|
+
return cachedFastGlob;
|
|
27
26
|
}
|
|
28
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
29
27
|
function getPicomatch() {
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
28
|
+
if (cachedPicomatch === void 0) cachedPicomatch = /*@__PURE__*/ require("../external/picomatch.js");
|
|
29
|
+
return cachedPicomatch;
|
|
32
30
|
}
|
|
33
31
|
/**
|
|
34
32
|
* Glob results are normalized to forward slashes regardless of the backend
|
|
@@ -38,7 +36,7 @@ function getPicomatch() {
|
|
|
38
36
|
* this stays consistent with every other path-shaped string in the lib.
|
|
39
37
|
*/
|
|
40
38
|
function normalizeGlobResults(out) {
|
|
41
|
-
for (let i = 0; i < out.length; i += 1) out[i] =
|
|
39
|
+
for (let i = 0; i < out.length; i += 1) out[i] = require_paths_normalize.normalizePath(out[i]);
|
|
42
40
|
return out;
|
|
43
41
|
}
|
|
44
42
|
/**
|
package/dist/globs/match.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_node_fs = require('../node/fs.js');
|
|
5
4
|
const require_primordials_object = require('../primordials/object.js');
|
|
5
|
+
const require_node_fs = require('../node/fs.js');
|
|
6
6
|
const require_node_fs_promises = require('../node/fs-promises.js');
|
|
7
7
|
const require_globs__internal = require('./_internal.js');
|
|
8
8
|
const require_promises_resolvers = require('../promises/resolvers.js');
|
|
@@ -58,15 +58,18 @@ function canUseNodeFsGlob(options) {
|
|
|
58
58
|
* console.log(files) // ['src/index.ts', 'src/utils.ts']
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
62
61
|
async function glob(patterns, options) {
|
|
62
|
+
options = {
|
|
63
|
+
__proto__: null,
|
|
64
|
+
...options
|
|
65
|
+
};
|
|
63
66
|
const normalizedIgnore = require_globs__internal.normalizeIgnorePatterns(options?.ignore);
|
|
64
67
|
/* c8 ignore start */
|
|
65
|
-
if (canUseNodeFsGlob(options)) return require_globs__internal.normalizeGlobResults(await require_promises_resolvers.fromAsync(
|
|
68
|
+
if (canUseNodeFsGlob(options)) return require_globs__internal.normalizeGlobResults(await require_promises_resolvers.fromAsync(require_node_fs_promises.getNodeFsPromises().glob(patterns, {
|
|
66
69
|
...options?.cwd ? { cwd: options.cwd } : {},
|
|
67
70
|
...normalizedIgnore ? { exclude: normalizedIgnore } : {}
|
|
68
71
|
})));
|
|
69
|
-
return require_globs__internal.normalizeGlobResults(await
|
|
72
|
+
return require_globs__internal.normalizeGlobResults(await require_globs__internal.getFastGlob().glob(patterns, {
|
|
70
73
|
...options,
|
|
71
74
|
...normalizedIgnore ? { ignore: normalizedIgnore } : {}
|
|
72
75
|
}));
|
|
@@ -81,15 +84,18 @@ async function glob(patterns, options) {
|
|
|
81
84
|
* console.log(files) // ['package.json', 'tsconfig.json']
|
|
82
85
|
* ```
|
|
83
86
|
*/
|
|
84
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
85
87
|
function globSync(patterns, options) {
|
|
88
|
+
options = {
|
|
89
|
+
__proto__: null,
|
|
90
|
+
...options
|
|
91
|
+
};
|
|
86
92
|
const normalizedIgnore = require_globs__internal.normalizeIgnorePatterns(options?.ignore);
|
|
87
93
|
/* c8 ignore start */
|
|
88
|
-
if (canUseNodeFsGlob(options)) return require_globs__internal.normalizeGlobResults([...
|
|
94
|
+
if (canUseNodeFsGlob(options)) return require_globs__internal.normalizeGlobResults([...require_node_fs.getNodeFs().globSync(patterns, {
|
|
89
95
|
...options?.cwd ? { cwd: options.cwd } : {},
|
|
90
96
|
...normalizedIgnore ? { exclude: normalizedIgnore } : {}
|
|
91
97
|
})]);
|
|
92
|
-
return require_globs__internal.normalizeGlobResults(
|
|
98
|
+
return require_globs__internal.normalizeGlobResults(require_globs__internal.getFastGlob().globSync(patterns, {
|
|
93
99
|
...options,
|
|
94
100
|
...normalizedIgnore ? { ignore: normalizedIgnore } : {}
|
|
95
101
|
}));
|
package/dist/globs/matcher.d.ts
CHANGED
|
@@ -30,9 +30,9 @@ import type { Pattern } from './types';
|
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
32
|
export declare function getGlobMatcher(glob: Pattern | Pattern[], options?: {
|
|
33
|
-
dot?: boolean;
|
|
34
|
-
nocase?: boolean;
|
|
35
|
-
ignore?: string[];
|
|
33
|
+
dot?: boolean | undefined;
|
|
34
|
+
nocase?: boolean | undefined;
|
|
35
|
+
ignore?: string[] | undefined;
|
|
36
36
|
}): (path: string) => boolean;
|
|
37
37
|
/**
|
|
38
38
|
* Resolve `path.matchesGlob` (or `undefined` if the runtime predates it).
|
package/dist/globs/matcher.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_primordials_object = require('../primordials/object.js');
|
|
4
5
|
const require_primordials_string = require('../primordials/string.js');
|
|
5
6
|
const require_primordials_array = require('../primordials/array.js');
|
|
6
|
-
const require_primordials_object = require('../primordials/object.js');
|
|
7
7
|
const require_primordials_json = require('../primordials/json.js');
|
|
8
8
|
const require_globs__internal = require('./_internal.js');
|
|
9
9
|
|
|
@@ -14,8 +14,8 @@ const require_globs__internal = require('./_internal.js');
|
|
|
14
14
|
* `path.matchesGlob` for the rare case where the caller wants strict
|
|
15
15
|
* (`nocase: false`, `dot: false`) matching.
|
|
16
16
|
*/
|
|
17
|
-
let
|
|
18
|
-
let
|
|
17
|
+
let matchesGlobCache;
|
|
18
|
+
let matchesGlobProbed = false;
|
|
19
19
|
/**
|
|
20
20
|
* Return a glob-matcher function, memoized by pattern + options.
|
|
21
21
|
*
|
|
@@ -40,13 +40,16 @@ let _matchesGlobProbed = false;
|
|
|
40
40
|
* const isSource = getGlobMatcher(['src/**', '!**\/*.test.ts'])
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
44
43
|
function getGlobMatcher(glob, options) {
|
|
44
|
+
options = {
|
|
45
|
+
__proto__: null,
|
|
46
|
+
...options
|
|
47
|
+
};
|
|
45
48
|
const patterns = require_primordials_array.ArrayIsArray(glob) ? glob : [glob];
|
|
46
|
-
const sortedPatterns = [...patterns].
|
|
47
|
-
const sortedOptions = options ? require_primordials_object.ObjectKeys(options).
|
|
49
|
+
const sortedPatterns = [...patterns].toSorted();
|
|
50
|
+
const sortedOptions = options ? require_primordials_object.ObjectKeys(options).toSorted().map((k) => {
|
|
48
51
|
const value = options[k];
|
|
49
|
-
return `${k}:${require_primordials_json.JSONStringify(require_primordials_array.ArrayIsArray(value) ? [...value].
|
|
52
|
+
return `${k}:${require_primordials_json.JSONStringify(require_primordials_array.ArrayIsArray(value) ? [...value].toSorted() : value)}`;
|
|
50
53
|
}).join(",") : "";
|
|
51
54
|
const key = `${sortedPatterns.join("|")}:${sortedOptions}`;
|
|
52
55
|
const existing = require_globs__internal.matcherCache.get(key);
|
|
@@ -64,7 +67,7 @@ function getGlobMatcher(glob, options) {
|
|
|
64
67
|
let matcher;
|
|
65
68
|
/* c8 ignore start */
|
|
66
69
|
if (patterns.length === 1 && !require_primordials_string.StringPrototypeStartsWith(patterns[0], "!") && options !== void 0 && options.nocase === false && options.dot === false && (options.ignore === void 0 || options.ignore.length === 0)) {
|
|
67
|
-
const matchesGlob =
|
|
70
|
+
const matchesGlob = getMatchesGlob();
|
|
68
71
|
if (matchesGlob !== void 0) {
|
|
69
72
|
const pattern = patterns[0];
|
|
70
73
|
matcher = (p) => matchesGlob(p, pattern);
|
|
@@ -80,7 +83,7 @@ function getGlobMatcher(glob, options) {
|
|
|
80
83
|
...options,
|
|
81
84
|
...negativePatterns.length > 0 ? { ignore: negativePatterns } : {}
|
|
82
85
|
};
|
|
83
|
-
matcher =
|
|
86
|
+
matcher = require_globs__internal.getPicomatch()(positivePatterns.length > 0 ? positivePatterns : patterns, matchOptions);
|
|
84
87
|
}
|
|
85
88
|
require_globs__internal.matcherCache.set(key, matcher);
|
|
86
89
|
return matcher;
|
|
@@ -94,16 +97,15 @@ function getGlobMatcher(glob, options) {
|
|
|
94
97
|
*
|
|
95
98
|
* @internal
|
|
96
99
|
*/
|
|
97
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
98
100
|
function getMatchesGlob() {
|
|
99
|
-
if (!
|
|
101
|
+
if (!matchesGlobProbed) {
|
|
100
102
|
const fn = (/* @__PURE__ */ require("node:path")).matchesGlob;
|
|
101
103
|
/* c8 ignore start */
|
|
102
|
-
if (typeof fn === "function")
|
|
104
|
+
if (typeof fn === "function") matchesGlobCache = fn;
|
|
103
105
|
/* c8 ignore stop */
|
|
104
|
-
|
|
106
|
+
matchesGlobProbed = true;
|
|
105
107
|
}
|
|
106
|
-
return
|
|
108
|
+
return matchesGlobCache;
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
//#endregion
|
package/dist/globs/stream.js
CHANGED
|
@@ -23,7 +23,6 @@ const require_paths_globs = require('../paths/globs.js');
|
|
|
23
23
|
* }
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
27
26
|
function globStreamLicenses(dirname, options) {
|
|
28
27
|
const { ignore: ignoreOpt, ignoreOriginals, recursive, ...globOptions } = {
|
|
29
28
|
__proto__: null,
|
|
@@ -31,7 +30,7 @@ function globStreamLicenses(dirname, options) {
|
|
|
31
30
|
};
|
|
32
31
|
const ignore = [...require_primordials_array.ArrayIsArray(ignoreOpt) ? require_globs__internal.normalizeIgnorePatterns(ignoreOpt) : require_globs_defaults.defaultIgnore, "**/*.{cjs,cts,js,json,mjs,mts,ts}"];
|
|
33
32
|
if (ignoreOriginals) ignore.push(require_paths_globs.LICENSE_ORIGINAL_GLOB_RECURSIVE);
|
|
34
|
-
return
|
|
33
|
+
return require_globs__internal.getFastGlob().globStream([recursive ? require_paths_globs.LICENSE_GLOB_RECURSIVE : require_paths_globs.LICENSE_GLOB], {
|
|
35
34
|
__proto__: null,
|
|
36
35
|
absolute: true,
|
|
37
36
|
caseSensitiveMatch: false,
|