functionalscript 0.16.0 → 0.16.1
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/ci/playwright/module.f.js +1 -2
- package/fs/io/module.f.js +2 -1
- package/fs/types/effects/node/module.f.d.ts +3 -1
- package/fs/types/effects/node/module.f.js +1 -0
- package/fs/types/effects/node/test.f.d.ts +1 -0
- package/fs/types/effects/node/test.f.js +7 -1
- package/fs/types/effects/node/virtual/module.f.d.ts +1 -0
- package/fs/types/effects/node/virtual/module.f.js +2 -0
- package/package.json +1 -1
|
@@ -2,10 +2,9 @@ import { images, node, playwright } from "../config/module.f.js";
|
|
|
2
2
|
import { install, test, toSteps } from "../common/module.f.js";
|
|
3
3
|
import { basicNode } from "../node/module.f.js";
|
|
4
4
|
const playwrightImage = images.ubuntu.intel;
|
|
5
|
-
// Playwright installation is stuck on Node 26 (May 7 2026) so we use Node 24.
|
|
6
5
|
export const playwrightJob = {
|
|
7
6
|
'runs-on': playwrightImage,
|
|
8
|
-
steps: toSteps(basicNode(node.
|
|
7
|
+
steps: toSteps(basicNode(node.default)([
|
|
9
8
|
install({
|
|
10
9
|
uses: 'actions/cache@v4',
|
|
11
10
|
with: {
|
package/fs/io/module.f.js
CHANGED
|
@@ -85,7 +85,8 @@ export const fromIo = ({ console: { error, log }, fs: { promises: { mkdir, readF
|
|
|
85
85
|
const s = asBase(server);
|
|
86
86
|
s.listen(port);
|
|
87
87
|
},
|
|
88
|
-
forever: () => new Promise(() => { })
|
|
88
|
+
forever: () => new Promise(() => { }),
|
|
89
|
+
now: async () => BigInt(Date.now()) * 1000000n,
|
|
89
90
|
});
|
|
90
91
|
return result;
|
|
91
92
|
};
|
|
@@ -82,7 +82,9 @@ export type Module = {
|
|
|
82
82
|
};
|
|
83
83
|
export type Import = ['import', (path: string) => IoResult<Module>];
|
|
84
84
|
export declare const import_: Func<Import>;
|
|
85
|
-
export type
|
|
85
|
+
export type Now = readonly ['now', () => bigint];
|
|
86
|
+
export declare const now: Func<Now>;
|
|
87
|
+
export type NodeOp = All | Fetch | Console | Fs | Http | Forever | Import | Now;
|
|
86
88
|
export type NodeEffect<T> = Effect<NodeOp, T>;
|
|
87
89
|
export type NodeOperationMap = ToAsyncOperationMap<NodeOp>;
|
|
88
90
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { empty, isVec, uint, vec8 } from "../../bit_vec/module.f.js";
|
|
2
2
|
import { pure } from "../module.f.js";
|
|
3
|
-
import { fetch, mkdir, readdir, readFile, rm, writeFile } from "./module.f.js";
|
|
3
|
+
import { fetch, mkdir, now, readdir, readFile, rm, writeFile } from "./module.f.js";
|
|
4
4
|
import { emptyState, virtual } from "./virtual/module.f.js";
|
|
5
5
|
export default {
|
|
6
6
|
map: () => {
|
|
@@ -326,4 +326,10 @@ export default {
|
|
|
326
326
|
}
|
|
327
327
|
},
|
|
328
328
|
},
|
|
329
|
+
now: () => {
|
|
330
|
+
const [_, result] = virtual({ ...emptyState, epochNs: 1000000n })(now());
|
|
331
|
+
if (result !== 1000000n) {
|
|
332
|
+
throw result;
|
|
333
|
+
}
|
|
334
|
+
},
|
|
329
335
|
};
|
|
@@ -13,6 +13,7 @@ export const emptyState = {
|
|
|
13
13
|
stderr: '',
|
|
14
14
|
root: {},
|
|
15
15
|
internet: {},
|
|
16
|
+
epochNs: 0n,
|
|
16
17
|
};
|
|
17
18
|
const operation = (op) => {
|
|
18
19
|
const f = (dir, path) => {
|
|
@@ -146,5 +147,6 @@ const map = {
|
|
|
146
147
|
createServer: todo,
|
|
147
148
|
listen: todo,
|
|
148
149
|
forever: todo,
|
|
150
|
+
now: (state) => [state, state.epochNs],
|
|
149
151
|
};
|
|
150
152
|
export const virtual = run(map);
|