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

docs: add tabs for bun package manager #138

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ yarn create electron-app my-app
npm init electron-app@latest my-app
```
{% endtab %}

{% tab title="Bun" %}
```bash
bunx create-electron-app@latest my-app
```
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Expand Down Expand Up @@ -52,6 +58,12 @@ yarn create electron-app my-app --template=webpack
npm init electron-app@latest my-app -- --template=webpack
```
{% endtab %}

{% tab title="Bun" %}
```bash
bunx create-electron-app@latest my-app -- --template=webpack
```
{% endtab %}
{% endtabs %}

There are currently two first-party templates:
Expand Down Expand Up @@ -85,6 +97,13 @@ cd my-app
npm start
```
{% endtab %}

{% tab title="Bun" %}
```bash
cd my-app
bun run start
```
{% endtab %}
{% endtabs %}

## Building distributables
Expand All @@ -103,6 +122,12 @@ yarn make
npm run make
```
{% endtab %}

{% tab title="Bun" %}
```bash
bun run make
```
{% endtab %}
{% endtabs %}

## Publishing your app
Expand All @@ -121,6 +146,12 @@ yarn run publish
npm run publish
```
{% endtab %}

{% tab title="Bun" %}
```bash
bun run publish
```
{% endtab %}
{% endtabs %}

## Advanced Usage
Expand Down
59 changes: 59 additions & 0 deletions cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ yarn add --dev @electron-forge/cli
npm install --save-dev @electron-forge/cli
```
{% endtab %}

{% tab title="Bun" %}
```bash
bun add --dev @electron-forge/cli
```
{% endtab %}
{% endtabs %}

## Bootstrap commands
Expand Down Expand Up @@ -70,6 +76,12 @@ yarn electron-forge init --template=webpack
npx electron-forge init --template=webpack
```
{% endtab %}

{% tab title="Bun" %}
```bash
npx electron-forge init --template=webpack
```
{% endtab %}
{% endtabs %}

### Import
Expand All @@ -94,6 +106,12 @@ yarn electron-forge import
npx electron-forge import
```
{% endtab %}

{% tab title="Bun" %}
```bash
bunx electron-forge import
```
{% endtab %}
{% endtabs %}

## Build commands
Expand Down Expand Up @@ -137,6 +155,15 @@ npm run package -- --arch="ia32"
npx electron-forge package --arch="ia32"
```
{% endtab %}

{% tab title="Bun" %}
```bash
# By default, the package command corresponds to a package npm script:
bun run package -- --arch="ia32"
# If there is no package script:
bunx electron-forge package --arch="ia32"
```
{% endtab %}
{% endtabs %}

### Make
Expand Down Expand Up @@ -178,6 +205,15 @@ npm run make -- --arch="ia32"
npx electron-forge make --arch="ia32"
```
{% endtab %}

{% tab title="Bun" %}
```bash
# By default, the make command corresponds to a make npm script:
bun run make -- --arch="ia32"
# If there is no make script:
bunx electron-forge make --arch="ia32"
```
{% endtab %}
{% endtabs %}

Building for ia32 and x64 architectures:
Expand All @@ -194,6 +230,12 @@ yarn make --arch="ia32,x64"
npm run make -- --arch="ia32,x64"
```
{% endtab %}

{% tab title="Bun" %}
```bash
bun run make --arch="ia32,x64"
```
{% endtab %}
{% endtabs %}

### Publish
Expand Down Expand Up @@ -230,6 +272,14 @@ yarn electron-forge publish --from-dry-run
npx electron-forge publish -- --from-dry-run
</code></pre>
{% endtab %}

{% tab title="Bun" %}
<pre class="language-bash"><code class="lang-bash"><strong># By default, the publish command corresponds to a publish npm script:
</strong>bun run publish -- --from-dry-run
# If there is no publish script:
bunx electron-forge publish -- --from-dry-run
</code></pre>
{% endtab %}
{% endtabs %}

## Dev commands
Expand Down Expand Up @@ -274,6 +324,15 @@ npm start --enable-logging
npx electron-forge start --enable-logging
```
{% endtab %}

{% tab title="Bun" %}
```bash
# By default, the start command corresponds to a start npm script:
bun run start --enable-logging
# if there is no start script
bunx electron-forge start --enable-logging
```
{% endtab %}
{% endtabs %}

## Programmatic usage
Expand Down
6 changes: 6 additions & 0 deletions config/plugins/auto-unpack-natives.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ yarn add --dev @electron-forge/plugin-auto-unpack-natives
npm install --save-dev @electron-forge/plugin-auto-unpack-natives
```
{% endtab %}

{% tab title="Bun" %}
```shell
bun add --dev @electron-forge/plugin-auto-unpack-natives
```
{% endtab %}
{% endtabs %}

## Usage
Expand Down
6 changes: 6 additions & 0 deletions config/plugins/electronegativity.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ yarn add --dev @electron-forge/plugin-electronegativity
npm install --save-dev @electron-forge/plugin-electronegativity
```
{% endtab %}

{% tab title="Bun" %}
```shell
bun add --dev @electron-forge/plugin-electronegativity
```
{% endtab %}
{% endtabs %}

