@pnpm/exe 11.0.0-beta.0 → 11.0.0-beta.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 (200) hide show
  1. package/dist/node_modules/@gar/promise-retry/lib/index.js +28 -0
  2. package/dist/node_modules/@gar/promise-retry/package.json +48 -0
  3. package/dist/node_modules/@npmcli/agent/package.json +7 -7
  4. package/dist/node_modules/@npmcli/fs/package.json +4 -4
  5. package/dist/node_modules/abbrev/package.json +11 -15
  6. package/dist/node_modules/cacache/package.json +10 -11
  7. package/dist/node_modules/glob/dist/commonjs/glob.js +2 -1
  8. package/dist/node_modules/glob/dist/commonjs/index.min.js +4 -0
  9. package/dist/node_modules/glob/dist/commonjs/pattern.js +4 -0
  10. package/dist/node_modules/glob/dist/esm/glob.js +2 -1
  11. package/dist/node_modules/glob/dist/esm/index.min.js +4 -0
  12. package/dist/node_modules/glob/dist/esm/pattern.js +4 -0
  13. package/dist/node_modules/glob/package.json +38 -37
  14. package/dist/node_modules/graceful-fs/graceful-fs.js +1 -1
  15. package/dist/node_modules/iconv-lite/encodings/dbcs-codec.js +460 -525
  16. package/dist/node_modules/iconv-lite/encodings/dbcs-data.js +179 -182
  17. package/dist/node_modules/iconv-lite/encodings/index.js +15 -15
  18. package/dist/node_modules/iconv-lite/encodings/internal.js +168 -148
  19. package/dist/node_modules/iconv-lite/encodings/sbcs-codec.js +55 -52
  20. package/dist/node_modules/iconv-lite/encodings/sbcs-data.js +174 -175
  21. package/dist/node_modules/iconv-lite/encodings/utf16.js +121 -131
  22. package/dist/node_modules/iconv-lite/encodings/utf32.js +226 -238
  23. package/dist/node_modules/iconv-lite/encodings/utf7.js +208 -215
  24. package/dist/node_modules/iconv-lite/lib/bom-handling.js +30 -34
  25. package/dist/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
  26. package/dist/node_modules/iconv-lite/lib/index.js +125 -123
  27. package/dist/node_modules/iconv-lite/lib/streams.js +92 -96
  28. package/dist/node_modules/iconv-lite/package.json +34 -8
  29. package/dist/node_modules/isexe/package.json +65 -18
  30. package/dist/node_modules/lru-cache/dist/commonjs/index.js +134 -85
  31. package/dist/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
  32. package/dist/node_modules/lru-cache/dist/esm/index.js +134 -85
  33. package/dist/node_modules/lru-cache/dist/esm/index.min.js +1 -1
  34. package/dist/node_modules/lru-cache/package.json +18 -41
  35. package/dist/node_modules/make-fetch-happen/lib/remote.js +1 -1
  36. package/dist/node_modules/make-fetch-happen/package.json +10 -10
  37. package/dist/node_modules/minipass-fetch/lib/body.js +25 -15
  38. package/dist/node_modules/minipass-fetch/package.json +7 -7
  39. package/dist/node_modules/minipass-sized/dist/commonjs/index.js +69 -0
  40. package/dist/node_modules/minipass-sized/dist/esm/index.js +64 -0
  41. package/dist/node_modules/minipass-sized/package.json +39 -9
  42. package/dist/node_modules/node-gyp/.release-please-manifest.json +1 -1
  43. package/dist/node_modules/node-gyp/bin/node-gyp.js +7 -0
  44. package/dist/node_modules/node-gyp/gyp/.release-please-manifest.json +1 -1
  45. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +3 -3
  46. package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +26 -1
  47. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +1 -1
  48. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +3 -4
  49. package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +1 -1
  50. package/dist/node_modules/node-gyp/gyp/pyproject.toml +1 -1
  51. package/dist/node_modules/node-gyp/lib/build.js +2 -2
  52. package/dist/node_modules/node-gyp/lib/find-python.js +2 -8
  53. package/dist/node_modules/node-gyp/lib/find-visualstudio.js +11 -5
  54. package/dist/node_modules/node-gyp/lib/install.js +1 -1
  55. package/dist/node_modules/node-gyp/lib/process-release.js +3 -3
  56. package/dist/node_modules/node-gyp/package.json +13 -13
  57. package/dist/node_modules/nopt/package.json +5 -5
  58. package/dist/node_modules/proc-log/lib/index.js +10 -5
  59. package/dist/node_modules/proc-log/package.json +5 -5
  60. package/dist/node_modules/retry/lib/retry.js +2 -2
  61. package/dist/node_modules/retry/lib/retry_operation.js +10 -6
  62. package/dist/node_modules/retry/package.json +6 -2
  63. package/dist/node_modules/ssri/lib/index.js +33 -63
  64. package/dist/node_modules/ssri/package.json +17 -17
  65. package/dist/node_modules/unique-filename/package.json +5 -5
  66. package/dist/node_modules/unique-slug/package.json +4 -4
  67. package/dist/node_modules/which/package.json +29 -20
  68. package/dist/pnpm.mjs +63952 -54674
  69. package/dist/worker.js +601 -2162
  70. package/package.json +8 -8
  71. package/dist/node_modules/@isaacs/cliui/dist/commonjs/ansi-regex/index.js +0 -16
  72. package/dist/node_modules/@isaacs/cliui/dist/commonjs/ansi-styles/index.js +0 -170
  73. package/dist/node_modules/@isaacs/cliui/dist/commonjs/eastasianwidth/index.js +0 -307
  74. package/dist/node_modules/@isaacs/cliui/dist/commonjs/emoji-regex/index.js +0 -7
  75. package/dist/node_modules/@isaacs/cliui/dist/commonjs/index.js +0 -322
  76. package/dist/node_modules/@isaacs/cliui/dist/commonjs/index.min.js +0 -12
  77. package/dist/node_modules/@isaacs/cliui/dist/commonjs/string-width/index.js +0 -49
  78. package/dist/node_modules/@isaacs/cliui/dist/commonjs/strip-ansi/index.js +0 -8
  79. package/dist/node_modules/@isaacs/cliui/dist/commonjs/wrap-ansi/index.js +0 -176
  80. package/dist/node_modules/@isaacs/cliui/dist/esm/ansi-regex/index.js +0 -12
  81. package/dist/node_modules/@isaacs/cliui/dist/esm/ansi-styles/index.js +0 -167
  82. package/dist/node_modules/@isaacs/cliui/dist/esm/eastasianwidth/index.js +0 -299
  83. package/dist/node_modules/@isaacs/cliui/dist/esm/emoji-regex/index.js +0 -3
  84. package/dist/node_modules/@isaacs/cliui/dist/esm/index.js +0 -317
  85. package/dist/node_modules/@isaacs/cliui/dist/esm/index.min.js +0 -12
  86. package/dist/node_modules/@isaacs/cliui/dist/esm/string-width/index.js +0 -46
  87. package/dist/node_modules/@isaacs/cliui/dist/esm/strip-ansi/index.js +0 -4
  88. package/dist/node_modules/@isaacs/cliui/dist/esm/wrap-ansi/index.js +0 -172
  89. package/dist/node_modules/@isaacs/cliui/package.json +0 -163
  90. package/dist/node_modules/cross-spawn/LICENSE +0 -21
  91. package/dist/node_modules/cross-spawn/index.js +0 -39
  92. package/dist/node_modules/cross-spawn/lib/enoent.js +0 -59
  93. package/dist/node_modules/cross-spawn/lib/parse.js +0 -91
  94. package/dist/node_modules/cross-spawn/lib/util/escape.js +0 -47
  95. package/dist/node_modules/cross-spawn/lib/util/readShebang.js +0 -23
  96. package/dist/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -52
  97. package/dist/node_modules/cross-spawn/package.json +0 -73
  98. package/dist/node_modules/encoding/.prettierrc.js +0 -8
  99. package/dist/node_modules/encoding/LICENSE +0 -16
  100. package/dist/node_modules/encoding/lib/encoding.js +0 -83
  101. package/dist/node_modules/encoding/package.json +0 -18
  102. package/dist/node_modules/err-code/.eslintrc.json +0 -7
  103. package/dist/node_modules/err-code/bower.json +0 -30
  104. package/dist/node_modules/err-code/index.js +0 -47
  105. package/dist/node_modules/err-code/index.umd.js +0 -51
  106. package/dist/node_modules/err-code/package.json +0 -34
  107. package/dist/node_modules/foreground-child/LICENSE +0 -15
  108. package/dist/node_modules/foreground-child/dist/commonjs/all-signals.js +0 -58
  109. package/dist/node_modules/foreground-child/dist/commonjs/index.js +0 -123
  110. package/dist/node_modules/foreground-child/dist/commonjs/proxy-signals.js +0 -38
  111. package/dist/node_modules/foreground-child/dist/commonjs/watchdog.js +0 -50
  112. package/dist/node_modules/foreground-child/dist/esm/all-signals.js +0 -52
  113. package/dist/node_modules/foreground-child/dist/esm/index.js +0 -115
  114. package/dist/node_modules/foreground-child/dist/esm/proxy-signals.js +0 -34
  115. package/dist/node_modules/foreground-child/dist/esm/watchdog.js +0 -46
  116. package/dist/node_modules/foreground-child/package.json +0 -106
  117. package/dist/node_modules/glob/dist/esm/bin.d.mts +0 -3
  118. package/dist/node_modules/glob/dist/esm/bin.mjs +0 -346
  119. package/dist/node_modules/iconv-lite/.github/dependabot.yml +0 -11
  120. package/dist/node_modules/iconv-lite/.idea/codeStyles/Project.xml +0 -47
  121. package/dist/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +0 -5
  122. package/dist/node_modules/iconv-lite/.idea/iconv-lite.iml +0 -12
  123. package/dist/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +0 -6
  124. package/dist/node_modules/iconv-lite/.idea/modules.xml +0 -8
  125. package/dist/node_modules/iconv-lite/.idea/vcs.xml +0 -6
  126. package/dist/node_modules/isexe/LICENSE +0 -15
  127. package/dist/node_modules/isexe/index.js +0 -57
  128. package/dist/node_modules/isexe/mode.js +0 -41
  129. package/dist/node_modules/isexe/windows.js +0 -42
  130. package/dist/node_modules/jackspeak/dist/commonjs/index.js +0 -944
  131. package/dist/node_modules/jackspeak/dist/commonjs/index.min.js +0 -33
  132. package/dist/node_modules/jackspeak/dist/commonjs/package.json +0 -3
  133. package/dist/node_modules/jackspeak/dist/esm/index.js +0 -936
  134. package/dist/node_modules/jackspeak/dist/esm/index.min.js +0 -33
  135. package/dist/node_modules/jackspeak/dist/esm/package.json +0 -3
  136. package/dist/node_modules/jackspeak/package.json +0 -115
  137. package/dist/node_modules/lru-cache/LICENSE +0 -15
  138. package/dist/node_modules/minipass-sized/index.js +0 -67
  139. package/dist/node_modules/minipass-sized/node_modules/minipass/LICENSE +0 -15
  140. package/dist/node_modules/minipass-sized/node_modules/minipass/index.js +0 -649
  141. package/dist/node_modules/minipass-sized/node_modules/minipass/package.json +0 -56
  142. package/dist/node_modules/minipass-sized/package-lock.json +0 -3464
  143. package/dist/node_modules/node-gyp/node_modules/isexe/dist/commonjs/package.json +0 -3
  144. package/dist/node_modules/node-gyp/node_modules/isexe/dist/esm/package.json +0 -3
  145. package/dist/node_modules/node-gyp/node_modules/isexe/package.json +0 -78
  146. package/dist/node_modules/node-gyp/node_modules/which/LICENSE +0 -15
  147. package/dist/node_modules/node-gyp/node_modules/which/package.json +0 -52
  148. package/dist/node_modules/package-json-from-dist/dist/commonjs/index.js +0 -134
  149. package/dist/node_modules/package-json-from-dist/dist/commonjs/package.json +0 -3
  150. package/dist/node_modules/package-json-from-dist/dist/esm/index.js +0 -129
  151. package/dist/node_modules/package-json-from-dist/dist/esm/package.json +0 -3
  152. package/dist/node_modules/package-json-from-dist/package.json +0 -68
  153. package/dist/node_modules/path-key/index.js +0 -16
  154. package/dist/node_modules/path-key/license +0 -9
  155. package/dist/node_modules/path-key/package.json +0 -39
  156. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js +0 -1589
  157. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.min.js +0 -2
  158. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/package.json +0 -3
  159. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js +0 -1585
  160. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.min.js +0 -2
  161. package/dist/node_modules/path-scurry/node_modules/lru-cache/dist/esm/package.json +0 -3
  162. package/dist/node_modules/path-scurry/node_modules/lru-cache/package.json +0 -101
  163. package/dist/node_modules/promise-retry/index.js +0 -52
  164. package/dist/node_modules/promise-retry/package.json +0 -37
  165. package/dist/node_modules/retry/equation.gif +0 -0
  166. package/dist/node_modules/shebang-command/index.js +0 -19
  167. package/dist/node_modules/shebang-command/license +0 -9
  168. package/dist/node_modules/shebang-command/package.json +0 -34
  169. package/dist/node_modules/shebang-regex/index.js +0 -2
  170. package/dist/node_modules/shebang-regex/license +0 -9
  171. package/dist/node_modules/shebang-regex/package.json +0 -35
  172. package/dist/node_modules/signal-exit/LICENSE.txt +0 -16
  173. package/dist/node_modules/signal-exit/dist/cjs/browser.js +0 -10
  174. package/dist/node_modules/signal-exit/dist/cjs/index.js +0 -279
  175. package/dist/node_modules/signal-exit/dist/cjs/package.json +0 -3
  176. package/dist/node_modules/signal-exit/dist/cjs/signals.js +0 -42
  177. package/dist/node_modules/signal-exit/dist/mjs/browser.js +0 -4
  178. package/dist/node_modules/signal-exit/dist/mjs/index.js +0 -275
  179. package/dist/node_modules/signal-exit/dist/mjs/package.json +0 -3
  180. package/dist/node_modules/signal-exit/dist/mjs/signals.js +0 -39
  181. package/dist/node_modules/signal-exit/package.json +0 -106
  182. package/dist/node_modules/which/bin/node-which +0 -52
  183. package/dist/node_modules/which/which.js +0 -125
  184. /package/dist/node_modules/{promise-retry → @gar/promise-retry}/LICENSE +0 -0
  185. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/commonjs/index.js +0 -0
  186. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/commonjs/index.min.js +0 -0
  187. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/commonjs/options.js +0 -0
  188. /package/dist/node_modules/{@isaacs/cliui → isexe}/dist/commonjs/package.json +0 -0
  189. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/commonjs/posix.js +0 -0
  190. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/commonjs/win32.js +0 -0
  191. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/esm/index.js +0 -0
  192. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/esm/index.min.js +0 -0
  193. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/esm/options.js +0 -0
  194. /package/dist/node_modules/{@isaacs/cliui → isexe}/dist/esm/package.json +0 -0
  195. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/esm/posix.js +0 -0
  196. /package/dist/node_modules/{node-gyp/node_modules/isexe → isexe}/dist/esm/win32.js +0 -0
  197. /package/dist/node_modules/{foreground-child → minipass-sized}/dist/commonjs/package.json +0 -0
  198. /package/dist/node_modules/{foreground-child → minipass-sized}/dist/esm/package.json +0 -0
  199. /package/dist/node_modules/{node-gyp/node_modules/which → which}/bin/which.js +0 -0
  200. /package/dist/node_modules/{node-gyp/node_modules/which → which}/lib/index.js +0 -0
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
@@ -1,78 +0,0 @@
1
- {
2
- "name": "isexe",
3
- "version": "3.1.5",
4
- "description": "Minimal module to check if a file is executable.",
5
- "main": "./dist/commonjs/index.min.js",
6
- "module": "./dist/esm/index.min.js",
7
- "types": "./dist/commonjs/index.d.ts",
8
- "files": [
9
- "dist"
10
- ],
11
- "tshy": {
12
- "selfLink": false,
13
- "exports": {
14
- "./raw": "./src/index.ts",
15
- "./package.json": "./package.json",
16
- ".": {
17
- "import": {
18
- "types": "./dist/esm/index.d.ts",
19
- "default": "./dist/esm/index.min.js"
20
- },
21
- "require": {
22
- "types": "./dist/commonjs/index.d.ts",
23
- "default": "./dist/commonjs/index.min.js"
24
- }
25
- }
26
- }
27
- },
28
- "exports": {
29
- "./raw": {
30
- "import": {
31
- "types": "./dist/esm/index.d.ts",
32
- "default": "./dist/esm/index.js"
33
- },
34
- "require": {
35
- "types": "./dist/commonjs/index.d.ts",
36
- "default": "./dist/commonjs/index.js"
37
- }
38
- },
39
- "./package.json": "./package.json",
40
- ".": {
41
- "import": {
42
- "types": "./dist/esm/index.d.ts",
43
- "default": "./dist/esm/index.min.js"
44
- },
45
- "require": {
46
- "types": "./dist/commonjs/index.d.ts",
47
- "default": "./dist/commonjs/index.min.js"
48
- }
49
- }
50
- },
51
- "devDependencies": {
52
- "@types/node": "^25.2.1",
53
- "esbuild": "^0.27.3",
54
- "prettier": "^3.8.1",
55
- "tap": "^21.5.1",
56
- "tshy": "^3.1.3",
57
- "typedoc": "^0.28.16"
58
- },
59
- "scripts": {
60
- "preversion": "npm test",
61
- "postversion": "npm publish",
62
- "prepublishOnly": "git push origin --follow-tags",
63
- "prepare": "tshy && bash build.sh",
64
- "pretest": "npm run prepare",
65
- "presnap": "npm run prepare",
66
- "test": "tap",
67
- "snap": "tap",
68
- "format": "prettier --write .",
69
- "typedoc": "typedoc"
70
- },
71
- "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
72
- "license": "BlueOak-1.0.0",
73
- "repository": "https://github.com/isaacs/isexe",
74
- "engines": {
75
- "node": ">=18"
76
- },
77
- "type": "module"
78
- }
@@ -1,15 +0,0 @@
1
- The ISC License
2
-
3
- Copyright (c) Isaac Z. Schlueter and Contributors
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted, provided that the above
7
- copyright notice and this permission notice appear in all copies.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
15
- IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -1,52 +0,0 @@
1
- {
2
- "author": "GitHub Inc.",
3
- "name": "which",
4
- "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.",
5
- "version": "5.0.0",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/npm/node-which.git"
9
- },
10
- "main": "lib/index.js",
11
- "bin": {
12
- "node-which": "./bin/which.js"
13
- },
14
- "license": "ISC",
15
- "dependencies": {
16
- "isexe": "^3.1.1"
17
- },
18
- "devDependencies": {
19
- "@npmcli/eslint-config": "^5.0.0",
20
- "@npmcli/template-oss": "4.23.3",
21
- "tap": "^16.3.0"
22
- },
23
- "scripts": {
24
- "test": "tap",
25
- "lint": "npm run eslint",
26
- "postlint": "template-oss-check",
27
- "template-oss-apply": "template-oss-apply --force",
28
- "lintfix": "npm run eslint -- --fix",
29
- "snap": "tap",
30
- "posttest": "npm run lint",
31
- "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
32
- },
33
- "files": [
34
- "bin/",
35
- "lib/"
36
- ],
37
- "tap": {
38
- "check-coverage": true,
39
- "nyc-arg": [
40
- "--exclude",
41
- "tap-snapshots/**"
42
- ]
43
- },
44
- "engines": {
45
- "node": "^18.17.0 || >=20.5.0"
46
- },
47
- "templateOSS": {
48
- "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
49
- "version": "4.23.3",
50
- "publish": "true"
51
- }
52
- }
@@ -1,134 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadPackageJson = exports.findPackageJson = void 0;
4
- const node_fs_1 = require("node:fs");
5
- const node_path_1 = require("node:path");
6
- const node_url_1 = require("node:url");
7
- const NM = `${node_path_1.sep}node_modules${node_path_1.sep}`;
8
- const STORE = `.store${node_path_1.sep}`;
9
- const PKG = `${node_path_1.sep}package${node_path_1.sep}`;
10
- const DIST = `${node_path_1.sep}dist${node_path_1.sep}`;
11
- /**
12
- * Find the package.json file, either from a TypeScript file somewhere not
13
- * in a 'dist' folder, or a built and/or installed 'dist' folder.
14
- *
15
- * Note: this *only* works if you build your code into `'./dist'`, and that the
16
- * source path does not also contain `'dist'`! If you don't build into
17
- * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will
18
- * not work properly!
19
- *
20
- * The default `pathFromSrc` option assumes that the calling code lives one
21
- * folder below the root of the package. Otherwise, it must be specified.
22
- *
23
- * Example:
24
- *
25
- * ```ts
26
- * // src/index.ts
27
- * import { findPackageJson } from 'package-json-from-dist'
28
- *
29
- * const pj = findPackageJson(import.meta.url)
30
- * console.log(`package.json found at ${pj}`)
31
- * ```
32
- *
33
- * If the caller is deeper within the project source, then you must provide
34
- * the appropriate fallback path:
35
- *
36
- * ```ts
37
- * // src/components/something.ts
38
- * import { findPackageJson } from 'package-json-from-dist'
39
- *
40
- * const pj = findPackageJson(import.meta.url, '../../package.json')
41
- * console.log(`package.json found at ${pj}`)
42
- * ```
43
- *
44
- * When running from CommmonJS, use `__filename` instead of `import.meta.url`
45
- *
46
- * ```ts
47
- * // src/index.cts
48
- * import { findPackageJson } from 'package-json-from-dist'
49
- *
50
- * const pj = findPackageJson(__filename)
51
- * console.log(`package.json found at ${pj}`)
52
- * ```
53
- */
54
- const findPackageJson = (from, pathFromSrc = '../package.json') => {
55
- const f = typeof from === 'object' || from.startsWith('file://') ?
56
- (0, node_url_1.fileURLToPath)(from)
57
- : from;
58
- const __dirname = (0, node_path_1.dirname)(f);
59
- const nms = __dirname.lastIndexOf(NM);
60
- if (nms !== -1) {
61
- // inside of node_modules. find the dist directly under package name.
62
- const nm = __dirname.substring(0, nms + NM.length);
63
- const pkgDir = __dirname.substring(nms + NM.length);
64
- // affordance for yarn berry, which puts package contents in
65
- // '.../node_modules/.store/${id}-${hash}/package/...'
66
- if (pkgDir.startsWith(STORE)) {
67
- const pkg = pkgDir.indexOf(PKG, STORE.length);
68
- if (pkg) {
69
- return (0, node_path_1.resolve)(nm, pkgDir.substring(0, pkg + PKG.length), 'package.json');
70
- }
71
- }
72
- const pkgName = pkgDir.startsWith('@') ?
73
- pkgDir.split(node_path_1.sep, 2).join(node_path_1.sep)
74
- : String(pkgDir.split(node_path_1.sep)[0]);
75
- return (0, node_path_1.resolve)(nm, pkgName, 'package.json');
76
- }
77
- else {
78
- // see if we are in a dist folder.
79
- const d = __dirname.lastIndexOf(DIST);
80
- if (d !== -1) {
81
- return (0, node_path_1.resolve)(__dirname.substring(0, d), 'package.json');
82
- }
83
- else {
84
- return (0, node_path_1.resolve)(__dirname, pathFromSrc);
85
- }
86
- }
87
- };
88
- exports.findPackageJson = findPackageJson;
89
- /**
90
- * Load the package.json file, either from a TypeScript file somewhere not
91
- * in a 'dist' folder, or a built and/or installed 'dist' folder.
92
- *
93
- * Note: this *only* works if you build your code into `'./dist'`, and that the
94
- * source path does not also contain `'dist'`! If you don't build into
95
- * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will
96
- * not work properly!
97
- *
98
- * The default `pathFromSrc` option assumes that the calling code lives one
99
- * folder below the root of the package. Otherwise, it must be specified.
100
- *
101
- * Example:
102
- *
103
- * ```ts
104
- * // src/index.ts
105
- * import { loadPackageJson } from 'package-json-from-dist'
106
- *
107
- * const pj = loadPackageJson(import.meta.url)
108
- * console.log(`Hello from ${pj.name}@${pj.version}`)
109
- * ```
110
- *
111
- * If the caller is deeper within the project source, then you must provide
112
- * the appropriate fallback path:
113
- *
114
- * ```ts
115
- * // src/components/something.ts
116
- * import { loadPackageJson } from 'package-json-from-dist'
117
- *
118
- * const pj = loadPackageJson(import.meta.url, '../../package.json')
119
- * console.log(`Hello from ${pj.name}@${pj.version}`)
120
- * ```
121
- *
122
- * When running from CommmonJS, use `__filename` instead of `import.meta.url`
123
- *
124
- * ```ts
125
- * // src/index.cts
126
- * import { loadPackageJson } from 'package-json-from-dist'
127
- *
128
- * const pj = loadPackageJson(__filename)
129
- * console.log(`Hello from ${pj.name}@${pj.version}`)
130
- * ```
131
- */
132
- const loadPackageJson = (from, pathFromSrc = '../package.json') => JSON.parse((0, node_fs_1.readFileSync)((0, exports.findPackageJson)(from, pathFromSrc), 'utf8'));
133
- exports.loadPackageJson = loadPackageJson;
134
- //# sourceMappingURL=index.js.map
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }
@@ -1,129 +0,0 @@
1
- import { readFileSync } from 'node:fs';
2
- import { dirname, resolve, sep } from 'node:path';
3
- import { fileURLToPath } from 'node:url';
4
- const NM = `${sep}node_modules${sep}`;
5
- const STORE = `.store${sep}`;
6
- const PKG = `${sep}package${sep}`;
7
- const DIST = `${sep}dist${sep}`;
8
- /**
9
- * Find the package.json file, either from a TypeScript file somewhere not
10
- * in a 'dist' folder, or a built and/or installed 'dist' folder.
11
- *
12
- * Note: this *only* works if you build your code into `'./dist'`, and that the
13
- * source path does not also contain `'dist'`! If you don't build into
14
- * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will
15
- * not work properly!
16
- *
17
- * The default `pathFromSrc` option assumes that the calling code lives one
18
- * folder below the root of the package. Otherwise, it must be specified.
19
- *
20
- * Example:
21
- *
22
- * ```ts
23
- * // src/index.ts
24
- * import { findPackageJson } from 'package-json-from-dist'
25
- *
26
- * const pj = findPackageJson(import.meta.url)
27
- * console.log(`package.json found at ${pj}`)
28
- * ```
29
- *
30
- * If the caller is deeper within the project source, then you must provide
31
- * the appropriate fallback path:
32
- *
33
- * ```ts
34
- * // src/components/something.ts
35
- * import { findPackageJson } from 'package-json-from-dist'
36
- *
37
- * const pj = findPackageJson(import.meta.url, '../../package.json')
38
- * console.log(`package.json found at ${pj}`)
39
- * ```
40
- *
41
- * When running from CommmonJS, use `__filename` instead of `import.meta.url`
42
- *
43
- * ```ts
44
- * // src/index.cts
45
- * import { findPackageJson } from 'package-json-from-dist'
46
- *
47
- * const pj = findPackageJson(__filename)
48
- * console.log(`package.json found at ${pj}`)
49
- * ```
50
- */
51
- export const findPackageJson = (from, pathFromSrc = '../package.json') => {
52
- const f = typeof from === 'object' || from.startsWith('file://') ?
53
- fileURLToPath(from)
54
- : from;
55
- const __dirname = dirname(f);
56
- const nms = __dirname.lastIndexOf(NM);
57
- if (nms !== -1) {
58
- // inside of node_modules. find the dist directly under package name.
59
- const nm = __dirname.substring(0, nms + NM.length);
60
- const pkgDir = __dirname.substring(nms + NM.length);
61
- // affordance for yarn berry, which puts package contents in
62
- // '.../node_modules/.store/${id}-${hash}/package/...'
63
- if (pkgDir.startsWith(STORE)) {
64
- const pkg = pkgDir.indexOf(PKG, STORE.length);
65
- if (pkg) {
66
- return resolve(nm, pkgDir.substring(0, pkg + PKG.length), 'package.json');
67
- }
68
- }
69
- const pkgName = pkgDir.startsWith('@') ?
70
- pkgDir.split(sep, 2).join(sep)
71
- : String(pkgDir.split(sep)[0]);
72
- return resolve(nm, pkgName, 'package.json');
73
- }
74
- else {
75
- // see if we are in a dist folder.
76
- const d = __dirname.lastIndexOf(DIST);
77
- if (d !== -1) {
78
- return resolve(__dirname.substring(0, d), 'package.json');
79
- }
80
- else {
81
- return resolve(__dirname, pathFromSrc);
82
- }
83
- }
84
- };
85
- /**
86
- * Load the package.json file, either from a TypeScript file somewhere not
87
- * in a 'dist' folder, or a built and/or installed 'dist' folder.
88
- *
89
- * Note: this *only* works if you build your code into `'./dist'`, and that the
90
- * source path does not also contain `'dist'`! If you don't build into
91
- * `'./dist'`, or if you have files at `./src/dist/dist.ts`, then this will
92
- * not work properly!
93
- *
94
- * The default `pathFromSrc` option assumes that the calling code lives one
95
- * folder below the root of the package. Otherwise, it must be specified.
96
- *
97
- * Example:
98
- *
99
- * ```ts
100
- * // src/index.ts
101
- * import { loadPackageJson } from 'package-json-from-dist'
102
- *
103
- * const pj = loadPackageJson(import.meta.url)
104
- * console.log(`Hello from ${pj.name}@${pj.version}`)
105
- * ```
106
- *
107
- * If the caller is deeper within the project source, then you must provide
108
- * the appropriate fallback path:
109
- *
110
- * ```ts
111
- * // src/components/something.ts
112
- * import { loadPackageJson } from 'package-json-from-dist'
113
- *
114
- * const pj = loadPackageJson(import.meta.url, '../../package.json')
115
- * console.log(`Hello from ${pj.name}@${pj.version}`)
116
- * ```
117
- *
118
- * When running from CommmonJS, use `__filename` instead of `import.meta.url`
119
- *
120
- * ```ts
121
- * // src/index.cts
122
- * import { loadPackageJson } from 'package-json-from-dist'
123
- *
124
- * const pj = loadPackageJson(__filename)
125
- * console.log(`Hello from ${pj.name}@${pj.version}`)
126
- * ```
127
- */
128
- export const loadPackageJson = (from, pathFromSrc = '../package.json') => JSON.parse(readFileSync(findPackageJson(from, pathFromSrc), 'utf8'));
129
- //# sourceMappingURL=index.js.map
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
@@ -1,68 +0,0 @@
1
- {
2
- "name": "package-json-from-dist",
3
- "version": "1.0.1",
4
- "description": "Load the local package.json from either src or dist folder",
5
- "main": "./dist/commonjs/index.js",
6
- "exports": {
7
- "./package.json": "./package.json",
8
- ".": {
9
- "import": {
10
- "types": "./dist/esm/index.d.ts",
11
- "default": "./dist/esm/index.js"
12
- },
13
- "require": {
14
- "types": "./dist/commonjs/index.d.ts",
15
- "default": "./dist/commonjs/index.js"
16
- }
17
- }
18
- },
19
- "files": [
20
- "dist"
21
- ],
22
- "scripts": {
23
- "preversion": "npm test",
24
- "postversion": "npm publish",
25
- "prepublishOnly": "git push origin --follow-tags",
26
- "prepare": "tshy",
27
- "pretest": "npm run prepare",
28
- "presnap": "npm run prepare",
29
- "test": "tap",
30
- "snap": "tap",
31
- "format": "prettier --write . --log-level warn",
32
- "typedoc": "typedoc"
33
- },
34
- "author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)",
35
- "license": "BlueOak-1.0.0",
36
- "repository": {
37
- "type": "git",
38
- "url": "git+https://github.com/isaacs/package-json-from-dist.git"
39
- },
40
- "devDependencies": {
41
- "@types/node": "^20.12.12",
42
- "prettier": "^3.2.5",
43
- "tap": "^18.5.3",
44
- "typedoc": "^0.24.8",
45
- "typescript": "^5.1.6",
46
- "tshy": "^1.14.0"
47
- },
48
- "prettier": {
49
- "semi": false,
50
- "printWidth": 70,
51
- "tabWidth": 2,
52
- "useTabs": false,
53
- "singleQuote": true,
54
- "jsxSingleQuote": false,
55
- "bracketSameLine": true,
56
- "arrowParens": "avoid",
57
- "endOfLine": "lf",
58
- "experimentalTernaries": true
59
- },
60
- "tshy": {
61
- "exports": {
62
- "./package.json": "./package.json",
63
- ".": "./src/index.ts"
64
- }
65
- },
66
- "types": "./dist/commonjs/index.d.ts",
67
- "type": "module"
68
- }
@@ -1,16 +0,0 @@
1
- 'use strict';
2
-
3
- const pathKey = (options = {}) => {
4
- const environment = options.env || process.env;
5
- const platform = options.platform || process.platform;
6
-
7
- if (platform !== 'win32') {
8
- return 'PATH';
9
- }
10
-
11
- return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';
12
- };
13
-
14
- module.exports = pathKey;
15
- // TODO: Remove this for the next major release
16
- module.exports.default = pathKey;
@@ -1,9 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,39 +0,0 @@
1
- {
2
- "name": "path-key",
3
- "version": "3.1.1",
4
- "description": "Get the PATH environment variable key cross-platform",
5
- "license": "MIT",
6
- "repository": "sindresorhus/path-key",
7
- "author": {
8
- "name": "Sindre Sorhus",
9
- "email": "sindresorhus@gmail.com",
10
- "url": "sindresorhus.com"
11
- },
12
- "engines": {
13
- "node": ">=8"
14
- },
15
- "scripts": {
16
- "test": "xo && ava && tsd"
17
- },
18
- "files": [
19
- "index.js",
20
- "index.d.ts"
21
- ],
22
- "keywords": [
23
- "path",
24
- "key",
25
- "environment",
26
- "env",
27
- "variable",
28
- "var",
29
- "get",
30
- "cross-platform",
31
- "windows"
32
- ],
33
- "devDependencies": {
34
- "@types/node": "^11.13.0",
35
- "ava": "^1.4.1",
36
- "tsd": "^0.7.2",
37
- "xo": "^0.24.0"
38
- }
39
- }