electron/.devcontainer
Keeley Hammond c006e129b3
build: remove CircleCI (#42844)
* build: remove CircleCI

* chore: remove remaining CircleCI references
2024-07-15 14:26:41 -04:00
..
README.md chore: clean up outdated goma references (#42762) 2024-07-05 09:44:34 +02:00
devcontainer.json build: remove CircleCI (#42844) 2024-07-15 14:26:41 -04:00
docker-compose.yml build: use latest devcontainer buildimage with codespaces (#41916) 2024-04-22 09:48:30 -04:00
on-create-command.sh chore: clean up outdated goma references (#42762) 2024-07-05 09:44:34 +02:00
update-content-command.sh build: update devcontainer and use latest codespaces features (#36422) 2022-11-22 12:16:15 -08:00

README.md

Electron Dev on Codespaces

Welcome to the Codespaces Electron Developer Environment.

Quick Start

Upon creation of your codespace you should have build tools installed and an initialized gclient checkout of Electron. In order to build electron you'll need to run the following command.

e build

The initial build will take ~8 minutes. Incremental builds are substantially quicker. If you pull changes from upstream that touch either the patches folder or the DEPS folder you will have to run e sync in order to keep your checkout up to date.

Directory Structure

Codespaces doesn't lean very well into gclient based checkouts, the directory structure is slightly strange. There are two locations for the electron checkout that both map to the same files under the hood.

# Primary gclient checkout container
/workspaces/gclient/*
  └─ src/* - # Chromium checkout
     └─ electron - # Electron checkout
# Symlinked Electron checkout (identical to the above)
/workspaces/electron

Reclient

If you are a maintainer with Reclient access you'll need to ensure you're authenticated when you spin up a new codespaces instance. You can validate this by checking e d rbe info - your build-tools configuration should have Access type Cache & Execute:

Authentication Status: Authenticated
Since:     2024-05-28 10:29:33 +0200 CEST
Expires:   2024-08-26 10:29:33 +0200 CEST
...
Access:    Cache & Execute

To authenticate if you're not logged in, run e d rbe login and follow the link to authenticate.

Running Electron

You can run Electron in a few ways. If you just want to see if it launches:

# Enter an interactive JS prompt headlessly
xvfb-run e start -i

But if you want to actually see Electron you will need to use the built-in VNC capability. If you click "Ports" in codespaces and then open the VNC web client forwarded port you should see a web based VNC portal in your browser. When you are asked for a password use builduser.

Once in the VNC UI you can open Applications -> System -> XTerm which will open a VNC based terminal app and then you can run e start like normal and Electron will open in your VNC session.

Running Tests

You run tests via build-tools and xvfb.

# Run all tests
xvfb-run e test

# Run the main process tests
xvfb-run e test --runners=main

# Run the old remote tests
xvfb-run e test --runners=remote