@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.
- package/.eslintrc.json +6 -0
- package/dist/app-templates/webapp/.env.ci +6 -0
- package/dist/app-templates/webapp/.env.example +9 -0
- package/dist/app-templates/webapp/.eslintrc.json +6 -0
- package/dist/app-templates/webapp/README.md.hbs +80 -0
- package/dist/app-templates/webapp/app/about/page.tsx.hbs +41 -0
- package/dist/app-templates/webapp/app/dashboard/page.tsx.hbs +51 -0
- package/dist/app-templates/webapp/app/globals.css +31 -0
- package/dist/app-templates/webapp/app/layout.tsx.hbs +26 -0
- package/dist/app-templates/webapp/app/page.tsx.hbs +30 -0
- package/dist/app-templates/webapp/next.config.js +99 -0
- package/dist/app-templates/webapp/package.json.hbs +30 -0
- package/dist/app-templates/webapp/postcss.config.js +6 -0
- package/dist/app-templates/webapp/tailwind.config.ts +24 -0
- package/dist/app-templates/webapp/tsconfig.json +29 -0
- package/dist/app-templates/webapp/vercel.json.hbs +7 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +29 -0
- package/dist/cli.js.map +1 -0
- package/dist/infrastructure/filesystem.d.ts +41 -0
- package/dist/infrastructure/filesystem.d.ts.map +1 -0
- package/dist/infrastructure/filesystem.js +61 -0
- package/dist/infrastructure/filesystem.js.map +1 -0
- package/dist/infrastructure/npm.d.ts +9 -0
- package/dist/infrastructure/npm.d.ts.map +1 -0
- package/dist/infrastructure/npm.js +17 -0
- package/dist/infrastructure/npm.js.map +1 -0
- package/dist/infrastructure/template-engine.d.ts +12 -0
- package/dist/infrastructure/template-engine.d.ts.map +1 -0
- package/dist/infrastructure/template-engine.js +40 -0
- package/dist/infrastructure/template-engine.js.map +1 -0
- package/dist/infrastructure/template-generator.d.ts +9 -0
- package/dist/infrastructure/template-generator.d.ts.map +1 -0
- package/dist/infrastructure/template-generator.js +19 -0
- package/dist/infrastructure/template-generator.js.map +1 -0
- package/dist/infrastructure/template.d.ts +20 -0
- package/dist/infrastructure/template.d.ts.map +1 -0
- package/dist/infrastructure/template.js +53 -0
- package/dist/infrastructure/template.js.map +1 -0
- package/dist/modules/app/commands/create-app.d.ts +3 -0
- package/dist/modules/app/commands/create-app.d.ts.map +1 -0
- package/dist/modules/app/commands/create-app.js +51 -0
- package/dist/modules/app/commands/create-app.js.map +1 -0
- package/dist/modules/app/commands/delete-app.d.ts +3 -0
- package/dist/modules/app/commands/delete-app.d.ts.map +1 -0
- package/dist/modules/app/commands/delete-app.js +109 -0
- package/dist/modules/app/commands/delete-app.js.map +1 -0
- package/dist/modules/app/commands/generate-manifest.d.ts +3 -0
- package/dist/modules/app/commands/generate-manifest.d.ts.map +1 -0
- package/dist/modules/app/commands/generate-manifest.js +62 -0
- package/dist/modules/app/commands/generate-manifest.js.map +1 -0
- package/dist/modules/app/commands/validate-manifest.d.ts +3 -0
- package/dist/modules/app/commands/validate-manifest.d.ts.map +1 -0
- package/dist/modules/app/commands/validate-manifest.js +68 -0
- package/dist/modules/app/commands/validate-manifest.js.map +1 -0
- package/dist/modules/app/errors/app-errors.d.ts +19 -0
- package/dist/modules/app/errors/app-errors.d.ts.map +1 -0
- package/dist/modules/app/errors/app-errors.js +37 -0
- package/dist/modules/app/errors/app-errors.js.map +1 -0
- package/dist/modules/app/index.d.ts +10 -0
- package/dist/modules/app/index.d.ts.map +1 -0
- package/dist/modules/app/index.js +11 -0
- package/dist/modules/app/index.js.map +1 -0
- package/dist/modules/app/lib/manifest-schema.d.ts +39 -0
- package/dist/modules/app/lib/manifest-schema.d.ts.map +1 -0
- package/dist/modules/app/lib/manifest-schema.js +44 -0
- package/dist/modules/app/lib/manifest-schema.js.map +1 -0
- package/dist/modules/app/services/app-svc.d.ts +15 -0
- package/dist/modules/app/services/app-svc.d.ts.map +1 -0
- package/dist/modules/app/services/app-svc.js +90 -0
- package/dist/modules/app/services/app-svc.js.map +1 -0
- package/dist/modules/app/services/manifest-svc.d.ts +28 -0
- package/dist/modules/app/services/manifest-svc.d.ts.map +1 -0
- package/dist/modules/app/services/manifest-svc.js +119 -0
- package/dist/modules/app/services/manifest-svc.js.map +1 -0
- package/dist/modules/app/types/app-types.d.ts +21 -0
- package/dist/modules/app/types/app-types.d.ts.map +1 -0
- package/dist/modules/app/types/app-types.js +5 -0
- package/dist/modules/app/types/app-types.js.map +1 -0
- package/dist/modules/catalog/commands/generate.d.ts +9 -0
- package/dist/modules/catalog/commands/generate.d.ts.map +1 -0
- package/dist/modules/catalog/commands/generate.js +94 -0
- package/dist/modules/catalog/commands/generate.js.map +1 -0
- package/dist/modules/catalog/commands/scan.d.ts +9 -0
- package/dist/modules/catalog/commands/scan.d.ts.map +1 -0
- package/dist/modules/catalog/commands/scan.js +43 -0
- package/dist/modules/catalog/commands/scan.js.map +1 -0
- package/dist/modules/catalog/config/catalog-config.d.ts +49 -0
- package/dist/modules/catalog/config/catalog-config.d.ts.map +1 -0
- package/dist/modules/catalog/config/catalog-config.js +116 -0
- package/dist/modules/catalog/config/catalog-config.js.map +1 -0
- package/dist/modules/catalog/config/catalog-config.test.d.ts +2 -0
- package/dist/modules/catalog/config/catalog-config.test.d.ts.map +1 -0
- package/dist/modules/catalog/config/catalog-config.test.js +362 -0
- package/dist/modules/catalog/config/catalog-config.test.js.map +1 -0
- package/dist/modules/catalog/index.d.ts +9 -0
- package/dist/modules/catalog/index.d.ts.map +1 -0
- package/dist/modules/catalog/index.js +9 -0
- package/dist/modules/catalog/index.js.map +1 -0
- package/dist/modules/catalog/parsers/typescript-parser.d.ts +15 -0
- package/dist/modules/catalog/parsers/typescript-parser.d.ts.map +1 -0
- package/dist/modules/catalog/parsers/typescript-parser.js +82 -0
- package/dist/modules/catalog/parsers/typescript-parser.js.map +1 -0
- package/dist/modules/catalog/scanners/metadata-extractor.d.ts +10 -0
- package/dist/modules/catalog/scanners/metadata-extractor.d.ts.map +1 -0
- package/dist/modules/catalog/scanners/metadata-extractor.js +122 -0
- package/dist/modules/catalog/scanners/metadata-extractor.js.map +1 -0
- package/dist/modules/catalog/scanners/metadata-validator.d.ts +6 -0
- package/dist/modules/catalog/scanners/metadata-validator.d.ts.map +1 -0
- package/dist/modules/catalog/scanners/metadata-validator.js +57 -0
- package/dist/modules/catalog/scanners/metadata-validator.js.map +1 -0
- package/dist/modules/catalog/scanners/ui-component-scanner.d.ts +11 -0
- package/dist/modules/catalog/scanners/ui-component-scanner.d.ts.map +1 -0
- package/dist/modules/catalog/scanners/ui-component-scanner.js +147 -0
- package/dist/modules/catalog/scanners/ui-component-scanner.js.map +1 -0
- package/dist/modules/catalog/schemas/catalog-ui-components.schema.json +161 -0
- package/dist/modules/catalog/schemas/schemas/catalog-ui-components.schema.json +145 -0
- package/dist/modules/catalog/services/catalog-generator-svc.d.ts +27 -0
- package/dist/modules/catalog/services/catalog-generator-svc.d.ts.map +1 -0
- package/dist/modules/catalog/services/catalog-generator-svc.js +100 -0
- package/dist/modules/catalog/services/catalog-generator-svc.js.map +1 -0
- package/dist/modules/catalog/services/catalog-generator-svc.test.d.ts +2 -0
- package/dist/modules/catalog/services/catalog-generator-svc.test.d.ts.map +1 -0
- package/dist/modules/catalog/services/catalog-generator-svc.test.js +201 -0
- package/dist/modules/catalog/services/catalog-generator-svc.test.js.map +1 -0
- package/dist/modules/catalog/services/catalog-svc.d.ts +39 -0
- package/dist/modules/catalog/services/catalog-svc.d.ts.map +1 -0
- package/dist/modules/catalog/services/catalog-svc.js +163 -0
- package/dist/modules/catalog/services/catalog-svc.js.map +1 -0
- package/dist/modules/catalog/types/catalog-types.d.ts +120 -0
- package/dist/modules/catalog/types/catalog-types.d.ts.map +1 -0
- package/dist/modules/catalog/types/catalog-types.js +5 -0
- package/dist/modules/catalog/types/catalog-types.js.map +1 -0
- package/dist/modules/catalog/utils/examples-generator.d.ts +6 -0
- package/dist/modules/catalog/utils/examples-generator.d.ts.map +1 -0
- package/dist/modules/catalog/utils/examples-generator.js +55 -0
- package/dist/modules/catalog/utils/examples-generator.js.map +1 -0
- package/dist/modules/catalog/utils/quality-reporter.d.ts +13 -0
- package/dist/modules/catalog/utils/quality-reporter.d.ts.map +1 -0
- package/dist/modules/catalog/utils/quality-reporter.js +64 -0
- package/dist/modules/catalog/utils/quality-reporter.js.map +1 -0
- package/dist/modules/catalog/validators/component-name-validator.d.ts +20 -0
- package/dist/modules/catalog/validators/component-name-validator.d.ts.map +1 -0
- package/dist/modules/catalog/validators/component-name-validator.js +33 -0
- package/dist/modules/catalog/validators/component-name-validator.js.map +1 -0
- package/dist/modules/catalog/validators/component-name-validator.test.d.ts +2 -0
- package/dist/modules/catalog/validators/component-name-validator.test.d.ts.map +1 -0
- package/dist/modules/catalog/validators/component-name-validator.test.js +196 -0
- package/dist/modules/catalog/validators/component-name-validator.test.js.map +1 -0
- package/dist/modules/deploy/commands/deploy-init-action.d.ts +12 -0
- package/dist/modules/deploy/commands/deploy-init-action.d.ts.map +1 -0
- package/dist/modules/deploy/commands/deploy-init-action.js +220 -0
- package/dist/modules/deploy/commands/deploy-init-action.js.map +1 -0
- package/dist/modules/deploy/commands/deploy-init.d.ts +6 -0
- package/dist/modules/deploy/commands/deploy-init.d.ts.map +1 -0
- package/dist/modules/deploy/commands/deploy-init.js +16 -0
- package/dist/modules/deploy/commands/deploy-init.js.map +1 -0
- package/dist/modules/deploy/commands/deploy-logs-action.d.ts +12 -0
- package/dist/modules/deploy/commands/deploy-logs-action.d.ts.map +1 -0
- package/dist/modules/deploy/commands/deploy-logs-action.js +113 -0
- package/dist/modules/deploy/commands/deploy-logs-action.js.map +1 -0
- package/dist/modules/deploy/commands/deploy-logs.d.ts +6 -0
- package/dist/modules/deploy/commands/deploy-logs.d.ts.map +1 -0
- package/dist/modules/deploy/commands/deploy-logs.js +17 -0
- package/dist/modules/deploy/commands/deploy-logs.js.map +1 -0
- package/dist/modules/deploy/commands/deploy-status-action.d.ts +8 -0
- package/dist/modules/deploy/commands/deploy-status-action.d.ts.map +1 -0
- package/dist/modules/deploy/commands/deploy-status-action.js +153 -0
- package/dist/modules/deploy/commands/deploy-status-action.js.map +1 -0
- package/dist/modules/deploy/commands/deploy-status.d.ts +6 -0
- package/dist/modules/deploy/commands/deploy-status.d.ts.map +1 -0
- package/dist/modules/deploy/commands/deploy-status.js +13 -0
- package/dist/modules/deploy/commands/deploy-status.js.map +1 -0
- package/dist/modules/deploy/index.d.ts +7 -0
- package/dist/modules/deploy/index.d.ts.map +1 -0
- package/dist/modules/deploy/index.js +7 -0
- package/dist/modules/deploy/index.js.map +1 -0
- package/dist/modules/deploy/services/deploy-svc.d.ts +17 -0
- package/dist/modules/deploy/services/deploy-svc.d.ts.map +1 -0
- package/dist/modules/deploy/services/deploy-svc.js +25 -0
- package/dist/modules/deploy/services/deploy-svc.js.map +1 -0
- package/dist/modules/deploy/utils/vercel-extended.d.ts +63 -0
- package/dist/modules/deploy/utils/vercel-extended.d.ts.map +1 -0
- package/dist/modules/deploy/utils/vercel-extended.js +238 -0
- package/dist/modules/deploy/utils/vercel-extended.js.map +1 -0
- package/dist/modules/plugin/commands/plugin-install.d.ts +3 -0
- package/dist/modules/plugin/commands/plugin-install.d.ts.map +1 -0
- package/dist/modules/plugin/commands/plugin-install.js +45 -0
- package/dist/modules/plugin/commands/plugin-install.js.map +1 -0
- package/dist/modules/plugin/errors/plugin-errors.d.ts +16 -0
- package/dist/modules/plugin/errors/plugin-errors.d.ts.map +1 -0
- package/dist/modules/plugin/errors/plugin-errors.js +39 -0
- package/dist/modules/plugin/errors/plugin-errors.js.map +1 -0
- package/dist/modules/plugin/index.d.ts +6 -0
- package/dist/modules/plugin/index.d.ts.map +1 -0
- package/dist/modules/plugin/index.js +9 -0
- package/dist/modules/plugin/index.js.map +1 -0
- package/dist/modules/plugin/lib/plugin-registry.d.ts +15 -0
- package/dist/modules/plugin/lib/plugin-registry.d.ts.map +1 -0
- package/dist/modules/plugin/lib/plugin-registry.js +47 -0
- package/dist/modules/plugin/lib/plugin-registry.js.map +1 -0
- package/dist/modules/plugin/services/plugin-svc.d.ts +10 -0
- package/dist/modules/plugin/services/plugin-svc.d.ts.map +1 -0
- package/dist/modules/plugin/services/plugin-svc.js +44 -0
- package/dist/modules/plugin/services/plugin-svc.js.map +1 -0
- package/dist/modules/plugin/types/plugin-types.d.ts +19 -0
- package/dist/modules/plugin/types/plugin-types.d.ts.map +1 -0
- package/dist/modules/plugin/types/plugin-types.js +2 -0
- package/dist/modules/plugin/types/plugin-types.js.map +1 -0
- package/dist/modules/startup/commands/create-startup.d.ts +3 -0
- package/dist/modules/startup/commands/create-startup.d.ts.map +1 -0
- package/dist/modules/startup/commands/create-startup.js +43 -0
- package/dist/modules/startup/commands/create-startup.js.map +1 -0
- package/dist/modules/startup/errors/startup-errors.d.ts +13 -0
- package/dist/modules/startup/errors/startup-errors.d.ts.map +1 -0
- package/dist/modules/startup/errors/startup-errors.js +25 -0
- package/dist/modules/startup/errors/startup-errors.js.map +1 -0
- package/dist/modules/startup/index.d.ts +5 -0
- package/dist/modules/startup/index.d.ts.map +1 -0
- package/dist/modules/startup/index.js +7 -0
- package/dist/modules/startup/index.js.map +1 -0
- package/dist/modules/startup/services/startup-service.d.ts +7 -0
- package/dist/modules/startup/services/startup-service.d.ts.map +1 -0
- package/dist/modules/startup/services/startup-service.js +43 -0
- package/dist/modules/startup/services/startup-service.js.map +1 -0
- package/dist/modules/startup/types/startup-types.d.ts +8 -0
- package/dist/modules/startup/types/startup-types.d.ts.map +1 -0
- package/dist/modules/startup/types/startup-types.js +2 -0
- package/dist/modules/startup/types/startup-types.js.map +1 -0
- package/dist/modules/startup/utils/startup-validators.d.ts +8 -0
- package/dist/modules/startup/utils/startup-validators.d.ts.map +1 -0
- package/dist/modules/startup/utils/startup-validators.js +17 -0
- package/dist/modules/startup/utils/startup-validators.js.map +1 -0
- package/dist/modules/workspace/commands/init-workspace.d.ts +3 -0
- package/dist/modules/workspace/commands/init-workspace.d.ts.map +1 -0
- package/dist/modules/workspace/commands/init-workspace.js +54 -0
- package/dist/modules/workspace/commands/init-workspace.js.map +1 -0
- package/dist/modules/workspace/errors/workspace-errors.d.ts +10 -0
- package/dist/modules/workspace/errors/workspace-errors.d.ts.map +1 -0
- package/dist/modules/workspace/errors/workspace-errors.js +19 -0
- package/dist/modules/workspace/errors/workspace-errors.js.map +1 -0
- package/dist/modules/workspace/index.d.ts +5 -0
- package/dist/modules/workspace/index.d.ts.map +1 -0
- package/dist/modules/workspace/index.js +7 -0
- package/dist/modules/workspace/index.js.map +1 -0
- package/dist/modules/workspace/services/workspace-service.d.ts +6 -0
- package/dist/modules/workspace/services/workspace-service.d.ts.map +1 -0
- package/dist/modules/workspace/services/workspace-service.js +46 -0
- package/dist/modules/workspace/services/workspace-service.js.map +1 -0
- package/dist/modules/workspace/types/workspace-types.d.ts +8 -0
- package/dist/modules/workspace/types/workspace-types.d.ts.map +1 -0
- package/dist/modules/workspace/types/workspace-types.js +2 -0
- package/dist/modules/workspace/types/workspace-types.js.map +1 -0
- package/dist/modules/workspace/utils/workspace-validators.d.ts +8 -0
- package/dist/modules/workspace/utils/workspace-validators.d.ts.map +1 -0
- package/dist/modules/workspace/utils/workspace-validators.js +17 -0
- package/dist/modules/workspace/utils/workspace-validators.js.map +1 -0
- package/dist/plugins/theme/package.json +32 -0
- package/dist/plugins/theme/plugin.json +9 -0
- package/dist/plugins/theme/src/generator.ts +92 -0
- package/dist/plugins/theme/src/utils/config-modifier.ts +142 -0
- package/dist/plugins/theme/src/utils/css-modifier.ts +89 -0
- package/dist/plugins/theme/templates/app/theme-test/page.tsx +156 -0
- package/dist/plugins/theme/templates/src/modules/theme/README.md +209 -0
- package/dist/plugins/theme/templates/src/modules/theme/config/brand.css +23 -0
- package/dist/plugins/theme/tsconfig.json +14 -0
- package/dist/plugins/theme/tsup.config.ts +10 -0
- package/dist/templates/startup/apps/.gitkeep +8 -0
- package/dist/templates/templates/startup/apps/.gitkeep +8 -0
- package/dist/templates/templates/workspace/.eslintignore +7 -0
- package/dist/templates/templates/workspace/.eslintrc.js +38 -0
- package/dist/templates/templates/workspace/.husky/pre-push +24 -0
- package/dist/templates/templates/workspace/.launch77/workspace.json +3 -0
- package/dist/templates/templates/workspace/.lintstagedrc.json +4 -0
- package/dist/templates/templates/workspace/.prettierrc +9 -0
- package/dist/templates/templates/workspace/README.md +62 -0
- package/dist/templates/templates/workspace/app-templates/.gitkeep +1 -0
- package/dist/templates/templates/workspace/apps/.gitkeep +1 -0
- package/dist/templates/templates/workspace/libraries/.gitkeep +1 -0
- package/dist/templates/templates/workspace/package.json +31 -0
- package/dist/templates/templates/workspace/plugins/.gitkeep +1 -0
- package/dist/templates/templates/workspace/tsconfig.json +22 -0
- package/dist/templates/templates/workspace/turbo.json +25 -0
- package/dist/templates/workspace/.launch77/workspace.json +3 -0
- package/dist/templates/workspace/README.md +62 -0
- package/dist/templates/workspace/app-templates/.gitkeep +1 -0
- package/dist/templates/workspace/apps/.gitkeep +1 -0
- package/dist/templates/workspace/libraries/.gitkeep +1 -0
- package/dist/templates/workspace/package.json +21 -0
- package/dist/templates/workspace/plugins/.gitkeep +1 -0
- package/dist/templates/workspace/tsconfig.json +22 -0
- package/dist/templates/workspace/turbo.json +25 -0
- package/dist/utils/launch77-context.d.ts +16 -0
- package/dist/utils/launch77-context.d.ts.map +1 -0
- package/dist/utils/launch77-context.js +111 -0
- package/dist/utils/launch77-context.js.map +1 -0
- package/dist/utils/launch77-validation.d.ts +17 -0
- package/dist/utils/launch77-validation.d.ts.map +1 -0
- package/dist/utils/launch77-validation.js +44 -0
- package/dist/utils/launch77-validation.js.map +1 -0
- package/dist/utils/monorepo.d.ts +19 -0
- package/dist/utils/monorepo.d.ts.map +1 -0
- package/dist/utils/monorepo.js +100 -0
- package/dist/utils/monorepo.js.map +1 -0
- package/dist/utils/validation.d.ts +32 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +92 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/utils/version.d.ts +7 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +16 -0
- package/dist/utils/version.js.map +1 -0
- package/launch77-cli-1.2.0.tgz +0 -0
- package/package.json +48 -0
- package/src/cli.ts +34 -0
- package/src/infrastructure/filesystem.ts +69 -0
- package/src/infrastructure/npm.ts +18 -0
- package/src/infrastructure/template-engine.ts +48 -0
- package/src/infrastructure/template-generator.ts +26 -0
- package/src/infrastructure/template.ts +66 -0
- package/src/modules/app/commands/create-app.ts +60 -0
- package/src/modules/app/commands/delete-app.ts +123 -0
- package/src/modules/app/commands/generate-manifest.ts +75 -0
- package/src/modules/app/commands/validate-manifest.ts +78 -0
- package/src/modules/app/errors/app-errors.ts +41 -0
- package/src/modules/app/index.ts +16 -0
- package/src/modules/app/lib/manifest-schema.ts +65 -0
- package/src/modules/app/services/app-svc.ts +115 -0
- package/src/modules/app/services/manifest-svc.ts +144 -0
- package/src/modules/app/types/app-types.ts +27 -0
- package/src/modules/catalog/commands/generate.ts +115 -0
- package/src/modules/catalog/commands/scan.ts +48 -0
- package/src/modules/catalog/config/catalog-config.test.ts +404 -0
- package/src/modules/catalog/config/catalog-config.ts +130 -0
- package/src/modules/catalog/index.ts +9 -0
- package/src/modules/catalog/parsers/typescript-parser.ts +93 -0
- package/src/modules/catalog/scanners/metadata-extractor.ts +134 -0
- package/src/modules/catalog/scanners/metadata-validator.ts +67 -0
- package/src/modules/catalog/scanners/ui-component-scanner.ts +185 -0
- package/src/modules/catalog/schemas/catalog-ui-components.schema.json +145 -0
- package/src/modules/catalog/services/catalog-generator-svc.test.ts +233 -0
- package/src/modules/catalog/services/catalog-generator-svc.ts +124 -0
- package/src/modules/catalog/services/catalog-svc.ts +222 -0
- package/src/modules/catalog/types/catalog-types.ts +149 -0
- package/src/modules/catalog/utils/examples-generator.ts +68 -0
- package/src/modules/catalog/utils/quality-reporter.ts +76 -0
- package/src/modules/catalog/validators/component-name-validator.test.ts +233 -0
- package/src/modules/catalog/validators/component-name-validator.ts +43 -0
- package/src/modules/deploy/commands/deploy-init-action.ts +247 -0
- package/src/modules/deploy/commands/deploy-init.ts +19 -0
- package/src/modules/deploy/commands/deploy-logs-action.ts +135 -0
- package/src/modules/deploy/commands/deploy-logs.ts +20 -0
- package/src/modules/deploy/commands/deploy-status-action.ts +175 -0
- package/src/modules/deploy/commands/deploy-status.ts +16 -0
- package/src/modules/deploy/index.ts +7 -0
- package/src/modules/deploy/services/deploy-svc.ts +31 -0
- package/src/modules/deploy/utils/vercel-extended.ts +286 -0
- package/src/modules/plugin/commands/plugin-install.ts +51 -0
- package/src/modules/plugin/errors/plugin-errors.ts +44 -0
- package/src/modules/plugin/index.ts +14 -0
- package/src/modules/plugin/lib/launch77-workspace.code-workspace +14 -0
- package/src/modules/plugin/lib/plugin-registry.ts +59 -0
- package/src/modules/plugin/services/plugin-svc.ts +53 -0
- package/src/modules/plugin/types/plugin-types.ts +21 -0
- package/src/modules/startup/commands/create-startup.ts +53 -0
- package/src/modules/startup/errors/startup-errors.ts +23 -0
- package/src/modules/startup/index.ts +11 -0
- package/src/modules/startup/services/startup-service.ts +57 -0
- package/src/modules/startup/types/startup-types.ts +8 -0
- package/src/modules/startup/utils/startup-validators.ts +19 -0
- package/src/modules/workspace/commands/init-workspace.ts +63 -0
- package/src/modules/workspace/errors/workspace-errors.ts +16 -0
- package/src/modules/workspace/index.ts +11 -0
- package/src/modules/workspace/services/workspace-service.ts +59 -0
- package/src/modules/workspace/types/workspace-types.ts +8 -0
- package/src/modules/workspace/utils/workspace-validators.ts +19 -0
- package/src/utils/launch77-context.ts +152 -0
- package/src/utils/launch77-validation.ts +59 -0
- package/src/utils/monorepo.ts +137 -0
- package/src/utils/validation.ts +117 -0
- package/src/utils/version.ts +16 -0
- package/templates/startup/apps/.gitkeep +8 -0
- package/templates/workspace/.eslintignore +7 -0
- package/templates/workspace/.eslintrc.js +38 -0
- package/templates/workspace/.husky/pre-push +24 -0
- package/templates/workspace/.launch77/workspace.json +3 -0
- package/templates/workspace/.lintstagedrc.json +4 -0
- package/templates/workspace/.prettierrc +9 -0
- package/templates/workspace/README.md +62 -0
- package/templates/workspace/app-templates/.gitkeep +1 -0
- package/templates/workspace/apps/.gitkeep +1 -0
- package/templates/workspace/libraries/.gitkeep +1 -0
- package/templates/workspace/package.json +31 -0
- package/templates/workspace/plugins/.gitkeep +1 -0
- package/templates/workspace/tsconfig.json +22 -0
- package/templates/workspace/turbo.json +25 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import path from 'path'
|
|
2
|
+
|
|
3
|
+
import fs from 'fs-extra'
|
|
4
|
+
import { describe, test, expect, beforeEach, afterEach } from 'vitest'
|
|
5
|
+
|
|
6
|
+
import { CatalogGeneratorService } from './catalog-generator-svc.js'
|
|
7
|
+
|
|
8
|
+
import type { CatalogConfig } from '../types/catalog-types.js'
|
|
9
|
+
|
|
10
|
+
describe('CatalogGeneratorService', () => {
|
|
11
|
+
const service = new CatalogGeneratorService()
|
|
12
|
+
const testDir = path.join(process.cwd(), '.test-temp', 'catalog-generator')
|
|
13
|
+
|
|
14
|
+
beforeEach(async () => {
|
|
15
|
+
// Create test directory
|
|
16
|
+
await fs.ensureDir(testDir)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
afterEach(async () => {
|
|
20
|
+
// Clean up test directory
|
|
21
|
+
await fs.remove(testDir)
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
describe('generateForLibrary', () => {
|
|
25
|
+
test('throws error if package.json not found', async () => {
|
|
26
|
+
const emptyDir = path.join(testDir, 'empty-lib')
|
|
27
|
+
await fs.ensureDir(emptyDir)
|
|
28
|
+
|
|
29
|
+
const config: CatalogConfig = {
|
|
30
|
+
type: 'ui-components',
|
|
31
|
+
packageName: '@test/lib',
|
|
32
|
+
sourceDir: './src',
|
|
33
|
+
componentsDir: './src/components',
|
|
34
|
+
exportsFile: './src/index.ts',
|
|
35
|
+
outputFile: 'catalog-ui-components.json',
|
|
36
|
+
catalogVersion: '0.1.0',
|
|
37
|
+
validation: {
|
|
38
|
+
strict: true,
|
|
39
|
+
requireCategory: true,
|
|
40
|
+
requireDescription: true,
|
|
41
|
+
minDescriptionLength: 20,
|
|
42
|
+
requireWhenToUse: true,
|
|
43
|
+
requireWhenNotToUse: true,
|
|
44
|
+
minTags: 3,
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
await expect(service.generateForLibrary(emptyDir, config)).rejects.toThrow('package.json not found')
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
test('throws error if package.json has no version', async () => {
|
|
52
|
+
const libDir = path.join(testDir, 'no-version-lib')
|
|
53
|
+
await fs.ensureDir(libDir)
|
|
54
|
+
await fs.writeJson(path.join(libDir, 'package.json'), { name: '@test/lib' })
|
|
55
|
+
|
|
56
|
+
const config: CatalogConfig = {
|
|
57
|
+
type: 'ui-components',
|
|
58
|
+
packageName: '@test/lib',
|
|
59
|
+
sourceDir: './src',
|
|
60
|
+
componentsDir: './src/components',
|
|
61
|
+
exportsFile: './src/index.ts',
|
|
62
|
+
outputFile: 'catalog-ui-components.json',
|
|
63
|
+
catalogVersion: '0.1.0',
|
|
64
|
+
validation: {
|
|
65
|
+
strict: true,
|
|
66
|
+
requireCategory: true,
|
|
67
|
+
requireDescription: true,
|
|
68
|
+
minDescriptionLength: 20,
|
|
69
|
+
requireWhenToUse: true,
|
|
70
|
+
requireWhenNotToUse: true,
|
|
71
|
+
minTags: 3,
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
await expect(service.generateForLibrary(libDir, config)).rejects.toThrow('does not have a version field')
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
test('generates empty catalog for library with no components', async () => {
|
|
79
|
+
const libDir = path.join(testDir, 'empty-components-lib')
|
|
80
|
+
await fs.ensureDir(path.join(libDir, 'src'))
|
|
81
|
+
await fs.writeJson(path.join(libDir, 'package.json'), {
|
|
82
|
+
name: '@test/lib',
|
|
83
|
+
version: '1.0.0',
|
|
84
|
+
})
|
|
85
|
+
await fs.writeFile(path.join(libDir, 'src', 'index.ts'), '// No exports')
|
|
86
|
+
|
|
87
|
+
const config: CatalogConfig = {
|
|
88
|
+
type: 'ui-components',
|
|
89
|
+
packageName: '@test/lib',
|
|
90
|
+
sourceDir: './src',
|
|
91
|
+
componentsDir: './src/components',
|
|
92
|
+
exportsFile: './src/index.ts',
|
|
93
|
+
outputFile: 'catalog-ui-components.json',
|
|
94
|
+
catalogVersion: '0.1.0',
|
|
95
|
+
validation: {
|
|
96
|
+
strict: false, // Non-strict to allow empty catalog
|
|
97
|
+
requireCategory: true,
|
|
98
|
+
requireDescription: true,
|
|
99
|
+
minDescriptionLength: 20,
|
|
100
|
+
requireWhenToUse: true,
|
|
101
|
+
requireWhenNotToUse: true,
|
|
102
|
+
minTags: 3,
|
|
103
|
+
},
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const result = await service.generateForLibrary(libDir, config)
|
|
107
|
+
|
|
108
|
+
expect(result.success).toBe(true)
|
|
109
|
+
expect(result.qualityReport.totalComponents).toBe(0)
|
|
110
|
+
expect(await fs.pathExists(path.join(libDir, 'catalog-ui-components.json'))).toBe(true)
|
|
111
|
+
|
|
112
|
+
const catalog = await fs.readJson(path.join(libDir, 'catalog-ui-components.json'))
|
|
113
|
+
expect(catalog.catalogType).toBe('ui-components')
|
|
114
|
+
expect(catalog.catalogVersion).toBe('0.1.0')
|
|
115
|
+
expect(catalog.packageName).toBe('@test/lib')
|
|
116
|
+
expect(catalog.packageVersion).toBe('1.0.0')
|
|
117
|
+
expect(catalog.components).toEqual([])
|
|
118
|
+
expect(catalog.generatedAt).toBeTruthy()
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
test('writes catalog to configured output file', async () => {
|
|
122
|
+
const libDir = path.join(testDir, 'custom-output-lib')
|
|
123
|
+
await fs.ensureDir(path.join(libDir, 'src'))
|
|
124
|
+
await fs.writeJson(path.join(libDir, 'package.json'), {
|
|
125
|
+
name: '@test/lib',
|
|
126
|
+
version: '2.0.0',
|
|
127
|
+
})
|
|
128
|
+
await fs.writeFile(path.join(libDir, 'src', 'index.ts'), '// No exports')
|
|
129
|
+
|
|
130
|
+
const config: CatalogConfig = {
|
|
131
|
+
type: 'ui-components',
|
|
132
|
+
packageName: '@test/lib',
|
|
133
|
+
sourceDir: './src',
|
|
134
|
+
componentsDir: './src/components',
|
|
135
|
+
exportsFile: './src/index.ts',
|
|
136
|
+
outputFile: 'custom-catalog.json', // Custom output file
|
|
137
|
+
catalogVersion: '1.2.3',
|
|
138
|
+
validation: {
|
|
139
|
+
strict: false,
|
|
140
|
+
requireCategory: true,
|
|
141
|
+
requireDescription: true,
|
|
142
|
+
minDescriptionLength: 20,
|
|
143
|
+
requireWhenToUse: true,
|
|
144
|
+
requireWhenNotToUse: true,
|
|
145
|
+
minTags: 3,
|
|
146
|
+
},
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const result = await service.generateForLibrary(libDir, config)
|
|
150
|
+
|
|
151
|
+
expect(result.success).toBe(true)
|
|
152
|
+
expect(result.catalogFile).toBe(path.join(libDir, 'custom-catalog.json'))
|
|
153
|
+
expect(await fs.pathExists(path.join(libDir, 'custom-catalog.json'))).toBe(true)
|
|
154
|
+
|
|
155
|
+
const catalog = await fs.readJson(path.join(libDir, 'custom-catalog.json'))
|
|
156
|
+
expect(catalog.catalogVersion).toBe('1.2.3')
|
|
157
|
+
expect(catalog.packageVersion).toBe('2.0.0')
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
test('catalog includes correct metadata structure', async () => {
|
|
161
|
+
const libDir = path.join(testDir, 'metadata-lib')
|
|
162
|
+
await fs.ensureDir(path.join(libDir, 'src'))
|
|
163
|
+
await fs.writeJson(path.join(libDir, 'package.json'), {
|
|
164
|
+
name: '@test/meta-lib',
|
|
165
|
+
version: '3.1.4',
|
|
166
|
+
})
|
|
167
|
+
await fs.writeFile(path.join(libDir, 'src', 'index.ts'), '')
|
|
168
|
+
|
|
169
|
+
const config: CatalogConfig = {
|
|
170
|
+
type: 'ui-components',
|
|
171
|
+
packageName: '@test/meta-lib',
|
|
172
|
+
sourceDir: './src',
|
|
173
|
+
componentsDir: './src/components',
|
|
174
|
+
exportsFile: './src/index.ts',
|
|
175
|
+
outputFile: 'catalog-ui-components.json',
|
|
176
|
+
catalogVersion: '2.0.0',
|
|
177
|
+
validation: {
|
|
178
|
+
strict: false,
|
|
179
|
+
requireCategory: true,
|
|
180
|
+
requireDescription: true,
|
|
181
|
+
minDescriptionLength: 20,
|
|
182
|
+
requireWhenToUse: true,
|
|
183
|
+
requireWhenNotToUse: true,
|
|
184
|
+
minTags: 3,
|
|
185
|
+
},
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const result = await service.generateForLibrary(libDir, config)
|
|
189
|
+
|
|
190
|
+
expect(result.success).toBe(true)
|
|
191
|
+
|
|
192
|
+
const catalog = await fs.readJson(path.join(libDir, 'catalog-ui-components.json'))
|
|
193
|
+
|
|
194
|
+
// Verify required fields
|
|
195
|
+
expect(catalog).toHaveProperty('catalogType', 'ui-components')
|
|
196
|
+
expect(catalog).toHaveProperty('catalogVersion', '2.0.0')
|
|
197
|
+
expect(catalog).toHaveProperty('packageName', '@test/meta-lib')
|
|
198
|
+
expect(catalog).toHaveProperty('packageVersion', '3.1.4')
|
|
199
|
+
expect(catalog).toHaveProperty('generatedAt')
|
|
200
|
+
expect(catalog).toHaveProperty('components')
|
|
201
|
+
|
|
202
|
+
// Verify generatedAt is valid ISO date
|
|
203
|
+
expect(() => new Date(catalog.generatedAt)).not.toThrow()
|
|
204
|
+
})
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
describe('error handling', () => {
|
|
208
|
+
test('provides helpful error message on failure', async () => {
|
|
209
|
+
const nonExistentDir = path.join(testDir, 'does-not-exist')
|
|
210
|
+
|
|
211
|
+
const config: CatalogConfig = {
|
|
212
|
+
type: 'ui-components',
|
|
213
|
+
packageName: '@test/lib',
|
|
214
|
+
sourceDir: './src',
|
|
215
|
+
componentsDir: './src/components',
|
|
216
|
+
exportsFile: './src/index.ts',
|
|
217
|
+
outputFile: 'catalog-ui-components.json',
|
|
218
|
+
catalogVersion: '0.1.0',
|
|
219
|
+
validation: {
|
|
220
|
+
strict: true,
|
|
221
|
+
requireCategory: true,
|
|
222
|
+
requireDescription: true,
|
|
223
|
+
minDescriptionLength: 20,
|
|
224
|
+
requireWhenToUse: true,
|
|
225
|
+
requireWhenNotToUse: true,
|
|
226
|
+
minTags: 3,
|
|
227
|
+
},
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
await expect(service.generateForLibrary(nonExistentDir, config)).rejects.toThrow('Failed to generate catalog')
|
|
231
|
+
})
|
|
232
|
+
})
|
|
233
|
+
})
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service for generating catalog metadata files for component libraries
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import path from 'path'
|
|
6
|
+
|
|
7
|
+
import fs from 'fs-extra'
|
|
8
|
+
|
|
9
|
+
import { scanUILibrary } from '../scanners/ui-component-scanner.js'
|
|
10
|
+
import { generateQualityReport } from '../utils/quality-reporter.js'
|
|
11
|
+
|
|
12
|
+
import type { CatalogConfig, UiComponentCatalog, GenerationResult, UiComponent, ValidationResult } from '../types/catalog-types.js'
|
|
13
|
+
|
|
14
|
+
export class CatalogGeneratorService {
|
|
15
|
+
/**
|
|
16
|
+
* Generate catalog metadata for a component library
|
|
17
|
+
*
|
|
18
|
+
* @param libraryPath - Absolute path to the library directory
|
|
19
|
+
* @param config - Validated catalog configuration
|
|
20
|
+
* @returns Generation result with success status and quality report
|
|
21
|
+
*/
|
|
22
|
+
async generateForLibrary(libraryPath: string, config: CatalogConfig): Promise<GenerationResult> {
|
|
23
|
+
try {
|
|
24
|
+
// 1. Scan library components
|
|
25
|
+
const scanResult = await scanUILibrary(libraryPath, config.packageName)
|
|
26
|
+
|
|
27
|
+
// 2. Validate components
|
|
28
|
+
const validatedComponents = this.filterValidComponents(scanResult.components, config)
|
|
29
|
+
|
|
30
|
+
// 3. Extract validation results
|
|
31
|
+
const { errors, warnings } = this.categorizeValidations(scanResult.validations)
|
|
32
|
+
|
|
33
|
+
// 4. Generate quality report
|
|
34
|
+
const qualityReport = generateQualityReport(scanResult.components.length, scanResult.excluded, scanResult.validations)
|
|
35
|
+
|
|
36
|
+
// 5. Check if generation should fail (strict mode with errors)
|
|
37
|
+
if (config.validation.strict && errors.length > 0) {
|
|
38
|
+
return {
|
|
39
|
+
success: false,
|
|
40
|
+
catalogFile: '',
|
|
41
|
+
qualityReport,
|
|
42
|
+
errors,
|
|
43
|
+
warnings,
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 6. Read package version
|
|
48
|
+
const packageJson = await this.readPackageJson(libraryPath)
|
|
49
|
+
|
|
50
|
+
// 7. Create catalog
|
|
51
|
+
const catalog: UiComponentCatalog = {
|
|
52
|
+
$schema: 'https://launch77.io/schemas/catalog-ui-components.schema.json',
|
|
53
|
+
catalogType: 'ui-components',
|
|
54
|
+
catalogVersion: config.catalogVersion,
|
|
55
|
+
packageName: config.packageName,
|
|
56
|
+
packageVersion: packageJson.version,
|
|
57
|
+
generatedAt: new Date().toISOString(),
|
|
58
|
+
components: validatedComponents,
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// 8. Write catalog file
|
|
62
|
+
const outputPath = path.join(libraryPath, config.outputFile)
|
|
63
|
+
await fs.writeJson(outputPath, catalog, { spaces: 2 })
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
success: true,
|
|
67
|
+
catalogFile: outputPath,
|
|
68
|
+
qualityReport,
|
|
69
|
+
errors,
|
|
70
|
+
warnings,
|
|
71
|
+
}
|
|
72
|
+
} catch (error) {
|
|
73
|
+
throw new Error(`Failed to generate catalog: ${error instanceof Error ? error.message : String(error)}`)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Filter components that passed validation
|
|
79
|
+
*/
|
|
80
|
+
private filterValidComponents(components: UiComponent[], config: CatalogConfig): UiComponent[] {
|
|
81
|
+
// In strict mode, only include components with valid metadata
|
|
82
|
+
if (config.validation.strict) {
|
|
83
|
+
return components.filter((component) => {
|
|
84
|
+
// Component is valid if it has required fields
|
|
85
|
+
return component.description && component.category
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// In non-strict mode, include all components
|
|
90
|
+
return components
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Categorize validations into errors and warnings
|
|
95
|
+
*/
|
|
96
|
+
private categorizeValidations(validations: ValidationResult[]): {
|
|
97
|
+
errors: ValidationResult[]
|
|
98
|
+
warnings: ValidationResult[]
|
|
99
|
+
} {
|
|
100
|
+
const errors = validations.filter((v) => !v.valid && v.errors.length > 0)
|
|
101
|
+
const warnings = validations.filter((v) => v.warnings.length > 0)
|
|
102
|
+
|
|
103
|
+
return { errors, warnings }
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Read package.json from library directory
|
|
108
|
+
*/
|
|
109
|
+
private async readPackageJson(libraryPath: string): Promise<{ version: string }> {
|
|
110
|
+
const packageJsonPath = path.join(libraryPath, 'package.json')
|
|
111
|
+
|
|
112
|
+
if (!(await fs.pathExists(packageJsonPath))) {
|
|
113
|
+
throw new Error(`package.json not found in ${libraryPath}`)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const packageJson = await fs.readJson(packageJsonPath)
|
|
117
|
+
|
|
118
|
+
if (!packageJson.version) {
|
|
119
|
+
throw new Error(`package.json in ${libraryPath} does not have a version field`)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return packageJson
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import * as path from 'path'
|
|
2
|
+
|
|
3
|
+
import chalk from 'chalk'
|
|
4
|
+
import fs from 'fs-extra'
|
|
5
|
+
import ora from 'ora'
|
|
6
|
+
import prettier from 'prettier'
|
|
7
|
+
|
|
8
|
+
import { scanUILibrary } from '../scanners/ui-component-scanner.js'
|
|
9
|
+
import { generateExamplesFiles } from '../utils/examples-generator.js'
|
|
10
|
+
import { generateQualityReport, printQualityReport } from '../utils/quality-reporter.js'
|
|
11
|
+
|
|
12
|
+
import type { MonorepoContext } from '../../../utils/monorepo.js'
|
|
13
|
+
import type { ValidationResult, UiComponent } from '../types/catalog-types.js'
|
|
14
|
+
|
|
15
|
+
export interface ScanCatalogOptions {
|
|
16
|
+
strict?: boolean
|
|
17
|
+
quiet?: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ScanCatalogResult {
|
|
21
|
+
catalogPath: string
|
|
22
|
+
version: string
|
|
23
|
+
totalArtifacts: number
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Catalog Service
|
|
28
|
+
*
|
|
29
|
+
* Scans Launch77 artifacts and generates catalog.json
|
|
30
|
+
*/
|
|
31
|
+
export class CatalogService {
|
|
32
|
+
/**
|
|
33
|
+
* Scan Launch77 codebase and generate catalog.json
|
|
34
|
+
*/
|
|
35
|
+
async scanCatalog(context: MonorepoContext, options: ScanCatalogOptions = {}): Promise<ScanCatalogResult> {
|
|
36
|
+
const strict = options.strict !== false // Default to true (strict mode)
|
|
37
|
+
const quiet = options.quiet || false
|
|
38
|
+
|
|
39
|
+
console.log(chalk.blue('\nš Scanning Launch77 artifacts...\n'))
|
|
40
|
+
|
|
41
|
+
const launch77Root = path.join(context.monorepoRoot, 'launch77')
|
|
42
|
+
|
|
43
|
+
const spinner = ora('Scanning codebase...').start()
|
|
44
|
+
|
|
45
|
+
// Phase 1: Scan all UI components deterministically (with validation)
|
|
46
|
+
const { components: uiComponents, validations, excluded } = await this.scanAllUIComponents(launch77Root)
|
|
47
|
+
|
|
48
|
+
spinner.succeed(`Found ${uiComponents.length} UI components`)
|
|
49
|
+
console.log(chalk.gray(` ⢠${uiComponents.length} UI components`))
|
|
50
|
+
if (excluded > 0) {
|
|
51
|
+
console.log(chalk.gray(` ⢠${excluded} excluded (@launch77-ignore)`))
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Generate quality report
|
|
55
|
+
const totalScanned = uiComponents.length + excluded
|
|
56
|
+
const qualityReport = generateQualityReport(totalScanned, excluded, validations)
|
|
57
|
+
|
|
58
|
+
// Print quality report unless in quiet mode
|
|
59
|
+
if (!quiet) {
|
|
60
|
+
printQualityReport(qualityReport, strict)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// In strict mode, fail if there are validation errors
|
|
64
|
+
if (strict && qualityReport.errors.length > 0) {
|
|
65
|
+
throw new Error('Catalog validation failed in strict mode')
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
console.log(chalk.blue('\nš Generating catalog with deterministic data...\n'))
|
|
69
|
+
console.log(chalk.green(' ā All required fields populated'))
|
|
70
|
+
console.log(chalk.green(' ā Props extracted via TypeScript AST'))
|
|
71
|
+
|
|
72
|
+
// Read existing catalog to check if content changed
|
|
73
|
+
const catalogPath = path.join(launch77Root, 'catalog.json')
|
|
74
|
+
const hasChanges = await this.catalogHasChanges(catalogPath, {
|
|
75
|
+
uiComponents,
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
// Get current or next version
|
|
79
|
+
const newVersion = hasChanges ? await this.getNextVersion(catalogPath) : await this.getCurrentVersion(catalogPath)
|
|
80
|
+
|
|
81
|
+
if (!hasChanges) {
|
|
82
|
+
console.log(chalk.gray('\n ā¹ No changes detected - version unchanged\n'))
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Generate examples.generated.ts files for UI libraries with examples
|
|
86
|
+
console.log(chalk.blue('\nš¦ Generating examples exports...'))
|
|
87
|
+
await generateExamplesFiles(uiComponents, launch77Root)
|
|
88
|
+
console.log(chalk.green(' ā Generated examples.generated.ts files'))
|
|
89
|
+
|
|
90
|
+
// Build catalog object
|
|
91
|
+
const catalog = {
|
|
92
|
+
$schema: './schemas/catalog.schema.json',
|
|
93
|
+
version: newVersion,
|
|
94
|
+
description: 'Launch77 Platform Artifact Catalog - UI Components',
|
|
95
|
+
uiComponents,
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Save catalog (no AI enrichment - metadata comes from source code)
|
|
99
|
+
// Use Prettier programmatically to match pre-commit formatting
|
|
100
|
+
const prettierConfig = await prettier.resolveConfig(catalogPath)
|
|
101
|
+
const formatted = await prettier.format(JSON.stringify(catalog, null, 2), {
|
|
102
|
+
...prettierConfig,
|
|
103
|
+
parser: 'json',
|
|
104
|
+
filepath: catalogPath,
|
|
105
|
+
})
|
|
106
|
+
await fs.writeFile(catalogPath, formatted)
|
|
107
|
+
|
|
108
|
+
console.log(chalk.blue('\nš¾ Writing catalog.json...\n'))
|
|
109
|
+
console.log(chalk.green(` ā Saved to ${path.relative(process.cwd(), catalogPath)}`))
|
|
110
|
+
|
|
111
|
+
// Sync catalog to Launch77 marketing site
|
|
112
|
+
const marketingSiteCatalogPath = path.join(context.monorepoRoot, 'startups/launch77/apps/marketing/src/catalog.json')
|
|
113
|
+
|
|
114
|
+
if (await fs.pathExists(path.dirname(marketingSiteCatalogPath))) {
|
|
115
|
+
await fs.writeFile(marketingSiteCatalogPath, formatted)
|
|
116
|
+
console.log(chalk.green(` ā Synced to marketing site`))
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const totalArtifacts = catalog.uiComponents.length
|
|
120
|
+
|
|
121
|
+
console.log(chalk.green(`\nā
Done! ${totalArtifacts} UI components cataloged (version ${newVersion}).\n`))
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
catalogPath,
|
|
125
|
+
version: newVersion,
|
|
126
|
+
totalArtifacts,
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Scan all UI components from @launch77/ui and @launch/marketing-ui
|
|
132
|
+
*/
|
|
133
|
+
private async scanAllUIComponents(launch77Root: string): Promise<{
|
|
134
|
+
components: UiComponent[]
|
|
135
|
+
validations: ValidationResult[]
|
|
136
|
+
excluded: number
|
|
137
|
+
}> {
|
|
138
|
+
const components: UiComponent[] = []
|
|
139
|
+
const validations: ValidationResult[] = []
|
|
140
|
+
let excluded = 0
|
|
141
|
+
|
|
142
|
+
const uiLibraries = [
|
|
143
|
+
{ path: path.join(launch77Root, 'libraries/ui'), package: '@launch77/ui' },
|
|
144
|
+
{ path: path.join(launch77Root, 'libraries/marketing-ui'), package: '@launch/marketing-ui' },
|
|
145
|
+
]
|
|
146
|
+
|
|
147
|
+
for (const lib of uiLibraries) {
|
|
148
|
+
if (await fs.pathExists(lib.path)) {
|
|
149
|
+
const result = await scanUILibrary(lib.path, lib.package)
|
|
150
|
+
components.push(...result.components)
|
|
151
|
+
validations.push(...result.validations)
|
|
152
|
+
excluded += result.excluded
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return { components, validations, excluded }
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Check if catalog content has changed (excluding version field)
|
|
161
|
+
*/
|
|
162
|
+
private async catalogHasChanges(
|
|
163
|
+
catalogPath: string,
|
|
164
|
+
newContent: {
|
|
165
|
+
uiComponents: UiComponent[]
|
|
166
|
+
}
|
|
167
|
+
): Promise<boolean> {
|
|
168
|
+
if (!(await fs.pathExists(catalogPath))) {
|
|
169
|
+
return true // No existing catalog = changes
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
try {
|
|
173
|
+
const existingCatalog = await fs.readJson(catalogPath)
|
|
174
|
+
|
|
175
|
+
// Compare content without version fields
|
|
176
|
+
const existingContent = {
|
|
177
|
+
uiComponents: existingCatalog.uiComponents || [],
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return JSON.stringify(existingContent) !== JSON.stringify(newContent)
|
|
181
|
+
} catch (error) {
|
|
182
|
+
return true // Error reading = treat as changes
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Get current version from existing catalog
|
|
188
|
+
*/
|
|
189
|
+
private async getCurrentVersion(catalogPath: string): Promise<string> {
|
|
190
|
+
if (!(await fs.pathExists(catalogPath))) {
|
|
191
|
+
return '1.0.0'
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
try {
|
|
195
|
+
const existingCatalog = await fs.readJson(catalogPath)
|
|
196
|
+
return existingCatalog.version || '1.0.0'
|
|
197
|
+
} catch (error) {
|
|
198
|
+
return '1.0.0'
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Get the next version by incrementing the patch version of existing catalog
|
|
204
|
+
* If no catalog exists, start at 1.0.0
|
|
205
|
+
*/
|
|
206
|
+
private async getNextVersion(catalogPath: string): Promise<string> {
|
|
207
|
+
const currentVersion = await this.getCurrentVersion(catalogPath)
|
|
208
|
+
|
|
209
|
+
// Parse version (major.minor.patch)
|
|
210
|
+
const versionParts = currentVersion.split('.')
|
|
211
|
+
const major = parseInt(versionParts[0] || '1', 10)
|
|
212
|
+
const minor = parseInt(versionParts[1] || '0', 10)
|
|
213
|
+
const patch = parseInt(versionParts[2] || '0', 10)
|
|
214
|
+
|
|
215
|
+
// Increment patch version
|
|
216
|
+
const newVersion = `${major}.${minor}.${patch + 1}`
|
|
217
|
+
|
|
218
|
+
console.log(chalk.gray(` Version: ${chalk.white(currentVersion)} ā ${chalk.white(newVersion)}\n`))
|
|
219
|
+
|
|
220
|
+
return newVersion
|
|
221
|
+
}
|
|
222
|
+
}
|