Skip to content

Commit

Permalink
chore: typescript configuration instructions (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzhao authored Jul 17, 2024
1 parent 3d4597a commit 8dc2758
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 45 deletions.
29 changes: 10 additions & 19 deletions config/publishers/bitbucket.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
---
description: >-
The Bitbucket publish target allows you to publish your artifacts directly to
Bitbucket where users will be able to download them.
---

# Bitbucket

The Bitbucket publish target allows you to publish your artifacts directly to Bitbucket where users will be able to download them.

{% hint style="warning" %}
This publish target is for [Bitbucket Cloud](https://bitbucket.org) only and will not work with self hosted Bitbucket Server instances.
{% endhint %}

Full configuration options are documented in [`PublisherBitbucketConfig`](https://js.electronforge.io/interfaces/\_electron\_forge\_publisher\_bitbucket.PublisherBitbucketConfig.html).
## Installation

```bash
npm install --save-dev @electron-forge/publisher-bitbucket
```

## Usage

To use `@electron-forge/publisher-bitbucket`, add it to the `publishers` array in your [Forge configuration](../configuration.md):

{% code title="forge.config.js" %}
```javascript
module.exports = {
Expand All @@ -37,18 +39,7 @@ module.exports = {
```
{% endcode %}

you can (and should) use environment variables for the authentication

{% code title="env.sh" %}
```bash
BITBUCKET_USERNAME="myusername"
BITBUCKET_APP_PASSWORD="mysecretapppassword"
```
{% endcode %}

```bash
$ source env.sh
```
Full configuration options are documented in [`PublisherBitbucketConfig`](https://js.electronforge.io/interfaces/\_electron\_forge\_publisher\_bitbucket.PublisherBitbucketConfig.html).

{% hint style="info" %}
Your artifacts can be found under the `Downloads` tab of your Bitbucket repository.
Expand Down
12 changes: 10 additions & 2 deletions config/publishers/electron-release-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ The Electron Release Server target publishes all your artifacts to a hosted inst

Please note that Electron Release Server is a community powered project and is not associated with Electron Forge or the Electron project directly.

Configuration options are documented in [`PublisherERSConfig`](https://js.electronforge.io/interfaces/\_electron\_forge\_publisher\_electron\_release\_server.PublisherERSConfig.html).
## Installation

```bash
npm install --save-dev @electron-forge/publisher-electron-release-server
```

### Usage
## Usage

To use `@electron-forge/publisher-electron-release-server`, add it to the `publishers` array in your [Forge configuration](../configuration.md):

{% code title="forge.config.js" %}
```javascript
Expand All @@ -25,3 +31,5 @@ module.exports = {
};
```
{% endcode %}

Configuration options are documented in [`PublisherERSConfig`](https://js.electronforge.io/interfaces/\_electron\_forge\_publisher\_electron\_release\_server.PublisherERSConfig.html).
24 changes: 17 additions & 7 deletions config/publishers/gcs.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ This Publisher was added in Electron Forge **v7.1.0**.

The Google Cloud Storage target publishes all your artifacts to a [Google Cloud Storage bucket](https://cloud.google.com/storage/docs).

## Authentication
## Installation

Under the hood, the Google Cloud Storage Publisher uses the `@google-cloud/storage` SDK and its associated authentication options.

We recommend following [Google's authentication documentation for client libraries](https://cloud.google.com/docs/authentication/client-libraries#node.js) to get authentication configured.
```bash
npm install --save-dev @electron-forge/publisher-gcs
```

## Usage

To pass options into the Google Cloud Storage SDK's [Storage constructor](https://cloud.google.com/nodejs/docs/reference/storage/latest/storage/storageoptions), use the `config.storageOptions` parameter.
To use `@electron-forge/publisher-gcs`, add it to the `publishers` array in your [Forge configuration](../configuration.md):

{% code title="forge.config.js" %}
```javascript
Expand All @@ -42,14 +42,24 @@ module.exports = {
```
{% endcode %}

Additional configuration options are documented in [`PublisherGCSConfig`](http://js.electronforge.io/interfaces/\_electron\_forge\_publisher\_gcs.PublisherGCSConfig.html).

To pass options into the Google Cloud Storage SDK's [Storage constructor](https://cloud.google.com/nodejs/docs/reference/storage/latest/storage/storageoptions), use the `config.storageOptions` parameter.

### Output location

When executed, the Publisher will publish to your GCS bucket under the following key:

```
${config.folder || version}/${artifactName}
```

Additional configuration options are documented in [`PublisherGCSConfig`](http://js.electronforge.io/interfaces/\_electron\_forge\_publisher\_gcs.PublisherGCSConfig.html).

{% hint style="warning" %}
If you run publish twice with the same version on the same platform, it is possible for your old artifacts to get overwritten in Storage. It is your responsibility to ensure that you don't overwrite your own releases.
{% endhint %}

### Authentication

Under the hood, the Google Cloud Storage Publisher uses the `@google-cloud/storage` SDK and its associated authentication options.

We recommend following [Google's authentication documentation for client libraries](https://cloud.google.com/docs/authentication/client-libraries#node.js) to get authentication configured.
18 changes: 13 additions & 5 deletions config/publishers/github.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# GitHub

The GitHub target publishes all your artifacts to GitHub releases, this allows your users to download the files straight from your repository or if your repository is open source you can use [update.electronjs.org](https://github.com/electron/update.electronjs.org) and get a free hosted update service.
The GitHub target publishes all your artifacts to GitHub releases, this allows your users to download the files straight from your repository. If your repository is open source you can use [update.electronjs.org](https://github.com/electron/update.electronjs.org) and get a free hosted update service.

Configuration options are documented in [`PublisherGitHubConfig`](https://js.electronforge.io/interfaces/\_electron\_forge\_publisher\_github.PublisherGitHubConfig.html)
## Installation

{% hint style="info" %}
You can use this target to publish to GitHub Enterprise using the host configuration options of `octokitOptions`. Check out the configuration options linked above.
{% endhint %}
```bash
npm install --save-dev @electron-forge/publisher-github
```

## Usage

To use `@electron-forge/publisher-github`, add it to the `publishers` array in your [Forge configuration](../configuration.md):

{% code title="forge.config.js" %}
```javascript
module.exports = {
Expand All @@ -30,6 +32,12 @@ module.exports = {
```
{% endcode %}

Configuration options are documented in [`PublisherGitHubConfig`](https://js.electronforge.io/interfaces/\_electron\_forge\_publisher\_github.PublisherGitHubConfig.html).

### Uploading to GitHub Enterprise instances

You can use this target to publish to GitHub Enterprise using the host configuration options of `octokitOptions`. Check out the configuration options linked above.

### Auto updating from GitHub

Updating from a GitHub release for a **public** repository is as simple as adding the [`update-electron-app`](https://github.com/electron/update-electron-app) module to your app's main process.
Expand Down
12 changes: 8 additions & 4 deletions config/publishers/nucleus.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

The Nucleus target publishes all your artifacts to an instance of Nucleus Update Server, this update service supports all three platforms. Check out the README at [`atlassian/nucleus`](https://github.com/atlassian/nucleus) for more information on this project.

Configuration options are documented in [`PublisherNucleusConfig`](https://js.electronforge.io/interfaces/\_electron\_forge\_publisher\_nucleus.PublisherNucleusConfig.html)
## Installation

{% hint style="warning" %}
We recommend you set the `token` option using an environment variable, don't hard code it into your config
{% endhint %}
```bash
npm install --save-dev @electron-forge/publisher-nucleus
```

## Usage

To use `@electron-forge/publisher-nucleus`, add it to the `publishers` array in your [Forge configuration](../configuration.md):

{% code title="forge.config.js" %}
```javascript
module.exports = {
Expand All @@ -28,3 +30,5 @@ module.exports = {
};
```
{% endcode %}

Configuration options are documented in [`PublisherNucleusConfig`](https://js.electronforge.io/interfaces/\_electron\_forge\_publisher\_nucleus.PublisherNucleusConfig.html).
14 changes: 11 additions & 3 deletions config/publishers/s3.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ description: How to publish your distributable Electron app artifacts to Amazon

The S3 target publishes your Make artifacts to an Amazon S3 bucket.

## Authentication
## Installation

It is recommended to follow the [Amazon AWS guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html) and set either a shared credentials guide or the proper environment variables. However, if that is not possible, the publisher config allows the setting of the `accessKeyId` and `secretAccessKey` configuration options.
```bash
npm install --save-dev @electron-forge/publisher-s3
```

## Usage

Configuration options are documented in [`PublisherS3Config`](https://js.electronforge.io/interfaces/\_electron\_forge\_publisher\_s3.PublisherS3Config.html).
To use `@electron-forge/publisher-s3`, add it to the `publishers` array in your [Forge configuration](../configuration.md):

{% code title="forge.config.js" %}
```javascript
Expand All @@ -31,6 +33,12 @@ module.exports = {
```
{% endcode %}

Configuration options are documented in [`PublisherS3Config`](https://js.electronforge.io/interfaces/\_electron\_forge\_publisher\_s3.PublisherS3Config.html).

### Authentication

It is recommended to follow the [Amazon AWS guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html) and set either a shared credentials guide or the proper environment variables. However, if that is not possible, the publisher config allows the setting of the `accessKeyId` and `secretAccessKey` configuration options.

### Key management

By default, the S3 publisher will upload its objects to the `{prefix}/{platform}/{arch}/{name}` key, where:
Expand Down
18 changes: 14 additions & 4 deletions config/publishers/snapcraft.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# Snapcraft

The Snapcraft target publishes your `.snap` artifacts to the [Snap Store](https://snapcraft.io/store). All configuration of your package is done via the [Snapcraft maker](../makers/snapcraft.md).
The Snapcraft target publishes your `.snap` artifacts to the [Snap Store](https://snapcraft.io/store). All configuration of your package is done via the [snapcraft.md](../makers/snapcraft.md "mention") maker.

This target requires that the system has the `snapcraft` utility installed.
## Requirements

Configuration options are documented in [`PublisherSnapConfig`](https://js.electronforge.io/interfaces/\_electron\_forge\_publisher\_snapcraft.PublisherSnapcraftConfig.html)
You can only publish to the Snap Store on Linux systems with the [`snapcraft`](https://snapcraft.io/) package installed.

### Usage
## Installation

```bash
npm install --save-dev @electron-forge/publisher-snapcraft
```

## Usage

To use `@electron-forge/publisher-snapcraft`, add it to the `publishers` array in your [Forge configuration](../configuration.md):

{% code title="forge.config.js" %}
```javascript
Expand All @@ -23,3 +31,5 @@ module.exports = {
};
```
{% endcode %}

Configuration options are documented in [`PublisherSnapConfig`](https://js.electronforge.io/interfaces/\_electron\_forge\_publisher\_snapcraft.PublisherSnapcraftConfig.html).
2 changes: 1 addition & 1 deletion config/typescript-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Set up your Forge configuration to use TypeScript

# TypeScript Configuration

By default, Electron Forge's [configuration](broken-reference) only supports JavaScript and JSON files as inputs.
By default, Electron Forge's [configuration](./configuration.md) only supports JavaScript and JSON files as inputs.

Forge also supports configuration files in other languages that transpile down to JavaScript as long as a transpiler is installed locally in your project's `devDependencies`. These configuration files follow the same format as `forge.config.js`.

Expand Down

0 comments on commit 8dc2758

Please sign in to comment.