Skip to content

Commit

Permalink
Merge branch 'development' into pr/10243
Browse files Browse the repository at this point in the history
  • Loading branch information
niik committed Aug 12, 2020
2 parents 444bce2 + d8742ec commit 0a94520
Show file tree
Hide file tree
Showing 175 changed files with 4,142 additions and 2,631 deletions.
85 changes: 0 additions & 85 deletions .circleci/config.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
# might be included when linting
app/coverage
script/coverage
node_modules
app/node_modules
76 changes: 74 additions & 2 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins:
- babel
- react
- json
- jsdoc

settings:
react:
Expand All @@ -13,6 +14,8 @@ settings:
extends:
- prettier
- prettier/react
- plugin:@typescript-eslint/recommended
- prettier/@typescript-eslint

rules:
##########
Expand All @@ -32,6 +35,26 @@ rules:
custom:
regex: '^I[A-Z]'
match: true
- selector: class
format:
- PascalCase
- selector: variableLike
format: null
custom:
# Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar we
# should probably be using the following expression here (newlines added for readability)
#
# ^(break|case|catch|class|const|continue|debugger|default|delete|do|else|export|
# extends|finally|for|function|if|import|in|instanceof|new|return|super|switch|this|
# throw|try|typeof|var|void|while|with|yield|enum|implements|interface|let|package|
# private|protected|public|static|await|abstract|boolean|byte|char|double|final|float|
# goto|int|long|native|short|synchronized|throws|transient|volatile|null|true|false)$
#
# But that'll cause a bunch of errors, for now we'll stick with replicating what the
# variable-name ban-keywords rule did for us in tslint
# see https://palantir.github.io/tslint/rules/variable-name/
regex: '^(any|Number|number|String|string|Boolean|boolean|Undefined|undefined)$'
match: false
'@typescript-eslint/consistent-type-assertions':
- error
- assertionStyle: 'as'
Expand All @@ -45,8 +68,34 @@ rules:
- functions: false
variables: false
typedefs: false
# this rule now works but generates a lot of issues with the codebase
# '@typescript-eslint/member-ordering': error
'@typescript-eslint/member-ordering':
- error
- default:
- static-field
- static-method
- field
- abstract-method
- constructor
- method
'@typescript-eslint/no-extraneous-class': error
'@typescript-eslint/no-empty-interface': error
# Would love to be able to turn this on eventually
'@typescript-eslint/no-non-null-assertion': off

# This rule does a lot of good but right now it catches way
# too many cases, we're gonna want to pay down this debt
# incrementally if we want to enable it.
'@typescript-eslint/ban-types': off

# It'd be nice to be able to turn this on eventually
'@typescript-eslint/no-var-requires': off

# Don't particularly care about these
'@typescript-eslint/triple-slash-reference': off
'@typescript-eslint/explicit-module-boundary-types': off
'@typescript-eslint/no-explicit-any': off
'@typescript-eslint/no-inferrable-types': off
'@typescript-eslint/no-empty-function': off

# Babel
babel/no-invalid-this: error
Expand All @@ -60,6 +109,23 @@ rules:
react/no-string-refs: error
react/jsx-uses-vars: error
react/jsx-uses-react: error
react/no-unused-state: error

# JSDoc
jsdoc/check-alignment: error
jsdoc/check-tag-names: error
jsdoc/check-types: error
jsdoc/implements-on-classes: error
jsdoc/newline-after-description: error
jsdoc/no-undefined-types: error
jsdoc/valid-types: error

# Would love to enable these at some point but
# they cause way to many issues now.
#jsdoc/check-param-names: error
#jsdoc/require-jsdoc:
# - error
# - publicOnly: true

###########
# BUILTIN #
Expand Down Expand Up @@ -96,6 +162,12 @@ overrides:
strict:
- error
- never
- files: 'app/test/**/*'
rules:
'@typescript-eslint/no-non-null-assertion': off
- files: 'script/**/*'
rules:
'@typescript-eslint/no-non-null-assertion': off

parserOptions:
sourceType: module
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI

on:
push:
branches:
- development
- __release-*
pull_request:

