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

Commit 8923a8c

Browse files
committed
fix: updated deps
1 parent 10c58ee commit 8923a8c

11 files changed

+223
-196
lines changed

.circleci/config.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ jobs:
99
- checkout
1010
- restore_cache: &restore_cache
1111
keys:
12-
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/test"}}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
13-
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/test"}}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-
14-
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/test"}}-{{checksum ".circleci/config.yml"}}-master-
15-
- run: ./.circleci/test
12+
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
13+
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-
14+
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/config.yml"}}-master-
15+
- run: ./.circleci/setup_git
16+
- run: ./.circleci/greenkeeper
17+
- run: yarn exec nps ci.test
18+
- run: curl -s https://codecov.io/bash | bash
1619
- store_test_results:
1720
path: ~/cli/reports
1821
- save_cache: &save_cache
19-
key: v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/test"}}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
22+
key: v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
2023
paths:
2124
- ~/cli/node_modules
2225
- /usr/local/share/.cache/yarn
@@ -28,10 +31,12 @@ jobs:
2831
release:
2932
<<: *test
3033
steps:
34+
- add_ssh_keys
3135
- checkout
3236
- restore_cache: *restore_cache
37+
- run: ./.circleci/setup_git
3338
- run: yarn --frozen-lockfile
34-
- run: ./node_modules/.bin/nps ci.release
39+
- run: yarn exec nps ci.release
3540
- save_cache: *save_cache
3641

3742
workflows:
+1-14
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
#!/usr/bin/env bash
22

3-
set -ex
3+
set -e
44

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

7-
if [[ ! -z "$GIT_EMAIL" ]] & [[ ! -z "$GIT_USERNAME" ]]; then
8-
git config --global push.default simple
9-
git config --global user.email "$GIT_EMAIL"
10-
git config --global user.user "$GIT_USERNAME"
11-
fi
12-
13-
git submodule sync
14-
git submodule update --init --recursive
15-
167
CLI_ENGINE_UTIL_YARN_ARGS="--frozen-lockfile"
178

