add 'build' target to make dist/ses-shim.js
Also rearrange imports a bit, use ES6-module syntax everywhere (including
test cases).
DELETE
index.js
-'use strict';
-
-module.exports = require('./src/index.js');

MODIFY
package.json
package.json
"name": "SES",
"version": "0.1.0",
"description": "Secure EcmaScript",
- "main": "index.js",
+ "main": "src/index.js",
"scripts": {
"test": "node scripts/build-intermediate.js && tape -r esm test/**/*.js",
"just-test": "tape -r esm test/**/*.js",
- "build-intermediate": "node scripts/build-intermediate.js"
+ "build-intermediate": "node scripts/build-intermediate.js",
+ "build": "rollup --format=iife --output.name=SES --sourcemap --file=dist/ses-shim.js -- src/index.js"
},
"devDependencies": {
"esm": "^3.0.37",

MODIFY
src/SES.js
src/SES.js
@@ -16,4 +16,5 @@ import { createSESWithRealmConstructor } from './bundle/index.js';
import { creatorStrings } from './stringifiedBundle.js';
import Realm from '../proposal-realms/shim/src/realm.js';
-export const SES = createSESWithRealmConstructor(creatorStrings, Realm);
+const SES = createSESWithRealmConstructor(creatorStrings, Realm);
+export default SES;

MODIFY
src/index.js
src/index.js
// See the License for the specific language governing permissions and
// limitations under the License.
-import { SES } from './SES.js';
-export { SES };
+import SES from './SES.js';
+export default SES;
// f = compileExpr(source); then f(imports) can only affect 'imports'
//exports.compileExpr = function(exprSrc, opt_mitigateOpts) { };

MODIFY
test/test.js
test/test.js
-const test = require('tape');
-const SES = require('../index.js').SES;
+import test from 'tape';
+import SES from '../src/index.js';
test('create', function(t) {
const s = SES.makeSESRootRealm();

add 'build' target to make dist/ses-shim.js

Also rearrange imports a bit, use ES6-module syntax everywhere (including
test cases).