@geekmidas/cli 0.10.0 → 0.13.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 (146) hide show
  1. package/README.md +525 -0
  2. package/dist/bundler-B1qy9b-j.cjs +112 -0
  3. package/dist/bundler-B1qy9b-j.cjs.map +1 -0
  4. package/dist/bundler-DskIqW2t.mjs +111 -0
  5. package/dist/bundler-DskIqW2t.mjs.map +1 -0
  6. package/dist/{config-C9aXOHBe.cjs → config-AmInkU7k.cjs} +8 -8
  7. package/dist/config-AmInkU7k.cjs.map +1 -0
  8. package/dist/{config-BrkUalUh.mjs → config-DYULeEv8.mjs} +3 -3
  9. package/dist/config-DYULeEv8.mjs.map +1 -0
  10. package/dist/config.cjs +1 -1
  11. package/dist/config.d.cts +1 -1
  12. package/dist/config.d.mts +1 -1
  13. package/dist/config.mjs +1 -1
  14. package/dist/encryption-C8H-38Yy.mjs +42 -0
  15. package/dist/encryption-C8H-38Yy.mjs.map +1 -0
  16. package/dist/encryption-Dyf_r1h-.cjs +44 -0
  17. package/dist/encryption-Dyf_r1h-.cjs.map +1 -0
  18. package/dist/index.cjs +2123 -179
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.mjs +2141 -192
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/{openapi-CZLI4QTr.mjs → openapi-BfFlOBCG.mjs} +801 -38
  23. package/dist/openapi-BfFlOBCG.mjs.map +1 -0
  24. package/dist/{openapi-BeHLKcwP.cjs → openapi-Bt_1FDpT.cjs} +794 -31
  25. package/dist/openapi-Bt_1FDpT.cjs.map +1 -0
  26. package/dist/{openapi-react-query-o5iMi8tz.cjs → openapi-react-query-B-sNWHFU.cjs} +5 -5
  27. package/dist/openapi-react-query-B-sNWHFU.cjs.map +1 -0
  28. package/dist/{openapi-react-query-CcciaVu5.mjs → openapi-react-query-B6XTeGqS.mjs} +5 -5
  29. package/dist/openapi-react-query-B6XTeGqS.mjs.map +1 -0
  30. package/dist/openapi-react-query.cjs +1 -1
  31. package/dist/openapi-react-query.d.cts.map +1 -1
  32. package/dist/openapi-react-query.d.mts.map +1 -1
  33. package/dist/openapi-react-query.mjs +1 -1
  34. package/dist/openapi.cjs +2 -2
  35. package/dist/openapi.d.cts +1 -1
  36. package/dist/openapi.d.cts.map +1 -1
  37. package/dist/openapi.d.mts +1 -1
  38. package/dist/openapi.d.mts.map +1 -1
  39. package/dist/openapi.mjs +2 -2
  40. package/dist/storage-BOOpAF8N.cjs +5 -0
  41. package/dist/storage-Bj1E26lU.cjs +187 -0
  42. package/dist/storage-Bj1E26lU.cjs.map +1 -0
  43. package/dist/storage-kSxTjkNb.mjs +133 -0
  44. package/dist/storage-kSxTjkNb.mjs.map +1 -0
  45. package/dist/storage-tgZSUnKl.mjs +3 -0
  46. package/dist/{types-b-vwGpqc.d.cts → types-BR0M2v_c.d.mts} +100 -1
  47. package/dist/types-BR0M2v_c.d.mts.map +1 -0
  48. package/dist/{types-DXgiA1sF.d.mts → types-BhkZc-vm.d.cts} +100 -1
  49. package/dist/types-BhkZc-vm.d.cts.map +1 -0
  50. package/examples/cron-example.ts +27 -27
  51. package/examples/env.ts +27 -27
  52. package/examples/function-example.ts +31 -31
  53. package/examples/gkm.config.json +20 -20
  54. package/examples/gkm.config.ts +8 -8
  55. package/examples/gkm.minimal.config.json +5 -5
  56. package/examples/gkm.production.config.json +25 -25
  57. package/examples/logger.ts +2 -2
  58. package/package.json +6 -6
  59. package/src/__tests__/EndpointGenerator.hooks.spec.ts +191 -191
  60. package/src/__tests__/config.spec.ts +55 -55
  61. package/src/__tests__/loadEnvFiles.spec.ts +93 -93
  62. package/src/__tests__/normalizeHooksConfig.spec.ts +58 -58
  63. package/src/__tests__/openapi-react-query.spec.ts +497 -497
  64. package/src/__tests__/openapi.spec.ts +428 -428
  65. package/src/__tests__/test-helpers.ts +76 -76
  66. package/src/auth/__tests__/credentials.spec.ts +204 -0
  67. package/src/auth/__tests__/index.spec.ts +168 -0
  68. package/src/auth/credentials.ts +187 -0
  69. package/src/auth/index.ts +226 -0
  70. package/src/build/__tests__/bundler.spec.ts +444 -0
  71. package/src/build/__tests__/index-new.spec.ts +474 -474
  72. package/src/build/__tests__/manifests.spec.ts +333 -333
  73. package/src/build/bundler.ts +210 -0
  74. package/src/build/endpoint-analyzer.ts +236 -0
  75. package/src/build/handler-templates.ts +1253 -0
  76. package/src/build/index.ts +260 -179
  77. package/src/build/manifests.ts +52 -52
  78. package/src/build/providerResolver.ts +145 -145
  79. package/src/build/types.ts +64 -43
  80. package/src/config.ts +39 -39
  81. package/src/deploy/__tests__/docker.spec.ts +111 -0
  82. package/src/deploy/__tests__/dokploy.spec.ts +245 -0
  83. package/src/deploy/__tests__/init.spec.ts +662 -0
  84. package/src/deploy/docker.ts +128 -0
  85. package/src/deploy/dokploy.ts +204 -0
  86. package/src/deploy/index.ts +136 -0
  87. package/src/deploy/init.ts +484 -0
  88. package/src/deploy/types.ts +48 -0
  89. package/src/dev/__tests__/index.spec.ts +266 -266
  90. package/src/dev/index.ts +647 -601
  91. package/src/docker/__tests__/compose.spec.ts +531 -0
  92. package/src/docker/__tests__/templates.spec.ts +280 -0
  93. package/src/docker/compose.ts +273 -0
  94. package/src/docker/index.ts +230 -0
  95. package/src/docker/templates.ts +446 -0
  96. package/src/generators/CronGenerator.ts +72 -72
  97. package/src/generators/EndpointGenerator.ts +699 -398
  98. package/src/generators/FunctionGenerator.ts +84 -84
  99. package/src/generators/Generator.ts +72 -72
  100. package/src/generators/OpenApiTsGenerator.ts +577 -577
  101. package/src/generators/SubscriberGenerator.ts +124 -124
  102. package/src/generators/__tests__/CronGenerator.spec.ts +433 -433
  103. package/src/generators/__tests__/EndpointGenerator.spec.ts +532 -382
  104. package/src/generators/__tests__/FunctionGenerator.spec.ts +244 -244
  105. package/src/generators/__tests__/SubscriberGenerator.spec.ts +397 -382
  106. package/src/generators/index.ts +4 -4
  107. package/src/index.ts +623 -201
  108. package/src/init/__tests__/generators.spec.ts +334 -334
  109. package/src/init/__tests__/init.spec.ts +332 -332
  110. package/src/init/__tests__/utils.spec.ts +89 -89
  111. package/src/init/generators/config.ts +175 -175
  112. package/src/init/generators/docker.ts +41 -41
  113. package/src/init/generators/env.ts +72 -72
  114. package/src/init/generators/index.ts +1 -1
  115. package/src/init/generators/models.ts +64 -64
  116. package/src/init/generators/monorepo.ts +161 -161
  117. package/src/init/generators/package.ts +71 -71
  118. package/src/init/generators/source.ts +6 -6
  119. package/src/init/index.ts +203 -208
  120. package/src/init/templates/api.ts +115 -115
  121. package/src/init/templates/index.ts +75 -75
  122. package/src/init/templates/minimal.ts +98 -98
  123. package/src/init/templates/serverless.ts +89 -89
  124. package/src/init/templates/worker.ts +98 -98
  125. package/src/init/utils.ts +54 -56
  126. package/src/openapi-react-query.ts +194 -194
  127. package/src/openapi.ts +63 -63
  128. package/src/secrets/__tests__/encryption.spec.ts +226 -0
  129. package/src/secrets/__tests__/generator.spec.ts +319 -0
  130. package/src/secrets/__tests__/index.spec.ts +91 -0
  131. package/src/secrets/__tests__/storage.spec.ts +611 -0
  132. package/src/secrets/encryption.ts +91 -0
  133. package/src/secrets/generator.ts +164 -0
  134. package/src/secrets/index.ts +383 -0
  135. package/src/secrets/storage.ts +192 -0
  136. package/src/secrets/types.ts +53 -0
  137. package/src/types.ts +295 -176
  138. package/tsdown.config.ts +11 -8
  139. package/dist/config-BrkUalUh.mjs.map +0 -1
  140. package/dist/config-C9aXOHBe.cjs.map +0 -1
  141. package/dist/openapi-BeHLKcwP.cjs.map +0 -1
  142. package/dist/openapi-CZLI4QTr.mjs.map +0 -1
  143. package/dist/openapi-react-query-CcciaVu5.mjs.map +0 -1
  144. package/dist/openapi-react-query-o5iMi8tz.cjs.map +0 -1
  145. package/dist/types-DXgiA1sF.d.mts.map +0 -1
  146. package/dist/types-b-vwGpqc.d.cts.map +0 -1
