@rsbuild/core 2.0.0-rc.1 → 2.0.0-rc.2

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 (44) hide show
  1. package/compiled/css-loader/index.js +2 -2
  2. package/compiled/html-rspack-plugin/index.js +14 -14
  3. package/compiled/postcss/index.js +1 -1
  4. package/compiled/postcss/lib/at-rule.d.ts +0 -1
  5. package/compiled/postcss/lib/comment.d.ts +0 -1
  6. package/compiled/postcss/lib/container.d.ts +1 -6
  7. package/compiled/postcss/lib/css-syntax-error.d.ts +0 -1
  8. package/compiled/postcss/lib/declaration.d.ts +0 -1
  9. package/compiled/postcss/lib/document.d.ts +0 -1
  10. package/compiled/postcss/lib/fromJSON.d.ts +1 -1
  11. package/compiled/postcss/lib/input.d.ts +0 -1
  12. package/compiled/postcss/lib/lazy-result.d.ts +3 -4
  13. package/compiled/postcss/lib/list.d.ts +1 -1
  14. package/compiled/postcss/lib/no-work-result.d.ts +0 -1
  15. package/compiled/postcss/lib/node.d.ts +0 -1
  16. package/compiled/postcss/lib/parse.d.ts +1 -1
  17. package/compiled/postcss/lib/postcss.d.ts +1 -3
  18. package/compiled/postcss/lib/previous-map.d.ts +0 -1
  19. package/compiled/postcss/lib/processor.d.ts +0 -1
  20. package/compiled/postcss/lib/result.d.ts +0 -1
  21. package/compiled/postcss/lib/root.d.ts +0 -1
  22. package/compiled/postcss/lib/rule.d.ts +12 -12
  23. package/compiled/postcss/lib/stringifier.d.ts +0 -1
  24. package/compiled/postcss/lib/stringify.d.ts +1 -1
  25. package/compiled/postcss/lib/warning.d.ts +0 -1
  26. package/compiled/postcss/license +1 -1
  27. package/compiled/postcss/package.json +1 -1
  28. package/compiled/postcss-loader/index.js +6 -6
  29. package/compiled/rspack-chain/package.json +1 -1
  30. package/compiled/rspack-chain/types/index.d.ts +3 -1
  31. package/dist/{863.js → 753.js} +101 -118
  32. package/dist/http-proxy-middleware.js +4 -4
  33. package/dist/index.js +1 -1
  34. package/dist/launch-editor-middleware.js +6 -6
  35. package/dist/manifest-plugin.js +8 -8
  36. package/dist/memfs.js +16 -56
  37. package/dist/tinyglobby.js +279 -127
  38. package/dist/ws.js +2 -2
  39. package/dist-types/server/devServer.d.ts +2 -2
  40. package/dist-types/server/socketServer.d.ts +3 -3
  41. package/dist-types/types/config.d.ts +7 -1
  42. package/package.json +5 -5
  43. package/dist-types/plugins/esm.d.ts +0 -2
  44. /package/dist/{863.js.LICENSE.txt → 753.js.LICENSE.txt} +0 -0
@@ -1,11 +1,12 @@
1
- import fs_0, * as __rspack_external_fs from "fs";
2
- import path_0, { basename, dirname, normalize, posix, relative as external_path_relative, resolve, sep } from "path";
1
+ import * as __rspack_external_fs from "fs";
2
+ import { readdir, readdirSync, realpath, realpathSync, stat as external_fs_stat, statSync } from "fs";
3
+ import { basename, dirname, isAbsolute, normalize, posix, relative as external_path_relative, resolve, sep } from "path";
3
4
  import { fileURLToPath } from "url";
4
5
  import { createRequire } from "module";
5
6
  import { __webpack_require__ } from "./1~rslib-runtime.js";
