fix(static-module-record)!: Emphasize RESM/NESM compatibility over CJS/UMD
MODIFY
packages/compartment-mapper/package.json
packages/compartment-mapper/package.json
},
"dependencies": {
"@endo/cjs-module-analyzer": "^0.1.0",
- "@endo/static-module-record": "^0.1.0",
+ "@endo/static-module-record": "^0.4.1",
"@endo/syrup": "^0.1.0",
"@endo/zip": "^0.1.0",
"ses": "^0.12.7"

MODIFY
packages/ses/package.json
packages/ses/package.json
"@agoric/compartment-mapper": "^0.2.4",
"@agoric/eslint-config": "^0.1.0",
"@agoric/test262-runner": "~0.1.0",
- "@endo/static-module-record": "^0.1.0",
+ "@endo/static-module-record": "^0.4.1",
"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-node-resolve": "^6.1.0",
"ava": "^3.12.1",

MODIFY
packages/static-module-record/NEWS.md
packages/static-module-record/NEWS.md
# Next release
+* *BREAKING CHANGE* This package has been renamed `@endo/static-module-record`.
* *BREAKING CHANGE* This package now only exports a `StaticModuleRecord`
constructor, suitable for use with the SES shim `importHook` starting with
version 0.13.0.
+* *BREAKING CHANGE* This version only provides compatibility for Node.js ESM
+ and the `node -r esm` emulation of ESM since these both require the `main`
+ entry module to be the same ESM source.
+ CommonJS and UMD targets have been dropped.
# v0.4.1 (2020-08-20)

MODIFY
packages/static-module-record/package.json
packages/static-module-record/package.json
{
"name": "@endo/static-module-record",
- "version": "0.1.0+1-dev",
+ "version": "0.4.1+1-dev",
"description": "Shim for the SES StaticModuleRecord and module-to-program transformer",
"keywords": ["ses", "StaticModuleRecord", "modules", "ESM"],
"author": "Agoric",
"parsers": {
"js": "mjs"
},
- "main": "./dist/static-module-record.cjs",
- "module": "./index.js",
- "browser": "./dist/static-module-record.umd.js",
- "unpkg": "./dist/static-module-record.umd.js",
"types": "./index.d.ts",
+ "main": "./index.js",
+ "module": "./index.js",
"exports": {
"./package.json": "./package.json",
".": {
- "import": "./index.js",
- "require": "./dist/static-module-record.cjs",
- "browser": "./dist/static-module-record.umd.js"
+ "import": "./index.js"
}
},
"scripts": {
- "build": "rollup --config rollup.config.js",
- "clean": "rm -rf dist",
"cover": "nyc ava",
"lint": "yarn lint:types && yarn lint:js",
"lint:types": "tsc --build jsconfig.json",
"lint:js": "eslint '**/*.js'",
"lint-fix": "eslint --fix '**/*.js'",
- "prepublish": "yarn clean && yarn build",
"test": "ava"
},
"dependencies": {
},
"files": [
"LICENSE*",
- "dist",
"src",
"index.js",
"index.d.ts"

DELETE
packages/static-module-record/rollup.config.js
-import resolve from '@rollup/plugin-node-resolve';
-import commonjs from '@rollup/plugin-commonjs';
-import { terser } from 'rollup-plugin-terser';
-import fs from 'fs';
-
-const metaPath = new URL('package.json', import.meta.url).pathname;
-const meta = JSON.parse(fs.readFileSync(metaPath, 'utf-8'));
-const name = meta.name.split('/').pop();
-const umd = meta.umd || name;
-
-export default [
- {
- input: 'index.js',
- output: [
- {
- file: `dist/${name}.mjs`,
- format: 'esm',
- },
- {
- file: `dist/${name}.cjs`,
- format: 'cjs',
- },
- ],
- plugins: [resolve(), commonjs()],
- },
- {
- input: 'index.js',
- output: {
- file: `dist/${name}.umd.js`,
- format: 'umd',
- name: umd,
- },
- plugins: [resolve(), commonjs()],
- },
- {
- input: 'index.js',
- output: {
- file: `dist/${name}.umd.min.js`,
- format: 'umd',
- name: umd,
- },
- plugins: [resolve(), commonjs(), terser()],
- },
-];

fix(static-module-record)!: Emphasize RESM/NESM compatibility over CJS/UMD