Skip to content

Commit b175d59

Browse files
authored
Continue mono repo work for plugins and resolvers (#441)
* Move core files into own packages * Move buildins to package plugin-javascript * Remove unused dep semver-regex * Move plugin tests * Fix plugin test imports * Fix imports * Import plugin into core package * Rename live-resolver package
1 parent 9fda080 commit b175d59

File tree

84 files changed

+508
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+508
-99
lines changed

packages/core/load-plugins.js

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
export { default as BowerManifest } from './plugins/bower-manifest.js';
2-
export { default as Composer } from './plugins/composer-manifest.js';
3-
export { default as CSS } from './plugins/css.js';
4-
export { default as Docker } from './plugins/docker.js';
5-
export { default as DotNetCore } from './plugins/dot-net-core.js';
6-
export { default as DotNet } from './plugins/dot-net.js';
7-
export { default as Rubygems } from './plugins/gemfile-manifest.js';
8-
export { default as Go } from './plugins/go.js';
9-
export { default as Haskell } from './plugins/haskell.js';
10-
export { default as Homebrew } from './plugins/homebrew-manifest.js';
11-
export { default as HTML } from './plugins/html.js';
12-
export { default as Java } from './plugins/java.js';
13-
export { default as JavaScript } from './plugins/javascript.js';
14-
export { default as Less } from './plugins/less.js';
1+
export { default as BowerManifest } from '@octolinker/plugin-bower-manifest';
2+
export { default as Composer } from '@octolinker/plugin-composer-manifest';
3+
export { default as CSS } from '@octolinker/plugin-css';
4+
export { default as Docker } from '@octolinker/plugin-docker';
5+
export { default as DotNetCore } from '@octolinker/plugin-dot-net-core';
6+
export { default as DotNet } from '@octolinker/plugin-dot-net';
7+
export { default as Rubygems } from '@octolinker/plugin-gemfile-manifest';
8+
export { default as Go } from '@octolinker/plugin-go';
9+
export { default as Haskell } from '@octolinker/plugin-haskell';
10+
export { default as Homebrew } from '@octolinker/plugin-homebrew-manifest';
11+
export { default as HTML } from '@octolinker/plugin-html';
12+
export { default as Java } from '@octolinker/plugin-java';
13+
export { default as JavaScript } from '@octolinker/plugin-javascript';
14+
export { default as Less } from '@octolinker/plugin-less';
1515
export {
1616
default as NodejsRelativePath,
17-
} from './plugins/nodejs-relative-path.js';
18-
export { default as NpmManifest } from './plugins/npm-manifest.js';
19-
export { default as Python } from './plugins/python.js';
20-
export { default as RequirementsTxt } from './plugins/requirements-txt.js';
21-
export { default as Ruby } from './plugins/ruby.js';
22-
export { default as Rust } from './plugins/rust.js';
23-
export { default as Sass } from './plugins/sass.js';
24-
export { default as TypeScript } from './plugins/typescript.js';
25-
export { default as Vim } from './plugins/vim.js';
17+
} from '@octolinker/plugin-nodejs-relative-path';
18+
export { default as NpmManifest } from '@octolinker/plugin-npm-manifest';
19+
export { default as Python } from '@octolinker/plugin-python';
20+
export {
21+
default as RequirementsTxt,
22+
} from '@octolinker/plugin-requirements-txt';
23+
export { default as Ruby } from '@octolinker/plugin-ruby';
24+
export { default as Rust } from '@octolinker/plugin-rust';
25+
export { default as Sass } from '@octolinker/plugin-sass';
26+
export { default as TypeScript } from '@octolinker/plugin-typescript';
27+
export { default as Vim } from '@octolinker/plugin-vim';

