functionalscript 0.19.0 → 0.21.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/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/asn.1/{test.f.js → proof.f.js} +1 -1
- package/fs/asserts/module.f.d.ts +4 -0
- package/fs/asserts/module.f.js +6 -0
- package/fs/base128/proof.f.d.ts +1 -0
- package/fs/base128/{test.f.js → proof.f.js} +1 -1
- package/fs/bnf/data/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/bnf/data/{test.f.js → proof.f.js} +1 -1
- package/fs/bnf/proof.f.d.ts +3 -0
- package/fs/bnf/{test.f.js → proof.f.js} +1 -1
- package/fs/cas/module.f.js +9 -23
- package/fs/cas/proof.f.d.ts +4 -0
- package/fs/cas/proof.f.js +37 -0
- package/fs/cbase32/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/cbase32/{test.f.js → proof.f.js} +1 -1
- package/fs/ci/bun/module.f.js +2 -7
- package/fs/ci/common/module.f.d.ts +2 -1
- package/fs/ci/common/module.f.js +7 -9
- package/fs/ci/config/module.f.d.ts +12 -3
- package/fs/ci/config/module.f.js +24 -4
- package/fs/ci/deno/module.f.js +2 -5
- package/fs/ci/node/module.f.js +14 -9
- package/fs/ci/playwright/module.f.js +5 -8
- package/fs/ci/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/ci/{test.f.js → proof.f.js} +2 -2
- package/fs/ci/rust/module.f.js +3 -9
- package/fs/crypto/hmac/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/crypto/hmac/{test.f.js → proof.f.js} +1 -1
- package/fs/crypto/secp/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/crypto/secp/{test.f.js → proof.f.js} +1 -1
- package/fs/crypto/sha2/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/crypto/sha2/{test.f.js → proof.f.js} +1 -1
- package/fs/crypto/sign/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/crypto/sign/{test.f.js → proof.f.js} +1 -1
- package/fs/dev/module.f.d.ts +28 -5
- package/fs/dev/module.f.js +38 -28
- package/fs/dev/{test.f.d.ts → proof.f.d.ts} +5 -2
- package/fs/dev/{test.f.js → proof.f.js} +26 -2
- package/fs/dev/version/proof.f.d.ts +3 -0
- package/fs/dev/version/{test.f.js → proof.f.js} +1 -1
- package/fs/djs/ast/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/djs/ast/{test.f.js → proof.f.js} +1 -1
- package/fs/djs/parser/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/djs/parser/{test.f.js → proof.f.js} +1 -1
- package/fs/djs/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/djs/{test.f.js → proof.f.js} +1 -1
- package/fs/djs/serializer/module.f.d.ts +2 -2
- package/fs/djs/serializer/module.f.js +47 -79
- package/fs/djs/serializer/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/djs/serializer/{test.f.js → proof.f.js} +8 -8
- package/fs/djs/tokenizer/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/djs/tokenizer/{test.f.js → proof.f.js} +1 -1
- package/fs/djs/tokenizer-new/module.f.js +1 -1
- package/fs/djs/tokenizer-new/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/djs/tokenizer-new/{test.f.js → proof.f.js} +1 -1
- package/fs/djs/transpiler/module.f.d.ts +15 -0
- package/fs/djs/transpiler/module.f.js +10 -2
- package/fs/djs/transpiler/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/djs/transpiler/{test.f.js → proof.f.js} +1 -1
- package/fs/{dev/tf → emergent-testing}/module.f.d.ts +66 -8
- package/fs/{dev/tf → emergent-testing}/module.f.js +101 -34
- package/fs/{dev/tf → emergent-testing}/module.js +2 -2
- package/fs/{dev/tf/test.f.d.ts → emergent-testing/proof.f.d.ts} +28 -0
- package/fs/{dev/tf/test.f.js → emergent-testing/proof.f.js} +119 -40
- package/fs/emergent-testing/scenarios/async-subtests.fail.d.ts +6 -0
- package/fs/emergent-testing/scenarios/async-subtests.fail.js +9 -0
- package/fs/emergent-testing/scenarios/async-subtests.pass.d.ts +6 -0
- package/fs/emergent-testing/scenarios/async-subtests.pass.js +9 -0
- package/fs/emergent-testing/scenarios/async.fail.d.ts +3 -0
- package/fs/emergent-testing/scenarios/async.fail.js +6 -0
- package/fs/emergent-testing/scenarios/async.pass.d.ts +3 -0
- package/fs/emergent-testing/scenarios/async.pass.js +5 -0
- package/fs/emergent-testing/scenarios/fail.fail.d.ts +3 -0
- package/fs/emergent-testing/scenarios/fail.fail.js +3 -0
- package/fs/emergent-testing/scenarios/return-value.pass.d.ts +3 -0
- package/fs/emergent-testing/scenarios/return-value.pass.js +4 -0
- package/fs/emergent-testing/scenarios/thenable.pass.d.ts +5 -0
- package/fs/emergent-testing/scenarios/thenable.pass.js +11 -0
- package/fs/emergent-testing/scenarios/thenable2.pass.d.ts +5 -0
- package/fs/emergent-testing/scenarios/thenable2.pass.js +3 -0
- package/fs/emergent-testing/scenarios/throw.pass.d.ts +5 -0
- package/fs/{dev/tf/scenarios/throw.pass.f.js → emergent-testing/scenarios/throw.pass.js} +1 -1
- package/fs/fjs/module.f.js +4 -5
- package/fs/fsc/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/fsc/{test.f.js → proof.f.js} +1 -1
- package/fs/fsm/proof.f.d.ts +4 -0
- package/fs/fsm/{test.f.js → proof.f.js} +1 -1
- package/fs/html/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/html/{test.f.js → proof.f.js} +1 -1
- package/fs/io/module.d.ts +1 -1
- package/fs/io/module.f.d.ts +3 -2
- package/fs/io/module.f.js +4 -3
- package/fs/io/module.js +19 -11
- package/fs/js/tokenizer/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/js/tokenizer/{test.f.js → proof.f.js} +1 -1
- package/fs/json/parser/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/json/parser/{test.f.js → proof.f.js} +1 -1
- package/fs/json/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/json/{test.f.js → proof.f.js} +1 -1
- package/fs/json/serializer/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/json/serializer/{test.f.js → proof.f.js} +1 -1
- package/fs/json/tokenizer/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/json/tokenizer/{test.f.js → proof.f.js} +1 -1
- package/fs/path/proof.f.d.ts +5 -0
- package/fs/path/{test.f.js → proof.f.js} +4 -3
- package/fs/sul/id/module.f.js +1 -1
- package/fs/sul/id/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/sul/id/{test.f.js → proof.f.js} +2 -2
- package/fs/sul/level/hash/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/sul/level/hash/{test.f.js → proof.f.js} +2 -2
- package/fs/sul/level/literal/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/sul/level/literal/{test.f.js → proof.f.js} +1 -1
- package/fs/sul/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/sul/{test.f.js → proof.f.js} +2 -2
- package/fs/text/ascii/proof.f.d.ts +3 -0
- package/fs/text/ascii/{test.f.js → proof.f.js} +1 -1
- package/fs/text/code_point/module.f.d.ts +28 -0
- package/fs/text/code_point/module.f.js +31 -0
- package/fs/text/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/text/{test.f.js → proof.f.js} +1 -1
- package/fs/text/sgr/proof.f.d.ts +1 -0
- package/fs/text/sgr/{test.f.js → proof.f.js} +1 -1
- package/fs/text/utf16/module.f.js +3 -53
- package/fs/text/utf16/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/text/utf16/{test.f.js → proof.f.js} +1 -1
- package/fs/text/utf8/module.f.js +3 -25
- package/fs/text/utf8/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/text/utf8/{test.f.js → proof.f.js} +1 -1
- package/fs/types/array/module.f.js +2 -5
- package/fs/types/array/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/array/{test.f.js → proof.f.js} +1 -1
- package/fs/types/bigfloat/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/bigfloat/{test.f.js → proof.f.js} +1 -1
- package/fs/types/bigint/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/bigint/{test.f.js → proof.f.js} +1 -1
- package/fs/types/bit_vec/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/bit_vec/{test.f.js → proof.f.js} +1 -1
- package/fs/types/btree/find/proof.f.d.ts +1 -0
- package/fs/types/btree/find/{test.f.js → proof.f.js} +1 -1
- package/fs/types/btree/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/btree/{test.f.js → proof.f.js} +1 -1
- package/fs/types/btree/remove/proof.f.d.ts +4 -0
- package/fs/types/btree/remove/{test.f.js → proof.f.js} +1 -1
- package/fs/types/btree/set/proof.f.d.ts +1 -0
- package/fs/types/btree/set/{test.f.js → proof.f.js} +1 -1
- package/fs/types/btree/types/module.f.d.ts +8 -0
- package/fs/types/btree/types/module.f.js +8 -0
- package/fs/types/byte_set/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/byte_set/{test.f.js → proof.f.js} +1 -1
- package/fs/types/effects/module.f.d.ts +17 -0
- package/fs/types/effects/module.f.js +17 -0
- package/fs/types/effects/node/module.f.d.ts +60 -5
- package/fs/types/effects/node/module.f.js +12 -1
- package/fs/types/effects/node/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/effects/node/{test.f.js → proof.f.js} +1 -1
- package/fs/types/effects/node/virtual/module.f.js +2 -1
- package/fs/types/effects/proof.f.d.ts +11 -0
- package/fs/types/effects/proof.f.js +57 -0
- package/fs/types/function/compare/proof.f.d.ts +1 -0
- package/fs/types/function/compare/{test.f.js → proof.f.js} +1 -1
- package/fs/types/function/operator/proof.f.d.ts +12 -0
- package/fs/types/function/operator/{test.f.js → proof.f.js} +11 -10
- package/fs/types/function/proof.f.d.ts +1 -0
- package/fs/types/function/{test.f.js → proof.f.js} +1 -1
- package/fs/types/list/{test.f.d.ts → proof.f.d.ts} +2 -2
- package/fs/types/list/{test.f.js → proof.f.js} +15 -1
- package/fs/types/map/proof.f.d.ts +4 -0
- package/fs/types/map/{test.f.js → proof.f.js} +1 -1
- package/fs/types/monoid/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/monoid/{test.f.js → proof.f.js} +1 -1
- package/fs/types/nibble_set/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/nibble_set/{test.f.js → proof.f.js} +1 -1
- package/fs/types/nominal/proof.f.d.ts +4 -0
- package/fs/types/nominal/{test.f.js → proof.f.js} +1 -1
- package/fs/types/nullable/module.f.d.ts +7 -0
- package/fs/types/nullable/module.f.js +7 -0
- package/fs/types/nullable/proof.f.d.ts +1 -0
- package/fs/types/nullable/{test.f.js → proof.f.js} +20 -3
- package/fs/types/number/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/number/{test.f.js → proof.f.js} +1 -1
- package/fs/types/object/module.f.js +2 -4
- package/fs/types/object/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/object/{test.f.js → proof.f.js} +1 -1
- package/fs/types/ordered_map/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/ordered_map/{test.f.js → proof.f.js} +1 -1
- package/fs/types/patricia_trie/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/patricia_trie/{test.f.js → proof.f.js} +2 -2
- package/fs/types/prime_field/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/prime_field/{test.f.js → proof.f.js} +1 -1
- package/fs/types/range/proof.f.d.ts +1 -0
- package/fs/types/range/{test.f.js → proof.f.js} +1 -1
- package/fs/types/range_map/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/range_map/{test.f.js → proof.f.js} +1 -1
- package/fs/types/result/proof.f.d.ts +5 -0
- package/fs/types/result/{test.f.js → proof.f.js} +18 -2
- package/fs/types/rtti/parse/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/rtti/parse/{test.f.js → proof.f.js} +1 -1
- package/fs/types/rtti/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/rtti/{test.f.js → proof.f.js} +1 -1
- package/fs/types/rtti/ts/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/rtti/ts/{test.f.js → proof.f.js} +1 -1
- package/fs/types/rtti/validate/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/rtti/validate/{test.f.js → proof.f.js} +1 -1
- package/fs/types/sorted_list/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/sorted_list/{test.f.js → proof.f.js} +1 -1
- package/fs/types/sorted_set/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/sorted_set/{test.f.js → proof.f.js} +1 -1
- package/fs/types/string/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/string/{test.f.js → proof.f.js} +1 -1
- package/fs/types/string_set/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/string_set/{test.f.js → proof.f.js} +1 -1
- package/fs/types/ts/module.f.d.ts +0 -1
- package/fs/types/ts/{test.f.d.ts → proof.f.d.ts} +20 -0
- package/fs/types/ts/{test.f.js → proof.f.js} +1 -0
- package/fs/types/uint8array/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/fs/types/uint8array/{test.f.js → proof.f.js} +1 -1
- package/fs/website/proof.f.d.ts +3 -0
- package/fs/website/proof.f.js +9 -0
- package/issues/demo/sample/{test.f.js → proof.f.js} +1 -1
- package/issues/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/issues/{test.f.js → proof.f.js} +1 -1
- package/nanvm-lib/tests/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/nanvm-lib/tests/{test.f.js → proof.f.js} +1 -1
- package/nanvm-lib/tests/vm/{test.f.d.ts → proof.f.d.ts} +1 -2
- package/nanvm-lib/tests/vm/{test.f.js → proof.f.js} +1 -1
- package/package.json +2 -2
- package/fs/base128/test.f.d.ts +0 -2
- package/fs/bnf/test.f.d.ts +0 -4
- package/fs/cas/test.f.d.ts +0 -2
- package/fs/cas/test.f.js +0 -1
- package/fs/dev/tf/scenarios/fail.fail.f.d.ts +0 -1
- package/fs/dev/tf/scenarios/fail.fail.f.js +0 -1
- package/fs/dev/tf/scenarios/return-value.pass.f.d.ts +0 -1
- package/fs/dev/tf/scenarios/return-value.pass.f.js +0 -2
- package/fs/dev/tf/scenarios/throw.pass.f.d.ts +0 -6
- package/fs/dev/version/test.f.d.ts +0 -4
- package/fs/fsm/test.f.d.ts +0 -5
- package/fs/path/test.f.d.ts +0 -3
- package/fs/text/ascii/test.f.d.ts +0 -4
- package/fs/text/sgr/test.f.d.ts +0 -2
- package/fs/types/btree/find/test.f.d.ts +0 -2
- package/fs/types/btree/remove/test.f.d.ts +0 -5
- package/fs/types/btree/set/test.f.d.ts +0 -2
- package/fs/types/function/compare/test.f.d.ts +0 -2
- package/fs/types/function/operator/test.f.d.ts +0 -10
- package/fs/types/function/test.f.d.ts +0 -2
- package/fs/types/map/test.f.d.ts +0 -5
- package/fs/types/nominal/test.f.d.ts +0 -5
- package/fs/types/nullable/test.f.d.ts +0 -2
- package/fs/types/range/test.f.d.ts +0 -2
- package/fs/types/result/test.f.d.ts +0 -2
- /package/fs/{dev/tf → emergent-testing}/all.test.d.ts +0 -0
- /package/fs/{dev/tf → emergent-testing}/all.test.js +0 -0
- /package/fs/{dev/tf → emergent-testing}/module.d.ts +0 -0
- /package/fs/{dev/tf → emergent-testing}/scenarios/all.d.ts +0 -0
- /package/fs/{dev/tf → emergent-testing}/scenarios/all.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const proof: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
export declare const proof: {
|
|
2
2
|
rangeDecode: () => void;
|
|
3
3
|
rangeEncode: () => void;
|
|
4
4
|
toData: (() => void)[];
|
|
@@ -12,4 +12,3 @@ declare const _default: {
|
|
|
12
12
|
repeatParser: (() => void)[];
|
|
13
13
|
example: () => void;
|
|
14
14
|
};
|
|
15
|
-
export default _default;
|
|
@@ -11,7 +11,7 @@ const descentParserCpOnly = (m, name, cp) => {
|
|
|
11
11
|
const cpm = toArray(map(mapCodePoint)(cp));
|
|
12
12
|
return m(name, cpm);
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export const proof = {
|
|
15
15
|
rangeDecode: () => {
|
|
16
16
|
const decoded1 = stringify(sort)(rangeDecode(0x000079_000087));
|
|
17
17
|
if (decoded1 !== '[121,135]') {
|
package/fs/cas/module.f.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
import { computeSync, sha256 } from "../crypto/sha2/module.f.js";
|
|
7
7
|
import { parse } from "../path/module.f.js";
|
|
8
8
|
import { cBase32ToVec, vecToCBase32 } from "../cbase32/module.f.js";
|
|
9
|
-
import { begin, pure } from "../types/effects/module.f.js";
|
|
10
|
-
import {
|
|
9
|
+
import { begin, forEachStep, pure } from "../types/effects/module.f.js";
|
|
10
|
+
import { errorExit, log, mkdir, readdir, readFile, writeFile } from "../types/effects/node/module.f.js";
|
|
11
11
|
import { toOption } from "../types/nullable/module.f.js";
|
|
12
12
|
import { unwrap } from "../types/result/module.f.js";
|
|
13
13
|
const o = { withFileTypes: true };
|
|
@@ -61,10 +61,6 @@ export const cas = (sha2) => {
|
|
|
61
61
|
list,
|
|
62
62
|
});
|
|
63
63
|
};
|
|
64
|
-
/** Prints an error message and returns exit code `1`. */
|
|
65
|
-
const e = (s) => begin
|
|
66
|
-
.step(() => error(s))
|
|
67
|
-
.step(() => pure(1));
|
|
68
64
|
/**
|
|
69
65
|
* Runs the CAS CLI.
|
|
70
66
|
*
|
|
@@ -79,7 +75,7 @@ export const main = (args) => {
|
|
|
79
75
|
switch (cmd) {
|
|
80
76
|
case 'add': {
|
|
81
77
|
if (options.length !== 1) {
|
|
82
|
-
return
|
|
78
|
+
return errorExit("'cas add' expects one parameter");
|
|
83
79
|
}
|
|
84
80
|
const [path] = options;
|
|
85
81
|
return begin
|
|
@@ -90,18 +86,18 @@ export const main = (args) => {
|
|
|
90
86
|
}
|
|
91
87
|
case 'get': {
|
|
92
88
|
if (options.length !== 2) {
|
|
93
|
-
return
|
|
89
|
+
return errorExit("'cas get' expects two parameters");
|
|
94
90
|
}
|
|
95
91
|
const [hashCBase32, path] = options;
|
|
96
92
|
const hash = cBase32ToVec(hashCBase32);
|
|
97
93
|
if (hash === null) {
|
|
98
|
-
return
|
|
94
|
+
return errorExit(`invalid hash format: ${hashCBase32}`);
|
|
99
95
|
}
|
|
100
96
|
return begin
|
|
101
97
|
.step(() => c.read(hash))
|
|
102
98
|
.step(v => {
|
|
103
99
|
const result = v === undefined
|
|
104
|
-
?
|
|
100
|
+
? errorExit(`no such hash: ${hashCBase32}`)
|
|
105
101
|
: begin
|
|
106
102
|
.step(() => writeFile(path, v))
|
|
107
103
|
.step(() => pure(0));
|
|
@@ -111,23 +107,13 @@ export const main = (args) => {
|
|
|
111
107
|
case 'list': {
|
|
112
108
|
return begin
|
|
113
109
|
.step(() => c.list())
|
|
114
|
-
.step(
|
|
115
|
-
// TODO: make it lazy.
|
|
116
|
-
let i = begin;
|
|
117
|
-
for (const j of v) {
|
|
118
|
-
const prev = i;
|
|
119
|
-
i = begin
|
|
120
|
-
.step(() => prev)
|
|
121
|
-
.step(() => log(vecToCBase32(j)));
|
|
122
|
-
}
|
|
123
|
-
return i;
|
|
124
|
-
})
|
|
110
|
+
.step(forEachStep(j => log(vecToCBase32(j))))
|
|
125
111
|
.step(() => pure(0));
|
|
126
112
|
}
|
|
127
113
|
case undefined: {
|
|
128
|
-
return
|
|
114
|
+
return errorExit('Error: CAS command requires subcommand');
|
|
129
115
|
}
|
|
130
116
|
default:
|
|
131
|
-
return
|
|
117
|
+
return errorExit(`Error: Unknown CAS subcommand "${args[0]}"`);
|
|
132
118
|
}
|
|
133
119
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { cas } from "./module.f.js";
|
|
2
|
+
import { sha256 } from "../crypto/sha2/module.f.js";
|
|
3
|
+
import { empty, length } from "../types/bit_vec/module.f.js";
|
|
4
|
+
import { pure } from "../types/effects/module.f.js";
|
|
5
|
+
import { run } from "../types/effects/mock/module.f.js";
|
|
6
|
+
export const proof = {
|
|
7
|
+
casWrite: () => {
|
|
8
|
+
const store = {
|
|
9
|
+
read: (_key) => pure(undefined),
|
|
10
|
+
write: (_key, _value) => pure(undefined),
|
|
11
|
+
list: () => pure([]),
|
|
12
|
+
};
|
|
13
|
+
const c = cas(sha256)(store);
|
|
14
|
+
const [, hash] = run({})(undefined)(c.write(empty));
|
|
15
|
+
// sha256 of empty input produces a 256-bit hash
|
|
16
|
+
if (length(hash) !== 256n) {
|
|
17
|
+
throw ['expected 256-bit hash', length(hash)];
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
casReadPassthrough: () => {
|
|
21
|
+
const stored = empty;
|
|
22
|
+
const store = {
|
|
23
|
+
read: (_key) => pure(stored),
|
|
24
|
+
write: (_key, _value) => pure(undefined),
|
|
25
|
+
list: () => pure([stored]),
|
|
26
|
+
};
|
|
27
|
+
const c = cas(sha256)(store);
|
|
28
|
+
const [, readResult] = run({})(undefined)(c.read(empty));
|
|
29
|
+
if (readResult !== stored) {
|
|
30
|
+
throw ['read should pass through', readResult];
|
|
31
|
+
}
|
|
32
|
+
const [, listResult] = run({})(undefined)(c.list());
|
|
33
|
+
if (listResult.length !== 1) {
|
|
34
|
+
throw ['list should pass through', listResult];
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
};
|
package/fs/ci/bun/module.f.js
CHANGED
|
@@ -5,17 +5,12 @@
|
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
7
|
import { bun } from "../config/module.f.js";
|
|
8
|
-
import { clean, install, test } from "../common/module.f.js";
|
|
8
|
+
import { clean, install, test, uses } from "../common/module.f.js";
|
|
9
9
|
const installOnWindowsArm = ({ def, name, path }) => (v) => (a) => install(v === 'windows' && a === 'arm'
|
|
10
10
|
? { run: `irm ${path}/install.ps1 | iex; "$env:USERPROFILE\\.${name}\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append` }
|
|
11
11
|
: def);
|
|
12
12
|
const installBun = installOnWindowsArm({
|
|
13
|
-
def: {
|
|
14
|
-
uses: 'oven-sh/setup-bun@v2',
|
|
15
|
-
with: {
|
|
16
|
-
'bun-version': bun
|
|
17
|
-
},
|
|
18
|
-
},
|
|
13
|
+
def: uses('oven-sh/setup-bun', { 'bun-version': bun }),
|
|
19
14
|
name: 'bun',
|
|
20
15
|
path: 'bun.sh',
|
|
21
16
|
});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import { images } from '../config/module.f.ts';
|
|
8
|
+
import { actions, images } from '../config/module.f.ts';
|
|
9
9
|
import { type Ts } from '../../types/rtti/ts/module.f.ts';
|
|
10
10
|
export declare const os: readonly ["ubuntu", "macos", "windows"];
|
|
11
11
|
export type Os = typeof os[number];
|
|
@@ -76,6 +76,7 @@ export type MetaStep = {
|
|
|
76
76
|
readonly type: 'apt-get';
|
|
77
77
|
readonly package: string;
|
|
78
78
|
};
|
|
79
|
+
export declare const uses: (name: keyof typeof actions, w?: Record<string, string>) => Step;
|
|
79
80
|
export declare const install: (step: Step) => MetaStep;
|
|
80
81
|
export declare const test: (step: Step) => MetaStep;
|
|
81
82
|
export declare const clean: (steps: readonly MetaStep[]) => readonly MetaStep[];
|
package/fs/ci/common/module.f.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { actions, images } from "../config/module.f.js";
|
|
9
9
|
import { option, array, record, string } from "../../types/rtti/module.f.js";
|
|
10
10
|
import {} from "../../types/rtti/ts/module.f.js";
|
|
11
11
|
import { parse as rttiParse } from "../../types/rtti/parse/module.f.js";
|
|
@@ -27,6 +27,10 @@ export const gitHubActionSchema = {
|
|
|
27
27
|
jobs: jobsSchema
|
|
28
28
|
};
|
|
29
29
|
export const parseGitHubAction = rttiParse(gitHubActionSchema);
|
|
30
|
+
export const uses = (name, w) => ({
|
|
31
|
+
uses: `${name}@${actions[name]}`,
|
|
32
|
+
...(w === undefined ? {} : { with: w })
|
|
33
|
+
});
|
|
30
34
|
export const install = (step) => ({ type: 'install', step });
|
|
31
35
|
export const test = (step) => ({ type: 'test', step });
|
|
32
36
|
export const clean = (steps) => [
|
|
@@ -40,15 +44,9 @@ export const toSteps = (m) => {
|
|
|
40
44
|
const targets = m.flatMap(v => v.type === 'rust' && v.target !== undefined ? [v.target] : []).join(',');
|
|
41
45
|
return [
|
|
42
46
|
...(aptGet !== '' ? [{ run: `sudo apt-get update && sudo apt-get install -y ${aptGet}` }] : []),
|
|
43
|
-
...(needRust ? [{
|
|
44
|
-
uses: `dtolnay/rust-toolchain@${rust}`,
|
|
45
|
-
with: {
|
|
46
|
-
components: 'rustfmt,clippy',
|
|
47
|
-
targets
|
|
48
|
-
}
|
|
49
|
-
}] : []),
|
|
47
|
+
...(needRust ? [uses('dtolnay/rust-toolchain', { components: 'rustfmt,clippy', targets })] : []),
|
|
50
48
|
...filter('install'),
|
|
51
|
-
|
|
49
|
+
uses('actions/checkout'),
|
|
52
50
|
...filter('test'),
|
|
53
51
|
];
|
|
54
52
|
};
|
|
@@ -22,11 +22,20 @@ export declare const images: {
|
|
|
22
22
|
export declare const bun = "1.3.14";
|
|
23
23
|
export declare const deno = "2.8.1";
|
|
24
24
|
export declare const playwright = "1.60.0";
|
|
25
|
-
export declare const rust = "1.95.0";
|
|
26
25
|
export declare const node: {
|
|
27
|
-
readonly default: "26.
|
|
26
|
+
readonly default: "26.3.0";
|
|
28
27
|
readonly others: readonly ["24.16.0"];
|
|
29
28
|
};
|
|
30
29
|
export declare const wasmtime = "45.0.0";
|
|
31
30
|
export declare const wasmer = "7.1.0";
|
|
32
|
-
export declare const tsgo = "7.0.0-dev.
|
|
31
|
+
export declare const tsgo = "7.0.0-dev.20260601.1";
|
|
32
|
+
export declare const actions: {
|
|
33
|
+
readonly 'actions/checkout': "v6";
|
|
34
|
+
readonly 'actions/setup-node': "v6";
|
|
35
|
+
readonly 'actions/cache': "v5";
|
|
36
|
+
readonly 'denoland/setup-deno': "v2";
|
|
37
|
+
readonly 'oven-sh/setup-bun': "v2";
|
|
38
|
+
readonly 'bytecodealliance/actions/wasmtime/setup': "v1";
|
|
39
|
+
readonly 'wasmerio/setup-wasmer': "v3.1";
|
|
40
|
+
readonly 'dtolnay/rust-toolchain': "1.95.0";
|
|
41
|
+
};
|
package/fs/ci/config/module.f.js
CHANGED
|
@@ -26,11 +26,9 @@ export const bun = '1.3.14';
|
|
|
26
26
|
export const deno = '2.8.1';
|
|
27
27
|
// https://www.npmjs.com/package/playwright
|
|
28
28
|
export const playwright = '1.60.0';
|
|
29
|
-
// https://rust-lang.org/
|
|
30
|
-
export const rust = '1.95.0';
|
|
31
29
|
// https://nodejs.org/en/download
|
|
32
30
|
export const node = {
|
|
33
|
-
default: '26.
|
|
31
|
+
default: '26.3.0',
|
|
34
32
|
others: ['24.16.0'],
|
|
35
33
|
};
|
|
36
34
|
// https://github.com/bytecodealliance/wasmtime/releases
|
|
@@ -38,4 +36,26 @@ export const wasmtime = '45.0.0';
|
|
|
38
36
|
// https://github.com/wasmerio/wasmer/releases
|
|
39
37
|
export const wasmer = '7.1.0';
|
|
40
38
|
// https://www.npmjs.com/package/@typescript/native-preview?activeTab=versions
|
|
41
|
-
export const tsgo = '7.0.0-dev.
|
|
39
|
+
export const tsgo = '7.0.0-dev.20260601.1';
|
|
40
|
+
// GitHub Action versions used by CI step builders. The key is the action
|
|
41
|
+
// `owner/name`; call sites compose the full ref as
|
|
42
|
+
// `` `${name}@${actions[name]}` ``.
|
|
43
|
+
// Note: dtolnay/rust-toolchain value is a Rust version, not an action version.
|
|
44
|
+
export const actions = {
|
|
45
|
+
// https://github.com/marketplace/actions/checkout
|
|
46
|
+
'actions/checkout': 'v6',
|
|
47
|
+
// https://github.com/marketplace/actions/setup-node-js-environment
|
|
48
|
+
'actions/setup-node': 'v6',
|
|
49
|
+
// https://github.com/marketplace/actions/cache
|
|
50
|
+
'actions/cache': 'v5',
|
|
51
|
+
// https://github.com/marketplace/actions/setup-deno
|
|
52
|
+
'denoland/setup-deno': 'v2',
|
|
53
|
+
// https://github.com/marketplace/actions/setup-bun
|
|
54
|
+
'oven-sh/setup-bun': 'v2',
|
|
55
|
+
// https://github.com/bytecodealliance/actions
|
|
56
|
+
'bytecodealliance/actions/wasmtime/setup': 'v1',
|
|
57
|
+
// https://github.com/wasmerio/setup-wasmer
|
|
58
|
+
'wasmerio/setup-wasmer': 'v3.1',
|
|
59
|
+
// https://rust-lang.org/ - value is Rust version, not action version
|
|
60
|
+
'dtolnay/rust-toolchain': '1.95.0',
|
|
61
|
+
};
|
package/fs/ci/deno/module.f.js
CHANGED
|
@@ -5,12 +5,9 @@
|
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
7
|
import { deno } from "../config/module.f.js";
|
|
8
|
-
import { clean, install, test } from "../common/module.f.js";
|
|
8
|
+
import { clean, install, test, uses } from "../common/module.f.js";
|
|
9
9
|
export const denoSteps = (extra) => clean([
|
|
10
|
-
install({
|
|
11
|
-
uses: 'denoland/setup-deno@v2',
|
|
12
|
-
with: { 'deno-version': deno },
|
|
13
|
-
}),
|
|
10
|
+
install(uses('denoland/setup-deno', { 'deno-version': deno })),
|
|
14
11
|
test({ run: 'deno install' }),
|
|
15
12
|
test({ run: 'deno task test' }),
|
|
16
13
|
...extra,
|
package/fs/ci/node/module.f.js
CHANGED
|
@@ -5,23 +5,28 @@
|
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
7
|
import { node, tsgo } from "../config/module.f.js";
|
|
8
|
-
import { clean, findTgz, install, test, ubuntu } from "../common/module.f.js";
|
|
8
|
+
import { clean, findTgz, install, test, ubuntu, uses } from "../common/module.f.js";
|
|
9
9
|
export const major = (v) => v.split('.')[0];
|
|
10
|
-
const installNode = (version) => (
|
|
11
|
-
|
|
12
|
-
install(installNode(
|
|
10
|
+
const installNode = (version) => uses('actions/setup-node', { 'node-version': version });
|
|
11
|
+
const nodeInstall = (v) => [
|
|
12
|
+
install(installNode(v)),
|
|
13
13
|
test({ run: 'npm ci' }),
|
|
14
|
+
];
|
|
15
|
+
export const basicNode = (version) => (extra) => clean([
|
|
16
|
+
...nodeInstall(version),
|
|
14
17
|
...extra,
|
|
15
18
|
]);
|
|
16
|
-
|
|
17
|
-
test({ run: 'npm
|
|
19
|
+
const basicTests = [
|
|
20
|
+
test({ run: 'npm t' }),
|
|
18
21
|
test({ run: 'npm run fst' }),
|
|
22
|
+
];
|
|
23
|
+
export const nodeTests = (version) => (extra) => basicNode(version)([
|
|
24
|
+
...basicTests,
|
|
19
25
|
...extra,
|
|
20
26
|
]);
|
|
21
27
|
const nodeSteps = (v) => [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
test({ run: 'npm t' }),
|
|
28
|
+
...nodeInstall(v),
|
|
29
|
+
...basicTests,
|
|
25
30
|
];
|
|
26
31
|
export const nodeVersions = Object.fromEntries(node.others.map(v => [
|
|
27
32
|
`node${major(v)}`,
|
|
@@ -5,19 +5,16 @@
|
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
7
|
import { images, node, playwright } from "../config/module.f.js";
|
|
8
|
-
import { install, test, toSteps } from "../common/module.f.js";
|
|
8
|
+
import { install, test, toSteps, uses } from "../common/module.f.js";
|
|
9
9
|
import { basicNode } from "../node/module.f.js";
|
|
10
10
|
const playwrightImage = images.ubuntu.intel;
|
|
11
11
|
export const playwrightJob = {
|
|
12
12
|
'runs-on': playwrightImage,
|
|
13
13
|
steps: toSteps(basicNode(node.default)([
|
|
14
|
-
install({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
key: `${playwrightImage}-playwright-${playwright}`,
|
|
19
|
-
},
|
|
20
|
-
}),
|
|
14
|
+
install(uses('actions/cache', {
|
|
15
|
+
path: '~/.cache/ms-playwright',
|
|
16
|
+
key: `${playwrightImage}-playwright-${playwright}`,
|
|
17
|
+
})),
|
|
21
18
|
install({ run: `npm install -g playwright@${playwright}` }),
|
|
22
19
|
install({ run: 'playwright install-deps' }),
|
|
23
20
|
install({ run: 'playwright install' }),
|
|
@@ -2,7 +2,7 @@ import { ci } from "./module.f.js";
|
|
|
2
2
|
import { utf8ToString } from "../text/module.f.js";
|
|
3
3
|
import { isVec } from "../types/bit_vec/module.f.js";
|
|
4
4
|
import { test, parseGitHubAction } from "./common/module.f.js";
|
|
5
|
-
import { assert } from "../
|
|
5
|
+
import { assert } from "../asserts/module.f.js";
|
|
6
6
|
import { emptyState, virtual } from "../types/effects/node/virtual/module.f.js";
|
|
7
7
|
import { parse as jsonParse } from "../json/module.f.js";
|
|
8
8
|
import { unwrap } from "../types/result/module.f.js";
|
|
@@ -23,7 +23,7 @@ const run = (rust, nodeExtra = () => []) => {
|
|
|
23
23
|
assert(isVec(file), file);
|
|
24
24
|
return unwrap(parseGitHubAction(jsonParse(utf8ToString(file))));
|
|
25
25
|
};
|
|
26
|
-
export
|
|
26
|
+
export const proof = {
|
|
27
27
|
rust: () => {
|
|
28
28
|
assert(hasRun('cargo')(run(true)), 'expected Rust steps');
|
|
29
29
|
},
|
package/fs/ci/rust/module.f.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
8
|
import { wasmer, wasmtime } from "../config/module.f.js";
|
|
9
|
-
import { install, test } from "../common/module.f.js";
|
|
9
|
+
import { install, test, uses } from "../common/module.f.js";
|
|
10
10
|
const cargoTest = (target, config) => {
|
|
11
11
|
const to = target ? ` --target ${target}` : '';
|
|
12
12
|
const co = config ? ` --config ${config}` : '';
|
|
@@ -40,14 +40,8 @@ export const rustSteps = (v, a) => [
|
|
|
40
40
|
test({ run: 'cargo fmt -- --check' }),
|
|
41
41
|
test({ run: 'cargo clippy -- -D warnings' }),
|
|
42
42
|
...cargoTest(),
|
|
43
|
-
install({
|
|
44
|
-
|
|
45
|
-
with: { version: wasmtime }
|
|
46
|
-
}),
|
|
47
|
-
install({
|
|
48
|
-
uses: 'wasmerio/setup-wasmer@v3.1',
|
|
49
|
-
with: { version: `v${wasmer}` },
|
|
50
|
-
}),
|
|
43
|
+
install(uses('bytecodealliance/actions/wasmtime/setup', { version: wasmtime })),
|
|
44
|
+
install(uses('wasmerio/setup-wasmer', { version: `v${wasmer}` })),
|
|
51
45
|
...wasmTarget('wasm32-wasip1'),
|
|
52
46
|
...wasmTarget('wasm32-wasip2'),
|
|
53
47
|
...wasmTarget('wasm32-unknown-unknown'),
|
|
@@ -2,7 +2,7 @@ import { utf8 } from "../../text/module.f.js";
|
|
|
2
2
|
import { uint, vec } from "../../types/bit_vec/module.f.js";
|
|
3
3
|
import { sha256, sha384, sha512 } from "../sha2/module.f.js";
|
|
4
4
|
import { hmac } from "./module.f.js";
|
|
5
|
-
export
|
|
5
|
+
export const proof = {
|
|
6
6
|
example: () => {
|
|
7
7
|
const r = hmac(sha256)(utf8('key'))(utf8('The quick brown fox jumps over the lazy dog'));
|
|
8
8
|
if (r !== vec(256n)(0xf7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8n)) {
|
|
@@ -12,7 +12,7 @@ const checkEmpty = ({ init, end, hashLength }) => (x) => {
|
|
|
12
12
|
// https://en.wikipedia.org/wiki/SHA-2#Test_vectors
|
|
13
13
|
//
|
|
14
14
|
// https://csrc.nist.gov/Projects/Cryptographic-Algorithm-Validation-Program/Secure-Hashing
|
|
15
|
-
export
|
|
15
|
+
export const proof = {
|
|
16
16
|
base: {
|
|
17
17
|
b32: () => {
|
|
18
18
|
const { fromV8, compress, chunkLength } = base32;
|
package/fs/dev/module.f.d.ts
CHANGED
|
@@ -6,18 +6,41 @@
|
|
|
6
6
|
import type { Io } from '../io/module.f.ts';
|
|
7
7
|
import { type Access, type All, type Env, type Import, type NodeProgram, type Readdir } from '../types/effects/node/module.f.ts';
|
|
8
8
|
import { type Effect } from '../types/effects/module.f.ts';
|
|
9
|
-
export declare const todo: () => never;
|
|
10
|
-
export declare const assert: (v: boolean, msg?: unknown) => asserts v;
|
|
11
|
-
export declare const assertEq: <T>(a: T, b: T) => void;
|
|
12
9
|
export type Module = {
|
|
13
|
-
readonly
|
|
10
|
+
readonly proof?: unknown;
|
|
14
11
|
readonly [k: string]: unknown;
|
|
15
12
|
};
|
|
16
13
|
export type ModuleMap = {
|
|
17
14
|
readonly [k in string]: Module;
|
|
18
15
|
};
|
|
19
16
|
export declare const env: (io: Io) => (v: string) => string | undefined;
|
|
20
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Returns `true` if the file should be loaded for proof discovery.
|
|
19
|
+
*
|
|
20
|
+
* All FunctionalScript modules (`.f.ts` / `.f.js`) are safe to bulk-load by
|
|
21
|
+
* construction — they have no import side effects. For vanilla TS/JS the
|
|
22
|
+
* load gate stays opt-in by filename: any file ending in `proof.ts`,
|
|
23
|
+
* `proof.js`, `proof.mts`, or `proof.mjs` is included.
|
|
24
|
+
*
|
|
25
|
+
* Whether a loaded module actually _contains_ a proof is determined at
|
|
26
|
+
* runtime by checking for an exported `proof` property.
|
|
27
|
+
*/
|
|
28
|
+
export declare const shouldLoad: (s: string) => boolean;
|
|
29
|
+
/** The effect operations required to discover and load a module map. */
|
|
21
30
|
export type LoadModuleOperations = Access | Import | All | Readdir;
|
|
31
|
+
/**
|
|
32
|
+
* Discovers all source files under `INIT_CWD` (or `.` if unset) that match
|
|
33
|
+
* `predicate`, imports them, and returns a map from relative path to module
|
|
34
|
+
* exports.
|
|
35
|
+
*
|
|
36
|
+
* The `predicate` is propagated into `allFiles` so that non-matching files
|
|
37
|
+
* are excluded before any `import()` is attempted — no wasted I/O.
|
|
38
|
+
* The default matches all JS/TS source files (`.js`, `.ts`, `.mts`, `.mjs`).
|
|
39
|
+
* `loadFile`'s own guards (`.f.js`, `.f.ts`, `shouldLoad`) still apply on
|
|
40
|
+
* top; the predicate only controls which files are discovered.
|
|
41
|
+
*
|
|
42
|
+
* The result is sorted by path key using `string.cmp` so the order is
|
|
43
|
+
* deterministic regardless of filesystem traversal order.
|
|
44
|
+
*/
|
|
22
45
|
export declare const loadModuleMap: (env: Env) => Effect<LoadModuleOperations, ModuleMap>;
|
|
23
46
|
export declare const index4: NodeProgram;
|