@rsbuild/core 1.3.21 → 1.4.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +2 -2
  2. package/compiled/css-loader/index.js +44 -44
  3. package/compiled/html-rspack-plugin/index.js +14 -14
  4. package/compiled/postcss/index.js +189 -144
  5. package/compiled/postcss/lib/input.d.ts +24 -3
  6. package/compiled/postcss/lib/node.d.ts +17 -2
  7. package/compiled/postcss/lib/stringifier.d.ts +2 -2
  8. package/compiled/postcss/package.json +1 -1
  9. package/compiled/postcss-load-config/index.js +10 -10
  10. package/compiled/postcss-loader/index.js +6 -6
  11. package/compiled/rsbuild-dev-middleware/index.js +115 -125
  12. package/compiled/rspack-chain/index.js +67 -67
  13. package/compiled/rspack-chain/package.json +1 -1
  14. package/compiled/rspack-chain/types/index.d.ts +1 -0
  15. package/compiled/rspack-manifest-plugin/index.js +4 -4
  16. package/compiled/sirv/index.js +12 -6
  17. package/compiled/style-loader/index.js +10 -10
  18. package/compiled/tinyglobby/index.d.ts +35 -16
  19. package/compiled/tinyglobby/index.js +517 -531
  20. package/compiled/tinyglobby/package.json +1 -1
  21. package/compiled/webpack-bundle-analyzer/index.js +62 -46
  22. package/dist/index.cjs +274 -236
  23. package/dist/index.js +233 -227
  24. package/dist-types/cli/commands.d.ts +1 -1
  25. package/dist-types/defaultConfig.d.ts +26 -0
  26. package/dist-types/index.d.ts +2 -2
  27. package/dist-types/{config.d.ts → loadConfig.d.ts} +9 -34
  28. package/dist-types/pluginHelper.d.ts +1 -1
  29. package/dist-types/plugins/minimize.d.ts +1 -1
  30. package/dist-types/server/cliShortcuts.d.ts +2 -2
  31. package/dist-types/server/helper.d.ts +2 -2
  32. package/dist-types/server/runner/asModule.d.ts +2 -2
  33. package/dist-types/types/config.d.ts +41 -20
  34. package/dist-types/types/hooks.d.ts +1 -1
  35. package/dist-types/types/plugin.d.ts +18 -18
  36. package/dist-types/types/rsbuild.d.ts +2 -2
  37. package/package.json +11 -10
@@ -1 +1 @@
1
- {"name":"tinyglobby","author":"Superchupu","version":"0.2.13","funding":{"url":"https://github.com/sponsors/SuperchupuDev"},"license":"MIT","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"tinyglobby","author":"Superchupu","version":"0.2.14","funding":{"url":"https://github.com/sponsors/SuperchupuDev"},"license":"MIT","types":"index.d.ts","type":"commonjs"}
@@ -983,7 +983,7 @@
983
983
  6069: (module, __unused_webpack_exports, __nccwpck_require__) => {
984
984
  module.exports = __nccwpck_require__(3344).version;
985
985
  },
986
- 9847: (__unused_webpack_module, exports, __nccwpck_require__) => {
986
+ 2600: (__unused_webpack_module, exports, __nccwpck_require__) => {
987
987
  const qs = __nccwpck_require__(3480);
988
988
  function parse(req) {
989
989
  let raw = req.url;
@@ -992,18 +992,24 @@
992
992
  if (prev && prev.raw === raw) return prev;
993
993
  let pathname = raw,
994
994
  search = "",
995
- query;
995
+ query,
996
+ hash;
996
997
  if (raw.length > 1) {
997
- let idx = raw.indexOf("?", 1);
998
+ let idx = raw.indexOf("#", 1);
998
999
  if (idx !== -1) {
999
- search = raw.substring(idx);
1000
+ hash = raw.substring(idx);
1000
1001
  pathname = raw.substring(0, idx);
1002
+ }
1003
+ idx = pathname.indexOf("?", 1);
1004
+ if (idx !== -1) {
1005
+ search = pathname.substring(idx);
1006
+ pathname = pathname.substring(0, idx);
1001
1007
  if (search.length > 1) {
1002
1008
  query = qs.parse(search.substring(1));
1003
1009
  }
1004
1010
  }
1005
1011
  }
1006
- return (req._parsedUrl = { pathname, search, query, raw });
1012
+ return (req._parsedUrl = { pathname, search, query, hash, raw });
1007
1013
  }
1008
1014
  exports.parse = parse;
1009
1015
  },
@@ -1542,7 +1548,7 @@
1542
1548
  exports.simple = simple;
1543
1549
  });
