Skip to content

Commit 74c0d03

Browse files
Start on blueprints
1 parent 4809759 commit 74c0d03

File tree

5 files changed

+89
-1
lines changed

5 files changed

+89
-1
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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',

.prettierrc.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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
],

0 commit comments

Comments
 (0)