build(static-module-record): use recast with patched ast-types
MODIFY
packages/static-module-record/package.json
packages/static-module-record/package.json
},
"dependencies": {
"@agoric/babel-standalone": "^7.14.3",
+ "@babel/traverse": "^7.10.4",
+ "@babel/types": "^7.10.4",
+ "recast": "agoric-labs/recast#Agoric-built",
"ses": "^0.15.7"
},
"devDependencies": {

MODIFY
packages/static-module-record/src/babelPlugin.js
packages/static-module-record/src/babelPlugin.js
@@ -38,22 +38,6 @@ const collectPatternIdentifiers = (path, pattern) => {
}
};
-const prependReplacements = (replacements, node) => {
- const lastReplace = replacements[replacements.length - 1];
- if (lastReplace) {
- lastReplace.trailingComments = node.trailingComments;
- node.trailingComments = undefined;
- }
- replacements.unshift(node);
-};
-
-const displayAsExport = node => {
- if (node.loc) {
- node.loc.prependText = '/*EX*/ ';
- }
- return node;
-};
-
function makeModulePlugins(options) {
const {
sourceType,

MODIFY
packages/static-module-record/src/transform-analyze.js
packages/static-module-record/src/transform-analyze.js
-import * as recastCJS from '@agoric/recast';
+import * as recastCJS from 'recast';
import traverseCJS from '@babel/traverse';
import typesCJS from '@babel/types';

MODIFY
yarn.lock
yarn.lock
@@ -2923,6 +2923,12 @@ ast-types-flow@^0.0.7:
resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad"
integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0=
+ast-types@agoric-labs/ast-types#Agoric-built:
+ version "0.15.2"
+ resolved "https://codeload.github.com/agoric-labs/ast-types/tar.gz/a2604e3d9ea8344952bff1cb9edca521d28f0c60"
+ dependencies:
+ tslib "^2.0.1"
+
astral-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
@@ -10777,6 +10783,15 @@ readdirp@~3.5.0:
dependencies:
picomatch "^2.2.1"
+recast@agoric-labs/recast#Agoric-built:
+ version "0.20.5"
+ resolved "https://codeload.github.com/agoric-labs/recast/tar.gz/700c2904c0b1cef1bb358520fc1ea5c3091ab07d"
+ dependencies:
+ ast-types agoric-labs/ast-types#Agoric-built
+ esprima "~4.0.0"
+ source-map "~0.6.1"
+ tslib "^2.0.1"
+
redent@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde"
@@ -12607,6 +12622,11 @@ tslib@^1.8.1, tslib@^1.9.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
+tslib@^2.0.1:
+ version "2.3.1"
+ resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
+ integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==
+
tsutils@^3.17.1:
version "3.21.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"

build(static-module-record): use recast with patched ast-types