Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Commit

Permalink
chore: ran generator
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 26, 2018
1 parent 3ba8a46 commit 5b368de
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 101 deletions.
17 changes: 11 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ jobs:
- checkout
- restore_cache: &restore_cache
keys:
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/test"}}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/test"}}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/test"}}-{{checksum ".circleci/config.yml"}}-master-
- run: ./.circleci/test
- 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
- run: curl -s https://codecov.io/bash | bash
- store_test_results:
path: ~/cli/reports
- save_cache: &save_cache
key: v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/test"}}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
key: v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
paths:
- ~/cli/node_modules
- /usr/local/share/.cache/yarn
Expand All @@ -28,10 +31,12 @@ jobs:
release:
<<: *test
steps:
- add_ssh_keys
- checkout
- restore_cache: *restore_cache
- run: ./.circleci/setup_git
- run: yarn --frozen-lockfile
- run: ./node_modules/.bin/nps ci.release
- run: yarn exec nps ci.release
- save_cache: *save_cache

workflows:
Expand Down
15 changes: 1 addition & 14 deletions .circleci/test → .circleci/greenkeeper
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
#!/usr/bin/env bash

set -ex
set -e

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

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"
fi

git submodule sync
git submodule update --init --recursive

CLI_ENGINE_UTIL_YARN_ARGS="--frozen-lockfile"

if [[ "$CIRCLE_BRANCH" == greenkeeper/* ]]; then
Expand All @@ -29,7 +20,3 @@ yarn install $CLI_ENGINE_UTIL_YARN_ARGS
if [[ "$CLI_ENGINE_GREENKEEPER_BRANCH" == 1 ]]; then
greenkeeper-lockfile-upload
fi

mkdir -p reports
./node_modules/.bin/nps ci
curl -s https://codecov.io/bash | bash
12 changes: 12 additions & 0 deletions .circleci/setup_git
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.user "$GIT_USERNAME"
fi

git submodule sync
git submodule update --init --recursive
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ install:
- git config --global user.name "dxcli"
- yarn
test_script:
- yarn test
- .\node_modules\.bin\nps ci.test
after_test:
- ps: |
$env:PATH = 'C:\msys64\usr\bin;' + $env:PATH
Expand Down
130 changes: 73 additions & 57 deletions package-scripts.js
Original file line number Diff line number Diff line change
@@ -1,75 +1,91 @@
const {concurrent, series} = require('nps-utils')
const {
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',
]

module.exports = {
scripts: {
build: 'rm -rf lib && tsc',
lint: {
default: concurrent.nps('lint.eslint', 'lint.commitlint', 'lint.tsc', 'lint.tslint'),
eslint: {
script: 'eslint .',
description: 'lint js files',
},
commitlint: {
script: 'commitlint --from origin/master',
description: 'ensure that commits are in valid conventional-changelog format',
},
tsc: {
script: 'tsc -p test --noEmit',
description: 'syntax check with tsc',
},
tslint: {
script: 'tslint -p test',
description: 'lint ts files',
},
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'),
description: 'lint and run all tests',
},
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: {
script: 'mocha "test/**/*.test.ts"',
description: 'run all mocha tests',
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: {
default: {
script: concurrent.nps(
'ci.mocha',
'ci.eslint',
'ci.tslint',
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'),
)
),
hiddenFromHelp: true,
},
mocha: {
default: {
script: series.nps('ci.mocha.test', 'ci.mocha.report'),
hiddenFromHelp: true,
},
test: {
script: 'MOCHA_FILE="reports/mocha.xml" nps "ci.mocha.nyc nps \\"test.mocha --reporter mocha-junit-reporter\\""',
hiddenFromHelp: true,
},
report: {
script: series.nps('ci.mocha.nyc report --reporter text-lcov > coverage.lcov'),
hiddenFromHelp: true,
},
nyc: {
script: 'nyc --nycrc-path node_modules/@dxcli/dev-nyc-config/.nycrc',
hiddenFromHelp: true,
},
},
eslint: {
script: series.nps('lint.eslint --format junit --output-file reports/eslint.xml'),
hiddenFromHelp: true,
},
tslint: {
script: series.nps('lint.tslint --format junit > reports/tslint.xml'),
hiddenFromHelp: true,
},
typedoc: hidden('typedoc --out /tmp/docs src/index.ts --excludeNotExported --mode file'),
release: {
script: 'dxcli-dev-semantic-release',
hiddenFromHelp: true,
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',
)),
},
},
},
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@
"devDependencies": {
"@dxcli/dev-nyc-config": "^0.0.3",
"@dxcli/dev-semantic-release": "^0.1.0",
"@dxcli/dev-tslint": "^0.0.15",
"@dxcli/dev-tslint": "^0.0.16",
"@types/ansi-styles": "^2.0.30",
"@types/chai": "^4.1.2",
"@types/fs-extra": "^5.0.0",
"@types/lodash": "^4.14.96",
"@types/mocha": "^2.2.47",
"@types/nock": "^9.1.2",
"@types/node": "^9.3.0",
"@types/node": "^9.4.0",
"@types/semver": "^5.4.0",
"@types/strip-ansi": "^3.0.0",
"@types/supports-color": "^3.1.0",
"chai": "^4.1.2",
"eslint": "^4.16.0",
"eslint-config-dxcli": "^1.1.4",
"fancy-mocha": "^0.3.2",
"fancy-mocha": "^0.3.3",
"husky": "^0.14.3",
"mocha": "^5.0.0",
"mocha-junit-reporter": "^1.16.0",
"mocha-junit-reporter": "^1.17.0",
"nps": "^5.7.1",
"nps-utils": "^1.5.0",
"nyc": "^11.4.1",
Expand Down
7 changes: 2 additions & 5 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"extends": "../tsconfig",
"compilerOptions": {
"rootDir": ".."
},
"include": [
"../src/**/*",
"../test/**/*"
"./**/*",
"../src/**/*"
]
}
10 changes: 6 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"compilerOptions": {
"declaration": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"module": "commonjs",
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "./lib",
"rootDir": "./src",
"strict": true,
"strictFunctionTypes": false,
"rootDirs": [
"./src"
],
"sourceMap": true,
"strict": true,
"target": "es2017"
},
"include": [
"src/**/*"
"./src/**/*"
]
}
25 changes: 15 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@
"@semantic-release/npm" "^2.6.4"
semantic-release "^12.2.2"

