@palantir/pack.sdkgen 0.5.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.
Files changed (61) hide show
  1. package/build/esm/__tests__/generator.test.js +1 -5
  2. package/build/esm/__tests__/generator.test.js.map +1 -1
  3. package/build/esm/__tests__/templateLoader.test.js +5 -4
  4. package/build/esm/__tests__/templateLoader.test.js.map +1 -1
  5. package/build/esm/commands/create.js +28 -151
  6. package/build/esm/commands/create.js.map +1 -1
  7. package/build/esm/index.js +1 -7
  8. package/build/esm/index.js.map +1 -1
  9. package/build/types/commands/create.d.ts +1 -1
  10. package/build/types/commands/create.d.ts.map +1 -1
  11. package/build/types/index.d.ts +2 -8
  12. package/build/types/index.d.ts.map +1 -1
  13. package/package.json +3 -8
  14. package/build/esm/__tests__/schemaParser.test.js +0 -67
  15. package/build/esm/__tests__/schemaParser.test.js.map +0 -1
  16. package/build/esm/__tests__/templateUtils.test.js +0 -94
  17. package/build/esm/__tests__/templateUtils.test.js.map +0 -1
  18. package/build/esm/core/contextBuilder.js +0 -33
  19. package/build/esm/core/contextBuilder.js.map +0 -1
  20. package/build/esm/core/generator.js +0 -248
  21. package/build/esm/core/generator.js.map +0 -1
  22. package/build/esm/core/hookRunner.js +0 -68
  23. package/build/esm/core/hookRunner.js.map +0 -1
  24. package/build/esm/core/schemaParser.js +0 -50
  25. package/build/esm/core/schemaParser.js.map +0 -1
  26. package/build/esm/core/templateLoader.js +0 -109
  27. package/build/esm/core/templateLoader.js.map +0 -1
  28. package/build/esm/types/index.js +0 -2
  29. package/build/esm/types/index.js.map +0 -1
  30. package/build/esm/utils/fileSystem.js +0 -72
  31. package/build/esm/utils/fileSystem.js.map +0 -1
  32. package/build/esm/utils/logger.js +0 -44
  33. package/build/esm/utils/logger.js.map +0 -1
  34. package/build/esm/utils/prompts.js +0 -25
  35. package/build/esm/utils/prompts.js.map +0 -1
  36. package/build/esm/utils/templateUtils.js +0 -61
  37. package/build/esm/utils/templateUtils.js.map +0 -1
  38. package/build/types/__tests__/schemaParser.test.d.ts +0 -2
  39. package/build/types/__tests__/schemaParser.test.d.ts.map +0 -1
  40. package/build/types/__tests__/templateUtils.test.d.ts +0 -2
  41. package/build/types/__tests__/templateUtils.test.d.ts.map +0 -1
  42. package/build/types/core/contextBuilder.d.ts +0 -5
  43. package/build/types/core/contextBuilder.d.ts.map +0 -1
  44. package/build/types/core/generator.d.ts +0 -15
  45. package/build/types/core/generator.d.ts.map +0 -1
  46. package/build/types/core/hookRunner.d.ts +0 -3
  47. package/build/types/core/hookRunner.d.ts.map +0 -1
  48. package/build/types/core/schemaParser.d.ts +0 -7
  49. package/build/types/core/schemaParser.d.ts.map +0 -1
  50. package/build/types/core/templateLoader.d.ts +0 -13
  51. package/build/types/core/templateLoader.d.ts.map +0 -1
  52. package/build/types/types/index.d.ts +0 -68
  53. package/build/types/types/index.d.ts.map +0 -1
  54. package/build/types/utils/fileSystem.d.ts +0 -8
  55. package/build/types/utils/fileSystem.d.ts.map +0 -1
  56. package/build/types/utils/logger.d.ts +0 -11
  57. package/build/types/utils/logger.d.ts.map +0 -1
  58. package/build/types/utils/prompts.d.ts +0 -3
  59. package/build/types/utils/prompts.d.ts.map +0 -1
  60. package/build/types/utils/templateUtils.d.ts +0 -3
  61. package/build/types/utils/templateUtils.d.ts.map +0 -1