6
7
  __webpack_require__.add({
7
- "../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.js" (module, __unused_rspack_exports, __webpack_require__) {
8
- let pico = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js"), utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js");
8
+ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js" (module, __unused_rspack_exports, __webpack_require__) {
9
+ let pico = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js"), utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js");
9
10
  function picomatch(glob, options, returnState = !1) {
10
11
  return options && (null === options.windows || void 0 === options.windows) && (options = {
11
12
  ...options,
@@ -14,7 +15,7 @@ __webpack_require__.add({
14
15
  }
15
16
  Object.assign(picomatch, pico), module.exports = picomatch;
16
17
  },
17
- "../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js" (module) {
18
+ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js" (module) {
18
19
  let WIN_NO_SLASH = "[^\\\\/]", QMARK = '[^/]', END_ANCHOR = "(?:\\/|$)", START_ANCHOR = "(?:^|\\/)", DOTS_SLASH = `\\.{1,2}${END_ANCHOR}`, NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`, NO_DOT_SLASH = `(?!\\.{0,1}${END_ANCHOR})`, NO_DOTS_SLASH = `(?!${DOTS_SLASH})`, STAR = `${QMARK}*?`, POSIX_CHARS = {
19
20
  DOT_LITERAL: '\\.',
20
21
  PLUS_LITERAL: '\\+',
@@ -48,8 +49,10 @@ __webpack_require__.add({
48
49
  SEP: '\\'
49
50
  };
50
51
  module.exports = {
52
+ DEFAULT_MAX_EXTGLOB_RECURSION: 0,
51
53
  MAX_LENGTH: 65536,
52
54
  POSIX_REGEX_SOURCE: {
55
+ __proto__: null,
53
56
  alnum: 'a-zA-Z0-9',
54
57
  alpha: 'a-zA-Z',
55
58
  ascii: '\\x00-\\x7F',
@@ -150,8 +153,8 @@ __webpack_require__.add({
150
153
  globChars: (win32)=>!0 === win32 ? WINDOWS_CHARS : POSIX_CHARS
151
154
  };
152
155
  },
153
- "../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.js" (module, __unused_rspack_exports, __webpack_require__) {
154
- let constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js"), utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js"), { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants, expandRange = (args, options)=>{
156
+ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js" (module, __unused_rspack_exports, __webpack_require__) {
157
+ let constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js"), utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js"), { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants, expandRange = (args, options)=>{
155
158
  if ('function' == typeof options.expandRange) return options.expandRange(...args, options);
156
159
  args.sort();
157
160
  let value = `[${args.join('-')}]`;
@@ -161,7 +164,115 @@ __webpack_require__.add({
161
164
  return args.map((v)=>utils.escapeRegex(v)).join('..');
162
165
  }
163
166
  return value;
164
- }, syntaxError = (type, char)=>`Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`, parse = (input, options)=>{
167
+ }, syntaxError = (type, char)=>`Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`, splitTopLevel = (input)=>{
168
+ let parts = [], bracket = 0, paren = 0, quote = 0, value = '', escaped = !1;
169
+ for (let ch of input){
170
+ if (!0 === escaped) {
171
+ value += ch, escaped = !1;
172
+ continue;
173
+ }
174
+ if ('\\' === ch) {
175
+ value += ch, escaped = !0;
176
+ continue;
177
+ }
178
+ if ('"' === ch) {
179
+ quote = +(1 !== quote), value += ch;
180
+ continue;
181
+ }
182
+ if (0 === quote) {
183
+ if ('[' === ch) bracket++;
184
+ else if (']' === ch && bracket > 0) bracket--;
185
+ else if (0 === bracket) {
186
+ if ('(' === ch) paren++;
187
+ else if (')' === ch && paren > 0) paren--;
188
+ else if ('|' === ch && 0 === paren) {
189
+ parts.push(value), value = '';
190
+ continue;
191
+ }
192
+ }
193
+ }
194
+ value += ch;
195
+ }
196
+ return parts.push(value), parts;
197
+ }, normalizeSimpleBranch = (branch)=>{
198
+ let value = branch.trim(), changed = !0;
199
+ for(; !0 === changed;)changed = !1, /^@\([^\\()[\]{}|]+\)$/.test(value) && (value = value.slice(2, -1), changed = !0);
200
+ if (((branch)=>{
201
+ let escaped = !1;
202
+ for (let ch of branch){
203
+ if (!0 === escaped) {
204
+ escaped = !1;
205
+ continue;
206
+ }
207
+ if ('\\' === ch) {
208
+ escaped = !0;
209
+ continue;
210
+ }
211
+ if (/[?*+@!()[\]{}]/.test(ch)) return !1;
212
+ }
213
+ return !0;
214
+ })(value)) return value.replace(/\\(.)/g, '$1');
215
+ }, parseRepeatedExtglob = (pattern, requireEnd = !0)=>{
216
+ if ('+' !== pattern[0] && '*' !== pattern[0] || '(' !== pattern[1]) return;
217
+ let bracket = 0, paren = 0, quote = 0, escaped = !1;
218
+ for(let i = 1; i < pattern.length; i++){
219
+ let ch = pattern[i];
220
+ if (!0 === escaped) {
221
+ escaped = !1;
222
+ continue;
223
+ }
224
+ if ('\\' === ch) {
225
+ escaped = !0;
226
+ continue;
227
+ }
228
+ if ('"' === ch) {
229
+ quote = +(1 !== quote);
230
+ continue;
231
+ }
232
+ if (1 !== quote) {
233
+ if ('[' === ch) {
234
+ bracket++;
235
+ continue;
236
+ }
237
+ if (']' === ch && bracket > 0) {
238
+ bracket--;
239
+ continue;
240
+ }
241
+ if (!(bracket > 0)) {
242
+ if ('(' === ch) {
243
+ paren++;
244
+ continue;
245
+ }
246
+ if (')' === ch && 0 == --paren) {
247
+ if (!0 === requireEnd && i !== pattern.length - 1) return;
248
+ return {
249
+ type: pattern[0],
250
+ body: pattern.slice(2, i),
251
+ end: i
252
+ };
253
+ }
254
+ }
255
+ }
256
+ }
257
+ }, getStarExtglobSequenceOutput = (pattern)=>{
258
+ let index = 0, chars = [];
259
+ for(; index < pattern.length;){
260
+ let match = parseRepeatedExtglob(pattern.slice(index), !1);
261
+ if (!match || '*' !== match.type) return;
262
+ let branches = splitTopLevel(match.body).map((branch)=>branch.trim());
263
+ if (1 !== branches.length) return;
264
+ let branch = normalizeSimpleBranch(branches[0]);
265
+ if (!branch || 1 !== branch.length) return;
266
+ chars.push(branch), index += match.end + 1;
267
+ }
268
+ if (chars.length < 1) return;
269
+ let source = 1 === chars.length ? utils.escapeRegex(chars[0]) : `[${chars.map((ch)=>utils.escapeRegex(ch)).join('')}]`;
270
+ return `${source}*`;
271
+ }, repeatedExtglobRecursion = (pattern)=>{
272
+ let depth = 0, value = pattern.trim(), match = parseRepeatedExtglob(value);
273
+ for(; match;)depth++, match = parseRepeatedExtglob(value = match.body.trim());
274
+ return depth;
275
+ }, parse = (input, options)=>{
165
276
  let value;
166
277
  if ('string' != typeof input) throw TypeError('Expected a string');
167
278
  input = REPLACEMENTS[input] || input;
@@ -223,7 +334,7 @@ __webpack_require__.add({
223
334
  conditions: 1,
224
335
  inner: ''
225
336
  };
226
- token.prev = prev, token.parens = state.parens, token.output = state.output;
337
+ token.prev = prev, token.parens = state.parens, token.output = state.output, token.startIndex = state.index, token.tokensIndex = tokens.length;
227
338
  let output = (opts.capture ? '(' : '') + token.open;
228
339
  increment('parens'), push({
229
340
  type,
@@ -236,7 +347,48 @@ __webpack_require__.add({
236
347
  output
237
348
  }), extglobs.push(token);
238
349
  }, extglobClose = (token)=>{
239
- let rest, output = token.close + (opts.capture ? ')' : '');
350
+ let rest, literal = input.slice(token.startIndex, state.index + 1), analysis = ((body, options)=>{
351
+ if (!1 === options.maxExtglobRecursion) return {
352
+ risky: !1
353
+ };
354
+ let max = 'number' == typeof options.maxExtglobRecursion ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION, branches = splitTopLevel(body).map((branch)=>branch.trim());
355
+ if (branches.length > 1 && (branches.some((branch)=>'' === branch) || branches.some((branch)=>/^[*?]+$/.test(branch)) || ((branches)=>{
356
+ let values = branches.map(normalizeSimpleBranch).filter(Boolean);
357
+ for(let i = 0; i < values.length; i++)for(let j = i + 1; j < values.length; j++){
358
+ let a = values[i], b = values[j], char = a[0];
359
+ if (char && a === char.repeat(a.length) && b === char.repeat(b.length) && (a === b || a.startsWith(b) || b.startsWith(a))) return !0;
360
+ }
361
+ return !1;
362
+ })(branches))) return {
363
+ risky: !0
364
+ };
365
+ for (let branch of branches){
366
+ let safeOutput = getStarExtglobSequenceOutput(branch);
367
+ if (safeOutput) return {
368
+ risky: !0,
369
+ safeOutput
370
+ };
371
+ if (repeatedExtglobRecursion(branch) > max) return {
372
+ risky: !0
373
+ };
374
+ }
375
+ return {
376
+ risky: !1
377
+ };
378
+ })(input.slice(token.startIndex + 2, state.index), opts);
379
+ if (('plus' === token.type || 'star' === token.type) && analysis.risky) {
380
+ let safeOutput = analysis.safeOutput ? (token.output ? '' : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0, open = tokens[token.tokensIndex];
381
+ open.type = 'text', open.value = literal, open.output = safeOutput || utils.escapeRegex(literal);
382
+ for(let i = token.tokensIndex + 1; i < tokens.length; i++)tokens[i].value = '', tokens[i].output = '', delete tokens[i].suffix;
383
+ state.output = token.output + open.output, state.backtrack = !0, push({
384
+ type: 'paren',
385
+ extglob: !0,
386
+ value,
387
+ output: ''
388
+ }), decrement('parens');
389
+ return;
390
+ }
391
+ let output = token.close + (opts.capture ? ')' : '');
240
392
  if ('negate' === token.type) {
241
393
  let extglobStar = star;
242
394
  if (token.inner && token.inner.length > 1 && token.inner.includes('/') && (extglobStar = globstar(opts)), (extglobStar !== star || eos() || /^\)+$/.test(remaining())) && (output = token.close = `)$))${extglobStar}`), token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
@@ -693,8 +845,8 @@ __webpack_require__.add({
693
845
  return source && !0 !== opts.strictSlashes && (source += `${SLASH_LITERAL}?`), source;
694
846
  }, module.exports = parse;
695
847
  },
696
- "../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js" (module, __unused_rspack_exports, __webpack_require__) {
697
- let scan = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.js"), parse = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.js"), utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js"), constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js"), picomatch = (glob, options, returnState = !1)=>{
848
+ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js" (module, __unused_rspack_exports, __webpack_require__) {
849
+ let scan = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js"), parse = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js"), utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js"), constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js"), picomatch = (glob, options, returnState = !1)=>{
698
850
  if (Array.isArray(glob)) {
699
851
  let fns = glob.map((input)=>picomatch(input, options, returnState));
700
852
  return (str)=>{
@@ -775,8 +927,8 @@ __webpack_require__.add({
775
927
  }
776
928
  }, picomatch.constants = constants, module.exports = picomatch;
777
929
  },
778
- "../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.js" (module, __unused_rspack_exports, __webpack_require__) {
779
- let utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js"), { 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 } = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js"), isPathSeparator = (code)=>code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH, depth = (token)=>{
930
+ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js" (module, __unused_rspack_exports, __webpack_require__) {
931
+ let utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js"), { 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 } = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js"), isPathSeparator = (code)=>code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH, depth = (token)=>{
780
932
  !0 !== token.isPrefix && (token.depth = token.isGlobstar ? 1 / 0 : 1);
781
933
  };
782
934
  module.exports = (input, options)=>{
@@ -921,8 +1073,8 @@ __webpack_require__.add({
921
1073
  return state;
922
1074
  };
923
1075
  },
924
- "../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js" (__unused_rspack_module, exports, __webpack_require__) {
925
- let { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js");
1076
+ "../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js" (__unused_rspack_module, exports, __webpack_require__) {
1077
+ let { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js");
926
1078
  exports.isObject = (val)=>null !== val && 'object' == typeof val && !Array.isArray(val), exports.hasRegexChars = (str)=>REGEX_SPECIAL_CHARS.test(str), exports.isRegexChar = (str)=>1 === str.length && exports.hasRegexChars(str), exports.escapeRegex = (str)=>str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'), exports.toPosixSlashes = (str)=>str.replace(REGEX_BACKSLASH, '/'), exports.isWindows = ()=>{
927
1079
  if ("u" > typeof navigator && navigator.platform) {
928
1080
  let platform = navigator.platform.toLowerCase();
@@ -1305,26 +1457,26 @@ var Builder = class {
1305
1457
  return isMatch || (isMatch = globFn(patterns, ...options), this.globCache[patterns.join("\0")] = isMatch), this.options.filters.push((path)=>isMatch(path)), this;
1306
1458
  }
1307
1459
  };
1308
- let picomatch = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.js"), isReadonlyArray = Array.isArray, isWin = "win32" === process.platform, ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
1460
+ let picomatch = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js"), isReadonlyArray = Array.isArray, BACKSLASHES = /\\/g, isWin = "win32" === process.platform, ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
1309
1461
  function getPartialMatcher(patterns, options = {}) {
1310
- let patternsCount = patterns.length, patternsParts = Array(patternsCount), matchers = Array(patternsCount), globstarEnabled = !options.noglobstar;
1311
- for(let i = 0; i < patternsCount; i++){
1462
+ let i, j, patternsCount = patterns.length, patternsParts = Array(patternsCount), matchers = Array(patternsCount);
1463
+ for(i = 0; i < patternsCount; i++){
1312
1464
  let parts = splitPattern(patterns[i]);
1313
1465
  patternsParts[i] = parts;
1314
1466
  let partsCount = parts.length, partMatchers = Array(partsCount);
1315
- for(let j = 0; j < partsCount; j++)partMatchers[j] = picomatch(parts[j], options);
1467
+ for(j = 0; j < partsCount; j++)partMatchers[j] = picomatch(parts[j], options);
1316
1468
  matchers[i] = partMatchers;
1317
1469
  }
1318
1470
  return (input)=>{
1319
1471
  let inputParts = input.split("/");
1320
1472
  if (".." === inputParts[0] && ONLY_PARENT_DIRECTORIES.test(input)) return !0;
1321
- for(let i = 0; i < patterns.length; i++){
1322
- let patternParts = patternsParts[i], matcher = matchers[i], inputPatternCount = inputParts.length, minParts = Math.min(inputPatternCount, patternParts.length), j = 0;
1323
- for(; j < minParts;){
1473
+ for(i = 0; i < patternsCount; i++){
1474
+ let patternParts = patternsParts[i], matcher = matchers[i], inputPatternCount = inputParts.length, minParts = Math.min(inputPatternCount, patternParts.length);
1475
+ for(j = 0; j < minParts;){
1324
1476
  let part = patternParts[j];
1325
1477
  if (part.includes("/")) return !0;
1326
1478
  if (!matcher[j](inputParts[j])) break;
1327
- if (globstarEnabled && "**" === part) return !0;
1479
+ if (!options.noglobstar && "**" === part) return !0;
1328
1480
  j++;
1329
1481
  }
1330
1482
  if (j === inputPatternCount) return !0;
@@ -1336,7 +1488,7 @@ let WIN32_ROOT_DIR = /^[A-Z]:\/$/i, isRoot = isWin ? (p)=>WIN32_ROOT_DIR.test(p)
1336
1488
  function buildFormat(cwd, root, absolute) {
1337
1489
  if (cwd === root || root.startsWith(`${cwd}/`)) {
1338
1490
  if (absolute) {
1339
- let start = isRoot(cwd) ? cwd.length : cwd.length + 1;
1491
+ let start = cwd.length + +!isRoot(cwd);
1340
1492
  return (p, isDir)=>p.slice(start, isDir ? -1 : void 0) || ".";
1341
1493
  }
1342
1494
  let prefix = root.slice(cwd.length + 1);
@@ -1355,20 +1507,20 @@ function buildRelative(cwd, root) {
1355
1507
  }
1356
1508
  return (p)=>{
1357
1509
  let result = posix.relative(cwd, `${root}/${p}`);
1358
- return p.endsWith("/") && "" !== result ? `${result}/` : result || ".";
1510
+ return "/" === p[p.length - 1] && "" !== result ? `${result}/` : result || ".";
1359
1511
  };
1360
1512
  }
1361
1513
  let splitPatternOptions = {
1362
1514
  parts: !0
1363
1515
  };
1364
- function splitPattern(path$1) {
1516
+ function splitPattern(path) {
1365
1517
  var _result$parts;
1366
- let result = picomatch.scan(path$1, splitPatternOptions);
1518
+ let result = picomatch.scan(path, splitPatternOptions);
1367
1519
  return (null == (_result$parts = result.parts) ? void 0 : _result$parts.length) ? result.parts : [
1368
- path$1
1520
+ path
1369
1521
  ];
1370
1522
  }
1371
- let POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g, WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g, escapePath = isWin ? (path$1)=>path$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&") : (path$1)=>path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
1523
+ let POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g, WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g, escapePath = isWin ? (path)=>path.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&") : (path)=>path.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
1372
1524
  function isDynamicPattern(pattern, options) {
1373
1525
  if ((null == options ? void 0 : options.caseSensitiveMatch) === !1) return !0;
1374
1526
  let scan = picomatch.scan(pattern);
@@ -1377,18 +1529,24 @@ function isDynamicPattern(pattern, options) {
1377
1529
  function log(...tasks) {
1378
1530
  console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`, ...tasks);
1379
1531
  }