packages/core/package.json

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,33 @@
77
"main": "./index.js",
88
"dependencies": {
99
"@octolinker/blob-reader": "1.0.0",
10-
"@octolinker/helper-grammar-regex-collection": "1.0.0",
11-
"@octolinker/helper-insert-link": "1.0.0",
1210
"@octolinker/helper-settings": "1.0.0",
13-
"JSONPath": "^0.11.2",
14-
"builtins": "^1.0.3",
15-
"concat-map": "^0.0.1",
16-
"escape-regex-string": "^1.0.4",
11+
"@octolinker/helper-insert-link": "1.0.0",
12+
"@octolinker/plugin-bower-manifest": "1.0.0",
13+
"@octolinker/plugin-composer-manifest": "1.0.0",
14+
"@octolinker/plugin-css": "1.0.0",
15+
"@octolinker/plugin-docker": "1.0.0",
16+
"@octolinker/plugin-dot-net-core": "1.0.0",
17+
"@octolinker/plugin-dot-net": "1.0.0",
18+
"@octolinker/plugin-gemfile-manifest": "1.0.0",
19+
"@octolinker/plugin-go": "1.0.0",
20+
"@octolinker/plugin-haskell": "1.0.0",
21+
"@octolinker/plugin-homebrew-manifest": "1.0.0",
22+
"@octolinker/plugin-html": "1.0.0",
23+
"@octolinker/plugin-java": "1.0.0",
24+
"@octolinker/plugin-javascript": "1.0.0",
25+
"@octolinker/plugin-less": "1.0.0",
26+
"@octolinker/plugin-nodejs-relative-path": "1.0.0",
27+
"@octolinker/plugin-npm-manifest": "1.0.0",
28+
"@octolinker/plugin-python": "1.0.0",
29+
"@octolinker/plugin-requirements-txt": "1.0.0",
30+
"@octolinker/plugin-ruby": "1.0.0",
31+
"@octolinker/plugin-rust": "1.0.0",
32+
"@octolinker/plugin-sass": "1.0.0",
33+
"@octolinker/plugin-typescript": "1.0.0",
34+
"@octolinker/plugin-vim": "1.0.0",
1735
"github-injection": "^1.0.1",
18-
"github-url-from-git": "^1.5.0",
19-
"github-url-from-username-repo": "^1.0.2",
20-
"giturl": "^1.0.0",
2136
"jquery": "^3.2.1",
22-
"path-parse": "^1.0.5",
23-
"querystring": "^0.2.0",
24-
"semver": "^5.4.1",
25-
"semver-regex": "^1.0.0"
37+
"querystring": "^0.2.0"
2638
}
2739
}

packages/helper-insert-link/__tests__/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { REQUIRE } from '@octolinker/helper-grammar-regex-collection';
2-
import insertLink from '../index.js';
2+
import insertLink from '../index';
33

44
describe('insert-link', () => {
55
const DEFAULT_REGEX = /foo ("\w+")/;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "@octolinker/helper-process-json",
3+
"version": "1.0.0",
4+
"description": "",
5+
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/helper-process-json",
6+
"license": "MIT",
7+
"main": "./index.js",
8+
"dependencies": {
9+
"JSONPath": "^0.11.2"
10+
}
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "@octolinker/helper-regex-builder",
3+
"version": "1.0.0",
4+
"description": "",
5+
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/helper-regex-builder",
6+
"license": "MIT",
7+
"main": "./index.js",
8+
"dependencies": {
9+
"escape-regex-string": "^1.0.4"
10+
}
11+
}

packages/helper-version/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "@octolinker/helper-version",
3+
"version": "1.0.0",
4+
"description": "",
5+
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/helper-version",
6+
"license": "MIT",
7+
"main": "./index.js",
8+
"dependencies": {
9+
"semver": "^5.4.1"
10+
}
11+
}

packages/core/plugins/bower-manifest.js renamed to packages/plugin-bower-manifest/index.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import insertLink from '@octolinker/helper-insert-link';
2-
import processJSON from './helper/process-json';
3-
import { isSemver } from './helper/version';
4-
import { javascriptFile } from './javascript';
5-
import { jsonRegExKeyValue, jsonRegExValue } from './helper/regex-builder';
6-
import liveResolverQuery from '../resolver/live-resolver-query.js';
7-
import gitUrl from '../resolver/git-url.js';
8-
import githubShorthand from '../resolver/github-shorthand.js';
2+
import processJSON from '@octolinker/helper-process-json';
3+
import { isSemver } from '@octolinker/helper-version';
4+
import { javascriptFile } from '@octolinker/plugin-javascript';
5+
import {
6+
jsonRegExKeyValue,
7+
jsonRegExValue,
8+
} from '@octolinker/helper-regex-builder';
9+
import liveResolverQuery from '@octolinker/resolver-live-query';
10+
import gitUrl from '@octolinker/resolver-git-url';
11+
import githubShorthand from '@octolinker/resolver-github-shorthand';
912

1013
function linkDependency(blob, key, value) {
1114
const isValidSemver = isSemver(value);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "@octolinker/plugin-bower-manifest",
3+
"version": "1.0.0",
4+
"description": "",
5+
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-bower-manifest",
6+
"license": "MIT",
7+
"main": "./index.js",
8+
"dependencies": {
9+
"@octolinker/helper-process-json": "1.0.0",
10+
"@octolinker/helper-version": "1.0.0",
11+
"@octolinker/plugin-javascript": "1.0.0",
12+
"@octolinker/helper-regex-builder": "1.0.0",
13+
"@octolinker/resolver-live-query": "1.0.0",
14+
"@octolinker/resolver-git-url": "1.0.0",
15+
"@octolinker/resolver-github-shorthand": "1.0.0",
16+
"@octolinker/helper-insert-link": "1.0.0"
17+
}
18+
}

