@palantir/pack.sdkgen 0.0.1-beta.1

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.
Files changed (80) hide show
  1. package/LICENSE.txt +13 -0
  2. package/README.md +589 -0
  3. package/bin/cli.ts +7 -0
  4. package/build/esm/__tests__/createCommand.test.js +157 -0
  5. package/build/esm/__tests__/createCommand.test.js.map +1 -0
  6. package/build/esm/__tests__/generator.test.js +190 -0
  7. package/build/esm/__tests__/generator.test.js.map +1 -0
  8. package/build/esm/__tests__/schemaParser.test.js +67 -0
  9. package/build/esm/__tests__/schemaParser.test.js.map +1 -0
  10. package/build/esm/__tests__/templateLoader.test.js +67 -0
  11. package/build/esm/__tests__/templateLoader.test.js.map +1 -0
  12. package/build/esm/__tests__/templateUtils.test.js +94 -0
  13. package/build/esm/__tests__/templateUtils.test.js.map +1 -0
  14. package/build/esm/__tests__/types/testTypes.js +2 -0
  15. package/build/esm/__tests__/types/testTypes.js.map +1 -0
  16. package/build/esm/cli.js +25 -0
  17. package/build/esm/cli.js.map +1 -0
  18. package/build/esm/commands/create.js +173 -0
  19. package/build/esm/commands/create.js.map +1 -0
  20. package/build/esm/core/contextBuilder.js +33 -0
  21. package/build/esm/core/contextBuilder.js.map +1 -0
  22. package/build/esm/core/generator.js +248 -0
  23. package/build/esm/core/generator.js.map +1 -0
  24. package/build/esm/core/hookRunner.js +68 -0
  25. package/build/esm/core/hookRunner.js.map +1 -0
  26. package/build/esm/core/schemaParser.js +50 -0
  27. package/build/esm/core/schemaParser.js.map +1 -0
  28. package/build/esm/core/templateLoader.js +99 -0
  29. package/build/esm/core/templateLoader.js.map +1 -0
  30. package/build/esm/index.js +26 -0
  31. package/build/esm/index.js.map +1 -0
  32. package/build/esm/types/index.js +2 -0
  33. package/build/esm/types/index.js.map +1 -0
  34. package/build/esm/utils/fileSystem.js +72 -0
  35. package/build/esm/utils/fileSystem.js.map +1 -0
  36. package/build/esm/utils/logger.js +44 -0
  37. package/build/esm/utils/logger.js.map +1 -0
  38. package/build/esm/utils/prompts.js +25 -0
  39. package/build/esm/utils/prompts.js.map +1 -0
  40. package/build/esm/utils/templateUtils.js +61 -0
  41. package/build/esm/utils/templateUtils.js.map +1 -0
  42. package/build/types/__tests__/createCommand.test.d.ts +2 -0
  43. package/build/types/__tests__/createCommand.test.d.ts.map +1 -0
  44. package/build/types/__tests__/generator.test.d.ts +2 -0
  45. package/build/types/__tests__/generator.test.d.ts.map +1 -0
  46. package/build/types/__tests__/schemaParser.test.d.ts +2 -0
  47. package/build/types/__tests__/schemaParser.test.d.ts.map +1 -0
  48. package/build/types/__tests__/templateLoader.test.d.ts +2 -0
  49. package/build/types/__tests__/templateLoader.test.d.ts.map +1 -0
  50. package/build/types/__tests__/templateUtils.test.d.ts +2 -0
  51. package/build/types/__tests__/templateUtils.test.d.ts.map +1 -0
  52. package/build/types/__tests__/types/testTypes.d.ts +38 -0
  53. package/build/types/__tests__/types/testTypes.d.ts.map +1 -0
  54. package/build/types/cli.d.ts +2 -0
  55. package/build/types/cli.d.ts.map +1 -0
  56. package/build/types/commands/create.d.ts +3 -0
  57. package/build/types/commands/create.d.ts.map +1 -0
  58. package/build/types/core/contextBuilder.d.ts +5 -0
  59. package/build/types/core/contextBuilder.d.ts.map +1 -0
  60. package/build/types/core/generator.d.ts +15 -0
  61. package/build/types/core/generator.d.ts.map +1 -0
  62. package/build/types/core/hookRunner.d.ts +3 -0
  63. package/build/types/core/hookRunner.d.ts.map +1 -0
  64. package/build/types/core/schemaParser.d.ts +7 -0
  65. package/build/types/core/schemaParser.d.ts.map +1 -0
  66. package/build/types/core/templateLoader.d.ts +12 -0
  67. package/build/types/core/templateLoader.d.ts.map +1 -0
  68. package/build/types/index.d.ts +11 -0
  69. package/build/types/index.d.ts.map +1 -0
  70. package/build/types/types/index.d.ts +68 -0
  71. package/build/types/types/index.d.ts.map +1 -0
  72. package/build/types/utils/fileSystem.d.ts +8 -0
  73. package/build/types/utils/fileSystem.d.ts.map +1 -0
  74. package/build/types/utils/logger.d.ts +11 -0
  75. package/build/types/utils/logger.d.ts.map +1 -0
  76. package/build/types/utils/prompts.d.ts +3 -0
  77. package/build/types/utils/prompts.d.ts.map +1 -0
  78. package/build/types/utils/templateUtils.d.ts +3 -0
  79. package/build/types/utils/templateUtils.d.ts.map +1 -0
  80. package/package.json +61 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","names":["spawnSync","ejs","findUp","fs","glob","path","fileURLToPath","fileSystem","__dirname","dirname","import","meta","url","Generator","constructor","context","templateDir","logger","generate","outputPath","options","dryRun","ensureDir","runHook","processTemplateFiles","copyStaticFiles","copySchemaDirectory","skipInstall","installDependencies","success","templateConfig","templateFiles","templatePath","join","pattern","files","globSync","cwd","nodir","dot","file","sourcePath","destPath","replace","debug","template","readFile","rendered","render","writeFile","staticFiles","length","copyFiles","schemaPath","schemaStats","stat","catch","destSchemaPath","isDirectory","copy","isFile","fileName","basename","hookName","hook","hooks","hookPath","pathExists","packageJsonPath","Error","packageRoot","hookRunnerPath","contextJson","JSON","stringify","result","encoding","stdio","error","status","stdout","updatedContext","parse","message","String","warning","projectName","info","hasPackageJson","_error"],"sources":["generator.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 { spawnSync } from \"child_process\";\nimport ejs from \"ejs\";\nimport { findUp } from \"find-up\";\nimport fs from \"fs-extra\";\nimport { glob } from \"glob\";\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\nimport type { GeneratorContext } from \"../types/index.js\";\nimport * as fileSystem from \"../utils/fileSystem.js\";\nimport type { Logger } from \"../utils/logger.js\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nexport class Generator {\n constructor(\n private context: GeneratorContext,\n private readonly templateDir: string,\n private readonly logger: Logger,\n ) {}\n\n async generate(): Promise<void> {\n const { outputPath, options } = this.context;\n\n // Create output directory\n if (!options.dryRun) {\n await fs.ensureDir(outputPath);\n }\n\n // Run beforeGenerate hook\n await this.runHook(\"beforeGenerate\");\n\n // Process template files\n await this.processTemplateFiles();\n\n // Copy static files\n await this.copyStaticFiles();\n\n // Copy schema directory if provided\n await this.copySchemaDirectory();\n\n // Run afterGenerate hook\n await this.runHook(\"afterGenerate\");\n\n // Install dependencies if not skipped\n if (!options.skipInstall && !options.dryRun) {\n await this.installDependencies();\n }\n\n this.logger.success(`✨ SDK generated successfully at ${outputPath}`);\n }\n\n private async processTemplateFiles(): Promise<void> {\n const { templateConfig, outputPath, options } = this.context;\n const templateFiles = templateConfig.templateFiles || [\"**/*.ejs\"];\n const templatePath = path.join(this.templateDir, \"template\");\n\n for (const pattern of templateFiles) {\n const files = glob.globSync(pattern, { cwd: templatePath, nodir: true, dot: true });\n\n for (const file of files) {\n const sourcePath = path.join(templatePath, file);\n const destPath = path.join(outputPath, file.replace(/\\.ejs$/, \"\"));\n\n this.logger.debug(`Processing template: ${file}`);\n\n // Read and render template\n const template = await fs.readFile(sourcePath, \"utf8\");\n const rendered = ejs.render(template, this.context);\n\n // Write rendered file\n if (!options.dryRun) {\n await fileSystem.writeFile(destPath, rendered);\n } else {\n this.logger.debug(`Would write to: ${destPath}`);\n }\n }\n }\n }\n\n private async copyStaticFiles(): Promise<void> {\n const { templateConfig, outputPath, options } = this.context;\n const staticFiles = templateConfig.staticFiles || [];\n const templatePath = path.join(this.templateDir, \"template\");\n\n if (staticFiles.length === 0) {\n return;\n }\n\n await fileSystem.copyFiles(templatePath, outputPath, staticFiles, options.dryRun);\n }\n\n private async copySchemaDirectory(): Promise<void> {\n const { schemaPath, outputPath, options } = this.context;\n\n if (!schemaPath) {\n return;\n }\n\n const schemaStats = await fs.stat(schemaPath).catch(() => null);\n if (!schemaStats) {\n return;\n }\n\n const destSchemaPath = path.join(outputPath, \"schema\");\n\n if (schemaStats.isDirectory()) {\n // Copy entire schema directory\n if (!options.dryRun) {\n await fs.ensureDir(destSchemaPath);\n await fs.copy(schemaPath, destSchemaPath);\n this.logger.debug(`Copied schema directory to ${destSchemaPath}`);\n } else {\n this.logger.debug(`Would copy schema directory to ${destSchemaPath}`);\n }\n } else if (schemaStats.isFile()) {\n // Copy single schema file\n if (!options.dryRun) {\n await fs.ensureDir(destSchemaPath);\n const fileName = path.basename(schemaPath);\n await fs.copy(schemaPath, path.join(destSchemaPath, fileName));\n this.logger.debug(`Copied schema file to ${destSchemaPath}`);\n } else {\n this.logger.debug(`Would copy schema file to ${destSchemaPath}`);\n }\n }\n }\n\n private async runHook(hookName: \"beforeGenerate\" | \"afterGenerate\"): Promise<void> {\n const { templateConfig } = this.context;\n const hook = templateConfig.hooks?.[hookName];\n\n if (!hook) {\n return;\n }\n\n this.logger.debug(`Running ${hookName} hook`);\n\n if (typeof hook === \"string\") {\n // Execute hook as child process\n const hookPath = path.join(this.templateDir, hook);\n if (await fs.pathExists(hookPath)) {\n try {\n // Find the package root by locating package.json\n const packageJsonPath = await findUp(\"package.json\", { cwd: __dirname });\n if (!packageJsonPath) {\n throw new Error(\"Could not find package.json\");\n }\n\n const packageRoot = path.dirname(packageJsonPath);\n const hookRunnerPath = path.join(packageRoot, \"build/esm/core/hookRunner.js\");\n\n if (!await fs.pathExists(hookRunnerPath)) {\n throw new Error(\n `Hook runner not found at ${hookRunnerPath}. `\n + `Please run 'pnpm build' in the sdkgen-cli package.`,\n );\n }\n\n // Serialize context to JSON\n const contextJson = JSON.stringify(this.context);\n\n // Run hook as child process in template directory\n // Use spawnSync for better output streaming\n const result = spawnSync(\n \"node\",\n [hookRunnerPath, hookPath, hookName, contextJson],\n {\n cwd: this.templateDir,\n encoding: \"utf8\",\n // 'inherit' for stderr allows errors to stream immediately\n // 'pipe' for stdout so we can capture the result for beforeGenerate\n stdio: [\"pipe\", \"pipe\", \"inherit\"],\n },\n );\n\n if (result.error) {\n throw result.error;\n }\n\n if (result.status !== 0) {\n throw new Error(`Hook ${hookName} failed with exit code ${result.status}`);\n }\n\n // Parse result and update context if needed\n if (hookName === \"beforeGenerate\" && result.stdout) {\n try {\n const updatedContext = JSON.parse(result.stdout) as GeneratorContext;\n this.context = updatedContext;\n } catch {\n // If result is not valid JSON, ignore it\n this.logger.debug(\"Hook did not return valid JSON, keeping original context\");\n }\n }\n } catch (error) {\n this.logger.error(\n `Failed to execute ${hookName} hook: ${\n error instanceof Error ? error.message : String(error)\n }`,\n );\n throw error;\n }\n } else {\n this.logger.warning(`Hook file not found: ${hookPath}`);\n }\n } else if (typeof hook === \"function\") {\n // Execute inline hook (for backward compatibility and testing)\n if (hookName === \"beforeGenerate\") {\n const result = await (hook as (context: GeneratorContext) => Promise<GeneratorContext>)(\n this.context,\n );\n this.context = result;\n } else {\n await (hook as (context: GeneratorContext, outputPath: string) => Promise<void>)(\n this.context,\n this.context.outputPath,\n );\n }\n }\n }\n\n private async installDependencies(): Promise<void> {\n const { outputPath, projectName } = this.context;\n\n this.logger.info(\"Installing dependencies...\");\n\n // Check which package manager to use\n const hasPackageJson = await fs.pathExists(path.join(outputPath, \"package.json\"));\n if (!hasPackageJson) {\n this.logger.debug(\"No package.json found, skipping dependency installation\");\n return;\n }\n\n // Detect package manager (simplified - just use npm for now)\n try {\n const result = spawnSync(\"npm\", [\"install\"], {\n cwd: outputPath,\n stdio: \"inherit\",\n });\n\n if (result.status === 0) {\n this.logger.success(\"Dependencies installed successfully\");\n } else {\n throw new Error(`npm install failed with exit code ${result.status}`);\n }\n } catch (_error) {\n this.logger.warning(\"Failed to install dependencies automatically\");\n this.logger.info(`Please run 'npm install' in ${projectName} directory`);\n }\n }\n}\n"],"mappings":"AAAA;AACA;A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AK,CAAC,EAAE;QACvB,IAAI,CAAC9D,MAAM,CAACY,OAAO,CAAC,qCAAqC,CAAC;MAC5D,CAAC,MAAM;QACL,MAAM,IAAIwC,KAAK,CAAC,qCAAqCM,MAAM,CAACI,MAAM,EAAE,CAAC;MACvE;IACF,CAAC,CAAC,OAAOU,MAAM,EAAE;MACf,IAAI,CAACxE,MAAM,CAACoE,OAAO,CAAC,8CAA8C,CAAC;MACnE,IAAI,CAACpE,MAAM,CAACsE,IAAI,CAAC,+BAA+BD,WAAW,YAAY,CAAC;IAC1E;EACF;AACF","ignoreList":[]}
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ * Copyright 2025 Palantir Technologies, Inc. All rights reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ /**
19
+ * Hook runner script that executes template hooks in a child process.
20
+ * This ensures hooks run with the template's Node context and dependencies.
21
+ */
22
+ import consola from "consola";
23
+ import { pathToFileURL } from "url";
24
+ async function runHook() {
25
+ const args = process.argv.slice(2);
26
+ if (args.length < 3) {
27
+ consola.error("Usage: hookRunner <hookPath> <hookName> <contextJson>");
28
+ process.exit(1);
29
+ }
30
+ const [hookPath, hookName, contextJson] = args;
31
+ try {
32
+ // Parse the context
33
+ const context = JSON.parse(contextJson);
34
+
35
+ // Import and execute the hook
36
+ const hookUrl = pathToFileURL(hookPath).href;
37
+ const {
38
+ default: hookFn
39
+ } = await import(hookUrl);
40
+
41
+ // Run the hook
42
+ let result;
43
+ if (hookName === "beforeGenerate") {
44
+ result = await hookFn(context);
45
+ } else {
46
+ // afterGenerate receives outputPath as second argument
47
+ result = await hookFn(context, context.outputPath);
48
+ }
49
+
50
+ // Return the result as JSON to stdout
51
+ if (result !== undefined) {
52
+ process.stdout.write(JSON.stringify(result));
53
+ }
54
+ process.exit(0);
55
+ } catch (error) {
56
+ consola.error("Hook execution failed:", error);
57
+ process.exit(1);
58
+ }
59
+ }
60
+
61
+ // Run if this is the main module
62
+ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
63
+ runHook().catch(error => {
64
+ consola.error("Unexpected error:", error);
65
+ process.exit(1);
66
+ });
67
+ }
68
+ //# sourceMappingURL=hookRunner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hookRunner.js","names":["consola","pathToFileURL","runHook","args","process","argv","slice","length","error","exit","hookPath","hookName","contextJson","context","JSON","parse","hookUrl","href","default","hookFn","result","outputPath","undefined","stdout","write","stringify","import","meta","url","catch"],"sources":["hookRunner.ts"],"sourcesContent":["#!/usr/bin/env node\n/*\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\n/**\n * Hook runner script that executes template hooks in a child process.\n * This ensures hooks run with the template's Node context and dependencies.\n */\n\nimport consola from \"consola\";\nimport { pathToFileURL } from \"url\";\nimport type { GeneratorContext } from \"../types/index.js\";\n\nasync function runHook(): Promise<void> {\n const args = process.argv.slice(2);\n\n if (args.length < 3) {\n consola.error(\"Usage: hookRunner <hookPath> <hookName> <contextJson>\");\n process.exit(1);\n }\n\n const [hookPath, hookName, contextJson] = args;\n try {\n // Parse the context\n const context = JSON.parse(contextJson!) as GeneratorContext;\n\n // Import and execute the hook\n const hookUrl = pathToFileURL(hookPath!).href;\n const { default: hookFn } = await import(hookUrl) as {\n default: (\n context: GeneratorContext,\n outputPath?: string,\n ) => Promise<GeneratorContext | undefined>;\n };\n\n // Run the hook\n let result;\n if (hookName === \"beforeGenerate\") {\n result = await hookFn(context);\n } else {\n // afterGenerate receives outputPath as second argument\n result = await hookFn(context, context.outputPath);\n }\n\n // Return the result as JSON to stdout\n if (result !== undefined) {\n process.stdout.write(JSON.stringify(result));\n }\n\n process.exit(0);\n } catch (error) {\n consola.error(\"Hook execution failed:\", error);\n process.exit(1);\n }\n}\n\n// Run if this is the main module\nif (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {\n runHook().catch((error: unknown) => {\n consola.error(\"Unexpected error:\", error);\n process.exit(1);\n });\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AAEA,OAAOA,OAAO,MAAM,SAAS;AAC7B,SAASC,aAAa,QAAQ,KAAK;AAGnC,eAAeC,OAAOA,CAAA,EAAkB;EACtC,MAAMC,IAAI,GAAGC,OAAO,CAACC,IAAI,CAACC,KAAK,CAAC,CAAC,CAAC;EAElC,IAAIH,IAAI,CAACI,MAAM,GAAG,CAAC,EAAE;IACnBP,OAAO,CAACQ,KAAK,CAAC,uDAAuD,CAAC;IACtEJ,OAAO,CAACK,IAAI,CAAC,CAAC,CAAC;EACjB;EAEA,MAAM,CAACC,QAAQ,EAAEC,QAAQ,EAAEC,WAAW,CAAC,GAAGT,IAAI;EAC9C,IAAI;IACF;IACA,MAAMU,OAAO,GAAGC,IAAI,CAACC,KAAK,CAACH,WAAY,CAAqB;;IAE5D;IACA,MAAMI,OAAO,GAAGf,aAAa,CAACS,QAAS,CAAC,CAACO,IAAI;IAC7C,MAAM;MAAEC,OAAO,EAAEC;IAAO,CAAC,GAAG,MAAM,MAAM,CAACH,OAAO,CAK/C;;IAED;IACA,IAAII,MAAM;IACV,IAAIT,QAAQ,KAAK,gBAAgB,EAAE;MACjCS,MAAM,GAAG,MAAMD,MAAM,CAACN,OAAO,CAAC;IAChC,CAAC,MAAM;MACL;MACAO,MAAM,GAAG,MAAMD,MAAM,CAACN,OAAO,EAAEA,OAAO,CAACQ,UAAU,CAAC;IACpD;;IAEA;IACA,IAAID,MAAM,KAAKE,SAAS,EAAE;MACxBlB,OAAO,CAACmB,MAAM,CAACC,KAAK,CAACV,IAAI,CAACW,SAAS,CAACL,MAAM,CAAC,CAAC;IAC9C;IAEAhB,OAAO,CAACK,IAAI,CAAC,CAAC,CAAC;EACjB,CAAC,CAAC,OAAOD,KAAK,EAAE;IACdR,OAAO,CAACQ,KAAK,CAAC,wBAAwB,EAAEA,KAAK,CAAC;IAC9CJ,OAAO,CAACK,IAAI,CAAC,CAAC,CAAC;EACjB;AACF;;AAEA;AACA,IAAIL,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC,IAAIqB,MAAM,CAACC,IAAI,CAACC,GAAG,KAAK3B,aAAa,CAACG,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC,CAAC,CAACY,IAAI,EAAE;EAC9Ef,OAAO,CAAC,CAAC,CAAC2B,KAAK,CAAErB,KAAc,IAAK;IAClCR,OAAO,CAACQ,KAAK,CAAC,mBAAmB,EAAEA,KAAK,CAAC;IACzCJ,OAAO,CAACK,IAAI,CAAC,CAAC,CAAC;EACjB,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,50 @@
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 path from "path";
19
+ export class SchemaParser {
20
+ constructor(logger) {
21
+ this.logger = logger;
22
+ }
23
+ async loadSchema(schemaPath) {
24
+ if (!schemaPath) {
25
+ this.logger.debug("No schema provided");
26
+ return null;
27
+ }
28
+ const resolvedPath = path.resolve(schemaPath);
29
+ if (!(await fs.pathExists(resolvedPath))) {
30
+ throw new Error(`Schema path not found: ${resolvedPath}`);
31
+ }
32
+ const stats = await fs.stat(resolvedPath);
33
+ if (stats.isDirectory()) {
34
+ return resolvedPath;
35
+ }
36
+ const ext = path.extname(resolvedPath).toLowerCase();
37
+ const content = await fs.readFile(resolvedPath, "utf8");
38
+ try {
39
+ if (ext === ".json") {
40
+ return JSON.parse(content);
41
+ } else {
42
+ return resolvedPath;
43
+ }
44
+ } catch (_error) {
45
+ this.logger.debug(`Could not parse as JSON, returning path: ${resolvedPath}`);
46
+ return resolvedPath;
47
+ }
48
+ }
49
+ }
50
+ //# sourceMappingURL=schemaParser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaParser.js","names":["fs","path","SchemaParser","constructor","logger","loadSchema","schemaPath","debug","resolvedPath","resolve","pathExists","Error","stats","stat","isDirectory","ext","extname","toLowerCase","content","readFile","JSON","parse","_error"],"sources":["schemaParser.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 path from \"path\";\nimport type { Logger } from \"../utils/logger.js\";\n\nexport class SchemaParser {\n constructor(private readonly logger: Logger) {}\n\n async loadSchema(schemaPath?: string): Promise<unknown> {\n if (!schemaPath) {\n this.logger.debug(\"No schema provided\");\n return null;\n }\n\n const resolvedPath = path.resolve(schemaPath);\n\n if (!await fs.pathExists(resolvedPath)) {\n throw new Error(`Schema path not found: ${resolvedPath}`);\n }\n\n const stats = await fs.stat(resolvedPath);\n\n if (stats.isDirectory()) {\n return resolvedPath;\n }\n\n const ext = path.extname(resolvedPath).toLowerCase();\n const content = await fs.readFile(resolvedPath, \"utf8\");\n\n try {\n if (ext === \".json\") {\n return JSON.parse(content);\n } else {\n return resolvedPath;\n }\n } catch (_error) {\n this.logger.debug(`Could not parse as JSON, returning path: ${resolvedPath}`);\n return resolvedPath;\n }\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,EAAE,MAAM,UAAU;AACzB,OAAOC,IAAI,MAAM,MAAM;AAGvB,OAAO,MAAMC,YAAY,CAAC;EACxBC,WAAWA,CAAkBC,MAAc,EAAE;IAAA,KAAhBA,MAAc,GAAdA,MAAc;EAAG;EAE9C,MAAMC,UAAUA,CAACC,UAAmB,EAAoB;IACtD,IAAI,CAACA,UAAU,EAAE;MACf,IAAI,CAACF,MAAM,CAACG,KAAK,CAAC,oBAAoB,CAAC;MACvC,OAAO,IAAI;IACb;IAEA,MAAMC,YAAY,GAAGP,IAAI,CAACQ,OAAO,CAACH,UAAU,CAAC;IAE7C,IAAI,EAAC,MAAMN,EAAE,CAACU,UAAU,CAACF,YAAY,CAAC,GAAE;MACtC,MAAM,IAAIG,KAAK,CAAC,0BAA0BH,YAAY,EAAE,CAAC;IAC3D;IAEA,MAAMI,KAAK,GAAG,MAAMZ,EAAE,CAACa,IAAI,CAACL,YAAY,CAAC;IAEzC,IAAII,KAAK,CAACE,WAAW,CAAC,CAAC,EAAE;MACvB,OAAON,YAAY;IACrB;IAEA,MAAMO,GAAG,GAAGd,IAAI,CAACe,OAAO,CAACR,YAAY,CAAC,CAACS,WAAW,CAAC,CAAC;IACpD,MAAMC,OAAO,GAAG,MAAMlB,EAAE,CAACmB,QAAQ,CAACX,YAAY,EAAE,MAAM,CAAC;IAEvD,IAAI;MACF,IAAIO,GAAG,KAAK,OAAO,EAAE;QACnB,OAAOK,IAAI,CAACC,KAAK,CAACH,OAAO,CAAC;MAC5B,CAAC,MAAM;QACL,OAAOV,YAAY;MACrB;IACF,CAAC,CAAC,OAAOc,MAAM,EAAE;MACf,IAAI,CAAClB,MAAM,CAACG,KAAK,CAAC,4CAA4CC,YAAY,EAAE,CAAC;MAC7E,OAAOA,YAAY;IACrB;EACF;AACF","ignoreList":[]}
@@ -0,0 +1,99 @@
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 { 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 (we'll create this later)
34
+ resolvedPath = path.join(path.dirname(import.meta.url.replace("file://", "")), "../../templates/default");
35
+ this.logger.debug(`Loading built-in default template`);
36
+ } else {
37
+ // Try to resolve as an npm package
38
+ try {
39
+ const packagePath = await this.resolveNodeModule(templatePath);
40
+ resolvedPath = packagePath;
41
+ this.logger.debug(`Loading npm template: ${templatePath}`);
42
+ } catch {
43
+ throw new Error(`Template not found: ${templatePath}`);
44
+ }
45
+ }
46
+
47
+ // Check if template directory exists
48
+ if (!(await fs.pathExists(resolvedPath))) {
49
+ throw new Error(`Template directory does not exist: ${resolvedPath}`);
50
+ }
51
+
52
+ // Load template configuration
53
+ const configPath = path.join(resolvedPath, "template.config.js");
54
+ if (!(await fs.pathExists(configPath))) {
55
+ throw new Error(`Template configuration not found: ${configPath}`);
56
+ }
57
+ const configUrl = pathToFileURL(configPath).href;
58
+ const {
59
+ default: config
60
+ } = await import(configUrl);
61
+ return {
62
+ config,
63
+ templateDir: resolvedPath
64
+ };
65
+ }
66
+ async resolveNodeModule(moduleName) {
67
+ try {
68
+ const require = (await import("module")).createRequire(import.meta.url);
69
+ const modulePath = require.resolve(moduleName);
70
+ const startDir = path.dirname(modulePath);
71
+ const packageJsonPath = await findUp(async directory => {
72
+ const pkgPath = path.join(directory, "package.json");
73
+ try {
74
+ const pkg = await fs.readJson(pkgPath);
75
+ if (pkg.name === moduleName) {
76
+ return pkgPath;
77
+ }
78
+ } catch {
79
+ return undefined;
80
+ }
81
+ return undefined;
82
+ }, {
83
+ cwd: startDir
84
+ });
85
+ if (packageJsonPath) {
86
+ return path.dirname(packageJsonPath);
87
+ }
88
+ throw new Error(`Package root not found for: ${moduleName}`);
89
+ } catch (error) {
90
+ this.logger.debug(`Failed to resolve via require.resolve: ${error instanceof Error ? error.message : String(error)}`);
91
+ const modulePath = path.join(process.cwd(), "node_modules", moduleName);
92
+ if (await fs.pathExists(modulePath)) {
93
+ return modulePath;
94
+ }
95
+ }
96
+ throw new Error(`Cannot resolve module: ${moduleName}`);
97
+ }
98
+ }
99
+ //# sourceMappingURL=templateLoader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templateLoader.js","names":["findUp","fs","path","pathToFileURL","TemplateLoader","constructor","logger","loadTemplate","templatePath","resolvedPath","startsWith","resolve","debug","join","dirname","import","meta","url","replace","packagePath","resolveNodeModule","Error","pathExists","configPath","configUrl","href","default","config","templateDir","moduleName","require","createRequire","modulePath","startDir","packageJsonPath","directory","pkgPath","pkg","readJson","name","undefined","cwd","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 { 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 (we'll create this later)\n resolvedPath = path.join(\n path.dirname(import.meta.url.replace(\"file://\", \"\")),\n \"../../templates/default\",\n );\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 resolveNodeModule(moduleName: string): Promise<string> {\n try {\n const require = (await import(\"module\")).createRequire(import.meta.url);\n const modulePath = require.resolve(moduleName);\n const startDir = path.dirname(modulePath);\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: startDir },\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,SAASC,aAAa,QAAQ,KAAK;AAInC,OAAO,MAAMC,cAAc,CAAC;EAC1BC,WAAWA,CAAkBC,MAAc,EAAE;IAAA,KAAhBA,MAAc,GAAdA,MAAc;EAAG;EAE9C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1D,CAAC;MAED,MAAMV,UAAU,GAAG9B,IAAI,CAACW,IAAI,CAACgC,OAAO,CAACJ,GAAG,CAAC,CAAC,EAAE,cAAc,EAAEZ,UAAU,CAAC;MACvE,IAAI,MAAM5B,EAAE,CAACqB,UAAU,CAACU,UAAU,CAAC,EAAE;QACnC,OAAOA,UAAU;MACnB;IACF;IAEA,MAAM,IAAIX,KAAK,CAAC,0BAA0BQ,UAAU,EAAE,CAAC;EACzD;AACF","ignoreList":[]}
@@ -0,0 +1,26 @@
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 { cli } from "./cli.js";
18
+ export { createCommand } from "./commands/create.js";
19
+ export { ContextBuilder } from "./core/contextBuilder.js";
20
+ export { Generator } from "./core/generator.js";
21
+ export { SchemaParser } from "./core/schemaParser.js";
22
+ export { TemplateLoader } from "./core/templateLoader.js";
23
+ export { Logger } from "./utils/logger.js";
24
+ export { promptUser } from "./utils/prompts.js";
25
+ export { createTemplateUtils } from "./utils/templateUtils.js";
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["cli","createCommand","ContextBuilder","Generator","SchemaParser","TemplateLoader","Logger","promptUser","createTemplateUtils"],"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 { cli } from \"./cli.js\";\nexport { createCommand } from \"./commands/create.js\";\nexport { ContextBuilder } from \"./core/contextBuilder.js\";\nexport { Generator } from \"./core/generator.js\";\nexport { SchemaParser } from \"./core/schemaParser.js\";\nexport { TemplateLoader } from \"./core/templateLoader.js\";\nexport type * from \"./types/index.js\";\nexport { Logger } from \"./utils/logger.js\";\nexport { promptUser } from \"./utils/prompts.js\";\nexport { createTemplateUtils } from \"./utils/templateUtils.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,GAAG,QAAQ,UAAU;AAC9B,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,cAAc,QAAQ,0BAA0B;AAEzD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,mBAAmB,QAAQ,0BAA0B","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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":[]}
@@ -0,0 +1,72 @@
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
@@ -0,0 +1 @@
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}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,EAAE,MAAM,UAAU;AACzB,SAASC,IAAI,QAAQ,MAAM;AAC3B,OAAOC,IAAI,MAAM,MAAM;AAEvB,OAAO,eAAeC,SAASA,CAC7BC,MAAc,EACdC,WAAmB,EACnBC,QAA2B,EAC3BC,MAAe,GAAG,KAAK,EACR;EACf;EACA,MAAMC,eAAe,GAAGF,QAAQ,CAACG,MAAM,CAACC,CAAC,IAAI,CAACA,CAAC,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AAMP,EAAE,CAAC2B,SAAS,CAACzB,IAAI,CAAC0B,OAAO,CAACI,QAAQ,CAAC,CAAC;IAC1C,MAAMhC,EAAE,CAAC+B,SAAS,CAACC,QAAQ,EAAEC,OAAO,EAAE,MAAM,CAAC;EAC/C;AACF;AAEA,OAAO,eAAeC,QAAQA,CAACF,QAAgB,EAAmB;EAChE,OAAOhC,EAAE,CAACkC,QAAQ,CAACF,QAAQ,EAAE,MAAM,CAAC;AACtC;AAEA,OAAO,eAAeG,UAAUA,CAACH,QAAgB,EAAoB;EACnE,OAAOhC,EAAE,CAACmC,UAAU,CAACH,QAAQ,CAAC;AAChC;AAEA,OAAO,eAAeI,QAAQA,CAACJ,QAAgB,EAAoB;EACjE,OAAOhC,EAAE,CAACoC,QAAQ,CAACJ,QAAQ,CAAC;AAC9B;AAEA,OAAO,eAAeK,SAASA,CAC7BL,QAAgB,EAChBM,IAAa,EACb/B,MAAe,GAAG,KAAK,EACR;EACf,IAAI,CAACA,MAAM,EAAE;IACX,MAAMP,EAAE,CAAC2B,SAAS,CAACzB,IAAI,CAAC0B,OAAO,CAACI,QAAQ,CAAC,CAAC;IAC1C,MAAMhC,EAAE,CAACqC,SAAS,CAACL,QAAQ,EAAEM,IAAI,EAAE;MAAEC,MAAM,EAAE;IAAE,CAAC,CAAC;EACnD;AACF","ignoreList":[]}
@@ -0,0 +1,44 @@
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 { 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
@@ -0,0 +1 @@
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":[]}
@@ -0,0 +1,25 @@
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
@@ -0,0 +1 @@
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":[]}
@@ -0,0 +1,61 @@
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
@@ -0,0 +1 @@
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,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;MAAA,CACnBA,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;MAAA,CAC3BI,IAAI,CAAC,CAAC;MACT;MACA,OA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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":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=createCommand.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createCommand.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/createCommand.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generator.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/generator.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=schemaParser.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaParser.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/schemaParser.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=templateLoader.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templateLoader.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/templateLoader.test.ts"],"names":[],"mappings":""}