@better-fullstack/template-generator 1.4.5 → 1.4.7

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,10 +1,10 @@
1
- import { t as isBinaryPath } from "./is-binary-path-BN88l03c.mjs";
2
1
  import { dirname, join } from "pathe";
2
+ import path from "node:path";
3
3
  import fs from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import * as nativeFs$1 from "fs";
6
6
  import nativeFs from "fs";
7
- import path, { basename, dirname as dirname$1, normalize as normalize$1, posix, relative, resolve, sep } from "path";
7
+ import path$1, { basename, dirname as dirname$1, normalize as normalize$1, posix, relative, resolve, sep } from "path";
8
8
  import { fileURLToPath as fileURLToPath$1 } from "url";
9
9
  import { createRequire } from "module";
10
10
 
@@ -35,29 +35,307 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
35
35
  enumerable: true
36
36
  }) : target, mod));
37
37
 
38
+ //#endregion
39
+ //#region ../../node_modules/.bun/binary-extensions@3.1.0/node_modules/binary-extensions/binary-extensions.json
40
+ var binary_extensions_default$1 = [
41
+ "3dm",
42
+ "3ds",
43
+ "3g2",
44
+ "3gp",
45
+ "7z",
46
+ "a",
47
+ "aac",
48
+ "adp",
49
+ "afdesign",
50
+ "afphoto",
51
+ "afpub",
52
+ "ai",
53
+ "aif",
54
+ "aiff",
55
+ "alz",
56
+ "ape",
57
+ "apk",
58
+ "appimage",
59
+ "ar",
60
+ "arj",
61
+ "asf",
62
+ "au",
63
+ "avi",
64
+ "bak",
65
+ "baml",
66
+ "bh",
67
+ "bin",
68
+ "bk",
69
+ "bmp",
70
+ "btif",
71
+ "bz2",
72
+ "bzip2",
73
+ "cab",
74
+ "caf",
75
+ "cgm",
76
+ "class",
77
+ "cmx",
78
+ "cpio",
79
+ "cr2",
80
+ "cr3",
81
+ "cur",
82
+ "dat",
83
+ "dcm",
84
+ "deb",
85
+ "dex",
86
+ "djvu",
87
+ "dll",
88
+ "dmg",
89
+ "dng",
90
+ "doc",
91
+ "docm",
92
+ "docx",
93
+ "dot",
94
+ "dotm",
95
+ "dra",
96
+ "DS_Store",
97
+ "dsk",
98
+ "dts",
99
+ "dtshd",
100
+ "dvb",
101
+ "dwg",
102
+ "dxf",
103
+ "ecelp4800",
104
+ "ecelp7470",
105
+ "ecelp9600",
106
+ "egg",
107
+ "eol",
108
+ "eot",
109
+ "epub",
110
+ "exe",
111
+ "f4v",
112
+ "fbs",
113
+ "fh",
114
+ "fla",
115
+ "flac",
116
+ "flatpak",
117
+ "fli",
118
+ "flv",
119
+ "fpx",
120
+ "fst",
121
+ "fvt",
122
+ "g3",
123
+ "gh",
124
+ "gif",
125
+ "graffle",
126
+ "gz",
127
+ "gzip",
128
+ "h261",
129
+ "h263",
130
+ "h264",
131
+ "icns",
132
+ "ico",
133
+ "ief",
134
+ "img",
135
+ "ipa",
136
+ "iso",
137
+ "jar",
138
+ "jpeg",
139
+ "jpg",
140
+ "jpgv",
141
+ "jpm",
142
+ "jxr",
143
+ "key",
144
+ "ktx",
145
+ "lha",
146
+ "lib",
147
+ "lvp",
148
+ "lz",
149
+ "lzh",
150
+ "lzma",
151
+ "lzo",
152
+ "m3u",
153
+ "m4a",
154
+ "m4v",
155
+ "mar",
156
+ "mdi",
157
+ "mht",
158
+ "mid",
159
+ "midi",
160
+ "mj2",
161
+ "mka",
162
+ "mkv",
163
+ "mmr",
164
+ "mng",
165
+ "mobi",
166
+ "mov",
167
+ "movie",
168
+ "mp3",
169
+ "mp4",
170
+ "mp4a",
171
+ "mpeg",
172
+ "mpg",
173
+ "mpga",
174
+ "mxu",
175
+ "nef",
176
+ "npx",
177
+ "numbers",
178
+ "nupkg",
179
+ "o",
180
+ "odp",
181
+ "ods",
182
+ "odt",
183
+ "oga",
184
+ "ogg",
185
+ "ogv",
186
+ "otf",
187
+ "ott",
188
+ "pages",
189
+ "pbm",
190
+ "pcx",
191
+ "pdb",
192
+ "pdf",
193
+ "pea",
194
+ "pgm",
195
+ "pic",
196
+ "png",
197
+ "pnm",
198
+ "pot",
199
+ "potm",
200
+ "potx",
201
+ "ppa",
202
+ "ppam",
203
+ "ppm",
204
+ "pps",
205
+ "ppsm",
206
+ "ppsx",
207
+ "ppt",
208
+ "pptm",
209
+ "pptx",
210
+ "psd",
211
+ "pya",
212
+ "pyc",
213
+ "pyo",
214
+ "pyv",
215
+ "qt",
216
+ "rar",
217
+ "ras",
218
+ "raw",
219
+ "resources",
220
+ "rgb",
221
+ "rip",
222
+ "rlc",
223
+ "rmf",
224
+ "rmvb",
225
+ "rpm",
226
+ "rtf",
227
+ "rz",
228
+ "s3m",
229
+ "s7z",
230
+ "scpt",
231
+ "sgi",
232
+ "shar",
233
+ "snap",
234
+ "sil",
235
+ "sketch",
236
+ "slk",
237
+ "smv",
238
+ "snk",
239
+ "so",
240
+ "stl",
241
+ "suo",
242
+ "sub",
243
+ "swf",
244
+ "tar",
245
+ "tbz",
246
+ "tbz2",
247
+ "tga",
248
+ "tgz",
249
+ "thmx",
250
+ "tif",
251
+ "tiff",
252
+ "tlz",
253
+ "ttc",
254
+ "ttf",
255
+ "txz",
256
+ "udf",
257
+ "uvh",
258
+ "uvi",
259
+ "uvm",
260
+ "uvp",
261
+ "uvs",
262
+ "uvu",
263
+ "viv",
264
+ "vob",
265
+ "war",
266
+ "wav",
267
+ "wax",
268
+ "wbmp",
269
+ "wdp",
270
+ "weba",
271
+ "webm",
272
+ "webp",
273
+ "whl",
274
+ "wim",
275
+ "wm",
276
+ "wma",
277
+ "wmv",
278
+ "wmx",
279
+ "woff",
280
+ "woff2",
281
+ "wrm",
282
+ "wvx",
283
+ "xbm",
284
+ "xif",
285
+ "xla",
286
+ "xlam",
287
+ "xls",
288
+ "xlsb",
289
+ "xlsm",
290
+ "xlsx",
291
+ "xlt",
292
+ "xltm",
293
+ "xltx",
294
+ "xm",
295
+ "xmind",
296
+ "xpi",
297
+ "xpm",
298
+ "xwd",
299
+ "xz",
300
+ "z",
301
+ "zip",
302
+ "zipx"
303
+ ];
304
+
305
+ //#endregion
306
+ //#region ../../node_modules/.bun/binary-extensions@3.1.0/node_modules/binary-extensions/index.js
307
+ var binary_extensions_default = binary_extensions_default$1;
308
+
309
+ //#endregion
310
+ //#region ../../node_modules/.bun/is-binary-path@3.0.0/node_modules/is-binary-path/index.js
311
+ const extensions = new Set(binary_extensions_default);
312
+ function isBinaryPath(filePath) {
313
+ return extensions.has(path.extname(filePath).slice(1).toLowerCase());
314
+ }
315
+
38
316
  //#endregion
