@socketsecurity/lib 3.5.0 → 4.0.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 (102) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +8 -8
  3. package/dist/agent.js +12 -25
  4. package/dist/bin.d.ts +97 -40
  5. package/dist/bin.js +133 -138
  6. package/dist/cacache.d.ts +5 -2
  7. package/dist/cacache.js +29 -18
  8. package/dist/cache-with-ttl.js +1 -1
  9. package/dist/constants/agents.d.ts +0 -4
  10. package/dist/constants/agents.js +13 -4
  11. package/dist/constants/node.d.ts +1 -0
  12. package/dist/constants/node.js +2 -5
  13. package/dist/constants/packages.js +23 -11
  14. package/dist/constants/process.d.ts +1 -1
  15. package/dist/constants/process.js +2 -2
  16. package/dist/debug.js +3 -3
  17. package/dist/dlx-binary.js +10 -18
  18. package/dist/dlx-manifest.js +2 -2
  19. package/dist/dlx-package.js +22 -62
  20. package/dist/dlx.js +14 -14
  21. package/dist/effects/text-shimmer.js +1 -1
  22. package/dist/env/ci.js +2 -2
  23. package/dist/env/debug.js +1 -1
  24. package/dist/env/github.js +1 -1
  25. package/dist/env/home.js +1 -1
  26. package/dist/env/locale.js +1 -1
  27. package/dist/env/node-auth-token.js +1 -1
  28. package/dist/env/node-env.js +1 -1
  29. package/dist/env/npm.js +1 -1
  30. package/dist/env/package-manager.js +1 -1
  31. package/dist/env/path.js +1 -1
  32. package/dist/env/pre-commit.js +2 -2
  33. package/dist/env/rewire.d.ts +7 -7
  34. package/dist/env/rewire.js +1 -1
  35. package/dist/env/shell.js +1 -1
  36. package/dist/env/socket-cli-shadow.js +2 -2
  37. package/dist/env/socket-cli.js +2 -2
  38. package/dist/env/socket.js +2 -2
  39. package/dist/env/temp-dir.js +1 -1
  40. package/dist/env/term.js +1 -1
  41. package/dist/env/test.js +3 -3
  42. package/dist/env/windows.js +1 -1
  43. package/dist/env/xdg.js +1 -1
  44. package/dist/fs.js +20 -25
  45. package/dist/git.d.ts +6 -6
  46. package/dist/git.js +11 -14
  47. package/dist/github.js +2 -2
  48. package/dist/globs.js +16 -29
  49. package/dist/ipc.d.ts +4 -4
  50. package/dist/ipc.js +3 -3
  51. package/dist/logger.d.ts +0 -25
  52. package/dist/logger.js +0 -26
  53. package/dist/objects.js +1 -1
  54. package/dist/package-default-node-range.js +13 -3
  55. package/dist/package-extensions.d.ts +2 -1
  56. package/dist/package-extensions.js +12 -2
  57. package/dist/packages/editable.d.ts +0 -3
  58. package/dist/packages/editable.js +34 -24
  59. package/dist/packages/exports.js +1 -1
  60. package/dist/packages/isolation.js +33 -33
  61. package/dist/packages/licenses.js +20 -34
  62. package/dist/packages/manifest.js +21 -36
  63. package/dist/packages/normalize.js +20 -52
  64. package/dist/packages/operations.js +39 -103
  65. package/dist/packages/provenance.js +15 -5
  66. package/dist/packages/specs.js +13 -12
  67. package/dist/packages/validation.js +12 -10
  68. package/dist/packages.d.ts +2 -2
  69. package/dist/packages.js +3 -3
  70. package/dist/paths/dirnames.d.ts +13 -0
  71. package/dist/paths/dirnames.js +50 -0
  72. package/dist/paths/exts.d.ts +18 -0
  73. package/dist/paths/exts.js +68 -0
  74. package/dist/paths/filenames.d.ts +16 -0
  75. package/dist/paths/filenames.js +62 -0
  76. package/dist/paths/globs.d.ts +10 -0
  77. package/dist/{argv/quote.js → paths/globs.js} +21 -19
  78. package/dist/{path.d.ts → paths/normalize.d.ts} +41 -0
  79. package/dist/{path.js → paths/normalize.js} +18 -5
  80. package/dist/{packages/paths.js → paths/packages.js} +8 -8
  81. package/dist/paths/rewire.d.ts +1 -1
  82. package/dist/{paths.js → paths/socket.js} +31 -67
  83. package/dist/promises.js +2 -2
  84. package/dist/sea.js +2 -2
  85. package/dist/shadow.js +3 -3
  86. package/dist/sorts.js +12 -2
  87. package/dist/spawn.d.ts +15 -12
  88. package/dist/spawn.js +43 -31
  89. package/dist/spinner.d.ts +2 -6
  90. package/dist/spinner.js +9 -41
  91. package/dist/stdio/prompts.d.ts +8 -10
  92. package/dist/stdio/prompts.js +15 -13
  93. package/dist/streams.d.ts +0 -4
  94. package/dist/streams.js +3 -12
  95. package/dist/temporary-executor.js +4 -4
  96. package/dist/versions.js +31 -28
  97. package/package.json +28 -29
  98. package/dist/argv/quote.d.ts +0 -49
  99. package/dist/constants/paths.d.ts +0 -51
  100. package/dist/constants/paths.js +0 -152
  101. /package/dist/{packages/paths.d.ts → paths/packages.d.ts} +0 -0
  102. /package/dist/{paths.d.ts → paths/socket.d.ts} +0 -0
