Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: oclif/plugin-plugins
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 38862718f982b164d9484e910c7ff62620b825a2
Choose a base ref
...
head repository: oclif/plugin-plugins
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.1.0
Choose a head ref
  • 5 commits
  • 23 files changed
  • 2 contributors

Commits on Jan 26, 2018

  1. chore(release): 0.0.1 [skip ci]

    <a name="0.0.1"></a>
    ## [0.0.1](a915cec...v0.0.1) (2018-01-26)
    
    ### Bug Fixes
    
    * added bin script and removed hook ([3886271](3886271))
    oclif-bot committed Jan 26, 2018
    Copy the full SHA
    86a46ee View commit details
  2. feat: initial implementation

    jdx committed Jan 26, 2018
    Copy the full SHA
    237b211 View commit details

Commits on Jan 27, 2018

  1. feat: initial implementation

    jdx committed Jan 27, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e7b589b View commit details
  2. test: increase timeout

    jdx committed Jan 27, 2018
    Copy the full SHA
    9d5dc97 View commit details
  3. chore(release): 0.1.0 [skip ci]

    <a name="0.1.0"></a>
    # [0.1.0](3886271...v0.1.0) (2018-01-27)
    
    ### Features
    
    * initial implementation ([e7b589b](e7b589b))
    * initial implementation ([237b211](237b211))
    oclif-bot committed Jan 27, 2018
    Copy the full SHA
    bca1771 View commit details
31 changes: 19 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -9,17 +9,17 @@ jobs:
- checkout
- restore_cache: &restore_cache
keys:
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/config.yml"}}-master-
- run: ./.circleci/setup_git
- run: ./.circleci/greenkeeper
- run: yarn exec nps ci.test
- v0-yarn-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
- v0-yarn-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-
- v0-yarn-{{checksum ".circleci/config.yml"}}-master-
- run: .circleci/setup_git
- run: .circleci/yarn
- run: yarn test
- run: curl -s https://codecov.io/bash | bash
- store_test_results:
- store_test_results: &store_test_results
path: ~/cli/reports
- save_cache: &save_cache
key: v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
key: v0-yarn-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
paths:
- ~/cli/node_modules
- /usr/local/share/.cache/yarn
@@ -28,16 +28,23 @@ jobs:
<<: *test
docker:
- image: node:8
steps:
- checkout
- restore_cache: *restore_cache
- run: .circleci/setup_git
- run: .circleci/yarn
- run: yarn test
- run: curl -s https://codecov.io/bash | bash
- store_test_results: *store_test_results
release:
<<: *test
steps:
- add_ssh_keys
- checkout
- restore_cache: *restore_cache
- run: ./.circleci/setup_git
- run: yarn --frozen-lockfile
- run: yarn exec nps ci.release
- save_cache: *save_cache
- run: .circleci/setup_git
- run: .circleci/yarn
- run: yarn exec nps release

workflows:
version: 2
2 changes: 1 addition & 1 deletion .circleci/setup_git
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ set -e
if [[ ! -z "$GIT_EMAIL" ]] & [[ ! -z "$GIT_USERNAME" ]]; then
git config --global push.default simple
git config --global user.email "$GIT_EMAIL"
git config --global user.user "$GIT_USERNAME"
git config --global user.name "$GIT_USERNAME"
fi

git submodule sync
22 changes: 22 additions & 0 deletions .circleci/yarn
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -e

PATH=/usr/local/share/.config/yarn/global/node_modules/.bin:$PATH

CLI_ENGINE_UTIL_YARN_ARGS="--frozen-lockfile"

