Skip to content

Commit 7c311b6

Browse files
committed
Rename repository and CLI command to optimize
1 parent da1bd45 commit 7c311b6

File tree

5 files changed

+67
-68
lines changed

5 files changed

+67
-68
lines changed

CHANGELOG.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and 
99

1010
### Changed
1111

12+
- The repository and CLI command have been renamed to `optimize`.
13+
- The `optimize` command now works with `pnpm`.
1214
- Apple touch icons are no longer generated.
1315
- Webp touch icons are no longer generated.
1416
- The processing of a specific image will now be skipped if the originDensity specified does not equal the maxDensity value available for that image in the metadata file.
@@ -102,15 +104,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and 
102104

103105
### Fixed
104106

105-
- The `conjure favicons` command now works fine on Windows.
107+
- The `optimize favicons` command now works fine on Windows.
106108
- The `webmanifest` is now generated with a final newline.
107109

108110
## [1.0.0] — 2024–04–19
109111

110112
### Changed
111113

112-
- Now the `conjure favicons` command does not generate the entire set of files for each SVG found, including those nested in subdirectories. Instead, this command only works with files in the specified directory and expects at least one of `touch.svg`, `32.svg` and `16.svg` (preferably only the first two, and the third only if there is such a version in the design). See [README.md](./README.md) for details on preparing and working with these files.
113-
- Now the `-r` (`--removeOrigin`) option also applies to the `conjure favicons` command.
114+
- Now the `optimize favicons` command does not generate the entire set of files for each SVG found, including those nested in subdirectories. Instead, this command only works with files in the specified directory and expects at least one of `touch.svg`, `32.svg` and `16.svg` (preferably only the first two, and the third only if there is such a version in the design). See [README.md](./README.md) for details on preparing and working with these files.
115+
- Now the `-r` (`--removeOrigin`) option also applies to the `optimize favicons` command.
114116

115117
### Added
116118

@@ -134,18 +136,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and 
134136

135137
- Basic functionality.
136138

137-
[Unreleased]: https://github.com/firefoxic/conjure/compare/v3.0.1...HEAD
138-
[3.0.1]: https://github.com/firefoxic/conjure/compare/v3.0.0...v3.0.1
139-
[3.0.0]: https://github.com/firefoxic/conjure/compare/v2.1.3...v3.0.0
140-
[2.1.3]: https://github.com/firefoxic/conjure/compare/v2.1.2...v2.1.3
141-
[2.1.2]: https://github.com/firefoxic/conjure/compare/v2.1.1...v2.1.2
142-
[2.1.1]: https://github.com/firefoxic/conjure/compare/v2.1.0...v2.1.1
143-
[2.1.0]: https://github.com/firefoxic/conjure/compare/v2.0.0...v2.1.0
144-
[2.0.0]: https://github.com/firefoxic/conjure/compare/v1.0.3...v2.0.0
145-
[1.0.3]: https://github.com/firefoxic/conjure/compare/v1.0.2...v1.0.3
146-
[1.0.2]: https://github.com/firefoxic/conjure/compare/v1.0.1...v1.0.2
147-
[1.0.1]: https://github.com/firefoxic/conjure/compare/v1.0.0...v1.0.1
148-
[1.0.0]: https://github.com/firefoxic/conjure/compare/v0.1.2...v1.0.0
149-
[0.1.2]: https://github.com/firefoxic/conjure/compare/v0.1.1...v0.1.2
150-
[0.1.1]: https://github.com/firefoxic/conjure/compare/v0.1.0...v0.1.1
151-
[0.1.0]: https://github.com/firefoxic/conjure/releases/tag/v0.1.0
139+
[Unreleased]: https://github.com/firefoxic/optimize/compare/v3.0.1...HEAD
140+
[3.0.1]: https://github.com/firefoxic/optimize/compare/v3.0.0...v3.0.1
141+
[3.0.0]: https://github.com/firefoxic/optimize/compare/v2.1.3...v3.0.0
142+
[2.1.3]: https://github.com/firefoxic/optimize/compare/v2.1.2...v2.1.3
143+
[2.1.2]: https://github.com/firefoxic/optimize/compare/v2.1.1...v2.1.2
144+
[2.1.1]: https://github.com/firefoxic/optimize/compare/v2.1.0...v2.1.1
145+
[2.1.0]: https://github.com/firefoxic/optimize/compare/v2.0.0...v2.1.0
146+
[2.0.0]: https://github.com/firefoxic/optimize/compare/v1.0.3...v2.0.0
147+
[1.0.3]: https://github.com/firefoxic/optimize/compare/v1.0.2...v1.0.3
148+
[1.0.2]: https://github.com/firefoxic/optimize/compare/v1.0.1...v1.0.2
149+
[1.0.1]: https://github.com/firefoxic/optimize/compare/v1.0.0...v1.0.1
150+
[1.0.0]: https://github.com/firefoxic/optimize/compare/v0.1.2...v1.0.0
151+
[0.1.2]: https://github.com/firefoxic/optimize/compare/v0.1.1...v0.1.2
152+
[0.1.1]: https://github.com/firefoxic/optimize/compare/v0.1.0...v0.1.1
153+
[0.1.0]: https://github.com/firefoxic/optimize/releases/tag/v0.1.0

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# Conjure
1+
# Optimize
22

