@stryke/fs 0.33.70 → 0.33.71

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 (196) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -1
  3. package/dist/buffer.cjs +5 -4
  4. package/dist/buffer.d.cts.map +1 -1
  5. package/dist/buffer.d.mts.map +1 -1
  6. package/dist/buffer.mjs +1 -1
  7. package/dist/chmod-x.cjs +2 -1
  8. package/dist/chmod-x.d.cts.map +1 -1
  9. package/dist/chmod-x.d.mts.map +1 -1
  10. package/dist/chmod-x.mjs.map +1 -1
  11. package/dist/command-exists.cjs +3 -2
  12. package/dist/command-exists.d.cts.map +1 -1
  13. package/dist/command-exists.d.mts.map +1 -1
  14. package/dist/command-exists.mjs +1 -1
  15. package/dist/command-exists.mjs.map +1 -1
  16. package/dist/compress.cjs +7 -7
  17. package/dist/compress.d.cts.map +1 -1
  18. package/dist/compress.d.mts.map +1 -1
  19. package/dist/compress.mjs +5 -6
  20. package/dist/compress.mjs.map +1 -1
  21. package/dist/constants.d.cts.map +1 -1
  22. package/dist/constants.d.mts.map +1 -1
  23. package/dist/copy-file.cjs +16 -15
  24. package/dist/copy-file.d.cts +0 -1
  25. package/dist/copy-file.d.cts.map +1 -1
  26. package/dist/copy-file.d.mts +0 -1
  27. package/dist/copy-file.d.mts.map +1 -1
  28. package/dist/copy-file.mjs +6 -6
  29. package/dist/exists.cjs +2 -1
  30. package/dist/exists.d.cts.map +1 -1
  31. package/dist/exists.d.mts.map +1 -1
  32. package/dist/get-parent-path.cjs +14 -13
  33. package/dist/get-parent-path.d.cts.map +1 -1
  34. package/dist/get-parent-path.d.mts.map +1 -1
  35. package/dist/get-parent-path.mjs +6 -6
  36. package/dist/get-parent-path.mjs.map +1 -1
  37. package/dist/get-workspace-root.cjs +14 -13
  38. package/dist/get-workspace-root.d.cts.map +1 -1
  39. package/dist/get-workspace-root.d.mts.map +1 -1
  40. package/dist/get-workspace-root.mjs +3 -3
  41. package/dist/get-workspace-root.mjs.map +1 -1
  42. package/dist/helpers.cjs +2 -1
  43. package/dist/helpers.d.cts.map +1 -1
  44. package/dist/helpers.d.mts.map +1 -1
  45. package/dist/helpers.mjs.map +1 -1
  46. package/dist/index.cjs +1 -0
  47. package/dist/install.cjs +6 -5
  48. package/dist/install.d.cts +0 -2
  49. package/dist/install.d.cts.map +1 -1
  50. package/dist/install.d.mts +0 -3
  51. package/dist/install.d.mts.map +1 -1
  52. package/dist/install.mjs +1 -1
  53. package/dist/is-file.cjs +7 -6
  54. package/dist/is-file.d.cts.map +1 -1
  55. package/dist/is-file.d.mts.map +1 -1
  56. package/dist/is-file.mjs +1 -1
  57. package/dist/json/src/storm-json.cjs +3 -3
  58. package/dist/json/src/storm-json.mjs +1 -1
  59. package/dist/json/src/storm-json.mjs.map +1 -1
  60. package/dist/json/src/types.d.cts +0 -1
  61. package/dist/json/src/types.d.cts.map +1 -1
  62. package/dist/json/src/types.d.mts +0 -1
  63. package/dist/json/src/types.d.mts.map +1 -1
  64. package/dist/json/src/utils/code-frames.mjs.map +1 -1
  65. package/dist/json/src/utils/parse-error.cjs +1 -1
  66. package/dist/json/src/utils/stringify.mjs.map +1 -1
  67. package/dist/json/src/utils/strip-comments.cjs +4 -5
  68. package/dist/json/src/utils/strip-comments.mjs +4 -6
  69. package/dist/json/src/utils/strip-comments.mjs.map +1 -1
  70. package/dist/json.cjs +6 -4
  71. package/dist/json.d.cts +0 -1
  72. package/dist/json.d.cts.map +1 -1
  73. package/dist/json.d.mts +0 -1
  74. package/dist/json.d.mts.map +1 -1
  75. package/dist/json.mjs +2 -2
  76. package/dist/list-files.cjs +6 -5
  77. package/dist/list-files.d.cts.map +1 -1
  78. package/dist/list-files.d.mts.map +1 -1
  79. package/dist/list-files.mjs +1 -1
  80. package/dist/list-files.mjs.map +1 -1
  81. package/dist/package-fns.cjs +12 -11
  82. package/dist/package-fns.d.cts +0 -1
  83. package/dist/package-fns.d.cts.map +1 -1
  84. package/dist/package-fns.d.mts +0 -1
  85. package/dist/package-fns.d.mts.map +1 -1
  86. package/dist/package-fns.mjs +4 -4
  87. package/dist/read-file.cjs +2 -1
  88. package/dist/read-file.d.cts.map +1 -1
  89. package/dist/read-file.d.mts.map +1 -1
  90. package/dist/registry.cjs +4 -3
  91. package/dist/registry.d.cts.map +1 -1
  92. package/dist/registry.d.mts.map +1 -1
  93. package/dist/registry.mjs.map +1 -1
  94. package/dist/remove-file.cjs +2 -1
  95. package/dist/remove-file.d.cts.map +1 -1
  96. package/dist/remove-file.d.mts.map +1 -1
  97. package/dist/resolve.cjs +38 -37
  98. package/dist/resolve.d.cts.map +1 -1
  99. package/dist/resolve.d.mts.map +1 -1
  100. package/dist/resolve.mjs +18 -18
  101. package/dist/resolve.mjs.map +1 -1
  102. package/dist/semver-fns.cjs +5 -4
  103. package/dist/semver-fns.d.cts.map +1 -1
  104. package/dist/semver-fns.d.mts.map +1 -1
  105. package/dist/semver-fns.mjs +1 -1
  106. package/dist/semver-fns.mjs.map +1 -1
  107. package/dist/toml.cjs +3 -2
  108. package/dist/toml.d.cts +3 -4
  109. package/dist/toml.d.cts.map +1 -1
  110. package/dist/toml.d.mts +3 -4
  111. package/dist/toml.d.mts.map +1 -1
  112. package/dist/tsconfig.cjs +13 -12
  113. package/dist/tsconfig.d.cts +0 -1
  114. package/dist/tsconfig.d.cts.map +1 -1
  115. package/dist/tsconfig.d.mts +0 -1
  116. package/dist/tsconfig.d.mts.map +1 -1
  117. package/dist/tsconfig.mjs +5 -5
  118. package/dist/type-checks/src/index.cjs +3 -3
  119. package/dist/type-checks/src/index.mjs +3 -3
  120. package/dist/type-checks/src/is-buffer.cjs +2 -2
  121. package/dist/type-checks/src/is-buffer.mjs +1 -1
  122. package/dist/type-checks/src/is-buffer.mjs.map +1 -1
  123. package/dist/type-checks/src/is-set-string.cjs +1 -1
  124. package/dist/type-checks/src/is-set-string.mjs +1 -1
  125. package/dist/types/src/file.d.cts +0 -1
  126. package/dist/types/src/file.d.cts.map +1 -1
  127. package/dist/types/src/file.d.mts +0 -1
  128. package/dist/types/src/file.d.mts.map +1 -1
  129. package/dist/types/src/package-json.d.cts.map +1 -1
  130. package/dist/types/src/package-json.d.mts.map +1 -1
  131. package/dist/types/src/package-manager.d.cts.map +1 -1
  132. package/dist/types/src/package-manager.d.mts.map +1 -1
  133. package/dist/types/src/tsconfig.d.cts.map +1 -1
  134. package/dist/types/src/tsconfig.d.mts.map +1 -1
  135. package/dist/write-file.cjs +6 -5
  136. package/dist/write-file.d.cts.map +1 -1
  137. package/dist/write-file.d.mts.map +1 -1
  138. package/dist/write-file.mjs +2 -2
  139. package/dist/yaml.cjs +2 -1
  140. package/dist/yaml.d.cts.map +1 -1
  141. package/dist/yaml.d.mts.map +1 -1
  142. package/package.json +139 -58
  143. package/dist/convert/src/array-buffer-to-string.cjs +0 -19
  144. package/dist/convert/src/array-buffer-to-string.mjs +0 -19
  145. package/dist/convert/src/array-buffer-to-string.mjs.map +0 -1
  146. package/dist/convert/src/to-array.cjs +0 -15
  147. package/dist/convert/src/to-array.mjs +0 -15
  148. package/dist/convert/src/to-array.mjs.map +0 -1
  149. package/dist/convert/src/uint8-array-to-string.cjs +0 -15
  150. package/dist/convert/src/uint8-array-to-string.mjs +0 -16
  151. package/dist/convert/src/uint8-array-to-string.mjs.map +0 -1
  152. package/dist/helpers/src/get-unique.cjs +0 -14
  153. package/dist/helpers/src/get-unique.mjs +0 -14
  154. package/dist/helpers/src/get-unique.mjs.map +0 -1
  155. package/dist/path/src/append.cjs +0 -57
  156. package/dist/path/src/append.mjs +0 -57
  157. package/dist/path/src/append.mjs.map +0 -1
  158. package/dist/path/src/correct-path.cjs +0 -138
  159. package/dist/path/src/correct-path.mjs +0 -135
  160. package/dist/path/src/correct-path.mjs.map +0 -1
  161. package/dist/path/src/cwd.cjs +0 -17
  162. package/dist/path/src/cwd.mjs +0 -17
  163. package/dist/path/src/cwd.mjs.map +0 -1
  164. package/dist/path/src/file-path-fns.cjs +0 -178
  165. package/dist/path/src/file-path-fns.mjs +0 -171
  166. package/dist/path/src/file-path-fns.mjs.map +0 -1
  167. package/dist/path/src/is-parent-path.cjs +0 -32
  168. package/dist/path/src/is-parent-path.mjs +0 -33
  169. package/dist/path/src/is-parent-path.mjs.map +0 -1
  170. package/dist/path/src/is-root-dir.cjs +0 -14
  171. package/dist/path/src/is-root-dir.mjs +0 -14
  172. package/dist/path/src/is-root-dir.mjs.map +0 -1
  173. package/dist/path/src/is-type.cjs +0 -68
  174. package/dist/path/src/is-type.mjs +0 -67
  175. package/dist/path/src/is-type.mjs.map +0 -1
  176. package/dist/path/src/join-paths.cjs +0 -122
  177. package/dist/path/src/join-paths.mjs +0 -123
  178. package/dist/path/src/join-paths.mjs.map +0 -1
  179. package/dist/path/src/regex.cjs +0 -20
  180. package/dist/path/src/regex.mjs +0 -13
  181. package/dist/path/src/regex.mjs.map +0 -1
  182. package/dist/path/src/replace.cjs +0 -24
  183. package/dist/path/src/replace.mjs +0 -25
  184. package/dist/path/src/replace.mjs.map +0 -1
  185. package/dist/path/src/resolve-parent-path.cjs +0 -18
  186. package/dist/path/src/resolve-parent-path.mjs +0 -19
  187. package/dist/path/src/resolve-parent-path.mjs.map +0 -1
  188. package/dist/path/src/slash.cjs +0 -15
  189. package/dist/path/src/slash.mjs +0 -15
  190. package/dist/path/src/slash.mjs.map +0 -1
  191. package/dist/string-format/src/package.cjs +0 -92
  192. package/dist/string-format/src/package.mjs +0 -92
  193. package/dist/string-format/src/package.mjs.map +0 -1
  194. package/dist/types/src/base.cjs +0 -6
  195. package/dist/types/src/base.mjs +0 -6
  196. package/dist/types/src/base.mjs.map +0 -1
