Skip to content

Commit

Permalink
More consistently use example.org in docs, links and even tests
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Mar 21, 2022
1 parent 6d7c3f2 commit 3ccdef0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/markdown-link-checker.json
@@ -1,5 +1,8 @@
{
"ignorePatterns": [
{
"pattern": "example.org"
},
{
"pattern": "gitlab.com/profile"
}
Expand Down
4 changes: 2 additions & 2 deletions docs/github-releases.md
Expand Up @@ -107,8 +107,8 @@ In case the release should not be made public yet, set `github.draft: true`.

Use a different host from what would be derived from the Git url (e.g. when using GitHub Enterprise).

By default, the GitHub API host is https://api.github.com. Setting `github.host` to `"private.source.com"` would result
in release-it using https://private.source.com/api/v3.
By default, the GitHub API host is https://api.github.com. Setting `github.host` to `"private.example.org"` would result
in release-it using https://private.example.org/api/v3.

## Proxy

Expand Down
2 changes: 1 addition & 1 deletion docs/recipes/my-version.md
Expand Up @@ -54,7 +54,7 @@ class MyVersionPlugin extends Plugin {
if (this.isReleased) {
const name = this.getPackageName();
const { version } = this.getContext();
this.log.log(`🔗 https://example.package-manager.org/${name}/${version}`);
this.log.log(`🔗 https://registry.example.org/${name}/${version}`);
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions test/github.js
Expand Up @@ -214,16 +214,16 @@ test('should release to enterprise host', async t => {
});

test('should release to alternative host and proxy', async t => {
const remote = { api: 'https://my-custom-host.org/api/v3', host: 'my-custom-host.org' };
const remote = { api: 'https://custom.example.org/api/v3', host: 'custom.example.org' };
interceptAuthentication(remote);
interceptCollaborator(remote);
interceptCreate(Object.assign({ body: { tag_name: '1.0.1' } }, remote));
const options = {
git,
github: {
tokenRef,
pushRepo: `git://my-custom-host.org:user/repo`,
host: 'my-custom-host.org',
pushRepo: `git://custom.example.org:user/repo`,
host: 'custom.example.org',
proxy: 'http://proxy:8080'
}
};
Expand All @@ -235,24 +235,24 @@ test('should release to alternative host and proxy', async t => {

const { isReleased, releaseUrl } = github.getContext();
t.true(isReleased);
t.is(releaseUrl, `https://my-custom-host.org/user/repo/releases/tag/1.0.1`);
t.is(releaseUrl, `https://custom.example.org/user/repo/releases/tag/1.0.1`);
exec.restore();
});

test('should release to git.pushRepo', async t => {
const remote = { api: 'https://my-custom-host.org/api/v3', host: 'my-custom-host.org' };
const remote = { api: 'https://custom.example.org/api/v3', host: 'custom.example.org' };
interceptCreate(Object.assign({ body: { tag_name: '1.0.1' } }, remote));
const options = { git: { pushRepo: 'upstream', changelog: '' }, github: { tokenRef, skipChecks: true } };
const github = factory(GitHub, { options });
const exec = sinon.stub(github.shell, 'exec').callThrough();
exec.withArgs('git describe --tags --match=* --abbrev=0').resolves('1.0.0');
exec.withArgs('git remote get-url upstream').resolves('https://my-custom-host.org/user/repo');
exec.withArgs('git remote get-url upstream').resolves('https://custom.example.org/user/repo');

await runTasks(github);

const { isReleased, releaseUrl } = github.getContext();
t.true(isReleased);
t.is(releaseUrl, 'https://my-custom-host.org/user/repo/releases/tag/1.0.1');
t.is(releaseUrl, 'https://custom.example.org/user/repo/releases/tag/1.0.1');
exec.restore();
});

Expand Down Expand Up @@ -385,10 +385,10 @@ test('should generate GitHub web release url for enterprise host', async t => {
const options = {
git,
github: {
pushRepo: 'git://my-custom-host.org:user/repo',
pushRepo: 'git://custom.example.org:user/repo',
release: true,
web: true,
host: 'my-custom-host.org',
host: 'custom.example.org',
releaseName: 'The Launch',
releaseNotes: 'echo It happened'
}
Expand All @@ -403,7 +403,7 @@ test('should generate GitHub web release url for enterprise host', async t => {
t.true(isReleased);
t.is(
releaseUrl,
'https://my-custom-host.org/user/repo/releases/new?tag=2.0.2&title=The+Launch&body=It+happened&prerelease=false'
'https://custom.example.org/user/repo/releases/new?tag=2.0.2&title=The+Launch&body=It+happened&prerelease=false'
);
exec.restore();
});
4 changes: 2 additions & 2 deletions test/npm.js
Expand Up @@ -13,9 +13,9 @@ test('should return npm package url', t => {
});

test('should return npm package url (custom registry)', t => {
const options = { npm: { name: 'my-cool-package', publishConfig: { registry: 'https://my-registry.com/' } } };
const options = { npm: { name: 'my-cool-package', publishConfig: { registry: 'https://registry.example.org/' } } };
const npmClient = factory(npm, { options });
t.is(npmClient.getPackageUrl(), 'https://my-registry.com/package/my-cool-package');
t.is(npmClient.getPackageUrl(), 'https://registry.example.org/package/my-cool-package');
});

test('should return default tag', async t => {
Expand Down
2 changes: 1 addition & 1 deletion test/tasks.js
Expand Up @@ -358,7 +358,7 @@ test.serial('should initially publish non-private scoped npm package privately',
test.serial('should use pkg.publishConfig.registry', async t => {
const { target } = t.context;
const pkgName = path.basename(target);
const registry = 'https://my-registry.com';
const registry = 'https://my-registry.example.org';

gitAdd(
JSON.stringify({
Expand Down

0 comments on commit 3ccdef0

Please sign in to comment.