Skip to content

feat: add devcontainer for documentation development#314

Open
mohitjeswani01 wants to merge 1 commit into
kmesh-net:mainfrom
mohitjeswani01:feat/add-devcontainer
Open

feat: add devcontainer for documentation development#314
mohitjeswani01 wants to merge 1 commit into
kmesh-net:mainfrom
mohitjeswani01:feat/add-devcontainer

Conversation

@mohitjeswani01
Copy link
Copy Markdown

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.json

A devcontainer configuration that provides:

  • Base image: mcr.microsoft.com/devcontainers/javascript-node:20 — matches the project's Node.js 20 requirement and the Netlify production environment (NODE_VERSION = 20.14.0 in netlify.toml)
  • Auto dependency install: Runs yarn install --frozen-lockfile on container creation so contributors don't need to run it manually
  • Port forwarding: Automatically forwards port 3000 (Docusaurus dev server) and opens the browser
  • VS Code extensions pre-installed:
    • markdownlint — aligns with the project's lint CI workflow
    • code-spell-checker — aligns with the project's codespell CI workflow
    • markdown-all-in-one — TOC generation, preview, and keyboard shortcuts for docs editing
    • eslint — JavaScript linting for configuration files

2. Updates README.md

Adds a "Development Environment" section with instructions for:

  • GitHub Codespaces — one-click setup with an "Open in Codespaces" badge
  • VS Code Dev Containers — local Docker-based setup with step-by-step guide

Both options follow the existing README convention of showing npm and yarn alternatives.

How to test

GitHub Codespaces

  1. Go to CodeCodespacesCreate codespace on feat/add-devcontainer
  2. Wait for the container to build and dependencies to install automatically
  3. Run npm start or yarn start
  4. Verify the Docusaurus dev server starts and is accessible at port 3000

VS Code Dev Containers (Local)

  1. Ensure Docker is running locally
  2. Open the repo in VS Code → click "Reopen in Container"
  3. Run npm start or yarn start
  4. Verify the dev server starts at http://localhost:3000

Files changed

File Change Lines
.devcontainer/devcontainer.json New +31
README.md Modified +35

Total: 2 files, 66 additions

Signed-off-by: Mohit Jeswani <2022.mohit.jeswani@ves.ac.in>
Copilot AI review requested due to automatic review settings May 20, 2026 21:52
@netlify
Copy link
Copy Markdown

netlify Bot commented May 20, 2026

Deploy Preview for kmesh-net ready!

Name Link
🔨 Latest commit fde9690
🔍 Latest deploy log https://app.netlify.com/projects/kmesh-net/deploys/6a0e2d1bce47510008b0a131
😎 Deploy Preview https://deploy-preview-314--kmesh-net.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kmesh-bot kmesh-bot requested review from YaoZengzeng and nlgwcy May 20, 2026 21:52
@kmesh-bot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jayesh9747 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json to define a Node-based dev environment, auto-install deps, and forward the Docusaurus dev server port.
  • Updated README.md with 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.

Comment on lines +2 to +4
"name": "Kmesh Website Development",
"image": "mcr.microsoft.com/devcontainers/javascript-node:20",

Comment thread README.md
yarn start
```

Both options provide a pre-configured environment with Node.js 20 and recommended VS Code extensions for documentation development.
Comment on lines +5 to +6
// Install dependencies using yarn to match the project's lockfile
"postCreateCommand": "yarn install --frozen-lockfile",
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +23 to +24
"yzhang.markdown-all-in-one",
"dbaeumer.vscode-eslint"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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"

@yashisrani
Copy link
Copy Markdown
Contributor

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Add Devcontainer for Documentation Development

4 participants