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

chore(docs): bring examples into npm workspace #1434

Merged
merged 11 commits into from
May 4, 2023

Conversation

dreamorosi
Copy link
Contributor

@dreamorosi dreamorosi commented May 4, 2023

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 and examples/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:

  • While versioning the workspace lerna is now able to effectively bump the Powertools utilities versions in the examples
  • Most of the dependencies duplication has been removed
  • The repo setup process has now been streamlined
  • Future dependency version updates are now centralised.

Given 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

  • My changes meet the tenets criteria
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in areas that should be flagged with a TODO, or hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding changes to the examples
  • My changes generate no new warnings
  • The code coverage hasn't decreased
  • I have added tests that prove my change is effective and works
  • New and existing unit tests pass locally and in Github Actions
  • Any dependent changes have been merged and published
  • The PR title follows the conventional commit semantics

Breaking change checklist

Is it a breaking change?: NO

  • I have documented the migration process
  • I have added, implemented necessary warnings (if it can live side by side)

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.

@dreamorosi dreamorosi self-assigned this May 4, 2023
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label May 4, 2023
@github-actions github-actions bot added the internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.) label May 4, 2023
@dreamorosi dreamorosi linked an issue May 4, 2023 that may be closed by this pull request
2 tasks
@pull-request-size pull-request-size bot added size/XL PRs between 500-999 LOC, often PRs that grown with feedback and removed size/L PRs between 100-499 LOC labels May 4, 2023
@dreamorosi dreamorosi merged commit 27ca202 into main May 4, 2023
@dreamorosi dreamorosi deleted the chore/examples_workspace branch May 4, 2023 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.) size/XL PRs between 500-999 LOC, often PRs that grown with feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintenance: fix version bump in examples
1 participant