@launch77/cli 1.2.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 (398) hide show
  1. package/.eslintrc.json +6 -0
  2. package/dist/app-templates/webapp/.env.ci +6 -0
  3. package/dist/app-templates/webapp/.env.example +9 -0
  4. package/dist/app-templates/webapp/.eslintrc.json +6 -0
  5. package/dist/app-templates/webapp/README.md.hbs +80 -0
  6. package/dist/app-templates/webapp/app/about/page.tsx.hbs +41 -0
  7. package/dist/app-templates/webapp/app/dashboard/page.tsx.hbs +51 -0
  8. package/dist/app-templates/webapp/app/globals.css +31 -0
  9. package/dist/app-templates/webapp/app/layout.tsx.hbs +26 -0
  10. package/dist/app-templates/webapp/app/page.tsx.hbs +30 -0
  11. package/dist/app-templates/webapp/next.config.js +99 -0
  12. package/dist/app-templates/webapp/package.json.hbs +30 -0
  13. package/dist/app-templates/webapp/postcss.config.js +6 -0
  14. package/dist/app-templates/webapp/tailwind.config.ts +24 -0
  15. package/dist/app-templates/webapp/tsconfig.json +29 -0
  16. package/dist/app-templates/webapp/vercel.json.hbs +7 -0
  17. package/dist/cli.d.ts +3 -0
  18. package/dist/cli.d.ts.map +1 -0
  19. package/dist/cli.js +29 -0
  20. package/dist/cli.js.map +1 -0
  21. package/dist/infrastructure/filesystem.d.ts +41 -0
  22. package/dist/infrastructure/filesystem.d.ts.map +1 -0
  23. package/dist/infrastructure/filesystem.js +61 -0
  24. package/dist/infrastructure/filesystem.js.map +1 -0
  25. package/dist/infrastructure/npm.d.ts +9 -0
  26. package/dist/infrastructure/npm.d.ts.map +1 -0
  27. package/dist/infrastructure/npm.js +17 -0
  28. package/dist/infrastructure/npm.js.map +1 -0
  29. package/dist/infrastructure/template-engine.d.ts +12 -0
  30. package/dist/infrastructure/template-engine.d.ts.map +1 -0
  31. package/dist/infrastructure/template-engine.js +40 -0
  32. package/dist/infrastructure/template-engine.js.map +1 -0
  33. package/dist/infrastructure/template-generator.d.ts +9 -0
  34. package/dist/infrastructure/template-generator.d.ts.map +1 -0
  35. package/dist/infrastructure/template-generator.js +19 -0
  36. package/dist/infrastructure/template-generator.js.map +1 -0
  37. package/dist/infrastructure/template.d.ts +20 -0
  38. package/dist/infrastructure/template.d.ts.map +1 -0
  39. package/dist/infrastructure/template.js +53 -0
  40. package/dist/infrastructure/template.js.map +1 -0
  41. package/dist/modules/app/commands/create-app.d.ts +3 -0
  42. package/dist/modules/app/commands/create-app.d.ts.map +1 -0
  43. package/dist/modules/app/commands/create-app.js +51 -0
  44. package/dist/modules/app/commands/create-app.js.map +1 -0
  45. package/dist/modules/app/commands/delete-app.d.ts +3 -0
  46. package/dist/modules/app/commands/delete-app.d.ts.map +1 -0
  47. package/dist/modules/app/commands/delete-app.js +109 -0
  48. package/dist/modules/app/commands/delete-app.js.map +1 -0
  49. package/dist/modules/app/commands/generate-manifest.d.ts +3 -0
  50. package/dist/modules/app/commands/generate-manifest.d.ts.map +1 -0
  51. package/dist/modules/app/commands/generate-manifest.js +62 -0
  52. package/dist/modules/app/commands/generate-manifest.js.map +1 -0
  53. package/dist/modules/app/commands/validate-manifest.d.ts +3 -0
  54. package/dist/modules/app/commands/validate-manifest.d.ts.map +1 -0
  55. package/dist/modules/app/commands/validate-manifest.js +68 -0
  56. package/dist/modules/app/commands/validate-manifest.js.map +1 -0
  57. package/dist/modules/app/errors/app-errors.d.ts +19 -0
  58. package/dist/modules/app/errors/app-errors.d.ts.map +1 -0
  59. package/dist/modules/app/errors/app-errors.js +37 -0
  60. package/dist/modules/app/errors/app-errors.js.map +1 -0
  61. package/dist/modules/app/index.d.ts +10 -0
  62. package/dist/modules/app/index.d.ts.map +1 -0
  63. package/dist/modules/app/index.js +11 -0
  64. package/dist/modules/app/index.js.map +1 -0
  65. package/dist/modules/app/lib/manifest-schema.d.ts +39 -0
  66. package/dist/modules/app/lib/manifest-schema.d.ts.map +1 -0
  67. package/dist/modules/app/lib/manifest-schema.js +44 -0
  68. package/dist/modules/app/lib/manifest-schema.js.map +1 -0
  69. package/dist/modules/app/services/app-svc.d.ts +15 -0
  70. package/dist/modules/app/services/app-svc.d.ts.map +1 -0
  71. package/dist/modules/app/services/app-svc.js +90 -0
  72. package/dist/modules/app/services/app-svc.js.map +1 -0
  73. package/dist/modules/app/services/manifest-svc.d.ts +28 -0
  74. package/dist/modules/app/services/manifest-svc.d.ts.map +1 -0
  75. package/dist/modules/app/services/manifest-svc.js +119 -0
  76. package/dist/modules/app/services/manifest-svc.js.map +1 -0
  77. package/dist/modules/app/types/app-types.d.ts +21 -0
  78. package/dist/modules/app/types/app-types.d.ts.map +1 -0
  79. package/dist/modules/app/types/app-types.js +5 -0
  80. package/dist/modules/app/types/app-types.js.map +1 -0
  81. package/dist/modules/catalog/commands/generate.d.ts +9 -0
  82. package/dist/modules/catalog/commands/generate.d.ts.map +1 -0
  83. package/dist/modules/catalog/commands/generate.js +94 -0
  84. package/dist/modules/catalog/commands/generate.js.map +1 -0
  85. package/dist/modules/catalog/commands/scan.d.ts +9 -0
  86. package/dist/modules/catalog/commands/scan.d.ts.map +1 -0
  87. package/dist/modules/catalog/commands/scan.js +43 -0
  88. package/dist/modules/catalog/commands/scan.js.map +1 -0
  89. package/dist/modules/catalog/config/catalog-config.d.ts +49 -0
  90. package/dist/modules/catalog/config/catalog-config.d.ts.map +1 -0
  91. package/dist/modules/catalog/config/catalog-config.js +116 -0
  92. package/dist/modules/catalog/config/catalog-config.js.map +1 -0
  93. package/dist/modules/catalog/config/catalog-config.test.d.ts +2 -0
  94. package/dist/modules/catalog/config/catalog-config.test.d.ts.map +1 -0
  95. package/dist/modules/catalog/config/catalog-config.test.js +362 -0
  96. package/dist/modules/catalog/config/catalog-config.test.js.map +1 -0
  97. package/dist/modules/catalog/index.d.ts +9 -0
  98. package/dist/modules/catalog/index.d.ts.map +1 -0
  99. package/dist/modules/catalog/index.js +9 -0
  100. package/dist/modules/catalog/index.js.map +1 -0
  101. package/dist/modules/catalog/parsers/typescript-parser.d.ts +15 -0
  102. package/dist/modules/catalog/parsers/typescript-parser.d.ts.map +1 -0
  103. package/dist/modules/catalog/parsers/typescript-parser.js +82 -0
  104. package/dist/modules/catalog/parsers/typescript-parser.js.map +1 -0
  105. package/dist/modules/catalog/scanners/metadata-extractor.d.ts +10 -0
  106. package/dist/modules/catalog/scanners/metadata-extractor.d.ts.map +1 -0
  107. package/dist/modules/catalog/scanners/metadata-extractor.js +122 -0
  108. package/dist/modules/catalog/scanners/metadata-extractor.js.map +1 -0
  109. package/dist/modules/catalog/scanners/metadata-validator.d.ts +6 -0
  110. package/dist/modules/catalog/scanners/metadata-validator.d.ts.map +1 -0
  111. package/dist/modules/catalog/scanners/metadata-validator.js +57 -0
  112. package/dist/modules/catalog/scanners/metadata-validator.js.map +1 -0
  113. package/dist/modules/catalog/scanners/ui-component-scanner.d.ts +11 -0
  114. package/dist/modules/catalog/scanners/ui-component-scanner.d.ts.map +1 -0
  115. package/dist/modules/catalog/scanners/ui-component-scanner.js +147 -0
  116. package/dist/modules/catalog/scanners/ui-component-scanner.js.map +1 -0
  117. package/dist/modules/catalog/schemas/catalog-ui-components.schema.json +161 -0
  118. package/dist/modules/catalog/schemas/schemas/catalog-ui-components.schema.json +145 -0
  119. package/dist/modules/catalog/services/catalog-generator-svc.d.ts +27 -0
  120. package/dist/modules/catalog/services/catalog-generator-svc.d.ts.map +1 -0
  121. package/dist/modules/catalog/services/catalog-generator-svc.js +100 -0
  122. package/dist/modules/catalog/services/catalog-generator-svc.js.map +1 -0
  123. package/dist/modules/catalog/services/catalog-generator-svc.test.d.ts +2 -0
  124. package/dist/modules/catalog/services/catalog-generator-svc.test.d.ts.map +1 -0
  125. package/dist/modules/catalog/services/catalog-generator-svc.test.js +201 -0
  126. package/dist/modules/catalog/services/catalog-generator-svc.test.js.map +1 -0
  127. package/dist/modules/catalog/services/catalog-svc.d.ts +39 -0
  128. package/dist/modules/catalog/services/catalog-svc.d.ts.map +1 -0
  129. package/dist/modules/catalog/services/catalog-svc.js +163 -0
  130. package/dist/modules/catalog/services/catalog-svc.js.map +1 -0
  131. package/dist/modules/catalog/types/catalog-types.d.ts +120 -0
  132. package/dist/modules/catalog/types/catalog-types.d.ts.map +1 -0
  133. package/dist/modules/catalog/types/catalog-types.js +5 -0
  134. package/dist/modules/catalog/types/catalog-types.js.map +1 -0
  135. package/dist/modules/catalog/utils/examples-generator.d.ts +6 -0
  136. package/dist/modules/catalog/utils/examples-generator.d.ts.map +1 -0
  137. package/dist/modules/catalog/utils/examples-generator.js +55 -0
  138. package/dist/modules/catalog/utils/examples-generator.js.map +1 -0
  139. package/dist/modules/catalog/utils/quality-reporter.d.ts +13 -0
  140. package/dist/modules/catalog/utils/quality-reporter.d.ts.map +1 -0
  141. package/dist/modules/catalog/utils/quality-reporter.js +64 -0
  142. package/dist/modules/catalog/utils/quality-reporter.js.map +1 -0
  143. package/dist/modules/catalog/validators/component-name-validator.d.ts +20 -0
  144. package/dist/modules/catalog/validators/component-name-validator.d.ts.map +1 -0
  145. package/dist/modules/catalog/validators/component-name-validator.js +33 -0
  146. package/dist/modules/catalog/validators/component-name-validator.js.map +1 -0
  147. package/dist/modules/catalog/validators/component-name-validator.test.d.ts +2 -0
  148. package/dist/modules/catalog/validators/component-name-validator.test.d.ts.map +1 -0
  149. package/dist/modules/catalog/validators/component-name-validator.test.js +196 -0
  150. package/dist/modules/catalog/validators/component-name-validator.test.js.map +1 -0
  151. package/dist/modules/deploy/commands/deploy-init-action.d.ts +12 -0
  152. package/dist/modules/deploy/commands/deploy-init-action.d.ts.map +1 -0
  153. package/dist/modules/deploy/commands/deploy-init-action.js +220 -0
  154. package/dist/modules/deploy/commands/deploy-init-action.js.map +1 -0
  155. package/dist/modules/deploy/commands/deploy-init.d.ts +6 -0
  156. package/dist/modules/deploy/commands/deploy-init.d.ts.map +1 -0
  157. package/dist/modules/deploy/commands/deploy-init.js +16 -0
  158. package/dist/modules/deploy/commands/deploy-init.js.map +1 -0
  159. package/dist/modules/deploy/commands/deploy-logs-action.d.ts +12 -0
  160. package/dist/modules/deploy/commands/deploy-logs-action.d.ts.map +1 -0
  161. package/dist/modules/deploy/commands/deploy-logs-action.js +113 -0
  162. package/dist/modules/deploy/commands/deploy-logs-action.js.map +1 -0
  163. package/dist/modules/deploy/commands/deploy-logs.d.ts +6 -0
  164. package/dist/modules/deploy/commands/deploy-logs.d.ts.map +1 -0
  165. package/dist/modules/deploy/commands/deploy-logs.js +17 -0
  166. package/dist/modules/deploy/commands/deploy-logs.js.map +1 -0
  167. package/dist/modules/deploy/commands/deploy-status-action.d.ts +8 -0
  168. package/dist/modules/deploy/commands/deploy-status-action.d.ts.map +1 -0
  169. package/dist/modules/deploy/commands/deploy-status-action.js +153 -0
  170. package/dist/modules/deploy/commands/deploy-status-action.js.map +1 -0
  171. package/dist/modules/deploy/commands/deploy-status.d.ts +6 -0
  172. package/dist/modules/deploy/commands/deploy-status.d.ts.map +1 -0
  173. package/dist/modules/deploy/commands/deploy-status.js +13 -0
  174. package/dist/modules/deploy/commands/deploy-status.js.map +1 -0
  175. package/dist/modules/deploy/index.d.ts +7 -0
  176. package/dist/modules/deploy/index.d.ts.map +1 -0
  177. package/dist/modules/deploy/index.js +7 -0
  178. package/dist/modules/deploy/index.js.map +1 -0
  179. package/dist/modules/deploy/services/deploy-svc.d.ts +17 -0
  180. package/dist/modules/deploy/services/deploy-svc.d.ts.map +1 -0
  181. package/dist/modules/deploy/services/deploy-svc.js +25 -0
  182. package/dist/modules/deploy/services/deploy-svc.js.map +1 -0
  183. package/dist/modules/deploy/utils/vercel-extended.d.ts +63 -0
  184. package/dist/modules/deploy/utils/vercel-extended.d.ts.map +1 -0
  185. package/dist/modules/deploy/utils/vercel-extended.js +238 -0
  186. package/dist/modules/deploy/utils/vercel-extended.js.map +1 -0
  187. package/dist/modules/plugin/commands/plugin-install.d.ts +3 -0
  188. package/dist/modules/plugin/commands/plugin-install.d.ts.map +1 -0
  189. package/dist/modules/plugin/commands/plugin-install.js +45 -0
  190. package/dist/modules/plugin/commands/plugin-install.js.map +1 -0
  191. package/dist/modules/plugin/errors/plugin-errors.d.ts +16 -0
  192. package/dist/modules/plugin/errors/plugin-errors.d.ts.map +1 -0
  193. package/dist/modules/plugin/errors/plugin-errors.js +39 -0
  194. package/dist/modules/plugin/errors/plugin-errors.js.map +1 -0
  195. package/dist/modules/plugin/index.d.ts +6 -0
  196. package/dist/modules/plugin/index.d.ts.map +1 -0
  197. package/dist/modules/plugin/index.js +9 -0
  198. package/dist/modules/plugin/index.js.map +1 -0
  199. package/dist/modules/plugin/lib/plugin-registry.d.ts +15 -0
  200. package/dist/modules/plugin/lib/plugin-registry.d.ts.map +1 -0
  201. package/dist/modules/plugin/lib/plugin-registry.js +47 -0
  202. package/dist/modules/plugin/lib/plugin-registry.js.map +1 -0
  203. package/dist/modules/plugin/services/plugin-svc.d.ts +10 -0
  204. package/dist/modules/plugin/services/plugin-svc.d.ts.map +1 -0
  205. package/dist/modules/plugin/services/plugin-svc.js +44 -0
  206. package/dist/modules/plugin/services/plugin-svc.js.map +1 -0
  207. package/dist/modules/plugin/types/plugin-types.d.ts +19 -0
  208. package/dist/modules/plugin/types/plugin-types.d.ts.map +1 -0
  209. package/dist/modules/plugin/types/plugin-types.js +2 -0
  210. package/dist/modules/plugin/types/plugin-types.js.map +1 -0
  211. package/dist/modules/startup/commands/create-startup.d.ts +3 -0
  212. package/dist/modules/startup/commands/create-startup.d.ts.map +1 -0
  213. package/dist/modules/startup/commands/create-startup.js +43 -0
  214. package/dist/modules/startup/commands/create-startup.js.map +1 -0
  215. package/dist/modules/startup/errors/startup-errors.d.ts +13 -0
  216. package/dist/modules/startup/errors/startup-errors.d.ts.map +1 -0
  217. package/dist/modules/startup/errors/startup-errors.js +25 -0
  218. package/dist/modules/startup/errors/startup-errors.js.map +1 -0
  219. package/dist/modules/startup/index.d.ts +5 -0
  220. package/dist/modules/startup/index.d.ts.map +1 -0
  221. package/dist/modules/startup/index.js +7 -0
  222. package/dist/modules/startup/index.js.map +1 -0
  223. package/dist/modules/startup/services/startup-service.d.ts +7 -0
  224. package/dist/modules/startup/services/startup-service.d.ts.map +1 -0
  225. package/dist/modules/startup/services/startup-service.js +43 -0
  226. package/dist/modules/startup/services/startup-service.js.map +1 -0
  227. package/dist/modules/startup/types/startup-types.d.ts +8 -0
  228. package/dist/modules/startup/types/startup-types.d.ts.map +1 -0
  229. package/dist/modules/startup/types/startup-types.js +2 -0
  230. package/dist/modules/startup/types/startup-types.js.map +1 -0
  231. package/dist/modules/startup/utils/startup-validators.d.ts +8 -0
  232. package/dist/modules/startup/utils/startup-validators.d.ts.map +1 -0
  233. package/dist/modules/startup/utils/startup-validators.js +17 -0
  234. package/dist/modules/startup/utils/startup-validators.js.map +1 -0
  235. package/dist/modules/workspace/commands/init-workspace.d.ts +3 -0
  236. package/dist/modules/workspace/commands/init-workspace.d.ts.map +1 -0
  237. package/dist/modules/workspace/commands/init-workspace.js +54 -0
  238. package/dist/modules/workspace/commands/init-workspace.js.map +1 -0
  239. package/dist/modules/workspace/errors/workspace-errors.d.ts +10 -0
  240. package/dist/modules/workspace/errors/workspace-errors.d.ts.map +1 -0
  241. package/dist/modules/workspace/errors/workspace-errors.js +19 -0
  242. package/dist/modules/workspace/errors/workspace-errors.js.map +1 -0
  243. package/dist/modules/workspace/index.d.ts +5 -0
  244. package/dist/modules/workspace/index.d.ts.map +1 -0
  245. package/dist/modules/workspace/index.js +7 -0
  246. package/dist/modules/workspace/index.js.map +1 -0
  247. package/dist/modules/workspace/services/workspace-service.d.ts +6 -0
  248. package/dist/modules/workspace/services/workspace-service.d.ts.map +1 -0
  249. package/dist/modules/workspace/services/workspace-service.js +46 -0
  250. package/dist/modules/workspace/services/workspace-service.js.map +1 -0
  251. package/dist/modules/workspace/types/workspace-types.d.ts +8 -0
  252. package/dist/modules/workspace/types/workspace-types.d.ts.map +1 -0
  253. package/dist/modules/workspace/types/workspace-types.js +2 -0
  254. package/dist/modules/workspace/types/workspace-types.js.map +1 -0
  255. package/dist/modules/workspace/utils/workspace-validators.d.ts +8 -0
  256. package/dist/modules/workspace/utils/workspace-validators.d.ts.map +1 -0
  257. package/dist/modules/workspace/utils/workspace-validators.js +17 -0
  258. package/dist/modules/workspace/utils/workspace-validators.js.map +1 -0
  259. package/dist/plugins/theme/package.json +32 -0
  260. package/dist/plugins/theme/plugin.json +9 -0
  261. package/dist/plugins/theme/src/generator.ts +92 -0
  262. package/dist/plugins/theme/src/utils/config-modifier.ts +142 -0
  263. package/dist/plugins/theme/src/utils/css-modifier.ts +89 -0
  264. package/dist/plugins/theme/templates/app/theme-test/page.tsx +156 -0
  265. package/dist/plugins/theme/templates/src/modules/theme/README.md +209 -0
  266. package/dist/plugins/theme/templates/src/modules/theme/config/brand.css +23 -0
  267. package/dist/plugins/theme/tsconfig.json +14 -0
  268. package/dist/plugins/theme/tsup.config.ts +10 -0
  269. package/dist/templates/startup/apps/.gitkeep +8 -0
  270. package/dist/templates/templates/startup/apps/.gitkeep +8 -0
  271. package/dist/templates/templates/workspace/.eslintignore +7 -0
  272. package/dist/templates/templates/workspace/.eslintrc.js +38 -0
  273. package/dist/templates/templates/workspace/.husky/pre-push +24 -0
  274. package/dist/templates/templates/workspace/.launch77/workspace.json +3 -0
  275. package/dist/templates/templates/workspace/.lintstagedrc.json +4 -0
  276. package/dist/templates/templates/workspace/.prettierrc +9 -0
  277. package/dist/templates/templates/workspace/README.md +62 -0
  278. package/dist/templates/templates/workspace/app-templates/.gitkeep +1 -0
  279. package/dist/templates/templates/workspace/apps/.gitkeep +1 -0
  280. package/dist/templates/templates/workspace/libraries/.gitkeep +1 -0
  281. package/dist/templates/templates/workspace/package.json +31 -0
  282. package/dist/templates/templates/workspace/plugins/.gitkeep +1 -0
  283. package/dist/templates/templates/workspace/tsconfig.json +22 -0
  284. package/dist/templates/templates/workspace/turbo.json +25 -0
  285. package/dist/templates/workspace/.launch77/workspace.json +3 -0
  286. package/dist/templates/workspace/README.md +62 -0
  287. package/dist/templates/workspace/app-templates/.gitkeep +1 -0
  288. package/dist/templates/workspace/apps/.gitkeep +1 -0
  289. package/dist/templates/workspace/libraries/.gitkeep +1 -0
  290. package/dist/templates/workspace/package.json +21 -0
  291. package/dist/templates/workspace/plugins/.gitkeep +1 -0
  292. package/dist/templates/workspace/tsconfig.json +22 -0
  293. package/dist/templates/workspace/turbo.json +25 -0
  294. package/dist/utils/launch77-context.d.ts +16 -0
  295. package/dist/utils/launch77-context.d.ts.map +1 -0
  296. package/dist/utils/launch77-context.js +111 -0
  297. package/dist/utils/launch77-context.js.map +1 -0
  298. package/dist/utils/launch77-validation.d.ts +17 -0
  299. package/dist/utils/launch77-validation.d.ts.map +1 -0
  300. package/dist/utils/launch77-validation.js +44 -0
  301. package/dist/utils/launch77-validation.js.map +1 -0
  302. package/dist/utils/monorepo.d.ts +19 -0
  303. package/dist/utils/monorepo.d.ts.map +1 -0
  304. package/dist/utils/monorepo.js +100 -0
  305. package/dist/utils/monorepo.js.map +1 -0
  306. package/dist/utils/validation.d.ts +32 -0
  307. package/dist/utils/validation.d.ts.map +1 -0
  308. package/dist/utils/validation.js +92 -0
  309. package/dist/utils/validation.js.map +1 -0
  310. package/dist/utils/version.d.ts +7 -0
  311. package/dist/utils/version.d.ts.map +1 -0
  312. package/dist/utils/version.js +16 -0
  313. package/dist/utils/version.js.map +1 -0
  314. package/launch77-cli-1.2.0.tgz +0 -0
  315. package/package.json +48 -0
  316. package/src/cli.ts +34 -0
  317. package/src/infrastructure/filesystem.ts +69 -0
  318. package/src/infrastructure/npm.ts +18 -0
  319. package/src/infrastructure/template-engine.ts +48 -0
  320. package/src/infrastructure/template-generator.ts +26 -0
  321. package/src/infrastructure/template.ts +66 -0
  322. package/src/modules/app/commands/create-app.ts +60 -0
  323. package/src/modules/app/commands/delete-app.ts +123 -0
  324. package/src/modules/app/commands/generate-manifest.ts +75 -0
  325. package/src/modules/app/commands/validate-manifest.ts +78 -0
  326. package/src/modules/app/errors/app-errors.ts +41 -0
  327. package/src/modules/app/index.ts +16 -0
  328. package/src/modules/app/lib/manifest-schema.ts +65 -0
  329. package/src/modules/app/services/app-svc.ts +115 -0
  330. package/src/modules/app/services/manifest-svc.ts +144 -0
  331. package/src/modules/app/types/app-types.ts +27 -0
  332. package/src/modules/catalog/commands/generate.ts +115 -0
  333. package/src/modules/catalog/commands/scan.ts +48 -0
  334. package/src/modules/catalog/config/catalog-config.test.ts +404 -0
  335. package/src/modules/catalog/config/catalog-config.ts +130 -0
  336. package/src/modules/catalog/index.ts +9 -0
  337. package/src/modules/catalog/parsers/typescript-parser.ts +93 -0
  338. package/src/modules/catalog/scanners/metadata-extractor.ts +134 -0
  339. package/src/modules/catalog/scanners/metadata-validator.ts +67 -0
  340. package/src/modules/catalog/scanners/ui-component-scanner.ts +185 -0
  341. package/src/modules/catalog/schemas/catalog-ui-components.schema.json +145 -0
  342. package/src/modules/catalog/services/catalog-generator-svc.test.ts +233 -0
  343. package/src/modules/catalog/services/catalog-generator-svc.ts +124 -0
  344. package/src/modules/catalog/services/catalog-svc.ts +222 -0
  345. package/src/modules/catalog/types/catalog-types.ts +149 -0
  346. package/src/modules/catalog/utils/examples-generator.ts +68 -0
  347. package/src/modules/catalog/utils/quality-reporter.ts +76 -0
  348. package/src/modules/catalog/validators/component-name-validator.test.ts +233 -0
  349. package/src/modules/catalog/validators/component-name-validator.ts +43 -0
  350. package/src/modules/deploy/commands/deploy-init-action.ts +247 -0
  351. package/src/modules/deploy/commands/deploy-init.ts +19 -0
  352. package/src/modules/deploy/commands/deploy-logs-action.ts +135 -0
  353. package/src/modules/deploy/commands/deploy-logs.ts +20 -0
  354. package/src/modules/deploy/commands/deploy-status-action.ts +175 -0
  355. package/src/modules/deploy/commands/deploy-status.ts +16 -0
  356. package/src/modules/deploy/index.ts +7 -0
  357. package/src/modules/deploy/services/deploy-svc.ts +31 -0
  358. package/src/modules/deploy/utils/vercel-extended.ts +286 -0
  359. package/src/modules/plugin/commands/plugin-install.ts +51 -0
  360. package/src/modules/plugin/errors/plugin-errors.ts +44 -0
  361. package/src/modules/plugin/index.ts +14 -0
  362. package/src/modules/plugin/lib/launch77-workspace.code-workspace +14 -0
  363. package/src/modules/plugin/lib/plugin-registry.ts +59 -0
  364. package/src/modules/plugin/services/plugin-svc.ts +53 -0
  365. package/src/modules/plugin/types/plugin-types.ts +21 -0
  366. package/src/modules/startup/commands/create-startup.ts +53 -0
  367. package/src/modules/startup/errors/startup-errors.ts +23 -0
  368. package/src/modules/startup/index.ts +11 -0
  369. package/src/modules/startup/services/startup-service.ts +57 -0
  370. package/src/modules/startup/types/startup-types.ts +8 -0
  371. package/src/modules/startup/utils/startup-validators.ts +19 -0
  372. package/src/modules/workspace/commands/init-workspace.ts +63 -0
  373. package/src/modules/workspace/errors/workspace-errors.ts +16 -0
  374. package/src/modules/workspace/index.ts +11 -0
  375. package/src/modules/workspace/services/workspace-service.ts +59 -0
  376. package/src/modules/workspace/types/workspace-types.ts +8 -0
  377. package/src/modules/workspace/utils/workspace-validators.ts +19 -0
  378. package/src/utils/launch77-context.ts +152 -0
  379. package/src/utils/launch77-validation.ts +59 -0
  380. package/src/utils/monorepo.ts +137 -0
  381. package/src/utils/validation.ts +117 -0
  382. package/src/utils/version.ts +16 -0
  383. package/templates/startup/apps/.gitkeep +8 -0
  384. package/templates/workspace/.eslintignore +7 -0
  385. package/templates/workspace/.eslintrc.js +38 -0
  386. package/templates/workspace/.husky/pre-push +24 -0
  387. package/templates/workspace/.launch77/workspace.json +3 -0
  388. package/templates/workspace/.lintstagedrc.json +4 -0
  389. package/templates/workspace/.prettierrc +9 -0
  390. package/templates/workspace/README.md +62 -0
  391. package/templates/workspace/app-templates/.gitkeep +1 -0
  392. package/templates/workspace/apps/.gitkeep +1 -0
  393. package/templates/workspace/libraries/.gitkeep +1 -0
  394. package/templates/workspace/package.json +31 -0
  395. package/templates/workspace/plugins/.gitkeep +1 -0
  396. package/templates/workspace/tsconfig.json +22 -0
  397. package/templates/workspace/turbo.json +25 -0
  398. package/tsconfig.json +23 -0
