@socketsecurity/lib 5.19.0 → 5.20.1

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/cache-with-ttl.d.ts +7 -0
  3. package/dist/cache-with-ttl.js +26 -7
  4. package/dist/constants/socket.js +1 -1
  5. package/dist/dlx/lockfile.js +4 -1
  6. package/dist/dlx/manifest.d.ts +10 -4
  7. package/dist/dlx/package.d.ts +1 -1
  8. package/dist/dlx/package.js +5 -2
  9. package/dist/external/@inquirer/checkbox.js +5 -0
  10. package/dist/external/@inquirer/confirm.js +5 -0
  11. package/dist/external/@inquirer/input.js +5 -0
  12. package/dist/external/@inquirer/password.js +5 -0
  13. package/dist/external/@inquirer/search.js +5 -0
  14. package/dist/external/@inquirer/select.js +5 -0
  15. package/dist/external/@npmcli/package-json/lib/read-package.js +40 -32
  16. package/dist/external/@npmcli/package-json/lib/sort.js +104 -92
  17. package/dist/external/@sinclair/typebox/value.js +9007 -0
  18. package/dist/external/@sinclair/typebox.js +7891 -0
  19. package/dist/external/external-pack.js +2749 -28
  20. package/dist/http-request.d.ts +0 -25
  21. package/dist/http-request.js +6 -5
  22. package/dist/ipc.js +43 -10
  23. package/dist/json/edit.d.ts +1 -1
  24. package/dist/memoization.js +6 -0
  25. package/dist/paths/packages.js +6 -2
  26. package/dist/promise-queue.js +1 -1
  27. package/dist/stdio/clear.d.ts +163 -0
  28. package/dist/stdio/clear.js +96 -0
  29. package/dist/stdio/progress.d.ts +152 -0
  30. package/dist/stdio/progress.js +217 -0
  31. package/dist/stdio/prompts.d.ts +196 -0
  32. package/dist/stdio/prompts.js +177 -0
  33. package/dist/tables.js +2 -3
  34. package/dist/validation/validate-schema.d.ts +124 -0
  35. package/dist/validation/validate-schema.js +108 -0
  36. package/package.json +25 -6
  37. package/dist/external/zod.js +0 -7825
  38. package/dist/zod.d.ts +0 -5
  39. package/dist/zod.js +0 -30
