Skip to content

GitHub Codespaces & Visual Studio Remote Development Container

Garry Trinder edited this page Mar 9, 2021 · 6 revisions

One of the difficulties of getting started with a new project is setting up the development environment, installing dependencies and hoping that you've followed all the instructions correctly.

We know that this can be time consuming but also put off potential contributors to the project, so we've looked at ways in which we can make contributor onboarding as simple as possible, so we have provided a definition for creating an instant development environment that contains all the dependencies needed to contribute to CLI for Microsoft 365, whether that is making code changes or making an update to the documentation, we have you covered.

Our development environments contain the following dependencies

  • Ubuntu 18.04 inc. sudo, zsh, jq, curl, git & wget
  • PowerShell (7.0.3)
  • node (v12.9.0) & npm (6.14.8)
  • Python3 (3.6.9) & pip3 (9.0.1)
  • MKDocs Material (3.1.0)
  • oh-my-zsh (zsh-in-docker)
  • zsh-autosuggestions
  • zsh-completions
  • zsh-syntax-highlighting
  • spaceship-prompt

We also automate the initial configuration steps for you when the development environment is being created, so we run npm install to install the necessary packages from npm, npm run build to build the CLI source and create a symbolic link by running npm link to ensure that when you execute m365 it use the code in the src directory.

You can use our development environment in the cloud using GitHub Codespaces or locally using Visual Studio Code Remote Development Containers.

GitHub Codespaces (Preview)

GitHub Codespaces is an online development environment, hosted by GitHub and powered by Visual Studio Code, that allows you to develop entirely in the cloud.

To create an instant environment to develop and test the CLI.

  • Fork this repository
  • On GitHub, navigate to the main page of the repository
  • Under the repository name, use the Branch drop-down menu, and select the branch you want to create a codespace for
  • Under the repository name, use the Code drop-down menu, and select Open with Codespaces
  • Click New codespace

Local Remote Development Container

If you don't have access to GitHub Codespaces yet, you can still use the development environment definition locally in using Visual Studio Code.

To build and use a remote development container for local development, you first need the below prerequisites installed.

  • Visual Studio Code
  • Docker Desktop
  • Remote Containers extension

Once the prerequisites are installed

  • Fork this repository
  • Clone your forked repository locally
  • Open the repository in Visual Studio Code
  • You will receive prompt Folder contains a remote development container
  • Click Reopen in Container to build the remote development container and start the instant development environment

The initial build time will vary dependant on your machine, but is a one time operation (unless we change the container in the future) so the next time you run the CLI in a remote development container the build step will not be required.