@@ -1,131 +1,131 @@
1
1
  import type {
2
- GeneratedFile,
3
- TemplateConfig,
4
- TemplateOptions,
2
+ GeneratedFile,
3
+ TemplateConfig,
4
+ TemplateOptions,
5
5
  } from '../templates/index.js';
6
6
 
7
7
  /**
8
8
  * Generate monorepo root files (pnpm-workspace.yaml, root package.json, etc.)
9
9
  */
10
10
  export function generateMonorepoFiles(
11
- options: TemplateOptions,
12
- _template: TemplateConfig,
11
+ options: TemplateOptions,
12
+ _template: TemplateConfig,
13
13
  ): GeneratedFile[] {
14
- if (!options.monorepo) {
15
- return [];
16
- }
17
-
18
- // Root package.json for monorepo
19
- const rootPackageJson = {
20
- name: options.name,
21
- version: '0.0.1',
22
- private: true,
23
- type: 'module',
24
- scripts: {
25
- dev: 'turbo dev',
26
- build: 'turbo build',
27
- test: 'turbo test',
28
- 'test:once': 'turbo test:once',
29
- typecheck: 'turbo typecheck',
30
- lint: 'biome lint .',
31
- fmt: 'biome format . --write',
32
- 'fmt:check': 'biome format .',
33
- },
34
- devDependencies: {
35
- '@biomejs/biome': '~1.9.4',
36
- turbo: '~2.3.0',
37
- typescript: '~5.8.2',
38
- vitest: '~4.0.0',
39
- },
40
- };
41
-
42
- // pnpm-workspace.yaml - detect folder structure from apiPath
43
- const apiPathParts = options.apiPath.split('/');
44
- const appsFolder = apiPathParts[0] || 'apps';
45
-
46
- const pnpmWorkspace = `packages:
14
+ if (!options.monorepo) {
15
+ return [];
16
+ }
17
+
18
+ // Root package.json for monorepo
19
+ const rootPackageJson = {
20
+ name: options.name,
21
+ version: '0.0.1',
22
+ private: true,
23
+ type: 'module',
24
+ scripts: {
25
+ dev: 'turbo dev',
26
+ build: 'turbo build',
27
+ test: 'turbo test',
28
+ 'test:once': 'turbo test:once',
29
+ typecheck: 'turbo typecheck',
30
+ lint: 'biome lint .',
31
+ fmt: 'biome format . --write',
32
+ 'fmt:check': 'biome format .',
33
+ },
34
+ devDependencies: {
35
+ '@biomejs/biome': '~1.9.4',
36
+ turbo: '~2.3.0',
37
+ typescript: '~5.8.2',
38
+ vitest: '~4.0.0',
39
+ },
40
+ };
41
+
42
+ // pnpm-workspace.yaml - detect folder structure from apiPath
43
+ const apiPathParts = options.apiPath.split('/');
44
+ const appsFolder = apiPathParts[0] || 'apps';
45
+
46
+ const pnpmWorkspace = `packages:
47
47
  - '${appsFolder}/*'
48
48
  - 'packages/*'
49
49
  `;
50
50
 
51
- // Root biome.json
52
- const biomeConfig = {
53
- $schema: 'https://biomejs.dev/schemas/1.9.4/schema.json',
54
- vcs: {
55
- enabled: true,
56
- clientKind: 'git',
57
- useIgnoreFile: true,
58
- },
59
- organizeImports: {
60
- enabled: true,
61
- },
62
- formatter: {
63
- enabled: true,
64
- indentStyle: 'space',
65
- indentWidth: 2,
66
- lineWidth: 80,
67
- },
68
- javascript: {
69
- formatter: {
70
- quoteStyle: 'single',
71
- trailingCommas: 'all',
72
- semicolons: 'always',
73
- arrowParentheses: 'always',
74
- },
75
- },
76
- linter: {
77
- enabled: true,
78
- rules: {
79
- recommended: true,
80
- correctness: {
81
- noUnusedImports: 'error',
82
- noUnusedVariables: 'error',
83
- },
84
- style: {
85
- noNonNullAssertion: 'off',
86
- },
87
- },
88
- },
89
- files: {
90
- ignore: ['node_modules', 'dist', '.gkm', 'coverage'],
91
- },
92
- };
93
-
94
- // Root turbo.json
95
- const turboConfig = {
96
- $schema: 'https://turbo.build/schema.json',
97
- tasks: {
98
- build: {
99
- dependsOn: ['^build'],
100
- outputs: ['dist/**'],
101
- },
102
- dev: {
103
- cache: false,
104
- persistent: true,
105
- },
106
- test: {
107
- dependsOn: ['^build'],
108
- cache: false,
109
- },
110
- 'test:once': {
111
- dependsOn: ['^build'],
112
- outputs: ['coverage/**'],
113
- },
114
- typecheck: {
115
- dependsOn: ['^build'],
116
- outputs: [],
117
- },
118
- lint: {
119
- outputs: [],
120
- },
121
- fmt: {
122
- outputs: [],
123
- },
124
- },
125
- };
126
-
127
- // Root .gitignore
128
- const gitignore = `# Dependencies
51
+ // Root biome.json
52
+ const biomeConfig = {
53
+ $schema: 'https://biomejs.dev/schemas/1.9.4/schema.json',
54
+ vcs: {
55
+ enabled: true,
56
+ clientKind: 'git',
57
+ useIgnoreFile: true,
58
+ },
59
+ organizeImports: {
60
+ enabled: true,
61
+ },
62
+ formatter: {
63
+ enabled: true,
64
+ indentStyle: 'space',
65
+ indentWidth: 2,
66
+ lineWidth: 80,
67
+ },
68
+ javascript: {
69
+ formatter: {
70
+ quoteStyle: 'single',
71
+ trailingCommas: 'all',
72
+ semicolons: 'always',
73
+ arrowParentheses: 'always',
74
+ },
75
+ },
76
+ linter: {
77
+ enabled: true,
78
+ rules: {
79
+ recommended: true,
80
+ correctness: {
81
+ noUnusedImports: 'error',
82
+ noUnusedVariables: 'error',
83
+ },
84
+ style: {
85
+ noNonNullAssertion: 'off',
86
+ },
87
+ },
88
+ },
89
+ files: {
90
+ ignore: ['node_modules', 'dist', '.gkm', 'coverage'],
91
+ },
92
+ };
93
+
94
+ // Root turbo.json
95
+ const turboConfig = {
96
+ $schema: 'https://turbo.build/schema.json',
97
+ tasks: {
98
+ build: {
99
+ dependsOn: ['^build'],
100
+ outputs: ['dist/**'],
101
+ },
102
+ dev: {
103
+ cache: false,
104
+ persistent: true,
105
+ },
106
+ test: {
107
+ dependsOn: ['^build'],
108
+ cache: false,
109
+ },
110
+ 'test:once': {
111
+ dependsOn: ['^build'],
112
+ outputs: ['coverage/**'],
113
+ },
114
+ typecheck: {
115
+ dependsOn: ['^build'],
116
+ outputs: [],
117
+ },
118
+ lint: {
119
+ outputs: [],
120
+ },
121
+ fmt: {
122
+ outputs: [],
123
+ },
124
+ },
125
+ };
126
+
127
+ // Root .gitignore
128
+ const gitignore = `# Dependencies
129
129
  node_modules/
130
130
 
131
131
  # Build output
@@ -163,49 +163,49 @@ coverage/
163
163
  .turbo/
164
164
  `;
165
165
 
166
- // Root tsconfig.json - base config for all packages
167
- const tsConfig = {
168
- compilerOptions: {
169
- target: 'ES2022',
170
- module: 'NodeNext',
171
- moduleResolution: 'NodeNext',
172
- lib: ['ES2022'],
173
- strict: true,
174
- esModuleInterop: true,
175
- skipLibCheck: true,
176
- forceConsistentCasingInFileNames: true,
177
- resolveJsonModule: true,
178
- declaration: true,
179
- declarationMap: true,
180
- composite: true,
181
- },
182
- exclude: ['node_modules', 'dist'],
183
- };
184
-
185
- return [
186
- {
187
- path: 'package.json',
188
- content: JSON.stringify(rootPackageJson, null, 2) + '\n',
189
- },
190
- {
191
- path: 'pnpm-workspace.yaml',
192
- content: pnpmWorkspace,
193
- },
194
- {
195
- path: 'tsconfig.json',
196
- content: JSON.stringify(tsConfig, null, 2) + '\n',
197
- },
198
- {
199
- path: 'biome.json',
200
- content: JSON.stringify(biomeConfig, null, 2) + '\n',
201
- },
202
- {
203
- path: 'turbo.json',
204
- content: JSON.stringify(turboConfig, null, 2) + '\n',
205
- },
206
- {
207
- path: '.gitignore',
208
- content: gitignore,
209
- },
210
- ];
166
+ // Root tsconfig.json - base config for all packages
167
+ const tsConfig = {
168
+ compilerOptions: {
169
+ target: 'ES2022',
170
+ module: 'NodeNext',
171
+ moduleResolution: 'NodeNext',
172
+ lib: ['ES2022'],
173
+ strict: true,
174
+ esModuleInterop: true,
175
+ skipLibCheck: true,
176
+ forceConsistentCasingInFileNames: true,
177
+ resolveJsonModule: true,
178
+ declaration: true,
179
+ declarationMap: true,
180
+ composite: true,
181
+ },
182
+ exclude: ['node_modules', 'dist'],
183
+ };
184
+
185
+ return [
186
+ {
187
+ path: 'package.json',
188
+ content: `${JSON.stringify(rootPackageJson, null, 2)}\n`,
189
+ },
190
+ {
191
+ path: 'pnpm-workspace.yaml',
192
+ content: pnpmWorkspace,
193
+ },
194
+ {
195
+ path: 'tsconfig.json',
196
+ content: `${JSON.stringify(tsConfig, null, 2)}\n`,
197
+ },
198
+ {
199
+ path: 'biome.json',
200
+ content: `${JSON.stringify(biomeConfig, null, 2)}\n`,
201
+ },
202
+ {
203
+ path: 'turbo.json',
204
+ content: `${JSON.stringify(turboConfig, null, 2)}\n`,
205
+ },
206
+ {
207
+ path: '.gitignore',
208
+ content: gitignore,
209
+ },
210
+ ];
211
211
  }