"@dxcli/dev-tslint@^0.0.15":
version "0.0.15"
resolved "https://registry.yarnpkg.com/@dxcli/dev-tslint/-/dev-tslint-0.0.15.tgz#54dbd49deccaaaf9dc590d83894415e3fab0b0ac"
"@dxcli/dev-tslint@^0.0.16":
version "0.0.16"
resolved "https://registry.yarnpkg.com/@dxcli/dev-tslint/-/dev-tslint-0.0.16.tgz#84aa077d5f0c92f770b2b7eb091588c8553b4c9f"
dependencies:
tslint "^5.9.1"
tslint-xo "^0.5.0"
Expand Down Expand Up @@ -273,10 +273,14 @@
dependencies:
"@types/node" "*"

"@types/node@*", "@types/node@^9.3.0":
"@types/node@*":
version "9.3.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.3.0.tgz#3a129cda7c4e5df2409702626892cb4b96546dd5"

"@types/node@^9.4.0":
version "9.4.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.4.0.tgz#b85a0bcf1e1cc84eb4901b7e96966aedc6f078d1"

"@types/semver@^5.4.0":
version "5.4.0"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.4.0.tgz#f3658535af7f1f502acd6da7daf405ffeb1f7ee4"
Expand Down Expand Up @@ -1618,9 +1622,9 @@ extsprintf@^1.2.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"

fancy-mocha@^0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/fancy-mocha/-/fancy-mocha-0.3.2.tgz#4bcc8dc4f323224ce0733bd1a093d8c485852406"
fancy-mocha@^0.3.3:
version "0.3.3"
resolved "https://registry.yarnpkg.com/fancy-mocha/-/fancy-mocha-0.3.3.tgz#414359b859e84cb8d25a9183d02fc52c03d43403"
dependencies:
lodash "^4.17.4"
stdout-stderr "^0.1.4"
Expand Down Expand Up @@ -2947,13 +2951,14 @@ [email protected], mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1:
dependencies:
minimist "0.0.8"

mocha-junit-reporter@^1.16.0:
version "1.16.0"
resolved "https://registry.yarnpkg.com/mocha-junit-reporter/-/mocha-junit-reporter-1.16.0.tgz#3d76af53e2f5e81f9b93406acee1e48b5dd6e6cc"
mocha-junit-reporter@^1.17.0:
version "1.17.0"
resolved "https://registry.yarnpkg.com/mocha-junit-reporter/-/mocha-junit-reporter-1.17.0.tgz#2e5149ed40fc5d2e3ca71e42db5ab1fec9c6d85c"
dependencies:
debug "^2.2.0"
md5 "^2.1.0"
mkdirp "~0.5.1"
strip-ansi "^4.0.0"
xml "^1.0.0"

mocha@^5.0.0:
Expand Down

0 comments on commit 5b368de

Please sign in to comment.