@socketsecurity/lib 6.0.7 → 6.0.9
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 +42 -0
- 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 +4 -0
- package/dist/ai/discover.js +1 -1
- 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 +82 -0
- package/dist/ai/route.js +171 -0
- package/dist/ai/spawn.d.mts +42 -2
- package/dist/ai/spawn.js +146 -33
- 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 +25 -2
- package/dist/ai/worktree.js +4 -0
- package/dist/archives/tar.js +1 -1
- package/dist/archives/zip.js +2 -2
- package/dist/argv/parse.d.ts +19 -2
- package/dist/argv/parse.js +1 -1
- package/dist/arrays/join.js +4 -0
- package/dist/bin/find.js +4 -4
- package/dist/bin/prim.cjs +23322 -18018
- package/dist/bin/resolve.js +2 -2
- package/dist/cache/ttl/store.js +2 -2
- package/dist/cli/check-primordials.d.ts +8 -3
- package/dist/cli/check-primordials.js +4 -4
- package/dist/compression/_internal.js +1 -1
- package/dist/compression/brotli.d.ts +1 -2
- package/dist/compression/brotli.js +5 -1
- package/dist/compression/gzip.js +5 -1
- package/dist/config/layers.d.ts +53 -0
- package/dist/config/layers.js +83 -0
- package/dist/constants/packages.d.ts +3 -0
- package/dist/constants/packages.js +2 -1
- package/dist/constants/socket.d.ts +2 -6
- package/dist/constants/socket.js +12 -14
- package/dist/cover/code.js +2 -2
- package/dist/crypto/hash.d.ts +4 -1
- package/dist/crypto/hash.js +4 -1
- package/dist/dlx/arborist.js +13 -3
- package/dist/dlx/binary-cache.js +1 -1
- package/dist/dlx/binary-resolution.js +1 -1
- package/dist/dlx/detect.d.ts +8 -0
- package/dist/dlx/firewall.d.ts +8 -0
- package/dist/dlx/lockfile.js +5 -2
- package/dist/dlx/manifest.js +1 -1
- package/dist/dlx/package.js +4 -0
- package/dist/eco/cargo/parse-lockfile.d.ts +1 -2
- package/dist/eco/cargo/parse-lockfile.js +3 -3
- package/dist/eco/manifest/detect-format.js +1 -1
- package/dist/eco/npm/npm/parse-lockfile.d.ts +3 -4
- package/dist/eco/npm/npm/parse-lockfile.js +2 -2
- package/dist/eco/npm/parse-package-json.d.ts +11 -0
- package/dist/eco/npm/parse-package-json.js +1 -1
- package/dist/eco/npm/pnpm/parse-lockfile.d.ts +5 -3
- package/dist/eco/npm/pnpm/parse-lockfile.js +3 -3
- package/dist/eco/npm/yarnpkg/yarn/exec.js +1 -1
- package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.d.ts +1 -2
- package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.js +2 -2
- package/dist/env/proxy.js +1 -1
- package/dist/env/rewire.d.ts +6 -3
- package/dist/env/rewire.js +7 -8
- package/dist/env/socket.d.ts +7 -0
- package/dist/env/socket.js +10 -0
- package/dist/env/xdg.d.ts +17 -0
- package/dist/env/xdg.js +21 -1
- package/dist/errors/predicates.js +1 -1
- package/dist/errors/stack.js +1 -2
- package/dist/external/@npmcli/package-json.js +3455 -4881
- package/dist/external/@npmcli/promise-spawn.js +3 -1
- package/dist/external/@yarnpkg/extensions.js +1 -1
- package/dist/external/external-pack.js +1 -1
- package/dist/external/npm-pack.js +29164 -31799
- package/dist/external/pico-pack.js +4 -2
- package/dist/external/tar-fs.js +63 -16
- 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/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/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/resolve.d.ts +3 -3
- package/dist/external-tools/cdxgen/resolve.js +16 -8
- package/dist/external-tools/from-download.d.ts +2 -2
- package/dist/external-tools/from-download.js +11 -5
- 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/resolve.d.ts +3 -3
- package/dist/external-tools/janus/resolve.js +16 -8
- 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.js +1 -1
- 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 +2 -2
- package/dist/external-tools/jre/resolve.d.ts +3 -3
- package/dist/external-tools/jre/resolve.js +16 -8
- package/dist/external-tools/manifest.d.ts +18 -0
- package/dist/external-tools/manifest.js +2 -2
- 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/resolve.d.ts +3 -3
- package/dist/external-tools/opengrep/resolve.js +16 -8
- package/dist/external-tools/python/asset-names.d.ts +1 -1
- package/dist/external-tools/python/asset-names.js +11 -4
- package/dist/external-tools/python/dlx.d.ts +3 -3
- package/dist/external-tools/python/dlx.js +20 -9
- package/dist/external-tools/python/from-download.d.ts +1 -1
- package/dist/external-tools/python/from-download.js +12 -5
- package/dist/external-tools/python/pin.js +6 -3
- package/dist/external-tools/python/pip-install.js +6 -3
- package/dist/external-tools/python/resolve.d.ts +3 -3
- package/dist/external-tools/python/resolve.js +19 -11
- package/dist/external-tools/python/uv-install.d.ts +89 -0
- package/dist/external-tools/python/uv-install.js +165 -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/resolve.d.ts +3 -3
- package/dist/external-tools/sbt/resolve.js +16 -8
- 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-uv.d.ts +30 -0
- package/dist/external-tools/skillspector/from-uv.js +56 -0
- package/dist/external-tools/skillspector/resolve.d.ts +20 -5
- package/dist/external-tools/skillspector/resolve.js +27 -6
- package/dist/external-tools/skillspector/types.d.ts +3 -1
- 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 +5 -2
- 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/resolve.d.ts +3 -3
- package/dist/external-tools/trivy/resolve.js +16 -8
- 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/resolve.d.ts +3 -3
- package/dist/external-tools/trufflehog/resolve.js +16 -8
- package/dist/external-tools/uv/asset-names.d.ts +36 -0
- package/dist/external-tools/uv/asset-names.js +73 -0
- package/dist/external-tools/uv/from-download.d.ts +17 -0
- package/dist/external-tools/uv/from-download.js +50 -0
- package/dist/external-tools/uv/from-path.d.ts +5 -0
- package/dist/external-tools/uv/from-path.js +22 -0
- package/dist/external-tools/uv/from-vfs.d.ts +7 -0
- package/dist/external-tools/uv/from-vfs.js +26 -0
- package/dist/external-tools/uv/resolve.d.ts +25 -0
- package/dist/external-tools/uv/resolve.js +61 -0
- package/dist/external-tools/uv/types.d.ts +24 -0
- package/dist/external-tools/uv/types.js +2 -0
- package/dist/fleet/repo-config.d.ts +53 -0
- package/dist/fleet/repo-config.js +79 -0
- package/dist/fs/allowed-dirs-cache.d.ts +27 -1
- package/dist/fs/allowed-dirs-cache.js +39 -6
- package/dist/fs/copy.d.ts +88 -0
- package/dist/fs/copy.js +89 -0
- package/dist/fs/find.js +1 -1
- package/dist/fs/read-json-cache.d.ts +7 -0
- package/dist/fs/resolve-module.js +6 -2
- package/dist/fs/safe.js +1 -1
- package/dist/git/_internal.js +3 -3
- package/dist/git/repo.js +2 -4
- package/dist/git/staged.js +8 -0
- package/dist/git/tracked.d.ts +84 -0
- package/dist/git/tracked.js +163 -0
- package/dist/git/unstaged.js +8 -0
- package/dist/github/refs-graphql.js +4 -0
- package/dist/github/refs-rest.js +4 -0
- package/dist/globs/_internal.js +1 -1
- package/dist/globs/match.js +9 -1
- package/dist/globs/matcher.js +5 -1
- package/dist/http-request/browser.js +7 -3
- package/dist/http-request/checksum-file.js +1 -1
- 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 -1
- package/dist/http-request/request-attempt.js +2 -2
- package/dist/http-request/user-agent.js +1 -1
- package/dist/integrity.d.ts +124 -71
- package/dist/integrity.js +168 -78
- package/dist/json/edit.js +38 -30
- package/dist/json/format.js +1 -1
- package/dist/logger/colors.d.ts +1 -2
- package/dist/logger/colors.js +2 -2
- package/dist/logger/symbols-builder.js +7 -8
- package/dist/logger/symbols.js +8 -8
- package/dist/native-messaging/install.d.ts +1 -1
- package/dist/native-messaging/install.js +7 -4
- package/dist/native-messaging/rate-limit.d.ts +7 -0
- package/dist/native-messaging/rate-limit.js +4 -0
- package/dist/node/async-hooks.js +1 -1
- package/dist/node/child-process.js +1 -1
- package/dist/node/crypto.js +1 -1
- package/dist/node/events.js +1 -1
- package/dist/node/fs-promises.js +1 -1
- package/dist/node/fs.d.ts +22 -6
- package/dist/node/fs.js +16 -3
- package/dist/node/http.js +1 -1
- package/dist/node/https.js +1 -1
- package/dist/node/module.d.ts +73 -2
- package/dist/node/module.js +97 -12
- package/dist/node/os.d.ts +10 -2
- package/dist/node/os.js +11 -4
- package/dist/node/path.d.ts +11 -2
- package/dist/node/path.js +17 -4
- package/dist/node/timers-promises.js +1 -1
- package/dist/node/url.js +1 -1
- package/dist/node/util.js +1 -1
- package/dist/objects/getters.js +1 -1
- package/dist/objects/mutate.js +2 -2
- package/dist/packages/edit-class.d.ts +2 -3
- package/dist/packages/edit-class.js +41 -35
- package/dist/packages/exports.js +4 -4
- package/dist/packages/fetch.js +1 -1
- package/dist/packages/isolation.js +2 -2
- package/dist/packages/licenses.js +2 -2
- package/dist/packages/manifest.d.ts +29 -0
- package/dist/packages/manifest.js +40 -4
- package/dist/packages/normalize.js +2 -2
- package/dist/packages/provenance.js +3 -3
- package/dist/packages/specs.js +1 -1
- package/dist/packages/tarball.js +4 -2
- package/dist/packages/types.d.ts +1 -2
- package/dist/paths/_internal.d.ts +1 -7
- package/dist/paths/_internal.js +9 -15
- package/dist/paths/conversion.js +1 -1
- package/dist/paths/dirnames.d.ts +1 -0
- package/dist/paths/dirnames.js +2 -0
- package/dist/paths/normalize.js +1 -1
- package/dist/paths/predicates.js +2 -1
- package/dist/paths/resolve.js +14 -19
- package/dist/paths/rewire.d.ts +5 -0
- package/dist/paths/socket.d.ts +137 -123
- package/dist/paths/socket.js +172 -131
- package/dist/perf/metrics.js +1 -1
- package/dist/perf/report.js +1 -1
- package/dist/primordials/process.d.ts +88 -0
- package/dist/primordials/process.js +132 -0
- package/dist/primordials/uncurry.d.ts +1 -2
- package/dist/process/spawn/child.js +8 -2
- package/dist/process/spawn/errors.js +1 -1
- package/dist/releases/github-archives.js +1 -1
- package/dist/releases/github-listing.d.ts +1 -2
- package/dist/schema/types.d.ts +3 -4
- package/dist/schema/validate.js +1 -1
- package/dist/secrets/broker.d.ts +35 -0
- package/dist/secrets/broker.js +72 -0
- package/dist/secrets/find.d.ts +8 -6
- package/dist/secrets/find.js +25 -5
- package/dist/secrets/keychain.d.ts +1 -1
- package/dist/secrets/linux.js +32 -44
- package/dist/secrets/macos.d.ts +1 -2
- package/dist/secrets/macos.js +20 -29
- package/dist/secrets/rc.d.ts +2 -2
- package/dist/secrets/rc.js +21 -13
- package/dist/secrets/socket-api-token.js +8 -0
- package/dist/secrets/windows.js +27 -33
- package/dist/shell/parse.d.ts +32 -0
- package/dist/shell/parse.js +60 -0
- package/dist/smol/detect.js +1 -1
- package/dist/smol/http.js +1 -1
- package/dist/smol/https.js +1 -1
- package/dist/smol/manifest.js +1 -1
- package/dist/smol/path.js +1 -1
- package/dist/smol/primordial.js +1 -1
- package/dist/smol/purl.js +1 -1
- package/dist/smol/versions.js +1 -1
- package/dist/smol/vfs.js +1 -1
- package/dist/sorts/_internal.d.ts +1 -2
- package/dist/sorts/_internal.js +2 -6
- package/dist/sorts/semver.js +2 -2
- package/dist/spinner/create-spinner-class.js +2 -2
- package/dist/spinner/spinner-internals.d.ts +1 -1
- package/dist/spinner/spinner-internals.js +9 -5
- package/dist/spinner/spinner.d.ts +4 -0
- package/dist/spinner/spinner.js +1 -1
- package/dist/stdio/progress.js +6 -2
- package/dist/stdio/prompts.d.ts +2 -10
- package/dist/stdio/prompts.js +11 -24
- package/dist/strings/format.js +1 -1
- package/dist/strings/search.js +1 -1
- package/dist/temporal/instant.js +2 -2
- package/dist/themes/context.d.ts +5 -3
- package/dist/themes/context.js +5 -6
- package/dist/url/assert-safe.d.ts +29 -0
- package/dist/url/assert-safe.js +54 -0
- package/dist/url/predicates.d.ts +31 -1
- package/dist/url/predicates.js +42 -1
- package/dist/url/types.d.ts +4 -0
- package/llms.txt +750 -0
- package/package.json +253 -125
package/dist/node/os.js
CHANGED
|
@@ -4,11 +4,18 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
const require_constants_runtime = require('../constants/runtime.js');
|
|
5
5
|
|
|
6
6
|
//#region src/node/os.ts
|
|
7
|
-
|
|
7
|
+
const nodeOs = require_constants_runtime.IS_NODE ? /*@__PURE__*/ require("os") : void 0;
|
|
8
8
|
function getNodeOs() {
|
|
9
|
-
|
|
10
|
-
return cachedOs ??= /*@__PURE__*/ require("node:os");
|
|
9
|
+
return nodeOs;
|
|
11
10
|
}
|
|
11
|
+
const osArch = nodeOs?.arch;
|
|
12
|
+
const osHomedir = nodeOs?.homedir;
|
|
13
|
+
const osPlatform = nodeOs?.platform;
|
|
14
|
+
const osTmpdir = nodeOs?.tmpdir;
|
|
12
15
|
|
|
13
16
|
//#endregion
|
|
14
|
-
exports.getNodeOs = getNodeOs;
|
|
17
|
+
exports.getNodeOs = getNodeOs;
|
|
18
|
+
exports.osArch = osArch;
|
|
19
|
+
exports.osHomedir = osHomedir;
|
|
20
|
+
exports.osPlatform = osPlatform;
|
|
21
|
+
exports.osTmpdir = osTmpdir;
|
package/dist/node/path.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file
|
|
3
|
-
* shared
|
|
2
|
+
* @file Early-snapshot accessor for `node:path`. See `node/fs.ts` for the
|
|
3
|
+
* shared rationale: the `require` runs at module load behind the runtime
|
|
4
|
+
* `IS_NODE` guard (false in browsers → never executes there), giving a
|
|
5
|
+
* load-time snapshot in Node while staying browser-safe.
|
|
4
6
|
*/
|
|
5
7
|
import type * as NodePath from 'node:path';
|
|
6
8
|
export declare function getNodePath(): typeof NodePath;
|
|
9
|
+
export declare const pathBasename: any;
|
|
10
|
+
export declare const pathDirname: any;
|
|
11
|
+
export declare const pathExtname: any;
|
|
12
|
+
export declare const pathIsAbsolute: any;
|
|
13
|
+
export declare const pathJoin: any;
|
|
14
|
+
export declare const pathRelative: any;
|
|
15
|
+
export declare const pathResolve: any;
|
package/dist/node/path.js
CHANGED
|
@@ -4,11 +4,24 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
const require_constants_runtime = require('../constants/runtime.js');
|
|
5
5
|
|
|
6
6
|
//#region src/node/path.ts
|
|
7
|
-
|
|
7
|
+
const nodePath = require_constants_runtime.IS_NODE ? /*@__PURE__*/ require("path") : void 0;
|
|
8
8
|
function getNodePath() {
|
|
9
|
-
|
|
10
|
-
return cachedPath ??= /*@__PURE__*/ require("node:path");
|
|
9
|
+
return nodePath;
|
|
11
10
|
}
|
|
11
|
+
const pathBasename = nodePath?.basename;
|
|
12
|
+
const pathDirname = nodePath?.dirname;
|
|
13
|
+
const pathExtname = nodePath?.extname;
|
|
14
|
+
const pathIsAbsolute = nodePath?.isAbsolute;
|
|
15
|
+
const pathJoin = nodePath?.join;
|
|
16
|
+
const pathRelative = nodePath?.relative;
|
|
17
|
+
const pathResolve = nodePath?.resolve;
|
|
12
18
|
|
|
13
19
|
//#endregion
|
|
14
|
-
exports.getNodePath = getNodePath;
|
|
20
|
+
exports.getNodePath = getNodePath;
|
|
21
|
+
exports.pathBasename = pathBasename;
|
|
22
|
+
exports.pathDirname = pathDirname;
|
|
23
|
+
exports.pathExtname = pathExtname;
|
|
24
|
+
exports.pathIsAbsolute = pathIsAbsolute;
|
|
25
|
+
exports.pathJoin = pathJoin;
|
|
26
|
+
exports.pathRelative = pathRelative;
|
|
27
|
+
exports.pathResolve = pathResolve;
|
|
@@ -7,7 +7,7 @@ const require_constants_runtime = require('../constants/runtime.js');
|
|
|
7
7
|
let timersPromises;
|
|
8
8
|
function getNodeTimersPromises() {
|
|
9
9
|
if (!require_constants_runtime.IS_NODE) return;
|
|
10
|
-
return timersPromises ??= /*@__PURE__*/ require("
|
|
10
|
+
return timersPromises ??= /*@__PURE__*/ require("timers/promises");
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
//#endregion
|
package/dist/node/url.js
CHANGED
|
@@ -7,7 +7,7 @@ const require_constants_runtime = require('../constants/runtime.js');
|
|
|
7
7
|
let cachedUrl;
|
|
8
8
|
function getNodeUrl() {
|
|
9
9
|
if (!require_constants_runtime.IS_NODE) return;
|
|
10
|
-
return cachedUrl ??= /*@__PURE__*/ require("
|
|
10
|
+
return cachedUrl ??= /*@__PURE__*/ require("url");
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
//#endregion
|
package/dist/node/util.js
CHANGED
|
@@ -7,7 +7,7 @@ const require_constants_runtime = require('../constants/runtime.js');
|
|
|
7
7
|
let cachedUtil;
|
|
8
8
|
function getNodeUtil() {
|
|
9
9
|
if (!require_constants_runtime.IS_NODE) return;
|
|
10
|
-
return cachedUtil ??= /*@__PURE__*/ require("
|
|
10
|
+
return cachedUtil ??= /*@__PURE__*/ require("util");
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
//#endregion
|
package/dist/objects/getters.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_primordials_map_set = require('../primordials/map-set.js');
|
|
5
4
|
const require_primordials_object = require('../primordials/object.js');
|
|
5
|
+
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
6
6
|
const require_constants_sentinels = require('../constants/sentinels.js');
|
|
7
7
|
const require_primordials_reflect = require('../primordials/reflect.js');
|
|
8
8
|
const require_objects_sort = require('./sort.js');
|
package/dist/objects/mutate.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_primordials_error = require('../primordials/error.js');
|
|
5
|
-
const require_constants_sentinels = require('../constants/sentinels.js');
|
|
6
|
-
const require_primordials_reflect = require('../primordials/reflect.js');
|
|
7
5
|
const require_arrays_predicates = require('../arrays/predicates.js');
|
|
8
6
|
const require_objects_predicates = require('./predicates.js');
|
|
7
|
+
const require_constants_sentinels = require('../constants/sentinels.js');
|
|
8
|
+
const require_primordials_reflect = require('../primordials/reflect.js');
|
|
9
9
|
|
|
10
10
|
//#region src/objects/mutate.ts
|
|
11
11
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file The `EditablePackageJson` class factory. Split out of
|
|
3
3
|
* `packages/edit.ts` for size hygiene. Wraps `@npmcli/package-json` with
|
|
4
|
-
* Socket-specific knobs: path tracking, a `
|
|
4
|
+
* Socket-specific knobs: path tracking, a `canSave` guard for content-only
|
|
5
5
|
* instances, async + sync save paths that honor `EditablePackageJsonOptions`
|
|
6
6
|
* formatting.
|
|
7
7
|
*
|
|
@@ -14,7 +14,7 @@ import type { EditablePackageJsonInstance } from './edit';
|
|
|
14
14
|
* class. Not exported because consumers go through
|
|
15
15
|
* `getEditablePackageJsonClass()`.
|
|
16
16
|
*/
|
|
17
|
-
interface EditablePackageJsonConstructor {
|
|
17
|
+
export interface EditablePackageJsonConstructor {
|
|
18
18
|
new (): EditablePackageJsonInstance;
|
|
19
19
|
fixSteps: unknown[];
|
|
20
20
|
normalizeSteps: unknown[];
|
|
@@ -36,4 +36,3 @@ interface EditablePackageJsonConstructor {
|
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
38
|
export declare function getEditablePackageJsonClass(): EditablePackageJsonConstructor;
|
|
39
|
-
export {};
|
|
@@ -18,7 +18,7 @@ let src_external__npmcli_package_json_lib_sort = require("../external/@npmcli/pa
|
|
|
18
18
|
/**
|
|
19
19
|
* @file The `EditablePackageJson` class factory. Split out of
|
|
20
20
|
* `packages/edit.ts` for size hygiene. Wraps `@npmcli/package-json` with
|
|
21
|
-
* Socket-specific knobs: path tracking, a `
|
|
21
|
+
* Socket-specific knobs: path tracking, a `canSave` guard for content-only
|
|
22
22
|
* instances, async + sync save paths that honor `EditablePackageJsonOptions`
|
|
23
23
|
* formatting.
|
|
24
24
|
*
|
|
@@ -40,28 +40,28 @@ function getEditablePackageJsonClass() {
|
|
|
40
40
|
static fixSteps = src_external__npmcli_package_json.default.fixSteps;
|
|
41
41
|
static normalizeSteps = src_external__npmcli_package_json.default.normalizeSteps;
|
|
42
42
|
static prepareSteps = src_external__npmcli_package_json.default.prepareSteps;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
canSave = true;
|
|
44
|
+
pkgPath = void 0;
|
|
45
|
+
readFileContent = "";
|
|
46
|
+
readFileJson = void 0;
|
|
47
47
|
get content() {
|
|
48
48
|
return super.content;
|
|
49
49
|
}
|
|
50
50
|
get filename() {
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
53
|
-
if (require_primordials_string.StringPrototypeEndsWith(
|
|
54
|
-
return require_node_path.getNodePath().join(
|
|
51
|
+
const pkgPath = this.pkgPath;
|
|
52
|
+
if (!pkgPath) return "";
|
|
53
|
+
if (require_primordials_string.StringPrototypeEndsWith(pkgPath, "package.json")) return pkgPath;
|
|
54
|
+
return require_node_path.getNodePath().join(pkgPath, "package.json");
|
|
55
55
|
}
|
|
56
56
|
static async create(path, opts = {}) {
|
|
57
57
|
const p = new cachedEditablePackageJsonClass();
|
|
58
58
|
await p.create(path);
|
|
59
59
|
return opts.data ? p.update(opts.data) : p;
|
|
60
60
|
}
|
|
61
|
-
static async fix(path,
|
|
61
|
+
static async fix(path, options) {
|
|
62
62
|
const p = new cachedEditablePackageJsonClass();
|
|
63
63
|
await p.load(path, true);
|
|
64
|
-
return await p.fix(
|
|
64
|
+
return await p.fix(options);
|
|
65
65
|
}
|
|
66
66
|
static async load(path, opts = {}) {
|
|
67
67
|
const p = new cachedEditablePackageJsonClass();
|
|
@@ -73,19 +73,19 @@ function getEditablePackageJsonClass() {
|
|
|
73
73
|
return p.create(path);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
static async normalize(path,
|
|
76
|
+
static async normalize(path, options) {
|
|
77
77
|
const p = new cachedEditablePackageJsonClass();
|
|
78
78
|
await p.load(path);
|
|
79
|
-
return await p.normalize(
|
|
79
|
+
return await p.normalize(options);
|
|
80
80
|
}
|
|
81
|
-
static async prepare(path,
|
|
81
|
+
static async prepare(path, options) {
|
|
82
82
|
const p = new cachedEditablePackageJsonClass();
|
|
83
83
|
await p.load(path, true);
|
|
84
|
-
return await p.prepare(
|
|
84
|
+
return await p.prepare(options);
|
|
85
85
|
}
|
|
86
86
|
create(path) {
|
|
87
87
|
super.create(path);
|
|
88
|
-
this.
|
|
88
|
+
this.pkgPath = path;
|
|
89
89
|
return this;
|
|
90
90
|
}
|
|
91
91
|
async fix(opts = {}) {
|
|
@@ -94,7 +94,7 @@ function getEditablePackageJsonClass() {
|
|
|
94
94
|
}
|
|
95
95
|
fromContent(data) {
|
|
96
96
|
super.fromContent(data);
|
|
97
|
-
this.
|
|
97
|
+
this.canSave = false;
|
|
98
98
|
return this;
|
|
99
99
|
}
|
|
100
100
|
fromJSON(data) {
|
|
@@ -102,11 +102,11 @@ function getEditablePackageJsonClass() {
|
|
|
102
102
|
return this;
|
|
103
103
|
}
|
|
104
104
|
async load(path, create) {
|
|
105
|
-
this.
|
|
105
|
+
this.pkgPath = path;
|
|
106
106
|
const { promises: fsPromises } = require_node_fs.getNodeFs();
|
|
107
107
|
let parseErr;
|
|
108
108
|
try {
|
|
109
|
-
this.
|
|
109
|
+
this.readFileContent = await (0, src_external__npmcli_package_json_lib_read_package.read)(this.filename);
|
|
110
110
|
} catch (e) {
|
|
111
111
|
if (!create) throw e;
|
|
112
112
|
parseErr = e;
|
|
@@ -124,11 +124,11 @@ function getEditablePackageJsonClass() {
|
|
|
124
124
|
} catch {
|
|
125
125
|
throw parseErr;
|
|
126
126
|
}
|
|
127
|
-
this.
|
|
127
|
+
this.canSave = false;
|
|
128
128
|
return this;
|
|
129
129
|
}
|
|
130
|
-
this.fromJSON(this.
|
|
131
|
-
this.
|
|
130
|
+
this.fromJSON(this.readFileContent);
|
|
131
|
+
this.readFileJson = (0, src_external__npmcli_package_json_lib_read_package.parse)(this.readFileContent);
|
|
132
132
|
return this;
|
|
133
133
|
}
|
|
134
134
|
async normalize(opts = {}) {
|
|
@@ -136,15 +136,19 @@ function getEditablePackageJsonClass() {
|
|
|
136
136
|
return this;
|
|
137
137
|
}
|
|
138
138
|
get path() {
|
|
139
|
-
return this.
|
|
139
|
+
return this.pkgPath;
|
|
140
140
|
}
|
|
141
141
|
async prepare(opts = {}) {
|
|
142
142
|
await super.prepare(opts);
|
|
143
143
|
return this;
|
|
144
144
|
}
|
|
145
145
|
async save(options) {
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
options = {
|
|
147
|
+
__proto__: null,
|
|
148
|
+
...options
|
|
149
|
+
};
|
|
150
|
+
if (!this.canSave || this.content === void 0) throw new require_primordials_error.ErrorCtor("No package.json to save to");
|
|
151
|
+
if (!require_json_format.shouldSave(this.content, this.readFileJson, this.readFileContent, {
|
|
148
152
|
...options,
|
|
149
153
|
sortFn: options?.sort ? src_external__npmcli_package_json_lib_sort.packageSort : void 0
|
|
150
154
|
})) return false;
|
|
@@ -152,26 +156,27 @@ function getEditablePackageJsonClass() {
|
|
|
152
156
|
const fileContent = require_json_format.stringifyWithFormatting(options?.sort ? (0, src_external__npmcli_package_json_lib_sort.packageSort)(content) : content, require_json_format.getFormattingFromContent(this.content));
|
|
153
157
|
const { promises: fsPromises } = require_node_fs.getNodeFs();
|
|
154
158
|
await fsPromises.writeFile(this.filename, fileContent);
|
|
155
|
-
this.
|
|
156
|
-
this.
|
|
159
|
+
this.readFileContent = fileContent;
|
|
160
|
+
this.readFileJson = (0, src_external__npmcli_package_json_lib_read_package.parse)(fileContent);
|
|
157
161
|
return true;
|
|
158
162
|
}
|
|
159
163
|
saveSync(options) {
|
|
160
|
-
if (!this.
|
|
164
|
+
if (!this.canSave || this.content === void 0) throw new require_primordials_error.ErrorCtor("No package.json to save to");
|
|
161
165
|
const { ignoreWhitespace = false, sort = false } = {
|
|
162
166
|
__proto__: null,
|
|
163
167
|
...options
|
|
164
168
|
};
|
|
165
169
|
const { [Symbol.for("indent")]: indent, [Symbol.for("newline")]: newline, ...rest } = this.content;
|
|
166
170
|
const content = sort ? (0, src_external__npmcli_package_json_lib_sort.packageSort)(rest) : rest;
|
|
167
|
-
|
|
171
|
+
const util = require_node_util.getNodeUtil();
|
|
172
|
+
if (ignoreWhitespace && util.isDeepStrictEqual(content, this.readFileJson)) return false;
|
|
168
173
|
const format = indent === void 0 || indent === null ? " " : indent;
|
|
169
174
|
const eol = newline === void 0 || newline === null ? "\n" : newline;
|
|
170
175
|
const fileContent = `${require_primordials_json.JSONStringify(content, void 0, format)}\n`.replace(/\n/g, eol);
|
|
171
|
-
if (!ignoreWhitespace && fileContent.trim() === this.
|
|
176
|
+
if (!ignoreWhitespace && fileContent.trim() === this.readFileContent.trim()) return false;
|
|
172
177
|
require_node_fs.getNodeFs().writeFileSync(this.filename, fileContent);
|
|
173
|
-
this.
|
|
174
|
-
this.
|
|
178
|
+
this.readFileContent = fileContent;
|
|
179
|
+
this.readFileJson = (0, src_external__npmcli_package_json_lib_read_package.parse)(fileContent);
|
|
175
180
|
return true;
|
|
176
181
|
}
|
|
177
182
|
update(content) {
|
|
@@ -183,14 +188,15 @@ function getEditablePackageJsonClass() {
|
|
|
183
188
|
__proto__: null,
|
|
184
189
|
...options
|
|
185
190
|
};
|
|
186
|
-
if (!this.
|
|
191
|
+
if (!this.canSave || this.content === void 0) return false;
|
|
187
192
|
const { [Symbol.for("indent")]: indent, [Symbol.for("newline")]: newline, ...rest } = this.content;
|
|
188
193
|
const content = sort ? (0, src_external__npmcli_package_json_lib_sort.packageSort)(rest) : rest;
|
|
189
|
-
|
|
194
|
+
const util = require_node_util.getNodeUtil();
|
|
195
|
+
if (ignoreWhitespace && util.isDeepStrictEqual(content, this.readFileJson)) return false;
|
|
190
196
|
const format = indent === void 0 || indent === null ? " " : indent;
|
|
191
197
|
const eol = newline === void 0 || newline === null ? "\n" : newline;
|
|
192
198
|
const fileContent = `${require_primordials_json.JSONStringify(content, void 0, format)}\n`.replace(/\n/g, eol);
|
|
193
|
-
if (!ignoreWhitespace && fileContent.trim() === this.
|
|
199
|
+
if (!ignoreWhitespace && fileContent.trim() === this.readFileContent.trim()) return false;
|
|
194
200
|
return true;
|
|
195
201
|
}
|
|
196
202
|
};
|
package/dist/packages/exports.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_primordials_error = require('../primordials/error.js');
|
|
5
|
-
const require_primordials_string = require('../primordials/string.js');
|
|
6
|
-
const require_primordials_array = require('../primordials/array.js');
|
|
7
|
-
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
8
5
|
const require_primordials_object = require('../primordials/object.js');
|
|
9
|
-
const
|
|
6
|
+
const require_primordials_string = require('../primordials/string.js');
|
|
10
7
|
const require_arrays_predicates = require('../arrays/predicates.js');
|
|
11
8
|
const require_objects_predicates = require('../objects/predicates.js');
|
|
9
|
+
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
10
|
+
const require_primordials_array = require('../primordials/array.js');
|
|
11
|
+
const require_constants_sentinels = require('../constants/sentinels.js');
|
|
12
12
|
|
|
13
13
|
//#region src/packages/exports.ts
|
|
14
14
|
/**
|
package/dist/packages/fetch.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_objects_predicates = require('../objects/predicates.js');
|
|
6
|
-
const require_constants_packages = require('../constants/packages.js');
|
|
7
6
|
const require_packages_specs = require('./specs.js');
|
|
7
|
+
const require_constants_packages = require('../constants/packages.js');
|
|
8
8
|
const require_packages_read = require('./read.js');
|
|
9
9
|
let src_external_npm_package_arg = require("../external/npm-package-arg");
|
|
10
10
|
src_external_npm_package_arg = require_runtime.__toESM(src_external_npm_package_arg);
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_primordials_error = require('../primordials/error.js');
|
|
6
|
-
const
|
|
6
|
+
const require_primordials_object = require('../primordials/object.js');
|
|
7
7
|
const require_primordials_string = require('../primordials/string.js');
|
|
8
|
+
const require_constants_platform = require('../constants/platform.js');
|
|
8
9
|
const require_paths_conversion = require('../paths/conversion.js');
|
|
9
10
|
const require_paths_predicates = require('../paths/predicates.js');
|
|
10
11
|
const require_node_fs = require('../node/fs.js');
|
|
11
12
|
const require_node_path = require('../node/path.js');
|
|
12
13
|
const require_primordials_json = require('../primordials/json.js');
|
|
13
|
-
const require_primordials_object = require('../primordials/object.js');
|
|
14
14
|
const require_errors_message = require('../errors/message.js');
|
|
15
15
|
const require_process_spawn_child = require('../process/spawn/child.js');
|
|
16
16
|
const require_paths_socket = require('../paths/socket.js');
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_primordials_error = require('../primordials/error.js');
|
|
6
|
+
const require_objects_predicates = require('../objects/predicates.js');
|
|
7
|
+
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
6
8
|
const require_primordials_regexp = require('../primordials/regexp.js');
|
|
7
9
|
const require_paths_normalize = require('../paths/normalize.js');
|
|
8
|
-
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
9
10
|
const require_node_path = require('../node/path.js');
|
|
10
11
|
const require_constants_sentinels = require('../constants/sentinels.js');
|
|
11
|
-
const require_objects_predicates = require('../objects/predicates.js');
|
|
12
12
|
const require_constants_licenses = require('../constants/licenses.js');
|
|
13
13
|
let src_external_spdx_correct = require("../external/spdx-correct");
|
|
14
14
|
src_external_spdx_correct = require_runtime.__toESM(src_external_spdx_correct);
|
|
@@ -32,3 +32,32 @@ export declare function fetchPackageManifest(pkgNameOrId: string, options?: Paco
|
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
export declare function fetchPackagePackument(pkgNameOrId: string, options?: PacoteOptions): Promise<unknown>;
|
|
35
|
+
/**
|
|
36
|
+
* Dev/build-only top-level package.json fields not needed at runtime. The
|
|
37
|
+
* conservative default for {@link trimPublishManifest}; extend per-package via
|
|
38
|
+
* its `drop` option.
|
|
39
|
+
*/
|
|
40
|
+
export declare const DEFAULT_TRIM_FIELDS: readonly string[];
|
|
41
|
+
export interface TrimPublishManifestOptions {
|
|
42
|
+
/**
|
|
43
|
+
* Top-level fields to omit (defaults to {@link DEFAULT_TRIM_FIELDS}).
|
|
44
|
+
*/
|
|
45
|
+
readonly drop?: readonly string[] | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Fields to KEEP even when listed in `drop` (e.g. a runtime postinstall).
|
|
48
|
+
*/
|
|
49
|
+
readonly keep?: readonly string[] | undefined;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Return a shallow copy of `manifest` that omits dev/build-only top-level
|
|
53
|
+
* fields so a published tarball + its npm metadata stay lean (npm caps total
|
|
54
|
+
* per-package metadata at 100 MB). The original object is left intact; persist
|
|
55
|
+
* the result only for the publish, never over the repo's own package.json.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ;```typescript
|
|
59
|
+
* const lean = trimPublishManifest(pkg) // omits devDependencies + scripts
|
|
60
|
+
* const kept = trimPublishManifest(pkg, { keep: ['scripts'] })
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function trimPublishManifest(manifest: PackageJson, options?: TrimPublishManifestOptions | undefined): PackageJson;
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_primordials_object = require('../primordials/object.js');
|
|
6
|
-
const require_process_abort = require('../process/abort.js');
|
|
7
6
|
const require_arrays_predicates = require('../arrays/predicates.js');
|
|
8
7
|
const require_objects_predicates = require('../objects/predicates.js');
|
|
8
|
+
const require_process_abort = require('../process/abort.js');
|
|
9
9
|
const require_constants_socket = require('../constants/socket.js');
|
|
10
10
|
const require_constants_packages = require('../constants/packages.js');
|
|
11
11
|
const require_objects_sort = require('../objects/sort.js');
|
|
12
12
|
const require_packages_exports = require('./exports.js');
|
|
13
13
|
const require_packages_validation = require('./validation.js');
|
|
14
|
+
let src_external_npm_package_arg = require("../external/npm-package-arg");
|
|
15
|
+
src_external_npm_package_arg = require_runtime.__toESM(src_external_npm_package_arg);
|
|
14
16
|
let src_external_semver = require("../external/semver");
|
|
15
17
|
src_external_semver = require_runtime.__toESM(src_external_semver);
|
|
16
18
|
let src_external_pacote = require("../external/pacote");
|
|
17
19
|
src_external_pacote = require_runtime.__toESM(src_external_pacote);
|
|
18
|
-
let src_external_npm_package_arg = require("../external/npm-package-arg");
|
|
19
|
-
src_external_npm_package_arg = require_runtime.__toESM(src_external_npm_package_arg);
|
|
20
20
|
|
|
21
21
|
//#region src/packages/manifest.ts
|
|
22
22
|
/**
|
|
@@ -132,8 +132,44 @@ async function fetchPackagePackument(pkgNameOrId, options) {
|
|
|
132
132
|
});
|
|
133
133
|
} catch {}
|
|
134
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Dev/build-only top-level package.json fields not needed at runtime. The
|
|
137
|
+
* conservative default for {@link trimPublishManifest}; extend per-package via
|
|
138
|
+
* its `drop` option.
|
|
139
|
+
*/
|
|
140
|
+
const DEFAULT_TRIM_FIELDS = ["devDependencies", "scripts"];
|
|
141
|
+
/**
|
|
142
|
+
* Return a shallow copy of `manifest` that omits dev/build-only top-level
|
|
143
|
+
* fields so a published tarball + its npm metadata stay lean (npm caps total
|
|
144
|
+
* per-package metadata at 100 MB). The original object is left intact; persist
|
|
145
|
+
* the result only for the publish, never over the repo's own package.json.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ;```typescript
|
|
149
|
+
* const lean = trimPublishManifest(pkg) // omits devDependencies + scripts
|
|
150
|
+
* const kept = trimPublishManifest(pkg, { keep: ['scripts'] })
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
function trimPublishManifest(manifest, options) {
|
|
154
|
+
const opts = {
|
|
155
|
+
__proto__: null,
|
|
156
|
+
...options
|
|
157
|
+
};
|
|
158
|
+
const drop = new Set(opts.drop ?? DEFAULT_TRIM_FIELDS);
|
|
159
|
+
const keep = new Set(opts.keep ?? []);
|
|
160
|
+
const source = manifest;
|
|
161
|
+
const keys = require_primordials_object.ObjectKeys(source);
|
|
162
|
+
const out = {};
|
|
163
|
+
for (let i = 0, { length } = keys; i < length; i += 1) {
|
|
164
|
+
const key = keys[i];
|
|
165
|
+
if (!drop.has(key) || keep.has(key)) out[key] = source[key];
|
|
166
|
+
}
|
|
167
|
+
return out;
|
|
168
|
+
}
|
|
135
169
|
|
|
136
170
|
//#endregion
|
|
171
|
+
exports.DEFAULT_TRIM_FIELDS = DEFAULT_TRIM_FIELDS;
|
|
137
172
|
exports.createPackageJson = createPackageJson;
|
|
138
173
|
exports.fetchPackageManifest = fetchPackageManifest;
|
|
139
|
-
exports.fetchPackagePackument = fetchPackagePackument;
|
|
174
|
+
exports.fetchPackagePackument = fetchPackagePackument;
|
|
175
|
+
exports.trimPublishManifest = trimPublishManifest;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
|
+
const require_primordials_object = require('../primordials/object.js');
|
|
5
6
|
const require_primordials_string = require('../primordials/string.js');
|
|
6
7
|
const require_primordials_regexp = require('../primordials/regexp.js');
|
|
7
8
|
const require_primordials_array = require('../primordials/array.js');
|
|
8
|
-
const require_primordials_object = require('../primordials/object.js');
|
|
9
|
-
const require_objects_mutate = require('../objects/mutate.js');
|
|
10
9
|
const require_constants_socket = require('../constants/socket.js');
|
|
10
|
+
const require_objects_mutate = require('../objects/mutate.js');
|
|
11
11
|
const require_regexps_escape = require('../regexps/escape.js');
|
|
12
12
|
const require_packages_metadata_extensions = require('./metadata-extensions.js');
|
|
13
13
|
let src_external_normalize_package_data = require("../external/normalize-package-data");
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_primordials_buffer = require('../primordials/buffer.js');
|
|
6
|
-
const
|
|
6
|
+
const require_primordials_object = require('../primordials/object.js');
|
|
7
7
|
const require_primordials_string = require('../primordials/string.js');
|
|
8
|
+
const require_abort_signal = require('../abort/signal.js');
|
|
9
|
+
const require_objects_predicates = require('../objects/predicates.js');
|
|
8
10
|
const require_primordials_array = require('../primordials/array.js');
|
|
9
11
|
const require_primordials_json = require('../primordials/json.js');
|
|
10
|
-
const require_primordials_object = require('../primordials/object.js');
|
|
11
|
-
const require_objects_predicates = require('../objects/predicates.js');
|
|
12
12
|
const require_constants_agents = require('../constants/agents.js');
|
|
13
13
|
const require_constants_packages = require('../constants/packages.js');
|
|
14
14
|
const require_url_parse = require('../url/parse.js');
|
package/dist/packages/specs.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_primordials_string = require('../primordials/string.js');
|
|
6
|
-
const require_strings_predicates = require('../strings/predicates.js');
|
|
7
6
|
const require_objects_predicates = require('../objects/predicates.js');
|
|
7
|
+
const require_strings_predicates = require('../strings/predicates.js');
|
|
8
8
|
const require_constants_socket = require('../constants/socket.js');
|
|
9
9
|
const require_smol_purl = require('../smol/purl.js');
|
|
10
10
|
let src_external__socketregistry_packageurl_js = require("../external/@socketregistry/packageurl-js");
|
package/dist/packages/tarball.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
|
+
const require_paths_normalize = require('../paths/normalize.js');
|
|
5
6
|
const require_process_abort = require('../process/abort.js');
|
|
6
7
|
const require_constants_packages = require('../constants/packages.js');
|
|
7
8
|
let src_external_cacache = require("../external/cacache");
|
|
@@ -46,8 +47,9 @@ async function extractPackage(pkgNameOrId, options, callback) {
|
|
|
46
47
|
};
|
|
47
48
|
/* c8 ignore start - External package registry extraction */
|
|
48
49
|
if (typeof dest === "string") {
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
const normalizedDest = require_paths_normalize.normalizePath(dest);
|
|
51
|
+
await src_external_pacote.default.extract(pkgNameOrId, normalizedDest, extractOptions);
|
|
52
|
+
if (typeof actualCallback === "function") await actualCallback(normalizedDest);
|
|
51
53
|
} else await src_external_cacache.default.tmp.withTmp(pacoteCachePath, { tmpPrefix }, async (tmpDirPath) => {
|
|
52
54
|
await src_external_pacote.default.extract(pkgNameOrId, tmpDirPath, extractOptions);
|
|
53
55
|
if (typeof actualCallback === "function") await actualCallback(tmpDirPath);
|
package/dist/packages/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { CategoryString } from '../eco/types';
|
|
8
8
|
import type { EditablePackageJsonInstance } from './edit';
|
|
9
|
-
type PackageExports = {
|
|
9
|
+
export type PackageExports = {
|
|
10
10
|
[path: string]: unknown;
|
|
11
11
|
};
|
|
12
12
|
export type EditablePackageJson = EditablePackageJsonInstance;
|
|
@@ -131,4 +131,3 @@ export type PacoteOptions = {
|
|
|
131
131
|
preferOffline?: boolean | undefined;
|
|
132
132
|
fullMetadata?: boolean | undefined;
|
|
133
133
|
};
|
|
134
|
-
export {};
|
|
@@ -9,13 +9,7 @@
|
|
|
9
9
|
* - `pathLikeToString` — `string | Buffer | URL` → `string`
|
|
10
10
|
*/
|
|
11
11
|
import type nodeUrl from 'node:url';
|
|
12
|
-
export
|
|
13
|
-
export declare const CHAR_COLON = 58;
|
|
14
|
-
export declare const CHAR_FORWARD_SLASH = 47;
|
|
15
|
-
export declare const CHAR_LOWERCASE_A = 97;
|
|
16
|
-
export declare const CHAR_LOWERCASE_Z = 122;
|
|
17
|
-
export declare const CHAR_UPPERCASE_A = 65;
|
|
18
|
-
export declare const CHAR_UPPERCASE_Z = 90;
|
|
12
|
+
export { CHAR_BACKWARD_SLASH, CHAR_COLON, CHAR_FORWARD_SLASH, CHAR_LOWERCASE_A, CHAR_LOWERCASE_Z, CHAR_UPPERCASE_A, CHAR_UPPERCASE_Z, } from '../constants/encoding';
|
|
19
13
|
export declare const msysDriveRegExp: RegExp;
|
|
20
14
|
export declare const nodeModulesPathRegExp: RegExp;
|
|
21
15
|
export declare const slashRegExp: RegExp;
|
package/dist/paths/_internal.js
CHANGED
|
@@ -2,17 +2,11 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_primordials_buffer = require('../primordials/buffer.js');
|
|
5
|
-
const require_constants_platform = require('../constants/platform.js');
|
|
6
5
|
const require_primordials_string = require('../primordials/string.js');
|
|
6
|
+
const require_constants_platform = require('../constants/platform.js');
|
|
7
|
+
const require_constants_encoding = require('../constants/encoding.js');
|
|
7
8
|
|
|
8
9
|
//#region src/paths/_internal.ts
|
|
9
|
-
const CHAR_BACKWARD_SLASH = 92;
|
|
10
|
-
const CHAR_COLON = 58;
|
|
11
|
-
const CHAR_FORWARD_SLASH = 47;
|
|
12
|
-
const CHAR_LOWERCASE_A = 97;
|
|
13
|
-
const CHAR_LOWERCASE_Z = 122;
|
|
14
|
-
const CHAR_UPPERCASE_A = 65;
|
|
15
|
-
const CHAR_UPPERCASE_Z = 90;
|
|
16
10
|
const msysDriveRegExp = /^\/([a-zA-Z])($|\/)/;
|
|
17
11
|
const nodeModulesPathRegExp = /(?:[/\\]|^)node_modules(?:$|[/\\])/;
|
|
18
12
|
const slashRegExp = /[/\\]/;
|
|
@@ -72,13 +66,13 @@ function pathLikeToString(pathLike) {
|
|
|
72
66
|
}
|
|
73
67
|
|
|
74
68
|
//#endregion
|
|
75
|
-
exports.CHAR_BACKWARD_SLASH = CHAR_BACKWARD_SLASH;
|
|
76
|
-
exports.CHAR_COLON = CHAR_COLON;
|
|
77
|
-
exports.CHAR_FORWARD_SLASH = CHAR_FORWARD_SLASH;
|
|
78
|
-
exports.CHAR_LOWERCASE_A = CHAR_LOWERCASE_A;
|
|
79
|
-
exports.CHAR_LOWERCASE_Z = CHAR_LOWERCASE_Z;
|
|
80
|
-
exports.CHAR_UPPERCASE_A = CHAR_UPPERCASE_A;
|
|
81
|
-
exports.CHAR_UPPERCASE_Z = CHAR_UPPERCASE_Z;
|
|
69
|
+
exports.CHAR_BACKWARD_SLASH = require_constants_encoding.CHAR_BACKWARD_SLASH;
|
|
70
|
+
exports.CHAR_COLON = require_constants_encoding.CHAR_COLON;
|
|
71
|
+
exports.CHAR_FORWARD_SLASH = require_constants_encoding.CHAR_FORWARD_SLASH;
|
|
72
|
+
exports.CHAR_LOWERCASE_A = require_constants_encoding.CHAR_LOWERCASE_A;
|
|
73
|
+
exports.CHAR_LOWERCASE_Z = require_constants_encoding.CHAR_LOWERCASE_Z;
|
|
74
|
+
exports.CHAR_UPPERCASE_A = require_constants_encoding.CHAR_UPPERCASE_A;
|
|
75
|
+
exports.CHAR_UPPERCASE_Z = require_constants_encoding.CHAR_UPPERCASE_Z;
|
|
82
76
|
exports.getUrl = getUrl;
|
|
83
77
|
exports.msysDriveRegExp = msysDriveRegExp;
|
|
84
78
|
exports.nodeModulesPathRegExp = nodeModulesPathRegExp;
|