-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 42ed767
Showing
21 changed files
with
5,171 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
version: 2 | ||
jobs: | ||
node-latest: &test | ||
docker: | ||
- image: node:latest | ||
working_directory: ~/cli | ||
steps: | ||
- checkout | ||
- restore_cache: &restore_cache | ||
keys: | ||
- 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 | ||
path: ~/cli/reports | ||
- save_cache: &save_cache | ||
key: v0-yarn-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}} | ||
paths: | ||
- ~/cli/node_modules | ||
- /usr/local/share/.cache/yarn | ||
- /usr/local/share/.config/yarn | ||
node-8: | ||
<<: *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: .circleci/yarn | ||
- run: yarn exec nps release | ||
|
||
workflows: | ||
version: 2 | ||
"@dxcli/help": | ||
jobs: | ||
- node-latest | ||
- node-8 | ||
- release: | ||
context: org-global | ||
filters: | ||
branches: {only: master} | ||
requires: | ||
- node-latest | ||
- node-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
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.name "$GIT_USERNAME" | ||
fi | ||
|
||
git submodule sync | ||
git submodule update --init --recursive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "dxcli" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* text=auto | ||
*.js text eol=lf | ||
*.ts text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
*-debug.log | ||
*-error.log | ||
/.nyc_output | ||
/coverage | ||
/coverage.lcov | ||
/lib | ||
/node_modules | ||
/tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@dxcli/help | ||
=========== | ||
|
||
standard help for dxcli | ||
|
||
[![Version](https://img.shields.io/npm/v/@dxcli/help.svg)](https://npmjs.org/package/@dxcli/help) | ||
[![CircleCI](https://circleci.com/gh/dxcli/help/tree/master.svg?style=svg)](https://circleci.com/gh/dxcli/help/tree/master) | ||
[![Appveyor CI](https://ci.appveyor.com/api/projects/status/github/dxcli/help?branch=master&svg=true)](https://ci.appveyor.com/project/heroku/help/branch/master) | ||
[![Codecov](https://codecov.io/gh/dxcli/help/branch/master/graph/badge.svg)](https://codecov.io/gh/dxcli/help) | ||
[![Greenkeeper](https://badges.greenkeeper.io/dxcli/help.svg)](https://greenkeeper.io/) | ||
[![Known Vulnerabilities](https://snyk.io/test/npm/@dxcli/help/badge.svg)](https://snyk.io/test/npm/@dxcli/help) | ||
[![Downloads/week](https://img.shields.io/npm/dw/@dxcli/help.svg)](https://npmjs.org/package/@dxcli/help) | ||
[![License](https://img.shields.io/npm/l/@dxcli/help.svg)](https://github.com/dxcli/help/blob/master/package.json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
environment: | ||
nodejs_version: "9" | ||
cache: | ||
- '%LOCALAPPDATA%\Yarn -> appveyor.yml' | ||
- node_modules -> yarn.lock | ||
|
||
install: | ||
- ps: Install-Product node $env:nodejs_version x64 | ||
- git submodule sync | ||
- git submodule update --init --recursive | ||
- git config --global user.email "[email protected]" | ||
- git config --global user.name "dxcli" | ||
- yarn | ||
test_script: | ||
- yarn test | ||
after_test: | ||
- ps: | | ||
$env:PATH = 'C:\msys64\usr\bin;' + $env:PATH | ||
Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh | ||
bash codecov.sh | ||
build: off | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const { | ||
setColors, | ||
concurrent, | ||
crossEnv, | ||
mkdirp, | ||
series, | ||
} = require('nps-utils') | ||
|
||
setColors(['dim']) | ||
|
||
const script = (script, description) => description ? {script, description} : {script} | ||
|
||
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "@dxcli/help", | ||
"description": "standard help for dxcli", | ||
"version": "0.0.0", | ||
"author": "Jeff Dickey @jdxcode", | ||
"bugs": "https://github.com/jdxcode/help/issues", | ||
"dependencies": { | ||
"@dxcli/command": "^0.1.19", | ||
"cli-ux": "^3.2.1" | ||
}, | ||
"devDependencies": { | ||
"@dxcli/config": "^0.1.26", | ||
"@dxcli/dev": "^2.0.3", | ||
"@dxcli/dev-test": "^0.9.11", | ||
"@dxcli/engine": "^0.1.12", | ||
"husky": "^0.14.3", | ||
"nps-utils": "^1.5.0" | ||
}, | ||
"dxcli": { | ||
"commands": "./lib/commands" | ||
}, | ||
"engines": { | ||
"node": ">=8.0.0" | ||
}, | ||
"files": [ | ||
"/lib" | ||
], | ||
"homepage": "https://github.com/jdxcode/help", | ||
"keywords": [ | ||
"dxcli-plugin" | ||
], | ||
"license": "MIT", | ||
"repository": "dxcli/help", | ||
"scripts": { | ||
"commitmsg": "dxcli-dev-commitmsg", | ||
"precommit": "nps lint -l warn", | ||
"prepare": "rm -rf lib && tsc", | ||
"test": "nps test -l warn" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Command, {flags} from '@dxcli/command' | ||
import cli from 'cli-ux' | ||
|
||
export default class CLI extends Command { | ||
static flags = { | ||
name: flags.string({char: 'n', description: 'name to print'}) | ||
} | ||
|
||
async run() { | ||
const name = this.flags.name || 'world' | ||
cli.log(`hello ${name}!`) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// this file is just here to make typescript not flatten the outDir | ||
// we can't use rootDir as this doesn't allow us to use linked plugins typescript files | ||
export default {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {expect, test} from '@dxcli/dev-test' | ||
|
||
describe('command', () => { | ||
test | ||
.stdout() | ||
.command(['hello']) | ||
.it('says hello', output => { | ||
expect(output.stdout).to.contain('hello world!') | ||
}) | ||
|
||
test | ||
.stdout() | ||
.command(['hello', '--name', 'jeff']) | ||
.it('says hello jeff', output => { | ||
expect(output.stdout).to.contain('hello jeff!') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
process.env.TS_NODE_PROJECT = 'test' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--require test/helpers/init.js | ||
--require ts-node/register | ||
--require source-map-support/register | ||
--watch-extensions ts | ||
--recursive | ||
--reporter spec | ||
--timeout 5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "../tsconfig", | ||
"include": [ | ||
"./**/*", | ||
"../src/**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"compilerOptions": { | ||
"declaration": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"importHelpers": true, | ||
"module": "commonjs", | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"outDir": "./lib", | ||
"rootDirs": [ | ||
"./src" | ||
], | ||
"sourceMap": true, | ||
"strict": true, | ||
"target": "es2017" | ||
}, | ||
"include": [ | ||
"./src/**/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "@dxcli/dev-tslint" | ||
} |
Oops, something went wrong.