Skip to content

Commit

Permalink
Initial commit - internal preview only
Browse files Browse the repository at this point in the history
  • Loading branch information
dprothero committed Sep 18, 2018
0 parents commit 6e156a8
Show file tree
Hide file tree
Showing 29 changed files with 7,129 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
version: 2
jobs:
node-latest: &test
docker:
- image: node:latest
working_directory: ~/cli
steps:
- checkout
- restore_cache: &restore_cache
keys:
- v1-npm-{{checksum ".circleci/config.yml"}}-{{ checksum "package-lock.json"}}
- v1-npm-{{checksum ".circleci/config.yml"}}
- run:
name: Install dependencies
command: .circleci/greenkeeper
- run: ./bin/run --version
- run: ./bin/run --help
- run:
name: Testing
command: npm test
- run:
name: Submitting code coverage to codecov
command: |
./node_modules/.bin/nyc report --reporter text-lcov > coverage.lcov
curl -s https://codecov.io/bash | bash
- save_cache:
key: v1-yarn-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}}
paths:
- ~/cli/node_modules
- ~/.npm
- /usr/local/lib/node_modules
node-8:
<<: *test
docker:
- image: node:8

workflows:
version: 2
"twilio-cli":
jobs:
- node-latest
- node-8
25 changes: 25 additions & 0 deletions .circleci/greenkeeper
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

if [[ "$CIRCLE_BRANCH" != greenkeeper/* ]]; then
yarn
# yarn check
exit 0
fi

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.name "$GIT_USERNAME"
fi

if [[ ! -x "$(command -v greenkeeper-lockfile-update)" ]]; then
yarn global add greenkeeper-lockfile@1
fi

greenkeeper-lockfile-update
yarn
greenkeeper-lockfile-upload
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
11 changes: 11 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "oclif",
"rules": {
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"object-curly-spacing": ["error", "always"],
"comma-dangle": ["error", "never"]
}
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
*.js text eol=lf
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*-debug.log
*-error.log
/.nyc_output
/dist
/tmp
/yarn.lock
node_modules
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"jshint.enable": false,
"javascript.implicitProjectConfig.checkJs": false
}
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# twilio-cli

Super-early preview.

## Set up to explore

1. Clone the repo.
2. From the working directory, run `npm install . -g`.
3. Run `twilio` from anywhere to use the CLI.

## Set up for development

1. Clone the repo.
2. From the working directory, run `npm install`.
3. Edit the code (most is in the `src` folder).
4. Test by running `bin/run` instead of `twilio`

## Basic usage

### Step 1 - Login (aka add a project)

```
twilio login
```

which is an alias for:

```
twilio project:add -p default
```

### Step 2 - Explore

```
twilio
```

Lists all available commands.

```
twilio incomingPhoneNumber:list
```

Lists all your phone numbers.

Add `--help` to any command to get help (e.g. `twilio incomingPhoneNumber:list --help`)
22 changes: 22 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
environment:
nodejs_version: "9"
cache:
- '%AppData%\npm-cache -> appveyor.yml'
- node_modules -> package-lock.json

install:
- ps: Install-Product node $env:nodejs_version x64
- npm install
test_script:
- .\bin\run --version
- .\bin\run --help
- npm test
after_test:
- .\node_modules\.bin\nyc report --reporter text-lcov > coverage.lcov
- ps: |
$env:PATH = 'C:\msys64\usr\bin;' + $env:PATH
Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh
bash codecov.sh
build: off

5 changes: 5 additions & 0 deletions bin/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env node

require('@oclif/command').run()
.then(require('@oclif/command/flush'))
.catch(require('@oclif/errors/handle'))
3 changes: 3 additions & 0 deletions bin/run.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

node "%~dp0\run" %*
Loading

0 comments on commit 6e156a8

Please sign in to comment.