Browse Source

Clean up repo layout

main
Tony Garnock-Jones 8 months ago
parent
commit
b6473eee6d
  1. 0
      experiments/i0.ts
  2. 0
      experiments/i2.ts
  3. 0
      experiments/interfaces.ts
  4. 0
      experiments/interfaces_test.ts
  5. 5
      package.json
  6. 0
      src/actor.ts
  7. 0
      src/bag.ts
  8. 0
      src/box-protocol.ts
  9. 0
      src/box.ts
  10. 0
      src/client.ts
  11. 0
      src/dataspace.ts
  12. 14
      src/main.ts
  13. 0
      src/protocol.ts
  14. 0
      src/relay.ts
  15. 0
      src/wload.ts
  16. 7
      t.ts
  17. 11
      tsconfig.json

0
i0.ts → experiments/i0.ts

0
i2.ts → experiments/i2.ts

0
interfaces.ts → experiments/interfaces.ts

0
interfaces_test.ts → experiments/interfaces_test.ts

5
package.json

@ -5,5 +5,10 @@
},
"dependencies": {
"preserves": "^0.6.0"
},
"scripts": {
"compile": "npx tsc",
"compile:watch": "npx tsc -w",
"clean": "rm -rf lib"
}
}

0
actor.ts → src/actor.ts

0
bag.ts → src/bag.ts

0
box-protocol.ts → src/box-protocol.ts

0
box.ts → src/box.ts

0
client.ts → src/client.ts

0
dataspace.ts → src/dataspace.ts

14
main.ts → src/main.ts

@ -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);
});

0
protocol.ts → src/protocol.ts

0
relay.ts → src/relay.ts

0
wload.ts → src/wload.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);
}

11
tsconfig.json

@ -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…
Cancel
Save