Skip to content

Commit 666ae35

Browse files
mlynchtlancina
authored andcommitted
feat(v2): New v2 support
1 parent f9f6b57 commit 666ae35

38 files changed

+1979
-438
lines changed

CHANGELOG.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,20 @@
3030

3131
* Added security command for managing Security Profiles.
3232
* Added package command for Ionic Package.
33+
* Added winston as default logger - may break event listeners.
34+
* Added ENV variable CONNECT_LIVE_RELOAD_PORT for users to expose the live reload server on a port.
35+
* Speed up CLI by lazy-loading ionic-app-lib modules.
36+
* Update hooks - use `util` instead of deprecated `sys`.
37+
* Update hooks to run sequentially instead of asychronously.
38+
* Added additional tests for CLI, stats, and running commands.
3339

3440
### 1.6.5
3541

3642
* Updating app-lib dependency
3743

3844
### 1.6.4
3945

40-
* Updating app-lib dependency
46+
* Updating app-lib dependency.
4147

4248
### 1.6.3
4349

@@ -47,7 +53,7 @@
4753

4854
* Added `io init` command to initialize your project with ionic.io.
4955
* Added config command to centralize ionic.io services configuration.
50-
* Added `--deploy` flag to upload command.
56+
* Added `--deploy` flag to upload command.
5157

5258
### 1.6.1
5359

@@ -75,7 +81,7 @@
7581
* Fix(platform): Remove console.log command from ionic-cordova-lib, bump to 5.1.5 to have that change.
7682
* Update ionic-cordova-lib to 5.1.4 for fix with cordova lib run propagating errors to callers.
7783
* Fix for serve - directory root is using path.join instead of path.resolve.
78-
* Add build platform to the cordova command.
84+
* Add build platform to the cordova command.
7985
* Bump version of ionic-cordova-lib.
8086

8187
### 1.5.5
@@ -138,7 +144,7 @@
138144
* Fix for a bug when serve wont start console logs with `--consolelogs` argument.
139145
* Added flag `--platform` for serve command that opens the browser with those platform specific styles (android/ios).
140146

141-
### 1.4.1
147+
### 1.4.1
142148

143149
* Corrected a bug with ionic state restore command - it now properly passes the app directory to be fixed.
144150
* Corrected landscape and portrait sizes for the resources command.
@@ -164,7 +170,7 @@
164170

165171
* Fix for Ionic default hooks permissions
166172

167-
### 1.3.20
173+
### 1.3.20
168174

169175
* Adding in a command with ionic start to provide an ionic io app ID. `ionic start --io-app-id <someid>`
170176

README.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ __Command-line flags/options:__
6060
[--no-cordova|-w] .... Do not create an app targeted for Cordova
6161
[--sass|-s] ........... Setup the project to use Sass CSS precompiling
6262
[--list|-l] .......... List starter templates available
63-
63+
6464
[--io-app-id] ......... The Ionic.io app ID to use
6565

6666
## Adding a platform target
@@ -448,7 +448,7 @@ Set `IONIC_EMAIL` and `IONIC_PASSWORD` as variables to have the CLI read these i
448448

449449
## Upload your Ionic app
450450

451-
Use the `ionic upload` command to take your current application you are developing and upload it to the Ionic.io servers.
451+
Use the `ionic upload` command to take your current application you are developing and upload it to the Ionic.io servers.
452452