package/CHANGELOG.md CHANGED
@@ -5,6 +5,50 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [5.20.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.20.1) - 2026-04-19
9
+
10
+ ### Fixed
11
+
12
+ - `src/ipc.ts`: harden stub-file writes against local symlink/TOCTOU. Previously `writeIpcStub` used `mkdir {recursive, mode: 0o700}` + `writeFile`, which on multi-user Linux (`/tmp` sticky-bit but world-writable) let a pre-positioned attacker-owned `.socket-ipc/<app>/` survive the mode argument and redirect the subsequent `writeFile` through symlinks to victim files. Now validates directory ownership + mode on POSIX after `mkdir`, then opens the stub with `O_CREAT | O_WRONLY | O_EXCL | O_NOFOLLOW` so pre-existing inodes trigger EEXIST and final-component symlinks trigger ELOOP rather than silent file overwrite
13
+ - `src/cache-with-ttl.ts` `getOrFetch()` — the inflight-map check ran _after_ `await get(key)`, so two concurrent cold-cache callers both suspended on the same disk read, both saw no cached value, both skipped the inflight check, and both fired `fetcher()`. Moves the inflight check before the persistent-cache lookup (with a re-check afterward) so the advertised dedupe guarantee actually holds
14
+ - `src/cache-with-ttl.ts` — cap the in-memory `memoCache` with LRU eviction (`memoMaxSize`, default 1000). Previously a long-running process (devserver, editor extension) querying many distinct keys grew memory without bound — expired entries were only reclaimed when the same key was read again
15
+ - `src/memoization.ts` `memoizeAsync()` — `entry.timestamp` was set when a cache miss STARTED its `fn(...)` call, so a fn taking longer than `ttl` produced a value classified as expired the moment it resolved; every subsequent caller past the first ttl window re-fetched instead of hitting the cache. Now refreshes the timestamp in the resolve handler. Also bumps `accessOrder` on the stale-dedup branch so an entry mid-refresh isn't evicted while a peer is computing on its behalf
16
+ - `src/tables.ts` — `displayWidth` measured columns by `.length` of the ANSI-stripped string, i.e. UTF-16 code units rather than rendered terminal cells. CJK, emoji, and combined code points misaligned tables. Routes measurement through `stringWidth` (Intl.Segmenter + East Asian Width)
17
+ - `src/paths/packages.ts` — `resolvePackageJsonDirname` / `resolvePackageJsonPath` gated on `filepath.endsWith('package.json')`, which misidentified any file whose name ended in that suffix (e.g. `/foo/my-package.json`) as a manifest. Now checks for the literal final segment
18
+ - `src/json/edit.ts` — `@example` for `getEditableJsonClass` imported from `@socketsecurity/lib/json`, which is not a package export; fixed to `@socketsecurity/lib/json/edit`
19
+
20
+ ## [5.20.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.20.0) - 2026-04-19
21
+
22
+ ### Added — validation
23
+
24
+ - `@socketsecurity/lib/validation/validate-schema` — universal validator that accepts any Zod-style schema (Zod v3/v4, or any `safeParse`-shaped duck type) and returns a tagged `{ ok: true, value } | { ok: false, errors }` result with normalized `{ path, message }` issues. Type inference flows through: callers get `z.infer<…>`, no casts. Zod is detected purely structurally via `.safeParse` — no runtime import of the `zod` package required
25
+ - `parseSchema(schema, data)` — throwing twin of `validateSchema` for fail-fast trust-boundary validation
26
+ - `Infer<S>`, `ValidateResult<T>`, `ValidationIssue`, `AnySchema` — supporting types exported alongside the helpers
27
+
28
+ ### Fixed
29
+
30
+ - `src/promise-queue.ts`: wrap `task.fn()` invocation via `Promise.resolve().then()` so a **synchronous** throw inside a queued task converts to a proper rejection on `task.reject` instead of escaping as an uncaught exception
31
+ - `src/stdio/progress.ts` `formatTime()`: clamp negative milliseconds so an over-ticking or clock-skewed progress bar no longer renders a negative ETA like `-1m59s`
32
+ - `src/dlx/lockfile.ts`: wrap the scratch-directory cleanup in `finally` with its own `try/catch` so a cleanup failure cannot clobber the real exception from the main try-block
33
+ - `src/dlx/package.ts` `parsePackageSpec`: normalize a bare trailing `@` (e.g. `"pkg@"`) to `version: undefined` so downstream "no version provided" checks behave consistently
34
+ - `src/stdio/prompts.ts`: tighten the `selectModule` destructure type to the two properties actually used (`default`, `Separator`) instead of an `as any` cast
35
+ - `src/http-request.ts`: hoist `CHECKSUM_BSD_RE` and `CHECKSUM_GNU_RE` regex literals to module scope so `parseChecksums()` no longer re-declares them once per line inside its loop
36
+ - `src/dlx/manifest.ts`: correct the `@fileoverview` "Primary API" list to match the actual `DlxManifest` methods (`get/set/clear/clearAll/isFresh/getManifestEntry`) and flag `setPackageEntry` / `setBinaryEntry` as deprecated
37
+
38
+ ## [5.19.1](https://github.com/SocketDev/socket-lib/releases/tag/v5.19.1) - 2026-04-19
39
+
40
+ ### Fixed — stdio (restore accidentally-dropped modules)
41
+
42
+ 5.19.0 shipped a breaking change that was not called out in its changelog or version bump: a refactor commit removed `stdio/prompts`, `stdio/progress`, `stdio/clear`, and the vendored `external/@inquirer/*` shims. socket-cli and other consumers import `stdio/prompts` directly and broke on upgrade.
43
+
44
+ Restored:
45
+
46
+ - `@socketsecurity/lib/stdio/prompts` — inquirer wrappers (`password`, `confirm`, `input`, `select`, `checkbox`, `search`)
47
+ - `@socketsecurity/lib/stdio/progress` — progress-bar utility (`ProgressBar` class)
48
+ - `@socketsecurity/lib/stdio/clear` — terminal line/screen/cursor helpers
49
+ - `src/external/@inquirer/{checkbox,confirm,input,password,search,select}.js` vendor shims
50
+ - Corresponding test suites
51
+
8
52
  ## [5.19.0](https://github.com/SocketDev/socket-lib/releases/tag/v5.19.0) - 2026-04-19
9
53
 
10
54
  ### Added — dlx/integrity (new module)
