@shopify/cli 3.61.2 → 3.62.0

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 (197) hide show
  1. package/dist/assets/dev-console/extensions/dev-console/assets/index-dfaab2a5.css +1 -0
  2. package/dist/assets/dev-console/extensions/dev-console/assets/{index-f3e60690.js → index-e3682a83.js} +1 -1
  3. package/dist/assets/dev-console/index.html +2 -2
  4. package/dist/{chokidar-RFZXZKRQ.js → chokidar-5MKSECYV.js} +4 -3
  5. package/dist/{chunk-QDZF6IG4.js → chunk-22PYIFA2.js} +112 -17
  6. package/dist/{chunk-3MBQVTEX.js → chunk-2QVJZ5TG.js} +2 -1
  7. package/dist/{chunk-KBXWK6XB.js → chunk-2ZSNH7CD.js} +4 -5
  8. package/dist/{chunk-BYFLATOA.js → chunk-5FNE3T7E.js} +5 -4
  9. package/dist/{chunk-G4EQLT5B.js → chunk-5X4QXYEZ.js} +9 -7
  10. package/dist/chunk-66NABVCG.js +73 -0
  11. package/dist/{chunk-LAY4AEXX.js → chunk-6UDFXWNE.js} +2 -1
  12. package/dist/{chunk-QQP6JS5H.js → chunk-7MXLRMOY.js} +3 -2
  13. package/dist/{chunk-EHF6FVWH.js → chunk-A5STII7T.js} +3 -2
  14. package/dist/{chunk-UPM6XNBH.js → chunk-ADESJ2KG.js} +6 -5
  15. package/dist/{chunk-BZJX2NV6.js → chunk-AMAYT2P2.js} +3 -2
  16. package/dist/{chunk-QTBH3GO6.js → chunk-B62HZLMM.js} +3 -2
  17. package/dist/{chunk-3RM5SOXY.js → chunk-BMTG2VHL.js} +4 -3
  18. package/dist/{chunk-FWGRGI4R.js → chunk-BYC3NA2Y.js} +2 -1
  19. package/dist/{chunk-NJTSDTDU.js → chunk-BZFXXFUC.js} +6 -5
  20. package/dist/{chunk-7IZTLXJ5.js → chunk-CKFE55FX.js} +4 -3
  21. package/dist/{chunk-YP5UVIUW.js → chunk-CYQRKZVM.js} +6 -5
  22. package/dist/{chunk-HTYJDJRZ.js → chunk-DL3MKXVR.js} +2 -1
  23. package/dist/{chunk-IUHH3PST.js → chunk-DLK3F3DC.js} +2 -1
  24. package/dist/{chunk-4XNS74OG.js → chunk-EARPFFS7.js} +2 -1
  25. package/dist/chunk-EQPYUHNM.js +3642 -0
  26. package/dist/{chunk-LKGDG6WW.js → chunk-FMKVOTQK.js} +2 -1
  27. package/dist/{chunk-I434ZJQI.js → chunk-GEN4RXTD.js} +7 -6
  28. package/dist/{chunk-QSO3GQEK.js → chunk-HJ4AUFE7.js} +94 -160
  29. package/dist/{chunk-FQIRJADJ.js → chunk-JIJ65JT6.js} +2 -1
  30. package/dist/{chunk-JQPQJN44.js → chunk-JKYNFUD3.js} +11 -12
  31. package/dist/{chunk-4L37JOS5.js → chunk-JL3ESOD2.js} +3 -2
  32. package/dist/{chunk-4TTAP7NN.js → chunk-JOOYCYFU.js} +6 -5
  33. package/dist/{chunk-XMJDBJPP.js → chunk-K3GG6Y3J.js} +12 -12
  34. package/dist/{chunk-VQZ2SHRY.js → chunk-K6257PKA.js} +3 -2
  35. package/dist/{chunk-5KRK4DLX.js → chunk-LC6MEJT3.js} +4 -3
  36. package/dist/{chunk-KDOLMUJB.js → chunk-LH533WG4.js} +2 -1
  37. package/dist/{chunk-FBB6KUZG.js → chunk-LSCXQWNO.js} +2 -1
  38. package/dist/{chunk-VC6CC75R.js → chunk-MG6QFKFM.js} +5 -4
  39. package/dist/{chunk-ETSILRIY.js → chunk-MQ2RGCDU.js} +5 -4
  40. package/dist/{chunk-QOHDW3X5.js → chunk-MQGV3PCJ.js} +4 -3
  41. package/dist/{chunk-PBFWVFAQ.js → chunk-NABCTJNW.js} +3 -2
  42. package/dist/{chunk-YZGLFVKK.js → chunk-NNASIYCT.js} +3 -2
  43. package/dist/chunk-PIB2FEJJ.js +4385 -0
  44. package/dist/{chunk-TXXQWILO.js → chunk-PIVNWN2P.js} +4 -3
  45. package/dist/{chunk-Q3KADKQA.js → chunk-PO6SEYU4.js} +4 -3
  46. package/dist/{chunk-FAFQQMD4.js → chunk-PRJ3U7MR.js} +2 -1
  47. package/dist/{chunk-5B2D56W6.js → chunk-Q4XGXPUG.js} +2 -1
  48. package/dist/{chunk-ZE2ZPLYI.js → chunk-QGJLRFY4.js} +19 -89
  49. package/dist/{chunk-RP2ISWQN.js → chunk-QOUOFEGO.js} +3 -2
  50. package/dist/{chunk-CWYZA7C7.js → chunk-RUSG4O2Z.js} +13464 -5175
  51. package/dist/{chunk-CKKROMZF.js → chunk-S4VBXFXP.js} +3 -2
  52. package/dist/{chunk-BE73NZXB.js → chunk-SAR5HGRG.js} +2 -1
  53. package/dist/{chunk-GXPKATXW.js → chunk-T5LLJYYS.js} +2 -1
  54. package/dist/{chunk-NBIE3DNN.js → chunk-TCRWMUKX.js} +4 -3
  55. package/dist/{chunk-4757GPBG.js → chunk-UACSLX64.js} +6 -5
  56. package/dist/{chunk-4KKFUTH7.js → chunk-UJ3QKFA5.js} +2 -1
  57. package/dist/chunk-UNPXLODI.js +121 -0
  58. package/dist/{chunk-RQ24VTW4.js → chunk-VM4POVNV.js} +2 -1
  59. package/dist/{chunk-CTETXMMM.js → chunk-VS6RWOLM.js} +8 -7
  60. package/dist/{chunk-BUWM6JUU.js → chunk-W5VEUSWG.js} +5 -4
  61. package/dist/{chunk-PCQFWMMD.js → chunk-WADS2TV5.js} +63 -5
  62. package/dist/{chunk-M73YMW2C.js → chunk-WAEWSGBK.js} +2579 -1632
  63. package/dist/{chunk-6SL33DOA.js → chunk-XQFDS44U.js} +2 -1
  64. package/dist/{chunk-WCNR75S2.js → chunk-YC4FLMDD.js} +2 -1
  65. package/dist/{chunk-OXZ2SRCK.js → chunk-YECNACSF.js} +3 -2
  66. package/dist/{chunk-QLLSCNEC.js → chunk-YX5VXHSJ.js} +4 -3
  67. package/dist/{chunk-5MODHNUE.js → chunk-ZCMXEGSE.js} +5 -4
  68. package/dist/{chunk-4VEOJ5JD.js → chunk-ZEHQN47F.js} +2 -1
  69. package/dist/{chunk-3JLUTHGR.js → chunk-ZPFJOUKZ.js} +2 -1
  70. package/dist/{chunk-M63RTPGR.js → chunk-ZPL24Y2D.js} +1 -0
  71. package/dist/cli/commands/auth/logout.js +37 -39
  72. package/dist/cli/commands/auth/logout.test.js +39 -41
  73. package/dist/cli/commands/debug/command-flags.js +33 -35
  74. package/dist/cli/commands/demo/catalog.js +36 -38
  75. package/dist/cli/commands/demo/generate-file.js +37 -39
  76. package/dist/cli/commands/demo/index.js +35 -37
  77. package/dist/cli/commands/demo/print-ai-prompt.js +37 -39
  78. package/dist/cli/commands/docs/generate.js +33 -35
  79. package/dist/cli/commands/docs/generate.test.js +34 -36
  80. package/dist/cli/commands/help.js +33 -35
  81. package/dist/cli/commands/kitchen-sink/async.js +34 -36
  82. package/dist/cli/commands/kitchen-sink/async.test.js +35 -37
  83. package/dist/cli/commands/kitchen-sink/index.js +36 -38
  84. package/dist/cli/commands/kitchen-sink/index.test.js +37 -39
  85. package/dist/cli/commands/kitchen-sink/prompts.js +34 -36
  86. package/dist/cli/commands/kitchen-sink/prompts.test.js +35 -37
  87. package/dist/cli/commands/kitchen-sink/static.js +34 -36
  88. package/dist/cli/commands/kitchen-sink/static.test.js +35 -37
  89. package/dist/cli/commands/search.js +34 -36
  90. package/dist/cli/commands/upgrade.js +33 -35
  91. package/dist/cli/commands/upgrade.test.js +5 -4
  92. package/dist/cli/commands/version.js +34 -36
  93. package/dist/cli/commands/version.test.js +35 -37
  94. package/dist/cli/services/commands/search.js +19 -21
  95. package/dist/cli/services/commands/search.test.js +20 -22
  96. package/dist/cli/services/commands/version.js +23 -25
  97. package/dist/cli/services/commands/version.test.js +25 -27
  98. package/dist/cli/services/demo.js +21 -23
  99. package/dist/cli/services/demo.test.js +22 -24
  100. package/dist/cli/services/kitchen-sink/async.js +19 -21
  101. package/dist/cli/services/kitchen-sink/prompts.js +19 -21
  102. package/dist/cli/services/kitchen-sink/static.js +19 -21
  103. package/dist/cli/services/upgrade.js +22 -24
  104. package/dist/cli/services/upgrade.test.js +30 -27
  105. package/dist/{constants-XCWOF7M7.js → constants-3CLHB4LQ.js} +5 -6
  106. package/dist/{custom-oclif-loader-4SQGUQ7D-P5C4NLSX.js → custom-oclif-loader-ZH42ZTTC.js} +25 -28
  107. package/dist/{del-DGT5RCOW.js → del-KSMMBLCD.js} +9 -8
  108. package/dist/{devtools-SJTLOVKU.js → devtools-6ZZ3EAY7.js} +3 -2
  109. package/dist/error-handler-I6WJC3U2.js +43 -0
  110. package/dist/error-handler-JFX2TIYX.js +38 -0
  111. package/dist/hooks/postrun.js +28 -30
  112. package/dist/hooks/prerun.js +23 -25
  113. package/dist/{http-proxy-WYSSUHIT.js → http-proxy-KFHAZRTT.js} +3 -2
  114. package/dist/index.js +138858 -143506
  115. package/dist/lib-E7NFRKVR.js +14 -0
  116. package/dist/{lib-RZNRJEWB.js → lib-LY6ZCPIO.js} +2 -1
  117. package/dist/{lib-AAMRQUES.js → lib-MUDJYT6A.js} +4 -3
  118. package/dist/{local-YKOG4EUR-XRRBWLSI.js → local-QXPV4RF5.js} +18 -14
  119. package/dist/{magic-string.es-6DE547FE.js → magic-string.es-ATGURXGQ.js} +2 -1
  120. package/dist/{morph-DCIZUK2Q.js → morph-WKKSW22O.js} +6 -5
  121. package/dist/{multipart-parser-ENLY4BKU.js → multipart-parser-KYOHF24X.js} +3 -2
  122. package/dist/{node-3DKQAOFU.js → node-5XXX7TNJ.js} +30 -29
  123. package/dist/{node-package-manager-HYTHPJBI.js → node-package-manager-O65VOP6W.js} +23 -23
  124. package/dist/{npa-AYOTDW63.js → npa-L2ZRSPZ2.js} +4 -3
  125. package/dist/{open-B7XFJJCK.js → open-JRS7RW22.js} +3 -2
  126. package/dist/out-AS7GH6TC.js +7 -0
  127. package/dist/{path-2NNC3QGW.js → path-JVVXOELJ.js} +10 -6
  128. package/dist/{source-map-V6UVDDPX.js → source-map-37TX6JEW.js} +2 -1
  129. package/dist/system-EEQBTJMJ.js +31 -0
  130. package/dist/tsconfig.tsbuildinfo +1 -1
  131. package/dist/{ui-5LSDG3C5.js → ui-3BAHGNCQ.js} +20 -20
  132. package/dist/{workerd-TFH7T6NI.js → workerd-WR22YQIS.js} +29 -28
  133. package/oclif.manifest.json +108 -93
  134. package/package.json +15 -5
  135. package/dist/assets/dev-console/extensions/dev-console/assets/index-792a0c8d.css +0 -1
  136. package/dist/chunk-3LWRRBH5.js +0 -75
  137. package/dist/chunk-3PIGYQSE.js +0 -36
  138. package/dist/chunk-CK7MF3LY.js +0 -28803
  139. package/dist/chunk-J4I3URIN.js +0 -893
  140. package/dist/chunk-MHMFNQE3.js +0 -76
  141. package/dist/chunk-MXHK26B3.js +0 -89
  142. package/dist/chunk-NJP5GFNN.js +0 -29224
  143. package/dist/chunk-OC4AY5G7.js +0 -11936
  144. package/dist/chunk-OQBI57X3.js +0 -22
  145. package/dist/chunk-RPRKZ6JC.js +0 -53861
  146. package/dist/chunk-RTZHOWFC.js +0 -5485
  147. package/dist/chunk-SZQX5J7X.js +0 -64
  148. package/dist/chunk-T77LT3XG.js +0 -4743
  149. package/dist/chunk-UV4APOMB.js +0 -273
  150. package/dist/chunk-VF4VWJWS.js +0 -213222
  151. package/dist/chunk-WZBNLCJ5.js +0 -13452
  152. package/dist/chunk-YWPV7MV2.js +0 -16432
  153. package/dist/chunk-ZLGRKPW3.js +0 -68
  154. package/dist/chunk-ZZGXXS5X.js +0 -819
  155. package/dist/cli/commands/auth/logout.js.map +0 -1
  156. package/dist/cli/commands/debug/command-flags.js.map +0 -1
  157. package/dist/cli/commands/demo/catalog.js.map +0 -1
  158. package/dist/cli/commands/demo/generate-file.js.map +0 -1
  159. package/dist/cli/commands/demo/index.js.map +0 -1
  160. package/dist/cli/commands/demo/print-ai-prompt.js.map +0 -1
  161. package/dist/cli/commands/docs/generate.js.map +0 -1
  162. package/dist/cli/commands/help.js.map +0 -1
  163. package/dist/cli/commands/kitchen-sink/async.js.map +0 -1
  164. package/dist/cli/commands/kitchen-sink/index.js.map +0 -1
  165. package/dist/cli/commands/kitchen-sink/prompts.js.map +0 -1
  166. package/dist/cli/commands/kitchen-sink/static.js.map +0 -1
  167. package/dist/cli/commands/search.js.map +0 -1
  168. package/dist/cli/commands/upgrade.js.map +0 -1
  169. package/dist/cli/commands/version.js.map +0 -1
  170. package/dist/cli/services/commands/search.js.map +0 -1
  171. package/dist/cli/services/commands/version.js.map +0 -1
  172. package/dist/cli/services/demo.js.map +0 -1
  173. package/dist/cli/services/kitchen-sink/async.js.map +0 -1
  174. package/dist/cli/services/kitchen-sink/prompts.js.map +0 -1
  175. package/dist/cli/services/kitchen-sink/static.js.map +0 -1
  176. package/dist/cli/services/upgrade.js.map +0 -1
  177. package/dist/custom-oclif-loader-OD47SFAU.js +0 -92
  178. package/dist/del-ICEHOC6W-GYLFYUKX.js +0 -2817
  179. package/dist/devtools-6HZ2IPFU-GLFJP63E.js +0 -3557
  180. package/dist/devtools-IHJDLLT4.js +0 -77
  181. package/dist/error-handler-EPMFPTYX.js +0 -37
  182. package/dist/error-handler-WI4YVJIS-U3BMMYNJ.js +0 -31
  183. package/dist/error-handler-WL3Q25NI.js +0 -45
  184. package/dist/hooks/postrun.js.map +0 -1
  185. package/dist/hooks/prerun.js.map +0 -1
  186. package/dist/index.js.map +0 -1
  187. package/dist/lib-76RCE6WZ-5IYGTKKK.js +0 -17
  188. package/dist/lib-UYK3ZLZK.js +0 -13
  189. package/dist/local-KISH2IRF.js +0 -67
  190. package/dist/multipart-parser-ENLY4BKU-IUS26CJU.js +0 -363
  191. package/dist/node-package-manager-S7TSAUJZ-KKDY6KSF.js +0 -70
  192. package/dist/open-B7XFJJCK-4XEFFVL7.js +0 -295
  193. package/dist/out-LRIJ35RZ.js +0 -6
  194. package/dist/out-M5MRQZP5-YHIOILKU.js +0 -14
  195. package/dist/path-HO4HBKK5-4Q2BBYUA.js +0 -33
  196. package/dist/system-LIP7AECY.js +0 -33
  197. package/dist/ui-FUZYK6S3-PVVDPVD5.js +0 -51
