This repository has been archived by the owner on Jul 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
102 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
'use strict'; | ||
|
||
var utils = require('../../../utils/utils.js'); | ||
var bowerConfig = require('./bower-config.js'); | ||
var cordovaConfig = require('./cordova-config.js'); | ||
|
||
module.exports = { | ||
main: [ | ||
// appName | ||
{ | ||
type: 'input', | ||
name: 'appName', | ||
message: '\nEnter a name for your project \nThis name will be displayed below the app icon.\n', | ||
validate: utils.validateAppName, | ||
when: function () { | ||
// Show this prompt only if appName is not already set | ||
return !this.appName; | ||
}.bind(this) | ||
}, | ||
// appId | ||
{ | ||
type: 'input', | ||
name: 'appId', | ||
message: '\nEnter an app identifier for your project \ne.g. com.company.project\n', | ||
validate: utils.validateAppId | ||
}, | ||
// ionic css | ||
{ | ||
type: 'list', | ||
name: 'ionicCss', | ||
message: '\nInclude Ionic styles as CSS or Sass\n', | ||
choices: [ | ||
{ | ||
name: 'Ionic CSS (faster, for starters)', | ||
value: true | ||
}, | ||
{ | ||
name: 'Ionic Sass (more flexible, for pros)', | ||
value: false | ||
} | ||
] | ||
}, | ||
// bower packages | ||
{ | ||
type: 'checkbox', | ||
name: 'bowerPackages', | ||
message: '\nChoose additional bower packages \nBesides angular, ionic, angular-ui-router and ngCordova.\n', | ||
choices: bowerConfig.optional | ||
}, | ||
// select platforms | ||
{ | ||
type: 'checkbox', | ||
name: 'platforms', | ||
message: '\nSelect Cordova platforms \nOnly works if you have the platforms correctly set up.\n', | ||
choices: cordovaConfig.platforms | ||
}, | ||
// select plugins | ||
{ | ||
type: 'checkbox', | ||
name: 'plugins', | ||
message: '\nSelect Cordova plugins \nInstall more later at any time.\n', | ||
choices: cordovaConfig.plugins | ||
}, | ||
], | ||
ecosystems: [ | ||
{ | ||
type: 'checkbox', | ||
name: 'ecosystems', | ||
message: '\nIntegrate into the following ecosystems \nCan als be done later, check out the README for further instructions.\n', | ||
choices: [{ | ||
name: 'Ionic Platform (beta)', | ||
value: 'ionic-platform' | ||
}, { | ||
name: 'Appmobi (have your APP_NAME, PROJECT_ID & CONFIG_URL ready)', | ||
value: 'appmobi' | ||
}, { | ||
name: 'ApiOmat (beta)', | ||
value: 'apiomat' | ||
}] | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict'; | ||
|
||
var assert = require('yeoman-assert'); | ||
var prompts = require('../generators/app/sources/prompts.js'); | ||
|
||
describe('generators/app/prompts', function () { | ||
it('prompts have proper formatting with \\n at beginning and end', function () { | ||
for (var key in prompts) { | ||
if (prompts.hasOwnProperty(key)) { | ||
for (var i = 0, prompt; (prompt = prompts[key][i]); i++) { | ||
assert.equal(prompt.message[0], '\n'); | ||
assert.equal(prompt.message[prompt.message.length - 1], '\n'); | ||
} | ||
} | ||
} | ||
}); | ||
}); |