package/dist/packages.js CHANGED
@@ -56,9 +56,9 @@ __export(packages_exports, {
56
56
  resolveEscapedScope: () => import_normalize.resolveEscapedScope,
57
57
  resolveGitHubTgzUrl: () => import_operations.resolveGitHubTgzUrl,
58
58
  resolveOriginalPackageName: () => import_normalize.resolveOriginalPackageName,
59
- resolvePackageJsonDirname: () => import_paths.resolvePackageJsonDirname,
59
+ resolvePackageJsonDirname: () => import_packages.resolvePackageJsonDirname,
60
60
  resolvePackageJsonEntryExports: () => import_exports.resolvePackageJsonEntryExports,
61
- resolvePackageJsonPath: () => import_paths.resolvePackageJsonPath,
61
+ resolvePackageJsonPath: () => import_packages.resolvePackageJsonPath,
62
62
  resolvePackageLicenses: () => import_licenses.resolvePackageLicenses,
63
63
  resolvePackageName: () => import_operations.resolvePackageName,
64
64
  resolveRegistryPackageName: () => import_operations.resolveRegistryPackageName,
@@ -75,7 +75,7 @@ var import_licenses = require("./packages/licenses");
75
75
  var import_manifest = require("./packages/manifest");
76
76
  var import_normalize = require("./packages/normalize");
77
77
  var import_operations = require("./packages/operations");
78
- var import_paths = require("./packages/paths");
78
+ var import_packages = require("./paths/packages");
79
79
  var import_provenance = require("./packages/provenance");
80
80
  var import_specs = require("./packages/specs");
81
81
  var import_validation = require("./packages/validation");
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @fileoverview Directory name and path pattern constants.
3
+ */
4
+ // Directory names.
5
+ export declare const NODE_MODULES = "node_modules";
6
+ export declare const DOT_GIT_DIR = ".git";
7
+ export declare const DOT_GITHUB = ".github";
8
+ export declare const DOT_SOCKET_DIR = ".socket";
9
+ export declare const CACHE_DIR = "cache";
10
+ export declare const CACHE_TTL_DIR = "ttl";
11
+ // Path patterns.
12
+ export declare const NODE_MODULES_GLOB_RECURSIVE = "**/node_modules";
13
+ export declare const SLASH_NODE_MODULES_SLASH = "/node_modules/";
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /* Socket Lib - Built with esbuild */
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var dirnames_exports = {};
21
+ __export(dirnames_exports, {
22
+ CACHE_DIR: () => CACHE_DIR,
23
+ CACHE_TTL_DIR: () => CACHE_TTL_DIR,
24
+ DOT_GITHUB: () => DOT_GITHUB,
25
+ DOT_GIT_DIR: () => DOT_GIT_DIR,
26
+ DOT_SOCKET_DIR: () => DOT_SOCKET_DIR,
27
+ NODE_MODULES: () => NODE_MODULES,
28
+ NODE_MODULES_GLOB_RECURSIVE: () => NODE_MODULES_GLOB_RECURSIVE,
29
+ SLASH_NODE_MODULES_SLASH: () => SLASH_NODE_MODULES_SLASH
30
+ });
31
+ module.exports = __toCommonJS(dirnames_exports);
32
+ const NODE_MODULES = "node_modules";
33
+ const DOT_GIT_DIR = ".git";
34
+ const DOT_GITHUB = ".github";
35
+ const DOT_SOCKET_DIR = ".socket";
36
+ const CACHE_DIR = "cache";
37
+ const CACHE_TTL_DIR = "ttl";
38
+ const NODE_MODULES_GLOB_RECURSIVE = "**/node_modules";
39
+ const SLASH_NODE_MODULES_SLASH = "/node_modules/";
40
+ // Annotate the CommonJS export names for ESM import in node:
41
+ 0 && (module.exports = {
42
+ CACHE_DIR,
43
+ CACHE_TTL_DIR,
44
+ DOT_GITHUB,
45
+ DOT_GIT_DIR,
46
+ DOT_SOCKET_DIR,
47
+ NODE_MODULES,
48
+ NODE_MODULES_GLOB_RECURSIVE,
49
+ SLASH_NODE_MODULES_SLASH
50
+ });
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @fileoverview File extension constants.
3
+ */
4
+ // File extensions.
5
+ export declare const EXT_CJS = ".cjs";
6
+ export declare const EXT_CMD = ".cmd";
7
+ export declare const EXT_CTS = ".cts";
8
+ export declare const EXT_DTS = ".d.ts";
9
+ export declare const EXT_JS = ".js";
10
+ export declare const EXT_JSON = ".json";
11
+ export declare const EXT_LOCK = ".lock";
12
+ export declare const EXT_LOCKB = ".lockb";
13
+ export declare const EXT_MD = ".md";
14
+ export declare const EXT_MJS = ".mjs";
15
+ export declare const EXT_MTS = ".mts";
16
+ export declare const EXT_PS1 = ".ps1";
17
+ export declare const EXT_YAML = ".yaml";
18
+ export declare const EXT_YML = ".yml";
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ /* Socket Lib - Built with esbuild */
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var exts_exports = {};
21
+ __export(exts_exports, {
22
+ EXT_CJS: () => EXT_CJS,
23
+ EXT_CMD: () => EXT_CMD,
24
+ EXT_CTS: () => EXT_CTS,
25
+ EXT_DTS: () => EXT_DTS,
26
+ EXT_JS: () => EXT_JS,
27
+ EXT_JSON: () => EXT_JSON,
28
+ EXT_LOCK: () => EXT_LOCK,
29
+ EXT_LOCKB: () => EXT_LOCKB,
30
+ EXT_MD: () => EXT_MD,
31
+ EXT_MJS: () => EXT_MJS,
32
+ EXT_MTS: () => EXT_MTS,
33
+ EXT_PS1: () => EXT_PS1,
34
+ EXT_YAML: () => EXT_YAML,
35
+ EXT_YML: () => EXT_YML
36
+ });
37
+ module.exports = __toCommonJS(exts_exports);
38
+ const EXT_CJS = ".cjs";
39
+ const EXT_CMD = ".cmd";
40
+ const EXT_CTS = ".cts";
41
+ const EXT_DTS = ".d.ts";
42
+ const EXT_JS = ".js";
43
+ const EXT_JSON = ".json";
44
+ const EXT_LOCK = ".lock";
45
+ const EXT_LOCKB = ".lockb";
46
+ const EXT_MD = ".md";
47
+ const EXT_MJS = ".mjs";
48
+ const EXT_MTS = ".mts";
49
+ const EXT_PS1 = ".ps1";
50
+ const EXT_YAML = ".yaml";
51
+ const EXT_YML = ".yml";
52
+ // Annotate the CommonJS export names for ESM import in node:
53
+ 0 && (module.exports = {
54
+ EXT_CJS,
55
+ EXT_CMD,
56
+ EXT_CTS,
57
+ EXT_DTS,
58
+ EXT_JS,
59
+ EXT_JSON,
60
+ EXT_LOCK,
61
+ EXT_LOCKB,
62
+ EXT_MD,
63
+ EXT_MJS,
64
+ EXT_MTS,
65
+ EXT_PS1,
66
+ EXT_YAML,
67
+ EXT_YML
68
+ });
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @fileoverview File name constants.
3
+ */
4
+ // File names.
5
+ export declare const PACKAGE_JSON = "package.json";
6
+ export declare const TSCONFIG_JSON = "tsconfig.json";
7
+ export declare const LICENSE = "LICENSE";
8
+ export declare const LICENSE_MD = "LICENSE.md";
9
+ export declare const LICENSE_ORIGINAL = "LICENSE.original";
10
+ export declare const README_MD = "README.md";
11
+ export declare const CHANGELOG_MD = "CHANGELOG.md";
12
+ export declare const MANIFEST_JSON = "manifest.json";
13
+ export declare const EXTENSIONS_JSON = "extensions.json";
14
+ export declare const ESLINT_CONFIG_JS = "eslint.config.js";
15
+ export declare const GITIGNORE = ".gitignore";
16
+ export declare const DOT_PACKAGE_LOCK_JSON = ".package-lock.json";
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ /* Socket Lib - Built with esbuild */
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var filenames_exports = {};
21
+ __export(filenames_exports, {
22
+ CHANGELOG_MD: () => CHANGELOG_MD,
23
+ DOT_PACKAGE_LOCK_JSON: () => DOT_PACKAGE_LOCK_JSON,
24
+ ESLINT_CONFIG_JS: () => ESLINT_CONFIG_JS,
25
+ EXTENSIONS_JSON: () => EXTENSIONS_JSON,
26
+ GITIGNORE: () => GITIGNORE,
27
+ LICENSE: () => LICENSE,
28
+ LICENSE_MD: () => LICENSE_MD,
29
+ LICENSE_ORIGINAL: () => LICENSE_ORIGINAL,
30
+ MANIFEST_JSON: () => MANIFEST_JSON,
31
+ PACKAGE_JSON: () => PACKAGE_JSON,
32
+ README_MD: () => README_MD,
33
+ TSCONFIG_JSON: () => TSCONFIG_JSON
34
+ });
35
+ module.exports = __toCommonJS(filenames_exports);
36
+ const PACKAGE_JSON = "package.json";
37
+ const TSCONFIG_JSON = "tsconfig.json";
38
+ const LICENSE = "LICENSE";
39
+ const LICENSE_MD = "LICENSE.md";
40
+ const LICENSE_ORIGINAL = "LICENSE.original";
41
+ const README_MD = "README.md";
42
+ const CHANGELOG_MD = "CHANGELOG.md";
43
+ const MANIFEST_JSON = "manifest.json";
44
+ const EXTENSIONS_JSON = "extensions.json";
45
+ const ESLINT_CONFIG_JS = "eslint.config.js";
46
+ const GITIGNORE = ".gitignore";
47
+ const DOT_PACKAGE_LOCK_JSON = ".package-lock.json";
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ CHANGELOG_MD,
51
+ DOT_PACKAGE_LOCK_JSON,
52
+ ESLINT_CONFIG_JS,
53
+ EXTENSIONS_JSON,
54
+ GITIGNORE,
55
+ LICENSE,
56
+ LICENSE_MD,
57
+ LICENSE_ORIGINAL,
58
+ MANIFEST_JSON,
59
+ PACKAGE_JSON,
60
+ README_MD,
61
+ TSCONFIG_JSON
62
+ });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @fileoverview Glob pattern constants.
3
+ */
4
+ // Glob patterns.
5
+ export declare const LICENSE_GLOB = "LICEN[CS]E{[.-]*,}";
6
+ export declare const LICENSE_GLOB_RECURSIVE = "**/LICEN[CS]E{[.-]*,}";
7
+ export declare const LICENSE_ORIGINAL_GLOB = "*.original{.*,}";
8
+ export declare const LICENSE_ORIGINAL_GLOB_RECURSIVE = "**/*.original{.*,}";
9
+ export declare const README_GLOB = "README{.*,}";
10
+ export declare const README_GLOB_RECURSIVE = "**/README{.*,}";
@@ -17,26 +17,28 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
- var quote_exports = {};
21
- __export(quote_exports, {
22
- posixQuote: () => posixQuote,
23
- win32Quote: () => win32Quote
20
+ var globs_exports = {};
21
+ __export(globs_exports, {
22
+ LICENSE_GLOB: () => LICENSE_GLOB,
23
+ LICENSE_GLOB_RECURSIVE: () => LICENSE_GLOB_RECURSIVE,
24
+ LICENSE_ORIGINAL_GLOB: () => LICENSE_ORIGINAL_GLOB,
25
+ LICENSE_ORIGINAL_GLOB_RECURSIVE: () => LICENSE_ORIGINAL_GLOB_RECURSIVE,
26
+ README_GLOB: () => README_GLOB,
27
+ README_GLOB_RECURSIVE: () => README_GLOB_RECURSIVE
24
28
  });
25
- module.exports = __toCommonJS(quote_exports);
26
- function posixQuote(arg) {
27
- if (!/[\s&|<>$`\\*?[\](){};"'~!#]/.test(arg)) {
28
- return arg;
29
- }
30
- return `'${arg.replace(/'/g, "'\\''")}'`;
31
- }
32
- function win32Quote(arg) {
33
- if (!/[\s&|<>^%()!"]/.test(arg)) {
34
- return arg;
35
- }
36
- return `"${arg.replace(/"/g, '""')}"`;
37
- }
29
+ module.exports = __toCommonJS(globs_exports);
30
+ const LICENSE_GLOB = "LICEN[CS]E{[.-]*,}";
31
+ const LICENSE_GLOB_RECURSIVE = "**/LICEN[CS]E{[.-]*,}";
32
+ const LICENSE_ORIGINAL_GLOB = "*.original{.*,}";
33
+ const LICENSE_ORIGINAL_GLOB_RECURSIVE = "**/*.original{.*,}";
34
+ const README_GLOB = "README{.*,}";
35
+ const README_GLOB_RECURSIVE = "**/README{.*,}";
38
36
  // Annotate the CommonJS export names for ESM import in node:
39
37
  0 && (module.exports = {
40
- posixQuote,
41
- win32Quote
38
+ LICENSE_GLOB,
39
+ LICENSE_GLOB_RECURSIVE,
40
+ LICENSE_ORIGINAL_GLOB,
41
+ LICENSE_ORIGINAL_GLOB_RECURSIVE,
42
+ README_GLOB,
43
+ README_GLOB_RECURSIVE
42
44
  });
@@ -347,3 +347,44 @@ export declare function trimLeadingDotSlash(pathLike: string | Buffer | URL): st
347
347
  */
348
348
  /*@__NO_SIDE_EFFECTS__*/
349
349
  export declare function relativeResolve(from: string, to: string): string;
350
+ /**
351
+ * Convert Windows paths to Unix-style POSIX paths for Git Bash tools.
352
+ *
353
+ * Git for Windows tools (like tar, git, etc.) expect POSIX-style paths with
354
+ * forward slashes and Unix drive letter notation (/c/ instead of C:\).
355
+ * This function handles the conversion for cross-platform compatibility.
356
+ *
357
+ * Conversion rules:
358
+ * - On Windows: Normalizes separators and converts drive letters
359
+ * - `C:\path\to\file` becomes `/c/path/to/file`
360
+ * - `D:/Users/name` becomes `/d/Users/name`
361
+ * - Drive letters are always lowercase in the output
362
+ * - On Unix: Returns the path unchanged (passes through normalization)
363
+ *
364
+ * This is particularly important for:
365
+ * - Git Bash tools that interpret `D:\` as a remote hostname
366
+ * - Cross-platform build scripts using tar, git archive, etc.
367
+ * - CI/CD environments where Git for Windows is used
368
+ *
369
+ * @param {string | Buffer | URL} pathLike - The path to convert
370
+ * @returns {string} Unix-style POSIX path (e.g., `/c/path/to/file`)
371
+ *
372
+ * @example
373
+ * ```typescript
374
+ * // Windows drive letter paths
375
+ * toUnixPath('C:\\path\\to\\file.txt') // '/c/path/to/file.txt'
376
+ * toUnixPath('D:/projects/foo/bar') // '/d/projects/foo/bar'
377
+ *
378
+ * // Already forward slashes (still converts drive letter)
379
+ * toUnixPath('C:/Windows/System32') // '/c/Windows/System32'
380
+ *
381
+ * // Unix paths (unchanged on Unix platforms)
382
+ * toUnixPath('/home/user/file') // '/home/user/file'
383
+ * toUnixPath('/var/log/app.log') // '/var/log/app.log'
384
+ *
385
+ * // UNC paths (Windows network shares)
386
+ * toUnixPath('\\\\server\\share\\file') // '//server/share/file'
387
+ * ```
388
+ */
389
+ /*@__NO_SIDE_EFFECTS__*/
390
+ export declare function toUnixPath(pathLike: string | Buffer | URL): string;
@@ -17,8 +17,8 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
- var path_exports = {};
21
- __export(path_exports, {
20
+ var normalize_exports = {};
21
+ __export(normalize_exports, {
22
22
  isAbsolute: () => isAbsolute,
23
23
  isNodeModules: () => isNodeModules,
24
24
  isPath: () => isPath,
@@ -27,11 +27,12 @@ __export(path_exports, {
27
27
  pathLikeToString: () => pathLikeToString,
28
28
  relativeResolve: () => relativeResolve,
29
29
  splitPath: () => splitPath,
30
+ toUnixPath: () => toUnixPath,
30
31
  trimLeadingDotSlash: () => trimLeadingDotSlash
31
32
  });
32
- module.exports = __toCommonJS(path_exports);
33
- var import_platform = require("#constants/platform");
34
- var import_strings = require("./strings");
33
+ module.exports = __toCommonJS(normalize_exports);
34
+ var import_platform = require("../constants/platform");
35
+ var import_strings = require("../strings");
35
36
  const CHAR_BACKWARD_SLASH = 92;
36
37
  const CHAR_COLON = 58;
37
38
  const CHAR_FORWARD_SLASH = 47;
@@ -434,6 +435,17 @@ function relativeResolve(from, to) {
434
435
  }
435
436
  return /* @__PURE__ */ normalizePath(rel);
436
437
  }
438
+ // @__NO_SIDE_EFFECTS__
439
+ function toUnixPath(pathLike) {
440
+ const normalized = /* @__PURE__ */ normalizePath(pathLike);
441
+ if (import_platform.WIN32) {
442
+ return normalized.replace(
443
+ /^([A-Z]):/i,
444
+ (_, letter) => `/${letter.toLowerCase()}`
445
+ );
446
+ }
447
+ return normalized;
448
+ }
437
449
  // Annotate the CommonJS export names for ESM import in node:
438
450
  0 && (module.exports = {
439
451
  isAbsolute,
@@ -444,5 +456,6 @@ function relativeResolve(from, to) {
444
456
  pathLikeToString,
445
457
  relativeResolve,
446
458
  splitPath,
459
+ toUnixPath,
447
460
  trimLeadingDotSlash
448
461
  });
@@ -17,13 +17,13 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
- var paths_exports = {};
21
- __export(paths_exports, {
20
+ var packages_exports = {};
21
+ __export(packages_exports, {
22
22
  resolvePackageJsonDirname: () => resolvePackageJsonDirname,
23
23
  resolvePackageJsonPath: () => resolvePackageJsonPath
24
24
  });
25
- module.exports = __toCommonJS(paths_exports);
26
- var import_path = require("../path");
25
+ module.exports = __toCommonJS(packages_exports);
26
+ var import_normalize = require("./normalize");
27
27
  let _path;
28
28
  // @__NO_SIDE_EFFECTS__
29
29
  function getPath() {
@@ -36,17 +36,17 @@ function getPath() {
36
36
  function resolvePackageJsonDirname(filepath) {
37
37
  if (filepath.endsWith("package.json")) {
38
38
  const path = /* @__PURE__ */ getPath();
39
- return (0, import_path.normalizePath)(path.dirname(filepath));
39
+ return (0, import_normalize.normalizePath)(path.dirname(filepath));
40
40
  }
41
- return (0, import_path.normalizePath)(filepath);
41
+ return (0, import_normalize.normalizePath)(filepath);
42
42
  }
43
43
  // @__NO_SIDE_EFFECTS__
44
44
  function resolvePackageJsonPath(filepath) {
45
45
  if (filepath.endsWith("package.json")) {
46
- return (0, import_path.normalizePath)(filepath);
46
+ return (0, import_normalize.normalizePath)(filepath);
47
47
  }
48
48
  const path = /* @__PURE__ */ getPath();
49
- return (0, import_path.normalizePath)(path.join(filepath, "package.json"));
49
+ return (0, import_normalize.normalizePath)(path.join(filepath, "package.json"));
50
50
  }
51
51
  // Annotate the CommonJS export names for ESM import in node:
52
52
  0 && (module.exports = {
@@ -53,7 +53,7 @@ export declare function resetPaths(): void;
53
53
  * @example
54
54
  * ```typescript
55
55
  * import { setPath, resetPaths } from '#paths/rewire'
56
- * import { getOsTmpDir } from '#lib/paths'
56
+ * import { getOsTmpDir } from './'
57
57
  *
58
58
  * beforeEach(() => {
59
59
  * setPath('tmpdir', '/custom/tmp')
@@ -27,8 +27,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  mod
28
28
  ));
29
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
- var paths_exports = {};
31
- __export(paths_exports, {
30
+ var socket_exports = {};
31
+ __export(socket_exports, {
32
32
  getOsHomeDir: () => getOsHomeDir,
33
33
  getOsTmpDir: () => getOsTmpDir,
34
34
  getSocketAppCacheDir: () => getSocketAppCacheDir,
@@ -44,14 +44,17 @@ __export(paths_exports, {
44
44
  getUserHomeDir: () => getUserHomeDir,
45
45
  invalidateCache: () => invalidateCache
46
46
  });
47
- module.exports = __toCommonJS(paths_exports);
47
+ module.exports = __toCommonJS(socket_exports);
48
48
  var os = __toESM(require("os"));
49
49
  var path = __toESM(require("path"));
50
- var import_home = require("#env/home");
51
- var import_socket = require("#env/socket");
52
- var import_windows = require("#env/windows");
53
- var import_path = require("./path");
54
- var import_rewire = require("./paths/rewire");
50
+ var import_github = require("../constants/github");
51
+ var import_socket = require("../constants/socket");
52
+ var import_home = require("../env/home");
53
+ var import_socket2 = require("../env/socket");
54
+ var import_windows = require("../env/windows");
55
+ var import_dirnames = require("./dirnames");
56
+ var import_normalize = require("./normalize");
57
+ var import_rewire = require("./rewire");
55
58
  function getOsHomeDir() {
56
59
  return (0, import_rewire.getPathValue)("homedir", () => os.homedir());
57
60
  }
@@ -64,96 +67,57 @@ function getSocketHomePath() {
64
67
  let _cachedSocketUserDir;
65
68
  function getSocketUserDir() {
66
69
  if (_cachedSocketUserDir === void 0) {
67
- _cachedSocketUserDir = (0, import_path.normalizePath)(
68
- path.join(
69
- getUserHomeDir(),
70
- /*@__INLINE__*/
71
- require("#constants/paths").DOT_SOCKET_DIR
72
- )
70
+ _cachedSocketUserDir = (0, import_normalize.normalizePath)(
71
+ path.join(getUserHomeDir(), import_dirnames.DOT_SOCKET_DIR)
73
72
  );
74
73
  }
75
74
  return _cachedSocketUserDir;
76
75
  }
77
76
  function getSocketAppDir(appName) {
78
- return (0, import_path.normalizePath)(
79
- path.join(
80
- getSocketUserDir(),
81
- `${/*@__INLINE__*/
82
- require("#constants/socket").SOCKET_APP_PREFIX}${appName}`
83
- )
77
+ return (0, import_normalize.normalizePath)(
78
+ path.join(getSocketUserDir(), `${import_socket.SOCKET_APP_PREFIX}${appName}`)
84
79
  );
85
80
  }
86
81
  let _cachedSocketCacacheDir;
87
82
  function getSocketCacacheDir() {
88
83
  if (_cachedSocketCacacheDir === void 0) {
89
- if ((0, import_socket.getSocketCacacheDir)()) {
90
- _cachedSocketCacacheDir = (0, import_path.normalizePath)(
91
- (0, import_socket.getSocketCacacheDir)()
84
+ if ((0, import_socket2.getSocketCacacheDir)()) {
85
+ _cachedSocketCacacheDir = (0, import_normalize.normalizePath)(
86
+ (0, import_socket2.getSocketCacacheDir)()
92
87
  );
93
88
  } else {
94
- _cachedSocketCacacheDir = (0, import_path.normalizePath)(
95
- path.join(
96
- getSocketUserDir(),
97
- `${/*@__INLINE__*/
98
- require("#constants/socket").SOCKET_APP_PREFIX}cacache`
99
- )
89
+ _cachedSocketCacacheDir = (0, import_normalize.normalizePath)(
90
+ path.join(getSocketUserDir(), `${import_socket.SOCKET_APP_PREFIX}cacache`)
100
91
  );
101
92
  }
102
93
  }
103
94
  return _cachedSocketCacacheDir;
104
95
  }
105
96
  function getSocketDlxDir() {
106
- if ((0, import_socket.getSocketDlxDirEnv)()) {
107
- return (0, import_path.normalizePath)((0, import_socket.getSocketDlxDirEnv)());
97
+ if ((0, import_socket2.getSocketDlxDirEnv)()) {
98
+ return (0, import_normalize.normalizePath)((0, import_socket2.getSocketDlxDirEnv)());
108
99
  }
109
- return (0, import_path.normalizePath)(
110
- path.join(
111
- getSocketUserDir(),
112
- `${/*@__INLINE__*/
113
- require("#constants/socket").SOCKET_APP_PREFIX}${/*@__INLINE__*/
114
- require("#constants/socket").SOCKET_DLX_APP_NAME}`
115
- )
100
+ return (0, import_normalize.normalizePath)(
101
+ path.join(getSocketUserDir(), `${import_socket.SOCKET_APP_PREFIX}${import_socket.SOCKET_DLX_APP_NAME}`)
116
102
  );
117
103
  }
118
104
  function getSocketAppCacheDir(appName) {
119
- return (0, import_path.normalizePath)(
120
- path.join(
121
- getSocketAppDir(appName),
122
- /*@__INLINE__*/
123
- require("#constants/paths").CACHE_DIR
124
- )
125
- );
105
+ return (0, import_normalize.normalizePath)(path.join(getSocketAppDir(appName), import_dirnames.CACHE_DIR));
126
106
  }
127
107
  function getSocketAppCacheTtlDir(appName) {
128
- return (0, import_path.normalizePath)(
129
- path.join(
130
- getSocketAppCacheDir(appName),
131
- /*@__INLINE__*/
132
- require("#constants/paths").CACHE_TTL_DIR
133
- )
134
- );
108
+ return (0, import_normalize.normalizePath)(path.join(getSocketAppCacheDir(appName), import_dirnames.CACHE_TTL_DIR));
135
109
  }
136
110
  function getSocketCliDir() {
137
- return getSocketAppDir(
138
- /*@__INLINE__*/
139
- require("#constants/socket").SOCKET_CLI_APP_NAME
140
- );
111
+ return getSocketAppDir(import_socket.SOCKET_CLI_APP_NAME);
141
112
  }
142
113
  function getSocketRegistryDir() {
143
- return getSocketAppDir(
144
- /*@__INLINE__*/
145
- require("#constants/socket").SOCKET_REGISTRY_APP_NAME
146
- );
114
+ return getSocketAppDir(import_socket.SOCKET_REGISTRY_APP_NAME);
147
115
  }
148
116
  function getSocketRegistryGithubCacheDir() {
149
- return (0, import_path.normalizePath)(
117
+ return (0, import_normalize.normalizePath)(
150
118
  path.join(
151
- getSocketAppCacheTtlDir(
152
- /*@__INLINE__*/
153
- require("#constants/socket").SOCKET_REGISTRY_APP_NAME
154
- ),
155
- /*@__INLINE__*/
156
- require("#constants/github").CACHE_GITHUB_DIR
119
+ getSocketAppCacheTtlDir(import_socket.SOCKET_REGISTRY_APP_NAME),
120
+ import_github.CACHE_GITHUB_DIR
157
121
  )
158
122
  );
159
123
  }
package/dist/promises.js CHANGED
@@ -29,8 +29,8 @@ __export(promises_exports, {
29
29
  resolveRetryOptions: () => resolveRetryOptions
30
30
  });
31
31
  module.exports = __toCommonJS(promises_exports);
32
- var import_core = require("#constants/core");
33
- var import_process = require("#constants/process");
32
+ var import_core = require("./constants/core");
33
+ var import_process = require("./constants/process");
34
34
  var import_arrays = require("./arrays");
35
35
  const abortSignal = (0, import_process.getAbortSignal)();
36
36
  let _timers;
package/dist/sea.js CHANGED
@@ -23,10 +23,10 @@ __export(sea_exports, {
23
23
  isSeaBinary: () => isSeaBinary
24
24
  });
25
25
  module.exports = __toCommonJS(sea_exports);
26
- var import_path = require("./path");
26
+ var import_normalize = require("./paths/normalize");
27
27
  let _isSea;
28
28
  function getSeaBinaryPath() {
29
- return isSeaBinary() && process.argv[0] ? (0, import_path.normalizePath)(process.argv[0]) : void 0;
29
+ return isSeaBinary() && process.argv[0] ? (0, import_normalize.normalizePath)(process.argv[0]) : void 0;
30
30
  }
31
31
  function isSeaBinary() {
32
32
  if (_isSea === void 0) {
package/dist/shadow.js CHANGED
@@ -22,7 +22,7 @@ __export(shadow_exports, {
22
22
  shouldSkipShadow: () => shouldSkipShadow
23
23
  });
24
24
  module.exports = __toCommonJS(shadow_exports);
25
- var import_path = require("./path");
25
+ var import_normalize = require("./paths/normalize");
26
26
  function shouldSkipShadow(binPath, options) {
27
27
  const { cwd = process.cwd(), win32 = false } = {
28
28
  __proto__: null,
@@ -35,9 +35,9 @@ function shouldSkipShadow(binPath, options) {
35
35
  if (userAgent?.includes("exec") || userAgent?.includes("npx") || userAgent?.includes("dlx")) {
36
36
  return true;
37
37
  }
38
- const normalizedCwd = (0, import_path.normalizePath)(cwd);
38
+ const normalizedCwd = (0, import_normalize.normalizePath)(cwd);
39
39
  const npmCache = process.env["npm_config_cache"];
40
- if (npmCache && normalizedCwd.includes((0, import_path.normalizePath)(npmCache))) {
40
+ if (npmCache && normalizedCwd.includes((0, import_normalize.normalizePath)(npmCache))) {
41
41
  return true;
42
42
  }
43
43
  const tempPatterns = [