@divriots/jampack 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -4
- package/dist/index.js +3 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +6 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -84,10 +84,6 @@ This pass takes all `*.{html|.htm}` files and parse them for optimisation.
|
|
|
84
84
|
|
|
85
85
|
| Optimization | Technical details | Related links | Available |
|
|
86
86
|
| -------------- | --------------------- |:------------:|:---------:|
|
|
87
|
-
| 🔽 `<img>` | | | |
|
|
88
|
-
| Optimize `png` to `WebP` | Given `foo.png`, creates a **near loss less** `foo.png.webp` if size reduced. | [web.dev](https://web.dev/uses-webp-images/) | ✅ |
|
|
89
|
-
| Optimize `jpeg` to `WebP` | Given `foo.jpg`, creates a **lossly** `foo.jpg.webp` if size reduced. | [web.dev](https://web.dev/uses-webp-images/) | ✅ |
|
|
90
|
-
| Optimize `svg` | | | ✅ |
|
|
91
87
|
| Generate responsive images and set `srcset` | Multiple smaller images are generated exclusively in `WebP` and `srcset` attribute is set accordingly. | [web.dev](https://web.dev/patterns/web-vitals-patterns/images/responsive-images/) | ✅ |
|
|
92
88
|
| Embed small images | If optimised image size is <500 bytes, image is embed in `[src]` | | ✅ |
|
|
93
89
|
| Set `width` and `height` if missing | Uses image size and aspect ratio to fill values | [web.dev](https://web.dev/optimize-cls/#images-without-dimensions) | ✅ |
|
package/dist/index.js
CHANGED
|
@@ -10,20 +10,21 @@ import { printTitle } from './logger.js';
|
|
|
10
10
|
import { exit } from 'process';
|
|
11
11
|
import kleur from 'kleur';
|
|
12
12
|
import { cleanCache } from './cache.js';
|
|
13
|
+
import { VERSION } from './version.js';
|
|
13
14
|
const logo = ` __ __
|
|
14
15
|
|__|____ _____ ___________ ____ | | __
|
|
15
16
|
| \\__ \\ / \\\\____ \\__ \\ _/ ___\\| |/ /
|
|
16
17
|
| |/ __ \\| Y Y \\ |_> > __ \\\\ \\___| <
|
|
17
18
|
/\\__| (____ /__|_| / __(____ /\\___ >__|_ \\
|
|
18
19
|
\\______| \\/ \\/| | \\/ \\/ \\/
|
|
19
|
-
|
|
20
|
+
v${VERSION.padEnd(14)} |__| by ‹div›RIOTS
|
|
20
21
|
`;
|
|
21
22
|
console.log(logo);
|
|
22
23
|
const program = new Command();
|
|
23
24
|
program
|
|
24
25
|
.name('jampack')
|
|
25
26
|
.description('Static website Optimizer')
|
|
26
|
-
.version(
|
|
27
|
+
.version(VERSION);
|
|
27
28
|
program.command('pack', { isDefault: true })
|
|
28
29
|
.description('todo')
|
|
29
30
|
.argument('<dir>', 'Directory to pack')
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION:
|
|
1
|
+
export declare const VERSION: any;
|
package/dist/version.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
const pkgjson = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json')).toString());
|
|
6
|
+
export const VERSION = pkgjson.version;
|