@qwik.dev/devtools 0.0.3 → 0.0.4

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 (134) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -47
  3. package/dist/component/_virtual/_commonjsHelpers.qwik.cjs +6 -0
  4. package/dist/component/_virtual/_commonjsHelpers.qwik.mjs +6 -0
  5. package/{lib → dist/component}/devtools.qwik.cjs +19 -20
  6. package/{lib → dist/component}/devtools.qwik.mjs +11 -12
  7. package/{lib → dist/component}/index.qwik.cjs +0 -2
  8. package/dist/component/index.qwik.mjs +4 -0
  9. package/{lib-types → dist/component/lib-types/devtools/src}/index.d.ts +0 -1
  10. package/dist/component/node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@5.4.10_@types_node@20.14.11__/node_modules/@qwikest/icons/lib/hi.qwik.qwik.cjs +60 -0
  11. package/dist/component/node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@5.4.10_@types_node@20.14.11__/node_modules/@qwikest/icons/lib/hi.qwik.qwik.mjs +60 -0
  12. package/dist/component/node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@5.4.10_@types_node@20.14.11__/node_modules/@qwikest/icons/lib/lu.qwik.qwik.cjs +32 -0
  13. package/dist/component/node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@5.4.10_@types_node@20.14.11__/node_modules/@qwikest/icons/lib/lu.qwik.qwik.mjs +32 -0
  14. package/dist/component/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.qwik.cjs +54 -0
  15. package/dist/component/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.qwik.mjs +54 -0
  16. package/dist/component/node_modules/.pnpm/birpc@0.2.19/node_modules/birpc/dist/index.qwik.cjs +128 -0
  17. package/dist/component/node_modules/.pnpm/birpc@0.2.19/node_modules/birpc/dist/index.qwik.mjs +128 -0
  18. package/dist/component/node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.qwik.cjs +149 -0
  19. package/dist/component/node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.qwik.mjs +150 -0
  20. package/dist/component/node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.qwik.cjs +36 -0
  21. package/dist/component/node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.qwik.mjs +36 -0
  22. package/dist/component/node_modules/.pnpm/dree@5.1.5/node_modules/dree/bundled/lib/esm/index.esm.qwik.cjs +12 -0
  23. package/dist/component/node_modules/.pnpm/dree@5.1.5/node_modules/dree/bundled/lib/esm/index.esm.qwik.mjs +12 -0
  24. package/dist/component/node_modules/.pnpm/is-what@4.1.16/node_modules/is-what/dist/index.qwik.cjs +17 -0
  25. package/dist/component/node_modules/.pnpm/is-what@4.1.16/node_modules/is-what/dist/index.qwik.mjs +17 -0
  26. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/assert-valid-pattern.qwik.cjs +12 -0
  27. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/assert-valid-pattern.qwik.mjs +12 -0
  28. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/ast.qwik.cjs +513 -0
  29. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/ast.qwik.mjs +513 -0
  30. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/brace-expressions.qwik.cjs +110 -0
  31. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/brace-expressions.qwik.mjs +110 -0
  32. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/escape.qwik.cjs +6 -0
  33. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/escape.qwik.mjs +6 -0
  34. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/index.qwik.cjs +738 -0
  35. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/index.qwik.mjs +738 -0
  36. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/unescape.qwik.cjs +6 -0
  37. package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/unescape.qwik.mjs +6 -0
  38. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/accessDeep.qwik.cjs +120 -0
  39. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/accessDeep.qwik.mjs +120 -0
  40. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.qwik.cjs +23 -0
  41. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.qwik.mjs +23 -0
  42. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.qwik.cjs +18 -0
  43. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.qwik.mjs +18 -0
  44. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/double-indexed-kv.qwik.cjs +23 -0
  45. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/double-indexed-kv.qwik.mjs +23 -0
  46. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.qwik.cjs +91 -0
  47. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.qwik.mjs +91 -0
  48. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.qwik.cjs +51 -0
  49. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.qwik.mjs +51 -0
  50. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/pathstringifier.qwik.cjs +30 -0
  51. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/pathstringifier.qwik.mjs +30 -0
  52. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.qwik.cjs +148 -0
  53. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.qwik.mjs +148 -0
  54. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.qwik.cjs +28 -0
  55. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.qwik.mjs +28 -0
  56. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/transformer.qwik.cjs +203 -0
  57. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/transformer.qwik.mjs +203 -0
  58. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/util.qwik.cjs +47 -0
  59. package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/util.qwik.mjs +47 -0
  60. package/dist/component/node_modules/.pnpm/vite-hot-client@0.2.4_vite@5.4.10_@types_node@20.14.11_/node_modules/vite-hot-client/dist/index.qwik.cjs +35 -0
  61. package/dist/component/node_modules/.pnpm/vite-hot-client@0.2.4_vite@5.4.10_@types_node@20.14.11_/node_modules/vite-hot-client/dist/index.qwik.mjs +35 -0
  62. package/{lib/kit → dist/component/packages/kit/src}/client.qwik.cjs +5 -5
  63. package/{lib/kit → dist/component/packages/kit/src}/client.qwik.mjs +2 -2
  64. package/{lib/kit → dist/component/packages/kit/src}/context.qwik.cjs +0 -12
  65. package/{lib/kit → dist/component/packages/kit/src}/context.qwik.mjs +2 -14
  66. package/{lib/kit → dist/component/packages/kit/src}/globals.qwik.cjs +0 -4
  67. package/dist/component/packages/kit/src/globals.qwik.mjs +6 -0
  68. package/dist/plugin/index.cjs +10504 -0
  69. package/dist/plugin/index.mjs +10492 -0
  70. package/package.json +26 -41
  71. package/lib/index.qwik.mjs +0 -6
  72. package/lib/kit/globals.qwik.mjs +0 -10
  73. package/lib/kit/server.qwik.cjs +0 -18
  74. package/lib/kit/server.qwik.mjs +0 -18
  75. package/lib/plugin/assets/index.qwik.cjs +0 -67
  76. package/lib/plugin/assets/index.qwik.mjs +0 -67
  77. package/lib/plugin/index.qwik.cjs +0 -49
  78. package/lib/plugin/index.qwik.mjs +0 -49
  79. package/lib/plugin/npm/index.qwik.cjs +0 -19
  80. package/lib/plugin/npm/index.qwik.mjs +0 -19
  81. package/lib/plugin/routes/index.qwik.cjs +0 -17
  82. package/lib/plugin/routes/index.qwik.mjs +0 -17
  83. package/lib/plugin/rpc/index.qwik.cjs +0 -14
  84. package/lib/plugin/rpc/index.qwik.mjs +0 -14
  85. package/lib/utils/location.qwik.cjs +0 -9
  86. package/lib/utils/location.qwik.mjs +0 -9
  87. package/lib-types/plugin/assets/index.d.ts +0 -5
  88. package/lib-types/plugin/components/index.d.ts +0 -0
  89. package/lib-types/plugin/index.d.ts +0 -2
  90. package/lib-types/plugin/npm/index.d.ts +0 -5
  91. package/lib-types/plugin/routes/index.d.ts +0 -5
  92. package/lib-types/plugin/rpc/index.d.ts +0 -3
  93. package/lib-types/plugin/types/index.d.ts +0 -5
  94. package/src/devtools.css +0 -558
  95. package/src/devtools.tsx +0 -404
  96. package/src/entry.dev.tsx +0 -17
  97. package/src/entry.ssr.tsx +0 -25
  98. package/src/index.ts +0 -2
  99. package/src/kit/client.ts +0 -21
  100. package/src/kit/constants.ts +0 -1
  101. package/src/kit/context.ts +0 -42
  102. package/src/kit/globals.ts +0 -22
  103. package/src/kit/index.ts +0 -4
  104. package/src/kit/server.ts +0 -21
  105. package/src/kit/shared.ts +0 -11
  106. package/src/kit/types.ts +0 -48
  107. package/src/plugin/assets/index.ts +0 -126
  108. package/src/plugin/components/index.ts +0 -0
  109. package/src/plugin/index.ts +0 -50
  110. package/src/plugin/npm/index.ts +0 -24
  111. package/src/plugin/routes/index.ts +0 -16
  112. package/src/plugin/rpc/index.ts +0 -14
  113. package/src/plugin/types/index.ts +0 -6
  114. package/src/root.tsx +0 -15
  115. package/src/utils/location.ts +0 -9
  116. /package/{lib → dist/component}/devtools.css.qwik.cjs +0 -0
  117. /package/{lib → dist/component}/devtools.css.qwik.mjs +0 -0
  118. /package/{lib-types → dist/component/lib-types/devtools/src}/devtools.d.ts +0 -0
  119. /package/{lib-types → dist/component/lib-types/devtools/src}/entry.dev.d.ts +0 -0
  120. /package/{lib-types → dist/component/lib-types/devtools/src}/entry.ssr.d.ts +0 -0
  121. /package/{lib-types → dist/component/lib-types/devtools/src}/root.d.ts +0 -0
  122. /package/{lib-types → dist/component/lib-types/devtools/src}/utils/location.d.ts +0 -0
  123. /package/{lib-types/kit → dist/component/lib-types/kit/src}/client.d.ts +0 -0
  124. /package/{lib-types/kit → dist/component/lib-types/kit/src}/constants.d.ts +0 -0
  125. /package/{lib-types/kit → dist/component/lib-types/kit/src}/context.d.ts +0 -0
  126. /package/{lib-types/kit → dist/component/lib-types/kit/src}/globals.d.ts +0 -0
  127. /package/{lib-types/kit → dist/component/lib-types/kit/src}/index.d.ts +0 -0
  128. /package/{lib-types/kit → dist/component/lib-types/kit/src}/server.d.ts +0 -0
  129. /package/{lib-types/kit → dist/component/lib-types/kit/src}/shared.d.ts +0 -0
  130. /package/{lib-types/kit → dist/component/lib-types/kit/src}/types.d.ts +0 -0
  131. /package/{lib/kit → dist/component/packages/kit/src}/constants.qwik.cjs +0 -0
  132. /package/{lib/kit → dist/component/packages/kit/src}/constants.qwik.mjs +0 -0
  133. /package/{lib/kit → dist/component/packages/kit/src}/shared.qwik.cjs +0 -0
  134. /package/{lib/kit → dist/component/packages/kit/src}/shared.qwik.mjs +0 -0
