File tree Expand file tree Collapse file tree 5 files changed +89
-1
lines changed
blueprints/ember-cli-capacitor Expand file tree Collapse file tree 5 files changed +89
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ module.exports = {
2626 {
2727 files : [
2828 '.eslintrc.js' ,
29+ '.prettierrc.js' ,
2930 '.template-lintrc.js' ,
3031 'ember-cli-build.js' ,
3132 'index.js' ,
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ module . exports = {
4+ singleQuote : true ,
5+ trailingComma : 'none' ,
6+ overrides : [
7+ {
8+ files : '**/*.hbs' ,
9+ options : {
10+ parser : 'glimmer' ,
11+ singleQuote : false
12+ }
13+ }
14+ ]
15+ } ;
Original file line number Diff line number Diff line change 1+ {
2+ "appId" : " com.example.app" ,
3+ "appName" : " ember-capacitor-app" ,
4+ "bundledWebRuntime" : false ,
5+ "npmClient" : " yarn" ,
6+ "webDir" : " dist" ,
7+ "server" : {
8+ "url" : " http://localhost:4200" ,
9+ "allowNavigation" : [
10+ " example.org" ,
11+ " *.example.org"
12+ ]
13+ },
14+ "plugins" : {
15+ "SplashScreen" : {
16+ "launchShowDuration" : 0
17+ }
18+ },
19+ "cordova" : {}
20+ }
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ const { execSync } = require ( 'child_process' ) ;
4+
5+ module . exports = {
6+ description : 'Sets up Capacitor for your Ember app.' ,
7+
8+ afterInstall ( ) {
9+ this . addPackagesToProject ( [
10+ { name : '@capacitor/core' } ,
11+ { name : '@capacitor/cli' }
12+ ] ) ;
13+ } ,
14+
15+ /**
16+ * Uses inquirer to prompt the user to select which platforms to support
17+ * @returns {Promise } Resolves into array of selected platforms
18+ * @private
19+ */
20+ _addPlatforms ( ) {
21+ let choices = [
22+ {
23+ checked : true ,
24+ name : 'iOS' ,
25+ value : 'ios'
26+ } ,
27+ {
28+ checked : true ,
29+ name : 'Android' ,
30+ value : 'android'
31+ } ,
32+ {
33+ checked : true ,
34+ name : 'Electron' ,
35+ value : 'electron'
36+ }
37+ ] ;
38+
39+ // Ask which npm packages to install
40+ return this . ui . prompt ( {
41+ type : 'checkbox' ,
42+ name : 'platforms' ,
43+ message : 'Which platforms would you like to support?' ,
44+ choices
45+ } )
46+ . then ( ( selected ) => {
47+ selected . platforms . forEach ( ( platform ) => {
48+ execSync ( `npx cap add ${ platform } ` ) ;
49+ } ) ;
50+ } ) ;
51+ }
52+ } ;
Original file line number Diff line number Diff line change 11{
22 "name" : " ember-cli-capacitor" ,
33 "version" : " 0.0.0" ,
4- "description" : " The default blueprint for ember-cli addons ." ,
4+ "description" : " Add capacitor to your Ember apps ." ,
55 "keywords" : [
66 " ember-addon"
77 ],
You can’t perform that action at this time.
0 commit comments