@better-t-stack/template-generator 3.13.2-dev.e23feef → 3.14.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.
- package/dist/core/template-reader.d.mts +10 -0
- package/dist/core/template-reader.d.mts.map +1 -0
- package/dist/{template-reader.mjs → core/template-reader.mjs} +3 -30
- package/dist/core/template-reader.mjs.map +1 -0
- package/dist/fs-writer.d.mts.map +1 -1
- package/dist/fs-writer.mjs +11 -24
- package/dist/fs-writer.mjs.map +1 -1
- package/dist/index.d.mts +15 -37
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +20782 -20090
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/dist/template-reader.d.mts +0 -30
- package/dist/template-reader.d.mts.map +0 -1
- package/dist/template-reader.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as VirtualFileTree, i as VirtualFile, n as GeneratorResult, o as VirtualNode, r as VirtualDirectory, t as GeneratorOptions } from "./types-BubFnV2d.mjs";
|
|
2
|
-
import
|
|
2
|
+
import * as memfs0 from "memfs";
|
|
3
3
|
import Handlebars from "handlebars";
|
|
4
4
|
import { ProjectConfig } from "@better-t-stack/types";
|
|
5
5
|
|
|
@@ -10,63 +10,41 @@ declare class VirtualFileSystem {
|
|
|
10
10
|
constructor();
|
|
11
11
|
writeFile(filePath: string, content: string): void;
|
|
12
12
|
readFile(filePath: string): string | undefined;
|
|
13
|
+
exists(path: string): boolean;
|
|
13
14
|
fileExists(filePath: string): boolean;
|
|
14
15
|
directoryExists(dirPath: string): boolean;
|
|
15
16
|
mkdir(dirPath: string): void;
|
|
17
|
+
deleteFile(filePath: string): boolean;
|
|
18
|
+
listDir(dirPath: string): string[];
|
|
19
|
+
readJson<T = unknown>(filePath: string): T | undefined;
|
|
20
|
+
writeJson(filePath: string, data: unknown, spaces?: number): void;
|
|
16
21
|
getAllFiles(): string[];
|
|
17
22
|
getAllDirectories(): string[];
|
|
18
|
-
private walkDir;
|
|
19
23
|
getFileCount(): number;
|
|
20
24
|
getDirectoryCount(): number;
|
|
21
|
-
exists(path: string): boolean;
|
|
22
|
-
readJson<T = unknown>(filePath: string): T | undefined;
|
|
23
|
-
writeJson(filePath: string, data: unknown, spaces?: number): void;
|
|
24
|
-
deleteFile(filePath: string): boolean;
|
|
25
|
-
listDir(dirPath: string): string[];
|
|
26
25
|
toTree(rootName?: string): VirtualDirectory;
|
|
26
|
+
clear(): void;
|
|
27
|
+
getVolume(): memfs0.Volume;
|
|
28
|
+
getFs(): memfs0.IFs;
|
|
29
|
+
private walkDir;
|
|
27
30
|
private buildTree;
|
|
28
31
|
private sortChildren;
|
|
29
32
|
private normalizePath;
|
|
30
|
-
private getExtension;
|
|
31
|
-
clear(): void;
|
|
32
|
-
getVolume(): ReturnType<typeof memfs>["vol"];
|
|
33
|
-
getFs(): ReturnType<typeof memfs>["fs"];
|
|
34
33
|
}
|
|
35
34
|
//#endregion
|
|
36
35
|
//#region src/core/template-processor.d.ts
|
|
37
|
-
|
|
38
|
-
* Process a Handlebars template string with the given context
|
|
39
|
-
*/
|
|
40
|
-
declare function processTemplateString(templateContent: string, context: ProjectConfig): string;
|
|
41
|
-
/**
|
|
42
|
-
* Determine if a file should be treated as binary (not processed by Handlebars)
|
|
43
|
-
*/
|
|
36
|
+
declare function processTemplateString(content: string, context: ProjectConfig): string;
|
|
44
37
|
declare function isBinaryFile(filePath: string): boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Transform template filename to output filename
|
|
47
|
-
* - Remove .hbs extension
|
|
48
|
-
* - Convert _gitignore to .gitignore
|
|
49
|
-
* - Convert _npmrc to .npmrc
|
|
50
|
-
*/
|
|
51
38
|
declare function transformFilename(filename: string): string;
|
|
52
|
-
/**
|
|
53
|
-
* Process template content based on file type
|
|
54
|
-
* - Binary files: return empty string (placeholder)
|
|
55
|
-
* - .hbs files: compile with Handlebars
|
|
56
|
-
* - Other files: return as-is
|
|
57
|
-
*/
|
|
58
39
|
declare function processFileContent(filePath: string, content: string, context: ProjectConfig): string;
|
|
59
40
|
//#endregion
|
|
60
|
-
//#region src/
|
|
41
|
+
//#region src/template-handlers/utils.d.ts
|
|
61
42
|
type TemplateData = Map<string, string>;
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/generator.d.ts
|
|
62
45
|
declare function generateVirtualProject(options: GeneratorOptions): Promise<GeneratorResult>;
|
|
63
46
|
//#endregion
|
|
64
47
|
//#region src/templates.generated.d.ts
|
|
65
|
-
/**
|
|
66
|
-
* Auto-generated embedded templates
|
|
67
|
-
* DO NOT EDIT - This file is generated by scripts/generate-templates.ts
|
|
68
|
-
* Run 'bun run generate-templates' to regenerate
|
|
69
|
-
*/
|
|
70
48
|
declare const EMBEDDED_TEMPLATES: Map<string, string>;
|
|
71
49
|
declare const TEMPLATE_COUNT = 409;
|
|
72
50
|
//#endregion
|
|
@@ -178,5 +156,5 @@ declare const dependencyVersionMap: {
|
|
|
178
156
|
};
|
|
179
157
|
type AvailableDependencies = keyof typeof dependencyVersionMap;
|
|
180
158
|
//#endregion
|
|
181
|
-
export { type AvailableDependencies, EMBEDDED_TEMPLATES, GeneratorOptions, GeneratorResult, Handlebars, TEMPLATE_COUNT, TemplateData, VirtualDirectory, VirtualFile, VirtualFileSystem, VirtualFileTree, VirtualNode, dependencyVersionMap, generateVirtualProject, isBinaryFile, processFileContent, processTemplateString, transformFilename };
|
|
159
|
+
export { type AvailableDependencies, EMBEDDED_TEMPLATES, GeneratorOptions, GeneratorResult, Handlebars, TEMPLATE_COUNT, type TemplateData, VirtualDirectory, VirtualFile, VirtualFileSystem, VirtualFileTree, VirtualNode, dependencyVersionMap, generateVirtualProject, isBinaryFile, processFileContent, processTemplateString, transformFilename };
|
|
182
160
|
//# sourceMappingURL=index.d.mts.map
|
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/generator.ts","../src/templates.generated.ts","../src/utils/add-deps.ts"],"sourcesContent":[],"mappings":";;;;;;cAOa,iBAAA
|
|
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/generator.ts","../src/templates.generated.ts","../src/utils/add-deps.ts"],"sourcesContent":[],"mappings":";;;;;;cAOa,iBAAA;;;;;EAAA,QAAA,CAAA,QAAA,EAAA,MAAiB,CAAA,EAAA,MAAA,GAAA,SAAA;EAyEa,MAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAAA,OAAA;EAkCX,UAAA,CAAA,QAAA,EAAA,MAAA,CAAA,EAAA,OAAA;EAAgB,eAarC,CAAA,OAAA,EAAA,MAAA,CAAA,EAAA,OAAA;EAAA,KAGJ,CAAA,OAAA,EAAA,MAAA,CAAA,EAAA,IAAA;EAAA,UAAA,CAAA,QAAA,EAAA,MAAA,CAAA,EAAA,OAAA;;2CAlDoC;;ECpE3B,WAAA,CAAA,CAAA,EAAA,MAAA,EAAA;EAIA,iBAAY,CAAA,CAAA,EAAA,MAAA,EAAA;EAKZ,YAAA,CAAA,CAAA,EAAA,MAAiB;EAUjB,iBAAA,CAAA,CAAA,EAAkB,MAAA;6BDmFF;;eAAgB,MAAA,CAarC;EEzHC,KAAA,CAAA,CAAA,EFyHD,MAAA,CAGJ,GE5HoB;;;;ECyBL,QAAA,aAAA;;;;iBFnBN,qBAAA,2BAAgD;iBAIhD,YAAA;iBAKA,iBAAA;iBAUA,kBAAA,6CAGL;;;KC5BC,YAAA,GAAe;;;iBCyBL,sBAAA,UAAgC,mBAAmB,QAAQ;;;cC5BpE,oBAAoB;cAk9vBpB,cAAA;;;cCx8vBA;;ELNA,SAAA,aAAiB,EAAA,QAAA;EAyEa,SAAA,mBAAA,EAAA,QAAA;EAkCX,SAAA,eAAA,EAAA,SAAA;EAAgB,SAarC,oBAAA,EAAA,S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