runtime-resolver 0.1.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/235.js +89 -0
- package/969.js +27407 -0
- package/LICENSE +21 -0
- package/README.md +119 -0
- package/bin/runtime-resolver.js +289 -0
- package/index.d.ts +430 -0
- package/index.js +20 -0
- package/package.json +66 -0
- package/tsdoc-metadata.json +11 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import { Context } from 'effect';
|
|
2
|
+
import type { Effect } from 'effect';
|
|
3
|
+
import { Equals } from 'effect/Types';
|
|
4
|
+
import { Layer } from 'effect';
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
|
+
import { YieldableError } from 'effect/Cause';
|
|
7
|
+
|
|
8
|
+
export declare class AuthenticationError extends AuthenticationErrorBase<{
|
|
9
|
+
readonly method: "token" | "app";
|
|
10
|
+
readonly message: string;
|
|
11
|
+
}> {
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
* Exported for declaration bundling (api-extractor). When `export *` re-exports
|
|
17
|
+
* a class whose `extends` expression is an inline call like
|
|
18
|
+
* `Data.TaggedError(...)`, TypeScript emits an un-nameable `_base` symbol in
|
|
19
|
+
* the declaration file. Splitting the base into a named export gives the
|
|
20
|
+
* bundler a stable reference.
|
|
21
|
+
*/
|
|
22
|
+
export declare const AuthenticationErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
23
|
+
readonly _tag: "AuthenticationError";
|
|
24
|
+
} & Readonly<A>;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Service interface for resolving Bun runtime versions.
|
|
28
|
+
*/
|
|
29
|
+
export declare interface BunResolver {
|
|
30
|
+
readonly resolve: (options?: BunResolverOptions) => Effect.Effect<ResolvedVersions, BunResolverError>;
|
|
31
|
+
readonly resolveVersion: (versionOrRange: string) => Effect.Effect<string, BunResolverError>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* BunResolver tag for dependency injection.
|
|
36
|
+
*
|
|
37
|
+
* @internal Uses GenericTag to avoid generating un-nameable `_base` types
|
|
38
|
+
* that break the declaration bundler (api-extractor) when re-exported via
|
|
39
|
+
* `export *`.
|
|
40
|
+
*/
|
|
41
|
+
export declare const BunResolver: Context.Tag<BunResolver, BunResolver>;
|
|
42
|
+
|
|
43
|
+
export declare type BunResolverError = AuthenticationError | NetworkError | ParseError | RateLimitError | VersionNotFoundError | InvalidInputError | FreshnessError | CacheError;
|
|
44
|
+
|
|
45
|
+
export declare const BunResolverLive: Layer.Layer<BunResolver, never, GitHubClient | VersionCache>;
|
|
46
|
+
|
|
47
|
+
export declare interface BunResolverOptions {
|
|
48
|
+
readonly semverRange?: string;
|
|
49
|
+
readonly defaultVersion?: string;
|
|
50
|
+
readonly increments?: Increments;
|
|
51
|
+
readonly freshness?: Freshness;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export declare type CachedData = CachedNodeData | CachedTagData;
|
|
55
|
+
|
|
56
|
+
export declare const CachedNodeData: Schema.Struct<{
|
|
57
|
+
versions: Schema.Array$<Schema.Struct<{
|
|
58
|
+
version: typeof Schema.String;
|
|
59
|
+
date: typeof Schema.String;
|
|
60
|
+
files: Schema.Array$<typeof Schema.String>;
|
|
61
|
+
npm: Schema.optional<typeof Schema.String>;
|
|
62
|
+
v8: Schema.optional<typeof Schema.String>;
|
|
63
|
+
uv: Schema.optional<typeof Schema.String>;
|
|
64
|
+
zlib: Schema.optional<typeof Schema.String>;
|
|
65
|
+
openssl: Schema.optional<typeof Schema.String>;
|
|
66
|
+
modules: Schema.optional<typeof Schema.String>;
|
|
67
|
+
lts: Schema.Union<[Schema.Literal<[false]>, typeof Schema.String]>;
|
|
68
|
+
security: typeof Schema.Boolean;
|
|
69
|
+
}>>;
|
|
70
|
+
schedule: Schema.Record$<typeof Schema.String, Schema.Struct<{
|
|
71
|
+
start: typeof Schema.String;
|
|
72
|
+
lts: Schema.optional<typeof Schema.String>;
|
|
73
|
+
maintenance: Schema.optional<typeof Schema.String>;
|
|
74
|
+
end: typeof Schema.String;
|
|
75
|
+
codename: Schema.optional<typeof Schema.String>;
|
|
76
|
+
}>>;
|
|
77
|
+
}>;
|
|
78
|
+
|
|
79
|
+
export declare type CachedNodeData = typeof CachedNodeData.Type;
|
|
80
|
+
|
|
81
|
+
export declare const CachedTagData: Schema.Struct<{
|
|
82
|
+
tags: Schema.Array$<Schema.Struct<{
|
|
83
|
+
name: typeof Schema.String;
|
|
84
|
+
zipball_url: typeof Schema.String;
|
|
85
|
+
tarball_url: typeof Schema.String;
|
|
86
|
+
commit: Schema.Struct<{
|
|
87
|
+
sha: typeof Schema.String;
|
|
88
|
+
url: typeof Schema.String;
|
|
89
|
+
}>;
|
|
90
|
+
node_id: typeof Schema.String;
|
|
91
|
+
}>>;
|
|
92
|
+
}>;
|
|
93
|
+
|
|
94
|
+
export declare type CachedTagData = typeof CachedTagData.Type;
|
|
95
|
+
|
|
96
|
+
export declare class CacheError extends CacheErrorBase<{
|
|
97
|
+
readonly operation: "read" | "write";
|
|
98
|
+
readonly message: string;
|
|
99
|
+
}> {
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @internal
|
|
104
|
+
* Exported for declaration bundling — see AuthenticationError.ts for details.
|
|
105
|
+
*/
|
|
106
|
+
export declare const CacheErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
107
|
+
readonly _tag: "CacheError";
|
|
108
|
+
} & Readonly<A>;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Service interface for resolving Deno runtime versions.
|
|
112
|
+
*/
|
|
113
|
+
export declare interface DenoResolver {
|
|
114
|
+
readonly resolve: (options?: DenoResolverOptions) => Effect.Effect<ResolvedVersions, DenoResolverError>;
|
|
115
|
+
readonly resolveVersion: (versionOrRange: string) => Effect.Effect<string, DenoResolverError>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @internal Uses GenericTag — see BunResolver.ts for rationale.
|
|
120
|
+
*/
|
|
121
|
+
export declare const DenoResolver: Context.Tag<DenoResolver, DenoResolver>;
|
|
122
|
+
|
|
123
|
+
export declare type DenoResolverError = AuthenticationError | NetworkError | ParseError | RateLimitError | VersionNotFoundError | InvalidInputError | FreshnessError | CacheError;
|
|
124
|
+
|
|
125
|
+
export declare const DenoResolverLive: Layer.Layer<DenoResolver, never, GitHubClient | VersionCache>;
|
|
126
|
+
|
|
127
|
+
export declare interface DenoResolverOptions {
|
|
128
|
+
readonly semverRange?: string;
|
|
129
|
+
readonly defaultVersion?: string;
|
|
130
|
+
readonly increments?: Increments;
|
|
131
|
+
readonly freshness?: Freshness;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export declare const Freshness: Schema.Literal<["auto", "api", "cache"]>;
|
|
135
|
+
|
|
136
|
+
export declare type Freshness = typeof Freshness.Type;
|
|
137
|
+
|
|
138
|
+
export declare class FreshnessError extends FreshnessErrorBase<{
|
|
139
|
+
readonly strategy: Freshness;
|
|
140
|
+
readonly message: string;
|
|
141
|
+
}> {
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @internal
|
|
146
|
+
* Exported for declaration bundling — see AuthenticationError.ts for details.
|
|
147
|
+
*/
|
|
148
|
+
export declare const FreshnessErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
149
|
+
readonly _tag: "FreshnessError";
|
|
150
|
+
} & Readonly<A>;
|
|
151
|
+
|
|
152
|
+
export declare const GitHubAppAuth: (config: GitHubAppAuthConfig) => Layer.Layer<OctokitInstance, AuthenticationError, never>;
|
|
153
|
+
|
|
154
|
+
export declare interface GitHubAppAuthConfig {
|
|
155
|
+
readonly appId: string;
|
|
156
|
+
readonly privateKey: string;
|
|
157
|
+
readonly installationId?: number;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export declare const GitHubAutoAuth: Layer.Layer<OctokitInstance, AuthenticationError>;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Service interface for GitHub API operations.
|
|
164
|
+
*/
|
|
165
|
+
export declare interface GitHubClient {
|
|
166
|
+
readonly listTags: (owner: string, repo: string, options?: ListOptions) => Effect.Effect<ReadonlyArray<GitHubTag>, AuthenticationError | NetworkError | RateLimitError | ParseError>;
|
|
167
|
+
readonly listReleases: (owner: string, repo: string, options?: ListOptions) => Effect.Effect<ReadonlyArray<GitHubRelease>, AuthenticationError | NetworkError | RateLimitError | ParseError>;
|
|
168
|
+
readonly getJson: <A>(url: string, schema: {
|
|
169
|
+
readonly decode: (input: unknown) => Effect.Effect<A, ParseError>;
|
|
170
|
+
}) => Effect.Effect<A, NetworkError | ParseError>;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @internal Uses GenericTag — see BunResolver.ts for rationale.
|
|
175
|
+
*/
|
|
176
|
+
export declare const GitHubClient: Context.Tag<GitHubClient, GitHubClient>;
|
|
177
|
+
|
|
178
|
+
export declare const GitHubClientLive: Layer.Layer<GitHubClient, never, OctokitInstance>;
|
|
179
|
+
|
|
180
|
+
export declare const GitHubRelease: Schema.Struct<{
|
|
181
|
+
tag_name: typeof Schema.String;
|
|
182
|
+
name: Schema.NullOr<typeof Schema.String>;
|
|
183
|
+
draft: typeof Schema.Boolean;
|
|
184
|
+
prerelease: typeof Schema.Boolean;
|
|
185
|
+
published_at: Schema.NullOr<typeof Schema.String>;
|
|
186
|
+
}>;
|
|
187
|
+
|
|
188
|
+
export declare type GitHubRelease = typeof GitHubRelease.Type;
|
|
189
|
+
|
|
190
|
+
export declare const GitHubTag: Schema.Struct<{
|
|
191
|
+
name: typeof Schema.String;
|
|
192
|
+
zipball_url: typeof Schema.String;
|
|
193
|
+
tarball_url: typeof Schema.String;
|
|
194
|
+
commit: Schema.Struct<{
|
|
195
|
+
sha: typeof Schema.String;
|
|
196
|
+
url: typeof Schema.String;
|
|
197
|
+
}>;
|
|
198
|
+
node_id: typeof Schema.String;
|
|
199
|
+
}>;
|
|
200
|
+
|
|
201
|
+
export declare type GitHubTag = typeof GitHubTag.Type;
|
|
202
|
+
|
|
203
|
+
export declare const GitHubTokenAuth: Layer.Layer<OctokitInstance>;
|
|
204
|
+
|
|
205
|
+
export declare const GitHubTokenAuthFromToken: (token: string) => Layer.Layer<OctokitInstance, never, never>;
|
|
206
|
+
|
|
207
|
+
export declare const Increments: Schema.Literal<["latest", "minor", "patch"]>;
|
|
208
|
+
|
|
209
|
+
export declare type Increments = typeof Increments.Type;
|
|
210
|
+
|
|
211
|
+
export declare class InvalidInputError extends InvalidInputErrorBase<{
|
|
212
|
+
readonly field: string;
|
|
213
|
+
readonly value: string;
|
|
214
|
+
readonly message: string;
|
|
215
|
+
}> {
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* @internal
|
|
220
|
+
* Exported for declaration bundling — see AuthenticationError.ts for details.
|
|
221
|
+
*/
|
|
222
|
+
export declare const InvalidInputErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
223
|
+
readonly _tag: "InvalidInputError";
|
|
224
|
+
} & Readonly<A>;
|
|
225
|
+
|
|
226
|
+
export declare interface ListOptions {
|
|
227
|
+
readonly perPage?: number;
|
|
228
|
+
readonly pages?: number;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export declare class NetworkError extends NetworkErrorBase<{
|
|
232
|
+
readonly url: string;
|
|
233
|
+
readonly status?: number;
|
|
234
|
+
readonly message: string;
|
|
235
|
+
}> {
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @internal
|
|
240
|
+
* Exported for declaration bundling — see AuthenticationError.ts for details.
|
|
241
|
+
*/
|
|
242
|
+
export declare const NetworkErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
243
|
+
readonly _tag: "NetworkError";
|
|
244
|
+
} & Readonly<A>;
|
|
245
|
+
|
|
246
|
+
export declare const NodePhase: Schema.Literal<["current", "active-lts", "maintenance-lts", "end-of-life"]>;
|
|
247
|
+
|
|
248
|
+
export declare type NodePhase = typeof NodePhase.Type;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Service interface for resolving Node.js runtime versions.
|
|
252
|
+
*/
|
|
253
|
+
export declare interface NodeResolver {
|
|
254
|
+
readonly resolve: (options?: NodeResolverOptions) => Effect.Effect<ResolvedVersions, NodeResolverError>;
|
|
255
|
+
readonly resolveVersion: (versionOrRange: string) => Effect.Effect<string, NodeResolverError>;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @internal Uses GenericTag — see BunResolver.ts for rationale.
|
|
260
|
+
*/
|
|
261
|
+
export declare const NodeResolver: Context.Tag<NodeResolver, NodeResolver>;
|
|
262
|
+
|
|
263
|
+
export declare type NodeResolverError = AuthenticationError | NetworkError | ParseError | RateLimitError | VersionNotFoundError | InvalidInputError | FreshnessError | CacheError;
|
|
264
|
+
|
|
265
|
+
export declare const NodeResolverLive: Layer.Layer<NodeResolver, never, GitHubClient | VersionCache>;
|
|
266
|
+
|
|
267
|
+
export declare interface NodeResolverOptions {
|
|
268
|
+
readonly semverRange?: string;
|
|
269
|
+
readonly defaultVersion?: string;
|
|
270
|
+
readonly phases?: ReadonlyArray<NodePhase>;
|
|
271
|
+
readonly increments?: Increments;
|
|
272
|
+
readonly date?: Date;
|
|
273
|
+
readonly freshness?: Freshness;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Service interface for Octokit REST API client.
|
|
278
|
+
*/
|
|
279
|
+
export declare interface OctokitInstance {
|
|
280
|
+
readonly rest: {
|
|
281
|
+
readonly repos: {
|
|
282
|
+
readonly listTags: (params: {
|
|
283
|
+
owner: string;
|
|
284
|
+
repo: string;
|
|
285
|
+
per_page?: number;
|
|
286
|
+
page?: number;
|
|
287
|
+
}) => Promise<{
|
|
288
|
+
data: Array<unknown>;
|
|
289
|
+
}>;
|
|
290
|
+
readonly listReleases: (params: {
|
|
291
|
+
owner: string;
|
|
292
|
+
repo: string;
|
|
293
|
+
per_page?: number;
|
|
294
|
+
page?: number;
|
|
295
|
+
}) => Promise<{
|
|
296
|
+
data: Array<unknown>;
|
|
297
|
+
}>;
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* @internal Uses GenericTag — see BunResolver.ts for rationale.
|
|
304
|
+
*/
|
|
305
|
+
export declare const OctokitInstance: Context.Tag<OctokitInstance, OctokitInstance>;
|
|
306
|
+
|
|
307
|
+
export declare class ParseError extends ParseErrorBase<{
|
|
308
|
+
readonly source: string;
|
|
309
|
+
readonly message: string;
|
|
310
|
+
}> {
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* @internal
|
|
315
|
+
* Exported for declaration bundling — see AuthenticationError.ts for details.
|
|
316
|
+
*/
|
|
317
|
+
export declare const ParseErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
318
|
+
readonly _tag: "ParseError";
|
|
319
|
+
} & Readonly<A>;
|
|
320
|
+
|
|
321
|
+
export declare class RateLimitError extends RateLimitErrorBase<{
|
|
322
|
+
readonly retryAfter?: number;
|
|
323
|
+
readonly limit: number;
|
|
324
|
+
readonly remaining: number;
|
|
325
|
+
readonly message: string;
|
|
326
|
+
}> {
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @internal
|
|
331
|
+
* Exported for declaration bundling — see AuthenticationError.ts for details.
|
|
332
|
+
*/
|
|
333
|
+
export declare const RateLimitErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
334
|
+
readonly _tag: "RateLimitError";
|
|
335
|
+
} & Readonly<A>;
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Resolve Bun versions matching the given options.
|
|
339
|
+
*
|
|
340
|
+
* Uses GITHUB_PERSONAL_ACCESS_TOKEN or GITHUB_TOKEN for authentication.
|
|
341
|
+
* Falls back to build-time cache when the network is unavailable.
|
|
342
|
+
*/
|
|
343
|
+
export declare const resolveBun: (options?: BunResolverOptions | undefined) => Promise<{
|
|
344
|
+
readonly source: "api" | "cache";
|
|
345
|
+
readonly versions: readonly string[];
|
|
346
|
+
readonly latest: string;
|
|
347
|
+
readonly lts?: string | undefined;
|
|
348
|
+
readonly default?: string | undefined;
|
|
349
|
+
}>;
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Resolve Deno versions matching the given options.
|
|
353
|
+
*
|
|
354
|
+
* Uses GITHUB_PERSONAL_ACCESS_TOKEN or GITHUB_TOKEN for authentication.
|
|
355
|
+
* Falls back to build-time cache when the network is unavailable.
|
|
356
|
+
*/
|
|
357
|
+
export declare const resolveDeno: (options?: DenoResolverOptions | undefined) => Promise<{
|
|
358
|
+
readonly source: "api" | "cache";
|
|
359
|
+
readonly versions: readonly string[];
|
|
360
|
+
readonly latest: string;
|
|
361
|
+
readonly lts?: string | undefined;
|
|
362
|
+
readonly default?: string | undefined;
|
|
363
|
+
}>;
|
|
364
|
+
|
|
365
|
+
export declare const ResolvedVersions: Schema.Struct<{
|
|
366
|
+
source: Schema.Literal<["api", "cache"]>;
|
|
367
|
+
versions: Schema.Array$<typeof Schema.String>;
|
|
368
|
+
latest: typeof Schema.String;
|
|
369
|
+
lts: Schema.optional<typeof Schema.String>;
|
|
370
|
+
default: Schema.optional<typeof Schema.String>;
|
|
371
|
+
}>;
|
|
372
|
+
|
|
373
|
+
export declare type ResolvedVersions = typeof ResolvedVersions.Type;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Resolve Node.js versions matching the given options.
|
|
377
|
+
*
|
|
378
|
+
* Uses GITHUB_PERSONAL_ACCESS_TOKEN or GITHUB_TOKEN for authentication.
|
|
379
|
+
* Falls back to build-time cache when the network is unavailable.
|
|
380
|
+
*/
|
|
381
|
+
export declare const resolveNode: (options?: NodeResolverOptions | undefined) => Promise<{
|
|
382
|
+
readonly source: "api" | "cache";
|
|
383
|
+
readonly versions: readonly string[];
|
|
384
|
+
readonly latest: string;
|
|
385
|
+
readonly lts?: string | undefined;
|
|
386
|
+
readonly default?: string | undefined;
|
|
387
|
+
}>;
|
|
388
|
+
|
|
389
|
+
export declare const Runtime: Schema.Literal<["node", "bun", "deno"]>;
|
|
390
|
+
|
|
391
|
+
export declare type Runtime = typeof Runtime.Type;
|
|
392
|
+
|
|
393
|
+
export declare const Source: Schema.Literal<["api", "cache"]>;
|
|
394
|
+
|
|
395
|
+
export declare type Source = typeof Source.Type;
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Service interface for version data caching.
|
|
399
|
+
*/
|
|
400
|
+
export declare interface VersionCache {
|
|
401
|
+
readonly get: (runtime: Runtime) => Effect.Effect<{
|
|
402
|
+
data: CachedData;
|
|
403
|
+
source: Source;
|
|
404
|
+
}, CacheError>;
|
|
405
|
+
readonly set: (runtime: Runtime, data: CachedData) => Effect.Effect<void, CacheError>;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* @internal Uses GenericTag — see BunResolver.ts for rationale.
|
|
410
|
+
*/
|
|
411
|
+
export declare const VersionCache: Context.Tag<VersionCache, VersionCache>;
|
|
412
|
+
|
|
413
|
+
export declare const VersionCacheLive: Layer.Layer<VersionCache>;
|
|
414
|
+
|
|
415
|
+
export declare class VersionNotFoundError extends VersionNotFoundErrorBase<{
|
|
416
|
+
readonly runtime: Runtime;
|
|
417
|
+
readonly constraint: string;
|
|
418
|
+
readonly message: string;
|
|
419
|
+
}> {
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* @internal
|
|
424
|
+
* Exported for declaration bundling — see AuthenticationError.ts for details.
|
|
425
|
+
*/
|
|
426
|
+
export declare const VersionNotFoundErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
427
|
+
readonly _tag: "VersionNotFoundError";
|
|
428
|
+
} & Readonly<A>;
|
|
429
|
+
|
|
430
|
+
export { }
|
package/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Layer, NodeResolver, GitHubAutoAuth, BunResolverLive, DenoResolverLive, GitHubClientLive, VersionCacheLive, Effect, BunResolver, DenoResolver, NodeResolverLive } from "./969.js";
|
|
2
|
+
const GitHubLayer = GitHubClientLive.pipe(Layer.provide(GitHubAutoAuth));
|
|
3
|
+
const SharedLayer = Layer.merge(GitHubLayer, VersionCacheLive);
|
|
4
|
+
const NodeLayer = NodeResolverLive.pipe(Layer.provide(SharedLayer));
|
|
5
|
+
const BunLayer = BunResolverLive.pipe(Layer.provide(SharedLayer));
|
|
6
|
+
const DenoLayer = DenoResolverLive.pipe(Layer.provide(SharedLayer));
|
|
7
|
+
const resolveNode = (options)=>Effect.runPromise(Effect.gen(function*() {
|
|
8
|
+
const resolver = yield* NodeResolver;
|
|
9
|
+
return yield* resolver.resolve(options);
|
|
10
|
+
}).pipe(Effect.provide(NodeLayer)));
|
|
11
|
+
const resolveBun = (options)=>Effect.runPromise(Effect.gen(function*() {
|
|
12
|
+
const resolver = yield* BunResolver;
|
|
13
|
+
return yield* resolver.resolve(options);
|
|
14
|
+
}).pipe(Effect.provide(BunLayer)));
|
|
15
|
+
const resolveDeno = (options)=>Effect.runPromise(Effect.gen(function*() {
|
|
16
|
+
const resolver = yield* DenoResolver;
|
|
17
|
+
return yield* resolver.resolve(options);
|
|
18
|
+
}).pipe(Effect.provide(DenoLayer)));
|
|
19
|
+
export { AuthenticationError, AuthenticationErrorBase, BunResolver, BunResolverLive, CacheError, CacheErrorBase, DenoResolver, DenoResolverLive, FreshnessError, FreshnessErrorBase, GitHubAppAuth, GitHubAutoAuth, GitHubClient, GitHubClientLive, GitHubTokenAuth, GitHubTokenAuthFromToken, InvalidInputError, InvalidInputErrorBase, NetworkError, NetworkErrorBase, NodeResolver, NodeResolverLive, OctokitInstance, ParseError, ParseErrorBase, RateLimitError, RateLimitErrorBase, VersionCache, VersionCacheLive, VersionNotFoundError, VersionNotFoundErrorBase } from "./969.js";
|
|
20
|
+
export { resolveBun, resolveDeno, resolveNode };
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "runtime-resolver",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Resolve semver-compatible versions of Node.js, Bun, and Deno runtimes with Effect-based architecture and offline fallback.",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"node",
|
|
8
|
+
"bun",
|
|
9
|
+
"deno",
|
|
10
|
+
"runtime",
|
|
11
|
+
"version",
|
|
12
|
+
"semver",
|
|
13
|
+
"resolver",
|
|
14
|
+
"ci",
|
|
15
|
+
"github-actions",
|
|
16
|
+
"effect",
|
|
17
|
+
"cli"
|
|
18
|
+
],
|
|
19
|
+
"homepage": "https://github.com/spencerbeggs/runtime-resolver#readme",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/spencerbeggs/runtime-resolver/issues"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/spencerbeggs/runtime-resolver.git"
|
|
26
|
+
},
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"author": {
|
|
29
|
+
"name": "C. Spencer Beggs",
|
|
30
|
+
"email": "spencer@beggs.codes",
|
|
31
|
+
"url": "https://spencerbeg.gs"
|
|
32
|
+
},
|
|
33
|
+
"type": "module",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./index.d.ts",
|
|
37
|
+
"import": "./index.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"bin": {
|
|
41
|
+
"runtime-resolver": "./bin/runtime-resolver.js"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@effect/cli": "^0.73.2",
|
|
45
|
+
"@effect/platform": "^0.94.5",
|
|
46
|
+
"@effect/platform-node": "^0.104.1",
|
|
47
|
+
"@octokit/auth-app": "^8.2.0",
|
|
48
|
+
"effect": "^3.19.19",
|
|
49
|
+
"octokit": "^5.0.5",
|
|
50
|
+
"semver": "^7.7.4"
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"!runtime-resolver.api.json",
|
|
54
|
+
"!tsconfig.json",
|
|
55
|
+
"!tsdoc.json",
|
|
56
|
+
"235.js",
|
|
57
|
+
"969.js",
|
|
58
|
+
"LICENSE",
|
|
59
|
+
"README.md",
|
|
60
|
+
"bin/runtime-resolver.js",
|
|
61
|
+
"index.d.ts",
|
|
62
|
+
"index.js",
|
|
63
|
+
"package.json",
|
|
64
|
+
"tsdoc-metadata.json"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.57.6"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|