Skip to content

Commit

Permalink
Transfer repo to refined-github organization (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Mar 4, 2022
1 parent edba1c9 commit d530f8e
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion demo/App.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
const defaultUrl = 'https://github.com/fregante/github-url-detection';
const defaultUrl = 'https://github.com/refined-github/github-url-detection';
export let url = '';
import * as urlDetection from '../index';
import collector from '../collector';
Expand Down
4 changes: 2 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

<body>
<h1>
<a href="https://github.com/fregante/github-url-detection">
fregante/github-url-detection
<a href="https://github.com/refined-github/github-url-detection">
refined-github/github-url-detection
</a>
</h1>
<main class="container">
Expand Down
12 changes: 6 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -617,14 +617,14 @@ collect.set('isMarketplaceAction', [
export const isActionJobRun = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('runs/'));
collect.set('isActionJobRun', [
'https://github.com/sindresorhus/refined-github/runs/639481849',
'https://github.com/fregante/github-url-detection/runs/1224552520?check_suite_focus=true',
'https://github.com/refined-github/github-url-detection/runs/1224552520?check_suite_focus=true',
]);

export const isActionRun = (url: URL | HTMLAnchorElement | Location = location): boolean => /^(actions\/)?runs/.test(getRepo(url)?.path!);
collect.set('isActionRun', [
'https://github.com/sindresorhus/refined-github/runs/639481849',
'https://github.com/fregante/github-url-detection/runs/1224552520?check_suite_focus=true',
'https://github.com/fregante/github-url-detection/actions/runs/294962314',
'https://github.com/refined-github/github-url-detection/runs/1224552520?check_suite_focus=true',
'https://github.com/refined-github/github-url-detection/actions/runs/294962314',
]);

export const isNewAction = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'actions/new';
Expand All @@ -634,9 +634,9 @@ collect.set('isNewAction', [

export const isRepositoryActions = (url: URL | HTMLAnchorElement | Location = location): boolean => /^actions(\/workflows\/.+\.ya?ml)?$/.test(getRepo(url)?.path!);
collect.set('isRepositoryActions', [
'https://github.com/fregante/github-url-detection/actions',
'https://github.com/fregante/github-url-detection/actions/workflows/demo.yml',
'https://github.com/fregante/github-url-detection/actions/workflows/esm-lint.yml',
'https://github.com/refined-github/github-url-detection/actions',
'https://github.com/refined-github/github-url-detection/actions/workflows/demo.yml',
'https://github.com/refined-github/github-url-detection/actions/workflows/esm-lint.yml',
]);

export const isUserTheOrganizationOwner = (): boolean => isOrganizationProfile() && exists('[aria-label="Organization"] [data-tab-item="org-header-settings-tab"]');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test",
"extension"
],
"repository": "fregante/github-url-detection",
"repository": "refined-github/github-url-detection",
"funding": "https://github.com/sponsors/fregante",
"license": "MIT",
"author": "Federico Brigante <me@fregante.com> (https://fregante.com)",
Expand Down
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
Battle-tested by and extracted from the [Refined GitHub](https://github.com/sindresorhus/refined-github) extension.

- Try the live [demo](https://fregante.github.io/github-url-detection/)
- See the code and expected URLs for [every detection](https://github.com/fregante/github-url-detection/blob/main/index.ts)
- Try the live [demo](https://refined-github.github.io/github-url-detection/)
- See the code and expected URLs for [every detection](https://github.com/refined-github/github-url-detection/blob/main/index.ts)

## Install

Expand All @@ -21,7 +21,7 @@ import * as pageDetect from 'github-url-detection';
## Usage

```js
const href = 'https://github.com/fregante/github-url-detection/issues/1';
const href = 'https://github.com/refined-github/github-url-detection/issues/1';
if (pageDetect.isIssue(new URL(href))) { // Pass the URL as an `URL` object
alert('The passed URL is of an issue!')
}
Expand Down Expand Up @@ -50,7 +50,7 @@ if (pageDetect.isConversationList()) {
```

```js
if (pageDetect.isConversationList(new URL('https://github.com/fregante/github-url-detection/pulls'))) {
if (pageDetect.isConversationList(new URL('https://github.com/refined-github/github-url-detection/pulls'))) {
alert('You’re looking at a issues or PRs list!')
}
```
Expand Down
42 changes: 21 additions & 21 deletions test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,46 +141,46 @@ test('getRepositoryInfo', t => {
t.is(getRepositoryInfoAdapter('https://github.com'), undefined);
t.is(getRepositoryInfoAdapter('https://gist.github.com/'), undefined);
t.is(getRepositoryInfoAdapter('https://github.com/settings/developers'), undefined);
t.deepEqual(getRepositoryInfoAdapter('https://github.com/fregante/github-url-detection'), {
owner: 'fregante',
t.deepEqual(getRepositoryInfoAdapter('https://github.com/refined-github/github-url-detection'), {
owner: 'refined-github',
name: 'github-url-detection',
nameWithOwner: 'fregante/github-url-detection',
nameWithOwner: 'refined-github/github-url-detection',
path: '',
});
t.deepEqual(getRepositoryInfoAdapter('https://github.com/fregante/github-url-detection/'), {
owner: 'fregante',
t.deepEqual(getRepositoryInfoAdapter('https://github.com/refined-github/github-url-detection/'), {
owner: 'refined-github',
name: 'github-url-detection',
nameWithOwner: 'fregante/github-url-detection',
nameWithOwner: 'refined-github/github-url-detection',
path: '',
});
t.deepEqual(getRepositoryInfoAdapter('https://github.com/fregante/github-url-detection/blame/master/package.json'), {
owner: 'fregante',
t.deepEqual(getRepositoryInfoAdapter('https://github.com/refined-github/github-url-detection/blame/master/package.json'), {
owner: 'refined-github',
name: 'github-url-detection',
nameWithOwner: 'fregante/github-url-detection',
nameWithOwner: 'refined-github/github-url-detection',
path: 'blame/master/package.json',
});
t.deepEqual(getRepositoryInfoAdapter('https://github.com/fregante/github-url-detection/commit/57bf4'), {
owner: 'fregante',
t.deepEqual(getRepositoryInfoAdapter('https://github.com/refined-github/github-url-detection/commit/57bf4'), {
owner: 'refined-github',
name: 'github-url-detection',
nameWithOwner: 'fregante/github-url-detection',
nameWithOwner: 'refined-github/github-url-detection',
path: 'commit/57bf4',
});
t.deepEqual(getRepositoryInfoAdapter('https://github.com/fregante/github-url-detection/compare/test-branch?quick_pull=0'), {
owner: 'fregante',
t.deepEqual(getRepositoryInfoAdapter('https://github.com/refined-github/github-url-detection/compare/test-branch?quick_pull=0'), {
owner: 'refined-github',
name: 'github-url-detection',
nameWithOwner: 'fregante/github-url-detection',
nameWithOwner: 'refined-github/github-url-detection',
path: 'compare/test-branch',
});
t.deepEqual(getRepositoryInfoAdapter('https://github.com/fregante/github-url-detection/tree/master/distribution'), {
owner: 'fregante',
t.deepEqual(getRepositoryInfoAdapter('https://github.com/refined-github/github-url-detection/tree/master/distribution'), {
owner: 'refined-github',
name: 'github-url-detection',
nameWithOwner: 'fregante/github-url-detection',
nameWithOwner: 'refined-github/github-url-detection',
path: 'tree/master/distribution',
});
t.deepEqual(getRepositoryInfoAdapter('https://github.com/fregante/github-url-detection/tree/master/distribution/'), {
owner: 'fregante',
t.deepEqual(getRepositoryInfoAdapter('https://github.com/refined-github/github-url-detection/tree/master/distribution/'), {
owner: 'refined-github',
name: 'github-url-detection',
nameWithOwner: 'fregante/github-url-detection',
nameWithOwner: 'refined-github/github-url-detection',
path: 'tree/master/distribution',
});
}
Expand Down

0 comments on commit d530f8e

Please sign in to comment.