From 4a9dfae57239c4d634a0208628c04e5159aa0f77 Mon Sep 17 00:00:00 2001 From: LeoTM <1881059+leotm@users.noreply.github.com> Date: Wed, 8 Nov 2023 19:33:17 +0000 Subject: [PATCH] feat(ses): add SES version Tested - `npm run build` - `head dist/ses.cjs` --- packages/ses/scripts/bundle.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/ses/scripts/bundle.js b/packages/ses/scripts/bundle.js index c1e77dfdf7..aeb4c4a1da 100644 --- a/packages/ses/scripts/bundle.js +++ b/packages/ses/scripts/bundle.js @@ -4,6 +4,7 @@ import fs from 'fs'; import { makeBundle } from '@endo/compartment-mapper/bundle.js'; import { minify } from 'terser'; import { fileURLToPath, pathToFileURL } from 'url'; +import packageJson from '../package.json' assert { type: 'json' }; const resolve = (rel, abs) => fileURLToPath(new URL(rel, abs).toString()); const root = new URL('..', import.meta.url).toString(); @@ -15,10 +16,11 @@ const write = async (target, content) => { }; const main = async () => { - const bundle = await makeBundle( + const version = packageJson.version; + const bundle = `// v${version}\n${await makeBundle( read, pathToFileURL(resolve('../index.js', import.meta.url)).toString(), - ); + )}`; const { code: terse } = await minify(bundle, { mangle: false, keep_classnames: true,