Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
fix: ran generator
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 28, 2018
1 parent 6495736 commit 22193c7
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 378 deletions.
2 changes: 1 addition & 1 deletion .circleci/setup_git
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -e
set -ex

if [[ ! -z "$GIT_EMAIL" ]] & [[ ! -z "$GIT_USERNAME" ]]; then
git config --global push.default simple
Expand Down
2 changes: 1 addition & 1 deletion .circleci/yarn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -e
set -ex

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

Expand Down
37 changes: 22 additions & 15 deletions package-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,35 @@ const linters = {
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'),
}

let test = 'mocha --forbid-only "test/**/*.test.ts"'
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`)
test = crossEnv(`MOCHA_FILE=reports/mocha.xml ${test} --reporter mocha-junit-reporter`)
// add eslint reporter
scripts.eslint.script = `${scripts.eslint.script} --format junit --output-file reports/eslint.xml`
linters.eslint.script = `${linters.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'
linters.tslint.script = `${linters.tslint.script} --format junit > reports/tslint.xml`
}
// add code coverage reporting with nyc
const nyc = 'nyc --nycrc-path node_modules/@dxcli/dev-nyc-config/.nycrc'
const nyc = 'nyc --nycrc-path node_modules/@dxcli/nyc-config/.nycrc'
const nycReport = `${nyc} report --reporter text-lcov > coverage.lcov`
scripts.mocha.script = series(`${nyc} ${scripts.mocha.script}`, nycReport)
test = series(`${nyc} ${test}`, nycReport)
}

module.exports = {scripts}
test = concurrent({
...linters,
test: series('nps build', test),
})

if (process.env.CI) test = series(mkdirp('reports'), test)

module.exports = {
scripts: {
...linters,
build: series('rm -rf lib', 'tsc'),
lint: concurrent(linters),
test,
release: 'semantic-release -e @dxcli/semantic-release',
},
}
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
},
"devDependencies": {
"@dxcli/config": "^0.1.26",
"@dxcli/dev": "^2.0.5",
"@dxcli/dev": "^2.0.12",
"@dxcli/engine": "^0.1.12",
"@dxcli/semantic-release": "^0.3.3",
"@dxcli/tslint": "^0.0.24",
"@heroku-cli/config-edit": "^1.0.4",
"@types/fs-extra": "^5.0.0",
"@types/load-json-file": "^2.0.7",
Expand All @@ -23,6 +25,7 @@
"fancy-test": "^0.5.5",
"husky": "^0.14.3",
"mocha": "^5.0.0",
"mocha-junit-reporter": "^1.17.0",
"nps": "^5.7.1",
"nps-utils": "^1.5.0",
"ts-node": "^4.1.0",
Expand All @@ -42,9 +45,9 @@
"main": "lib/index.js",
"repository": "dxcli/config",
"scripts": {
"commitmsg": "dxcli-dev-commitmsg",
"commitmsg": "dxcli-commitlint",
"precommit": "nps lint -l warn",
"prepare": "rm -rf lib && tsc",
"prepublishOnly": "nps build",
"test": "nps test -l warn"
},
"types": "lib/index.d.ts"
Expand Down
3 changes: 3 additions & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": "../tsconfig",
"compilerOptions": {
"sourceMap": true
},
"include": [
"./**/*",
"../src/**/*"
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"rootDirs": [
"./src"
],
"sourceMap": true,
"strict": true,
"target": "es2017"
},
Expand Down
2 changes: 1 addition & 1 deletion tslint.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "@dxcli/dev-tslint"
"extends": "@dxcli/tslint"
}
Loading

0 comments on commit 22193c7

Please sign in to comment.