Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Commit

Permalink
feat(sync): Synchronize updates 8ffc2d717de5d91df48f5189e4a23eccc64ddb19
Browse files Browse the repository at this point in the history
  • Loading branch information
gouzil committed Oct 12, 2022
1 parent 54d0c9b commit 2f1f472
Show file tree
Hide file tree
Showing 156 changed files with 3,715 additions and 738 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ extends:
- prettier/react
- plugin:@typescript-eslint/recommended
- prettier/@typescript-eslint
- plugin:github/react

rules:
##########
Expand All @@ -29,6 +30,7 @@ rules:
###########
# PLUGINS #
###########

# TYPESCRIPT
'@typescript-eslint/naming-convention':
- error
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,16 @@ jobs:
fail-fast: false
matrix:
node: [16.13.0]
os: [macos-10.15, windows-2019]
os: [macos-11, windows-2019]
arch: [x64, arm64]
include:
- os: macos-10.15
- os: macos-11
friendlyName: macOS
asset_name: GitHub\ Desktop-darwin
- os: windows-2019
friendlyName: Windows
asset_name: GitHubDesktop-win32
timeout-minutes: 60
env:
# Needed for macOS arm64 until hosted macos-11.0 runners become available
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
private_key: ${{ secrets.DESKTOP_RELEASES_APP_PRIVATE_KEY }}

