@better-t-stack/template-generator 3.37.0 → 3.38.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.
@@ -1,7 +1,7 @@
1
1
  import path from "node:path";
2
2
  //#endregion
3
3
  //#region ../../node_modules/.bun/is-binary-path@3.0.0/node_modules/is-binary-path/index.js
4
- const extensions = new Set([
4
+ const extensions = /* @__PURE__ */ new Set([
5
5
  "3dm",
6
6
  "3ds",
7
7
  "3g2",
@@ -271,4 +271,4 @@ function isBinaryPath(filePath) {
271
271
  //#endregion
272
272
  export { isBinaryPath as t };
273
273
 
274
- //# sourceMappingURL=is-binary-path-maAgJE_Q.mjs.map
274
+ //# sourceMappingURL=is-binary-path-C-QlvTjz.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-binary-path-maAgJE_Q.mjs","names":["binaryExtensions","binaryExtensions"],"sources":["../../../node_modules/.bun/binary-extensions@3.1.0/node_modules/binary-extensions/binary-extensions.json","../../../node_modules/.bun/binary-extensions@3.1.0/node_modules/binary-extensions/index.js","../../../node_modules/.bun/is-binary-path@3.0.0/node_modules/is-binary-path/index.js"],"sourcesContent":["","import binaryExtensions from './binary-extensions.json' with {type: 'json'};\n\nexport default binaryExtensions;\n","import path from 'node:path';\nimport binaryExtensions from 'binary-extensions';\n\nconst extensions = new Set(binaryExtensions);\n\nexport default function isBinaryPath(filePath) {\n\treturn extensions.has(path.extname(filePath).slice(1).toLowerCase());\n}\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;AEGA,MAAM,aAAa,IAAI,IAAIC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,CAAgB;AAE3C,SAAwB,aAAa,UAAU;CAC9C,OAAO,WAAW,IAAI,KAAK,QAAQ,QAAQ,EAAE,MAAM,CAAC,EAAE,YAAY,CAAC;AACpE"}
1
+ {"version":3,"file":"is-binary-path-C-QlvTjz.mjs","names":["binaryExtensions","binaryExtensions"],"sources":["../../../node_modules/.bun/binary-extensions@3.1.0/node_modules/binary-extensions/binary-extensions.json","../../../node_modules/.bun/binary-extensions@3.1.0/node_modules/binary-extensions/index.js","../../../node_modules/.bun/is-binary-path@3.0.0/node_modules/is-binary-path/index.js"],"sourcesContent":["","import binaryExtensions from './binary-extensions.json' with {type: 'json'};\n\nexport default binaryExtensions;\n","import path from 'node:path';\nimport binaryExtensions from 'binary-extensions';\n\nconst extensions = new Set(binaryExtensions);\n\nexport default function isBinaryPath(filePath) {\n\treturn extensions.has(path.extname(filePath).slice(1).toLowerCase());\n}\n"],"x_google_ignoreList":[0,1,2],"mappings":";;;AEGA,MAAM,6BAAa,IAAI,IAAIC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,CAAgB;AAE3C,SAAwB,aAAa,UAAU;CAC9C,OAAO,WAAW,IAAI,KAAK,QAAQ,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC;AACpE"}
@@ -1,4 +1,4 @@
1
- import { t as isBinaryPath } from "./is-binary-path-maAgJE_Q.mjs";
1
+ import { t as isBinaryPath } from "./is-binary-path-C-QlvTjz.mjs";
2
2
  import { dirname, join } from "pathe";
3
3
  import fs from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
@@ -30,7 +30,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  enumerable: true
31
31
  }) : target, mod));
32
32
  //#endregion
33
- //#region ../../node_modules/.bun/fdir@6.5.0+5b2c60377f53a28e/node_modules/fdir/dist/index.mjs
33
+ //#region ../../node_modules/.bun/fdir@6.5.0+0cdedc5136c7dcff/node_modules/fdir/dist/index.mjs
34
34
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
35
35
  function cleanPath(path) {
36
36
  let normalized = normalize$1(path);
@@ -538,7 +538,7 @@ var Builder = class {
538
538
  }
539
539
  };
540
540
  //#endregion
541
- //#region ../../node_modules/.bun/picomatch@4.0.4/node_modules/picomatch/lib/constants.js
541
+ //#region ../../node_modules/.bun/picomatch@4.0.5/node_modules/picomatch/lib/constants.js
542
542
  var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
543
543
  const WIN_SLASH = "\\\\/";
544
544
  const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
@@ -707,7 +707,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
707
707
  };
