@effected/runtimes 0.2.0 → 0.2.2
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/NodeResolver.js +5 -3
- package/index.d.ts +3 -3
- package/internal/defaults/node.js +15 -0
- package/internal/githubRuntime.js +7 -3
- package/internal/resolve.js +2 -1
- package/package.json +2 -2
package/NodeResolver.js
CHANGED
|
@@ -91,14 +91,16 @@ function build(tag, strategy) {
|
|
|
91
91
|
return Layer.effect(tag, Effect.gen(function* () {
|
|
92
92
|
const index = yield* make();
|
|
93
93
|
const scheduleRef = yield* Ref.make(NodeSchedule.empty);
|
|
94
|
-
const
|
|
94
|
+
const live = Effect.gen(function* () {
|
|
95
95
|
const [raw, scheduleData] = yield* Effect.all([fetchNodeReleases(), fetchNodeSchedule()]);
|
|
96
96
|
yield* Ref.set(scheduleRef, yield* NodeSchedule.fromData(scheduleData));
|
|
97
97
|
return yield* buildNodeReleases(raw);
|
|
98
|
-
}).pipe(Effect.catchTag("InvalidVersionError", (cause) => Effect.die(cause)))
|
|
98
|
+
}).pipe(Effect.catchTag("InvalidVersionError", (cause) => Effect.die(cause)));
|
|
99
|
+
const offline = Effect.gen(function* () {
|
|
99
100
|
yield* Ref.set(scheduleRef, yield* NodeSchedule.fromData(nodeScheduleDefaults));
|
|
100
101
|
return yield* buildNodeReleases(nodeDefaults);
|
|
101
|
-
}).pipe(Effect.orDie)
|
|
102
|
+
}).pipe(Effect.orDie);
|
|
103
|
+
const populate = yield* once(strategy(index, live, offline));
|
|
102
104
|
return { resolve: Effect.fn("NodeResolver.resolve")(function* (options) {
|
|
103
105
|
yield* populate;
|
|
104
106
|
const range = options?.range ?? "*";
|
package/index.d.ts
CHANGED
|
@@ -617,10 +617,10 @@ declare class NodeSchedule extends NodeSchedule_base {
|
|
|
617
617
|
static readonly fromData: (data: {
|
|
618
618
|
readonly [x: string]: {
|
|
619
619
|
readonly start: string;
|
|
620
|
-
readonly lts?: string
|
|
621
|
-
readonly maintenance?: string
|
|
620
|
+
readonly lts?: string;
|
|
621
|
+
readonly maintenance?: string;
|
|
622
622
|
readonly end: string;
|
|
623
|
-
readonly codename?: string
|
|
623
|
+
readonly codename?: string;
|
|
624
624
|
};
|
|
625
625
|
}) => Effect.Effect<NodeSchedule, InvalidScheduleDateError, never>;
|
|
626
626
|
/**
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
7
|
const nodeDefaults = [
|
|
8
|
+
{
|
|
9
|
+
version: "26.5.1",
|
|
10
|
+
npm: "11.17.0",
|
|
11
|
+
date: "2026-07-28"
|
|
12
|
+
},
|
|
8
13
|
{
|
|
9
14
|
version: "26.5.0",
|
|
10
15
|
npm: "11.17.0",
|
|
@@ -110,6 +115,11 @@ const nodeDefaults = [
|
|
|
110
115
|
npm: "11.6.2",
|
|
111
116
|
date: "2025-10-15"
|
|
112
117
|
},
|
|
118
|
+
{
|
|
119
|
+
version: "24.18.1",
|
|
120
|
+
npm: "11.16.0",
|
|
121
|
+
date: "2026-07-28"
|
|
122
|
+
},
|
|
113
123
|
{
|
|
114
124
|
version: "24.18.0",
|
|
115
125
|
npm: "11.16.0",
|
|
@@ -305,6 +315,11 @@ const nodeDefaults = [
|
|
|
305
315
|
npm: "10.9.0",
|
|
306
316
|
date: "2024-10-16"
|
|
307
317
|
},
|
|
318
|
+
{
|
|
319
|
+
version: "22.23.2",
|
|
320
|
+
npm: "10.9.8",
|
|
321
|
+
date: "2026-07-28"
|
|
322
|
+
},
|
|
308
323
|
{
|
|
309
324
|
version: "22.23.1",
|
|
310
325
|
npm: "10.9.8",
|
|
@@ -24,9 +24,13 @@ const build = (spec, strategy) => {
|
|
|
24
24
|
const { tag, runtime, owner, repo, spanName, defaults, make: make$1 } = spec;
|
|
25
25
|
return Layer.effect(tag, Effect.gen(function* () {
|
|
26
26
|
const index = yield* make();
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
const live = Effect.gen(function* () {
|
|
28
|
+
const client = yield* GitHubClient;
|
|
29
|
+
const raw = yield* fetchGitHubReleases(client, owner, repo);
|
|
30
|
+
return yield* buildReleases(raw, make$1);
|
|
31
|
+
});
|
|
32
|
+
const offline = buildReleases(defaults, make$1);
|
|
33
|
+
const populate = yield* once(strategy(index, live, offline));
|
|
30
34
|
return { resolve: Effect.fn(spanName)(function* (options) {
|
|
31
35
|
yield* populate;
|
|
32
36
|
const range = options?.range ?? "*";
|
package/internal/resolve.js
CHANGED
|
@@ -13,7 +13,8 @@ import { Effect, Option } from "effect";
|
|
|
13
13
|
const resolveWith = (args) => Effect.gen(function* () {
|
|
14
14
|
const { index, runtime, constraint, increments, defaultVersion, refine, pickLts, defaultsToLts, phases } = args;
|
|
15
15
|
const range = yield* Range.parse(constraint);
|
|
16
|
-
const
|
|
16
|
+
const matching = yield* index.filter(range);
|
|
17
|
+
const grouped = groupByIncrements(refine(matching), increments);
|
|
17
18
|
if (grouped.length === 0) return yield* new NoMatchingVersionError({
|
|
18
19
|
runtime,
|
|
19
20
|
constraint,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effected/runtimes",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Resolve semver-compatible Node.js, Bun and Deno runtime versions with offline fallback.",
|
|
6
6
|
"keywords": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"./package.json": "./package.json"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@effected/semver": "~0.
|
|
43
|
+
"@effected/semver": "~0.3.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"effect": "4.0.0-beta.101"
|