runtime-resolver 1.0.1 → 1.0.3
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/bin/runtime-resolver.js +1 -1
- package/command.js +4 -3
- package/layers.js +5 -2
- package/package.json +3 -3
package/bin/runtime-resolver.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Effect, Exit } from "effect";
|
|
|
6
6
|
import { Command } from "effect/unstable/cli";
|
|
7
7
|
|
|
8
8
|
//#region src/cli/index.ts
|
|
9
|
-
const program = Command.runWith(cli, { version: "1.0.
|
|
9
|
+
const program = Command.runWith(cli, { version: "1.0.3" })(process.argv.slice(2)).pipe(Effect.provide(NodeCliEnvironment));
|
|
10
10
|
const exit = await Effect.runPromiseExit(program);
|
|
11
11
|
if (Exit.isFailure(exit)) {
|
|
12
12
|
process.exitCode = 1;
|
package/command.js
CHANGED
|
@@ -17,6 +17,7 @@ const describeResolveError = (runtime, error) => {
|
|
|
17
17
|
return `no ${runtime} version matched "${error.constraint}"${scope}`;
|
|
18
18
|
}
|
|
19
19
|
case "UnresolvableDefaultError": return `no ${runtime} version matched the requested default "${error.defaultVersion}"`;
|
|
20
|
+
case "FreshnessError": return `could not fetch live ${runtime} release data: ${String(error.cause)}`;
|
|
20
21
|
}
|
|
21
22
|
};
|
|
22
23
|
/**
|
|
@@ -49,9 +50,9 @@ const tokenFlag = Flag.optional(Flag.redacted("token").pipe(Flag.withDescription
|
|
|
49
50
|
* The selector is called once per run with the parsed `--offline` flag to pick
|
|
50
51
|
* the layer set (live feeds, or the snapshot-only `.layerOffline`). Each
|
|
51
52
|
* runtime's chosen layer is provided *inside* its flag-gated branch and nowhere
|
|
52
|
-
* else, so an unrequested runtime's layer
|
|
53
|
-
*
|
|
54
|
-
*
|
|
53
|
+
* else, so an unrequested runtime's layer — and the `GitHubClient` beneath a
|
|
54
|
+
* Bun or Deno one — is never built, and no feed it would have fetched is ever
|
|
55
|
+
* reached. Parameterizing the selector is also what lets tests inject
|
|
55
56
|
* `.layerOffline` (or a tripwire that dies if built).
|
|
56
57
|
*/
|
|
57
58
|
const makeCli = (selectLayers) => Command.make("runtime-resolver", {
|
package/layers.js
CHANGED
|
@@ -21,8 +21,11 @@ const githubClientFor = (token) => Option.match(token, {
|
|
|
21
21
|
onSome: (pat) => GitHubClient.layer.pipe(Layer.provide(Layer.mergeAll(GitHubAuth.token(pat), httpClient)))
|
|
22
22
|
});
|
|
23
23
|
/**
|
|
24
|
-
* The live resolver layers:
|
|
25
|
-
*
|
|
24
|
+
* The live resolver layers: the kit's `.layer` strategy, which tries the real
|
|
25
|
+
* feed over `fetch` on the first `resolve` and falls back to the bundled
|
|
26
|
+
* snapshot. Never `.layerFresh`, whose fetch-or-fail contract would turn an
|
|
27
|
+
* unreachable feed into a run-ending `FreshnessError`. Each is built only when
|
|
28
|
+
* its runtime's branch runs.
|
|
26
29
|
*/
|
|
27
30
|
const liveResolverLayers = {
|
|
28
31
|
node: NodeResolver.layer.pipe(Layer.provide(httpClient)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "runtime-resolver",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Resolve semver-compatible versions of Node.js, Bun, and Deno runtimes with Effect-based architecture and offline fallback.",
|
|
6
6
|
"keywords": [
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"runtime-resolver": "bin/runtime-resolver.js"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@effected/runtimes": "^0.
|
|
41
|
-
"@effected/semver": "
|
|
40
|
+
"@effected/runtimes": "^0.2.3",
|
|
41
|
+
"@effected/semver": "^0.3.1",
|
|
42
42
|
"effect": "4.0.0-beta.101"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|