@powerlines/plugin-rspack 0.5.298 → 0.5.300

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 (114) hide show
  1. package/dist/core/src/lib/logger.mjs +40 -0
  2. package/dist/core/src/lib/logger.mjs.map +1 -0
  3. package/dist/core/src/lib/unplugin/helpers.mjs +19 -0
  4. package/dist/core/src/lib/unplugin/helpers.mjs.map +1 -0
  5. package/dist/core/src/lib/unplugin/index.mjs +5 -0
  6. package/dist/core/src/lib/unplugin/module-resolution.mjs +66 -0
  7. package/dist/core/src/lib/unplugin/module-resolution.mjs.map +1 -0
  8. package/dist/core/src/lib/unplugin/plugin.mjs +71 -0
  9. package/dist/core/src/lib/unplugin/plugin.mjs.map +1 -0
  10. package/dist/core/src/lib/utilities/source-file.mjs +22 -0
  11. package/dist/core/src/lib/utilities/source-file.mjs.map +1 -0
  12. package/dist/core/src/types/api.d.mts +103 -0
  13. package/dist/core/src/types/api.d.mts.map +1 -0
  14. package/dist/core/src/types/commands.d.mts +10 -0
  15. package/dist/core/src/types/commands.d.mts.map +1 -0
  16. package/dist/core/src/types/config.d.mts +551 -0
  17. package/dist/core/src/types/config.d.mts.map +1 -0
  18. package/dist/core/src/types/context.d.mts +511 -0
  19. package/dist/core/src/types/context.d.mts.map +1 -0
  20. package/dist/core/src/types/fs.d.mts +487 -0
  21. package/dist/core/src/types/fs.d.mts.map +1 -0
  22. package/dist/core/src/types/hooks.d.mts +99 -0
  23. package/dist/core/src/types/hooks.d.mts.map +1 -0
  24. package/dist/core/src/types/index.d.mts +9 -0
  25. package/dist/core/src/types/plugin.d.mts +204 -0
  26. package/dist/core/src/types/plugin.d.mts.map +1 -0
  27. package/dist/core/src/types/tsconfig.d.mts +70 -0
  28. package/dist/core/src/types/tsconfig.d.mts.map +1 -0
  29. package/dist/core/src/types/unplugin.d.mts +25 -0
  30. package/dist/core/src/types/unplugin.d.mts.map +1 -0
  31. package/dist/core/src/types/unplugin.mjs +22 -0
  32. package/dist/core/src/types/unplugin.mjs.map +1 -0
  33. package/dist/helpers/index.d.mts +2 -1
  34. package/dist/helpers/index.mjs +2 -1
  35. package/dist/helpers/resolve-options.d.mts +16 -0
  36. package/dist/helpers/resolve-options.d.mts.map +1 -0
  37. package/dist/helpers/resolve-options.mjs +37 -0
  38. package/dist/helpers/resolve-options.mjs.map +1 -0
  39. package/dist/helpers/unplugin.mjs +3 -2
  40. package/dist/helpers/unplugin.mjs.map +1 -1
  41. package/dist/index.d.mts +6 -3
  42. package/dist/index.d.mts.map +1 -1
  43. package/dist/index.mjs +3 -3
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/types/build.d.mts +8 -0
  46. package/dist/types/build.d.mts.map +1 -0
  47. package/dist/types/build.mjs +1 -0
  48. package/dist/types/index.d.mts +3 -2
  49. package/dist/types/plugin.d.mts +13 -6
  50. package/dist/types/plugin.d.mts.map +1 -1
  51. package/package.json +27 -98
  52. package/dist/_virtual/rolldown_runtime.cjs +0 -31
  53. package/dist/_virtual/rolldown_runtime.mjs +0 -32
  54. package/dist/helpers/index.cjs +0 -3
  55. package/dist/helpers/index.d.cts +0 -2
  56. package/dist/helpers/unplugin.cjs +0 -11
  57. package/dist/helpers/unplugin.d.cts +0 -8
  58. package/dist/helpers/unplugin.d.cts.map +0 -1
  59. package/dist/index.cjs +0 -37
  60. package/dist/index.d.cts +0 -14
  61. package/dist/index.d.cts.map +0 -1
  62. package/dist/node_modules/.pnpm/@jridgewell_gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.cjs +0 -2
  63. package/dist/node_modules/.pnpm/@jridgewell_gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs +0 -4
  64. package/dist/node_modules/.pnpm/@jridgewell_remapping@2.3.5/node_modules/@jridgewell/remapping/dist/remapping.cjs +0 -2
  65. package/dist/node_modules/.pnpm/@jridgewell_remapping@2.3.5/node_modules/@jridgewell/remapping/dist/remapping.mjs +0 -4
  66. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +0 -15
  67. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +0 -16
  68. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +0 -1
  69. package/dist/node_modules/.pnpm/@jridgewell_trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.cjs +0 -1
  70. package/dist/node_modules/.pnpm/@jridgewell_trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs +0 -3
  71. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.cjs +0 -28
  72. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.mjs +0 -24
  73. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.mjs.map +0 -1
  74. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.cjs +0 -175
  75. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.mjs +0 -171
  76. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.mjs.map +0 -1
  77. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.cjs +0 -871
  78. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.mjs +0 -867
  79. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.mjs.map +0 -1
  80. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.cjs +0 -307
  81. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.mjs +0 -303
  82. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.mjs.map +0 -1
  83. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.cjs +0 -300
  84. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.mjs +0 -296
  85. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.mjs.map +0 -1
  86. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.cjs +0 -60
  87. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.mjs +0 -56
  88. package/dist/node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.mjs.map +0 -1
  89. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/context-CehLHpzV.cjs +0 -46
  90. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/context-CehLHpzV.mjs +0 -45
  91. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/context-CehLHpzV.mjs.map +0 -1
  92. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/index.cjs +0 -142
  93. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/index.mjs +0 -141
  94. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/index.mjs.map +0 -1
  95. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/parse-CRORloGP.cjs +0 -114
  96. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/parse-CRORloGP.mjs +0 -113
  97. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/parse-CRORloGP.mjs.map +0 -1
  98. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/utils-CuyC8gTr.cjs +0 -59
  99. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/utils-CuyC8gTr.mjs +0 -55
  100. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/utils-CuyC8gTr.mjs.map +0 -1
  101. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/webpack-like-BU9ULG6P.cjs +0 -35
  102. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/webpack-like-BU9ULG6P.mjs +0 -34
  103. package/dist/node_modules/.pnpm/unplugin@3.0.0-beta.3/node_modules/unplugin/dist/webpack-like-BU9ULG6P.mjs.map +0 -1
  104. package/dist/node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/index.cjs +0 -236
  105. package/dist/node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/index.mjs +0 -232
  106. package/dist/node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/index.mjs.map +0 -1
  107. package/dist/node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/virtual-stats.cjs +0 -54
  108. package/dist/node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/virtual-stats.mjs +0 -50
  109. package/dist/node_modules/.pnpm/webpack-virtual-modules@0.6.2/node_modules/webpack-virtual-modules/lib/virtual-stats.mjs.map +0 -1
  110. package/dist/types/index.cjs +0 -0
  111. package/dist/types/index.d.cts +0 -2
  112. package/dist/types/plugin.cjs +0 -0
  113. package/dist/types/plugin.d.cts +0 -14
  114. package/dist/types/plugin.d.cts.map +0 -1
