@tsdoctor/bundle 0.5.5 → 0.6.1

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.
Files changed (2) hide show
  1. package/BundleAssets.js +8 -12
  2. package/package.json +4 -4
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 { imageSize } from "image-size";
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
- /** `imageSize` throws on bytes it cannot parse; that degrades to no measurement, never a failure. */
35
+ /** Bytes that are not a readable image header degrade to no measurement, never a failure. */
36
36
  function safeSize(bytes) {
37
- try {
38
- const size = imageSize(bytes);
39
- return {
40
- ...size.width !== void 0 ? { width: size.width } : {},
41
- ...size.height !== void 0 ? { height: size.height } : {}
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.5.5",
3
+ "version": "0.6.1",
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,10 +40,11 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@effected/glob": "^0.10.0",
43
+ "@effected/images": "^0.1.1",
43
44
  "@effected/walker": "^0.15.0"
44
45
  },
45
46
  "peerDependencies": {
46
- "@effected/github": "^0.15.0",
47
+ "@effected/github": "^0.17.0",
47
48
  "@effected/jsonc": "^0.15.0",
48
49
  "@effected/npm": "^0.20.0",
49
50
  "@effected/package-json": "^0.20.0",
@@ -51,8 +52,7 @@
51
52
  "@effected/tsconfig-json": "^0.13.0",
52
53
  "@effected/xdg": "^0.9.0",
53
54
  "@tsdoctor/manifest": "0.2.5",
54
- "effect": "^4.0.2",
55
- "image-size": "^2.0.2"
55
+ "effect": "^4.0.2"
56
56
  },
57
57
  "engines": {
58
58
  "node": ">=24.11.0"