Skip to content

Commit 8c44bb3

Browse files
committed
Rename GitHubPlugin to SourceLinkPlugin
For #1728.
1 parent 89537bc commit 8c44bb3

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/lib/converter/plugins/GitHubPlugin.ts renamed to src/lib/converter/plugins/SourceLinkPlugin.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ export class Repository {
4949
project?: string;
5050

5151
/**
52-
* The hostname for this GitHub or Bitbucket project.
52+
* The hostname for this GitHub/Bitbucket/.etc project.
5353
*
5454
* Defaults to: `github.com` (for normal, public GitHub instance projects)
5555
*
56-
* Or the hostname for an enterprise version of GitHub, e.g. `github.acme.com`
56+
* Can be the hostname for an enterprise version of GitHub, e.g. `github.acme.com`
5757
* (if found as a match in the list of git remotes).
5858
*/
5959
hostname = "github.com";
6060

6161
/**
62-
* Whether this is a GitHub or Bitbucket repository.
62+
* Whether this is a GitHub, Bitbucket, or other type of repository.
6363
*/
6464
type: RepositoryType = RepositoryType.GitHub;
6565

@@ -201,8 +201,8 @@ export class Repository {
201201
* A handler that watches for repositories with GitHub origin and links
202202
* their source files to the related GitHub pages.
203203
*/
204-
@Component({ name: "git-hub" })
205-
export class GitHubPlugin extends ConverterComponent {
204+
@Component({ name: "source-link" })
205+
export class SourceLinkPlugin extends ConverterComponent {
206206
/**
207207
* List of known repositories.
208208
*/

src/lib/converter/plugins/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export { CategoryPlugin } from "./CategoryPlugin";
22
export { CommentPlugin } from "./CommentPlugin";
33
export { DecoratorPlugin } from "./DecoratorPlugin";
4-
export { GitHubPlugin } from "./GitHubPlugin";
4+
export { SourceLinkPlugin } from "./SourceLinkPlugin";
55
export { GroupPlugin } from "./GroupPlugin";
66
export { ImplementsPlugin } from "./ImplementsPlugin";
77
export { PackagePlugin } from "./PackagePlugin";

src/test/GitHubPlugin.test.ts renamed to src/test/SourceLinkPlugin.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import * as github from "../lib/converter/plugins/GitHubPlugin";
1+
import { Repository } from "../lib/converter/plugins/SourceLinkPlugin";
22
import { RepositoryType } from "../lib/models";
33
import { strictEqual as equal } from "assert";
44

55
describe("Repository", function () {
66
describe("constructor", function () {
77
it("defaults to github.com hostname", function () {
8-
const repository = new github.Repository("", "", []);
8+
const repository = new Repository("", "", []);
99

1010
equal(repository.hostname, "github.com");
1111
equal(repository.type, RepositoryType.GitHub);
@@ -14,7 +14,7 @@ describe("Repository", function () {
1414
it("handles a personal GitHub HTTPS URL", function () {
1515
const mockRemotes = ["https://github.com/joebloggs/foobar.git"];
1616

17-
const repository = new github.Repository("", "", mockRemotes);
17+
const repository = new Repository("", "", mockRemotes);
1818

1919
equal(repository.hostname, "github.com");
2020
equal(repository.user, "joebloggs");
@@ -25,7 +25,7 @@ describe("Repository", function () {
2525
it("handles an enterprise GitHub URL", function () {
2626
const mockRemotes = ["[email protected]:joebloggs/foobar.git"];
2727

28-
const repository = new github.Repository("", "", mockRemotes);
28+
const repository = new Repository("", "", mockRemotes);
2929

3030
equal(repository.hostname, "github.acme.com");
3131
equal(repository.user, "joebloggs");
@@ -38,7 +38,7 @@ describe("Repository", function () {
3838
"ssh://[email protected]/joebloggs/foobar.git",
3939
];
4040

41-
const repository = new github.Repository("", "", mockRemotes);
41+
const repository = new Repository("", "", mockRemotes);
4242

4343
equal(repository.hostname, "bigcompany.githubprivate.com");
4444
equal(repository.user, "joebloggs");
@@ -51,7 +51,7 @@ describe("Repository", function () {
5151
"https://[email protected]/joebloggs/foobar.git",
5252
];
5353

54-
const repository = new github.Repository("", "", mockRemotes);
54+
const repository = new Repository("", "", mockRemotes);
5555

5656
equal(repository.hostname, "bitbucket.org");
5757
equal(repository.user, "joebloggs");
@@ -62,7 +62,7 @@ describe("Repository", function () {
6262
it("handles a Bitbucket SSH URL", function () {
6363
const mockRemotes = ["[email protected]:joebloggs/foobar.git"];
6464

65-
const repository = new github.Repository("", "", mockRemotes);
65+
const repository = new Repository("", "", mockRemotes);
6666

6767
equal(repository.hostname, "bitbucket.org");
6868
equal(repository.user, "joebloggs");
@@ -78,7 +78,7 @@ describe("Repository", function () {
7878
it("returns a GitHub URL", function () {
7979
const mockRemotes = ["https://github.com/joebloggs/foobar.git"];
8080

81-
const repository = new github.Repository(
81+
const repository = new Repository(
8282
repositoryPath,
8383
"main",
8484
mockRemotes
@@ -96,7 +96,7 @@ describe("Repository", function () {
9696
"https://[email protected]/joebloggs/foobar.git",
9797
];
9898

99-
const repository = new github.Repository(
99+
const repository = new Repository(
100100
repositoryPath,
101101
"main",
102102
mockRemotes

0 commit comments

Comments
 (0)