@tsdoctor/vfs 0.4.7 → 0.4.8
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/TsEnvironment.js +1 -2
- package/TsconfigParser.js +1 -2
- package/TwoslashCache.js +1 -2
- package/TypeResolutionOptions.js +1 -2
- package/TypeScriptConfig.js +1 -2
- package/Vfs.js +1 -2
- package/VirtualPackage.js +1 -2
- package/index.d.ts +0 -14
- package/package.json +3 -3
package/TsEnvironment.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isTypeDefinition } from "./Vfs.js";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/TsEnvironment.ts
|
|
5
5
|
/**
|
|
6
6
|
* Raised when building a virtual TypeScript environment fails — including
|
|
7
7
|
* when the optional `typescript` / `@typescript/vfs` /
|
|
@@ -91,5 +91,4 @@ var TsEnvironment = class {
|
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
//#endregion
|
|
95
94
|
export { TsEnvironment, TsEnvironmentError };
|
package/TsconfigParser.js
CHANGED
|
@@ -4,7 +4,7 @@ import path from "node:path";
|
|
|
4
4
|
import { TsconfigLoaderSync } from "@effected/tsconfig-json";
|
|
5
5
|
import { Result } from "effect";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/TsconfigParser.ts
|
|
8
8
|
/**
|
|
9
9
|
* Reading a `tsconfig.json` into the compiler options the plugin consumes.
|
|
10
10
|
*
|
|
@@ -94,5 +94,4 @@ function parseTsConfig(configPath, projectRoot) {
|
|
|
94
94
|
return decoded.success;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
//#endregion
|
|
98
97
|
export { TsConfigParseError, parseTsConfig };
|
package/TwoslashCache.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { gunzipSync, gzipSync } from "node:zlib";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/TwoslashCache.ts
|
|
5
5
|
/**
|
|
6
6
|
* Persisted Twoslash result cache.
|
|
7
7
|
*
|
|
@@ -184,5 +184,4 @@ function decodeTwoslashCache(blob) {
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
//#endregion
|
|
188
187
|
export { TWOSLASH_CACHE_FORMAT, decodeTwoslashCache, encodeTwoslashCache, makeTwoslashCache, twoslashBlobKey, twoslashEntryKey, twoslashEnvHash };
|
package/TypeResolutionOptions.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CompilerOptions, CompilerOptionsFromProgrammatic, TsEnumCodec } from "@effected/tsconfig-json";
|
|
2
2
|
import { Result, Schema } from "effect";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/TypeResolutionOptions.ts
|
|
5
5
|
const fields = CompilerOptions.schema.fields;
|
|
6
6
|
/**
|
|
7
7
|
* The compiler options that may influence how a documentation example
|
|
@@ -94,5 +94,4 @@ const decodeCompilerOptions = (input) => Result.map(Schema.decodeUnknownResult(C
|
|
|
94
94
|
*/
|
|
95
95
|
const toProgrammaticCompilerOptions = (options) => TsEnumCodec.encodeCompilerOptions(options);
|
|
96
96
|
|
|
97
|
-
//#endregion
|
|
98
97
|
export { TypeResolutionCompilerOptions, decodeCompilerOptions, toProgrammaticCompilerOptions };
|
package/TypeScriptConfig.js
CHANGED
|
@@ -2,7 +2,7 @@ import { decodeCompilerOptions } from "./TypeResolutionOptions.js";
|
|
|
2
2
|
import { TsConfigParseError, parseTsConfig } from "./TsconfigParser.js";
|
|
3
3
|
import { Result } from "effect";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/TypeScriptConfig.ts
|
|
6
6
|
/**
|
|
7
7
|
* Default TypeScript compiler options for Twoslash and type resolution.
|
|
8
8
|
*
|
|
@@ -222,5 +222,4 @@ async function resolveTypeScriptConfig(projectRoot, global, api) {
|
|
|
222
222
|
return options;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
//#endregion
|
|
226
225
|
export { DEFAULT_COMPILER_OPTIONS, mergeCompilerOptions, resolveTypeScriptConfig, resolveTypeScriptConfigSingle, resolveTypeScriptConfigSingleAsync };
|
package/Vfs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/Vfs.ts
|
|
2
2
|
/**
|
|
3
3
|
* Merge VFS maps left to right into a new map; later entries win on path
|
|
4
4
|
* collisions.
|
|
@@ -43,5 +43,4 @@ const prefixVfs = (name, entries) => {
|
|
|
43
43
|
*/
|
|
44
44
|
const isTypeDefinition = (filePath) => filePath.endsWith(".d.ts") || filePath.endsWith(".d.mts") || filePath.endsWith(".d.cts");
|
|
45
45
|
|
|
46
|
-
//#endregion
|
|
47
46
|
export { isTypeDefinition, mergeVfs, prefixVfs };
|
package/VirtualPackage.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, FileSystem, Schema } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/VirtualPackage.ts
|
|
4
4
|
/**
|
|
5
5
|
* A synthetic npm package built from locally supplied TypeScript declaration
|
|
6
6
|
* content, for inclusion in a {@link Vfs} without fetching from the CDN.
|
|
@@ -122,5 +122,4 @@ var VirtualPackage = class VirtualPackage extends Schema.Class("VirtualPackage")
|
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
|
|
125
|
-
//#endregion
|
|
126
125
|
export { VirtualPackage };
|
package/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { Effect, FileSystem, PlatformError, Result, Schema } from "effect";
|
|
|
3
3
|
import { VirtualTypeScriptEnvironment } from "@typescript/vfs";
|
|
4
4
|
import { TwoslashTypesCache } from "@shikijs/twoslash";
|
|
5
5
|
import { PathLike } from "node:fs";
|
|
6
|
-
//#region src/TypeResolutionOptions.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* The compiler options that may influence how a documentation example
|
|
9
8
|
* type-checks.
|
|
@@ -79,8 +78,6 @@ export declare const decodeCompilerOptions: (input: unknown) => Result.Result<Ty
|
|
|
79
78
|
* @public
|
|
80
79
|
*/
|
|
81
80
|
export declare const toProgrammaticCompilerOptions: (options: TypeResolutionCompilerOptions) => ProgrammaticCompilerOptions;
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region src/TsconfigParser.d.ts
|
|
84
81
|
/**
|
|
85
82
|
* Error thrown when tsconfig.json parsing fails.
|
|
86
83
|
*
|
|
@@ -118,8 +115,6 @@ export declare class TsConfigParseError extends Error {
|
|
|
118
115
|
* @public
|
|
119
116
|
*/
|
|
120
117
|
export declare function parseTsConfig(configPath: string, projectRoot: string): TypeResolutionCompilerOptions;
|
|
121
|
-
//#endregion
|
|
122
|
-
//#region src/Vfs.d.ts
|
|
123
118
|
/**
|
|
124
119
|
* The package's currency type: a virtual file system mapping
|
|
125
120
|
* `node_modules/`-prefixed paths to file contents.
|
|
@@ -171,8 +166,6 @@ export declare const prefixVfs: (name: string, entries: ReadonlyMap<string, stri
|
|
|
171
166
|
* @public
|
|
172
167
|
*/
|
|
173
168
|
export declare const isTypeDefinition: (filePath: string) => boolean;
|
|
174
|
-
//#endregion
|
|
175
|
-
//#region src/TsEnvironment.d.ts
|
|
176
169
|
declare const TsEnvironmentError_base: Schema.Class<TsEnvironmentError, Schema.TaggedStruct<"TsEnvironmentError", {
|
|
177
170
|
/** The underlying failure, preserved structurally. */
|
|
178
171
|
readonly cause: Schema.Defect;
|
|
@@ -252,8 +245,6 @@ export declare class TsEnvironment {
|
|
|
252
245
|
/** Build a `VirtualTypeScriptEnvironment` over a {@link Vfs}. */
|
|
253
246
|
static make(options: TsEnvironmentOptions): Effect.Effect<VirtualTypeScriptEnvironment, TsEnvironmentError>;
|
|
254
247
|
}
|
|
255
|
-
//#endregion
|
|
256
|
-
//#region src/TwoslashCache.d.ts
|
|
257
248
|
/**
|
|
258
249
|
* Persisted Twoslash result cache.
|
|
259
250
|
*
|
|
@@ -409,8 +400,6 @@ export declare function encodeTwoslashCache(entries: ReadonlyMap<string, Twoslas
|
|
|
409
400
|
* @public
|
|
410
401
|
*/
|
|
411
402
|
export declare function decodeTwoslashCache(blob: Uint8Array): Map<string, TwoslashCacheValue>;
|
|
412
|
-
//#endregion
|
|
413
|
-
//#region src/TypeScriptConfig.d.ts
|
|
414
403
|
/**
|
|
415
404
|
* How a caller points at TypeScript configuration: a `tsconfig.json`, inline
|
|
416
405
|
* compiler options, or both.
|
|
@@ -584,8 +573,6 @@ export declare function resolveTypeScriptConfigSingleAsync(config: TypeScriptCon
|
|
|
584
573
|
* @public
|
|
585
574
|
*/
|
|
586
575
|
export declare function resolveTypeScriptConfig(projectRoot: string, global?: TypeScriptConfig, api?: TypeScriptConfig): Promise<TypeResolutionCompilerOptions>;
|
|
587
|
-
//#endregion
|
|
588
|
-
//#region src/VirtualPackage.d.ts
|
|
589
576
|
declare const VirtualPackage_base: Schema.Class<VirtualPackage, Schema.Struct<{
|
|
590
577
|
/** The package name (e.g. `"@my-org/api-types"`). */
|
|
591
578
|
readonly name: Schema.String;
|
|
@@ -658,6 +645,5 @@ export declare class VirtualPackage extends VirtualPackage_base {
|
|
|
658
645
|
toVfs(): Vfs;
|
|
659
646
|
private toPackageJson;
|
|
660
647
|
}
|
|
661
|
-
//#endregion
|
|
662
648
|
export type { CompilerOptionsInput, TsEnvironmentOptions, TwoslashCacheStats, TwoslashCacheValue, TwoslashResultCache, TypeScriptConfig, Vfs };
|
|
663
649
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsdoctor/vfs",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Virtual TypeScript projects for documentation tooling: the Vfs currency type, declaration-backed virtual packages, @typescript/vfs environments, and the compiler-option resolution that configures them.",
|
|
6
6
|
"keywords": [
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@effected/tsconfig-json": "^0.
|
|
40
|
+
"@effected/tsconfig-json": "^0.17.0",
|
|
41
41
|
"@shikijs/twoslash": "^4.4.3",
|
|
42
42
|
"@typescript/vfs": "^1.6.5",
|
|
43
|
-
"effect": "^4.0.
|
|
43
|
+
"effect": "^4.0.6",
|
|
44
44
|
"typescript": "^6.0.3"
|
|
45
45
|
},
|
|
46
46
|
"peerDependenciesMeta": {
|