packages/core/plugins/composer-manifest.js renamed to packages/plugin-composer-manifest/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import insertLink from '@octolinker/helper-insert-link';
2-
import processJSON from './helper/process-json';
3-
import { jsonRegExKeyValue } from './helper/regex-builder';
4-
import liveResolverQuery from '../resolver/live-resolver-query.js';
2+
import processJSON from '@octolinker/helper-process-json';
3+
import { jsonRegExKeyValue } from '@octolinker/helper-regex-builder';
4+
import liveResolverQuery from '@octolinker/resolver-live-query';
55

66
function linkDependency(blob, key, value) {
77
if (key === 'php') {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "@octolinker/plugin-composer-manifest",
3+
"version": "1.0.0",
4+
"description": "",
5+
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-composer-manifest",
6+
"license": "MIT",
7+
"main": "./index.js",
8+
"dependencies": {
9+
"@octolinker/helper-process-json": "1.0.0",
10+
"@octolinker/helper-regex-builder": "1.0.0",
11+
"@octolinker/resolver-live-query": "1.0.0",
12+
"@octolinker/helper-insert-link": "1.0.0"
13+
}
14+
}

packages/core/plugins/css.js renamed to packages/plugin-css/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CSS_IMPORT } from '@octolinker/helper-grammar-regex-collection';
2-
import relativeFile from '../resolver/relative-file.js';
2+
import relativeFile from '@octolinker/resolver-relative-file';
33

44
export default {
55
name: 'CSS',

packages/plugin-css/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@octolinker/plugin-css",
3+
"version": "1.0.0",
4+
"description": "",
5+
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-css",
6+
"license": "MIT",
7+
"main": "./index.js",
8+
"dependencies": {
9+
"@octolinker/resolver-relative-file": "1.0.0",
10+
"@octolinker/helper-grammar-regex-collection": "1.0.0"
11+
}
12+
}

packages/core/plugins/__tests__/docker.test.js renamed to packages/plugin-docker/__tests__/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import assert from 'assert';
2-
import dockerImage from '../docker';
2+
import dockerImage from '../index';
33