33
[![License: MIT][license-image]][license-url]
44
[![Changelog][changelog-image]][changelog-url]
55
[![NPM version][npm-image]][npm-url]
66
[![Test Status][test-image]][test-url]
77

8-
🪄 Conjure images, icons and favicons for your frontend project.
8+
Optimize images, icons and favicons for your frontend project.
99

1010
<picture>
11-
<source srcset="https://raw.githubusercontent.com/firefoxic/conjure/main/example/dark.webp" media="(prefers-color-scheme: dark)">
12-
<img src="https://raw.githubusercontent.com/firefoxic/conjure/main/example/light.webp" alt="Example showing the source files, and the files after running the 'conjure all -r -m' command.">
11+
<source srcset="https://raw.githubusercontent.com/firefoxic/optimize/main/example/dark.webp" media="(prefers-color-scheme: dark)">
12+
<img src="https://raw.githubusercontent.com/firefoxic/optimize/main/example/light.webp" alt="Example showing the source files, and the files after running the 'optimize all -r -m' command.">
1313
</picture>
1414

1515
## Purpose
1616

1717
In most frontend projects, you have to perform the same and rather boring actions with images between exporting them from Figma and deploying the project to the server. Spare yourself from this routine!
1818

19-
Conjure is a command line utility for optimizing vector images, converting raster images to modern formats for different pixel densities and also preparing favicons.
19+
Optimize is a command line utility for optimizing vector images, converting raster images to modern formats for different pixel densities and also preparing favicons.
2020

2121
## Installation
2222

23-
To install Conjure, you need to have Node.js installed on your machine. Then you can install in your project using _pnpm_ (for _npm_, just remove the first `p`):
23+
To install Optimize, you need to have Node.js installed on your machine. Then you can install in your project using _pnpm_ (for _npm_, just remove the first `p`):
2424