@@ -0,0 +1,54 @@
1
+ import * as path from 'path';
2
+ import { input } from '@inquirer/prompts';
3
+ import chalk from 'chalk';
4
+ import { Command } from 'commander';
5
+ import ora from 'ora';
6
+ import { WorkspaceAlreadyExistsError, InvalidWorkspaceNameError } from '../errors/workspace-errors.js';
7
+ import { WorkspaceService } from '../services/workspace-service.js';
8
+ export function initWorkspaceCommand() {
9
+ return new Command('init')
10
+ .argument('[name]', 'Name of the workspace (lowercase, alphanumeric, hyphens)')
11
+ .description('Initialize a new Launch77 workspace')
12
+ .action(async (name) => {
13
+ // If no name provided, prompt for it
14
+ let workspaceName = name;
15
+ if (!workspaceName) {
16
+ workspaceName = await input({
17
+ message: 'Workspace name:',
18
+ validate: (value) => {
19
+ if (!value || value.trim().length === 0) {
20
+ return 'Workspace name cannot be empty';
21
+ }
22
+ const validPattern = /^[a-z0-9-]+$/;
23
+ if (!validPattern.test(value)) {
24
+ return 'Workspace name must be lowercase, alphanumeric, and hyphens only';
25
+ }
26
+ return true;
27
+ },
28
+ });
29
+ }
30
+ console.log(chalk.blue(`\n🚀 Initializing workspace: ${workspaceName}\n`));
31
+ const service = new WorkspaceService();
32
+ try {
33
+ const spinner = ora('Creating workspace structure...').start();
34
+ const result = await service.initWorkspace({ name: workspaceName }, process.cwd());
35
+ spinner.succeed('Workspace structure created');
36
+ // Success message
37
+ const cwd = process.cwd();
38
+ console.log(chalk.green(`\n✅ Workspace created successfully at ${path.relative(cwd, result.workspacePath)}\n`));
39
+ console.log(chalk.gray(`Next steps:\n` + ` 1. cd ${workspaceName}\n` + ` 2. npm install\n` + ` 3. Create your first app with launch77 commands\n`));
40
+ }
41
+ catch (error) {
42
+ if (error instanceof WorkspaceAlreadyExistsError) {
43
+ console.error(chalk.red(`\n❌ ${error.message}\n`));
44
+ process.exit(1);
45
+ }
46
+ if (error instanceof InvalidWorkspaceNameError) {
47
+ console.error(chalk.red(`\n❌ ${error.message}\n`));
48
+ process.exit(1);
49
+ }
50
+ throw error;
51
+ }
52
+ });
53
+ }
54
+ //# sourceMappingURL=init-workspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init-workspace.js","sourceRoot":"","sources":["../../../../src/modules/workspace/commands/init-workspace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAA;AACtG,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAEnE,MAAM,UAAU,oBAAoB;IAClC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;SACvB,QAAQ,CAAC,QAAQ,EAAE,0DAA0D,CAAC;SAC9E,WAAW,CAAC,qCAAqC,CAAC;SAClD,MAAM,CAAC,KAAK,EAAE,IAAa,EAAE,EAAE;QAC9B,qCAAqC;QACrC,IAAI,aAAa,GAAG,IAAI,CAAA;QACxB,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,aAAa,GAAG,MAAM,KAAK,CAAC;gBAC1B,OAAO,EAAE,iBAAiB;gBAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;oBAClB,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;wBACxC,OAAO,gCAAgC,CAAA;oBACzC,CAAC;oBACD,MAAM,YAAY,GAAG,cAAc,CAAA;oBACnC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;wBAC9B,OAAO,kEAAkE,CAAA;oBAC3E,CAAC;oBACD,OAAO,IAAI,CAAA;gBACb,CAAC;aACF,CAAC,CAAA;QACJ,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,gCAAgC,aAAa,IAAI,CAAC,CAAC,CAAA;QAE1E,MAAM,OAAO,GAAG,IAAI,gBAAgB,EAAE,CAAA;QAEtC,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,GAAG,CAAC,iCAAiC,CAAC,CAAC,KAAK,EAAE,CAAA;YAE9D,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;YAElF,OAAO,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAA;YAE9C,kBAAkB;YAClB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;YACzB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,yCAAyC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAA;YAC/G,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,GAAG,WAAW,aAAa,IAAI,GAAG,oBAAoB,GAAG,qDAAqD,CAAC,CAAC,CAAA;QACxJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,2BAA2B,EAAE,CAAC;gBACjD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAA;gBAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACjB,CAAC;YAED,IAAI,KAAK,YAAY,yBAAyB,EAAE,CAAC;gBAC/C,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAA;gBAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACjB,CAAC;YAED,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC,CAAC,CAAA;AACN,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare class WorkspaceAlreadyExistsError extends Error {
2
+ workspaceName: string;
3
+ workspacePath: string;
4
+ constructor(workspaceName: string, workspacePath: string);
5
+ }
6
+ export declare class InvalidWorkspaceNameError extends Error {
7
+ workspaceName: string;
8
+ constructor(workspaceName: string);
9
+ }
10
+ //# sourceMappingURL=workspace-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-errors.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/errors/workspace-errors.ts"],"names":[],"mappings":"AAAA,qBAAa,2BAA4B,SAAQ,KAAK;IAE3C,aAAa,EAAE,MAAM;IACrB,aAAa,EAAE,MAAM;gBADrB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM;CAK/B;AAED,qBAAa,yBAA0B,SAAQ,KAAK;IAC/B,aAAa,EAAE,MAAM;gBAArB,aAAa,EAAE,MAAM;CAIzC"}
@@ -0,0 +1,19 @@
1
+ export class WorkspaceAlreadyExistsError extends Error {
2
+ workspaceName;
3
+ workspacePath;
4
+ constructor(workspaceName, workspacePath) {
5
+ super(`Workspace ${workspaceName} already exists at ${workspacePath}`);
6
+ this.workspaceName = workspaceName;
7
+ this.workspacePath = workspacePath;
8
+ this.name = 'WorkspaceAlreadyExistsError';
9
+ }
10
+ }
11
+ export class InvalidWorkspaceNameError extends Error {
12
+ workspaceName;
13
+ constructor(workspaceName) {
14
+ super(`Invalid workspace name: "${workspaceName}"\n\n` + `Workspace names must:\n` + ` • Be lowercase only\n` + ` • Can only contain: lowercase letters, numbers, and hyphens\n` + ` • Cannot contain: spaces, uppercase, underscores, periods, or special characters\n\n` + `Valid examples:\n` + ` ✓ my-workspace\n` + ` ✓ myworkspace\n` + ` ✓ workspace123\n\n` + `Invalid examples:\n` + ` ✗ MyWorkspace (uppercase)\n` + ` ✗ my_workspace (underscores)\n` + ` ✗ my.workspace (periods)\n` + ` ✗ my workspace (spaces)`);
15
+ this.workspaceName = workspaceName;
16
+ this.name = 'InvalidWorkspaceNameError';
17
+ }
18
+ }
19
+ //# sourceMappingURL=workspace-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-errors.js","sourceRoot":"","sources":["../../../../src/modules/workspace/errors/workspace-errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IAE3C;IACA;IAFT,YACS,aAAqB,EACrB,aAAqB;QAE5B,KAAK,CAAC,aAAa,aAAa,sBAAsB,aAAa,EAAE,CAAC,CAAA;QAH/D,kBAAa,GAAb,aAAa,CAAQ;QACrB,kBAAa,GAAb,aAAa,CAAQ;QAG5B,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAA;IAC3C,CAAC;CACF;AAED,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAC/B;IAAnB,YAAmB,aAAqB;QACtC,KAAK,CAAC,4BAA4B,aAAa,OAAO,GAAG,yBAAyB,GAAG,yBAAyB,GAAG,iEAAiE,GAAG,wFAAwF,GAAG,mBAAmB,GAAG,oBAAoB,GAAG,mBAAmB,GAAG,sBAAsB,GAAG,qBAAqB,GAAG,+BAA+B,GAAG,kCAAkC,GAAG,8BAA8B,GAAG,2BAA2B,CAAC,CAAA;QADvf,kBAAa,GAAb,aAAa,CAAQ;QAEtC,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAA;IACzC,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ export { WorkspaceService } from './services/workspace-service.js';
2
+ export type { InitWorkspaceRequest, InitWorkspaceResult } from './types/workspace-types.js';
3
+ export { WorkspaceAlreadyExistsError, InvalidWorkspaceNameError } from './errors/workspace-errors.js';
4
+ export { initWorkspaceCommand } from './commands/init-workspace.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/workspace/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAGlE,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAG3F,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AAGrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA"}
@@ -0,0 +1,7 @@
1
+ // Services
2
+ export { WorkspaceService } from './services/workspace-service.js';
3
+ // Errors
4
+ export { WorkspaceAlreadyExistsError, InvalidWorkspaceNameError } from './errors/workspace-errors.js';
5
+ // Command
6
+ export { initWorkspaceCommand } from './commands/init-workspace.js';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/workspace/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAKlE,SAAS;AACT,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AAErG,UAAU;AACV,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { InitWorkspaceRequest, InitWorkspaceResult } from '../types/workspace-types.js';
2
+ export declare class WorkspaceService {
3
+ initWorkspace(request: InitWorkspaceRequest, cwd: string): Promise<InitWorkspaceResult>;
4
+ private getTemplatePath;
5
+ }
6
+ //# sourceMappingURL=workspace-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-service.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/services/workspace-service.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAE5F,qBAAa,gBAAgB;IACrB,aAAa,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAoC7F,OAAO,CAAC,eAAe;CAYxB"}
@@ -0,0 +1,46 @@
1
+ import * as path from 'path';
2
+ import { fileURLToPath } from 'url';
3
+ import * as filesystem from '../../../infrastructure/filesystem.js';
4
+ import { WorkspaceAlreadyExistsError } from '../errors/workspace-errors.js';
5
+ import { validateWorkspaceName } from '../utils/workspace-validators.js';
6
+ export class WorkspaceService {
7
+ async initWorkspace(request, cwd) {
8
+ const { name } = request;
9
+ // 1. Validate name
10
+ validateWorkspaceName(name);
11
+ // 2. Determine workspace path (relative to current directory)
12
+ const workspacePath = path.join(cwd, name);
13
+ // 3. Check if workspace already exists
14
+ if (await filesystem.exists(workspacePath)) {
15
+ throw new WorkspaceAlreadyExistsError(name, workspacePath);
16
+ }
17
+ // 4. Copy template
18
+ const templatePath = this.getTemplatePath();
19
+ await filesystem.copy(templatePath, workspacePath);
20
+ // 5. Update package.json with workspace name
21
+ const packageJsonPath = path.join(workspacePath, 'package.json');
22
+ const packageJson = await filesystem.readJSON(packageJsonPath);
23
+ packageJson.name = name;
24
+ await filesystem.writeJSON(packageJsonPath, packageJson);
25
+ // 6. Verify workspace.json was created
26
+ const workspaceJsonPath = path.join(workspacePath, '.launch77', 'workspace.json');
27
+ if (!(await filesystem.exists(workspaceJsonPath))) {
28
+ throw new Error('Failed to create workspace manifest (.launch77/workspace.json)');
29
+ }
30
+ return {
31
+ workspacePath,
32
+ name,
33
+ };
34
+ }
35
+ getTemplatePath() {
36
+ const __filename = fileURLToPath(import.meta.url);
37
+ const __dirname = path.dirname(__filename);
38
+ // From src/modules/workspace/services/ or dist/modules/workspace/services/ up to cli root
39
+ const isDev = __filename.includes('/src/');
40
+ const cliRoot = isDev
41
+ ? path.join(__dirname, '../../../..') // src/modules/workspace/services -> cli root
42
+ : path.join(__dirname, '../../../..'); // dist/modules/workspace/services -> cli root
43
+ return path.join(cliRoot, 'templates/workspace');
44
+ }
45
+ }
46
+ //# sourceMappingURL=workspace-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-service.js","sourceRoot":"","sources":["../../../../src/modules/workspace/services/workspace-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAEnC,OAAO,KAAK,UAAU,MAAM,uCAAuC,CAAA;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAIxE,MAAM,OAAO,gBAAgB;IAC3B,KAAK,CAAC,aAAa,CAAC,OAA6B,EAAE,GAAW;QAC5D,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;QAExB,mBAAmB;QACnB,qBAAqB,CAAC,IAAI,CAAC,CAAA;QAE3B,8DAA8D;QAC9D,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QAE1C,uCAAuC;QACvC,IAAI,MAAM,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,2BAA2B,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QAC5D,CAAC;QAED,mBAAmB;QACnB,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,EAAE,CAAA;QAC3C,MAAM,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,CAAA;QAElD,6CAA6C;QAC7C,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;QAChE,MAAM,WAAW,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAoB,eAAe,CAAC,CAAA;QACjF,WAAW,CAAC,IAAI,GAAG,IAAI,CAAA;QACvB,MAAM,UAAU,CAAC,SAAS,CAAC,eAAe,EAAE,WAAW,CAAC,CAAA;QAExD,uCAAuC;QACvC,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAA;QACjF,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC;YAClD,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAA;QACnF,CAAC;QAED,OAAO;YACL,aAAa;YACb,IAAI;SACL,CAAA;IACH,CAAC;IAEO,eAAe;QACrB,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACjD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QAE1C,0FAA0F;QAC1F,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QAC1C,MAAM,OAAO,GAAG,KAAK;YACnB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,6CAA6C;YACnF,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA,CAAC,8CAA8C;QAEtF,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAA;IAClD,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ export interface InitWorkspaceRequest {
2
+ name: string;
3
+ }
4
+ export interface InitWorkspaceResult {
5
+ workspacePath: string;
6
+ name: string;
7
+ }
8
+ //# sourceMappingURL=workspace-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-types.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/types/workspace-types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;CACb"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=workspace-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-types.js","sourceRoot":"","sources":["../../../../src/modules/workspace/types/workspace-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Validate workspace name format
3
+ * - Must be lowercase
4
+ * - Can only contain lowercase letters, numbers, and hyphens
5
+ * - Cannot contain spaces, uppercase, underscores, periods, or special characters
6
+ */
7
+ export declare function validateWorkspaceName(name: string): void;
8
+ //# sourceMappingURL=workspace-validators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-validators.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/utils/workspace-validators.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAUxD"}
@@ -0,0 +1,17 @@
1
+ import { InvalidWorkspaceNameError } from '../errors/workspace-errors.js';
2
+ /**
3
+ * Validate workspace name format
4
+ * - Must be lowercase
5
+ * - Can only contain lowercase letters, numbers, and hyphens
6
+ * - Cannot contain spaces, uppercase, underscores, periods, or special characters
7
+ */
8
+ export function validateWorkspaceName(name) {
9
+ if (!name || name.trim().length === 0) {
10
+ throw new Error('Workspace name cannot be empty');
11
+ }
12
+ const validPattern = /^[a-z0-9-]+$/;
13
+ if (!validPattern.test(name)) {
14
+ throw new InvalidWorkspaceNameError(name);
15
+ }
16
+ }
17
+ //# sourceMappingURL=workspace-validators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-validators.js","sourceRoot":"","sources":["../../../../src/modules/workspace/utils/workspace-validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAA;AAEzE;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;IACnD,CAAC;IAED,MAAM,YAAY,GAAG,cAAc,CAAA;IAEnC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,yBAAyB,CAAC,IAAI,CAAC,CAAA;IAC3C,CAAC;AACH,CAAC"}
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@launch77-shared/plugin-theme",
3
+ "version": "1.0.0",
4
+ "description": "Launch77 theme plugin - Design system with Tailwind preset",
5
+ "type": "module",
6
+ "main": "dist/generator.js",
7
+ "bin": {
8
+ "generate": "./dist/generator.js"
9
+ },
10
+ "files": [
11
+ "dist/",
12
+ "templates/",
13
+ "plugin.json"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsup",
17
+ "dev": "tsup --watch",
18
+ "typecheck": "tsc --noEmit"
19
+ },
20
+ "dependencies": {
21
+ "@launch77/plugin-runtime": "file:../../../launch77-cli/libraries/plugin-runtime/launch77-plugin-runtime-0.1.0.tgz",
22
+ "chalk": "^5.3.0"
23
+ },
24
+ "devDependencies": {
25
+ "@types/node": "^20.10.0",
26
+ "tsup": "^8.0.0",
27
+ "typescript": "^5.3.0"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ }
32
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "theme",
3
+ "version": "1.0.0",
4
+ "description": "Launch77 design system with Tailwind preset and design tokens",
5
+ "pluginDependencies": {},
6
+ "libraryDependencies": {
7
+ "@launch77-shared/lib-theme": "^0.1.0"
8
+ }
9
+ }
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env node
2
+ import * as path from 'path'
3
+ import chalk from 'chalk'
4
+ import { StandardGenerator } from '@launch77/plugin-runtime'
5
+ import type { GeneratorContext } from '@launch77/plugin-runtime'
6
+ import { addTailwindPreset } from './utils/config-modifier.js'
7
+ import { insertCssImports } from './utils/css-modifier.js'
8
+
9
+ export class ThemeGenerator extends StandardGenerator {
10
+ constructor(context: GeneratorContext) {
11
+ super(context)
12
+ }
13
+
14
+ protected async injectCode(): Promise<void> {
15
+ console.log(chalk.cyan('🔧 Configuring theme...\n'))
16
+
17
+ await this.updateGlobalsCss()
18
+ await this.updateTailwindConfig()
19
+ }
20
+
21
+ private async updateGlobalsCss(): Promise<void> {
22
+ const globalsCssPath = path.join(this.context.appPath, 'app/globals.css')
23
+
24
+ const result = await insertCssImports(globalsCssPath, [
25
+ "@import '@launch77-shared/lib-theme/tokens.css';",
26
+ "@import '../src/modules/theme/config/brand.css';",
27
+ ])
28
+
29
+ if (result.success) {
30
+ if (result.alreadyExists) {
31
+ console.log(chalk.gray(' ✓ CSS imports already exist in app/globals.css'))
32
+ } else {
33
+ console.log(chalk.green(' ✓ Added CSS imports to app/globals.css'))
34
+ }
35
+ } else {
36
+ console.log(chalk.yellow(` ⚠️ Could not auto-configure app/globals.css: ${result.error}`))
37
+ console.log(chalk.gray(' You will need to add imports manually'))
38
+ }
39
+ }
40
+
41
+ private async updateTailwindConfig(): Promise<void> {
42
+ const tailwindConfigPath = path.join(this.context.appPath, 'tailwind.config.ts')
43
+
44
+ const result = await addTailwindPreset(tailwindConfigPath, "require('@launch77-shared/lib-theme')")
45
+
46
+ if (result.success) {
47
+ if (result.alreadyExists) {
48
+ console.log(chalk.gray(' ✓ Theme preset already exists in tailwind.config.ts'))
49
+ } else {
50
+ console.log(chalk.green(' ✓ Added theme preset to tailwind.config.ts'))
51
+ }
52
+ } else {
53
+ console.log(chalk.yellow(` ⚠️ Could not auto-configure tailwind.config.ts: ${result.error}`))
54
+ console.log(chalk.gray(' You will need to add preset manually'))
55
+ }
56
+ }
57
+
58
+ protected showNextSteps(): void {
59
+ console.log(chalk.white('Next Steps:\n'))
60
+ console.log(chalk.gray('1. Test your theme:'))
61
+ console.log(chalk.gray(' Visit http://localhost:3000/theme-test\n'))
62
+ console.log(chalk.gray('2. Customize your brand:'))
63
+ console.log(chalk.gray(' Edit src/modules/theme/config/brand.css\n'))
64
+ }
65
+ }
66
+
67
+ // CLI entry point
68
+ async function main() {
69
+ const args = process.argv.slice(2)
70
+ const appPath = args.find((arg) => arg.startsWith('--appPath='))?.split('=')[1]
71
+ const appName = args.find((arg) => arg.startsWith('--appName='))?.split('=')[1]
72
+ const workspaceName = args.find((arg) => arg.startsWith('--workspaceName='))?.split('=')[1]
73
+ const pluginPath = args.find((arg) => arg.startsWith('--pluginPath='))?.split('=')[1]
74
+
75
+ if (!appPath || !appName || !workspaceName || !pluginPath) {
76
+ console.error(chalk.red('Error: Missing required arguments'))
77
+ console.error('Usage: generate --appPath=<path> --appName=<name> --workspaceName=<workspace> --pluginPath=<path>')
78
+ process.exit(1)
79
+ }
80
+
81
+ const generator = new ThemeGenerator({ appPath, appName, workspaceName, pluginPath })
82
+ await generator.run()
83
+ }
84
+
85
+ // Run if executed directly
86
+ if (import.meta.url === `file://${process.argv[1]}`) {
87
+ main().catch((error) => {
88
+ console.error(chalk.red('\n❌ Error during theme setup:'))
89
+ console.error(error)
90
+ process.exit(1)
91
+ })
92
+ }
@@ -0,0 +1,142 @@
1
+ import fs from 'fs/promises'
2
+
3
+ export interface AddTailwindPresetResult {
4
+ success: boolean
5
+ error?: string
6
+ alreadyExists?: boolean
7
+ }
8
+
9
+ /**
10
+ * Add Launch77 theme preset to tailwind.config.ts
11
+ * Idempotent - won't duplicate if preset already exists
12
+ */
13
+ export async function addTailwindPreset(
14
+ filePath: string,
15
+ presetRequire: string
16
+ ): Promise<AddTailwindPresetResult> {
17
+ try {
18
+ // Check if file exists
19
+ const fileExists = await fs
20
+ .access(filePath)
21
+ .then(() => true)
22
+ .catch(() => false)
23
+
24
+ if (!fileExists) {
25
+ return {
26
+ success: false,
27
+ error: `File not found: ${filePath}`,
28
+ }
29
+ }
30
+
31
+ // Read file content
32
+ const content = await fs.readFile(filePath, 'utf-8')
33
+
34
+ // Check if preset already exists
35
+ if (content.includes(presetRequire)) {
36
+ return {
37
+ success: true,
38
+ alreadyExists: true,
39
+ }
40
+ }
41
+
42
+ // Find the config object and check for existing presets property
43
+ const lines = content.split('\n')
44
+ let configStartIndex = -1
45
+ let presetsIndex = -1
46
+ let indentation = ' '
47
+
48
+ // Find where the config object starts
49
+ for (let i = 0; i < lines.length; i++) {
50
+ const line = lines[i]
51
+
52
+ // Look for the config object declaration
53
+ if (line.includes('satisfies Config') || line.includes(': Config =')) {
54
+ configStartIndex = i
55
+ // Detect indentation from first property
56
+ for (let j = i + 1; j < lines.length; j++) {
57
+ const propLine = lines[j]
58
+ const match = propLine.match(/^(\s+)\w+:/)
59
+ if (match) {
60
+ indentation = match[1]
61
+ break
62
+ }
63
+ }
64
+ }
65
+
66
+ // Check if presets property already exists
67
+ if (line.includes('presets:')) {
68
+ presetsIndex = i
69
+ }
70
+ }
71
+
72
+ if (configStartIndex === -1) {
73
+ return {
74
+ success: false,
75
+ error: 'Could not find Tailwind config object',
76
+ }
77
+ }
78
+
79
+ let newContent: string
80
+
81
+ if (presetsIndex !== -1) {
82
+ // Presets property exists - add to existing array
83
+ const presetsLine = lines[presetsIndex]
84
+
85
+ // Check if it's an empty array
86
+ if (presetsLine.includes('[]')) {
87
+ // Replace empty array with array containing our preset
88
+ lines[presetsIndex] = presetsLine.replace('[]', `[${presetRequire}]`)
89
+ } else {
90
+ // Add to existing array - find the opening bracket
91
+ const openBracketIndex = presetsLine.indexOf('[')
92
+ if (openBracketIndex !== -1) {
93
+ // Insert after the opening bracket
94
+ lines[presetsIndex] =
95
+ presetsLine.slice(0, openBracketIndex + 1) +
96
+ presetRequire +
97
+ ', ' +
98
+ presetsLine.slice(openBracketIndex + 1)
99
+ } else {
100
+ return {
101
+ success: false,
102
+ error: 'Could not parse existing presets array',
103
+ }
104
+ }
105
+ }
106
+ newContent = lines.join('\n')
107
+ } else {
108
+ // No presets property - add it as first property in config
109
+ // Find the line after config object starts (skip opening brace)
110
+ let insertIndex = configStartIndex + 1
111
+
112
+ // Skip the opening brace line if it's on the same line
113
+ if (lines[configStartIndex].includes('{')) {
114
+ // Opening brace is on same line, insert after
115
+ } else {
116
+ // Find the opening brace
117
+ while (insertIndex < lines.length && !lines[insertIndex].includes('{')) {
118
+ insertIndex++
119
+ }
120
+ insertIndex++
121
+ }
122
+
123
+ // Insert presets property
124
+ const presetsLine = `${indentation}presets: [${presetRequire}],`
125
+ lines.splice(insertIndex, 0, presetsLine)
126
+
127
+ newContent = lines.join('\n')
128
+ }
129
+
130
+ // Write back to file
131
+ await fs.writeFile(filePath, newContent, 'utf-8')
132
+
133
+ return {
134
+ success: true,
135
+ }
136
+ } catch (error) {
137
+ return {
138
+ success: false,
139
+ error: error instanceof Error ? error.message : String(error),
140
+ }
141
+ }
142
+ }
@@ -0,0 +1,89 @@
1
+ import fs from 'fs/promises'
2
+
3
+ export interface InsertCssImportsResult {
4
+ success: boolean
5
+ error?: string
6
+ alreadyExists?: boolean
7
+ }
8
+
9
+ /**
10
+ * Insert CSS imports after @tailwind directives
11
+ * Idempotent - won't duplicate if imports already exist
12
+ */
13
+ export async function insertCssImports(
14
+ filePath: string,
15
+ imports: string[]
16
+ ): Promise<InsertCssImportsResult> {
17
+ try {
18
+ // Check if file exists
19
+ const fileExists = await fs
20
+ .access(filePath)
21
+ .then(() => true)
22
+ .catch(() => false)
23
+
24
+ if (!fileExists) {
25
+ return {
26
+ success: false,
27
+ error: `File not found: ${filePath}`,
28
+ }
29
+ }
30
+
31
+ // Read file content
32
+ const content = await fs.readFile(filePath, 'utf-8')
33
+
34
+ // Check if imports already exist
35
+ const allImportsExist = imports.every((importLine) => content.includes(importLine))
36
+
37
+ if (allImportsExist) {
38
+ return {
39
+ success: true,
40
+ alreadyExists: true,
41
+ }
42
+ }
43
+
44
+ // Find the last @tailwind directive
45
+ const lines = content.split('\n')
46
+ let lastTailwindIndex = -1
47
+
48
+ for (let i = 0; i < lines.length; i++) {
49
+ if (lines[i].trim().startsWith('@tailwind')) {
50
+ lastTailwindIndex = i
51
+ }
52
+ }
53
+
54
+ if (lastTailwindIndex === -1) {
55
+ return {
56
+ success: false,
57
+ error: 'Could not find @tailwind directives',
58
+ }
59
+ }
60
+
61
+ // Insert imports after the last @tailwind directive
62
+ const importsToAdd = imports.filter((importLine) => !content.includes(importLine))
63
+
64
+ if (importsToAdd.length === 0) {
65
+ return {
66
+ success: true,
67
+ alreadyExists: true,
68
+ }
69
+ }
70
+
71
+ // Build the new content
72
+ const before = lines.slice(0, lastTailwindIndex + 1)
73
+ const after = lines.slice(lastTailwindIndex + 1)
74
+
75
+ const newContent = [...before, '', '/* Launch77 Theme */', ...importsToAdd, ...after].join('\n')
76
+
77
+ // Write back to file
78
+ await fs.writeFile(filePath, newContent, 'utf-8')
79
+
80
+ return {
81
+ success: true,
82
+ }
83
+ } catch (error) {
84
+ return {
85
+ success: false,
86
+ error: error instanceof Error ? error.message : String(error),
87
+ }
88
+ }
89
+ }