Skip to content

Commit

Permalink
build: lint Markdown (electron-forge#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanders11 authored May 23, 2023
1 parent 0b55dc2 commit 5738031
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 16 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint

on:
push:
pull_request:
branches:
- main
workflow_dispatch:
inputs:
fetch-external-links:
type: boolean
description: Check if external links are broken

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag: v3.3.0
- name: Setup Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # tag: v3.6.0
with:
node-version: 18.x
- name: Create a Temporary package.json
run: npm init --yes
- name: Install @electron/lint-roller
run: npm install --save-dev @electron/lint-roller
- name: Run markdownlint
run: npx electron-markdownlint "**/*.md"
- name: Lint links
run: npx electron-lint-markdown-links --root . --ignore-path .markdownlintignore "**/*.md"
if: ${{ always() }}
- name: Check external links
run: npx electron-lint-markdown-links --root . --ignore-path .markdownlintignore --fetch-external-links "**/*.md"
if: ${{ github.event.inputs.fetch-external-links }}
5 changes: 5 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "@dsanders11/markdown-linting/configs/markdownlint.json",
"blanks-around-fences": false,
"no-multiple-blanks": false
}
1 change: 1 addition & 0 deletions .markdownlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/**
4 changes: 2 additions & 2 deletions advanced/extending-electron-forge/writing-publishers.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Publishers must implement this method to publish the artifacts returned from mak

Please note for a given version, publish will be called multiple times, once for each set of "platform" and "arch". This means if you are publishing `darwin` and `win32` artifacts to somewhere like GitHub on the first publish call, you will have to create the version on GitHub and the second call will just be appending files to the existing version. Your `publish` implementation will not be aware that another call is coming, however it must just be able to handle this case.

The `config` for the publisher will be available on `this.config` .
The `config` for the publisher will be available on `this.config`.

The options object is documented in [`PublisherOptions`](https://js.electronforge.io/interfaces/_electron_forge_publisher_base.PublisherOptions.html)
The options object is documented in [`PublisherOptions`](https://js.electronforge.io/interfaces/_electron_forge_publisher_base.PublisherOptions.html).

```javascript
export default class MyPublisher extends PublisherBase {
Expand Down
2 changes: 1 addition & 1 deletion cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: How to use the command line interface (CLI) commands for Electron F

Forge's CLI is the main way to run Electron Forge commands. It consists of a thin wrapper for its core API. Configuration for these commands is done through your [Forge configuration](configuration.md) object.

If you want to use the core API programmatically, see the [#undefined](cli.md#undefined "mention") section below.
If you want to use the core API programmatically, see the [#programmatic-usage](#programmatic-usage "mention") section below.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion config/plugins/webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ In development mode, you can change most `webpack-dev-server` options by setting

#### devContentSecurityPolicy

In development mode, you can set a[ Content Security Policy (CSP) ](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP)by setting `devContentSecurityPolicy` in your Forge Webpack plugin configuration.
In development mode, you can set a [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) by setting `devContentSecurityPolicy` in your Forge Webpack plugin configuration.

```javascript
{
Expand Down
2 changes: 1 addition & 1 deletion config/publishers/electron-release-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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)
Configuration options are documented in [`PublisherERSConfig`](https://js.electronforge.io/interfaces/_electron_forge_publisher_electron_release_server.PublisherERSConfig.html).

### Usage

Expand Down
2 changes: 1 addition & 1 deletion config/publishers/nucleus.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ module.exports = {
]
}
```
{% endcode %}
{% endcode %}
6 changes: 3 additions & 3 deletions configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ You can not override the `buildPath`, `arch`, or `electronVersion` options as th

### Makers

The top level property `makers` on the configuration object is an array of maker configurations. Check out the [Makers ](config/makers/)documentation for all possible makers and their config options.
The top level property `makers` on the configuration object is an array of maker configurations. Check out the [Makers](config/makers/) documentation for all possible makers and their config options.

### Publishers

The top level property `publishers` on the configuration object is an array of publisher configurations. Check out the [Publishers ](config/publishers/)documentation for all possible publishers and their config options.
The top level property `publishers` on the configuration object is an array of publisher configurations. Check out the [Publishers](config/publishers/) documentation for all possible publishers and their config options.

### Plugins

The top level property `plugins` on the configuration object is an array of plugin configurations. Check out the [Plugins ](config/plugins/)documentation for all possible plugins and their config options.
The top level property `plugins` on the configuration object is an array of plugin configurations. Check out the [Plugins](config/plugins/) documentation for all possible plugins and their config options.

### Hooks

Expand Down
2 changes: 1 addition & 1 deletion core-concepts/why-electron-forge.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The key difference in philosophy between the two projects is that Electron Forge

We believe there are two main advantages to using Forge:

1. **Forge receives new features for application building as soon as they are supported in Electron** (e.g. [ASAR integrity ](https://electronjs.org/docs/latest/tutorial/asar-integrity)or [universal macOS builds](https://github.com/electron/universal)). These features are built with first-party Electron tooling in mind, so Forge receives them as soon as they are released.
1. **Forge receives new features for application building as soon as they are supported in Electron** (e.g. [ASAR integrity](https://electronjs.org/docs/latest/tutorial/asar-integrity) or [universal macOS builds](https://github.com/electron/universal)). These features are built with first-party Electron tooling in mind, so Forge receives them as soon as they are released.
2. **Forge's multi-package architecture makes it easier to understand and extend.** Since Forge is made up of many smaller packages with clear responsibilities, it is easier to follow the flow of the code. Also, its extensible API design means that you can write your own build logic separate from the provided configuration options for advanced use cases.


Expand Down
2 changes: 1 addition & 1 deletion guides/code-signing/code-signing-macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ To sign Electron apps, you may require two separate certificates:
* The **Developer ID Installer** certificate is for apps distributed to the Mac App Store.
* The **Developer ID Application** certificate is for apps distributed outside the Mac App Store.

Once you have an Apple Developer Program membership, you first need to install them onto your machine. We recommend[ loading them through Xcode](https://help.apple.com/xcode/mac/current/#/dev3a05256b8).
Once you have an Apple Developer Program membership, you first need to install them onto your machine. We recommend [loading them through Xcode](https://help.apple.com/xcode/mac/current/#/dev3a05256b8).

{% hint style="success" %}
**Verifying your certificate is installed**
Expand Down
2 changes: 1 addition & 1 deletion guides/code-signing/code-signing-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ On Windows, apps are signed using [Sign Tool](https://learn.microsoft.com/en-us/

### Acquiring a certificate

You can get a [Windows Authenticode ](https://learn.microsoft.com/en-us/windows-hardware/drivers/install/authenticode)code signing certificate from many vendors. Prices vary, so it may be worth your time to shop around. Popular vendors include:
You can get a [Windows Authenticode](https://learn.microsoft.com/en-us/windows-hardware/drivers/install/authenticode) code signing certificate from many vendors. Prices vary, so it may be worth your time to shop around. Popular vendors include:

* [digicert](https://www.digicert.com/dc/code-signing/microsoft-authenticode.htm)
* [Sectigo](https://sectigo.com/ssl-certificates-tls/code-signing)
Expand Down
4 changes: 2 additions & 2 deletions guides/create-and-add-icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ On platforms that have high-DPI support (such as Apple Retina displays), you can

If you want to support different displays with different DPI densities at the same time, you can put images with different sizes in the same folder and use the filename without DPI suffixes. For example:

```
```text
images/
├── icon.png
├── [email protected]
Expand Down Expand Up @@ -69,7 +69,7 @@ Configuring the path to your icon must be done in both package.json as well as i

<pre class="language-javascript" data-title="forge.config.js"><code class="lang-javascript">module.exports = {
// ...
makers: [
makers: \[
{
name: '@electron-forge/maker-deb',
config: {
Expand Down
4 changes: 2 additions & 2 deletions guides/framework-integration/vue-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Adding Vue 2 support to a basic Electron Forge template doesn't require a compli

### Create the app

Create a standard Electron per the [Getting Started](../../#the-basics) guide.
Create a standard Electron per the [Getting Started](../../README.md#getting-started) guide.

### Add the Vue 2 dependency

Expand Down Expand Up @@ -71,7 +71,7 @@ Create the app with the [Webpack template](../../templates/webpack-template.md)

{% tabs %}
{% tab title="NPM" %}
```
```bash
npm install --save-dev vue-loader vue-template-compiler
```
{% endtab %}
Expand Down

0 comments on commit 5738031

Please sign in to comment.