Update project config
MODIFY
package.json
package.json
{
"name": "ecma-proposal-realms",
- "private": true,
"version": "1.0.0",
"description": "ECMAScript spec proposal for Realms API",
- "scripts": {
- "build": "ecmarkup spec/index.emu index.html --css ecmarkup.css --js ecmarkup.js",
- "watch": "ecmarkup --watch spec/index.emu index.html --css ecmarkup.css --js ecmarkup.js",
- "shim:build": "npm run shim:build:dev && npm run shim:build:prod",
- "shim:watch": "npm run shim:build:dev --watch",
- "shim:build:dev": "cross-env NODE_ENV=development rollup -c shim/rollup.config.js",
- "shim:build:prod": "cross-env NODE_ENV=production rollup -c shim/rollup.config.js",
- "shim:lint": "eslint ./shim/src/**/**/*.js ./shim/test/**/**/*.js",
- "shim:prettier": "prettier --config ./shim/.prettierrc --write ./shim/src/**/**/*.js ./shim/test/**/**/*.js",
- "shim:test": "tape -r esm ./shim/test/**/**/*.js",
- "shim:coverage": "nyc --require esm tape ./shim/test/**/**/*.js | tap-nyc",
- "shim:coveralls": "nyc report --reporter=text-lcov | coveralls"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/tc39/proposal-realms.git"
+ "main": "shim/dist/realm-shim.js",
+ "module": "shim/src/main.js",
+ "license": "Apache-2.0",
+ "author": {
+ "name": "TC39 Open Source Contributors"
},
- "main": "shim/src/main.js",
"keywords": [
"realms",
"ES8",
"spec",
"proposal"
],
- "author": {
- "name": "Dave Herman"
- },
- "license": "Apache 2.0",
+ "homepage": "https://github.com/tc39/proposal-realms#readme",
"bugs": {
"url": "https://github.com/tc39/proposal-realms/issues"
},
- "homepage": "https://github.com/tc39/proposal-realms#readme",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/tc39/proposal-realms.git"
+ },
+ "scripts": {
+ "build": "ecmarkup spec/index.emu index.html --css ecmarkup.css --js ecmarkup.js",
+ "watch": "ecmarkup --watch spec/index.emu index.html --css ecmarkup.css --js ecmarkup.js",
+ "shim:lint": "eslint ./shim/src ./shim/test ./shim/examples",
+ "shim:prettier": "prettier --config ./shim/.prettierrc --write ./shim/src/**/**/*.js ./shim/test/**/**/*.js ./shim/examples/**/**/*.js",
+ "shim:test": "tape -r esm ./shim/test/**/**/*.js",
+ "shim:coverage": "nyc --require esm tape ./shim/test/**/**/*.js | tap-nyc",
+ "shim:coveralls": "nyc report --reporter=text-lcov | coveralls",
+ "shim:build": "npm run shim:build:dev && npm run shim:build:prod",
+ "shim:watch": "npm run shim:build:dev --watch",
+ "shim:build:dev": "cross-env NODE_ENV=development rollup -c shim/rollup.config.js",
+ "shim:build:prod": "cross-env NODE_ENV=production rollup -c shim/rollup.config.js"
+ },
"devDependencies": {
"babel-eslint": "^8.2.5",
"babel-minify": "^0.4.3",
- "babel-preset-es2016": "^6.24.1",
+ "babel-preset-env": "^1.7.0",
"coveralls": "^3.0.2",
"cross-env": "^5.2.0",
"ecmarkup": "^3.16.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-prettier": "^2.6.2",
"esm": "^3.0.62",
- "forever": "^0.15.2",
"nyc": "^12.0.2",
"prettier": "^1.13.7",
"rollup": "^0.62.0",

MODIFY
shim/.babelrc
shim/.babelrc
{
- "presets": ["es2016"],
- "env": {
- "production": {
- "presets": ["minify"]
- }
- }
+ "presets": ["env"]
}
\ No newline at end of file

MODIFY
shim/examples/simple.html
shim/examples/simple.html
<html>
<header>
- <script src="../dist/realm-shim.js"></script>
+ <script src="../dist/realm-shim.js" />
</header>
<body>
<h1>Realm Shim</h1>
- <p>
- This demo show allow you to evaluate code inside a brand new Realm:
- </p>
+ <p>This demo show allow you to evaluate code inside a brand new Realm:</p>
Input:<br />
- <textarea id="sourceText" rows="20" cols="80"></textarea><br />
- <button id="run">Evaluate</button><br />
+ <textarea id="sourceText" rows="20" cols="80" />
+ <br />
+ <button id="run">Evaluate</button>
+ <br />
Output:<br />
- <textarea id="output" disabled="disabled" rows="20" cols="80"></textarea>
+ <textarea id="output" disabled="disabled" rows="20" cols="80" />
<p>
- <small>Note: you can look in the console to inspect the original output of the evaluation.</small>
+ <small>
+ Note: you can look in the console to inspect the original output of the evaluation.
+ </small>
</p>
- <script src="simple.js"></script>
+ <script src="simple.js" />
</body>
-</html>
\ No newline at end of file
+</html>;

MODIFY
shim/examples/simple.js
shim/examples/simple.js
/* global Realm */
-/* eslint no-self-compare: "off" */
+/* eslint-disable no-self-compare, no-console */
// basic sanity check: they all should output true
// Root realm

MODIFY
shim/rollup.config.js
shim/rollup.config.js
import path from 'path';
import minify from 'rollup-plugin-babel-minify';
-import stripCode from "rollup-plugin-strip-code"
+import stripCode from 'rollup-plugin-strip-code';
const isProduction = process.env.NODE_ENV === 'production';

Update project config