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