Move transform-module to ES6 modules
DELETE
packages/transform-module/.eslintignore
-/dist/

MODIFY
packages/transform-module/package.json
packages/transform-module/package.json
"name": "@agoric/transform-module",
"version": "0.3.0",
"description": "Transform for evaluating ES modules as Javascript programs",
- "main": "dist/transform-module.cjs.js",
- "module": "dist/transform-module.esm.js",
- "browser": "dist/transform-module.umd.js",
+ "author": "Agoric",
+ "license": "Apache-2.0",
+ "homepage": "https://github.com/Agoric/SES/packages/transform-module#readme",
+ "type": "module",
+ "main": "./src/main.js",
"scripts": {
"lint": "eslint '**/*.js'",
"lint-fix": "eslint --fix '**/*.js'",
- "OFF-test": "tape -r esm 'test/**/*.js'",
- "OFF-build": "rollup -c"
- },
- "devEngines": {
- "node": "8.x || 9.x || 10.x || 11.x || 12.x"
+ "test": "tap --no-esm --no-coverage --reporter specy 'test/**/*.test.js'"
},
"devDependencies": {
"babel-eslint": "^10.0.3",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
- "tape": "4.12.1",
- "tape-promise": "^4.0.0"
+ "tap": "14.10.5"
},
"dependencies": {
- "@agoric/evaluate": "^2.1.3",
+ "@agoric/make-simple-evaluate": "0.1.0",
"@babel/core": "7.7.5",
"rollup": "1.27.9",
"rollup-plugin-node-resolve": "5.2.0"
},
- "keywords": [
- "ESM",
- "ECMAScript Modules",
- "import",
- "export"
- ],
- "files": [
- "dist"
- ],
"repository": {
"type": "git",
"url": "git+https://github.com/Agoric/SES.git"
- },
- "author": "Agoric",
- "license": "Apache-2.0",
- "bugs": {
- "url": "https://github.com/Agoric/transform-module/issues"
- },
- "homepage": "https://github.com/Agoric/transform-module#readme"
+ }
}

DELETE
packages/transform-module/rollup.config.js
-import resolve from 'rollup-plugin-node-resolve';
-
-export default [
- {
- input: 'src/index.js',
- output: [
- {
- file: 'dist/transform-module.umd.js',
- format: 'umd',
- name: 'makeModuleTransformer',
- },
- {
- file: 'dist/transform-module.esm.js',
- format: 'esm',
- },
- {
- file: 'dist/transform-module.cjs.js',
- format: 'cjs',
- },
- ],
- plugins: [resolve()],
- },
-];

MODIFY
packages/transform-module/src/babelPlugin.js
packages/transform-module/src/babelPlugin.js
-import * as h from './hidden';
+import * as h from './hidden.js';
// export const pattern = ...;
const collectPatternIdentifiers = (path, pattern) => {

RENAME
packages/transform-module/src/index.js
packages/transform-module/src/main.js
-import * as h from './hidden';
-import makeModulePlugins from './babelPlugin';
+import * as h from './hidden.js';
+import makeModulePlugins from './babelPlugin.js';
const makeTransformSource = babelCore =>
function transformSource(source, sourceOptions = {}) {

Move transform-module to ES6 modules