@@ -1,94 +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 { describe, expect, it } from "vitest";
18
- import { createTemplateUtils } from "../utils/templateUtils.js";
19
- describe("templateUtils", () => {
20
- const utils = createTemplateUtils();
21
- describe("camelCase", () => {
22
- it("should convert to camelCase", () => {
23
- expect(utils.camelCase("hello-world")).toBe("helloWorld");
24
- expect(utils.camelCase("hello_world")).toBe("helloWorld");
25
- expect(utils.camelCase("Hello World")).toBe("helloWorld");
26
- expect(utils.camelCase("HelloWorld")).toBe("helloWorld");
27
- expect(utils.camelCase("HELLO_WORLD")).toBe("helloWorld");
28
- });
29
- });
30
- describe("pascalCase", () => {
31
- it("should convert to PascalCase", () => {
32
- expect(utils.pascalCase("hello-world")).toBe("HelloWorld");
33
- expect(utils.pascalCase("hello_world")).toBe("HelloWorld");
34
- expect(utils.pascalCase("hello world")).toBe("HelloWorld");
35
- expect(utils.pascalCase("helloWorld")).toBe("HelloWorld");
36
- });
37
- });
38
- describe("kebabCase", () => {
39
- it("should convert to kebab-case", () => {
40
- expect(utils.kebabCase("HelloWorld")).toBe("hello-world");
41
- expect(utils.kebabCase("helloWorld")).toBe("hello-world");
42
- expect(utils.kebabCase("hello_world")).toBe("hello-world");
43
- expect(utils.kebabCase("Hello World")).toBe("hello-world");
44
- });
45
- });
46
- describe("snakeCase", () => {
47
- it("should convert to snake_case", () => {
48
- expect(utils.snakeCase("HelloWorld")).toBe("hello_world");
49
- expect(utils.snakeCase("helloWorld")).toBe("hello_world");
50
- expect(utils.snakeCase("hello-world")).toBe("hello_world");
51
- expect(utils.snakeCase("Hello World")).toBe("hello_world");
52
- });
53
- });
54
- describe("pluralize", () => {
55
- it("should pluralize words", () => {
56
- expect(utils.pluralize("user")).toBe("users");
57
- expect(utils.pluralize("users")).toBe("users");
58
- expect(utils.pluralize("city")).toBe("cities");
59
- expect(utils.pluralize("box")).toBe("boxes");
60
- expect(utils.pluralize("church")).toBe("churches");
61
- expect(utils.pluralize("bush")).toBe("bushes");
62
- });
63
- });
64
- describe("singularize", () => {
65
- it("should singularize words", () => {
66
- expect(utils.singularize("users")).toBe("user");
67
- expect(utils.singularize("cities")).toBe("city");
68
- /* cspell:disable-next-line */
69
- expect(utils.singularize("boxes")).toBe("boxe");
70
- /* cspell:disable-next-line */
71
- expect(utils.singularize("churches")).toBe("churche");
72
- });
73
- });
74
- describe("capitalize", () => {
75
- it("should capitalize first letter", () => {
76
- expect(utils.capitalize("hello")).toBe("Hello");
77
- expect(utils.capitalize("HELLO")).toBe("HELLO");
78
- expect(utils.capitalize("hello world")).toBe("Hello world");
79
- });
80
- });
81
- describe("lower", () => {
82
- it("should convert to lowercase", () => {
83
- expect(utils.lower("HELLO")).toBe("hello");
84
- expect(utils.lower("Hello World")).toBe("hello world");
85
- });
86
- });
87
- describe("upper", () => {
88
- it("should convert to uppercase", () => {
89
- expect(utils.upper("hello")).toBe("HELLO");
90
- expect(utils.upper("Hello World")).toBe("HELLO WORLD");
91
- });
92
- });
93
- });
94
- //# sourceMappingURL=templateUtils.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"templateUtils.test.js","names":["describe","expect","it","createTemplateUtils","utils","camelCase","toBe","pascalCase","kebabCase","snakeCase","pluralize","singularize","capitalize","lower","upper"],"sources":["templateUtils.test.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 { describe, expect, it } from \"vitest\";\nimport { createTemplateUtils } from \"../utils/templateUtils.js\";\n\ndescribe(\"templateUtils\", () => {\n const utils = createTemplateUtils();\n\n describe(\"camelCase\", () => {\n it(\"should convert to camelCase\", () => {\n expect(utils.camelCase(\"hello-world\")).toBe(\"helloWorld\");\n expect(utils.camelCase(\"hello_world\")).toBe(\"helloWorld\");\n expect(utils.camelCase(\"Hello World\")).toBe(\"helloWorld\");\n expect(utils.camelCase(\"HelloWorld\")).toBe(\"helloWorld\");\n expect(utils.camelCase(\"HELLO_WORLD\")).toBe(\"helloWorld\");\n });\n });\n\n describe(\"pascalCase\", () => {\n it(\"should convert to PascalCase\", () => {\n expect(utils.pascalCase(\"hello-world\")).toBe(\"HelloWorld\");\n expect(utils.pascalCase(\"hello_world\")).toBe(\"HelloWorld\");\n expect(utils.pascalCase(\"hello world\")).toBe(\"HelloWorld\");\n expect(utils.pascalCase(\"helloWorld\")).toBe(\"HelloWorld\");\n });\n });\n\n describe(\"kebabCase\", () => {\n it(\"should convert to kebab-case\", () => {\n expect(utils.kebabCase(\"HelloWorld\")).toBe(\"hello-world\");\n expect(utils.kebabCase(\"helloWorld\")).toBe(\"hello-world\");\n expect(utils.kebabCase(\"hello_world\")).toBe(\"hello-world\");\n expect(utils.kebabCase(\"Hello World\")).toBe(\"hello-world\");\n });\n });\n\n describe(\"snakeCase\", () => {\n it(\"should convert to snake_case\", () => {\n expect(utils.snakeCase(\"HelloWorld\")).toBe(\"hello_world\");\n expect(utils.snakeCase(\"helloWorld\")).toBe(\"hello_world\");\n expect(utils.snakeCase(\"hello-world\")).toBe(\"hello_world\");\n expect(utils.snakeCase(\"Hello World\")).toBe(\"hello_world\");\n });\n });\n\n describe(\"pluralize\", () => {\n it(\"should pluralize words\", () => {\n expect(utils.pluralize(\"user\")).toBe(\"users\");\n expect(utils.pluralize(\"users\")).toBe(\"users\");\n expect(utils.pluralize(\"city\")).toBe(\"cities\");\n expect(utils.pluralize(\"box\")).toBe(\"boxes\");\n expect(utils.pluralize(\"church\")).toBe(\"churches\");\n expect(utils.pluralize(\"bush\")).toBe(\"bushes\");\n });\n });\n\n describe(\"singularize\", () => {\n it(\"should singularize words\", () => {\n expect(utils.singularize(\"users\")).toBe(\"user\");\n expect(utils.singularize(\"cities\")).toBe(\"city\");\n /* cspell:disable-next-line */\n expect(utils.singularize(\"boxes\")).toBe(\"boxe\");\n /* cspell:disable-next-line */\n expect(utils.singularize(\"churches\")).toBe(\"churche\");\n });\n });\n\n describe(\"capitalize\", () => {\n it(\"should capitalize first letter\", () => {\n expect(utils.capitalize(\"hello\")).toBe(\"Hello\");\n expect(utils.capitalize(\"HELLO\")).toBe(\"HELLO\");\n expect(utils.capitalize(\"hello world\")).toBe(\"Hello world\");\n });\n });\n\n describe(\"lower\", () => {\n it(\"should convert to lowercase\", () => {\n expect(utils.lower(\"HELLO\")).toBe(\"hello\");\n expect(utils.lower(\"Hello World\")).toBe(\"hello world\");\n });\n });\n\n describe(\"upper\", () => {\n it(\"should convert to uppercase\", () => {\n expect(utils.upper(\"hello\")).toBe(\"HELLO\");\n expect(utils.upper(\"Hello World\")).toBe(\"HELLO WORLD\");\n });\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,mBAAmB,QAAQ,2BAA2B;AAE/DH,QAAQ,CAAC,eAAe,EAAE,MAAM;EAC9B,MAAMI,KAAK,GAAGD,mBAAmB,CAAC,CAAC;EAEnCH,QAAQ,CAAC,WAAW,EAAE,MAAM;IAC1BE,EAAE,CAAC,6BAA6B,EAAE,MAAM;MACtCD,MAAM,CAACG,KAAK,CAACC,SAAS,CAAC,aAAa,CAAC,CAAC,CAACC,IAAI,CAAC,YAAY,CAAC;MACzDL,MAAM,CAACG,KAAK,CAACC,SAAS,CAAC,aAAa,CAAC,CAAC,CAACC,IAAI,CAAC,YAAY,CAAC;MACzDL,MAAM,CAACG,KAAK,CAACC,SAAS,CAAC,aAAa,CAAC,CAAC,CAACC,IAAI,CAAC,YAAY,CAAC;MACzDL,MAAM,CAACG,KAAK,CAACC,SAAS,CAAC,YAAY,CAAC,CAAC,CAACC,IA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AC,CAAC,CAACR,IAAI,CAAC,aAAa,CAAC;IACxD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,33 +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 { createTemplateUtils } from "../utils/templateUtils.js";
18
- export class ContextBuilder {
19
- build(projectName, schema, answers, templateConfig, outputPath, options, schemaPath) {
20
- return {
21
- projectName,
22
- schema,
23
- answers,
24
- templateConfig,
25
- schemaPath,
26
- outputPath,
27
- options,
28
- utils: createTemplateUtils(),
29
- additionalData: {}
30
- };
31
- }
32
- }
33
- //# sourceMappingURL=contextBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contextBuilder.js","names":["createTemplateUtils","ContextBuilder","build","projectName","schema","answers","templateConfig","outputPath","options","schemaPath","utils","additionalData"],"sources":["contextBuilder.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 { GeneratorContext, GeneratorOptions, TemplateConfig } from \"../types/index.js\";\nimport { createTemplateUtils } from \"../utils/templateUtils.js\";\n\nexport class ContextBuilder {\n build(\n projectName: string,\n schema: unknown,\n answers: Record<string, unknown>,\n templateConfig: TemplateConfig,\n outputPath: string,\n options: GeneratorOptions,\n schemaPath?: string,\n ): GeneratorContext {\n return {\n projectName,\n schema,\n answers,\n templateConfig,\n schemaPath,\n outputPath,\n options,\n utils: createTemplateUtils(),\n additionalData: {},\n };\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,mBAAmB,QAAQ,2BAA2B;AAE/D,OAAO,MAAMC,cAAc,CAAC;EAC1BC,KAAKA,CACHC,WAAmB,EACnBC,MAAe,EACfC,OAAgC,EAChCC,cAA8B,EAC9BC,UAAkB,EAClBC,OAAyB,EACzBC,UAAmB,EACD;IAClB,OAAO;MACLN,WAAW;MACXC,MAAM;MACNC,OAAO;MACPC,cAAc;MACdG,UAAU;MACVF,UAAU;MACVC,OAAO;MACPE,KAAK,EAAEV,mBAAmB,CAAC,CAAC;MAC5BW,cAAc,EAAE,CAAC;IACnB,CAAC;EACH;AACF","ignoreList":[]}
@@ -1,248 +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 { spawnSync } from "child_process";
18
- import ejs from "ejs";
19
- import { findUp } from "find-up";
20
- import fs from "fs-extra";
21
- import { glob } from "glob";
22
- import path from "path";
23
- import { fileURLToPath } from "url";
24
- import * as fileSystem from "../utils/fileSystem.js";
25
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
26
- export class Generator {
27
- constructor(context, templateDir, logger) {
28
- this.context = context;
29
- this.templateDir = templateDir;
30
- this.logger = logger;
31
- }
32
- async generate() {
33
- const {
34
- outputPath,
35
- options
36
- } = this.context;
37
-
38
- // Create output directory
39
- if (!options.dryRun) {
40
- await fs.ensureDir(outputPath);
41
- }
42
-
43
- // Run beforeGenerate hook
44
- await this.runHook("beforeGenerate");
45
-
46
- // Process template files
47
- await this.processTemplateFiles();
48
-
49
- // Copy static files
50
- await this.copyStaticFiles();
51
-
52
- // Copy schema directory if provided
53
- await this.copySchemaDirectory();
54
-
55
- // Run afterGenerate hook
56
- await this.runHook("afterGenerate");
57
-
58
- // Install dependencies if not skipped
59
- if (!options.skipInstall && !options.dryRun) {
60
- await this.installDependencies();
61
- }
62
- this.logger.success(`✨ SDK generated successfully at ${outputPath}`);
63
- }
64
- async processTemplateFiles() {
65
- const {
66
- templateConfig,
67
- outputPath,
68
- options
69
- } = this.context;
70
- const templateFiles = templateConfig.templateFiles || ["**/*.ejs"];
71
- const templatePath = path.join(this.templateDir, "template");
72
- for (const pattern of templateFiles) {
73
- const files = glob.globSync(pattern, {
74
- cwd: templatePath,
75
- nodir: true,
76
- dot: true
77
- });
78
- for (const file of files) {
79
- const sourcePath = path.join(templatePath, file);
80
- const destPath = path.join(outputPath, file.replace(/\.ejs$/, ""));
81
- this.logger.debug(`Processing template: ${file}`);
82
-
83
- // Read and render template
84
- const template = await fs.readFile(sourcePath, "utf8");
85
- const rendered = ejs.render(template, this.context);
86
-
87
- // Write rendered file
88
- if (!options.dryRun) {
89
- await fileSystem.writeFile(destPath, rendered);
90
- } else {
91
- this.logger.debug(`Would write to: ${destPath}`);
92
- }
93
- }
94
- }
95
- }
96
- async copyStaticFiles() {
97
- const {
98
- templateConfig,
99
- outputPath,
100
- options
101
- } = this.context;
102
- const staticFiles = templateConfig.staticFiles || [];
103
- const templatePath = path.join(this.templateDir, "template");
104
- if (staticFiles.length === 0) {
105
- return;
106
- }
107
- await fileSystem.copyFiles(templatePath, outputPath, staticFiles, options.dryRun);
108
- }
109
- async copySchemaDirectory() {
110
- const {
111
- schemaPath,
112
- outputPath,
113
- options
114
- } = this.context;
115
- if (!schemaPath) {
116
- return;
117
- }
118
- const schemaStats = await fs.stat(schemaPath).catch(() => null);
119
- if (!schemaStats) {
120
- return;
121
- }
122
- const destSchemaPath = path.join(outputPath, "schema");
123
- if (schemaStats.isDirectory()) {
124
- // Copy entire schema directory
125
- if (!options.dryRun) {
126
- await fs.ensureDir(destSchemaPath);
127
- await fs.copy(schemaPath, destSchemaPath);
128
- this.logger.debug(`Copied schema directory to ${destSchemaPath}`);
129
- } else {
130
- this.logger.debug(`Would copy schema directory to ${destSchemaPath}`);
131
- }
132
- } else if (schemaStats.isFile()) {
133
- // Copy single schema file
134
- if (!options.dryRun) {
135
- await fs.ensureDir(destSchemaPath);
136
- const fileName = path.basename(schemaPath);
137
- await fs.copy(schemaPath, path.join(destSchemaPath, fileName));
138
- this.logger.debug(`Copied schema file to ${destSchemaPath}`);
139
- } else {
140
- this.logger.debug(`Would copy schema file to ${destSchemaPath}`);
141
- }
142
- }
143
- }
144
- async runHook(hookName) {
145
- const {
146
- templateConfig
147
- } = this.context;
148
- const hook = templateConfig.hooks?.[hookName];
149
- if (!hook) {
150
- return;
151
- }
152
- this.logger.debug(`Running ${hookName} hook`);
153
- if (typeof hook === "string") {
154
- // Execute hook as child process
155
- const hookPath = path.join(this.templateDir, hook);
156
- if (await fs.pathExists(hookPath)) {
157
- try {
158
- // Find the package root by locating package.json
159
- const packageJsonPath = await findUp("package.json", {
160
- cwd: __dirname
161
- });
162
- if (!packageJsonPath) {
163
- throw new Error("Could not find package.json");
164
- }
165
- const packageRoot = path.dirname(packageJsonPath);
166
- const hookRunnerPath = path.join(packageRoot, "build/esm/core/hookRunner.js");
167
- if (!(await fs.pathExists(hookRunnerPath))) {
168
- throw new Error(`Hook runner not found at ${hookRunnerPath}. ` + `Please run 'pnpm build' in the sdkgen-cli package.`);
169
- }
170
-
171
- // Serialize context to JSON
172
- const contextJson = JSON.stringify(this.context);
173
-
174
- // Run hook as child process in template directory
175
- // Use spawnSync for better output streaming
176
- const result = spawnSync("node", [hookRunnerPath, hookPath, hookName, contextJson], {
177
- cwd: this.templateDir,
178
- encoding: "utf8",
179
- // 'inherit' for stderr allows errors to stream immediately
180
- // 'pipe' for stdout so we can capture the result for beforeGenerate
181
- stdio: ["pipe", "pipe", "inherit"]
182
- });
183
- if (result.error) {
184
- throw result.error;
185
- }
186
- if (result.status !== 0) {
187
- throw new Error(`Hook ${hookName} failed with exit code ${result.status}`);
188
- }
189
-
190
- // Parse result and update context if needed
191
- if (hookName === "beforeGenerate" && result.stdout) {
192
- try {
193
- const updatedContext = JSON.parse(result.stdout);
194
- this.context = updatedContext;
195
- } catch {
196
- // If result is not valid JSON, ignore it
197
- this.logger.debug("Hook did not return valid JSON, keeping original context");
198
- }
199
- }
200
- } catch (error) {
201
- this.logger.error(`Failed to execute ${hookName} hook: ${error instanceof Error ? error.message : String(error)}`);
202
- throw error;
203
- }
204
- } else {
205
- this.logger.warning(`Hook file not found: ${hookPath}`);
206
- }
207
- } else if (typeof hook === "function") {
208
- // Execute inline hook (for backward compatibility and testing)
209
- if (hookName === "beforeGenerate") {
210
- const result = await hook(this.context);
211
- this.context = result;
212
- } else {
213
- await hook(this.context, this.context.outputPath);
214
- }
215
- }
216
- }
217
- async installDependencies() {
218
- const {
219
- outputPath,
220
- projectName
221
- } = this.context;
222
- this.logger.info("Installing dependencies...");
223
-
224
- // Check which package manager to use
225
- const hasPackageJson = await fs.pathExists(path.join(outputPath, "package.json"));
226
- if (!hasPackageJson) {
227
- this.logger.debug("No package.json found, skipping dependency installation");
228
- return;
229
- }
230
-
231
- // Detect package manager (simplified - just use npm for now)
232
- try {
233
- const result = spawnSync("npm", ["install"], {
234
- cwd: outputPath,
235
- stdio: "inherit"
236
- });
237
- if (result.status === 0) {
238
- this.logger.success("Dependencies installed successfully");
239
- } else {
240
- throw new Error(`npm install failed with exit code ${result.status}`);
241
- }
242
- } catch (_error) {
243
- this.logger.warning("Failed to install dependencies automatically");
244
- this.logger.info(`Please run 'npm install' in ${projectName} directory`);
245
- }
246
- }
247
- }
248
- //# sourceMappingURL=generator.js.map
@@ -1 +0,0 @@
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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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AM,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":[]}
@@ -1,68 +0,0 @@
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
@@ -1 +0,0 @@
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":[]}
@@ -1,50 +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 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
@@ -1 +0,0 @@
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,CA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