Skip to content

Comments

chore: update directory structure and file names#14311

Merged
kaizencc merged 3 commits intoaws-amplify:gen2-migrationfrom
dgandhi62:gen2-migration-restructure
Oct 31, 2025
Merged

chore: update directory structure and file names#14311
kaizencc merged 3 commits intoaws-amplify:gen2-migrationfrom
dgandhi62:gen2-migration-restructure

Conversation

@dgandhi62
Copy link
Contributor

@dgandhi62 dgandhi62 commented Oct 30, 2025

Changes include:

  1. Renaming amplify-gen2-migration-codegen-dg directory to codegen-generate
  2. Removing src from migration_head
  3. Rename migration_head to codegen-head
  4. Remove codegen/cli directory

The src directory needs to remain for the codegen-generate folder since there would be an additional tsconfig file added for codegen in the future. This is to enforce strict:false behavior in tsconfig as it was in the old tool. Currently, amplify-cli's tsconfig has been modified to make the option strict:false from strict:true (which needs to change back before merging to dev)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dgandhi62 dgandhi62 marked this pull request as ready for review October 30, 2025 18:02
@dgandhi62 dgandhi62 requested a review from a team as a code owner October 30, 2025 18:02
Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! i'm still confused by these parts of the structure:

  • src folder --> why is it necessary to have another src folder? the folder structure is now amplify-cli/src/comands/codegen-generate/src. src typically is a top-level folder that delineates where all the source code lives so it's confusing to me to see it again.
  • migration_head folder -> what does this mean? why is this the head of the migration?
  • cll folder -> are we releasing generate as a CLI separate from the migrate tool?
  • npm_package folder -> are we releasing generate as a separate npm package?
  • test_utils folder -> ok, but where are the tests? I can only see auth/index.test.ts. in the structure of the gen2-migration branch, i see src/__tests__/gen2-migration with some tests from Sai and Sanjana. i think that's where all the unit tests belong, and if so, that's where test_utils belong too if they are truly just utilities for tests

@dgandhi62
Copy link
Contributor Author

dgandhi62 commented Oct 30, 2025

  1. The idea is that there needs to be a codegen-generate/tsconfig that applies for the entire codegen src files. Therefore, codegen-generate/src is what I figured makes sense. The codegen tsconfig needs to inherit from the amplify-cli one and override strict:false. I was facing errors while doing this and so I left it for before we merge to dev.

Although codegen is not its separate package, it is currently built to have some separate config requirements than amplify-cli.

  1. The thought was that the entire codegen runs from "command_handler.ts" which lives in migration_head. Other than that, all the files with it were clumped together to begin with in a separate package in the old tool. Didn't think of separating them unless needed.

  2. cli folder is unnecessary. This was there because I'd initially thought of integrating things differently before I saw the command files. Removing it.

  3. npm package contains a singular file called "renderer.ts", which I believe helps in creating package.jsons. Its part of the migration process

  4. The tests haven't been added yet. The unit tests in the old tool aren't comprehensive and I thought I'd go category by category and add them. The unit tests exist for auth-generator, the rest still need to be added / updated. I'm currently working on making the tests a little better for auth. Will add them soon.

I can make a separate pr to restructure the tests when they are ready en masse. Currently its just one file

@kaizencc kaizencc merged commit bd1fc47 into aws-amplify:gen2-migration Oct 31, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants