Skip to content

Maintenance: move code snippets under examples #2398

Closed
@dreamorosi

Description

@dreamorosi

Summary

Currently the code snippets of the documentation live under the docs/snippets folder. This location was chosen before we expanded the npm workspace to other packages under the packages/* directory, which means we also had to use TypeScript paths to "link" the utilities to the snippets.

Additionally, these code samples are hard to find and in a different place from where customers might expect to find them - i.e. under examples.

Why is this needed?

So that customers can refer to them and find them more easily.

Additionally, the TypeScript config change will also streamline the project's setup.

Which area does this relate to?

Other

Solution

The change will have to be made in this order:

  • remove the docs/snippet npm workspace (might need to run npm un -w docs/snippets but not sure)
  • move the entire content of docs/snippets to examples/snippets
  • add back the workspace to the larger npm workspace (might need to run npm i -w examples/snippets or simply find & replace docs/snippets occurrences in lerna.json, package.json, and package-lock.json)
  • clear all the path aliases in the tsconfig.json of the snippets project
  • add all Powertools utilities as dependency of the snippets workspace (i.e. npm i @aws-lambda-powertools/logger -w examples/snippets)
  • replace all imports in the docs to point to the new location
  • replace all occurrences of old location/workspace name in CI - aka under .github/

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

Labels

completedThis item is complete and has been merged/shippeddocumentationImprovements or additions to documentationinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions