@better-t-stack/template-generator 3.27.1 → 3.27.3
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/core/template-reader.d.mts +16 -1
- package/dist/core/template-reader.d.mts.map +1 -1
- package/dist/core/template-reader.mjs +3 -4
- package/dist/fs-writer.d.mts +3 -3
- package/dist/fs-writer.d.mts.map +1 -1
- package/dist/fs-writer.mjs +2 -3
- package/dist/fs-writer.mjs.map +1 -1
- package/dist/index.d.mts +8 -8
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +18 -79
- package/dist/index.mjs.map +1 -1
- package/dist/{is-binary-path-BN88l03c.mjs → is-binary-path-maAgJE_Q.mjs} +6 -14
- package/dist/is-binary-path-maAgJE_Q.mjs.map +1 -0
- package/dist/{template-reader-DOXCnctl.mjs → template-reader-C8MBRmk-.mjs} +532 -351
- package/dist/template-reader-C8MBRmk-.mjs.map +1 -0
- package/dist/{types-zSU486rU.d.mts → types-CzW_c7t0.d.mts} +3 -3
- package/dist/types-CzW_c7t0.d.mts.map +1 -0
- package/package.json +12 -12
- package/dist/is-binary-path-BN88l03c.mjs.map +0 -1
- package/dist/template-reader-DOXCnctl.mjs.map +0 -1
- package/dist/types-zSU486rU.d.mts.map +0 -1
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
//#region ../../node_modules/.bun/is-binary-path@3.0.0/node_modules/is-binary-path/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
Check if a file path is a binary file.
|
|
2
4
|
|
|
5
|
+
@example
|
|
6
|
+
```
|
|
7
|
+
import isBinaryPath from 'is-binary-path';
|
|
8
|
+
|
|
9
|
+
isBinaryPath('source/unicorn.png');
|
|
10
|
+
//=> true
|
|
11
|
+
|
|
12
|
+
isBinaryPath('source/unicorn.txt');
|
|
13
|
+
//=> false
|
|
14
|
+
```
|
|
15
|
+
*/
|
|
16
|
+
declare function isBinaryPath(filePath: string): boolean;
|
|
17
|
+
//#endregion
|
|
3
18
|
//#region src/core/template-reader.d.ts
|
|
4
19
|
declare function getTemplatesRoot(): string;
|
|
5
20
|
declare function getBinaryTemplatesRoot(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-reader.d.mts","names":[],"sources":["../../src/core/template-reader.ts"],"
|
|
1
|
+
{"version":3,"file":"template-reader.d.mts","names":["isBinaryPath","filePath","default"],"sources":["../../../../node_modules/.bun/is-binary-path@3.0.0/node_modules/is-binary-path/index.d.ts","../../src/core/template-reader.ts"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;ACUA;;;;;iBDIwBA,YAAAA,CAAaC,QAAAA;;;iBCJrB,gBAAA,CAAA;AAAA,iBAcA,sBAAA,CAAA;AAAA,iBAcM,aAAA,CAAc,MAAA,YAAkB,OAAA,CAAQ,GAAA;AAAA,iBA2B9C,YAAA,CAAa,YAAA;AAAA,iBAOP,aAAA,CAAc,MAAA,YAAkB,OAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { a as loadTemplates, i as loadTemplate, n as getTemplatesRoot, r as listTemplates, t as getBinaryTemplatesRoot } from "../template-reader-
|
|
2
|
-
import { t as isBinaryPath } from "../is-binary-path-
|
|
3
|
-
|
|
4
|
-
export { getTemplatesRoot as TEMPLATES_ROOT, getTemplatesRoot, getBinaryTemplatesRoot, isBinaryPath, listTemplates, loadTemplate, loadTemplates };
|
|
1
|
+
import { a as loadTemplates, i as loadTemplate, n as getTemplatesRoot, r as listTemplates, t as getBinaryTemplatesRoot } from "../template-reader-C8MBRmk-.mjs";
|
|
2
|
+
import { t as isBinaryPath } from "../is-binary-path-maAgJE_Q.mjs";
|
|
3
|
+
export { getTemplatesRoot as TEMPLATES_ROOT, getTemplatesRoot, getBinaryTemplatesRoot, isBinaryPath, listTemplates, loadTemplate, loadTemplates };
|
package/dist/fs-writer.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as VirtualFileTree } from "./types-
|
|
2
|
-
import * as better_result0 from "better-result";
|
|
1
|
+
import { a as VirtualFileTree } from "./types-CzW_c7t0.mjs";
|
|
2
|
+
import * as _$better_result0 from "better-result";
|
|
3
3
|
import { Result } from "better-result";
|
|
4
4
|
|
|
5
5
|
//#region src/fs-writer.d.ts
|
|
6
|
-
declare const FileWriteError_base: better_result0.TaggedErrorClass<"FileWriteError", {
|
|
6
|
+
declare const FileWriteError_base: _$better_result0.TaggedErrorClass<"FileWriteError", {
|
|
7
7
|
message: string;
|
|
8
8
|
path?: string;
|
|
9
9
|
cause?: unknown;
|
package/dist/fs-writer.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs-writer.d.mts","names":[],"sources":["../src/fs-writer.ts"],"
|
|
1
|
+
{"version":3,"file":"fs-writer.d.mts","names":[],"sources":["../src/fs-writer.ts"],"mappings":";;;;;cAM2F,mBAAA;;;;;;;;cAO9E,cAAA,SAAuB,mBAAA;;;;AAApC;iBAUsB,SAAA,CACpB,IAAA,EAAM,eAAA,EACN,OAAA,WACC,OAAA,CAAQ,MAAA,OAAa,cAAA;;;;AAHxB;iBAiDsB,aAAA,CACpB,IAAA,EAAM,eAAA,EACN,OAAA,UACA,MAAA,GAAS,QAAA,uBACR,OAAA,CAAQ,MAAA,WAAiB,cAAA"}
|
package/dist/fs-writer.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { t as getBinaryTemplatesRoot } from "./template-reader-
|
|
1
|
+
import { t as getBinaryTemplatesRoot } from "./template-reader-C8MBRmk-.mjs";
|
|
2
2
|
import { Result, TaggedError } from "better-result";
|
|
3
3
|
import { dirname, join } from "pathe";
|
|
4
4
|
import * as fs from "node:fs/promises";
|
|
5
|
-
|
|
6
5
|
//#region src/fs-writer.ts
|
|
7
6
|
const BINARY_FILE_MARKER = "[Binary file]";
|
|
8
7
|
/**
|
|
@@ -76,7 +75,7 @@ async function copyBinaryFile(templatePath, destPath) {
|
|
|
76
75
|
const sourcePath = join(getBinaryTemplatesRoot(), templatePath);
|
|
77
76
|
await fs.copyFile(sourcePath, destPath);
|
|
78
77
|
}
|
|
79
|
-
|
|
80
78
|
//#endregion
|
|
81
79
|
export { FileWriteError, writeSelected, writeTree };
|
|
80
|
+
|
|
82
81
|
//# sourceMappingURL=fs-writer.mjs.map
|
package/dist/fs-writer.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs-writer.mjs","names":[
|
|
1
|
+
{"version":3,"file":"fs-writer.mjs","names":[],"sources":["../src/fs-writer.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\n\nimport { Result, TaggedError } from \"better-result\";\nimport { join, dirname } from \"pathe\";\n\nimport { getBinaryTemplatesRoot } from \"./core/template-reader\";\nimport type { VirtualFileTree, VirtualNode, VirtualFile, VirtualDirectory } from \"./types\";\n\nconst BINARY_FILE_MARKER = \"[Binary file]\";\n\n/**\n * Error class for filesystem write failures\n */\nexport class FileWriteError extends TaggedError(\"FileWriteError\")<{\n message: string;\n path?: string;\n cause?: unknown;\n}>() {}\n\n/**\n * Writes a virtual file tree to the filesystem.\n * Returns a Result type for type-safe error handling.\n */\nexport async function writeTree(\n tree: VirtualFileTree,\n destDir: string,\n): Promise<Result<void, FileWriteError>> {\n return Result.tryPromise({\n try: async () => {\n for (const child of tree.root.children) {\n await writeNodeInternal(child, destDir, \"\");\n }\n },\n catch: (e) => {\n if (FileWriteError.is(e)) return e;\n return new FileWriteError({\n message: e instanceof Error ? e.message : String(e),\n cause: e,\n });\n },\n });\n}\n\nasync function writeNodeInternal(\n node: VirtualNode,\n baseDir: string,\n relativePath: string,\n): Promise<void> {\n const fullPath = join(baseDir, relativePath, node.name);\n const nodePath = relativePath ? join(relativePath, node.name) : node.name;\n\n if (node.type === \"file\") {\n const fileNode = node as VirtualFile;\n await fs.mkdir(dirname(fullPath), { recursive: true });\n\n if (fileNode.content === BINARY_FILE_MARKER && fileNode.sourcePath) {\n await copyBinaryFile(fileNode.sourcePath, fullPath);\n } else if (fileNode.content !== BINARY_FILE_MARKER) {\n await fs.writeFile(fullPath, fileNode.content, \"utf-8\");\n }\n } else {\n await fs.mkdir(fullPath, { recursive: true });\n for (const child of (node as VirtualDirectory).children) {\n await writeNodeInternal(child, baseDir, nodePath);\n }\n }\n}\n\n/**\n * Writes selected files from a virtual file tree to the filesystem.\n * Returns a Result with the list of written file paths.\n */\nexport async function writeSelected(\n tree: VirtualFileTree,\n destDir: string,\n filter: (filePath: string) => boolean,\n): Promise<Result<string[], FileWriteError>> {\n return Result.tryPromise({\n try: async () => {\n const writtenFiles: string[] = [];\n await writeSelectedNodeInternal(tree.root, destDir, \"\", filter, writtenFiles);\n return writtenFiles;\n },\n catch: (e) => {\n if (FileWriteError.is(e)) return e;\n return new FileWriteError({\n message: e instanceof Error ? e.message : String(e),\n cause: e,\n });\n },\n });\n}\n\nasync function writeSelectedNodeInternal(\n node: VirtualNode,\n baseDir: string,\n relativePath: string,\n filter: (filePath: string) => boolean,\n writtenFiles: string[],\n): Promise<void> {\n const nodePath = relativePath ? `${relativePath}/${node.name}` : node.name;\n\n if (node.type === \"file\") {\n if (filter(nodePath)) {\n const fileNode = node as VirtualFile;\n await fs.mkdir(dirname(join(baseDir, nodePath)), { recursive: true });\n\n if (fileNode.content === BINARY_FILE_MARKER && fileNode.sourcePath) {\n await copyBinaryFile(fileNode.sourcePath, join(baseDir, nodePath));\n } else if (fileNode.content !== BINARY_FILE_MARKER) {\n await fs.writeFile(join(baseDir, nodePath), fileNode.content, \"utf-8\");\n }\n writtenFiles.push(nodePath);\n }\n } else {\n for (const child of (node as VirtualDirectory).children) {\n await writeSelectedNodeInternal(child, baseDir, nodePath, filter, writtenFiles);\n }\n }\n}\n\nasync function copyBinaryFile(templatePath: string, destPath: string): Promise<void> {\n const templatesRoot = getBinaryTemplatesRoot();\n const sourcePath = join(templatesRoot, templatePath);\n // Let errors propagate - they'll be caught by the Result wrapper\n await fs.copyFile(sourcePath, dest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IACxB,SAAS,aAAa,QAAQ,EAAE,UAAU,OAAO,EAAE;IACnD,OAAO;IACR,CAAC;;EAEL,CAAC;;AAGJ,eAAe,0BACb,MACA,SACA,cACA,QACA,cACe;CACf,MAAM,WAAW,eAAe,GAAG,aAAa,GAAG,KAAK,SAAS,KAAK;AAEtE,KAAI,KAAK,SAAS;MACZ,OAAO,SAAS,EAAE;GACpB,MAAM,WAAW;AACjB,SAAM,GAAG,MAAM,QAAQ,KAAK,SAAS,SAAS,CAAC,EAAE,EAAE,WAAW,MAAM,CAAC;AAErE,OAAI,SAAS,YAAY,sBAAsB,SAAS,WACtD,OAAM,eAAe,SAAS,YAAY,KAAK,SAAS,SAAS,CAAC;YACzD,SAAS,YAAY,mBAC9B,OAAM,GAAG,UAAU,KAAK,SAAS,SAAS,EAAE,SAAS,SAAS,QAAQ;AAExE,gBAAa,KAAK,SAAS;;OAG7B,MAAK,MAAM,SAAU,KAA0B,SAC7C,OAAM,0BAA0B,OAAO,SAAS,UAAU,QAAQ,aAAa;;AAKrF,eAAe,eAAe,cAAsB,UAAiC;CAEnF,MAAM,aAAa,KADG,wBAAwB,EACP,aAAa;AAEpD,OAAM,GAAG,SAAS,YAAY,SAAS"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as VirtualFileTree, i as VirtualFile, n as GeneratorOptions, o as VirtualNode, r as VirtualDirectory, t as GeneratorError } from "./types-
|
|
1
|
+
import { a as VirtualFileTree, i as VirtualFile, n as GeneratorOptions, o as VirtualNode, r as VirtualDirectory, t as GeneratorError } from "./types-CzW_c7t0.mjs";
|
|
2
2
|
import { Result } from "better-result";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _$memfs from "memfs";
|
|
4
4
|
import Handlebars from "handlebars";
|
|
5
5
|
import { ProjectConfig } from "@better-t-stack/types";
|
|
6
6
|
|
|
@@ -26,8 +26,8 @@ declare class VirtualFileSystem {
|
|
|
26
26
|
getDirectoryCount(): number;
|
|
27
27
|
toTree(rootName?: string): VirtualDirectory;
|
|
28
28
|
clear(): void;
|
|
29
|
-
getVolume():
|
|
30
|
-
getFs():
|
|
29
|
+
getVolume(): _$memfs.Volume;
|
|
30
|
+
getFs(): _$memfs.IFs;
|
|
31
31
|
private walkDir;
|
|
32
32
|
private buildTree;
|
|
33
33
|
private sortChildren;
|
|
@@ -78,7 +78,7 @@ declare const TEMPLATE_COUNT = 462;
|
|
|
78
78
|
//#endregion
|
|
79
79
|
//#region src/utils/add-deps.d.ts
|
|
80
80
|
declare const dependencyVersionMap: {
|
|
81
|
-
readonly typescript: "^
|
|
81
|
+
readonly typescript: "^6";
|
|
82
82
|
readonly "better-auth": "1.5.5";
|
|
83
83
|
readonly "@better-auth/expo": "1.5.5";
|
|
84
84
|
readonly "@clerk/backend": "^3.2.1";
|
|
@@ -114,8 +114,8 @@ declare const dependencyVersionMap: {
|
|
|
114
114
|
readonly "@vite-pwa/assets-generator": "^1.0.2";
|
|
115
115
|
readonly "@tauri-apps/cli": "^2.4.0";
|
|
116
116
|
readonly "@biomejs/biome": "^2.2.0";
|
|
117
|
-
readonly oxlint: "^1.
|
|
118
|
-
readonly oxfmt: "^0.
|
|
117
|
+
readonly oxlint: "^1.61.0";
|
|
118
|
+
readonly oxfmt: "^0.46.0";
|
|
119
119
|
readonly husky: "^9.1.7";
|
|
120
120
|
readonly lefthook: "^2.0.13";
|
|
121
121
|
readonly "lint-staged": "^16.1.2";
|
|
@@ -184,7 +184,7 @@ declare const dependencyVersionMap: {
|
|
|
184
184
|
readonly "@astrojs/node": "^10.0.0-beta.9";
|
|
185
185
|
readonly alchemy: "^0.91.2";
|
|
186
186
|
readonly dotenv: "^17.2.2";
|
|
187
|
-
readonly tsdown: "^0.
|
|
187
|
+
readonly tsdown: "^0.21.9";
|
|
188
188
|
readonly zod: "^4.1.13";
|
|
189
189
|
readonly "@t3-oss/env-core": "^0.13.1";
|
|
190
190
|
readonly "@t3-oss/env-nextjs": "^0.13.1";
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/core/virtual-fs.ts","../src/core/template-processor.ts","../src/template-handlers/utils.ts","../src/template-handlers/addons.ts","../src/generator.ts","../src/processors/addons-deps.ts","../src/bts-config.ts","../src/templates.generated.ts","../src/utils/add-deps.ts","../src/utils/reproducible-command.ts"],"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/core/virtual-fs.ts","../src/core/template-processor.ts","../src/template-handlers/utils.ts","../src/template-handlers/addons.ts","../src/generator.ts","../src/processors/addons-deps.ts","../src/bts-config.ts","../src/templates.generated.ts","../src/utils/add-deps.ts","../src/utils/reproducible-command.ts"],"mappings":";;;;;;;cAOa,iBAAA;EAAA,QACH,GAAA;EAAA,QACA,IAAA;EAAA,QACA,cAAA;;EAQR,SAAA,CAAU,QAAA,UAAkB,OAAA,UAAiB,UAAA;EAY7C,QAAA,CAAS,QAAA;EAQT,MAAA,CAAO,IAAA;EASP,UAAA,CAAW,QAAA;EAQX,eAAA,CAAgB,OAAA;EAQhB,KAAA,CAAM,OAAA;EAIN,UAAA,CAAW,QAAA;EASX,OAAA,CAAQ,OAAA;EAQR,QAAA,aAAA,CAAsB,QAAA,WAAmB,CAAA;EAUzC,SAAA,CAAU,QAAA,UAAkB,IAAA,WAAe,MAAA;EAI3C,WAAA,CAAA;EAMA,iBAAA,CAAA;EAMA,YAAA,CAAA;EAIA,iBAAA,CAAA;EAIA,MAAA,CAAO,QAAA,YAAuB,gBAAA;EAO9B,KAAA,CAAA;EAOA,SAAA,CAAA,GAd8C,OAAA,CAcrC,MAAA;EAGT,KAAA,CAAA,GAHS,OAAA,CAGJ,GAAA;EAAA,QAIG,OAAA;EAAA,QAeA,SAAA;EAAA,QAiCA,YAAA;EAAA,QAWA,aAAA;AAAA;;;iBC5LM,qBAAA,CAAsB,OAAA,UAAiB,OAAA,EAAS,aAAA;AAAA,iBAIhD,YAAA,CA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