@@ -1,92 +1,92 @@
1
1
  import {
2
- type GeneratedFile,
3
- OPENAPI_OUTPUT_PATH,
4
- type TemplateConfig,
5
- type TemplateOptions,
2
+ type GeneratedFile,
3
+ OPENAPI_OUTPUT_PATH,
4
+ type TemplateConfig,
5
+ type TemplateOptions,
6
6
  } from '../templates/index.js';
7
7
 
8
8
  /**
9
9
  * Generate package.json with dependencies based on template and options
10
10
  */
11
11
  export function generatePackageJson(
12
- options: TemplateOptions,
13
- template: TemplateConfig,
12
+ options: TemplateOptions,
13
+ template: TemplateConfig,
14
14
  ): GeneratedFile[] {
15
- const { name, telescope, database, studio, monorepo } = options;
15
+ const { name, telescope, database, studio, monorepo } = options;
16
16
 
17
- // Start with template dependencies
18
- const dependencies = { ...template.dependencies };
19
- const devDependencies = { ...template.devDependencies };
20
- const scripts = { ...template.scripts };
17
+ // Start with template dependencies
18
+ const dependencies = { ...template.dependencies };
19
+ const devDependencies = { ...template.devDependencies };
20
+ const scripts = { ...template.scripts };
21
21
 
22
- // Add optional dependencies based on user choices
23
- if (telescope) {
24
- dependencies['@geekmidas/telescope'] = 'workspace:*';
25
- }
22
+ // Add optional dependencies based on user choices
23
+ if (telescope) {
24
+ dependencies['@geekmidas/telescope'] = 'workspace:*';
25
+ }
26
26
 
27
- if (studio) {
28
- dependencies['@geekmidas/studio'] = 'workspace:*';
29
- }
27
+ if (studio) {
28
+ dependencies['@geekmidas/studio'] = 'workspace:*';
29
+ }
30
30
 
31
- if (database) {
32
- dependencies['@geekmidas/db'] = 'workspace:*';
33
- dependencies['kysely'] = '~0.28.2';
34
- dependencies['pg'] = '~8.16.0';
35
- devDependencies['@types/pg'] = '~8.15.0';
36
- }
31
+ if (database) {
32
+ dependencies['@geekmidas/db'] = 'workspace:*';
33
+ dependencies.kysely = '~0.28.2';
34
+ dependencies.pg = '~8.16.0';
35
+ devDependencies['@types/pg'] = '~8.15.0';
36
+ }
37
37
 
38
- // Add zod for schema validation (commonly used)
39
- dependencies['zod'] = '~4.1.0';
38
+ // Add zod for schema validation (commonly used)
39
+ dependencies.zod = '~4.1.0';
40
40
 
41
- // For monorepo apps, remove biome/turbo (they're at root) and lint/fmt scripts
42
- if (monorepo) {
43
- delete devDependencies['@biomejs/biome'];
44
- delete devDependencies['turbo'];
45
- delete scripts['lint'];
46
- delete scripts['fmt'];
47
- delete scripts['fmt:check'];
41
+ // For monorepo apps, remove biome/turbo (they're at root) and lint/fmt scripts
42
+ if (monorepo) {
43
+ delete devDependencies['@biomejs/biome'];
44
+ delete devDependencies.turbo;
45
+ delete scripts.lint;
46
+ delete scripts.fmt;
47
+ delete scripts['fmt:check'];
48
48
 
49
- // Add models package as dependency
50
- dependencies[`@${name}/models`] = 'workspace:*';
49
+ // Add models package as dependency
50
+ dependencies[`@${name}/models`] = 'workspace:*';
51
51
 
52
- // Remove zod from api package (it's in models)
53
- delete dependencies['zod'];
54
- }
52
+ // Remove zod from api package (it's in models)
53
+ delete dependencies.zod;
54
+ }
55
55
 
56
- // Sort dependencies alphabetically
57
- const sortObject = (obj: Record<string, string>) =>
58
- Object.fromEntries(
59
- Object.entries(obj).sort(([a], [b]) => a.localeCompare(b)),
60
- );
56
+ // Sort dependencies alphabetically
57
+ const sortObject = (obj: Record<string, string>) =>
58
+ Object.fromEntries(
59
+ Object.entries(obj).sort(([a], [b]) => a.localeCompare(b)),
60
+ );
61
61
 
62
- // For monorepo, derive package name from apiPath (e.g., apps/api -> @name/api)
63
- let packageName = name;
64
- if (monorepo && options.apiPath) {
65
- const pathParts = options.apiPath.split('/');
66
- const appName = pathParts[pathParts.length - 1] || 'api';
67
- packageName = `@${name}/${appName}`;
68
- }
62
+ // For monorepo, derive package name from apiPath (e.g., apps/api -> @name/api)
63
+ let packageName = name;
64
+ if (monorepo && options.apiPath) {
65
+ const pathParts = options.apiPath.split('/');
66
+ const appName = pathParts[pathParts.length - 1] || 'api';
67
+ packageName = `@${name}/${appName}`;
68
+ }
69
69
 
70
- const packageJson = {
71
- name: packageName,
72
- version: '0.0.1',
73
- private: true,
74
- type: 'module',
75
- exports: {
76
- './client': {
77
- types: OPENAPI_OUTPUT_PATH,
78
- import: OPENAPI_OUTPUT_PATH,
79
- },
80
- },
81
- scripts,
82
- dependencies: sortObject(dependencies),
83
- devDependencies: sortObject(devDependencies),
84
- };
70
+ const packageJson = {
71
+ name: packageName,
72
+ version: '0.0.1',
73
+ private: true,
74
+ type: 'module',
75
+ exports: {
76
+ './client': {
77
+ types: OPENAPI_OUTPUT_PATH,
78
+ import: OPENAPI_OUTPUT_PATH,
79
+ },
80
+ },
81
+ scripts,
82
+ dependencies: sortObject(dependencies),
83
+ devDependencies: sortObject(devDependencies),
84
+ };
85
85
 
86
- return [
87
- {
88
- path: 'package.json',
89
- content: JSON.stringify(packageJson, null, 2) + '\n',
90
- },
91
- ];
86
+ return [
87
+ {
88
+ path: 'package.json',
89
+ content: `${JSON.stringify(packageJson, null, 2)}\n`,
90
+ },
91
+ ];
92
92
  }
@@ -1,15 +1,15 @@
1
1
  import type {
2
- GeneratedFile,
3
- TemplateConfig,
4
- TemplateOptions,
2
+ GeneratedFile,
3
+ TemplateConfig,
4
+ TemplateOptions,
5
5
  } from '../templates/index.js';
6
6
 
7
7
  /**
8
8
  * Generate source files from template
9
9
  */
10
10
  export function generateSourceFiles(
11
- options: TemplateOptions,
12
- template: TemplateConfig,
11
+ options: TemplateOptions,
12
+ template: TemplateConfig,
13
13
  ): GeneratedFile[] {
14
- return template.files(options);
14
+ return template.files(options);
15
15
  }