189
if [[ "$CIRCLE_BRANCH" == greenkeeper/* ]]; then
@@ -29,7 +20,3 @@ yarn install $CLI_ENGINE_UTIL_YARN_ARGS
2920
if [[ "$CLI_ENGINE_GREENKEEPER_BRANCH" == 1 ]]; then
3021
greenkeeper-lockfile-upload
3122
fi
32-
33-
mkdir -p reports
34-
./node_modules/.bin/nps ci
35-
curl -s https://codecov.io/bash | bash

.circleci/setup_git

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
if [[ ! -z "$GIT_EMAIL" ]] & [[ ! -z "$GIT_USERNAME" ]]; then
6+
git config --global push.default simple
7+
git config --global user.email "$GIT_EMAIL"
8+
git config --global user.user "$GIT_USERNAME"
9+
fi
10+
11+
git submodule sync
12+
git submodule update --init --recursive

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ install:
1212
- git config --global user.name "dxcli"
1313
- yarn
1414
test_script:
15-
- yarn test
15+
- .\node_modules\.bin\nps ci.test
1616
after_test:
1717
- ps: |
1818
$env:PATH = 'C:\msys64\usr\bin;' + $env:PATH

package-scripts.js

+73-57
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,91 @@
1-
const {concurrent, series} = require('nps-utils')
1+
const {
2+
concurrent,
3+
crossEnv,
4+
ifNotWindows,
5+
ifWindows,
6+
mkdirp,
7+
series,
8+
setColors,
9+
} = require('nps-utils')
10+
const pjson = require('./package.json')
11+
const release = pjson.devDependencies.typedoc ? ['ci.release.semantic-release', 'ci.release.typedoc'] : ['ci.release.semantic-release']
12+
const script = (script, description) => description ? {script, description} : {script}
13+
const hidden = script => ({script, hiddenFromHelp: true})
14+
const unixOrWindows = (unix, windows) => series(ifNotWindows(unix), ifWindows(windows))
15+
16+
setColors(['dim'])
17+
18+
let ciTests = [
19+
'ci.test.eslint',
20+
'ci.test.mocha',
21+
'ci.test.tslint',
22+
]
223

324
module.exports = {
425
scripts: {
526
build: 'rm -rf lib && tsc',
627
lint: {
728
default: concurrent.nps('lint.eslint', 'lint.commitlint', 'lint.tsc', 'lint.tslint'),
8-
eslint: {
9-
script: 'eslint .',
10-
description: 'lint js files',
11-
},
12-
commitlint: {
13-
script: 'commitlint --from origin/master',
14-
description: 'ensure that commits are in valid conventional-changelog format',
15-
},
16-
tsc: {
17-
script: 'tsc -p test --noEmit',
18-
description: 'syntax check with tsc',
19-
},
20-
tslint: {
21-
script: 'tslint -p test',
22-
description: 'lint ts files',
23-
},
29+
eslint: script('eslint .', 'lint js files'),
30+
commitlint: script('commitlint --from origin/master', 'ensure that commits are in valid conventional-changelog format'),
31+
tsc: script('tsc -p test --noEmit', 'syntax check with tsc'),
32+
tslint: script('tslint -p test', 'lint ts files'),
2433
},
2534
test: {
26-
default: {
27-
script: concurrent.nps('lint', 'test.mocha'),
28-
description: 'lint and run all tests',
29-
},
35+
default: script(concurrent.nps('lint', 'test.mocha'), 'lint and run all tests'),
36+
series: script(series.nps('lint', 'test.mocha'), 'lint and run all tests in series'),
3037
mocha: {
31-
script: 'mocha "test/**/*.test.ts"',
32-
description: 'run all mocha tests',
38+
default: script('mocha --forbid-only "test/**/*.test.ts"', 'run all mocha tests'),
39+
coverage: {
40+
default: hidden(series.nps('test.mocha.nyc nps test.mocha', 'test.mocha.coverage.report')),
41+
report: hidden(series('nps "test.mocha.nyc report --reporter text-lcov" > coverage.lcov')),
42+
},
43+
junit: hidden(series(
44+
crossEnv('MOCHA_FILE="reports/mocha.xml" ') + series.nps('test.mocha.nyc nps \\"test.mocha --reporter mocha-junit-reporter\\"'),
45+
series.nps('test.mocha.coverage.report'),
46+
)),
47+
nyc: hidden('nyc --nycrc-path node_modules/@dxcli/dev-nyc-config/.nycrc'),
3348
},
3449
},
3550
ci: {
36-
default: {
37-
script: concurrent.nps(
38-
'ci.mocha',
39-
'ci.eslint',
40-
'ci.tslint',
51+
test: {
52+
default: hidden(series(
53+
mkdirp('reports'),
54+
unixOrWindows(
55+
concurrent.nps(...ciTests),
56+
series.nps(...ciTests),
57+
),
58+
)),
59+
mocha: hidden(
60+
unixOrWindows(
61+
series.nps('test.mocha.junit'),
62+
series.nps('test.mocha.coverage'),
63+
)
64+
),
65+
eslint: hidden(
66+
unixOrWindows(
67+
series.nps('lint.eslint --format junit --output-file reports/eslint.xml'),
68+
series.nps('lint.eslint'),
69+
)
70+
),
71+
tslint: hidden(
72+
unixOrWindows(
73+
series.nps('lint.tslint --format junit > reports/tslint.xml'),
74+
series.nps('lint.tslint'),
75+
)
4176
),
42-
hiddenFromHelp: true,
43-
},
44-
mocha: {
45-
default: {
46-
script: series.nps('ci.mocha.test', 'ci.mocha.report'),
47-
hiddenFromHelp: true,
48-
},
49-
test: {
50-
script: 'MOCHA_FILE="reports/mocha.xml" nps "ci.mocha.nyc nps \\"test.mocha --reporter mocha-junit-reporter\\""',
51-
hiddenFromHelp: true,
52-
},
53-
report: {
54-
script: series.nps('ci.mocha.nyc report --reporter text-lcov > coverage.lcov'),
55-
hiddenFromHelp: true,
56-
},
57-
nyc: {
58-
script: 'nyc --nycrc-path node_modules/@dxcli/dev-nyc-config/.nycrc',
59-
hiddenFromHelp: true,
60-
},
61-
},
62-
eslint: {
63-
script: series.nps('lint.eslint --format junit --output-file reports/eslint.xml'),
64-
hiddenFromHelp: true,
65-
},
66-
tslint: {
67-
script: series.nps('lint.tslint --format junit > reports/tslint.xml'),
68-
hiddenFromHelp: true,
6977
},
78+
typedoc: hidden('typedoc --out /tmp/docs src/index.ts --excludeNotExported --mode file'),
7079
release: {
71-
script: 'dxcli-dev-semantic-release',
72-
hiddenFromHelp: true,
80+
default: hidden(series.nps(...release)),
81+
'semantic-release': hidden('semantic-release -e @dxcli/dev-semantic-release'),
82+
typedoc: hidden(series(
83+
'git clone -b gh-pages $CIRCLE_REPOSITORY_URL gh-pages',
84+
'nps ci.typedoc',
85+
'rm -rf ./gh-pages/*',
86+
'mv /tmp/docs/* ./gh-pages',
87+
'cd gh-pages && git add . && git commit -m "updates from $CIRCLE_SHA1 [skip ci]" && git push',
88+
)),
7389
},
7490
},
7591
},

package.json

+11-2
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,24 @@
1010
"lodash": "^4.17.4"
1111
},
1212
"devDependencies": {
13-
"@dxcli/dev-semantic-release": "^0.0.3",
14-
"@dxcli/dev-test": "^0.7.0",
13+
"@dxcli/dev-nyc-config": "^0.0.3",
14+
"@dxcli/dev-semantic-release": "^0.1.0",
1515
"@dxcli/dev-tslint": "^0.0.15",
1616
"@heroku/linewrap": "^1.0.0",
17+
"@types/ansi-styles": "^2.0.30",
18+
"@types/chai": "^4.1.2",
19+
"@types/lodash": "^4.14.96",
20+
"@types/mocha": "^2.2.47",
21+
"@types/nock": "^9.1.2",
1722
"@types/node": "^9.3.0",
23+
"@types/read-pkg": "^3.0.0",
24+
"@types/strip-ansi": "^3.0.0",
25+
"chai": "^4.1.2",
1826
"eslint": "^4.16.0",
1927
"eslint-config-dxcli": "^1.1.4",
2028
"husky": "^0.14.3",
2129
"mocha": "^5.0.0",
30+
"mocha-junit-reporter": "^1.17.0",
2231
"nps": "^5.7.1",
2332
"nps-utils": "^1.5.0",
2433
"nyc": "^11.4.1",

test/help.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {describe, expect} from '@dxcli/dev-test'
1+
import {expect} from 'chai'
22
import chalk from 'chalk'
33

44
import * as flags from '../src/flags'

test/parse.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {describe, expect} from '@dxcli/dev-test'
1+
import {expect} from 'chai'
22
import chalk from 'chalk'
33

44
import {flags, parse} from '../src'

test/tsconfig.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
{
22
"extends": "../tsconfig",
3-
"compilerOptions": {
4-
"rootDir": ".."
5-
},
63
"include": [
7-
"../src/**/*",
8-
"../test/**/*"
4+
"./**/*"
95
]
106
}

tsconfig.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
"noUnusedLocals": true,
88
"noUnusedParameters": true,
99
"outDir": "./lib",
10-
"rootDir": "./src",
10+
"rootDirs": [
11+
"./src"
12+
],
13+
"sourceMap": true,
1114
"strict": true,
1215
"target": "es2017"
1316
},
1417
"include": [
15-
"src/**/*"
18+
"./src/**/*"
1619
]
1720
}

0 commit comments

Comments
 (0)