@vue/compiler-sfc 3.5.28 → 3.5.29

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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Lower level utilities for compiling Vue Single File Components
4
4
 
5
- **Note: as of 3.2.13+, this package is included as a dependency of the main `vue` package and can be accessed as `vue/compiler-sfc`. This means you no longer need to explicitly install this package and ensure its version match that of `vue`'s. Just use the main `vue/compiler-sfc` deep import instead.**
5
+ **Note: as of 3.2.13+, this package is included as a dependency of the main `vue` package and can be accessed as `vue/compiler-sfc`. This means you no longer need to explicitly install this package and ensure its version matches that of `vue`'s. Just use the main `vue/compiler-sfc` deep import instead.**
6
6
 
7
7
  This package contains lower level utilities that you can use if you are writing a plugin / transform for a bundler or module system that compiles Vue Single File Components (SFCs) into JavaScript. It is used in [vue-loader](https://github.com/vuejs/vue-loader) and [@vitejs/plugin-vue](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue).
8
8
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-sfc v3.5.28
2
+ * @vue/compiler-sfc v3.5.29
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -20353,10 +20353,8 @@ const parseClass = (glob, position) => {
20353
20353
  }
20354
20354
  const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';
20355
20355
  const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';
20356
- const comb = ranges.length && negs.length
20357
- ? '(' + sranges + '|' + snegs + ')'
20358
- : ranges.length
20359
- ? sranges
20356
+ const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'
20357
+ : ranges.length ? sranges
20360
20358
  : snegs;
20361
20359
  return [comb, uflag, endPos - pos, true];
20362
20360
  };
