chore: Update project skeleton
MODIFY
scripts/repackage.sh
scripts/repackage.sh
@@ -26,6 +26,7 @@ NEWPKGJSONHASH=$(
fi | jq --arg name "$NAME" '{
name: null,
version: null,
+ private: null,
description: "Description forthcoming.",
keywords: [],
author: "Endo contributors",
@@ -34,7 +35,6 @@ NEWPKGJSONHASH=$(
repository: null,
bugs: null,
type: null,
- parsers: null,
main: null,
module: null,
browser: null,
@@ -61,49 +61,33 @@ NEWPKGJSONHASH=$(
url: "https://github.com/endojs/endo/issues",
},
type: "module",
- parsers: {"js": "mjs"},
- main: "./dist/\($name).cjs",
+ main: "./index.js",
module: "./index.js",
- browser: "./dist/\($name).umd.js",
- unpkg: "./dist/\($name).umd.js",
types: "./index.d.ts",
exports: (
if
.exports["./package.json"]
then
(.exports // {}) + {
- ".": ((.exports["."] // {}) + {
- import: "./index.js",
- require: "./dist/\($name).cjs",
- browser: "./dist/\($name).umd.js",
- })
+ ".": "./index.js",
}
else
({
+ ".": "./index.js",
"./package.json": "./package.json",
- ".": ((.exports // {}) + {
- import: "./index.js",
- require: "./dist/\($name).cjs",
- browser: "./dist/\($name).umd.js",
- })
})
end
),
scripts: ((.scripts // {}) + {
- "prepublish": "yarn clean && yarn build",
- "clean": "rm -rf dist",
- "build": "rollup --config rollup.config.js",
+ "build": "exit 0",
"test": "ava",
- "cover": "nyc ava",
"lint": "yarn lint:types && yarn lint:js",
"lint:types": "tsc --build jsconfig.json",
- "lint:js": "eslint '"'*.js'"' '"'**/*.js'"' '"'test*/**.js'"'",
- "lint-fix": "eslint --fix '"'*.js'"' '"'**/*.js'"' '"'test*/**.js'"'",
+ "lint:js": "eslint '"'**/*.js'"'",
+ "lint-fix": "eslint --fix '"'**/*.js'"'",
}) | to_entries | sort_by(.key) | from_entries,
devDependencies: ((.devDependencies // {}) + {
- "@rollup/plugin-node-resolve": "^6.1.0",
- "@rollup/plugin-commonjs": "^13.0.0",
- "rollup-plugin-terser": "^5.1.3",
+ "@agoric/eslint-config": "^0.3.6",
"ava": "^3.12.1",
"babel-eslint": "^10.0.3",
"eslint": "^7.23.0",
@@ -112,21 +96,15 @@ NEWPKGJSONHASH=$(
"eslint-plugin-eslint-comments": "^3.1.2",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
- "nyc": "^15.1.0",
"prettier": "^1.19.1",
- "rollup": "1.31.0",
- "rollup-plugin-terser": "^5.1.3",
"typescript": "^4.0.5",
"ava": "^3.12.1",
- "nyc": "^15.1.0",
}) | to_entries | sort_by(.key) | from_entries,
files: ((.files // []) + [
"src",
- "dist",
- "types",
"LICENSE*",
- "*.js",
- "*.d.ts",
+ "index.js",
+ "index.d.ts"
]) | sort | unique,
"publishConfig": {
"access": "public",
@@ -152,7 +130,6 @@ NEWPKGJSONHASH=$(
git cat-file blob "$NEWPKGJSONHASH" > "$PKGJSON"
cp skel/index.d.ts packages/"$NAME"/index.d.ts
-cp skel/rollup.config.js packages/"$NAME"/rollup.config.js
cp skel/jsconfig.json packages/"$NAME"/jsconfig.json
cp LICENSE packages/"$NAME"/LICENSE
touch packages/"$NAME"/README.md

DELETE
skel/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()],
- },
-];

chore: Update project skeleton