1380
- let PARENT_DIRECTORY = /^(\/?\.\.)+/, ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g, BACKSLASHES = /\\/g;
1381
- function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
1382
- let result = pattern;
1383
- pattern.endsWith("/") && (result = pattern.slice(0, -1)), !result.endsWith("*") && expandDirectories && (result += "/**");
1532
+ function ensureStringArray(value) {
1533
+ return "string" == typeof value ? [
1534
+ value
1535
+ ] : null != value ? value : [];
1536
+ }
1537
+ let PARENT_DIRECTORY = /^(\/?\.\.)+/, ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
1538
+ function normalizePattern(pattern, opts, props, isIgnore) {
1539
+ var _PARENT_DIRECTORY$exe;
1540
+ let cwd = opts.cwd, result = pattern;
1541
+ "/" === pattern[pattern.length - 1] && (result = pattern.slice(0, -1)), "*" !== result[result.length - 1] && opts.expandDirectories && (result += "/**");
1384
1542
  let escapedCwd = escapePath(cwd);
1385
- result = path_0.isAbsolute(result.replace(ESCAPING_BACKSLASHES, "")) ? posix.relative(escapedCwd, result) : posix.normalize(result);
1386
- let parentDirectoryMatch = PARENT_DIRECTORY.exec(result), parts = splitPattern(result);
1387
- if (null == parentDirectoryMatch ? void 0 : parentDirectoryMatch[0]) {
1388
- let n = (parentDirectoryMatch[0].length + 1) / 3, i = 0, cwdParts = escapedCwd.split("/");
1543
+ result = isAbsolute(result.replace(ESCAPING_BACKSLASHES, "")) ? posix.relative(escapedCwd, result) : posix.normalize(result);
1544
+ let parentDir = null == (_PARENT_DIRECTORY$exe = PARENT_DIRECTORY.exec(result)) ? void 0 : _PARENT_DIRECTORY$exe[0], parts = splitPattern(result);
1545
+ if (parentDir) {
1546
+ let n = (parentDir.length + 1) / 3, i = 0, cwdParts = escapedCwd.split("/");
1389
1547
  for(; i < n && parts[i + n] === cwdParts[cwdParts.length + i - n];)result = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || ".", i++;
1390
- let potentialRoot = posix.join(cwd, parentDirectoryMatch[0].slice(3 * i));
1391
- !potentialRoot.startsWith(".") && props.root.length > potentialRoot.length && (props.root = potentialRoot, props.depthOffset = -n + i);
1548
+ let potentialRoot = posix.join(cwd, parentDir.slice(3 * i));
1549
+ "." !== potentialRoot[0] && props.root.length > potentialRoot.length && (props.root = potentialRoot, props.depthOffset = -n + i);
1392
1550
  }
1393
1551
  if (!isIgnore && props.depthOffset >= 0) {
1394
1552
  null != props.commonPath || (props.commonPath = parts);
@@ -1399,118 +1557,112 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
1399
1557
  newCommonPath.pop();
1400
1558
  break;
1401
1559
  }
1402
- if (part !== props.commonPath[i] || isDynamicPattern(part) || i === parts.length - 1) break;
1560
+ if (i === parts.length - 1 || part !== props.commonPath[i] || isDynamicPattern(part)) break;
1403
1561
  newCommonPath.push(part);
1404
1562
  }
1405
1563
  props.depthOffset = newCommonPath.length, props.commonPath = newCommonPath, props.root = newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd;
1406
1564
  }
1407
1565
  return result;
1408
1566
  }
1409
- function processPatterns({ patterns = [
1410
- "**/*"
1411
- ], ignore = [], expandDirectories = !0 }, cwd, props) {
1412
- "string" == typeof patterns && (patterns = [
1413
- patterns
1414
- ]), "string" == typeof ignore && (ignore = [
1415
- ignore
1416
- ]);
1567
+ function processPatterns(options, patterns, props) {
1417
1568
  let matchPatterns = [], ignorePatterns = [];
1418
- for (let pattern of ignore)pattern && ("!" !== pattern[0] || "(" === pattern[1]) && ignorePatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, !0));
1419
- for (let pattern of patterns)pattern && ("!" !== pattern[0] || "(" === pattern[1] ? matchPatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, !1)) : ("!" !== pattern[1] || "(" === pattern[2]) && ignorePatterns.push(normalizePattern(pattern.slice(1), expandDirectories, cwd, props, !0)));
1569
+ for (let pattern of options.ignore)pattern && ("!" !== pattern[0] || "(" === pattern[1]) && ignorePatterns.push(normalizePattern(pattern, options, props, !0));
1570
+ for (let pattern of patterns)pattern && ("!" !== pattern[0] || "(" === pattern[1] ? matchPatterns.push(normalizePattern(pattern, options, props, !1)) : ("!" !== pattern[1] || "(" === pattern[2]) && ignorePatterns.push(normalizePattern(pattern.slice(1), options, props, !0)));
1420
1571
  return {
1421
1572
  match: matchPatterns,
1422
1573
  ignore: ignorePatterns
1423
1574
  };
