Skip to content
This repository was archived by the owner on Apr 24, 2020. It is now read-only.

Commit 358ddce

Browse files
feat(naming) Let out the genie!
- this has too many changes to track.
1 parent 6c94b2c commit 358ddce

File tree

7 files changed

+70
-70
lines changed

7 files changed

+70
-70
lines changed

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
![official icon](https://img.shields.io/badge/Quasar%201.0-Official%20UI%20App%20Extension-blue.svg)
2-
![npm (scoped)](https://img.shields.io/npm/v/@quasar/quasar-app-extension-icon-factory.svg)
3-
[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/quasarframework/app-extension-icon-factory.svg)]()
4-
[![GitHub repo size in bytes](https://img.shields.io/github/repo-size/quasarframework/app-extension-icon-factory.svg)]()
5-
[![npm](https://img.shields.io/npm/dt/@quasar/quasar-app-extension-icon-factory.svg)](https://www.npmjs.com/package/@quasar/quasar-app-extension-icon-factory)
2+
![npm (scoped)](https://img.shields.io/npm/v/@quasar/quasar-app-extension-icon-genie.svg)
3+
[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/quasarframework/app-extension-icon-genie.svg)]()
4+
[![GitHub repo size in bytes](https://img.shields.io/github/repo-size/quasarframework/app-extension-icon-genie.svg)]()
5+
[![npm](https://img.shields.io/npm/dt/@quasar/quasar-app-extension-icon-genie.svg)](https://www.npmjs.com/package/@quasar/quasar-app-extension-icon-genie)
66

77
<img src="iconfactory.png" />
88

9-
# @quasar/icon-factory
9+
# @quasar/icon-genie
1010

1111
This node module outputs a set of **SQUARE** favicons, webicons, pwa-icons and electron-icons as well as iOS, Windows Store and MacOS icons from an original 1240x1240 square icon that retains transparency and also **minifies** the assets. It will also create splash screens for Cordova and even a minified svg.
1212

@@ -27,19 +27,19 @@ A final note: You should always pad your icon design with about 1% of empty spac
2727
- @quasar/cli version 1.0.0-beta.7 or higher (if building a new project) or @quasar/app v1.0.0-beta.25 or later in order to add this module as an app-extension.
2828

2929
### Note for early adopters
30-
Things have changed along the way to the RC, and if you have a version of the Icon Factory that is less than v1.0.0-beta.30 (you can find out by running `$ quasar info`), please follow these instructions:
30+
Things have changed along the way to the RC, and if you have a version of the Icon Genie that is less than v1.0.0-beta.30 (you can find out by running `$ quasar info`), please follow these instructions:
3131

3232
1. delete the `.icon-factory/` and all its components
3333
2. if its still there, delete the `quasar.icon-factory.json` file
3434
3. run: `$ quasar ext remove @quasar/icon-factory`
3535
4. move your icon source-file to `app-icon.png` in the root of your app
3636
5. if you want a custom splashscreen, put that file at `app-splashscreen.png`
37-
6. run: `$ quasar ext add @quasar/icon-factory`
37+
6. run: `$ quasar ext add @quasar/icon-genie`
3838

3939
### Install as an App Extension (Quasar v1.0+)
4040

4141
```bash
42-
$ quasar ext add @quasar/icon-factory
42+
$ quasar ext add @quasar/icon-genie
4343
```
4444

4545
If you are on Windows and seeing an error the likes of `pngquant failed to build, make sure that libpng-dev is installed`, please do the following:
@@ -62,7 +62,7 @@ The most important part (and indeed the only reason to use this extension) is po
6262
--------------------------------------------------------------------
6363
```
6464
> **Note:**
65-
Please use a valid png of 1240x1240 pixels. If you choose an image that is not square or has smaller dimensions, the icon-factory will do its best, but the results will not be optimal. Transparency is recommended. PNG is required.
65+
Please use a valid png of 1240x1240 pixels. If you choose an image that is not square or has smaller dimensions, the icon-genie will do its best, but the results will not be optimal. Transparency is recommended. PNG is required.
6666

6767
Then choose a minification strategy:
6868
```bash
@@ -80,18 +80,18 @@ You will be asked the same question for production. Our recommendation is to cho
8080
You will also be asked for a background color. This is used in the few cases that a background is required, as with Cordova splashscreens and Cordova iOS icons.
8181

8282
### Triggering
83-
The first time you start Quasar, icon-factory will create the images needed for the specific app artifacts. They will not automatically be added to git, so you will need to manage that yourself.
83+
The first time you start Quasar, icon-genie will create the images needed for the specific app artifacts. They will not automatically be added to git, so you will need to manage that yourself.
8484

8585
```bash
8686
$ quasar dev --mode electron
8787
```
8888

8989
You will also be asked which method of splashscreen generation you prefer, ranging from the mere placement of your logo upon the background color you specified, overlaying your icon on top of a splashscreen image, or just using the splashscreen image. If you aren't happy with the results, don't forget you can change it in `quasar.extensions.json`.
9090

91-
The final option during the install phase is to "always rebuild", which is useful for fine-tuning e.g. background colors, but if you don't remove this flag in quasar.extensions.json (or set it to false), the icon-factory will always run and slow down your dev buildtime.
91+
The final option during the install phase is to "always rebuild", which is useful for fine-tuning e.g. background colors, but if you don't remove this flag in quasar.extensions.json (or set it to false), the icon-genie will always run and slow down your dev buildtime.
9292

9393
### Intermediary Folder
94-
The icon-factory makes an intermediary folder in the `node_modules/@quasar/icon-factory/tmp` folder to host the images when you switch between dev and build. If you haven't changed the source icon, these will merely be copied to the right destination folders.
94+
The icon-genie makes an intermediary folder in the `node_modules/@quasar/icon-genie/tmp` folder to host the images when you switch between dev and build. If you haven't changed the source icon, these will merely be copied to the right destination folders.
9595

9696
### Changing the Source Image
9797
If you don't change the source image for the icon or the splashscreen, you will see a default iamge that reminds you to do this.
@@ -103,7 +103,7 @@ All relevant settings are stored in `quasar.extensions.json`, and if you change
103103
### Uninstalling
104104
Run:
105105
```
106-
$ quasar ext remove @quasar/icon-factory
106+
$ quasar ext remove @quasar/icon-genie
107107
```
108108

109109
This will remove the extension, its dependencies - but not any of the icons it created.
@@ -125,7 +125,7 @@ Splashscreens are obviously a little different depending on whether you are targ
125125
- https://github.com/apache/cordova-plugin-splashscreen#readme
126126

127127
## How it Works
128-
There are 5 things that Icon Factory does with your original file. It will create a set of webicons for your project, it will minify those icons, it can make special icns (Mac) / ico (Windows) files for apps that need them and it will create SVG assets. Finally it will sort these icons into folders.
128+
There are 5 things that Icon Genie does with your original file. It will create a set of webicons for your project, it will minify those icons, it can make special icns (Mac) / ico (Windows) files for apps that need them and it will create SVG assets. Finally it will sort these icons into folders.
129129

130130
Here is the description of these general functions that are used internally to compose icon sets and if you just want to use them, feel free:
131131

@@ -187,21 +187,21 @@ If you are indeed of a discerning nature (and have used gradients in your icon d
187187
To make these SVG's as small as possible, they are compressed with SVGO. There are no scripts or remote resources included in these SVG assets.
188188

189189
## CLI Usage
190-
The Icon Factory can be used as a command line tool for batch invocation, and you can simply add it by installing it "globally" with your node package manager:
190+
The Icon Genie can be used as a command line tool for batch invocation, and you can simply add it by installing it "globally" with your node package manager:
191191
```bash
192-
$ yarn global add @quasar/quasar-app-extension-icon-factory
192+
$ yarn global add @quasar/quasar-app-extension-icon-genie
193193
- or -
194-
$ npm install --global @quasar/quasar-app-extension-icon-factory
194+
$ npm install --global @quasar/quasar-app-extension-icon-genie
195195
```
196196

197197
To find out about the settings, just use
198198
```
199-
$ iconfactory --help
199+
$ icongenie --help
200200
201-
Quasar Icon Factory: v.1.0.0
201+
Quasar Icon Genie: v.1.0.0
202202
License: MIT
203203
204-
Icon Factory is a node utility to create a batch of icons for your app.
204+
Icon Genie is a node utility to create a batch of icons for your app.
205205
Designed to work seamlessly with the Quasar Framework, but probably
206206
useful for other build pipelines.
207207
@@ -220,8 +220,8 @@ Flags:
220220
221221
Usage:
222222
223-
$ iconfactory -p=kitchensink -s=icon-1280x1280.png -t=./outputFolder -m=pngquant
224-
$ iconfactory -p=minify -s=icon-1240x1240.png -t=./output -m=pngquant -d=singlefile
223+
$ icongenie -p=kitchensink -s=icon-1280x1280.png -t=./outputFolder -m=pngquant
224+
$ icongenie -p=minify -s=icon-1240x1240.png -t=./output -m=pngquant -d=singlefile
225225
```
226226

227227
## Consuming as a library
@@ -274,5 +274,5 @@ You are welcome to join this project. Please file issues and make PRs! Let us kn
274274
## Licenses
275275
- Code: MIT
276276
- © 2018: Present Daniel Thompson-Yvetot & Razvan Stoenescu
277-
- Original Image for iconfactory: [Public Domain](https://www.publicdomainpictures.net/pictures/180000/nahled/coffee-grinder-14658946414E8.jpg)
277+
- Original Image for icongenie: [Public Domain](https://www.publicdomainpictures.net/pictures/180000/nahled/coffee-grinder-14658946414E8.jpg)
278278
- Modifications: Daniel Thompson-Yvetot. CC-BY

bin/cli.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ const args = require('minimist')(process.argv.slice(2), {
2121
})
2222

2323
if (args.version) {
24-
console.log('Quasar Icon Factory: v.' + info.version)
24+
console.log('Quasar Icon Genie: v.' + info.version)
2525
console.log(' License: MIT')
2626
process.exit(0)
2727
}
2828

2929
if (args.help) {
30-
console.log('Quasar Icon Factory: v.' + info.version)
30+
console.log('Quasar Icon Genie: v.' + info.version)
3131
console.log(' License: MIT')
3232
console.log(`
33-
The Icon Factory is a node utility to create a batch of icons for your app.
33+
The Icon Genie is a node utility to create a batch of icons for your app.
3434
Designed to work seamlessly with the Quasar Framework, but probably
3535
useful for other build pipelines.
3636
@@ -50,14 +50,14 @@ Flags:
5050
5151
Usage:
5252
53-
$ iconfactory -p=kitchensink -s=icon-1280x1280.png -t=./outputFolder -m=pngquant
54-
$ iconfactory -p=minify -s=icon-1240x1240.png -t=./output -m=pngquant -d=singlefile
53+
$ icongenie -p=kitchensink -s=icon-1280x1280.png -t=./outputFolder -m=pngquant
54+
$ icongenie -p=minify -s=icon-1240x1240.png -t=./output -m=pngquant -d=singlefile
5555
`)
5656
process.exit(0)
5757
}
5858

5959
if (!args.preset) {
60-
console.log('Icon Factory: v.' + info.version)
60+
console.log('Icon Genie: v.' + info.version)
6161
console.log('You must choose a preset or declare custom.')
6262
console.log(
6363
' -p, --preset [minify|splash|svg|favicon]\n' +
@@ -67,68 +67,68 @@ if (!args.preset) {
6767
}
6868

6969
if (!args.source) {
70-
console.log('Icon Factory: v.' + info.version)
70+
console.log('Icon Genie: v.' + info.version)
7171
console.log('You must provide a source file.')
7272
console.log(' -s, --source Your source image as a large square png\n')
7373
process.exit(0)
7474
}
7575

7676
if (!fs.existsSync(args.source)) {
77-
console.log('Icon Factory: v.' + info.version)
77+
console.log('Icon Genie: v.' + info.version)
7878
console.log('That is not a file, provide a source image.')
7979
console.log(' -s, --source Your source image as a large square png\n')
8080
process.exit(0)
8181
}
8282

8383
if (!args.target) {
84-
console.log('Icon Factory: v.' + info.version)
84+
console.log('Icon Genie: v.' + info.version)
8585
console.log('You must provide a target folder.')
8686
console.log(' -t, --target The destination directory for the files created\n')
8787
process.exit(0)
8888
}
8989

9090
if (args.preset === 'custom' && !args.options) {
91-
console.log('Icon Factory: v.' + info.version)
91+
console.log('Icon Genie: v.' + info.version)
9292
console.log('You must add a file that has the options if you use custom preset')
9393
console.log(' -o, --options path to file that overrides defaults (if custom)\n')
9494
process.exit(0)
9595
}
9696

97-
const iconfactory = require('../lib/index.js')
97+
const icongenie = require('../lib/index.js')
9898

9999
switch (args.preset) {
100100
case 'minify':
101-
iconfactory.minify(args.source, false, args.minify, args.mode)
101+
icongenie.minify(args.source, false, args.minify, args.mode)
102102
break
103103
case 'splash':
104-
iconfactory.splash(args.source, false, args.minify, args.mode)
104+
icongenie.splash(args.source, false, args.minify, args.mode)
105105
break
106106
case 'svg':
107-
iconfactory.svg(args.source, args.target)
107+
icongenie.svg(args.source, args.target)
108108
break
109109
case 'favicon':
110-
iconfactory.favicon(args.source, args.target)
110+
icongenie.favicon(args.source, args.target)
111111
break
112112
case 'kitchensink':
113-
iconfactory.kitchensink(args.source, args.target, args.minify)
113+
icongenie.kitchensink(args.source, args.target, args.minify)
114114
break
115115
case 'spa':
116-
iconfactory.spa(args.source, args.target, args.minify)
116+
icongenie.spa(args.source, args.target, args.minify)
117117
break
118118
case 'pwa':
119-
iconfactory.pwa(args.source, args.target, args.minify)
119+
icongenie.pwa(args.source, args.target, args.minify)
120120
break
121121
case 'cordova':
122-
iconfactory.cordova(args.source, args.target, args.minify)
122+
icongenie.cordova(args.source, args.target, args.minify)
123123
break
124124
case 'electron':
125-
iconfactory.electron(args.source, args.target, args.minify)
125+
icongenie.electron(args.source, args.target, args.minify)
126126
break
127127
case 'custom':
128-
iconfactory.custom(args.source, args.target, args.options)
128+
icongenie.custom(args.source, args.target, args.options)
129129
break
130130
case 'validate':
131-
iconfactory.validate(args.source, args.target)
131+
icongenie.validate(args.source, args.target)
132132
break
133133
default:
134134
console.log('You must supply a preset')

lib/index.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* It will retain transparency and can make special file
77
* types. You can control the settings.
88
*
9-
* @module icon-factory
10-
* @exports iconfactory
9+
* @module icon-genie
10+
* @exports icongenie
1111
*/
1212

1313
const { promisify } = require('util'),
@@ -82,15 +82,15 @@ const checkSrc = async function (src) {
8282
const srcExists = await exists(src)
8383
if (!srcExists) {
8484
image = false
85-
throw 'Source image for icon-factory not found'
85+
throw 'Source image for icon-genie not found'
8686
} else {
8787
const buffer = await readChunk(src, 0, 8)
8888
if (isPng(buffer) === true) {
8989
// console.log('created image buffer')
9090
return (image = sharp(src))
9191
} else {
9292
image = false
93-
console.error('* [ERROR] Source image for icon-factory is not a png')
93+
console.error('* [ERROR] Source image for icon-genie is not a png')
9494
// exit because this is BAD!
9595
// Developers should catch () { } this as it is
9696
// the last chance to stop bad things happening.
@@ -189,7 +189,7 @@ const spinner = function () {
189189
},500)
190190
}
191191

192-
let iconfactory = exports.iconfactory = {
192+
let icongenie = exports.icongenie = {
193193
validate: async function (src, target) {
194194
await validate(src, target)
195195
return typeof image === 'object'
@@ -215,7 +215,7 @@ let iconfactory = exports.iconfactory = {
215215
} else {
216216
console.log('no minify strategy')
217217
}
218-
progress('Icon Factory Finished')
218+
progress('Icon Genie Finished')
219219
clearInterval(spinnerInterval)
220220
},
221221
electron: async function(src, target, strategy, options) {
@@ -232,7 +232,7 @@ let iconfactory = exports.iconfactory = {
232232
} else {
233233
console.log('no minify strategy')
234234
}
235-
progress('Icon Factory Finished')
235+
progress('Icon Genie Finished')
236236
clearInterval(spinnerInterval)
237237
},
238238
pwa: async function(src, target, strategy, options) {
@@ -251,7 +251,7 @@ let iconfactory = exports.iconfactory = {
251251
} else {
252252
console.log('no minify strategy')
253253
}
254-
progress('Icon Factory Finished')
254+
progress('Icon Genie Finished')
255255
clearInterval(spinnerInterval)
256256
},
257257
spa: async function(src, target, strategy, options) {
@@ -270,7 +270,7 @@ let iconfactory = exports.iconfactory = {
270270
} else {
271271
console.log('no minify strategy')
272272
}
273-
progress('Icon Factory Finished')
273+
progress('Icon Genie Finished')
274274
clearInterval(spinnerInterval)
275275
// await this.svgDuochrome(src, target, options)
276276
},
@@ -600,7 +600,7 @@ let iconfactory = exports.iconfactory = {
600600

601601
if (typeof exports !== 'undefined') {
602602
if (typeof module !== 'undefined' && module.exports) {
603-
exports = module.exports = iconfactory
603+
exports = module.exports = icongenie
604604
}
605-
exports.iconfactory = iconfactory
605+
exports.icongenie = icongenie
606606
}

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": "@quasar/quasar-app-extension-icon-factory",
3-
"version": "1.0.0-rc.6",
4-
"description": "A Quasar CLI Extension",
2+
"name": "@quasar/quasar-app-extension-icon-genie",
3+
"version": "1.0.0",
4+
"description": "A Quasar CLI Extension for Making All Your Icons",
55
"license": "MIT",
66
"author": "Daniel Thompson-Yvetot <35242872+nothingismagick@users.noreply.github.com>",
7-
"repository": "git@github.com:quasarframework/app-extension-icon-factory.git",
7+
"repository": "git@github.com:quasarframework/app-extension-icon-genie.git",
88
"main": "src/index.js",
99
"bin": {
10-
"iconfactory": "./bin/cli.js"
10+
"icongenie": "./bin/cli.js"
1111
},
1212
"scripts": {
1313
"format": "prettier --write bin/*.js lib/*.js src/*.js test/*.js",

0 commit comments

Comments
 (0)