Skip to content

Sync examples with StackBlitz #2798

@mrlubos

Description

@mrlubos

We want our examples living in the examples folder (except for examples/openapi-ts-sample) to be deployed to StackBlitz and kept in sync with the latest code as we merge features into the main branch. There are two parts to this task:

  1. We want to build examples, generate code using openapi-ts, and test examples as part of every CI run just like we do with regular packages. This is to ensure merging a new feature doesn't break any examples. If so, we need to update them before merging. This would function similar to snapshot tests, so we should have a simple command to update generate code in examples, just like we have pnpm test:update for updating all snapshots. In the end, this step ensures our examples directory is always kept up-to-date with the code in the same branch.
  2. When we make a new release using changesets, after we publish a new version to npm, we want to update live examples hosted on StackBlitz. Currently, these are maintained manually and there's only a subset of examples from the examples folder on StackBlitz due to the effort required to maintain them. We want to ensure the StackBlitz URL for any example would never change once it's first published, so we can reference a permalink to each example. The challenge here will be to wait until the new version is published on npm, so when we update StackBlitz, it's correctly pulling the latest version. In the end, this step ensures our examples directory is always kept up-to-date with the released version.

Feel free to split this issue into two pull requests and start with the simpler step 1 before moving onto step 2. Feel free to ask clarifying questions.

Metadata

Metadata

Assignees

Labels

docs 📃Improvements or additions to documentationfeature 🚀New feature or requestinternal ⚙️Internal development related

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions