chore(docs): bring examples into npm workspace #1434
Merged
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.
Description of your changes
The repository uses npm workspaces to manage the different sections/packages of the codebase. Before this PR, the only two remaining entities that were still outside of the workspace were the examples found in
examples/sam
andexamples/cdk
.One of the side effects of this setup was that the examples were using the versions of the Powertools utilities published on npm rather than using the ones in the repository. This meant that the examples could either go for long periods of time without getting updated or that maintainers had to manually bump the version after making a release, since due to how
lerna
works, during the release process the next npm version was not published yet at the time of versioning.Another effect of this setup was that dependencies were being duplicated in at least 3
node_modules
folders (the workspace one, as well as one for each example folder) and this caused additional management overhead whenever there was a version bump needed in any of the shared dependencies.This PR aims at removing all these issues by bringing the two
examples/*
folders into the npm workspace, so that the examples can now be managed together with the rest of the other packages.With this new setup, the dependencies of the two examples folders are managed at the workspace level. This has a few advantages:
lerna
is now able to effectively bump the Powertools utilities versions in the examplesGiven that now all
node_modules
are handled centrally, this PR also simplifies the GitHub workflows by centralizing the caching in a dedicated local GitHub action, which can be found at.github/actions/cached-node-modules
and that is used by all other workflows.Related issues, RFCs
Issue number: #1407
Checklist
Breaking change checklist
Is it a breaking change?: NO
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.