Skip to content

Commit 6c7a040

Browse files
committed
Cli refactor (#969)
* chore(test): add test coverage and ensure circleci runs coveralls. * chore(docs): update badges on readme to include appveyor and npm * refactor(cli.js): changed cli to allow for promises and created acceptance test to use those. * refactor(help): change help command to use new array print mechanism * refactor(task): remove the task parent prototype from all available ionic tasks * refactor(task): removed prototypes from tasks. * refactor(tasks): change ionic task so that their settings are decentralized and easier to maintain * refactor(cordova): split cordova commands off into seperate modules. * refactor(help): move help commands to help task and create a util to house helper functions. * fix(help): update help list so that it is ordered. * refactor(tasks): remove unneeded underscorejs dependency and replace with utils extend. * chore(test): setup tests for the build task. * refactor(task): pass processArguments on to child tasks. * refactor(tests): ensure all tests pass for cli and cordova commands * fix(store): ensure that cli can run even if home directory ionic file does not exist. * chore(tests): added coveralls to the branch and appveyor testing. * chore(tests): add istanbul to npm test and add tests for hooks and lib. * chore(tests): ensure all rewire tests reset themselves. * chore(tests): create tests for help, ionitron, and prompt utils. * chore(tests): add tests for gulp task before and after events. * fix(help): ensure help does not print duplicate lines between tasks. * chore(tests): add tests for table and template utils. * chore(tests): correct tests around stats and ensure stats is tracking cli_release_tag. * chore(tests): add test coverage to stats utility. * chore(tests): ensure cordova utlity functions are covered by tests. * chore(tests): add test coverage to bower util. * fix(stats): ensure stats code works on node 0.12 by using extend with only 2 arguments. * chore(tests): add tests to utility modules. * chore(tests): write tests for config task. * chore(tests): add tests for ionic task add. * chore(tests): add tests for list task. * chore(tests): add tests for add, io, start and state tasks. * chore(tests): add tests to cover info task. * chore(tests): add tests to the upload task. * chore(tests): add tests to the remove task. * chore(tests): add tests to the help task. * chore(tests): add tests for resources task. * chore(tests): add tests for share task. * chore(tests): write tests for login task. * refactor(): replace disableChangePwd with isProjectTask * chore(tests): add tests to cover compile task. * chore(tests): add tests to cover build task. * chore(tests): add tests to cover emulate task. * chore(tests): add tests to cover platform task. * chore(tests): add tests to cover plugin task. * chore(tests): add tests to cover prepare task. * chore(tests): add tests to cover run task. * chore(tests): add tests to cover the cordova util. * test(cli): warning if no node_modules and v2 * test(cli): change test description to match isProjectTask * test(cli): don't runWithGulp if no node_modules and not v2 * feat(cli): remove gulp upgrade help * test(): remove inquirer assertions * test(cli): warn if no gulpfile and cmd requires build step * test(cli): assert specific log message * feat(cli): add gulp functions to Cli object * feat(ionic): catch unhandled promise rejections * refactor(cli): refactor gulp logic * feat(cli): remove unnecessary lookupTask function * chore(cli): add comments, cleanup logs a little * feat(cli): pull out build command test into its own fn * test(cli): add runWithGulp test * test(cli): fix runWithGulp test * feat(cli): improve gulpfile error formatting * refactor(cli): don't run gulp unnecessarily if hook doesn't exist * feat(cli): remove old project upgrade check * fix(cli): remove unnecessary catch * fix(stats): only split version number for release number if version is available. * chore(): update gitignore * refactor(cli): move error handling out of loadGulpfile * test(cli): add loadGulpfile tests * chore(tests): Update address command to remove from serve file and add tests for it. * chore(tests): add more tests to the serve command.
1 parent d54dca4 commit 6c7a040

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+7971
-3295
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
*.cookies
33
node_modules/
44
.idea/
5-
coverage/
65
.vscode/
6+
coverage/
7+
.coveralls.yml
8+
npm-debug.log

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
[![Circle CI](https://circleci.com/gh/driftyco/ionic-cli.svg?style=svg)](https://circleci.com/gh/driftyco/ionic-cli)
1+
[![Build Status][circle-badge]][circle-badge-url]
2+
[![Build status][appveyor-badge]][appveyor-badge-url]
3+
[![npm][npm-badge]][npm-badge-url]
24

35
Ionic-Cli
46
=========
@@ -583,3 +585,10 @@ Usage:
583585
List:
584586

585587
View all generators: `ionic g --list`.
588+
589+
[circle-badge]: https://circleci.com/gh/driftyco/ionic-cli.svg?style=shield
590+
[circle-badge-url]: https://circleci.com/gh/driftyco/ionic-cli
591+
[appveyor-badge]: https://ci.appveyor.com/api/projects/status/oqaqa7fdc7y9mma3?svg=true
592+
[appveyor-badge-url]: https://ci.appveyor.com/project/jthoms1/ionic-cli
593+
[npm-badge]: https://img.shields.io/npm/v/ionic.svg
594+
[npm-badge-url]: https://www.npmjs.com/package/ionic

appveyor.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# http://www.appveyor.com/docs/appveyor-yml
2+
3+
# Test against these versions of Node.js.
4+
environment:
5+
matrix:
6+
- nodejs_version: "0.12"
7+
- nodejs_version: "4.2"
8+
9+
# Install scripts. (runs after repo cloning)
10+
install:
11+
- git rev-parse HEAD
12+
# Get the latest stable version of Node 0.STABLE.latest
13+
- ps: Install-Product node $env:nodejs_version
14+
# Typical npm stuff.
15+
- npm version
16+
- npm install
17+
18+
cache:
19+
- '%APPDATA%\npm-cache'
20+
21+
# Post-install test scripts.
22+
test_script:
23+
# Output useful info for debugging.
24+
- npm version
25+
- cmd: npm run test
26+
27+
# Don't actually build.
28+
build: off
29+
30+
# Set build version format here instead of in the admin panel.
31+
version: "{build}"

bin/ionic

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ process.on('uncaughtException', function(err) {
1010

1111
var IonicCli = require('../lib/cli');
1212

13-
IonicCli.run(process.argv);
13+
IonicCli.run(process.argv).catch(function(err){
14+
console.error('Caught exception:\n', err.stack, '\n\nMind letting us know? https://github.com/driftyco/ionic-cli/issues\n');
15+
});

circle.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
test:
2+
override:
3+
- nvm use 0.12 && npm test
4+
- nvm use 4.0 && npm test
5+
post:
6+
- npm run coveralls

0 commit comments

Comments
 (0)