@aws-amplify/cli-internal-gen2-migration-experimental-alpha 0.6.0 → 0.7.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/CHANGELOG.md +16 -0
- package/adr/001-refactor-gen2-migration-generate.md +413 -0
- package/adr/002-refactor-gen2-migration-refactor.md +593 -0
- package/adr/003-gen2-migration-assess.md +414 -0
- package/adr/004-gen2-migration-validation-modeling.md +336 -0
- package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.7.0.tgz +0 -0
- package/bin/amplify +1 -1
- package/lib/commands/drift-detection/detect-local-drift.d.ts +1 -2
- package/lib/commands/drift-detection/detect-local-drift.d.ts.map +1 -1
- package/lib/commands/drift-detection/detect-local-drift.js +19 -6
- package/lib/commands/drift-detection/detect-local-drift.js.map +1 -1
- package/lib/commands/drift-detection/detect-stack-drift.d.ts +20 -9
- package/lib/commands/drift-detection/detect-stack-drift.d.ts.map +1 -1
- package/lib/commands/drift-detection/detect-stack-drift.js +121 -151
- package/lib/commands/drift-detection/detect-stack-drift.js.map +1 -1
- package/lib/commands/drift-detection/detect-template-drift.d.ts +8 -21
- package/lib/commands/drift-detection/detect-template-drift.d.ts.map +1 -1
- package/lib/commands/drift-detection/detect-template-drift.js +81 -89
- package/lib/commands/drift-detection/detect-template-drift.js.map +1 -1
- package/lib/commands/drift-detection/index.d.ts +2 -3
- package/lib/commands/drift-detection/index.d.ts.map +1 -1
- package/lib/commands/drift-detection/index.js +1 -3
- package/lib/commands/drift-detection/index.js.map +1 -1
- package/lib/commands/drift-detection/services/amplify-config-service.d.ts +0 -1
- package/lib/commands/drift-detection/services/amplify-config-service.d.ts.map +1 -1
- package/lib/commands/drift-detection/services/amplify-config-service.js +0 -16
- package/lib/commands/drift-detection/services/amplify-config-service.js.map +1 -1
- package/lib/commands/drift-detection/services/cloudformation-service.d.ts +2 -4
- package/lib/commands/drift-detection/services/cloudformation-service.d.ts.map +1 -1
- package/lib/commands/drift-detection/services/cloudformation-service.js +7 -11
- package/lib/commands/drift-detection/services/cloudformation-service.js.map +1 -1
- package/lib/commands/drift-detection/services/drift-formatter.d.ts +3 -70
- package/lib/commands/drift-detection/services/drift-formatter.d.ts.map +1 -1
- package/lib/commands/drift-detection/services/drift-formatter.js +148 -603
- package/lib/commands/drift-detection/services/drift-formatter.js.map +1 -1
- package/lib/commands/drift-detection/services/index.d.ts +1 -2
- package/lib/commands/drift-detection/services/index.d.ts.map +1 -1
- package/lib/commands/drift-detection/services/index.js +2 -4
- package/lib/commands/drift-detection/services/index.js.map +1 -1
- package/lib/commands/drift.d.ts +7 -18
- package/lib/commands/drift.d.ts.map +1 -1
- package/lib/commands/drift.js +71 -172
- package/lib/commands/drift.js.map +1 -1
- package/lib/commands/gen2-migration/_infra/aws-clients.d.ts +31 -0
- package/lib/commands/gen2-migration/_infra/aws-clients.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/aws-clients.js +64 -0
- package/lib/commands/gen2-migration/_infra/aws-clients.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/categories.d.ts +2 -0
- package/lib/commands/gen2-migration/_infra/categories.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/categories.js +32 -0
- package/lib/commands/gen2-migration/_infra/categories.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/cfn-template.d.ts +52 -0
- package/lib/commands/gen2-migration/_infra/cfn-template.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/cfn-template.js +21 -0
- package/lib/commands/gen2-migration/_infra/cfn-template.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/operation.d.ts +16 -0
- package/lib/commands/gen2-migration/_infra/operation.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/operation.js +3 -0
- package/lib/commands/gen2-migration/_infra/operation.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/plan.d.ts +21 -0
- package/lib/commands/gen2-migration/_infra/plan.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/plan.js +111 -0
- package/lib/commands/gen2-migration/_infra/plan.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/planner.d.ts +5 -0
- package/lib/commands/gen2-migration/_infra/planner.d.ts.map +1 -0
- package/lib/commands/gen2-migration/{generate/custom-resources/types.js → _infra/planner.js} +1 -1
- package/lib/commands/gen2-migration/_infra/planner.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/spinning-logger.d.ts +25 -0
- package/lib/commands/gen2-migration/_infra/spinning-logger.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/spinning-logger.js +115 -0
- package/lib/commands/gen2-migration/_infra/spinning-logger.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/stateful-resources.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/stateful-resources.js.map +1 -0
- package/lib/commands/gen2-migration/_infra/step.d.ts +15 -0
- package/lib/commands/gen2-migration/_infra/step.d.ts.map +1 -0
- package/lib/commands/gen2-migration/_infra/step.js +13 -0
- package/lib/commands/gen2-migration/_infra/step.js.map +1 -0
- package/lib/commands/gen2-migration/{_validations.d.ts → _infra/validations.d.ts} +6 -7
- package/lib/commands/gen2-migration/_infra/validations.d.ts.map +1 -0
- package/lib/commands/gen2-migration/{_validations.js → _infra/validations.js} +24 -60
- package/lib/commands/gen2-migration/_infra/validations.js.map +1 -0
- package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.js +15 -0
- package/lib/commands/gen2-migration/assess/analytics/kinesis.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/api/data.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/api/data.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/api/data.assessor.js +25 -0
- package/lib/commands/gen2-migration/assess/api/data.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/api/rest-api.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/api/rest-api.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/api/rest-api.assessor.js +25 -0
- package/lib/commands/gen2-migration/assess/api/rest-api.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/assessment.d.ts +42 -0
- package/lib/commands/gen2-migration/assess/assessment.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/assessment.js +118 -0
- package/lib/commands/gen2-migration/assess/assessment.js.map +1 -0
- package/lib/commands/gen2-migration/assess/assessor.d.ts +5 -0
- package/lib/commands/gen2-migration/assess/assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/{generate/types.js → assess/assessor.js} +1 -1
- package/lib/commands/gen2-migration/assess/assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.js +30 -0
- package/lib/commands/gen2-migration/assess/auth/auth-cognito.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.js +24 -0
- package/lib/commands/gen2-migration/assess/auth/auth-user-pool-groups.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/function/function.assessor.d.ts +12 -0
- package/lib/commands/gen2-migration/assess/function/function.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/function/function.assessor.js +40 -0
- package/lib/commands/gen2-migration/assess/function/function.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.js +19 -0
- package/lib/commands/gen2-migration/assess/geo/geo-geofence-collection.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.js +15 -0
- package/lib/commands/gen2-migration/assess/geo/geo-map.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.js +15 -0
- package/lib/commands/gen2-migration/assess/geo/geo-place-index.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.js +25 -0
- package/lib/commands/gen2-migration/assess/storage/dynamodb.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess/storage/s3.assessor.d.ts +10 -0
- package/lib/commands/gen2-migration/assess/storage/s3.assessor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess/storage/s3.assessor.js +25 -0
- package/lib/commands/gen2-migration/assess/storage/s3.assessor.js.map +1 -0
- package/lib/commands/gen2-migration/assess.d.ts +9 -0
- package/lib/commands/gen2-migration/assess.d.ts.map +1 -0
- package/lib/commands/gen2-migration/assess.js +80 -0
- package/lib/commands/gen2-migration/assess.js.map +1 -0
- package/lib/commands/gen2-migration/decommission.d.ts +6 -5
- package/lib/commands/gen2-migration/decommission.d.ts.map +1 -1
- package/lib/commands/gen2-migration/decommission.js +82 -25
- package/lib/commands/gen2-migration/decommission.js.map +1 -1
- package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.d.ts +32 -0
- package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.js +136 -0
- package/lib/commands/gen2-migration/generate/_infra/aws-fetcher.js.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/files.d.ts +2 -0
- package/lib/commands/gen2-migration/generate/_infra/files.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/{codegen-head/directory_exists.js → _infra/files.js} +4 -5
- package/lib/commands/gen2-migration/generate/_infra/files.js.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/gen1-app.d.ts +40 -0
- package/lib/commands/gen2-migration/generate/_infra/gen1-app.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/gen1-app.js +198 -0
- package/lib/commands/gen2-migration/generate/_infra/gen1-app.js.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/ts.d.ts +24 -0
- package/lib/commands/gen2-migration/generate/_infra/ts.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/_infra/ts.js +128 -0
- package/lib/commands/gen2-migration/generate/_infra/ts.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.d.ts +18 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.js +126 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/cfn-condition-resolver.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.d.ts +33 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/{unsupported/cdk-from-cfn.js → amplify/analytics/kinesis-cfn-converter.js} +94 -52
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis-cfn-converter.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.d.ts +14 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.js +69 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.d.ts +18 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.js +68 -0
- package/lib/commands/gen2-migration/generate/amplify/analytics/kinesis.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.d.ts +24 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.js +233 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.d.ts +78 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.js +491 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/auth.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.d.ts +15 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.js +75 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.d.ts +13 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.js +33 -0
- package/lib/commands/gen2-migration/generate/amplify/auth/reference-auth.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/backend.generator.d.ts +22 -0
- package/lib/commands/gen2-migration/generate/amplify/backend.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/backend.generator.js +150 -0
- package/lib/commands/gen2-migration/generate/amplify/backend.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/{custom-resources/transformer → amplify/custom-resources}/amplify-helper-transformer.d.ts +4 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.js +333 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/amplify-helper-transformer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.d.ts +17 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.js +190 -0
- package/lib/commands/gen2-migration/generate/amplify/custom-resources/custom.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.generator.d.ts +15 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.generator.js +112 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.d.ts +22 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.js +167 -0
- package/lib/commands/gen2-migration/generate/amplify/data/data.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.generator.d.ts +49 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.generator.js +626 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.d.ts +21 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.js +105 -0
- package/lib/commands/gen2-migration/generate/amplify/function/function.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.d.ts +49 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.js +239 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo-cfn-converter.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.d.ts +14 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.js +70 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.d.ts +13 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.js +161 -0
- package/lib/commands/gen2-migration/generate/amplify/geo/geo.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/package.json.generator.d.ts +8 -0
- package/lib/commands/gen2-migration/generate/amplify/package.json.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/package.json.generator.js +28 -0
- package/lib/commands/gen2-migration/generate/amplify/package.json.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.d.ts +15 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.js +162 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.d.ts +51 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.js +269 -0
- package/lib/commands/gen2-migration/generate/amplify/rest-api/rest-api.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.d.ts +14 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.js +96 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.d.ts +30 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.js +90 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/dynamodb.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.d.ts +22 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.js +132 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.d.ts +31 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.js +137 -0
- package/lib/commands/gen2-migration/generate/amplify/storage/s3.renderer.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.d.ts +8 -0
- package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.js +45 -0
- package/lib/commands/gen2-migration/generate/amplify/tsconfig.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify.yml.generator.d.ts +9 -0
- package/lib/commands/gen2-migration/generate/amplify.yml.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/amplify.yml.generator.js +112 -0
- package/lib/commands/gen2-migration/generate/amplify.yml.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/gitignore.generator.d.ts +6 -0
- package/lib/commands/gen2-migration/generate/gitignore.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/gitignore.generator.js +45 -0
- package/lib/commands/gen2-migration/generate/gitignore.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate/package.json.generator.d.ts +12 -0
- package/lib/commands/gen2-migration/generate/package.json.generator.d.ts.map +1 -0
- package/lib/commands/gen2-migration/generate/package.json.generator.js +83 -0
- package/lib/commands/gen2-migration/generate/package.json.generator.js.map +1 -0
- package/lib/commands/gen2-migration/generate.d.ts +6 -5
- package/lib/commands/gen2-migration/generate.d.ts.map +1 -1
- package/lib/commands/gen2-migration/generate.js +232 -17
- package/lib/commands/gen2-migration/generate.js.map +1 -1
- package/lib/commands/gen2-migration/lock.d.ts +10 -6
- package/lib/commands/gen2-migration/lock.d.ts.map +1 -1
- package/lib/commands/gen2-migration/lock.js +182 -64
- package/lib/commands/gen2-migration/lock.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.js +19 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-forward.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.js +26 -0
- package/lib/commands/gen2-migration/refactor/analytics/analytics-rollback.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.d.ts +21 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.js +87 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-forward.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.js +44 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-cognito-rollback.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.d.ts +11 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.js +33 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-forward.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.js +26 -0
- package/lib/commands/gen2-migration/refactor/auth/auth-user-pool-groups-rollback.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/cfn.d.ts +41 -0
- package/lib/commands/gen2-migration/refactor/cfn.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/cfn.js +337 -0
- package/lib/commands/gen2-migration/refactor/cfn.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/index.d.ts +1 -1
- package/lib/commands/gen2-migration/refactor/index.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/index.js +1 -1
- package/lib/commands/gen2-migration/refactor/index.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/oauth-values-retriever.d.ts +23 -11
- package/lib/commands/gen2-migration/refactor/oauth-values-retriever.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/oauth-values-retriever.js +53 -45
- package/lib/commands/gen2-migration/refactor/oauth-values-retriever.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.d.ts +2 -11
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.js +89 -123
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-condition-resolver.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.d.ts +2 -7
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.js +6 -22
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-dependency-resolver.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.d.ts +8 -12
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.js +105 -127
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-output-resolver.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.d.ts +2 -8
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.js +36 -41
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-parameter-resolver.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.d.ts +3 -0
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.js +18 -0
- package/lib/commands/gen2-migration/refactor/resolvers/cfn-tree-walker.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/stack-facade.d.ts +13 -0
- package/lib/commands/gen2-migration/refactor/stack-facade.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/stack-facade.js +39 -0
- package/lib/commands/gen2-migration/refactor/stack-facade.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.d.ts +8 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.js +18 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-forward.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.js +26 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-dynamo-rollback.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-forward.d.ts +10 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-forward.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-forward.js +36 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-forward.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-rollback.d.ts +9 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-rollback.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-rollback.js +26 -0
- package/lib/commands/gen2-migration/refactor/storage/storage-rollback.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/utils.d.ts +1 -1
- package/lib/commands/gen2-migration/refactor/utils.d.ts.map +1 -1
- package/lib/commands/gen2-migration/refactor/utils.js +2 -2
- package/lib/commands/gen2-migration/refactor/utils.js.map +1 -1
- package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.d.ts +52 -0
- package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.js +212 -0
- package/lib/commands/gen2-migration/refactor/workflow/category-refactorer.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.d.ts +15 -0
- package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.js +148 -0
- package/lib/commands/gen2-migration/refactor/workflow/forward-category-refactorer.js.map +1 -0
- package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.d.ts +13 -0
- package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.js +123 -0
- package/lib/commands/gen2-migration/refactor/workflow/rollback-category-refactorer.js.map +1 -0
- package/lib/commands/gen2-migration/refactor.d.ts +11 -0
- package/lib/commands/gen2-migration/refactor.d.ts.map +1 -0
- package/lib/commands/gen2-migration/refactor.js +189 -0
- package/lib/commands/gen2-migration/refactor.js.map +1 -0
- package/lib/commands/gen2-migration.d.ts +0 -12
- package/lib/commands/gen2-migration.d.ts.map +1 -1
- package/lib/commands/gen2-migration.js +82 -111
- package/lib/commands/gen2-migration.js.map +1 -1
- package/package.json +21 -12
- package/aws-amplify-cli-internal-gen2-migration-experimental-alpha-0.6.0.tgz +0 -0
- package/lib/commands/drift-detection/services/file-service.d.ts +0 -7
- package/lib/commands/drift-detection/services/file-service.d.ts.map +0 -1
- package/lib/commands/drift-detection/services/file-service.js +0 -53
- package/lib/commands/drift-detection/services/file-service.js.map +0 -1
- package/lib/commands/gen2-migration/_step.d.ts +0 -17
- package/lib/commands/gen2-migration/_step.d.ts.map +0 -1
- package/lib/commands/gen2-migration/_step.js +0 -16
- package/lib/commands/gen2-migration/_step.js.map +0 -1
- package/lib/commands/gen2-migration/_validations.d.ts.map +0 -1
- package/lib/commands/gen2-migration/_validations.js.map +0 -1
- package/lib/commands/gen2-migration/cleanup.d.ts +0 -8
- package/lib/commands/gen2-migration/cleanup.d.ts.map +0 -1
- package/lib/commands/gen2-migration/cleanup.js +0 -21
- package/lib/commands/gen2-migration/cleanup.js.map +0 -1
- package/lib/commands/gen2-migration/clone.d.ts +0 -8
- package/lib/commands/gen2-migration/clone.d.ts.map +0 -1
- package/lib/commands/gen2-migration/clone.js +0 -21
- package/lib/commands/gen2-migration/clone.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts +0 -24
- package/lib/commands/gen2-migration/generate/adapters/auth/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/auth/index.js +0 -297
- package/lib/commands/gen2-migration/generate/adapters/auth/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js +0 -140
- package/lib/commands/gen2-migration/generate/adapters/auth/index.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts +0 -5
- package/lib/commands/gen2-migration/generate/adapters/data/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/data/index.js +0 -17
- package/lib/commands/gen2-migration/generate/adapters/data/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.d.ts +0 -10
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.js +0 -43
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.js +0 -34
- package/lib/commands/gen2-migration/generate/adapters/functions/api-trigger-detector.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts +0 -18
- package/lib/commands/gen2-migration/generate/adapters/functions/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/functions/index.js +0 -85
- package/lib/commands/gen2-migration/generate/adapters/functions/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/adapters/project/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/project/index.js +0 -7
- package/lib/commands/gen2-migration/generate/adapters/project/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts +0 -31
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js +0 -34
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js +0 -181
- package/lib/commands/gen2-migration/generate/adapters/storage/gen1_storage_codegen_adapter.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts +0 -3
- package/lib/commands/gen2-migration/generate/adapters/storage/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/index.js +0 -10
- package/lib/commands/gen2-migration/generate/adapters/storage/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts +0 -25
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js +0 -76
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.js.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.js +0 -125
- package/lib/commands/gen2-migration/generate/adapters/storage/storage_access.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts +0 -91
- package/lib/commands/gen2-migration/generate/backend/synthesizer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/backend/synthesizer.js +0 -1014
- package/lib/commands/gen2-migration/generate/backend/synthesizer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js +0 -777
- package/lib/commands/gen2-migration/generate/backend/synthesizer.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts +0 -14
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js +0 -82
- package/lib/commands/gen2-migration/generate/codegen-head/amplify_stack_parser.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts +0 -10
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.js +0 -11
- package/lib/commands/gen2-migration/generate/codegen-head/analytics.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.d.ts +0 -7
- package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.js +0 -80
- package/lib/commands/gen2-migration/generate/codegen-head/api-cfn-access.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts +0 -13
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js +0 -59
- package/lib/commands/gen2-migration/generate/codegen-head/app_analytics_definition_fetcher.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts +0 -24
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js +0 -167
- package/lib/commands/gen2-migration/generate/codegen-head/app_auth_definition_fetcher.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts +0 -21
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js +0 -135
- package/lib/commands/gen2-migration/generate/codegen-head/app_functions_definition_fetcher.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts +0 -23
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js +0 -181
- package/lib/commands/gen2-migration/generate/codegen-head/app_storage_definition_fetcher.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.d.ts +0 -12
- package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.js +0 -157
- package/lib/commands/gen2-migration/generate/codegen-head/auth_access_analyzer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts +0 -10
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js +0 -48
- package/lib/commands/gen2-migration/generate/codegen-head/backend_downloader.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts +0 -11
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js +0 -38
- package/lib/commands/gen2-migration/generate/codegen-head/backend_environment_selector.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts +0 -13
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js +0 -498
- package/lib/commands/gen2-migration/generate/codegen-head/command-handlers.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts +0 -47
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js +0 -222
- package/lib/commands/gen2-migration/generate/codegen-head/data_definition_fetcher.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.d.ts +0 -10
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.js +0 -59
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.js +0 -90
- package/lib/commands/gen2-migration/generate/codegen-head/data_model_access_parser.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/directory_exists.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.d.ts +0 -14
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.js +0 -100
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.js +0 -69
- package/lib/commands/gen2-migration/generate/codegen-head/dynamodb_cfn_access_parser.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts +0 -8
- package/lib/commands/gen2-migration/generate/codegen-head/format.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/format.js +0 -66
- package/lib/commands/gen2-migration/generate/codegen-head/format.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts +0 -15
- package/lib/commands/gen2-migration/generate/codegen-head/logger.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/logger.js +0 -14
- package/lib/commands/gen2-migration/generate/codegen-head/logger.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts +0 -26
- package/lib/commands/gen2-migration/generate/codegen-head/printer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/printer.js +0 -103
- package/lib/commands/gen2-migration/generate/codegen-head/printer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.d.ts +0 -13
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.js +0 -66
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.js.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.js +0 -97
- package/lib/commands/gen2-migration/generate/codegen-head/s3_cfn_access_parser.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts +0 -26
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.js +0 -269
- package/lib/commands/gen2-migration/generate/core/migration-pipeline.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts +0 -7
- package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js +0 -84
- package/lib/commands/gen2-migration/generate/custom-resources/generator/backend-updater.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts +0 -8
- package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js +0 -105
- package/lib/commands/gen2-migration/generate/custom-resources/generator/dependency-merger.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts +0 -5
- package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js +0 -88
- package/lib/commands/gen2-migration/generate/custom-resources/generator/file-converter.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts +0 -8
- package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js +0 -36
- package/lib/commands/gen2-migration/generate/custom-resources/generator/gen2-file-generator.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts +0 -5
- package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js +0 -81
- package/lib/commands/gen2-migration/generate/custom-resources/parser/cdk-stack-parser.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts +0 -15
- package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js +0 -35
- package/lib/commands/gen2-migration/generate/custom-resources/parser/pattern-detector.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts +0 -5
- package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js +0 -66
- package/lib/commands/gen2-migration/generate/custom-resources/scanner/custom-resource-scanner.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js +0 -178
- package/lib/commands/gen2-migration/generate/custom-resources/transformer/amplify-helper-transformer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts +0 -38
- package/lib/commands/gen2-migration/generate/custom-resources/types.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/custom-resources/types.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts +0 -9
- package/lib/commands/gen2-migration/generate/generators/analytics/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/analytics/index.js +0 -40
- package/lib/commands/gen2-migration/generate/generators/analytics/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts +0 -107
- package/lib/commands/gen2-migration/generate/generators/auth/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/auth/index.js +0 -313
- package/lib/commands/gen2-migration/generate/generators/auth/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.js +0 -566
- package/lib/commands/gen2-migration/generate/generators/auth/index.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/data/index.d.ts +0 -35
- package/lib/commands/gen2-migration/generate/generators/data/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/data/index.js +0 -185
- package/lib/commands/gen2-migration/generate/generators/data/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/generators/data/index.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/data/index.test.js +0 -47
- package/lib/commands/gen2-migration/generate/generators/data/index.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts +0 -53
- package/lib/commands/gen2-migration/generate/generators/functions/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/index.js +0 -125
- package/lib/commands/gen2-migration/generate/generators/functions/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts +0 -6
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.js +0 -16
- package/lib/commands/gen2-migration/generate/generators/functions/lambda.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.d.ts +0 -3
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.js +0 -106
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.js +0 -120
- package/lib/commands/gen2-migration/generate/generators/functions/lambda_env_generator.test.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts +0 -4
- package/lib/commands/gen2-migration/generate/generators/storage/access.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/storage/access.js +0 -73
- package/lib/commands/gen2-migration/generate/generators/storage/access.js.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts +0 -37
- package/lib/commands/gen2-migration/generate/generators/storage/index.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/generators/storage/index.js +0 -78
- package/lib/commands/gen2-migration/generate/generators/storage/index.js.map +0 -1
- package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts +0 -27
- package/lib/commands/gen2-migration/generate/npm_package/renderer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/npm_package/renderer.js +0 -28
- package/lib/commands/gen2-migration/generate/npm_package/renderer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/render_pipeline.d.ts +0 -9
- package/lib/commands/gen2-migration/generate/render_pipeline.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/render_pipeline.js +0 -15
- package/lib/commands/gen2-migration/generate/render_pipeline.js.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts +0 -7
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js +0 -17
- package/lib/commands/gen2-migration/generate/renderers/ensure_directory.js.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts +0 -8
- package/lib/commands/gen2-migration/generate/renderers/package_json.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/package_json.js +0 -15
- package/lib/commands/gen2-migration/generate/renderers/package_json.js.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts +0 -11
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js +0 -22
- package/lib/commands/gen2-migration/generate/renderers/typescript_block_node.js.map +0 -1
- package/lib/commands/gen2-migration/generate/resource/resource.d.ts +0 -20
- package/lib/commands/gen2-migration/generate/resource/resource.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/resource/resource.js +0 -60
- package/lib/commands/gen2-migration/generate/resource/resource.js.map +0 -1
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts +0 -2
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.js +0 -6
- package/lib/commands/gen2-migration/generate/test_utils/import_regex.js.map +0 -1
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts +0 -4
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js +0 -22
- package/lib/commands/gen2-migration/generate/test_utils/ts_node_printer.js.map +0 -1
- package/lib/commands/gen2-migration/generate/todo_error.d.ts +0 -3
- package/lib/commands/gen2-migration/generate/todo_error.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/todo_error.js +0 -11
- package/lib/commands/gen2-migration/generate/todo_error.js.map +0 -1
- package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts +0 -3
- package/lib/commands/gen2-migration/generate/ts_factory_utils.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/ts_factory_utils.js +0 -10
- package/lib/commands/gen2-migration/generate/ts_factory_utils.js.map +0 -1
- package/lib/commands/gen2-migration/generate/types.d.ts +0 -4
- package/lib/commands/gen2-migration/generate/types.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/types.js.map +0 -1
- package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts +0 -26
- package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.d.ts.map +0 -1
- package/lib/commands/gen2-migration/generate/unsupported/cdk-from-cfn.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.d.ts +0 -5
- package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.js +0 -76
- package/lib/commands/gen2-migration/refactor/cfn-stack-refactor-updater.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/cfn-stack-updater.d.ts +0 -6
- package/lib/commands/gen2-migration/refactor/cfn-stack-updater.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/cfn-stack-updater.js +0 -52
- package/lib/commands/gen2-migration/refactor/cfn-stack-updater.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/generators/category-template-generator.d.ts +0 -40
- package/lib/commands/gen2-migration/refactor/generators/category-template-generator.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/generators/category-template-generator.js +0 -321
- package/lib/commands/gen2-migration/refactor/generators/category-template-generator.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/generators/template-generator.d.ts +0 -48
- package/lib/commands/gen2-migration/refactor/generators/template-generator.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/generators/template-generator.js +0 -513
- package/lib/commands/gen2-migration/refactor/generators/template-generator.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/refactor.d.ts +0 -19
- package/lib/commands/gen2-migration/refactor/refactor.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/refactor.js +0 -241
- package/lib/commands/gen2-migration/refactor/refactor.js.map +0 -1
- package/lib/commands/gen2-migration/refactor/types.d.ts +0 -128
- package/lib/commands/gen2-migration/refactor/types.d.ts.map +0 -1
- package/lib/commands/gen2-migration/refactor/types.js +0 -59
- package/lib/commands/gen2-migration/refactor/types.js.map +0 -1
- package/lib/commands/gen2-migration/shift.d.ts +0 -8
- package/lib/commands/gen2-migration/shift.d.ts.map +0 -1
- package/lib/commands/gen2-migration/shift.js +0 -21
- package/lib/commands/gen2-migration/shift.js.map +0 -1
- package/lib/commands/gen2-migration/stateful-resources.d.ts.map +0 -1
- package/lib/commands/gen2-migration/stateful-resources.js.map +0 -1
- /package/lib/commands/gen2-migration/{stateful-resources.d.ts → _infra/stateful-resources.d.ts} +0 -0
- /package/lib/commands/gen2-migration/{stateful-resources.js → _infra/stateful-resources.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [14.2.5](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@14.2.4...@aws-amplify/cli-internal@14.2.5) (2026-01-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-amplify/cli-internal
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [14.2.4](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@14.2.3...@aws-amplify/cli-internal@14.2.4) (2026-01-22)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @aws-amplify/cli-internal
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [14.2.3](https://github.com/aws-amplify/amplify-cli/compare/@aws-amplify/cli-internal@14.2.2...@aws-amplify/cli-internal@14.2.3) (2025-11-20)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @aws-amplify/cli-internal
|
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
# Generate Command — Guideline Violations
|
|
2
|
+
|
|
3
|
+
This document maps issues in `packages/amplify-cli/src/commands/gen2-migration/generate`
|
|
4
|
+
to the guidelines in `CODING_GUIDELINES.md`.
|
|
5
|
+
|
|
6
|
+
## Architecture & Structure
|
|
7
|
+
|
|
8
|
+
### Point 1 — God modules
|
|
9
|
+
|
|
10
|
+
`command-handlers.ts` (~730 lines) is the primary offender. It handles AWS client instantiation, code generation orchestration, amplify.yml updates, .gitignore updates, custom resource migration, dependency extraction, file copying, and npm install. These are unrelated concerns in a single file.
|
|
11
|
+
|
|
12
|
+
`createGen2Renderer` in `migration-pipeline.ts` (~250 lines of function body) manually wires every category, builds cross-category data structures (`functionNamesAndCategory`, `functionsWithApiAccess`, `dynamoTriggers`), and populates `BackendRenderParameters` — acting as both orchestrator and implementor.
|
|
13
|
+
|
|
14
|
+
`BackendSynthesizer` (~750 lines) generates the entire `backend.ts` file including OAuth flows, user pool client overrides, environment variable logic, DynamoDB table mappings, and custom resource registration.
|
|
15
|
+
|
|
16
|
+
### Point 2 — Unjustified layer boundaries
|
|
17
|
+
|
|
18
|
+
Data flows through four or five reshaping layers: SDK response → adapter output (e.g., `AuthDefinition`) → `Gen2RenderingOptions` → `BackendRenderParameters` → TypeScript AST. Each boundary manually maps properties with different names. For example, auth data goes from Cognito SDK types → `getAuthDefinition()` → `AuthDefinition` → `Gen2RenderingOptions.auth` → `BackendRenderParameters.auth` (cherry-picked subset). Adding a new auth field requires changes in five places.
|
|
19
|
+
|
|
20
|
+
The adapter layer (`adapters/`) and the generator layer (`generators/`) could be collapsed — the adapter reshapes SDK data into a definition, then the generator reshapes the definition into AST nodes. Neither layer is expected to change independently.
|
|
21
|
+
|
|
22
|
+
### Point 3 — File size and focus
|
|
23
|
+
|
|
24
|
+
`command-handlers.ts`, `migration-pipeline.ts`, and `backend/synthesizer.ts` are all large files mixing multiple concerns. The auth generator (`generators/auth/index.ts`) is also large, handling login options, external providers, OIDC/SAML, user attributes, MFA, and secret generation in a single file.
|
|
25
|
+
|
|
26
|
+
### Point 4 — Naming
|
|
27
|
+
|
|
28
|
+
The `codegen-head/` folder name doesn't convey what it contains (definition fetchers, environment resolution, stack parsing, formatting utilities). The `renderers/` folder contains `EnsureDirectory`, `JsonRenderer`, and `TypescriptNodeArrayRenderer` — the first isn't a renderer in any meaningful sense.
|
|
29
|
+
|
|
30
|
+
### Point 5 — Scattered API calls
|
|
31
|
+
|
|
32
|
+
AWS SDK clients are instantiated in `prepare()` inside `command-handlers.ts` and passed to individual fetchers. However, each fetcher also independently calls `backendEnvironmentResolver.selectBackendEnvironment()` and `ccbFetcher.getCurrentCloudBackend()`. There's no centralized wrapper for Cognito, S3, Lambda, or CloudFormation calls — each fetcher makes its own SDK calls directly.
|
|
33
|
+
|
|
34
|
+
## Mutability & State Management
|
|
35
|
+
|
|
36
|
+
### Point 6 — Mutable state
|
|
37
|
+
|
|
38
|
+
`BackendRenderParameters` is built incrementally via mutation in `createGen2Renderer` — properties are conditionally assigned across ~200 lines of code. `Gen2RenderingOptions` has many optional mutable fields. Neither interface uses `readonly`.
|
|
39
|
+
|
|
40
|
+
### Point 7 — `let` over `const`
|
|
41
|
+
|
|
42
|
+
`createGen2Renderer` uses mutable variables like `functionNames`, `functionNamesAndCategory`, `functionsWithApiAccess`, `functionsWithDataModelAccess` that are populated inside loops and conditionals, then consumed later. The `updateAmplifyYmlFile` function uses `let amplifyYml: any` assigned across three branches.
|
|
43
|
+
|
|
44
|
+
## Interface Design
|
|
45
|
+
|
|
46
|
+
### Point 8 — Properties that don't belong
|
|
47
|
+
|
|
48
|
+
`StorageRenderParameters` contains `functionNamesAndCategories?: Map<string, string>` — function metadata that has nothing to do with storage. It's there because `renderStorage()` needs it for import path generation.
|
|
49
|
+
|
|
50
|
+
### Point 9 — Excessive optionality
|
|
51
|
+
|
|
52
|
+
`Gen2RenderingOptions` has 13 optional properties out of 15 total. `AuthDefinition` has 15 optional properties. `BackendRenderParameters` has all optional category blocks. Most of these are optional because not every Gen1 project has every category, but the optionality propagates through the entire pipeline rather than being resolved at the boundary.
|
|
53
|
+
|
|
54
|
+
### Point 10 — Same information twice
|
|
55
|
+
|
|
56
|
+
`functionNamesAndCategory` is derived from `functions` in `createGen2Renderer`, then passed separately to `StorageRenderParameters` and `BackendRenderParameters`. The same function-to-category mapping exists in three places. `backendEnvironmentName` is passed as a separate argument alongside objects that already contain it.
|
|
57
|
+
|
|
58
|
+
### Point 11 — Dead inputs
|
|
59
|
+
|
|
60
|
+
`command-handlers.ts` imports `UpdateAppCommand`, `AppContextLogger`, `AmplifyError`, `printer`, `format`, and `hasUncommentedDependency` — none of which are used. `getUsageDataMetric` is defined but never called. `Gen1ProjectConfig` in `types.ts` is an empty stub interface with `[key: string]: any`.
|
|
61
|
+
|
|
62
|
+
### Point 13 — Catch-all types file
|
|
63
|
+
|
|
64
|
+
`generate/types.ts` contains a single stub interface `Gen1ProjectConfig` with `[key: string]: any` — a dead, untyped placeholder that serves no purpose.
|
|
65
|
+
|
|
66
|
+
## Error Handling
|
|
67
|
+
|
|
68
|
+
### Point 16 — Fallbacks for invalid states
|
|
69
|
+
|
|
70
|
+
Several fetchers in the generate module return `undefined` when categories don't exist — this is valid. However, `extractGen1FunctionDependencies` silently returns `{}` on any error, including permission failures or corrupted JSON.
|
|
71
|
+
|
|
72
|
+
### Point 17 — `assert()` in production code
|
|
73
|
+
|
|
74
|
+
`command-handlers.ts` uses `assert` ~15 times for values that should be validated with user-facing errors (e.g., `assert(backendEnvironment)`, `assert(accountId)`, `assert(resourceName)`). `app_auth_definition_fetcher.ts` and `app_functions_definition_fetcher.ts` also use `assert` extensively.
|
|
75
|
+
|
|
76
|
+
## Control Flow & Logic
|
|
77
|
+
|
|
78
|
+
### Point 18 — Repeated branching
|
|
79
|
+
|
|
80
|
+
`createGen2Renderer` branches on category existence (`if (auth)`, `if (storage)`, `if (data)`, `if (functions)`, `if (analytics)`) in a long sequential block. Each block follows the same pattern (create directory, create renderer, populate `backendRenderOptions`) but the logic isn't consolidated.
|
|
81
|
+
|
|
82
|
+
### Point 19 — Repeated derived values
|
|
83
|
+
|
|
84
|
+
`amplify-meta.json` is independently read and parsed in `AppAuthDefinitionFetcher`, `AppStorageDefinitionFetcher`, `AppFunctionsDefinitionFetcher`, `AppAnalyticsDefinitionFetcher`, `DataDefinitionFetcher`, `AuthAccessAnalyzer`, and multiple times in `command-handlers.ts`. Each call site also independently resolves the backend environment via `backendEnvironmentResolver.selectBackendEnvironment()`.
|
|
85
|
+
|
|
86
|
+
The function-to-category mapping is derived three times: once in `AppFunctionsDefinitionFetcher`, once in `createGen2Renderer` for storage, and once in `createGen2Renderer` for auth.
|
|
87
|
+
|
|
88
|
+
## Function Design
|
|
89
|
+
|
|
90
|
+
### Point 21 — Positional arguments
|
|
91
|
+
|
|
92
|
+
`AppAuthDefinitionFetcher` constructor takes 6 positional arguments. `AppFunctionsDefinitionFetcher` takes 6. `getAuthDefinition()` adapter takes a single object (good), but `renderAuthNode()` takes `(auth, functions, functionCategories)` as separate positional arguments.
|
|
93
|
+
|
|
94
|
+
### Point 22 — High argument count
|
|
95
|
+
|
|
96
|
+
`prepare()` instantiates 8 AWS clients and passes a `CodegenCommandParameters` object with 14 fields to `generateGen2Code`. `CodegenCommandParameters` mixes infrastructure concerns (clients, environment) with domain concerns (fetchers, app ID).
|
|
97
|
+
|
|
98
|
+
## Code Hygiene
|
|
99
|
+
|
|
100
|
+
### Point 24 — Code duplication
|
|
101
|
+
|
|
102
|
+
`readJsonFile` is independently defined in `app_auth_definition_fetcher.ts`, `data_definition_fetcher.ts`, and `app_storage_definition_fetcher.ts` — identical implementations in three files. Each fetcher independently resolves the backend environment and downloads the current cloud backend with the same boilerplate.
|
|
103
|
+
|
|
104
|
+
### Point 25 — Duplicate constants
|
|
105
|
+
|
|
106
|
+
`GEN1_CONFIGURATION_FILES` is exported from `command-handlers.ts` but the same file names appear as string literals elsewhere.
|
|
107
|
+
|
|
108
|
+
### Point 27 — Dead code
|
|
109
|
+
|
|
110
|
+
Unused imports: `UpdateAppCommand`, `AppContextLogger`, `AmplifyError`, `printer`, `format`. Unused function: `getUsageDataMetric`, `hasUncommentedDependency`. Dead type: `Gen1ProjectConfig` in `types.ts`. Commented-out import: `SSMClient`.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Refactoring Requirements
|
|
115
|
+
|
|
116
|
+
### R1. Generators have access to all Gen1 app information
|
|
117
|
+
|
|
118
|
+
Every generator must have access to all Gen1 app information through a single facade. The facade provides methods for querying any aspect of the Gen1 app (auth config, storage config, functions, metadata, etc.) but fetches data lazily — only when a generator actually requests it. Results are cached so that multiple generators querying the same data get the same cached result without duplicate API calls or file reads. This makes the facade easy to mock in tests: a test for the auth generator only needs to stub the auth-related methods without constructing the entire Gen1 app state.
|
|
119
|
+
|
|
120
|
+
### R2. Category generators can contribute to backend.ts
|
|
121
|
+
|
|
122
|
+
Each category generator (auth, storage, data, functions, etc.) must be able to add imports, statements, and overrides to the `backend.ts` file directly. This eliminates the need for a centralized synthesizer that has to know about every category and reshapes data through an intermediate interface. The generator that understands the category's needs is the one that writes the backend.ts contributions for that category.
|
|
123
|
+
|
|
124
|
+
### R3. Adding a new category doesn't require modifying existing code
|
|
125
|
+
|
|
126
|
+
A new category generator should be pluggable without touching other category generators. Adding a category requires only creating the new generator and adding one line to `AmplifyMigrationGenerateStep.execute()` to instantiate it.
|
|
127
|
+
|
|
128
|
+
### R4. Category generators are self-contained
|
|
129
|
+
|
|
130
|
+
All logic for generating a category's output — both its `resource.ts` file and its `backend.ts` contributions — lives in one module. No category-specific logic is scattered across shared orchestration code or other category generators.
|
|
131
|
+
|
|
132
|
+
### R5. Generators support dry run
|
|
133
|
+
|
|
134
|
+
Each generator must be able to report what it will do without doing it. The description and execution logic must be structurally tied together so they can't diverge.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Refactoring Plan
|
|
139
|
+
|
|
140
|
+
### Target Directory Structure
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
generate/
|
|
144
|
+
gen1-app/
|
|
145
|
+
gen1-app.ts # Facade — lazy-loading, caching access to all Gen1 app state
|
|
146
|
+
aws-clients.ts # Single instantiation point for all AWS SDK clients
|
|
147
|
+
amplify-meta.ts # Reads/caches amplify-meta.json with typed accessors
|
|
148
|
+
backend-environment.ts # Backend environment resolution and caching
|
|
149
|
+
cloud-backend.ts # Downloads/caches current cloud backend
|
|
150
|
+
|
|
151
|
+
auth/
|
|
152
|
+
auth.generator.ts # Produces auth/resource.ts + backend.ts contributions
|
|
153
|
+
auth-triggers.ts # Auth trigger connection parsing
|
|
154
|
+
|
|
155
|
+
storage/
|
|
156
|
+
storage.generator.ts # Produces storage/resource.ts + backend.ts contributions
|
|
157
|
+
storage-access.ts # S3/DynamoDB access pattern parsing
|
|
158
|
+
|
|
159
|
+
data/
|
|
160
|
+
data.generator.ts # Produces data/resource.ts + backend.ts contributions
|
|
161
|
+
schema-reader.ts # GraphQL schema reading
|
|
162
|
+
|
|
163
|
+
functions/
|
|
164
|
+
functions.generator.ts # Produces resource.ts per function + backend.ts contributions
|
|
165
|
+
schedule-parser.ts # CloudWatch schedule expression conversion
|
|
166
|
+
trigger-detector.ts # DynamoDB/API trigger detection
|
|
167
|
+
|
|
168
|
+
analytics/
|
|
169
|
+
analytics.generator.ts # Produces analytics/resource.ts + backend.ts contributions
|
|
170
|
+
kinesis-cfn-converter.ts # Kinesis CFN-to-CDK conversion
|
|
171
|
+
|
|
172
|
+
custom-resources/
|
|
173
|
+
custom.generator.ts # Copies/transforms custom CDK stacks
|
|
174
|
+
amplify-helper-transformer.ts
|
|
175
|
+
dependency-merger.ts
|
|
176
|
+
file-converter.ts
|
|
177
|
+
|
|
178
|
+
backend.generator.ts # Generator that runs last — accumulates contributions, writes backend.ts
|
|
179
|
+
root-package-json.generator.ts # Writes root package.json, accumulates dependencies from category generators
|
|
180
|
+
backend-package-json.generator.ts # Writes amplify/package.json (static { type: 'module' })
|
|
181
|
+
tsconfig.generator.ts # Writes amplify/tsconfig.json
|
|
182
|
+
amplify-yml.generator.ts # Writes/updates amplify.yml buildspec
|
|
183
|
+
gitignore.generator.ts # Writes/updates .gitignore
|
|
184
|
+
generator.ts # Generator interface
|
|
185
|
+
ts-writer.ts # TypeScript AST printing utility
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Key Abstractions
|
|
189
|
+
|
|
190
|
+
**Generator interface** — Every generator implements this. Returns `AmplifyMigrationOperation[]` from `plan()`, reusing the existing operation interface that co-locates `describe()` and `execute()`. `AmplifyMigrationGenerateStep.execute()` collects all operations and returns them to the gen2-migration dispatcher, which already handles the describe-then-execute flow.
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
interface Generator {
|
|
194
|
+
plan(): Promise<AmplifyMigrationOperation[]>;
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Gen1App** — Lazy-loading facade passed to every generator. Each `fetch*` method calls AWS on first invocation and caches the result. Properties are initialized synchronously from local files in the constructor. Returns raw SDK types or parsed file contents directly — no custom intermediate interfaces. Easy to mock: stub only the methods your test needs.
|
|
199
|
+
|
|
200
|
+
```typescript
|
|
201
|
+
class Gen1App {
|
|
202
|
+
public readonly accountId: string;
|
|
203
|
+
public readonly region: string;
|
|
204
|
+
public readonly meta: Record<string, unknown>; // parsed amplify-meta.json
|
|
205
|
+
public readonly graphQLSchema: string | undefined; // raw file content
|
|
206
|
+
|
|
207
|
+
public fetchUserPool(): Promise<UserPoolType | undefined>; // raw SDK type
|
|
208
|
+
public fetchIdentityPool(): Promise<IdentityPoolType | undefined>; // raw SDK type
|
|
209
|
+
public fetchFunctionConfig(resourceName: string): Promise<FunctionConfiguration | undefined>; // raw SDK type
|
|
210
|
+
// ... other raw Gen1 state as needed
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**BackendGenerator** — Implements `Generator`. Other generators call `addImport()`, `addStatement()`, etc. during their execution. When run last, it writes `backend.ts` from the accumulated content.
|
|
215
|
+
|
|
216
|
+
```typescript
|
|
217
|
+
class BackendGenerator implements Generator {
|
|
218
|
+
public addImport(source: string, identifiers: string[]): void;
|
|
219
|
+
public addStatement(node: ts.Statement): void;
|
|
220
|
+
public plan(): Promise<AmplifyMigrationOperation[]>;
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Category generators** — Each category has a generator that reads its entries from `Gen1App.meta`, and for each resource name dispatches to a resource-specific generator based on the `service` key. The category generators are:
|
|
225
|
+
|
|
226
|
+
- `AuthGenerator` → dispatches to resource generators by service (Cognito, Cognito-UserPool-Groups)
|
|
227
|
+
- `DataGenerator` → dispatches to resource generators by service (AppSync, API Gateway)
|
|
228
|
+
- `StorageGenerator` → dispatches by service (S3, DynamoDB)
|
|
229
|
+
- `FunctionsGenerator` → dispatches to `FunctionGenerator` per resource
|
|
230
|
+
- `AnalyticsGenerator` → dispatches to resource generators by service (e.g., Kinesis, Pinpoint)
|
|
231
|
+
- `CustomResourcesGenerator` → dispatches to `CustomResourceGenerator` per resource
|
|
232
|
+
|
|
233
|
+
Each resource generator receives `Gen1App`, `BackendGenerator`, `RootPackageJsonGenerator`, the output directory, and the resource name. It writes its `resource.ts` and contributes to `BackendGenerator` and `RootPackageJsonGenerator`.
|
|
234
|
+
|
|
235
|
+
**AmplifyMigrationGenerateStep.execute()** — The orchestration lives directly in the existing step class. Reads `Gen1App.meta` top-level keys to determine which categories exist. Creates one category generator per key. Collects all `AmplifyMigrationOperation[]` from generators and returns them to the parent dispatcher, which handles describe-then-execute.
|
|
236
|
+
|
|
237
|
+
```typescript
|
|
238
|
+
// Inside AmplifyMigrationGenerateStep
|
|
239
|
+
public async execute(): Promise<AmplifyMigrationOperation[]> {
|
|
240
|
+
const gen1App = new Gen1App(/* aws clients, region, appId, etc. */);
|
|
241
|
+
const backendGenerator = new BackendGenerator(this.outputDir);
|
|
242
|
+
const rootPackageJsonGenerator = new RootPackageJsonGenerator(this.outputDir);
|
|
243
|
+
const generators: Generator[] = [];
|
|
244
|
+
|
|
245
|
+
if (gen1App.meta.auth) {
|
|
246
|
+
generators.push(new AuthGenerator(gen1App, backendGenerator, packageJsonGenerator, this.outputDir));
|
|
247
|
+
}
|
|
248
|
+
// ... other categories follow the same pattern
|
|
249
|
+
|
|
250
|
+
generators.push(backendGenerator);
|
|
251
|
+
generators.push(rootPackageJsonGenerator);
|
|
252
|
+
generators.push(new BackendPackageJsonGenerator(this.outputDir));
|
|
253
|
+
generators.push(new TsConfigGenerator(this.outputDir));
|
|
254
|
+
generators.push(new AmplifyYmlGenerator(this.outputDir));
|
|
255
|
+
generators.push(new GitIgnoreGenerator(this.outputDir));
|
|
256
|
+
|
|
257
|
+
const operations: AmplifyMigrationOperation[] = [];
|
|
258
|
+
for (const generator of generators) {
|
|
259
|
+
operations.push(...(await generator.plan()));
|
|
260
|
+
}
|
|
261
|
+
return operations;
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Execution Flow
|
|
266
|
+
|
|
267
|
+
```mermaid
|
|
268
|
+
flowchart TD
|
|
269
|
+
STEP["AmplifyMigrationGenerateStep.execute()"] -->|Create| G1[Gen1App]
|
|
270
|
+
STEP -->|Create| BG[BackendGenerator]
|
|
271
|
+
|
|
272
|
+
G1 --> GEN[Create one CategoryGenerator per<br/>category present in Gen1App.meta]
|
|
273
|
+
BG --> GEN
|
|
274
|
+
|
|
275
|
+
GEN --> CAT["CategoryGenerator<br/>(Auth, Data, Storage, Functions,<br/>Analytics, CustomResources)"]
|
|
276
|
+
|
|
277
|
+
CAT -->|per resource name,<br/>dispatched by service key| RES[ResourceGenerator]
|
|
278
|
+
RES -->|writes| RES_F[amplify/category/resourceName/resource.ts]
|
|
279
|
+
RES -->|contributes| BG2[BackendGenerator]
|
|
280
|
+
RES -->|contributes deps| PKG[RootPackageJsonGenerator]
|
|
281
|
+
|
|
282
|
+
BG2 -->|writes last| BACK_F[amplify/backend.ts]
|
|
283
|
+
|
|
284
|
+
STEP -->|Create| PKG
|
|
285
|
+
PKG -->|writes| PKG_F[package.json]
|
|
286
|
+
|
|
287
|
+
STEP -->|Create| BPKG[BackendPackageJsonGenerator]
|
|
288
|
+
BPKG -->|writes| BPKG_F[amplify/package.json]
|
|
289
|
+
|
|
290
|
+
STEP -->|Create| TSC[TsConfigGenerator]
|
|
291
|
+
TSC -->|writes| TSC_F[amplify/tsconfig.json]
|
|
292
|
+
|
|
293
|
+
STEP -->|Create| YML[AmplifyYmlGenerator]
|
|
294
|
+
YML -->|writes| YML_F[amplify.yml]
|
|
295
|
+
|
|
296
|
+
STEP -->|Create| GIT[GitIgnoreGenerator]
|
|
297
|
+
GIT -->|writes| GIT_F[.gitignore]
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Phased Execution
|
|
301
|
+
|
|
302
|
+
**Execution notes:** Each phase should be delegated to a `general-task-execution` sub-agent with a prompt that references this document (`REFACTORING_GENERATE.md`) and the specific phase. The sub-agent has access to all tools and can read this document for full context. Wait for each phase to complete and review its output before starting the next. Use `context-gatherer` at the start of each phase to re-orient on the current state of the codebase.
|
|
303
|
+
|
|
304
|
+
**Work style:** Prefer large, cohesive refactoring changes over small incremental ones — don't waste time validating intermediate states you may end up discarding. Do not run `yarn test`, `jest`, or any test command for incremental validation during a phase. Commit freely as you work — no need to check in with the user before committing. Use your judgment on commit granularity.
|
|
305
|
+
|
|
306
|
+
**No imports from old code:** Code in `generate-new/` must NOT import from the old `generate/` directory. If you need a utility or class that exists in the old code, duplicate it into `generate-new/`. This ensures `generate-new/` is fully self-contained and the old `generate/` directory can be cleanly deleted in Phase 5 without breaking anything.
|
|
307
|
+
|
|
308
|
+
**Exit criteria (all phases):** `yarn build && yarn test` in the `amplify-cli` package must pass before moving on to the next phase.
|
|
309
|
+
|
|
310
|
+
**Phase 1 — Foundation**
|
|
311
|
+
Create a new `generate-new/` directory alongside the existing `generate/` directory. Build the foundation: `Gen1App` facade, `BackendGenerator`, `RootPackageJsonGenerator`, and `Generator` interface. The old `generate/` directory remains intact as reference throughout. Stop for review.
|
|
312
|
+
|
|
313
|
+
The old code and its unit tests remain intact and must continue to pass. No new tests are needed for this phase since the new code has no entry point yet.
|
|
314
|
+
|
|
315
|
+
**Phase 2 — Migrate categories**
|
|
316
|
+
One category at a time, create the new generator in `generate-new/` (e.g., `auth/auth.generator.ts`). Copy over and restructure the relevant logic from the old code. Each generator reads from `Gen1App`, writes its `resource.ts`, and contributes to `BackendGenerator` and `RootPackageJsonGenerator`. The old code stays untouched as reference. Stop for review after each generator. Code does not need to compile at this stage.
|
|
317
|
+
|
|
318
|
+
Same as Phase 1 — the old tests must still pass. No new tests yet since the new code is not wired in.
|
|
319
|
+
|
|
320
|
+
**Phase 3 — Switch over**
|
|
321
|
+
Once all generators are complete in `generate-new/`, update `generate.ts` (the `AmplifyMigrationGenerateStep` entry point) to use the new generator infrastructure instead of the old `prepare()` function. Use `generate.test.ts` (the snapshot tests) as the sole validation mechanism — these tests exercise the full generate pipeline end-to-end and compare output against known-good snapshots. Don't run or worry about the other unit tests in this phase; they test the old code's internal classes which are being replaced. Iterate until the snapshot tests are green.
|
|
322
|
+
|
|
323
|
+
The snapshot test framework (MigrationApp, mocks, test harness) must not be modified. Only the import path for `prepare` should change to point at the new implementation. Minor test file changes are allowed only with clear justification.
|
|
324
|
+
|
|
325
|
+
**Phase 4 — Review & simplify**
|
|
326
|
+
All snapshot tests pass. Phase 3 was implementation-driven — decisions were made to match expected output, and code was added under time pressure. This phase steps back and reviews the result against the coding guidelines, the design in this document, and the refactoring requirements (R1–R5).
|
|
327
|
+
|
|
328
|
+
Specifically:
|
|
329
|
+
|
|
330
|
+
1. **Coding guidelines audit.** Read every file in `generate-new/` against `CODING_GUIDELINES.md`. Look for violations introduced during Phase 3: missing visibility modifiers, unnecessary optionality, dead imports, missing `readonly`, single-line JSDoc on public members, `assert()` usage, mutable state that should be `const`, repeated derived values, catch-all error handling, etc.
|
|
331
|
+
|
|
332
|
+
2. **Design alignment.** Compare the actual code against the target directory structure and key abstractions described above. Flag any deviations — files that don't belong, abstractions that leaked, responsibilities that ended up in the wrong place. For example: does `prepare.ts` contain logic that should live in a generator? Does `BackendGenerator.earlyStatements` violate the design's intent? Are there cross-category dependencies that shouldn't exist?
|
|
333
|
+
|
|
334
|
+
3. **Requirement check.** Verify each requirement (R1–R5) is met:
|
|
335
|
+
|
|
336
|
+
- R1: Do all generators access Gen1 app info through `Gen1App`? Or did Phase 3 introduce direct file reads or SDK calls outside the facade?
|
|
337
|
+
- R2: Do category generators contribute to `backend.ts` through `BackendGenerator`? Or did workarounds bypass it?
|
|
338
|
+
- R3: Can a new category be added without modifying existing generators? Or did Phase 3 introduce coupling?
|
|
339
|
+
- R4: Is each category generator self-contained? Or did cross-category logic creep in (e.g., functions generator knowing about auth, storage generator reading function templates)?
|
|
340
|
+
- R5: Do generators support dry run via `plan()` returning describable operations?
|
|
341
|
+
|
|
342
|
+
4. **Simplification pass.** Remove anything that was added as a workaround but can now be done more cleanly. Collapse unnecessary indirection. Inline trivial helpers. Merge files that are too small to justify their existence. Reduce the surface area.
|
|
343
|
+
|
|
344
|
+
5. **No imports from old code.** Verify that `generate-new/` has no imports from `generate/`. If Phase 3 introduced any (e.g., `auth_access_analyzer`), duplicate the needed logic or refactor it out.
|
|
345
|
+
|
|
346
|
+
Exit criteria: all snapshot tests still pass, the code is clean against coding guidelines, and the design matches the intent of this document. Stop for review.
|
|
347
|
+
|
|
348
|
+
**Phase 5 — Unit tests**
|
|
349
|
+
Write unit tests for the new classes in `generate-new/`. Test individual components (generators, renderers, Gen1App, BackendGenerator) in isolation. Don't port old tests mechanically — write tests that cover the same ground with the new architecture. The old `generate/` directory and its tests remain intact. The old code stays as reference for future refactoring passes.
|
|
350
|
+
|
|
351
|
+
Exit criteria: all snapshot tests still pass, new unit tests pass, old tests still pass.
|
|
352
|
+
|
|
353
|
+
**Phase 6 — Merge**
|
|
354
|
+
Merge the branch. The old `generate/` directory stays in the codebase but is no longer wired (generate.ts imports from `generate-new/`). This keeps the PR focused on the new code.
|
|
355
|
+
|
|
356
|
+
**Phase 7 — Delete old code**
|
|
357
|
+
In a separate PR: delete the old `generate/` directory and its tests. Rename `generate-new/` to `generate/`. Update all import paths. This is a clean deletion PR with no logic changes.
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## Design Principles for AI Assistants
|
|
362
|
+
|
|
363
|
+
When working on this codebase, follow these principles proactively — don't wait for the human to identify the issues.
|
|
364
|
+
|
|
365
|
+
### Design toward a target structure, not incrementally from existing code
|
|
366
|
+
|
|
367
|
+
Before making changes, define what the code should look like when you're done. Don't preserve existing patterns by default — question whether they belong in the target design. The existing code is a reference, not a constraint.
|
|
368
|
+
|
|
369
|
+
### Gen1App is a thin, category-agnostic facade
|
|
370
|
+
|
|
371
|
+
Gen1App provides generic access to the Gen1 project state. It must not contain category-specific logic (auth triggers, GraphQL schemas, REST API configs, function categories). If a method is only called by one generator, it belongs in that generator. Gen1App should look like the test framework's `MigrationApp` class in `_framework/app.ts` — eagerly resolved readonly fields, simple accessor methods, no caching of filesystem operations.
|
|
372
|
+
|
|
373
|
+
### Generators follow a consistent structure
|
|
374
|
+
|
|
375
|
+
Every generator has:
|
|
376
|
+
|
|
377
|
+
1. A constructor accepting `gen1App`, `backendGenerator`, `outputDir`, and references to other generators it contributes to
|
|
378
|
+
2. A renderer instance named `defineX` (e.g., `defineAuth`, `defineStorage`)
|
|
379
|
+
3. One public `plan()` method
|
|
380
|
+
4. Public methods to accept contributions from other generators (e.g., `addTrigger`, `addFunctionAuthAccess`)
|
|
381
|
+
5. Private methods that contribute to other generators
|
|
382
|
+
|
|
383
|
+
File length is fine as long as this structure is maintained. Don't split files based on line count — split based on responsibility.
|
|
384
|
+
|
|
385
|
+
### Eliminate intermediate reshaping layers
|
|
386
|
+
|
|
387
|
+
If data flows through an interface that just renames properties from the previous layer, that interface shouldn't exist. Renderers should accept raw SDK types directly. The test: if removing a layer only requires renaming properties at the boundary, the layer is pure overhead.
|
|
388
|
+
|
|
389
|
+
### Each generator owns its domain knowledge
|
|
390
|
+
|
|
391
|
+
A generator should derive everything it needs from `Gen1App` and its own inputs. It should not rely on other generators to parse data on its behalf. For example:
|
|
392
|
+
|
|
393
|
+
- The function generator determines its own trigger event type (from the resource name suffix), not the auth generator
|
|
394
|
+
- The data generator reads the GraphQL schema from the cloud backend, not Gen1App
|
|
395
|
+
- The auth generator gets Cognito IDs from `metaOutput`, not from walking CloudFormation stacks
|
|
396
|
+
|
|
397
|
+
### Prefer concrete identifiers over generic resource maps
|
|
398
|
+
|
|
399
|
+
AWS SDK calls should accept the specific ID they need (user pool ID, bucket name, function name), not a generic `Record<string, StackResource>` that the callee searches through. The caller extracts the ID from `metaOutput` and passes it directly.
|
|
400
|
+
|
|
401
|
+
### Don't add defensive checks for states that can't occur
|
|
402
|
+
|
|
403
|
+
If a previous step validated that a resource exists, don't null-check it again downstream. If `singleResourceName` found the auth resource, `metaOutput('auth', name, 'UserPoolId')` will have a value — don't add `if (!userPoolId) return []`. The coding guidelines are explicit about this: "Only return fallbacks or branch for valid states."
|
|
404
|
+
|
|
405
|
+
### Cross-generator contributions flow from producer to consumer
|
|
406
|
+
|
|
407
|
+
When generator A needs information from generator B's domain, B contributes it to A — not the other way around. For example:
|
|
408
|
+
|
|
409
|
+
- Function generators contribute trigger info and auth access permissions to the auth generator
|
|
410
|
+
- Function generators contribute storage access to the S3 generator
|
|
411
|
+
- All generators contribute imports and statements to the backend generator
|
|
412
|
+
|
|
413
|
+
The consumer exposes `addX()` methods. The producer calls them during `plan()`.
|