-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add basic support for command-palette-plus
- add basic POC for the new command pallete - add first link parsing to determine repo name in standardised format - add palette support for all platforms for issues & PRs - remove some debugging messages from console
- Loading branch information
Showing
15 changed files
with
12,356 additions
and
8,155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = { | ||
sourceMaps: "inline", | ||
plugins: [ | ||
"@babel/plugin-proposal-object-rest-spread", | ||
"add-module-exports" | ||
], | ||
presets: [ | ||
["@babel/preset-env", { | ||
targets: {electron: process.versions.electron || process.env.ELECTRON_VERSION} | ||
}], | ||
"@babel/preset-react" | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
module.exports = {extends: ['@commitlint/config-conventional']} | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
ignores: [ | ||
(message) => (message.includes('WIP') || message.trim() === 'fix') | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
'use babel'; | ||
|
||
const filePath = () => { | ||
return atom.workspace.getActiveTextEditor().getBuffer().getPath(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
'use babel'; | ||
|
||
import { toShortHash } from '../git' | ||
import tmpl from 'reverse-string-template' | ||
|
||
const bitbucket = ({ | ||
repo, | ||
}) => ({ | ||
hostsRepo: ({ host, response }) => { | ||
// If it's the known public domain (BitBucket.org) | ||
if (host.toLowerCase() === 'bitbucket.org') { | ||
return true | ||
} | ||
|
||
// If the header has the x-view-name | ||
if (response.headers['x-view-name'].indexOf('bitbucket') !== -1) { | ||
return true | ||
} | ||
|
||
// Otherwise.. | ||
return false | ||
}, | ||
getSelectionLink: ({ commitHash, relativePath, start, end }) => `${repo}/src/${toShortHash(commitHash)}${relativePath}#lines-${start}:${end}`, | ||
getLineLink: ({ commitHash, relativePath, start }) => `${repo}/src/${toShortHash(commitHash)}${relativePath}#lines-${start}`, | ||
getFileLink: ({ commitHash, relativePath }) => `${repo}/src/${toShortHash(commitHash)}${relativePath}`, | ||
export default function ({ repo }) { | ||
return { | ||
getRepoDisplay: () => { | ||
const template = 'https://{%endpoint%}/{%username%}/{{repository}}' | ||
const { username, repository } = tmpl(repo, template) | ||
return `${username}/${repository}` | ||
}, | ||
hostsRepo: ({ host, response }) => { | ||
// If it's the known public domain (BitBucket.org) | ||
if (host.toLowerCase() === 'bitbucket.org') { | ||
return true | ||
} | ||
|
||
}) | ||
// If the header has the x-view-name | ||
if (response.headers['x-view-name']?.includes('bitbucket')) { | ||
return true | ||
} | ||
|
||
export default bitbucket | ||
// Otherwise.. | ||
return false | ||
}, | ||
getSelectionLink: ({ commitHash, relativePath, start, end }) => `${repo}/src/${toShortHash(commitHash)}${relativePath}#lines-${start}:${end}`, | ||
getLineLink: ({ commitHash, relativePath, start }) => `${repo}/src/${toShortHash(commitHash)}${relativePath}#lines-${start}`, | ||
getFileLink: ({ commitHash, relativePath }) => `${repo}/src/${toShortHash(commitHash)}${relativePath}`, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
'use babel'; | ||
|
||
// Generic fallback for everything else, based on GitLab's format, without any special GitHub support. | ||
const genericDefault = ({ | ||
repo, | ||
}) => ({ | ||
getRepo: () => repo, | ||
hostsRepo: () => false, | ||
getSelectionLink: ({ commitHash, relativePath, start, end }) => `${repo}/blob/${commitHash}${relativePath}#L${start}-${end}`, | ||
getLineLink: ({ commitHash, relativePath, start }) => `${repo}/blob/${commitHash}${relativePath}#L${start}`, | ||
getFileLink: ({ commitHash, relativePath }) => `${repo}/blob/${commitHash}${relativePath}`, | ||
}) | ||
|
||
export default genericDefault | ||
export default function ({ repo }) { | ||
return { | ||
getRepo: () => repo, | ||
getRepoDisplay: () => 'Current Repository', // e.g. for this package, it would be "keevan/git-link" | ||
hostsRepo: () => false, | ||
getSelectionLink: ({ commitHash, relativePath, start, end }) => `${repo}/blob/${commitHash}${relativePath}#L${start}-${end}`, | ||
getLineLink: ({ commitHash, relativePath, start }) => `${repo}/blob/${commitHash}${relativePath}#L${start}`, | ||
getFileLink: ({ commitHash, relativePath }) => `${repo}/blob/${commitHash}${relativePath}`, | ||
} | ||
} |
Oops, something went wrong.