Skip to content

Commit cf3b3c1

Browse files
dgandhi62iankhou
authored andcommitted
feat: cumulative codegen structure (#14296)
* feat: add codegen auth v1 * chore: add a new tsconfig file for codegen tool * chore: added codegen tsconfig reference in base tsconfig * chore: add build artifacts * feat: add comprehensive codegen tool for amplify gen 1 to gen 2 migration - add auth generator file to generate typescript asts - add preliminary unit tests for the auth generator - integrate the rest of the old migration tool to maintain dependencies * chore: updated dependencies * chore: update dependencies * fix: add proper exclusions for codegen tsconfig * feat: configure separate TypeScript compilation for gen2-migration codegen - Add dual build process: main project with strict:true, gen2-migration with strict:false - Update build script to compile both tsconfigs sequentially - Exclude gen2-migration directory from main tsconfig to prevent double compilation - Create separate Jest config for gen2-migration tests with relaxed TypeScript settings - Update test script to run both Jest configurations - Add gen2-migration lib directory to .gitignore to exclude compiled artifacts - Configure gen2-migration tsconfig with strict:false, skipLibCheck, and proper paths This allows the gen2-migration codegen to build and test with relaxed TypeScript settings while maintaining strict type checking for the main codebase. * chore: change auth generator to the original tool * chore: update jest.config.js * chore: update jest.config.js * feat: auth generator update v1 * chore: add separate command for running codegen tests * fix: revert tsconfig and package.json changes and set strict:false for amplify-cli * chore: update auth generator to original tool's code
1 parent 0cc4ff5 commit cf3b3c1

File tree

34 files changed

+4641
-674
lines changed

34 files changed

+4641
-674
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ packages/amplify-opensearch-simulator/emulator
4242
packages/graphql*/lib
4343
packages/amplify-graphql-transformer-*/lib
4444
packages/amplify-cli/lib
45+
packages/amplify-cli/src/commands/gen2-migration/amplify-gen2-migration-codegen-dg/lib
4546
packages/amplify-cli-npm/lib
4647
packages/amplify-cli-core/lib
4748
packages/amplify-cli-core-vNext/lib

packages/amplify-cli/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@
107107
},
108108
"devDependencies": {
109109
"@aws-amplify/amplify-function-plugin-interface": "1.12.1",
110+
"@aws-sdk/client-cognito-identity-provider": "^3.624.0",
111+
"@aws-sdk/client-lambda": "^3.624.0",
112+
"@aws-sdk/client-s3": "^3.624.0",
110113
"@types/archiver": "^5.3.1",
111114
"@types/columnify": "^1.5.1",
112115
"@types/folder-hash": "^4.0.1",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Auth adapter - converts Gen 1 auth config to intermediate format
2+
// Logic from amplify-gen1-codegen-auth-adapter
3+
export const adaptAuthConfig = async (gen1AuthConfig: any) => {
4+
// Convert Gen 1 auth configuration to intermediate format
5+
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Data adapter - converts Gen 1 GraphQL/DynamoDB config to intermediate format
2+
// Logic from amplify-gen1-codegen-data-adapter
3+
export const adaptDataConfig = async (gen1DataConfig: any) => {
4+
// Convert Gen 1 data configuration to intermediate format
5+
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Functions adapter - converts Gen 1 Lambda functions to intermediate format
2+
// Logic from amplify-gen1-codegen-function-adapter
3+
export const adaptFunctionsConfig = async (gen1FunctionsConfig: any[]) => {
4+
// Convert Gen 1 functions configuration to intermediate format
5+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Project adapter - handles Gen 1 project detection and parsing
2+
// Logic from amplify-migration
3+
export const detectGen1Project = async (projectPath: string) => {
4+
// Detect if project is Gen 1
5+
// Parse amplify directory structure
6+
// Extract project metadata
7+
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Storage adapter - converts Gen 1 S3 storage config to intermediate format
2+
// Logic from amplify-gen1-codegen-storage-adapter
3+
export const adaptStorageConfig = async (gen1StorageConfig: any) => {
4+
// Convert Gen 1 storage configuration to intermediate format
5+
};

0 commit comments

Comments
 (0)