Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(open-api-gateway): idomatic smithy project structure for better IDE support #280

Merged
merged 2 commits into from
Feb 6, 2023

Conversation

cogwirrel
Copy link
Member

This change restructures the smithy-based projects to combine the model and smithy-build directories into a single smithy directory. This directory has a more similar structure to those found in the Smithy documentation, and in turn means that IDE tools can be more easily configured to help with the developer experience.

Specifically with this change, the Smithy IntelliJ plugin can be used to enhance the development experience when authoring models. https://github.com/iancaffey/smithy-intellij-plugin

We preserve the behaviour of abstracting away the gradle wrapper, whereby it is ignored from the generated project's source control by default, and copied from the PDK if it does not already exist. Similarly we allow users to bring their own gradle wrapper by choosing not to ignore it in source control, and placing it in the smithy directory. This replaces the gradleWrapperPath configuration option.

While this is a breaking change, the migration steps are fairly straightforward:

  • Upgrade the open-api-gateway package
  • npx projen to regenerate code - notice the new smithy folder in your api project
  • Copy the contents of the old model directory into smithy/src/main/smithy
  • If any custom dependencies were added to the smithy-build/build.gradle file, add them to smithy/build.gradle
  • Delete the old model and smithy-build directories

BREAKING CHANGE: Moved the location of the smithy model from 'model' to 'smithy/src/main/smithy'. Removed the gradleWrapperPath configuration option.

fix #278

@nx-cloud
Copy link

nx-cloud bot commented Feb 3, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit ccddc4c. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

Copy link
Contributor

@JeremyJonas JeremyJonas left a comment

Choose a reason for hiding this comment

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

Is it possible to add auto-migration capabilities - thinking for the model folder move would be great. More curious from how we can handle migrations in general for packages that this particularly since quite minimal. Nothing have to do now, but could be a nice simple example to attempt 😄

@cogwirrel cogwirrel force-pushed the feat/idiomatic-smithy-structure branch from 113a2a9 to a366643 Compare February 3, 2023 08:15
@cogwirrel
Copy link
Member Author

Is it possible to add auto-migration capabilities - thinking for the model folder move would be great. More curious from how we can handle migrations in general for packages that this particularly since quite minimal. Nothing have to do now, but could be a nice simple example to attempt 😄

This would be super cool, but is a little bit fiddly to do properly as we'd need to parse the old build.gradle file and copy the dependencies across into the new one. Given we're still at 0.x I think it's more trouble than it's worth! 😄

…ide support

This change restructures the smithy-based projects to combine the `model` and `smithy-build`
directories into a single `smithy` directory. This directory has a more similar structure to those
found in the Smithy documentation, and in turn means that IDE tools can be more easily configured to
help with the developer experience.

Specifically with this change, the Smithy IntelliJ plugin can be used to enhance the development
experience when authoring models. https://github.com/iancaffey/smithy-intellij-plugin

We preserve the behaviour of abstracting away the gradle wrapper, whereby it is ignored from the
generated project's source control by default, and copied from the PDK if it does not already
exist.  Similarly we allow users to bring their own `gradle wrapper` by choosing not to ignore
it in source control, and placing it in the `smithy` directory. This replaces the
`gradleWrapperPath` configuration option.

While this is a breaking change, the migration steps are fairly straightforward:

- Upgrade the open-api-gateway package
- `npx projen` to regenerate code - notice the new `smithy` folder in your api project
- Copy the contents of the old `model` directory into `smithy/src/main/smithy`
- If any custom dependencies were added to the `smithy-build/build.gradle` file, add them
to `smithy/build.gradle`
- Delete the old `model` and `smithy-build` directories

BREAKING CHANGE: Moved the location of the smithy model from 'model' to 'smithy/src/main/smithy'.
Removed the gradleWrapperPath configuration option.

fix #278
@cogwirrel cogwirrel force-pushed the feat/idiomatic-smithy-structure branch from a366643 to 7049544 Compare February 6, 2023 01:08
@cogwirrel cogwirrel merged commit af7315a into mainline Feb 6, 2023
@cogwirrel cogwirrel deleted the feat/idiomatic-smithy-structure branch February 6, 2023 05:06
mteichtahl pushed a commit to mteichtahl/aws-prototyping-sdk that referenced this pull request Feb 8, 2023
…ide support (aws#280)

This change restructures the smithy-based projects to combine the `model` and `smithy-build`
directories into a single `smithy` directory. This directory has a more similar structure to those
found in the Smithy documentation, and in turn means that IDE tools can be more easily configured to
help with the developer experience.

Specifically with this change, the Smithy IntelliJ plugin can be used to enhance the development
experience when authoring models. https://github.com/iancaffey/smithy-intellij-plugin

We preserve the behaviour of abstracting away the gradle wrapper, whereby it is ignored from the
generated project's source control by default, and copied from the PDK if it does not already
exist.  Similarly we allow users to bring their own `gradle wrapper` by choosing not to ignore
it in source control, and placing it in the `smithy` directory. This replaces the
`gradleWrapperPath` configuration option.

While this is a breaking change, the migration steps are fairly straightforward:

- Upgrade the open-api-gateway package
- `npx projen` to regenerate code - notice the new `smithy` folder in your api project
- Copy the contents of the old `model` directory into `smithy/src/main/smithy`
- If any custom dependencies were added to the `smithy-build/build.gradle` file, add them
to `smithy/build.gradle`
- Delete the old `model` and `smithy-build` directories

BREAKING CHANGE: Moved the location of the smithy model from 'model' to 'smithy/src/main/smithy'.
Removed the gradleWrapperPath configuration option.

fix aws#278
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.

[FEATURE] Support Smithy IntelliJ plugin
3 participants