-
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12754 from keymanapp/change/developer/12746-kmc-c…
…opy-full-gh-url change(developer): use full github url in kmc copy parameters
- Loading branch information
Showing
13 changed files
with
298 additions
and
83 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
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,18 @@ | ||
/** | ||
* Matches a Keyman keyboard resource, based on the permanent home page for the | ||
* keyboard on keyman.com, `https://keyman.com/keyboards/<id>` | ||
*/ | ||
export const KEYMANCOM_CLOUD_URI = /^(?:http(?:s)?:\/\/)?keyman\.com\/keyboards\/(?<id>[a-z0-9_.-]+)/i; | ||
|
||
/** | ||
* Matches a `cloud:<id>` URI for a Keyman resource (e.g. keyboard or lexical | ||
* model) | ||
*/ | ||
export const CLOUD_URI = /^cloud:(?<id>.+)$/i; | ||
|
||
|
||
export interface CloudUriRegexMatchArray extends RegExpMatchArray { | ||
groups?: { | ||
id?: string; | ||
} | ||
} |
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,35 @@ | ||
/** | ||
* Matches only a GitHub permanent raw URI with a commit hash, without any other | ||
* components; note hash is called branch to match other URI formats | ||
*/ | ||
export const GITHUB_STABLE_SOURCE = /^https:\/\/github\.com\/(?<owner>[a-zA-Z0-9-]+)\/(?<repo>[\w\.-]+)\/raw\/(?<branch>[a-f0-9]{40})\/(?<path>.+)$/; | ||
|
||
/** | ||
* Matches any GitHub git resource raw 'user content' URI which can be | ||
* translated to a permanent URI with a commit hash | ||
*/ | ||
export const GITHUB_RAW_URI = /^https:\/\/raw\.githubusercontent\.com\/(?<owner>[a-zA-Z0-9-]+)\/(?<repo>[\w\.-]+)\/(?:refs\/(?:heads|tags)\/)?(?<branch>[^/]+)\/(?<path>.+)$/; | ||
|
||
/** | ||
* Matches any GitHub git resource raw URI which can be translated to a | ||
* permanent URI with a commit hash | ||
*/ | ||
export const GITHUB_URI = /^https:\/\/github\.com\/(?<owner>[a-zA-Z0-9-]+)\/(?<repo>[\w\.-]+)\/(?:raw|blob|tree)\/(?:refs\/(?:heads|tags)\/)?(?<branch>[^/]+)\/(?<path>.+)$/; | ||
|
||
/** | ||
* Matches any GitHub git resource raw URI which can be translated to a | ||
* permanent URI with a commit hash, with the http[s] protocol optional, for | ||
* matching user-supplied URLs. groups are: `owner`, `repo`, `branch`, and | ||
* `path`. | ||
*/ | ||
export const GITHUB_URI_OPTIONAL_PROTOCOL = /^(?:http(?:s)?:\/\/)?github\.com\/(?<owner>[a-zA-Z0-9-]+)\/(?<repo>[\w\.-]+)(?:\/(?:(?:raw|blob|tree)\/(?:refs\/(?:heads|tags)\/)?(?<branch>[^/]+)\/(?<path>.*))?)?$/; | ||
|
||
|
||
export interface GitHubRegexMatchArray extends RegExpMatchArray { | ||
groups?: { | ||
owner?: string; | ||
repo?: string; | ||
branch?: string; | ||
path?: string; | ||
} | ||
} |
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
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
Oops, something went wrong.