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
dxcli committed Jan 16, 2018
1 parent 58fe3ed commit 93ed6e1
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 49 deletions.
5 changes: 2 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum "scripts/circleci"}}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum "scripts/circleci"}}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-
- v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum "scripts/circleci"}}-{{checksum ".circleci/config.yml"}}-master-
- run: ./scripts/circleci
- run: ./scripts/circleci test
- store_test_results:
path: ~/cli/reports
- save_cache: &save_cache
Expand All @@ -30,8 +30,7 @@ jobs:
steps:
- checkout
- restore_cache: *restore_cache
- run: yarn
- run: ./node_modules/.bin/dxcli-dev-semantic-release
- run: ./scripts/circleci release
- save_cache: *save_cache

workflows:
Expand Down
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
* text=auto
*.js text eol=lf
*.ts text eol=lf
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
*-debug.log
*-error.log
/.nyc_output
/coverage
/coverage.lcov
/lib
/node_modules
/tmp
/lib
/.nyc_output
4 changes: 3 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ environment:
nodejs_version: "9"
cache:
- '%LOCALAPPDATA%\Yarn -> appveyor.yml'
- node_modules -> package.json
- node_modules -> yarn.lock

install:
- ps: Install-Product node $env:nodejs_version x64
- git config --global user.email "dxcli@example.com"
- git config --global user.name "dxcli"
- yarn
test_script:
- yarn test
Expand Down
18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"lodash": "^4.17.4"
},
"devDependencies": {
"@dxcli/dev": "^1.1.2",
"@dxcli/dev": "^1.1.3",
"@dxcli/dev-semantic-release": "^0.0.3",
"@dxcli/dev-test": "^0.0.1",
"@dxcli/dev-tslint": "^0.0.8",
"@dxcli/dev-test": "^0.1.1",
"@dxcli/dev-tslint": "^0.0.9",
"@heroku/linewrap": "^1.0.0",
"@types/chalk": "^2.2.0",
"@types/node": "^9.3.0",
Expand All @@ -28,18 +28,16 @@
"workflows": {
"test": [
"eslint .",
"tsc",
"tslint -p .",
"commitlint --from master",
"tsc -p test --noEmit",
"tslint -p test",
"commitlint --from origin/master",
"mocha \"test/**/*.ts\""
],
"lint": [
"eslint .",
"tsc",
"tslint -p .",
"commitlint --from master",
"tsc -p test --noEmit"
"tsc -p test --noEmit",
"tslint -p test",
"commitlint --from origin/master"
]
}
},
Expand Down
74 changes: 51 additions & 23 deletions scripts/circleci
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,61 @@

set -ex

duration() {
set +x
start=$(date +%s)
"$@"
end=$(date +%s)
python -c "print 'Ran $1 in %u:%02u' % ((${end} - ${start})/60, (${end} - ${start})%60)"
set -x
}

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

CLI_ENGINE_UTIL_YARN_ARGS="--frozen-lockfile"
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