jobs:
build:
name: ${{ matrix.friendlyName }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-10.15, windows-2019]
include:
- os: macos-10.15
friendlyName: macOS
- os: windows-2019
friendlyName: Windows
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Use Node.js 12.8.1
uses: actions/setup-node@v1
with:
node-version: 12.8.1

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-
- name: Install and build dependencies
run: yarn
- name: Pre-build checks (Linting)
run: |
yarn lint
yarn validate-changelog
yarn check-modified
- name: Build production app
run: yarn build:prod
env:
DESKTOP_OAUTH_CLIENT_ID: ${{ secrets.DESKTOP_OAUTH_CLIENT_ID }}
DESKTOP_OAUTH_CLIENT_SECRET:
${{ secrets.DESKTOP_OAUTH_CLIENT_SECRET }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
DESKTOPBOT_TOKEN: ${{ secrets.DESKTOPBOT_TOKEN }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
- name: Prepare testing environment
run: yarn test:setup
- name: Run unit tests
run: yarn test:unit:cov
- name: Run script tests
run: yarn test:script:cov
- name: Run integration tests
run: yarn test:integration
- name: Publish production app
run: yarn run publish
env:
DESKTOPBOT_TOKEN: ${{ secrets.DESKTOPBOT_TOKEN }}
WINDOWS_CERT_PASSWORD: ${{ secrets.WINDOWS_CERT_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
DEPLOYMENT_SECRET: ${{ secrets.DEPLOYMENT_SECRET }}
S3_KEY: ${{ secrets.S3_KEY }}
S3_SECRET: ${{ secrets.S3_SECRET }}
S3_BUCKET: github-desktop
timeout-minutes: 5
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# [GitHub Desktop](https://desktop.github.com)

[![Travis](https://img.shields.io/travis/desktop/desktop.svg?style=flat-square&label=Travis+CI)](https://travis-ci.org/desktop/desktop)
[![CircleCI](https://img.shields.io/circleci/project/github/desktop/desktop.svg?style=flat-square&label=CircleCI)](https://circleci.com/gh/desktop/desktop)
[![AppVeyor Build Status](https://img.shields.io/appveyor/ci/github-windows/desktop/development.svg?style=flat-square&label=AppVeyor&logo=appveyor)](https://ci.appveyor.com/project/github-windows/desktop/branch/development)
[![license](https://img.shields.io/github/license/desktop/desktop.svg?style=flat-square)](https://github.com/desktop/desktop/blob/development/LICENSE)
![90+% TypeScript](https://img.shields.io/github/languages/top/desktop/desktop.svg?style=flat-square&colorB=green)

GitHub Desktop is an open source [Electron](https://electron.atom.io)-based
GitHub app. It is written in [TypeScript](http://www.typescriptlang.org) and
uses [React](https://facebook.github.io/react/).
Expand Down
2 changes: 1 addition & 1 deletion app/.npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
runtime = electron
disturl = https://atom.io/download/electron
target = 7.1.8
target = 9.1.2
arch = x64
11 changes: 1 addition & 10 deletions app/jest.integration.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,7 @@ module.exports = {
testMatch: ['**/integration/**/*-test.ts{,x}'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupTestFrameworkScriptFile: '<rootDir>/test/setup-test-framework.ts',
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: '.',
outputName: 'junit-integration-tests.xml',
},
],
],
reporters: ['default', '<rootDir>../script/jest-actions-reporter.js'],
globals: {
'ts-jest': {
useBabelrc: true,
Expand Down
11 changes: 1 addition & 10 deletions app/jest.unit.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,7 @@ module.exports = {
// ignore index files
'!**/index.ts',
],
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: '.',
outputName: 'junit-unit-tests.xml',
},
],
],
reporters: ['default', '<rootDir>../script/jest-actions-reporter.js'],
coverageReporters: ['text-summary', 'json', 'html', 'cobertura'],
globals: {
'ts-jest': {
Expand Down
13 changes: 7 additions & 6 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"productName": "GitHub Desktop",
"bundleID": "com.github.GitHubClient",
"companyName": "GitHub, Inc.",
"version": "2.5.4-beta1",
"version": "2.5.4-beta2",
"main": "./main.js",
"repository": {
"type": "git",
Expand All @@ -30,12 +30,13 @@
"dugite": "1.91.3",
"electron-window-state": "^5.0.3",
"event-kit": "^2.0.0",
"file-metadata": "^1.0.0",
"file-uri-to-path": "0.0.2",
"file-url": "^2.0.2",
"fs-admin": "^0.12.0",
"fs-admin": "^0.15.0",
"fs-extra": "^7.0.1",
"fuzzaldrin-plus": "^0.6.0",
"keytar": "^5.0.0",
"keytar": "^6.0.1",
"mem": "^4.3.0",
"memoize-one": "^4.0.3",
"moment": "^2.24.0",
Expand All @@ -46,7 +47,6 @@
"queue": "^4.4.2",
"quick-lru": "^3.0.0",
"react": "^16.8.4",
"react-addons-shallow-compare": "^15.6.2",
"react-css-transition-replace": "^3.0.3",
"react-dom": "^16.8.4",
"react-transition-group": "^1.2.0",
Expand All @@ -55,6 +55,7 @@
"source-map-support": "^0.4.15",
"strip-ansi": "^4.0.0",
"textarea-caret": "^3.0.2",
"tslib": "^2.0.0",
"ua-parser-js": "^0.7.12",
"untildify": "^3.0.2",
"username": "^2.3.0",
Expand All @@ -65,8 +66,8 @@
},
"devDependencies": {
"devtron": "^1.4.0",
"electron-debug": "^3.0.1",
"electron-devtools-installer": "^2.2.4",
"electron-debug": "^3.1.0",
"electron-devtools-installer": "^3.1.1",
"temp": "^0.8.3",
"webpack-hot-middleware": "^2.10.0"
}
Expand Down
Loading

0 comments on commit 0a94520

Please sign in to comment.