with-zephyr 0.1.1 → 0.1.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.
package/dist/index.js CHANGED
@@ -43515,7 +43515,10 @@ const parseClass = (glob, position)=>{
43515
43515
  true
43516
43516
  ];
43517
43517
  };
43518
- const unescape_unescape = (s, { windowsPathsNoEscape = false } = {})=>windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, '$1') : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1');
43518
+ const unescape_unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {})=>{
43519
+ if (magicalBraces) return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, '$1') : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1');
43520
+ return windowsPathsNoEscape ? s.replace(/\[([^\/\\{}])\]/g, '$1') : s.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, '$1$2').replace(/\\([^\/{}])/g, '$1');
43521
+ };
43519
43522
  const types = new Set([
43520
43523
  '!',
43521
43524
  '?',
@@ -43760,7 +43763,7 @@ class ast_AST {
43760
43763
  const dot = allowDot ?? !!this.#options.dot;
43761
43764
  if (this.#root === this) this.#fillNegs();
43762
43765
  if (!this.type) {
43763
- const noEmpty = this.isStart() && this.isEnd();
43766
+ const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s)=>'string' != typeof s);
43764
43767
  const src = this.#parts.map((p)=>{
43765
43768
  const [re, _, hasMagic, uflag] = 'string' == typeof p ? ast_AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
43766
43769
  this.#hasMagic = this.#hasMagic || hasMagic;
@@ -43857,8 +43860,7 @@ class ast_AST {
43857
43860
  }
43858
43861
  }
43859
43862
  if ('*' === c) {
43860
- if (noEmpty && '*' === glob) re += starNoEmpty;
43861
- else re += star;
43863
+ re += noEmpty && '*' === glob ? starNoEmpty : star;
43862
43864
  hasMagic = true;
43863
43865
  continue;
43864
43866
  }
@@ -43877,7 +43879,10 @@ class ast_AST {
43877
43879
  ];
43878
43880
  }
43879
43881
  }
43880
- const escape_escape = (s, { windowsPathsNoEscape = false } = {})=>windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, '[$&]') : s.replace(/[?*()[\]\\]/g, '\\$&');
43882
+ const escape_escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {})=>{
43883
+ if (magicalBraces) return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, '[$&]') : s.replace(/[?*()[\]\\{}]/g, '\\$&');
43884
+ return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, '[$&]') : s.replace(/[?*()[\]\\]/g, '\\$&');
43885
+ };
43881
43886
  const minimatch = (p, pattern, options = {})=>{
43882
43887
  assertValidPattern(pattern);
43883
43888
  if (!options.nocomment && '#' === pattern.charAt(0)) return false;
@@ -44413,13 +44418,19 @@ class esm_Minimatch {
44413
44418
  if (p !== GLOBSTAR || prev === GLOBSTAR) return;
44414
44419
  if (void 0 === prev) if (void 0 !== next && next !== GLOBSTAR) pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
44415
44420
  else pp[i] = twoStar;
44416
- else if (void 0 === next) pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?';
44421
+ else if (void 0 === next) pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
44417
44422
  else if (next !== GLOBSTAR) {
44418
44423
  pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
44419
44424
  pp[i + 1] = GLOBSTAR;
44420
44425
  }
44421
44426
  });
44422
- return pp.filter((p)=>p !== GLOBSTAR).join('/');
44427
+ const filtered = pp.filter((p)=>p !== GLOBSTAR);
44428
+ if (this.partial && filtered.length >= 1) {
44429
+ const prefixes = [];
44430
+ for(let i = 1; i <= filtered.length; i++)prefixes.push(filtered.slice(0, i).join('/'));
44431
+ return '(?:' + prefixes.join('|') + ')';
44432
+ }
44433
+ return filtered.join('/');
44423
44434
  }).join('|');
44424
44435
  const [open, close] = set.length > 1 ? [
44425
44436
  '(?:',
@@ -44429,6 +44440,7 @@ class esm_Minimatch {
44429
44440
  ''
44430
44441
  ];
44431
44442
  re = '^' + open + re + close + '$';
44443
+ if (this.partial) re = '^(?:\\/|' + open + re.slice(1, -1) + close + ')$';
44432
44444
  if (this.negate) re = '^(?!' + re + ').+$';
44433
44445
  try {
44434
44446
  this.regexp = new RegExp(re, [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "1.0.0",
3
- "timestamp": "2025-10-29T15:11:47.671Z",
3
+ "timestamp": "2025-11-28T18:52:09.251Z",
4
4
  "dependencies": {},
5
5
  "zeVars": {}
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "with-zephyr",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "A codemod to automatically add withZephyr plugin to bundler configurations",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -38,7 +38,7 @@
38
38
  "@types/node": "^24.5.2",
39
39
  "@rslib/core": "^0.13.3",
40
40
  "typescript": "^5.9.2",
41
- "zephyr-rsbuild-plugin": "0.1.1"
41
+ "zephyr-rsbuild-plugin": "0.1.2"
42
42
  },
43
43
  "keywords": [
44
44
  "zephyr",