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

feat: add TypeScript definition #1131

Merged
merged 2 commits into from
Mar 2, 2020
Merged
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
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ steps-ci: &steps-ci
- *step-restore-electron-cache
- run: test/ci/_before_script.js
- *step-save-electron-cache
- run: npm test
- run: npm run lint
- run: npm run tsd
- run: npm run coverage
- run: npm run codecov

version: 2.1
Expand Down
32 changes: 32 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:ava/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:promise/recommended',
'standard'
],
parserOptions: {
sourceType: 'script'
},
plugins: [
'ava'
],
rules: {
'ava/no-import-test-files': 0,
'ava/no-ignored-test-files': 0,
indent: [
'error',
2,
{
'CallExpression': {
'arguments': 'first'
},
'SwitchCase': 1
}
],
'no-console': 0,
strict: 'error'
}
}
13 changes: 13 additions & 0 deletions .eslintrc.typescript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const eslintConfig = require('./.eslintrc')
eslintConfig.parser = '@typescript-eslint/parser'
eslintConfig.parserOptions.sourceType = 'module'
eslintConfig.extends.push(
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended'
)

eslintConfig.rules['comma-dangle'] = ['error', 'only-multiline']
eslintConfig.rules.semi = ['error', 'always']
eslintConfig.rules['space-before-function-paren'] = ['error', 'never']

module.exports = eslintConfig
28 changes: 28 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish documentation

on:
push:
branches:
- master
tags:
- v[0-9]+.[0-9]+.[0-9]+*

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch all git branches
run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- uses: actions/setup-node@v1
with:
node-version: 12.x
- run: npm install --engine-strict --no-lockfile
- run: npm run docs:build
- uses: docker://malept/gha-gh-pages:1.0.0
with:
docsPath: typedoc
showUnderscoreFiles: true
versionDocs: true
env:
DOCS_SSH_DEPLOY_KEY: ${{ secrets.DOCS_SSH_DEPLOY_KEY }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ yarn.lock
test/fixtures/basic/main-link.js
!test/fixtures/prune-is-module/node_modules
test/work
typedoc
.DS_Store
.nyc_output
npm-debug.log
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Here are some things to keep in mind as you file pull requests to fix bugs, add
spot regressions much easier.
* If your PR changes the behavior of an existing feature, or adds a new feature, please add/edit
the package's documentation. Files that will likely need to be updated include `README.md`,
`docs/api.md`, and `usage.txt`.
`src/index.d.ts`, and `usage.txt`.
* This project uses the [JavaScript Standard Style](https://standardjs.com/) as a coding convention.
CI will fail if the PR does not conform to this standard.
* One of the philosophies of the project is to keep the code base as small as possible. If you are
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Package your [Electron](https://electronjs.org) app into OS-specific bundles (`.
[Supported Platforms](#supported-platforms) |
[Installation](#installation) |
[Usage](#usage) |
[API](https://github.com/electron/electron-packager/blob/master/docs/api.md) |
[API](https://electron.github.io/electron-packager/master/) |
[Contributing](https://github.com/electron/electron-packager/blob/master/CONTRIBUTING.md) |
[Support](https://github.com/electron/electron-packager/blob/master/SUPPORT.md) |
[Related Apps/Libraries](#related) |
Expand Down Expand Up @@ -72,7 +72,7 @@ later needs to be installed. On macOS, it is installable via [Homebrew](http://b

## Usage

JavaScript API usage can be found in the [API documentation](https://github.com/electron/electron-packager/blob/master/docs/api.md).
JavaScript API usage can be found in the [API documentation](https://electron.github.io/electron-packager/master/modules/electronpackager.html).

### From the Command Line

Expand All @@ -95,7 +95,7 @@ This will:

For an overview of the other optional flags, run `electron-packager --help` or see
[usage.txt](https://github.com/electron/electron-packager/blob/master/usage.txt). For
detailed descriptions, see the [API documentation](https://github.com/electron/electron-packager/blob/master/docs/api.md).
detailed descriptions, see the [API documentation](https://electron.github.io/electron-packager/master/modules/electronpackager.html).

If `appname` is omitted, this will use the name specified by "productName" or "name" in the nearest package.json.

Expand Down
1 change: 0 additions & 1 deletion docs/_config.yml

This file was deleted.

Loading