_test() {
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
if [[ "$CIRCLE_BRANCH" == greenkeeper/* ]]; then
CLI_ENGINE_GREENKEEPER_BRANCH=1
CLI_ENGINE_UTIL_YARN_ARGS=""
if [[ ! -x "$(command -v greenkeeper-lockfile-update)" ]]; then
duration yarn global add greenkeeper-lockfile@1
fi
duration greenkeeper-lockfile-update
fi
greenkeeper-lockfile-update
fi

yarn install $CLI_ENGINE_UTIL_YARN_ARGS
duration yarn install $CLI_ENGINE_UTIL_YARN_ARGS

if [[ "$CLI_ENGINE_GREENKEEPER_BRANCH" == 1 ]]; then
greenkeeper-lockfile-upload
fi
if [[ "$CLI_ENGINE_GREENKEEPER_BRANCH" == 1 ]]; then
duration greenkeeper-lockfile-upload
fi

CWD=$(pwd)
NYC="./node_modules/.bin/nyc --nycrc-path node_modules/@dxcli/dev-nyc-config/.nycrc"
mkdir -p reports
MOCHA_FILE="$CWD/reports/mocha.xml" \
DXCLI_MOCHA_OPTS="--reporter mocha-junit-reporter" \
DXCLI_ESLINT_OPTS="--format junit --output-file $CWD/reports/eslint.xml" \
DXCLI_TSLINT_OPTS="--format junit > $CWD/reports/tslint.xml" \
$NYC yarn test
$NYC report --reporter=text-lcov > coverage.lcov

curl -s https://codecov.io/bash | bash
CWD=$(pwd)
NYC=(./node_modules/.bin/nyc --nycrc-path node_modules/@dxcli/dev-nyc-config/.nycrc)
mkdir -p reports
MOCHA_FILE="$CWD/reports/mocha.xml" \
DXCLI_MOCHA_OPTS="--reporter mocha-junit-reporter" \
DXCLI_ESLINT_OPTS="--format junit --output-file $CWD/reports/eslint.xml" \
DXCLI_TSLINT_OPTS="--format junit > $CWD/reports/tslint.xml" \
duration "${NYC[@]}" yarn test

duration "${NYC[@]}" report --reporter=text-lcov > coverage.lcov

duration curl -s https://codecov.io/bash | bash
}

_release() {
yarn --frozen-lockfile
./node_modules/.bin/dxcli-dev-semantic-release
}

case "$1" in
release) _release;;
*) _test;;
esac
2 changes: 1 addition & 1 deletion test/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ See more help with --help`)
foo: flags.string(),
},
})
expect(out.flags.foo!.toUpperCase()).to.equal('C')
expect(out.flags.foo.toUpperCase()).to.equal('C')
expect(out.flags.bar.join('|')).to.equal('a|b')
})
})
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@
"@semantic-release/npm" "^2.6.1"
semantic-release "^12.2.0"

"@dxcli/dev-test@^0.0.1":
version "0.0.1"
resolved "https://registry.yarnpkg.com/@dxcli/dev-test/-/dev-test-0.0.1.tgz#8440c7fec40ccf7ad5dc21d5224be09ca42a4cb4"
"@dxcli/dev-test@^0.1.1":
version "0.1.1"
resolved "https://registry.yarnpkg.com/@dxcli/dev-test/-/dev-test-0.1.1.tgz#6a03471c700412e3b04724501e083310777beda1"
dependencies:
"@dxcli/dev-nyc-config" "^0.0.3"
"@types/ansi-styles" "^2.0.30"
Expand All @@ -147,16 +147,16 @@
strip-ansi "^4.0.0"
ts-node "^4.1.0"

"@dxcli/dev-tslint@^0.0.8":
version "0.0.8"
resolved "https://registry.yarnpkg.com/@dxcli/dev-tslint/-/dev-tslint-0.0.8.tgz#f07750d0152b26764b43fd99110076db87b4a22e"
"@dxcli/dev-tslint@^0.0.9":
version "0.0.9"
resolved "https://registry.yarnpkg.com/@dxcli/dev-tslint/-/dev-tslint-0.0.9.tgz#552b62b769ede24b30fdc3b8c04e10b1a60f027f"
dependencies:
tslint "^5.9.1"
tslint-xo "^0.5.0"

"@dxcli/dev@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@dxcli/dev/-/dev-1.1.2.tgz#66acd0b6d5cc9cf8a94a00692c67d40c94ebf81b"
"@dxcli/dev@^1.1.3":
version "1.1.3"
resolved "https://registry.yarnpkg.com/@dxcli/dev/-/dev-1.1.3.tgz#da1b929372cae0af15f78849483494a74c3c075e"
dependencies:
cli-ux "^2.0.21"
concurrently "^3.5.1"
Expand Down

0 comments on commit 93ed6e1

Please sign in to comment.