docs: update remaining references to electron-quick-start
(#47405)
* chore: udpate remaining references to electron-quick-start * chore: Update docs/tutorial/tutorial-1-prerequisites.md Co-authored-by: Niklas Wenzel <dev@nikwen.de> * chore: Update docs/tutorial/tutorial-3-preload.md Co-authored-by: Niklas Wenzel <dev@nikwen.de> * chore: Update docs/tutorial/tutorial-2-first-app.md Co-authored-by: Niklas Wenzel <dev@nikwen.de> * chore: linebreak * chore: swap minimal-repro for npx create-electron-app * chore: add back code commands * chore: add whitespace * chore: remove reference to repo containing old quick start --------- Co-authored-by: Niklas Wenzel <dev@nikwen.de>
This commit is contained in:
parent
38fe14041d
commit
0259abe920
5 changed files with 50 additions and 32 deletions
|
@ -1,6 +1,7 @@
|
||||||
# Debugging in VSCode
|
# Debugging in VSCode
|
||||||
|
|
||||||
This guide goes over how to set up VSCode debugging for both your own Electron project as well as the native Electron codebase.
|
This guide goes over how to set up VSCode debugging for both your own Electron
|
||||||
|
project as well as the native Electron codebase.
|
||||||
|
|
||||||
## Debugging your Electron app
|
## Debugging your Electron app
|
||||||
|
|
||||||
|
@ -9,8 +10,8 @@ This guide goes over how to set up VSCode debugging for both your own Electron p
|
||||||
#### 1. Open an Electron project in VSCode.
|
#### 1. Open an Electron project in VSCode.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ git clone git@github.com:electron/electron-quick-start.git
|
$ npx create-electron-app@latest my-app
|
||||||
$ code electron-quick-start
|
$ code my-app
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 2. Add a file `.vscode/launch.json` with the following configuration:
|
#### 2. Add a file `.vscode/launch.json` with the following configuration:
|
||||||
|
@ -37,23 +38,27 @@ $ code electron-quick-start
|
||||||
|
|
||||||
#### 3. Debugging
|
#### 3. Debugging
|
||||||
|
|
||||||
Set some breakpoints in `main.js`, and start debugging in the [Debug View](https://code.visualstudio.com/docs/editor/debugging). You should be able to hit the breakpoints.
|
Set some breakpoints in `main.js`, and start debugging in the
|
||||||
|
[Debug View](https://code.visualstudio.com/docs/editor/debugging). You should
|
||||||
Here is a pre-configured project that you can download and directly debug in VSCode: https://github.com/octref/vscode-electron-debug/tree/master/electron-quick-start
|
be able to hit the breakpoints.
|
||||||
|
|
||||||
## Debugging the Electron codebase
|
## Debugging the Electron codebase
|
||||||
|
|
||||||
If you want to build Electron from source and modify the native Electron codebase, this section will help you in testing your modifications.
|
If you want to build Electron from source and modify the native Electron codebase,
|
||||||
|
this section will help you in testing your modifications.
|
||||||
|
|
||||||
For those unsure where to acquire this code or how to build it, [Electron's Build Tools](https://github.com/electron/build-tools) automates and explains most of this process. If you wish to manually set up the environment, you can instead use these [build instructions](../development/build-instructions-gn.md).
|
For those unsure where to acquire this code or how to build it,
|
||||||
|
[Electron's Build Tools](https://github.com/electron/build-tools) automates and
|
||||||
|
explains most of this process. If you wish to manually set up the environment,
|
||||||
|
you can instead use these [build instructions](../development/build-instructions-gn.md).
|
||||||
|
|
||||||
### Windows (C++)
|
### Windows (C++)
|
||||||
|
|
||||||
#### 1. Open an Electron project in VSCode.
|
#### 1. Open an Electron project in VSCode.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ git clone git@github.com:electron/electron-quick-start.git
|
$ npx create-electron-app@latest my-app
|
||||||
$ code electron-quick-start
|
$ code my-app
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 2. Add a file `.vscode/launch.json` with the following configuration:
|
#### 2. Add a file `.vscode/launch.json` with the following configuration:
|
||||||
|
@ -86,14 +91,22 @@ $ code electron-quick-start
|
||||||
|
|
||||||
**Configuration Notes**
|
**Configuration Notes**
|
||||||
|
|
||||||
* `cppvsdbg` requires the [built-in C/C++ extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) be enabled.
|
* `cppvsdbg` requires the
|
||||||
|
[built-in C/C++ extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)
|
||||||
|
be enabled.
|
||||||
* `${workspaceFolder}` is the full path to Chromium's `src` directory.
|
* `${workspaceFolder}` is the full path to Chromium's `src` directory.
|
||||||
* `your-executable-location` will be one of the following depending on a few items:
|
* `your-executable-location` will be one of the following depending on a few items:
|
||||||
* `Testing`: If you are using the default settings of [Electron's Build-Tools](https://github.com/electron/build-tools) or the default instructions when [building from source](../development/build-instructions-gn.md#building).
|
* `Testing`: If you are using the default settings of
|
||||||
|
[Electron's Build-Tools](https://github.com/electron/build-tools) or the default
|
||||||
|
instructions when [building from source](../development/build-instructions-gn.md#building).
|
||||||
* `Release`: If you built a Release build rather than a Testing build.
|
* `Release`: If you built a Release build rather than a Testing build.
|
||||||
* `your-directory-name`: If you modified this during your build process from the default, this will be whatever you specified.
|
* `your-directory-name`: If you modified this during your build process from
|
||||||
* The `args` array string `"your-electron-project-path"` should be the absolute path to either the directory or `main.js` file of the Electron project you are using for testing. In this example, it should be your path to `electron-quick-start`.
|
the default, this will be whatever you specified.
|
||||||
|
* The `args` array string `"your-electron-project-path"` should be the absolute
|
||||||
|
path to either the directory or `main.js` file of the Electron project you are
|
||||||
|
using for testing. In this example, it should be your path to `my-app`.
|
||||||
|
|
||||||
#### 3. Debugging
|
#### 3. Debugging
|
||||||
|
|
||||||
Set some breakpoints in the .cc files of your choosing in the native Electron C++ code, and start debugging in the [Debug View](https://code.visualstudio.com/docs/editor/debugging).
|
Set some breakpoints in the .cc files of your choosing in the native Electron C++
|
||||||
|
code, and start debugging in the [Debug View](https://code.visualstudio.com/docs/editor/debugging).
|
||||||
|
|
|
@ -5,8 +5,8 @@ for any Snapcraft environment, including the Ubuntu Software Center.
|
||||||
|
|
||||||
## Background and Requirements
|
## Background and Requirements
|
||||||
|
|
||||||
Together with the broader Linux community, Canonical aims to fix many of the
|
Together with the broader Linux community, Canonical aims to address common
|
||||||
common software installation problems with the [`snapcraft`](https://snapcraft.io/)
|
software installation issues through the [`snapcraft`](https://snapcraft.io/)
|
||||||
project. Snaps are containerized software packages that include required
|
project. Snaps are containerized software packages that include required
|
||||||
dependencies, auto-update, and work on all major Linux distributions without
|
dependencies, auto-update, and work on all major Linux distributions without
|
||||||
system modification.
|
system modification.
|
||||||
|
@ -83,7 +83,14 @@ snap(options)
|
||||||
|
|
||||||
### Step 1: Create Sample Snapcraft Project
|
### Step 1: Create Sample Snapcraft Project
|
||||||
|
|
||||||
Create your project directory and add the following to `snap/snapcraft.yaml`:
|
```sh
|
||||||
|
$ npx create-electron-app@latest my-app
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 2: Create Sample Snapcraft Project
|
||||||
|
|
||||||
|
Create a `snap` directory in your project root and add the following to
|
||||||
|
`snap/snapcraft.yaml`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: electron-packager-hello-world
|
name: electron-packager-hello-world
|
||||||
|
@ -97,7 +104,7 @@ grade: stable
|
||||||
|
|
||||||
apps:
|
apps:
|
||||||
electron-packager-hello-world:
|
electron-packager-hello-world:
|
||||||
command: electron-quick-start/electron-quick-start --no-sandbox
|
command: my-app/my-app --no-sandbox
|
||||||
extensions: [gnome]
|
extensions: [gnome]
|
||||||
plugs:
|
plugs:
|
||||||
- browser-support
|
- browser-support
|
||||||
|
@ -109,13 +116,13 @@ apps:
|
||||||
TMPDIR: $XDG_RUNTIME_DIR
|
TMPDIR: $XDG_RUNTIME_DIR
|
||||||
|
|
||||||
parts:
|
parts:
|
||||||
electron-quick-start:
|
my-app:
|
||||||
plugin: nil
|
plugin: nil
|
||||||
source: https://github.com/electron/electron-quick-start.git
|
source: .
|
||||||
override-build: |
|
override-build: |
|
||||||
npm install electron @electron/packager
|
npm install electron @electron/packager
|
||||||
npx electron-packager . --overwrite --platform=linux --output=release-build --prune=true
|
npx electron-packager . --overwrite --platform=linux --output=release-build --prune=true
|
||||||
cp -rv ./electron-quick-start-linux-* $SNAPCRAFT_PART_INSTALL/electron-quick-start
|
cp -rv ./my-app-linux-* $SNAPCRAFT_PART_INSTALL/my-app
|
||||||
build-snaps:
|
build-snaps:
|
||||||
- node/14/stable
|
- node/14/stable
|
||||||
build-packages:
|
build-packages:
|
||||||
|
@ -125,12 +132,10 @@ parts:
|
||||||
- libnspr4
|
- libnspr4
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to apply this example to an existing project:
|
If you want to apply this example to an existing project, replace all instances
|
||||||
|
of `my-app` with your project's name.
|
||||||
|
|
||||||
- Replace `source: https://github.com/electron/electron-quick-start.git` with `source: .`.
|
### Step 3: Build the snap
|
||||||
- Replace all instances of `electron-quick-start` with your project's name.
|
|
||||||
|
|
||||||
### Step 2: Build the snap
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ snapcraft
|
$ snapcraft
|
||||||
|
@ -139,13 +144,13 @@ $ snapcraft
|
||||||
Snapped electron-packager-hello-world_0.1_amd64.snap
|
Snapped electron-packager-hello-world_0.1_amd64.snap
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 3: Install the snap
|
### Step 4: Install the snap
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo snap install electron-packager-hello-world_0.1_amd64.snap --dangerous
|
sudo snap install electron-packager-hello-world_0.1_amd64.snap --dangerous
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 4: Run the snap
|
### Step 5: Run the snap
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
electron-packager-hello-world
|
electron-packager-hello-world
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: 'Prerequisites'
|
title: 'Prerequisites'
|
||||||
description: 'This guide will step you through the process of creating a barebones Hello World app in Electron, similar to electron/electron-quick-start.'
|
description: 'This guide will step you through the process of creating a barebones Hello World app in Electron.'
|
||||||
slug: tutorial-prerequisites
|
slug: tutorial-prerequisites
|
||||||
hide_title: false
|
hide_title: false
|
||||||
---
|
---
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: 'Building your First App'
|
title: 'Building your First App'
|
||||||
description: 'This guide will step you through the process of creating a barebones Hello World app in Electron, similar to electron/electron-quick-start.'
|
description: 'This guide will step you through the process of creating a barebones Hello World app in Electron.'
|
||||||
slug: tutorial-first-app
|
slug: tutorial-first-app
|
||||||
hide_title: false
|
hide_title: false
|
||||||
---
|
---
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
title: 'Using Preload Scripts'
|
title: 'Using Preload Scripts'
|
||||||
description: 'This guide will step you through the process of creating a barebones Hello World app in Electron, similar to electron/electron-quick-start.'
|
description: 'This guide will step you through the process of creating a barebones Hello World app in Electron.'
|
||||||
slug: tutorial-preload
|
slug: tutorial-preload
|
||||||
hide_title: false
|
hide_title: false
|
||||||
---
|
---
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue