-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
171 create script to sync examples #172
Conversation
✅ Deploy Preview for jest-preview-library ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- We need to review the content of
/docs/examples/*.md
before deleting it. They might need to combine with the current README.md in/examples
. (Sorry for the inconsistent) - We might want to keep the front matter, to preserve the order of examples (need more discussion).
--- | ||
sidebar_position: 2 | ||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for discussion. There are 2 options:
- Keep the front matter. In the future, we might want to add more data to the front matter. We might need to map the README in
/examples
with the existing.md
file in/website
- Just remove all
.md
file in/website/docs/examples/
like you did. But we cannot control the order of example. And if we want to tweak something by adding more fields in front matter. It might be not possible. (or we can just add the front matter directly to README.md file??)
## Caveats | ||
|
||
Next's `<Image />` component has yet to work with Jest Preview. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not mentioned in https://github.com/nvh95/jest-preview/tree/main/examples/nextjs-babel
Please help to move it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Caveats | ||
|
||
Next's `<Image />` component has yet to work with Jest Preview. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not mentioned in https://github.com/nvh95/jest-preview/tree/main/examples/nextjs
Please help to move it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually they are there
🚧 Next.js's <Image /> component isn't working with Jest Preview yet.
website/scripts/syncExampleDocs.js
Outdated
const path = require('path'); | ||
|
||
const rootExamples = '../../examples'; | ||
const webDocs = '../docs/examples'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current build is failed.
https://app.netlify.com/sites/jest-preview-library/deploys/62bc8bb04f81ca0009cc8374
Remember the build settings
You might need to adjust the script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an issue with build, because all over the docs and examples relative paths are used. I have fixed some with last code fix, but what do you think, maybe we should go with absolute paths?
website/docs/examples/jest-24.md
Outdated
# Use with Jest 24 | ||
|
||
This example demonstrates how to use `jest-preview` with `jest-24`. The main intention of this example is to make sure Jest Preview works with Jest 24 | ||
|
||
## Setup jest with vite | ||
|
||
If you haven't set up jest with vite yet, you can see how to do it at [Setup Jest with Vite](https://hung.dev/jest-vite) ([repo](https://github.com/nvh95/jest-with-vite)). | ||
|
||
## Installation and Usage | ||
|
||
Please refer to [Installation](../getting-started/installation.md) and [Usage](../getting-started/usage.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we don't need to add every example to the docs site.
The idea of examples
folder I learned from Next.js (https://github.com/vercel/next.js/tree/canary/examples)
They attracts contributors to contribute by examples
. And it's very easy for anyone to find their corresponding technology in examples
folder.
It will be a ridiculous huge folder in the future. So I think we don't want to put every example
to www.jest-preview.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, jest-24
serve a little bit like an integration test, more than an example
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, before we move to other comments and fixes, we need some sort of mapping of which examples we want to include, so then I can filter them out and work from there
…o relative path to website docs and remove one unnecessary page in the user flow
b9aa0f8
to
98955bf
Compare
@all-contributors please add @skirianov for code |
I've put up a pull request to add @skirianov! 🎉 |
@all-contributors please add @skirianov for code |
I've put up a pull request to add @skirianov! 🎉 |
Summary/ Motivation (TLDR;)
Created a script to copy files from GitHub examples and add/replace them in the Website Docs examples section.
Related issues
#171
Features