708
708
  }));
709
709
  //#endregion
710
- //#region ../../node_modules/.bun/picomatch@4.0.4/node_modules/picomatch/lib/utils.js
710
+ //#region ../../node_modules/.bun/picomatch@4.0.5/node_modules/picomatch/lib/utils.js
711
711
  var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
712
712
  const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
713
713
  exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
@@ -755,7 +755,7 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
755
755
  };
756
756
  }));
757
757
  //#endregion
758
- //#region ../../node_modules/.bun/picomatch@4.0.4/node_modules/picomatch/lib/scan.js
758
+ //#region ../../node_modules/.bun/picomatch@4.0.5/node_modules/picomatch/lib/scan.js
759
759
  var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
760
760
  const utils = require_utils();
761
761
  const { 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 } = require_constants();
@@ -1042,7 +1042,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1042
1042
  module.exports = scan;
1043
1043
  }));
1044
1044
  //#endregion
1045
- //#region ../../node_modules/.bun/picomatch@4.0.4/node_modules/picomatch/lib/parse.js
1045
+ //#region ../../node_modules/.bun/picomatch@4.0.5/node_modules/picomatch/lib/parse.js
1046
1046
  var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1047
1047
  const constants = require_constants();
1048
1048
  const utils = require_utils();
@@ -1197,7 +1197,10 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1197
1197
  }
1198
1198
  }
1199
1199
  };
1200
- const getStarExtglobSequenceOutput = (pattern) => {
1200
+ const buildCharClassStar = (chars) => {
1201
+ return `${chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`}*`;
1202
+ };
1203
+ const getStarExtglobSequenceChars = (pattern) => {
1201
1204
  let index = 0;
1202
1205
  const chars = [];
1203
1206
  while (index < pattern.length) {
@@ -1211,7 +1214,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1211
1214
  index += match.end + 1;
1212
1215
  }
1213
1216
  if (chars.length < 1) return;
1214
- return `${chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`}*`;
1217
+ return chars;
1215
1218
  };
1216
1219
  const repeatedExtglobRecursion = (pattern) => {
1217
1220
  let depth = 0;
@@ -1231,14 +1234,28 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1231
1234
  if (branches.length > 1) {
1232
1235
  if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) return { risky: true };
1233
1236
  }
1237
+ const safeChars = [];
1238
+ let sawStarSequence = false;
1239
+ let combinable = true;
1234
1240
  for (const branch of branches) {
1235
- const safeOutput = getStarExtglobSequenceOutput(branch);
1236
- if (safeOutput) return {
1237
- risky: true,
1238
- safeOutput
1239
- };
1241
+ const chars = getStarExtglobSequenceChars(branch);
1242
+ if (chars) {
1243
+ sawStarSequence = true;
1244
+ safeChars.push(...chars);
1245
+ continue;
1246
+ }
1247
+ const literal = normalizeSimpleBranch(branch);
1248
+ if (literal && literal.length === 1) {
1249
+ safeChars.push(literal);
1250
+ continue;
1251
+ }
1252
+ combinable = false;
1240
1253
  if (repeatedExtglobRecursion(branch) > max) return { risky: true };
1241
1254
  }
1255
+ if (sawStarSequence) return combinable ? {
1256
+ risky: true,
1257
+ safeOutput: buildCharClassStar([...new Set(safeChars)])
1258
+ } : { risky: true };
1242
1259
  return { risky: false };
1243
1260
  };
