Skip to content
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

feat: optimize development experience in GitHub Codespaces #19

Open
glaucia86 opened this issue Feb 19, 2025 · 0 comments
Open

feat: optimize development experience in GitHub Codespaces #19

glaucia86 opened this issue Feb 19, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@glaucia86
Copy link
Member

The repository already has a configured devcontainer, but we can further enhance the experience by ensuring that users can start the project even faster and with a more streamlined setup inside GitHub Codespaces.


Proposed Improvements:

1️⃣ Automate Project Initialization

  • Currently, users must manually run npm start after Codespaces loads.
  • We can automate this process so that the project starts as soon as Codespaces is ready.

Suggested update to postCreateCommand:

"postCreateCommand": "npm install -g ollamazure tsx; npm ci; cd videos/demos && npm ci && cd ../.. && npm start"

✅ Impact: The project starts automatically when opening Codespaces, reducing manual steps.


2️⃣ Improve Instructions in README

  • Update the README steps to clearly indicate that the project automatically installs dependencies and starts running.
  • Highlight the Codespaces button for better visibility.

Suggested README update:

## 🚀 Quick Start with GitHub Codespaces  
Click the button below to start coding instantly:  

[![Open in GitHub Codespaces](https://img.shields.io/badge/Open%20in-GitHub%20Codespaces-blue?logo=github)](https://codespaces.new/microsoft/generative-ai-with-javascript)  

Once the Codespaces environment loads, the project will **automatically install dependencies and start running**. No need to run extra commands!  

Impact: Improves onboarding experience and reduces manual steps.


3️⃣ Improve Performance by Pre-Installing Dependencies

Installing dependencies inside Codespaces can slow down the first-time setup. Instead of relying on fresh npm install runs, we can pre-install dependencies inside a Dockerfile to speed up initialization.

📌 Suggested changes:

  1. Modify .devcontainer/devcontainer.json to use a Dockerfile:
{
  "build": {
    "dockerfile": "Dockerfile"
  }
}
  1. Create a Dockerfile in .devcontainer/ with:
FROM mcr.microsoft.com/devcontainers/javascript-node:20-bullseye
WORKDIR /workspace
COPY package.json package-lock.json ./
RUN npm ci
COPY . .

Impact: Dependencies are pre-installed during the container build, reducing the setup time when launching Codespaces.


@glaucia86 glaucia86 added the enhancement New feature or request label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant