@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,893 +0,0 @@
1
- import {
2
- require_merge2,
3
- require_out4
4
- } from "./chunk-RTZHOWFC.js";
5
- import {
6
- __commonJS,
7
- __require,
8
- init_cjs_shims as init_cjs_shims2
9
- } from "./chunk-ZLGRKPW3.js";
10
- import {
11
- init_cjs_shims
12
- } from "./chunk-M63RTPGR.js";
13
-
14
- // ../create-app/dist/chunk-LUP5VDI4.js
15
- init_cjs_shims();
16
- var require_slash = __commonJS({
17
- "../../node_modules/.pnpm/slash@3.0.0/node_modules/slash/index.js"(exports, module) {
18
- "use strict";
19
- init_cjs_shims2();
20
- module.exports = (path) => {
21
- const isExtendedLengthPath = /^\\\\\?\\/.test(path);
22
- const hasNonAscii = /[^\u0000-\u0080]+/.test(path);
23
- if (isExtendedLengthPath || hasNonAscii) {
24
- return path;
25
- }
26
- return path.replace(/\\/g, "/");
27
- };
28
- }
29
- });
30
- var require_array_union = __commonJS({
31
- "../../node_modules/.pnpm/array-union@2.1.0/node_modules/array-union/index.js"(exports, module) {
32
- "use strict";
33
- init_cjs_shims2();
34
- module.exports = (...arguments_) => {
35
- return [...new Set([].concat(...arguments_))];
36
- };
37
- }
38
- });
39
- var require_path_type = __commonJS({
40
- "../../node_modules/.pnpm/path-type@4.0.0/node_modules/path-type/index.js"(exports) {
41
- "use strict";
42
- init_cjs_shims2();
43
- var { promisify } = __require("util");
44
- var fs = __require("fs");
45
- async function isType(fsStatType, statsMethodName, filePath) {
46
- if (typeof filePath !== "string") {
47
- throw new TypeError(`Expected a string, got ${typeof filePath}`);
48
- }
49
- try {
50
- const stats = await promisify(fs[fsStatType])(filePath);
51
- return stats[statsMethodName]();
52
- } catch (error) {
53
- if (error.code === "ENOENT") {
54
- return false;
55
- }
56
- throw error;
57
- }
58
- }
59
- function isTypeSync(fsStatType, statsMethodName, filePath) {
60
- if (typeof filePath !== "string") {
61
- throw new TypeError(`Expected a string, got ${typeof filePath}`);
62
- }
63
- try {
64
- return fs[fsStatType](filePath)[statsMethodName]();
65
- } catch (error) {
66
- if (error.code === "ENOENT") {
67
- return false;
68
- }
69
- throw error;
70
- }
71
- }
72
- exports.isFile = isType.bind(null, "stat", "isFile");
73
- exports.isDirectory = isType.bind(null, "stat", "isDirectory");
74
- exports.isSymlink = isType.bind(null, "lstat", "isSymbolicLink");
75
- exports.isFileSync = isTypeSync.bind(null, "statSync", "isFile");
76
- exports.isDirectorySync = isTypeSync.bind(null, "statSync", "isDirectory");
77
- exports.isSymlinkSync = isTypeSync.bind(null, "lstatSync", "isSymbolicLink");
78
- }
79
- });
80
- var require_dir_glob = __commonJS({
81
- "../../node_modules/.pnpm/dir-glob@3.0.1/node_modules/dir-glob/index.js"(exports, module) {
82
- "use strict";
83
- init_cjs_shims2();
84
- var path = __require("path");
85
- var pathType = require_path_type();
86
- var getExtensions = (extensions) => extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0];
87
- var getPath = (filepath, cwd) => {
88
- const pth = filepath[0] === "!" ? filepath.slice(1) : filepath;
89
- return path.isAbsolute(pth) ? pth : path.join(cwd, pth);
90
- };
91
- var addExtensions = (file, extensions) => {
92
- if (path.extname(file)) {
93
- return `**/${file}`;
94
- }
95
- return `**/${file}.${getExtensions(extensions)}`;
96
- };
97
- var getGlob = (directory, options) => {
98
- if (options.files && !Array.isArray(options.files)) {
99
- throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof options.files}\``);
100
- }
101
- if (options.extensions && !Array.isArray(options.extensions)) {
102
- throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof options.extensions}\``);
103
- }
104
- if (options.files && options.extensions) {
105
- return options.files.map((x) => path.posix.join(directory, addExtensions(x, options.extensions)));
106
- }
107
- if (options.files) {
108
- return options.files.map((x) => path.posix.join(directory, `**/${x}`));
109
- }
110
- if (options.extensions) {
111
- return [path.posix.join(directory, `**/*.${getExtensions(options.extensions)}`)];
112
- }
113
- return [path.posix.join(directory, "**")];
114
- };
115
- module.exports = async (input, options) => {
116
- options = {
117
- cwd: process.cwd(),
118
- ...options
119
- };
120
- if (typeof options.cwd !== "string") {
121
- throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof options.cwd}\``);
122
- }
123
- const globs = await Promise.all([].concat(input).map(async (x) => {
124
- const isDirectory = await pathType.isDirectory(getPath(x, options.cwd));
125
- return isDirectory ? getGlob(x, options) : x;
126
- }));
127
- return [].concat.apply([], globs);
128
- };
129
- module.exports.sync = (input, options) => {
130
- options = {
131
- cwd: process.cwd(),
132
- ...options
133
- };
134
- if (typeof options.cwd !== "string") {
135
- throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof options.cwd}\``);
136
- }
137
- const globs = [].concat(input).map((x) => pathType.isDirectorySync(getPath(x, options.cwd)) ? getGlob(x, options) : x);
138
- return [].concat.apply([], globs);
139
- };
140
- }
141
- });
142
- var require_ignore = __commonJS({
143
- "../../node_modules/.pnpm/ignore@5.3.1/node_modules/ignore/index.js"(exports, module) {
144
- init_cjs_shims2();
145
- function makeArray(subject) {
146
- return Array.isArray(subject) ? subject : [subject];
147
- }
148
- var EMPTY = "";
149
- var SPACE = " ";
150
- var ESCAPE = "\\";
151
- var REGEX_TEST_BLANK_LINE = /^\s+$/;
152
- var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
153
- var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
154
- var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
155
- var REGEX_SPLITALL_CRLF = /\r?\n/g;
156
- var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/;
157
- var SLASH = "/";
158
- var TMP_KEY_IGNORE = "node-ignore";
159
- if (typeof Symbol !== "undefined") {
160
- TMP_KEY_IGNORE = Symbol.for("node-ignore");
161
- }
162
- var KEY_IGNORE = TMP_KEY_IGNORE;
163
- var define = (object, key, value) => Object.defineProperty(object, key, { value });
164
- var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
165
- var RETURN_FALSE = () => false;
166
- var sanitizeRange = (range) => range.replace(
167
- REGEX_REGEXP_RANGE,
168
- (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY
169
- );
170
- var cleanRangeBackSlash = (slashes) => {
171
- const { length } = slashes;
172
- return slashes.slice(0, length - length % 2);
173
- };
174
- var REPLACERS = [
175
- [
176
- // remove BOM
177
- // TODO:
178
- // Other similar zero-width characters?
179
- /^\uFEFF/,
180
- () => EMPTY
181
- ],
182
- // > Trailing spaces are ignored unless they are quoted with backslash ("\")
183
- [
184
- // (a\ ) -> (a )
185
- // (a ) -> (a)
186
- // (a \ ) -> (a )
187
- /\\?\s+$/,
188
- (match) => match.indexOf("\\") === 0 ? SPACE : EMPTY
189
- ],
190
- // replace (\ ) with ' '
191
- [
192
- /\\\s/g,
193
- () => SPACE
194
- ],
195
- // Escape metacharacters
196
- // which is written down by users but means special for regular expressions.
197
- // > There are 12 characters with special meanings:
198
- // > - the backslash \,
199
- // > - the caret ^,
200
- // > - the dollar sign $,
201
- // > - the period or dot .,
202
- // > - the vertical bar or pipe symbol |,
203
- // > - the question mark ?,
204
- // > - the asterisk or star *,
205
- // > - the plus sign +,
206
- // > - the opening parenthesis (,
207
- // > - the closing parenthesis ),
208
- // > - and the opening square bracket [,
209
- // > - the opening curly brace {,
210
- // > These special characters are often called "metacharacters".
211
- [
212
- /[\\$.|*+(){^]/g,
213
- (match) => `\\${match}`
214
- ],
215
- [
216
- // > a question mark (?) matches a single character
217
- /(?!\\)\?/g,
218
- () => "[^/]"
219
- ],
220
- // leading slash
221
- [
222
- // > A leading slash matches the beginning of the pathname.
223
- // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
224
- // A leading slash matches the beginning of the pathname
225
- /^\//,
226
- () => "^"
227
- ],
228
- // replace special metacharacter slash after the leading slash
229
- [
230
- /\//g,
231
- () => "\\/"
232
- ],
233
- [
234
- // > A leading "**" followed by a slash means match in all directories.
235
- // > For example, "**/foo" matches file or directory "foo" anywhere,
236
- // > the same as pattern "foo".
237
- // > "**/foo/bar" matches file or directory "bar" anywhere that is directly
238
- // > under directory "foo".
239
- // Notice that the '*'s have been replaced as '\\*'
240
- /^\^*\\\*\\\*\\\//,
241
- // '**/foo' <-> 'foo'
242
- () => "^(?:.*\\/)?"
243
- ],
244
- // starting
245
- [
246
- // there will be no leading '/'
247
- // (which has been replaced by section "leading slash")
248
- // If starts with '**', adding a '^' to the regular expression also works
249
- /^(?=[^^])/,
250
- function startingReplacer() {
251
- return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^";
252
- }
253
- ],
254
- // two globstars
255
- [
256
- // Use lookahead assertions so that we could match more than one `'/**'`
257
- /\\\/\\\*\\\*(?=\\\/|$)/g,
258
- // Zero, one or several directories
259
- // should not use '*', or it will be replaced by the next replacer
260
- // Check if it is not the last `'/**'`
261
- (_, index, str) => index + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+"
262
- ],
263
- // normal intermediate wildcards
264
- [
265
- // Never replace escaped '*'
266
- // ignore rule '\*' will match the path '*'
267
- // 'abc.*/' -> go
268
- // 'abc.*' -> skip this rule,
269
- // coz trailing single wildcard will be handed by [trailing wildcard]
270
- /(^|[^\\]+)(\\\*)+(?=.+)/g,
271
- // '*.js' matches '.js'
272
- // '*.js' doesn't match 'abc'
273
- (_, p1, p2) => {
274
- const unescaped = p2.replace(/\\\*/g, "[^\\/]*");
275
- return p1 + unescaped;
276
- }
277
- ],
278
- [
279
- // unescape, revert step 3 except for back slash
280
- // For example, if a user escape a '\\*',
281
- // after step 3, the result will be '\\\\\\*'
282
- /\\\\\\(?=[$.|*+(){^])/g,
283
- () => ESCAPE
284
- ],
285
- [
286
- // '\\\\' -> '\\'
287
- /\\\\/g,
288
- () => ESCAPE
289
- ],
290
- [
291
- // > The range notation, e.g. [a-zA-Z],
292
- // > can be used to match one of the characters in a range.
293
- // `\` is escaped by step 3
294
- /(\\)?\[([^\]/]*?)(\\*)($|\])/g,
295
- (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]"
296
- ],
297
- // ending
298
- [
299
- // 'js' will not match 'js.'
300
- // 'ab' will not match 'abc'
301
- /(?:[^*])$/,
302
- // WTF!
303
- // https://git-scm.com/docs/gitignore
304
- // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
305
- // which re-fixes #24, #38
306
- // > If there is a separator at the end of the pattern then the pattern
307
- // > will only match directories, otherwise the pattern can match both
308
- // > files and directories.
309
- // 'js*' will not match 'a.js'
310
- // 'js/' will not match 'a.js'
311
- // 'js' will match 'a.js' and 'a.js/'
312
- (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)`
313
- ],
314
- // trailing wildcard
315
- [
316
- /(\^|\\\/)?\\\*$/,
317
- (_, p1) => {
318
- const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
319
- return `${prefix}(?=$|\\/$)`;
320
- }
321
- ]
322
- ];
323
- var regexCache = /* @__PURE__ */ Object.create(null);
324
- var makeRegex = (pattern, ignoreCase) => {
325
- let source = regexCache[pattern];
326
- if (!source) {
327
- source = REPLACERS.reduce(
328
- (prev, current) => prev.replace(current[0], current[1].bind(pattern)),
329
- pattern
330
- );
331
- regexCache[pattern] = source;
332
- }
333
- return ignoreCase ? new RegExp(source, "i") : new RegExp(source);
334
- };
335
- var isString = (subject) => typeof subject === "string";
336
- var checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0;
337
- var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF);
338
- var IgnoreRule = class {
339
- constructor(origin, pattern, negative, regex) {
340
- this.origin = origin;
341
- this.pattern = pattern;
342
- this.negative = negative;
343
- this.regex = regex;
344
- }
345
- };
346
- var createRule = (pattern, ignoreCase) => {
347
- const origin = pattern;
348
- let negative = false;
349
- if (pattern.indexOf("!") === 0) {
350
- negative = true;
351
- pattern = pattern.substr(1);
352
- }
353
- pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
354
- const regex = makeRegex(pattern, ignoreCase);
355
- return new IgnoreRule(
356
- origin,
357
- pattern,
358
- negative,
359
- regex
360
- );
361
- };
362
- var throwError = (message, Ctor) => {
363
- throw new Ctor(message);
364
- };
365
- var checkPath = (path, originalPath, doThrow) => {
366
- if (!isString(path)) {
367
- return doThrow(
368
- `path must be a string, but got \`${originalPath}\``,
369
- TypeError
370
- );
371
- }
372
- if (!path) {
373
- return doThrow(`path must not be empty`, TypeError);
374
- }
375
- if (checkPath.isNotRelative(path)) {
376
- const r = "`path.relative()`d";
377
- return doThrow(
378
- `path should be a ${r} string, but got "${originalPath}"`,
379
- RangeError
380
- );
381
- }
382
- return true;
383
- };
384
- var isNotRelative = (path) => REGEX_TEST_INVALID_PATH.test(path);
385
- checkPath.isNotRelative = isNotRelative;
386
- checkPath.convert = (p) => p;
387
- var Ignore = class {
388
- constructor({
389
- ignorecase = true,
390
- ignoreCase = ignorecase,
391
- allowRelativePaths = false
392
- } = {}) {
393
- define(this, KEY_IGNORE, true);
394
- this._rules = [];
395
- this._ignoreCase = ignoreCase;
396
- this._allowRelativePaths = allowRelativePaths;
397
- this._initCache();
398
- }
399
- _initCache() {
400
- this._ignoreCache = /* @__PURE__ */ Object.create(null);
401
- this._testCache = /* @__PURE__ */ Object.create(null);
402
- }
403
- _addPattern(pattern) {
404
- if (pattern && pattern[KEY_IGNORE]) {
405
- this._rules = this._rules.concat(pattern._rules);
406
- this._added = true;
407
- return;
408
- }
409
- if (checkPattern(pattern)) {
410
- const rule = createRule(pattern, this._ignoreCase);
411
- this._added = true;
412
- this._rules.push(rule);
413
- }
414
- }
415
- // @param {Array<string> | string | Ignore} pattern
416
- add(pattern) {
417
- this._added = false;
418
- makeArray(
419
- isString(pattern) ? splitPattern(pattern) : pattern
420
- ).forEach(this._addPattern, this);
421
- if (this._added) {
422
- this._initCache();
423
- }
424
- return this;
425
- }
426
- // legacy
427
- addPattern(pattern) {
428
- return this.add(pattern);
429
- }
430
- // | ignored : unignored
431
- // negative | 0:0 | 0:1 | 1:0 | 1:1
432
- // -------- | ------- | ------- | ------- | --------
433
- // 0 | TEST | TEST | SKIP | X
434
- // 1 | TESTIF | SKIP | TEST | X
435
- // - SKIP: always skip
436
- // - TEST: always test
437
- // - TESTIF: only test if checkUnignored
438
- // - X: that never happen
439
- // @param {boolean} whether should check if the path is unignored,
440
- // setting `checkUnignored` to `false` could reduce additional
441
- // path matching.
442
- // @returns {TestResult} true if a file is ignored
443
- _testOne(path, checkUnignored) {
444
- let ignored = false;
445
- let unignored = false;
446
- this._rules.forEach((rule) => {
447
- const { negative } = rule;
448
- if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
449
- return;
450
- }
451
- const matched = rule.regex.test(path);
452
- if (matched) {
453
- ignored = !negative;
454
- unignored = negative;
455
- }
456
- });
457
- return {
458
- ignored,
459
- unignored
460
- };
461
- }
462
- // @returns {TestResult}
463
- _test(originalPath, cache, checkUnignored, slices) {
464
- const path = originalPath && checkPath.convert(originalPath);
465
- checkPath(
466
- path,
467
- originalPath,
468
- this._allowRelativePaths ? RETURN_FALSE : throwError
469
- );
470
- return this._t(path, cache, checkUnignored, slices);
471
- }
472
- _t(path, cache, checkUnignored, slices) {
473
- if (path in cache) {
474
- return cache[path];
475
- }
476
- if (!slices) {
477
- slices = path.split(SLASH);
478
- }
479
- slices.pop();
480
- if (!slices.length) {
481
- return cache[path] = this._testOne(path, checkUnignored);
482
- }
483
- const parent = this._t(
484
- slices.join(SLASH) + SLASH,
485
- cache,
486
- checkUnignored,
487
- slices
488
- );
489
- return cache[path] = parent.ignored ? parent : this._testOne(path, checkUnignored);
490
- }
491
- ignores(path) {
492
- return this._test(path, this._ignoreCache, false).ignored;
493
- }
494
- createFilter() {
495
- return (path) => !this.ignores(path);
496
- }
497
- filter(paths) {
498
- return makeArray(paths).filter(this.createFilter());
499
- }
500
- // @returns {TestResult}
501
- test(path) {
502
- return this._test(path, this._testCache, true);
503
- }
504
- };
505
- var factory = (options) => new Ignore(options);
506
- var isPathValid = (path) => checkPath(path && checkPath.convert(path), path, RETURN_FALSE);
507
- factory.isPathValid = isPathValid;
508
- factory.default = factory;
509
- module.exports = factory;
510
- if (
511
- // Detect `process` so that it can run in browsers.
512
- typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")
513
- ) {
514
- const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
515
- checkPath.convert = makePosix;
516
- const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
517
- checkPath.isNotRelative = (path) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path);
518
- }
519
- }
520
- });
521
- var require_gitignore = __commonJS({
522
- "../../node_modules/.pnpm/globby@11.1.0/node_modules/globby/gitignore.js"(exports, module) {
523
- "use strict";
524
- init_cjs_shims2();
525
- var { promisify } = __require("util");
526
- var fs = __require("fs");
527
- var path = __require("path");
528
- var fastGlob = require_out4();
529
- var gitIgnore = require_ignore();
530
- var slash = require_slash();
531
- var DEFAULT_IGNORE = [
532
- "**/node_modules/**",
533
- "**/flow-typed/**",
534
- "**/coverage/**",
535
- "**/.git"
536
- ];
537
- var readFileP = promisify(fs.readFile);
538
- var mapGitIgnorePatternTo = (base) => (ignore) => {
539
- if (ignore.startsWith("!")) {
540
- return "!" + path.posix.join(base, ignore.slice(1));
541
- }
542
- return path.posix.join(base, ignore);
543
- };
544
- var parseGitIgnore = (content, options) => {
545
- const base = slash(path.relative(options.cwd, path.dirname(options.fileName)));
546
- return content.split(/\r?\n/).filter(Boolean).filter((line) => !line.startsWith("#")).map(mapGitIgnorePatternTo(base));
547
- };
548
- var reduceIgnore = (files) => {
549
- const ignores = gitIgnore();
550
- for (const file of files) {
551
- ignores.add(parseGitIgnore(file.content, {
552
- cwd: file.cwd,
553
- fileName: file.filePath
554
- }));
555
- }
556
- return ignores;
557
- };
558
- var ensureAbsolutePathForCwd = (cwd, p) => {
559
- cwd = slash(cwd);
560
- if (path.isAbsolute(p)) {
561
- if (slash(p).startsWith(cwd)) {
562
- return p;
563
- }
564
- throw new Error(`Path ${p} is not in cwd ${cwd}`);
565
- }
566
- return path.join(cwd, p);
567
- };
568
- var getIsIgnoredPredecate = (ignores, cwd) => {
569
- return (p) => ignores.ignores(slash(path.relative(cwd, ensureAbsolutePathForCwd(cwd, p.path || p))));
570
- };
571
- var getFile = async (file, cwd) => {
572
- const filePath = path.join(cwd, file);
573
- const content = await readFileP(filePath, "utf8");
574
- return {
575
- cwd,
576
- filePath,
577
- content
578
- };
579
- };
580
- var getFileSync = (file, cwd) => {
581
- const filePath = path.join(cwd, file);
582
- const content = fs.readFileSync(filePath, "utf8");
583
- return {
584
- cwd,
585
- filePath,
586
- content
587
- };
588
- };
589
- var normalizeOptions = ({
590
- ignore = [],
591
- cwd = slash(process.cwd())
592
- } = {}) => {
593
- return { ignore, cwd };
594
- };
595
- module.exports = async (options) => {
596
- options = normalizeOptions(options);
597
- const paths = await fastGlob("**/.gitignore", {
598
- ignore: DEFAULT_IGNORE.concat(options.ignore),
599
- cwd: options.cwd
600
- });
601
- const files = await Promise.all(paths.map((file) => getFile(file, options.cwd)));
602
- const ignores = reduceIgnore(files);
603
- return getIsIgnoredPredecate(ignores, options.cwd);
604
- };
605
- module.exports.sync = (options) => {
606
- options = normalizeOptions(options);
607
- const paths = fastGlob.sync("**/.gitignore", {
608
- ignore: DEFAULT_IGNORE.concat(options.ignore),
609
- cwd: options.cwd
610
- });
611
- const files = paths.map((file) => getFileSync(file, options.cwd));
612
- const ignores = reduceIgnore(files);
613
- return getIsIgnoredPredecate(ignores, options.cwd);
614
- };
615
- }
616
- });
617
- var require_stream_utils = __commonJS({
618
- "../../node_modules/.pnpm/globby@11.1.0/node_modules/globby/stream-utils.js"(exports, module) {
619
- "use strict";
620
- init_cjs_shims2();
621
- var { Transform } = __require("stream");
622
- var ObjectTransform = class extends Transform {
623
- constructor() {
624
- super({
625
- objectMode: true
626
- });
627
- }
628
- };
629
- var FilterStream = class extends ObjectTransform {
630
- constructor(filter) {
631
- super();
632
- this._filter = filter;
633
- }
634
- _transform(data, encoding, callback) {
635
- if (this._filter(data)) {
636
- this.push(data);
637
- }
638
- callback();
639
- }
640
- };
641
- var UniqueStream = class extends ObjectTransform {
642
- constructor() {
643
- super();
644
- this._pushed = /* @__PURE__ */ new Set();
645
- }
646
- _transform(data, encoding, callback) {
647
- if (!this._pushed.has(data)) {
648
- this.push(data);
649
- this._pushed.add(data);
650
- }
651
- callback();
652
- }
653
- };
654
- module.exports = {
655
- FilterStream,
656
- UniqueStream
657
- };
658
- }
659
- });
660
- var require_globby = __commonJS({
661
- "../../node_modules/.pnpm/globby@11.1.0/node_modules/globby/index.js"(exports, module) {
662
- "use strict";
663
- init_cjs_shims2();
664
- var fs = __require("fs");
665
- var arrayUnion = require_array_union();
666
- var merge2 = require_merge2();
667
- var fastGlob = require_out4();
668
- var dirGlob = require_dir_glob();
669
- var gitignore = require_gitignore();
670
- var { FilterStream, UniqueStream } = require_stream_utils();
671
- var DEFAULT_FILTER = () => false;
672
- var isNegative = (pattern) => pattern[0] === "!";
673
- var assertPatternsInput = (patterns) => {
674
- if (!patterns.every((pattern) => typeof pattern === "string")) {
675
- throw new TypeError("Patterns must be a string or an array of strings");
676
- }
677
- };
678
- var checkCwdOption = (options = {}) => {
679
- if (!options.cwd) {
680
- return;
681
- }
682
- let stat;
683
- try {
684
- stat = fs.statSync(options.cwd);
685
- } catch {
686
- return;
687
- }
688
- if (!stat.isDirectory()) {
689
- throw new Error("The `cwd` option must be a path to a directory");
690
- }
691
- };
692
- var getPathString = (p) => p.stats instanceof fs.Stats ? p.path : p;
693
- var generateGlobTasks = (patterns, taskOptions) => {
694
- patterns = arrayUnion([].concat(patterns));
695
- assertPatternsInput(patterns);
696
- checkCwdOption(taskOptions);
697
- const globTasks = [];
698
- taskOptions = {
699
- ignore: [],
700
- expandDirectories: true,
701
- ...taskOptions
702
- };
703
- for (const [index, pattern] of patterns.entries()) {
704
- if (isNegative(pattern)) {
705
- continue;
706
- }
707
- const ignore = patterns.slice(index).filter((pattern2) => isNegative(pattern2)).map((pattern2) => pattern2.slice(1));
708
- const options = {
709
- ...taskOptions,
710
- ignore: taskOptions.ignore.concat(ignore)
711
- };
712
- globTasks.push({ pattern, options });
713
- }
714
- return globTasks;
715
- };
716
- var globDirs = (task, fn) => {
717
- let options = {};
718
- if (task.options.cwd) {
719
- options.cwd = task.options.cwd;
720
- }
721
- if (Array.isArray(task.options.expandDirectories)) {
722
- options = {
723
- ...options,
724
- files: task.options.expandDirectories
725
- };
726
- } else if (typeof task.options.expandDirectories === "object") {
727
- options = {
728
- ...options,
729
- ...task.options.expandDirectories
730
- };
731
- }
732
- return fn(task.pattern, options);
733
- };
734
- var getPattern = (task, fn) => task.options.expandDirectories ? globDirs(task, fn) : [task.pattern];
735
- var getFilterSync = (options) => {
736
- return options && options.gitignore ? gitignore.sync({ cwd: options.cwd, ignore: options.ignore }) : DEFAULT_FILTER;
737
- };
738
- var globToTask = (task) => (glob) => {
739
- const { options } = task;
740
- if (options.ignore && Array.isArray(options.ignore) && options.expandDirectories) {
741
- options.ignore = dirGlob.sync(options.ignore);
742
- }
743
- return {
744
- pattern: glob,
745
- options
746
- };
747
- };
748
- module.exports = async (patterns, options) => {
749
- const globTasks = generateGlobTasks(patterns, options);
750
- const getFilter = async () => {
751
- return options && options.gitignore ? gitignore({ cwd: options.cwd, ignore: options.ignore }) : DEFAULT_FILTER;
752
- };
753
- const getTasks = async () => {
754
- const tasks2 = await Promise.all(globTasks.map(async (task) => {
755
- const globs = await getPattern(task, dirGlob);
756
- return Promise.all(globs.map(globToTask(task)));
757
- }));
758
- return arrayUnion(...tasks2);
759
- };
760
- const [filter, tasks] = await Promise.all([getFilter(), getTasks()]);
761
- const paths = await Promise.all(tasks.map((task) => fastGlob(task.pattern, task.options)));
762
- return arrayUnion(...paths).filter((path_) => !filter(getPathString(path_)));
763
- };
764
- module.exports.sync = (patterns, options) => {
765
- const globTasks = generateGlobTasks(patterns, options);
766
- const tasks = [];
767
- for (const task of globTasks) {
768
- const newTask = getPattern(task, dirGlob.sync).map(globToTask(task));
769
- tasks.push(...newTask);
770
- }
771
- const filter = getFilterSync(options);
772
- let matches = [];
773
- for (const task of tasks) {
774
- matches = arrayUnion(matches, fastGlob.sync(task.pattern, task.options));
775
- }
776
- return matches.filter((path_) => !filter(path_));
777
- };
778
- module.exports.stream = (patterns, options) => {
779
- const globTasks = generateGlobTasks(patterns, options);
780
- const tasks = [];
781
- for (const task of globTasks) {
782
- const newTask = getPattern(task, dirGlob.sync).map(globToTask(task));
783
- tasks.push(...newTask);
784
- }
785
- const filter = getFilterSync(options);
786
- const filterStream = new FilterStream((p) => !filter(p));
787
- const uniqueStream = new UniqueStream();
788
- return merge2(tasks.map((task) => fastGlob.stream(task.pattern, task.options))).pipe(filterStream).pipe(uniqueStream);
789
- };
790
- module.exports.generateGlobTasks = generateGlobTasks;
791
- module.exports.hasMagic = (patterns, options) => [].concat(patterns).some((pattern) => fastGlob.isDynamicPattern(pattern, options));
792
- module.exports.gitignore = gitignore;
793
- }
794
- });
795
- var require_indent_string = __commonJS({
796
- "../../node_modules/.pnpm/indent-string@4.0.0/node_modules/indent-string/index.js"(exports, module) {
797
- "use strict";
798
- init_cjs_shims2();
799
- module.exports = (string, count = 1, options) => {
800
- options = {
801
- indent: " ",
802
- includeEmptyLines: false,
803
- ...options
804
- };
805
- if (typeof string !== "string") {
806
- throw new TypeError(
807
- `Expected \`input\` to be a \`string\`, got \`${typeof string}\``
808
- );
809
- }
810
- if (typeof count !== "number") {
811
- throw new TypeError(
812
- `Expected \`count\` to be a \`number\`, got \`${typeof count}\``
813
- );
814
- }
815
- if (typeof options.indent !== "string") {
816
- throw new TypeError(
817
- `Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``
818
- );
819
- }
820
- if (count === 0) {
821
- return string;
822
- }
823
- const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
824
- return string.replace(regex, options.indent.repeat(count));
825
- };
826
- }
827
- });
828
- var require_balanced_match = __commonJS({
829
- "../../node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports, module) {
830
- "use strict";
831
- init_cjs_shims2();
832
- module.exports = balanced;
833
- function balanced(a, b, str) {
834
- if (a instanceof RegExp)
835
- a = maybeMatch(a, str);
836
- if (b instanceof RegExp)
837
- b = maybeMatch(b, str);
838
- var r = range(a, b, str);
839
- return r && {
840
- start: r[0],
841
- end: r[1],
842
- pre: str.slice(0, r[0]),
843
- body: str.slice(r[0] + a.length, r[1]),
844
- post: str.slice(r[1] + b.length)
845
- };
846
- }
847
- function maybeMatch(reg, str) {
848
- var m = str.match(reg);
849
- return m ? m[0] : null;
850
- }
851
- balanced.range = range;
852
- function range(a, b, str) {
853
- var begs, beg, left, right, result;
854
- var ai = str.indexOf(a);
855
- var bi = str.indexOf(b, ai + 1);
856
- var i = ai;
857
- if (ai >= 0 && bi > 0) {
858
- if (a === b) {
859
- return [ai, bi];
860
- }
861
- begs = [];
862
- left = str.length;
863
- while (i >= 0 && !result) {
864
- if (i == ai) {
865
- begs.push(i);
866
- ai = str.indexOf(a, i + 1);
867
- } else if (begs.length == 1) {
868
- result = [begs.pop(), bi];
869
- } else {
870
- beg = begs.pop();
871
- if (beg < left) {
872
- left = beg;
873
- right = bi;
874
- }
875
- bi = str.indexOf(b, i + 1);
876
- }
877
- i = ai < bi && ai >= 0 ? ai : bi;
878
- }
879
- if (begs.length) {
880
- result = [left, right];
881
- }
882
- }
883
- return result;
884
- }
885
- }
886
- });
887
-
888
- export {
889
- require_slash,
890
- require_globby,
891
- require_indent_string,
892
- require_balanced_match
893
- };