create-pwa
Advanced tools
Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "create-pwa", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Easily create a progressive web app", | ||
"scripts": { | ||
"test": "node ./test/index.js" | ||
"test": "tape test.js" | ||
}, | ||
@@ -30,4 +30,5 @@ "bin": { | ||
"sharp": "^0.20.2", | ||
"tape": "^4.9.0", | ||
"yargs": "^11.0.0" | ||
} | ||
} |
@@ -6,2 +6,3 @@ [![GitHub stars](https://img.shields.io/github/stars/scriptex/create-pwa.svg?style=social&label=Stars)](https://github.com/scriptex/create-pwa) | ||
[![GitHub last commit](https://img.shields.io/github/last-commit/scriptex/create-pwa.svg)](https://github.com/scriptex/create-pwa/commits/master) | ||
[![Build Status](https://travis-ci.org/scriptex/create-pwa.svg?branch=master)](https://travis-ci.org/scriptex/create-pwa) | ||
[![npm](https://img.shields.io/npm/dt/create-pwa.svg)](https://www.npmjs.com/package/create-pwa) | ||
@@ -41,3 +42,7 @@ [![npm](https://img.shields.io/npm/v/create-pwa.svg)](https://www.npmjs.com/package/create-pwa) | ||
```console | ||
# Using NPM: | ||
npm i -g create-pwa | ||
# Using Yarn | ||
yarn global add create-pwa | ||
``` | ||
@@ -48,3 +53,3 @@ | ||
```console | ||
npx create-pwa | ||
npx create-pwa --icon="./icon.png" | ||
``` | ||
@@ -54,3 +59,3 @@ | ||
`icon`: Specifies relative path to the application icon. This path is relative to the folder you are located in currently (`your/app/folder`). | ||
`icon`: Specifies relative path to the application icon. This path is relative to the folder you are located in currently (`your/app/folder`). It is recommended that the icon file should be at least 512 pixels wide and 512 pixels high. **The `icon` argument is required.** | ||
@@ -65,2 +70,6 @@ ## Usage | ||
# If installed globally: | ||
create-pwa --icon="./icon.png" | ||
# Using NPX: | ||
npx create-pwa --icon="./icon.png" | ||
@@ -67,0 +76,0 @@ ``` |
@@ -25,8 +25,6 @@ /** | ||
for (const size of iconSizes) { | ||
const dimensions = size.split('x'); | ||
const width = Number(dimensions[0]); | ||
const height = Number(dimensions[1]); | ||
const [width, height] = size.split('x'); | ||
sharp(icon) | ||
.resize(width, height) | ||
.resize(Number(width), Number(height)) | ||
.png() | ||
@@ -33,0 +31,0 @@ .toFile(`${folder}/icon-${size}.png`); |
@@ -60,5 +60,8 @@ #!/usr/bin/env node | ||
const setIcons = icon => { | ||
const ext = icon.split('.').pop(); | ||
if (!icon) { | ||
return; | ||
} | ||
const dir = resolve(pwd, 'icons'); | ||
const image = resolve(pwd, icon); | ||
const dir = resolve(pwd, 'icons'); | ||
@@ -75,6 +78,6 @@ if (!existsSync(dir)) { | ||
*/ | ||
const create = () => { | ||
const create = ({ icon }) => { | ||
const name = getAppName(); | ||
argv.icon && setIcons(argv.icon); | ||
setIcons(argv.icon || icon); | ||
@@ -85,6 +88,9 @@ setManifest(name); | ||
create(); | ||
create({ | ||
icon: './icon.png' | ||
}); | ||
module.exports = create; | ||
module.exports.setIcons = setIcons; | ||
module.exports.setManifest = setManifest; | ||
module.exports.setServiceWorker = setServiceWorker; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
48462
232
127
0
3
7