diff --git a/packages/vats/decentral-config.json b/packages/vats/decentral-config.json index 1d54b93d11d..711fdb13fd4 100644 --- a/packages/vats/decentral-config.json +++ b/packages/vats/decentral-config.json @@ -7,40 +7,37 @@ }, "vats": { "board": { - "sourceSpec": "vat-board.js" - }, - "spawner": { - "sourceSpec": "vat-spawner.js" + "sourceSpec": "./src/vat-board.js" }, "ibc": { - "sourceSpec": "vat-ibc.js" + "sourceSpec": "./src/vat-ibc.js" }, "mints": { - "sourceSpec": "vat-mints.js" + "sourceSpec": "./src/vat-mints.js" }, "network": { - "sourceSpec": "vat-network.js" + "sourceSpec": "./src/vat-network.js" }, "priceAuthority": { - "sourceSpec": "vat-priceAuthority.js" + "sourceSpec": "./src/vat-priceAuthority.js" }, "provisioning": { - "sourceSpec": "vat-provisioning.js" + "sourceSpec": "./src/vat-provisioning.js" }, "registrar": { - "sourceSpec": "vat-registrar.js" + "sourceSpec": "./src/vat-registrar.js" }, "sharing": { - "sourceSpec": "vat-sharing.js" + "sourceSpec": "./src/vat-sharing.js" }, "zoe": { - "sourceSpec": "vat-zoe.js", + "sourceSpec": "./src/vat-zoe.js", "parameters": { "zcfBundleName": "zcf" } }, "bootstrap": { - "sourceSpec": "bootstrap.js" + "sourceSpec": "./src/bootstrap.js" } } } diff --git a/packages/vats/exported.js b/packages/vats/exported.js index f46300ce964..bc6da56dd1e 100644 --- a/packages/vats/exported.js +++ b/packages/vats/exported.js @@ -1 +1 @@ -import './lib/ag-solo/vats/types'; +import './src/types'; diff --git a/packages/vats/jsconfig.json b/packages/vats/jsconfig.json new file mode 100644 index 00000000000..291db11d535 --- /dev/null +++ b/packages/vats/jsconfig.json @@ -0,0 +1,18 @@ +// This file can contain .js-specific Typescript compiler config. +{ + "compilerOptions": { + "target": "esnext", + + "noEmit": true, +/* + // The following flags are for creating .d.ts files: + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true, +*/ + "downlevelIteration": true, + "strictNullChecks": true, + "moduleResolution": "node", + }, + "include": ["src/**/*.js", "exported.js", "globals.d.ts"], +} diff --git a/packages/vats/package.json b/packages/vats/package.json new file mode 100644 index 00000000000..46087225aff --- /dev/null +++ b/packages/vats/package.json @@ -0,0 +1,79 @@ +{ + "name": "@agoric/vats", + "version": "0.1.0", + "description": "Agoric's Vat library", + "parsers": { + "js": "mjs" + }, + "main": "src/bootstrap.js", + "repository": "https://github.com/Agoric/agoric-sdk", + "scripts": { + "build": "exit 0", + "test": "ava", + "test:nyc": "nyc ava", + "test:xs": "exit 0", + "pretty-fix": "prettier --write '**/*.js'", + "pretty-check": "prettier --check '**/*.js'", + "lint-fix": "yarn lint:eslint --fix && yarn lint:types", + "lint-check": "yarn lint", + "lint": "yarn lint:types && yarn lint:eslint", + "lint:types": "tsc -p jsconfig.json", + "lint:eslint": "eslint '**/*.js'" + }, + "keywords": [], + "author": "Agoric", + "license": "Apache-2.0", + "dependencies": { + "@agoric/assert": "^0.2.8", + "@agoric/dapp-svelte-wallet": "^0.9.3", + "@agoric/ertp": "^0.10.7", + "@agoric/eventual-send": "^0.13.10", + "@agoric/import-bundle": "^0.2.10", + "@agoric/install-ses": "^0.5.9", + "@agoric/marshal": "^0.4.7", + "@agoric/nat": "^4.0.0", + "@agoric/pegasus": "^0.2.3", + "@agoric/promise-kit": "^0.2.9", + "@agoric/registrar": "^0.2.10", + "@agoric/same-structure": "^0.1.9", + "@agoric/sharing-service": "^0.1.10", + "@agoric/sparse-ints": "^0.1.6", + "@agoric/store": "^0.4.10", + "@agoric/swingset-vat": "^0.16.3", + "@agoric/transform-eventual-send": "^1.4.6", + "@agoric/treasury": "^0.3.3", + "@agoric/zoe": "^0.15.3", + "@babel/generator": "^7.6.4", + "polycrc": "https://github.com/agoric-labs/node-polycrc", + "esm": "^3.2.25" + }, + "devDependencies": { + "@agoric/babel-parser": "^7.6.4", + "ava": "^3.12.1", + "nyc": "^15.1.0" + }, + "eslintConfig": { + "extends": [ + "@agoric" + ] + }, + "prettier": { + "trailingComma": "all", + "singleQuote": true + }, + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">=11.0" + }, + "ava": { + "files": [ + "test/**/test-*.js" + ], + "require": [ + "esm" + ], + "timeout": "20m" + } +} diff --git a/packages/vats/src/bootstrap.js b/packages/vats/src/bootstrap.js index b9d671c38f5..870624225a1 100644 --- a/packages/vats/src/bootstrap.js +++ b/packages/vats/src/bootstrap.js @@ -65,7 +65,6 @@ export function buildRootObject(vatPowers, vatParameters) { board, chainTimerService, zoe, - contractHost, { priceAuthority, adminFacet: priceAuthorityAdmin }, ] = await Promise.all([ E(vats.sharing).getSharingService(), @@ -73,7 +72,6 @@ export function buildRootObject(vatPowers, vatParameters) { E(vats.board).getBoard(), E(vats.timer).createTimerService(timerDevice), /** @type {ERef} */ (E(vats.zoe).buildZoe(vatAdminSvc)), - E(vats.spawner).buildSpawner(vatAdminSvc), E(vats.priceAuthority).makePriceAuthority(), ]); @@ -471,7 +469,6 @@ export function buildRootObject(vatPowers, vatParameters) { agoricNames, chainTimerService, sharingService, - contractHost, faucet, ibcport, myAddressNameAdmin, diff --git a/packages/vats/test/test-lib-board.js b/packages/vats/test/test-lib-board.js index 6cf436fe8da..a59773b456b 100644 --- a/packages/vats/test/test-lib-board.js +++ b/packages/vats/test/test-lib-board.js @@ -1,7 +1,7 @@ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava'; import { Far } from '@agoric/marshal'; -import { makeBoard } from '../../lib/ag-solo/vats/lib-board'; +import { makeBoard } from '../src/lib-board'; test('makeBoard', async t => { const board = makeBoard(); diff --git a/packages/vats/test/test-name-hub.js b/packages/vats/test/test-name-hub.js index db70005a6cc..4a0f6eaa95a 100644 --- a/packages/vats/test/test-name-hub.js +++ b/packages/vats/test/test-name-hub.js @@ -1,6 +1,6 @@ import { test } from '@agoric/swingset-vat/tools/prepare-test-env-ava'; -import { makeNameHubKit } from '../../lib/ag-solo/vats/nameHub'; +import { makeNameHubKit } from '../src/nameHub'; test('makeNameHubKit - lookup paths', async t => { const { nameAdmin: na1, nameHub: nh1 } = makeNameHubKit(); diff --git a/packages/vats/test/test-repl.js b/packages/vats/test/test-repl.js index 7b2a8f46f70..5922753f3ab 100644 --- a/packages/vats/test/test-repl.js +++ b/packages/vats/test/test-repl.js @@ -3,7 +3,7 @@ import { makeTransform } from '@agoric/transform-eventual-send'; import * as babelParser from '@agoric/babel-parser'; import babelGenerate from '@babel/generator'; import test from 'ava'; -import { getReplHandler } from '../../lib/ag-solo/vats/repl'; +import { getReplHandler } from '../src/repl'; function make() { const homeObjects = { base: 1, fries: 2, cooking: 3 };