1244
1261
  /**
@@ -1389,7 +1406,8 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1389
1406
  };
1390
1407
  const extglobClose = (token) => {
1391
1408
  const literal = input.slice(token.startIndex, state.index + 1);
1392
- const analysis = analyzeRepeatedExtglob(input.slice(token.startIndex + 2, state.index), opts);
1409
+ const body = input.slice(token.startIndex + 2, state.index);
1410
+ const analysis = analyzeRepeatedExtglob(body, opts);
1393
1411
  if ((token.type === "plus" || token.type === "star") && analysis.risky) {
1394
1412
  const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
1395
1413
  const open = tokens[token.tokensIndex];
@@ -1515,7 +1533,8 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1515
1533
  if (inner.includes(":")) {
1516
1534
  const idx = prev.value.lastIndexOf("[");
1517
1535
  const pre = prev.value.slice(0, idx);
1518
- const posix = POSIX_REGEX_SOURCE[prev.value.slice(idx + 2)];
1536
+ const rest = prev.value.slice(idx + 2);
1537
+ const posix = POSIX_REGEX_SOURCE[rest];
1519
1538
  if (posix) {
1520
1539
  prev.value = pre + posix;
1521
1540
  state.backtrack = true;
@@ -2097,7 +2116,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2097
2116
  module.exports = parse;
2098
2117
  }));
2099
2118
  //#endregion
2100
- //#region ../../node_modules/.bun/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js
2119
+ //#region ../../node_modules/.bun/picomatch@4.0.5/node_modules/picomatch/lib/picomatch.js
2101
2120
  var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2102
2121
  const scan = require_scan();
2103
2122
  const parse = require_parse();
@@ -2118,6 +2137,18 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2118
2137
  * const isMatch = picomatch('*.!(*a)');
2119
2138
  * console.log(isMatch('a.a')); //=> false
2120
2139
  * console.log(isMatch('a.b')); //=> true
2140
+ *
2141
+ * // For environments without `node.js`, `picomatch/posix` provides you a dependency-free matcher, without automatic OS detection.
2142
+ * const picomatch = require('picomatch/posix');
2143
+ * // the same API, defaulting to posix paths
2144
+ * const isMatch = picomatch('a/*');
2145
+ * console.log(isMatch('a\\b')); //=> false
2146
+ * console.log(isMatch('a/b')); //=> true
2147
+ *
2148
+ * // you can still configure the matcher function to accept windows paths
2149
+ * const isMatch = picomatch('a/*', { options: windows });
2150
+ * console.log(isMatch('a\\b')); //=> true
2151
+ * console.log(isMatch('a/b')); //=> true
2121
2152
  * ```
2122
2153
  * @name picomatch
2123
2154
  * @param {String|Array} `globs` One or more glob patterns.
@@ -2236,8 +2267,8 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2236
2267
  * @return {Boolean}
2237
2268
  * @api public
2238
2269
  */
2239
- picomatch.matchBase = (input, glob, options) => {
2240
- return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input));
2270
+ picomatch.matchBase = (input, glob, options, posix = options && options.windows) => {
2271
+ return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input, { windows: posix }));
2241
2272
  };