if [[ "$CIRCLE_BRANCH" == greenkeeper/* ]]; then
CLI_ENGINE_GREENKEEPER_BRANCH=1
CLI_ENGINE_UTIL_YARN_ARGS=""
if [[ ! -x "$(command -v greenkeeper-lockfile-update)" ]]; then
yarn global add greenkeeper-lockfile@1
fi
greenkeeper-lockfile-update
fi

yarn install $CLI_ENGINE_UTIL_YARN_ARGS

if [[ "$CLI_ENGINE_GREENKEEPER_BRANCH" == 1 ]]; then
greenkeeper-lockfile-upload
fi
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<a name="0.1.0"></a>
# [0.1.0](https://github.com/dxcli/plugins/compare/38862718f982b164d9484e910c7ff62620b825a2...v0.1.0) (2018-01-27)


### Features

* initial implementation ([e7b589b](https://github.com/dxcli/plugins/commit/e7b589b))
* initial implementation ([237b211](https://github.com/dxcli/plugins/commit/237b211))

<a name="0.0.1"></a>
## [0.0.1](https://github.com/dxcli/plugins/compare/a915cecb0403e249296572f80ca34fe612634669...v0.0.1) (2018-01-26)


### Bug Fixes

* added bin script and removed hook ([3886271](https://github.com/dxcli/plugins/commit/3886271))
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ install:
- git config --global user.name "dxcli"
- yarn
test_script:
- .\node_modules\.bin\nps ci.test
- yarn test
after_test:
- ps: |
$env:PATH = 'C:\msys64\usr\bin;' + $env:PATH
2 changes: 0 additions & 2 deletions bin/run
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env node

/* eslint-disable no-unpublished-require */

const undefault = m => m.__esModule === true ? m.default : m

const fs = require('fs')
114 changes: 33 additions & 81 deletions package-scripts.js
Original file line number Diff line number Diff line change
@@ -1,92 +1,44 @@
const {
setColors,
concurrent,
crossEnv,
ifNotWindows,
ifWindows,
mkdirp,
series,
setColors,
} = require('nps-utils')
const pjson = require('./package.json')
const release = pjson.devDependencies.typedoc ? ['ci.release.semantic-release', 'ci.release.typedoc'] : ['ci.release.semantic-release']
const script = (script, description) => description ? {script, description} : {script}
const hidden = script => ({script, hiddenFromHelp: true})
const unixOrWindows = (unix, windows) => series(ifNotWindows(unix), ifWindows(windows))

setColors(['dim'])

let ciTests = [
'ci.test.eslint',
'ci.test.mocha',
'ci.test.tslint',
]
const script = (script, description) => description ? {script, description} : {script}

module.exports = {
scripts: {
build: 'rm -rf lib && tsc',
lint: {
default: concurrent.nps('lint.eslint', 'lint.commitlint', 'lint.tsc', 'lint.tslint'),
eslint: script('eslint .', 'lint js files'),
commitlint: script('commitlint --from origin/master', 'ensure that commits are in valid conventional-changelog format'),
tsc: script('tsc -p test --noEmit', 'syntax check with tsc'),
tslint: script('tslint -p test', 'lint ts files'),
},
test: {
default: script(concurrent.nps('lint', 'test.mocha'), 'lint and run all tests'),
series: script(series.nps('lint', 'test.mocha'), 'lint and run all tests in series'),
mocha: {
default: script('mocha --forbid-only "test/**/*.test.ts"', 'run all mocha tests'),
coverage: {
default: hidden(series.nps('test.mocha.nyc nps test.mocha', 'test.mocha.coverage.report')),
report: hidden(series('nps "test.mocha.nyc report --reporter text-lcov" > coverage.lcov')),
},
junit: hidden(series(
crossEnv('MOCHA_FILE="reports/mocha.xml" ') + series.nps('test.mocha.nyc nps \\"test.mocha --reporter mocha-junit-reporter\\"'),
series.nps('test.mocha.coverage.report'),
)),
nyc: hidden('nyc --nycrc-path node_modules/@dxcli/dev-nyc-config/.nycrc'),
},
},
ci: {
test: {
default: hidden(series(
mkdirp('reports'),
unixOrWindows(
concurrent.nps(...ciTests),
series.nps(...ciTests),
),
)),
mocha: hidden(
unixOrWindows(
series.nps('test.mocha.junit'),
series.nps('test.mocha.coverage'),
)
),
eslint: hidden(
unixOrWindows(
series.nps('lint.eslint --format junit --output-file reports/eslint.xml'),
series.nps('lint.eslint'),
)
),
tslint: hidden(
unixOrWindows(
series.nps('lint.tslint --format junit > reports/tslint.xml'),
series.nps('lint.tslint'),
)
),
},
typedoc: hidden('typedoc --out /tmp/docs src/index.ts --excludeNotExported --mode file'),
release: {
default: hidden(series.nps(...release)),
'semantic-release': hidden('semantic-release -e @dxcli/dev-semantic-release'),
typedoc: hidden(series(
'git clone -b gh-pages $CIRCLE_REPOSITORY_URL gh-pages',
'nps ci.typedoc',
'rm -rf ./gh-pages/*',
'mv /tmp/docs/* ./gh-pages',
'cd gh-pages && git add . && git commit -m "updates from $CIRCLE_SHA1 [skip ci]" && git push',
)),
},
},
},
const linters = {
eslint: script('eslint .', 'lint js files'),
commitlint: script('commitlint --from origin/master', 'ensure that commits are in valid conventional-changelog format'),
tsc: script('tsc -p test --noEmit', 'syntax check with tsc'),
tslint: script('tslint -p test', 'lint ts files'),
}

const scripts = {
...linters,
lint: concurrent(linters),
test: script(concurrent.nps(...Object.keys(linters), 'mocha'), 'lint and run all tests'),
mocha: script('mocha --forbid-only "test/**/*.test.ts"', 'run all mocha tests'),
}

if (process.env.CI) {
if (process.env.CIRCLECI) {
scripts.test.script = series(mkdirp('reports'), scripts.test.script)
// add mocha junit reporter
scripts.mocha.script = crossEnv(`MOCHA_FILE=reports/mocha.xml ${scripts.mocha.script} --reporter mocha-junit-reporter`)
// add eslint reporter
scripts.eslint.script = `${scripts.eslint.script} --format junit --output-file reports/eslint.xml`
// add tslint reporter
scripts.tslint.script = `${scripts.tslint.script} --format junit > reports/tslint.xml`
scripts.release = 'semantic-release -e @dxcli/dev-semantic-release'
}
// add code coverage reporting with nyc
const nyc = 'nyc --nycrc-path node_modules/@dxcli/dev-nyc-config/.nycrc'
const nycReport = `${nyc} report --reporter text-lcov > coverage.lcov`
scripts.mocha.script = series(`${nyc} ${scripts.mocha.script}`, nycReport)
}

module.exports = {scripts}
51 changes: 23 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,37 @@
{
"name": "@dxcli/plugins",
"description": "plugins plugin for dxcli",
"version": "0.0.0",
"version": "0.1.0",
"author": "Jeff Dickey @jdxcode",
"bugs": "https://github.com/jdxcode/plugins/issues",
"dependencies": {
"@dxcli/command": "^0.1.16",
"cli-ux": "^3.1.5"
"@dxcli/command": "^0.1.19",
"@dxcli/config": "^0.1.26",
"@dxcli/loader": "^0.2.5",
"@dxcli/manifest-file": "^0.0.4",
"@heroku-cli/color": "^1.1.1",
"cli-ux": "^3.2.1",
"debug": "^3.1.0",
"fs-extra": "^5.0.0",
"lodash": "^4.17.4",
"npm-run-path": "^2.0.2",
"tslib": "^1.9.0",
"yarn": "^1.3.2"
},
"devDependencies": {
"@dxcli/config": "^0.1.24",
"@dxcli/dev-nyc-config": "^0.0.3",
"@dxcli/dev-semantic-release": "^0.1.0",
"@dxcli/dev-test": "^0.9.4",
"@dxcli/dev-tslint": "^0.0.15",
"@dxcli/engine": "^0.1.7",
"@types/ansi-styles": "^2.0.30",
"@types/chai": "^4.1.2",
"@types/lodash": "^4.14.96",
"@types/mocha": "^2.2.47",
"@types/nock": "^9.1.2",
"@types/node": "^9.3.0",
"@types/read-pkg": "^3.0.0",
"@types/strip-ansi": "^3.0.0",
"@dxcli/dev": "^2.0.4",
"@dxcli/dev-test": "^0.9.12",
"@dxcli/engine": "^0.1.12",
"@types/fs-extra": "^5.0.0",
"chai": "^4.1.2",
"eslint": "^4.16.0",
"eslint-config-dxcli": "^1.1.4",
"husky": "^0.14.3",
"mocha": "^5.0.0",
"mocha-junit-reporter": "^1.17.0",
"nps": "^5.7.1",
"nps-utils": "^1.5.0",
"nyc": "^11.4.1",
"ts-node": "^4.1.0",
"typescript": "^2.6.2"
"nps-utils": "^1.5.0"
},
"dxcli": {
"commands": "./lib/commands"
"commands": "./lib/commands",
"plugins": "./lib/load"
},
"engines": {
"node": ">=8.0.0"
@@ -52,8 +47,8 @@
"repository": "dxcli/plugins",
"scripts": {
"commitmsg": "dxcli-dev-commitmsg",
"precommit": "nps lint",
"prepare": "nps build",
"test": "nps test"
"precommit": "nps lint -l warn",
"prepare": "rm -rf lib && tsc",
"test": "nps test -l warn"
}
}
13 changes: 0 additions & 13 deletions src/commands/hello.ts

This file was deleted.

48 changes: 48 additions & 0 deletions src/commands/plugins/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import Command, {flags} from '@dxcli/command'
import color from '@heroku-cli/color'
import cli from 'cli-ux'
import * as _ from 'lodash'

let examplePlugins = {
'heroku-ci': {version: '1.8.0'},
'heroku-cli-status': {version: '3.0.10', type: 'link'},
'heroku-fork': {version: '4.1.22'},
}
let bin = 'heroku'
const g = global as any
if (g.config) {
bin = g.config.bin
let pjson = g.config.pjson['cli-engine']
if (pjson.help && pjson.help.plugins) {
examplePlugins = pjson.help.plugins
}
}
const examplePluginsHelp = Object.entries(examplePlugins).map(([name, p]: [string, any]) => ` ${name} ${p.version}`)

export default class Plugins extends Command {
static flags: flags.Input = {
core: flags.boolean({description: 'show core plugins'})
}
static description = 'list installed plugins'
static help = `Example:
$ ${bin} plugins
${examplePluginsHelp.join('\n')}
`

async run() {
let plugins = this.config.engine!.plugins
plugins = plugins.filter(p => p.type !== 'builtin' && p.type !== 'main')
_.sortBy(plugins, 'name')
if (!this.flags.core) plugins = plugins.filter(p => p.type !== 'core')
if (!plugins.length) {
cli.info('no plugins installed')
}
for (let plugin of plugins) {
let output = `${plugin.name} ${color.dim(plugin.version)}`
if (plugin.type !== 'user') output += color.dim(` (${plugin.type})`)
if (plugin.type === 'link') output += ` ${plugin.root}`
else if (plugin.tag !== 'latest') output += color.dim(` (${String(plugin.tag)})`)
cli.log(output)
}
}
}
Loading