-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move generator into this package
- Loading branch information
Showing
75 changed files
with
2,155 additions
and
271 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 |
---|---|---|
@@ -1,49 +1,156 @@ | ||
--- | ||
version: 2 | ||
jobs: | ||
node-latest: &test | ||
node-latest-base: &test | ||
docker: | ||
- image: node:latest | ||
working_directory: ~/cli | ||
steps: | ||
- 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 | ||
- store_test_results: | ||
- v1-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum "scripts/circleci"}}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}} | ||
- v1-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum "scripts/circleci"}}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}- | ||
- v1-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum "scripts/circleci"}}-{{checksum ".circleci/config.yml"}}-master- | ||
- run: .circleci/greenkeeper | ||
- run: .circleci/setup_git | ||
- run: ./scripts/circleci | ||
- run: yarn exec mocha test/commands/base/*.test.ts | ||
- store_test_results: &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: v1-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum "scripts/circleci"}}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}} | ||
paths: | ||
- ~/cli/node_modules | ||
- /usr/local/share/.cache/yarn | ||
- /usr/local/share/.config/yarn | ||
node-8: | ||
node-latest-single: | ||
<<: *test | ||
steps: | ||
- checkout | ||
- restore_cache: *restore_cache | ||
- run: ./scripts/greenkeeper | ||
- run: ./scripts/setup_git | ||
- run: yarn exec mocha test/commands/single/*.test.ts | ||
- store_test_results: *store_test_results | ||
- save_cache: *save_cache | ||
node-latest-plugin: | ||
<<: *test | ||
steps: | ||
- checkout | ||
- restore_cache: *restore_cache | ||
- run: ./scripts/greenkeeper | ||
- run: ./scripts/setup_git | ||
- run: yarn exec mocha test/commands/plugin/*.test.ts | ||
- store_test_results: *store_test_results | ||
- save_cache: *save_cache | ||
node-latest-multi: | ||
<<: *test | ||
steps: | ||
- checkout | ||
- restore_cache: *restore_cache | ||
- run: ./scripts/greenkeeper | ||
- run: ./scripts/setup_git | ||
- run: yarn exec mocha test/commands/multi/*.test.ts | ||
- store_test_results: *store_test_results | ||
- save_cache: *save_cache | ||
node-8-base: | ||
<<: *test | ||
docker: | ||
- image: node:8 | ||
steps: | ||
- checkout | ||
- restore_cache: *restore_cache | ||
- run: ./scripts/greenkeeper | ||
- run: ./scripts/setup_git | ||
- run: yarn exec mocha test/commands/base/*.test.ts | ||
- store_test_results: *store_test_results | ||
- save_cache: *save_cache | ||
node-8-single: | ||
<<: *test | ||
docker: | ||
- image: node:8 | ||
steps: | ||
- checkout | ||
- restore_cache: *restore_cache | ||
- run: ./scripts/greenkeeper | ||
- run: ./scripts/setup_git | ||
- run: yarn exec mocha test/commands/single/*.test.ts | ||
- store_test_results: *store_test_results | ||
- save_cache: *save_cache | ||
node-8-plugin: | ||
<<: *test | ||
docker: | ||
- image: node:8 | ||
steps: | ||
- checkout | ||
- restore_cache: *restore_cache | ||
- run: ./scripts/greenkeeper | ||
- run: ./scripts/setup_git | ||
- run: yarn exec mocha test/commands/plugin/*.test.ts | ||
- store_test_results: *store_test_results | ||
- save_cache: *save_cache | ||
node-8-multi: | ||
<<: *test | ||
docker: | ||
- image: node:8 | ||
steps: | ||
- checkout | ||
- restore_cache: *restore_cache | ||
- run: ./scripts/greenkeeper | ||
- run: ./scripts/setup_git | ||
- run: yarn exec mocha test/commands/multi/*.test.ts | ||
- store_test_results: *store_test_results | ||
- save_cache: *save_cache | ||
|
||
lint: | ||
<<: *test | ||
docker: | ||
- image: node:latest | ||
steps: | ||
- checkout | ||
- restore_cache: *restore_cache | ||
- run: ./scripts/greenkeeper | ||
- run: ./scripts/setup_git | ||
- run: nps lint | ||
- store_test_results: *store_test_results | ||
- save_cache: *save_cache | ||
|
||
release: | ||
<<: *test | ||
steps: | ||
- add_ssh_keys | ||
- checkout | ||
- restore_cache: *restore_cache | ||
- run: yarn --frozen-lockfile | ||
- run: ./node_modules/.bin/nps ci.release | ||
- run: ./scripts/greenkeeper | ||
- run: ./scripts/setup_git | ||
- run: ./node_modules/.bin/nps release | ||
- save_cache: *save_cache | ||
|
||
workflows: | ||
version: 2 | ||
"create-dxcli": | ||
jobs: | ||
- node-latest | ||
- node-8 | ||
- lint | ||
- node-latest-base | ||
- node-latest-single | ||
- node-latest-plugin | ||
- node-latest-multi | ||
- node-8-base | ||
- node-8-single | ||
- node-8-plugin | ||
- node-8-multi | ||
- release: | ||
context: org-global | ||
filters: | ||
branches: {only: master} | ||
requires: | ||
- node-latest | ||
- node-8 | ||
- lint | ||
- node-latest-base | ||
- node-latest-single | ||
- node-latest-plugin | ||
- node-latest-multi | ||
- node-8-base | ||
- node-8-single | ||
- node-8-plugin | ||
- node-8-multi |
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
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.user "$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 |
---|---|---|
@@ -1 +1,3 @@ | ||
/lib | ||
/tmp | ||
/templates |
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 |
---|---|---|
@@ -1,2 +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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
*-debug.log | ||
*-error.log | ||
/.nyc_output | ||
/coverage | ||
/coverage.lcov | ||
/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
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 |
---|---|---|
@@ -1,3 +1,13 @@ | ||
#!/usr/bin/env node | ||
|
||
require('generator-dxcli/generators/run') | ||
/* eslint-disable no-unpublished-require */ | ||
|
||
const undefault = m => m.__esModule === true ? m.default : m | ||
|
||
const fs = require('fs') | ||
const path = require('path') | ||
const dev = fs.existsSync(path.join(__dirname, '../tsconfig.json')) | ||
|
||
if (dev) require('ts-node/register') | ||
|
||
undefault(require(`../${dev ? 'src' : '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 |
---|---|---|
@@ -1,45 +1,40 @@ | ||
/* eslint-disable node/no-extraneous-require */ | ||
const { | ||
concurrent, | ||
crossEnv, | ||
series, | ||
setColors, | ||
} = require('nps-utils') | ||
const script = (script, description) => description ? {script, description} : {script} | ||
const hidden = script => ({script, hiddenFromHelp: true}) | ||
|
||
const {concurrent} = require('nps-utils') | ||
setColors(['dim']) | ||
|
||
module.exports = { | ||
scripts: { | ||
build: 'rm -rf lib && tsc', | ||
lint: { | ||
default: concurrent.nps('lint.eslint', 'lint.commitlint'), | ||
eslint: { | ||
script: 'eslint .', | ||
description: 'lint js files', | ||
}, | ||
commitlint: { | ||
script: 'commitlint --from origin/master', | ||
description: 'ensure that commits are in valid conventional-changelog format', | ||
}, | ||
default: concurrent.nps('lint.eslint', 'lint.commitlint', 'lint.tsc', 'lint.tslint'), | ||
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.single'), | ||
description: 'lint and test', | ||
}, | ||
single: { | ||
script: 'node ./scripts/test single', | ||
description: 'test single CLI generator', | ||
}, | ||
}, | ||
ci: { | ||
default: { | ||
script: concurrent.nps( | ||
'ci.eslint', | ||
), | ||
hiddenFromHelp: true, | ||
}, | ||
eslint: { | ||
script: concurrent.nps('lint.eslint --format junit --output-file reports/eslint.xml'), | ||
hiddenFromHelp: true, | ||
}, | ||
release: { | ||
script: 'dxcli-dev-semantic-release', | ||
hiddenFromHelp: true, | ||
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: { | ||
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'), | ||
}, | ||
}, | ||
release: hidden('semantic-release -e @dxcli/dev-semantic-release'), | ||
}, | ||
} |
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
Oops, something went wrong.