@tsdoctor/bundle 0.6.4 → 0.6.6
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/Bundle.js +1 -2
- package/BundleAssets.js +1 -2
- package/BundleDiscovery.js +1 -2
- package/BundleFetch.js +1 -2
- package/BundleHash.js +1 -2
- package/BundleResolver.js +1 -2
- package/PlatformOverrides.js +1 -2
- package/index.d.ts +0 -19
- package/internal/asset-path.js +1 -2
- package/package.json +13 -13
package/Bundle.js
CHANGED
|
@@ -3,7 +3,7 @@ import { PackageJsonFile } from "@effected/package-json";
|
|
|
3
3
|
import { TsconfigLoader } from "@effected/tsconfig-json";
|
|
4
4
|
import { Effect, FileSystem, Option, Schema } from "effect";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/Bundle.ts
|
|
7
7
|
/** The minimal api.json shape the layer-0 reader validates. */
|
|
8
8
|
const ApiModelHeader = Schema.Struct({ name: Schema.String });
|
|
9
9
|
/**
|
|
@@ -117,5 +117,4 @@ function readBundle(descriptor) {
|
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
//#endregion
|
|
121
120
|
export { BundleLayerError, readApiModelInfo, readBundle };
|
package/BundleAssets.js
CHANGED
|
@@ -2,7 +2,7 @@ import { isSafeAssetPath } from "./internal/asset-path.js";
|
|
|
2
2
|
import { Effect, FileSystem, Path, Result, Schema } from "effect";
|
|
3
3
|
import { ImageFacts } from "@effected/images";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/BundleAssets.ts
|
|
6
6
|
/**
|
|
7
7
|
* Publishing a resolved bundle's Open Graph images into a site's public
|
|
8
8
|
* directory.
|
|
@@ -122,5 +122,4 @@ const publishBundleAssets = Effect.fn("publishBundleAssets")(function* (input) {
|
|
|
122
122
|
return out;
|
|
123
123
|
});
|
|
124
124
|
|
|
125
|
-
//#endregion
|
|
126
125
|
export { BundleAssetError, publishBundleAssets };
|
package/BundleDiscovery.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Effect, FileSystem, Option, Path, Schema } from "effect";
|
|
|
5
5
|
import { GlobPatternOptions } from "@effected/glob";
|
|
6
6
|
import { compileAndExpand } from "@effected/walker";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/BundleDiscovery.ts
|
|
9
9
|
/**
|
|
10
10
|
* Raised when a directory cannot be resolved into a bundle descriptor.
|
|
11
11
|
*
|
|
@@ -240,5 +240,4 @@ function loadBundles(parentDir, options) {
|
|
|
240
240
|
return Effect.flatMap(discoverBundles(parentDir, options), (descriptors) => Effect.forEach(descriptors, readBundle));
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
//#endregion
|
|
244
243
|
export { BundleDiscoveryError, discoverBundle, discoverBundles, loadBundle, loadBundles };
|
package/BundleFetch.js
CHANGED
|
@@ -8,7 +8,7 @@ import { NpmRegistry, PackageTarball, PublishedVersion } from "@effected/npm";
|
|
|
8
8
|
import { Cache } from "@effected/store";
|
|
9
9
|
import { AppDirs } from "@effected/xdg";
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
// src/BundleFetch.ts
|
|
12
12
|
/**
|
|
13
13
|
* Raised when a remote bundle cannot be fetched into the local cache.
|
|
14
14
|
*
|
|
@@ -382,5 +382,4 @@ function fetchGitHubReleaseBundle(options) {
|
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
384
|
|
|
385
|
-
//#endregion
|
|
386
385
|
export { BundleFetchError, fetchGitHubReleaseBundle, fetchNpmBundle };
|
package/BundleHash.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { JsoncFingerprint } from "@effected/jsonc";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/BundleHash.ts
|
|
5
5
|
/**
|
|
6
6
|
* Normalize text for hashing: CRLF/CR line endings become LF and trailing
|
|
7
7
|
* whitespace at the end of the content is trimmed.
|
|
@@ -95,5 +95,4 @@ function fingerprintResolvedBundle(resolved) {
|
|
|
95
95
|
return Effect.forEach(present, (key) => JsoncFingerprint.hash(fields[key]).pipe(Effect.catchTag("JsoncCanonicalizeError", (error) => Effect.die(error)), Effect.map((hash) => [key, hash])), { concurrency: 1 }).pipe(Effect.map((entries) => Object.fromEntries(entries)));
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
//#endregion
|
|
99
98
|
export { fingerprintResolvedBundle, hashJsonValue, hashLayerText, hashText, normalizeText };
|
package/BundleResolver.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HashMap, Option } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/BundleResolver.ts
|
|
4
4
|
/** MIME types inferred from image file extensions. */
|
|
5
5
|
const IMAGE_MIME_BY_EXTENSION = {
|
|
6
6
|
avif: "image/avif",
|
|
@@ -163,5 +163,4 @@ function resolveBundleFrom(bundle, platform) {
|
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
//#endregion
|
|
167
166
|
export { resolveBundle, resolveBundleFrom };
|
package/PlatformOverrides.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BundleManifestError, OpenGraphConfig, RegistryRef, SbomRef } from "@tsdoctor/manifest";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/PlatformOverrides.ts
|
|
5
5
|
/**
|
|
6
6
|
* The `manifest.platform` tier: a data-override object a consumer passes
|
|
7
7
|
* through platform options (e.g. `ApiExtractorPlugin(options)`), sitting at
|
|
@@ -44,5 +44,4 @@ function decodePlatformOverrides(input) {
|
|
|
44
44
|
return Schema.decodeUnknownEffect(PlatformOverrides)(input).pipe(Effect.mapError((cause) => new BundleManifestError({ cause })));
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
//#endregion
|
|
48
47
|
export { PlatformOverrides, decodePlatformOverrides };
|
package/index.d.ts
CHANGED
|
@@ -6,8 +6,6 @@ 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
|
-
//#region ../manifest/dist/dev/pkg/index.d.ts
|
|
10
|
-
//#region src/BundleManifest.d.ts
|
|
11
9
|
/**
|
|
12
10
|
* The registry protocol families this reader knows how to do more than link
|
|
13
11
|
* to. `"npm"` means an npm-compatible registry — install commands and tarball
|
|
@@ -291,8 +289,6 @@ export declare const TSDOCTOR_MANIFEST_FILENAME = "tsdoctor.json";
|
|
|
291
289
|
* @public
|
|
292
290
|
*/
|
|
293
291
|
export declare function encodeBundleManifest(manifest: BundleManifest): Effect.Effect<unknown, BundleManifestError>;
|
|
294
|
-
//#endregion
|
|
295
|
-
//#region src/ManifestSource.d.ts
|
|
296
292
|
/**
|
|
297
293
|
* The shape an author checks in as a `tsdoctor.json` SOURCE file, at a
|
|
298
294
|
* package root (the leaf tier) or a workspace root (the project tier).
|
|
@@ -342,8 +338,6 @@ export type ManifestSource = typeof ManifestSource.Type;
|
|
|
342
338
|
* @public
|
|
343
339
|
*/
|
|
344
340
|
export declare function decodeManifestSource(input: unknown, path?: string): Effect.Effect<ManifestSource, BundleManifestError>;
|
|
345
|
-
//#endregion
|
|
346
|
-
//#region src/Bundle.d.ts
|
|
347
341
|
/**
|
|
348
342
|
* The subset of a `<name>.api.json` model this package reads: the package
|
|
349
343
|
* name from the model's own metadata.
|
|
@@ -456,8 +450,6 @@ export declare function readApiModelInfo(modelPath: string): Effect.Effect<ApiMo
|
|
|
456
450
|
* @public
|
|
457
451
|
*/
|
|
458
452
|
export declare function readBundle(descriptor: BundleDescriptor): Effect.Effect<Bundle, BundleLayerError | BundleManifestError, FileSystem.FileSystem | Path.Path>;
|
|
459
|
-
//#endregion
|
|
460
|
-
//#region src/PlatformOverrides.d.ts
|
|
461
453
|
/**
|
|
462
454
|
* The `manifest.platform` tier: a data-override object a consumer passes
|
|
463
455
|
* through platform options (e.g. `ApiExtractorPlugin(options)`), sitting at
|
|
@@ -520,8 +512,6 @@ export type PlatformOverrides = typeof PlatformOverrides.Type;
|
|
|
520
512
|
* @public
|
|
521
513
|
*/
|
|
522
514
|
export declare function decodePlatformOverrides(input: unknown): Effect.Effect<PlatformOverrides, BundleManifestError>;
|
|
523
|
-
//#endregion
|
|
524
|
-
//#region src/BundleResolver.d.ts
|
|
525
515
|
/**
|
|
526
516
|
* Where a resolved field's value came from, highest-ranked tier first.
|
|
527
517
|
*
|
|
@@ -659,8 +649,6 @@ export declare function resolveBundle(input: ResolveBundleInput): ResolvedBundle
|
|
|
659
649
|
* @public
|
|
660
650
|
*/
|
|
661
651
|
export declare function resolveBundleFrom(bundle: Bundle, platform?: PlatformOverrides): ResolvedBundle;
|
|
662
|
-
//#endregion
|
|
663
|
-
//#region src/BundleAssets.d.ts
|
|
664
652
|
declare const BundleAssetError_base: Schema.Class<BundleAssetError, Schema.TaggedStruct<"BundleAssetError", {
|
|
665
653
|
/** The source or destination path at fault. */
|
|
666
654
|
readonly path: Schema.String;
|
|
@@ -733,8 +721,6 @@ interface PublishBundleAssetsInput {
|
|
|
733
721
|
* @public
|
|
734
722
|
*/
|
|
735
723
|
export declare const publishBundleAssets: (input: PublishBundleAssetsInput) => Effect.Effect<readonly PublishedOpenGraphImage[], BundleAssetError, FileSystem.FileSystem | Path.Path>;
|
|
736
|
-
//#endregion
|
|
737
|
-
//#region src/BundleDiscovery.d.ts
|
|
738
724
|
declare const BundleDiscoveryError_base: Schema.Class<BundleDiscoveryError, Schema.TaggedStruct<"BundleDiscoveryError", {
|
|
739
725
|
/** The directory (or file) the failure is about. */
|
|
740
726
|
readonly path: Schema.String;
|
|
@@ -834,8 +820,6 @@ export declare function loadBundle(dir: string, options?: DiscoverBundleOptions)
|
|
|
834
820
|
* @public
|
|
835
821
|
*/
|
|
836
822
|
export declare function loadBundles(parentDir: string, options?: DiscoverBundlesOptions): Effect.Effect<ReadonlyArray<Bundle>, BundleDiscoveryError | BundleLayerError | BundleManifestError, FileSystem.FileSystem | Path.Path>;
|
|
837
|
-
//#endregion
|
|
838
|
-
//#region src/BundleFetch.d.ts
|
|
839
823
|
declare const BundleFetchError_base: Schema.Class<BundleFetchError, Schema.TaggedStruct<"BundleFetchError", {
|
|
840
824
|
/** Which fetcher failed. */
|
|
841
825
|
readonly source: Schema.Literals<readonly ["npm", "github"]>;
|
|
@@ -952,8 +936,6 @@ export declare function fetchNpmBundle(options: FetchNpmBundleOptions): Effect.E
|
|
|
952
936
|
* @public
|
|
953
937
|
*/
|
|
954
938
|
export declare function fetchGitHubReleaseBundle(options: FetchGitHubReleaseBundleOptions): Effect.Effect<Bundle, BundleFetchError | BundleLayerError | BundleManifestError, GitHubRelease | PackageTarball | Cache | AppDirs | FileSystem.FileSystem | Path.Path>;
|
|
955
|
-
//#endregion
|
|
956
|
-
//#region src/BundleHash.d.ts
|
|
957
939
|
/**
|
|
958
940
|
* Normalize text for hashing: CRLF/CR line endings become LF and trailing
|
|
959
941
|
* whitespace at the end of the content is trimmed.
|
|
@@ -1028,6 +1010,5 @@ export declare function hashLayerText(text: string): Effect.Effect<string, Platf
|
|
|
1028
1010
|
* @public
|
|
1029
1011
|
*/
|
|
1030
1012
|
export declare function fingerprintResolvedBundle(resolved: ResolvedBundle): Effect.Effect<Readonly<Record<string, string>>, PlatformError.PlatformError, Crypto.Crypto>;
|
|
1031
|
-
//#endregion
|
|
1032
1013
|
export type { ApiModelInfo, Bundle, BundleDescriptor, BundleOverrides, DiscoverBundleOptions, DiscoverBundlesOptions, FetchGitHubReleaseBundleOptions, FetchNpmBundleOptions, KnownRegistryType, ProvenanceSource, Provenanced, PublishBundleAssetsInput, PublishedOpenGraphImage, ResolveBundleInput, ResolvedBundle, ResolvedOpenGraph, ResolvedOpenGraphImage };
|
|
1033
1014
|
//# sourceMappingURL=index.d.ts.map
|
package/internal/asset-path.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/asset-path.ts
|
|
2
2
|
/**
|
|
3
3
|
* Shared traversal guard for bundle-relative asset paths.
|
|
4
4
|
*
|
|
@@ -25,5 +25,4 @@ function isSafeAssetPath(assetPath) {
|
|
|
25
25
|
return assetPath.split(/[/\\]/).every((segment) => SAFE_SEGMENT.test(segment));
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
//#endregion
|
|
29
28
|
export { isSafeAssetPath };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsdoctor/bundle",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
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.14.0",
|
|
43
|
+
"@effected/images": "^0.5.0",
|
|
44
|
+
"@effected/walker": "^0.19.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.2.
|
|
55
|
-
"effect": "^4.0.
|
|
47
|
+
"@effected/github": "^0.23.0",
|
|
48
|
+
"@effected/jsonc": "^0.19.0",
|
|
49
|
+
"@effected/npm": "^0.25.0",
|
|
50
|
+
"@effected/package-json": "^0.24.0",
|
|
51
|
+
"@effected/store": "^0.17.0",
|
|
52
|
+
"@effected/tsconfig-json": "^0.17.0",
|
|
53
|
+
"@effected/xdg": "^0.13.0",
|
|
54
|
+
"@tsdoctor/manifest": "0.2.10",
|
|
55
|
+
"effect": "^4.0.6"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|
|
58
58
|
"node": ">=24.11.0"
|