Clean up repo layout
This commit is contained in:
parent
d9a1480bad
commit
b6473eee6d
|
@ -5,5 +5,10 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"preserves": "^0.6.0"
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "npx tsc",
|
||||
"compile:watch": "npx tsc -w",
|
||||
"clean": "rm -rf lib"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,12 +4,13 @@ import { Dataspace, Observe } from './dataspace.js';
|
|||
import { Worker } from 'worker_threads';
|
||||
import { Relay, spawnRelay } from './relay.js';
|
||||
import { BoxState, SetBox } from './box-protocol.js';
|
||||
import path from 'path';
|
||||
|
||||
const Instance = Record.makeConstructor<{moduleName: string, arg: Assertion}>()(
|
||||
Symbol.for('Instance'), ['moduleName', 'arg']);
|
||||
|
||||
function spawnWorker(t: Turn, moduleName: string, arg: Assertion) {
|
||||
const w = new Worker('./wload.js');
|
||||
const w = new Worker(path.join(__dirname, 'wload.js'));
|
||||
spawnRelay(t, {
|
||||
packetWriter: bs => w.postMessage(bs),
|
||||
setup(t: Turn, r: Relay) {
|
||||
|
@ -60,11 +61,12 @@ Turn.for(new Actor(), async (t: Turn) => {
|
|||
[0, Lit(BoxState.constructorInfo.label)]]))));
|
||||
|
||||
|
||||
// spawnModule(t, './box.js', [ds, 500000, 25000]);
|
||||
spawnWorker(t, './box.js', [ds_for_box, 50000, 2500]);
|
||||
|
||||
// spawnModule(t, './client.js', ds_for_client);
|
||||
spawnWorker(t, './client.js', ds_for_client);
|
||||
const boxpath = path.join(__dirname, 'box.js');
|
||||
const clientpath = path.join(__dirname, 'client.js');
|
||||
|
||||
spawnModule(t, boxpath, [ds, 500000, 25000]);
|
||||
// spawnWorker(t, boxpath, [ds_for_box, 50000, 2500]);
|
||||
|
||||
spawnModule(t, clientpath, ds_for_client);
|
||||
// spawnWorker(t, clientpath, ds_for_client);
|
||||
});
|
7
t.ts
7
t.ts
|
@ -1,7 +0,0 @@
|
|||
import { Assertion, Turn } from './actor';
|
||||
|
||||
console.log('hi')
|
||||
|
||||
export default function (_t: Turn, arg: Assertion) {
|
||||
console.log('in exported main', arg);
|
||||
}
|
|
@ -3,16 +3,15 @@
|
|||
"target": "es2017",
|
||||
"lib": ["es2017", "dom"],
|
||||
"declaration": true,
|
||||
"baseUrl": ".",
|
||||
"rootDir": ".",
|
||||
"outDir": ".",
|
||||
"declarationDir": ".",
|
||||
"baseUrl": "./src",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib",
|
||||
"declarationDir": "./lib",
|
||||
"esModuleInterop": true,
|
||||
"moduleResolution": "node",
|
||||
"module": "commonjs",
|
||||
"sourceMap": true,
|
||||
"strict": true
|
||||
},
|
||||
"include": ["**/*.ts"],
|
||||
"exclude": []
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue