feat: add devcontainer for documentation development#314
Conversation
Signed-off-by: Mohit Jeswani <2022.mohit.jeswani@ves.ac.in>
✅ Deploy Preview for kmesh-net ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
Adds a Dev Container configuration and documentation so contributors can develop the Kmesh documentation site in a pre-configured environment (Codespaces or VS Code Dev Containers), reducing local setup friction.
Changes:
- Added
.devcontainer/devcontainer.jsonto define a Node-based dev environment, auto-install deps, and forward the Docusaurus dev server port. - Updated
README.mdwith Codespaces and Dev Containers setup instructions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.devcontainer/devcontainer.json |
Introduces a Dev Container setup (Node image, dependency install, port forwarding, recommended extensions). |
README.md |
Documents how to use Codespaces/Dev Containers for a streamlined docs development workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "name": "Kmesh Website Development", | ||
| "image": "mcr.microsoft.com/devcontainers/javascript-node:20", | ||
|
|
| yarn start | ||
| ``` | ||
|
|
||
| Both options provide a pre-configured environment with Node.js 20 and recommended VS Code extensions for documentation development. |
| // Install dependencies using yarn to match the project's lockfile | ||
| "postCreateCommand": "yarn install --frozen-lockfile", |
There was a problem hiding this comment.
Code Review
This pull request introduces a development environment configuration using VS Code Dev Containers and GitHub Codespaces, along with updated documentation in the README.md. A review comment suggests removing the ESLint extension from the dev container setup, as the project currently lacks the necessary ESLint dependencies and configuration to make use of it.
| "yzhang.markdown-all-in-one", | ||
| "dbaeumer.vscode-eslint" |
There was a problem hiding this comment.
The dbaeumer.vscode-eslint extension is included, but eslint is not listed as a dependency in package.json, nor is there an ESLint configuration file visible in the repository. Unless ESLint is being added to the project, this extension will not provide any functionality and can be removed to keep the development environment lean.
"yzhang.markdown-all-in-one"|
/lgtm |
Summary
Fixes #123
Currently, contributors need to manually install Node.js, dependencies, and handle platform-specific issues before they can start contributing to the Kmesh documentation. This PR adds a Dev Container configuration that provides a pre-configured, ready-to-code environment — eliminating manual setup entirely.
What this PR does
1. Adds
.devcontainer/devcontainer.jsonA devcontainer configuration that provides:
mcr.microsoft.com/devcontainers/javascript-node:20— matches the project's Node.js 20 requirement and the Netlify production environment (NODE_VERSION = 20.14.0innetlify.toml)yarn install --frozen-lockfileon container creation so contributors don't need to run it manually3000(Docusaurus dev server) and opens the browsermarkdownlint— aligns with the project's lint CI workflowcode-spell-checker— aligns with the project's codespell CI workflowmarkdown-all-in-one— TOC generation, preview, and keyboard shortcuts for docs editingeslint— JavaScript linting for configuration files2. Updates
README.mdAdds a "Development Environment" section with instructions for:
Both options follow the existing README convention of showing
npmandyarnalternatives.How to test
GitHub Codespaces
feat/add-devcontainernpm startoryarn startVS Code Dev Containers (Local)
npm startoryarn starthttp://localhost:3000Files changed
.devcontainer/devcontainer.jsonREADME.mdTotal: 2 files, 66 additions