feat: cumulative codegen structure#14296
Merged
iliapolo merged 16 commits intoaws-amplify:gen2-migrationfrom Oct 28, 2025
Merged
feat: cumulative codegen structure#14296iliapolo merged 16 commits intoaws-amplify:gen2-migrationfrom
iliapolo merged 16 commits intoaws-amplify:gen2-migrationfrom
Conversation
…tion - 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
Contributor
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
…degen - 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.
| // CLI entry point - handles command line interface | ||
| // import { migrateToGen2 } from '../core/migration-pipeline'; | ||
|
|
||
| export const run = async (args: string[]) => { |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
iliapolo
approved these changes
Oct 28, 2025
iankhou
pushed a commit
that referenced
this pull request
Oct 28, 2025
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR creates a code generation system that transforms Amplify Gen 1 authentication configurations into Gen 2 TypeScript code. The added code files are copies of the old tool to maintain dependencies. They would be updated individually in future prs.
Currently, strict:false has been set for packages/amplify-cli/tsconfig.json. This is because this setting is required for codegen. The following issue would need to be resolved in future prs:
A separate typescript compilation would need to be configured for codegen. That is, a separate tsconfig file and jest config would be added. To accomodate the new tsconfig settings, the build script would be changed to compile and test codegen separately. If any changes to codegen name or placement would be made, the following points of change would be required:
packages/amplify-cli/package.json
Build script: tsc -p src/commands/../gen2-migration/NEW_NAME/tsconfig.json
Test script: jest --config src/commands/../gen2-migration/NEW_NAME/jest.config.js
testIgnorePathPatterns
packages/amplify-cli/tsconfig.json
Exclude pattern: "src/commands/gen2-migration/NEW_NAME"
.gitignore
packages/amplify-cli/src/commands/gen2-migration/NEW_NAME/lib
yarn testpassesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.