From a3f4836ba0a75b355c004e1991e8dd1e6321a983 Mon Sep 17 00:00:00 2001 From: Gar Date: Mon, 14 Mar 2022 14:57:24 -0700 Subject: [PATCH] fix: move files to lib --- git-host-info.js => lib/git-host-info.js | 0 git-host.js => lib/git-host.js | 0 index.js => lib/index.js | 0 package.json | 2 +- test/bitbucket.js | 4 ++-- test/gist.js | 4 ++-- test/github.js | 4 ++-- test/gitlab.js | 4 ++-- test/invalid.js | 2 +- test/localhost.js | 4 ++-- test/sourcehut.js | 4 ++-- 11 files changed, 14 insertions(+), 14 deletions(-) rename git-host-info.js => lib/git-host-info.js (100%) rename git-host.js => lib/git-host.js (100%) rename index.js => lib/index.js (100%) diff --git a/git-host-info.js b/lib/git-host-info.js similarity index 100% rename from git-host-info.js rename to lib/git-host-info.js diff --git a/git-host.js b/lib/git-host.js similarity index 100% rename from git-host.js rename to lib/git-host.js diff --git a/index.js b/lib/index.js similarity index 100% rename from index.js rename to lib/index.js diff --git a/package.json b/package.json index 8cd6fee..96db9e0 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "hosted-git-info", "version": "4.1.0", "description": "Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab", - "main": "index.js", + "main": "./lib/index.js", "repository": { "type": "git", "url": "git+https://github.com/npm/hosted-git-info.git" diff --git a/test/bitbucket.js b/test/bitbucket.js index c63d7d6..4668e59 100644 --- a/test/bitbucket.js +++ b/test/bitbucket.js @@ -1,6 +1,6 @@ /* eslint-disable max-len */ 'use strict' -const HostedGit = require('../index') +const HostedGit = require('..') const t = require('tap') const invalid = [ @@ -14,7 +14,7 @@ const invalid = [ // assigning the constructor here is hacky, but the only way to make assertions that compare // a subset of properties to a found object pass as you would expect -const GitHost = require('../git-host') +const GitHost = require('../lib/git-host') const defaults = { constructor: GitHost, type: 'bitbucket', user: 'foo', project: 'bar' } const valid = { diff --git a/test/gist.js b/test/gist.js index 6de3988..9313550 100644 --- a/test/gist.js +++ b/test/gist.js @@ -1,6 +1,6 @@ /* eslint-disable max-len */ 'use strict' -const HostedGit = require('../index') +const HostedGit = require('..') const t = require('tap') const invalid = [ @@ -13,7 +13,7 @@ const invalid = [ // user defaults to null for all inputs that do not specify one // assigning the constructor here is hacky, but the only way to make assertions that compare // a subset of properties to a found object pass as you would expect -const GitHost = require('../git-host') +const GitHost = require('../lib/git-host') const defaults = { constructor: GitHost, type: 'gist', user: null, project: 'feedbeef' } const valid = { // shortcuts diff --git a/test/github.js b/test/github.js index 2a72030..23be141 100644 --- a/test/github.js +++ b/test/github.js @@ -1,5 +1,5 @@ /* eslint-disable max-len */ -const HostedGit = require('../index') +const HostedGit = require('..') const t = require('tap') const invalid = [ @@ -24,7 +24,7 @@ const invalid = [ // assigning the constructor here is hacky, but the only way to make assertions that compare // a subset of properties to a found object pass as you would expect -const GitHost = require('../git-host') +const GitHost = require('../lib/git-host') const defaults = { constructor: GitHost, type: 'github', user: 'foo', project: 'bar' } const valid = { // extreme shorthand diff --git a/test/gitlab.js b/test/gitlab.js index 6f942c8..1975b3e 100644 --- a/test/gitlab.js +++ b/test/gitlab.js @@ -1,6 +1,6 @@ /* eslint-disable max-len */ 'use strict' -const HostedGit = require('../index') +const HostedGit = require('..') const t = require('tap') const invalid = [ @@ -15,7 +15,7 @@ const invalid = [ // assigning the constructor here is hacky, but the only way to make assertions that compare // a subset of properties to a found object pass as you would expect -const GitHost = require('../git-host') +const GitHost = require('../lib/git-host') const defaults = { constructor: GitHost, type: 'gitlab', user: 'foo', project: 'bar' } const subgroup = { constructor: GitHost, type: 'gitlab', user: 'foo/bar', project: 'baz' } const valid = { diff --git a/test/invalid.js b/test/invalid.js index aaf121e..57a9fdb 100644 --- a/test/invalid.js +++ b/test/invalid.js @@ -1,4 +1,4 @@ -const HostedGit = require('../') +const HostedGit = require('..') const t = require('tap') // each of these urls should return `undefined` diff --git a/test/localhost.js b/test/localhost.js index 36e33fc..744ac09 100644 --- a/test/localhost.js +++ b/test/localhost.js @@ -1,6 +1,6 @@ // An example of a custom setup, useful when testing modules like pacote, // which do various things with these git shortcuts. -const ghi = require('../git-host-info.js') +const ghi = require('../lib/git-host-info.js') ghi.localhost = { protocols: ['git:'], domain: 'localhost', @@ -13,7 +13,7 @@ ghi.localhost = { ghi.byShortcut['localhost:'] = 'localhost' ghi.byDomain.localhost = 'localhost' -const HostedGit = require('../') +const HostedGit = require('..') const t = require('tap') t.test('supports extensions', t => { diff --git a/test/sourcehut.js b/test/sourcehut.js index 281089c..779bacd 100644 --- a/test/sourcehut.js +++ b/test/sourcehut.js @@ -1,5 +1,5 @@ 'use strict' -const HostedGit = require('../index') +const HostedGit = require('..') const t = require('tap') const invalid = [ @@ -14,7 +14,7 @@ const invalid = [ // assigning the constructor here is hacky, but the only way to make assertions that compare // a subset of properties to a found object pass as you would expect -const GitHost = require('../git-host') +const GitHost = require('../lib/git-host') const defaults = { constructor: GitHost, type: 'sourcehut', user: '~foo', project: 'bar' } const valid = {