Skip to content

Commit 4b6bcf1

Browse files
Add support for pwa - fixes #7
1 parent 41d9549 commit 4b6bcf1

4 files changed

Lines changed: 30 additions & 3 deletions

File tree

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ const pathExists = require('path-exists');
44
const pify = require('pify');
55
const gm = require('gm');
66
const mkdir = require('mkdirp');
7+
const pwaIcons = require('pwa-icon-list');
78
const androidIcons = require('android-icon-list');
89
const bb10Icons = require('bb10-icon-list');
910
const iosIcons = require('ios-icon-list');
1011

1112
const mkdirp = pify(mkdir);
1213

1314
const platformIcons = {
15+
pwa: pwaIcons(),
1416
android: androidIcons(),
1517
ios: iosIcons(),
1618
blackberry10: bb10Icons()

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"ios-icon-list": "^1.0.0",
3838
"mkdirp": "^0.5.1",
3939
"path-exists": "^3.0.0",
40-
"pify": "^2.3.0"
40+
"pify": "^2.3.0",
41+
"pwa-icon-list": "^1.0.0"
4142
},
4243
"devDependencies": {
4344
"ava": "*",

readme.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Source file of the icon.
6565

6666
*Required*<br>
6767
Type: `string`<br>
68-
Values: `android` `ios` `blackberry10`
68+
Values: `pwa` `android` `ios` `blackberry10`
6969

7070
Platform to generate the icons for.
7171

@@ -93,7 +93,18 @@ Directory to save the generated icons.
9393

9494
## Platforms
9595

96-
The supported platforms are `Android`, `iOS` and `BlackBerry 10`. Every platform generates a different set of icons.
96+
The supported platforms are `PWA`, `Android`, `iOS` and `BlackBerry 10`. Every platform generates a different set of icons.
97+
98+
### PWA
99+
100+
- `icon-72x72.png`
101+
- `icon-96x96.png`
102+
- `icon-128x128.png`
103+
- `icon-144x144.png`
104+
- `icon-152x152.png`
105+
- `icon-192x192.png`
106+
- `icon-384x384.png`
107+
- `icon-512x512.png`
97108

98109
### Android
99110

test.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ test.beforeEach(t => {
1010
t.context.tmp = tempfile();
1111
});
1212

13+
test('pwa', async t => {
14+
await fn('fixtures/icon.png', {platform: 'pwa', dest: t.context.tmp});
15+
16+
t.true(pathExists.sync(path.join(t.context.tmp, 'icon-72x72.png')));
17+
t.true(pathExists.sync(path.join(t.context.tmp, 'icon-96x96.png')));
18+
t.true(pathExists.sync(path.join(t.context.tmp, 'icon-128x128.png')));
19+
t.true(pathExists.sync(path.join(t.context.tmp, 'icon-144x144.png')));
20+
t.true(pathExists.sync(path.join(t.context.tmp, 'icon-152x152.png')));
21+
t.true(pathExists.sync(path.join(t.context.tmp, 'icon-192x192.png')));
22+
t.true(pathExists.sync(path.join(t.context.tmp, 'icon-384x384.png')));
23+
t.true(pathExists.sync(path.join(t.context.tmp, 'icon-512x512.png')));
24+
});
25+
1326
test('android', async t => {
1427
await fn('fixtures/icon.png', {platform: 'android', dest: t.context.tmp});
1528

0 commit comments

Comments
 (0)