@@ -0,0 +1,738 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
6
+ const index = require("../../../../../brace-expansion@2.0.1/node_modules/brace-expansion/index.qwik.cjs");
7
+ const assertValidPattern = require("./assert-valid-pattern.qwik.cjs");
8
+ const ast = require("./ast.qwik.cjs");
9
+ const escape = require("./escape.qwik.cjs");
10
+ const unescape = require("./unescape.qwik.cjs");
11
+ const minimatch = (p, pattern, options = {}) => {
12
+ assertValidPattern.assertValidPattern(pattern);
13
+ if (!options.nocomment && pattern.charAt(0) === "#") {
14
+ return false;
15
+ }
16
+ return new Minimatch(pattern, options).match(p);
17
+ };
18
+ const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
19
+ const starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
20
+ const starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
21
+ const starDotExtTestNocase = (ext2) => {
22
+ ext2 = ext2.toLowerCase();
23
+ return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
24
+ };
25
+ const starDotExtTestNocaseDot = (ext2) => {
26
+ ext2 = ext2.toLowerCase();
27
+ return (f) => f.toLowerCase().endsWith(ext2);
28
+ };
29
+ const starDotStarRE = /^\*+\.\*+$/;
30
+ const starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
31
+ const starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
32
+ const dotStarRE = /^\.\*+$/;
33
+ const dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
34
+ const starRE = /^\*+$/;
35
+ const starTest = (f) => f.length !== 0 && !f.startsWith(".");
36
+ const starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
37
+ const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
38
+ const qmarksTestNocase = ([$0, ext2 = ""]) => {
39
+ const noext = qmarksTestNoExt([$0]);
40
+ if (!ext2)
41
+ return noext;
42
+ ext2 = ext2.toLowerCase();
43
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
44
+ };
45
+ const qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
46
+ const noext = qmarksTestNoExtDot([$0]);
47
+ if (!ext2)
48
+ return noext;
49
+ ext2 = ext2.toLowerCase();
50
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
51
+ };
52
+ const qmarksTestDot = ([$0, ext2 = ""]) => {
53
+ const noext = qmarksTestNoExtDot([$0]);
54
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
55
+ };
56
+ const qmarksTest = ([$0, ext2 = ""]) => {
57
+ const noext = qmarksTestNoExt([$0]);
58
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
59
+ };
60
+ const qmarksTestNoExt = ([$0]) => {
61
+ const len = $0.length;
62
+ return (f) => f.length === len && !f.startsWith(".");
63
+ };
64
+ const qmarksTestNoExtDot = ([$0]) => {
65
+ const len = $0.length;
66
+ return (f) => f.length === len && f !== "." && f !== "..";
67
+ };
68
+ const defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
69
+ const path = {
70
+ win32: { sep: "\\" },
71
+ posix: { sep: "/" }
72
+ };
73
+ const sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
74
+ minimatch.sep = sep;
75
+ const GLOBSTAR = Symbol("globstar **");
76
+ minimatch.GLOBSTAR = GLOBSTAR;
77
+ const qmark = "[^/]";
78
+ const star = qmark + "*?";
79
+ const twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
80
+ const twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
81
+ const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
82
+ minimatch.filter = filter;
83
+ const ext = (a, b = {}) => Object.assign({}, a, b);
84
+ const defaults = (def) => {
85
+ if (!def || typeof def !== "object" || !Object.keys(def).length) {
86
+ return minimatch;
87
+ }
88
+ const orig = minimatch;
89
+ const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
90
+ return Object.assign(m, {
91
+ Minimatch: class Minimatch extends orig.Minimatch {
92
+ constructor(pattern, options = {}) {
93
+ super(pattern, ext(def, options));
94
+ }
95
+ static defaults(options) {
96
+ return orig.defaults(ext(def, options)).Minimatch;
97
+ }
98
+ },
99
+ AST: class AST extends orig.AST {
100
+ /* c8 ignore start */
101
+ constructor(type, parent, options = {}) {
102
+ super(type, parent, ext(def, options));
103
+ }
104
+ /* c8 ignore stop */
105
+ static fromGlob(pattern, options = {}) {
106
+ return orig.AST.fromGlob(pattern, ext(def, options));
107
+ }
108
+ },
109
+ unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
110
+ escape: (s, options = {}) => orig.escape(s, ext(def, options)),
111
+ filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
112
+ defaults: (options) => orig.defaults(ext(def, options)),
113
+ makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
114
+ braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
115
+ match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
116
+ sep: orig.sep,
117
+ GLOBSTAR
118
+ });
119
+ };
120
+ minimatch.defaults = defaults;
121
+ const braceExpand = (pattern, options = {}) => {
122
+ assertValidPattern.assertValidPattern(pattern);
123
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
124
+ return [pattern];
125
+ }
126
+ return index(pattern);
127
+ };
128
+ minimatch.braceExpand = braceExpand;
129
+ const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
130
+ minimatch.makeRe = makeRe;
131
+ const match = (list, pattern, options = {}) => {
132
+ const mm = new Minimatch(pattern, options);
133
+ list = list.filter((f) => mm.match(f));
134
+ if (mm.options.nonull && !list.length) {
135
+ list.push(pattern);
136
+ }
137
+ return list;
138
+ };
139
+ minimatch.match = match;
140
+ const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
141
+ const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
142
+ class Minimatch {
143
+ constructor(pattern, options = {}) {
144
+ __publicField(this, "options");
145
+ __publicField(this, "set");
146
+ __publicField(this, "pattern");
147
+ __publicField(this, "windowsPathsNoEscape");
148
+ __publicField(this, "nonegate");
149
+ __publicField(this, "negate");
150
+ __publicField(this, "comment");
151
+ __publicField(this, "empty");
152
+ __publicField(this, "preserveMultipleSlashes");
153
+ __publicField(this, "partial");
154
+ __publicField(this, "globSet");
155
+ __publicField(this, "globParts");
156
+ __publicField(this, "nocase");
157
+ __publicField(this, "isWindows");
158
+ __publicField(this, "platform");
159
+ __publicField(this, "windowsNoMagicRoot");
160
+ __publicField(this, "regexp");
161
+ assertValidPattern.assertValidPattern(pattern);
162
+ options = options || {};
163
+ this.options = options;
164
+ this.pattern = pattern;
165
+ this.platform = options.platform || defaultPlatform;
166
+ this.isWindows = this.platform === "win32";
167
+ this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
168
+ if (this.windowsPathsNoEscape) {
169
+ this.pattern = this.pattern.replace(/\\/g, "/");
170
+ }
171
+ this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
172
+ this.regexp = null;
173
+ this.negate = false;
174
+ this.nonegate = !!options.nonegate;
175
+ this.comment = false;
176
+ this.empty = false;
177
+ this.partial = !!options.partial;
178
+ this.nocase = !!this.options.nocase;
179
+ this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
180
+ this.globSet = [];
181
+ this.globParts = [];
182
+ this.set = [];
183
+ this.make();
184
+ }
185
+ hasMagic() {
186
+ if (this.options.magicalBraces && this.set.length > 1) {
187
+ return true;
188
+ }
189
+ for (const pattern of this.set) {
190
+ for (const part of pattern) {
191
+ if (typeof part !== "string")
192
+ return true;
193
+ }
194
+ }
195
+ return false;
196
+ }
197
+ debug(..._) {
198
+ }
199
+ make() {
200
+ const pattern = this.pattern;
201
+ const options = this.options;
202
+ if (!options.nocomment && pattern.charAt(0) === "#") {
203
+ this.comment = true;
204
+ return;
205
+ }
206
+ if (!pattern) {
207
+ this.empty = true;
208
+ return;
209
+ }
210
+ this.parseNegate();
211
+ this.globSet = [...new Set(this.braceExpand())];
212
+ if (options.debug) {
213
+ this.debug = (...args) => console.error(...args);
214
+ }
215
+ this.debug(this.pattern, this.globSet);
216
+ const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
217
+ this.globParts = this.preprocess(rawGlobParts);
218
+ this.debug(this.pattern, this.globParts);
219
+ let set = this.globParts.map((s, _, __) => {
220
+ if (this.isWindows && this.windowsNoMagicRoot) {
221
+ const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
222
+ const isDrive = /^[a-z]:/i.test(s[0]);
223
+ if (isUNC) {
224
+ return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
225
+ } else if (isDrive) {
226
+ return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
227
+ }
228
+ }
229
+ return s.map((ss) => this.parse(ss));
230
+ });
231
+ this.debug(this.pattern, set);
232
+ this.set = set.filter((s) => s.indexOf(false) === -1);
233
+ if (this.isWindows) {
234
+ for (let i = 0; i < this.set.length; i++) {
235
+ const p = this.set[i];
236
+ if (p[0] === "" && p[1] === "" && this.globParts[i][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
237
+ p[2] = "?";
238
+ }
239
+ }
240
+ }
241
+ this.debug(this.pattern, this.set);
242
+ }
243
+ // various transforms to equivalent pattern sets that are
244
+ // faster to process in a filesystem walk. The goal is to
245
+ // eliminate what we can, and push all ** patterns as far
246
+ // to the right as possible, even if it increases the number
247
+ // of patterns that we have to process.
248
+ preprocess(globParts) {
249
+ if (this.options.noglobstar) {
250
+ for (let i = 0; i < globParts.length; i++) {
251
+ for (let j = 0; j < globParts[i].length; j++) {
252
+ if (globParts[i][j] === "**") {
253
+ globParts[i][j] = "*";
254
+ }
255
+ }
256
+ }
257
+ }
258
+ const { optimizationLevel = 1 } = this.options;
259
+ if (optimizationLevel >= 2) {
260
+ globParts = this.firstPhasePreProcess(globParts);
261
+ globParts = this.secondPhasePreProcess(globParts);
262
+ } else if (optimizationLevel >= 1) {
263
+ globParts = this.levelOneOptimize(globParts);
264
+ } else {
265
+ globParts = this.adjascentGlobstarOptimize(globParts);
266
+ }
267
+ return globParts;
268
+ }
269
+ // just get rid of adjascent ** portions
270
+ adjascentGlobstarOptimize(globParts) {
271
+ return globParts.map((parts) => {
272
+ let gs = -1;
273
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
274
+ let i = gs;
275
+ while (parts[i + 1] === "**") {
276
+ i++;
277
+ }
278
+ if (i !== gs) {
279
+ parts.splice(gs, i - gs);
280
+ }
281
+ }
282
+ return parts;
283
+ });
284
+ }
285
+ // get rid of adjascent ** and resolve .. portions
286
+ levelOneOptimize(globParts) {
287
+ return globParts.map((parts) => {
288
+ parts = parts.reduce((set, part) => {
289
+ const prev = set[set.length - 1];
290
+ if (part === "**" && prev === "**") {
291
+ return set;
292
+ }
293
+ if (part === "..") {
294
+ if (prev && prev !== ".." && prev !== "." && prev !== "**") {
295
+ set.pop();
296
+ return set;
297
+ }
298
+ }
299
+ set.push(part);
300
+ return set;
301
+ }, []);
302
+ return parts.length === 0 ? [""] : parts;
303
+ });
304
+ }
305
+ levelTwoFileOptimize(parts) {
306
+ if (!Array.isArray(parts)) {
307
+ parts = this.slashSplit(parts);
308
+ }
309
+ let didSomething = false;
310
+ do {
311
+ didSomething = false;
312
+ if (!this.preserveMultipleSlashes) {
313
+ for (let i = 1; i < parts.length - 1; i++) {
314
+ const p = parts[i];
315
+ if (i === 1 && p === "" && parts[0] === "")
316
+ continue;
317
+ if (p === "." || p === "") {
318
+ didSomething = true;
319
+ parts.splice(i, 1);
320
+ i--;
321
+ }
322
+ }
323
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
324
+ didSomething = true;
325
+ parts.pop();
326
+ }
327
+ }
328
+ let dd = 0;
329
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
330
+ const p = parts[dd - 1];
331
+ if (p && p !== "." && p !== ".." && p !== "**") {
332
+ didSomething = true;
333
+ parts.splice(dd - 1, 2);
334
+ dd -= 2;
335
+ }
336
+ }
337
+ } while (didSomething);
338
+ return parts.length === 0 ? [""] : parts;
339
+ }
340
+ // First phase: single-pattern processing
341
+ // <pre> is 1 or more portions
342
+ // <rest> is 1 or more portions
343
+ // <p> is any portion other than ., .., '', or **
344
+ // <e> is . or ''
345
+ //
346
+ // **/.. is *brutal* for filesystem walking performance, because
347
+ // it effectively resets the recursive walk each time it occurs,
348
+ // and ** cannot be reduced out by a .. pattern part like a regexp
349
+ // or most strings (other than .., ., and '') can be.
350
+ //
351
+ // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
352
+ // <pre>/<e>/<rest> -> <pre>/<rest>
353
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
354
+ // **/**/<rest> -> **/<rest>
355
+ //
356
+ // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
357
+ // this WOULD be allowed if ** did follow symlinks, or * didn't
358
+ firstPhasePreProcess(globParts) {
359
+ let didSomething = false;
360
+ do {
361
+ didSomething = false;
362
+ for (let parts of globParts) {
363
+ let gs = -1;
364
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
365
+ let gss = gs;
366
+ while (parts[gss + 1] === "**") {
367
+ gss++;
368
+ }
369
+ if (gss > gs) {
370
+ parts.splice(gs + 1, gss - gs);
371
+ }
372
+ let next = parts[gs + 1];
373
+ const p = parts[gs + 2];
374
+ const p2 = parts[gs + 3];
375
+ if (next !== "..")
376
+ continue;
377
+ if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
378
+ continue;
379
+ }
380
+ didSomething = true;
381
+ parts.splice(gs, 1);
382
+ const other = parts.slice(0);
383
+ other[gs] = "**";
384
+ globParts.push(other);
385
+ gs--;
386
+ }
387
+ if (!this.preserveMultipleSlashes) {
388
+ for (let i = 1; i < parts.length - 1; i++) {
389
+ const p = parts[i];
390
+ if (i === 1 && p === "" && parts[0] === "")
391
+ continue;
392
+ if (p === "." || p === "") {
393
+ didSomething = true;
394
+ parts.splice(i, 1);
395
+ i--;
396
+ }
397
+ }
398
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
399
+ didSomething = true;
400
+ parts.pop();
401
+ }
402
+ }
403
+ let dd = 0;
404
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
405
+ const p = parts[dd - 1];
406
+ if (p && p !== "." && p !== ".." && p !== "**") {
407
+ didSomething = true;
408
+ const needDot = dd === 1 && parts[dd + 1] === "**";
409
+ const splin = needDot ? ["."] : [];
410
+ parts.splice(dd - 1, 2, ...splin);
411
+ if (parts.length === 0)
412
+ parts.push("");
413
+ dd -= 2;
414
+ }
415
+ }
416
+ }
417
+ } while (didSomething);
418
+ return globParts;
419
+ }
420
+ // second phase: multi-pattern dedupes
421
+ // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
422
+ // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
423
+ // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
424
+ //
425
+ // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
426
+ // ^-- not valid because ** doens't follow symlinks
427
+ secondPhasePreProcess(globParts) {
428
+ for (let i = 0; i < globParts.length - 1; i++) {
429
+ for (let j = i + 1; j < globParts.length; j++) {
430
+ const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
431
+ if (matched) {
432
+ globParts[i] = [];
433
+ globParts[j] = matched;
434
+ break;
435
+ }
436
+ }
437
+ }
438
+ return globParts.filter((gs) => gs.length);
439
+ }
440
+ partsMatch(a, b, emptyGSMatch = false) {
441
+ let ai = 0;
442
+ let bi = 0;
443
+ let result = [];
444
+ let which = "";
445
+ while (ai < a.length && bi < b.length) {
446
+ if (a[ai] === b[bi]) {
447
+ result.push(which === "b" ? b[bi] : a[ai]);
448
+ ai++;
449
+ bi++;
450
+ } else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
451
+ result.push(a[ai]);
452
+ ai++;
453
+ } else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
454
+ result.push(b[bi]);
455
+ bi++;
456
+ } else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
457
+ if (which === "b")
458
+ return false;
459
+ which = "a";
460
+ result.push(a[ai]);
461
+ ai++;
462
+ bi++;
463
+ } else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
464
+ if (which === "a")
465
+ return false;
466
+ which = "b";
467
+ result.push(b[bi]);
468
+ ai++;
469
+ bi++;
470
+ } else {
471
+ return false;
472
+ }
473
+ }
474
+ return a.length === b.length && result;
475
+ }
476
+ parseNegate() {
477
+ if (this.nonegate)
478
+ return;
479
+ const pattern = this.pattern;
480
+ let negate = false;
481
+ let negateOffset = 0;
482
+ for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++) {
483
+ negate = !negate;
484
+ negateOffset++;
485
+ }
486
+ if (negateOffset)
487
+ this.pattern = pattern.slice(negateOffset);
488
+ this.negate = negate;
489
+ }
490
+ // set partial to true to test if, for example,
491
+ // "/a/b" matches the start of "/*/b/*/d"
492
+ // Partial means, if you run out of file before you run
493
+ // out of pattern, then that's fine, as long as all
494
+ // the parts match.
495
+ matchOne(file, pattern, partial = false) {
496
+ const options = this.options;
497
+ if (this.isWindows) {
498
+ const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
499
+ const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
500
+ const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
501
+ const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
502
+ const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
503
+ const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
504
+ if (typeof fdi === "number" && typeof pdi === "number") {
505
+ const [fd, pd] = [file[fdi], pattern[pdi]];
506
+ if (fd.toLowerCase() === pd.toLowerCase()) {
507
+ pattern[pdi] = fd;
508
+ if (pdi > fdi) {
509
+ pattern = pattern.slice(pdi);
510
+ } else if (fdi > pdi) {
511
+ file = file.slice(fdi);
512
+ }
513
+ }
514
+ }
515
+ }
516
+ const { optimizationLevel = 1 } = this.options;
517
+ if (optimizationLevel >= 2) {
518
+ file = this.levelTwoFileOptimize(file);
519
+ }
520
+ this.debug("matchOne", this, { file, pattern });
521
+ this.debug("matchOne", file.length, pattern.length);
522
+ for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
523
+ this.debug("matchOne loop");
524
+ var p = pattern[pi];
525
+ var f = file[fi];
526
+ this.debug(pattern, p, f);
527
+ if (p === false) {
528
+ return false;
529
+ }
530
+ if (p === GLOBSTAR) {
531
+ this.debug("GLOBSTAR", [pattern, p, f]);
532
+ var fr = fi;
533
+ var pr = pi + 1;
534
+ if (pr === pl) {
535
+ this.debug("** at the end");
536
+ for (; fi < fl; fi++) {
537
+ if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
538
+ return false;
539
+ }
540
+ return true;
541
+ }
542
+ while (fr < fl) {
543
+ var swallowee = file[fr];
544
+ this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
545
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
546
+ this.debug("globstar found match!", fr, fl, swallowee);
547
+ return true;
548
+ } else {
549
+ if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
550
+ this.debug("dot detected!", file, fr, pattern, pr);
551
+ break;
552
+ }
553
+ this.debug("globstar swallow a segment, and continue");
554
+ fr++;
555
+ }
556
+ }
557
+ if (partial) {
558
+ this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
559
+ if (fr === fl) {
560
+ return true;
561
+ }
562
+ }
563
+ return false;
564
+ }
565
+ let hit;
566
+ if (typeof p === "string") {
567
+ hit = f === p;
568
+ this.debug("string match", p, f, hit);
569
+ } else {
570
+ hit = p.test(f);
571
+ this.debug("pattern match", p, f, hit);
572
+ }
573
+ if (!hit)
574
+ return false;
575
+ }
576
+ if (fi === fl && pi === pl) {
577
+ return true;
578
+ } else if (fi === fl) {
579
+ return partial;
580
+ } else if (pi === pl) {
581
+ return fi === fl - 1 && file[fi] === "";
582
+ } else {
583
+ throw new Error("wtf?");
584
+ }
585
+ }
586
+ braceExpand() {
587
+ return braceExpand(this.pattern, this.options);
588
+ }
589
+ parse(pattern) {
590
+ assertValidPattern.assertValidPattern(pattern);
591
+ const options = this.options;
592
+ if (pattern === "**")
593
+ return GLOBSTAR;
594
+ if (pattern === "")
595
+ return "";
596
+ let m;
597
+ let fastTest = null;
598
+ if (m = pattern.match(starRE)) {
599
+ fastTest = options.dot ? starTestDot : starTest;
600
+ } else if (m = pattern.match(starDotExtRE)) {
601
+ fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
602
+ } else if (m = pattern.match(qmarksRE)) {
603
+ fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
604
+ } else if (m = pattern.match(starDotStarRE)) {
605
+ fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
606
+ } else if (m = pattern.match(dotStarRE)) {
607
+ fastTest = dotStarTest;
608
+ }
609
+ const re = ast.AST.fromGlob(pattern, this.options).toMMPattern();
610
+ if (fastTest && typeof re === "object") {
611
+ Reflect.defineProperty(re, "test", { value: fastTest });
612
+ }
613
+ return re;
614
+ }
615
+ makeRe() {
616
+ if (this.regexp || this.regexp === false)
617
+ return this.regexp;
618
+ const set = this.set;
619
+ if (!set.length) {
620
+ this.regexp = false;
621
+ return this.regexp;
622
+ }
623
+ const options = this.options;
624
+ const twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
625
+ const flags = new Set(options.nocase ? ["i"] : []);
626
+ let re = set.map((pattern) => {
627
+ const pp = pattern.map((p) => {
628
+ if (p instanceof RegExp) {
629
+ for (const f of p.flags.split(""))
630
+ flags.add(f);
631
+ }
632
+ return typeof p === "string" ? regExpEscape(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
633
+ });
634
+ pp.forEach((p, i) => {
635
+ const next = pp[i + 1];
636
+ const prev = pp[i - 1];
637
+ if (p !== GLOBSTAR || prev === GLOBSTAR) {
638
+ return;
639
+ }
640
+ if (prev === void 0) {
641
+ if (next !== void 0 && next !== GLOBSTAR) {
642
+ pp[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
643
+ } else {
644
+ pp[i] = twoStar;
645
+ }
646
+ } else if (next === void 0) {
647
+ pp[i - 1] = prev + "(?:\\/|" + twoStar + ")?";
648
+ } else if (next !== GLOBSTAR) {
649
+ pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
650
+ pp[i + 1] = GLOBSTAR;
651
+ }
652
+ });
653
+ return pp.filter((p) => p !== GLOBSTAR).join("/");
654
+ }).join("|");
655
+ const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
656
+ re = "^" + open + re + close + "$";
657
+ if (this.negate)
658
+ re = "^(?!" + re + ").+$";
659
+ try {
660
+ this.regexp = new RegExp(re, [...flags].join(""));
661
+ } catch (ex) {
662
+ this.regexp = false;
663
+ }
664
+ return this.regexp;
665
+ }
666
+ slashSplit(p) {
667
+ if (this.preserveMultipleSlashes) {
668
+ return p.split("/");
669
+ } else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
670
+ return ["", ...p.split(/\/+/)];
671
+ } else {
672
+ return p.split(/\/+/);
673
+ }
674
+ }
675
+ match(f, partial = this.partial) {
676
+ this.debug("match", f, this.pattern);
677
+ if (this.comment) {
678
+ return false;
679
+ }
680
+ if (this.empty) {
681
+ return f === "";
682
+ }
683
+ if (f === "/" && partial) {
684
+ return true;
685
+ }
686
+ const options = this.options;
687
+ if (this.isWindows) {
688
+ f = f.split("\\").join("/");
689
+ }
690
+ const ff = this.slashSplit(f);
691
+ this.debug(this.pattern, "split", ff);
692
+ const set = this.set;
693
+ this.debug(this.pattern, "set", set);
694
+ let filename = ff[ff.length - 1];
695
+ if (!filename) {
696
+ for (let i = ff.length - 2; !filename && i >= 0; i--) {
697
+ filename = ff[i];
698
+ }
699
+ }
700
+ for (let i = 0; i < set.length; i++) {
701
+ const pattern = set[i];
702
+ let file = ff;
703
+ if (options.matchBase && pattern.length === 1) {
704
+ file = [filename];
705
+ }
706
+ const hit = this.matchOne(file, pattern, partial);
707
+ if (hit) {
708
+ if (options.flipNegate) {
709
+ return true;
710
+ }
711
+ return !this.negate;
712
+ }
713
+ }
714
+ if (options.flipNegate) {
715
+ return false;
716
+ }
717
+ return this.negate;
718
+ }
719
+ static defaults(def) {
720
+ return minimatch.defaults(def).Minimatch;
721
+ }
722
+ }
723
+ minimatch.AST = ast.AST;
724
+ minimatch.Minimatch = Minimatch;
725
+ minimatch.escape = escape.escape;
726
+ minimatch.unescape = unescape.unescape;
727
+ exports.AST = ast.AST;
728
+ exports.escape = escape.escape;
729
+ exports.unescape = unescape.unescape;
730
+ exports.GLOBSTAR = GLOBSTAR;
731
+ exports.Minimatch = Minimatch;
732
+ exports.braceExpand = braceExpand;
733
+ exports.defaults = defaults;
734
+ exports.filter = filter;
735
+ exports.makeRe = makeRe;
736
+ exports.match = match;
737
+ exports.minimatch = minimatch;
738
+ exports.sep = sep;