Skip to content

Commit

Permalink
fix: updated engine
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 29, 2018
1 parent 032810e commit 6d396b1
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 68 deletions.
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@
"lodash": "^4.17.4"
},
"devDependencies": {
"@dxcli/command": "^0.2.0",
"@dxcli/config": "^0.1.28",
"@dxcli/dev": "^2.0.14",
"@dxcli/engine": "^0.1.13",
"@dxcli/loader": "^0.2.9",
"@dxcli/semantic-release": "^0.3.3",
"@dxcli/tslint": "^0.1.2",
"@dxcli/version": "^0.1.9",
"@dxcli/command": "^0.2.5",
"@dxcli/config": "^0.1.37",
"@dxcli/dev": "^2.0.16",
"@dxcli/engine": "^0.1.18",
"@dxcli/semantic-release": "^1.0.0",
"@dxcli/tslint": "^0.1.3",
"@dxcli/version": "^0.1.12",
"chai": "^4.1.2",
"cli-ux": "^3.3.6",
"cli-ux": "^3.3.8",
"eslint": "^4.16.0",
"husky": "^0.14.3",
"mocha": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default (event?: string, hookOpts: object = {}) => ({
if (!ctx.config) ctx.config = await loadConfig().run({} as any)
ctx.expectation = ctx.expectation || `runs ${event} hook`
const engine = new Engine()
await engine.load(ctx.config.root)
await engine.load(ctx.config)
await engine.runHook(event!, hookOpts || {})
}
})
6 changes: 2 additions & 4 deletions src/load_config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {IConfig} from '@dxcli/config'
import {load} from '@dxcli/loader'
import {IConfig, read} from '@dxcli/config'

export type WithRoot<T> = T & {root: string}

Expand All @@ -9,8 +8,7 @@ export type WithRoot<T> = T & {root: string}
export const _loadConfig = (opts: {root?: string} = {}) => {
return {
async run(ctx: {config: IConfig}) {
const {config} = await load({root: opts.root || loadConfig.root})
return ctx.config = config
return ctx.config = await read({root: opts.root || loadConfig.root})
}
}
}
Expand Down
89 changes: 35 additions & 54 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -102,38 +102,30 @@
dependencies:
find-up "^2.1.0"

"@dxcli/command@^0.1.23":
version "0.1.23"
resolved "https://registry.yarnpkg.com/@dxcli/command/-/command-0.1.23.tgz#93a77b455ca1eddafc58e7966a3127dec5be420b"
dependencies:
"@dxcli/parser" "^0.0.5"
debug "^3.1.0"
tslib "^1.9.0"

"@dxcli/command@^0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@dxcli/command/-/command-0.2.0.tgz#d076919322cd7b9f61ff2144d46eaa47f62863c0"
"@dxcli/command@^0.2.2", "@dxcli/command@^0.2.5":
version "0.2.5"
resolved "https://registry.yarnpkg.com/@dxcli/command/-/command-0.2.5.tgz#f9078fb5745f45536de0636c069174033af4a9ff"
dependencies:
"@dxcli/parser" "^0.0.5"
debug "^3.1.0"
lodash "^4.17.4"
tslib "^1.9.0"

"@dxcli/config@^0.1.28":
version "0.1.28"
resolved "https://registry.yarnpkg.com/@dxcli/config/-/config-0.1.28.tgz#76131f25b1725eba3ebf9609d4552cd5372147b8"
"@dxcli/config@^0.1.37":
version "0.1.37"
resolved "https://registry.yarnpkg.com/@dxcli/config/-/config-0.1.37.tgz#7014bd6a6d2ae83d40bfe153c06b3a3e1e35dfd2"
dependencies:
cli-ux "^3.3.8"
debug "^3.1.0"
fs-extra "^5.0.0"
load-json-file "^4.0.0"
lodash "^4.17.4"
read-pkg "^3.0.0"

"@dxcli/dev@^2.0.14":
version "2.0.14"
resolved "https://registry.yarnpkg.com/@dxcli/dev/-/dev-2.0.14.tgz#44834aa54dc60a11737e583a1716405207ab81a2"
"@dxcli/dev@^2.0.16":
version "2.0.16"
resolved "https://registry.yarnpkg.com/@dxcli/dev/-/dev-2.0.16.tgz#8d1d30fb02a02a1595d74bf464e71593228b0e93"
dependencies:
"@dxcli/nyc-config" "^0.0.4"
"@types/ansi-styles" "^2.0.30"
"@types/chai" "^4.1.2"
"@types/lodash" "^4.14.97"
Expand All @@ -144,39 +136,30 @@
"@types/read-pkg" "^3.0.0"
"@types/strip-ansi" "^3.0.0"
"@types/supports-color" "^3.1.0"
eslint-config-dxcli "^1.2.0"
eslint-config-dxcli "^1.2.1"
nyc "^11.4.1"

"@dxcli/engine@^0.1.13":
version "0.1.13"
resolved "https://registry.yarnpkg.com/@dxcli/engine/-/engine-0.1.13.tgz#46bc63407b12cedfa8a31b92b1314c25dcf37980"
dependencies:
"@dxcli/loader" "^0.2.9"
debug "^3.1.0"