39
317
  //#region ../../node_modules/.bun/fdir@6.5.0+a185e370e160e74e/node_modules/fdir/dist/index.mjs
40
318
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
41
- function cleanPath(path$1) {
42
- let normalized = normalize$1(path$1);
319
+ function cleanPath(path$2) {
320
+ let normalized = normalize$1(path$2);
43
321
  if (normalized.length > 1 && normalized[normalized.length - 1] === sep) normalized = normalized.substring(0, normalized.length - 1);
44
322
  return normalized;
45
323
  }
46
324
  const SLASHES_REGEX = /[\\/]/g;
47
- function convertSlashes(path$1, separator) {
48
- return path$1.replace(SLASHES_REGEX, separator);
325
+ function convertSlashes(path$2, separator) {
326
+ return path$2.replace(SLASHES_REGEX, separator);
49
327
  }
50
328
  const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
51
- function isRootDirectory(path$1) {
52
- return path$1 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$1);
329
+ function isRootDirectory(path$2) {
330
+ return path$2 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$2);
53
331
  }
54
- function normalizePath(path$1, options) {
332
+ function normalizePath(path$2, options) {
55
333
  const { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options;
56
- const pathNeedsCleaning = process.platform === "win32" && path$1.includes("/") || path$1.startsWith(".");
57
- if (resolvePaths) path$1 = resolve(path$1);
58
- if (normalizePath$1 || pathNeedsCleaning) path$1 = cleanPath(path$1);
59
- if (path$1 === ".") return "";
60
- return convertSlashes(path$1[path$1.length - 1] !== pathSeparator ? path$1 + pathSeparator : path$1, pathSeparator);
334
+ const pathNeedsCleaning = process.platform === "win32" && path$2.includes("/") || path$2.startsWith(".");
335
+ if (resolvePaths) path$2 = resolve(path$2);
336
+ if (normalizePath$1 || pathNeedsCleaning) path$2 = cleanPath(path$2);
337
+ if (path$2 === ".") return "";
338
+ return convertSlashes(path$2[path$2.length - 1] !== pathSeparator ? path$2 + pathSeparator : path$2, pathSeparator);
61
339
  }
62
340
  function joinPathWithBasePath(filename, directoryPath) {
63
341
  return directoryPath + filename;
@@ -93,8 +371,8 @@ const pushDirectory = (directoryPath, paths) => {
93
371
  paths.push(directoryPath || ".");
94
372
  };
95
373
  const pushDirectoryFilter = (directoryPath, paths, filters) => {
96
- const path$1 = directoryPath || ".";
97
- if (filters.every((filter) => filter(path$1, true))) paths.push(path$1);
374
+ const path$2 = directoryPath || ".";
375
+ if (filters.every((filter) => filter(path$2, true))) paths.push(path$2);
98
376
  };
99
377
  const empty$2 = () => {};
100
378
  function build$6(root, options) {
@@ -143,26 +421,26 @@ const empty = () => {};
143
421
  function build$3(options) {
144
422
  return options.group ? groupFiles : empty;
145
423
  }
146
- const resolveSymlinksAsync = function(path$1, state, callback$1) {
424
+ const resolveSymlinksAsync = function(path$2, state, callback$1) {
147
425
  const { queue, fs: fs$1, options: { suppressErrors } } = state;
148
426
  queue.enqueue();
149
- fs$1.realpath(path$1, (error, resolvedPath) => {
427
+ fs$1.realpath(path$2, (error, resolvedPath) => {
150
428
  if (error) return queue.dequeue(suppressErrors ? null : error, state);
151
429
  fs$1.stat(resolvedPath, (error$1, stat) => {
152
430
  if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
153
- if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return queue.dequeue(null, state);
431
+ if (stat.isDirectory() && isRecursive(path$2, resolvedPath, state)) return queue.dequeue(null, state);
154
432
  callback$1(stat, resolvedPath);
155
433
  queue.dequeue(null, state);
156
434
  });
157
435
  });
158
436
  };
159
- const resolveSymlinks = function(path$1, state, callback$1) {
437
+ const resolveSymlinks = function(path$2, state, callback$1) {
160
438
  const { queue, fs: fs$1, options: { suppressErrors } } = state;
161
439
  queue.enqueue();
162
440
  try {
163
- const resolvedPath = fs$1.realpathSync(path$1);
441
+ const resolvedPath = fs$1.realpathSync(path$2);
164
442
  const stat = fs$1.statSync(resolvedPath);
165
- if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return;
443
+ if (stat.isDirectory() && isRecursive(path$2, resolvedPath, state)) return;
166
444
  callback$1(stat, resolvedPath);
167
445
  } catch (e) {
168
446
  if (!suppressErrors) throw e;
@@ -172,16 +450,16 @@ function build$2(options, isSynchronous) {
172
450
  if (!options.resolveSymlinks || options.excludeSymlinks) return null;
173
451
  return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
174
452
  }
175
- function isRecursive(path$1, resolved, state) {
453
+ function isRecursive(path$2, resolved, state) {
176
454
  if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
177
- let parent = dirname$1(path$1);
455
+ let parent = dirname$1(path$2);
178
456
  let depth$1 = 1;
179
457
  while (parent !== state.root && depth$1 < 2) {
180
458
  const resolvedPath = state.symlinks.get(parent);
181
459
  if (!!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath))) depth$1++;
182
460
  else parent = dirname$1(parent);
183
461
  }
184
- state.symlinks.set(path$1, resolved);
462
+ state.symlinks.set(path$2, resolved);
185
463
  return depth$1 > 1;
186
464
  }
187
465
  function isRecursiveUsingRealPaths(resolved, state) {
@@ -362,19 +640,19 @@ var Walker = class {
362
640
  const filename = this.joinPath(entry.name, directoryPath);
363
641
  this.pushFile(filename, files, this.state.counts, filters);
364
642
  } else if (entry.isDirectory()) {
365
- let path$1 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
366
- if (exclude && exclude(entry.name, path$1)) continue;
367
- this.pushDirectory(path$1, paths, filters);
368
- this.walkDirectory(this.state, path$1, path$1, depth$1 - 1, this.walk);
643
+ let path$2 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
644
+ if (exclude && exclude(entry.name, path$2)) continue;
645
+ this.pushDirectory(path$2, paths, filters);
646
+ this.walkDirectory(this.state, path$2, path$2, depth$1 - 1, this.walk);
369
647
  } else if (this.resolveSymlink && entry.isSymbolicLink()) {
370
- let path$1 = joinPathWithBasePath(entry.name, directoryPath);
371
- this.resolveSymlink(path$1, this.state, (stat, resolvedPath) => {
648
+ let path$2 = joinPathWithBasePath(entry.name, directoryPath);
649
+ this.resolveSymlink(path$2, this.state, (stat, resolvedPath) => {
372
650
  if (stat.isDirectory()) {
373
651
  resolvedPath = normalizePath(resolvedPath, this.state.options);
374
- if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$1 + pathSeparator)) return;
375
- this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$1 + pathSeparator, depth$1 - 1, this.walk);
652
+ if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$2 + pathSeparator)) return;
653
+ this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$2 + pathSeparator, depth$1 - 1, this.walk);
376
654
  } else {
377
- resolvedPath = useRealPaths ? resolvedPath : path$1;
655
+ resolvedPath = useRealPaths ? resolvedPath : path$2;
378
656
  const filename = basename(resolvedPath);
379
657
  const directoryPath$1 = normalizePath(dirname$1(resolvedPath), this.state.options);
380
658
  resolvedPath = this.joinPath(filename, directoryPath$1);
@@ -539,7 +817,7 @@ var Builder = class {
539
817
  isMatch = globFn(patterns, ...options);
540
818
  this.globCache[patterns.join("\0")] = isMatch;
541
819
  }
542
- this.options.filters.push((path$1) => isMatch(path$1));
820
+ this.options.filters.push((path$2) => isMatch(path$2));
543
821
  return this;
544
822
  }
545
823
  };
@@ -750,8 +1028,8 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
750
1028
  if (state.negated === true) output = `(?:^(?!${output}).*$)`;
751
1029
  return output;
752
1030
  };
753
- exports.basename = (path$1, { windows } = {}) => {
754
- const segs = path$1.split(windows ? /[\\/]/ : "/");
1031
+ exports.basename = (path$2, { windows } = {}) => {
1032
+ const segs = path$2.split(windows ? /[\\/]/ : "/");
755
1033
  const last = segs[segs.length - 1];
756
1034
  if (last === "") return segs[segs.length - 2];
757
1035
  return last;
@@ -2286,15 +2564,15 @@ function buildRelative(cwd, root) {
2286
2564
  };
2287
2565
  }
2288
2566
  const splitPatternOptions = { parts: true };
2289
- function splitPattern(path$1) {
2567
+ function splitPattern(path$1$1) {
2290
2568
  var _result$parts;
2291
- const result = import_picomatch.default.scan(path$1, splitPatternOptions);
2292
- return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1];
2569
+ const result = import_picomatch.default.scan(path$1$1, splitPatternOptions);
2570
+ return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1$1];
2293
2571
  }
2294
2572
  const POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
2295
2573
  const WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
2296
- const escapePosixPath = (path$1) => path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
2297
- const escapeWin32Path = (path$1) => path$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
2574
+ const escapePosixPath = (path$1$1) => path$1$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
2575
+ const escapeWin32Path = (path$1$1) => path$1$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
2298
2576
  /**
2299
2577
  * Escapes a path's special characters depending on the platform.
2300
2578
  * @see {@link https://superchupu.dev/tinyglobby/documentation#escapePath}
@@ -2329,7 +2607,7 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
2329
2607
  if (pattern.endsWith("/")) result = pattern.slice(0, -1);
2330
2608
  if (!result.endsWith("*") && expandDirectories) result += "/**";
2331
2609
  const escapedCwd = escapePath(cwd);
2332
- if (path.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) result = posix.relative(escapedCwd, result);
2610
+ if (path$1.isAbsolute(result.replace(ESCAPING_BACKSLASHES, ""))) result = posix.relative(escapedCwd, result);
2333
2611
  else result = posix.normalize(result);
2334
2612
  const parentDirectoryMatch = PARENT_DIRECTORY.exec(result);
2335
2613
  const parts = splitPattern(result);
@@ -2388,15 +2666,15 @@ function processPatterns({ patterns = ["**/*"], ignore = [], expandDirectories =
2388
2666
  }
2389
2667
  function formatPaths(paths, relative$1) {
2390
2668
  for (let i = paths.length - 1; i >= 0; i--) {
2391
- const path$1 = paths[i];
2392
- paths[i] = relative$1(path$1);
2669
+ const path$1$1 = paths[i];
2670
+ paths[i] = relative$1(path$1$1);
2393
2671
  }
2394
2672
  return paths;
2395
2673
  }
2396
2674
  function normalizeCwd(cwd) {
2397
2675
  if (!cwd) return process.cwd().replace(BACKSLASHES, "/");
2398
2676
  if (cwd instanceof URL) return fileURLToPath$1(cwd).replace(BACKSLASHES, "/");
2399
- return path.resolve(cwd).replace(BACKSLASHES, "/");
2677
+ return path$1.resolve(cwd).replace(BACKSLASHES, "/");
2400
2678
  }
2401
2679
  function getCrawler(patterns, inputOptions = {}) {
2402
2680
  const options = process.env.TINYGLOBBY_DEBUG ? {
@@ -2441,9 +2719,9 @@ function getCrawler(patterns, inputOptions = {}) {
2441
2719
  const formatExclude = options.absolute ? format : buildFormat(cwd, props.root, true);
2442
2720
  const fdirOptions = {
2443
2721
  filters: [options.debug ? (p, isDirectory) => {
2444
- const path$1 = format(p, isDirectory);
2445
- const matches = matcher(path$1);
2446
- if (matches) log(`matched ${path$1}`);
2722
+ const path$1$1 = format(p, isDirectory);
2723
+ const matches = matcher(path$1$1);
2724
+ if (matches) log(`matched ${path$1$1}`);
2447
2725
  return matches;
2448
2726
  } : (p, isDirectory) => matcher(format(p, isDirectory))],
2449
2727
  exclude: options.debug ? (_, p) => {
@@ -2560,5 +2838,5 @@ async function listTemplates(prefix) {
2560
2838
  }
2561
2839
 
2562
2840
  //#endregion
2563
- export { loadTemplates as a, loadTemplate as i, getTemplatesRoot as n, listTemplates as r, getBinaryTemplatesRoot as t };
2564
- //# sourceMappingURL=template-reader-DOXCnctl.mjs.map
2841
+ export { loadTemplates as a, loadTemplate as i, getTemplatesRoot as n, isBinaryPath as o, listTemplates as r, getBinaryTemplatesRoot as t };
2842
+ //# sourceMappingURL=template-reader-BjQIVD2E.mjs.map