package/dist/json.cjs CHANGED
@@ -1,10 +1,12 @@
1
- const require_is_set_string = require('./type-checks/src/is-set-string.cjs');
2
- const require_file_path_fns = require('./path/src/file-path-fns.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
3
  const require_is_error = require('./type-checks/src/is-error.cjs');
4
+ const require_is_set_string = require('./type-checks/src/is-set-string.cjs');
4
5
  require('./type-checks/src/index.cjs');
5
6
  const require_read_file = require('./read-file.cjs');
6
7
  const require_write_file = require('./write-file.cjs');
7
8
  const require_storm_json = require('./json/src/storm-json.cjs');
9
+ let _stryke_path = require("@stryke/path");
8
10
 
9
11
  //#region src/json.ts
10
12
  /**
@@ -18,7 +20,7 @@ function readJsonFileSync(path, options) {
18
20
  const content = require_read_file.readFileSync(path);
19
21
  try {
20
22
  return require_storm_json.StormJSON.parse(require_is_set_string.isSetString(content) ? content.trim() : "{}", {
21
- expectComments: require_file_path_fns.findFileExtension(path) === "jsonc",
23
+ expectComments: (0, _stryke_path.findFileExtension)(path) === "jsonc",
22
24
  ...options
23
25
  });
24
26
  } catch (error) {
@@ -40,7 +42,7 @@ async function readJsonFile(path, options = {}) {
40
42
  const content = await require_read_file.readFile(path);
41
43
  try {
42
44
  return require_storm_json.StormJSON.parse(require_is_set_string.isSetString(content) ? content.trim() : "{}", {
43
- expectComments: require_file_path_fns.findFileExtension(path) === "jsonc",
45
+ expectComments: (0, _stryke_path.findFileExtension)(path) === "jsonc",
44
46
  ...options
45
47
  });
46
48
  } catch (error) {
package/dist/json.d.cts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { JsonParseOptions, JsonSerializeOptions } from "./json/src/types.cjs";
2
2
 
3
3
  //#region src/json.d.ts
4
-
5
4
  /**
6
5
  * Reads a JSON file and returns the object the JSON content represents.
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"json.d.cts","names":[],"sources":["../src/json.ts"],"sourcesContent":[],"mappings":";;;;;;AAoCA;AA4BA;;;;AAGU,iBA/BM,gBA+BN,CAAA,UAAA,MAAA,GAAA,GAAA,CAAA,CAAA,IAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EA7BE,gBA6BF,CAAA,EA5BP,CA4BO;AAkBV;AAgBA;AAoBA;;;;;iBAzDsB,6DAEX,mBACR,QAAQ;UAkBM,gBAAA,SAAyB;;;;;;;;;;;;;;;iBAgB1B,iEAER,aACG;;;;;;;;iBAiBW,6DAEd,aACG,mBACR"}
1
+ {"version":3,"file":"json.d.cts","names":[],"sources":["../src/json.ts"],"mappings":";;;;;AAoCA;;;;;iBAAgB,gBAAA,wBAAA,CACd,IAAA,UACA,OAAA,GAAU,gBAAA,GACT,CAAA;;;;;;AAyBH;;iBAAsB,YAAA,wBAAA,CACpB,IAAA,UACA,OAAA,GAAS,gBAAA,GACR,OAAA,CAAQ,CAAA;AAAA,UAkBM,gBAAA,SAAyB,oBAAA;EAlB/B;;;;;EAwBT,aAAA;AAAA;;;;;;AANF;;iBAgBgB,iBAAA,2BAAA,CACd,IAAA,UACA,IAAA,EAAM,CAAA,EACN,OAAA,GAAS,gBAAA;;;AAHX;;;;;iBAoBsB,aAAA,2BAAA,CACpB,IAAA,UACA,IAAA,EAAM,CAAA,EACN,OAAA,GAAS,gBAAA,GACR,OAAA"}
package/dist/json.d.mts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { JsonParseOptions, JsonSerializeOptions } from "./json/src/types.mjs";
2
2
 
3
3
  //#region src/json.d.ts
4
-
5
4
  /**
6
5
  * Reads a JSON file and returns the object the JSON content represents.
7
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"json.d.mts","names":[],"sources":["../src/json.ts"],"sourcesContent":[],"mappings":";;;;;;AAoCA;AA4BA;;;;AAGU,iBA/BM,gBA+BN,CAAA,UAAA,MAAA,GAAA,GAAA,CAAA,CAAA,IAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EA7BE,gBA6BF,CAAA,EA5BP,CA4BO;AAkBV;AAgBA;AAoBA;;;;;iBAzDsB,6DAEX,mBACR,QAAQ;UAkBM,gBAAA,SAAyB;;;;;;;;;;;;;;;iBAgB1B,iEAER,aACG;;;;;;;;iBAiBW,6DAEd,aACG,mBACR"}
1
+ {"version":3,"file":"json.d.mts","names":[],"sources":["../src/json.ts"],"mappings":";;;;;AAoCA;;;;;iBAAgB,gBAAA,wBAAA,CACd,IAAA,UACA,OAAA,GAAU,gBAAA,GACT,CAAA;;;;;;AAyBH;;iBAAsB,YAAA,wBAAA,CACpB,IAAA,UACA,OAAA,GAAS,gBAAA,GACR,OAAA,CAAQ,CAAA;AAAA,UAkBM,gBAAA,SAAyB,oBAAA;EAlB/B;;;;;EAwBT,aAAA;AAAA;;;;;;AANF;;iBAgBgB,iBAAA,2BAAA,CACd,IAAA,UACA,IAAA,EAAM,CAAA,EACN,OAAA,GAAS,gBAAA;;;AAHX;;;;;iBAoBsB,aAAA,2BAAA,CACpB,IAAA,UACA,IAAA,EAAM,CAAA,EACN,OAAA,GAAS,gBAAA,GACR,OAAA"}
package/dist/json.mjs CHANGED
@@ -1,10 +1,10 @@
1
- import { isSetString } from "./type-checks/src/is-set-string.mjs";
2
- import { findFileExtension } from "./path/src/file-path-fns.mjs";
3
1
  import { isError } from "./type-checks/src/is-error.mjs";
2
+ import { isSetString } from "./type-checks/src/is-set-string.mjs";
4
3
  import "./type-checks/src/index.mjs";
5
4
  import { readFile, readFileSync } from "./read-file.mjs";
6
5
  import { writeFile, writeFileSync } from "./write-file.mjs";
7
6
  import { StormJSON } from "./json/src/storm-json.mjs";
7
+ import { findFileExtension } from "@stryke/path";
8
8
 
9
9
  //#region src/json.ts
10
10
  /**
@@ -1,9 +1,10 @@
1
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
- const require_join_paths = require('./path/src/join-paths.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
3
  const require_is_string = require('./type-checks/src/is-string.cjs');
4
4
  require('./type-checks/src/index.cjs');
5
+ let _stryke_path = require("@stryke/path");
5
6
  let defu = require("defu");
6
- defu = require_rolldown_runtime.__toESM(defu);
7
+ defu = require_runtime.__toESM(defu, 1);
7
8
  let glob = require("glob");
8
9
 
9
10
  //#region src/list-files.ts
@@ -15,7 +16,7 @@ const DEFAULT_OPTIONS = { dot: true };
15
16
  * @returns A list of file paths
16
17
  */
17
18
  async function list(filesGlob, options) {
18
- return (0, glob.glob)(require_is_string.isString(filesGlob) ? filesGlob.includes("*") ? filesGlob : require_join_paths.joinPaths(filesGlob, "**/*") : filesGlob.input ? require_join_paths.joinPaths(filesGlob.input, filesGlob.glob) : filesGlob.glob, (0, defu.default)(require_is_string.isString(filesGlob) ? {} : {
19
+ return (0, glob.glob)(require_is_string.isString(filesGlob) ? filesGlob.includes("*") ? filesGlob : (0, _stryke_path.joinPaths)(filesGlob, "**/*") : filesGlob.input ? (0, _stryke_path.joinPaths)(filesGlob.input, filesGlob.glob) : filesGlob.glob, (0, defu.default)(require_is_string.isString(filesGlob) ? {} : {
19
20
  dot: filesGlob.dot,
20
21
  ignore: filesGlob.ignore
21
22
  }, options ?? {}, DEFAULT_OPTIONS));
@@ -27,7 +28,7 @@ async function list(filesGlob, options) {
27
28
  * @returns A list of file paths
28
29
  */
29
30
  function listSync(filesGlob, options) {
30
- return glob.glob.sync(require_is_string.isString(filesGlob) ? filesGlob.includes("*") ? filesGlob : require_join_paths.joinPaths(filesGlob, "**/*") : filesGlob.input ? require_join_paths.joinPaths(filesGlob.input, filesGlob.glob) : filesGlob.glob, (0, defu.default)(require_is_string.isString(filesGlob) ? {} : {
31
+ return glob.glob.sync(require_is_string.isString(filesGlob) ? filesGlob.includes("*") ? filesGlob : (0, _stryke_path.joinPaths)(filesGlob, "**/*") : filesGlob.input ? (0, _stryke_path.joinPaths)(filesGlob.input, filesGlob.glob) : filesGlob.glob, (0, defu.default)(require_is_string.isString(filesGlob) ? {} : {
31
32
  dot: filesGlob.dot,
32
33
  ignore: filesGlob.ignore
33
34
  }, options ?? {}, DEFAULT_OPTIONS));
@@ -1 +1 @@
1
- {"version":3,"file":"list-files.d.cts","names":[],"sources":["../src/list-files.ts"],"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1BE,CAAA,CAAA,SAAA,EAAA,MAAA,GA2BjC,IA3BiC,CA2B5B,SA3B4B,EAAA,QAAA,CAAA,EAAA,OAAA,CAAA,EA4B3C,QA5B2C,CAAA,EA4BnC,mBA5BmC,CA4BnC,QA5BmC,CAAA"}
1
+ {"version":3,"file":"list-files.d.cts","names":[],"sources":["../src/list-files.ts"],"mappings":";;;;KAyBY,WAAA,GAAc,WAAA;AAAA,KACd,mBAAA,kBAAqC,WAAA,IAC/C,QAAA,iCAAyC,IAAA;AAF3C;;;;;AACA;AADA,iBAcsB,IAAA,kBAAsB,WAAA,CAAA,CAC1C,SAAA,WAAoB,IAAA,CAAK,SAAA,aACzB,OAAA,GAAU,QAAA,GACT,OAAA,CAAQ,mBAAA,CAAoB,QAAA;;;;;;;iBAyBf,QAAA,kBAA0B,WAAA,CAAA,CACxC,SAAA,WAAoB,IAAA,CAAK,SAAA,aACzB,OAAA,GAAU,QAAA,GACT,mBAAA,CAAoB,QAAA;;;;;;AA/BvB;iBAwDsB,SAAA,kBAA2B,WAAA,CAAA,CAC/C,SAAA,WAAoB,IAAA,CAAK,SAAA,aACzB,OAAA,GAAU,QAAA,GAAQ,OAAA,CAAA,mBAAA,CAAA,QAAA;;;;;;;iBAwBJ,aAAA,kBAA+B,WAAA,CAAA,CAC7C,SAAA,WAAoB,IAAA,CAAK,SAAA,aACzB,OAAA,GAAU,QAAA,GAAQ,mBAAA,CAAA,QAAA;;;;;;;iBAmBE,eAAA,kBAAiC,WAAA,CAAA,CACrD,SAAA,WAAoB,IAAA,CAAK,SAAA,aACzB,OAAA,GAAU,QAAA,GAAQ,OAAA,CAAA,mBAAA,CAAA,QAAA;;;;;;;iBAwBJ,mBAAA,kBAAqC,WAAA,CAAA,CACnD,SAAA,WAAoB,IAAA,CAAK,SAAA,aACzB,OAAA,GAAU,QAAA,GAAQ,mBAAA,CAAA,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"list-files.d.mts","names":[],"sources":["../src/list-files.ts"],"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1BE,CAAA,CAAA,SAAA,EAAA,MAAA,GA2BjC,IA3BiC,CA2B5B,SA3B4B,EAAA,QAAA,CAAA,EAAA,OAAA,CAAA,EA4B3C,QA5B2C,CAAA,EA4BnC,mBA5BmC,CA4BnC,QA5BmC,CAAA"}
1
+ {"version":3,"file":"list-files.d.mts","names":[],"sources":["../src/list-files.ts"],"mappings":";;;;KAyBY,WAAA,GAAc,WAAA;AAAA,KACd,mBAAA,kBAAqC,WAAA,IAC/C,QAAA,iCAAyC,IAAA;AAF3C;;;;;AACA;AADA,iBAcsB,IAAA,kBAAsB,WAAA,CAAA,CAC1C,SAAA,WAAoB,IAAA,CAAK,SAAA,aACzB,OAAA,GAAU,QAAA,GACT,OAAA,CAAQ,mBAAA,CAAoB,QAAA;;;;;;;iBAyBf,QAAA,kBAA0B,WAAA,CAAA,CACxC,SAAA,WAAoB,IAAA,CAAK,SAAA,aACzB,OAAA,GAAU,QAAA,GACT,mBAAA,CAAoB,QAAA;;;;;;AA/BvB;iBAwDsB,SAAA,kBAA2B,WAAA,CAAA,CAC/C,SAAA,WAAoB,IAAA,CAAK,SAAA,aACzB,OAAA,GAAU,QAAA,GAAQ,OAAA,CAAA,mBAAA,CAAA,QAAA;;;;;;;iBAwBJ,aAAA,kBAA+B,WAAA,CAAA,CAC7C,SAAA,WAAoB,IAAA,CAAK,SAAA,aACzB,OAAA,GAAU,QAAA,GAAQ,mBAAA,CAAA,QAAA;;;;;;;iBAmBE,eAAA,kBAAiC,WAAA,CAAA,CACrD,SAAA,WAAoB,IAAA,CAAK,SAAA,aACzB,OAAA,GAAU,QAAA,GAAQ,OAAA,CAAA,mBAAA,CAAA,QAAA;;;;;;;iBAwBJ,mBAAA,kBAAqC,WAAA,CAAA,CACnD,SAAA,WAAoB,IAAA,CAAK,SAAA,aACzB,OAAA,GAAU,QAAA,GAAQ,mBAAA,CAAA,QAAA"}
@@ -1,6 +1,6 @@
1
- import { joinPaths } from "./path/src/join-paths.mjs";
2
1
  import { isString } from "./type-checks/src/is-string.mjs";
3
2
  import "./type-checks/src/index.mjs";
3
+ import { joinPaths } from "@stryke/path";
4
4
  import defu from "defu";
5
5
  import { glob } from "glob";
6
6
 
@@ -1 +1 @@
1
- {"version":3,"file":"list-files.mjs","names":["DEFAULT_OPTIONS: ListOptions"],"sources":["../src/list-files.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path\";\nimport { isString } from \"@stryke/type-checks\";\nimport type { AssetGlob } from \"@stryke/types/file\";\nimport defu from \"defu\";\nimport type { GlobOptions, GlobOptionsWithFileTypesTrue, Path } from \"glob\";\nimport { glob } from \"glob\";\n\nexport type ListOptions = GlobOptions;\nexport type InferListReturnType<TOptions extends GlobOptions> =\n TOptions[\"withFileTypes\"] extends true ? Path[] : string[];\n\nconst DEFAULT_OPTIONS: ListOptions = {\n dot: true\n};\n\n/**\n * A files and directories listing helper function\n *\n * @param filesGlob - A glob pattern to match files\n * @returns A list of file paths\n */\nexport async function list<TOptions extends ListOptions>(\n filesGlob: string | Omit<AssetGlob, \"output\">,\n options?: TOptions\n): Promise<InferListReturnType<TOptions>> {\n return glob(\n isString(filesGlob)\n ? filesGlob.includes(\"*\")\n ? filesGlob\n : joinPaths(filesGlob, \"**/*\")\n : filesGlob.input\n ? joinPaths(filesGlob.input, filesGlob.glob)\n : filesGlob.glob,\n defu(\n isString(filesGlob)\n ? {}\n : { dot: filesGlob.dot, ignore: filesGlob.ignore },\n options ?? {},\n DEFAULT_OPTIONS\n )\n ) as Promise<InferListReturnType<TOptions>>;\n}\n\n/**\n * A synchronous files and directories listing helper function\n *\n * @param filesGlob - A glob pattern to match files\n * @returns A list of file paths\n */\nexport function listSync<TOptions extends ListOptions>(\n filesGlob: string | Omit<AssetGlob, \"output\">,\n options?: TOptions\n): InferListReturnType<TOptions> {\n return glob.sync(\n isString(filesGlob)\n ? filesGlob.includes(\"*\")\n ? filesGlob\n : joinPaths(filesGlob, \"**/*\")\n : filesGlob.input\n ? joinPaths(filesGlob.input, filesGlob.glob)\n : filesGlob.glob,\n defu(\n isString(filesGlob)\n ? {}\n : { dot: filesGlob.dot, ignore: filesGlob.ignore },\n options ?? {},\n DEFAULT_OPTIONS\n )\n ) as InferListReturnType<TOptions>;\n}\n\n/**\n * A file listing helper function\n *\n * @param filesGlob - A glob pattern to match files\n * @returns A list of file paths\n */\nexport async function listFiles<TOptions extends ListOptions>(\n filesGlob: string | Omit<AssetGlob, \"output\">,\n options?: TOptions\n) {\n const result = (\n await list(\n filesGlob,\n defu(\n { withFileTypes: true },\n options ?? {}\n ) as GlobOptionsWithFileTypesTrue\n )\n ).filter(ret => ret.isFile());\n if (!options?.withFileTypes) {\n return result.map(file => file.fullpath()) as InferListReturnType<TOptions>;\n }\n\n return result as InferListReturnType<TOptions>;\n}\n\n/**\n * A synchronous file listing helper function\n *\n * @param filesGlob - A glob pattern to match files\n * @returns A list of file paths\n */\nexport function listFilesSync<TOptions extends ListOptions>(\n filesGlob: string | Omit<AssetGlob, \"output\">,\n options?: TOptions\n) {\n const result = listSync(\n filesGlob,\n defu({ withFileTypes: true }, options ?? {}) as GlobOptionsWithFileTypesTrue\n ).filter(ret => ret.isFile());\n if (!options?.withFileTypes) {\n return result.map(file => file.fullpath()) as InferListReturnType<TOptions>;\n }\n\n return result as InferListReturnType<TOptions>;\n}\n\n/**\n * A directories listing helper function\n *\n * @param filesGlob - A glob pattern to match files\n * @returns A list of file paths\n */\nexport async function listDirectories<TOptions extends ListOptions>(\n filesGlob: string | Omit<AssetGlob, \"output\">,\n options?: TOptions\n) {\n const result = (\n await list(\n filesGlob,\n defu(\n { withFileTypes: true },\n options ?? {}\n ) as GlobOptionsWithFileTypesTrue\n )\n ).filter(ret => ret.isDirectory());\n if (!options?.withFileTypes) {\n return result.map(file => file.fullpath()) as InferListReturnType<TOptions>;\n }\n\n return result as InferListReturnType<TOptions>;\n}\n\n/**\n * A synchronous directories listing helper function\n *\n * @param filesGlob - A glob pattern to match files\n * @returns A list of file paths\n */\nexport function listDirectoriesSync<TOptions extends ListOptions>(\n filesGlob: string | Omit<AssetGlob, \"output\">,\n options?: TOptions\n) {\n const result = listSync(\n filesGlob,\n defu({ withFileTypes: true }, options ?? {}) as GlobOptionsWithFileTypesTrue\n ).filter(ret => ret.isDirectory());\n if (!options?.withFileTypes) {\n return result.map(file => file.fullpath()) as InferListReturnType<TOptions>;\n }\n\n return result as InferListReturnType<TOptions>;\n}\n"],"mappings":";;;;;;;AA6BA,MAAMA,kBAA+B,EACnC,KAAK,MACN;;;;;;;AAQD,eAAsB,KACpB,WACA,SACwC;AACxC,QAAO,KACL,SAAS,UAAU,GACf,UAAU,SAAS,IAAI,GACrB,YACA,UAAU,WAAW,OAAO,GAC9B,UAAU,QACR,UAAU,UAAU,OAAO,UAAU,KAAK,GAC1C,UAAU,MAChB,KACE,SAAS,UAAU,GACf,EAAE,GACF;EAAE,KAAK,UAAU;EAAK,QAAQ,UAAU;EAAQ,EACpD,WAAW,EAAE,EACb,gBACD,CACF;;;;;;;;AASH,SAAgB,SACd,WACA,SAC+B;AAC/B,QAAO,KAAK,KACV,SAAS,UAAU,GACf,UAAU,SAAS,IAAI,GACrB,YACA,UAAU,WAAW,OAAO,GAC9B,UAAU,QACR,UAAU,UAAU,OAAO,UAAU,KAAK,GAC1C,UAAU,MAChB,KACE,SAAS,UAAU,GACf,EAAE,GACF;EAAE,KAAK,UAAU;EAAK,QAAQ,UAAU;EAAQ,EACpD,WAAW,EAAE,EACb,gBACD,CACF;;;;;;;;AASH,eAAsB,UACpB,WACA,SACA;CACA,MAAM,UACJ,MAAM,KACJ,WACA,KACE,EAAE,eAAe,MAAM,EACvB,WAAW,EAAE,CACd,CACF,EACD,QAAO,QAAO,IAAI,QAAQ,CAAC;AAC7B,KAAI,CAAC,SAAS,cACZ,QAAO,OAAO,KAAI,SAAQ,KAAK,UAAU,CAAC;AAG5C,QAAO;;;;;;;;AAST,SAAgB,cACd,WACA,SACA;CACA,MAAM,SAAS,SACb,WACA,KAAK,EAAE,eAAe,MAAM,EAAE,WAAW,EAAE,CAAC,CAC7C,CAAC,QAAO,QAAO,IAAI,QAAQ,CAAC;AAC7B,KAAI,CAAC,SAAS,cACZ,QAAO,OAAO,KAAI,SAAQ,KAAK,UAAU,CAAC;AAG5C,QAAO;;;;;;;;AAST,eAAsB,gBACpB,WACA,SACA;CACA,MAAM,UACJ,MAAM,KACJ,WACA,KACE,EAAE,eAAe,MAAM,EACvB,WAAW,EAAE,CACd,CACF,EACD,QAAO,QAAO,IAAI,aAAa,CAAC;AAClC,KAAI,CAAC,SAAS,cACZ,QAAO,OAAO,KAAI,SAAQ,KAAK,UAAU,CAAC;AAG5C,QAAO;;;;;;;;AAST,SAAgB,oBACd,WACA,SACA;CACA,MAAM,SAAS,SACb,WACA,KAAK,EAAE,eAAe,MAAM,EAAE,WAAW,EAAE,CAAC,CAC7C,CAAC,QAAO,QAAO,IAAI,aAAa,CAAC;AAClC,KAAI,CAAC,SAAS,cACZ,QAAO,OAAO,KAAI,SAAQ,KAAK,UAAU,CAAC;AAG5C,QAAO"}
1
+ {"version":3,"file":"list-files.mjs","names":[],"sources":["../src/list-files.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path\";\nimport { isString } from \"@stryke/type-checks\";\nimport type { AssetGlob } from \"@stryke/types/file\";\nimport defu from \"defu\";\nimport type { GlobOptions, GlobOptionsWithFileTypesTrue, Path } from \"glob\";\nimport { glob } from \"glob\";\n\nexport type ListOptions = GlobOptions;\nexport type InferListReturnType<TOptions extends GlobOptions> =\n TOptions[\"withFileTypes\"] extends true ? Path[] : string[];\n\nconst DEFAULT_OPTIONS: ListOptions = {\n dot: true\n};\n\n/**\n * A files and directories listing helper function\n *\n * @param filesGlob - A glob pattern to match files\n * @returns A list of file paths\n */\nexport async function list<TOptions extends ListOptions>(\n filesGlob: string | Omit<AssetGlob, \"output\">,\n options?: TOptions\n): Promise<InferListReturnType<TOptions>> {\n return glob(\n isString(filesGlob)\n ? filesGlob.includes(\"*\")\n ? filesGlob\n : joinPaths(filesGlob, \"**/*\")\n : filesGlob.input\n ? joinPaths(filesGlob.input, filesGlob.glob)\n : filesGlob.glob,\n defu(\n isString(filesGlob)\n ? {}\n : { dot: filesGlob.dot, ignore: filesGlob.ignore },\n options ?? {},\n DEFAULT_OPTIONS\n )\n ) as Promise<InferListReturnType<TOptions>>;\n}\n\n/**\n * A synchronous files and directories listing helper function\n *\n * @param filesGlob - A glob pattern to match files\n * @returns A list of file paths\n */\nexport function listSync<TOptions extends ListOptions>(\n filesGlob: string | Omit<AssetGlob, \"output\">,\n options?: TOptions\n): InferListReturnType<TOptions> {\n return glob.sync(\n isString(filesGlob)\n ? filesGlob.includes(\"*\")\n ? filesGlob\n : joinPaths(filesGlob, \"**/*\")\n : filesGlob.input\n ? joinPaths(filesGlob.input, filesGlob.glob)\n : filesGlob.glob,\n defu(\n isString(filesGlob)\n ? {}\n : { dot: filesGlob.dot, ignore: filesGlob.ignore },\n options ?? {},\n DEFAULT_OPTIONS\n )\n ) as InferListReturnType<TOptions>;\n}\n\n/**\n * A file listing helper function\n *\n * @param filesGlob - A glob pattern to match files\n * @returns A list of file paths\n */\nexport async function listFiles<TOptions extends ListOptions>(\n filesGlob: string | Omit<AssetGlob, \"output\">,\n options?: TOptions\n) {\n const result = (\n await list(\n filesGlob,\n defu(\n { withFileTypes: true },\n options ?? {}\n ) as GlobOptionsWithFileTypesTrue\n )\n ).filter(ret => ret.isFile());\n if (!options?.withFileTypes) {\n return result.map(file => file.fullpath()) as InferListReturnType<TOptions>;\n }\n\n return result as InferListReturnType<TOptions>;\n}\n\n/**\n * A synchronous file listing helper function\n *\n * @param filesGlob - A glob pattern to match files\n * @returns A list of file paths\n */\nexport function listFilesSync<TOptions extends ListOptions>(\n filesGlob: string | Omit<AssetGlob, \"output\">,\n options?: TOptions\n) {\n const result = listSync(\n filesGlob,\n defu({ withFileTypes: true }, options ?? {}) as GlobOptionsWithFileTypesTrue\n ).filter(ret => ret.isFile());\n if (!options?.withFileTypes) {\n return result.map(file => file.fullpath()) as InferListReturnType<TOptions>;\n }\n\n return result as InferListReturnType<TOptions>;\n}\n\n/**\n * A directories listing helper function\n *\n * @param filesGlob - A glob pattern to match files\n * @returns A list of file paths\n */\nexport async function listDirectories<TOptions extends ListOptions>(\n filesGlob: string | Omit<AssetGlob, \"output\">,\n options?: TOptions\n) {\n const result = (\n await list(\n filesGlob,\n defu(\n { withFileTypes: true },\n options ?? {}\n ) as GlobOptionsWithFileTypesTrue\n )\n ).filter(ret => ret.isDirectory());\n if (!options?.withFileTypes) {\n return result.map(file => file.fullpath()) as InferListReturnType<TOptions>;\n }\n\n return result as InferListReturnType<TOptions>;\n}\n\n/**\n * A synchronous directories listing helper function\n *\n * @param filesGlob - A glob pattern to match files\n * @returns A list of file paths\n */\nexport function listDirectoriesSync<TOptions extends ListOptions>(\n filesGlob: string | Omit<AssetGlob, \"output\">,\n options?: TOptions\n) {\n const result = listSync(\n filesGlob,\n defu({ withFileTypes: true }, options ?? {}) as GlobOptionsWithFileTypesTrue\n ).filter(ret => ret.isDirectory());\n if (!options?.withFileTypes) {\n return result.map(file => file.fullpath()) as InferListReturnType<TOptions>;\n }\n\n return result as InferListReturnType<TOptions>;\n}\n"],"mappings":";;;;;;;AA6BA,MAAM,kBAA+B,EACnC,KAAK,MACN;;;;;;;AAQD,eAAsB,KACpB,WACA,SACwC;AACxC,QAAO,KACL,SAAS,UAAU,GACf,UAAU,SAAS,IAAI,GACrB,YACA,UAAU,WAAW,OAAO,GAC9B,UAAU,QACR,UAAU,UAAU,OAAO,UAAU,KAAK,GAC1C,UAAU,MAChB,KACE,SAAS,UAAU,GACf,EAAE,GACF;EAAE,KAAK,UAAU;EAAK,QAAQ,UAAU;EAAQ,EACpD,WAAW,EAAE,EACb,gBACD,CACF;;;;;;;;AASH,SAAgB,SACd,WACA,SAC+B;AAC/B,QAAO,KAAK,KACV,SAAS,UAAU,GACf,UAAU,SAAS,IAAI,GACrB,YACA,UAAU,WAAW,OAAO,GAC9B,UAAU,QACR,UAAU,UAAU,OAAO,UAAU,KAAK,GAC1C,UAAU,MAChB,KACE,SAAS,UAAU,GACf,EAAE,GACF;EAAE,KAAK,UAAU;EAAK,QAAQ,UAAU;EAAQ,EACpD,WAAW,EAAE,EACb,gBACD,CACF;;;;;;;;AASH,eAAsB,UACpB,WACA,SACA;CACA,MAAM,UACJ,MAAM,KACJ,WACA,KACE,EAAE,eAAe,MAAM,EACvB,WAAW,EAAE,CACd,CACF,EACD,QAAO,QAAO,IAAI,QAAQ,CAAC;AAC7B,KAAI,CAAC,SAAS,cACZ,QAAO,OAAO,KAAI,SAAQ,KAAK,UAAU,CAAC;AAG5C,QAAO;;;;;;;;AAST,SAAgB,cACd,WACA,SACA;CACA,MAAM,SAAS,SACb,WACA,KAAK,EAAE,eAAe,MAAM,EAAE,WAAW,EAAE,CAAC,CAC7C,CAAC,QAAO,QAAO,IAAI,QAAQ,CAAC;AAC7B,KAAI,CAAC,SAAS,cACZ,QAAO,OAAO,KAAI,SAAQ,KAAK,UAAU,CAAC;AAG5C,QAAO;;;;;;;;AAST,eAAsB,gBACpB,WACA,SACA;CACA,MAAM,UACJ,MAAM,KACJ,WACA,KACE,EAAE,eAAe,MAAM,EACvB,WAAW,EAAE,CACd,CACF,EACD,QAAO,QAAO,IAAI,aAAa,CAAC;AAClC,KAAI,CAAC,SAAS,cACZ,QAAO,OAAO,KAAI,SAAQ,KAAK,UAAU,CAAC;AAG5C,QAAO;;;;;;;;AAST,SAAgB,oBACd,WACA,SACA;CACA,MAAM,SAAS,SACb,WACA,KAAK,EAAE,eAAe,MAAM,EAAE,WAAW,EAAE,CAAC,CAC7C,CAAC,QAAO,QAAO,IAAI,aAAa,CAAC;AAClC,KAAI,CAAC,SAAS,cACZ,QAAO,OAAO,KAAI,SAAQ,KAAK,UAAU,CAAC;AAG5C,QAAO"}
@@ -1,14 +1,15 @@
1
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
- const require_join_paths = require('./path/src/join-paths.cjs');
3
- const require_is_string = require('./type-checks/src/is-string.cjs');
4
- const require_file_path_fns = require('./path/src/file-path-fns.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
5
3
  const require_exists = require('./exists.cjs');
4
+ const require_is_string = require('./type-checks/src/is-string.cjs');
6
5
  const require_get_parent_path = require('./get-parent-path.cjs');
7
6
  const require_get_workspace_root = require('./get-workspace-root.cjs');
8
7
  const require_resolve = require('./resolve.cjs');
9
8
  const require_json = require('./json.cjs');
10
- const require_package = require('./string-format/src/package.cjs');
11
9
  let node_fs = require("node:fs");
10
+ let _stryke_path_join_paths = require("@stryke/path/join-paths");
11
+ let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
12
+ let _stryke_string_format_package = require("@stryke/string-format/package");
12
13
  let semver = require("semver");
13
14
 
14
15
  //#region src/package-fns.ts
@@ -26,7 +27,7 @@ function getPackageManager(dir = require_get_workspace_root.getWorkspaceRoot())
26
27
  "bun.lock"
27
28
  ], dir, { includeNameInResults: true });
28
29
  if (!lockFile) return "pnpm";
29
- switch (require_file_path_fns.findFileName(lockFile)) {
30
+ switch ((0, _stryke_path_file_path_fns.findFileName)(lockFile)) {
30
31
  case "yarn.lock": return "yarn";
31
32
  case "pnpm-lock.yaml": return "pnpm";
32
33
  case "bun.lock": return "bun";
@@ -37,10 +38,10 @@ async function searchPackageJson(dir) {
37
38
  let packageJsonPath;
38
39
  while (true) {
39
40
  if (!dir) return;
40
- const newDir = require_file_path_fns.findFilePath(dir);
41
+ const newDir = (0, _stryke_path_file_path_fns.findFilePath)(dir);
41
42
  if (newDir === dir) return;
42
43
  dir = newDir;
43
- packageJsonPath = require_join_paths.joinPaths(dir, "package.json");
44
+ packageJsonPath = (0, _stryke_path_join_paths.joinPaths)(dir, "package.json");
44
45
  if (await require_exists.exists(packageJsonPath)) break;
45
46
  }
46
47
  return packageJsonPath;
@@ -64,7 +65,7 @@ async function getPackageInfo(name, options = {}) {
64
65
  return {
65
66
  name,
66
67
  version: packageJson.version,
67
- rootPath: require_file_path_fns.findFilePath(packageJsonPath),
68
+ rootPath: (0, _stryke_path_file_path_fns.findFilePath)(packageJsonPath),
68
69
  packageJsonPath,
69
70
  packageJson
70
71
  };
@@ -91,7 +92,7 @@ async function loadPackageJson(cwd = require_get_workspace_root.getWorkspaceRoot
91
92
  * @returns An indicator specifying if the package is listed
92
93
  */
93
94
  async function isPackageListed(name, cwdOrOptions) {
94
- const packageName = require_package.getPackageName(name);
95
+ const packageName = (0, _stryke_string_format_package.getPackageName)(name);
95
96
  const packageJson = await loadPackageJson(require_is_string.isString(cwdOrOptions) ? cwdOrOptions : cwdOrOptions?.cwd);
96
97
  if (!packageJson) return false;
97
98
  return Boolean(packageJson.dependencies && packageName in packageJson.dependencies && packageJson.dependencies[packageName] || packageJson.devDependencies && packageName in packageJson.devDependencies && packageJson.devDependencies[packageName]);
@@ -104,7 +105,7 @@ async function isPackageListed(name, cwdOrOptions) {
104
105
  * @returns The version and type of the package if listed, otherwise undefined
105
106
  */
106
107
  async function getPackageListing(name, cwdOrOptions) {
107
- const packageName = require_package.getPackageName(name);
108
+ const packageName = (0, _stryke_string_format_package.getPackageName)(name);
108
109
  const packageJson = await loadPackageJson(require_is_string.isString(cwdOrOptions) ? cwdOrOptions : cwdOrOptions?.cwd);
109
110
  if (!packageJson) return;
110
111
  const version = packageJson.dependencies && packageName in packageJson.dependencies ? packageJson.dependencies[packageName] : packageJson.devDependencies && packageName in packageJson.devDependencies ? packageJson.devDependencies[packageName] : void 0;
@@ -4,7 +4,6 @@ import { ResolveOptions } from "./resolve.cjs";
4
4
  import { Range } from "semver";
5
5
 
6
6
  //#region src/package-fns.d.ts
7
-
8
7
  /**
9
8
  * Get the package manager used in the project
10
9
  *
@@ -1 +1 @@
1
- {"version":3,"file":"package-fns.d.cts","names":[],"sources":["../src/package-fns.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAwCA;AAwEA;;;AAE8B,iBA1Ed,iBAAA,CA0Ec,GAAA,CAAA,EAAA,MAAA,CAAA,EA1E+B,cA0E/B;;AAwB9B;AAcA;AAOA;AAcA;AAYA;AAkCA;AAYsB,iBAvHA,cAAA,CAuHiB,IAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EArH5B,cAqH4B,CAAA,EArHT,OAqHS,CAAA;EAEb,IAAA,EAAA,MAAA;EACf,OAAA,EAAA,MAAA,GAAA,SAAA;EAAR,QAAA,EAAA,MAAA;EAAO,eAAA,EAAA,MAAA;EAwCY,WAAA,aAAgB;AAwBtC,CAAA,GAAgB,SAAA,CAAA;;;;;;;iBAhKM,eAAA,gBAEnB,QAAQ;UAYM,oBAAA;;;;;;UAOA,qBAAA,SAA8B;;;;qBAI1B;;;;;;;;;iBAUC,eAAA,8BAGnB;;;;;;;;iBASmB,eAAA,yBAEV,uBACT;UA+Bc,uBAAA;;;;;;;;;;;iBAYK,iBAAA,uCAEI,uBACvB,QAAQ;;;;;;;;;iBAwCW,gBAAA,+CAInB;;;;;;;;iBAoBa,eAAA,yBAAuC"}
1
+ {"version":3,"file":"package-fns.d.cts","names":[],"sources":["../src/package-fns.ts"],"mappings":";;;;;;;;AAwCA;;;;iBAAgB,iBAAA,CAAkB,GAAA,YAA2B,cAAA;AAwE7D;;;;;;;AAAA,iBAAsB,cAAA,CACpB,IAAA,UACA,OAAA,GAAS,cAAA,GAAmB,OAAA;;;;;;;;;;;;;iBAwBR,eAAA,CACpB,GAAA,YACC,OAAA,CAAQ,WAAA;AAAA,UAYM,oBAAA;;;;EAIf,GAAA;AAAA;AAAA,UAGe,qBAAA,SAA8B,oBAAA;EAnBzB;AAYtB;;EAWE,OAAA,YAAmB,KAAA;AAAA;;AAJrB;;;;;;iBAcsB,eAAA,CACpB,IAAA,UACA,GAAA,YACC,OAAA;;;AAHH;;;;;iBAYsB,eAAA,CACpB,IAAA,UACA,OAAA,GAAU,oBAAA,GACT,OAAA;AAAA,UA+Bc,uBAAA;EACf,OAAA;EACA,IAAA;AAAA;;;;;;;;iBAUoB,iBAAA,CACpB,IAAA,UACA,YAAA,YAAwB,oBAAA,GACvB,OAAA,CAAQ,uBAAA;;AAfX;;;;;AAYA;;iBA2CsB,gBAAA,CACpB,IAAA,UACA,OAAA,UACA,GAAA,YACC,OAAA;;;;;;;;iBAoBa,eAAA,CAAgB,IAAA,UAAc,OAAA,GAAS,cAAA"}
@@ -4,7 +4,6 @@ import { ResolveOptions } from "./resolve.mjs";
4
4
  import { Range } from "semver";
5
5
 
6
6
  //#region src/package-fns.d.ts
7
-
8
7
  /**
9
8
  * Get the package manager used in the project
10
9
  *
@@ -1 +1 @@
1
- {"version":3,"file":"package-fns.d.mts","names":[],"sources":["../src/package-fns.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAwCA;AAwEA;;;AAE8B,iBA1Ed,iBAAA,CA0Ec,GAAA,CAAA,EAAA,MAAA,CAAA,EA1E+B,cA0E/B;;AAwB9B;AAcA;AAOA;AAcA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AAA;;AAfX;;;;;AAYA;;iBA2CsB,gBAAA,CACpB,IAAA,UACA,OAAA,UACA,GAAA,YACC,OAAA;;;;;;;;iBAoBa,eAAA,CAAgB,IAAA,UAAc,OAAA,GAAS,cAAA"}
@@ -1,13 +1,13 @@
1
- import { joinPaths } from "./path/src/join-paths.mjs";
2
- import { isString } from "./type-checks/src/is-string.mjs";
3
- import { findFileName, findFilePath } from "./path/src/file-path-fns.mjs";
4
1
  import { exists } from "./exists.mjs";
2
+ import { isString } from "./type-checks/src/is-string.mjs";
5
3
  import { getParentPath } from "./get-parent-path.mjs";
6
4
  import { getWorkspaceRoot } from "./get-workspace-root.mjs";
7
5
  import { resolvePackage } from "./resolve.mjs";
8
6
  import { readJsonFile } from "./json.mjs";
9
- import { getPackageName } from "./string-format/src/package.mjs";
10
7
  import { existsSync } from "node:fs";
8
+ import { joinPaths } from "@stryke/path/join-paths";
9
+ import { findFileName, findFilePath } from "@stryke/path/file-path-fns";
10
+ import { getPackageName } from "@stryke/string-format/package";
11
11
  import { subset } from "semver";
12
12
 
13
13
  //#region src/package-fns.ts
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
3
  let node_fs = require("node:fs");
3
4
  let node_fs_promises = require("node:fs/promises");
4
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"read-file.d.cts","names":[],"sources":["../src/read-file.ts"],"sourcesContent":[],"mappings":";;AA0BA;AAaA;AAcA;AAUA;cArCa;;;;;;cAaA,gCAAqC;;;;;;;iBAclC,sBAAA;;;;;;;iBAUM,kBAAA,gBAA+B"}
1
+ {"version":3,"file":"read-file.d.cts","names":[],"sources":["../src/read-file.ts"],"mappings":";;AA0BA;;;;cAAa,YAAA,GAAgB,QAAA;AAa7B;;;;;AAAA,cAAa,QAAA,GAAkB,QAAA,aAAmB,OAAA;;;;;AAwBlD;;iBAVgB,sBAAA,CAAuB,IAAA;;;;;;;iBAUjB,kBAAA,CAAmB,IAAA,WAAY,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"read-file.d.mts","names":[],"sources":["../src/read-file.ts"],"sourcesContent":[],"mappings":";;AA0BA;AAaA;AAcA;AAUA;cArCa;;;;;;cAaA,gCAAqC;;;;;;;iBAclC,sBAAA;;;;;;;iBAUM,kBAAA,gBAA+B"}
1
+ {"version":3,"file":"read-file.d.mts","names":[],"sources":["../src/read-file.ts"],"mappings":";;AA0BA;;;;cAAa,YAAA,GAAgB,QAAA;AAa7B;;;;;AAAA,cAAa,QAAA,GAAkB,QAAA,aAAmB,OAAA;;;;;AAwBlD;;iBAVgB,sBAAA,CAAuB,IAAA;;;;;;;iBAUjB,kBAAA,CAAmB,IAAA,WAAY,OAAA"}
package/dist/registry.cjs CHANGED
@@ -1,7 +1,8 @@
1
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
3
  const require_get_workspace_root = require('./get-workspace-root.cjs');
3
4
  let node_child_process = require("node:child_process");
4
- let __antfu_install_pkg = require("@antfu/install-pkg");
5
+ let _antfu_install_pkg = require("@antfu/install-pkg");
5
6
  let node_util = require("node:util");
6
7
 
7
8
  //#region src/registry.ts
@@ -119,7 +120,7 @@ function getFormattedNodeOptionsWithoutInspect() {
119
120
  * @throws Will throw an error if the package manager cannot be detected or if the registry cannot be retrieved.
120
121
  */
121
122
  async function getRegistry(baseDir) {
122
- const pkgManager = await (0, __antfu_install_pkg.detectPackageManager)(require_get_workspace_root.getWorkspaceRoot(baseDir));
123
+ const pkgManager = await (0, _antfu_install_pkg.detectPackageManager)(require_get_workspace_root.getWorkspaceRoot(baseDir));
123
124
  const resolvedFlags = pkgManager === "npm" ? "--no-workspaces" : "";
124
125
  let registry = `https://registry.npmjs.org/`;
125
126
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.cts","names":[],"sources":["../src/registry.ts"],"sourcesContent":[],"mappings":";UAuBiB,gBAAA;EAAA,IAAA,EAAA,QAAA;EA8DJ,KAAA,EAAA,MAAA;EAmEG,IAAA,EAAA,MAAA;EA+BA,OAAA,EAAA,MAAA;EAoBA,KAAA,EAAA,SAAA;EAcM,WAAA,EAAA,SAAW;;;;;;;;;;cApIpB;;;;;;;;iBAmEG,iBAAA,OACR;;;;;;;iBA8BQ,kCAAA,CAAA;;;;;;;;;iBAoBA,qCAAA,CAAA;;;;;;;;iBAcM,WAAA,oBAA4B"}
1
+ {"version":3,"file":"registry.d.cts","names":[],"sources":["../src/registry.ts"],"mappings":";UAuBiB,gBAAA;EACf,IAAA;EACA,KAAA;EACA,IAAA;EACA,OAAA;EACA,KAAA;EACA,WAAA;AAAA;;;;;;AAwDF;;;cAAa,YAAA,GAAgB,KAAA;;AAmE7B;;;;;AA+BA;iBA/BgB,iBAAA,CACd,IAAA,EAAM,MAAA;;;;AAkDR;;;iBApBgB,kCAAA,CAAA;EAAA,CAAkC,UAAA;AAAA;;;;;;;iBAoBlC,qCAAA,CAAA;;;;;;;;iBAcM,WAAA,CAAY,OAAA,YAAgB,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.mts","names":[],"sources":["../src/registry.ts"],"sourcesContent":[],"mappings":";UAuBiB,gBAAA;EAAA,IAAA,EAAA,QAAA;EA8DJ,KAAA,EAAA,MAAA;EAmEG,IAAA,EAAA,MAAA;EA+BA,OAAA,EAAA,MAAA;EAoBA,KAAA,EAAA,SAAA;EAcM,WAAA,EAAA,SAAW;;;;;;;;;;cApIpB;;;;;;;;iBAmEG,iBAAA,OACR;;;;;;;iBA8BQ,kCAAA,CAAA;;;;;;;;;iBAoBA,qCAAA,CAAA;;;;;;;;iBAcM,WAAA,oBAA4B"}
1
+ {"version":3,"file":"registry.d.mts","names":[],"sources":["../src/registry.ts"],"mappings":";UAuBiB,gBAAA;EACf,IAAA;EACA,KAAA;EACA,IAAA;EACA,OAAA;EACA,KAAA;EACA,WAAA;AAAA;;;;;;AAwDF;;;cAAa,YAAA,GAAgB,KAAA;;AAmE7B;;;;;AA+BA;iBA/BgB,iBAAA,CACd,IAAA,EAAM,MAAA;;;;AAkDR;;;iBApBgB,kCAAA,CAAA;EAAA,CAAkC,UAAA;AAAA;;;;;;;iBAoBlC,qCAAA,CAAA;;;;;;;;iBAcM,WAAA,CAAY,OAAA,YAAgB,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"registry.mjs","names":["orphan: NodeOptionsToken | null | undefined","args: string[]"],"sources":["../src/registry.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { detectPackageManager } from \"@antfu/install-pkg\";\nimport { execSync } from \"node:child_process\";\nimport { parseArgs } from \"node:util\";\nimport { getWorkspaceRoot } from \"./get-workspace-root\";\n\nexport interface NodeOptionsToken {\n kind: \"option\";\n index: number;\n name: string;\n rawName: string;\n value: undefined;\n inlineValue: undefined;\n}\n\nconst parseNodeArgs = (args: string[]) => {\n const { values, tokens } = parseArgs({ args, strict: false, tokens: true });\n\n // For the `NODE_OPTIONS`, we support arguments with values without the `=`\n // sign. We need to parse them manually.\n let orphan: NodeOptionsToken | null | undefined = null;\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i]!;\n\n if (token.kind === \"option-terminator\") {\n break;\n }\n\n // When we encounter an option, if it's value is undefined, we should check\n // to see if the following tokens are positional parameters. If they are,\n // then the option is orphaned, and we can assign it.\n if (token.kind === \"option\") {\n orphan = typeof token.value === \"undefined\" ? token : null;\n continue;\n }\n\n // If the token isn't a positional one, then we can't assign it to the found\n // orphaned option.\n if (token.kind !== \"positional\") {\n orphan = null;\n continue;\n }\n\n // If we don't have an orphan, then we can skip this token.\n if (!orphan) {\n continue;\n }\n\n // If the token is a positional one, and it has a value, so add it to the\n // values object. If it already exists, append it with a space.\n if (orphan.name in values && typeof values[orphan.name] === \"string\") {\n values[orphan.name] += ` ${token.value}`;\n } else {\n values[orphan.name] = token.value;\n }\n }\n\n return values;\n};\n\n/**\n * Tokenizes the arguments string into an array of strings, supporting quoted\n * values and escaped characters.\n * Converted from: https://github.com/nodejs/node/blob/c29d53c5cfc63c5a876084e788d70c9e87bed880/src/node_options.cc#L1401\n *\n * @param input - The arguments string to be tokenized.\n * @returns An array of strings with the tokenized arguments.\n */\nexport const tokenizeArgs = (input: string): string[] => {\n const args: string[] = [];\n let isInString = false;\n let willStartNewArg = true;\n\n for (let i = 0; i < input.length; i++) {\n let char = input[i]!;\n\n // Skip any escaped characters in strings.\n if (char === \"\\\\\" && isInString) {\n // Ensure we don't have an escape character at the end.\n if (input.length === i + 1) {\n throw new Error(\"Invalid escape character at the end.\");\n }\n\n // Skip the next character.\n char = input[++i]!;\n }\n // If we find a space outside of a string, we should start a new argument.\n else if (char === \" \" && !isInString) {\n willStartNewArg = true;\n continue;\n }\n\n // If we find a quote, we should toggle the string flag.\n else if (char === '\"') {\n isInString = !isInString;\n continue;\n }\n\n // If we're starting a new argument, we should add it to the array.\n if (willStartNewArg) {\n args.push(char);\n willStartNewArg = false;\n }\n // Otherwise, add it to the last argument.\n else {\n args[args.length - 1] += char;\n }\n }\n\n if (isInString) {\n throw new Error(\"Unterminated string\");\n }\n\n return args;\n};\n\n/**\n * Get the node options from the environment variable `NODE_OPTIONS` and returns\n * them as an array of strings.\n *\n * @returns An array of strings with the node options.\n */\nconst getNodeOptionsArgs = () => {\n if (!process.env.NODE_OPTIONS) return [];\n\n return tokenizeArgs(process.env.NODE_OPTIONS);\n};\n\n/**\n * Stringify the arguments to be used in a command line. It will ignore any\n * argument that has a value of `undefined`.\n *\n * @param args - The arguments to be stringified.\n * @returns A string with the arguments.\n */\nexport function formatNodeOptions(\n args: Record<string, string | boolean | undefined>\n): string {\n return Object.entries(args)\n .map(([key, value]) => {\n if (value === true) {\n return `--${key}`;\n }\n\n if (value) {\n return `--${key}=${\n // Values with spaces need to be quoted. We use JSON.stringify to\n // also escape any nested quotes.\n value.includes(\" \") && !value.startsWith('\"')\n ? JSON.stringify(value)\n : value\n }`;\n }\n\n return null;\n })\n .filter(arg => arg !== null)\n .join(\" \");\n}\n\n/**\n * Get the node options from the `NODE_OPTIONS` environment variable and parse\n * them into an object without the inspect options.\n *\n * @returns An object with the parsed node options.\n */\nexport function getParsedNodeOptionsWithoutInspect() {\n const args = getNodeOptionsArgs();\n if (args.length === 0) return {};\n\n const parsed = parseNodeArgs(args);\n\n // Remove inspect options.\n delete parsed.inspect;\n delete parsed[\"inspect-brk\"];\n delete parsed.inspect_brk;\n\n return parsed;\n}\n\n/**\n * Get the node options from the `NODE_OPTIONS` environment variable and format\n * them into a string without the inspect options.\n *\n * @returns A string with the formatted node options.\n */\nexport function getFormattedNodeOptionsWithoutInspect() {\n const args = getParsedNodeOptionsWithoutInspect();\n if (Object.keys(args).length === 0) return \"\";\n\n return formatNodeOptions(args);\n}\n\n/**\n * Returns the package registry using the user's package manager. The URL will have a trailing slash.\n *\n * @param baseDir - The base directory to detect the package manager from.\n * @returns The package registry URL with a trailing slash.\n * @throws Will throw an error if the package manager cannot be detected or if the registry cannot be retrieved.\n */\nexport async function getRegistry(baseDir?: string) {\n const workspaceRoot = getWorkspaceRoot(baseDir);\n const pkgManager = await detectPackageManager(workspaceRoot);\n\n // Since `npm config` command fails in npm workspace to prevent workspace config conflicts,\n // add `--no-workspaces` flag to run under the context of the root project only.\n // Safe for non-workspace projects as it's equivalent to default `--workspaces=false`.\n // x-ref: https://github.com/vercel/next.js/issues/47121#issuecomment-1499044345\n // x-ref: https://github.com/npm/statusboard/issues/371#issue-920669998\n const resolvedFlags = pkgManager === \"npm\" ? \"--no-workspaces\" : \"\";\n let registry = `https://registry.npmjs.org/`;\n\n try {\n const output = execSync(\n `${pkgManager} config get registry ${resolvedFlags}`,\n {\n env: {\n ...process.env,\n NODE_OPTIONS: getFormattedNodeOptionsWithoutInspect()\n }\n }\n )\n .toString()\n .trim();\n\n if (output.startsWith(\"http\")) {\n registry = output.endsWith(\"/\") ? output : `${output}/`;\n }\n } catch (err) {\n throw new Error(`Failed to get registry from \"${pkgManager}\".`, {\n cause: err\n });\n }\n\n return registry;\n}\n"],"mappings":";;;;;;AAgCA,MAAM,iBAAiB,SAAmB;CACxC,MAAM,EAAE,QAAQ,WAAW,UAAU;EAAE;EAAM,QAAQ;EAAO,QAAQ;EAAM,CAAC;CAI3E,IAAIA,SAA8C;AAClD,MAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;EACtC,MAAM,QAAQ,OAAO;AAErB,MAAI,MAAM,SAAS,oBACjB;AAMF,MAAI,MAAM,SAAS,UAAU;AAC3B,YAAS,OAAO,MAAM,UAAU,cAAc,QAAQ;AACtD;;AAKF,MAAI,MAAM,SAAS,cAAc;AAC/B,YAAS;AACT;;AAIF,MAAI,CAAC,OACH;AAKF,MAAI,OAAO,QAAQ,UAAU,OAAO,OAAO,OAAO,UAAU,SAC1D,QAAO,OAAO,SAAS,IAAI,MAAM;MAEjC,QAAO,OAAO,QAAQ,MAAM;;AAIhC,QAAO;;;;;;;;;;AAWT,MAAa,gBAAgB,UAA4B;CACvD,MAAMC,OAAiB,EAAE;CACzB,IAAI,aAAa;CACjB,IAAI,kBAAkB;AAEtB,MAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,IAAI,OAAO,MAAM;AAGjB,MAAI,SAAS,QAAQ,YAAY;AAE/B,OAAI,MAAM,WAAW,IAAI,EAC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,SAAS,SACb,GAAG,WAAW,uBAAuB,iBACrC,EACE,KAAK;GACH,GAAG,QAAQ;GACX,cAAc,uCAAuC;GACtD,EACF,CACF,CACE,UAAU,CACV,MAAM;AAET,MAAI,OAAO,WAAW,OAAO,CAC3B,YAAW,OAAO,SAAS,IAAI,GAAG,SAAS,GAAG,OAAO;UAEhD,KAAK;AACZ,QAAM,IAAI,MAAM,gCAAgC,WAAW,KAAK,EAC9D,OAAO,KACR,CAAC;;AAGJ,QAAO"}
1
+ {"version":3,"file":"registry.mjs","names":[],"sources":["../src/registry.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Stryke\n\n This code was released as part of the Stryke project. Stryke\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/stryke.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/stryke\n Documentation: https://docs.stormsoftware.com/projects/stryke\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { detectPackageManager } from \"@antfu/install-pkg\";\nimport { execSync } from \"node:child_process\";\nimport { parseArgs } from \"node:util\";\nimport { getWorkspaceRoot } from \"./get-workspace-root\";\n\nexport interface NodeOptionsToken {\n kind: \"option\";\n index: number;\n name: string;\n rawName: string;\n value: undefined;\n inlineValue: undefined;\n}\n\nconst parseNodeArgs = (args: string[]) => {\n const { values, tokens } = parseArgs({ args, strict: false, tokens: true });\n\n // For the `NODE_OPTIONS`, we support arguments with values without the `=`\n // sign. We need to parse them manually.\n let orphan: NodeOptionsToken | null | undefined = null;\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i]!;\n\n if (token.kind === \"option-terminator\") {\n break;\n }\n\n // When we encounter an option, if it's value is undefined, we should check\n // to see if the following tokens are positional parameters. If they are,\n // then the option is orphaned, and we can assign it.\n if (token.kind === \"option\") {\n orphan = typeof token.value === \"undefined\" ? token : null;\n continue;\n }\n\n // If the token isn't a positional one, then we can't assign it to the found\n // orphaned option.\n if (token.kind !== \"positional\") {\n orphan = null;\n continue;\n }\n\n // If we don't have an orphan, then we can skip this token.\n if (!orphan) {\n continue;\n }\n\n // If the token is a positional one, and it has a value, so add it to the\n // values object. If it already exists, append it with a space.\n if (orphan.name in values && typeof values[orphan.name] === \"string\") {\n values[orphan.name] += ` ${token.value}`;\n } else {\n values[orphan.name] = token.value;\n }\n }\n\n return values;\n};\n\n/**\n * Tokenizes the arguments string into an array of strings, supporting quoted\n * values and escaped characters.\n * Converted from: https://github.com/nodejs/node/blob/c29d53c5cfc63c5a876084e788d70c9e87bed880/src/node_options.cc#L1401\n *\n * @param input - The arguments string to be tokenized.\n * @returns An array of strings with the tokenized arguments.\n */\nexport const tokenizeArgs = (input: string): string[] => {\n const args: string[] = [];\n let isInString = false;\n let willStartNewArg = true;\n\n for (let i = 0; i < input.length; i++) {\n let char = input[i]!;\n\n // Skip any escaped characters in strings.\n if (char === \"\\\\\" && isInString) {\n // Ensure we don't have an escape character at the end.\n if (input.length === i + 1) {\n throw new Error(\"Invalid escape character at the end.\");\n }\n\n // Skip the next character.\n char = input[++i]!;\n }\n // If we find a space outside of a string, we should start a new argument.\n else if (char === \" \" && !isInString) {\n willStartNewArg = true;\n continue;\n }\n\n // If we find a quote, we should toggle the string flag.\n else if (char === '\"') {\n isInString = !isInString;\n continue;\n }\n\n // If we're starting a new argument, we should add it to the array.\n if (willStartNewArg) {\n args.push(char);\n willStartNewArg = false;\n }\n // Otherwise, add it to the last argument.\n else {\n args[args.length - 1] += char;\n }\n }\n\n if (isInString) {\n throw new Error(\"Unterminated string\");\n }\n\n return args;\n};\n\n/**\n * Get the node options from the environment variable `NODE_OPTIONS` and returns\n * them as an array of strings.\n *\n * @returns An array of strings with the node options.\n */\nconst getNodeOptionsArgs = () => {\n if (!process.env.NODE_OPTIONS) return [];\n\n return tokenizeArgs(process.env.NODE_OPTIONS);\n};\n\n/**\n * Stringify the arguments to be used in a command line. It will ignore any\n * argument that has a value of `undefined`.\n *\n * @param args - The arguments to be stringified.\n * @returns A string with the arguments.\n */\nexport function formatNodeOptions(\n args: Record<string, string | boolean | undefined>\n): string {\n return Object.entries(args)\n .map(([key, value]) => {\n if (value === true) {\n return `--${key}`;\n }\n\n if (value) {\n return `--${key}=${\n // Values with spaces need to be quoted. We use JSON.stringify to\n // also escape any nested quotes.\n value.includes(\" \") && !value.startsWith('\"')\n ? JSON.stringify(value)\n : value\n }`;\n }\n\n return null;\n })\n .filter(arg => arg !== null)\n .join(\" \");\n}\n\n/**\n * Get the node options from the `NODE_OPTIONS` environment variable and parse\n * them into an object without the inspect options.\n *\n * @returns An object with the parsed node options.\n */\nexport function getParsedNodeOptionsWithoutInspect() {\n const args = getNodeOptionsArgs();\n if (args.length === 0) return {};\n\n const parsed = parseNodeArgs(args);\n\n // Remove inspect options.\n delete parsed.inspect;\n delete parsed[\"inspect-brk\"];\n delete parsed.inspect_brk;\n\n return parsed;\n}\n\n/**\n * Get the node options from the `NODE_OPTIONS` environment variable and format\n * them into a string without the inspect options.\n *\n * @returns A string with the formatted node options.\n */\nexport function getFormattedNodeOptionsWithoutInspect() {\n const args = getParsedNodeOptionsWithoutInspect();\n if (Object.keys(args).length === 0) return \"\";\n\n return formatNodeOptions(args);\n}\n\n/**\n * Returns the package registry using the user's package manager. The URL will have a trailing slash.\n *\n * @param baseDir - The base directory to detect the package manager from.\n * @returns The package registry URL with a trailing slash.\n * @throws Will throw an error if the package manager cannot be detected or if the registry cannot be retrieved.\n */\nexport async function getRegistry(baseDir?: string) {\n const workspaceRoot = getWorkspaceRoot(baseDir);\n const pkgManager = await detectPackageManager(workspaceRoot);\n\n // Since `npm config` command fails in npm workspace to prevent workspace config conflicts,\n // add `--no-workspaces` flag to run under the context of the root project only.\n // Safe for non-workspace projects as it's equivalent to default `--workspaces=false`.\n // x-ref: https://github.com/vercel/next.js/issues/47121#issuecomment-1499044345\n // x-ref: https://github.com/npm/statusboard/issues/371#issue-920669998\n const resolvedFlags = pkgManager === \"npm\" ? \"--no-workspaces\" : \"\";\n let registry = `https://registry.npmjs.org/`;\n\n try {\n const output = execSync(\n `${pkgManager} config get registry ${resolvedFlags}`,\n {\n env: {\n ...process.env,\n NODE_OPTIONS: getFormattedNodeOptionsWithoutInspect()\n }\n }\n )\n .toString()\n .trim();\n\n if (output.startsWith(\"http\")) {\n registry = output.endsWith(\"/\") ? output : `${output}/`;\n }\n } catch (err) {\n throw new Error(`Failed to get registry from \"${pkgManager}\".`, {\n cause: err\n });\n }\n\n return registry;\n}\n"],"mappings":";;;;;;AAgCA,MAAM,iBAAiB,SAAmB;CACxC,MAAM,EAAE,QAAQ,WAAW,UAAU;EAAE;EAAM,QAAQ;EAAO,QAAQ;EAAM,CAAC;CAI3E,IAAI,SAA8C;AAClD,MAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;EACtC,MAAM,QAAQ,OAAO;AAErB,MAAI,MAAM,SAAS,oBACjB;AAMF,MAAI,MAAM,SAAS,UAAU;AAC3B,YAAS,OAAO,MAAM,UAAU,cAAc,QAAQ;AACtD;;AAKF,MAAI,MAAM,SAAS,cAAc;AAC/B,YAAS;AACT;;AAIF,MAAI,CAAC,OACH;AAKF,MAAI,OAAO,QAAQ,UAAU,OAAO,OAAO,OAAO,UAAU,SAC1D,QAAO,OAAO,SAAS,IAAI,MAAM;MAEjC,QAAO,OAAO,QAAQ,MAAM;;AAIhC,QAAO;;;;;;;;;;AAWT,MAAa,gBAAgB,UAA4B;CACvD,MAAM,OAAiB,EAAE;CACzB,IAAI,aAAa;CACjB,IAAI,kBAAkB;AAEtB,MAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,IAAI,OAAO,MAAM;AAGjB,MAAI,SAAS,QAAQ,YAAY;AAE/B,OAAI,MAAM,WAAW,IAAI,EACvB,OAAM,IAAI,MAAM,uCAAuC;AAIzD,UAAO,MAAM,EAAE;aAGR,SAAS,O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GACX,cAAc,uCAAuC;GACtD,EACF,CACF,CACE,UAAU,CACV,MAAM;AAET,MAAI,OAAO,WAAW,OAAO,CAC3B,YAAW,OAAO,SAAS,IAAI,GAAG,SAAS,GAAG,OAAO;UAEhD,KAAK;AACZ,QAAM,IAAI,MAAM,gCAAgC,WAAW,KAAK,EAC9D,OAAO,KACR,CAAC;;AAGJ,QAAO"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
3
  let node_fs = require("node:fs");
3
4
  let node_fs_promises = require("node:fs/promises");
4
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"remove-file.d.cts","names":[],"sources":["../src/remove-file.ts"],"sourcesContent":[],"mappings":";;AA0BA;AAaA;;;cAba;;;;;;cAaA,kCAAuC"}
1
+ {"version":3,"file":"remove-file.d.cts","names":[],"sources":["../src/remove-file.ts"],"mappings":";;AA0BA;;;;cAAa,cAAA,GAAkB,QAAA;AAa/B;;;;;AAAA,cAAa,UAAA,GAAoB,QAAA,aAAmB,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"remove-file.d.mts","names":[],"sources":["../src/remove-file.ts"],"sourcesContent":[],"mappings":";;AA0BA;AAaA;;;cAba;;;;;;cAaA,kCAAuC"}
1
+ {"version":3,"file":"remove-file.d.mts","names":[],"sources":["../src/remove-file.ts"],"mappings":";;AA0BA;;;;cAAa,cAAA,GAAkB,QAAA;AAa/B;;;;;AAAA,cAAa,UAAA,GAAoB,QAAA,aAAmB,OAAA"}