@travetto/image 3.4.2 → 4.0.0-rc.0
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 +1 -1
- package/__index__.ts +1 -0
- package/package.json +3 -3
- package/src/convert.ts +2 -2
- package/src/resource.ts +4 -4
- package/src/trv.d.ts +11 -0
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ The utility's primary structure revolves around the [CommandOperation](https://g
|
|
|
19
19
|
|
|
20
20
|
**Code: Simple Image Resize**
|
|
21
21
|
```typescript
|
|
22
|
-
import { createReadStream } from 'fs';
|
|
22
|
+
import { createReadStream } from 'node:fs';
|
|
23
23
|
|
|
24
24
|
import { StreamUtil } from '@travetto/base';
|
|
25
25
|
import { ImageConverter } from '@travetto/image';
|
package/__index__.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/image",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-rc.0",
|
|
4
4
|
"description": "Image support, resizing, and optimization",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"images",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"directory": "module/image"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@travetto/base": "^
|
|
27
|
-
"@travetto/command": "^
|
|
26
|
+
"@travetto/base": "^4.0.0-rc.0",
|
|
27
|
+
"@travetto/command": "^4.0.0-rc.0"
|
|
28
28
|
},
|
|
29
29
|
"travetto": {
|
|
30
30
|
"displayName": "Image"
|
package/src/convert.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Readable } from 'stream';
|
|
2
|
-
import { createReadStream } from 'fs';
|
|
1
|
+
import { Readable } from 'node:stream';
|
|
2
|
+
import { createReadStream } from 'node:fs';
|
|
3
3
|
|
|
4
4
|
import { CommandOperation } from '@travetto/command';
|
|
5
5
|
import { StreamUtil } from '@travetto/base';
|
package/src/resource.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import fs from 'fs/promises';
|
|
2
|
-
import { Readable } from 'stream';
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import { Readable } from 'node:stream';
|
|
3
3
|
|
|
4
|
-
import { ManifestFileUtil,
|
|
4
|
+
import { ManifestFileUtil, RuntimeIndex, path } from '@travetto/manifest';
|
|
5
5
|
import { Env, ResourceLoader, StreamUtil } from '@travetto/base';
|
|
6
6
|
|
|
7
7
|
import { ImageConverter } from './convert';
|
|
@@ -16,7 +16,7 @@ export class ImageOptimizingResourceLoader extends ResourceLoader {
|
|
|
16
16
|
constructor(paths: string[] = [], cacheRoot?: string) {
|
|
17
17
|
super(paths);
|
|
18
18
|
|
|
19
|
-
this.#cacheRoot = cacheRoot ?? path.resolve(Env.
|
|
19
|
+
this.#cacheRoot = cacheRoot ?? path.resolve(Env.TRV_IMAGE_CACHE.val || ManifestFileUtil.toolPath(RuntimeIndex, 'image_cache'));
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
async #openFile(pth: string): Promise<fs.FileHandle> {
|