Skip to content

Commit

Permalink
Continue mono repo work for plugins and resolvers (OctoLinker#441)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
stefanbuck authored Feb 3, 2018
1 parent 9fda080 commit b175d59
Show file tree
Hide file tree
Showing 84 changed files with 508 additions and 99 deletions.
48 changes: 25 additions & 23 deletions packages/core/load-plugins.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
export { default as BowerManifest } from './plugins/bower-manifest.js';
export { default as Composer } from './plugins/composer-manifest.js';
export { default as CSS } from './plugins/css.js';
export { default as Docker } from './plugins/docker.js';
export { default as DotNetCore } from './plugins/dot-net-core.js';
export { default as DotNet } from './plugins/dot-net.js';
export { default as Rubygems } from './plugins/gemfile-manifest.js';
export { default as Go } from './plugins/go.js';
export { default as Haskell } from './plugins/haskell.js';
export { default as Homebrew } from './plugins/homebrew-manifest.js';
export { default as HTML } from './plugins/html.js';
export { default as Java } from './plugins/java.js';
export { default as JavaScript } from './plugins/javascript.js';
export { default as Less } from './plugins/less.js';
export { default as BowerManifest } from '@octolinker/plugin-bower-manifest';
export { default as Composer } from '@octolinker/plugin-composer-manifest';
export { default as CSS } from '@octolinker/plugin-css';
export { default as Docker } from '@octolinker/plugin-docker';
export { default as DotNetCore } from '@octolinker/plugin-dot-net-core';
export { default as DotNet } from '@octolinker/plugin-dot-net';
export { default as Rubygems } from '@octolinker/plugin-gemfile-manifest';
export { default as Go } from '@octolinker/plugin-go';
export { default as Haskell } from '@octolinker/plugin-haskell';
export { default as Homebrew } from '@octolinker/plugin-homebrew-manifest';
export { default as HTML } from '@octolinker/plugin-html';
export { default as Java } from '@octolinker/plugin-java';
export { default as JavaScript } from '@octolinker/plugin-javascript';
export { default as Less } from '@octolinker/plugin-less';
export {
default as NodejsRelativePath,
} from './plugins/nodejs-relative-path.js';
export { default as NpmManifest } from './plugins/npm-manifest.js';
export { default as Python } from './plugins/python.js';
export { default as RequirementsTxt } from './plugins/requirements-txt.js';
export { default as Ruby } from './plugins/ruby.js';
export { default as Rust } from './plugins/rust.js';
export { default as Sass } from './plugins/sass.js';
export { default as TypeScript } from './plugins/typescript.js';
export { default as Vim } from './plugins/vim.js';
} from '@octolinker/plugin-nodejs-relative-path';
export { default as NpmManifest } from '@octolinker/plugin-npm-manifest';
export { default as Python } from '@octolinker/plugin-python';
export {
default as RequirementsTxt,
} from '@octolinker/plugin-requirements-txt';
export { default as Ruby } from '@octolinker/plugin-ruby';
export { default as Rust } from '@octolinker/plugin-rust';
export { default as Sass } from '@octolinker/plugin-sass';
export { default as TypeScript } from '@octolinker/plugin-typescript';
export { default as Vim } from '@octolinker/plugin-vim';
38 changes: 25 additions & 13 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,33 @@
"main": "./index.js",
"dependencies": {
"@octolinker/blob-reader": "1.0.0",
"@octolinker/helper-grammar-regex-collection": "1.0.0",
"@octolinker/helper-insert-link": "1.0.0",
"@octolinker/helper-settings": "1.0.0",
"JSONPath": "^0.11.2",
"builtins": "^1.0.3",
"concat-map": "^0.0.1",
"escape-regex-string": "^1.0.4",
"@octolinker/helper-insert-link": "1.0.0",
"@octolinker/plugin-bower-manifest": "1.0.0",
"@octolinker/plugin-composer-manifest": "1.0.0",
"@octolinker/plugin-css": "1.0.0",
"@octolinker/plugin-docker": "1.0.0",
"@octolinker/plugin-dot-net-core": "1.0.0",
"@octolinker/plugin-dot-net": "1.0.0",
"@octolinker/plugin-gemfile-manifest": "1.0.0",
"@octolinker/plugin-go": "1.0.0",
"@octolinker/plugin-haskell": "1.0.0",
"@octolinker/plugin-homebrew-manifest": "1.0.0",
"@octolinker/plugin-html": "1.0.0",
"@octolinker/plugin-java": "1.0.0",
"@octolinker/plugin-javascript": "1.0.0",
"@octolinker/plugin-less": "1.0.0",
"@octolinker/plugin-nodejs-relative-path": "1.0.0",
"@octolinker/plugin-npm-manifest": "1.0.0",
"@octolinker/plugin-python": "1.0.0",
"@octolinker/plugin-requirements-txt": "1.0.0",
"@octolinker/plugin-ruby": "1.0.0",
"@octolinker/plugin-rust": "1.0.0",
"@octolinker/plugin-sass": "1.0.0",
"@octolinker/plugin-typescript": "1.0.0",
"@octolinker/plugin-vim": "1.0.0",
"github-injection": "^1.0.1",
"github-url-from-git": "^1.5.0",
"github-url-from-username-repo": "^1.0.2",
"giturl": "^1.0.0",
"jquery": "^3.2.1",
"path-parse": "^1.0.5",
"querystring": "^0.2.0",
"semver": "^5.4.1",
"semver-regex": "^1.0.0"
"querystring": "^0.2.0"
}
}
2 changes: 1 addition & 1 deletion packages/helper-insert-link/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { REQUIRE } from '@octolinker/helper-grammar-regex-collection';
import insertLink from '../index.js';
import insertLink from '../index';