44
describe('docker-image', () => {
55
it('resolves foo to https://hub.docker.com/_/foo', () => {
File renamed without changes.

packages/plugin-docker/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "@octolinker/plugin-docker",
3+
"version": "1.0.0",
4+
"description": "",
5+
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-docker",
6+
"license": "MIT",
7+
"main": "./index.js",
8+
"dependencies": {
9+
"@octolinker/helper-grammar-regex-collection": "1.0.0"
10+
}
11+
}

packages/core/plugins/__tests__/dot-net-core.test.js renamed to packages/plugin-dot-net-core/__tests__/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import assert from 'assert';
2-
import dotNetCore from '../dot-net-core';
2+
import dotNetCore from '../index';
33

44
describe('dotNetCore', () => {
55
it('resolves Microsoft.NETCore.App to https://www.nuget.org/packages/Microsoft.NETCore.App', () => {

packages/core/plugins/dot-net-core.js renamed to packages/plugin-dot-net-core/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import insertLink from '@octolinker/helper-insert-link';
2-
import processJSON from './helper/process-json';
3-
import { jsonRegExKeyValue } from './helper/regex-builder';
4-
import nugetResolver from '../resolver/nuget';
2+
import processJSON from '@octolinker/helper-process-json';
3+
import { jsonRegExKeyValue } from '@octolinker/helper-regex-builder';
4+
import nugetResolver from '@octolinker/resolver-nuget';
55

66
function linkDependency(blob, key, value) {
77
const regex = jsonRegExKeyValue(key, value);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "@octolinker/plugin-dot-net-core",
3+
"version": "1.0.0",
4+
"description": "",
5+
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-dot-net-core",
6+
"license": "MIT",
7+
"main": "./index.js",
8+
"dependencies": {
9+
"@octolinker/helper-process-json": "1.0.0",
10+
"@octolinker/helper-regex-builder": "1.0.0",
11+
"@octolinker/resolver-nuget": "1.0.0",
12+
"@octolinker/helper-insert-link": "1.0.0"
13+
}
14+
}

packages/core/plugins/__tests__/dot-net.test.js renamed to packages/plugin-dot-net/__tests__/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import assert from 'assert';
2-
import dotNet from '../dot-net';
2+
import dotNet from '../index';
33

44
describe('dotNet', () => {
55
it('resolves EntityFramework to https://www.nuget.org/packages/EntityFramework', () => {

packages/core/plugins/dot-net.js renamed to packages/plugin-dot-net/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
NET_PACKAGE,
33
NET_PROJ_PACKAGE,
44
} from '@octolinker/helper-grammar-regex-collection';
5-
import nugetResolver from '../resolver/nuget';
5+
import nugetResolver from '@octolinker/resolver-nuget';
66

77
export default {
88
name: 'DotNet',

packages/plugin-dot-net/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@octolinker/plugin-dot-net",
3+
"version": "1.0.0",
4+
"description": "",
5+
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-dot-net",
6+
"license": "MIT",
7+
"main": "./index.js",
8+
"dependencies": {
9+
"@octolinker/resolver-nuget": "1.0.0",
10+
"@octolinker/helper-grammar-regex-collection": "1.0.0"
11+
}
12+
}

packages/core/plugins/gemfile-manifest.js renamed to packages/plugin-gemfile-manifest/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { GEM } from '@octolinker/helper-grammar-regex-collection';
2-
import liveResolverQuery from '../resolver/live-resolver-query.js';
2+
import liveResolverQuery from '@octolinker/resolver-live-query';
33

44
export default {
55
name: 'Rubygems',
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@octolinker/plugin-gemfile-manifest",
3+
"version": "1.0.0",
4+
"description": "",
5+
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-gemfile-manifest",
6+
"license": "MIT",
7+
"main": "./index.js",
8+
"dependencies": {
9+
"@octolinker/resolver-live-query": "1.0.0",
10+
"@octolinker/helper-grammar-regex-collection": "1.0.0"
11+
}
12+
}

packages/core/plugins/__tests__/go.test.js renamed to packages/plugin-go/__tests__/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import assert from 'assert';
2-
import goUniversal from '../go';
2+
import goUniversal from '../index';
33

44
describe('go-universal', () => {
55
const path = 'octo/dog.go';
File renamed without changes.

packages/plugin-go/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "@octolinker/plugin-go",
3+
"version": "1.0.0",
4+
"description": "",
5+
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-go",
6+
"license": "MIT",
7+
"main": "./index.js",
8+
"dependencies": {
9+
"@octolinker/helper-grammar-regex-collection": "1.0.0"
10+
}
11+
}

packages/core/plugins/__tests__/haskell.test.js renamed to packages/plugin-haskell/__tests__/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import assert from 'assert';
2-
import Haskell from '../haskell';
3-
import githubSearch from '../../resolver/github-search.js';
2+
import githubSearch from '@octolinker/resolver-github-search';
3+
import Haskell from '../index';
44

55
describe('haskell', () => {
66
const path = '/user/repo/blob/d6/lib/plugins/javascript.js';

packages/core/plugins/haskell.js renamed to packages/plugin-haskell/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { HASKELL_IMPORT } from '@octolinker/helper-grammar-regex-collection';
2-
import githubSearch from '../resolver/github-search.js';
2+
import githubSearch from '@octolinker/resolver-github-search';
33

44
export default {
55
name: 'Haskell',

packages/plugin-haskell/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@octolinker/plugin-haskell",
3+
"version": "1.0.0",
4+
"description": "",
5+
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-haskell",
6+
"license": "MIT",
7+
"main": "./index.js",
8+
"dependencies": {
9+
"@octolinker/resolver-github-search": "1.0.0",
10+
"@octolinker/helper-grammar-regex-collection": "1.0.0"
11+
}
12+
}

packages/core/plugins/__tests__/homebrew-manifest.test.js renamed to packages/plugin-homebrew-manifest/__tests__/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import assert from 'assert';
2-
import homebrew from '../homebrew-manifest';
2+
import homebrew from '../index';
33

44
describe('homebrew-file', () => {
55
it('resolves a dependency of a homebrew-science formula to both homebrew-science and homebrew-core', () => {

packages/core/plugins/homebrew-manifest.js renamed to packages/plugin-homebrew-manifest/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { HOMEBREW } from '@octolinker/helper-grammar-regex-collection';
2-
import Ruby from './ruby';
3-
import relativeFile from '../resolver/relative-file.js';
2+
import relativeFile from '@octolinker/resolver-relative-file';
3+
import Ruby from '@octolinker/plugin-ruby';
44

55
export default {
66
name: 'Homebrew',

0 commit comments

Comments
 (0)