2242
2273
  /**
2243
2274
  * Returns true if **any** of the given glob `patterns` match the specified `string`.
@@ -2397,7 +2428,7 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2397
2428
  module.exports = picomatch;
2398
2429
  }));
2399
2430
  //#endregion
2400
- //#region ../../node_modules/.bun/tinyglobby@0.2.16/node_modules/tinyglobby/dist/index.mjs
2431
+ //#region ../../node_modules/.bun/tinyglobby@0.2.17/node_modules/tinyglobby/dist/index.mjs
2401
2432
  var import_picomatch = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
2402
2433
  const pico = require_picomatch$1();
2403
2434
  const utils = require_utils();
@@ -2413,6 +2444,7 @@ var import_picomatch = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((
2413
2444
  })))(), 1);
2414
2445
  const isReadonlyArray = Array.isArray;
2415
2446
  const BACKSLASHES = /\\/g;
2447
+ const DRIVE_RELATIVE_PATH = /^[A-Za-z]:$/;
2416
2448
  const isWin = process.platform === "win32";
2417
2449
  const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
2418
2450
  function getPartialMatcher(patterns, options = {}) {
@@ -2479,6 +2511,9 @@ function buildRelative(cwd, root) {
2479
2511
  return p[p.length - 1] === "/" && result !== "" ? `${result}/` : result || ".";
2480
2512
  };
2481
2513
  }
2514
+ function ensureNonDriveRelativePath(path) {
2515
+ return path.replace(DRIVE_RELATIVE_PATH, (match) => `${match}/`);
2516
+ }
2482
2517
  const splitPatternOptions = { parts: true };
2483
2518
  function splitPattern(path) {
2484
2519
  var _result$parts;
@@ -2540,7 +2575,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
2540
2575
  }
2541
2576
  const potentialRoot = posix.join(cwd, parentDir.slice(i * 3));
2542
2577
  if (potentialRoot[0] !== "." && props.root.length > potentialRoot.length) {
2543
- props.root = potentialRoot;
2578
+ props.root = ensureNonDriveRelativePath(potentialRoot);
2544
2579
  props.depthOffset = -n + i;
2545
2580
  }
2546
2581
  }
@@ -2560,7 +2595,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
2560
2595
  }
2561
2596
  props.depthOffset = newCommonPath.length;
2562
2597
  props.commonPath = newCommonPath;
2563
- props.root = newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd;
2598
+ props.root = ensureNonDriveRelativePath(newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd);
2564
2599
  }
2565
2600
  return result;
2566
2601
  }
@@ -2649,18 +2684,15 @@ function formatPaths(paths, mapper) {
2649
2684
  }
2650
2685
  const defaultOptions = {
2651
2686
  caseSensitiveMatch: true,
2652
- cwd: process.cwd(),
2653
2687
  debug: !!process.env.TINYGLOBBY_DEBUG,
2654
2688
  expandDirectories: true,
2655
2689
  followSymbolicLinks: true,
2656
2690
  onlyFiles: true
2657
2691
  };
2658
2692
  function getOptions(options) {
2659
- const opts = {
2660
- ...defaultOptions,
2661
- ...options
2662
- };
2663
- opts.cwd = (opts.cwd instanceof URL ? fileURLToPath$1(opts.cwd) : resolve(opts.cwd)).replace(BACKSLASHES, "/");
2693
+ const opts = Object.assign({}, options);
2694
+ for (const key in defaultOptions) if (opts[key] === void 0) Object.assign(opts, { [key]: defaultOptions[key] });
2695
+ opts.cwd = (opts.cwd instanceof URL ? fileURLToPath$1(opts.cwd) : resolve(opts.cwd || process.cwd())).replace(BACKSLASHES, "/");
2664
2696
  opts.ignore = ensureStringArray(opts.ignore);
2665
2697
  opts.fs && (opts.fs = {
2666
2698
  readdir: opts.fs.readdir || readdir,
@@ -2748,4 +2780,4 @@ async function listTemplates(prefix) {
2748
2780
  //#endregion
2749
2781
  export { loadTemplates as a, loadTemplate as i, getTemplatesRoot as n, listTemplates as r, getBinaryTemplatesRoot as t };
2750
2782
 
2751
- //# sourceMappingURL=template-reader-DVuwwW6S.mjs.map
2783
+ //# sourceMappingURL=template-reader-Apnxs6ej.mjs.map