"@dxcli/loader@^0.2.9":
version "0.2.9"
resolved "https://registry.yarnpkg.com/@dxcli/loader/-/loader-0.2.9.tgz#4022b2b790650efb3015961c892aa081beecb838"
"@dxcli/engine@^0.1.18":
version "0.1.18"
resolved "https://registry.yarnpkg.com/@dxcli/engine/-/engine-0.1.18.tgz#7f7ce2fea40efd50153026bd50bd739baef67c33"
dependencies:
"@dxcli/manifest-file" "^0.0.4"
"@dxcli/manifest-file" "^0.1.0"
cli-ux "^3.3.8"
debug "^3.1.0"
fs-extra "^5.0.0"
globby "^7.1.1"
lodash "^4.17.4"

"@dxcli/manifest-file@^0.0.4":
version "0.0.4"
resolved "https://registry.yarnpkg.com/@dxcli/manifest-file/-/manifest-file-0.0.4.tgz#cc5f250f9baf59083ad9cc4693af61f08cc0daf2"
"@dxcli/manifest-file@^0.1.0":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@dxcli/manifest-file/-/manifest-file-0.1.0.tgz#acfcc9708936624900e3dcee6b81a086049c2d7e"
dependencies:
debug "^3.1.0"
fs-extra "^5.0.0"
load-json-file "^4.0.0"
lodash "^4.17.4"
rwlockfile "^2.0.21"

"@dxcli/nyc-config@^0.0.4":
version "0.0.4"
resolved "https://registry.yarnpkg.com/@dxcli/nyc-config/-/nyc-config-0.0.4.tgz#bd60c089aaa6d5da34e415bab6bc527d8c35a210"

"@dxcli/parser@^0.0.5":
version "0.0.5"
resolved "https://registry.yarnpkg.com/@dxcli/parser/-/parser-0.0.5.tgz#51daf8133e8cec6ff21bfa464c4d58cd46b5ed99"
Expand All @@ -189,9 +172,9 @@
version "0.0.1"
resolved "https://registry.yarnpkg.com/@dxcli/screen/-/screen-0.0.1.tgz#9af4e8d0e5a9475e9e4b5f2da775b0447ff72fc2"

"@dxcli/semantic-release@^0.3.3":
version "0.3.3"
resolved "https://registry.yarnpkg.com/@dxcli/semantic-release/-/semantic-release-0.3.3.tgz#b3e058935a9064b51defcbc16766b346df5904f0"
"@dxcli/semantic-release@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@dxcli/semantic-release/-/semantic-release-1.0.0.tgz#383ec0bbadd361628a8b1418cfd5a7bf3d789c26"
dependencies:
"@commitlint/cli" "^6.0.2"
"@commitlint/config-conventional" "^6.0.2"
Expand All @@ -203,21 +186,19 @@
execa "^0.9.0"
semantic-release "^12.2.5"

"@dxcli/tslint@^0.1.2":
version "0.1.2"
resolved "https://registry.yarnpkg.com/@dxcli/tslint/-/tslint-0.1.2.tgz#943c36b2faef36a3ca2eed760267da0c859c89b3"
"@dxcli/tslint@^0.1.3":
version "0.1.3"
resolved "https://registry.yarnpkg.com/@dxcli/tslint/-/tslint-0.1.3.tgz#9a7334bab9fd442e8de3d8dcbec8cc1d8d13333e"
dependencies:
tslint "^5.9.1"
tslint-xo "^0.5.0"

"@dxcli/version@^0.1.9":
version "0.1.9"
resolved "https://registry.yarnpkg.com/@dxcli/version/-/version-0.1.9.tgz#89b8e5146c118709d8fb69f65ea8cc587e9a7b28"
"@dxcli/version@^0.1.12":
version "0.1.12"
resolved "https://registry.yarnpkg.com/@dxcli/version/-/version-0.1.12.tgz#1c2093ee3607170dbe61c19939aaf223fa8fae29"
dependencies:
"@dxcli/command" "^0.1.23"
"@dxcli/config" "^0.1.28"
"@dxcli/parser" "^0.0.5"
cli-ux "^3.3.6"
"@dxcli/command" "^0.2.2"
cli-ux "^3.3.8"

"@heroku/linewrap@^1.0.0":
version "1.0.0"
Expand Down Expand Up @@ -927,9 +908,9 @@ cli-table@^0.3.1:
dependencies:
colors "1.0.3"

cli-ux@^3.3.6:
version "3.3.6"
resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-3.3.6.tgz#99b8ef6965d03786d9396eb29d413a5dc14f0cef"
cli-ux@^3.3.8:
version "3.3.8"
resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-3.3.8.tgz#5df2e8731de5531aaa415dff96a4130f29aaeb01"
dependencies:
"@dxcli/screen" "^0.0.1"
"@heroku/linewrap" "^1.0.0"
Expand Down Expand Up @@ -1415,7 +1396,7 @@ eslint-ast-utils@^1.0.0:
lodash.get "^4.4.2"
lodash.zip "^4.2.0"

eslint-config-dxcli@^1.2.0:
eslint-config-dxcli@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/eslint-config-dxcli/-/eslint-config-dxcli-1.2.1.tgz#8e65ee698fa77e9485462c788fa466edffccc13d"
dependencies:
Expand Down

0 comments on commit 6d396b1

Please sign in to comment.