@@ -126,6 +126,13 @@ export interface TtlCacheOptions {
126
126
  * @default true
127
127
  */
128
128
  memoize?: boolean | undefined;
129
+ /**
130
+ * Maximum number of entries to keep in the in-memory memo cache. When
131
+ * exceeded, the least-recently-used entry is evicted. The persistent
132
+ * (cacache) layer is unaffected.
133
+ * @default 1000
134
+ */
135
+ memoMaxSize?: number | undefined;
129
136
  /**
130
137
  * Custom cache key prefix.
131
138
  * Must not contain wildcards (*).
@@ -36,10 +36,12 @@ module.exports = __toCommonJS(cache_with_ttl_exports);
36
36
  var cacache = __toESM(require("./cacache"));
37
37
  const DEFAULT_TTL_MS = 5 * 60 * 1e3;
38
38
  const DEFAULT_PREFIX = "ttl-cache";
39
+ const DEFAULT_MEMO_MAX_SIZE = 1e3;
39
40
  function createTtlCache(options) {
40
41
  const opts = {
41
42
  __proto__: null,
42
43
  memoize: true,
44
+ memoMaxSize: DEFAULT_MEMO_MAX_SIZE,
43
45
  prefix: DEFAULT_PREFIX,
44
46
  ttl: DEFAULT_TTL_MS,
45
47
  ...options
@@ -50,6 +52,18 @@ function createTtlCache(options) {
50
52
  );
51
53
  }
52
54
  const memoCache = /* @__PURE__ */ new Map();
55
+ const memoMaxSize = Math.max(1, opts.memoMaxSize ?? DEFAULT_MEMO_MAX_SIZE);
56
+ function memoSet(fullKey, entry) {
57
+ if (memoCache.has(fullKey)) {
58
+ memoCache.delete(fullKey);
59
+ } else if (memoCache.size >= memoMaxSize) {
60
+ const oldest = memoCache.keys().next().value;
61
+ if (oldest !== void 0) {
62
+ memoCache.delete(oldest);
63
+ }
64
+ }
65
+ memoCache.set(fullKey, entry);
66
+ }
53
67
  const ttl = opts.ttl ?? DEFAULT_TTL_MS;
54
68
  function buildKey(key) {
55
69
  return `${opts.prefix}:${key}`;
@@ -83,6 +97,7 @@ function createTtlCache(options) {
83
97
  if (opts.memoize) {
84
98
  const memoEntry = memoCache.get(fullKey);
85
99
  if (memoEntry && !isExpired(memoEntry)) {
100
+ memoSet(fullKey, memoEntry);
86
101
  return memoEntry.data;
87
102
  }
88
103
  if (memoEntry) {
@@ -103,7 +118,7 @@ function createTtlCache(options) {
103
118
  }
104
119
  if (!isExpired(entry)) {
105
120
  if (opts.memoize) {
106
- memoCache.set(fullKey, entry);
121
+ memoSet(fullKey, entry);
107
122
  }
108
123
  return entry.data;
109
124
  }
@@ -158,7 +173,7 @@ function createTtlCache(options) {
158
173
  }
159
174
  results.set(originalKey, parsed.data);
160
175
  if (opts.memoize) {
161
- memoCache.set(cacheEntry.key, parsed);
176
+ memoSet(cacheEntry.key, parsed);
162
177
  }
163
178
  } catch {
164
179
  }
@@ -177,7 +192,7 @@ function createTtlCache(options) {
177
192
  expiresAt: Date.now() + ttl
178
193
  };
179
194
  if (opts.memoize) {
180
- memoCache.set(fullKey, entry);
195
+ memoSet(fullKey, entry);
181
196
  }
182
197
  try {
183
198
  await cacache.put(fullKey, JSON.stringify(entry), {
@@ -188,14 +203,18 @@ function createTtlCache(options) {
188
203
  }
189
204
  const inflightRequests = /* @__PURE__ */ new Map();
190
205
  async function getOrFetch(key, fetcher) {
206
+ const fullKey = buildKey(key);
207
+ const preexisting = inflightRequests.get(fullKey);
208
+ if (preexisting) {
209
+ return await preexisting;
210
+ }
191
211
  const cached = await get(key);
192
212
  if (cached !== void 0) {
193
213
  return cached;
194
214
  }
195
- const fullKey = buildKey(key);
196
- const existing = inflightRequests.get(fullKey);
197
- if (existing) {
198
- return await existing;
215
+ const rechecked = inflightRequests.get(fullKey);
216
+ if (rechecked) {
217
+ return await rechecked;
199
218
  }
200
219
  const promise = (async () => {
201
220
  try {
@@ -77,7 +77,7 @@ const SOCKET_FIREWALL_APP_NAME = "sfw";
77
77
  const SOCKET_REGISTRY_APP_NAME = "registry";
78
78
  const SOCKET_APP_PREFIX = "_";
79
79
  const SOCKET_LIB_NAME = "@socketsecurity/lib";
80
- const SOCKET_LIB_VERSION = "5.19.0";
80
+ const SOCKET_LIB_VERSION = "5.20.1";
81
81
  const SOCKET_LIB_URL = "https://github.com/SocketDev/socket-lib";
82
82
  const SOCKET_LIB_USER_AGENT = `socketsecurity-lib/${SOCKET_LIB_VERSION} (${SOCKET_LIB_URL})`;
83
83
  const SOCKET_IPC_HANDSHAKE = "SOCKET_IPC_HANDSHAKE";
@@ -128,7 +128,10 @@ async function generatePackagePin(options) {
128
128
  lockfile: ideal.lockfile
129
129
  };
130
130
  } finally {
131
- await (0, import_fs.safeDelete)(scratch, { force: true });
131
+ try {
132
+ await (0, import_fs.safeDelete)(scratch, { force: true });
133
+ } catch {
134
+ }
132
135
  }
133
136
  }
134
137
  // Annotate the CommonJS export names for ESM import in node:
@@ -3,10 +3,16 @@
3
3
  * Manages persistent caching of DLX package and binary metadata with TTL support
4
4
  * and atomic file operations.
5
5
  *
6
- * Key Functions:
7
- * - getManifestEntry: Retrieve manifest entry by spec
8
- * - setPackageEntry: Store npm package metadata
9
- * - setBinaryEntry: Store binary download metadata
6
+ * Primary API (on {@link DlxManifest}):
7
+ * - `getManifestEntry(spec)` retrieve a manifest entry by spec
8
+ * - `setPackageEntry(spec, key, details)` — store npm package metadata
9
+ * - `setBinaryEntry(spec, key, details)` — store binary download metadata
10
+ * - `getAllPackages()` — enumerate cached package names
11
+ * - `clear(name)` / `clearAll()` — eviction
12
+ * - `isFresh(record, ttlMs)` — TTL check
13
+ *
14
+ * The bare `get(name)` / `set(name, record)` methods are deprecated
15
+ * legacy shims kept for backward compatibility with pre-5.x callers.
10
16
  *
11
17
  * Features:
12
18
  * - TTL-based cache expiration
@@ -136,7 +136,7 @@ export interface DlxPackageResult {
136
136
  * await result.spawnPromise
137
137
  * ```
138
138
  */
139
- export declare function dlxPackage(args: readonly string[] | string[], options?: DlxPackageOptions | undefined, spawnExtra?: SpawnExtra | undefined): Promise<DlxPackageResult>;
139
+ export declare function dlxPackage(args: readonly string[] | string[], options: DlxPackageOptions, spawnExtra?: SpawnExtra | undefined): Promise<DlxPackageResult>;
140
140
  /**
141
141
  * Download and install a package without executing it.
142
142
  * This is useful for self-update or when you need the package files
@@ -141,7 +141,7 @@ async function dlxPackage(args, options, spawnExtra) {
141
141
  const spawnPromise = executePackage(
142
142
  downloadResult.binaryPath,
143
143
  args,
144
- options?.spawnOptions,
144
+ options.spawnOptions,
145
145
  spawnExtra
146
146
  );
147
147
  return {
@@ -414,9 +414,12 @@ function parsePackageSpec(spec) {
414
414
  if (atIndex === -1 || atIndex === 0) {
415
415
  return { name: spec, version: void 0 };
416
416
  }
417
+ const sliced = spec.slice(atIndex + 1);
417
418
  return {
418
419
  name: spec.slice(0, atIndex),
419
- version: spec.slice(atIndex + 1)
420
+ // A trailing `@` (e.g. `'pkg@'`) yields an empty slice normalize
421
+ // to undefined so downstream "no version" checks behave.
422
+ version: sliced || void 0
420
423
  };
421
424
  }
422
425
  }
@@ -0,0 +1,5 @@
1
+ 'use strict'
2
+
3
+ // Re-export from external-pack bundle for better deduplication.
4
+ const { checkbox } = require('../external-pack')
5
+ module.exports = checkbox
@@ -0,0 +1,5 @@
1
+ 'use strict'
2
+
3
+ // Re-export from external-pack bundle for better deduplication.
4
+ const { confirm } = require('../external-pack')
5
+ module.exports = confirm
@@ -0,0 +1,5 @@
1
+ 'use strict'
2
+
3
+ // Re-export from external-pack bundle for better deduplication.
4
+ const { input } = require('../external-pack')
5
+ module.exports = input
@@ -0,0 +1,5 @@
1
+ 'use strict'
2
+
3
+ // Re-export from external-pack bundle for better deduplication.
4
+ const { password } = require('../external-pack')
5
+ module.exports = password
@@ -0,0 +1,5 @@
1
+ 'use strict'
2
+
3
+ // Re-export from external-pack bundle for better deduplication.
4
+ const { search } = require('../external-pack')
5
+ module.exports = search
@@ -0,0 +1,5 @@
1
+ 'use strict'
2
+
3
+ // Re-export from external-pack bundle for better deduplication.
4
+ const { select } = require('../external-pack')
5
+ module.exports = select
@@ -3,6 +3,7 @@
3
3
  * Bundled from @npmcli/package-json/lib/read-package.js
4
4
  * This is a zero-dependency bundle created by esbuild.
5
5
  */
6
+ "use strict";
6
7
  var __defProp = Object.defineProperty;
7
8
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
9
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
@@ -119,36 +120,43 @@ var require_lib = __commonJS({
119
120
  });
120
121
 
121
122
  // node_modules/.pnpm/@npmcli+package-json@7.0.0/node_modules/@npmcli/package-json/lib/read-package.js
122
- var { readFile } = require("fs/promises");
123
- var parseJSON = require_lib();
124
- async function read(filename) {
125
- try {
126
- const data = await readFile(filename, "utf8");
127
- return data;
128
- } catch (err) {
129
- err.message = `Could not read package.json: ${err}`;
130
- throw err;
131
- }
132
- }
133
- __name(read, "read");
134
- function parse(data) {
135
- try {
136
- const content = parseJSON(data);
137
- return content;
138
- } catch (err) {
139
- err.message = `Invalid package.json: ${err}`;
140
- throw err;
123
+ var require_read_package = __commonJS({
124
+ "node_modules/.pnpm/@npmcli+package-json@7.0.0/node_modules/@npmcli/package-json/lib/read-package.js"(exports2, module2) {
125
+ var { readFile } = require("fs/promises");
126
+ var parseJSON = require_lib();
127
+ async function read(filename) {
128
+ try {
129
+ const data = await readFile(filename, "utf8");
130
+ return data;
131
+ } catch (err) {
132
+ err.message = `Could not read package.json: ${err}`;
133
+ throw err;
134
+ }
135
+ }
136
+ __name(read, "read");
137
+ function parse(data) {
138
+ try {
139
+ const content = parseJSON(data);
140
+ return content;
141
+ } catch (err) {
142
+ err.message = `Invalid package.json: ${err}`;
143
+ throw err;
144
+ }
145
+ }
146
+ __name(parse, "parse");
147
+ async function readPackage(filename) {
148
+ const data = await read(filename);
149
+ const content = parse(data);
150
+ return content;
151
+ }
152
+ __name(readPackage, "readPackage");
153
+ module2.exports = {
154
+ read,
155
+ parse,
156
+ readPackage
157
+ };
141
158
  }
142
- }
143
- __name(parse, "parse");
144
- async function readPackage(filename) {
145
- const data = await read(filename);
146
- const content = parse(data);
147
- return content;
148
- }
149
- __name(readPackage, "readPackage");
150
- module.exports = {
151
- read,
152
- parse,
153
- readPackage
154
- };
159
+ });
160
+
161
+ // src/external/@npmcli/package-json/lib/read-package.js
162
+ module.exports = require_read_package();
@@ -3,99 +3,111 @@
3
3
  * Bundled from @npmcli/package-json/lib/sort.js
4
4
  * This is a zero-dependency bundle created by esbuild.
5
5
  */
6
+ "use strict";
6
7
  var __defProp = Object.defineProperty;
8
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
9
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
10
+ var __commonJS = (cb, mod) => function __require() {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ };
8
13
 
9
14
  // node_modules/.pnpm/@npmcli+package-json@7.0.0/node_modules/@npmcli/package-json/lib/sort.js
10
- function packageSort(json) {
11
- const {
12
- name,
13
- version,
14
- private: isPrivate,
15
- description,
16
- keywords,
17
- homepage,
18
- bugs,
19
- repository,
20
- funding,
21
- license,
22
- author,
23
- maintainers,
24
- contributors,
25
- type,
26
- imports,
27
- exports: exports2,
28
- main,
29
- browser,
30
- types,
31
- bin,
32
- man,
33
- directories,
34
- files,
35
- workspaces,
36
- scripts,
37
- config,
38
- dependencies,
39
- devDependencies,
40
- peerDependencies,
41
- peerDependenciesMeta,
42
- optionalDependencies,
43
- bundledDependencies,
44
- bundleDependencies,
45
- engines,
46
- os,
47
- cpu,
48
- publishConfig,
49
- devEngines,
50
- licenses,
51
- overrides,
52
- ...rest
53
- } = json;
54
- return {
55
- ...typeof name !== "undefined" ? { name } : {},
56
- ...typeof version !== "undefined" ? { version } : {},
57
- ...typeof isPrivate !== "undefined" ? { private: isPrivate } : {},
58
- ...typeof description !== "undefined" ? { description } : {},
59
- ...typeof keywords !== "undefined" ? { keywords } : {},
60
- ...typeof homepage !== "undefined" ? { homepage } : {},
61
- ...typeof bugs !== "undefined" ? { bugs } : {},
62
- ...typeof repository !== "undefined" ? { repository } : {},
63
- ...typeof funding !== "undefined" ? { funding } : {},
64
- ...typeof license !== "undefined" ? { license } : {},
65
- ...typeof author !== "undefined" ? { author } : {},
66
- ...typeof maintainers !== "undefined" ? { maintainers } : {},
67
- ...typeof contributors !== "undefined" ? { contributors } : {},
68
- ...typeof type !== "undefined" ? { type } : {},
69
- ...typeof imports !== "undefined" ? { imports } : {},
70
- ...typeof exports2 !== "undefined" ? { exports: exports2 } : {},
71
- ...typeof main !== "undefined" ? { main } : {},
72
- ...typeof browser !== "undefined" ? { browser } : {},
73
- ...typeof types !== "undefined" ? { types } : {},
74
- ...typeof bin !== "undefined" ? { bin } : {},
75
- ...typeof man !== "undefined" ? { man } : {},
76
- ...typeof directories !== "undefined" ? { directories } : {},
77
- ...typeof files !== "undefined" ? { files } : {},
78
- ...typeof workspaces !== "undefined" ? { workspaces } : {},
79
- ...typeof scripts !== "undefined" ? { scripts } : {},
80
- ...typeof config !== "undefined" ? { config } : {},
81
- ...typeof dependencies !== "undefined" ? { dependencies } : {},
82
- ...typeof devDependencies !== "undefined" ? { devDependencies } : {},
83
- ...typeof peerDependencies !== "undefined" ? { peerDependencies } : {},
84
- ...typeof peerDependenciesMeta !== "undefined" ? { peerDependenciesMeta } : {},
85
- ...typeof optionalDependencies !== "undefined" ? { optionalDependencies } : {},
86
- ...typeof bundledDependencies !== "undefined" ? { bundledDependencies } : {},
87
- ...typeof bundleDependencies !== "undefined" ? { bundleDependencies } : {},
88
- ...typeof engines !== "undefined" ? { engines } : {},
89
- ...typeof os !== "undefined" ? { os } : {},
90
- ...typeof cpu !== "undefined" ? { cpu } : {},
91
- ...typeof publishConfig !== "undefined" ? { publishConfig } : {},
92
- ...typeof devEngines !== "undefined" ? { devEngines } : {},
93
- ...typeof licenses !== "undefined" ? { licenses } : {},
94
- ...typeof overrides !== "undefined" ? { overrides } : {},
95
- ...rest
96
- };
97
- }
98
- __name(packageSort, "packageSort");
99
- module.exports = {
100
- packageSort
101
- };
15
+ var require_sort = __commonJS({
16
+ "node_modules/.pnpm/@npmcli+package-json@7.0.0/node_modules/@npmcli/package-json/lib/sort.js"(exports2, module2) {
17
+ function packageSort(json) {
18
+ const {
19
+ name,
20
+ version,
21
+ private: isPrivate,
22
+ description,
23
+ keywords,
24
+ homepage,
25
+ bugs,
26
+ repository,
27
+ funding,
28
+ license,
29
+ author,
30
+ maintainers,
31
+ contributors,
32
+ type,
33
+ imports,
34
+ exports: exports3,
35
+ main,
36
+ browser,
37
+ types,
38
+ bin,
39
+ man,
40
+ directories,
41
+ files,
42
+ workspaces,
43
+ scripts,
44
+ config,
45
+ dependencies,
46
+ devDependencies,
47
+ peerDependencies,
48
+ peerDependenciesMeta,
49
+ optionalDependencies,
50
+ bundledDependencies,
51
+ bundleDependencies,
52
+ engines,
53
+ os,
54
+ cpu,
55
+ publishConfig,
56
+ devEngines,
57
+ licenses,
58
+ overrides,
59
+ ...rest
60
+ } = json;
61
+ return {
62
+ ...typeof name !== "undefined" ? { name } : {},
63
+ ...typeof version !== "undefined" ? { version } : {},
64
+ ...typeof isPrivate !== "undefined" ? { private: isPrivate } : {},
65
+ ...typeof description !== "undefined" ? { description } : {},
66
+ ...typeof keywords !== "undefined" ? { keywords } : {},
67
+ ...typeof homepage !== "undefined" ? { homepage } : {},
68
+ ...typeof bugs !== "undefined" ? { bugs } : {},
69
+ ...typeof repository !== "undefined" ? { repository } : {},
70
+ ...typeof funding !== "undefined" ? { funding } : {},
71
+ ...typeof license !== "undefined" ? { license } : {},
72
+ ...typeof author !== "undefined" ? { author } : {},
73
+ ...typeof maintainers !== "undefined" ? { maintainers } : {},
74
+ ...typeof contributors !== "undefined" ? { contributors } : {},
75
+ ...typeof type !== "undefined" ? { type } : {},
76
+ ...typeof imports !== "undefined" ? { imports } : {},
77
+ ...typeof exports3 !== "undefined" ? { exports: exports3 } : {},
78
+ ...typeof main !== "undefined" ? { main } : {},
79
+ ...typeof browser !== "undefined" ? { browser } : {},
80
+ ...typeof types !== "undefined" ? { types } : {},
81
+ ...typeof bin !== "undefined" ? { bin } : {},
82
+ ...typeof man !== "undefined" ? { man } : {},
83
+ ...typeof directories !== "undefined" ? { directories } : {},
84
+ ...typeof files !== "undefined" ? { files } : {},
85
+ ...typeof workspaces !== "undefined" ? { workspaces } : {},
86
+ ...typeof scripts !== "undefined" ? { scripts } : {},
87
+ ...typeof config !== "undefined" ? { config } : {},
88
+ ...typeof dependencies !== "undefined" ? { dependencies } : {},
89
+ ...typeof devDependencies !== "undefined" ? { devDependencies } : {},
90
+ ...typeof peerDependencies !== "undefined" ? { peerDependencies } : {},
91
+ ...typeof peerDependenciesMeta !== "undefined" ? { peerDependenciesMeta } : {},
92
+ ...typeof optionalDependencies !== "undefined" ? { optionalDependencies } : {},
93
+ ...typeof bundledDependencies !== "undefined" ? { bundledDependencies } : {},
94
+ ...typeof bundleDependencies !== "undefined" ? { bundleDependencies } : {},
95
+ ...typeof engines !== "undefined" ? { engines } : {},
96
+ ...typeof os !== "undefined" ? { os } : {},
97
+ ...typeof cpu !== "undefined" ? { cpu } : {},
98
+ ...typeof publishConfig !== "undefined" ? { publishConfig } : {},
99
+ ...typeof devEngines !== "undefined" ? { devEngines } : {},
100
+ ...typeof licenses !== "undefined" ? { licenses } : {},
101
+ ...typeof overrides !== "undefined" ? { overrides } : {},
102
+ ...rest
103
+ };
104
+ }
105
+ __name(packageSort, "packageSort");
106
+ module2.exports = {
107
+ packageSort
108
+ };
109
+ }
110
+ });
111
+
112
+ // src/external/@npmcli/package-json/lib/sort.js
113
+ module.exports = require_sort();