@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,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* deploy:init action - One-time Vercel deployment setup
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/* eslint-disable no-console */
|
|
6
|
+
import * as path from 'path'
|
|
7
|
+
|
|
8
|
+
import chalk from 'chalk'
|
|
9
|
+
import fs from 'fs-extra'
|
|
10
|
+
import ora from 'ora'
|
|
11
|
+
|
|
12
|
+
import { detectMonorepoContext } from '../../../utils/monorepo.js'
|
|
13
|
+
import { DeployService } from '../services/deploy-svc.js'
|
|
14
|
+
import { connectGitRepository, getPackageName, getVercelInstallInstructions, isVercelCliInstalled, loadVercelProject, runVercelCommand, updateProjectRootDirectory, verifyVercelProjectExists } from '../utils/vercel-extended.js'
|
|
15
|
+
|
|
16
|
+
interface DeployInitOptions {
|
|
17
|
+
force?: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Initialize Vercel deployment for an app
|
|
22
|
+
*/
|
|
23
|
+
export async function deployInit(options: DeployInitOptions = {}) {
|
|
24
|
+
const deployService = new DeployService()
|
|
25
|
+
|
|
26
|
+
// Detect monorepo context
|
|
27
|
+
const context = await detectMonorepoContext(process.cwd())
|
|
28
|
+
|
|
29
|
+
if (context.location !== 'startup-app') {
|
|
30
|
+
throw new Error('Must be run from within an app directory (e.g., startups/mycompany/apps/myapp)')
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const appPath = process.cwd()
|
|
34
|
+
const appName = context.appName!
|
|
35
|
+
const startupName = context.startupName!
|
|
36
|
+
|
|
37
|
+
console.log(chalk.blue(`\n🚀 Initializing Vercel deployment for ${appName}...\n`))
|
|
38
|
+
|
|
39
|
+
// Check if Vercel CLI is installed
|
|
40
|
+
if (!(await isVercelCliInstalled())) {
|
|
41
|
+
console.error(chalk.red('❌ Vercel CLI is not installed'))
|
|
42
|
+
console.log()
|
|
43
|
+
console.log(chalk.yellow('To install, run:'))
|
|
44
|
+
console.log(chalk.cyan(` ${getVercelInstallInstructions()}`))
|
|
45
|
+
console.log()
|
|
46
|
+
process.exit(1)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Load manifest
|
|
50
|
+
const manifest = await deployService.loadManifest()
|
|
51
|
+
|
|
52
|
+
// Check if already connected (unless --force flag is used)
|
|
53
|
+
if (manifest.deployment?.connected && !options.force) {
|
|
54
|
+
console.log(chalk.blue('📋 Checking existing connection...\n'))
|
|
55
|
+
|
|
56
|
+
const projectName = manifest.deployment.projectName
|
|
57
|
+
const projectInfo = projectName ? await verifyVercelProjectExists(projectName) : null
|
|
58
|
+
|
|
59
|
+
if (projectInfo) {
|
|
60
|
+
// Project exists in Vercel
|
|
61
|
+
console.log(chalk.green('✅ App is connected to Vercel'))
|
|
62
|
+
console.log()
|
|
63
|
+
console.log(chalk.cyan('Project Status'))
|
|
64
|
+
console.log(chalk.gray(' Platform:'), 'Vercel')
|
|
65
|
+
console.log(chalk.gray(' Project:'), projectInfo.name)
|
|
66
|
+
console.log(chalk.gray(' Status:'), chalk.green('Live'))
|
|
67
|
+
if (projectInfo.latestProductionUrl) {
|
|
68
|
+
console.log(chalk.gray(' Production URL:'), projectInfo.latestProductionUrl)
|
|
69
|
+
}
|
|
70
|
+
console.log(chalk.gray(' Last Updated:'), new Date(projectInfo.updatedAt).toLocaleString())
|
|
71
|
+
console.log()
|
|
72
|
+
|
|
73
|
+
// Check if .vercel/project.json exists
|
|
74
|
+
const vercelProject = await loadVercelProject(appPath)
|
|
75
|
+
if (vercelProject) {
|
|
76
|
+
console.log(chalk.gray('Local Configuration'))
|
|
77
|
+
console.log(chalk.gray(' Project ID:'), vercelProject.projectId)
|
|
78
|
+
console.log(chalk.gray(' Org ID:'), vercelProject.orgId)
|
|
79
|
+
} else {
|
|
80
|
+
console.log(chalk.yellow('ℹ️ Local .vercel/ directory not found'))
|
|
81
|
+
console.log(chalk.gray('This is normal if you cloned the repo.'))
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
console.log()
|
|
85
|
+
console.log(chalk.cyan('Commands:'))
|
|
86
|
+
console.log(chalk.white(' launch77 deploy:status'), chalk.gray('- View deployment status'))
|
|
87
|
+
console.log(chalk.white(' launch77 deploy:init --force'), chalk.gray('- Force reconnection'))
|
|
88
|
+
return
|
|
89
|
+
} else if (projectName) {
|
|
90
|
+
// Project doesn't exist in Vercel (likely deleted)
|
|
91
|
+
console.log(chalk.red('❌ Vercel project not found'))
|
|
92
|
+
console.log()
|
|
93
|
+
console.log(chalk.yellow("The app is marked as connected, but the Vercel project doesn't exist."))
|
|
94
|
+
console.log(chalk.gray(` Expected project: ${projectName}`))
|
|
95
|
+
console.log()
|
|
96
|
+
console.log(chalk.cyan('This usually means:'))
|
|
97
|
+
console.log(chalk.white(' • The Vercel project was deleted'))
|
|
98
|
+
console.log(chalk.white(' • The project name changed'))
|
|
99
|
+
console.log(chalk.white(" • You're connected to a different Vercel account"))
|
|
100
|
+
console.log()
|
|
101
|
+
console.log(chalk.green('✨ Proceeding with reconnection...'))
|
|
102
|
+
console.log()
|
|
103
|
+
} else {
|
|
104
|
+
console.log(chalk.yellow('⚠️ Connection info incomplete'))
|
|
105
|
+
console.log()
|
|
106
|
+
console.log(chalk.green('✨ Proceeding with setup...'))
|
|
107
|
+
console.log()
|
|
108
|
+
}
|
|
109
|
+
} else if (options.force) {
|
|
110
|
+
console.log(chalk.blue('🔄 Force reconnecting to Vercel...\n'))
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Get package name from package.json
|
|
114
|
+
const packageName = await getPackageName(appPath)
|
|
115
|
+
if (!packageName) {
|
|
116
|
+
throw new Error('Could not read package name from package.json')
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
console.log(chalk.gray(`App details:`))
|
|
120
|
+
console.log(chalk.gray(` Name: ${manifest.name}`))
|
|
121
|
+
console.log(chalk.gray(` Type: ${manifest.type}`))
|
|
122
|
+
console.log(chalk.gray(` Package: ${packageName}`))
|
|
123
|
+
console.log()
|
|
124
|
+
|
|
125
|
+
// Check if this is an API app - Railway deployment coming soon
|
|
126
|
+
if (manifest.type === 'api') {
|
|
127
|
+
console.log(chalk.yellow('⚠️ Railway deployments for API apps are not yet supported'))
|
|
128
|
+
console.log()
|
|
129
|
+
console.log(chalk.cyan('Coming soon! For now, you can deploy manually to:'))
|
|
130
|
+
console.log(chalk.white(' • Railway.app'), chalk.gray('- Simple deployment with databases'))
|
|
131
|
+
console.log(chalk.white(' • Fly.io'), chalk.gray('- Global edge deployment'))
|
|
132
|
+
console.log(chalk.white(' • Render.com'), chalk.gray('- Managed cloud hosting'))
|
|
133
|
+
console.log()
|
|
134
|
+
console.log(chalk.gray('Stay tuned for automated Railway deployment support!'))
|
|
135
|
+
process.exit(0)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Check if vercel.json exists
|
|
139
|
+
const vercelJsonPath = path.join(appPath, 'vercel.json')
|
|
140
|
+
if (!(await fs.pathExists(vercelJsonPath))) {
|
|
141
|
+
console.log(chalk.red('❌ vercel.json not found'))
|
|
142
|
+
console.log()
|
|
143
|
+
console.log(chalk.yellow('The vercel.json file is required for deployment.'))
|
|
144
|
+
console.log(chalk.yellow('This file should have been created when the app was generated.'))
|
|
145
|
+
console.log()
|
|
146
|
+
console.log(chalk.cyan('If this is an older app, you need to create vercel.json manually.'))
|
|
147
|
+
console.log(chalk.cyan('See the documentation for the correct configuration.'))
|
|
148
|
+
process.exit(1)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
console.log(chalk.green('✓ vercel.json exists'))
|
|
152
|
+
|
|
153
|
+
// Run vercel link
|
|
154
|
+
const spinner = ora('Linking to Vercel...').start()
|
|
155
|
+
spinner.stop()
|
|
156
|
+
|
|
157
|
+
console.log()
|
|
158
|
+
console.log(chalk.cyan('📋 Linking to Vercel project...'))
|
|
159
|
+
console.log(chalk.gray(' This will create a new Vercel project or link to an existing one'))
|
|
160
|
+
console.log()
|
|
161
|
+
|
|
162
|
+
try {
|
|
163
|
+
const suggestedProjectName = `${startupName}--${appName}`
|
|
164
|
+
await runVercelCommand(['link', '--project', suggestedProjectName, '--yes'], appPath)
|
|
165
|
+
|
|
166
|
+
console.log()
|
|
167
|
+
console.log(chalk.green('✅ Successfully linked to Vercel!'))
|
|
168
|
+
} catch (error) {
|
|
169
|
+
console.error(chalk.red('\n❌ Failed to link to Vercel'))
|
|
170
|
+
throw error
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Read the created .vercel/project.json to get project info
|
|
174
|
+
const vercelProject = await loadVercelProject(appPath)
|
|
175
|
+
const projectName = vercelProject?.projectName || `${startupName}--${appName}`
|
|
176
|
+
|
|
177
|
+
// Update manifest with deployment configuration
|
|
178
|
+
manifest.deployment = {
|
|
179
|
+
platform: 'vercel',
|
|
180
|
+
connected: true,
|
|
181
|
+
connectedAt: new Date().toISOString(),
|
|
182
|
+
projectName,
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
await deployService.saveManifest(manifest)
|
|
186
|
+
console.log(chalk.green('✓ Updated .launch/app.json'))
|
|
187
|
+
|
|
188
|
+
// Set Root Directory for monorepo deployments
|
|
189
|
+
console.log()
|
|
190
|
+
const rootDirectory = `startups/${startupName}/apps/${appName}`
|
|
191
|
+
await updateProjectRootDirectory(projectName, rootDirectory)
|
|
192
|
+
|
|
193
|
+
// Automatically connect to Git repository
|
|
194
|
+
console.log()
|
|
195
|
+
const gitConnected = await connectGitRepository(appPath)
|
|
196
|
+
|
|
197
|
+
if (gitConnected) {
|
|
198
|
+
console.log()
|
|
199
|
+
console.log(chalk.blue('🎉 Deployment Setup Complete!'))
|
|
200
|
+
console.log()
|
|
201
|
+
console.log(chalk.green('✨ Your app is now connected to GitHub for automatic deployments!'))
|
|
202
|
+
console.log()
|
|
203
|
+
console.log(chalk.cyan('How it works:'))
|
|
204
|
+
console.log(chalk.white(' • Production deployments:'), chalk.gray('Push to main branch'))
|
|
205
|
+
console.log(chalk.white(' • Preview deployments:'), chalk.gray('Push to any other branch'))
|
|
206
|
+
console.log(chalk.white(' • Pull request previews:'), chalk.gray('Automatic on PR creation'))
|
|
207
|
+
console.log()
|
|
208
|
+
console.log(chalk.cyan('Next steps:'))
|
|
209
|
+
console.log(chalk.white(' 1. Make changes to your app'))
|
|
210
|
+
console.log(chalk.white(' 2. Commit and push to GitHub'))
|
|
211
|
+
console.log(chalk.white(' 3. Watch automatic deployment in Vercel'))
|
|
212
|
+
console.log()
|
|
213
|
+
console.log(chalk.gray('Useful commands:'))
|
|
214
|
+
console.log(chalk.white(' launch77 deploy:status'), chalk.gray('- View deployment status'))
|
|
215
|
+
console.log(chalk.white(' launch77 deploy:logs'), chalk.gray('- View build/function logs'))
|
|
216
|
+
console.log()
|
|
217
|
+
console.log(chalk.gray('View your project at:'))
|
|
218
|
+
console.log(chalk.cyan(` https://vercel.com/dashboard/project/${projectName}`))
|
|
219
|
+
} else {
|
|
220
|
+
console.log()
|
|
221
|
+
console.log(chalk.yellow('⚠️ Could not automatically connect to GitHub'))
|
|
222
|
+
console.log()
|
|
223
|
+
console.log(chalk.blue('📦 Manual Git Integration Steps:'))
|
|
224
|
+
console.log()
|
|
225
|
+
console.log(chalk.white('To enable automatic deployments from Git:'))
|
|
226
|
+
console.log()
|
|
227
|
+
console.log(chalk.cyan('1. Go to your Vercel dashboard:'))
|
|
228
|
+
console.log(chalk.gray(` https://vercel.com/dashboard`))
|
|
229
|
+
console.log()
|
|
230
|
+
console.log(chalk.cyan('2. Select your project:'))
|
|
231
|
+
console.log(chalk.gray(` ${projectName}`))
|
|
232
|
+
console.log()
|
|
233
|
+
console.log(chalk.cyan('3. Go to Settings → Git'))
|
|
234
|
+
console.log()
|
|
235
|
+
console.log(chalk.cyan('4. Connect your GitHub/GitLab repository'))
|
|
236
|
+
console.log()
|
|
237
|
+
console.log(chalk.cyan('5. Configure branch deployments:'))
|
|
238
|
+
console.log(chalk.gray(' • Production: main/master branch'))
|
|
239
|
+
console.log(chalk.gray(' • Preview: all other branches'))
|
|
240
|
+
console.log()
|
|
241
|
+
console.log(chalk.green('✨ Once connected, every git push will trigger automatic deployments!'))
|
|
242
|
+
console.log()
|
|
243
|
+
console.log(chalk.gray('Commands available:'))
|
|
244
|
+
console.log(chalk.white(' launch77 deploy:status'), chalk.gray('- View deployment status'))
|
|
245
|
+
console.log(chalk.white(' launch77 deploy:logs'), chalk.gray('- View build/function logs'))
|
|
246
|
+
}
|
|
247
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* deploy:init command - One-time Vercel deployment setup
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Command } from 'commander'
|
|
6
|
+
|
|
7
|
+
export function deployInitCommand(): Command {
|
|
8
|
+
const command = new Command('deploy:init')
|
|
9
|
+
|
|
10
|
+
command
|
|
11
|
+
.description('One-time deployment setup for an app')
|
|
12
|
+
.option('-f, --force', 'Force reconnection even if already connected')
|
|
13
|
+
.action(async (options) => {
|
|
14
|
+
const { deployInit } = await import('./deploy-init-action.js')
|
|
15
|
+
await deployInit(options)
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
return command
|
|
19
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* deploy:logs action - View deployment runtime logs
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/* eslint-disable no-console */
|
|
6
|
+
import chalk from 'chalk'
|
|
7
|
+
|
|
8
|
+
import { detectMonorepoContext } from '../../../utils/monorepo.js'
|
|
9
|
+
import { DeployService } from '../services/deploy-svc.js'
|
|
10
|
+
import { getVercelInstallInstructions, isVercelCliInstalled, runVercelCommand } from '../utils/vercel-extended.js'
|
|
11
|
+
|
|
12
|
+
export interface DeployLogsOptions {
|
|
13
|
+
json?: boolean
|
|
14
|
+
deployment?: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* View Vercel logs
|
|
19
|
+
*/
|
|
20
|
+
export async function deployLogs(options: DeployLogsOptions) {
|
|
21
|
+
const deployService = new DeployService()
|
|
22
|
+
|
|
23
|
+
// Detect monorepo context
|
|
24
|
+
const context = await detectMonorepoContext(process.cwd())
|
|
25
|
+
|
|
26
|
+
if (context.location !== 'startup-app') {
|
|
27
|
+
throw new Error('Must be run from within an app directory (e.g., startups/mycompany/apps/myapp)')
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const appPath = process.cwd()
|
|
31
|
+
|
|
32
|
+
console.log(chalk.blue(`\n📜 Deployment Logs\n`))
|
|
33
|
+
|
|
34
|
+
// Load manifest
|
|
35
|
+
const manifest = await deployService.loadManifest()
|
|
36
|
+
|
|
37
|
+
// Check if this is an API app
|
|
38
|
+
if (manifest.type === 'api') {
|
|
39
|
+
console.log(chalk.yellow('⚠️ Railway deployments for API apps are not yet supported'))
|
|
40
|
+
console.log()
|
|
41
|
+
console.log(chalk.cyan('Coming soon! For now, you can view logs at:'))
|
|
42
|
+
console.log(chalk.white(' • Railway.app dashboard'))
|
|
43
|
+
console.log(chalk.white(' • Fly.io dashboard'))
|
|
44
|
+
console.log(chalk.white(' • Render.com dashboard'))
|
|
45
|
+
console.log()
|
|
46
|
+
return
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Check if Vercel CLI is installed
|
|
50
|
+
if (!(await isVercelCliInstalled())) {
|
|
51
|
+
console.error(chalk.red('❌ Vercel CLI is not installed'))
|
|
52
|
+
console.log()
|
|
53
|
+
console.log(chalk.yellow('To install, run:'))
|
|
54
|
+
console.log(chalk.cyan(` ${getVercelInstallInstructions()}`))
|
|
55
|
+
console.log()
|
|
56
|
+
process.exit(1)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Check if app is connected
|
|
60
|
+
if (!manifest.deployment?.connected) {
|
|
61
|
+
console.log(chalk.yellow('⚠️ App is not connected to Vercel'))
|
|
62
|
+
console.log()
|
|
63
|
+
console.log(chalk.gray('To connect this app, run:'))
|
|
64
|
+
console.log(chalk.white(' launch77 deploy:init'))
|
|
65
|
+
console.log()
|
|
66
|
+
return
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Get deployment ID if not provided
|
|
70
|
+
let deploymentId = options.deployment
|
|
71
|
+
|
|
72
|
+
if (!deploymentId) {
|
|
73
|
+
console.log(chalk.gray('Fetching latest deployment...'))
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
const listResult = await runVercelCommand(['ls'], appPath, { silent: true })
|
|
77
|
+
|
|
78
|
+
const output = (listResult.stdout || '') + '\n' + (listResult.stderr || '')
|
|
79
|
+
|
|
80
|
+
if (output) {
|
|
81
|
+
const urlMatch = output.match(/https:\/\/[^\s]+\.vercel\.app/)
|
|
82
|
+
if (urlMatch) {
|
|
83
|
+
deploymentId = urlMatch[0]
|
|
84
|
+
console.log(chalk.gray(`Using deployment: ${deploymentId}`))
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
} catch (error) {
|
|
88
|
+
console.log(chalk.yellow('Could not fetch deployment list'))
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (!deploymentId) {
|
|
93
|
+
console.log(chalk.yellow('No deployments found'))
|
|
94
|
+
console.log(chalk.gray('Deploy your app first with git push or vercel'))
|
|
95
|
+
return
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Build Vercel logs command
|
|
99
|
+
const args = ['logs', deploymentId]
|
|
100
|
+
|
|
101
|
+
if (options.json) {
|
|
102
|
+
args.push('--json')
|
|
103
|
+
console.log(chalk.gray('Outputting as JSON (pipe to jq for filtering)'))
|
|
104
|
+
} else {
|
|
105
|
+
console.log(chalk.gray('Showing runtime logs (Ctrl+C to exit)...'))
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
console.log()
|
|
109
|
+
|
|
110
|
+
try {
|
|
111
|
+
await runVercelCommand(args, appPath)
|
|
112
|
+
|
|
113
|
+
if (!options.json) {
|
|
114
|
+
console.log()
|
|
115
|
+
console.log(chalk.gray('Tips:'))
|
|
116
|
+
console.log(chalk.white(' launch77 deploy:logs --json'), chalk.gray('- Output as JSON'))
|
|
117
|
+
console.log(chalk.white(' launch77 deploy:logs --deployment <id>'), chalk.gray('- Specific deployment'))
|
|
118
|
+
console.log(chalk.white(' launch77 deploy:logs --json | jq \'select(.level == "warning")\''), chalk.gray('- Filter warnings'))
|
|
119
|
+
}
|
|
120
|
+
} catch (error) {
|
|
121
|
+
const errorMessage = error instanceof Error ? error.message : String(error)
|
|
122
|
+
const errorObj = error as { stderr?: string }
|
|
123
|
+
if (errorMessage.includes('not linked') || errorObj.stderr?.includes('not linked')) {
|
|
124
|
+
console.log()
|
|
125
|
+
console.log(chalk.yellow('Local .vercel directory not found'))
|
|
126
|
+
console.log(chalk.gray('This is normal if you cloned the repo.'))
|
|
127
|
+
console.log(chalk.gray('The project exists in Vercel but needs local linking.'))
|
|
128
|
+
console.log()
|
|
129
|
+
console.log(chalk.cyan('To link locally:'))
|
|
130
|
+
console.log(chalk.white(' vercel link'))
|
|
131
|
+
} else {
|
|
132
|
+
throw error
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* deploy:logs command - View Vercel deployment logs
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Command } from 'commander'
|
|
6
|
+
|
|
7
|
+
export function deployLogsCommand(): Command {
|
|
8
|
+
const command = new Command('deploy:logs')
|
|
9
|
+
|
|
10
|
+
command
|
|
11
|
+
.description('View Vercel deployment runtime logs')
|
|
12
|
+
.option('--json', 'Output logs as JSON')
|
|
13
|
+
.option('--deployment <id>', 'Specific deployment ID or URL')
|
|
14
|
+
.action(async (options) => {
|
|
15
|
+
const { deployLogs } = await import('./deploy-logs-action.js')
|
|
16
|
+
await deployLogs(options)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
return command
|
|
20
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* deploy:status action - Show deployment status for an app
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/* eslint-disable no-console */
|
|
6
|
+
import chalk from 'chalk'
|
|
7
|
+
import ora from 'ora'
|
|
8
|
+
|
|
9
|
+
import { detectMonorepoContext } from '../../../utils/monorepo.js'
|
|
10
|
+
import { DeployService } from '../services/deploy-svc.js'
|
|
11
|
+
import { getVercelInstallInstructions, isVercelCliInstalled, runVercelCommand, verifyVercelProjectExists } from '../utils/vercel-extended.js'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Show Vercel deployment status
|
|
15
|
+
*/
|
|
16
|
+
export async function deployStatus() {
|
|
17
|
+
const deployService = new DeployService()
|
|
18
|
+
|
|
19
|
+
// Detect monorepo context
|
|
20
|
+
const context = await detectMonorepoContext(process.cwd())
|
|
21
|
+
|
|
22
|
+
if (context.location !== 'startup-app') {
|
|
23
|
+
throw new Error('Must be run from within an app directory (e.g., startups/mycompany/apps/myapp)')
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const appPath = process.cwd()
|
|
27
|
+
|
|
28
|
+
console.log(chalk.blue(`\n📊 Deployment Status\n`))
|
|
29
|
+
|
|
30
|
+
// Load manifest
|
|
31
|
+
const manifest = await deployService.loadManifest()
|
|
32
|
+
|
|
33
|
+
// Check if this is an API app
|
|
34
|
+
if (manifest.type === 'api') {
|
|
35
|
+
console.log(chalk.yellow('⚠️ Railway deployments for API apps are not yet supported'))
|
|
36
|
+
console.log()
|
|
37
|
+
console.log(chalk.cyan('Coming soon! For now, you can check your deployment status at:'))
|
|
38
|
+
console.log(chalk.white(' • Railway.app dashboard'))
|
|
39
|
+
console.log(chalk.white(' • Fly.io dashboard'))
|
|
40
|
+
console.log(chalk.white(' • Render.com dashboard'))
|
|
41
|
+
console.log()
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Check if Vercel CLI is installed
|
|
46
|
+
if (!(await isVercelCliInstalled())) {
|
|
47
|
+
console.error(chalk.red('❌ Vercel CLI is not installed'))
|
|
48
|
+
console.log()
|
|
49
|
+
console.log(chalk.yellow('To install, run:'))
|
|
50
|
+
console.log(chalk.cyan(` ${getVercelInstallInstructions()}`))
|
|
51
|
+
console.log()
|
|
52
|
+
process.exit(1)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Check if app is connected
|
|
56
|
+
if (!manifest.deployment?.connected) {
|
|
57
|
+
console.log(chalk.yellow('⚠️ App is not connected to Vercel'))
|
|
58
|
+
console.log()
|
|
59
|
+
console.log(chalk.gray('To connect this app, run:'))
|
|
60
|
+
console.log(chalk.white(' launch77 deploy:init'))
|
|
61
|
+
console.log()
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Verify project exists and show status
|
|
66
|
+
const spinner = ora('Verifying project status...').start()
|
|
67
|
+
const projectName = manifest.deployment.projectName
|
|
68
|
+
const projectInfo = projectName ? await verifyVercelProjectExists(projectName) : null
|
|
69
|
+
|
|
70
|
+
spinner.stop()
|
|
71
|
+
|
|
72
|
+
console.log(chalk.cyan('Project Status'))
|
|
73
|
+
console.log(chalk.gray(' Platform:'), 'Vercel')
|
|
74
|
+
console.log(chalk.gray(' Project Name:'), projectName || 'Unknown')
|
|
75
|
+
|
|
76
|
+
if (projectInfo) {
|
|
77
|
+
console.log(chalk.gray(' Status:'), chalk.green('✅ Live'))
|
|
78
|
+
if (projectInfo.latestProductionUrl) {
|
|
79
|
+
console.log(chalk.gray(' Production URL:'), projectInfo.latestProductionUrl)
|
|
80
|
+
}
|
|
81
|
+
console.log(chalk.gray(' Last Updated:'), new Date(projectInfo.updatedAt).toLocaleString())
|
|
82
|
+
} else if (projectName) {
|
|
83
|
+
console.log(chalk.gray(' Status:'), chalk.red('❌ Not Found'))
|
|
84
|
+
console.log()
|
|
85
|
+
console.log(chalk.yellow('⚠️ Project not found in Vercel'))
|
|
86
|
+
console.log(chalk.gray('The project may have been deleted or renamed.'))
|
|
87
|
+
console.log()
|
|
88
|
+
console.log(chalk.cyan('To reconnect:'))
|
|
89
|
+
console.log(chalk.white(' launch77 deploy:init --force'))
|
|
90
|
+
console.log()
|
|
91
|
+
return
|
|
92
|
+
} else {
|
|
93
|
+
console.log(chalk.gray(' Status:'), chalk.yellow('⚠️ Unknown'))
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
console.log()
|
|
97
|
+
|
|
98
|
+
// Get recent deployments
|
|
99
|
+
spinner.text = 'Fetching recent deployments...'
|
|
100
|
+
spinner.start()
|
|
101
|
+
|
|
102
|
+
try {
|
|
103
|
+
const listResult = await runVercelCommand(['ls'], appPath, { silent: true })
|
|
104
|
+
|
|
105
|
+
spinner.succeed('Fetched deployment information')
|
|
106
|
+
console.log()
|
|
107
|
+
|
|
108
|
+
console.log(chalk.cyan('Recent Deployments'))
|
|
109
|
+
console.log()
|
|
110
|
+
|
|
111
|
+
const deploymentOutput = listResult.stderr || listResult.stdout
|
|
112
|
+
|
|
113
|
+
if (deploymentOutput && deploymentOutput.trim()) {
|
|
114
|
+
console.log(deploymentOutput)
|
|
115
|
+
} else {
|
|
116
|
+
console.log(chalk.gray(' No deployments found'))
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
console.log()
|
|
120
|
+
|
|
121
|
+
// Get production URL
|
|
122
|
+
spinner.text = 'Fetching production URL...'
|
|
123
|
+
spinner.start()
|
|
124
|
+
|
|
125
|
+
try {
|
|
126
|
+
const inspectResult = await runVercelCommand(['inspect', '--prod'], appPath, {
|
|
127
|
+
silent: true,
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
spinner.stop()
|
|
131
|
+
|
|
132
|
+
if (inspectResult.stdout) {
|
|
133
|
+
const urlMatch = inspectResult.stdout.match(/https:\/\/[^\s]+/i)
|
|
134
|
+
if (urlMatch) {
|
|
135
|
+
console.log(chalk.cyan('Production URL'))
|
|
136
|
+
console.log(chalk.white(' ' + urlMatch[0]))
|
|
137
|
+
console.log()
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
} catch (error) {
|
|
141
|
+
spinner.stop()
|
|
142
|
+
console.log(chalk.gray('No production deployment found yet'))
|
|
143
|
+
console.log()
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Show helpful commands
|
|
147
|
+
console.log(chalk.gray('Commands:'))
|
|
148
|
+
console.log(chalk.white(' vercel'), chalk.gray('- Deploy manually (creates preview)'))
|
|
149
|
+
console.log(chalk.white(' vercel --prod'), chalk.gray('- Deploy to production'))
|
|
150
|
+
console.log(chalk.white(' launch77 deploy:logs'), chalk.gray('- View logs'))
|
|
151
|
+
console.log()
|
|
152
|
+
console.log(chalk.gray('For automatic deployments, ensure Git integration is configured.'))
|
|
153
|
+
} catch (error) {
|
|
154
|
+
spinner.fail('Failed to fetch deployment status')
|
|
155
|
+
|
|
156
|
+
const errorMessage = error instanceof Error ? error.message : String(error)
|
|
157
|
+
const errorObj = error as { stderr?: string }
|
|
158
|
+
if (errorMessage.includes('not linked') || errorObj.stderr?.includes('not linked') || errorMessage.includes('requires confirmation') || errorObj.stderr?.includes('requires confirmation')) {
|
|
159
|
+
console.log()
|
|
160
|
+
console.log(chalk.yellow('Local .vercel directory not found or needs setup'))
|
|
161
|
+
console.log(chalk.gray('This is normal if you cloned the repo or just connected.'))
|
|
162
|
+
console.log(chalk.gray('The project exists in Vercel but needs local linking.'))
|
|
163
|
+
console.log()
|
|
164
|
+
console.log(chalk.cyan('To link locally:'))
|
|
165
|
+
console.log(chalk.white(' vercel link'))
|
|
166
|
+
console.log()
|
|
167
|
+
console.log(chalk.gray('After linking, you can check status and deploy:'))
|
|
168
|
+
console.log(chalk.white(' launch77 deploy:status'))
|
|
169
|
+
console.log(chalk.white(' vercel'), chalk.gray('(to deploy)'))
|
|
170
|
+
} else {
|
|
171
|
+
console.log()
|
|
172
|
+
console.error(chalk.red('Error details:'), errorMessage)
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* deploy:status command - Show deployment status
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Command } from 'commander'
|
|
6
|
+
|
|
7
|
+
export function deployStatusCommand(): Command {
|
|
8
|
+
const command = new Command('deploy:status')
|
|
9
|
+
|
|
10
|
+
command.description('Show deployment status and recent deployments').action(async () => {
|
|
11
|
+
const { deployStatus } = await import('./deploy-status-action.js')
|
|
12
|
+
await deployStatus()
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
return command
|
|
16
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deployment service - handles Vercel deployment operations
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { ManifestService } from '../../app/services/manifest-svc.js'
|
|
6
|
+
|
|
7
|
+
import type { AppManifest } from '../../app/lib/manifest-schema.js'
|
|
8
|
+
|
|
9
|
+
export class DeployService {
|
|
10
|
+
private manifestService: ManifestService
|
|
11
|
+
|
|
12
|
+
constructor() {
|
|
13
|
+
this.manifestService = new ManifestService()
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Load the manifest from the current directory
|
|
18
|
+
*/
|
|
19
|
+
async loadManifest(): Promise<AppManifest> {
|
|
20
|
+
const { manifest } = await this.manifestService.loadManifest(process.cwd())
|
|
21
|
+
return manifest
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Save manifest updates
|
|
26
|
+
*/
|
|
27
|
+
async saveManifest(manifest: AppManifest): Promise<void> {
|
|
28
|
+
const { manifestPath } = await this.manifestService.loadManifest(process.cwd())
|
|
29
|
+
await this.manifestService.saveManifest(manifestPath, manifest)
|
|
30
|
+
}
|
|
31
|
+
}
|