-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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: add DevContainer config for GitHub codespaces #4003
Conversation
Signed-off-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
✔️ Deploy preview for docusaurus-2 ready! 🔨 Explore the source changes: 9d2b5af 🔍 Inspect the deploy logs: https://app.netlify.com/sites/docusaurus-2/deploys/5ffc55ede3dc430007df38d5 😎 Browse the preview: https://deploy-preview-4003--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-4003--docusaurus-2.netlify.app/classic/ |
Size Change: -2 B (0%) Total Size: 26.7 kB ℹ️ View Unchanged
|
Thanks Can you give context about this feature? Why is it useful, and how can I validate that your PR is good? |
@slorber Github codespaces uses docker containers as a complete dev environment and it can be configured as per the project needs. This pr add the configuration required for docusaurus i.e. install all the packages and forwards the docusaurus port for the user to connect using browsers otherwise users cannot open it. |
@kumaraditya303 thanks but I need more infos. How can I test your PR exactly and see in practice that it works, and the benefits of supporting Codespaces? Also, how do we document this so that users can discover this feature? |
@slorber It similar to gitpod and there isn't any docs needed as GitHub codespaces automatically uses devcontainer.json. Users can directly open with codespaces and good to go. |
@slorber do you have access to GitHub codespaces? |
Unfortunately no, I'm still on the waiting list 😅 |
@slorber Ohh, I am a beta and pro user so I got it very early. |
.devcontainer/devcontainer.json
Outdated
@@ -0,0 +1,14 @@ | |||
{ | |||
"name": "Docusaurus Dev Container", | |||
"image": "mcr.microsoft.com/vscode/devcontainers/typescript-node:0-10-buster", |
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.
how did you choose the image here?
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 may need something on node LTS 14 instead of node 10
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.
@slorber Because the GitHub workflow are using nodejs 10 so I chose that
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 image I chose is one of the official GitHub codespaces images for nodejs with typescript support
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 may move/require node 14 LTS soon so it's better to use node 14 directly for this feature
Can you show me screenshots or somthing about how this feature works? I'm ok to merge it as it seems harmful and could check later how it works, just curious to see it in action |
.devcontainer/devcontainer.json
Outdated
@@ -0,0 +1,14 @@ | |||
{ | |||
"name": "Docusaurus Dev Container", |
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.
Why tabs?
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.
just reformatted it
IMO its a ripoff of Gitpod that is less extendable and I don't see any benefit of using it over Gitpod. Gitpod, unlike Codespaces, is fully open-source. |
@slorber What do you mean by |
I meant "does not seem harmful". Let's merge it and see if people report config problems. |
@kumaraditya303 can you reformat the json file with prettier please? Or give me edit permission on your PR so that I can do it myself? (otherwise I'd need to open another PR) |
@slorber given edit permission |
thanks |
Motivation
Dev container for GitHub codespaces
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Not Required
Related PRs
None