@palantir/pack.sdkgen 0.4.0 → 0.6.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/build/esm/__tests__/generator.test.js +1 -5
- package/build/esm/__tests__/generator.test.js.map +1 -1
- package/build/esm/__tests__/templateLoader.test.js +5 -4
- package/build/esm/__tests__/templateLoader.test.js.map +1 -1
- package/build/esm/commands/create.js +28 -151
- package/build/esm/commands/create.js.map +1 -1
- package/build/esm/index.js +1 -7
- package/build/esm/index.js.map +1 -1
- package/build/types/commands/create.d.ts +1 -1
- package/build/types/commands/create.d.ts.map +1 -1
- package/build/types/index.d.ts +2 -8
- package/build/types/index.d.ts.map +1 -1
- package/package.json +3 -8
- package/build/esm/__tests__/schemaParser.test.js +0 -67
- package/build/esm/__tests__/schemaParser.test.js.map +0 -1
- package/build/esm/__tests__/templateUtils.test.js +0 -94
- package/build/esm/__tests__/templateUtils.test.js.map +0 -1
- package/build/esm/core/contextBuilder.js +0 -33
- package/build/esm/core/contextBuilder.js.map +0 -1
- package/build/esm/core/generator.js +0 -248
- package/build/esm/core/generator.js.map +0 -1
- package/build/esm/core/hookRunner.js +0 -68
- package/build/esm/core/hookRunner.js.map +0 -1
- package/build/esm/core/schemaParser.js +0 -50
- package/build/esm/core/schemaParser.js.map +0 -1
- package/build/esm/core/templateLoader.js +0 -109
- package/build/esm/core/templateLoader.js.map +0 -1
- package/build/esm/types/index.js +0 -2
- package/build/esm/types/index.js.map +0 -1
- package/build/esm/utils/fileSystem.js +0 -72
- package/build/esm/utils/fileSystem.js.map +0 -1
- package/build/esm/utils/logger.js +0 -44
- package/build/esm/utils/logger.js.map +0 -1
- package/build/esm/utils/prompts.js +0 -25
- package/build/esm/utils/prompts.js.map +0 -1
- package/build/esm/utils/templateUtils.js +0 -61
- package/build/esm/utils/templateUtils.js.map +0 -1
- package/build/types/__tests__/schemaParser.test.d.ts +0 -2
- package/build/types/__tests__/schemaParser.test.d.ts.map +0 -1
- package/build/types/__tests__/templateUtils.test.d.ts +0 -2
- package/build/types/__tests__/templateUtils.test.d.ts.map +0 -1
- package/build/types/core/contextBuilder.d.ts +0 -5
- package/build/types/core/contextBuilder.d.ts.map +0 -1
- package/build/types/core/generator.d.ts +0 -15
- package/build/types/core/generator.d.ts.map +0 -1
- package/build/types/core/hookRunner.d.ts +0 -3
- package/build/types/core/hookRunner.d.ts.map +0 -1
- package/build/types/core/schemaParser.d.ts +0 -7
- package/build/types/core/schemaParser.d.ts.map +0 -1
- package/build/types/core/templateLoader.d.ts +0 -13
- package/build/types/core/templateLoader.d.ts.map +0 -1
- package/build/types/types/index.d.ts +0 -68
- package/build/types/types/index.d.ts.map +0 -1
- package/build/types/utils/fileSystem.d.ts +0 -8
- package/build/types/utils/fileSystem.d.ts.map +0 -1
- package/build/types/utils/logger.d.ts +0 -11
- package/build/types/utils/logger.d.ts.map +0 -1
- package/build/types/utils/prompts.d.ts +0 -3
- package/build/types/utils/prompts.d.ts.map +0 -1
- package/build/types/utils/templateUtils.d.ts +0 -3
- package/build/types/utils/templateUtils.d.ts.map +0 -1
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import { findUp } from "find-up";
|
|
18
|
-
import fs from "fs-extra";
|
|
19
|
-
import path from "path";
|
|
20
|
-
import { fileURLToPath, pathToFileURL } from "url";
|
|
21
|
-
export class TemplateLoader {
|
|
22
|
-
constructor(logger) {
|
|
23
|
-
this.logger = logger;
|
|
24
|
-
}
|
|
25
|
-
async loadTemplate(templatePath) {
|
|
26
|
-
let resolvedPath;
|
|
27
|
-
|
|
28
|
-
// Check if it's a local path
|
|
29
|
-
if (templatePath.startsWith(".") || templatePath.startsWith("/")) {
|
|
30
|
-
resolvedPath = path.resolve(templatePath);
|
|
31
|
-
this.logger.debug(`Loading local template from: ${resolvedPath}`);
|
|
32
|
-
} else if (templatePath === "default") {
|
|
33
|
-
// Use built-in default template
|
|
34
|
-
// Find package root by looking for package.json
|
|
35
|
-
const currentFile = import.meta.url.replace("file://", "");
|
|
36
|
-
const packageRoot = await this.findPackageRoot(path.dirname(currentFile));
|
|
37
|
-
resolvedPath = path.join(packageRoot, "templates/default");
|
|
38
|
-
this.logger.debug(`Loading built-in default template`);
|
|
39
|
-
} else {
|
|
40
|
-
// Try to resolve as an npm package
|
|
41
|
-
try {
|
|
42
|
-
const packagePath = await this.resolveNodeModule(templatePath);
|
|
43
|
-
resolvedPath = packagePath;
|
|
44
|
-
this.logger.debug(`Loading npm template: ${templatePath}`);
|
|
45
|
-
} catch {
|
|
46
|
-
throw new Error(`Template not found: ${templatePath}`);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Check if template directory exists
|
|
51
|
-
if (!(await fs.pathExists(resolvedPath))) {
|
|
52
|
-
throw new Error(`Template directory does not exist: ${resolvedPath}`);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Load template configuration
|
|
56
|
-
const configPath = path.join(resolvedPath, "template.config.js");
|
|
57
|
-
if (!(await fs.pathExists(configPath))) {
|
|
58
|
-
throw new Error(`Template configuration not found: ${configPath}`);
|
|
59
|
-
}
|
|
60
|
-
const configUrl = pathToFileURL(configPath).href;
|
|
61
|
-
const {
|
|
62
|
-
default: config
|
|
63
|
-
} = await import(configUrl);
|
|
64
|
-
return {
|
|
65
|
-
config,
|
|
66
|
-
templateDir: resolvedPath
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
async findPackageRoot(startDir) {
|
|
70
|
-
const packageJsonPath = await findUp("package.json", {
|
|
71
|
-
cwd: startDir
|
|
72
|
-
});
|
|
73
|
-
if (!packageJsonPath) {
|
|
74
|
-
throw new Error("Could not find package.json");
|
|
75
|
-
}
|
|
76
|
-
return path.dirname(packageJsonPath);
|
|
77
|
-
}
|
|
78
|
-
async resolveNodeModule(moduleName) {
|
|
79
|
-
try {
|
|
80
|
-
const modulePath = import.meta.resolve(moduleName);
|
|
81
|
-
const packageJsonPath = await findUp(async directory => {
|
|
82
|
-
const pkgPath = path.join(directory, "package.json");
|
|
83
|
-
try {
|
|
84
|
-
const pkg = await fs.readJson(pkgPath);
|
|
85
|
-
if (pkg.name === moduleName) {
|
|
86
|
-
return pkgPath;
|
|
87
|
-
}
|
|
88
|
-
} catch {
|
|
89
|
-
return undefined;
|
|
90
|
-
}
|
|
91
|
-
return undefined;
|
|
92
|
-
}, {
|
|
93
|
-
cwd: fileURLToPath(modulePath)
|
|
94
|
-
});
|
|
95
|
-
if (packageJsonPath) {
|
|
96
|
-
return path.dirname(packageJsonPath);
|
|
97
|
-
}
|
|
98
|
-
throw new Error(`Package root not found for: ${moduleName}`);
|
|
99
|
-
} catch (error) {
|
|
100
|
-
this.logger.debug(`Failed to resolve via require.resolve: ${error instanceof Error ? error.message : String(error)}`);
|
|
101
|
-
const modulePath = path.join(process.cwd(), "node_modules", moduleName);
|
|
102
|
-
if (await fs.pathExists(modulePath)) {
|
|
103
|
-
return modulePath;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
throw new Error(`Cannot resolve module: ${moduleName}`);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
//# sourceMappingURL=templateLoader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templateLoader.js","names":["findUp","fs","path","fileURLToPath","pathToFileURL","TemplateLoader","constructor","logger","loadTemplate","templatePath","resolvedPath","startsWith","resolve","debug","currentFile","import","meta","url","replace","packageRoot","findPackageRoot","dirname","join","packagePath","resolveNodeModule","Error","pathExists","configPath","configUrl","href","default","config","templateDir","startDir","packageJsonPath","cwd","moduleName","modulePath","directory","pkgPath","pkg","readJson","name","undefined","error","message","String","process"],"sources":["templateLoader.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { findUp } from \"find-up\";\nimport fs from \"fs-extra\";\nimport path from \"path\";\nimport { fileURLToPath, pathToFileURL } from \"url\";\nimport type { TemplateConfig } from \"../types/index.js\";\nimport type { Logger } from \"../utils/logger.js\";\n\nexport class TemplateLoader {\n constructor(private readonly logger: Logger) {}\n\n async loadTemplate(templatePath: string): Promise<{\n config: TemplateConfig;\n templateDir: string;\n }> {\n let resolvedPath: string;\n\n // Check if it's a local path\n if (templatePath.startsWith(\".\") || templatePath.startsWith(\"/\")) {\n resolvedPath = path.resolve(templatePath);\n this.logger.debug(`Loading local template from: ${resolvedPath}`);\n } else if (templatePath === \"default\") {\n // Use built-in default template\n // Find package root by looking for package.json\n const currentFile = import.meta.url.replace(\"file://\", \"\");\n const packageRoot = await this.findPackageRoot(path.dirname(currentFile));\n resolvedPath = path.join(packageRoot, \"templates/default\");\n this.logger.debug(`Loading built-in default template`);\n } else {\n // Try to resolve as an npm package\n try {\n const packagePath = await this.resolveNodeModule(templatePath);\n resolvedPath = packagePath;\n this.logger.debug(`Loading npm template: ${templatePath}`);\n } catch {\n throw new Error(`Template not found: ${templatePath}`);\n }\n }\n\n // Check if template directory exists\n if (!await fs.pathExists(resolvedPath)) {\n throw new Error(`Template directory does not exist: ${resolvedPath}`);\n }\n\n // Load template configuration\n const configPath = path.join(resolvedPath, \"template.config.js\");\n if (!await fs.pathExists(configPath)) {\n throw new Error(`Template configuration not found: ${configPath}`);\n }\n\n const configUrl = pathToFileURL(configPath).href;\n const { default: config } = await import(configUrl) as { default: TemplateConfig };\n\n return {\n config,\n templateDir: resolvedPath,\n };\n }\n\n private async findPackageRoot(startDir: string): Promise<string> {\n const packageJsonPath = await findUp(\n \"package.json\",\n { cwd: startDir },\n );\n\n if (!packageJsonPath) {\n throw new Error(\"Could not find package.json\");\n }\n\n return path.dirname(packageJsonPath);\n }\n\n private async resolveNodeModule(moduleName: string): Promise<string> {\n try {\n const modulePath = import.meta.resolve(moduleName);\n\n const packageJsonPath = await findUp(\n async directory => {\n const pkgPath = path.join(directory, \"package.json\");\n try {\n const pkg = await fs.readJson(pkgPath) as { name?: string };\n if (pkg.name === moduleName) {\n return pkgPath;\n }\n } catch {\n return undefined;\n }\n return undefined;\n },\n { cwd: fileURLToPath(modulePath) },\n );\n\n if (packageJsonPath) {\n return path.dirname(packageJsonPath);\n }\n\n throw new Error(`Package root not found for: ${moduleName}`);\n } catch (error) {\n this.logger.debug(\n `Failed to resolve via require.resolve: ${\n error instanceof Error ? error.message : String(error)\n }`,\n );\n\n const modulePath = path.join(process.cwd(), \"node_modules\", moduleName);\n if (await fs.pathExists(modulePath)) {\n return modulePath;\n }\n }\n\n throw new Error(`Cannot resolve module: ${moduleName}`);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,SAAS;AAChC,OAAOC,EAAE,MAAM,UAAU;AACzB,OAAOC,IAAI,MAAM,MAAM;AACvB,SA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A,SAAS;MAClB,CAAC,EACD;QAAER,GAAG,EAAEhC,aAAa,CAACkC,UAAU;MAAE,CACnC,CAAC;MAED,IAAIH,eAAe,EAAE;QACnB,OAAOhC,IAAI,CAACmB,OAAO,CAACa,eAAe,CAAC;MACtC;MAEA,MAAM,IAAIT,KAAK,CAAC,+BAA+BW,UAAU,EAAE,CAAC;IAC9D,CAAC,CAAC,OAAOQ,KAAK,EAAE;MACd,IAAI,CAACrC,MAAM,CAACM,KAAK,CACf,0CACE+B,KAAK,YAAYnB,KAAK,GAAGmB,KAAK,CAACC,OAAO,GAAGC,MAAM,CAACF,KAAK,CAAC,EAE1D,CAAC;MAED,MAAMP,UAAU,GAAGnC,IAAI,CAACoB,IAAI,CAACyB,OAAO,CAACZ,GAAG,CAAC,CAAC,EAAE,cAAc,EAAEC,UAAU,CAAC;MACvE,IAAI,MAAMnC,EAAE,CAACyB,UAAU,CAACW,UAAU,CAAC,EAAE;QACnC,OAAOA,UAAU;MACnB;IACF;IAEA,MAAM,IAAIZ,KAAK,CAAC,0BAA0BW,UAAU,EAAE,CAAC;EACzD;AACF","ignoreList":[]}
|
package/build/esm/types/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["index.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface GeneratorContext {\n readonly projectName: string;\n readonly schema: unknown;\n readonly answers: Readonly<Record<string, unknown>>;\n readonly templateConfig: TemplateConfig;\n readonly schemaPath?: string;\n readonly outputPath: string;\n readonly options: GeneratorOptions;\n readonly utils: TemplateUtils;\n readonly additionalData?: Readonly<Record<string, unknown>>;\n}\n\nexport interface GeneratorOptions {\n readonly skipInstall?: boolean;\n readonly verbose?: boolean;\n readonly dryRun?: boolean;\n}\n\nexport interface TemplateConfig {\n readonly name: string;\n readonly description?: string;\n readonly prompts?: PromptQuestion[];\n readonly templateFiles?: readonly string[];\n readonly staticFiles?: readonly string[];\n readonly hooks?: {\n readonly beforeGenerate?: string | ((context: GeneratorContext) => Promise<GeneratorContext>);\n readonly afterGenerate?:\n | string\n | ((context: GeneratorContext, outputPath: string) => Promise<void>);\n readonly beforeInstall?:\n | string\n | ((context: GeneratorContext, outputPath: string) => Promise<void>);\n readonly afterInstall?:\n | string\n | ((context: GeneratorContext, outputPath: string) => Promise<void>);\n };\n readonly transformers?: {\n readonly [key: string]:\n | string\n | ((schema: unknown, context: GeneratorContext) => Promise<unknown>);\n };\n readonly dependencies?: Readonly<Record<string, string>>;\n readonly devDependencies?: Readonly<Record<string, string>>;\n}\n\nexport interface PromptQuestion {\n readonly type: \"input\" | \"number\" | \"confirm\" | \"list\" | \"checkbox\" | \"password\";\n readonly name: string;\n readonly message: string;\n readonly default?: unknown;\n readonly choices?:\n | readonly string[]\n | readonly { readonly name: string; readonly value: unknown }[];\n readonly validate?: (input: unknown) => boolean | string;\n readonly when?: (answers: Readonly<Record<string, unknown>>) => boolean;\n}\n\nexport interface TemplateUtils {\n readonly camelCase: (str: string) => string;\n readonly capitalize: (str: string) => string;\n readonly kebabCase: (str: string) => string;\n readonly lower: (str: string) => string;\n readonly pascalCase: (str: string) => string;\n readonly pluralize: (str: string) => string;\n readonly singularize: (str: string) => string;\n readonly snakeCase: (str: string) => string;\n readonly upper: (str: string) => string;\n}\n\nexport interface CreateCommandOptions {\n readonly config?: string | Record<string, unknown>;\n readonly dryRun?: boolean;\n readonly nonInteractive?: boolean;\n readonly overwrite?: boolean;\n readonly schema?: string;\n readonly skipInstall?: boolean;\n readonly template?: string;\n readonly verbose?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import fs from "fs-extra";
|
|
18
|
-
import { glob } from "glob";
|
|
19
|
-
import path from "path";
|
|
20
|
-
export async function copyFiles(source, destination, patterns, dryRun = false) {
|
|
21
|
-
// Separate positive and negative patterns
|
|
22
|
-
const includePatterns = patterns.filter(p => !p.startsWith("!"));
|
|
23
|
-
const excludePatterns = patterns.filter(p => p.startsWith("!")).map(p => p.slice(1)); // Remove the ! prefix
|
|
24
|
-
|
|
25
|
-
for (const pattern of includePatterns) {
|
|
26
|
-
const files = glob.globSync(pattern, {
|
|
27
|
-
cwd: source,
|
|
28
|
-
nodir: true,
|
|
29
|
-
dot: true,
|
|
30
|
-
ignore: excludePatterns
|
|
31
|
-
});
|
|
32
|
-
for (const file of files) {
|
|
33
|
-
const sourcePath = path.join(source, file);
|
|
34
|
-
// Rename _gitignore to .gitignore during copy
|
|
35
|
-
const destFile = file === "_gitignore" ? ".gitignore" : file;
|
|
36
|
-
const destPath = path.join(destination, destFile);
|
|
37
|
-
if (!dryRun) {
|
|
38
|
-
await fs.ensureDir(path.dirname(destPath));
|
|
39
|
-
await fs.copy(sourcePath, destPath);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
export async function ensureDir(dirPath, dryRun = false) {
|
|
45
|
-
if (!dryRun) {
|
|
46
|
-
await fs.ensureDir(dirPath);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
export async function writeFile(filePath, content, dryRun = false) {
|
|
50
|
-
if (!dryRun) {
|
|
51
|
-
await fs.ensureDir(path.dirname(filePath));
|
|
52
|
-
await fs.writeFile(filePath, content, "utf8");
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
export async function readFile(filePath) {
|
|
56
|
-
return fs.readFile(filePath, "utf8");
|
|
57
|
-
}
|
|
58
|
-
export async function pathExists(filePath) {
|
|
59
|
-
return fs.pathExists(filePath);
|
|
60
|
-
}
|
|
61
|
-
export async function readJSON(filePath) {
|
|
62
|
-
return fs.readJSON(filePath);
|
|
63
|
-
}
|
|
64
|
-
export async function writeJSON(filePath, data, dryRun = false) {
|
|
65
|
-
if (!dryRun) {
|
|
66
|
-
await fs.ensureDir(path.dirname(filePath));
|
|
67
|
-
await fs.writeJSON(filePath, data, {
|
|
68
|
-
spaces: 2
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=fileSystem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fileSystem.js","names":["fs","glob","path","copyFiles","source","destination","patterns","dryRun","includePatterns","filter","p","startsWith","excludePatterns","map","slice","pattern","files","globSync","cwd","nodir","dot","ignore","file","sourcePath","join","destFile","destPath","ensureDir","dirname","copy","dirPath","writeFile","filePath","content","readFile","pathExists","readJSON","writeJSON","data","spaces"],"sources":["fileSystem.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from \"fs-extra\";\nimport { glob } from \"glob\";\nimport path from \"path\";\n\nexport async function copyFiles(\n source: string,\n destination: string,\n patterns: readonly string[],\n dryRun: boolean = false,\n): Promise<void> {\n // Separate positive and negative patterns\n const includePatterns = patterns.filter(p => !p.startsWith(\"!\"));\n const excludePatterns = patterns\n .filter(p => p.startsWith(\"!\"))\n .map(p => p.slice(1)); // Remove the ! prefix\n\n for (const pattern of includePatterns) {\n const files = glob.globSync(pattern, {\n cwd: source,\n nodir: true,\n dot: true,\n ignore: excludePatterns,\n });\n\n for (const file of files) {\n const sourcePath = path.join(source, file);\n // Rename _gitignore to .gitignore during copy\n const destFile = file === \"_gitignore\" ? \".gitignore\" : file;\n const destPath = path.join(destination, destFile);\n\n if (!dryRun) {\n await fs.ensureDir(path.dirname(destPath));\n await fs.copy(sourcePath, destPath);\n }\n }\n }\n}\n\nexport async function ensureDir(dirPath: string, dryRun: boolean = false): Promise<void> {\n if (!dryRun) {\n await fs.ensureDir(dirPath);\n }\n}\n\nexport async function writeFile(\n filePath: string,\n content: string,\n dryRun: boolean = false,\n): Promise<void> {\n if (!dryRun) {\n await fs.ensureDir(path.dirname(filePath));\n await fs.writeFile(filePath, content, \"utf8\");\n }\n}\n\nexport async function readFile(filePath: string): Promise<string> {\n return fs.readFile(filePath, \"utf8\");\n}\n\nexport async function pathExists(filePath: string): Promise<boolean> {\n return fs.pathExists(filePath);\n}\n\nexport async function readJSON(filePath: string): Promise<unknown> {\n return fs.readJSON(filePath);\n}\n\nexport async function writeJSON(\n filePath: string,\n data: unknown,\n dryRun: boolean = false,\n): Promise<void> {\n if (!dryRun) {\n await fs.ensureDir(path.dirname(filePath));\n await fs.writeJSON(filePath, data, { spaces: 2 });\n }\n}\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/*
|
|
2
|
-
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import { createConsola } from "consola";
|
|
18
|
-
export class Logger {
|
|
19
|
-
consola;
|
|
20
|
-
constructor(verbose = false) {
|
|
21
|
-
this.consola = createConsola({
|
|
22
|
-
level: verbose ? 4 : 3
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
info(message) {
|
|
26
|
-
this.consola.info(message);
|
|
27
|
-
}
|
|
28
|
-
success(message) {
|
|
29
|
-
this.consola.success(message);
|
|
30
|
-
}
|
|
31
|
-
warning(message) {
|
|
32
|
-
this.consola.warn(message);
|
|
33
|
-
}
|
|
34
|
-
error(message) {
|
|
35
|
-
this.consola.error(message);
|
|
36
|
-
}
|
|
37
|
-
debug(message) {
|
|
38
|
-
this.consola.debug(message);
|
|
39
|
-
}
|
|
40
|
-
log(message) {
|
|
41
|
-
this.consola.log(message);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=logger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","names":["createConsola","Logger","consola","constructor","verbose","level","info","message","success","warning","warn","error","debug","log"],"sources":["logger.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type ConsolaInstance, createConsola } from \"consola\";\n\nexport class Logger {\n private consola: ConsolaInstance;\n\n constructor(verbose: boolean = false) {\n this.consola = createConsola({\n level: verbose ? 4 : 3,\n });\n }\n\n info(message: string): void {\n this.consola.info(message);\n }\n\n success(message: string): void {\n this.consola.success(message);\n }\n\n warning(message: string): void {\n this.consola.warn(message);\n }\n\n error(message: string): void {\n this.consola.error(message);\n }\n\n debug(message: string): void {\n this.consola.debug(message);\n }\n\n log(message: string): void {\n this.consola.log(message);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAA+BA,aAAa,QAAQ,SAAS;AAE7D,OAAO,MAAMC,MAAM,CAAC;EACVC,OAAO;EAEfC,WAAWA,CAACC,OAAgB,GAAG,KAAK,EAAE;IACpC,IAAI,CAACF,OAAO,GAAGF,aAAa,CAAC;MAC3BK,KAAK,EAAED,OAAO,GAAG,CAAC,GAAG;IACvB,CAAC,CAAC;EACJ;EAEAE,IAAIA,CAACC,OAAe,EAAQ;IAC1B,IAAI,CAACL,OAAO,CAACI,IAAI,CAACC,OAAO,CAAC;EAC5B;EAEAC,OAAOA,CAACD,OAAe,EAAQ;IAC7B,IAAI,CAACL,OAAO,CAACM,OAAO,CAACD,OAAO,CAAC;EAC/B;EAEAE,OAAOA,CAACF,OAAe,EAAQ;IAC7B,IAAI,CAACL,OAAO,CAACQ,IAAI,CAACH,OAAO,CAAC;EAC5B;EAEAI,KAAKA,CAACJ,OAAe,EAAQ;IAC3B,IAAI,CAACL,OAAO,CAACS,KAAK,CAACJ,OAAO,CAAC;EAC7B;EAEAK,KAAKA,CAACL,OAAe,EAAQ;IAC3B,IAAI,CAACL,OAAO,CAACU,KAAK,CAACL,OAAO,CAAC;EAC7B;EAEAM,GAAGA,CAACN,OAAe,EAAQ;IACzB,IAAI,CAACL,OAAO,CAACW,GAAG,CAACN,OAAO,CAAC;EAC3B;AACF","ignoreList":[]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import inquirer from "inquirer";
|
|
18
|
-
export async function promptUser(questions) {
|
|
19
|
-
const mappedQuestions = questions.map(q => ({
|
|
20
|
-
...q,
|
|
21
|
-
type: q.type
|
|
22
|
-
}));
|
|
23
|
-
return inquirer.prompt(mappedQuestions);
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=prompts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","names":["inquirer","promptUser","questions","mappedQuestions","map","q","type","prompt"],"sources":["prompts.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport inquirer from \"inquirer\";\nimport type { PromptQuestion } from \"../types/index.js\";\n\nexport async function promptUser(\n questions: PromptQuestion[],\n): Promise<Record<string, unknown>> {\n const mappedQuestions = questions.map(q => ({\n ...q,\n\n type: q.type as any,\n }));\n\n return inquirer.prompt(mappedQuestions);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,QAAQ,MAAM,UAAU;AAG/B,OAAO,eAAeC,UAAUA,CAC9BC,SAA2B,EACO;EAClC,MAAMC,eAAe,GAAGD,SAAS,CAACE,GAAG,CAACC,CAAC,KAAK;IAC1C,GAAGA,CAAC;IAEJC,IAAI,EAAED,CAAC,CAACC;EACV,CAAC,CAAC,CAAC;EAEH,OAAON,QAAQ,CAACO,MAAM,CAACJ,eAAe,CAAC;AACzC","ignoreList":[]}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
export function createTemplateUtils() {
|
|
18
|
-
return {
|
|
19
|
-
camelCase: str => {
|
|
20
|
-
// First handle all caps with underscores (like HELLO_WORLD)
|
|
21
|
-
if (str === str.toUpperCase() && str.includes("_")) {
|
|
22
|
-
return str.toLowerCase().replace(/_(.)/g, (_, c) => c.toUpperCase());
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Handle PascalCase by inserting spaces before capitals, and replace underscores with spaces
|
|
26
|
-
const withSpaces = str.replace(/_/g, " ") // Replace underscores with spaces
|
|
27
|
-
.replace(/([A-Z])/g, " $1") // Insert spaces before capitals
|
|
28
|
-
.trim();
|
|
29
|
-
// Now convert to camelCase
|
|
30
|
-
return withSpaces.toLowerCase().replace(/[-_\s]+(.)?/g, (_, c) => c ? c.toUpperCase() : "").replace(/^(.)/, c => c.toLowerCase());
|
|
31
|
-
},
|
|
32
|
-
pascalCase: str => {
|
|
33
|
-
return str.replace(/[-_\s]+(.)?/g, (_, c) => c ? c.toUpperCase() : "").replace(/^(.)/, c => c.toUpperCase());
|
|
34
|
-
},
|
|
35
|
-
kebabCase: str => {
|
|
36
|
-
return str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
37
|
-
},
|
|
38
|
-
snakeCase: str => {
|
|
39
|
-
return str.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase();
|
|
40
|
-
},
|
|
41
|
-
pluralize: str => {
|
|
42
|
-
if (str.match(/s$/)) return str;
|
|
43
|
-
/* cspell:disable-next-line */
|
|
44
|
-
if (str.match(/[^aeiou]y$/)) return str.replace(/y$/, "ies");
|
|
45
|
-
if (str.match(/(s|x|z|ch|sh)$/)) return str + "es";
|
|
46
|
-
return str + "s";
|
|
47
|
-
},
|
|
48
|
-
singularize: str => {
|
|
49
|
-
if (str.match(/ies$/)) return str.replace(/ies$/, "y");
|
|
50
|
-
if (str.match(/ses$/)) return str.replace(/es$/, "");
|
|
51
|
-
if (str.match(/s$/)) return str.replace(/s$/, "");
|
|
52
|
-
return str;
|
|
53
|
-
},
|
|
54
|
-
capitalize: str => {
|
|
55
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
56
|
-
},
|
|
57
|
-
lower: str => str.toLowerCase(),
|
|
58
|
-
upper: str => str.toUpperCase()
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=templateUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templateUtils.js","names":["createTemplateUtils","camelCase","str","toUpperCase","includes","toLowerCase","replace","_","c","withSpaces","trim","pascalCase","kebabCase","snakeCase","pluralize","match","singularize","capitalize","charAt","slice","lower","upper"],"sources":["templateUtils.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { TemplateUtils } from \"../types/index.js\";\n\nexport function createTemplateUtils(): TemplateUtils {\n return {\n camelCase: (str: string) => {\n // First handle all caps with underscores (like HELLO_WORLD)\n if (str === str.toUpperCase() && str.includes(\"_\")) {\n return str\n .toLowerCase()\n .replace(/_(.)/g, (_, c: string) => c.toUpperCase());\n }\n\n // Handle PascalCase by inserting spaces before capitals, and replace underscores with spaces\n const withSpaces = str\n .replace(/_/g, \" \") // Replace underscores with spaces\n .replace(/([A-Z])/g, \" $1\") // Insert spaces before capitals\n .trim();\n // Now convert to camelCase\n return withSpaces\n .toLowerCase()\n .replace(/[-_\\s]+(.)?/g, (_, c: string | undefined) => c ? c.toUpperCase() : \"\")\n .replace(/^(.)/, c => c.toLowerCase());\n },\n\n pascalCase: (str: string) => {\n return str\n .replace(/[-_\\s]+(.)?/g, (_, c: string | undefined) => c ? c.toUpperCase() : \"\")\n .replace(/^(.)/, c => c.toUpperCase());\n },\n\n kebabCase: (str: string) => {\n return str\n .replace(/([a-z])([A-Z])/g, \"$1-$2\")\n .replace(/[\\s_]+/g, \"-\")\n .toLowerCase();\n },\n\n snakeCase: (str: string) => {\n return str\n .replace(/([a-z])([A-Z])/g, \"$1_$2\")\n .replace(/[\\s-]+/g, \"_\")\n .toLowerCase();\n },\n\n pluralize: (str: string) => {\n if (str.match(/s$/)) return str;\n /* cspell:disable-next-line */\n if (str.match(/[^aeiou]y$/)) return str.replace(/y$/, \"ies\");\n if (str.match(/(s|x|z|ch|sh)$/)) return str + \"es\";\n return str + \"s\";\n },\n\n singularize: (str: string) => {\n if (str.match(/ies$/)) return str.replace(/ies$/, \"y\");\n if (str.match(/ses$/)) return str.replace(/es$/, \"\");\n if (str.match(/s$/)) return str.replace(/s$/, \"\");\n return str;\n },\n\n capitalize: (str: string) => {\n return str.charAt(0).toUpperCase() + str.slice(1);\n },\n\n lower: (str: string) => str.toLowerCase(),\n\n upper: (str: string) => str.toUpperCase(),\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,SAASA,mBAAmBA,CAAA,EAAkB;EACnD,OAAO;IACLC,SAAS,EAAGC,GAAW,IAAK;MAC1B;MACA,IAAIA,GAAG,KAAKA,GAAG,CAACC,WAAW,CAAC,CAAC,IAAID,GAAG,CAACE,QAAQ,CAAC,GAAG,CAAC,EAAE;QAClD,OAAOF,GAAG,CACPG,WAAW,CAAC,CAAC,CACbC,OAAO,CAAC,OAAO,EAAE,CAACC,CAAC,EAAEC,CAAS,KAAKA,CAAC,CAACL,WAAW,CAAC,CAAC,CAAC;MACxD;;MAEA;MACA,MAAMM,UAAU,GAAGP,GAAG,CACnBI,OAAO,CA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AAK,CAAC;MAC5D,IAAIJ,GAAG,CAACa,KAAK,CAAC,gBAAgB,CAAC,EAAE,OAAOb,GAAG,GAAG,IAAI;MAClD,OAAOA,GAAG,GAAG,GAAG;IAClB,CAAC;IAEDc,WAAW,EAAGd,GAAW,IAAK;MAC5B,IAAIA,GAAG,CAACa,KAAK,CAAC,MAAM,CAAC,EAAE,OAAOb,GAAG,CAACI,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;MACtD,IAAIJ,GAAG,CAACa,KAAK,CAAC,MAAM,CAAC,EAAE,OAAOb,GAAG,CAACI,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;MACpD,IAAIJ,GAAG,CAACa,KAAK,CAAC,IAAI,CAAC,EAAE,OAAOb,GAAG,CAACI,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;MACjD,OAAOJ,GAAG;IACZ,CAAC;IAEDe,UAAU,EAAGf,GAAW,IAAK;MAC3B,OAAOA,GAAG,CAACgB,MAAM,CAAC,CAAC,CAAC,CAACf,WAAW,CAAC,CAAC,GAAGD,GAAG,CAACiB,KAAK,CAAC,CAAC,CAAC;IACnD,CAAC;IAEDC,KAAK,EAAGlB,GAAW,IAAKA,GAAG,CAACG,WAAW,CAAC,CAAC;IAEzCgB,KAAK,EAAGnB,GAAW,IAAKA,GAAG,CAACC,WAAW,CAAC;EAC1C,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemaParser.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/schemaParser.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templateUtils.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/templateUtils.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { GeneratorContext, GeneratorOptions, TemplateConfig } from "../types/index.js";
|
|
2
|
-
export declare class ContextBuilder {
|
|
3
|
-
build(projectName: string, schema: unknown, answers: Record<string, unknown>, templateConfig: TemplateConfig, outputPath: string, options: GeneratorOptions, schemaPath?: string): GeneratorContext;
|
|
4
|
-
}
|
|
5
|
-
//# sourceMappingURL=contextBuilder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contextBuilder.d.ts","sourceRoot":"","sources":["../../../src/core/contextBuilder.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAG5F,qBAAa,cAAc;IACzB,KAAK,CACH,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,gBAAgB,EACzB,UAAU,CAAC,EAAE,MAAM,GAClB,gBAAgB;CAapB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { GeneratorContext } from "../types/index.js";
|
|
2
|
-
import type { Logger } from "../utils/logger.js";
|
|
3
|
-
export declare class Generator {
|
|
4
|
-
private context;
|
|
5
|
-
private readonly templateDir;
|
|
6
|
-
private readonly logger;
|
|
7
|
-
constructor(context: GeneratorContext, templateDir: string, logger: Logger);
|
|
8
|
-
generate(): Promise<void>;
|
|
9
|
-
private processTemplateFiles;
|
|
10
|
-
private copyStaticFiles;
|
|
11
|
-
private copySchemaDirectory;
|
|
12
|
-
private runHook;
|
|
13
|
-
private installDependencies;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../src/core/generator.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAIjD,qBAAa,SAAS;IAElB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFf,OAAO,EAAE,gBAAgB,EAChB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM;IAG3B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;YA+BjB,oBAAoB;YA4BpB,eAAe;YAYf,mBAAmB;YAoCnB,OAAO;YA6FP,mBAAmB;CA6BlC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hookRunner.d.ts","sourceRoot":"","sources":["../../../src/core/hookRunner.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemaParser.d.ts","sourceRoot":"","sources":["../../../src/core/schemaParser.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAErC,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAgCxD"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { TemplateConfig } from "../types/index.js";
|
|
2
|
-
import type { Logger } from "../utils/logger.js";
|
|
3
|
-
export declare class TemplateLoader {
|
|
4
|
-
private readonly logger;
|
|
5
|
-
constructor(logger: Logger);
|
|
6
|
-
loadTemplate(templatePath: string): Promise<{
|
|
7
|
-
config: TemplateConfig;
|
|
8
|
-
templateDir: string;
|
|
9
|
-
}>;
|
|
10
|
-
private findPackageRoot;
|
|
11
|
-
private resolveNodeModule;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=templateLoader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templateLoader.d.ts","sourceRoot":"","sources":["../../../src/core/templateLoader.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAErC,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;QAChD,MAAM,EAAE,cAAc,CAAC;QACvB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;YA6CY,eAAe;YAaf,iBAAiB;CAwChC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
export interface GeneratorContext {
|
|
2
|
-
readonly projectName: string;
|
|
3
|
-
readonly schema: unknown;
|
|
4
|
-
readonly answers: Readonly<Record<string, unknown>>;
|
|
5
|
-
readonly templateConfig: TemplateConfig;
|
|
6
|
-
readonly schemaPath?: string;
|
|
7
|
-
readonly outputPath: string;
|
|
8
|
-
readonly options: GeneratorOptions;
|
|
9
|
-
readonly utils: TemplateUtils;
|
|
10
|
-
readonly additionalData?: Readonly<Record<string, unknown>>;
|
|
11
|
-
}
|
|
12
|
-
export interface GeneratorOptions {
|
|
13
|
-
readonly skipInstall?: boolean;
|
|
14
|
-
readonly verbose?: boolean;
|
|
15
|
-
readonly dryRun?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export interface TemplateConfig {
|
|
18
|
-
readonly name: string;
|
|
19
|
-
readonly description?: string;
|
|
20
|
-
readonly prompts?: PromptQuestion[];
|
|
21
|
-
readonly templateFiles?: readonly string[];
|
|
22
|
-
readonly staticFiles?: readonly string[];
|
|
23
|
-
readonly hooks?: {
|
|
24
|
-
readonly beforeGenerate?: string | ((context: GeneratorContext) => Promise<GeneratorContext>);
|
|
25
|
-
readonly afterGenerate?: string | ((context: GeneratorContext, outputPath: string) => Promise<void>);
|
|
26
|
-
readonly beforeInstall?: string | ((context: GeneratorContext, outputPath: string) => Promise<void>);
|
|
27
|
-
readonly afterInstall?: string | ((context: GeneratorContext, outputPath: string) => Promise<void>);
|
|
28
|
-
};
|
|
29
|
-
readonly transformers?: {
|
|
30
|
-
readonly [key: string]: string | ((schema: unknown, context: GeneratorContext) => Promise<unknown>);
|
|
31
|
-
};
|
|
32
|
-
readonly dependencies?: Readonly<Record<string, string>>;
|
|
33
|
-
readonly devDependencies?: Readonly<Record<string, string>>;
|
|
34
|
-
}
|
|
35
|
-
export interface PromptQuestion {
|
|
36
|
-
readonly type: "input" | "number" | "confirm" | "list" | "checkbox" | "password";
|
|
37
|
-
readonly name: string;
|
|
38
|
-
readonly message: string;
|
|
39
|
-
readonly default?: unknown;
|
|
40
|
-
readonly choices?: readonly string[] | readonly {
|
|
41
|
-
readonly name: string;
|
|
42
|
-
readonly value: unknown;
|
|
43
|
-
}[];
|
|
44
|
-
readonly validate?: (input: unknown) => boolean | string;
|
|
45
|
-
readonly when?: (answers: Readonly<Record<string, unknown>>) => boolean;
|
|
46
|
-
}
|
|
47
|
-
export interface TemplateUtils {
|
|
48
|
-
readonly camelCase: (str: string) => string;
|
|
49
|
-
readonly capitalize: (str: string) => string;
|
|
50
|
-
readonly kebabCase: (str: string) => string;
|
|
51
|
-
readonly lower: (str: string) => string;
|
|
52
|
-
readonly pascalCase: (str: string) => string;
|
|
53
|
-
readonly pluralize: (str: string) => string;
|
|
54
|
-
readonly singularize: (str: string) => string;
|
|
55
|
-
readonly snakeCase: (str: string) => string;
|
|
56
|
-
readonly upper: (str: string) => string;
|
|
57
|
-
}
|
|
58
|
-
export interface CreateCommandOptions {
|
|
59
|
-
readonly config?: string | Record<string, unknown>;
|
|
60
|
-
readonly dryRun?: boolean;
|
|
61
|
-
readonly nonInteractive?: boolean;
|
|
62
|
-
readonly overwrite?: boolean;
|
|
63
|
-
readonly schema?: string;
|
|
64
|
-
readonly skipInstall?: boolean;
|
|
65
|
-
readonly template?: string;
|
|
66
|
-
readonly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AAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare function copyFiles(source: string, destination: string, patterns: readonly string[], dryRun?: boolean): Promise<void>;
|
|
2
|
-
export declare function ensureDir(dirPath: string, dryRun?: boolean): Promise<void>;
|
|
3
|
-
export declare function writeFile(filePath: string, content: string, dryRun?: boolean): Promise<void>;
|
|
4
|
-
export declare function readFile(filePath: string): Promise<string>;
|
|
5
|
-
export declare function pathExists(filePath: string): Promise<boolean>;
|
|
6
|
-
export declare function readJSON(filePath: string): Promise<unknown>;
|
|
7
|
-
export declare function writeJSON(filePath: string, data: unknown, dryRun?: boolean): Promise<void>;
|
|
8
|
-
//# sourceMappingURL=fileSystem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fileSystem.d.ts","sourceRoot":"","sources":["../../../src/utils/fileSystem.ts"],"names":[],"mappings":"AAoBA,wBAAsB,SAAS,CAC7B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,MAAM,GAAE,OAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CA2Bf;AAED,wBAAsB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAIvF;AAED,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,OAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEhE;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEnE;AAED,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEjE;AAED,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,OAAO,EACb,MAAM,GAAE,OAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAKf"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare class Logger {
|
|
2
|
-
private consola;
|
|
3
|
-
constructor(verbose?: boolean);
|
|
4
|
-
info(message: string): void;
|
|
5
|
-
success(message: string): void;
|
|
6
|
-
warning(message: string): void;
|
|
7
|
-
error(message: string): void;
|
|
8
|
-
debug(message: string): void;
|
|
9
|
-
log(message: string): void;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/utils/logger.ts"],"names":[],"mappings":"AAkBA,qBAAa,MAAM;IACjB,OAAO,CAAC,OAAO,CAAkB;gBAErB,OAAO,GAAE,OAAe;IAMpC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI3B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI9B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI9B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI5B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI5B,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAG3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/utils/prompts.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,wBAAsB,UAAU,CAC9B,SAAS,EAAE,cAAc,EAAE,GAC1B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAQlC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templateUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/templateUtils.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,wBAAgB,mBAAmB,IAAI,aAAa,CAiEnD"}
|