Skip to content

Commit

Permalink
feat: added generator
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 13, 2018
1 parent 3f46075 commit 6e96584
Show file tree
Hide file tree
Showing 10 changed files with 4,160 additions and 3 deletions.
47 changes: 47 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
version: 2
jobs:
node-latest: &test
docker:
- image: node:latest
working_directory: ~/cli
steps:
- checkout
- restore_cache: &restore_cache
keys:
- 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: ./scripts/circleci
- save_cache: &save_cache
key: v0-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
paths:
- ~/cli/node_modules
- /usr/local/share/.cache/yarn
- /usr/local/share/.config/yarn
node-8:
<<: *test
docker:
- image: node:8
release:
<<: *test
steps:
- checkout
- restore_cache: *restore_cache
- run: yarn
- run: npx dxcli-dev-semantic-release
- save_cache: *save_cache

workflows:
version: 2
test:
jobs:
- node-latest
- node-8
- release:
context: org-global
filters:
branches: {only: master}
requires:
- node-latest
- node-8
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "dxcli"
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/coverage
/lib
/node_modules

*-error.log
*-debug.log
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

=================

[![Version](https://img.shields.io/npm/v/.svg)](https://npmjs.org/package/)
[![CircleCI](https://circleci.com/gh/dxcli/create-dxcli/tree/master.svg?style=svg)](https://circleci.com/gh/dxcli/create-dxcli/tree/master)
[![Appveyor CI](https://ci.appveyor.com/api/projects/status/fyhxf3w8gyqxv0ou/branch/master?svg=true)](https://ci.appveyor.com/api/projects/status/github/dxcli/create-dxcli
[![Codecov](https://codecov.io/gh/dxcli/create-dxcli/branch/master/graph/badge.svg)](https://codecov.io/gh/dxcli/create-dxcli)
[![Greenkeeper](https://badges.greenkeeper.io/dxcli/create-dxcli.svg)](https://greenkeeper.io/)
[![Known Vulnerabilities](https://snyk.io/test/npm/}/badge.svg)](https://snyk.io/test/npm/)
[![Downloads/week](https://img.shields.io/npm/dw/.svg)](https://npmjs.org/package/)
[![License](https://img.shields.io/npm/l/.svg)](https://github.com/dxcli/create-dxcli/blob/master/package.json)
15 changes: 15 additions & 0 deletions bin/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env node

const {createEnv} = require('yeoman-environment')

const env = createEnv()

env.register(
require.resolve('generator-dxcli'),
'dxcli:app'
)

const type = process.argv[2]
if (!type) throw new Error(`Usage: yarn create dxcli (single|multi|plugin|base)`)

env.run('dxcli:app', {type})
38 changes: 35 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,40 @@
{
"name": "create-dxcli",
"version": "0.0.0",
"description": "dxcli: create your own CLI",
"repository": "dxcli/create-dxcli",
"version": "0.0.0",
"author": "Jeff Dickey @jdxcode",
"license": "MIT"
"bin": "bin/run",
"dependencies": {
"generator-dxcli": "^1.0.1",
"yeoman-environment": "^2.0.5"
},
"devDependencies": {
"@dxcli/dev-semantic-release": "^0.0.2",
"eslint": "^4.15.0",
"eslint-config-dxcli": "^1.1.1",
"husky": "^0.14.3"
},
"dxcli": {
"workflows": {
"test": [
"eslint ."
],
"lint": [
"eslint ."
]
}
},
"engines": {
"node": ">=8.0.0"
},
"files": [
"/bin"
],
"license": "MIT",
"repository": "dxcli/create-dxcli",
"scripts": {
"commitmsg": "dxcli-dev-commitmsg",
"lint": "dxcli-dev lint",
"test": "dxcli-dev test"
}
}
25 changes: 25 additions & 0 deletions scripts/circleci
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

set -ex

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

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
fi
greenkeeper-lockfile-update
fi

yarn install $CLI_ENGINE_UTIL_YARN_ARGS

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

yarn test --coverage
curl -s https://codecov.io/bash | bash

0 comments on commit 6e96584

Please sign in to comment.