From 0e819f365717e76f4e893ddb0b249649641be5bc Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Fri, 27 Oct 2023 14:28:44 -0700 Subject: [PATCH] fix(ses): fix ThirdPartyStaticModuleInterface type The `proxiedExports` param to the `execute` function cannot be `Object`, which is the literal `Object`. It must be _some_ kind of `Object`, however, and `Record` is about as loose as I could think of. --- packages/ses/package.json.md | 24 ++++++++++++++++-------- packages/ses/types.d.ts | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/packages/ses/package.json.md b/packages/ses/package.json.md index 15519a5409..219038f772 100644 --- a/packages/ses/package.json.md +++ b/packages/ses/package.json.md @@ -3,7 +3,7 @@ This is an explainer for the module system configuration of the SES shim package through some properties of `package.json`. -## "type": "module", +## "type": "module" For Node.js, this means that any `.js` file will be interpreted as if it were `.mjs`, meaning a JavaScript module / ESM, as opposed to `.cjs` which is @@ -14,7 +14,7 @@ and translates all `.js` files down from ESM to CommonJS. A patch to `esm` that is in the Agoric SDK repository allows `.js` files in dependencies to break through to the underlying Node.js ESM. -## "main": "./dist/ses.cjs", +## "main": "./dist/ses.cjs" SES provides its own translation from its own ESM sources to CommonJS, emitted by `yarn build`, specifically `scripts/bundle.js`. @@ -35,7 +35,7 @@ The `main` property has been supported by the npm ecosystem since the earliest versions, so every version of Node.js and every tool will look here if nothing else in `package.json` overrides it. -## "module": "./index.js", +## "module": "./index.js" Some tools like WebPack, Parcel and the ESM emulation provided by `node -r esm` use this instead of `main` if it is present. @@ -49,7 +49,7 @@ non-ASCII characters (we use zero-width-joiner to avoid collisions with other names in scope, then censor the use of zero-width-joiner in source). Most tools tolerate this, but WebPack does not. -## "unpkg": "./dist/ses.umd.js", +## "unpkg": "./dist/ses.umd.js" The [Unpkg][] CDN uses this property to direct usage of SES to a precompiled module in "Universal Module Definition" format. @@ -60,7 +60,7 @@ a `