@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,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://turbo.build/schema.json",
|
|
3
|
+
"globalDependencies": ["**/.env.*local"],
|
|
4
|
+
"tasks": {
|
|
5
|
+
"build": {
|
|
6
|
+
"dependsOn": ["^build"],
|
|
7
|
+
"outputs": ["dist/**", ".next/**", "!.next/cache/**", "src/**"]
|
|
8
|
+
},
|
|
9
|
+
"dev": {
|
|
10
|
+
"cache": false,
|
|
11
|
+
"persistent": true
|
|
12
|
+
},
|
|
13
|
+
"lint": {
|
|
14
|
+
"outputs": []
|
|
15
|
+
},
|
|
16
|
+
"typecheck": {
|
|
17
|
+
"outputs": [],
|
|
18
|
+
"dependsOn": ["^build"]
|
|
19
|
+
},
|
|
20
|
+
"test": {
|
|
21
|
+
"outputs": [],
|
|
22
|
+
"dependsOn": ["build"]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Launch77 Workspace
|
|
2
|
+
|
|
3
|
+
Welcome to your Launch77 workspace! This is a standalone monorepo for building applications with the Launch77 platform.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
### 1. Install Dependencies
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### 2. Create Your First App
|
|
14
|
+
|
|
15
|
+
Use the Launch77 CLI to create apps:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Create a web application
|
|
19
|
+
launch77 app:create webapp my-app
|
|
20
|
+
|
|
21
|
+
# Create an API
|
|
22
|
+
launch77 app:create api my-api
|
|
23
|
+
|
|
24
|
+
# Create a marketing site
|
|
25
|
+
launch77 app:create marketing-site my-marketing
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Workspace Structure
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
.
|
|
32
|
+
├── apps/ # Your applications live here
|
|
33
|
+
├── app-templates/ # Custom app templates (future)
|
|
34
|
+
├── libraries/ # Shared libraries (future)
|
|
35
|
+
├── plugins/ # Custom plugins (future)
|
|
36
|
+
├── package.json # Workspace configuration
|
|
37
|
+
└── turbo.json # Turbo build configuration
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Available Commands
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Development
|
|
44
|
+
npm run dev # Start all apps in development mode
|
|
45
|
+
|
|
46
|
+
# Building
|
|
47
|
+
npm run build # Build all apps
|
|
48
|
+
|
|
49
|
+
# Quality Checks
|
|
50
|
+
npm run typecheck # Type check all apps
|
|
51
|
+
npm run lint # Lint all apps
|
|
52
|
+
npm run test # Run tests for all apps
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Learn More
|
|
56
|
+
|
|
57
|
+
- [Launch77 Documentation](https://launch77.com/docs) (coming soon)
|
|
58
|
+
- [Turborepo Documentation](https://turbo.build/repo/docs)
|
|
59
|
+
|
|
60
|
+
## Need Help?
|
|
61
|
+
|
|
62
|
+
Visit [launch77.com](https://launch77.com) for more information.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# This file ensures the app-templates directory is tracked by git
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# This file ensures the apps directory is tracked by git
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# This file ensures the libraries directory is tracked by git
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "workspace-name",
|
|
3
|
+
"private": true,
|
|
4
|
+
"packageManager": "npm@9.0.0",
|
|
5
|
+
"workspaces": [
|
|
6
|
+
"apps/*",
|
|
7
|
+
"libraries/*",
|
|
8
|
+
"plugins/*",
|
|
9
|
+
"app-templates/*"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"dev": "turbo run dev",
|
|
13
|
+
"build": "turbo run build",
|
|
14
|
+
"test": "turbo run test",
|
|
15
|
+
"lint": "turbo run lint",
|
|
16
|
+
"typecheck": "turbo run typecheck"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"turbo": "^2.0.0"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# This file ensures the plugins directory is tracked by git
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
5
|
+
"module": "commonjs",
|
|
6
|
+
"jsx": "preserve",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"moduleResolution": "node",
|
|
15
|
+
"allowSyntheticDefaultImports": true,
|
|
16
|
+
"declaration": true,
|
|
17
|
+
"declarationMap": true,
|
|
18
|
+
"sourceMap": true,
|
|
19
|
+
"baseUrl": "."
|
|
20
|
+
},
|
|
21
|
+
"exclude": ["node_modules", "dist", ".next", ".turbo"]
|
|
22
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://turbo.build/schema.json",
|
|
3
|
+
"globalDependencies": ["**/.env.*local"],
|
|
4
|
+
"tasks": {
|
|
5
|
+
"build": {
|
|
6
|
+
"dependsOn": ["^build"],
|
|
7
|
+
"outputs": ["dist/**", ".next/**", "!.next/cache/**", "src/**"]
|
|
8
|
+
},
|
|
9
|
+
"dev": {
|
|
10
|
+
"cache": false,
|
|
11
|
+
"persistent": true
|
|
12
|
+
},
|
|
13
|
+
"lint": {
|
|
14
|
+
"outputs": []
|
|
15
|
+
},
|
|
16
|
+
"typecheck": {
|
|
17
|
+
"outputs": [],
|
|
18
|
+
"dependsOn": ["^build"]
|
|
19
|
+
},
|
|
20
|
+
"test": {
|
|
21
|
+
"outputs": [],
|
|
22
|
+
"dependsOn": ["build"]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type Launch77LocationType = 'workspace-root' | 'workspace-app' | 'unknown';
|
|
2
|
+
export interface Launch77Context {
|
|
3
|
+
isValid: boolean;
|
|
4
|
+
locationType: Launch77LocationType;
|
|
5
|
+
workspaceRoot: string;
|
|
6
|
+
appsDir: string;
|
|
7
|
+
workspaceVersion: string;
|
|
8
|
+
workspaceName: string;
|
|
9
|
+
appName?: string;
|
|
10
|
+
packageName: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Detect the Launch77 workspace context from the current working directory
|
|
14
|
+
*/
|
|
15
|
+
export declare function detectLaunch77Context(cwd: string): Promise<Launch77Context>;
|
|
16
|
+
//# sourceMappingURL=launch77-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launch77-context.d.ts","sourceRoot":"","sources":["../../src/utils/launch77-context.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,eAAe,GAAG,SAAS,CAAA;AAEjF,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,oBAAoB,CAAA;IAClC,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;CACpB;AA4ED;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAyDjF"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
const WORKSPACE_MANIFEST = '.launch77/workspace.json';
|
|
4
|
+
/**
|
|
5
|
+
* Check if a directory contains a Launch77 workspace manifest
|
|
6
|
+
*/
|
|
7
|
+
async function isWorkspaceRoot(dir) {
|
|
8
|
+
const manifestPath = path.join(dir, WORKSPACE_MANIFEST);
|
|
9
|
+
return await fs.pathExists(manifestPath);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Read workspace manifest
|
|
13
|
+
*/
|
|
14
|
+
async function readWorkspaceManifest(workspaceRoot) {
|
|
15
|
+
const manifestPath = path.join(workspaceRoot, WORKSPACE_MANIFEST);
|
|
16
|
+
return await fs.readJSON(manifestPath);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Find the workspace root by traversing up from a starting directory
|
|
20
|
+
* Looks for .launch77/workspace.json manifest file
|
|
21
|
+
*/
|
|
22
|
+
async function findWorkspaceRoot(startDir) {
|
|
23
|
+
let currentDir = path.resolve(startDir);
|
|
24
|
+
const rootDir = path.parse(currentDir).root;
|
|
25
|
+
while (currentDir !== rootDir) {
|
|
26
|
+
if (await isWorkspaceRoot(currentDir)) {
|
|
27
|
+
return currentDir;
|
|
28
|
+
}
|
|
29
|
+
currentDir = path.dirname(currentDir);
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Parse the directory structure to determine location context
|
|
35
|
+
* Based on patterns:
|
|
36
|
+
* - apps/[name] → workspace-app
|
|
37
|
+
* - (empty or root) → workspace-root
|
|
38
|
+
*/
|
|
39
|
+
function parseLocationFromPath(cwdPath, workspaceRoot) {
|
|
40
|
+
const relativePath = path.relative(workspaceRoot, cwdPath);
|
|
41
|
+
// At workspace root
|
|
42
|
+
if (!relativePath || relativePath === '.') {
|
|
43
|
+
return { locationType: 'workspace-root' };
|
|
44
|
+
}
|
|
45
|
+
const parts = relativePath.split(path.sep);
|
|
46
|
+
// apps/[app-name]/...
|
|
47
|
+
if (parts[0] === 'apps' && parts.length >= 2) {
|
|
48
|
+
return {
|
|
49
|
+
locationType: 'workspace-app',
|
|
50
|
+
appName: parts[1],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
// Somewhere else in workspace (libraries, plugins, etc.)
|
|
54
|
+
// Still considered workspace-root for now
|
|
55
|
+
return { locationType: 'workspace-root' };
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Detect the Launch77 workspace context from the current working directory
|
|
59
|
+
*/
|
|
60
|
+
export async function detectLaunch77Context(cwd) {
|
|
61
|
+
const resolvedCwd = path.resolve(cwd);
|
|
62
|
+
// Find the workspace root
|
|
63
|
+
const workspaceRoot = await findWorkspaceRoot(resolvedCwd);
|
|
64
|
+
if (!workspaceRoot) {
|
|
65
|
+
return {
|
|
66
|
+
isValid: false,
|
|
67
|
+
locationType: 'unknown',
|
|
68
|
+
workspaceRoot: '',
|
|
69
|
+
appsDir: '',
|
|
70
|
+
workspaceVersion: '',
|
|
71
|
+
workspaceName: '',
|
|
72
|
+
packageName: '',
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
// Read workspace manifest
|
|
76
|
+
let manifest;
|
|
77
|
+
try {
|
|
78
|
+
manifest = await readWorkspaceManifest(workspaceRoot);
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
// Manifest exists (we found it) but couldn't read it
|
|
82
|
+
return {
|
|
83
|
+
isValid: false,
|
|
84
|
+
locationType: 'unknown',
|
|
85
|
+
workspaceRoot: '',
|
|
86
|
+
appsDir: '',
|
|
87
|
+
workspaceVersion: '',
|
|
88
|
+
workspaceName: '',
|
|
89
|
+
packageName: '',
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
// Parse the directory structure to determine location
|
|
93
|
+
const parsed = parseLocationFromPath(resolvedCwd, workspaceRoot);
|
|
94
|
+
// Workspace name is the directory name
|
|
95
|
+
const workspaceName = path.basename(workspaceRoot);
|
|
96
|
+
// Apps directory is always {workspaceRoot}/apps
|
|
97
|
+
const appsDir = path.join(workspaceRoot, 'apps');
|
|
98
|
+
// Package name: @{workspaceName}/{appName} (if in app)
|
|
99
|
+
const packageName = parsed.appName ? `@${workspaceName}/${parsed.appName}` : '';
|
|
100
|
+
return {
|
|
101
|
+
isValid: true,
|
|
102
|
+
locationType: parsed.locationType,
|
|
103
|
+
workspaceRoot,
|
|
104
|
+
appsDir,
|
|
105
|
+
workspaceVersion: manifest.version,
|
|
106
|
+
workspaceName,
|
|
107
|
+
appName: parsed.appName,
|
|
108
|
+
packageName,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=launch77-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launch77-context.js","sourceRoot":"","sources":["../../src/utils/launch77-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,MAAM,UAAU,CAAA;AAezB,MAAM,kBAAkB,GAAG,0BAA0B,CAAA;AAMrD;;GAEG;AACH,KAAK,UAAU,eAAe,CAAC,GAAW;IACxC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAA;IACvD,OAAO,MAAM,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAA;AAC1C,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,qBAAqB,CAAC,aAAqB;IACxD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa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QACb,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,aAAa;QACb,OAAO;QACP,gBAAgB,EAAE,QAAQ,CAAC,OAAO;QAClC,aAAa;QACb,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,WAAW;KACZ,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Launch77Context } from './launch77-context.js';
|
|
2
|
+
/**
|
|
3
|
+
* Validation result with helpful error messages
|
|
4
|
+
*/
|
|
5
|
+
export interface ValidationResult {
|
|
6
|
+
valid: boolean;
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Validate that we're in a workspace context for app:create
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateWorkspaceContext(context: Launch77Context): ValidationResult;
|
|
13
|
+
/**
|
|
14
|
+
* Validate that we're inside an app directory (for plugin:install - future use)
|
|
15
|
+
*/
|
|
16
|
+
export declare function validateAppContext(context: Launch77Context): ValidationResult;
|
|
17
|
+
//# sourceMappingURL=launch77-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launch77-validation.d.ts","sourceRoot":"","sources":["../../src/utils/launch77-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE5D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAgBnF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAwB7E"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate that we're in a workspace context for app:create
|
|
3
|
+
*/
|
|
4
|
+
export function validateWorkspaceContext(context) {
|
|
5
|
+
if (!context.isValid) {
|
|
6
|
+
return {
|
|
7
|
+
valid: false,
|
|
8
|
+
errorMessage: 'Must be run from within a Launch77 workspace.\n\n' + 'Create a workspace first:\n' + ' launch77 init my-workspace\n' + ' cd my-workspace',
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
if (context.locationType !== 'workspace-root' && context.locationType !== 'workspace-app') {
|
|
12
|
+
return {
|
|
13
|
+
valid: false,
|
|
14
|
+
errorMessage: 'Must be run from workspace root or app directory',
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return { valid: true };
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Validate that we're inside an app directory (for plugin:install - future use)
|
|
21
|
+
*/
|
|
22
|
+
export function validateAppContext(context) {
|
|
23
|
+
if (!context.isValid) {
|
|
24
|
+
return {
|
|
25
|
+
valid: false,
|
|
26
|
+
errorMessage: 'Must be run from within a Launch77 workspace app directory',
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
// Must be inside an app, not just workspace root
|
|
30
|
+
if (context.locationType !== 'workspace-app') {
|
|
31
|
+
return {
|
|
32
|
+
valid: false,
|
|
33
|
+
errorMessage: 'plugin:install must be run from within an app directory.\n\n' + 'Navigate to an app:\n' + ' cd apps/<app-name>',
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
if (!context.appName) {
|
|
37
|
+
return {
|
|
38
|
+
valid: false,
|
|
39
|
+
errorMessage: 'Could not determine app name from current directory.\nThis is a bug. Please report it.',
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
return { valid: true };
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=launch77-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launch77-validation.js","sourceRoot":"","sources":["../../src/utils/launch77-validation.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAwB;IAC/D,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,YAAY,EAAE,mDAAmD,GAAG,6BAA6B,GAAG,gCAAgC,GAAG,mBAAmB;SAC3J,CAAA;IACH,CAAC;IAED,IAAI,OAAO,CAAC,YAAY,KAAK,gBAAgB,IAAI,OAAO,CAAC,YAAY,KAAK,eAAe,EAAE,CAAC;QAC1F,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,YAAY,EAAE,kDAAkD;SACjE,CAAA;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAwB;IACzD,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,YAAY,EAAE,4DAA4D;SAC3E,CAAA;IACH,CAAC;IAED,iDAAiD;IACjD,IAAI,OAAO,CAAC,YAAY,KAAK,eAAe,EAAE,CAAC;QAC7C,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,YAAY,EAAE,8DAA8D,GAAG,uBAAuB,GAAG,sBAAsB;SAChI,CAAA;IACH,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,YAAY,EAAE,wFAAwF;SACvG,CAAA;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;AACxB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type LocationType = 'monorepo-root' | 'startup-root' | 'startup-app' | 'unknown';
|
|
2
|
+
export interface MonorepoContext {
|
|
3
|
+
isValid: boolean;
|
|
4
|
+
location: LocationType;
|
|
5
|
+
monorepoRoot: string;
|
|
6
|
+
appsDir: string | null;
|
|
7
|
+
startupName?: string;
|
|
8
|
+
appName?: string;
|
|
9
|
+
packageName?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Detect the monorepo context from the current working directory
|
|
13
|
+
*
|
|
14
|
+
* @deprecated Use detectLaunch77Context() from launch77-context.ts instead.
|
|
15
|
+
* This function is maintained for legacy monorepo structure only.
|
|
16
|
+
* New workspaces created with `launch77 init` should use the new context system.
|
|
17
|
+
*/
|
|
18
|
+
export declare function detectMonorepoContext(cwd: string): Promise<MonorepoContext>;
|
|
19
|
+
//# sourceMappingURL=monorepo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monorepo.d.ts","sourceRoot":"","sources":["../../src/utils/monorepo.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,cAAc,GAAG,aAAa,GAAG,SAAS,CAAA;AAEvF,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,YAAY,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAEtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAuFD;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CA2BjF"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
const MONOREPO_ROOT_MARKER = '.launch-monorepo-root.md';
|
|
4
|
+
/**
|
|
5
|
+
* Check if a directory is the monorepo root by looking for the marker file
|
|
6
|
+
*/
|
|
7
|
+
async function isMonorepoRoot(dir) {
|
|
8
|
+
const markerPath = path.join(dir, MONOREPO_ROOT_MARKER);
|
|
9
|
+
return await fs.pathExists(markerPath);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Find the monorepo root by traversing up from a starting directory
|
|
13
|
+
* Looks for .launch-monorepo-root.md marker file
|
|
14
|
+
*/
|
|
15
|
+
async function findMonorepoRoot(startDir) {
|
|
16
|
+
let currentDir = path.resolve(startDir);
|
|
17
|
+
const rootDir = path.parse(currentDir).root;
|
|
18
|
+
while (currentDir !== rootDir) {
|
|
19
|
+
if (await isMonorepoRoot(currentDir)) {
|
|
20
|
+
return currentDir;
|
|
21
|
+
}
|
|
22
|
+
currentDir = path.dirname(currentDir);
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parse the directory structure to determine location context
|
|
28
|
+
* Based on patterns:
|
|
29
|
+
* - startups/[name] → startup-root
|
|
30
|
+
* - startups/[name]/apps/[app] → startup-app
|
|
31
|
+
* - (empty or root) → monorepo-root
|
|
32
|
+
*/
|
|
33
|
+
function parseLocationFromPath(cwdPath, monorepoRoot) {
|
|
34
|
+
const relativePath = path.relative(monorepoRoot, cwdPath);
|
|
35
|
+
// At monorepo root
|
|
36
|
+
if (!relativePath || relativePath === '.') {
|
|
37
|
+
return { location: 'monorepo-root' };
|
|
38
|
+
}
|
|
39
|
+
const parts = relativePath.split(path.sep);
|
|
40
|
+
// startups/[name]/...
|
|
41
|
+
if (parts[0] === 'startups' && parts.length >= 2) {
|
|
42
|
+
const startupName = parts[1];
|
|
43
|
+
// startups/[name]/apps/[app]
|
|
44
|
+
if (parts.length >= 4 && parts[2] === 'apps') {
|
|
45
|
+
return {
|
|
46
|
+
location: 'startup-app',
|
|
47
|
+
startupName,
|
|
48
|
+
appName: parts[3],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
// startups/[name]
|
|
52
|
+
return {
|
|
53
|
+
location: 'startup-root',
|
|
54
|
+
startupName,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return { location: 'unknown' };
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Determine the apps directory based on location context
|
|
61
|
+
* Returns null for invalid locations (e.g., monorepo-root, unknown)
|
|
62
|
+
*/
|
|
63
|
+
function getAppsDir(monorepoRoot, location, startupName) {
|
|
64
|
+
if (location === 'startup-root' || location === 'startup-app') {
|
|
65
|
+
return path.join(monorepoRoot, 'startups', startupName, 'apps');
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Detect the monorepo context from the current working directory
|
|
71
|
+
*
|
|
72
|
+
* @deprecated Use detectLaunch77Context() from launch77-context.ts instead.
|
|
73
|
+
* This function is maintained for legacy monorepo structure only.
|
|
74
|
+
* New workspaces created with `launch77 init` should use the new context system.
|
|
75
|
+
*/
|
|
76
|
+
export async function detectMonorepoContext(cwd) {
|
|
77
|
+
const resolvedCwd = path.resolve(cwd);
|
|
78
|
+
// Find the monorepo root
|
|
79
|
+
const monorepoRoot = await findMonorepoRoot(resolvedCwd);
|
|
80
|
+
if (!monorepoRoot) {
|
|
81
|
+
return {
|
|
82
|
+
isValid: false,
|
|
83
|
+
location: 'unknown',
|
|
84
|
+
monorepoRoot: '',
|
|
85
|
+
appsDir: null,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
// Parse the directory structure to determine location
|
|
89
|
+
const parsed = parseLocationFromPath(resolvedCwd, monorepoRoot);
|
|
90
|
+
const appsDir = getAppsDir(monorepoRoot, parsed.location, parsed.startupName);
|
|
91
|
+
return {
|
|
92
|
+
isValid: true,
|
|
93
|
+
location: parsed.location,
|
|
94
|
+
monorepoRoot,
|
|
95
|
+
appsDir,
|
|
96
|
+
startupName: parsed.startupName,
|
|
97
|
+
appName: parsed.appName,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=monorepo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monorepo.js","sourceRoot":"","sources":["../../src/utils/monorepo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5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,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,YAAY;QACZ,OAAO;QACP,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { MonorepoContext } from './monorepo.js';
|
|
2
|
+
/**
|
|
3
|
+
* Validation result with helpful error messages
|
|
4
|
+
*/
|
|
5
|
+
export interface ValidationResult {
|
|
6
|
+
valid: boolean;
|
|
7
|
+
errorMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Validate that we're in a startup context (for create-app)
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateStartupContext(context: MonorepoContext): ValidationResult;
|
|
13
|
+
/**
|
|
14
|
+
* Validate that we're inside an app directory (for plugin:install)
|
|
15
|
+
*/
|
|
16
|
+
export declare function validateAppContext(context: MonorepoContext): ValidationResult;
|
|
17
|
+
/**
|
|
18
|
+
* Get the app directory path
|
|
19
|
+
* Returns null if not in an app context
|
|
20
|
+
*/
|
|
21
|
+
export declare function getAppDirectory(context: MonorepoContext): string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Validate app name format
|
|
24
|
+
*
|
|
25
|
+
* App names must follow Launch77 naming conventions:
|
|
26
|
+
* - Must be lowercase
|
|
27
|
+
* - Must start with a letter [a-z]
|
|
28
|
+
* - Can only contain lowercase letters, numbers, and hyphens
|
|
29
|
+
* - Cannot contain spaces, uppercase, underscores, periods, or special characters
|
|
30
|
+
*/
|
|
31
|
+
export declare function validateAppName(appName: string): ValidationResult;
|
|
32
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAuBjF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAwB7E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAUvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAoBjE"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
/**
|
|
4
|
+
* Validate that we're in a startup context (for create-app)
|
|
5
|
+
*/
|
|
6
|
+
export function validateStartupContext(context) {
|
|
7
|
+
if (!context.isValid) {
|
|
8
|
+
return {
|
|
9
|
+
valid: false,
|
|
10
|
+
errorMessage: 'Must be run from within a Launch77 monorepo (could not find .launch-monorepo-root.md)',
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
if (context.location !== 'startup-root' && context.location !== 'startup-app') {
|
|
14
|
+
return {
|
|
15
|
+
valid: false,
|
|
16
|
+
errorMessage: `Command must be run from a startup directory.\n\n` + `${chalk.gray('Current location:')} ${context.location}\n` + `${chalk.gray('Expected:')} Within startups/<startup-name>/\n\n` + `${chalk.yellow('Navigate to a startup first:')}\n` + ` cd startups/<startup-name>/\n\n` + `${chalk.yellow('Or create a startup:')}\n` + ` launch77 create-startup <startup-name>`,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
if (!context.appsDir) {
|
|
20
|
+
return {
|
|
21
|
+
valid: false,
|
|
22
|
+
errorMessage: `Could not determine apps directory for location: ${context.location}\n` + `This is a bug. Please report it.`,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return { valid: true };
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Validate that we're inside an app directory (for plugin:install)
|
|
29
|
+
*/
|
|
30
|
+
export function validateAppContext(context) {
|
|
31
|
+
if (!context.isValid) {
|
|
32
|
+
return {
|
|
33
|
+
valid: false,
|
|
34
|
+
errorMessage: 'Must be run from within a Launch77 monorepo (could not find .launch-monorepo-root.md)',
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// Must be inside an app, not just a startup
|
|
38
|
+
if (context.location !== 'startup-app') {
|
|
39
|
+
return {
|
|
40
|
+
valid: false,
|
|
41
|
+
errorMessage: `plugin:install must be run from within an app directory.\n\n` + `${chalk.gray('Current location:')} ${context.location}\n` + `${chalk.gray('Expected:')} startups/<startup-name>/apps/<app-name>/\n\n` + `${chalk.yellow('Navigate to an app directory:')}\n` + ` cd startups/<startup-name>/apps/<app-name>/\n\n` + `${chalk.yellow('Or create an app first:')}\n` + ` cd startups/<startup-name>/\n` + ` launch77 app:create api <app-name>`,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (!context.appName) {
|
|
45
|
+
return {
|
|
46
|
+
valid: false,
|
|
47
|
+
errorMessage: `Could not determine app name from current directory.\n` + `This is a bug. Please report it.`,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return { valid: true };
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get the app directory path
|
|
54
|
+
* Returns null if not in an app context
|
|
55
|
+
*/
|
|
56
|
+
export function getAppDirectory(context) {
|
|
57
|
+
if (context.location !== 'startup-app') {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
if (!context.monorepoRoot || !context.startupName || !context.appName) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
return path.join(context.monorepoRoot, 'startups', context.startupName, 'apps', context.appName);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Validate app name format
|
|
67
|
+
*
|
|
68
|
+
* App names must follow Launch77 naming conventions:
|
|
69
|
+
* - Must be lowercase
|
|
70
|
+
* - Must start with a letter [a-z]
|
|
71
|
+
* - Can only contain lowercase letters, numbers, and hyphens
|
|
72
|
+
* - Cannot contain spaces, uppercase, underscores, periods, or special characters
|
|
73
|
+
*/
|
|
74
|
+
export function validateAppName(appName) {
|
|
75
|
+
// Check for empty name
|
|
76
|
+
if (!appName || appName.trim().length === 0) {
|
|
77
|
+
return {
|
|
78
|
+
valid: false,
|
|
79
|
+
errorMessage: 'App name cannot be empty',
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
// Launch77 naming convention: lowercase, letters, numbers, hyphens only
|
|
83
|
+
const validPattern = /^[a-z][a-z0-9-]*$/;
|
|
84
|
+
if (!validPattern.test(appName)) {
|
|
85
|
+
return {
|
|
86
|
+
valid: false,
|
|
87
|
+
errorMessage: `Invalid app name: "${appName}"\n\n` + `${chalk.gray('App names must:')}\n` + ` • Be lowercase only\n` + ` • Start with a letter\n` + ` • Can only contain: lowercase letters, numbers, and hyphens\n` + ` • Cannot contain: spaces, uppercase, underscores, periods, or special characters\n\n` + `${chalk.yellow('Valid examples:')}\n` + ` ✓ my-app\n` + ` ✓ myapp\n` + ` ✓ myapp123\n` + ` ✓ app-123\n\n` + `${chalk.red('Invalid examples:')}\n` + ` ✗ MyApp (uppercase)\n` + ` ✗ my_app (underscores)\n` + ` ✗ my.app (periods)\n` + ` ✗ my app (spaces)\n` + ` ✗ @myapp (special characters)\n` + ` ✗ -myapp (starts with hyphen)\n` + ` ✗ 123app (starts with number)`,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
return { valid: true };
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;A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