refactor(import-bundle): Migrate from Agoric SDK
MODIFY
package.json
package.json
"packages/eslint-plugin",
"packages/eventual-send",
"packages/far",
+ "packages/import-bundle",
"packages/init",
"packages/lockdown",
"packages/lp32",

MODIFY
packages/import-bundle/README.md
packages/import-bundle/README.md
@@ -10,7 +10,7 @@ const namespace = await importBundle(bundle);
const { default, namedExport1, namedExport2 } = namespace;
```
-This must be run in a SES environment: you must install SES before importing `@agoric/import-bundle`. The conventional way to do this is to import a module (e.g. `@agoric/install-ses`) which does `import 'ses'; lockdown();`.
+This must be run in a SES environment: you must install SES before importing `@endo/import-bundle`. The conventional way to do this is to import a module (e.g. `@endo/init`) which does `import 'ses'; lockdown();`.
The bundle will be loaded into a new Compartment, which does not have access to platform globals like `document` or `Fetch` or `require`. The bundle is isolated to only having access to powerless JavaScript facilities and whatever endowments you provide.

MODIFY
packages/import-bundle/package.json
packages/import-bundle/package.json
{
- "name": "@agoric/import-bundle",
+ "name": "@endo/import-bundle",
"version": "0.2.33",
- "description": "load modules created by @agoric/bundle-source",
+ "description": "load modules created by @endo/bundle-source",
"type": "module",
"main": "src/index.js",
"module": "src/index.js",
"engines": {
- "node": ">=10.15.1"
+ "node": ">=12"
},
"scripts": {
"test": "ava",
"@endo/compartment-mapper": "^0.6.1"
},
"devDependencies": {
- "@agoric/bundle-source": "^2.0.1",
- "@agoric/install-ses": "^0.5.29",
+ "@endo/bundle-source": "^2.0.1",
+ "@endo/init": "^0.5.29",
"@endo/ses-ava": "^0.2.13",
"ava": "^3.12.1",
- "c8": "^7.7.2"
+ "c8": "^7.7.3"
},
"files": [
"README.md",
"NEWS.md",
"src/**/*.js"
],
- "author": "Agoric",
+ "author": "Endo contributors",
"license": "Apache-2.0",
"bugs": {
- "url": "https://github.com/Agoric/agoric-sdk/issues"
+ "url": "https://github.com/endojs/endo/issues"
},
- "homepage": "https://github.com/Agoric/agoric-sdk/packages/import-bundle",
+ "homepage": "https://github.com/endojs/endo/tree/master/packages/import-bundle",
"eslintConfig": {
"extends": [
- "@agoric"
+ "@endo"
]
},
"prettier": {

MODIFY
packages/import-bundle/test/prepare-test-env-ava.js
packages/import-bundle/test/prepare-test-env-ava.js
-import '@agoric/install-ses/pre-bundle-source.js';
-import '@agoric/install-ses/debug.js';
+import '@endo/init/pre-bundle-source.js';
+import '@endo/init/debug.js';
import { wrapTest } from '@endo/ses-ava';
import rawTest from 'ava';

MODIFY
packages/import-bundle/test/test-import-bundle.js
packages/import-bundle/test/test-import-bundle.js
@@ -3,7 +3,7 @@ import { test } from './prepare-test-env-ava.js';
import { encodeBase64 } from '@endo/base64';
import * as fs from 'fs';
import { makeArchive } from '@endo/compartment-mapper/archive.js';
-import bundleSource from '@agoric/bundle-source';
+import bundleSource from '@endo/bundle-source';
import { importBundle } from '../src/index.js';
const read = async location =>

refactor(import-bundle): Migrate from Agoric SDK