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