@idealyst/cli 1.2.0 → 1.2.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 (324) hide show
  1. package/dist/commands/add.js +233 -0
  2. package/dist/commands/add.js.map +1 -0
  3. package/dist/commands/index.js +13 -0
  4. package/dist/commands/index.js.map +1 -0
  5. package/dist/commands/info.js +193 -0
  6. package/dist/commands/info.js.map +1 -0
  7. package/dist/commands/init.js +155 -0
  8. package/dist/commands/init.js.map +1 -0
  9. package/dist/constants.js +119 -0
  10. package/dist/constants.js.map +1 -0
  11. package/dist/generators/core/index.js +23 -0
  12. package/dist/generators/core/index.js.map +1 -0
  13. package/dist/generators/core/mobile.js +286 -0
  14. package/dist/generators/core/mobile.js.map +1 -0
  15. package/dist/generators/core/shared.js +207 -0
  16. package/dist/generators/core/shared.js.map +1 -0
  17. package/dist/generators/core/web.js +377 -0
  18. package/dist/generators/core/web.js.map +1 -0
  19. package/dist/generators/extensions/api.js +223 -0
  20. package/dist/generators/extensions/api.js.map +1 -0
  21. package/dist/generators/extensions/devcontainer.js +510 -0
  22. package/dist/generators/extensions/devcontainer.js.map +1 -0
  23. package/dist/generators/extensions/graphql.js +202 -0
  24. package/dist/generators/extensions/graphql.js.map +1 -0
  25. package/dist/generators/extensions/index.js +17 -0
  26. package/dist/generators/extensions/index.js.map +1 -0
  27. package/dist/generators/extensions/prisma.js +249 -0
  28. package/dist/generators/extensions/prisma.js.map +1 -0
  29. package/dist/generators/extensions/trpc.js +258 -0
  30. package/dist/generators/extensions/trpc.js.map +1 -0
  31. package/dist/generators/index.js +106 -4
  32. package/dist/generators/index.js.map +1 -1
  33. package/dist/generators/reactNative.js +177 -0
  34. package/dist/generators/reactNative.js.map +1 -0
  35. package/dist/generators/workspace.js +272 -0
  36. package/dist/generators/workspace.js.map +1 -0
  37. package/dist/identifiers/android.js +75 -0
  38. package/dist/identifiers/android.js.map +1 -0
  39. package/dist/identifiers/index.js +35 -0
  40. package/dist/identifiers/index.js.map +1 -0
  41. package/dist/identifiers/ios.js +65 -0
  42. package/dist/identifiers/ios.js.map +1 -0
  43. package/dist/index.js +41 -319
  44. package/dist/index.js.map +1 -1
  45. package/dist/templates/copier.js +135 -0
  46. package/dist/templates/copier.js.map +1 -0
  47. package/dist/templates/index.js +23 -0
  48. package/dist/templates/index.js.map +1 -0
  49. package/dist/templates/merger.js +113 -0
  50. package/dist/templates/merger.js.map +1 -0
  51. package/dist/templates/processor.js +142 -0
  52. package/dist/templates/processor.js.map +1 -0
  53. package/dist/types/commands/add.d.ts +14 -0
  54. package/dist/types/commands/index.d.ts +6 -0
  55. package/dist/types/commands/info.d.ts +10 -0
  56. package/dist/types/commands/init.d.ts +19 -0
  57. package/dist/types/constants.d.ts +76 -0
  58. package/dist/types/generators/core/index.d.ts +6 -0
  59. package/dist/types/generators/core/mobile.d.ts +13 -0
  60. package/dist/types/generators/core/shared.d.ts +8 -0
  61. package/dist/types/generators/core/web.d.ts +8 -0
  62. package/dist/types/generators/extensions/api.d.ts +8 -0
  63. package/dist/types/generators/extensions/devcontainer.d.ts +15 -0
  64. package/dist/types/generators/extensions/graphql.d.ts +8 -0
  65. package/dist/types/generators/extensions/index.d.ts +8 -0
  66. package/dist/types/generators/extensions/prisma.d.ts +8 -0
  67. package/dist/types/generators/extensions/trpc.d.ts +9 -0
  68. package/dist/types/generators/index.d.ts +11 -3
  69. package/dist/types/generators/reactNative.d.ts +19 -0
  70. package/dist/types/generators/workspace.d.ts +8 -0
  71. package/dist/types/identifiers/android.d.ts +26 -0
  72. package/dist/types/identifiers/index.d.ts +26 -0
  73. package/dist/types/identifiers/ios.d.ts +21 -0
  74. package/dist/types/index.d.ts +3 -0
  75. package/dist/types/templates/copier.d.ts +24 -0
  76. package/dist/types/templates/index.d.ts +6 -0
  77. package/dist/types/templates/merger.d.ts +43 -0
  78. package/dist/types/templates/processor.d.ts +39 -0
  79. package/dist/types/types.d.ts +153 -5
  80. package/dist/types/utils/filesystem.d.ts +56 -0
  81. package/dist/types/utils/index.d.ts +7 -0
  82. package/dist/types/utils/logger.d.ts +58 -0
  83. package/dist/types/utils/shell.d.ts +35 -0
  84. package/dist/types/utils/validation.d.ts +32 -0
  85. package/dist/types/wizard/index.d.ts +20 -0
  86. package/dist/types/wizard/steps/apiExtension.d.ts +5 -0
  87. package/dist/types/wizard/steps/appDisplayName.d.ts +5 -0
  88. package/dist/types/wizard/steps/devcontainerExtension.d.ts +5 -0
  89. package/dist/types/wizard/steps/graphqlExtension.d.ts +5 -0
  90. package/dist/types/wizard/steps/index.d.ts +12 -0
  91. package/dist/types/wizard/steps/orgDomain.d.ts +5 -0
  92. package/dist/types/wizard/steps/prismaExtension.d.ts +5 -0
  93. package/dist/types/wizard/steps/projectName.d.ts +5 -0
  94. package/dist/types/wizard/steps/summary.d.ts +5 -0
  95. package/dist/types/wizard/steps/trpcExtension.d.ts +5 -0
  96. package/dist/types/wizard/validators.d.ts +17 -0
  97. package/dist/types.js +41 -0
  98. package/dist/types.js.map +1 -1
  99. package/dist/utils/filesystem.js +173 -0
  100. package/dist/utils/filesystem.js.map +1 -0
  101. package/dist/utils/index.js +24 -0
  102. package/dist/utils/index.js.map +1 -0
  103. package/dist/utils/logger.js +95 -0
  104. package/dist/utils/logger.js.map +1 -0
  105. package/dist/utils/shell.js +113 -0
  106. package/dist/utils/shell.js.map +1 -0
  107. package/dist/utils/validation.js +196 -0
  108. package/dist/utils/validation.js.map +1 -0
  109. package/dist/wizard/index.js +177 -0
  110. package/dist/wizard/index.js.map +1 -0
  111. package/dist/wizard/steps/apiExtension.js +33 -0
  112. package/dist/wizard/steps/apiExtension.js.map +1 -0
  113. package/dist/wizard/steps/appDisplayName.js +53 -0
  114. package/dist/wizard/steps/appDisplayName.js.map +1 -0
  115. package/dist/wizard/steps/devcontainerExtension.js +78 -0
  116. package/dist/wizard/steps/devcontainerExtension.js.map +1 -0
  117. package/dist/wizard/steps/graphqlExtension.js +37 -0
  118. package/dist/wizard/steps/graphqlExtension.js.map +1 -0
  119. package/dist/wizard/steps/index.js +25 -0
  120. package/dist/wizard/steps/index.js.map +1 -0
  121. package/dist/wizard/steps/orgDomain.js +40 -0
  122. package/dist/wizard/steps/orgDomain.js.map +1 -0
  123. package/dist/wizard/steps/prismaExtension.js +33 -0
  124. package/dist/wizard/steps/prismaExtension.js.map +1 -0
  125. package/dist/wizard/steps/projectName.js +40 -0
  126. package/dist/wizard/steps/projectName.js.map +1 -0
  127. package/dist/wizard/steps/summary.js +107 -0
  128. package/dist/wizard/steps/summary.js.map +1 -0
  129. package/dist/wizard/steps/trpcExtension.js +37 -0
  130. package/dist/wizard/steps/trpcExtension.js.map +1 -0
  131. package/dist/wizard/validators.js +35 -0
  132. package/dist/wizard/validators.js.map +1 -0
  133. package/package.json +6 -19
  134. package/README.md +0 -110
  135. package/dist/generators/init.js +0 -268
  136. package/dist/generators/init.js.map +0 -1
  137. package/dist/generators/utils.js +0 -682
  138. package/dist/generators/utils.js.map +0 -1
  139. package/dist/scripts/configure-react-native-monorepo.js +0 -144
  140. package/dist/scripts/configure-react-native-monorepo.js.map +0 -1
  141. package/dist/template/.devcontainer/Dockerfile +0 -26
  142. package/dist/template/.devcontainer/devcontainer.json +0 -113
  143. package/dist/template/.devcontainer/docker-compose.yml +0 -59
  144. package/dist/template/.devcontainer/figma-mcp.sh +0 -32
  145. package/dist/template/.devcontainer/gitignore.template +0 -2
  146. package/dist/template/.devcontainer/setup.sh +0 -45
  147. package/dist/template/DOCKER.md +0 -0
  148. package/dist/template/Dockerfile +0 -111
  149. package/dist/template/README.md +0 -233
  150. package/dist/template/docker/nginx/prod.conf +0 -238
  151. package/dist/template/docker/nginx.conf +0 -131
  152. package/dist/template/docker/postgres/init.sql +0 -41
  153. package/dist/template/docker/prometheus/prometheus.yml +0 -52
  154. package/dist/template/docker-compose.prod.yml +0 -146
  155. package/dist/template/docker-compose.yml +0 -143
  156. package/dist/template/dockerignore.template +0 -151
  157. package/dist/template/env.example.template +0 -36
  158. package/dist/template/gitignore.template +0 -56
  159. package/dist/template/jest.config.js +0 -20
  160. package/dist/template/mcp.json.template +0 -8
  161. package/dist/template/package.json +0 -45
  162. package/dist/template/packages/api/README.md +0 -510
  163. package/dist/template/packages/api/__tests__/api.test.ts +0 -26
  164. package/dist/template/packages/api/env.example.template +0 -6
  165. package/dist/template/packages/api/gitignore.template +0 -35
  166. package/dist/template/packages/api/jest.config.js +0 -23
  167. package/dist/template/packages/api/jest.setup.js +0 -9
  168. package/dist/template/packages/api/package.json +0 -66
  169. package/dist/template/packages/api/src/context.ts +0 -52
  170. package/dist/template/packages/api/src/controllers/TestController.ts +0 -0
  171. package/dist/template/packages/api/src/graphql/builder.ts +0 -75
  172. package/dist/template/packages/api/src/graphql/generated.ts +0 -64
  173. package/dist/template/packages/api/src/graphql/index.ts +0 -75
  174. package/dist/template/packages/api/src/graphql/types/index.ts +0 -44
  175. package/dist/template/packages/api/src/graphql/types/test.ts +0 -245
  176. package/dist/template/packages/api/src/index.ts +0 -26
  177. package/dist/template/packages/api/src/lib/database.ts +0 -23
  178. package/dist/template/packages/api/src/router/index.ts +0 -163
  179. package/dist/template/packages/api/src/routers/test.ts +0 -161
  180. package/dist/template/packages/api/src/server.ts +0 -68
  181. package/dist/template/packages/api/src/trpc.ts +0 -28
  182. package/dist/template/packages/api/tsconfig.json +0 -44
  183. package/dist/template/packages/database/README.md +0 -162
  184. package/dist/template/packages/database/gitignore.template +0 -41
  185. package/dist/template/packages/database/package.json +0 -49
  186. package/dist/template/packages/database/prisma/seed.ts +0 -64
  187. package/dist/template/packages/database/schema.prisma +0 -107
  188. package/dist/template/packages/database/src/index.ts +0 -15
  189. package/dist/template/packages/database/src/validators.ts +0 -10
  190. package/dist/template/packages/database/tsconfig.json +0 -18
  191. package/dist/template/packages/mobile/README.md +0 -86
  192. package/dist/template/packages/mobile/__tests__/App.test.tsx +0 -156
  193. package/dist/template/packages/mobile/__tests__/components.test.tsx +0 -300
  194. package/dist/template/packages/mobile/app.json +0 -5
  195. package/dist/template/packages/mobile/babel.config.js +0 -10
  196. package/dist/template/packages/mobile/gitignore.template +0 -73
  197. package/dist/template/packages/mobile/index.js +0 -6
  198. package/dist/template/packages/mobile/jest.config.js +0 -21
  199. package/dist/template/packages/mobile/jest.setup.js +0 -12
  200. package/dist/template/packages/mobile/metro.config.js +0 -36
  201. package/dist/template/packages/mobile/package.json +0 -60
  202. package/dist/template/packages/mobile/src/App.tsx +0 -8
  203. package/dist/template/packages/mobile/src/utils/trpc.ts +0 -7
  204. package/dist/template/packages/mobile/tsconfig.json +0 -28
  205. package/dist/template/packages/shared/README.md +0 -135
  206. package/dist/template/packages/shared/__tests__/shared.test.ts +0 -51
  207. package/dist/template/packages/shared/gitignore.template +0 -35
  208. package/dist/template/packages/shared/jest.config.js +0 -22
  209. package/dist/template/packages/shared/package.json +0 -68
  210. package/dist/template/packages/shared/src/components/App.tsx +0 -57
  211. package/dist/template/packages/shared/src/components/HelloWorld.tsx +0 -531
  212. package/dist/template/packages/shared/src/components/index.ts +0 -1
  213. package/dist/template/packages/shared/src/graphql/client.ts +0 -34
  214. package/dist/template/packages/shared/src/index.ts +0 -22
  215. package/dist/template/packages/shared/src/navigation/AppRouter.tsx +0 -565
  216. package/dist/template/packages/shared/src/trpc/client.ts +0 -44
  217. package/dist/template/packages/shared/tsconfig.json +0 -22
  218. package/dist/template/packages/web/README.md +0 -131
  219. package/dist/template/packages/web/__tests__/App.test.tsx +0 -342
  220. package/dist/template/packages/web/__tests__/components.test.tsx +0 -564
  221. package/dist/template/packages/web/gitignore.template +0 -35
  222. package/dist/template/packages/web/index.html +0 -13
  223. package/dist/template/packages/web/jest.config.js +0 -27
  224. package/dist/template/packages/web/jest.setup.js +0 -24
  225. package/dist/template/packages/web/package.json +0 -69
  226. package/dist/template/packages/web/src/App.tsx +0 -14
  227. package/dist/template/packages/web/src/components/TestDemo.tsx +0 -164
  228. package/dist/template/packages/web/src/main.tsx +0 -25
  229. package/dist/template/packages/web/src/utils/trpc.ts +0 -7
  230. package/dist/template/packages/web/tsconfig.json +0 -26
  231. package/dist/template/packages/web/vite.config.ts +0 -98
  232. package/dist/template/setup.sh +0 -30
  233. package/dist/template/tsconfig.json +0 -22
  234. package/dist/template/yarnrc.yml.template +0 -4
  235. package/dist/types/generators/init.d.ts +0 -5
  236. package/dist/types/generators/utils.d.ts +0 -45
  237. package/dist/types/scripts/configure-react-native-monorepo.d.ts +0 -23
  238. package/template/.devcontainer/Dockerfile +0 -26
  239. package/template/.devcontainer/devcontainer.json +0 -113
  240. package/template/.devcontainer/docker-compose.yml +0 -59
  241. package/template/.devcontainer/figma-mcp.sh +0 -32
  242. package/template/.devcontainer/setup.sh +0 -45
  243. package/template/.dockerignore +0 -151
  244. package/template/.env.example +0 -36
  245. package/template/.env.production +0 -56
  246. package/template/DOCKER.md +0 -0
  247. package/template/Dockerfile +0 -111
  248. package/template/README.md +0 -233
  249. package/template/docker/nginx/prod.conf +0 -238
  250. package/template/docker/nginx.conf +0 -131
  251. package/template/docker/postgres/init.sql +0 -41
  252. package/template/docker/prometheus/prometheus.yml +0 -52
  253. package/template/docker-compose.prod.yml +0 -146
  254. package/template/docker-compose.yml +0 -143
  255. package/template/jest.config.js +0 -20
  256. package/template/package.json +0 -45
  257. package/template/packages/api/.env.example +0 -6
  258. package/template/packages/api/README.md +0 -510
  259. package/template/packages/api/__tests__/api.test.ts +0 -26
  260. package/template/packages/api/jest.config.js +0 -23
  261. package/template/packages/api/jest.setup.js +0 -9
  262. package/template/packages/api/package.json +0 -66
  263. package/template/packages/api/src/context.ts +0 -52
  264. package/template/packages/api/src/controllers/TestController.ts +0 -0
  265. package/template/packages/api/src/graphql/builder.ts +0 -75
  266. package/template/packages/api/src/graphql/generated.ts +0 -64
  267. package/template/packages/api/src/graphql/index.ts +0 -75
  268. package/template/packages/api/src/graphql/types/index.ts +0 -44
  269. package/template/packages/api/src/graphql/types/test.ts +0 -245
  270. package/template/packages/api/src/index.ts +0 -26
  271. package/template/packages/api/src/lib/database.ts +0 -23
  272. package/template/packages/api/src/router/index.ts +0 -163
  273. package/template/packages/api/src/routers/test.ts +0 -161
  274. package/template/packages/api/src/server.ts +0 -68
  275. package/template/packages/api/src/trpc.ts +0 -28
  276. package/template/packages/api/tsconfig.json +0 -44
  277. package/template/packages/database/README.md +0 -162
  278. package/template/packages/database/package.json +0 -49
  279. package/template/packages/database/prisma/seed.ts +0 -64
  280. package/template/packages/database/schema.prisma +0 -107
  281. package/template/packages/database/src/index.ts +0 -15
  282. package/template/packages/database/src/validators.ts +0 -10
  283. package/template/packages/database/tsconfig.json +0 -18
  284. package/template/packages/mobile/README.md +0 -86
  285. package/template/packages/mobile/__tests__/App.test.tsx +0 -156
  286. package/template/packages/mobile/__tests__/components.test.tsx +0 -300
  287. package/template/packages/mobile/app.json +0 -5
  288. package/template/packages/mobile/babel.config.js +0 -26
  289. package/template/packages/mobile/index.js +0 -8
  290. package/template/packages/mobile/jest.config.js +0 -21
  291. package/template/packages/mobile/jest.setup.js +0 -12
  292. package/template/packages/mobile/metro.config.js +0 -36
  293. package/template/packages/mobile/package.json +0 -60
  294. package/template/packages/mobile/src/App.tsx +0 -8
  295. package/template/packages/mobile/src/utils/trpc.ts +0 -7
  296. package/template/packages/mobile/tsconfig.json +0 -28
  297. package/template/packages/shared/README.md +0 -135
  298. package/template/packages/shared/__tests__/shared.test.ts +0 -51
  299. package/template/packages/shared/jest.config.js +0 -22
  300. package/template/packages/shared/package.json +0 -68
  301. package/template/packages/shared/src/components/App.tsx +0 -57
  302. package/template/packages/shared/src/components/HelloWorld.tsx +0 -531
  303. package/template/packages/shared/src/components/index.ts +0 -1
  304. package/template/packages/shared/src/graphql/client.ts +0 -34
  305. package/template/packages/shared/src/index.ts +0 -25
  306. package/template/packages/shared/src/navigation/AppRouter.tsx +0 -565
  307. package/template/packages/shared/src/trpc/client.ts +0 -44
  308. package/template/packages/shared/src/unistyles.ts +0 -50
  309. package/template/packages/shared/tsconfig.json +0 -22
  310. package/template/packages/web/README.md +0 -131
  311. package/template/packages/web/__tests__/App.test.tsx +0 -342
  312. package/template/packages/web/__tests__/components.test.tsx +0 -564
  313. package/template/packages/web/index.html +0 -13
  314. package/template/packages/web/jest.config.js +0 -27
  315. package/template/packages/web/jest.setup.js +0 -24
  316. package/template/packages/web/package.json +0 -69
  317. package/template/packages/web/src/App.tsx +0 -14
  318. package/template/packages/web/src/components/TestDemo.tsx +0 -164
  319. package/template/packages/web/src/main.tsx +0 -27
  320. package/template/packages/web/src/utils/trpc.ts +0 -7
  321. package/template/packages/web/tsconfig.json +0 -26
  322. package/template/packages/web/vite.config.ts +0 -114
  323. package/template/setup.sh +0 -30
  324. package/template/tsconfig.json +0 -22
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Template file copying utilities
3
+ */
4
+ import { TemplateData } from '../types';
5
+ /**
6
+ * Copy a template directory with variable replacement
7
+ */
8
+ export declare function copyTemplateDirectory(sourceDir: string, destDir: string, data: TemplateData): Promise<void>;
9
+ /**
10
+ * Copy a single template file with variable replacement
11
+ */
12
+ export declare function copyTemplateFile(sourceFile: string, destFile: string, data: TemplateData): Promise<void>;
13
+ /**
14
+ * Get the path to a template directory
15
+ */
16
+ export declare function getTemplatePath(...segments: string[]): string;
17
+ /**
18
+ * Check if a template exists and has content
19
+ */
20
+ export declare function templateExists(...segments: string[]): Promise<boolean>;
21
+ /**
22
+ * Check if a template has content (non-empty directory)
23
+ */
24
+ export declare function templateHasContent(templatePath: string): Promise<boolean>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Template utilities exports
3
+ */
4
+ export * from './processor';
5
+ export * from './copier';
6
+ export * from './merger';
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Package.json merging utilities
3
+ */
4
+ /**
5
+ * Deep merge two objects, with source taking precedence
6
+ */
7
+ export declare function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T;
8
+ /**
9
+ * Package.json structure
10
+ */
11
+ export interface PackageJson {
12
+ name?: string;
13
+ version?: string;
14
+ description?: string;
15
+ main?: string;
16
+ types?: string;
17
+ scripts?: Record<string, string>;
18
+ dependencies?: Record<string, string>;
19
+ devDependencies?: Record<string, string>;
20
+ peerDependencies?: Record<string, string>;
21
+ workspaces?: string[];
22
+ [key: string]: unknown;
23
+ }
24
+ /**
25
+ * Merge additional configuration into a package.json file
26
+ */
27
+ export declare function mergePackageJson(filePath: string, additions: Partial<PackageJson>): Promise<void>;
28
+ /**
29
+ * Add dependencies to a package.json file
30
+ */
31
+ export declare function addDependencies(filePath: string, dependencies: Record<string, string>, type?: 'dependencies' | 'devDependencies' | 'peerDependencies'): Promise<void>;
32
+ /**
33
+ * Remove dependencies from a package.json file
34
+ */
35
+ export declare function removeDependencies(filePath: string, dependencyNames: string[], type?: 'dependencies' | 'devDependencies' | 'peerDependencies'): Promise<void>;
36
+ /**
37
+ * Add scripts to a package.json file
38
+ */
39
+ export declare function addScripts(filePath: string, scripts: Record<string, string>): Promise<void>;
40
+ /**
41
+ * Update workspace configuration in root package.json
42
+ */
43
+ export declare function addToWorkspaces(filePath: string, packagePath: string): Promise<void>;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Template variable processor
3
+ */
4
+ import { TemplateData } from '../types';
5
+ /**
6
+ * Process template content and replace all variables
7
+ */
8
+ export declare function processTemplate(content: string, data: TemplateData): string;
9
+ /**
10
+ * Process conditional blocks in templates
11
+ * Supports: {{#if hasApi}}...{{/if}} and {{#unless hasApi}}...{{/unless}}
12
+ */
13
+ export declare function processConditionals(content: string, data: TemplateData): string;
14
+ /**
15
+ * Full template processing (variables + conditionals)
16
+ */
17
+ export declare function processTemplateContent(content: string, data: TemplateData): string;
18
+ /**
19
+ * Check if a file should be processed for template variables
20
+ */
21
+ export declare function shouldProcessFile(filename: string): boolean;
22
+ /**
23
+ * Build TemplateData from ProjectConfig and additional info
24
+ */
25
+ export declare function buildTemplateData(config: {
26
+ projectName: string;
27
+ appDisplayName: string;
28
+ iosBundleId: string;
29
+ androidPackageName: string;
30
+ extensions: {
31
+ api: boolean;
32
+ prisma: boolean;
33
+ trpc: boolean;
34
+ graphql: boolean;
35
+ devcontainer: boolean | {
36
+ enabled: boolean;
37
+ };
38
+ };
39
+ }, idealystVersion: string): TemplateData;
@@ -1,15 +1,163 @@
1
- export interface GenerateProjectOptions {
2
- name: string;
1
+ /**
2
+ * Core type definitions for the CLI-Beta package
3
+ */
4
+ /**
5
+ * Complete project configuration collected from wizard or CLI args
6
+ */
7
+ export interface ProjectConfig {
8
+ projectName: string;
9
+ orgDomain: string;
10
+ appDisplayName: string;
11
+ iosBundleId: string;
12
+ androidPackageName: string;
13
+ extensions: ExtensionConfig;
3
14
  directory: string;
4
15
  skipInstall: boolean;
5
- figmaToken?: string;
16
+ isInteractive: boolean;
17
+ }
18
+ /**
19
+ * Extension configuration - which optional features are enabled
20
+ */
21
+ export interface ExtensionConfig {
22
+ api: boolean;
23
+ prisma: boolean;
24
+ trpc: boolean;
25
+ graphql: boolean;
26
+ devcontainer: boolean | DevcontainerConfig;
27
+ }
28
+ /**
29
+ * Devcontainer configuration options
30
+ */
31
+ export interface DevcontainerConfig {
32
+ enabled: boolean;
33
+ postgres: boolean;
34
+ redis: boolean;
35
+ chrome: boolean;
36
+ claudeCode: boolean;
37
+ }
38
+ /**
39
+ * CLI arguments before processing
40
+ */
41
+ export interface CLIArgs {
42
+ projectName?: string;
43
+ orgDomain?: string;
44
+ appDisplayName?: string;
45
+ withApi?: boolean;
46
+ withPrisma?: boolean;
47
+ withTrpc?: boolean;
48
+ withGraphql?: boolean;
49
+ withDevcontainer?: boolean;
50
+ noInteractive?: boolean;
51
+ skipInstall?: boolean;
52
+ directory?: string;
53
+ }
54
+ /**
55
+ * A single wizard step definition
56
+ */
57
+ export interface WizardStep<T = unknown> {
58
+ id: string;
59
+ prompt: (currentConfig: Partial<ProjectConfig>) => Promise<T>;
60
+ validate: (value: T) => ValidationResult;
61
+ shouldShow?: (config: Partial<ProjectConfig>) => boolean;
6
62
  }
63
+ /**
64
+ * Result of validation
65
+ */
66
+ export interface ValidationResult {
67
+ valid: boolean;
68
+ error?: string;
69
+ suggestions?: string[];
70
+ }
71
+ /**
72
+ * Wizard state during collection
73
+ */
74
+ export interface WizardState {
75
+ currentStep: number;
76
+ totalSteps: number;
77
+ config: Partial<ProjectConfig>;
78
+ completed: boolean;
79
+ }
80
+ /**
81
+ * Template data passed to template processor
82
+ */
7
83
  export interface TemplateData {
8
84
  projectName: string;
9
85
  packageName: string;
86
+ workspaceScope: string;
10
87
  version: string;
11
88
  description: string;
12
- appName?: string;
13
- workspaceScope?: string;
89
+ appDisplayName: string;
90
+ iosBundleId: string;
91
+ androidPackageName: string;
14
92
  idealystVersion: string;
93
+ hasApi: boolean;
94
+ hasPrisma: boolean;
95
+ hasTrpc: boolean;
96
+ hasGraphql: boolean;
97
+ hasDevcontainer: boolean;
98
+ }
99
+ /**
100
+ * Generator result with metadata
101
+ */
102
+ export interface GeneratorResult {
103
+ success: boolean;
104
+ projectPath: string;
105
+ packagesCreated: string[];
106
+ extensionsEnabled: string[];
107
+ warnings: string[];
108
+ nextSteps: string[];
109
+ }
110
+ /**
111
+ * Result from generating a single package
112
+ */
113
+ export interface PackageGeneratorResult {
114
+ success: boolean;
115
+ warning?: string;
116
+ }
117
+ /**
118
+ * Options for React Native initialization
119
+ */
120
+ export interface ReactNativeInitOptions {
121
+ projectName: string;
122
+ displayName: string;
123
+ bundleId: string;
124
+ packageName: string;
125
+ directory: string;
126
+ skipInstall: boolean;
127
+ }
128
+ /**
129
+ * Types of projects that can be added to workspace
130
+ */
131
+ export type AddableProjectType = 'web' | 'mobile' | 'api' | 'shared';
132
+ /**
133
+ * Options for add command
134
+ */
135
+ export interface AddProjectOptions {
136
+ name: string;
137
+ type: AddableProjectType;
138
+ directory: string;
139
+ appDisplayName?: string;
140
+ withTrpc?: boolean;
141
+ withGraphql?: boolean;
142
+ skipInstall?: boolean;
143
+ }
144
+ /**
145
+ * Custom error for missing required arguments in non-interactive mode
146
+ */
147
+ export declare class MissingArgumentsError extends Error {
148
+ missingArgs: string[];
149
+ providedArgs: Record<string, unknown>;
150
+ constructor(missingArgs: string[], providedArgs: Record<string, unknown>);
151
+ }
152
+ /**
153
+ * Error when trying to run outside workspace for certain operations
154
+ */
155
+ export declare class NotInWorkspaceError extends Error {
156
+ constructor(operation: string);
157
+ }
158
+ /**
159
+ * Error for invalid extension combinations
160
+ */
161
+ export declare class InvalidExtensionError extends Error {
162
+ constructor(extension: string, requirement: string);
15
163
  }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * File system utilities for template copying and file operations
3
+ */
4
+ import { TemplateData } from '../types';
5
+ /**
6
+ * Check if a path matches any ignore patterns
7
+ */
8
+ export declare function shouldIgnore(filePath: string): boolean;
9
+ /**
10
+ * Check if a file should have template variables processed
11
+ */
12
+ export declare function shouldProcessTemplate(filePath: string): boolean;
13
+ /**
14
+ * Replace template variables in content
15
+ */
16
+ export declare function processTemplateContent(content: string, data: TemplateData): string;
17
+ /**
18
+ * Copy a template directory with variable replacement
19
+ */
20
+ export declare function copyTemplate(sourceDir: string, destDir: string, data: TemplateData): Promise<void>;
21
+ /**
22
+ * Ensure a directory exists
23
+ */
24
+ export declare function ensureDir(dirPath: string): Promise<void>;
25
+ /**
26
+ * Check if a path exists
27
+ */
28
+ export declare function pathExists(filePath: string): Promise<boolean>;
29
+ /**
30
+ * Read a JSON file
31
+ */
32
+ export declare function readJson<T = unknown>(filePath: string): Promise<T>;
33
+ /**
34
+ * Write a JSON file
35
+ */
36
+ export declare function writeJson(filePath: string, data: unknown): Promise<void>;
37
+ /**
38
+ * Read a text file
39
+ */
40
+ export declare function readFile(filePath: string): Promise<string>;
41
+ /**
42
+ * Write a text file
43
+ */
44
+ export declare function writeFile(filePath: string, content: string): Promise<void>;
45
+ /**
46
+ * Copy a file
47
+ */
48
+ export declare function copyFile(source: string, dest: string): Promise<void>;
49
+ /**
50
+ * Remove a file or directory
51
+ */
52
+ export declare function remove(filePath: string): Promise<void>;
53
+ /**
54
+ * Get the template path for cli-beta
55
+ */
56
+ export declare function getTemplatePath(templateName: string): string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Utility exports
3
+ */
4
+ export * from './logger';
5
+ export * from './filesystem';
6
+ export * from './shell';
7
+ export * from './validation';
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Logger utility for consistent CLI output
3
+ */
4
+ export declare const logger: {
5
+ /**
6
+ * Log an info message
7
+ */
8
+ info(message: string): void;
9
+ /**
10
+ * Log a success message
11
+ */
12
+ success(message: string): void;
13
+ /**
14
+ * Log a warning message
15
+ */
16
+ warn(message: string): void;
17
+ /**
18
+ * Log an error message
19
+ */
20
+ error(message: string): void;
21
+ /**
22
+ * Log a step in the process
23
+ */
24
+ step(message: string): void;
25
+ /**
26
+ * Log a bullet point item
27
+ */
28
+ bullet(message: string, color?: "green" | "yellow" | "blue" | "white"): void;
29
+ /**
30
+ * Log a code snippet or command
31
+ */
32
+ code(message: string): void;
33
+ /**
34
+ * Log a dimmed/subtle message
35
+ */
36
+ dim(message: string): void;
37
+ /**
38
+ * Log a bold message
39
+ */
40
+ bold(message: string): void;
41
+ /**
42
+ * Log a newline
43
+ */
44
+ newline(): void;
45
+ /**
46
+ * Log a horizontal separator
47
+ */
48
+ separator(): void;
49
+ /**
50
+ * Log a header with separator
51
+ */
52
+ header(message: string): void;
53
+ /**
54
+ * Log a key-value pair
55
+ */
56
+ keyValue(key: string, value: string): void;
57
+ };
58
+ export default logger;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Shell command execution utilities
3
+ */
4
+ export interface CommandOptions {
5
+ cwd?: string;
6
+ timeout?: number;
7
+ silent?: boolean;
8
+ }
9
+ export interface CommandResult {
10
+ stdout: string;
11
+ stderr: string;
12
+ exitCode: number;
13
+ }
14
+ /**
15
+ * Run a shell command and return the result
16
+ */
17
+ export declare function runCommand(command: string, args: string[], options?: CommandOptions): Promise<CommandResult>;
18
+ /**
19
+ * Run yarn install in a directory
20
+ */
21
+ export declare function installDependencies(directory: string, options?: {
22
+ silent?: boolean;
23
+ }): Promise<void>;
24
+ /**
25
+ * Check if a command exists
26
+ */
27
+ export declare function commandExists(command: string): Promise<boolean>;
28
+ /**
29
+ * Get the current yarn version
30
+ */
31
+ export declare function getYarnVersion(): Promise<string | null>;
32
+ /**
33
+ * Get the current node version
34
+ */
35
+ export declare function getNodeVersion(): Promise<string | null>;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Input validation utilities
3
+ */
4
+ import { ValidationResult } from '../types';
5
+ /**
6
+ * Validate a project name
7
+ */
8
+ export declare function validateProjectName(name: string): ValidationResult;
9
+ /**
10
+ * Validate an organization domain
11
+ */
12
+ export declare function validateOrgDomain(domain: string): ValidationResult;
13
+ /**
14
+ * Validate an app display name
15
+ */
16
+ export declare function validateAppDisplayName(name: string): ValidationResult;
17
+ /**
18
+ * Validate an iOS bundle ID
19
+ */
20
+ export declare function validateBundleId(bundleId: string): ValidationResult;
21
+ /**
22
+ * Validate an Android package name
23
+ */
24
+ export declare function validateAndroidPackageName(packageName: string): ValidationResult;
25
+ /**
26
+ * Validate that extension dependencies are met
27
+ */
28
+ export declare function validateExtensions(options: {
29
+ withApi?: boolean;
30
+ withTrpc?: boolean;
31
+ withGraphql?: boolean;
32
+ }): ValidationResult;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Wizard orchestrator - manages the step-by-step configuration flow
3
+ */
4
+ import { ProjectConfig, CLIArgs } from '../types';
5
+ /**
6
+ * Run the interactive wizard to collect all configuration
7
+ */
8
+ export declare function runWizard(prefilledArgs?: Partial<CLIArgs>): Promise<ProjectConfig | null>;
9
+ /**
10
+ * Validate CLI args for non-interactive mode
11
+ */
12
+ export declare function validateNonInteractiveArgs(args: CLIArgs): {
13
+ valid: boolean;
14
+ missing: string[];
15
+ };
16
+ /**
17
+ * Build a ProjectConfig from CLI arguments (for non-interactive mode)
18
+ */
19
+ export declare function buildConfigFromArgs(args: CLIArgs): ProjectConfig;
20
+ export * from './validators';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * API extension wizard step
3
+ */
4
+ import { WizardStep } from '../../types';
5
+ export declare const apiExtensionStep: WizardStep<boolean>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * App display name wizard step
3
+ */
4
+ import { WizardStep } from '../../types';
5
+ export declare const appDisplayNameStep: WizardStep<string>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Wizard step for devcontainer extension
3
+ */
4
+ import { WizardStep, DevcontainerConfig } from '../../types';
5
+ export declare const devcontainerExtensionStep: WizardStep<DevcontainerConfig | false>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * GraphQL extension wizard step
3
+ */
4
+ import { WizardStep } from '../../types';
5
+ export declare const graphqlExtensionStep: WizardStep<boolean>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wizard steps exports
3
+ */
4
+ export { projectNameStep } from './projectName';
5
+ export { orgDomainStep } from './orgDomain';
6
+ export { appDisplayNameStep } from './appDisplayName';
7
+ export { apiExtensionStep } from './apiExtension';
8
+ export { trpcExtensionStep } from './trpcExtension';
9
+ export { graphqlExtensionStep } from './graphqlExtension';
10
+ export { prismaExtensionStep } from './prismaExtension';
11
+ export { devcontainerExtensionStep } from './devcontainerExtension';
12
+ export { summaryStep } from './summary';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Organization domain wizard step
3
+ */
4
+ import { WizardStep } from '../../types';
5
+ export declare const orgDomainStep: WizardStep<string>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Prisma extension wizard step
3
+ */
4
+ import { WizardStep } from '../../types';
5
+ export declare const prismaExtensionStep: WizardStep<boolean>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Project name wizard step
3
+ */
4
+ import { WizardStep } from '../../types';
5
+ export declare const projectNameStep: WizardStep<string>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Summary wizard step
3
+ */
4
+ import { WizardStep } from '../../types';
5
+ export declare const summaryStep: WizardStep<boolean>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * tRPC extension wizard step
3
+ */
4
+ import { WizardStep } from '../../types';
5
+ export declare const trpcExtensionStep: WizardStep<boolean>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wizard input validators
3
+ */
4
+ import { ValidationResult } from '../types';
5
+ import { validateProjectName, validateOrgDomain, validateAppDisplayName } from '../utils/validation';
6
+ /**
7
+ * Re-export validators for use in wizard steps
8
+ */
9
+ export { validateProjectName, validateOrgDomain, validateAppDisplayName, };
10
+ /**
11
+ * Validate a boolean input
12
+ */
13
+ export declare function validateBoolean(value: unknown): ValidationResult;
14
+ /**
15
+ * Display validation error to user
16
+ */
17
+ export declare function formatValidationError(result: ValidationResult): string;
package/dist/types.js CHANGED
@@ -1,3 +1,44 @@
1
1
  "use strict";
2
+ /**
3
+ * Core type definitions for the CLI-Beta package
4
+ */
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.InvalidExtensionError = exports.NotInWorkspaceError = exports.MissingArgumentsError = void 0;
7
+ // ============================================
8
+ // ERROR TYPES
9
+ // ============================================
10
+ /**
11
+ * Custom error for missing required arguments in non-interactive mode
12
+ */
13
+ class MissingArgumentsError extends Error {
14
+ constructor(missingArgs, providedArgs) {
15
+ const message = `Missing required arguments: ${missingArgs.join(', ')}\n` +
16
+ `Run with interactive mode (remove --no-interactive) or provide all required arguments.`;
17
+ super(message);
18
+ this.name = 'MissingArgumentsError';
19
+ this.missingArgs = missingArgs;
20
+ this.providedArgs = providedArgs;
21
+ }
22
+ }
23
+ exports.MissingArgumentsError = MissingArgumentsError;
24
+ /**
25
+ * Error when trying to run outside workspace for certain operations
26
+ */
27
+ class NotInWorkspaceError extends Error {
28
+ constructor(operation) {
29
+ super(`The '${operation}' command must be run from within an Idealyst workspace.`);
30
+ this.name = 'NotInWorkspaceError';
31
+ }
32
+ }
33
+ exports.NotInWorkspaceError = NotInWorkspaceError;
34
+ /**
35
+ * Error for invalid extension combinations
36
+ */
37
+ class InvalidExtensionError extends Error {
38
+ constructor(extension, requirement) {
39
+ super(`Extension '${extension}' requires '${requirement}' to be enabled.`);
40
+ this.name = 'InvalidExtensionError';
41
+ }
42
+ }
43
+ exports.InvalidExtensionError = InvalidExtensionError;
3
44
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAqLH,+CAA+C;AAC/C,cAAc;AACd,+CAA+C;AAE/C;;GAEG;AACH,MAAa,qBAAsB,SAAQ,KAAK;IAI9C,YACE,WAAqB,EACrB,YAAqC;QAErC,MAAM,OAAO,GAAG,+BAA+B,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YACvE,wFAAwF,CAAC;QAC3F,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF;AAfD,sDAeC;AAED;;GAEG;AACH,MAAa,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,SAAiB;QAC3B,KAAK,CAAC,QAAQ,SAAS,0DAA0D,CAAC,CAAC;QACnF,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AALD,kDAKC;AAED;;GAEG;AACH,MAAa,qBAAsB,SAAQ,KAAK;IAC9C,YAAY,SAAiB,EAAE,WAAmB;QAChD,KAAK,CAAC,cAAc,SAAS,eAAe,WAAW,kBAAkB,CAAC,CAAC;QAC3E,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AALD,sDAKC"}