@better-fullstack/template-generator 1.8.0 → 2.0.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.
@@ -2701,10 +2701,11 @@ var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2701
2701
  }));
2702
2702
 
2703
2703
  //#endregion
2704
- //#region ../../node_modules/.bun/tinyglobby@0.2.16/node_modules/tinyglobby/dist/index.mjs
2704
+ //#region ../../node_modules/.bun/tinyglobby@0.2.17/node_modules/tinyglobby/dist/index.mjs
2705
2705
  var import_picomatch = /* @__PURE__ */ __toESM(require_picomatch(), 1);
2706
2706
  const isReadonlyArray = Array.isArray;
2707
2707
  const BACKSLASHES = /\\/g;
2708
+ const DRIVE_RELATIVE_PATH = /^[A-Za-z]:$/;
2708
2709
  const isWin = process.platform === "win32";
2709
2710
  const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
2710
2711
  function getPartialMatcher(patterns, options = {}) {
@@ -2771,6 +2772,9 @@ function buildRelative(cwd, root) {
2771
2772
  return p[p.length - 1] === "/" && result !== "" ? `${result}/` : result || ".";
2772
2773
  };
2773
2774
  }
2775
+ function ensureNonDriveRelativePath(path$1) {
2776
+ return path$1.replace(DRIVE_RELATIVE_PATH, (match) => `${match}/`);
2777
+ }
2774
2778
  const splitPatternOptions = { parts: true };
2775
2779
  function splitPattern(path$1) {
2776
2780
  var _result$parts;
@@ -2832,7 +2836,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
2832
2836
  }
2833
2837
  const potentialRoot = posix.join(cwd, parentDir.slice(i * 3));
2834
2838
  if (potentialRoot[0] !== "." && props.root.length > potentialRoot.length) {
2835
- props.root = potentialRoot;
2839
+ props.root = ensureNonDriveRelativePath(potentialRoot);
2836
2840
  props.depthOffset = -n + i;
2837
2841
  }
2838
2842
  }
@@ -2852,7 +2856,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
2852
2856
  }
2853
2857
  props.depthOffset = newCommonPath.length;
2854
2858
  props.commonPath = newCommonPath;
2855
- props.root = newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd;
2859
+ props.root = ensureNonDriveRelativePath(newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd);
2856
2860
  }
2857
2861
  return result;
2858
2862
  }
@@ -2941,18 +2945,15 @@ function formatPaths(paths, mapper) {
2941
2945
  }
2942
2946
  const defaultOptions = {
2943
2947
  caseSensitiveMatch: true,
2944
- cwd: process.cwd(),
2945
2948
  debug: !!process.env.TINYGLOBBY_DEBUG,
2946
2949
  expandDirectories: true,
2947
2950
  followSymbolicLinks: true,
2948
2951
  onlyFiles: true
2949
2952
  };
2950
2953
  function getOptions(options) {
2951
- const opts = {
2952
- ...defaultOptions,
2953
- ...options
2954
- };
2955
- opts.cwd = (opts.cwd instanceof URL ? fileURLToPath$1(opts.cwd) : resolve(opts.cwd)).replace(BACKSLASHES, "/");
2954
+ const opts = Object.assign({}, options);
2955
+ for (const key in defaultOptions) if (opts[key] === void 0) Object.assign(opts, { [key]: defaultOptions[key] });
2956
+ opts.cwd = (opts.cwd instanceof URL ? fileURLToPath$1(opts.cwd) : resolve(opts.cwd || process.cwd())).replace(BACKSLASHES, "/");
2956
2957
  opts.ignore = ensureStringArray(opts.ignore);
2957
2958
  opts.fs && (opts.fs = {
2958
2959
  readdir: opts.fs.readdir || readdir,
@@ -3041,4 +3042,4 @@ async function listTemplates(prefix) {
3041
3042
 
3042
3043
  //#endregion
3043
3044
  export { loadTemplates as a, loadTemplate as i, getTemplatesRoot as n, isBinaryPath as o, listTemplates as r, getBinaryTemplatesRoot as t };
3044
- //# sourceMappingURL=template-reader-D1uxgWOQ.mjs.map
3045
+ //# sourceMappingURL=template-reader-BvvsuK44.mjs.map