@tsdoctor/bundle 0.6.11 → 0.8.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/BundleFetch.js +1 -1
- package/BundleHash.js +4 -3
- package/README.md +2 -2
- package/index.d.ts +10 -8
- package/package.json +13 -13
- package/tsdoc-metadata.json +1 -1
package/BundleFetch.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readBundle } from "./Bundle.js";
|
|
2
|
-
import { isSafeAssetPath } from "./internal/asset-path.js";
|
|
3
2
|
import { discoverBundle } from "./BundleDiscovery.js";
|
|
3
|
+
import { isSafeAssetPath } from "./internal/asset-path.js";
|
|
4
4
|
import { decodeBundleManifest } from "@tsdoctor/manifest";
|
|
5
5
|
import { Effect, FileSystem, Option, Path, Schema } from "effect";
|
|
6
6
|
import { GitHubRelease, Repo, RepoRef } from "@effected/github";
|
package/BundleHash.js
CHANGED
|
@@ -22,10 +22,11 @@ function normalizeText(text) {
|
|
|
22
22
|
* Hash text content: {@link normalizeText} then SHA-256 (lowercase hex).
|
|
23
23
|
*
|
|
24
24
|
* @remarks
|
|
25
|
-
* Digesting runs through core's `
|
|
25
|
+
* Digesting runs through core's `Digest` service (`JsoncFingerprint`), so
|
|
26
26
|
* consumers provide a backend — `@effect/platform-node`'s
|
|
27
|
-
* `NodeCrypto.
|
|
28
|
-
* `FileSystem | Path`
|
|
27
|
+
* `NodeCrypto.layerDigest` or core's `Digest.layerWebCrypto` — at the
|
|
28
|
+
* edge, the same posture as this package's `FileSystem | Path`
|
|
29
|
+
* requirements.
|
|
29
30
|
*
|
|
30
31
|
* @public
|
|
31
32
|
*/
|
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ const program = Effect.gen(function* () {
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
program.pipe(
|
|
47
|
-
Effect.provide(Layer.mergeAll(NodeFileSystem.layer, Path.layer, NodeCrypto.
|
|
47
|
+
Effect.provide(Layer.mergeAll(NodeFileSystem.layer, Path.layer, NodeCrypto.layerDigest)),
|
|
48
48
|
Effect.runPromise,
|
|
49
49
|
);
|
|
50
50
|
```
|
|
@@ -61,7 +61,7 @@ Every resolved field carries `{ value, source }`, so "did the user override this
|
|
|
61
61
|
- `resolveBundle` / `resolveBundleFrom` — the pure six-tier resolver producing a `ResolvedBundle` of `Provenanced` fields, with the documented inference rules (Open Graph alt-text chain, MIME from extension).
|
|
62
62
|
- `hashLayerText`, `hashJsonValue`, `fingerprintResolvedBundle` — RFC 8785 (JCS) canonicalization plus SHA-256 (via `@effected/jsonc`'s `JsoncFingerprint`) for coarse (per-layer) and fine (per-field) change detection. Canonicalization is strict: an `undefined`-valued member or non-plain object fails typed rather than being silently dropped.
|
|
63
63
|
|
|
64
|
-
All filesystem-touching functions keep `FileSystem` and `Path` in the Effect `R` channel, and the hashing functions keep `
|
|
64
|
+
All filesystem-touching functions keep `FileSystem` and `Path` in the Effect `R` channel, and the hashing functions keep core's `Digest` there too; provide platform layers (for example `@effect/platform-node`'s `NodeFileSystem.layer`, `Path.layer` and `NodeCrypto.layerDigest`) once at the application boundary.
|
|
65
65
|
|
|
66
66
|
## License
|
|
67
67
|
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Effect, FileSystem, Option, Path, Schema } from "effect";
|
|
2
2
|
import { PackageManifest } from "@effected/package-json";
|
|
3
3
|
import { CompilerOptions, ResolvedTsconfig } from "@effected/tsconfig-json";
|
|
4
4
|
import { GitHubRelease } from "@effected/github";
|
|
@@ -6,6 +6,7 @@ import { NpmRegistry, PackageTarball, RegistryTarget } from "@effected/npm";
|
|
|
6
6
|
import { Cache } from "@effected/store";
|
|
7
7
|
import { AppDirs } from "@effected/xdg";
|
|
8
8
|
import { JsoncCanonicalizeError } from "@effected/jsonc";
|
|
9
|
+
import { Digest } from "effect/crypto";
|
|
9
10
|
/**
|
|
10
11
|
* The registry protocol families this reader knows how to do more than link
|
|
11
12
|
* to. `"npm"` means an npm-compatible registry — install commands and tarball
|
|
@@ -954,14 +955,15 @@ export declare function normalizeText(text: string): string;
|
|
|
954
955
|
* Hash text content: {@link normalizeText} then SHA-256 (lowercase hex).
|
|
955
956
|
*
|
|
956
957
|
* @remarks
|
|
957
|
-
* Digesting runs through core's `
|
|
958
|
+
* Digesting runs through core's `Digest` service (`JsoncFingerprint`), so
|
|
958
959
|
* consumers provide a backend — `@effect/platform-node`'s
|
|
959
|
-
* `NodeCrypto.
|
|
960
|
-
* `FileSystem | Path`
|
|
960
|
+
* `NodeCrypto.layerDigest` or core's `Digest.layerWebCrypto` — at the
|
|
961
|
+
* edge, the same posture as this package's `FileSystem | Path`
|
|
962
|
+
* requirements.
|
|
961
963
|
*
|
|
962
964
|
* @public
|
|
963
965
|
*/
|
|
964
|
-
export declare function hashText(text: string): Effect.Effect<string,
|
|
966
|
+
export declare function hashText(text: string): Effect.Effect<string, never, Digest.Digest>;
|
|
965
967
|
/**
|
|
966
968
|
* Hash a JSON-shaped value: RFC 8785 (JCS) canonicalization then SHA-256.
|
|
967
969
|
*
|
|
@@ -974,7 +976,7 @@ export declare function hashText(text: string): Effect.Effect<string, PlatformEr
|
|
|
974
976
|
*
|
|
975
977
|
* @public
|
|
976
978
|
*/
|
|
977
|
-
export declare function hashJsonValue(value: unknown): Effect.Effect<string, JsoncCanonicalizeError
|
|
979
|
+
export declare function hashJsonValue(value: unknown): Effect.Effect<string, JsoncCanonicalizeError, Digest.Digest>;
|
|
978
980
|
/**
|
|
979
981
|
* Hash one bundle layer file's raw text — the COARSE half of change
|
|
980
982
|
* detection (all layer hashes match → skip resolution entirely).
|
|
@@ -990,7 +992,7 @@ export declare function hashJsonValue(value: unknown): Effect.Effect<string, Jso
|
|
|
990
992
|
*
|
|
991
993
|
* @public
|
|
992
994
|
*/
|
|
993
|
-
export declare function hashLayerText(text: string): Effect.Effect<string,
|
|
995
|
+
export declare function hashLayerText(text: string): Effect.Effect<string, never, Digest.Digest>;
|
|
994
996
|
/**
|
|
995
997
|
* Fingerprint every present field of a {@link ResolvedBundle} — the FINE
|
|
996
998
|
* half of change detection, hashing each field's `{ value, source }` pair.
|
|
@@ -1009,6 +1011,6 @@ export declare function hashLayerText(text: string): Effect.Effect<string, Platf
|
|
|
1009
1011
|
*
|
|
1010
1012
|
* @public
|
|
1011
1013
|
*/
|
|
1012
|
-
export declare function fingerprintResolvedBundle(resolved: ResolvedBundle): Effect.Effect<Readonly<Record<string, string>>,
|
|
1014
|
+
export declare function fingerprintResolvedBundle(resolved: ResolvedBundle): Effect.Effect<Readonly<Record<string, string>>, never, Digest.Digest>;
|
|
1013
1015
|
export type { ApiModelInfo, Bundle, BundleDescriptor, BundleOverrides, DiscoverBundleOptions, DiscoverBundlesOptions, FetchGitHubReleaseBundleOptions, FetchNpmBundleOptions, KnownRegistryType, ProvenanceSource, Provenanced, PublishBundleAssetsInput, PublishedOpenGraphImage, ResolveBundleInput, ResolvedBundle, ResolvedOpenGraph, ResolvedOpenGraphImage };
|
|
1014
1016
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsdoctor/bundle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.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": [
|
|
@@ -39,20 +39,20 @@
|
|
|
39
39
|
"./package.json": "./package.json"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@effected/glob": "^0.
|
|
43
|
-
"@effected/images": "^0.
|
|
44
|
-
"@effected/walker": "^0.
|
|
42
|
+
"@effected/glob": "^0.18.0",
|
|
43
|
+
"@effected/images": "^0.9.0",
|
|
44
|
+
"@effected/walker": "^0.25.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@effected/github": "^0.
|
|
48
|
-
"@effected/jsonc": "^0.
|
|
49
|
-
"@effected/npm": "^0.
|
|
50
|
-
"@effected/package-json": "^0.
|
|
51
|
-
"@effected/store": "^0.
|
|
52
|
-
"@effected/tsconfig-json": "^0.
|
|
53
|
-
"@effected/xdg": "^0.
|
|
54
|
-
"@tsdoctor/manifest": "0.
|
|
55
|
-
"effect": "
|
|
47
|
+
"@effected/github": "^0.28.0",
|
|
48
|
+
"@effected/jsonc": "^0.23.0",
|
|
49
|
+
"@effected/npm": "^0.30.0",
|
|
50
|
+
"@effected/package-json": "^0.29.0",
|
|
51
|
+
"@effected/store": "^0.23.0",
|
|
52
|
+
"@effected/tsconfig-json": "^0.20.0",
|
|
53
|
+
"@effected/xdg": "^0.19.0",
|
|
54
|
+
"@tsdoctor/manifest": "0.4.0",
|
|
55
|
+
"effect": "~4.1.2"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|
|
58
58
|
"node": ">=24.11.0"
|