ipx 3.1.0 → 3.1.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/dist/cli.cjs +7 -8
- package/dist/cli.mjs +4 -5
- package/dist/index.cjs +10 -11
- package/dist/index.d.cts +8 -1
- package/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.mjs +2 -3
- package/dist/shared/ipx.CgX2Ix7n.cjs +1685 -0
- package/dist/shared/ipx.CzhtJU9h.mjs +1671 -0
- package/package.json +30 -27
- package/dist/shared/ipx.C8X6338M.mjs +0 -764
- package/dist/shared/ipx.CHfn1B1U.cjs +0 -778
package/dist/cli.cjs
CHANGED
|
@@ -3,19 +3,18 @@
|
|
|
3
3
|
const listhen = require('listhen');
|
|
4
4
|
const citty = require('citty');
|
|
5
5
|
const cli = require('listhen/cli');
|
|
6
|
-
const
|
|
6
|
+
const http = require('./shared/ipx.CgX2Ix7n.cjs');
|
|
7
7
|
require('defu');
|
|
8
8
|
require('ufo');
|
|
9
9
|
require('h3');
|
|
10
|
-
require('image-meta');
|
|
11
10
|
require('destr');
|
|
12
11
|
require('@fastify/accept-negotiator');
|
|
13
12
|
require('etag');
|
|
14
|
-
require('ofetch');
|
|
15
13
|
require('pathe');
|
|
14
|
+
require('ofetch');
|
|
16
15
|
|
|
17
16
|
const name = "ipx";
|
|
18
|
-
const version = "3.1.
|
|
17
|
+
const version = "3.1.2";
|
|
19
18
|
const description = "High performance, secure and easy-to-use image optimizer.";
|
|
20
19
|
|
|
21
20
|
const serve = citty.defineCommand({
|
|
@@ -36,15 +35,15 @@ const serve = citty.defineCommand({
|
|
|
36
35
|
...cli.getArgs()
|
|
37
36
|
},
|
|
38
37
|
async run({ args }) {
|
|
39
|
-
const ipx =
|
|
40
|
-
storage:
|
|
38
|
+
const ipx = http.createIPX({
|
|
39
|
+
storage: http.ipxFSStorage({
|
|
41
40
|
dir: args.dir
|
|
42
41
|
}),
|
|
43
|
-
httpStorage:
|
|
42
|
+
httpStorage: http.ipxHttpStorage({
|
|
44
43
|
domains: args.domains
|
|
45
44
|
})
|
|
46
45
|
});
|
|
47
|
-
await listhen.listen(
|
|
46
|
+
await listhen.listen(http.createIPXNodeServer(ipx), {
|
|
48
47
|
name: "IPX",
|
|
49
48
|
...cli.parseArgs(args)
|
|
50
49
|
});
|
package/dist/cli.mjs
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { listen } from 'listhen';
|
|
2
2
|
import { defineCommand, runMain } from 'citty';
|
|
3
|
-
import {
|
|
4
|
-
import { c as createIPX, i as ipxHttpStorage,
|
|
3
|
+
import { parseArgs, getArgs } from 'listhen/cli';
|
|
4
|
+
import { c as createIPX, i as ipxHttpStorage, a as ipxFSStorage, b as createIPXNodeServer } from './shared/ipx.CzhtJU9h.mjs';
|
|
5
5
|
import 'defu';
|
|
6
6
|
import 'ufo';
|
|
7
7
|
import 'h3';
|
|
8
|
-
import 'image-meta';
|
|
9
8
|
import 'destr';
|
|
10
9
|
import '@fastify/accept-negotiator';
|
|
11
10
|
import 'etag';
|
|
12
|
-
import 'ofetch';
|
|
13
11
|
import 'pathe';
|
|
12
|
+
import 'ofetch';
|
|
14
13
|
|
|
15
14
|
const name = "ipx";
|
|
16
|
-
const version = "3.1.
|
|
15
|
+
const version = "3.1.2";
|
|
17
16
|
const description = "High performance, secure and easy-to-use image optimizer.";
|
|
18
17
|
|
|
19
18
|
const serve = defineCommand({
|
package/dist/index.cjs
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const http = require('./shared/ipx.CgX2Ix7n.cjs');
|
|
4
4
|
const h3 = require('h3');
|
|
5
5
|
require('defu');
|
|
6
6
|
require('ufo');
|
|
7
|
-
require('image-meta');
|
|
8
7
|
require('destr');
|
|
9
8
|
require('@fastify/accept-negotiator');
|
|
10
9
|
require('etag');
|
|
11
|
-
require('ofetch');
|
|
12
10
|
require('pathe');
|
|
11
|
+
require('ofetch');
|
|
13
12
|
|
|
14
13
|
function unstorageToIPXStorage(storage, _options = {}) {
|
|
15
14
|
const options = typeof _options === "string" ? { prefix: _options } : _options;
|
|
@@ -51,12 +50,12 @@ ${error.message}`,
|
|
|
51
50
|
};
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
exports.createIPX =
|
|
55
|
-
exports.createIPXH3App =
|
|
56
|
-
exports.createIPXH3Handler =
|
|
57
|
-
exports.createIPXNodeServer =
|
|
58
|
-
exports.createIPXPlainServer =
|
|
59
|
-
exports.createIPXWebServer =
|
|
60
|
-
exports.ipxFSStorage =
|
|
61
|
-
exports.ipxHttpStorage =
|
|
53
|
+
exports.createIPX = http.createIPX;
|
|
54
|
+
exports.createIPXH3App = http.createIPXH3App;
|
|
55
|
+
exports.createIPXH3Handler = http.createIPXH3Handler;
|
|
56
|
+
exports.createIPXNodeServer = http.createIPXNodeServer;
|
|
57
|
+
exports.createIPXPlainServer = http.createIPXPlainServer;
|
|
58
|
+
exports.createIPXWebServer = http.createIPXWebServer;
|
|
59
|
+
exports.ipxFSStorage = http.ipxFSStorage;
|
|
60
|
+
exports.ipxHttpStorage = http.ipxHttpStorage;
|
|
62
61
|
exports.unstorageToIPXStorage = unstorageToIPXStorage;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { Color, KernelEnum, Sharp, SharpOptions } from 'sharp';
|
|
2
|
-
import { ImageMeta } from 'image-meta';
|
|
3
2
|
import { Config } from 'svgo';
|
|
4
3
|
import * as h3 from 'h3';
|
|
5
4
|
import { Storage, Driver } from 'unstorage';
|
|
6
5
|
|
|
6
|
+
type ImageMeta = {
|
|
7
|
+
images?: Omit<ImageMeta, "images">[];
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
orientation?: number;
|
|
11
|
+
type?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
7
14
|
interface HandlerContext {
|
|
8
15
|
/**
|
|
9
16
|
* Optional quality setting for the output image, affects compression in certain formats.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { Color, KernelEnum, Sharp, SharpOptions } from 'sharp';
|
|
2
|
-
import { ImageMeta } from 'image-meta';
|
|
3
2
|
import { Config } from 'svgo';
|
|
4
3
|
import * as h3 from 'h3';
|
|
5
4
|
import { Storage, Driver } from 'unstorage';
|
|
6
5
|
|
|
6
|
+
type ImageMeta = {
|
|
7
|
+
images?: Omit<ImageMeta, "images">[];
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
orientation?: number;
|
|
11
|
+
type?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
7
14
|
interface HandlerContext {
|
|
8
15
|
/**
|
|
9
16
|
* Optional quality setting for the output image, affects compression in certain formats.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { Color, KernelEnum, Sharp, SharpOptions } from 'sharp';
|
|
2
|
-
import { ImageMeta } from 'image-meta';
|
|
3
2
|
import { Config } from 'svgo';
|
|
4
3
|
import * as h3 from 'h3';
|
|
5
4
|
import { Storage, Driver } from 'unstorage';
|
|
6
5
|
|
|
6
|
+
type ImageMeta = {
|
|
7
|
+
images?: Omit<ImageMeta, "images">[];
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
orientation?: number;
|
|
11
|
+
type?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
7
14
|
interface HandlerContext {
|
|
8
15
|
/**
|
|
9
16
|
* Optional quality setting for the output image, affects compression in certain formats.
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
export { c as createIPX,
|
|
1
|
+
export { c as createIPX, d as createIPXH3App, e as createIPXH3Handler, b as createIPXNodeServer, f as createIPXPlainServer, g as createIPXWebServer, a as ipxFSStorage, i as ipxHttpStorage } from './shared/ipx.CzhtJU9h.mjs';
|
|
2
2
|
import { createError } from 'h3';
|
|
3
3
|
import 'defu';
|
|
4
4
|
import 'ufo';
|
|
5
|
-
import 'image-meta';
|
|
6
5
|
import 'destr';
|
|
7
6
|
import '@fastify/accept-negotiator';
|
|
8
7
|
import 'etag';
|
|
9
|
-
import 'ofetch';
|
|
10
8
|
import 'pathe';
|
|
9
|
+
import 'ofetch';
|
|
11
10
|
|
|
12
11
|
function unstorageToIPXStorage(storage, _options = {}) {
|
|
13
12
|
const options = typeof _options === "string" ? { prefix: _options } : _options;
|