refactor(nat): Rename into Endo and ditch RESM/Rollup
MODIFY
package.json
package.json
"packages/lockdown",
"packages/lp32",
"packages/marshal",
+ "packages/nat",
"packages/netstring",
"packages/promise-kit",
"packages/ses",

MODIFY
packages/nat/package.json
packages/nat/package.json
{
- "name": "@agoric/nat",
+ "name": "@endo/nat",
"version": "4.1.0",
"description": "Ensures that a number is within the natural numbers (0, 1, 2...) or throws a RangeError",
- "main": "dist/nat.cjs.js",
- "module": "dist/nat.esm.js",
- "browser": "dist/nat.umd.js",
+ "main": "./src/index.js",
+ "type": "module",
"exports": {
".": "./src/index.js",
"./package.json": "./package.json"
},
- "parsers": {
- "js": "mjs"
- },
"scripts": {
"test": "ava test/**/test-*.js",
- "build": "rollup -c",
- "lint-fix": "eslint --fix '**/*.{js,jsx}'",
- "lint-check": "eslint '**/*.{js,jsx}'",
- "eslint-disable-stats": "grep -R --exclude-dir=node_modules --include='*.js' 'eslint' . | wc -l | tr -d [:blank:]"
+ "lint-fix": "eslint --fix",
+ "lint-check": "eslint"
},
"repository": {
"type": "git",
- "url": "git+https://github.com/Agoric/nat.git"
+ "url": "git+https://github.com/endojs/endo.git"
},
- "author": "Agoric",
+ "author": "Endo contributors",
"license": "Apache-2.0",
"bugs": {
- "url": "https://github.com/Agoric/nat/issues"
+ "url": "https://github.com/endojs/endo/issues"
},
- "homepage": "https://github.com/Agoric/nat#readme",
+ "homepage": "https://github.com/endojs/endo#readme",
"dependencies": {},
"devDependencies": {
- "@endo/compartment-mapper": "^0.3.1",
- "ava": "^3.15.0",
- "eslint": "^7.14.0",
- "eslint-config-airbnb-base": "^14.2.1",
- "eslint-config-prettier": "^6.15.0",
- "eslint-plugin-import": "^2.22.1",
- "eslint-plugin-prettier": "^3.1.4",
- "esm": "agoric-labs/esm#Agoric-built",
+ "@endo/compartment-mapper": "^0.6.1",
+ "ava": "^3.12.1",
+ "eslint": "^7.23.0",
+ "eslint-config-airbnb-base": "^14.0.0",
+ "eslint-config-prettier": "^6.9.0",
+ "eslint-plugin-import": "^2.19.1",
+ "eslint-plugin-prettier": "^3.1.2",
"prettier": "^1.19.1",
- "rollup": "^2.34.0",
- "ses": "^0.13.1"
+ "ses": "^0.15.3"
},
"directories": {
"test": "test"
"overflow"
],
"files": [
- "dist",
"src"
],
"ava": {
"files": [
"test/**/*.js"
- ],
- "require": [
- "esm"
]
},
"eslintConfig": {
"extends": [
- "@agoric"
+ "@endo"
]
},
"prettier": {

DELETE
packages/nat/rollup.config.js
-export default [
- {
- input: 'src/index.js',
- output: [
- {
- file: 'dist/nat.umd.js',
- format: 'umd',
- name: 'Nat',
- },
- {
- file: 'dist/nat.esm.js',
- format: 'esm',
- },
- {
- file: 'dist/nat.cjs.js',
- format: 'cjs',
- },
- ],
- },
-];

MODIFY
packages/nat/test/test-nat.js
packages/nat/test/test-nat.js
import test from 'ava';
-import { isNat, Nat } from '../src/index';
+import { isNat, Nat } from '../src/index.js';
test('Nat() works for natural BigInts', t => {
t.is(Nat(1n), 1n);

refactor(nat): Rename into Endo and ditch RESM/Rollup