@powerlines/plugin-rspack 0.5.231 → 0.5.232

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