functionalscript 0.29.1 → 0.31.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/fs/asn.1/module.f.js +18 -22
- package/fs/asn.1/proof.f.d.ts +5 -0
- package/fs/asn.1/proof.f.js +38 -2
- package/fs/base64/module.f.d.ts +9 -0
- package/fs/base64/module.f.js +60 -0
- package/fs/base64/proof.f.d.ts +11 -0
- package/fs/base64/proof.f.js +117 -0
- package/fs/base_n/module.f.d.ts +44 -0
- package/fs/base_n/module.f.js +54 -0
- package/fs/base_n/proof.f.d.ts +10 -0
- package/fs/base_n/proof.f.js +86 -0
- package/fs/bnf/data/module.f.d.ts +4 -9
- package/fs/bnf/data/module.f.js +4 -3
- package/fs/bnf/module.f.d.ts +3 -4
- package/fs/bnf/module.f.js +3 -2
- package/fs/bnf/proof.f.d.ts +9 -0
- package/fs/bnf/proof.f.js +98 -1
- package/fs/cas/mcp/module.f.d.ts +40 -0
- package/fs/cas/mcp/module.f.js +223 -0
- package/fs/cas/mcp/proof.f.d.ts +30 -0
- package/fs/cas/mcp/proof.f.js +310 -0
- package/fs/cas/module.f.d.ts +9 -3
- package/fs/cas/module.f.js +104 -69
- package/fs/cas/proof.f.d.ts +2 -0
- package/fs/cas/proof.f.js +30 -1
- package/fs/cbase32/module.f.d.ts +1 -1
- package/fs/cbase32/module.f.js +19 -40
- package/fs/cbase32/proof.f.d.ts +1 -0
- package/fs/cbase32/proof.f.js +15 -0
- package/fs/ci/bun/module.f.d.ts +2 -2
- package/fs/ci/bun/module.f.js +7 -14
- package/fs/ci/common/module.f.d.ts +3 -1
- package/fs/ci/common/module.f.js +9 -2
- package/fs/ci/config/module.f.d.ts +7 -5
- package/fs/ci/config/module.f.js +11 -5
- package/fs/ci/deno/module.f.d.ts +1 -1
- package/fs/ci/deno/module.f.js +7 -5
- package/fs/ci/module.f.d.ts +6 -3
- package/fs/ci/module.f.js +24 -54
- package/fs/ci/node/module.f.d.ts +3 -3
- package/fs/ci/node/module.f.js +30 -26
- package/fs/ci/playwright/module.f.js +1 -1
- package/fs/ci/proof.f.d.ts +6 -7
- package/fs/ci/proof.f.js +63 -36
- package/fs/ci/rust/module.f.d.ts +2 -1
- package/fs/ci/rust/module.f.js +33 -16
- package/fs/cli/module.f.d.ts +3 -1
- package/fs/cli/module.f.js +22 -12
- package/fs/cli/proof.f.d.ts +5 -0
- package/fs/cli/proof.f.js +76 -0
- package/fs/crypto/hmac/proof.f.d.ts +1 -0
- package/fs/crypto/hmac/proof.f.js +8 -0
- package/fs/crypto/secp/proof.f.d.ts +1 -0
- package/fs/crypto/secp/proof.f.js +10 -0
- package/fs/crypto/sign/module.f.js +1 -4
- package/fs/dev/module.f.d.ts +5 -3
- package/fs/dev/module.f.js +13 -2
- package/fs/dev/package_json/proof.f.d.ts +1 -0
- package/fs/dev/package_json/proof.f.js +5 -0
- package/fs/dev/proof.f.d.ts +1 -0
- package/fs/dev/proof.f.js +12 -1
- package/fs/djs/ast/module.f.d.ts +1 -1
- package/fs/djs/ast/proof.f.d.ts +5 -0
- package/fs/djs/ast/proof.f.js +17 -0
- package/fs/djs/module.f.d.ts +1 -1
- package/fs/djs/module.f.js +2 -3
- package/fs/djs/serializer/module.f.js +24 -11
- package/fs/djs/transpiler/module.f.js +3 -4
- package/fs/effects/memory/module.f.d.ts +37 -0
- package/fs/effects/memory/module.f.js +24 -0
- package/fs/effects/memory/proof.f.d.ts +6 -0
- package/fs/effects/memory/proof.f.js +64 -0
- package/fs/effects/mock/module.f.d.ts +7 -2
- package/fs/effects/mock/module.f.js +12 -8
- package/fs/effects/module.d.ts +1 -1
- package/fs/effects/module.f.d.ts +41 -0
- package/fs/effects/module.f.js +25 -0
- package/fs/effects/module.js +6 -7
- package/fs/effects/node/memory/module.d.ts +20 -0
- package/fs/effects/node/memory/module.js +44 -0
- package/fs/effects/node/memory/proof.d.ts +10 -0
- package/fs/effects/node/memory/proof.js +35 -0
- package/fs/effects/node/module.d.ts +1 -1
- package/fs/effects/node/module.f.d.ts +54 -8
- package/fs/effects/node/module.f.js +55 -4
- package/fs/effects/node/module.js +166 -135
- package/fs/effects/node/proof.f.d.ts +10 -0
- package/fs/effects/node/proof.f.js +88 -21
- package/fs/effects/node/virtual/module.f.d.ts +6 -0
- package/fs/effects/node/virtual/module.f.js +48 -16
- package/fs/effects/node/virtual/proof.f.d.ts +17 -0
- package/fs/effects/node/virtual/proof.f.js +79 -0
- package/fs/effects/proof.f.d.ts +5 -0
- package/fs/effects/proof.f.js +54 -34
- package/fs/emergent_testing/module.f.d.ts +6 -1
- package/fs/emergent_testing/module.f.js +8 -3
- package/fs/emergent_testing/proof.f.d.ts +11 -0
- package/fs/emergent_testing/proof.f.js +52 -16
- package/fs/fjs/module.f.js +2 -2
- package/fs/fjs/proof.f.d.ts +8 -0
- package/fs/fjs/proof.f.js +39 -0
- package/fs/fsc/module.f.d.ts +5 -0
- package/fs/fsc/module.f.js +17 -27
- package/fs/fsc/proof.f.d.ts +8 -0
- package/fs/fsc/proof.f.js +48 -2
- package/fs/fsm/module.f.d.ts +2 -3
- package/fs/fsm/module.f.js +1 -1
- package/fs/html/module.f.d.ts +2 -3
- package/fs/html/module.f.js +7 -6
- package/fs/html/proof.f.d.ts +1 -0
- package/fs/html/proof.f.js +7 -0
- package/fs/js/tokenizer/module.f.js +1 -1
- package/fs/js/tokenizer/proof.f.js +7 -0
- package/fs/json/module.f.d.ts +9 -2
- package/fs/json/module.f.js +9 -7
- package/fs/json/parser/module.f.js +4 -6
- package/fs/json/parser/proof.f.js +19 -10
- package/fs/json/proof.f.d.ts +2 -1
- package/fs/json/proof.f.js +33 -6
- package/fs/json/rpc/module.f.d.ts +5 -0
- package/fs/json/rpc/module.f.js +16 -11
- package/fs/json/schema/module.f.d.ts +15 -14
- package/fs/json/schema/proof.f.d.ts +3 -0
- package/fs/json/schema/proof.f.js +16 -1
- package/fs/mcp/module.f.d.ts +103 -5
- package/fs/mcp/module.f.js +139 -2
- package/fs/mcp/proof.f.d.ts +34 -0
- package/fs/mcp/proof.f.js +207 -0
- package/fs/mcp/stdio/module.f.d.ts +39 -0
- package/fs/mcp/stdio/module.f.js +54 -0
- package/fs/mcp/stdio/proof.f.d.ts +10 -0
- package/fs/mcp/stdio/proof.f.js +92 -0
- package/fs/mime/module.f.d.ts +39 -0
- package/fs/mime/module.f.js +78 -0
- package/fs/mime/proof.f.d.ts +15 -0
- package/fs/mime/proof.f.js +30 -0
- package/fs/path/module.f.d.ts +8 -0
- package/fs/path/module.f.js +10 -3
- package/fs/path/proof.f.d.ts +1 -0
- package/fs/path/proof.f.js +40 -2
- package/fs/text/sgr/proof.f.js +30 -2
- package/fs/text/utf8/module.f.d.ts +7 -0
- package/fs/text/utf8/module.f.js +85 -31
- package/fs/text/utf8/proof.f.d.ts +1 -0
- package/fs/text/utf8/proof.f.js +60 -1
- package/fs/types/bigfloat/module.f.d.ts +3 -0
- package/fs/types/bigfloat/module.f.js +30 -31
- package/fs/types/bigint/module.f.d.ts +24 -2
- package/fs/types/bigint/module.f.js +30 -2
- package/fs/types/bigint/proof.f.d.ts +7 -0
- package/fs/types/bigint/proof.f.js +47 -16
- package/fs/types/bit_vec/module.f.d.ts +18 -0
- package/fs/types/bit_vec/module.f.js +18 -0
- package/fs/types/bit_vec/proof.f.d.ts +1 -0
- package/fs/types/bit_vec/proof.f.js +13 -1
- package/fs/types/function/operator/proof.f.d.ts +2 -0
- package/fs/types/function/operator/proof.f.js +20 -2
- package/fs/types/list/module.f.js +1 -4
- package/fs/types/list/proof.f.d.ts +1 -1
- package/fs/types/list/proof.f.js +14 -6
- package/fs/types/map/proof.f.d.ts +1 -0
- package/fs/types/map/proof.f.js +10 -1
- package/fs/types/nibble_set/module.f.d.ts +13 -0
- package/fs/types/nibble_set/module.f.js +16 -0
- package/fs/types/object/module.f.d.ts +12 -8
- package/fs/types/object/module.f.js +9 -2
- package/fs/types/object/proof.f.d.ts +14 -0
- package/fs/types/object/proof.f.js +4 -0
- package/fs/types/ordered_map/proof.f.d.ts +1 -0
- package/fs/types/ordered_map/proof.f.js +39 -79
- package/fs/types/phantom/module.f.d.ts +22 -0
- package/fs/types/phantom/module.f.js +11 -0
- package/fs/types/prime_field/proof.f.d.ts +7 -0
- package/fs/types/prime_field/proof.f.js +63 -122
- package/fs/types/rtti/common/module.f.d.ts +4 -4
- package/fs/types/rtti/common/module.f.js +1 -1
- package/fs/types/rtti/module.f.d.ts +2 -3
- package/fs/types/rtti/parse/module.f.js +0 -1
- package/fs/types/rtti/ts/module.f.d.ts +26 -32
- package/fs/types/rtti/ts/module.f.js +2 -2
- package/fs/types/rtti/ts/proof.f.js +3 -3
- package/fs/types/rtti/validate/module.f.js +0 -1
- package/fs/types/sorted_list/module.f.d.ts +6 -0
- package/fs/types/sorted_list/module.f.js +11 -0
- package/fs/types/sorted_set/module.f.js +2 -8
- package/fs/types/ts/module.f.d.ts +1 -1
- package/fs/types/ts/module.f.js +3 -1
- package/fs/types/ts/proof.f.js +3 -2
- package/fs/website/proof.f.d.ts +1 -0
- package/fs/website/proof.f.js +8 -1
- package/package.json +3 -3
package/fs/cbase32/module.f.js
CHANGED
|
@@ -4,32 +4,11 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
import { msb, lsb, length, vec, empty } from "../types/bit_vec/module.f.js";
|
|
7
|
+
import { baseN } from "../base_n/module.f.js";
|
|
7
8
|
// 0123456789abcdef
|
|
8
9
|
const m = '0123456789abcdefghjkmnpqrstvwxyz';
|
|
9
|
-
const {
|
|
10
|
+
const { concat } = msb;
|
|
10
11
|
const popBack1 = lsb.popFront(1n);
|
|
11
|
-
const popFront5 = popFront(5n);
|
|
12
|
-
export const vec5xToCBase32 = (v) => {
|
|
13
|
-
let result = '';
|
|
14
|
-
while (true) {
|
|
15
|
-
const len = length(v);
|
|
16
|
-
if (len === 0n) {
|
|
17
|
-
break;
|
|
18
|
-
}
|
|
19
|
-
const [r, rest] = popFront5(v);
|
|
20
|
-
result += m[Number(r)];
|
|
21
|
-
v = rest;
|
|
22
|
-
}
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
export const vecToCBase32 = (v) => {
|
|
26
|
-
const len = length(v);
|
|
27
|
-
const extraLen = 5n - len % 5n;
|
|
28
|
-
const last = 1n << (extraLen - 1n);
|
|
29
|
-
const padded = concat(v)(vec(extraLen)(last));
|
|
30
|
-
return vec5xToCBase32(padded);
|
|
31
|
-
};
|
|
32
|
-
const vec5 = vec(5n);
|
|
33
12
|
const normalizeChar = (c) => {
|
|
34
13
|
const lower = c.toLowerCase();
|
|
35
14
|
switch (lower) {
|
|
@@ -47,30 +26,30 @@ const normalizeChar = (c) => {
|
|
|
47
26
|
}
|
|
48
27
|
}
|
|
49
28
|
};
|
|
50
|
-
const
|
|
51
|
-
export const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
result = concat(result)(v);
|
|
60
|
-
}
|
|
61
|
-
return result;
|
|
29
|
+
const codec = baseN(5n, m, normalizeChar);
|
|
30
|
+
export const vec5xToCBase32 = codec.vecToString;
|
|
31
|
+
export const cBase32ToVec5x = codec.stringToVec;
|
|
32
|
+
export const vecToCBase32 = (v) => {
|
|
33
|
+
const len = length(v);
|
|
34
|
+
const extraLen = 5n - len % 5n;
|
|
35
|
+
const last = 1n << (extraLen - 1n);
|
|
36
|
+
const padded = concat(v)(vec(extraLen)(last));
|
|
37
|
+
return vec5xToCBase32(padded);
|
|
62
38
|
};
|
|
63
39
|
export const cBase32ToVec = (s) => {
|
|
64
40
|
let v = cBase32ToVec5x(s);
|
|
65
|
-
if (v === null
|
|
41
|
+
if (v === null) {
|
|
66
42
|
return null;
|
|
67
43
|
}
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
44
|
+
// Strip the padding: trailing zeros up to and including the sentinel `1` bit.
|
|
45
|
+
// A string with no sentinel — only zero symbols (`0`/`o`), or empty — exhausts
|
|
46
|
+
// to `empty` and is rejected as `null` rather than looping forever.
|
|
47
|
+
while (v !== empty) {
|
|
48
|
+
const [last, rest] = popBack1(v);
|
|
49
|
+
v = rest;
|
|
72
50
|
if (last === 1n) {
|
|
73
51
|
return v;
|
|
74
52
|
}
|
|
75
53
|
}
|
|
54
|
+
return null;
|
|
76
55
|
};
|
package/fs/cbase32/proof.f.d.ts
CHANGED
package/fs/cbase32/proof.f.js
CHANGED
|
@@ -70,5 +70,20 @@ export const proof = {
|
|
|
70
70
|
if (cBase32ToVec5x("u") !== null) {
|
|
71
71
|
throw 'should error on invalid character';
|
|
72
72
|
}
|
|
73
|
+
},
|
|
74
|
+
unterminated: () => {
|
|
75
|
+
// No sentinel `1` bit → invalid; must return null, not loop forever.
|
|
76
|
+
if (cBase32ToVec("") !== null) {
|
|
77
|
+
throw 'empty must be null';
|
|
78
|
+
}
|
|
79
|
+
if (cBase32ToVec("0") !== null) {
|
|
80
|
+
throw 'single zero symbol must be null';
|
|
81
|
+
}
|
|
82
|
+
if (cBase32ToVec("00") !== null) {
|
|
83
|
+
throw 'all-zero symbols must be null';
|
|
84
|
+
}
|
|
85
|
+
if (cBase32ToVec("o") !== null) {
|
|
86
|
+
throw 'o (maps to 0) must be null';
|
|
87
|
+
}
|
|
73
88
|
}
|
|
74
89
|
};
|
package/fs/ci/bun/module.f.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare const bunSteps: (
|
|
1
|
+
import { type MetaStep } from '../common/module.f.ts';
|
|
2
|
+
export declare const bunSteps: (version: string) => readonly MetaStep[];
|
package/fs/ci/bun/module.f.js
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CI step builder for Bun: installs the pinned Bun version
|
|
3
|
-
*
|
|
2
|
+
* CI step builder for Bun: installs the pinned Bun version and runs the
|
|
3
|
+
* FunctionalScript package smoke test plus Bun coverage in one canonical job.
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
7
|
import { bun } from "../config/module.f.js";
|
|
8
8
|
import { clean, install, test, uses } from "../common/module.f.js";
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
:
|
|
12
|
-
const installBun = installOnWindowsArm({
|
|
13
|
-
def: uses('oven-sh/setup-bun', { 'bun-version': bun }),
|
|
14
|
-
name: 'bun',
|
|
15
|
-
path: 'bun.sh',
|
|
16
|
-
});
|
|
17
|
-
export const bunSteps = (extra) => (v, a) => clean([
|
|
18
|
-
installBun(v)(a),
|
|
9
|
+
export const bunSteps = (version) => clean([
|
|
10
|
+
install(uses('oven-sh/setup-bun', { 'bun-version': bun })),
|
|
11
|
+
install({ run: `bun install -g functionalscript@${version}` }),
|
|
19
12
|
test({ run: 'bun install --frozen-lockfile' }),
|
|
20
|
-
test({ run:
|
|
21
|
-
|
|
13
|
+
test({ run: `bunx functionalscript@${version} t` }),
|
|
14
|
+
test({ run: 'bun test --coverage' }),
|
|
22
15
|
]);
|
|
@@ -39,6 +39,7 @@ export declare const gitHubActionSchema: {
|
|
|
39
39
|
readonly pull_request: import("../../types/rtti/module.f.ts").Or<readonly [{}, undefined]>;
|
|
40
40
|
readonly merge_group: import("../../types/rtti/module.f.ts").Or<readonly [{}, undefined]>;
|
|
41
41
|
};
|
|
42
|
+
readonly permissions: import("../../types/rtti/module.f.ts").Type1<"record", import("../../types/rtti/module.f.ts").String>;
|
|
42
43
|
readonly jobs: import("../../types/rtti/module.f.ts").Type1<"record", {
|
|
43
44
|
readonly 'runs-on': import("../../types/rtti/module.f.ts").String;
|
|
44
45
|
readonly steps: import("../../types/rtti/module.f.ts").Type1<"array", {
|
|
@@ -58,6 +59,7 @@ export declare const parseGitHubAction: import("../../types/rtti/parse/module.f.
|
|
|
58
59
|
readonly pull_request: import("../../types/rtti/module.f.ts").Or<readonly [{}, undefined]>;
|
|
59
60
|
readonly merge_group: import("../../types/rtti/module.f.ts").Or<readonly [{}, undefined]>;
|
|
60
61
|
};
|
|
62
|
+
readonly permissions: import("../../types/rtti/module.f.ts").Type1<"record", import("../../types/rtti/module.f.ts").String>;
|
|
61
63
|
readonly jobs: import("../../types/rtti/module.f.ts").Type1<"record", {
|
|
62
64
|
readonly 'runs-on': import("../../types/rtti/module.f.ts").String;
|
|
63
65
|
readonly steps: import("../../types/rtti/module.f.ts").Type1<"array", {
|
|
@@ -84,4 +86,4 @@ export declare const test: (step: Step) => MetaStep;
|
|
|
84
86
|
export declare const clean: (steps: readonly MetaStep[]) => readonly MetaStep[];
|
|
85
87
|
export declare const toSteps: (m: readonly MetaStep[]) => readonly Step[];
|
|
86
88
|
export declare const ubuntu: (ms: readonly MetaStep[]) => Job;
|
|
87
|
-
export declare const
|
|
89
|
+
export declare const ubuntuArm: (ms: readonly MetaStep[]) => Job;
|
package/fs/ci/common/module.f.js
CHANGED
|
@@ -27,6 +27,7 @@ export const gitHubActionSchema = {
|
|
|
27
27
|
pull_request: option({}),
|
|
28
28
|
merge_group: option({})
|
|
29
29
|
},
|
|
30
|
+
permissions: record(string),
|
|
30
31
|
jobs: jobsSchema
|
|
31
32
|
};
|
|
32
33
|
export const parseGitHubAction = rttiParse(gitHubActionSchema);
|
|
@@ -47,7 +48,10 @@ export const toSteps = (m) => {
|
|
|
47
48
|
const targets = m.flatMap(v => v.type === 'rust' && v.target !== undefined ? [v.target] : []).join(',');
|
|
48
49
|
return [
|
|
49
50
|
...(aptGet !== '' ? [{ run: `sudo apt-get update && sudo apt-get install -y ${aptGet}` }] : []),
|
|
50
|
-
...(needRust ? [uses('dtolnay/rust-toolchain', {
|
|
51
|
+
...(needRust ? [uses('dtolnay/rust-toolchain', {
|
|
52
|
+
components: 'rustfmt,clippy',
|
|
53
|
+
...(targets === '' ? {} : { targets }),
|
|
54
|
+
})] : []),
|
|
51
55
|
...filter('install'),
|
|
52
56
|
uses('actions/checkout'),
|
|
53
57
|
...filter('test'),
|
|
@@ -57,4 +61,7 @@ export const ubuntu = (ms) => ({
|
|
|
57
61
|
'runs-on': images.ubuntu.intel,
|
|
58
62
|
steps: toSteps(ms)
|
|
59
63
|
});
|
|
60
|
-
export const
|
|
64
|
+
export const ubuntuArm = (ms) => ({
|
|
65
|
+
'runs-on': images.ubuntu.arm,
|
|
66
|
+
steps: toSteps(ms)
|
|
67
|
+
});
|
|
@@ -19,16 +19,18 @@ export declare const images: {
|
|
|
19
19
|
readonly arm: "windows-11-arm";
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
+
export declare const functionalscript: "0.30.0";
|
|
22
23
|
export declare const bun = "1.3.14";
|
|
23
|
-
export declare const deno = "2.8.
|
|
24
|
-
export declare const playwright = "1.
|
|
24
|
+
export declare const deno = "2.8.3";
|
|
25
|
+
export declare const playwright = "1.61.0";
|
|
25
26
|
export declare const node: {
|
|
26
27
|
readonly default: "26.3.0";
|
|
27
|
-
readonly
|
|
28
|
+
readonly node22: "22.22.3";
|
|
29
|
+
readonly node24: "24.16.0";
|
|
28
30
|
};
|
|
29
|
-
export declare const wasmtime = "45.0.
|
|
31
|
+
export declare const wasmtime = "45.0.2";
|
|
30
32
|
export declare const wasmer = "7.1.0";
|
|
31
|
-
export declare const tsgo = "7.0.0-dev.
|
|
33
|
+
export declare const tsgo = "7.0.0-dev.20260615.1";
|
|
32
34
|
export declare const actions: {
|
|
33
35
|
readonly 'actions/checkout': "v6";
|
|
34
36
|
readonly 'actions/setup-node': "v6";
|
package/fs/ci/config/module.f.js
CHANGED
|
@@ -20,23 +20,29 @@ export const images = {
|
|
|
20
20
|
arm: 'windows-11-arm',
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
+
// Bootstrap package version used by generated smoke tests. Keep this on a
|
|
24
|
+
// published FunctionalScript release; do not tie it to package.json's current
|
|
25
|
+
// in-repo version. A separate maintenance job advances this pin.
|
|
26
|
+
// https://www.npmjs.com/package/functionalscript
|
|
27
|
+
export const functionalscript = '0.30.0';
|
|
23
28
|
// https://bun.sh/
|
|
24
29
|
export const bun = '1.3.14';
|
|
25
30
|
// https://deno.com/
|
|
26
|
-
export const deno = '2.8.
|
|
31
|
+
export const deno = '2.8.3';
|
|
27
32
|
// https://www.npmjs.com/package/playwright
|
|
28
|
-
export const playwright = '1.
|
|
33
|
+
export const playwright = '1.61.0';
|
|
29
34
|
// https://nodejs.org/en/download
|
|
30
35
|
export const node = {
|
|
31
36
|
default: '26.3.0',
|
|
32
|
-
|
|
37
|
+
node22: '22.22.3',
|
|
38
|
+
node24: '24.16.0',
|
|
33
39
|
};
|
|
34
40
|
// https://github.com/bytecodealliance/wasmtime/releases
|
|
35
|
-
export const wasmtime = '45.0.
|
|
41
|
+
export const wasmtime = '45.0.2';
|
|
36
42
|
// https://github.com/wasmerio/wasmer/releases
|
|
37
43
|
export const wasmer = '7.1.0';
|
|
38
44
|
// https://www.npmjs.com/package/@typescript/native-preview?activeTab=versions
|
|
39
|
-
export const tsgo = '7.0.0-dev.
|
|
45
|
+
export const tsgo = '7.0.0-dev.20260615.1';
|
|
40
46
|
// GitHub Action versions used by CI step builders. The key is the action
|
|
41
47
|
// `owner/name`; call sites compose the full ref as
|
|
42
48
|
// `` `${name}@${actions[name]}` ``.
|
package/fs/ci/deno/module.f.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type MetaStep } from '../common/module.f.ts';
|
|
2
|
-
export declare const denoSteps: (
|
|
2
|
+
export declare const denoSteps: (version: string) => readonly MetaStep[];
|
package/fs/ci/deno/module.f.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CI step builder for Deno: installs the pinned Deno version and runs
|
|
3
|
-
*
|
|
2
|
+
* CI step builder for Deno: installs the pinned Deno version and runs the
|
|
3
|
+
* FunctionalScript package smoke test plus Deno coverage in one canonical job.
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
7
|
import { deno } from "../config/module.f.js";
|
|
8
8
|
import { clean, install, test, uses } from "../common/module.f.js";
|
|
9
|
-
|
|
9
|
+
const denoTest = 'deno test --allow-read --allow-env --allow-sys';
|
|
10
|
+
export const denoSteps = (version) => clean([
|
|
10
11
|
install(uses('denoland/setup-deno', { 'deno-version': deno })),
|
|
12
|
+
install({ run: `deno install -g -A npm:functionalscript@${version}` }),
|
|
13
|
+
test({ run: `deno run -A npm:functionalscript@${version} t` }),
|
|
11
14
|
test({ run: 'deno install --frozen' }),
|
|
12
|
-
test({ run:
|
|
13
|
-
...extra,
|
|
15
|
+
test({ run: `${denoTest} --coverage && deno coverage --include='.*module\\.f\\.ts'` }),
|
|
14
16
|
]);
|
package/fs/ci/module.f.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Continuous integration helper commands for repository automation tasks.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
1
6
|
import { type Effect } from '../effects/module.f.ts';
|
|
2
7
|
import { type NodeOp } from '../effects/node/module.f.ts';
|
|
3
8
|
import { type MetaStep, type Os } from './common/module.f.ts';
|
|
4
9
|
export type Setup = {
|
|
5
10
|
readonly nodeExtra: (os: Os) => readonly MetaStep[];
|
|
6
|
-
readonly denoExtra: readonly MetaStep[];
|
|
7
|
-
readonly bunExtra: readonly MetaStep[];
|
|
8
11
|
};
|
|
9
|
-
export declare const ci: ({ nodeExtra
|
|
12
|
+
export declare const ci: ({ nodeExtra }: Setup) => Effect<NodeOp, number>;
|
|
10
13
|
export declare const main: () => Effect<NodeOp, number>;
|
package/fs/ci/module.f.js
CHANGED
|
@@ -3,48 +3,37 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { utf8, utf8ToString } from "../text/module.f.js";
|
|
7
|
-
import { validatePackageJsonText } from "../dev/package_json/module.f.js";
|
|
8
6
|
import { pure } from "../effects/module.f.js";
|
|
9
|
-
import { access,
|
|
10
|
-
import { images } from "./config/module.f.js";
|
|
11
|
-
import { architecture,
|
|
12
|
-
import {
|
|
13
|
-
import { nodeMainSteps,
|
|
7
|
+
import { access, writeUtf8File } from "../effects/node/module.f.js";
|
|
8
|
+
import { functionalscript, images } from "./config/module.f.js";
|
|
9
|
+
import { architecture, os, toSteps, ubuntuArm } from "./common/module.f.js";
|
|
10
|
+
import { rustPlatformSteps, rustWasmSteps } from "./rust/module.f.js";
|
|
11
|
+
import { nodeMainSteps, nodeVersionJobs } from "./node/module.f.js";
|
|
14
12
|
import { playwrightJob } from "./playwright/module.f.js";
|
|
15
13
|
import { bunSteps } from "./bun/module.f.js";
|
|
16
14
|
import { denoSteps } from "./deno/module.f.js";
|
|
17
|
-
const job = (rust, nodeExtra
|
|
15
|
+
const job = (rust, nodeExtra) => (o) => (a) => {
|
|
18
16
|
const id = `${o}-${a}`;
|
|
19
17
|
const image = images[o][a];
|
|
20
18
|
const result = [
|
|
21
|
-
...(rust ?
|
|
22
|
-
...nodeMainSteps(
|
|
23
|
-
...
|
|
24
|
-
...bunSteps(bunExtra)(o, a),
|
|
19
|
+
...(rust ? rustPlatformSteps(o, a) : []),
|
|
20
|
+
...nodeMainSteps(functionalscript),
|
|
21
|
+
...nodeExtra,
|
|
25
22
|
];
|
|
26
23
|
return [id, { 'runs-on': image, steps: toSteps(result) }];
|
|
27
24
|
};
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const packageInfoFromText = (text) => {
|
|
37
|
-
const result = validatePackageJsonText(text);
|
|
38
|
-
return result[0] === 'ok' ? packageInfoFromPackageJson(result[1]) : fallbackPackageInfo;
|
|
39
|
-
};
|
|
40
|
-
const readPackageInfo = readFile('package.json')
|
|
41
|
-
.step(result => pure(result[0] === 'ok' ? packageInfoFromText(utf8ToString(result[1])) : fallbackPackageInfo));
|
|
42
|
-
export const ci = ({ nodeExtra, denoExtra, bunExtra }) => access('Cargo.toml').step(result => {
|
|
25
|
+
const canonicalJobs = (rust) => ({
|
|
26
|
+
...(rust ? { wasm: ubuntuArm(rustWasmSteps) } : {}),
|
|
27
|
+
deno: ubuntuArm(denoSteps(functionalscript)),
|
|
28
|
+
bun: ubuntuArm(bunSteps(functionalscript)),
|
|
29
|
+
...nodeVersionJobs(functionalscript),
|
|
30
|
+
playwright: playwrightJob,
|
|
31
|
+
});
|
|
32
|
+
export const ci = ({ nodeExtra }) => access('Cargo.toml').step(result => {
|
|
43
33
|
const rust = result[0] === 'ok';
|
|
44
34
|
const jobs = {
|
|
45
|
-
...Object.fromEntries(os.flatMap(o => architecture.map(job(rust, nodeExtra(o)
|
|
46
|
-
...
|
|
47
|
-
playwright: playwrightJob,
|
|
35
|
+
...Object.fromEntries(os.flatMap(o => architecture.map(job(rust, nodeExtra(o))(o)))),
|
|
36
|
+
...canonicalJobs(rust),
|
|
48
37
|
};
|
|
49
38
|
const gha = {
|
|
50
39
|
name: 'CI',
|
|
@@ -52,31 +41,12 @@ export const ci = ({ nodeExtra, denoExtra, bunExtra }) => access('Cargo.toml').s
|
|
|
52
41
|
pull_request: {},
|
|
53
42
|
merge_group: {},
|
|
54
43
|
},
|
|
44
|
+
permissions: {
|
|
45
|
+
contents: 'read',
|
|
46
|
+
},
|
|
55
47
|
jobs,
|
|
56
48
|
};
|
|
57
|
-
return
|
|
49
|
+
return writeUtf8File('.github/workflows/ci.yml', JSON.stringify(gha, null, ' '))
|
|
58
50
|
.step(() => pure(0));
|
|
59
51
|
});
|
|
60
|
-
const
|
|
61
|
-
test({ run: 'fjs compile issues/demo/data/tree.json _tree.f.js' }),
|
|
62
|
-
test({ run: 'fjs t' }),
|
|
63
|
-
];
|
|
64
|
-
const denoDemoCompile = [
|
|
65
|
-
test({ run: 'deno task fjs compile issues/demo/data/tree.json _tree.f.js' }),
|
|
66
|
-
test({ run: 'deno task fjs t' }),
|
|
67
|
-
];
|
|
68
|
-
const bunDemoCompile = [
|
|
69
|
-
test({ run: 'bun ./fs/fjs/module.ts t' }),
|
|
70
|
-
];
|
|
71
|
-
const defaultNodeExtra = ({ name, functionalscript }) => (o) => [
|
|
72
|
-
test({ run: 'npm pack' }),
|
|
73
|
-
test({ run: `npm install -g ${findTgz(o)}` }),
|
|
74
|
-
...(functionalscript ? demoCompile : []),
|
|
75
|
-
test({ run: `npm uninstall ${name} -g` }),
|
|
76
|
-
];
|
|
77
|
-
const defaultEffect = (info) => ci({
|
|
78
|
-
nodeExtra: defaultNodeExtra(info),
|
|
79
|
-
denoExtra: info.functionalscript ? [...denoDemoCompile] : [],
|
|
80
|
-
bunExtra: info.functionalscript ? bunDemoCompile : [],
|
|
81
|
-
});
|
|
82
|
-
export const main = () => readPackageInfo.step(defaultEffect);
|
|
52
|
+
export const main = () => ci({ nodeExtra: () => [] });
|
package/fs/ci/node/module.f.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Jobs, type MetaStep } from '../common/module.f.ts';
|
|
2
2
|
export declare const major: (v: string) => string;
|
|
3
3
|
export declare const basicNode: (version: string) => (extra: readonly MetaStep[]) => readonly MetaStep[];
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const nodeMainSteps: (
|
|
4
|
+
export declare const platformNodeSteps: (version: string) => readonly MetaStep[];
|
|
5
|
+
export declare const nodeVersionJobs: (version: string) => Jobs;
|
|
6
|
+
export declare const nodeMainSteps: (version: string) => readonly MetaStep[];
|
package/fs/ci/node/module.f.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CI step builders for Node.js: setup-node installation,
|
|
3
|
-
*
|
|
2
|
+
* CI step builders for Node.js: setup-node installation, platform smoke tests,
|
|
3
|
+
* per-version canonical jobs, and the main TSGO step.
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
7
|
import { node, tsgo } from "../config/module.f.js";
|
|
8
|
-
import { clean,
|
|
8
|
+
import { clean, install, test, ubuntuArm, uses } from "../common/module.f.js";
|
|
9
9
|
export const major = (v) => v.split('.')[0];
|
|
10
10
|
const installNode = (version) => uses('actions/setup-node', { 'node-version': version });
|
|
11
11
|
const nodeInstall = (v) => [
|
|
@@ -16,29 +16,33 @@ export const basicNode = (version) => (extra) => clean([
|
|
|
16
16
|
...nodeInstall(version),
|
|
17
17
|
...extra,
|
|
18
18
|
]);
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
test({ run: '
|
|
19
|
+
const fjsGlobalInstall = (version) => install({ run: `npm install -g functionalscript@${version}` });
|
|
20
|
+
export const platformNodeSteps = (version) => [
|
|
21
|
+
...nodeInstall(node.default),
|
|
22
|
+
fjsGlobalInstall(version),
|
|
23
|
+
test({ run: 'fjs t' }),
|
|
24
24
|
];
|
|
25
|
-
|
|
26
|
-
...
|
|
27
|
-
|
|
25
|
+
const node22Steps = (version) => clean([
|
|
26
|
+
...nodeInstall(node.node22),
|
|
27
|
+
fjsGlobalInstall(version),
|
|
28
|
+
test({ run: 'fjs t' }),
|
|
28
29
|
]);
|
|
29
|
-
const
|
|
30
|
-
...nodeInstall(
|
|
31
|
-
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
install({ run: `npm cache add ${tsgoName}` }),
|
|
41
|
-
test({ run: `npx npm:${tsgoName}` }),
|
|
42
|
-
// extra
|
|
43
|
-
...extra,
|
|
30
|
+
const node24Steps = clean([
|
|
31
|
+
...nodeInstall(node.node24),
|
|
32
|
+
test({ run: 'node --test' }),
|
|
33
|
+
]);
|
|
34
|
+
const node26Steps = clean([
|
|
35
|
+
...nodeInstall(node.default),
|
|
36
|
+
install({ run: `npm install -g @typescript/native-preview@${tsgo}` }),
|
|
37
|
+
test({ run: 'npx tsc' }),
|
|
38
|
+
test({ run: 'tsgo' }),
|
|
39
|
+
test({ run: 'npm run cov' }),
|
|
40
|
+
test({ run: 'npm pack' }),
|
|
44
41
|
]);
|
|
42
|
+
const nodeJob = (steps) => ubuntuArm(steps);
|
|
43
|
+
export const nodeVersionJobs = (version) => ({
|
|
44
|
+
[`node${major(node.node22)}`]: nodeJob(node22Steps(version)),
|
|
45
|
+
[`node${major(node.node24)}`]: nodeJob(node24Steps),
|
|
46
|
+
[`node${major(node.default)}`]: nodeJob(node26Steps),
|
|
47
|
+
});
|
|
48
|
+
export const nodeMainSteps = platformNodeSteps;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { images, node, playwright } from "../config/module.f.js";
|
|
8
8
|
import { install, test, toSteps, uses } from "../common/module.f.js";
|
|
9
9
|
import { basicNode } from "../node/module.f.js";
|
|
10
|
-
const playwrightImage = images.ubuntu.
|
|
10
|
+
const playwrightImage = images.ubuntu.arm;
|
|
11
11
|
export const playwrightJob = {
|
|
12
12
|
'runs-on': playwrightImage,
|
|
13
13
|
steps: toSteps(basicNode(node.default)([
|
package/fs/ci/proof.f.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const proof: {
|
|
2
|
+
matrixShape: () => void;
|
|
2
3
|
rust: () => void;
|
|
3
4
|
noRust: () => void;
|
|
4
5
|
extra: {
|
|
@@ -6,12 +7,10 @@ export declare const proof: {
|
|
|
6
7
|
osSpecific: () => void;
|
|
7
8
|
};
|
|
8
9
|
defaultSetup: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
missingPackageJsonFallback: () => void;
|
|
14
|
-
missingNameFallback: () => void;
|
|
15
|
-
nonObjectFallback: () => void;
|
|
10
|
+
functionalscriptPackage: () => void;
|
|
11
|
+
otherPackage: () => void;
|
|
12
|
+
configuredPackageVersion: () => void;
|
|
13
|
+
missingPackageJson: () => void;
|
|
16
14
|
};
|
|
15
|
+
ubuntu: () => void;
|
|
17
16
|
};
|