- name: Create Release Pull Request
uses: peter-evans/create-pull-request@v4.1.3
uses: peter-evans/create-pull-request@v4.1.1
if: |
startsWith(github.ref, 'refs/heads/releases/') && !contains(github.ref, 'test')
with:
Expand Down
2 changes: 2 additions & 0 deletions .markdownlint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const markdownlintGitHub = require('@github/markdownlint-github')
module.exports = markdownlintGitHub.init()
2 changes: 1 addition & 1 deletion Original-README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GitHub app. 它是用 [TypeScript](https://www.typescriptlang.org) 和 [React](h

## 这是一个什么项目?

这是一个把github desktop翻译成中文的项目, 当前翻译版本[release-3.0.8](https://github.com/gouzil/github-desktop-zh/tree/release-3.0.8)
这是一个把github desktop翻译成中文的项目, 当前翻译版本[release-3.1.0](https://github.com/gouzil/github-desktop-zh/tree/release-3.1.0)

## 在哪里可以下载到?

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

## 这是一个什么项目?

这是一个把github desktop翻译成中文的项目, 当前翻译版本[release-3.0.8](https://github.com/gouzil/github-desktop-zh/tree/release-3.0.8)
这是一个把github desktop翻译成中文的项目, 当前翻译版本[release-3.1.0](https://github.com/gouzil/github-desktop-zh/tree/release-3.1.0)

## 部分截图

Expand Down
4 changes: 2 additions & 2 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": "3.0.8",
"version": "3.1.0",
"main": "./main.js",
"repository": {
"type": "git",
Expand All @@ -30,7 +30,7 @@
"desktop-trampoline": "desktop/desktop-trampoline#v0.9.8",
"dexie": "^3.2.2",
"dompurify": "^2.3.3",
"dugite": "^1.110.0",
"dugite": "^2.0.0",
"electron-window-state": "^5.0.3",
"event-kit": "^2.0.0",
"focus-trap-react": "^8.1.0",
Expand Down
4 changes: 3 additions & 1 deletion app/src/crash/crash-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ export class CrashApp extends React.Component<ICrashAppProps, ICrashAppState> {
}

private renderBackgroundGraphics() {
return <img className="background-graphic-bottom" src={BottomImageUri} />
return (
<img className="background-graphic-bottom" alt="" src={BottomImageUri} />
)
}

public render() {
Expand Down
38 changes: 38 additions & 0 deletions app/src/lib/app-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ export interface IAppState {
/** Should the app prompt the user to confirm a force push? */
readonly askForConfirmationOnForcePush: boolean

/** Should the app prompt the user to confirm an undo commit? */
readonly askForConfirmationOnUndoCommit: boolean

/** How the app should handle uncommitted changes when switching branches */
readonly uncommittedChangesStrategy: UncommittedChangesStrategy

Expand Down Expand Up @@ -418,6 +421,16 @@ export interface IRepositoryState {
readonly compareState: ICompareState
readonly selectedSection: RepositorySectionTab

/**
* The state of the current pull request view in the repository.
*
* It will be populated when a user initiates a pull request. It may have
* content to retain a users pull request state if they navigate
* away from the current pull request view and then back. It is returned
* to null after a pull request has been opened.
*/
readonly pullRequestState: IPullRequestState | null

/**
* The name and email that will be used for the author info
* when committing barring any race where user.name/user.email is
Expand Down Expand Up @@ -928,3 +941,28 @@ export interface IConstrainedValue {
readonly max: number
readonly min: number
}

/**
* The state of the current pull request view in the repository.
*/
export interface IPullRequestState {
/**
* The base branch of a a pull request - the branch the currently checked out
* branch would merge into
*/
readonly baseBranch: Branch

/** The SHAs of commits of the pull request */
readonly commitSHAs: ReadonlyArray<string> | null

/**
* The commit selection, file selection and diff of the pull request.
*
* Note: By default the commit selection shas will be all the pull request
* shas and will mean the diff represents the merge base of the current branch
* and the the pull request base branch. This is different than the
* repositories commit selection where the diff of all commits represents the
* diff between the latest commit and the earliest commits parent.
*/
readonly commitSelection: ICommitSelection
}
12 changes: 12 additions & 0 deletions app/src/lib/editors/darwin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ const editors: IDarwinExternalEditor[] = [
name: 'MacVim',
bundleIdentifiers: ['org.vim.MacVim'],
},
{
name: 'Neovide',
bundleIdentifiers: ['com.neovide.neovide'],
},
{
name: 'Visual Studio Code',
bundleIdentifiers: ['com.microsoft.VSCode'],
Expand Down Expand Up @@ -132,6 +136,14 @@ const editors: IDarwinExternalEditor[] = [
name: 'Nova',
bundleIdentifiers: ['com.panic.Nova'],
},
{
name: 'Emacs',
bundleIdentifiers: ['org.gnu.Emacs'],
},
{
name: 'Lite XL',
bundleIdentifiers: ['com.lite-xl'],
},
]

async function findApplication(
Expand Down
4 changes: 4 additions & 0 deletions app/src/lib/editors/linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ const editors: ILinuxExternalEditor[] = [
name: 'Code',
paths: ['/usr/bin/io.elementary.code'],
},
{
name: 'Lite XL',
paths: ['/usr/bin/lite-xl'],
},
]

async function getAvailablePath(paths: string[]): Promise<string | null> {
Expand Down
14 changes: 12 additions & 2 deletions app/src/lib/feature-flag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function enableBetaFeatures(): boolean {

/** Should git pass `--recurse-submodules` when performing operations? */
export function enableRecurseSubmodulesFlag(): boolean {
return enableBetaFeatures()
return true
}

export function enableReadmeOverwriteWarning(): boolean {
Expand Down Expand Up @@ -100,5 +100,15 @@ export function enablePullRequestQuickView(): boolean {

/** Should we enable displaying multi commit diffs. This also switches diff logic from one commit */
export function enableMultiCommitDiffs(): boolean {
return enableBetaFeatures()
return true
}

/** Should we enable the new interstitial for submodule diffs? */
export function enableSubmoduleDiff(): boolean {
return true
}

/** Should we enable starting pull requests? */
export function enableStartingPullRequests(): boolean {
return enableDevelopmentFeatures()
}
1 change: 1 addition & 0 deletions app/src/lib/git/apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export async function applyPatchToIndex(
const { kind } = diff
switch (diff.kind) {
case DiffType.Binary:
case DiffType.Submodule:
case DiffType.Image:
throw new Error(
`Can't create partial commit in binary file: ${file.path}`
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/git/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export async function git(
// from a terminal or if the system environment variables
// have TERM set Git won't consider us as a smart terminal.
// See https://github.com/git/git/blob/a7312d1a2/editor.c#L11-L15
opts.env = { TERM: 'dumb', ...combinedEnv } as Object
opts.env = { TERM: 'dumb', ...combinedEnv } as object

const commandName = `${name}: git ${args.join(' ')}`

Expand Down
Loading

0 comments on commit 2f1f472

Please sign in to comment.