Skip to content

Commit 36a9a98

Browse files
authored
feat(kernel-shims): Add eventual send shim (#536)
Ref: #461 Adds a bundled shim for eventual send only to `@metamask/kernel-shims`. This is the last item necessary before we cut a release and resolve #461. It is necessary because the MetaMask extension entrains its own `ses` shim, and we only need to add eventual send.
1 parent 82af075 commit 36a9a98

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

packages/kernel-shims/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"type": "module",
2121
"exports": {
2222
"./endoify": "./dist/endoify.js",
23+
"./eventual-send": "./dist/eventual-send.js",
2324
"./package.json": "./package.json"
2425
},
2526
"main": "./dist/endoify.js",

packages/kernel-shims/scripts/bundle.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,22 @@ import { rimraf } from 'rimraf';
1111

1212
console.log('Bundling shims...');
1313

14+
const shims = ['endoify.js', 'eventual-send.js'];
15+
1416
const rootDir = fileURLToPath(new URL('..', import.meta.url));
1517
const srcDir = path.resolve(rootDir, 'src');
1618
const distDir = path.resolve(rootDir, 'dist');
17-
const shim = 'endoify.js';
1819

1920
await mkdir(distDir, { recursive: true });
2021
await rimraf(`${distDir}/*`, { glob: true });
2122

22-
const { source } = await bundleSource(path.resolve(srcDir, shim), {
23-
format: 'endoScript',
24-
});
25-
await writeFile(path.resolve(distDir, shim), source);
23+
await Promise.all(
24+
shims.map(async (shim) => {
25+
const { source } = await bundleSource(path.resolve(srcDir, shim), {
26+
format: 'endoScript',
27+
});
28+
await writeFile(path.resolve(distDir, shim), source);
29+
}),
30+
);
2631

2732
console.log('Success!');
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import '@endo/eventual-send/shim.js';

0 commit comments

Comments
 (0)