ember-cli-cordova
Advanced tools
Comparing version 0.0.17 to 0.0.19
import redirect from '../utils/redirect'; | ||
export var initialize = function(container, app, config) { | ||
export var initialize = function(app, config) { | ||
var url = config.cordova.emberUrl || 'http://localhost:4200'; | ||
@@ -5,0 +5,0 @@ return redirect(url); |
@@ -8,3 +8,3 @@ /* globals cordova */ | ||
export var initialize = function(container, app) { | ||
export var initialize = function(app) { | ||
if(typeof cordova === 'undefined' || | ||
@@ -17,3 +17,3 @@ config.environment !== 'development' || | ||
return inAppReload(container, app, config); | ||
return inAppReload(app, config); | ||
}; | ||
@@ -20,0 +20,0 @@ |
var projectWithConfig = require('../../lib/models/project-with-config'); | ||
var Promise = require('../../lib/ext/promise'); | ||
var stringUtils = require('../../lib/utils/string'); | ||
var defaultPlatform = require('../../lib/utils/default-platform'); | ||
@@ -16,4 +17,4 @@ module.exports = { | ||
afterInstall: function(options) { | ||
this.options = options.entity.options; | ||
this.options.platform = options.platform || 'ios'; | ||
this.options = options.entity.options; | ||
this.options.platform = options.platform || defaultPlatform(this.project); | ||
@@ -20,0 +21,0 @@ projectWithConfig(this.project, options.entity.name); |
@@ -19,2 +19,10 @@ ### Configuration | ||
// Which emulated target to deploy to | ||
// | ||
// default: <system default> | ||
emulateTarget: { | ||
ios: "iPad-2", | ||
android: "android-20" | ||
} | ||
// Which platform to build and/or emulate | ||
@@ -21,0 +29,0 @@ // |
# Getting Started | ||
This guide will walk you through setting up your first app with | ||
ember-cli-cordova. | ||
ember-cli-cordova. | ||
@@ -11,2 +11,9 @@ ## Prerequisites | ||
Ember-cli-cordova requires ember-cli and cordova. You may install them as follows: | ||
``` | ||
npm install -g ember-cli | ||
npm install -g cordova | ||
``` | ||
## Setting Up The App | ||
@@ -23,17 +30,13 @@ | ||
```sh | ||
npm install --save-dev ember-cli-cordova | ||
ember install ember-cli-cordova | ||
``` | ||
Ember cli-cordova requires cordova. If you don't have cordova, use this line to install it. | ||
Ember cli-cordova requires cordova. If you don't have cordova, use this line to install it. | ||
``` | ||
npm install -g cordova | ||
``` | ||
To intialize the cordova project we use a generator provided by | ||
ember-cli-cordova. You pass in the com domain identifier that you want to use | ||
with your app. It can be anything you like as long as it's unique. This matters | ||
if you plan on releasing it to the app store's. It takes an optional `platform` | ||
if you plan on releasing it to the app stores. It takes an optional `platform` | ||
argument that defaults to `ios`. If you want to generate an android project you | ||
would pass in `--platform=android` at the end. | ||
would pass in `--platform=android` at the end or set your default platform in [cordova configuration](https://github.com/poetic/ember-cli-cordova/blob/master/docs/configuration.md). | ||
@@ -40,0 +43,0 @@ ```sh |
@@ -78,2 +78,5 @@ 'use strict'; | ||
} | ||
else if (config.liveReload.platform === 'browser') { | ||
pluginsPath = path.join(platformsPath, 'browser', 'www'); | ||
} | ||
else if (config.liveReload.platform === 'android') { | ||
@@ -80,0 +83,0 @@ pluginsPath = path.join(platformsPath, 'android', 'assets', 'www'); |
'use strict'; | ||
var path = require('path'); | ||
var chalk = require('chalk'); | ||
var path = require('path'); | ||
var chalk = require('chalk'); | ||
var defaultPlatform = require('../utils/default-platform'); | ||
@@ -14,8 +15,9 @@ module.exports = { | ||
{ name: 'environment', type: String, default: 'development' }, | ||
{ name: 'platform', type: String, default: 'ios' } | ||
{ name: 'platform', type: String } | ||
], | ||
run: function(options) { | ||
return require('../tasks/build')(options.environment, options.platform, this.project)(); | ||
var platform = options.platform || defaultPlatform(this.project); | ||
return require('../tasks/build')(options.environment, platform, this.project)(); | ||
} | ||
}; |
'use strict'; | ||
var path = require('path'); | ||
var path = require('path'); | ||
var defaultPlatform = require('../utils/default-platform'); | ||
@@ -12,3 +13,3 @@ module.exports = { | ||
availableOptions: [ | ||
{ name: 'platform', type: String, default: 'ios' }, | ||
{ name: 'platform', type: String }, | ||
{ name: 'application', type: String} | ||
@@ -18,4 +19,5 @@ ], | ||
run: function(options) { | ||
return require('../tasks/open')(this.project, options.platform, options.application)(); | ||
var platform = options.platform || defaultPlatform(this.project); | ||
return require('../tasks/open')(this.project, platform, options.application)(); | ||
} | ||
}; |
@@ -6,4 +6,5 @@ 'use strict'; | ||
var Promise = require('../ext/promise'); | ||
var defaultPlatform = require('../utils/default-platform'); | ||
module.exports = function(version, options, project) { | ||
module.exports = function(version, options, project, platform) { | ||
var config = project.cordovaConfig; | ||
@@ -13,2 +14,4 @@ var updateXml = function() { return Promise.resolve(); }; | ||
platform = platform || 'ios'; | ||
if (version) { | ||
@@ -18,6 +21,4 @@ updateXml = require('./update-config-xml-version')(version, project); | ||
var platform = options.platform || 'ios'; | ||
var build = require('./build')(options.environment, platform, project); | ||
if(platform === 'ios') { | ||
@@ -32,2 +33,11 @@ var iosPath = path.join(project.root, 'cordova', 'platforms/ios'); | ||
if(platform === 'android' && version) { | ||
var __updateXml = updateXml; | ||
updateXml = function () { | ||
var androidVersionCode = require('./update-config-xml-android-version-code')(project); | ||
return __updateXml().then(androidVersionCode); | ||
} | ||
} | ||
var commitCommand = 'git add . && git commit -m "archive version: ' | ||
@@ -34,0 +44,0 @@ + version + '"'; |
'use strict'; | ||
var runCommand = require('../utils/run-command'); | ||
var path = require('path'); | ||
var chalk = require('chalk'); | ||
var ui = require('../ui'); | ||
var Promise = require('../ext/promise'); | ||
var runCommand = require('../utils/run-command'); | ||
var defaultPlatform = require('../utils/default-platform'); | ||
var path = require('path'); | ||
var chalk = require('chalk'); | ||
var ui = require('../ui'); | ||
var Promise = require('../ext/promise'); | ||
function createCommand(project, options) { | ||
var platform = options.platform || 'ios'; | ||
var command = 'cordova build ' + platform; | ||
var platform = options.platform || defaultPlatform(project); | ||
var command = 'cordova build ' + platform; | ||
if (options.emulate) { | ||
command += ' && cordova emulate ' + platform; | ||
if (options.emulateTarget) { | ||
if (options.emulateTarget[platform]) { | ||
command += ' --target="' + options.emulateTarget[platform] + '"'; | ||
} | ||
} | ||
} | ||
@@ -16,0 +23,0 @@ |
@@ -21,4 +21,9 @@ global.expect = require('chai').expect; | ||
}, | ||
root: 'project-root' | ||
root: 'project-root', | ||
config: function (){ | ||
return { | ||
cordova: {} | ||
}; | ||
} | ||
} | ||
}; |
{ | ||
"name": "ember-cli-cordova", | ||
"version": "0.0.17", | ||
"version": "0.0.19", | ||
"description": "A tool for creating hybrid apps using a combination of ember-cli and cordova ", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/poetic/ember-cli-cordova", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
88079
86
1812
15