* Fix the error for babel/preset-typescript in docs.
* Unfix the version.
* Try using amaro for type stripping.
* Run prettier after stripping types.
* Fix tests.
---------
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
* feat(docs): code samples with ts type stripping
Introduce a new option to `$CodeSample`, `convertToJs`, which takes a
code sample written in TypeScript and strips the types to produce a
JavaScript version.
Adds tests for type stripping.
* Clarify instructions
---------
Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
Pages incorporating an external code sample on local dev will fail for contributors without the GitHub API key. This PR fixes the local DX by replacing such code samples with a local-only message describing the error, and asking contributors to check the preview site.
Add the ability to embed code samples from GitHub into tutorials, so we can have a single source of truth for the source code.
Introduces the <$CodeSample /> syntax, which is a special syntax and not a real React component (see the directives/README.md for why on earth I did it this way -- in this specific case, CodeHike adjusts the MDX syntax tree before it gets compiled, and we need to adjust it ourselves before CodeHike sees it, so we need to get down to the level of manipulating the AST in order to make this work with CodeHike).
Adjusted one of the example tutorials to use this new feature as a test.