1424
1575
  }
1425
- function formatPaths(paths, relative) {
1426
- for(let i = paths.length - 1; i >= 0; i--){
1427
- let path$1 = paths[i];
1428
- paths[i] = relative(path$1);
1429
- }
1430
- return paths;
1431
- }
1432
- function normalizeCwd(cwd) {
1433
- return cwd ? cwd instanceof URL ? fileURLToPath(cwd).replace(BACKSLASHES, "/") : path_0.resolve(cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
1434
- }
1435
- function getCrawler(patterns, inputOptions = {}) {
1436
- let options = process.env.TINYGLOBBY_DEBUG ? {
1437
- ...inputOptions,
1438
- debug: !0
1439
- } : inputOptions, cwd = normalizeCwd(options.cwd);
1440
- if (options.debug && log("globbing with:", {
1441
- patterns,
1442
- options,
1443
- cwd
1444
- }), Array.isArray(patterns) && 0 === patterns.length) return [
1445
- {
1446
- sync: ()=>[],
1447
- withPromise: async ()=>[]
1448
- },
1449
- !1
1450
- ];
1451
- let props = {
1576
+ function buildCrawler(options, patterns) {
1577
+ let maxDepth, cwd = options.cwd, props = {
1452
1578
  root: cwd,
1453
- commonPath: null,
1454
1579
  depthOffset: 0
1455
- }, processed = processPatterns({
1456
- ...options,
1457
- patterns
1458
- }, cwd, props);
1580
+ }, processed = processPatterns(options, patterns, props);
1459
1581
  options.debug && log("internal processing patterns:", processed);
1460
- let matchOptions = {
1461
- dot: options.dot,
1582
+ let { absolute, caseSensitiveMatch, debug, dot, followSymbolicLinks, onlyDirectories } = options, root = props.root.replace(BACKSLASHES, ""), matchOptions = {
1583
+ dot,
1462
1584
  nobrace: !1 === options.braceExpansion,
1463
- nocase: !1 === options.caseSensitiveMatch,
1585
+ nocase: !caseSensitiveMatch,
1464
1586
  noextglob: !1 === options.extglob,
1465
1587
  noglobstar: !1 === options.globstar,
1466
1588
  posix: !0
1467
- }, matcher = picomatch(processed.match, {
1468
- ...matchOptions,
1469
- ignore: processed.ignore
1470
- }), ignore = picomatch(processed.ignore, matchOptions), partialMatcher = getPartialMatcher(processed.match, matchOptions), format = buildFormat(cwd, props.root, options.absolute), formatExclude = options.absolute ? format : buildFormat(cwd, props.root, !0), fdirOptions = {
1589
+ }, matcher = picomatch(processed.match, matchOptions), ignore = picomatch(processed.ignore, matchOptions), partialMatcher = getPartialMatcher(processed.match, matchOptions), format = buildFormat(cwd, root, absolute), excludeFormatter = absolute ? format : buildFormat(cwd, root, !0), excludePredicate = (_, p)=>{
1590
+ let relativePath = excludeFormatter(p, !0);
1591
+ return "." !== relativePath && !partialMatcher(relativePath) || ignore(relativePath);
1592
+ };
1593
+ void 0 !== options.deep && (maxDepth = Math.round(options.deep - props.depthOffset));
1594
+ let crawler = new Builder({
1471
1595
  filters: [
1472
- options.debug ? (p, isDirectory)=>{
1473
- let path$1 = format(p, isDirectory), matches = matcher(path$1);
1474
- return matches && log(`matched ${path$1}`), matches;
1475
- } : (p, isDirectory)=>matcher(format(p, isDirectory))
1596
+ debug ? (p, isDirectory)=>{
1597
+ let path = format(p, isDirectory), matches = matcher(path) && !ignore(path);
1598
+ return matches && log(`matched ${path}`), matches;
1599
+ } : (p, isDirectory)=>{
1600
+ let path = format(p, isDirectory);
1601
+ return matcher(path) && !ignore(path);
1602
+ }
1476
1603
  ],
1477
- exclude: options.debug ? (_, p)=>{
1478
- let relativePath = formatExclude(p, !0), skipped = "." !== relativePath && !partialMatcher(relativePath) || ignore(relativePath);
1479
- return skipped ? log(`skipped ${p}`) : log(`crawling ${p}`), skipped;
1480
- } : (_, p)=>{
1481
- let relativePath = formatExclude(p, !0);
1482
- return "." !== relativePath && !partialMatcher(relativePath) || ignore(relativePath);
1483
- },
1484
- fs: options.fs ? {
1485
- readdir: options.fs.readdir || fs_0.readdir,
1486
- readdirSync: options.fs.readdirSync || fs_0.readdirSync,
1487
- realpath: options.fs.realpath || fs_0.realpath,
1488
- realpathSync: options.fs.realpathSync || fs_0.realpathSync,
1489
- stat: options.fs.stat || fs_0.stat,
1490
- statSync: options.fs.statSync || fs_0.statSync
1491
- } : void 0,
1604
+ exclude: debug ? (_, p)=>{
1605
+ let skipped = excludePredicate(_, p);
1606
+ return log(`${skipped ? "skipped" : "crawling"} ${p}`), skipped;
1607
+ } : excludePredicate,
1608
+ fs: options.fs,
1492
1609
  pathSeparator: "/",
1493
- relativePaths: !0,
1494
- resolveSymlinks: !0,
1610
+ relativePaths: !absolute,
1611
+ resolvePaths: absolute,
1612
+ includeBasePath: absolute,
1613
+ resolveSymlinks: followSymbolicLinks,
1614
+ excludeSymlinks: !followSymbolicLinks,
1615
+ excludeFiles: onlyDirectories,
1616
+ includeDirs: onlyDirectories || !options.onlyFiles,
1617
+ maxDepth,
1495
1618
  signal: options.signal
1496
- };
1497
- void 0 !== options.deep && (fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset)), options.absolute && (fdirOptions.relativePaths = !1, fdirOptions.resolvePaths = !0, fdirOptions.includeBasePath = !0), !1 === options.followSymbolicLinks && (fdirOptions.resolveSymlinks = !1, fdirOptions.excludeSymlinks = !0), options.onlyDirectories ? (fdirOptions.excludeFiles = !0, fdirOptions.includeDirs = !0) : !1 === options.onlyFiles && (fdirOptions.includeDirs = !0), props.root = props.root.replace(BACKSLASHES, "");
1498
- let root = props.root;
1499
- options.debug && log("internal properties:", props);
1500
- let relative = cwd !== root && !options.absolute && buildRelative(cwd, props.root);
1501
- return [
1502
- new Builder(fdirOptions).crawl(root),
1503
- relative
1619
+ }).crawl(root);
1620
+ return options.debug && log("internal properties:", {
1621
+ ...props,
1622
+ root
1623
+ }), [
1624
+ crawler,
1625
+ cwd !== root && !absolute && buildRelative(cwd, root)
1504
1626
  ];
1505
1627
  }
1506
- async function glob(patternsOrOptions, options) {
1507
- if (patternsOrOptions && (null == options ? void 0 : options.patterns)) throw Error("Cannot pass patterns as both an argument and an option");
1508
- let isModern = isReadonlyArray(patternsOrOptions) || "string" == typeof patternsOrOptions, opts = isModern ? options : patternsOrOptions, [crawler, relative] = getCrawler(isModern ? patternsOrOptions : patternsOrOptions.patterns, opts);
1509
- return relative ? formatPaths(await crawler.withPromise(), relative) : crawler.withPromise();
1628
+ function formatPaths(paths, mapper) {
1629
+ if (mapper) for(let i = paths.length - 1; i >= 0; i--)paths[i] = mapper(paths[i]);
1630
+ return paths;
1631
+ }
1632
+ let defaultOptions = {
1633
+ caseSensitiveMatch: !0,
1634
+ cwd: process.cwd(),
1635
+ debug: !!process.env.TINYGLOBBY_DEBUG,
1636
+ expandDirectories: !0,
1637
+ followSymbolicLinks: !0,
1638
+ onlyFiles: !0
1639
+ };
1640
+ function getOptions(options) {
1641
+ let opts = {
1642
+ ...defaultOptions,
1643
+ ...options
1644
+ };
1645
+ return opts.cwd = (opts.cwd instanceof URL ? fileURLToPath(opts.cwd) : resolve(opts.cwd)).replace(BACKSLASHES, "/"), opts.ignore = ensureStringArray(opts.ignore), opts.fs && (opts.fs = {
1646
+ readdir: opts.fs.readdir || readdir,
1647
+ readdirSync: opts.fs.readdirSync || readdirSync,
1648
+ realpath: opts.fs.realpath || realpath,
1649
+ realpathSync: opts.fs.realpathSync || realpathSync,
1650
+ stat: opts.fs.stat || external_fs_stat,
1651
+ statSync: opts.fs.statSync || statSync
1652
+ }), opts.debug && log("globbing with options:", opts), opts;
1653
+ }
1654
+ function getCrawler(globInput, inputOptions = {}) {
1655
+ var _ref;
1656
+ if (globInput && (null == inputOptions ? void 0 : inputOptions.patterns)) throw Error("Cannot pass patterns as both an argument and an option");
1657
+ let isModern = isReadonlyArray(globInput) || "string" == typeof globInput, patterns = ensureStringArray(null != (_ref = isModern ? globInput : globInput.patterns) ? _ref : "**/*"), options = getOptions(isModern ? inputOptions : globInput);
1658
+ return patterns.length > 0 ? buildCrawler(options, patterns) : [];
1659
+ }
1660
+ async function glob(globInput, options) {
1661
+ let [crawler, relative] = getCrawler(globInput, options);
1662
+ return crawler ? formatPaths(await crawler.withPromise(), relative) : [];
1510
1663
  }
1511
- function globSync(patternsOrOptions, options) {
1512
- if (patternsOrOptions && (null == options ? void 0 : options.patterns)) throw Error("Cannot pass patterns as both an argument and an option");
1513
- let isModern = isReadonlyArray(patternsOrOptions) || "string" == typeof patternsOrOptions, opts = isModern ? options : patternsOrOptions, [crawler, relative] = getCrawler(isModern ? patternsOrOptions : patternsOrOptions.patterns, opts);
1514
- return relative ? formatPaths(crawler.sync(), relative) : crawler.sync();
1664
+ function globSync(globInput, options) {
1665
+ let [crawler, relative] = getCrawler(globInput, options);
1666
+ return crawler ? formatPaths(crawler.sync(), relative) : [];
1515
1667
  }
1516
1668
  export { glob, globSync };
package/dist/ws.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { __webpack_require__ } from "./1~rslib-runtime.js";
2
- import "./863.js";
2
+ import "./753.js";
3
3
  __webpack_require__.add({
4
4
  "../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/buffer-util.js" (module, __unused_rspack_exports, __webpack_require__) {
5
5
  let { EMPTY_BUFFER } = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/constants.js"), FastBuffer = Buffer[Symbol.species];
@@ -1125,7 +1125,7 @@ __webpack_require__.add({
1125
1125
  };
1126
1126
  },
1127
1127
  "../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/websocket.js" (module, __unused_rspack_exports, __webpack_require__) {
1128
- let EventEmitter = __webpack_require__("events"), https = __webpack_require__("https"), http = __webpack_require__("http"), net = __webpack_require__("net"), tls = __webpack_require__("tls"), { randomBytes, createHash } = __webpack_require__("crypto"), { Duplex, Readable } = __webpack_require__("stream"), { URL } = __webpack_require__("url?5f07"), PerMessageDeflate = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/permessage-deflate.js"), Receiver = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/receiver.js"), Sender = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/sender.js"), { isBlob } = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/validation.js"), { BINARY_TYPES, CLOSE_TIMEOUT, EMPTY_BUFFER, GUID, kForOnEventAttribute, kListener, kStatusCode, kWebSocket, NOOP } = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/constants.js"), { EventTarget: { addEventListener, removeEventListener } } = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/event-target.js"), { format, parse } = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/extension.js"), { toBuffer } = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/buffer-util.js"), kAborted = Symbol('kAborted'), protocolVersions = [
1128
+ let EventEmitter = __webpack_require__("events"), https = __webpack_require__("https"), http = __webpack_require__("http"), net = __webpack_require__("net"), tls = __webpack_require__("tls"), { randomBytes, createHash } = __webpack_require__("crypto"), { Duplex, Readable } = __webpack_require__("stream"), { URL } = __webpack_require__("url?b918"), PerMessageDeflate = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/permessage-deflate.js"), Receiver = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/receiver.js"), Sender = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/sender.js"), { isBlob } = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/validation.js"), { BINARY_TYPES, CLOSE_TIMEOUT, EMPTY_BUFFER, GUID, kForOnEventAttribute, kListener, kStatusCode, kWebSocket, NOOP } = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/constants.js"), { EventTarget: { addEventListener, removeEventListener } } = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/event-target.js"), { format, parse } = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/extension.js"), { toBuffer } = __webpack_require__("../../node_modules/.pnpm/ws@8.20.0/node_modules/ws/lib/buffer-util.js"), kAborted = Symbol('kAborted'), protocolVersions = [
1129
1129
  8,
1130
1130
  13
1131
1131
  ], readyStates = [
@@ -9,7 +9,7 @@ type ExtractSocketMessageData<T extends ServerMessage['type']> = 'data' extends
9
9
  }> ? Extract<ServerMessage, {
10
10
  type: T;
11
11
  }>['data'] : undefined;
12
- export type SockWrite = <T extends ServerMessage['type']>(type: T, data?: ExtractSocketMessageData<T>) => void;
12
+ export type HotSend = <T extends ServerMessage['type']>(type: T, data?: ExtractSocketMessageData<T>) => void;
13
13
  export type RsbuildDevServer = RsbuildServerBase & {
14
14
  /**
15
15
  * Notifies Rsbuild that the custom server has successfully started.
@@ -39,7 +39,7 @@ export type RsbuildDevServer = RsbuildServerBase & {
39
39
  * - `static-changed`: Alias of `full-reload` for backward compatibility.
40
40
  * - `custom`: Send custom messages via `custom` type with optional data to the browser and handle them via HMR events.
41
41
  */
42
- sockWrite: SockWrite;
42
+ sockWrite: HotSend;
43
43
  };
44
44
  export declare function createDevServer<Options extends {
45
45
  context: InternalContext;
@@ -86,12 +86,12 @@ export declare class SocketServer {
86
86
  */
87
87
  sendWarning(warnings: Rspack.StatsError[], token: string): void;
88
88
  /**
89
- * Write message to each socket
89
+ * Send a server message to matching client sockets.
90
90
  * @param message - The message to send
91
91
  * @param token - The token of the socket to send the message to,
92
92
  * if not provided, the message will be sent to all sockets
93
93
  */
94
- sockWrite(message: ServerMessage, token?: string): void;
94
+ sendMessage(message: ServerMessage, token?: string): void;
95
95
  close(): Promise<void>;
96
96
  private onConnect;
97
97
  private getEnvironmentByToken;
@@ -99,5 +99,5 @@ export declare class SocketServer {
99
99
  private ensureInitialChunks;
100
100
  private getStats;
101
101
  private sendStats;
102
- private send;
102
+ private sendRawMessage;
103
103
  }