From de80b75404290c9aec89e5dc49069c22859e0e65 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Mon, 16 Oct 2023 15:41:53 -0700 Subject: [PATCH] chore: move all of transform.js into @endo/transforms --- packages/bundle-source/package.json | 4 +- .../src/nested-evaluate-and-get-exports.js | 15 +- packages/bundle-source/src/transform.js | 131 ------------------ packages/bundle-source/src/zip-base64.js | 13 +- packages/transforms/index.js | 1 + packages/transforms/package.json | 12 +- packages/transforms/src/evade-censor.js | 14 +- packages/transforms/src/index.js | 99 ++++++++++++- packages/transforms/src/location-unmapper.js | 63 +++++++++ packages/transforms/test/test-evade-censor.js | 14 +- packages/transforms/tsconfig.json | 9 +- yarn.lock | 93 ++++++++----- 12 files changed, 261 insertions(+), 207 deletions(-) delete mode 100644 packages/bundle-source/src/transform.js create mode 100644 packages/transforms/src/location-unmapper.js diff --git a/packages/bundle-source/package.json b/packages/bundle-source/package.json index db95e2109c..fcea3227c3 100644 --- a/packages/bundle-source/package.json +++ b/packages/bundle-source/package.json @@ -29,13 +29,11 @@ "lint:types": "tsc -p jsconfig.json" }, "dependencies": { - "@agoric/babel-generator": "^7.17.4", - "@babel/parser": "^7.17.3", - "@babel/traverse": "^7.17.3", "@endo/base64": "^0.2.35", "@endo/compartment-mapper": "^0.9.2", "@endo/init": "^0.5.60", "@endo/promise-kit": "^0.2.60", + "@endo/transforms": "^0.1.3", "@endo/where": "^0.3.5", "@rollup/plugin-commonjs": "^19.0.0", "@rollup/plugin-node-resolve": "^13.0.0", diff --git a/packages/bundle-source/src/nested-evaluate-and-get-exports.js b/packages/bundle-source/src/nested-evaluate-and-get-exports.js index 8ff71adebb..1e04859bf7 100644 --- a/packages/bundle-source/src/nested-evaluate-and-get-exports.js +++ b/packages/bundle-source/src/nested-evaluate-and-get-exports.js @@ -3,7 +3,7 @@ import url from 'url'; import { rollup as rollup0 } from 'rollup'; import resolve0 from '@rollup/plugin-node-resolve'; import commonjs0 from '@rollup/plugin-commonjs'; -import { transformSource } from './transform.js'; +import { transformSource } from '@endo/transforms'; const DEFAULT_FILE_PREFIX = '/bundled-source/...'; @@ -95,11 +95,14 @@ export async function bundleNestedEvaluateAndGetExports( const useLocationUnmap = moduleFormat === 'nestedEvaluate' && !fileName.startsWith('_virtual/'); - const { code: transformedCode } = await transformSource(code, { - sourceMapUrl: pathname, - sourceMap: chunk.map, - useLocationUnmap, - }); + const { code: transformedCode } = await transformSource( + code, + chunk.map, + pathname, + { + useLocationUnmap, + }, + ); unsortedSourceBundle[shortName] = transformedCode; // console.log(`==== sourceBundle[${fileName}]\n${sourceBundle[fileName]}\n====`); diff --git a/packages/bundle-source/src/transform.js b/packages/bundle-source/src/transform.js deleted file mode 100644 index b787274773..0000000000 --- a/packages/bundle-source/src/transform.js +++ /dev/null @@ -1,131 +0,0 @@ -import * as babelParser from '@babel/parser'; -import babelGenerate from '@agoric/babel-generator'; -import babelTraverse from '@babel/traverse'; -import SourceMaps from 'source-map'; - -const SourceMapConsumer = SourceMaps.SourceMapConsumer; -const parseBabel = babelParser.default - ? babelParser.default.parse - : babelParser.parse || babelParser; - -const IMPORT_RE = new RegExp('\\b(import)(\\s*(?:\\(|/[/*]))', 'sg'); -const HTML_COMMENT_START_RE = new RegExp(`${'<'}!--`, 'g'); -const HTML_COMMENT_END_RE = new RegExp(`--${'>'}`, 'g'); - -function rewriteComment(node, unmapLoc) { - node.type = 'CommentBlock'; - // Within comments... - node.value = node.value - // ...strip extraneous comment whitespace - .replace(/^\s+/gm, ' ') - // ...replace HTML comments with a defanged version to pass SES restrictions. - .replace(HTML_COMMENT_START_RE, '') - // ...replace import expressions with a defanged version to pass SES restrictions. - .replace(IMPORT_RE, 'X$1$2') - // ...replace end-of-comment markers - .replace(/\*\//g, '*X/'); - if (unmapLoc) { - unmapLoc(node.loc); - } - // console.log(JSON.stringify(node, undefined, 2)); -} - -async function makeLocationUnmapper({ sourceMap, ast }) { - // We rearrange the rolled-up chunk according to its sourcemap to move - // its source lines back to the right place. - // eslint-disable-next-line no-await-in-loop - const consumer = await new SourceMapConsumer(sourceMap); - try { - const unmapped = new WeakSet(); - let lastPos = { ...ast.loc.start }; - return loc => { - if (!loc || unmapped.has(loc)) { - return; - } - // Make sure things start at least at the right place. - loc.end = { ...loc.start }; - for (const pos of ['start', 'end']) { - if (loc[pos]) { - const newPos = consumer.originalPositionFor(loc[pos]); - if (newPos.source !== null) { - lastPos = { - line: newPos.line, - column: newPos.column, - }; - } - loc[pos] = lastPos; - } - } - unmapped.add(loc); - }; - } finally { - consumer.destroy(); - } -} - -function transformAst(ast, unmapLoc) { - (babelTraverse.default || babelTraverse)(ast, { - enter(p) { - const { - loc, - comments, - leadingComments, - innerComments, - trailingComments, - } = p.node; - (comments || []).forEach(node => rewriteComment(node, unmapLoc)); - // Rewrite all comments. - (leadingComments || []).forEach(node => rewriteComment(node, unmapLoc)); - if (p.node.type.startsWith('Comment')) { - rewriteComment(p.node, unmapLoc); - } - (innerComments || []).forEach(node => rewriteComment(node, unmapLoc)); - // If not a comment, and we are unmapping the source maps, - // then do it for this location. - if (unmapLoc) { - unmapLoc(loc); - } - (trailingComments || []).forEach(node => rewriteComment(node, unmapLoc)); - }, - }); -} - -/** - * @param {string} code - * @param {object} param1 - * @param {string} [param1.sourceMap] - * @param {string} [param1.sourceMapUrl] - * @param {boolean} [param1.useLocationUnmap] - * @param {string} [param1.sourceType] - */ -export async function transformSource( - code, - { sourceMap, sourceMapUrl, useLocationUnmap, sourceType } = {}, -) { - await null; - - // Parse the rolled-up chunk with Babel. - // We are prepared for different module systems. - const ast = parseBabel(code, { - sourceType, - }); - - let unmapLoc; - if (useLocationUnmap) { - unmapLoc = await makeLocationUnmapper({ - sourceMap, - ast, - }); - } - - transformAst(ast, unmapLoc); - - // Now generate the sources with the new positions. - return (babelGenerate.default || babelGenerate)(ast, { - sourceFileName: sourceMapUrl, - sourceMaps: true, - retainLines: true, - compact: true, - }); -} diff --git a/packages/bundle-source/src/zip-base64.js b/packages/bundle-source/src/zip-base64.js index dae6ecdb25..3983acc9ef 100644 --- a/packages/bundle-source/src/zip-base64.js +++ b/packages/bundle-source/src/zip-base64.js @@ -10,7 +10,7 @@ import { makeAndHashArchive } from '@endo/compartment-mapper/archive.js'; import { encodeBase64 } from '@endo/base64'; import { whereEndoCache } from '@endo/where'; import { makeReadPowers } from '@endo/compartment-mapper/node-powers.js'; -import { transformSource } from './transform.js'; +import { transformSource } from '@endo/transforms'; const textEncoder = new TextEncoder(); const textDecoder = new TextDecoder(); @@ -119,11 +119,14 @@ export async function bundleZipBase64( ) { const source = textDecoder.decode(sourceBytes); let object; - ({ code: object, map: sourceMap } = await transformSource(source, { - sourceType: 'module', + ({ code: object, map: sourceMap } = await transformSource( + source, sourceMap, - sourceMapUrl: new URL(specifier, location).href, - })); + new URL(specifier, location).href, + { + sourceType: 'module', + }, + )); const objectBytes = textEncoder.encode(object); return { bytes: objectBytes, parser: 'mjs', sourceMap }; }, diff --git a/packages/transforms/index.js b/packages/transforms/index.js index e69de29bb2..4df73b330f 100644 --- a/packages/transforms/index.js +++ b/packages/transforms/index.js @@ -0,0 +1 @@ +export * from './src/index.js'; diff --git a/packages/transforms/package.json b/packages/transforms/package.json index 0d9927bc4b..a29e46d42c 100644 --- a/packages/transforms/package.json +++ b/packages/transforms/package.json @@ -18,7 +18,6 @@ "module": "./index.js", "exports": { ".": "./index.js", - "./evade-censor": "./src/evade-censor.js", "./package.json": "./package.json" }, "scripts": { @@ -37,6 +36,7 @@ }, "devDependencies": { "@endo/ses-ava": "^0.2.44", + "@types/babel__traverse": "^7.20.2", "ava": "^5.3.0", "c8": "^7.14.0", "tsd": "^0.28.1" @@ -64,6 +64,14 @@ "timeout": "2m" }, "dependencies": { - "@babel/types": "7.20.2" + "@agoric/babel-generator": "7.17.6", + "@babel/parser": "7.20.3", + "@babel/traverse": "7.20.1", + "@babel/types": "7.23.0", + "@types/babel__generator": "7.6.5", + "source-map": "0.7.4" + }, + "resolutions": { + "@babel/types": "7.23.0" } } diff --git a/packages/transforms/src/evade-censor.js b/packages/transforms/src/evade-censor.js index ce630379e9..c089b9859a 100644 --- a/packages/transforms/src/evade-censor.js +++ b/packages/transforms/src/evade-censor.js @@ -1,5 +1,3 @@ -// @ts-check - /** * Provides functions for evading SES restrictions. * @@ -25,10 +23,11 @@ const HTML_COMMENT_END_RE = new RegExp(`--${'>'}`, 'g'); * Rewrites a Comment Node to avoid triggering SES restrictions. * * Apparently coerces all comments to block comments. + * * @param {import('@babel/types').Comment} node - * @param {LocationUnmapper} [unmapLoc] + * @param {import('./location-unmapper').LocationUnmapper} [unmapLoc] */ -export function transformComment(node, unmapLoc) { +export function evadeCensor(node, unmapLoc) { node.type = 'CommentBlock'; // Within comments... node.value = node.value @@ -46,10 +45,3 @@ export function transformComment(node, unmapLoc) { unmapLoc(node.loc); } } - -/** - * A function which modifies a Node's source location so that sourcemaps work properly. - * @callback LocationUnmapper - * @param {import('@babel/types').SourceLocation} [loc] - * @returns {void} - */ diff --git a/packages/transforms/src/index.js b/packages/transforms/src/index.js index 1f23798740..2f25201b73 100644 --- a/packages/transforms/src/index.js +++ b/packages/transforms/src/index.js @@ -1,2 +1,97 @@ -// place holder to unwedge lint -export {}; +import babelGenerate from '@agoric/babel-generator'; +import babelTraverse from '@babel/traverse'; +import * as babelParser from '@babel/parser'; +import { makeLocationUnmapper } from './location-unmapper.js'; +import { evadeCensor } from './evade-censor.js'; + +export * from './evade-censor.js'; +export * from './location-unmapper.js'; + +/** @type {typeof import('@babel/traverse')} */ +const { default: traverse } = /** @type {any} */ (babelTraverse); + +/** @type {typeof import('@babel/generator')} */ +const { default: generate } = /** @type {any} */ (babelGenerate); + +const { parse: parseBabel } = babelParser; + +/** + * Transforms AST by rewriting comments + * @internal + * @param {import('@babel/types').File} ast + * @param {import('./location-unmapper.js').LocationUnmapper} [unmapLoc] + * @returns {void} + */ +function transformAst(ast, unmapLoc) { + traverse(ast, { + enter(p) { + const { loc, leadingComments, innerComments, trailingComments, type } = + p.node; + // discriminated union + if ('comments' in p.node) { + (p.node.comments || []).forEach(node => evadeCensor(node, unmapLoc)); + } + // Rewrite all comments. + (leadingComments || []).forEach(node => evadeCensor(node, unmapLoc)); + // XXX: there is no such Node having type matching /^Comment.+/ in + // @babel/types + if (type.startsWith('Comment')) { + // @ts-expect-error - see above XXX + evadeCensor(p.node, unmapLoc); + } + (innerComments || []).forEach(node => evadeCensor(node, unmapLoc)); + // If not a comment, and we are unmapping the source maps, + // then do it for this location. + if (unmapLoc) { + unmapLoc(loc); + } + (trailingComments || []).forEach(node => evadeCensor(node, unmapLoc)); + }, + }); +} + +/** + * Apply source transforms on the given code and source map + * + * @param {string} code - Code to transform + * @param {string} sourceMap - Original source map + * @param {string} sourceMapUrl - URL of original source map + * @param {TransformSourceOptions} options - Options for the transform + * @returns {Promise} Object + * containing new code and source map + */ +export async function transformSource( + code, + sourceMap, + sourceMapUrl, + { useLocationUnmap, sourceType } = {}, +) { + await null; + + // Parse the rolled-up chunk with Babel. + // We are prepared for different module systems. + const ast = parseBabel(code, { + sourceType, + }); + + let unmapLoc; + if (useLocationUnmap) { + unmapLoc = await makeLocationUnmapper(sourceMap, ast); + } + + transformAst(ast, unmapLoc); + + // Now generate the sources with the new positions. + return generate(ast, { + sourceFileName: sourceMapUrl, + sourceMaps: true, + retainLines: true, + compact: true, + }); +} + +/** + * @typedef TransformSourceOptions + * @property {boolean} [useLocationUnmap] + * @property {import('@babel/parser').ParserOptions['sourceType']} [sourceType] + */ diff --git a/packages/transforms/src/location-unmapper.js b/packages/transforms/src/location-unmapper.js new file mode 100644 index 0000000000..5b1615f7f5 --- /dev/null +++ b/packages/transforms/src/location-unmapper.js @@ -0,0 +1,63 @@ +/** + * Provides functionality to unmap a source location + * + * @module + */ + +import { SourceMapConsumer } from 'source-map'; + +/** + * Fixes sourcemap after transformation + * @internal + * @param {string} sourceMap + * @param {import('@babel/types').File} ast + * @returns {Promise} + */ +export async function makeLocationUnmapper(sourceMap, ast) { + // We rearrange the rolled-up chunk according to its sourcemap to move + // its source lines back to the right place. + return SourceMapConsumer.with(sourceMap, null, async consumer => { + if (!ast.loc) { + throw new TypeError('No SourceLocation found in AST'); + } + const unmapped = new WeakSet(); + /** + * Change this type to `import('@babel/types').Position` if we assign the + * `index` prop below + * @type {any} + */ + let lastPos = { + ...ast.loc.start, + }; + return loc => { + if (!loc || unmapped.has(loc)) { + return; + } + // Make sure things start at least at the right place. + loc.end = { ...loc.start }; + for (const pos of /** @type {const} */ (['start', 'end'])) { + if (loc[pos]) { + const newPos = consumer.originalPositionFor(loc[pos]); + if (newPos.source !== null) { + // This assumes that if source is non-null, then line and column are + // also non-null + lastPos = { + line: /** @type {number} */ (newPos.line), + column: /** @type {number} */ (newPos.column), + // XXX: what of the `index` prop? + }; + } + loc[pos] = lastPos; + } + } + unmapped.add(loc); + }; + }); +} + +/** + * A function which modifies a Node's source location so that sourcemaps work properly. + * @callback LocationUnmapper + * @param {import('@babel/types').SourceLocation|null} [loc] + * @returns {void} + */ diff --git a/packages/transforms/test/test-evade-censor.js b/packages/transforms/test/test-evade-censor.js index 0d83f53463..90d305b9ea 100644 --- a/packages/transforms/test/test-evade-censor.js +++ b/packages/transforms/test/test-evade-censor.js @@ -1,13 +1,11 @@ -// @ts-check - import { test } from './prepare-test-env-ava.js'; -import { transformComment } from '../src/evade-censor.js'; +import { evadeCensor } from '../src/evade-censor.js'; test('transformComment() - Node type becomes CommentBlock', async t => { const comment = /** @type {import('@babel/types').Comment} */ ({ value: 'hello world', }); - transformComment(comment); + evadeCensor(comment); t.is(comment.type, 'CommentBlock'); }); @@ -16,7 +14,7 @@ test('transformComment() - strip extraneous leading whitespace', async t => { type: 'CommentBlock', value: ' hello world ', }); - transformComment(comment); + evadeCensor(comment); t.is(comment.value, ' hello world '); }); @@ -25,7 +23,7 @@ test('transformComment() - defang HTML comment', async t => { type: 'CommentBlock', value: '', }); - transformComment(comment); + evadeCensor(comment); t.is(comment.value, ''); }); @@ -36,7 +34,7 @@ test('transformComment() - rewrite suspicious import(...)', async t => { * @type {import('c:\\My Documents\\user.js')} */`, }); - transformComment(comment); + evadeCensor(comment); t.regex( comment.value, new RegExp("\\* @type \\{ІᛖРΟᏒТ\\('c:\\\\My Documents\\\\user\\.js'\\)"), @@ -48,6 +46,6 @@ test('transformComment() - rewrite end-of-comment marker', async t => { type: 'CommentBlock', value: '/** I like turtles */', }); - transformComment(comment); + evadeCensor(comment); t.is(comment.value, '/** I like turtles *X/'); }); diff --git a/packages/transforms/tsconfig.json b/packages/transforms/tsconfig.json index a06773acd0..9ae1ffdb41 100644 --- a/packages/transforms/tsconfig.json +++ b/packages/transforms/tsconfig.json @@ -1,7 +1,12 @@ { "extends": "../../jsconfig.eslint-base.json", "compilerOptions": { - "allowJs": true + "allowJs": true, + "paths": { + "@agoric/babel-generator": ["../../node_modules/@types/babel__generator"], + }, + "strict": true }, - "include": ["*.js", "*.ts", "src/**/*.js", "src/**/*.ts"] + "include": ["index.js", "src/**/*.js", "test/**/*.js"], + "exclude": ["**/*.d.ts"] } diff --git a/yarn.lock b/yarn.lock index 9d7d6935a9..293c7e0045 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,7 +7,7 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== -"@agoric/babel-generator@^7.17.4", "@agoric/babel-generator@^7.17.6": +"@agoric/babel-generator@7.17.6", "@agoric/babel-generator@^7.17.6": version "7.17.6" resolved "https://registry.yarnpkg.com/@agoric/babel-generator/-/babel-generator-7.17.6.tgz#75ff4629468a481d670b4154bcfade11af6de674" integrity sha512-D2wnk5fGajxMN5SCRSaA/triQGEaEX2Du0EzrRqobuD4wRXjvtF1e7jC1PPOk/RC2bZ8/0fzp0CHOiB7YLwb5w== @@ -225,16 +225,21 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-string-parser@^7.19.4": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" - integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== +"@babel/helper-string-parser@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" + integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== "@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": version "7.19.1" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + "@babel/helper-validator-option@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" @@ -268,16 +273,16 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/parser@7.20.3", "@babel/parser@^7.17.3", "@babel/parser@^7.18.10", "@babel/parser@^7.2.2", "@babel/parser@^7.20.1", "@babel/parser@^7.3.4", "@babel/parser@^7.7.0": + version "7.20.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.3.tgz#5358cf62e380cf69efcb87a7bb922ff88bfac6e2" + integrity sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg== + "@babel/parser@^7.0.0 <7.4.0": version "7.3.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.4.tgz#a43357e4bbf4b92a437fb9e465c192848287f27c" integrity sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ== -"@babel/parser@^7.17.3", "@babel/parser@^7.18.10", "@babel/parser@^7.2.2", "@babel/parser@^7.20.1", "@babel/parser@^7.3.4", "@babel/parser@^7.7.0": - version "7.20.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.3.tgz#5358cf62e380cf69efcb87a7bb922ff88bfac6e2" - integrity sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg== - "@babel/plugin-proposal-async-generator-functions@^7.2.0": version "7.19.1" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.19.1.tgz#34f6f5174b688529342288cd264f80c9ea9fb4a7" @@ -687,22 +692,7 @@ "@babel/parser" "^7.18.10" "@babel/types" "^7.18.10" -"@babel/traverse@^7.0.0 <7.4.0": - version "7.3.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.3.4.tgz#1330aab72234f8dea091b08c4f8b9d05c7119e06" - integrity sha512-TvTHKp6471OYEcE/91uWmhR6PrrYywQntCHSaZ8CM8Vmp+pjAusal4nGB2WCCQd0rvI7nOMKn9GnbcvTUz3/ZQ== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.3.4" - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.0.0" - "@babel/parser" "^7.3.4" - "@babel/types" "^7.3.4" - debug "^4.1.0" - globals "^11.1.0" - lodash "^4.17.11" - -"@babel/traverse@^7.17.3", "@babel/traverse@^7.19.0", "@babel/traverse@^7.19.1", "@babel/traverse@^7.20.1", "@babel/traverse@^7.3.4", "@babel/traverse@^7.7.0": +"@babel/traverse@7.20.1", "@babel/traverse@^7.17.3", "@babel/traverse@^7.19.0", "@babel/traverse@^7.19.1", "@babel/traverse@^7.20.1", "@babel/traverse@^7.3.4", "@babel/traverse@^7.7.0": version "7.20.1" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.1.tgz#9b15ccbf882f6d107eeeecf263fbcdd208777ec8" integrity sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA== @@ -718,13 +708,28 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@7.20.2", "@babel/types@^7.17.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.2.2", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.3.4", "@babel/types@^7.7.0": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.2.tgz#67ac09266606190f496322dbaff360fdaa5e7842" - integrity sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog== +"@babel/traverse@^7.0.0 <7.4.0": + version "7.3.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.3.4.tgz#1330aab72234f8dea091b08c4f8b9d05c7119e06" + integrity sha512-TvTHKp6471OYEcE/91uWmhR6PrrYywQntCHSaZ8CM8Vmp+pjAusal4nGB2WCCQd0rvI7nOMKn9GnbcvTUz3/ZQ== dependencies: - "@babel/helper-string-parser" "^7.19.4" - "@babel/helper-validator-identifier" "^7.19.1" + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.3.4" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.0.0" + "@babel/parser" "^7.3.4" + "@babel/types" "^7.3.4" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.11" + +"@babel/types@7.23.0", "@babel/types@^7.0.0", "@babel/types@^7.17.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.2.2", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.3.4", "@babel/types@^7.7.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb" + integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg== + dependencies: + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" "@babel/types@^7.0.0 <7.4.0": @@ -2105,6 +2110,20 @@ resolved "https://registry.yarnpkg.com/@tsd/typescript/-/typescript-5.0.4.tgz#18aa4eb2c35c6bf9aab3199c289be319bedb7e9c" integrity sha512-YQi2lvZSI+xidKeUjlbv6b6Zw7qB3aXHw5oGJLs5OOGAEqKIOvz5UIAkWyg0bJbkSUWPBEtaOHpVxU4EYBO1Jg== +"@types/babel__generator@7.6.5": + version "7.6.5" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.5.tgz#281f4764bcbbbc51fdded0f25aa587b4ce14da95" + integrity sha512-h9yIuWbJKdOPLJTbmSpPzkF67e659PbQDba7ifWm5BJ8xTv+sDmS7rFmywkWOvXedGTivCdeGSIIX8WLcRTz8w== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__traverse@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.2.tgz#4ddf99d95cfdd946ff35d2b65c978d9c9bf2645d" + integrity sha512-ojlGK1Hsfce93J0+kn3H5R73elidKUaZonirN33GSmgTUMpzI/MIFfSpF3haANe3G1bEBS9/9/QEqwTzwqFsKw== + dependencies: + "@babel/types" "^7.20.7" + "@types/eslint@^7.2.13": version "7.29.0" resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.29.0.tgz#e56ddc8e542815272720bb0b4ccc2aff9c3e1c78" @@ -11109,16 +11128,16 @@ source-map@0.6.1, source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +source-map@0.7.4, source-map@^0.7.3: + version "0.7.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" + integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== + source-map@^0.5.0, source-map@^0.5.6, source-map@~0.5.3: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== -source-map@^0.7.3: - version "0.7.4" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" - integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== - sourcemap-codec@^1.4.8: version "1.4.8" resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4"