describe('insert-link', () => {
const DEFAULT_REGEX = /foo ("\w+")/;
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions packages/helper-process-json/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@octolinker/helper-process-json",
"version": "1.0.0",
"description": "",
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/helper-process-json",
"license": "MIT",
"main": "./index.js",
"dependencies": {
"JSONPath": "^0.11.2"
}
}
File renamed without changes.
11 changes: 11 additions & 0 deletions packages/helper-regex-builder/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@octolinker/helper-regex-builder",
"version": "1.0.0",
"description": "",
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/helper-regex-builder",
"license": "MIT",
"main": "./index.js",
"dependencies": {
"escape-regex-string": "^1.0.4"
}
}
File renamed without changes.
11 changes: 11 additions & 0 deletions packages/helper-version/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@octolinker/helper-version",
"version": "1.0.0",
"description": "",
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/helper-version",
"license": "MIT",
"main": "./index.js",
"dependencies": {
"semver": "^5.4.1"
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import insertLink from '@octolinker/helper-insert-link';
import processJSON from './helper/process-json';
import { isSemver } from './helper/version';
import { javascriptFile } from './javascript';
import { jsonRegExKeyValue, jsonRegExValue } from './helper/regex-builder';
import liveResolverQuery from '../resolver/live-resolver-query.js';
import gitUrl from '../resolver/git-url.js';
import githubShorthand from '../resolver/github-shorthand.js';
import processJSON from '@octolinker/helper-process-json';
import { isSemver } from '@octolinker/helper-version';
import { javascriptFile } from '@octolinker/plugin-javascript';
import {
jsonRegExKeyValue,
jsonRegExValue,
} from '@octolinker/helper-regex-builder';
import liveResolverQuery from '@octolinker/resolver-live-query';
import gitUrl from '@octolinker/resolver-git-url';
import githubShorthand from '@octolinker/resolver-github-shorthand';

function linkDependency(blob, key, value) {
const isValidSemver = isSemver(value);
Expand Down
18 changes: 18 additions & 0 deletions packages/plugin-bower-manifest/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@octolinker/plugin-bower-manifest",
"version": "1.0.0",
"description": "",
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-bower-manifest",
"license": "MIT",
"main": "./index.js",
"dependencies": {
"@octolinker/helper-process-json": "1.0.0",
"@octolinker/helper-version": "1.0.0",
"@octolinker/plugin-javascript": "1.0.0",
"@octolinker/helper-regex-builder": "1.0.0",
"@octolinker/resolver-live-query": "1.0.0",
"@octolinker/resolver-git-url": "1.0.0",
"@octolinker/resolver-github-shorthand": "1.0.0",
"@octolinker/helper-insert-link": "1.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import insertLink from '@octolinker/helper-insert-link';
import processJSON from './helper/process-json';
import { jsonRegExKeyValue } from './helper/regex-builder';
import liveResolverQuery from '../resolver/live-resolver-query.js';
import processJSON from '@octolinker/helper-process-json';
import { jsonRegExKeyValue } from '@octolinker/helper-regex-builder';
import liveResolverQuery from '@octolinker/resolver-live-query';

function linkDependency(blob, key, value) {
if (key === 'php') {
Expand Down
14 changes: 14 additions & 0 deletions packages/plugin-composer-manifest/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@octolinker/plugin-composer-manifest",
"version": "1.0.0",
"description": "",
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-composer-manifest",
"license": "MIT",
"main": "./index.js",
"dependencies": {
"@octolinker/helper-process-json": "1.0.0",
"@octolinker/helper-regex-builder": "1.0.0",
"@octolinker/resolver-live-query": "1.0.0",
"@octolinker/helper-insert-link": "1.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CSS_IMPORT } from '@octolinker/helper-grammar-regex-collection';
import relativeFile from '../resolver/relative-file.js';
import relativeFile from '@octolinker/resolver-relative-file';

export default {
name: 'CSS',
Expand Down
12 changes: 12 additions & 0 deletions packages/plugin-css/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@octolinker/plugin-css",
"version": "1.0.0",
"description": "",
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-css",
"license": "MIT",
"main": "./index.js",
"dependencies": {
"@octolinker/resolver-relative-file": "1.0.0",
"@octolinker/helper-grammar-regex-collection": "1.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'assert';
import dockerImage from '../docker';
import dockerImage from '../index';

describe('docker-image', () => {
it('resolves foo to https://hub.docker.com/_/foo', () => {
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions packages/plugin-docker/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@octolinker/plugin-docker",
"version": "1.0.0",
"description": "",
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-docker",
"license": "MIT",
"main": "./index.js",
"dependencies": {
"@octolinker/helper-grammar-regex-collection": "1.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'assert';
import dotNetCore from '../dot-net-core';
import dotNetCore from '../index';

describe('dotNetCore', () => {
it('resolves Microsoft.NETCore.App to https://www.nuget.org/packages/Microsoft.NETCore.App', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import insertLink from '@octolinker/helper-insert-link';
import processJSON from './helper/process-json';
import { jsonRegExKeyValue } from './helper/regex-builder';
import nugetResolver from '../resolver/nuget';
import processJSON from '@octolinker/helper-process-json';
import { jsonRegExKeyValue } from '@octolinker/helper-regex-builder';
import nugetResolver from '@octolinker/resolver-nuget';

function linkDependency(blob, key, value) {
const regex = jsonRegExKeyValue(key, value);
Expand Down
14 changes: 14 additions & 0 deletions packages/plugin-dot-net-core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@octolinker/plugin-dot-net-core",
"version": "1.0.0",
"description": "",
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-dot-net-core",
"license": "MIT",
"main": "./index.js",
"dependencies": {
"@octolinker/helper-process-json": "1.0.0",
"@octolinker/helper-regex-builder": "1.0.0",
"@octolinker/resolver-nuget": "1.0.0",
"@octolinker/helper-insert-link": "1.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'assert';
import dotNet from '../dot-net';
import dotNet from '../index';

describe('dotNet', () => {
it('resolves EntityFramework to https://www.nuget.org/packages/EntityFramework', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
NET_PACKAGE,
NET_PROJ_PACKAGE,
} from '@octolinker/helper-grammar-regex-collection';
import nugetResolver from '../resolver/nuget';
import nugetResolver from '@octolinker/resolver-nuget';

export default {
name: 'DotNet',
Expand Down
12 changes: 12 additions & 0 deletions packages/plugin-dot-net/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@octolinker/plugin-dot-net",
"version": "1.0.0",
"description": "",
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-dot-net",
"license": "MIT",
"main": "./index.js",
"dependencies": {
"@octolinker/resolver-nuget": "1.0.0",
"@octolinker/helper-grammar-regex-collection": "1.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GEM } from '@octolinker/helper-grammar-regex-collection';
import liveResolverQuery from '../resolver/live-resolver-query.js';
import liveResolverQuery from '@octolinker/resolver-live-query';

export default {
name: 'Rubygems',
Expand Down
12 changes: 12 additions & 0 deletions packages/plugin-gemfile-manifest/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@octolinker/plugin-gemfile-manifest",
"version": "1.0.0",
"description": "",
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-gemfile-manifest",
"license": "MIT",
"main": "./index.js",
"dependencies": {
"@octolinker/resolver-live-query": "1.0.0",
"@octolinker/helper-grammar-regex-collection": "1.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'assert';
import goUniversal from '../go';
import goUniversal from '../index';

describe('go-universal', () => {
const path = 'octo/dog.go';
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions packages/plugin-go/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@octolinker/plugin-go",
"version": "1.0.0",
"description": "",
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-go",
"license": "MIT",
"main": "./index.js",
"dependencies": {
"@octolinker/helper-grammar-regex-collection": "1.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'assert';
import Haskell from '../haskell';
import githubSearch from '../../resolver/github-search.js';
import githubSearch from '@octolinker/resolver-github-search';
import Haskell from '../index';

describe('haskell', () => {
const path = '/user/repo/blob/d6/lib/plugins/javascript.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HASKELL_IMPORT } from '@octolinker/helper-grammar-regex-collection';
import githubSearch from '../resolver/github-search.js';
import githubSearch from '@octolinker/resolver-github-search';

export default {
name: 'Haskell',
Expand Down
12 changes: 12 additions & 0 deletions packages/plugin-haskell/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@octolinker/plugin-haskell",
"version": "1.0.0",
"description": "",
"repository": "https://github.com/octolinker/octolinker/tree/master/packages/plugin-haskell",
"license": "MIT",
"main": "./index.js",
"dependencies": {
"@octolinker/resolver-github-search": "1.0.0",
"@octolinker/helper-grammar-regex-collection": "1.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'assert';
import homebrew from '../homebrew-manifest';
import homebrew from '../index';

describe('homebrew-file', () => {
it('resolves a dependency of a homebrew-science formula to both homebrew-science and homebrew-core', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HOMEBREW } from '@octolinker/helper-grammar-regex-collection';
import Ruby from './ruby';
import relativeFile from '../resolver/relative-file.js';
import relativeFile from '@octolinker/resolver-relative-file';
import Ruby from '@octolinker/plugin-ruby';

export default {
name: 'Homebrew',
Expand Down
Loading

0 comments on commit b175d59

Please sign in to comment.