diff --git a/package.json b/package.json index 5b43432fce..2cace9665d 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ "atLeast": 0 }, "resolutions": { - "@babel/types": "7.24.0", "@lerna/version@npm:5.6.2": "patch:@lerna/version@npm%3A5.6.2#~/.yarn/patches/@lerna-version-npm-5.6.2-ce2d9cb2f5.patch", "@lerna/conventional-commits@npm:5.6.2": "patch:@lerna/conventional-commits@npm%3A5.6.2#~/.yarn/patches/@lerna-conventional-commits-npm-5.6.2-a373ba4bc0.patch" } diff --git a/packages/evasive-transform/package.json b/packages/evasive-transform/package.json index b909068ebd..4d5e688914 100644 --- a/packages/evasive-transform/package.json +++ b/packages/evasive-transform/package.json @@ -39,12 +39,12 @@ "test:rebuild-fixtures": "node test/rebuild-fixtures.js" }, "devDependencies": { - "@babel/types": "^7.24.0", + "@babel/types": "~7.26.0", "@endo/ses-ava": "workspace:^", "@rollup/plugin-commonjs": "^19.0.0", "@rollup/plugin-node-resolve": "^13.0.0", "@types/babel__generator": "^7.6.8", - "@types/babel__traverse": "^7.20.5", + "@types/babel__traverse": "^7.20.6", "ava": "^6.1.3", "c8": "^7.14.0", "eslint": "^8.57.0", @@ -78,9 +78,9 @@ "timeout": "2m" }, "dependencies": { - "@agoric/babel-generator": "^7.17.6", - "@babel/parser": "^7.23.6", - "@babel/traverse": "^7.23.6", + "@babel/generator": "~7.26.2", + "@babel/parser": "~7.26.2", + "@babel/traverse": "~7.25.9", "source-map-js": "^1.2.0" } } diff --git a/packages/evasive-transform/src/generate.js b/packages/evasive-transform/src/generate.js index 0b632f8fce..fc6dddda91 100644 --- a/packages/evasive-transform/src/generate.js +++ b/packages/evasive-transform/src/generate.js @@ -5,7 +5,7 @@ */ // @ts-ignore XXX no types defined -import babelGenerator from '@agoric/babel-generator'; +import babelGenerator from '@babel/generator'; // TODO The following is sufficient on Node.js, but for compatibility with // `node -r esm`, we must use the pattern below. @@ -21,6 +21,7 @@ const generator = /** @type {typeof import('@babel/generator')['default']} */ ( * Options for {@link generateCode} with source map * * @typedef GenerateAstOptionsWithSourceMap + * @property {string} [source] * @property {string} sourceUrl - If present, we will generate a source map * @internal */ @@ -29,7 +30,8 @@ const generator = /** @type {typeof import('@babel/generator')['default']} */ ( * Options for {@link generateCode} (no source map generated) * * @typedef GenerateAstOptionsWithoutSourceMap - * @property {undefined} sourceUrl - This should be undefined or otherwise not provided + * @property {string} [source] + * @property {undefined} [sourceUrl] - This should be undefined or otherwise not provided * @internal */ @@ -67,12 +69,19 @@ export const generate = // TODO Use options?.sourceUrl when resolved: // https://github.com/Agoric/agoric-sdk/issues/8671 const sourceUrl = options ? options.sourceUrl : undefined; - const result = generator(ast, { - sourceFileName: sourceUrl, - sourceMaps: Boolean(sourceUrl), - retainLines: true, - compact: true, - }); + const source = options ? options.source : undefined; + const result = generator( + ast, + { + sourceFileName: sourceUrl, + sourceMaps: Boolean(sourceUrl), + retainLines: true, + ...(source === undefined + ? {} + : { experimental_preserveFormat: true }), + }, + source, + ); if (sourceUrl) { return { diff --git a/packages/evasive-transform/src/index.js b/packages/evasive-transform/src/index.js index e205a463b0..968a173b97 100644 --- a/packages/evasive-transform/src/index.js +++ b/packages/evasive-transform/src/index.js @@ -70,9 +70,9 @@ export function evadeCensorSync(source, options) { } if (sourceUrl) { - return generate(ast, { sourceUrl }); + return generate(ast, { source, sourceUrl }); } - return generate(ast); + return generate(ast, { source }); } /** diff --git a/packages/evasive-transform/src/parse-ast.js b/packages/evasive-transform/src/parse-ast.js index 9bb74dbe2d..cf5f72f165 100644 --- a/packages/evasive-transform/src/parse-ast.js +++ b/packages/evasive-transform/src/parse-ast.js @@ -33,7 +33,11 @@ const { parse: parseBabel } = babelParser; * @param {ParseAstOptions} [opts] - Options for underlying parser * @internal */ -export function parseAst(source, opts) { +export function parseAst(source, opts = {}) { // Might not want to pass `opts` verbatim, but also might not matter! - return parseBabel(source, opts); + return parseBabel(source, { + tokens: true, + createParenthesizedExpressions: true, + ...opts, + }); } diff --git a/packages/evasive-transform/test/snapshots/evade-censor.test.js.md b/packages/evasive-transform/test/snapshots/evade-censor.test.js.md index db937fd3d5..39344fd071 100644 --- a/packages/evasive-transform/test/snapshots/evade-censor.test.js.md +++ b/packages/evasive-transform/test/snapshots/evade-censor.test.js.md @@ -8,24 +8,26 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 - '\'use strict\';var node_fs=require(\'node:fs\');/** * @returns {IMPORT(\'node:fs\').constants.F_OK} */function bambalam(){return node_fs.constants.F_OK;}/** * */function monkey(){return true;}exports.bambalam=bambalam;exports.monkey=monkey;/*# sourceMappingURL=index.cjs.map*/' + '\'use strict\';var node_fs = require(\'node:fs\');/** * @returns {IMPORT(\'node:fs\').constants.F_OK} */function bambalam() { return node_fs.constants.F_OK;}/** * */function monkey() { return true;}exports.bambalam = bambalam;exports.monkey = monkey;/*# sourceMappingURL=index.cjs.map*/' ## evadeCensor() - successful source transform w/ source map > Snapshot 1 - '\'use strict\';var node_fs=require(\'node:fs\');/** * @returns {IMPORT(\'node:fs\').constants.F_OK} */function bambalam(){return node_fs.constants.F_OK;}/** * */function monkey(){return true;}exports.bambalam=bambalam;exports.monkey=monkey;/*# sourceMappingURL=index.cjs.map*/' + '\'use strict\';var node_fs = require(\'node:fs\');/** * @returns {IMPORT(\'node:fs\').constants.F_OK} */function bambalam() { return node_fs.constants.F_OK;}/** * */function monkey() { return true;}exports.bambalam = bambalam;exports.monkey = monkey;/*# sourceMappingURL=index.cjs.map*/' ## evadeCensor() - successful source transform w/ source map & source URL > Snapshot 1 - '\'use strict\';var node_fs=require(\'node:fs\');/** * @returns {IMPORT(\'node:fs\').constants.F_OK} */function bambalam(){return node_fs.constants.F_OK;}/** * */function monkey(){return true;}exports.bambalam=bambalam;exports.monkey=monkey;/*# sourceMappingURL=index.cjs.map*/' + '\'use strict\';var node_fs = require(\'node:fs\');/** * @returns {IMPORT(\'node:fs\').constants.F_OK} */function bambalam() { return node_fs.constants.F_OK;}/** * */function monkey() { return true;}exports.bambalam = bambalam;exports.monkey = monkey;/*# sourceMappingURL=index.cjs.map*/' > Snapshot 2 { - mappings: 'AAAA;;AAEA,GAAIA,CAAAA,OAAO,CAAGC,OAAO,CAAC,SAAD,CAArB;;AAEA;AACA;AACA;AACA,QAASC,CAAAA,QAAT,EAAoB;AAClB,MAAOF,CAAAA,OAAO,CAACG,SAAR,CAAkBC,IAAzB;AACD;;AAED;AACA;AACA;AACA,QAASC,CAAAA,MAAT,EAAkB;AAChB,MAAO,KAAP;AACD;;AAEDC,OAAO,CAACJ,QAAR,CAAmBA,QAAnB;AACAI,OAAO,CAACD,MAAR,CAAiBA,MAAjB;AACA', + file: undefined, + ignoreList: [], + mappings: 'AAAA,YAAY;;AAEZ,IAAIA,OAAO,GAAGC,OAAO,CAAC,SAAS,CAAC;;AAEhC;AACA;AACA;AACA,SAASC,QAAQA,CAAA,EAAG;AAAA,EAClB,OAAOF,OAAO,CAACG,SAAS,CAACC,IAAI;AAAC;;AAGhC;AACA;AACA;AACA,SAASC,MAAMA,CAAA,EAAG;AAAA,EAChB,OAAO,IAAI;AAAC;;AAGdC,OAAO,CAACJ,QAAQ,GAAGA,QAAQ;AAC3BI,OAAO,CAACD,MAAM,GAAGA,MAAM;AACvB', names: [ 'node_fs', 'require', @@ -35,9 +37,34 @@ Generated by [AVA](https://avajs.dev). 'monkey', 'exports', ], + sourceRoot: undefined, sources: [ 'index.cjs', ], + sourcesContent: [ + `'use strict';␊ + ␊ + var node_fs = require('node:fs');␊ + ␊ + /**␊ + * @returns {import('node:fs').constants.F_OK}␊ + */␊ + function bambalam() {␊ + return node_fs.constants.F_OK;␊ + }␊ + ␊ + /**␊ + * ␊ + */␊ + function monkey() {␊ + return true;␊ + }␊ + ␊ + exports.bambalam = bambalam;␊ + exports.monkey = monkey;␊ + //# sourceMappingURL=index.cjs.map␊ + `, + ], version: 3, } @@ -45,12 +72,14 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 - '\'use strict\';var node_fs=require(\'node:fs\');/** * @returns {IMPORT(\'node:fs\').constants.F_OK} */function bambalam(){return node_fs.constants.F_OK;}/** * */function monkey(){return true;}exports.bambalam=bambalam;exports.monkey=monkey;/*# sourceMappingURL=index.cjs.map*/' + '\'use strict\';var node_fs = require(\'node:fs\');/** * @returns {IMPORT(\'node:fs\').constants.F_OK} */function bambalam() { return node_fs.constants.F_OK;}/** * */function monkey() { return true;}exports.bambalam = bambalam;exports.monkey = monkey;/*# sourceMappingURL=index.cjs.map*/' > Snapshot 2 { - mappings: 'AAAA;;AAEA,GAAIA,CAAAA,OAAO,CAAGC,OAAO,CAAC,SAAD,CAArB;;AAEA;AACA;AACA;AACA,QAASC,CAAAA,QAAT,EAAoB;AAClB,MAAOF,CAAAA,OAAO,CAACG,SAAR,CAAkBC,IAAzB;AACD;;AAED;AACA;AACA;AACA,QAASC,CAAAA,MAAT,EAAkB;AAChB,MAAO,KAAP;AACD;;AAEDC,OAAO,CAACJ,QAAR,CAAmBA,QAAnB;AACAI,OAAO,CAACD,MAAR,CAAiBA,MAAjB;AACA', + file: undefined, + ignoreList: [], + mappings: 'AAAA,YAAY;;AAEZ,IAAIA,OAAO,GAAGC,OAAO,CAAC,SAAS,CAAC;;AAEhC;AACA;AACA;AACA,SAASC,QAAQA,CAAA,EAAG;AAAA,EAClB,OAAOF,OAAO,CAACG,SAAS,CAACC,IAAI;AAAC;;AAGhC;AACA;AACA;AACA,SAASC,MAAMA,CAAA,EAAG;AAAA,EAChB,OAAO,IAAI;AAAC;;AAGdC,OAAO,CAACJ,QAAQ,GAAGA,QAAQ;AAC3BI,OAAO,CAACD,MAAM,GAAGA,MAAM;AACvB', names: [ 'node_fs', 'require', @@ -60,9 +89,34 @@ Generated by [AVA](https://avajs.dev). 'monkey', 'exports', ], + sourceRoot: undefined, sources: [ 'index.cjs', ], + sourcesContent: [ + `'use strict';␊ + ␊ + var node_fs = require('node:fs');␊ + ␊ + /**␊ + * @returns {import('node:fs').constants.F_OK}␊ + */␊ + function bambalam() {␊ + return node_fs.constants.F_OK;␊ + }␊ + ␊ + /**␊ + * ␊ + */␊ + function monkey() {␊ + return true;␊ + }␊ + ␊ + exports.bambalam = bambalam;␊ + exports.monkey = monkey;␊ + //# sourceMappingURL=index.cjs.map␊ + `, + ], version: 3, } @@ -70,18 +124,20 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 - '\'use strict\';varnode_fs=require(\'node:fs\');/** * @returns {IMPORT(\'node:fs\').constants.F_OK} */function bambalam(){return node_fs.constants.F_OK;}/** * */function monkey(){return true;}exports.bambalam=bambalam;exports.monkey=monkey;/*# sourceMappingURL=index.cjs.map*/' + '\'use strict\';var node_fs = require(\'node:fs\');/** * @returns {IMPORT(\'node:fs\').constants.F_OK} */ function bambalam(){ return node_fs.constants.F_OK;}/** * */ function monkey(){ return true;} exports. bambalam=bambalam;exports. monkey=monkey;/*# sourceMappingURL=index.cjs.map*/' ## evadeCensor() - successful source transform w/ source map, source URL & unmapping > Snapshot 1 - '\'use strict\';varnode_fs=require(\'node:fs\');/** * @returns {IMPORT(\'node:fs\').constants.F_OK} */function bambalam(){return node_fs.constants.F_OK;}/** * */function monkey(){return true;}exports.bambalam=bambalam;exports.monkey=monkey;/*# sourceMappingURL=index.cjs.map*/' + '\'use strict\';var node_fs = require(\'node:fs\');/** * @returns {IMPORT(\'node:fs\').constants.F_OK} */ function bambalam(){ return node_fs.constants.F_OK;}/** * */ function monkey(){ return true;} exports. bambalam=bambalam;exports. monkey=monkey;/*# sourceMappingURL=index.cjs.map*/' > Snapshot 2 { - mappings: 'AAAA;;AAEAA,OAAA,CAAAC,OAAA,CAAA,SAAA,CAFA,CAEA;AACA;AACA;AACO,QAASC,CAAAA,QAAT,EAAoB;AACzB,MAAOF,CAAAA,OAAA,CAAAG,SAAA,CAAUC,IAAjB,CADyB,CAH3B;AACA;AACA,GACO,QAASC,CAAAA,MAAT,EAAkB,CACvB,MAAO,KAAP,CADuB,CAChBC,OAAA,CAAAJ,QAAA,CAAAA,QAAA,CAAAI,OAAA,CAAAD,MAAA,CAAAA,MAAA', + file: undefined, + ignoreList: [], + mappings: 'AAAA;;AAAA,GAEA,CAAAA,OAAA,EAAAC,QAAA;AACA;AACA;AAFA;;AAGO,2VAASC,SAAA,CAAW;AACzB,2VAAOF,OAAA,CAAAG,SAAA,CAAUC,IAAV;AAAP,CAJF;AACA;AACA,GAFA;;;AAGO,2VAASC,OAAA,CAAS;AACvB,2VAAO;AAAP,CADK;;AACEC,OAAA,oVAAAJ,QAAA,CAAAA,QAAA;AAAAI,OAAA,oVAAAD,MAAA,CAAAA,MAAA', names: [ 'node_fs', 'require', @@ -91,8 +147,33 @@ Generated by [AVA](https://avajs.dev). 'monkey', 'exports', ], + sourceRoot: undefined, sources: [ 'index.cjs', ], + sourcesContent: [ + `'use strict';␊ + ␊ + var node_fs = require('node:fs');␊ + ␊ + /**␊ + * @returns {import('node:fs').constants.F_OK}␊ + */␊ + function bambalam() {␊ + return node_fs.constants.F_OK;␊ + }␊ + ␊ + /**␊ + * ␊ + */␊ + function monkey() {␊ + return true;␊ + }␊ + ␊ + exports.bambalam = bambalam;␊ + exports.monkey = monkey;␊ + //# sourceMappingURL=index.cjs.map␊ + `, + ], version: 3, } diff --git a/packages/evasive-transform/test/snapshots/evade-censor.test.js.snap b/packages/evasive-transform/test/snapshots/evade-censor.test.js.snap index 391945013c..7792b4f5c9 100644 Binary files a/packages/evasive-transform/test/snapshots/evade-censor.test.js.snap and b/packages/evasive-transform/test/snapshots/evade-censor.test.js.snap differ diff --git a/packages/module-source/package.json b/packages/module-source/package.json index d3625cf092..c01ff3c2af 100644 --- a/packages/module-source/package.json +++ b/packages/module-source/package.json @@ -38,10 +38,10 @@ "test": "ava" }, "dependencies": { - "@agoric/babel-generator": "^7.17.6", - "@babel/parser": "^7.23.6", - "@babel/traverse": "^7.23.6", - "@babel/types": "^7.24.0", + "@babel/generator": "~7.26.2", + "@babel/parser": "~7.26.2", + "@babel/traverse": "~7.25.9", + "@babel/types": "~7.26.0", "ses": "workspace:^" }, "devDependencies": { diff --git a/packages/module-source/src/babelPlugin.js b/packages/module-source/src/babel-plugin.js similarity index 100% rename from packages/module-source/src/babelPlugin.js rename to packages/module-source/src/babel-plugin.js diff --git a/packages/module-source/src/transform-analyze.js b/packages/module-source/src/transform-analyze.js index 588d918b13..34d4f94a59 100644 --- a/packages/module-source/src/transform-analyze.js +++ b/packages/module-source/src/transform-analyze.js @@ -1,6 +1,6 @@ // @ts-nocheck XXX Babel types -import { makeTransformSource } from './transformSource.js'; -import makeModulePlugins from './babelPlugin.js'; +import { makeTransformSource } from './transform-source.js'; +import makeModulePlugins from './babel-plugin.js'; import * as h from './hidden.js'; @@ -71,7 +71,7 @@ const makeCreateStaticRecord = transformSource => .map( src => `[${js(src)}, [${Object.entries(isrc[src]) - .map(([exp, upds]) => `[${js(exp)}, [${upds.join(',')}]]`) + .map(([exp, upds]) => `[${js(exp)},[${upds.join(',')}]]`) .join(',')}]]`, ) .join(',')}]);`; @@ -80,9 +80,7 @@ const makeCreateStaticRecord = transformSource => let src = ''; if (cvname) { // It's a function assigned to, so set its name property. - src = `Object.defineProperty(${cvname}, 'name', {value: ${js( - vname, - )}});`; + src = `Object.defineProperty(${cvname},'name',{value:${js(vname)}});`; } const hDeclId = isOnce ? h.HIDDEN_ONCE : h.HIDDEN_LIVE; src += `${hDeclId}.${vname}(${cvname || ''});`; @@ -99,14 +97,9 @@ const makeCreateStaticRecord = transformSource => // well. // Relies on the evaluator to ensure these functions are strict. let functorSource = `\ -({ \ - imports: ${h.HIDDEN_IMPORTS}, \ - liveVar: ${h.HIDDEN_LIVE}, \ - onceVar: ${h.HIDDEN_ONCE}, \ - importMeta: ${h.HIDDEN_META}, \ -}) => (function () { 'use strict'; \ - ${preamble} \ - ${scriptSource} +({imports:${h.HIDDEN_IMPORTS},liveVar:${h.HIDDEN_LIVE},onceVar:${h.HIDDEN_ONCE},importMeta:${h.HIDDEN_META}})=>(function(){'use strict';\ +${preamble}\ +${scriptSource} })() `; diff --git a/packages/module-source/src/transformSource.js b/packages/module-source/src/transform-source.js similarity index 74% rename from packages/module-source/src/transformSource.js rename to packages/module-source/src/transform-source.js index 1d749d0cbf..a45b65b882 100644 --- a/packages/module-source/src/transformSource.js +++ b/packages/module-source/src/transform-source.js @@ -1,6 +1,6 @@ // @ts-nocheck XXX Babel types import * as babelParser from '@babel/parser'; -import babelGenerate from '@agoric/babel-generator'; +import babelGenerate from '@babel/generator'; import babelTraverse from '@babel/traverse'; import * as babelTypes from '@babel/types'; @@ -26,7 +26,11 @@ export const makeTransformSource = (makeModulePlugins, babel = null) => { const { sourceUrl, sourceMapUrl, sourceType, sourceMap, sourceMapHook } = sourceOptions; - const ast = parseBabel(source, { sourceType }); + const ast = parseBabel(source, { + sourceType, + tokens: true, + createParenthesizedExpressions: true, + }); traverseBabel(ast, visitorFromPlugin(analyzePlugin)); traverseBabel(ast, visitorFromPlugin(transformPlugin)); @@ -34,14 +38,19 @@ export const makeTransformSource = (makeModulePlugins, babel = null) => { const sourceMaps = sourceOptions.sourceMapHook !== undefined; const { code: transformedSource, map: transformedSourceMap } = - generateBabel(ast, { - sourceFileName: sourceMapUrl, - sourceMaps, - inputSourceMap: sourceMap, - retainLines: true, - compact: true, - verbatim: true, - }); + generateBabel( + ast, + { + sourceFileName: sourceMapUrl, + sourceMaps, + inputSourceMap: sourceMap, + experimental_preserveFormat: true, + preserveFormat: true, + retainLines: true, + verbatim: true, + }, + source, + ); if (sourceMaps) { sourceMapHook(transformedSourceMap, { diff --git a/packages/module-source/test/_benchmark-babel-plugin.js b/packages/module-source/test/_benchmark-babel-plugin.js index e83668df27..1874179933 100644 --- a/packages/module-source/test/_benchmark-babel-plugin.js +++ b/packages/module-source/test/_benchmark-babel-plugin.js @@ -1,8 +1,8 @@ import Benchmark from 'benchmark'; import fs from 'fs'; import url from 'url'; -import { makeTransformSource } from '../src/transformSource.js'; -import makeModulePlugins from '../src/babelPlugin.js'; +import { makeTransformSource } from '../src/transform-source.js'; +import makeModulePlugins from '../src/babel-plugin.js'; const suite = new Benchmark.Suite(); diff --git a/packages/module-source/test/fixtures/format-preserved.txt b/packages/module-source/test/fixtures/format-preserved.txt new file mode 100644 index 0000000000..a2c4924c31 --- /dev/null +++ b/packages/module-source/test/fixtures/format-preserved.txt @@ -0,0 +1,11 @@ +({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);Object.defineProperty(createBinop,'name',{value:"createBinop"});$h͏_once.createBinop(createBinop);// deliberately offset +function TokenType() {} +const beforeExpr = 0; + + function createBinop(name, binop) { + return new TokenType(name, { + beforeExpr, + binop, + }); +} +})() diff --git a/packages/module-source/test/fixtures/preserve-format.js b/packages/module-source/test/fixtures/preserve-format.js new file mode 100644 index 0000000000..9b1ab73ed9 --- /dev/null +++ b/packages/module-source/test/fixtures/preserve-format.js @@ -0,0 +1,10 @@ +// deliberately offset +function TokenType() {} +const beforeExpr = 0; + +export function createBinop(name, binop) { + return new TokenType(name, { + beforeExpr, + binop, + }); +} diff --git a/packages/module-source/test/preserve-format.test.js b/packages/module-source/test/preserve-format.test.js new file mode 100644 index 0000000000..35cbd5ed56 --- /dev/null +++ b/packages/module-source/test/preserve-format.test.js @@ -0,0 +1,20 @@ +import url from 'url'; +import fs from 'fs'; +import test from 'ava'; +import { ModuleSource } from '../src/module-source.js'; +import './_lockdown.js'; + +function readFixture(filename) { + return fs.readFileSync( + url.fileURLToPath(new URL(filename, import.meta.url)), + 'utf-8', + ); +} + +test('preserves formatting', t => { + const { __syncModuleProgram__: actual } = new ModuleSource( + readFixture('fixtures/preserve-format.js'), + ); + const expected = readFixture('fixtures/format-preserved.txt'); + t.is(actual, expected); +}); diff --git a/scripts/all-versions.sh b/scripts/all-versions.sh index 7746d3cf94..3e33963b52 100755 --- a/scripts/all-versions.sh +++ b/scripts/all-versions.sh @@ -8,8 +8,8 @@ cd -- "$WORKDIR" ( echo package.json - yarn workspaces --json info --silent | - jq -r '.data | fromjson | .[].location | "\(.)/package.json"' || true + npm query .workspace | + jq -r '.[].location | "\(.)/package.json"' ) | xargs jq ' ((.dependencies // {}), (.devDependencies // {})) diff --git a/scripts/set-versions.sh b/scripts/set-versions.sh index 8460985193..2573f2e581 100755 --- a/scripts/set-versions.sh +++ b/scripts/set-versions.sh @@ -12,8 +12,8 @@ VERSIONSHASH=$(git hash-object -w --stdin) ( echo package.json - yarn workspaces --json info | - jq -r '.data | fromjson | .[].location | "\(.)/package.json"' || true + npm query .workspace | + jq -r '.[].location | "\(.)/package.json"' ) | while read PACKAGEJSON; do PACKAGEJSONHASH=$( jq --slurpfile versions <(git cat-file blob "$VERSIONSHASH") ' diff --git a/yarn.lock b/yarn.lock index dbf81d4412..42fdb1c584 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,17 +12,6 @@ __metadata: languageName: node linkType: hard -"@agoric/babel-generator@npm:^7.17.6": - version: 7.17.6 - resolution: "@agoric/babel-generator@npm:7.17.6" - dependencies: - "@babel/types": "npm:^7.17.0" - jsesc: "npm:^2.5.1" - source-map: "npm:^0.5.0" - checksum: 10c0/59db151ae737bd9b1f21c1589df4c7da9cbf484de5b5cc8352052825c2d977283d975303f55acb54d0210c176cb405da263073ceba1d3a6db65c6e21cc6e663f - languageName: node - linkType: hard - "@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.22.13, @babel/code-frame@npm:^7.23.5": version: 7.23.5 resolution: "@babel/code-frame@npm:7.23.5" @@ -33,6 +22,17 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.25.9": + version: 7.26.2 + resolution: "@babel/code-frame@npm:7.26.2" + dependencies: + "@babel/helper-validator-identifier": "npm:^7.25.9" + js-tokens: "npm:^4.0.0" + picocolors: "npm:^1.0.0" + checksum: 10c0/7d79621a6849183c415486af99b1a20b84737e8c11cd55b6544f688c51ce1fd710e6d869c3dd21232023da272a79b91efb3e83b5bc2dc65c1187c5fcd1b72ea8 + languageName: node + linkType: hard + "@babel/generator@npm:^7.23.6": version: 7.23.6 resolution: "@babel/generator@npm:7.23.6" @@ -45,6 +45,19 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.25.9, @babel/generator@npm:~7.26.2": + version: 7.26.2 + resolution: "@babel/generator@npm:7.26.2" + dependencies: + "@babel/parser": "npm:^7.26.2" + "@babel/types": "npm:^7.26.0" + "@jridgewell/gen-mapping": "npm:^0.3.5" + "@jridgewell/trace-mapping": "npm:^0.3.25" + jsesc: "npm:^3.0.2" + checksum: 10c0/167ebce8977142f5012fad6bd91da51ac52bcd752f2261a54b7ab605d928aebe57e21636cdd2a9c7757e552652c68d9fcb5d40b06fcb66e02d9ee7526e118a5c + languageName: node + linkType: hard + "@babel/helper-environment-visitor@npm:^7.22.20": version: 7.22.20 resolution: "@babel/helper-environment-visitor@npm:7.22.20" @@ -80,10 +93,10 @@ __metadata: languageName: node linkType: hard -"@babel/helper-string-parser@npm:^7.23.4": - version: 7.23.4 - resolution: "@babel/helper-string-parser@npm:7.23.4" - checksum: 10c0/f348d5637ad70b6b54b026d6544bd9040f78d24e7ec245a0fc42293968181f6ae9879c22d89744730d246ce8ec53588f716f102addd4df8bbc79b73ea10004ac +"@babel/helper-string-parser@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/helper-string-parser@npm:7.25.9" + checksum: 10c0/7244b45d8e65f6b4338a6a68a8556f2cb161b782343e97281a5f2b9b93e420cad0d9f5773a59d79f61d0c448913d06f6a2358a87f2e203cf112e3c5b53522ee6 languageName: node linkType: hard @@ -94,6 +107,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/helper-validator-identifier@npm:7.25.9" + checksum: 10c0/4fc6f830177b7b7e887ad3277ddb3b91d81e6c4a24151540d9d1023e8dc6b1c0505f0f0628ae653601eb4388a8db45c1c14b2c07a9173837aef7e4116456259d + languageName: node + linkType: hard + "@babel/highlight@npm:^7.23.4": version: 7.23.4 resolution: "@babel/highlight@npm:7.23.4" @@ -114,6 +134,17 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.2, @babel/parser@npm:~7.26.2": + version: 7.26.2 + resolution: "@babel/parser@npm:7.26.2" + dependencies: + "@babel/types": "npm:^7.26.0" + bin: + parser: ./bin/babel-parser.js + checksum: 10c0/751a743087b3a9172a7599f1421830d44c38f065ef781588d2bfb1c98f9b461719a226feb13c868d7a284783eee120c88ea522593118f2668f46ebfb1105c4d7 + languageName: node + linkType: hard + "@babel/template@npm:^7.22.15": version: 7.22.15 resolution: "@babel/template@npm:7.22.15" @@ -125,7 +156,18 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.23.6, @babel/traverse@npm:^7.7.0": +"@babel/template@npm:^7.25.9": + version: 7.25.9 + resolution: "@babel/template@npm:7.25.9" + dependencies: + "@babel/code-frame": "npm:^7.25.9" + "@babel/parser": "npm:^7.25.9" + "@babel/types": "npm:^7.25.9" + checksum: 10c0/ebe677273f96a36c92cc15b7aa7b11cc8bc8a3bb7a01d55b2125baca8f19cae94ff3ce15f1b1880fb8437f3a690d9f89d4e91f16fc1dc4d3eb66226d128983ab + languageName: node + linkType: hard + +"@babel/traverse@npm:^7.7.0": version: 7.23.7 resolution: "@babel/traverse@npm:7.23.7" dependencies: @@ -143,14 +185,28 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:7.24.0": - version: 7.24.0 - resolution: "@babel/types@npm:7.24.0" +"@babel/traverse@npm:~7.25.9": + version: 7.25.9 + resolution: "@babel/traverse@npm:7.25.9" dependencies: - "@babel/helper-string-parser": "npm:^7.23.4" - "@babel/helper-validator-identifier": "npm:^7.22.20" - to-fast-properties: "npm:^2.0.0" - checksum: 10c0/777a0bb5dbe038ca4c905fdafb1cdb6bdd10fe9d63ce13eca0bd91909363cbad554a53dc1f902004b78c1dcbc742056f877f2c99eeedff647333b1fadf51235d + "@babel/code-frame": "npm:^7.25.9" + "@babel/generator": "npm:^7.25.9" + "@babel/parser": "npm:^7.25.9" + "@babel/template": "npm:^7.25.9" + "@babel/types": "npm:^7.25.9" + debug: "npm:^4.3.1" + globals: "npm:^11.1.0" + checksum: 10c0/e90be586a714da4adb80e6cb6a3c5cfcaa9b28148abdafb065e34cc109676fc3db22cf98cd2b2fff66ffb9b50c0ef882cab0f466b6844be0f6c637b82719bba1 + languageName: node + linkType: hard + +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.15, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.23.6, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0, @babel/types@npm:^7.7.0, @babel/types@npm:^7.8.3, @babel/types@npm:~7.26.0": + version: 7.26.0 + resolution: "@babel/types@npm:7.26.0" + dependencies: + "@babel/helper-string-parser": "npm:^7.25.9" + "@babel/helper-validator-identifier": "npm:^7.25.9" + checksum: 10c0/b694f41ad1597127e16024d766c33a641508aad037abd08d0d1f73af753e1119fa03b4a107d04b5f92cc19c095a594660547ae9bead1db2299212d644b0a5cb8 languageName: node linkType: hard @@ -451,15 +507,15 @@ __metadata: version: 0.0.0-use.local resolution: "@endo/evasive-transform@workspace:packages/evasive-transform" dependencies: - "@agoric/babel-generator": "npm:^7.17.6" - "@babel/parser": "npm:^7.23.6" - "@babel/traverse": "npm:^7.23.6" - "@babel/types": "npm:^7.24.0" + "@babel/generator": "npm:~7.26.2" + "@babel/parser": "npm:~7.26.2" + "@babel/traverse": "npm:~7.25.9" + "@babel/types": "npm:~7.26.0" "@endo/ses-ava": "workspace:^" "@rollup/plugin-commonjs": "npm:^19.0.0" "@rollup/plugin-node-resolve": "npm:^13.0.0" "@types/babel__generator": "npm:^7.6.8" - "@types/babel__traverse": "npm:^7.20.5" + "@types/babel__traverse": "npm:^7.20.6" ava: "npm:^6.1.3" c8: "npm:^7.14.0" eslint: "npm:^8.57.0" @@ -639,10 +695,10 @@ __metadata: version: 0.0.0-use.local resolution: "@endo/module-source@workspace:packages/module-source" dependencies: - "@agoric/babel-generator": "npm:^7.17.6" - "@babel/parser": "npm:^7.23.6" - "@babel/traverse": "npm:^7.23.6" - "@babel/types": "npm:^7.24.0" + "@babel/generator": "npm:~7.26.2" + "@babel/parser": "npm:~7.26.2" + "@babel/traverse": "npm:~7.25.9" + "@babel/types": "npm:~7.26.0" ava: "npm:^6.1.3" babel-eslint: "npm:^10.1.0" benchmark: "npm:^2.1.4" @@ -1099,6 +1155,17 @@ __metadata: languageName: node linkType: hard +"@jridgewell/gen-mapping@npm:^0.3.5": + version: 0.3.5 + resolution: "@jridgewell/gen-mapping@npm:0.3.5" + dependencies: + "@jridgewell/set-array": "npm:^1.2.1" + "@jridgewell/sourcemap-codec": "npm:^1.4.10" + "@jridgewell/trace-mapping": "npm:^0.3.24" + checksum: 10c0/1be4fd4a6b0f41337c4f5fdf4afc3bd19e39c3691924817108b82ffcb9c9e609c273f936932b9fba4b3a298ce2eb06d9bff4eb1cc3bd81c4f4ee1b4917e25feb + languageName: node + linkType: hard + "@jridgewell/resolve-uri@npm:^3.1.0": version: 3.1.1 resolution: "@jridgewell/resolve-uri@npm:3.1.1" @@ -1113,6 +1180,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/set-array@npm:^1.2.1": + version: 1.2.1 + resolution: "@jridgewell/set-array@npm:1.2.1" + checksum: 10c0/2a5aa7b4b5c3464c895c802d8ae3f3d2b92fcbe84ad12f8d0bfbb1f5ad006717e7577ee1fd2eac00c088abe486c7adb27976f45d2941ff6b0b92b2c3302c60f4 + languageName: node + linkType: hard + "@jridgewell/source-map@npm:^0.3.2": version: 0.3.2 resolution: "@jridgewell/source-map@npm:0.3.2" @@ -1140,6 +1214,16 @@ __metadata: languageName: node linkType: hard +"@jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25": + version: 0.3.25 + resolution: "@jridgewell/trace-mapping@npm:0.3.25" + dependencies: + "@jridgewell/resolve-uri": "npm:^3.1.0" + "@jridgewell/sourcemap-codec": "npm:^1.4.14" + checksum: 10c0/3d1ce6ebc69df9682a5a8896b414c6537e428a1d68b02fcc8363b04284a8ca0df04d0ee3013132252ab14f2527bc13bea6526a912ecb5658f0e39fd2860b4df4 + languageName: node + linkType: hard + "@lerna/create@npm:8.1.8": version: 8.1.8 resolution: "@lerna/create@npm:8.1.8" @@ -2069,12 +2153,12 @@ __metadata: languageName: node linkType: hard -"@types/babel__traverse@npm:^7.20.5": - version: 7.20.5 - resolution: "@types/babel__traverse@npm:7.20.5" +"@types/babel__traverse@npm:^7.20.6": + version: 7.20.6 + resolution: "@types/babel__traverse@npm:7.20.6" dependencies: "@babel/types": "npm:^7.20.7" - checksum: 10c0/033abcb2f4c084ad33e30c3efaad82161240f351e3c71b6154ed289946b33b363696c0fbd42502b68e4582a87413c418321f40eb1ea863e34fe525641345e05b + checksum: 10c0/7ba7db61a53e28cac955aa99af280d2600f15a8c056619c05b6fc911cbe02c61aa4f2823299221b23ce0cce00b294c0e5f618ec772aa3f247523c2e48cf7b888 languageName: node linkType: hard @@ -6399,6 +6483,15 @@ __metadata: languageName: node linkType: hard +"jsesc@npm:^3.0.2": + version: 3.0.2 + resolution: "jsesc@npm:3.0.2" + bin: + jsesc: bin/jsesc + checksum: 10c0/ef22148f9e793180b14d8a145ee6f9f60f301abf443288117b4b6c53d0ecd58354898dc506ccbb553a5f7827965cd38bc5fb726575aae93c5e8915e2de8290e1 + languageName: node + linkType: hard + "json-parse-better-errors@npm:^1.0.1": version: 1.0.2 resolution: "json-parse-better-errors@npm:1.0.2" @@ -8215,6 +8308,13 @@ __metadata: languageName: node linkType: hard +"picocolors@npm:^1.0.0": + version: 1.1.1 + resolution: "picocolors@npm:1.1.1" + checksum: 10c0/e2e3e8170ab9d7c7421969adaa7e1b31434f789afb9b3f115f6b96d91945041ac3ceb02e9ec6fe6510ff036bcc0bf91e69a1772edc0b707e12b19c0f2d6bcf58 + languageName: node + linkType: hard + "picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.2.2, picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" @@ -9218,13 +9318,6 @@ __metadata: languageName: node linkType: hard -"source-map@npm:^0.5.0": - version: 0.5.7 - resolution: "source-map@npm:0.5.7" - checksum: 10c0/904e767bb9c494929be013017380cbba013637da1b28e5943b566031e29df04fba57edf3f093e0914be094648b577372bd8ad247fa98cfba9c600794cd16b599 - languageName: node - linkType: hard - "source-map@npm:^0.6.0, source-map@npm:^0.6.1, source-map@npm:~0.6.1": version: 0.6.1 resolution: "source-map@npm:0.6.1" @@ -9744,13 +9837,6 @@ __metadata: languageName: node linkType: hard -"to-fast-properties@npm:^2.0.0": - version: 2.0.0 - resolution: "to-fast-properties@npm:2.0.0" - checksum: 10c0/b214d21dbfb4bce3452b6244b336806ffea9c05297148d32ebb428d5c43ce7545bdfc65a1ceb58c9ef4376a65c0cb2854d645f33961658b3e3b4f84910ddcdd7 - languageName: node - linkType: hard - "to-regex-range@npm:^5.0.1": version: 5.0.1 resolution: "to-regex-range@npm:5.0.1"