1544
1550
  },
1545
- 8024: function (__unused_webpack_module, exports) {
1551
+ 2424: function (__unused_webpack_module, exports) {
1546
1552
  (function (global, factory) {
1547
1553
  true ? factory(exports) : 0;
1548
1554
  })(this, function (exports) {
@@ -1992,6 +1998,7 @@
1992
1998
  SCOPE_SUPER = 64,
1993
1999
  SCOPE_DIRECT_SUPER = 128,
1994
2000
  SCOPE_CLASS_STATIC_BLOCK = 256,
2001
+ SCOPE_CLASS_FIELD_INIT = 512,
1995
2002
  SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
1996
2003
  function functionFlags(async, generator) {
1997
2004
  return (
@@ -2094,28 +2101,20 @@
2094
2101
  return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
2095
2102
  };
2096
2103
  prototypeAccessors.inGenerator.get = function () {
2097
- return (
2098
- (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 &&
2099
- !this.currentVarScope().inClassFieldInit
2100
- );
2104
+ return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0;
2101
2105
  };
2102
2106
  prototypeAccessors.inAsync.get = function () {
2103
- return (
2104
- (this.currentVarScope().flags & SCOPE_ASYNC) > 0 &&
2105
- !this.currentVarScope().inClassFieldInit
2106
- );
2107
+ return (this.currentVarScope().flags & SCOPE_ASYNC) > 0;
2107
2108
  };
2108
2109
  prototypeAccessors.canAwait.get = function () {
2109
2110
  for (var i = this.scopeStack.length - 1; i >= 0; i--) {
2110
- var scope = this.scopeStack[i];
2111
- if (
2112
- scope.inClassFieldInit ||
2113
- scope.flags & SCOPE_CLASS_STATIC_BLOCK
2114
- ) {
2111
+ var ref = this.scopeStack[i];
2112
+ var flags = ref.flags;
2113
+ if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT)) {
2115
2114
  return false;
2116
2115
  }
2117
- if (scope.flags & SCOPE_FUNCTION) {
2118
- return (scope.flags & SCOPE_ASYNC) > 0;
2116
+ if (flags & SCOPE_FUNCTION) {
2117
+ return (flags & SCOPE_ASYNC) > 0;
2119
2118
  }
2120
2119
  }
2121
2120
  return (
@@ -2126,11 +2125,8 @@
2126
2125
  prototypeAccessors.allowSuper.get = function () {
2127
2126
  var ref = this.currentThisScope();
2128
2127
  var flags = ref.flags;
2129
- var inClassFieldInit = ref.inClassFieldInit;
2130
2128
  return (
2131
- (flags & SCOPE_SUPER) > 0 ||
2132
- inClassFieldInit ||
2133
- this.options.allowSuperOutsideMethod
2129
+ (flags & SCOPE_SUPER) > 0 || this.options.allowSuperOutsideMethod
2134
2130
  );
2135
2131
  };
2136
2132
  prototypeAccessors.allowDirectSuper.get = function () {
@@ -2140,13 +2136,17 @@
2140
2136
  return this.treatFunctionsAsVarInScope(this.currentScope());
2141
2137
  };
2142
2138
  prototypeAccessors.allowNewDotTarget.get = function () {
2143
- var ref = this.currentThisScope();
2144
- var flags = ref.flags;
2145
- var inClassFieldInit = ref.inClassFieldInit;
2146
- return (
2147
- (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 ||
2148
- inClassFieldInit
2149
- );
2139
+ for (var i = this.scopeStack.length - 1; i >= 0; i--) {
2140
+ var ref = this.scopeStack[i];
2141
+ var flags = ref.flags;
2142
+ if (
2143
+ flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT) ||
2144
+ (flags & SCOPE_FUNCTION && !(flags & SCOPE_ARROW))
2145
+ ) {
2146
+ return true;
2147
+ }
2148
+ }
2149
+ return false;
2150
2150
  };
2151
2151
  prototypeAccessors.inClassStaticBlock.get = function () {
2152
2152
  return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0;
@@ -3309,11 +3309,9 @@
3309
3309
  );
3310
3310
  }
3311
3311
  if (this.eat(types$1.eq)) {
3312
- var scope = this.currentThisScope();
3313
- var inClassFieldInit = scope.inClassFieldInit;
3314
- scope.inClassFieldInit = true;
3312
+ this.enterScope(SCOPE_CLASS_FIELD_INIT | SCOPE_SUPER);
3315
3313
  field.value = this.parseMaybeAssign();
3316
- scope.inClassFieldInit = inClassFieldInit;
3314
+ this.exitScope();
3317
3315
  } else {
3318
3316
  field.value = null;
3319
3317
  }
@@ -3459,6 +3457,9 @@
3459
3457
  }
3460
3458
  node.specifiers = [];
3461
3459
  node.source = null;
3460
+ if (this.options.ecmaVersion >= 16) {
3461
+ node.attributes = [];
3462
+ }
3462
3463
  } else {
3463
3464
  node.declaration = null;
3464
3465
  node.specifiers = this.parseExportSpecifiers(exports);
@@ -3483,6 +3484,9 @@
3483
3484
  }
3484
3485
  }
3485
3486
  node.source = null;
3487
+ if (this.options.ecmaVersion >= 16) {
3488
+ node.attributes = [];
3489
+ }
3486
3490
  }
3487
3491
  this.semicolon();
3488
3492
  }
@@ -5427,9 +5431,10 @@
5427
5431
  return this.finishNode(prop, "Property");
5428
5432
  };
5429
5433
  pp$5.parseGetterSetter = function (prop) {
5430
- prop.kind = prop.key.name;
5434
+ var kind = prop.key.name;
5431
5435
  this.parsePropertyName(prop);
5432
5436
  prop.value = this.parseMethod(false);
5437
+ prop.kind = kind;
5433
5438
  var paramCount = prop.kind === "get" ? 0 : 1;
5434
5439
  if (prop.value.params.length !== paramCount) {
5435
5440
  var start = prop.value.start;
@@ -5478,9 +5483,9 @@
5478
5483
  if (isPattern) {
5479
5484
  this.unexpected();
5480
5485
  }
5481
- prop.kind = "init";
5482
5486
  prop.method = true;
5483
5487
  prop.value = this.parseMethod(isGenerator, isAsync);
5488
+ prop.kind = "init";
5484
5489
  } else if (
5485
5490
  !isPattern &&
5486
5491
  !containsEsc &&
@@ -5508,7 +5513,6 @@
5508
5513
  if (prop.key.name === "await" && !this.awaitIdentPos) {
5509
5514
  this.awaitIdentPos = startPos;
5510
5515
  }
5511
- prop.kind = "init";
5512
5516
  if (isPattern) {
5513
5517
  prop.value = this.parseMaybeDefault(
5514
5518
  startPos,
@@ -5527,6 +5531,7 @@
5527
5531
  } else {
5528
5532
  prop.value = this.copyNode(prop.key);
5529
5533
  }
5534
+ prop.kind = "init";
5530
5535
  prop.shorthand = true;
5531
5536
  } else {
5532
5537
  this.unexpected();
@@ -5735,7 +5740,7 @@
5735
5740
  );
5736
5741
  }
5737
5742
  if (
5738
- this.currentThisScope().inClassFieldInit &&
5743
+ !(this.currentThisScope().flags & SCOPE_VAR) &&
5739
5744
  name === "arguments"
5740
5745
  ) {
5741
5746
  this.raiseRecoverable(
@@ -5863,6 +5868,9 @@
5863
5868
  pp$4.raise = function (pos, message) {
5864
5869
  var loc = getLineInfo(this.input, pos);
5865
5870
  message += " (" + loc.line + ":" + loc.column + ")";
5871
+ if (this.sourceFile) {
5872
+ message += " in " + this.sourceFile;
5873
+ }
5866
5874
  var err = new SyntaxError(message);
5867
5875
  err.pos = pos;
5868
5876
  err.loc = loc;
@@ -5881,7 +5889,6 @@
5881
5889
  this.var = [];
5882
5890
  this.lexical = [];
5883
5891
  this.functions = [];
5884
- this.inClassFieldInit = false;
5885
5892
  };
5886
5893
  pp$3.enterScope = function (flags) {
5887
5894
  this.scopeStack.push(new Scope(flags));
@@ -5965,7 +5972,10 @@
5965
5972
  pp$3.currentVarScope = function () {
5966
5973
  for (var i = this.scopeStack.length - 1; ; i--) {
5967
5974
  var scope = this.scopeStack[i];
5968
- if (scope.flags & SCOPE_VAR) {
5975
+ if (
5976
+ scope.flags &
5977
+ (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK)
5978
+ ) {
5969
5979
  return scope;
5970
5980
  }
5971
5981
  }
@@ -5973,7 +5983,13 @@
5973
5983
  pp$3.currentThisScope = function () {
5974
5984
  for (var i = this.scopeStack.length - 1; ; i--) {
5975
5985
  var scope = this.scopeStack[i];
5976
- if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) {
5986
+ if (
5987
+ scope.flags &
5988
+ (SCOPE_VAR |
5989
+ SCOPE_CLASS_FIELD_INIT |
5990
+ SCOPE_CLASS_STATIC_BLOCK) &&
5991
+ !(scope.flags & SCOPE_ARROW)
5992
+ ) {
5977
5993
  return scope;
5978
5994
  }
5979
5995
  }
@@ -8350,7 +8366,7 @@
8350
8366
  }
8351
8367
  return this.finishToken(type, word);
8352
8368
  };
8353
- var version = "8.14.0";
8369
+ var version = "8.14.1";
8354
8370
  Parser.acorn = {
8355
8371
  Parser,
8356
8372
  version,
@@ -9105,7 +9121,7 @@
9105
9121
  const fs = __nccwpck_require__(9896);
9106
9122
  const { join, normalize, resolve } = __nccwpck_require__(6928);
9107
9123
  const { totalist } = __nccwpck_require__(8794);
9108
- const { parse } = __nccwpck_require__(9847);
9124
+ const { parse } = __nccwpck_require__(2600);
9109
9125
  const { lookup } = __nccwpck_require__(2443);
9110
9126
  const noop = () => {};
9111
9127
  function isMatch(uri, arr) {
@@ -9736,7 +9752,7 @@
9736
9752
  9451: (module, __unused_webpack_exports, __nccwpck_require__) => {
9737
9753
  "use strict";
9738
9754
  const fs = __nccwpck_require__(9896);
9739
- const acorn = __nccwpck_require__(8024);
9755
+ const acorn = __nccwpck_require__(2424);
9740
9756
  const walk = __nccwpck_require__(9703);
9741
9757
  module.exports = { parseBundle };
9742
9758
  function parseBundle(bundlePath) {