## Usage
Expand Down
6 changes: 6 additions & 0 deletions config/plugins/local-electron.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ yarn add --dev @electron-forge/plugin-local-electron
npm install --save-dev @electron-forge/plugin-local-electron
```
{% endtab %}

{% tab title="Bun" %}
```bash
bun add --dev @electron-forge/plugin-local-electron
```
{% endtab %}
{% endtabs %}

### Usage
Expand Down
6 changes: 6 additions & 0 deletions config/plugins/vite.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ yarn add --dev @electron-forge/plugin-vite
npm install --save-dev @electron-forge/plugin-vite
```
{% endtab %}

{% tab title="Bun" %}
```shell
bun add --dev @electron-forge/plugin-vite
```
{% endtab %}
{% endtabs %}

## Usage
Expand Down
12 changes: 12 additions & 0 deletions config/plugins/webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ yarn add --dev @electron-forge/plugin-webpack
npm install --save-dev @electron-forge/plugin-webpack
```
{% endtab %}

{% tab title="Bun" %}
```shell
bun add --dev @electron-forge/plugin-webpack
```
{% endtab %}
{% endtabs %}

## Usage
Expand Down Expand Up @@ -249,6 +255,12 @@ yarn add --dev node-loader @vercel/[email protected]
npm install --save-dev node-loader @vercel/[email protected]
```
{% endtab %}

{% tab title="Bun" %}
```shell
bun add --dev node-loader @vercel/[email protected]
```
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Expand Down
7 changes: 7 additions & 0 deletions guides/framework-integration/react-with-typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ npm install --save react react-dom
npm install --save-dev @types/react @types/react-dom
```
{% endtab %}

{% tab title="Bun" %}
```bash
bun add react react-dom
bun add --dev @types/react @types/react-dom
```
{% endtab %}
{% endtabs %}

### Integrate React code
Expand Down
12 changes: 12 additions & 0 deletions guides/framework-integration/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ yarn add --dev @babel/core @babel/preset-react babel-loader
npm install --save-dev @babel/core @babel/preset-react babel-loader
```
{% endtab %}

{% tab title="Bun" %}
```text
bun add --dev @babel/core @babel/preset-react babel-loader
```
{% endtab %}
{% endtabs %}

Set up the [`babel-loader`](https://www.npmjs.com/package/babel-loader)module with the [React preset](https://babeljs.io/docs/en/babel-preset-react) in `webpack.rules.js`:
Expand Down Expand Up @@ -65,6 +71,12 @@ yarn add react react-dom
npm install --save react react-dom
```
{% endtab %}

{% tab title="Bun" %}
```bash
bun add react react-dom
```
{% endtab %}
{% endtabs %}

### Integrate React code
Expand Down
18 changes: 18 additions & 0 deletions guides/framework-integration/vue-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ npm install --save vue
yarn add vue
```
{% endtab %}

{% tab title="Bun" %}
```bash
bun add vue
```
{% endtab %}
{% endtabs %}

### Integrate Vue 2 code
Expand Down Expand Up @@ -81,6 +87,12 @@ npm install --save-dev vue-loader vue-template-compiler
yarn add --dev vue-loader vue-template-compiler
```
{% endtab %}

{% tab title="Bun" %}
```bash
bun add --dev vue-loader vue-template-compiler
```
{% endtab %}
{% endtabs %}

Setting up the [`vue-loader` Webpack module](https://vue-loader.vuejs.org/guide/#webpack-configuration) is left as an exercise for the reader _(hint: `vue-loader` Webpack config should ideally go in the renderer configuration only)_.
Expand All @@ -99,6 +111,12 @@ npm install --save vue
yarn add vue
```
{% endtab %}

{% tab title="Bun" %}
```bash
bun add vue
```
{% endtab %}
{% endtabs %}

You should now be able to add single file components to your app, the same as you would for a "regular" web app.
21 changes: 21 additions & 0 deletions import-existing-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ cd my-app
npm install --save-dev @electron-forge/cli @electron-forge/maker-squirrel @electron-forge/maker-deb @electron-forge/maker-zip
```
{% endtab %}

{% tab title="Bun" %}
```bash
cd my-app
bun add --dev @electron-forge/cli @electron-forge/maker-squirrel @electron-forge/maker-deb @electron-forge/maker-zip
```
{% endtab %}
{% endtabs %}

### Configuring package.json
Expand Down Expand Up @@ -156,6 +163,13 @@ cd my-app
npm install electron-squirrel-startup
```
{% endtab %}

{% tab title="Bun" %}
```bash
cd my-app
bun add electron-squirrel-startup
```
{% endtab %}
{% endtabs %}

Then, add the following snippet as early as possible in the main process execution (before the `app.ready` event).
Expand Down Expand Up @@ -186,6 +200,13 @@ cd my-app
npm install --save-dev @electron-forge/publisher-s3
```
{% endtab %}

{% tab title="Bun" %}
```bash
cd my-app
bun add --dev @electron-forge/publisher-s3
```
{% endtab %}
{% endtabs %}

{% code title="package.json" %}
Expand Down
7 changes: 7 additions & 0 deletions templates/typescript-+-webpack-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ yarn create electron-app my-new-app --template=webpack-typescript
npm init electron-app@latest my-new-app -- --template=webpack-typescript
```
{% endtab %}

{% tab title="Bun" %}
```bash
bunx create-electron-app@latest my-new-app -- --template=webpack-typescript
```
{% endtab %}

{% endtabs %}

{% hint style="warning" %}
Expand Down
Loading