@@ -20382,14 +20380,14 @@ const parseClass = (glob, position) => {
20382
20380
  */
20383
20381
  const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
20384
20382
  if (magicalBraces) {
20385
- return windowsPathsNoEscape
20386
- ? s.replace(/\[([^\/\\])\]/g, '$1')
20383
+ return windowsPathsNoEscape ?
20384
+ s.replace(/\[([^\/\\])\]/g, '$1')
20387
20385
  : s
20388
20386
  .replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2')
20389
20387
  .replace(/\\([^\/])/g, '$1');
20390
20388
  }
20391
- return windowsPathsNoEscape
20392
- ? s.replace(/\[([^\/\\{}])\]/g, '$1')
20389
+ return windowsPathsNoEscape ?
20390
+ s.replace(/\[([^\/\\{}])\]/g, '$1')
20393
20391
  : s
20394
20392
  .replace(/((?!\\).|^)\[([^\/\\{}])\]/g, '$1$2')
20395
20393
  .replace(/\\([^\/{}])/g, '$1');
@@ -20514,7 +20512,8 @@ class AST {
20514
20512
  if (p === '')
20515
20513
  continue;
20516
20514
  /* c8 ignore start */
20517
- if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) {
20515
+ if (typeof p !== 'string' &&
20516
+ !(p instanceof AST && p.#parent === this)) {
20518
20517
  throw new Error('invalid part: ' + p);
20519
20518
  }
20520
20519
  /* c8 ignore stop */
@@ -20522,8 +20521,10 @@ class AST {
20522
20521
  }
20523
20522
  }
20524
20523
  toJSON() {
20525
- const ret = this.type === null
20526
- ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON()))
20524
+ const ret = this.type === null ?
20525
+ this.#parts
20526
+ .slice()
20527
+ .map(p => (typeof p === 'string' ? p : p.toJSON()))
20527
20528
  : [this.type, ...this.#parts.map(p => p.toJSON())];
20528
20529
  if (this.isStart() && !this.type)
20529
20530
  ret.unshift([]);
@@ -20812,8 +20813,8 @@ class AST {
20812
20813
  !this.#parts.some(s => typeof s !== 'string');
20813
20814
  const src = this.#parts
20814
20815
  .map(p => {
20815
- const [re, _, hasMagic, uflag] = typeof p === 'string'
20816
- ? AST.#parseGlob(p, this.#hasMagic, noEmpty)
20816
+ const [re, _, hasMagic, uflag] = typeof p === 'string' ?
20817
+ AST.#parseGlob(p, this.#hasMagic, noEmpty)
20817
20818
  : p.toRegExpSource(allowDot);
20818
20819
  this.#hasMagic = this.#hasMagic || hasMagic;
20819
20820
  this.#uflag = this.#uflag || uflag;
@@ -20842,7 +20843,10 @@ class AST {
20842
20843
  // no need to prevent dots if it can't match a dot, or if a
20843
20844
  // sub-pattern will be preventing it anyway.
20844
20845
  const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
20845
- start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : '';
20846
+ start =
20847
+ needNoTrav ? startNoTraversal
20848
+ : needNoDot ? startNoDot
20849
+ : '';
20846
20850
  }
20847
20851
  }
20848
20852
  }
@@ -20878,8 +20882,8 @@ class AST {
20878
20882
  return [s, unescape(this.toString()), false, false];
20879
20883
  }
20880
20884
  // XXX abstract out this map method
20881
- let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot
20882
- ? ''
20885
+ let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?
20886
+ ''
20883
20887
  : this.#partsToRegExp(true);
20884
20888
  if (bodyDotAllowed === body) {
20885
20889
  bodyDotAllowed = '';
@@ -20893,20 +20897,16 @@ class AST {
20893
20897
  final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
20894
20898
  }
20895
20899
  else {
20896
- const close = this.type === '!'
20897
- ? // !() must match something,but !(x) can match ''
20898
- '))' +
20899
- (this.isStart() && !dot && !allowDot ? startNoDot : '') +
20900
- star$1 +
20901
- ')'
20902
- : this.type === '@'
20903
- ? ')'
20904
- : this.type === '?'
20905
- ? ')?'
20906
- : this.type === '+' && bodyDotAllowed
20907
- ? ')'
20908
- : this.type === '*' && bodyDotAllowed
20909
- ? `)?`
20900
+ const close = this.type === '!' ?
20901
+ // !() must match something,but !(x) can match ''
20902
+ '))' +
20903
+ (this.isStart() && !dot && !allowDot ? startNoDot : '') +
20904
+ star$1 +
20905
+ ')'
20906
+ : this.type === '@' ? ')'
20907
+ : this.type === '?' ? ')?'
20908
+ : this.type === '+' && bodyDotAllowed ? ')'
20909
+ : this.type === '*' && bodyDotAllowed ? `)?`
20910
20910
  : `)${this.type}`;
20911
20911
  final = start + body + close;
20912
20912
  }
@@ -20938,6 +20938,8 @@ class AST {
20938
20938
  let escaping = false;
20939
20939
  let re = '';
20940
20940
  let uflag = false;
20941
+ // multiple stars that aren't globstars coalesce into one *
20942
+ let inStar = false;
20941
20943
  for (let i = 0; i < glob.length; i++) {
20942
20944
  const c = glob.charAt(i);
20943
20945
  if (escaping) {
@@ -20945,6 +20947,17 @@ class AST {
20945
20947
  re += (reSpecials.has(c) ? '\\' : '') + c;
20946
20948
  continue;
20947
20949
  }
20950
+ if (c === '*') {
20951
+ if (inStar)
20952
+ continue;
20953
+ inStar = true;
20954
+ re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star$1;
20955
+ hasMagic = true;
20956
+ continue;
20957
+ }
20958
+ else {
20959
+ inStar = false;
20960
+ }
20948
20961
  if (c === '\\') {
20949
20962
  if (i === glob.length - 1) {
20950
20963
  re += '\\\\';
@@ -20964,11 +20977,6 @@ class AST {
20964
20977
  continue;
20965
20978
  }
20966
20979
  }
20967
- if (c === '*') {
20968
- re += noEmpty && glob === '*' ? starNoEmpty : star$1;
20969
- hasMagic = true;
20970
- continue;
20971
- }
20972
20980
  if (c === '?') {
20973
20981
  re += qmark$1;
20974
20982
  hasMagic = true;
@@ -20997,12 +21005,12 @@ const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}
20997
21005
  // that make those magic, and escaping ! as [!] isn't valid,
20998
21006
  // because [!]] is a valid glob class meaning not ']'.
20999
21007
  if (magicalBraces) {
21000
- return windowsPathsNoEscape
21001
- ? s.replace(/[?*()[\]{}]/g, '[$&]')
21008
+ return windowsPathsNoEscape ?
21009
+ s.replace(/[?*()[\]{}]/g, '[$&]')
21002
21010
  : s.replace(/[?*()[\]\\{}]/g, '\\$&');
21003
21011
  }
21004
- return windowsPathsNoEscape
21005
- ? s.replace(/[?*()[\]]/g, '[$&]')
21012
+ return windowsPathsNoEscape ?
21013
+ s.replace(/[?*()[\]]/g, '[$&]')
21006
21014
  : s.replace(/[?*()[\]\\]/g, '\\$&');
21007
21015
  };
21008
21016
 
@@ -21066,8 +21074,8 @@ const qmarksTestNoExtDot = ([$0]) => {
21066
21074
  return (f) => f.length === len && f !== '.' && f !== '..';
21067
21075
  };
21068
21076
  /* c8 ignore start */
21069
- const defaultPlatform = (typeof process === 'object' && process
21070
- ? (typeof process.env === 'object' &&
21077
+ const defaultPlatform = (typeof process === 'object' && process ?
21078
+ (typeof process.env === 'object' &&
21071
21079
  process.env &&
21072
21080
  process.env.__MINIMATCH_TESTING_PLATFORM__) ||
21073
21081
  process.platform
@@ -21151,7 +21159,7 @@ const braceExpand = (pattern, options = {}) => {
21151
21159
  // shortcut. no need to expand.
21152
21160
  return [pattern];
21153
21161
  }
21154
- return expand(pattern);
21162
+ return expand(pattern, { max: options.braceExpandMax });
21155
21163
  };
21156
21164
  minimatch.braceExpand = braceExpand;
21157
21165
  // parse a component of the expanded set.
@@ -21204,8 +21212,10 @@ class Minimatch {
21204
21212
  this.pattern = pattern;
21205
21213
  this.platform = options.platform || defaultPlatform;
21206
21214
  this.isWindows = this.platform === 'win32';
21215
+ // avoid the annoying deprecation flag lol
21216
+ const awe = ('allowWindow' + 'sEscape');
21207
21217
  this.windowsPathsNoEscape =
21208
- !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
21218
+ !!options.windowsPathsNoEscape || options[awe] === false;
21209
21219
  if (this.windowsPathsNoEscape) {
21210
21220
  this.pattern = this.pattern.replace(/\\/g, '/');
21211
21221
  }
@@ -21218,8 +21228,8 @@ class Minimatch {
21218
21228
  this.partial = !!options.partial;
21219
21229
  this.nocase = !!this.options.nocase;
21220
21230
  this.windowsNoMagicRoot =
21221
- options.windowsNoMagicRoot !== undefined
21222
- ? options.windowsNoMagicRoot
21231
+ options.windowsNoMagicRoot !== undefined ?
21232
+ options.windowsNoMagicRoot
21223
21233
  : !!(this.isWindows && this.nocase);
21224
21234
  this.globSet = [];
21225
21235
  this.globParts = [];
@@ -21282,7 +21292,10 @@ class Minimatch {
21282
21292
  !globMagic.test(s[3]);
21283
21293
  const isDrive = /^[a-z]:/i.test(s[0]);
21284
21294
  if (isUNC) {
21285
- return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))];
21295
+ return [
21296
+ ...s.slice(0, 4),
21297
+ ...s.slice(4).map(ss => this.parse(ss)),
21298
+ ];
21286
21299
  }
21287
21300
  else if (isDrive) {
21288
21301
  return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
@@ -21314,7 +21327,7 @@ class Minimatch {
21314
21327
  // to the right as possible, even if it increases the number
21315
21328
  // of patterns that we have to process.
21316
21329
  preprocess(globParts) {
21317
- // if we're not in globstar mode, then turn all ** into *
21330
+ // if we're not in globstar mode, then turn ** into *
21318
21331
  if (this.options.noglobstar) {
21319
21332
  for (let i = 0; i < globParts.length; i++) {
21320
21333
  for (let j = 0; j < globParts[i].length; j++) {
@@ -21618,10 +21631,17 @@ class Minimatch {
21618
21631
  pattern[2] === '?' &&
21619
21632
  typeof pattern[3] === 'string' &&
21620
21633
  /^[a-z]:$/i.test(pattern[3]);
21621
- const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
21622
- const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
21634
+ const fdi = fileUNC ? 3
21635
+ : fileDrive ? 0
21636
+ : undefined;
21637
+ const pdi = patternUNC ? 3
21638
+ : patternDrive ? 0
21639
+ : undefined;
21623
21640
  if (typeof fdi === 'number' && typeof pdi === 'number') {
21624
- const [fd, pd] = [file[fdi], pattern[pdi]];
21641
+ const [fd, pd] = [
21642
+ file[fdi],
21643
+ pattern[pdi],
21644
+ ];
21625
21645
  if (fd.toLowerCase() === pd.toLowerCase()) {
21626
21646
  pattern[pdi] = fd;
21627
21647
  if (pdi > fdi) {
@@ -21802,21 +21822,19 @@ class Minimatch {
21802
21822
  fastTest = options.dot ? starTestDot : starTest;
21803
21823
  }
21804
21824
  else if ((m = pattern.match(starDotExtRE))) {
21805
- fastTest = (options.nocase
21806
- ? options.dot
21807
- ? starDotExtTestNocaseDot
21825
+ fastTest = (options.nocase ?
21826
+ options.dot ?
21827
+ starDotExtTestNocaseDot
21808
21828
  : starDotExtTestNocase
21809
- : options.dot
21810
- ? starDotExtTestDot
21829
+ : options.dot ? starDotExtTestDot
21811
21830
  : starDotExtTest)(m[1]);
21812
21831
  }
21813
21832
  else if ((m = pattern.match(qmarksRE))) {
21814
- fastTest = (options.nocase
21815
- ? options.dot
21816
- ? qmarksTestNocaseDot
21833
+ fastTest = (options.nocase ?
21834
+ options.dot ?
21835
+ qmarksTestNocaseDot
21817
21836
  : qmarksTestNocase
21818
- : options.dot
21819
- ? qmarksTestDot
21837
+ : options.dot ? qmarksTestDot
21820
21838
  : qmarksTest)(m);
21821
21839
  }
21822
21840
  else if ((m = pattern.match(starDotStarRE))) {
@@ -21847,10 +21865,8 @@ class Minimatch {
21847
21865
  return this.regexp;
21848
21866
  }
21849
21867
  const options = this.options;
21850
- const twoStar = options.noglobstar
21851
- ? star
21852
- : options.dot
21853
- ? twoStarDot
21868
+ const twoStar = options.noglobstar ? star
21869
+ : options.dot ? twoStarDot
21854
21870
  : twoStarNoDot;
21855
21871
  const flags = new Set(options.nocase ? ['i'] : []);
21856
21872
  // regexpify non-globstar patterns
@@ -21866,11 +21882,9 @@ class Minimatch {
21866
21882
  for (const f of p.flags.split(''))
21867
21883
  flags.add(f);
21868
21884
  }
21869
- return typeof p === 'string'
21870
- ? regExpEscape(p)
21871
- : p === GLOBSTAR
21872
- ? GLOBSTAR
21873
- : p._src;
21885
+ return (typeof p === 'string' ? regExpEscape(p)
21886
+ : p === GLOBSTAR ? GLOBSTAR
21887
+ : p._src);
21874
21888
  });
21875
21889
  pp.forEach((p, i) => {
21876
21890
  const next = pp[i + 1];
@@ -25199,7 +25213,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
25199
25213
  return generator.toJSON();
25200
25214
  }
25201
25215
 
25202
- const version = "3.5.28";
25216
+ const version = "3.5.29";
25203
25217
  const parseCache = parseCache$1;
25204
25218
  const errorMessages = {
25205
25219
  ...CompilerDOM.errorMessages,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-sfc v3.5.28
2
+ * @vue/compiler-sfc v3.5.29
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -50778,7 +50778,7 @@ var __spreadValues = (a, b) => {
50778
50778
  }
50779
50779
  return a;
50780
50780
  };
50781
- const version = "3.5.28";
50781
+ const version = "3.5.29";
50782
50782
  const parseCache = parseCache$1;
50783
50783
  const errorMessages = __spreadValues(__spreadValues({}, errorMessages$1), DOMErrorMessages);
50784
50784
  const walk = walk$2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-sfc",
3
- "version": "3.5.28",
3
+ "version": "3.5.29",
4
4
  "description": "@vue/compiler-sfc",
5
5
  "main": "dist/compiler-sfc.cjs.js",
6
6
  "module": "dist/compiler-sfc.esm-browser.js",
@@ -47,10 +47,10 @@
47
47
  "magic-string": "^0.30.21",
48
48
  "postcss": "^8.5.6",
49
49
  "source-map-js": "^1.2.1",
50
- "@vue/compiler-core": "3.5.28",
51
- "@vue/compiler-dom": "3.5.28",
52
- "@vue/compiler-ssr": "3.5.28",
53
- "@vue/shared": "3.5.28"
50
+ "@vue/shared": "3.5.29",
51
+ "@vue/compiler-ssr": "3.5.29",
52
+ "@vue/compiler-core": "3.5.29",
53
+ "@vue/compiler-dom": "3.5.29"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@babel/types": "^7.29.0",
@@ -58,7 +58,7 @@
58
58
  "hash-sum": "^2.0.0",
59
59
  "lru-cache": "10.1.0",
60
60
  "merge-source-map": "^1.1.0",
61
- "minimatch": "~10.1.2",
61
+ "minimatch": "~10.2.0",
62
62
  "postcss-modules": "^6.0.1",
63
63
  "postcss-selector-parser": "^7.1.1",
64
64
  "pug": "^3.0.3",