453453
Now you can use [the ionic view app](http://view.ionic.io/) to view that application or have others view the application.
454454

@@ -467,7 +467,7 @@ You can then view that App ID from the View app or the application listing on io
467467

468468
### Adding a note with your upload
469469

470-
To add a note to your build, pass the `--note` option as follows:
470+
To add a note to your build, pass the `--note` option as follows:
471471

472472
`ionic upload --note "This version of the application fixes the menu selections"`.
473473

@@ -490,9 +490,9 @@ To get help with a doc you may not remember, just type the name close enough: `i
490490

491491
# Ionic Hooks
492492

493-
Ionic provides some default hooks for you to use in your Cordova application. In versions prior to 1.3.18, these hooks were automatically installed via the `ionic platform` command.
493+
Ionic provides some default hooks for you to use in your Cordova application. In versions prior to 1.3.18, these hooks were automatically installed via the `ionic platform` command.
494494

495-
In 1.3.18, the hooks were automatically removed due to some errors users were having with Crosswalk and other plugins with variables.
495+
In 1.3.18, the hooks were automatically removed due to some errors users were having with Crosswalk and other plugins with variables.
496496

497497
If you were a user who would still like to use those hooks, you can re-install these hooks with the `ionic hooks add` command.
498498

@@ -541,7 +541,7 @@ Your package.json file might look something like the following:
541541

542542
## ionic state save
543543

544-
The `ionic state save` command does some lookup in your platforms and plugins to save the current state of your cordova application.
544+
The `ionic state save` command does some lookup in your platforms and plugins to save the current state of your cordova application.
545545

546546
First it looks in your platforms folder to see which platforms are installed, and saves the name and version in your `package.json` file under the `cordovaPlatforms` attribute.
547547

@@ -568,20 +568,18 @@ The `ionic state reset` method will first remove your platforms and plugins fold
568568
This command can be helpful for you to reinstall your plugins and platforms to get a fresh start.
569569

570570

571-
# ionic.project file
571+
# Ionic CLI 2.0
572+
573+
## Ionic Generators
574+
575+
First class support has come to the Ionic CLI to scaffold and generate Ionic and Angular 2 components. To use this feature, first install the V2 Ionic CLI: `npm install ionic@alpha` and start an app.
576+
577+
Once in the app folder, use the `generate` command (alias: `g`).
572578

573-
The ionic.project is a configuration for an ionic project that stores the following:
579+
Usage:
580+
* `ionic generate page About` - Generate a page named About with HTML, JavaScript, and Sass named `about`.
581+
* `ionic g tabs MyTabPage` - Generate a page named MyTabPage, queries for the amount of tabs, and creates pages for those tabs.
574582

575-
* `app_id` - the associated app ID in ionic.io.
576-
* `browsers` - the installed browsers (CrossWalk).
577-
* `createDocumentRoot` - boolean setting stating to create the designated.document root upon serve (for CI, using `app` folder, and compiling)
578-
* `defaultBrowser` - the browser they prefer to use with `ionic serve`. Chrome, Firefox, etc.
579-
* `documentRoot` - the associated document root with HTML/JS/CSS files.
580-
* `gulpDependantTasks` - gulp tasks that are run before `ionic serve` launches. Think of `gulp build`, `gulp sass`, etc.
581-
* `gulpStartupTasks` - gulp tasks that are run and kept alive during `ionic serve`.
582-
* `imagePaths` - paths relative to document root that specify the release feature to compress images.
583-
* `proxies` - designated proxies to use during `ionic serve`.
584-
* `name` - the name of the application.
585-
* `sass` - the setting to watch sass during `ionic serve`.
586-
* `watchPatterns` - the patterns to watch and live reload during `ionic.serve`.
583+
List:
587584

585+
View all generators: `ionic g --list`.

e2e/e2e.spec.js

Lines changed: 97 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,111 @@
1-
var fs = require('fs'),
2-
helpers = require('./helpers'),
3-
path = require('path'),
4-
Q = require('q'),
5-
shell = require('shelljs');
1+
// var fs = require('fs'),
2+
// helpers = require('./helpers'),
3+
// path = require('path'),
4+
// Q = require('q'),
5+
// shell = require('shelljs');
66

7-
var IonicCli = require('../lib/cli');
8-
var IonicAppLib = require('ionic-app-lib');
7+
// var IonicCli = require('../lib/cli');
8+
// var IonicAppLib = require('ionic-app-lib');
99

10-
var tmpDir = helpers.tmpDir('create_test');
11-
var appName = 'TestIonic';
12-
var appId = 'org.ionic.testing';
13-
var project = path.join(tmpDir, appName);
14-
var optimist = require('optimist');
15-
var start = IonicAppLib.start;
16-
var utils = IonicAppLib.utils;
17-
var optimistSpy;
10+
// var tmpDir = helpers.tmpDir('create_test');
11+
// var appName = 'TestIonic';
12+
// var appId = 'org.ionic.testing';
13+
// var project = path.join(tmpDir, appName);
14+
// var optimist = require('optimist');
15+
// var start = IonicAppLib.start;
16+
// var utils = IonicAppLib.utils;
17+
// var optimistSpy;
1818

1919

20-
describe('end-to-end', function() {
21-
beforeEach(function() {
22-
jasmine.getEnv().defaultTimeoutInterval = 150000;
23-
// if (optimistSpy) {
24-
// optimistSpy.reset();
25-
// }
26-
optimistSpy = spyOn(optimist, 'boolean');
27-
optimist.boolean.reset();
20+
// xdescribe('end-to-end', function() {
21+
// beforeEach(function() {
22+
// jasmine.getEnv().defaultTimeoutInterval = 150000;
23+
// // if (optimistSpy) {
24+
// // optimistSpy.reset();
25+
// // }
26+
// optimistSpy = spyOn(optimist, 'boolean');
27+
// optimist.boolean.reset();
2828

29-
//Mock out call to get the app directory, return our project
30-
spyOn(utils, 'getProjectDirectory').andReturn(project);
29+
// //Mock out call to get the app directory, return our project
30+
// spyOn(utils, 'getProjectDirectory').andReturn(project);
3131

32-
//Disable console.log statements
33-
// spyOn(IonicAppLib.events, 'on');
34-
// spyOn(process.stdout, 'write');
35-
spyOn(IonicAppLib.multibar, 'newBar').andReturn({tick: function(){}});
32+
// //Disable console.log statements
33+
// // spyOn(IonicAppLib.events, 'on');
34+
// // spyOn(process.stdout, 'write');
35+
// spyOn(IonicAppLib.multibar, 'newBar').andReturn({tick: function(){}});
3636

3737

38-
shell.rm('-rf', project);
39-
shell.mkdir('-p', tmpDir);
40-
});
41-
afterEach(function() {
42-
process.chdir(path.join(__dirname, '..')); // Needed to rm the dir on Windows.
43-
// shell.rm('-rf', tmpDir);
44-
});
38+
// shell.rm('-rf', project);
39+
// shell.mkdir('-p', tmpDir);
40+
// });
41+
// afterEach(function() {
42+
// process.chdir(path.join(__dirname, '..')); // Needed to rm the dir on Windows.
43+
// // shell.rm('-rf', tmpDir);
44+
// });
4545

46-
describe('#start e2e', function() {
47-
it('should call start with default template and folder name', function(done) {
48-
console.log('default template');
49-
var args = { _: ['start', 'test'], verbose: true};
50-
//Mock out args from the commands.
51-
// optimistSpy.andReturn({argv: args});
52-
optimistSpy.andCallFake(function(){
53-
return {argv: args};
54-
});
46+
// describe('#start e2e', function() {
47+
// it('should call start with default template and folder name', function(done) {
48+
// console.log('default template');
49+
// var args = { _: ['start', 'test'], verbose: true};
50+
// //Mock out args from the commands.
51+
// // optimistSpy.andReturn({argv: args});
52+
// optimistSpy.andCallFake(function(){
53+
// return {argv: args};
54+
// });
5555

56-
Q()
57-
.then(function() {
58-
return IonicCli.run(args);
59-
}).then(function(){
60-
expect(path.join(project, 'www', 'index.html')).toExist();
61-
expect(path.join(project, 'www', 'templates', 'tabs.html')).toExist();
62-
})
63-
.catch(function(error) {
64-
expect('this').toBe('not this');
65-
})
66-
.fin(done);
67-
});
56+
// Q()
57+
// .then(function() {
58+
// return IonicCli.run(args);
59+
// }).then(function(){
60+
// expect(path.join(project, 'www', 'index.html')).toExist();
61+
// expect(path.join(project, 'www', 'templates', 'tabs.html')).toExist();
62+
// })
63+
// .catch(function(error) {
64+
// expect('this').toBe('not this');
65+
// })
66+
// .fin(done);
67+
// });
6868

69-
it('should call start with sidemenu template and folder name', function(done) {
70-
console.log('sidemenu template');
71-
var args = { _: ['start', 'test', 'sidemenu'], verbose: true};
72-
//Mock out args from the commands.
73-
// optimistSpy.andReturn({argv: args});
74-
optimistSpy.andCallFake(function(){
75-
return {argv: args};
76-
});
69+
// it('should call start with sidemenu template and folder name', function(done) {
70+
// console.log('sidemenu template');
71+
// var args = { _: ['start', 'test', 'sidemenu'], verbose: true};
72+
// //Mock out args from the commands.
73+
// // optimistSpy.andReturn({argv: args});
74+
// optimistSpy.andCallFake(function(){
75+
// return {argv: args};
76+
// });
7777

78-
Q()
79-
.then(function() {
80-
return IonicCli.run(args);
81-
}).then(function(){
82-
expect(path.join(project, 'www', 'index.html')).toExist();
83-
expect(path.join(project, 'www', 'templates', 'menu.html')).toExist();
84-
})
85-
.catch(function(error) {
86-
expect('this').toBe('not this');
87-
})
88-
.fin(done);
89-
});
78+
// Q()
79+
// .then(function() {
80+
// return IonicCli.run(args);
81+
// }).then(function(){
82+
// expect(path.join(project, 'www', 'index.html')).toExist();
83+
// expect(path.join(project, 'www', 'templates', 'menu.html')).toExist();
84+
// })
85+
// .catch(function(error) {
86+
// expect('this').toBe('not this');
87+
// })
88+
// .fin(done);
89+
// });
9090

91-
it('should call start with blank template and folder name', function(done) {
92-
var args = { _: ['start', 'test', 'blank'], verbose: true};
93-
//Mock out args from the commands.
94-
optimistSpy.andCallFake(function(){
95-
return {argv: args};
96-
});
91+
// it('should call start with blank template and folder name', function(done) {
92+
// var args = { _: ['start', 'test', 'blank'], verbose: true};
93+
// //Mock out args from the commands.
94+
// optimistSpy.andCallFake(function(){
95+
// return {argv: args};
96+
// });
9797

98-
Q()
99-
.then(function() {
100-
return IonicCli.run(args);
101-
}).then(function(){
102-
expect(path.join(project, 'www', 'index.html')).toExist();
103-
expect(path.join(project, 'www', 'js', 'app.js')).toExist();
104-
})
105-
.catch(function(error) {
106-
expect('this').toBe('not this');
107-
})
108-
.fin(done);
109-
});
110-
});
111-
});
98+
// Q()
99+
// .then(function() {
100+
// return IonicCli.run(args);
101+
// }).then(function(){
102+
// expect(path.join(project, 'www', 'index.html')).toExist();
103+
// expect(path.join(project, 'www', 'js', 'app.js')).toExist();
104+
// })
105+
// .catch(function(error) {
106+
// expect('this').toBe('not this');
107+
// })
108+
// .fin(done);
109+
// });
110+
// });
111+
// });

0 commit comments

Comments
 (0)