@@ -1,303 +0,0 @@
1
- import { __commonJSMin } from "../../../../../../_virtual/rolldown_runtime.mjs";
2
- import { require_constants } from "./constants.mjs";
3
- import { require_utils } from "./utils.mjs";
4
- import { require_scan } from "./scan.mjs";
5
- import { require_parse } from "./parse.mjs";
6
-
7
- //#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js
8
- var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
9
- const scan = require_scan();
10
- const parse = require_parse();
11
- const utils = require_utils();
12
- const constants = require_constants();
13
- const isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
14
- /**
15
- * Creates a matcher function from one or more glob patterns. The
16
- * returned function takes a string to match as its first argument,
17
- * and returns true if the string is a match. The returned matcher
18
- * function also takes a boolean as the second argument that, when true,
19
- * returns an object with additional information.
20
- *
21
- * ```js
22
- * const picomatch = require('picomatch');
23
- * // picomatch(glob[, options]);
24
- *
25
- * const isMatch = picomatch('*.!(*a)');
26
- * console.log(isMatch('a.a')); //=> false
27
- * console.log(isMatch('a.b')); //=> true
28
- * ```
29
- * @name picomatch
30
- * @param {String|Array} `globs` One or more glob patterns.
31
- * @param {Object=} `options`
32
- * @return {Function=} Returns a matcher function.
33
- * @api public
34
- */
35
- const picomatch = (glob, options, returnState = false) => {
36
- if (Array.isArray(glob)) {
37
- const fns = glob.map((input) => picomatch(input, options, returnState));
38
- const arrayMatcher = (str) => {
39
- for (const isMatch of fns) {
40
- const state$1 = isMatch(str);
41
- if (state$1) return state$1;
42
- }
43
- return false;
44
- };
45
- return arrayMatcher;
46
- }
47
- const isState = isObject(glob) && glob.tokens && glob.input;
48
- if (glob === "" || typeof glob !== "string" && !isState) throw new TypeError("Expected pattern to be a non-empty string");
49
- const opts = options || {};
50
- const posix = opts.windows;
51
- const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
52
- const state = regex.state;
53
- delete regex.state;
54
- let isIgnored = () => false;
55
- if (opts.ignore) {
56
- const ignoreOpts = {
57
- ...options,
58
- ignore: null,
59
- onMatch: null,
60
- onResult: null
61
- };
62
- isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
63
- }
64
- const matcher = (input, returnObject = false) => {
65
- const { isMatch, match, output } = picomatch.test(input, regex, options, {
66
- glob,
67
- posix
68
- });
69
- const result = {
70
- glob,
71
- state,
72
- regex,
73
- posix,
74
- input,
75
- output,
76
- match,
77
- isMatch
78
- };
79
- if (typeof opts.onResult === "function") opts.onResult(result);
80
- if (isMatch === false) {
81
- result.isMatch = false;
82
- return returnObject ? result : false;
83
- }
84
- if (isIgnored(input)) {
85
- if (typeof opts.onIgnore === "function") opts.onIgnore(result);
86
- result.isMatch = false;
87
- return returnObject ? result : false;
88
- }
89
- if (typeof opts.onMatch === "function") opts.onMatch(result);
90
- return returnObject ? result : true;
91
- };
92
- if (returnState) matcher.state = state;
93
- return matcher;
94
- };
95
- /**
96
- * Test `input` with the given `regex`. This is used by the main
97
- * `picomatch()` function to test the input string.
98
- *
99
- * ```js
100
- * const picomatch = require('picomatch');
101
- * // picomatch.test(input, regex[, options]);
102
- *
103
- * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
104
- * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
105
- * ```
106
- * @param {String} `input` String to test.
107
- * @param {RegExp} `regex`
108
- * @return {Object} Returns an object with matching info.
109
- * @api public
110
- */
111
- picomatch.test = (input, regex, options, { glob, posix } = {}) => {
112
- if (typeof input !== "string") throw new TypeError("Expected input to be a string");
113
- if (input === "") return {
114
- isMatch: false,
115
- output: ""
116
- };
117
- const opts = options || {};
118
- const format = opts.format || (posix ? utils.toPosixSlashes : null);
119
- let match = input === glob;
120
- let output = match && format ? format(input) : input;
121
- if (match === false) {
122
- output = format ? format(input) : input;
123
- match = output === glob;
124
- }
125
- if (match === false || opts.capture === true) if (opts.matchBase === true || opts.basename === true) match = picomatch.matchBase(input, regex, options, posix);
126
- else match = regex.exec(output);
127
- return {
128
- isMatch: Boolean(match),
129
- match,
130
- output
131
- };
132
- };
133
- /**
134
- * Match the basename of a filepath.
135
- *
136
- * ```js
137
- * const picomatch = require('picomatch');
138
- * // picomatch.matchBase(input, glob[, options]);
139
- * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
140
- * ```
141
- * @param {String} `input` String to test.
142
- * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
143
- * @return {Boolean}
144
- * @api public
145
- */
146
- picomatch.matchBase = (input, glob, options) => {
147
- return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input));
148
- };
149
- /**
150
- * Returns true if **any** of the given glob `patterns` match the specified `string`.
151
- *
152
- * ```js
153
- * const picomatch = require('picomatch');
154
- * // picomatch.isMatch(string, patterns[, options]);
155
- *
156
- * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
157
- * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
158
- * ```
159
- * @param {String|Array} str The string to test.
160
- * @param {String|Array} patterns One or more glob patterns to use for matching.
161
- * @param {Object} [options] See available [options](#options).
162
- * @return {Boolean} Returns true if any patterns match `str`
163
- * @api public
164
- */
165
- picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
166
- /**
167
- * Parse a glob pattern to create the source string for a regular
168
- * expression.
169
- *
170
- * ```js
171
- * const picomatch = require('picomatch');
172
- * const result = picomatch.parse(pattern[, options]);
173
- * ```
174
- * @param {String} `pattern`
175
- * @param {Object} `options`
176
- * @return {Object} Returns an object with useful properties and output to be used as a regex source string.
177
- * @api public
178
- */
179
- picomatch.parse = (pattern, options) => {
180
- if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
181
- return parse(pattern, {
182
- ...options,
183
- fastpaths: false
184
- });
185
- };
186
- /**
187
- * Scan a glob pattern to separate the pattern into segments.
188
- *
189
- * ```js
190
- * const picomatch = require('picomatch');
191
- * // picomatch.scan(input[, options]);
192
- *
193
- * const result = picomatch.scan('!./foo/*.js');
194
- * console.log(result);
195
- * { prefix: '!./',
196
- * input: '!./foo/*.js',
197
- * start: 3,
198
- * base: 'foo',
199
- * glob: '*.js',
200
- * isBrace: false,
201
- * isBracket: false,
202
- * isGlob: true,
203
- * isExtglob: false,
204
- * isGlobstar: false,
205
- * negated: true }
206
- * ```
207
- * @param {String} `input` Glob pattern to scan.
208
- * @param {Object} `options`
209
- * @return {Object} Returns an object with
210
- * @api public
211
- */
212
- picomatch.scan = (input, options) => scan(input, options);
213
- /**
214
- * Compile a regular expression from the `state` object returned by the
215
- * [parse()](#parse) method.
216
- *
217
- * @param {Object} `state`
218
- * @param {Object} `options`
219
- * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.
220
- * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.
221
- * @return {RegExp}
222
- * @api public
223
- */
224
- picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
225
- if (returnOutput === true) return state.output;
226
- const opts = options || {};
227
- const prepend = opts.contains ? "" : "^";
228
- const append = opts.contains ? "" : "$";
229
- let source = `${prepend}(?:${state.output})${append}`;
230
- if (state && state.negated === true) source = `^(?!${source}).*$`;
231
- const regex = picomatch.toRegex(source, options);
232
- if (returnState === true) regex.state = state;
233
- return regex;
234
- };
235
- /**
236
- * Create a regular expression from a parsed glob pattern.
237
- *
238
- * ```js
239
- * const picomatch = require('picomatch');
240
- * const state = picomatch.parse('*.js');
241
- * // picomatch.compileRe(state[, options]);
242
- *
243
- * console.log(picomatch.compileRe(state));
244
- * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
245
- * ```
246
- * @param {String} `state` The object returned from the `.parse` method.
247
- * @param {Object} `options`
248
- * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
249
- * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
250
- * @return {RegExp} Returns a regex created from the given pattern.
251
- * @api public
252
- */
253
- picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
254
- if (!input || typeof input !== "string") throw new TypeError("Expected a non-empty string");
255
- let parsed = {
256
- negated: false,
257
- fastpaths: true
258
- };
259
- if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) parsed.output = parse.fastpaths(input, options);
260
- if (!parsed.output) parsed = parse(input, options);
261
- return picomatch.compileRe(parsed, options, returnOutput, returnState);
262
- };
263
- /**
264
- * Create a regular expression from the given regex source string.
265
- *
266
- * ```js
267
- * const picomatch = require('picomatch');
268
- * // picomatch.toRegex(source[, options]);
269
- *
270
- * const { output } = picomatch.parse('*.js');
271
- * console.log(picomatch.toRegex(output));
272
- * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
273
- * ```
274
- * @param {String} `source` Regular expression source string.
275
- * @param {Object} `options`
276
- * @return {RegExp}
277
- * @api public
278
- */
279
- picomatch.toRegex = (source, options) => {
280
- try {
281
- const opts = options || {};
282
- return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
283
- } catch (err) {
284
- if (options && options.debug === true) throw err;
285
- return /$^/;
286
- }
287
- };
288
- /**
289
- * Picomatch constants.
290
- * @return {Object}
291
- */
292
- picomatch.constants = constants;
293
- /**
294
- * Expose "picomatch"
295
- */
296
- module.exports = picomatch;
297
- }));
298
-
299
- //#endregion
300
- export default require_picomatch();
301
-
302
- export { require_picomatch };
303
- //# sourceMappingURL=picomatch.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"picomatch.mjs","names":["state"],"sources":["../../../../../../../../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js"],"sourcesContent":["'use strict';\n\nconst scan = require('./scan');\nconst parse = require('./parse');\nconst utils = require('./utils');\nconst constants = require('./constants');\nconst isObject = val => val && typeof val === 'object' && !Array.isArray(val);\n\n/**\n * Creates a matcher function from one or more glob patterns. The\n * returned function takes a string to match as its first argument,\n * and returns true if the string is a match. The returned matcher\n * function also takes a boolean as the second argument that, when true,\n * returns an object with additional information.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch(glob[, options]);\n *\n * const isMatch = picomatch('*.!(*a)');\n * console.log(isMatch('a.a')); //=> false\n * console.log(isMatch('a.b')); //=> true\n * ```\n * @name picomatch\n * @param {String|Array} `globs` One or more glob patterns.\n * @param {Object=} `options`\n * @return {Function=} Returns a matcher function.\n * @api public\n */\n\nconst picomatch = (glob, options, returnState = false) => {\n if (Array.isArray(glob)) {\n const fns = glob.map(input => picomatch(input, options, returnState));\n const arrayMatcher = str => {\n for (const isMatch of fns) {\n const state = isMatch(str);\n if (state) return state;\n }\n return false;\n };\n return arrayMatcher;\n }\n\n const isState = isObject(glob) && glob.tokens && glob.input;\n\n if (glob === '' || (typeof glob !== 'string' && !isState)) {\n throw new TypeError('Expected pattern to be a non-empty string');\n }\n\n const opts = options || {};\n const posix = opts.windows;\n const regex = isState\n ? picomatch.compileRe(glob, options)\n : picomatch.makeRe(glob, options, false, true);\n\n const state = regex.state;\n delete regex.state;\n\n let isIgnored = () => false;\n if (opts.ignore) {\n const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };\n isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);\n }\n\n const matcher = (input, returnObject = false) => {\n const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });\n const result = { glob, state, regex, posix, input, output, match, isMatch };\n\n if (typeof opts.onResult === 'function') {\n opts.onResult(result);\n }\n\n if (isMatch === false) {\n result.isMatch = false;\n return returnObject ? result : false;\n }\n\n if (isIgnored(input)) {\n if (typeof opts.onIgnore === 'function') {\n opts.onIgnore(result);\n }\n result.isMatch = false;\n return returnObject ? result : false;\n }\n\n if (typeof opts.onMatch === 'function') {\n opts.onMatch(result);\n }\n return returnObject ? result : true;\n };\n\n if (returnState) {\n matcher.state = state;\n }\n\n return matcher;\n};\n\n/**\n * Test `input` with the given `regex`. This is used by the main\n * `picomatch()` function to test the input string.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.test(input, regex[, options]);\n *\n * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\\/([^/]*?))$/));\n * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }\n * ```\n * @param {String} `input` String to test.\n * @param {RegExp} `regex`\n * @return {Object} Returns an object with matching info.\n * @api public\n */\n\npicomatch.test = (input, regex, options, { glob, posix } = {}) => {\n if (typeof input !== 'string') {\n throw new TypeError('Expected input to be a string');\n }\n\n if (input === '') {\n return { isMatch: false, output: '' };\n }\n\n const opts = options || {};\n const format = opts.format || (posix ? utils.toPosixSlashes : null);\n let match = input === glob;\n let output = (match && format) ? format(input) : input;\n\n if (match === false) {\n output = format ? format(input) : input;\n match = output === glob;\n }\n\n if (match === false || opts.capture === true) {\n if (opts.matchBase === true || opts.basename === true) {\n match = picomatch.matchBase(input, regex, options, posix);\n } else {\n match = regex.exec(output);\n }\n }\n\n return { isMatch: Boolean(match), match, output };\n};\n\n/**\n * Match the basename of a filepath.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.matchBase(input, glob[, options]);\n * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true\n * ```\n * @param {String} `input` String to test.\n * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).\n * @return {Boolean}\n * @api public\n */\n\npicomatch.matchBase = (input, glob, options) => {\n const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);\n return regex.test(utils.basename(input));\n};\n\n/**\n * Returns true if **any** of the given glob `patterns` match the specified `string`.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.isMatch(string, patterns[, options]);\n *\n * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true\n * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false\n * ```\n * @param {String|Array} str The string to test.\n * @param {String|Array} patterns One or more glob patterns to use for matching.\n * @param {Object} [options] See available [options](#options).\n * @return {Boolean} Returns true if any patterns match `str`\n * @api public\n */\n\npicomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);\n\n/**\n * Parse a glob pattern to create the source string for a regular\n * expression.\n *\n * ```js\n * const picomatch = require('picomatch');\n * const result = picomatch.parse(pattern[, options]);\n * ```\n * @param {String} `pattern`\n * @param {Object} `options`\n * @return {Object} Returns an object with useful properties and output to be used as a regex source string.\n * @api public\n */\n\npicomatch.parse = (pattern, options) => {\n if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));\n return parse(pattern, { ...options, fastpaths: false });\n};\n\n/**\n * Scan a glob pattern to separate the pattern into segments.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.scan(input[, options]);\n *\n * const result = picomatch.scan('!./foo/*.js');\n * console.log(result);\n * { prefix: '!./',\n * input: '!./foo/*.js',\n * start: 3,\n * base: 'foo',\n * glob: '*.js',\n * isBrace: false,\n * isBracket: false,\n * isGlob: true,\n * isExtglob: false,\n * isGlobstar: false,\n * negated: true }\n * ```\n * @param {String} `input` Glob pattern to scan.\n * @param {Object} `options`\n * @return {Object} Returns an object with\n * @api public\n */\n\npicomatch.scan = (input, options) => scan(input, options);\n\n/**\n * Compile a regular expression from the `state` object returned by the\n * [parse()](#parse) method.\n *\n * @param {Object} `state`\n * @param {Object} `options`\n * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.\n * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.\n * @return {RegExp}\n * @api public\n */\n\npicomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {\n if (returnOutput === true) {\n return state.output;\n }\n\n const opts = options || {};\n const prepend = opts.contains ? '' : '^';\n const append = opts.contains ? '' : '$';\n\n let source = `${prepend}(?:${state.output})${append}`;\n if (state && state.negated === true) {\n source = `^(?!${source}).*$`;\n }\n\n const regex = picomatch.toRegex(source, options);\n if (returnState === true) {\n regex.state = state;\n }\n\n return regex;\n};\n\n/**\n * Create a regular expression from a parsed glob pattern.\n *\n * ```js\n * const picomatch = require('picomatch');\n * const state = picomatch.parse('*.js');\n * // picomatch.compileRe(state[, options]);\n *\n * console.log(picomatch.compileRe(state));\n * //=> /^(?:(?!\\.)(?=.)[^/]*?\\.js)$/\n * ```\n * @param {String} `state` The object returned from the `.parse` method.\n * @param {Object} `options`\n * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.\n * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.\n * @return {RegExp} Returns a regex created from the given pattern.\n * @api public\n */\n\npicomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {\n if (!input || typeof input !== 'string') {\n throw new TypeError('Expected a non-empty string');\n }\n\n let parsed = { negated: false, fastpaths: true };\n\n if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {\n parsed.output = parse.fastpaths(input, options);\n }\n\n if (!parsed.output) {\n parsed = parse(input, options);\n }\n\n return picomatch.compileRe(parsed, options, returnOutput, returnState);\n};\n\n/**\n * Create a regular expression from the given regex source string.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.toRegex(source[, options]);\n *\n * const { output } = picomatch.parse('*.js');\n * console.log(picomatch.toRegex(output));\n * //=> /^(?:(?!\\.)(?=.)[^/]*?\\.js)$/\n * ```\n * @param {String} `source` Regular expression source string.\n * @param {Object} `options`\n * @return {RegExp}\n * @api public\n */\n\npicomatch.toRegex = (source, options) => {\n try {\n const opts = options || {};\n return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));\n } catch (err) {\n if (options && options.debug === true) throw err;\n return /$^/;\n }\n};\n\n/**\n * Picomatch constants.\n * @return {Object}\n */\n\npicomatch.constants = constants;\n\n/**\n * Expose \"picomatch\"\n */\n\nmodule.exports = picomatch;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;CAEA,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM,YAAW,QAAO,OAAO,OAAO,QAAQ,YAAY,CAAC,MAAM,QAAQ,IAAI;;;;;;;;;;;;;;;;;;;;;;CAwB7E,MAAM,aAAa,MAAM,SAAS,cAAc,UAAU;AACxD,MAAI,MAAM,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../../../../../../_virtual/rolldown_runtime.cjs');
4
- const require_constants$1 = require('./constants.cjs');
5
- const require_utils$1 = require('./utils.cjs');
6
-
7
- //#region ../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.js
8
- var require_scan = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports, module) => {
9
- const utils = require_utils$1.default;
10
- const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants$1.default;
11
- const isPathSeparator = (code) => {
12
- return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
13
- };
14
- const depth = (token) => {
15
- if (token.isPrefix !== true) token.depth = token.isGlobstar ? Infinity : 1;
16
- };
17
- /**
18
- * Quickly scans a glob pattern and returns an object with a handful of
19
- * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
20
- * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
21
- * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
22
- *
23
- * ```js
24
- * const pm = require('picomatch');
25
- * console.log(pm.scan('foo/bar/*.js'));
26
- * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
27
- * ```
28
- * @param {String} `str`
29
- * @param {Object} `options`
30
- * @return {Object} Returns an object with tokens and regex source string.
31
- * @api public
32
- */
33
- const scan = (input, options) => {
34
- const opts = options || {};
35
- const length = input.length - 1;
36
- const scanToEnd = opts.parts === true || opts.scanToEnd === true;
37
- const slashes = [];
38
- const tokens = [];
39
- const parts = [];
40
- let str = input;
41
- let index = -1;
42
- let start = 0;
43
- let lastIndex = 0;
44
- let isBrace = false;
45
- let isBracket = false;
46
- let isGlob = false;
47
- let isExtglob = false;
48
- let isGlobstar = false;
49
- let braceEscaped = false;
50
- let backslashes = false;
51
- let negated = false;
52
- let negatedExtglob = false;
53
- let finished = false;
54
- let braces = 0;
55
- let prev;
56
- let code;
57
- let token = {
58
- value: "",
59
- depth: 0,
60
- isGlob: false
61
- };
62
- const eos = () => index >= length;
63
- const peek = () => str.charCodeAt(index + 1);
64
- const advance = () => {
65
- prev = code;
66
- return str.charCodeAt(++index);
67
- };
68
- while (index < length) {
69
- code = advance();
70
- let next;
71
- if (code === CHAR_BACKWARD_SLASH) {
72
- backslashes = token.backslashes = true;
73
- code = advance();
74
- if (code === CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
75
- continue;
76
- }
77
- if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
78
- braces++;
79
- while (eos() !== true && (code = advance())) {
80
- if (code === CHAR_BACKWARD_SLASH) {
81
- backslashes = token.backslashes = true;
82
- advance();
83
- continue;
84
- }
85
- if (code === CHAR_LEFT_CURLY_BRACE) {
86
- braces++;
87
- continue;
88
- }
89
- if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
90
- isBrace = token.isBrace = true;
91
- isGlob = token.isGlob = true;
92
- finished = true;
93
- if (scanToEnd === true) continue;
94
- break;
95
- }
96
- if (braceEscaped !== true && code === CHAR_COMMA) {
97
- isBrace = token.isBrace = true;
98
- isGlob = token.isGlob = true;
99
- finished = true;
100
- if (scanToEnd === true) continue;
101
- break;
102
- }
103
- if (code === CHAR_RIGHT_CURLY_BRACE) {
104
- braces--;
105
- if (braces === 0) {
106
- braceEscaped = false;
107
- isBrace = token.isBrace = true;
108
- finished = true;
109
- break;
110
- }
111
- }
112
- }
113
- if (scanToEnd === true) continue;
114
- break;
115
- }
116
- if (code === CHAR_FORWARD_SLASH) {
117
- slashes.push(index);
118
- tokens.push(token);
119
- token = {
120
- value: "",
121
- depth: 0,
122
- isGlob: false
123
- };
124
- if (finished === true) continue;
125
- if (prev === CHAR_DOT && index === start + 1) {
126
- start += 2;
127
- continue;
128
- }
129
- lastIndex = index + 1;
130
- continue;
131
- }
132
- if (opts.noext !== true) {
133
- if ((code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === true && peek() === CHAR_LEFT_PARENTHESES) {
134
- isGlob = token.isGlob = true;
135
- isExtglob = token.isExtglob = true;
136
- finished = true;
137
- if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
138
- if (scanToEnd === true) {
139
- while (eos() !== true && (code = advance())) {
140
- if (code === CHAR_BACKWARD_SLASH) {
141
- backslashes = token.backslashes = true;
142
- code = advance();
143
- continue;
144
- }
145
- if (code === CHAR_RIGHT_PARENTHESES) {
146
- isGlob = token.isGlob = true;
147
- finished = true;
148
- break;
149
- }
150
- }
151
- continue;
152
- }
153
- break;
154
- }
155
- }
156
- if (code === CHAR_ASTERISK) {
157
- if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
158
- isGlob = token.isGlob = true;
159
- finished = true;
160
- if (scanToEnd === true) continue;
161
- break;
162
- }
163
- if (code === CHAR_QUESTION_MARK) {
164
- isGlob = token.isGlob = true;
165
- finished = true;
166
- if (scanToEnd === true) continue;
167
- break;
168
- }
169
- if (code === CHAR_LEFT_SQUARE_BRACKET) {
170
- while (eos() !== true && (next = advance())) {
171
- if (next === CHAR_BACKWARD_SLASH) {
172
- backslashes = token.backslashes = true;
173
- advance();
174
- continue;
175
- }
176
- if (next === CHAR_RIGHT_SQUARE_BRACKET) {
177
- isBracket = token.isBracket = true;
178
- isGlob = token.isGlob = true;
179
- finished = true;
180
- break;
181
- }
182
- }
183
- if (scanToEnd === true) continue;
184
- break;
185
- }
186
- if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
187
- negated = token.negated = true;
188
- start++;
189
- continue;
190
- }
191
- if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
192
- isGlob = token.isGlob = true;
193
- if (scanToEnd === true) {
194
- while (eos() !== true && (code = advance())) {
195
- if (code === CHAR_LEFT_PARENTHESES) {
196
- backslashes = token.backslashes = true;
197
- code = advance();
198
- continue;
199
- }
200
- if (code === CHAR_RIGHT_PARENTHESES) {
201
- finished = true;
202
- break;
203
- }
204
- }
205
- continue;
206
- }
207
- break;
208
- }
209
- if (isGlob === true) {
210
- finished = true;
211
- if (scanToEnd === true) continue;
212
- break;
213
- }
214
- }
215
- if (opts.noext === true) {
216
- isExtglob = false;
217
- isGlob = false;
218
- }
219
- let base = str;
220
- let prefix = "";
221
- let glob = "";
222
- if (start > 0) {
223
- prefix = str.slice(0, start);
224
- str = str.slice(start);
225
- lastIndex -= start;
226
- }
227
- if (base && isGlob === true && lastIndex > 0) {
228
- base = str.slice(0, lastIndex);
229
- glob = str.slice(lastIndex);
230
- } else if (isGlob === true) {
231
- base = "";
232
- glob = str;
233
- } else base = str;
234
- if (base && base !== "" && base !== "/" && base !== str) {
235
- if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
236
- }
237
- if (opts.unescape === true) {
238
- if (glob) glob = utils.removeBackslashes(glob);
239
- if (base && backslashes === true) base = utils.removeBackslashes(base);
240
- }
241
- const state = {
242
- prefix,
243
- input,
244
- start,
245
- base,
246
- glob,
247
- isBrace,
248
- isBracket,
249
- isGlob,
250
- isExtglob,
251
- isGlobstar,
252
- negated,
253
- negatedExtglob
254
- };
255
- if (opts.tokens === true) {
256
- state.maxDepth = 0;
257
- if (!isPathSeparator(code)) tokens.push(token);
258
- state.tokens = tokens;
259
- }
260
- if (opts.parts === true || opts.tokens === true) {
261
- let prevIndex;
262
- for (let idx = 0; idx < slashes.length; idx++) {
263
- const n = prevIndex ? prevIndex + 1 : start;
264
- const i = slashes[idx];
265
- const value = input.slice(n, i);
266
- if (opts.tokens) {
267
- if (idx === 0 && start !== 0) {
268
- tokens[idx].isPrefix = true;
269
- tokens[idx].value = prefix;
270
- } else tokens[idx].value = value;
271
- depth(tokens[idx]);
272
- state.maxDepth += tokens[idx].depth;
273
- }
274
- if (idx !== 0 || value !== "") parts.push(value);
275
- prevIndex = i;
276
- }
277
- if (prevIndex && prevIndex + 1 < input.length) {
278
- const value = input.slice(prevIndex + 1);
279
- parts.push(value);
280
- if (opts.tokens) {
281
- tokens[tokens.length - 1].value = value;
282
- depth(tokens[tokens.length - 1]);
283
- state.maxDepth += tokens[tokens.length - 1].depth;
284
- }
285
- }
286
- state.slashes = slashes;
287
- state.parts = parts;
288
- }
289
- return state;
290
- };
291
- module.exports = scan;
292
- }));
293
-
294
- //#endregion
295
- Object.defineProperty(exports, 'default', {
296
- enumerable: true,
297
- get: function () {
298
- return require_scan();
299
- }
300
- });