2525
```shell
2626
pnpm add @firefoxic/conjure -D
@@ -34,18 +34,18 @@ pnpm add @firefoxic/conjure -g
3434

3535
## Usage
3636

37-
Conjure is invoked via the command line:
37+
Optimize is invoked via the command line:
3838

3939
- with globally installation:
4040

4141
```shell
42-
conjure <command> [options]
42+
optimize <command> [options]
4343
```
4444

4545
- with locally installation (in a project):
4646

4747
```shell
48-
pnpm exec conjure <command> [options]
48+
pnpm exec optimize <command> [options]
4949
```
5050

5151
- without installation:
@@ -114,7 +114,7 @@ Conjure is invoked via the command line:
114114
- In the `source/images` folder, optimize all SVGs and convert the raster images to `avif` and `webp` formats at the original size for `2x` pixel density and at a reduced size for `1x` pixel density; and after processing the raster images, delete their original files and generate JSON and JS files with metadata:
115115

116116
```shell
117-
conjure images --input-directory=source/images --remove-origin --add-meta-data
117+
optimize images --input-directory=source/images --remove-origin --add-meta-data
118118
```
119119

120120
> #### Tip for exporting raster layers from layouts
@@ -124,13 +124,13 @@ Conjure is invoked via the command line:
124124
- Take all vector and raster images from the `raws/images` folder; optimize vector images and put them in `source/images`; convert raster images to `webp` format and to the original format, optimizing them for `2x` and `1x` pixel densities, placing these results also in `source/images`; when processing is completed, delete the original raster images from `raws/images`:
125125

126126
```shell
127-
conjure images -i raws/images -o source/images -f webp -a -r
127+
optimize images -i raws/images -o source/images -f webp -a -r
128128
```
129129

130130
- Optimize SVG icons in the default `src/shared/icons` folder and create the CSS file that contain custom properties with paths to the icons:
131131

132132
```shell
133-
conjure icons -m
133+
optimize icons -m
134134
```
135135

136136
- In the `assets` folder, convert files `touch.svg`, `32.svg` (and optionaly `16.svg`) to:
@@ -142,7 +142,7 @@ Conjure is invoked via the command line:
142142
- `Links.md` — advice on code of links for generated files, moving files, and fixing paths to files.
143143

144144
```shell
145-
conjure favicons -p assets
145+
optimize favicons -p assets
146146
```
147147

148148
> #### Recommendations for the source favicon files
@@ -151,26 +151,26 @@ Conjure is invoked via the command line:
151151
> - `32.svg` — the drawing is adjusted to a `32×32` pixel grid, may transparent areas such as rounded corners of the background;
152152
> - `touch.svg` — the drawing is prepared for large touch icons with solid background without rounding, with margins much larger than `32.svg`.
153153
> - If you don't have a variant specially prepared by the designer for the pixel grid size `16×16`, then don't create a file `16.svg` from variants of other sizes — it will only increase the weight of the final `favicon.ico`.
154-
> - If you don't have a `32×32` variant, but you have a `16×16` variant, there is no need to make a `32.svg` file, `conjure` will make all the variants for you.
155-
> - If you have only one variant and it's not `16×16`, it doesn't matter what you name the file, `32.svg` or `touch.svg` (as long as it's not `16.svg`) — a file with either of these two names will be used by `conjure` to generate the entire set of favicons.
154+
> - If you don't have a `32×32` variant, but you have a `16×16` variant, there is no need to make a `32.svg` file, `optimize` will make all the variants for you.
155+
> - If you have only one variant and it's not `16×16`, it doesn't matter what you name the file, `32.svg` or `touch.svg` (as long as it's not `16.svg`) — a file with either of these two names will be used by `optimize` to generate the entire set of favicons.
156156

157157
- Run all three special commands with default settings, but deleting the original raster images, i.e.:
158-
- run `conjure images` in the `src/shared/images` folder with deleting the original raster images and generating JSON and JS files with metadata,
159-
- run `conjure icons` in the `src/shared/icons` folder,
160-
- run `conjure favicons` in the `public` folder,
158+
- run `optimize images` in the `src/shared/images` folder with deleting the original raster images and generating JSON and JS files with metadata,
159+
- run `optimize icons` in the `src/shared/icons` folder,
160+
- run `optimize favicons` in the `public` folder,
161161

162162
```shell
163-
conjure all -r -m
163+
optimize all -r -m
164164
```
165165

166-
[license-url]: https://github.com/firefoxic/conjure/blob/main/LICENSE.md
166+
[license-url]: https://github.com/firefoxic/optimizee/blob/main/LICENSE.md
167167
[license-image]: https://img.shields.io/badge/License-MIT-limegreen.svg
168168

169-
[changelog-url]: https://github.com/firefoxic/conjure/blob/main/CHANGELOG.md
169+
[changelog-url]: https://github.com/firefoxic/optimizee/blob/main/CHANGELOG.md
170170
[changelog-image]: https://img.shields.io/badge/Changelog-md-limegreen
171171

172172
[npm-url]: https://npmjs.org/package/@firefoxic/conjure
173173
[npm-image]: https://img.shields.io/npm/v/%40firefoxic%2Fconjure?logo=npm&color=limegreen
174174

175-
[test-url]: https://github.com/firefoxic/conjure/actions
176-
[test-image]: https://github.com/firefoxic/conjure/actions/workflows/test.yaml/badge.svg?branch=main
175+
[test-url]: https://github.com/firefoxic/optimize/actions
176+
[test-image]: https://github.com/firefoxic/optimize/actions/workflows/test.yaml/badge.svg?branch=main

bin/cli.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
import meow from "meow"
44

5-
import { conjureAll, conjureFavicons, conjureIcons, conjureImages } from "../lib/index.js"
5+
import { optimizeAll, optimizeFavicons, optimizeIcons, optimizeImages } from "../lib/index.js"
66

77
let cli = meow(`
88
Usage
9-
$ conjure <command> [options]
9+
$ optimize <command> [options]
1010
1111
Commands
1212
images
@@ -58,11 +58,11 @@ let cli = meow(`
5858
5959
Examples
6060
61-
$ conjure images --inputDirectory=source/images --removeOrigin -m
62-
$ conjure images -i raws/images -o source/images -f webp -a -r
63-
$ conjure icons
64-
$ conjure favicons -p assets/favicons
65-
$ conjure all -r -m
61+
$ optimize images --inputDirectory=source/images --removeOrigin -m
62+
$ optimize images -i raws/images -o source/images -f webp -a -r
63+
$ optimize icons
64+
$ optimize favicons -p assets/favicons
65+
$ optimize all -r -m
6666
6767
`, {
6868
importMeta: import.meta,
@@ -123,16 +123,16 @@ if (!(`outputDirectory` in cli.flags)) {
123123

124124
switch (command) {
125125
case `images`:
126-
await conjureImages(options)
126+
await optimizeImages(options)
127127
break
128128
case `icons`:
129-
await conjureIcons(options)
129+
await optimizeIcons(options)
130130
break
131131
case `favicons`:
132-
await conjureFavicons(options)
132+
await optimizeFavicons(options)
133133
break
134134
case `all`:
135-
await conjureAll(options)
135+
await optimizeAll(options)
136136
break
137137
default:
138138
cli.showHelp()

lib/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { removeSourceFaviconFiles } from "./removeSourceFaviconFiles.js"
1515
* @param {string} options.inputDirectory - The directory to search for files.
1616
* @returns {Promise<void>} - A promise that resolves when the icons are optimized.
1717
*/
18-
export async function conjureIcons (options) {
18+
export async function optimizeIcons (options) {
1919
await addPathsToOptions(options)
2020
await generateIconsCss(options)
2121
await optimizeVector(options)
@@ -28,7 +28,7 @@ export async function conjureIcons (options) {
2828
* @param {string} options.inputDirectory - The directory to search for files.
2929
* @returns {Promise<void>} - A promise that resolves when the images are optimized.
3030
*/
31-
export async function conjureImages (options) {
31+
export async function optimizeImages (options) {
3232
await addPathsToOptions(options)
3333
await optimizeVector(options)
3434
await processRaster(options)
@@ -40,7 +40,7 @@ export async function conjureImages (options) {
4040
* @param {Object} options - The options object.
4141
* @returns {Promise<void>} - A promise that resolves when the favicons are optimized.
4242
*/
43-
export async function conjureFavicons (options) {
43+
export async function optimizeFavicons (options) {
4444
await prepareSourceFaviconFiles(options)
4545

4646
if (options.isSourceFaviconNotExists) return
@@ -61,14 +61,14 @@ export async function conjureFavicons (options) {
6161
* @param {string} options.outputDirectory - The directory where processed files will be placed.
6262
* @returns {Promise<void>} - A promise that resolves when all the assets are optimized.
6363
*/
64-
export async function conjureAll (options) {
64+
export async function optimizeAll (options) {
6565
let iconsOptions = prepareOptionsForCommand(`icons`)
6666
let imagesOptions = prepareOptionsForCommand(`images`)
6767
let faviconsOptions = prepareOptionsForCommand(`favicons`)
6868

69-
await conjureIcons(iconsOptions)
70-
await conjureImages(imagesOptions)
71-
await conjureFavicons(faviconsOptions)
69+
await optimizeIcons(iconsOptions)
70+
await optimizeImages(imagesOptions)
71+
await optimizeFavicons(faviconsOptions)
7272

7373
/**
7474
* Prepare options for a specific command

package.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
{
22
"name": "@firefoxic/conjure",
3-
"description": "🪄 Conjure images, icons and favicons for your frontend project.",
3+
"description": "Optimize images, icons and favicons for your frontend project.",
44
"version": "3.0.1",
55
"license": "MIT",
66
"author": {
77
"name": "Sergey Artemov",
88
"email": "[email protected]"
99
},
10-
"homepage": "https://github.com/firefoxic/conjure#readme",
10+
"homepage": "https://github.com/firefoxic/optimize#readme",
1111
"bugs": {
12-
"url": "https://github.com/firefoxic/conjure/issues"
12+
"url": "https://github.com/firefoxic/optimize/issues"
1313
},
1414
"repository": {
1515
"type": "git",
16-
"url": "git://github.com/firefoxic/conjure.git"
16+
"url": "git://github.com/firefoxic/optimize.git"
1717
},
1818
"bin": {
19-
"conjure": "bin/cli.js",
20-
"whoosh": "bin/cli.js",
21-
"woosh": "bin/cli.js"
19+
"optimize": "bin/cli.js"
2220
},
2321
"type": "module",
2422
"exports": "./lib/index.js",
@@ -50,11 +48,10 @@
5048
"eslint": "9.33.0"
5149
},
5250
"keywords": [
53-
"conjure",
51+
"optimize",
5452
"image",
5553
"icon",
5654
"favicon",
57-
"optimize",
5855
"vector",
5956
"svg",
6057
"convert",

0 commit comments

Comments
 (0)