@tsdoctor/bundle 0.5.4 → 0.6.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/BundleAssets.js +8 -12
- package/package.json +5 -5
package/BundleAssets.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isSafeAssetPath } from "./internal/asset-path.js";
|
|
2
|
-
import { Effect, FileSystem, Path, Schema } from "effect";
|
|
3
|
-
import {
|
|
2
|
+
import { Effect, FileSystem, Path, Result, Schema } from "effect";
|
|
3
|
+
import { ImageFacts } from "@effected/images";
|
|
4
4
|
|
|
5
5
|
//#region src/BundleAssets.ts
|
|
6
6
|
/**
|
|
@@ -32,17 +32,13 @@ var BundleAssetError = class extends Schema.TaggedError()("BundleAssetError", {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
const bytesEqual = (a, b) => a.byteLength === b.byteLength && a.every((value, index) => value === b[index]);
|
|
35
|
-
/**
|
|
35
|
+
/** Bytes that are not a readable image header degrade to no measurement, never a failure. */
|
|
36
36
|
function safeSize(bytes) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
} catch {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
37
|
+
const facts = ImageFacts.fromBytesResult(bytes);
|
|
38
|
+
return Result.isSuccess(facts) ? {
|
|
39
|
+
width: facts.success.width,
|
|
40
|
+
height: facts.success.height
|
|
41
|
+
} : void 0;
|
|
46
42
|
}
|
|
47
43
|
/**
|
|
48
44
|
* Copy every bundle-relative image into `<publicDir>/tsdoctor/<unscopedName>/`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsdoctor/bundle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The tsdoctor bundle spec: layered bundle discovery, the versioned tsdoctor.json sidecar manifest, provenance-carrying resolution and canonical input hashing for API documentation bundles.",
|
|
6
6
|
"keywords": [
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@effected/glob": "^0.10.0",
|
|
43
|
+
"@effected/images": "^0.1.0",
|
|
43
44
|
"@effected/walker": "^0.15.0"
|
|
44
45
|
},
|
|
45
46
|
"peerDependencies": {
|
|
@@ -47,12 +48,11 @@
|
|
|
47
48
|
"@effected/jsonc": "^0.15.0",
|
|
48
49
|
"@effected/npm": "^0.20.0",
|
|
49
50
|
"@effected/package-json": "^0.20.0",
|
|
50
|
-
"@effected/store": "^0.
|
|
51
|
+
"@effected/store": "^0.13.0",
|
|
51
52
|
"@effected/tsconfig-json": "^0.13.0",
|
|
52
53
|
"@effected/xdg": "^0.9.0",
|
|
53
|
-
"@tsdoctor/manifest": "0.2.
|
|
54
|
-
"effect": "^4.0.
|
|
55
|
-
"image-size": "^2.0.2"
|
|
54
|
+
"@tsdoctor/manifest": "0.2.5",
|
|
55
|
+
"effect": "^4.0.2"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|
|
58
58
|
"node": ">=24.11.0"
|