@@ -1,273 +0,0 @@
1
- import {
2
- __commonJS,
3
- __require,
4
- __toESM,
5
- init_cjs_shims as init_cjs_shims2
6
- } from "./chunk-ZLGRKPW3.js";
7
- import {
8
- init_cjs_shims
9
- } from "./chunk-M63RTPGR.js";
10
-
11
- // ../create-app/dist/chunk-GXPKATXW.js
12
- init_cjs_shims();
13
- init_cjs_shims2();
14
- function normalizeWindowsPath(input = "") {
15
- if (!input || !input.includes("\\")) {
16
- return input;
17
- }
18
- return input.replace(/\\/g, "/");
19
- }
20
- var _UNC_REGEX = /^[/\\]{2}/;
21
- var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
22
- var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
23
- var normalize = function(path2) {
24
- if (path2.length === 0) {
25
- return ".";
26
- }
27
- path2 = normalizeWindowsPath(path2);
28
- const isUNCPath = path2.match(_UNC_REGEX);
29
- const isPathAbsolute = isAbsolute(path2);
30
- const trailingSeparator = path2[path2.length - 1] === "/";
31
- path2 = normalizeString(path2, !isPathAbsolute);
32
- if (path2.length === 0) {
33
- if (isPathAbsolute) {
34
- return "/";
35
- }
36
- return trailingSeparator ? "./" : ".";
37
- }
38
- if (trailingSeparator) {
39
- path2 += "/";
40
- }
41
- if (_DRIVE_LETTER_RE.test(path2)) {
42
- path2 += "/";
43
- }
44
- if (isUNCPath) {
45
- if (!isPathAbsolute) {
46
- return `//./${path2}`;
47
- }
48
- return `//${path2}`;
49
- }
50
- return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
51
- };
52
- var join = function(...arguments_) {
53
- if (arguments_.length === 0) {
54
- return ".";
55
- }
56
- let joined;
57
- for (const argument of arguments_) {
58
- if (argument && argument.length > 0) {
59
- if (joined === void 0) {
60
- joined = argument;
61
- } else {
62
- joined += `/${argument}`;
63
- }
64
- }
65
- }
66
- if (joined === void 0) {
67
- return ".";
68
- }
69
- return normalize(joined.replace(/\/\/+/g, "/"));
70
- };
71
- function cwd() {
72
- if (typeof process !== "undefined") {
73
- return process.cwd().replace(/\\/g, "/");
74
- }
75
- return "/";
76
- }
77
- var resolve = function(...arguments_) {
78
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
79
- let resolvedPath = "";
80
- let resolvedAbsolute = false;
81
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
82
- const path2 = index >= 0 ? arguments_[index] : cwd();
83
- if (!path2 || path2.length === 0) {
84
- continue;
85
- }
86
- resolvedPath = `${path2}/${resolvedPath}`;
87
- resolvedAbsolute = isAbsolute(path2);
88
- }
89
- resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
90
- if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
91
- return `/${resolvedPath}`;
92
- }
93
- return resolvedPath.length > 0 ? resolvedPath : ".";
94
- };
95
- function normalizeString(path2, allowAboveRoot) {
96
- let res = "";
97
- let lastSegmentLength = 0;
98
- let lastSlash = -1;
99
- let dots = 0;
100
- let char = null;
101
- for (let index = 0; index <= path2.length; ++index) {
102
- if (index < path2.length) {
103
- char = path2[index];
104
- } else if (char === "/") {
105
- break;
106
- } else {
107
- char = "/";
108
- }
109
- if (char === "/") {
110
- if (lastSlash === index - 1 || dots === 1)
111
- ;
112
- else if (dots === 2) {
113
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
114
- if (res.length > 2) {
115
- const lastSlashIndex = res.lastIndexOf("/");
116
- if (lastSlashIndex === -1) {
117
- res = "";
118
- lastSegmentLength = 0;
119
- } else {
120
- res = res.slice(0, lastSlashIndex);
121
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
122
- }
123
- lastSlash = index;
124
- dots = 0;
125
- continue;
126
- } else if (res.length > 0) {
127
- res = "";
128
- lastSegmentLength = 0;
129
- lastSlash = index;
130
- dots = 0;
131
- continue;
132
- }
133
- }
134
- if (allowAboveRoot) {
135
- res += res.length > 0 ? "/.." : "..";
136
- lastSegmentLength = 2;
137
- }
138
- } else {
139
- if (res.length > 0) {
140
- res += `/${path2.slice(lastSlash + 1, index)}`;
141
- } else {
142
- res = path2.slice(lastSlash + 1, index);
143
- }
144
- lastSegmentLength = index - lastSlash - 1;
145
- }
146
- lastSlash = index;
147
- dots = 0;
148
- } else if (char === "." && dots !== -1) {
149
- ++dots;
150
- } else {
151
- dots = -1;
152
- }
153
- }
154
- return res;
155
- }
156
- var isAbsolute = function(p) {
157
- return _IS_ABSOLUTE_RE.test(p);
158
- };
159
- var _EXTNAME_RE = /.(\.[^./]+)$/;
160
- var extname = function(p) {
161
- const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
162
- return match && match[1] || "";
163
- };
164
- var relative = function(from, to) {
165
- const _from = resolve(from).split("/");
166
- const _to = resolve(to).split("/");
167
- const _fromCopy = [..._from];
168
- for (const segment of _fromCopy) {
169
- if (_to[0] !== segment) {
170
- break;
171
- }
172
- _from.shift();
173
- _to.shift();
174
- }
175
- return [..._from.map(() => ".."), ..._to].join("/");
176
- };
177
- var dirname = function(p) {
178
- const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
179
- if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
180
- segments[0] += "/";
181
- }
182
- return segments.join("/") || (isAbsolute(p) ? "/" : ".");
183
- };
184
- var basename = function(p, extension) {
185
- const lastSegment = normalizeWindowsPath(p).split("/").pop();
186
- return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
187
- };
188
- init_cjs_shims2();
189
-
190
- // ../create-app/dist/chunk-G6FN5VUE.js
191
- init_cjs_shims();
192
- import { fileURLToPath } from "url";
193
- var require_commondir = __commonJS({
194
- "../../node_modules/.pnpm/commondir@1.0.1/node_modules/commondir/index.js"(exports, module) {
195
- init_cjs_shims2();
196
- var path = __require("path");
197
- module.exports = function(basedir, relfiles) {
198
- if (relfiles) {
199
- var files = relfiles.map(function(r) {
200
- return path.resolve(basedir, r);
201
- });
202
- } else {
203
- var files = basedir;
204
- }
205
- var res = files.slice(1).reduce(function(ps, file) {
206
- if (!file.match(/^([A-Za-z]:)?\/|\\/)) {
207
- throw new Error("relative path without a basedir");
208
- }
209
- var xs = file.split(/\/+|\\+/);
210
- for (var i = 0; ps[i] === xs[i] && i < Math.min(ps.length, xs.length); i++)
211
- ;
212
- return ps.slice(0, i);
213
- }, files[0].split(/\/+|\\+/));
214
- return res.length > 1 ? res.join("/") : "/";
215
- };
216
- }
217
- });
218
- init_cjs_shims2();
219
- var import_commondir = __toESM(require_commondir(), 1);
220
- function joinPath(...paths) {
221
- return join(...paths);
222
- }
223
- function normalizePath(path) {
224
- return normalize(path);
225
- }
226
- function resolvePath(...paths) {
227
- return resolve(...paths);
228
- }
229
- function relativePath(from, to) {
230
- return relative(from, to);
231
- }
232
- function isAbsolutePath(path) {
233
- return isAbsolute(path);
234
- }
235
- function dirname2(path) {
236
- return dirname(path);
237
- }
238
- function basename2(path, ext) {
239
- return basename(path, ext);
240
- }
241
- function extname2(path) {
242
- return extname(path);
243
- }
244
- function relativizePath(path, dir = cwd2()) {
245
- const result = (0, import_commondir.default)([path, dir]);
246
- const relativePath2 = relative(dir, path);
247
- const relativeComponents = relativePath2.split("/").filter((component) => component === "..").length;
248
- if (result === "/" || relativePath2 === "" || relativeComponents > 2) {
249
- return path;
250
- } else {
251
- return relativePath2;
252
- }
253
- }
254
- function moduleDirectory(moduleURL) {
255
- return dirname2(fileURLToPath(moduleURL));
256
- }
257
- function cwd2() {
258
- return normalize(process.env.INIT_CWD ? process.env.INIT_CWD : process.cwd());
259
- }
260
-
261
- export {
262
- joinPath,
263
- normalizePath,
264
- resolvePath,
265
- relativePath,
266
- isAbsolutePath,
267
- dirname2,
268
- basename2,
269
- extname2,
270
- relativizePath,
271
- moduleDirectory,
272
- cwd2 as cwd
273
- };