feat(syrup)!: Update packaging for RESM/NESM bridge
BREAKING CHANGE: No longer supports direct use from CommonJS
MODIFY
packages/syrup/index.d.ts
packages/syrup/index.d.ts
-export { encodeSyrup } from './src/encode.js';
-export { decodeSyrup } from './src/decode.js';
+export { encodeSyrup, decodeSyrup } from './index.js';

MODIFY
packages/syrup/package.json
packages/syrup/package.json
{
"name": "@endo/syrup",
"version": "0.0.0+1-dev",
- "private": true,
- "description": "Description forthcoming.",
- "keywords": [],
+ "description": "Syrup is a language-independent binary serialization format for structured object trees",
+ "keywords": ["syrup", "codec", "structured"],
"author": "Endo contributors",
"license": "Apache-2.0",
"homepage": "https://github.com/endojs/endo/tree/master/packages/syrup#readme",
"url": "https://github.com/endojs/endo/issues"
},
"type": "module",
- "parsers": {
- "js": "mjs"
- },
- "main": "./dist/syrup.cjs",
+ "main": "./index.js",
"module": "./index.js",
- "browser": "./dist/syrup.umd.js",
- "unpkg": "./dist/syrup.umd.js",
"types": "./index.d.ts",
"exports": {
- "./package.json": "./package.json",
- ".": {
- "import": "./index.js",
- "require": "./dist/syrup.cjs",
- "browser": "./dist/syrup.umd.js"
- },
- "./encode": {
- "import": "./encode.js",
- "require": "./dist/encode.cjs",
- "browser": "./dist/encode.umd.js"
- },
- "./decode": {
- "import": "./decode.js",
- "require": "./dist/decode.cjs",
- "browser": "./dist/decode.umd.js"
- }
+ ".": "./index.js",
+ "./encode.js": "./encode.js",
+ "./decode.js": "./decode.js",
+ "./package.json": "./package.json"
},
"scripts": {
- "build": "rollup --config rollup.config.js",
- "clean": "rm -rf dist",
- "cover": "nyc ava",
+ "build": "exit 0",
"lint": "yarn lint:types && yarn lint:js",
- "lint-fix": "eslint --fix '*.js' '**/*.js' 'test*/**.js'",
- "lint:js": "eslint '*.js' '**/*.js' 'test*/**.js'",
+ "lint-fix": "eslint --fix '**/*.js'",
+ "lint:js": "eslint '**/*.js'",
"lint:types": "tsc --build jsconfig.json",
- "prepublish": "yarn clean && yarn build",
"test": "ava"
},
- "dependencies": {},
"devDependencies": {
- "@rollup/plugin-commonjs": "^13.0.0",
- "@rollup/plugin-node-resolve": "^6.1.0",
+ "@agoric/eslint-config": "^0.3.6",
"ava": "^3.12.1",
"babel-eslint": "^10.0.3",
"eslint": "^7.23.0",
"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"
},
"files": [
"LICENSE*",
- "dist",
- "src",
- "types"
+ "index.d.ts",
+ "index.js",
+ "decode.js",
+ "encode.js",
+ "src"
],
- "publishConfig": {
- "access": "public"
- },
+ "private": true,
"eslintConfig": {
"extends": [
"@agoric"

DELETE
packages/syrup/rollup.config.js
-import resolve from '@rollup/plugin-node-resolve';
-import commonjs from '@rollup/plugin-commonjs';
-import { terser } from 'rollup-plugin-terser';
-
-export default [
- {
- input: 'index.js',
- output: [
- {
- file: `dist/syrup.mjs`,
- format: 'esm',
- },
- {
- file: `dist/syrup.cjs`,
- format: 'cjs',
- },
- ],
- plugins: [resolve(), commonjs()],
- },
- {
- input: 'index.js',
- output: {
- file: `dist/syrup.umd.js`,
- format: 'umd',
- name: 'Syrup',
- },
- plugins: [resolve(), commonjs()],
- },
- {
- input: 'index.js',
- output: {
- file: `dist/syrup.umd.min.js`,
- format: 'umd',
- name: 'Syrup',
- },
- plugins: [resolve(), commonjs(), terser()],
- },
-
- {
- input: 'encode.js',
- output: [
- {
- file: `dist/encode.mjs`,
- format: 'esm',
- },
- {
- file: `dist/encode.cjs`,
- format: 'cjs',
- },
- ],
- plugins: [resolve(), commonjs()],
- },
- {
- input: 'encode.js',
- output: {
- file: `dist/encode.umd.js`,
- format: 'umd',
- name: 'SyrupEncoder',
- },
- plugins: [resolve(), commonjs()],
- },
- {
- input: 'encode.js',
- output: {
- file: `dist/encode.umd.min.js`,
- format: 'umd',
- name: 'SyrupEncoder',
- },
- plugins: [resolve(), commonjs(), terser()],
- },
-
- {
- input: 'decode.js',
- output: [
- {
- file: `dist/decode.mjs`,
- format: 'esm',
- },
- {
- file: `dist/decode.cjs`,
- format: 'cjs',
- },
- ],
- plugins: [resolve(), commonjs()],
- },
- {
- input: 'decode.js',
- output: {
- file: `dist/decode.umd.js`,
- format: 'umd',
- name: 'SyrupDecoder',
- },
- plugins: [resolve(), commonjs()],
- },
- {
- input: 'decode.js',
- output: {
- file: `dist/decode.umd.min.js`,
- format: 'umd',
- name: 'SyrupDecoder',
- },
- plugins: [resolve(), commonjs(), terser()],
- },
-];

feat(syrup)!: Update packaging for RESM/NESM bridge

BREAKING CHANGE: No longer supports direct use from CommonJS