summaryrefslogtreecommitdiff
path: root/node_modules/@babel/helper-module-transforms/lib
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@babel/helper-module-transforms/lib')
-rw-r--r--node_modules/@babel/helper-module-transforms/lib/dynamic-import.js48
-rw-r--r--node_modules/@babel/helper-module-transforms/lib/dynamic-import.js.map1
-rw-r--r--node_modules/@babel/helper-module-transforms/lib/get-module-name.js48
-rw-r--r--node_modules/@babel/helper-module-transforms/lib/get-module-name.js.map1
-rw-r--r--node_modules/@babel/helper-module-transforms/lib/index.js398
-rw-r--r--node_modules/@babel/helper-module-transforms/lib/index.js.map1
-rw-r--r--node_modules/@babel/helper-module-transforms/lib/lazy-modules.js31
-rw-r--r--node_modules/@babel/helper-module-transforms/lib/lazy-modules.js.map1
-rw-r--r--node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js361
-rw-r--r--node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js.map1
-rw-r--r--node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js355
-rw-r--r--node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js.map1
-rw-r--r--node_modules/@babel/helper-module-transforms/lib/rewrite-this.js22
-rw-r--r--node_modules/@babel/helper-module-transforms/lib/rewrite-this.js.map1
14 files changed, 0 insertions, 1270 deletions
diff --git a/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js b/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js
deleted file mode 100644
index 90fcea61..00000000
--- a/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js
+++ /dev/null
@@ -1,48 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.buildDynamicImport = buildDynamicImport;
-var _core = require("@babel/core");
-{
- exports.getDynamicImportSource = function getDynamicImportSource(node) {
- const [source] = node.arguments;
- return _core.types.isStringLiteral(source) || _core.types.isTemplateLiteral(source) ? source : _core.template.expression.ast`\`\${${source}}\``;
- };
-}
-function buildDynamicImport(node, deferToThen, wrapWithPromise, builder) {
- const specifier = _core.types.isCallExpression(node) ? node.arguments[0] : node.source;
- if (_core.types.isStringLiteral(specifier) || _core.types.isTemplateLiteral(specifier) && specifier.quasis.length === 0) {
- if (deferToThen) {
- return _core.template.expression.ast`
- Promise.resolve().then(() => ${builder(specifier)})
- `;
- } else return builder(specifier);
- }
- const specifierToString = _core.types.isTemplateLiteral(specifier) ? _core.types.identifier("specifier") : _core.types.templateLiteral([_core.types.templateElement({
- raw: ""
- }), _core.types.templateElement({
- raw: ""
- })], [_core.types.identifier("specifier")]);
- if (deferToThen) {
- return _core.template.expression.ast`
- (specifier =>
- new Promise(r => r(${specifierToString}))
- .then(s => ${builder(_core.types.identifier("s"))})
- )(${specifier})
- `;
- } else if (wrapWithPromise) {
- return _core.template.expression.ast`
- (specifier =>
- new Promise(r => r(${builder(specifierToString)}))
- )(${specifier})
- `;
- } else {
- return _core.template.expression.ast`
- (specifier => ${builder(specifierToString)})(${specifier})
- `;
- }
-}
-
-//# sourceMappingURL=dynamic-import.js.map
diff --git a/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js.map b/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js.map
deleted file mode 100644
index 1ae8dc39..00000000
--- a/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"names":["_core","require","exports","getDynamicImportSource","node","source","arguments","t","isStringLiteral","isTemplateLiteral","template","expression","ast","buildDynamicImport","deferToThen","wrapWithPromise","builder","specifier","isCallExpression","quasis","length","specifierToString","identifier","templateLiteral","templateElement","raw"],"sources":["../src/dynamic-import.ts"],"sourcesContent":["// Heavily inspired by\n// https://github.com/airbnb/babel-plugin-dynamic-import-node/blob/master/src/utils.js\n\nimport { types as t, template } from \"@babel/core\";\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // eslint-disable-next-line no-restricted-globals\n exports.getDynamicImportSource = function getDynamicImportSource(\n node: t.CallExpression,\n ): t.StringLiteral | t.TemplateLiteral {\n const [source] = node.arguments;\n\n return t.isStringLiteral(source) || t.isTemplateLiteral(source)\n ? source\n : (template.expression.ast`\\`\\${${source}}\\`` as t.TemplateLiteral);\n };\n}\n\nexport function buildDynamicImport(\n node: t.CallExpression | t.ImportExpression,\n deferToThen: boolean,\n wrapWithPromise: boolean,\n builder: (specifier: t.Expression) => t.Expression,\n): t.Expression {\n const specifier = t.isCallExpression(node) ? node.arguments[0] : node.source;\n\n if (\n t.isStringLiteral(specifier) ||\n (t.isTemplateLiteral(specifier) && specifier.quasis.length === 0)\n ) {\n if (deferToThen) {\n return template.expression.ast`\n Promise.resolve().then(() => ${builder(specifier)})\n `;\n } else return builder(specifier);\n }\n\n const specifierToString = t.isTemplateLiteral(specifier)\n ? t.identifier(\"specifier\")\n : t.templateLiteral(\n [t.templateElement({ raw: \"\" }), t.templateElement({ raw: \"\" })],\n [t.identifier(\"specifier\")],\n );\n\n if (deferToThen) {\n return template.expression.ast`\n (specifier =>\n new Promise(r => r(${specifierToString}))\n .then(s => ${builder(t.identifier(\"s\"))})\n )(${specifier})\n `;\n } else if (wrapWithPromise) {\n return template.expression.ast`\n (specifier =>\n new Promise(r => r(${builder(specifierToString)}))\n )(${specifier})\n `;\n } else {\n return template.expression.ast`\n (specifier => ${builder(specifierToString)})(${specifier})\n `;\n }\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAEiE;EAE/DC,OAAO,CAACC,sBAAsB,GAAG,SAASA,sBAAsBA,CAC9DC,IAAsB,EACe;IACrC,MAAM,CAACC,MAAM,CAAC,GAAGD,IAAI,CAACE,SAAS;IAE/B,OAAOC,WAAC,CAACC,eAAe,CAACH,MAAM,CAAC,IAAIE,WAAC,CAACE,iBAAiB,CAACJ,MAAM,CAAC,GAC3DA,MAAM,GACLK,cAAQ,CAACC,UAAU,CAACC,GAAG,QAAQP,MAAM,KAA2B;EACvE,CAAC;AACH;AAEO,SAASQ,kBAAk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nB,KAAK;EACH,CAAC,MAAM;IACL,OAAOP,cAAQ,CAACC,UAAU,CAACC,GAAG;AAClC,sBAAsBI,OAAO,CAACK,iBAAiB,CAAC,KAAKJ,SAAS;AAC9D,KAAK;EACH;AACF","ignoreList":[]} \ No newline at end of file
diff --git a/node_modules/@babel/helper-module-transforms/lib/get-module-name.js b/node_modules/@babel/helper-module-transforms/lib/get-module-name.js
deleted file mode 100644
index b1a6ed70..00000000
--- a/node_modules/@babel/helper-module-transforms/lib/get-module-name.js
+++ /dev/null
@@ -1,48 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = getModuleName;
-{
- const originalGetModuleName = getModuleName;
- exports.default = getModuleName = function getModuleName(rootOpts, pluginOpts) {
- var _pluginOpts$moduleId, _pluginOpts$moduleIds, _pluginOpts$getModule, _pluginOpts$moduleRoo;
- return originalGetModuleName(rootOpts, {
- moduleId: (_pluginOpts$moduleId = pluginOpts.moduleId) != null ? _pluginOpts$moduleId : rootOpts.moduleId,
- moduleIds: (_pluginOpts$moduleIds = pluginOpts.moduleIds) != null ? _pluginOpts$moduleIds : rootOpts.moduleIds,
- getModuleId: (_pluginOpts$getModule = pluginOpts.getModuleId) != null ? _pluginOpts$getModule : rootOpts.getModuleId,
- moduleRoot: (_pluginOpts$moduleRoo = pluginOpts.moduleRoot) != null ? _pluginOpts$moduleRoo : rootOpts.moduleRoot
- });
- };
-}
-function getModuleName(rootOpts, pluginOpts) {
- const {
- filename,
- filenameRelative = filename,
- sourceRoot = pluginOpts.moduleRoot
- } = rootOpts;
- const {
- moduleId,
- moduleIds = !!moduleId,
- getModuleId,
- moduleRoot = sourceRoot
- } = pluginOpts;
- if (!moduleIds) return null;
- if (moduleId != null && !getModuleId) {
- return moduleId;
- }
- let moduleName = moduleRoot != null ? moduleRoot + "/" : "";
- if (filenameRelative) {
- const sourceRootReplacer = sourceRoot != null ? new RegExp("^" + sourceRoot + "/?") : "";
- moduleName += filenameRelative.replace(sourceRootReplacer, "").replace(/\.\w*$/, "");
- }
- moduleName = moduleName.replace(/\\/g, "/");
- if (getModuleId) {
- return getModuleId(moduleName) || moduleName;
- } else {
- return moduleName;
- }
-}
-
-//# sourceMappingURL=get-module-name.js.map
diff --git a/node_modules/@babel/helper-module-transforms/lib/get-module-name.js.map b/node_modules/@babel/helper-module-transforms/lib/get-module-name.js.map
deleted file mode 100644
index fd69f3bb..00000000
--- a/node_modules/@babel/helper-module-transforms/lib/get-module-name.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"names":["originalGetModuleName","getModuleName","exports","default","rootOpts","pluginOpts","_pluginOpts$moduleId","_pluginOpts$moduleIds","_pluginOpts$getModule","_pluginOpts$moduleRoo","moduleId","moduleIds","getModuleId","moduleRoot","filename","filenameRelative","sourceRoot","moduleName","sourceRootReplacer","RegExp","replace"],"sources":["../src/get-module-name.ts"],"sourcesContent":["type RootOptions = {\n filename?: string;\n filenameRelative?: string;\n sourceRoot?: string;\n};\n\nexport type PluginOptions = {\n moduleId?: string;\n moduleIds?: boolean;\n getModuleId?: (moduleName: string) => string | null | undefined;\n moduleRoot?: string;\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n const originalGetModuleName = getModuleName;\n\n // @ts-expect-error TS doesn't like reassigning a function.\n getModuleName = function getModuleName(\n rootOpts: RootOptions & PluginOptions,\n pluginOpts: PluginOptions,\n ): string | null {\n return originalGetModuleName(rootOpts, {\n moduleId: pluginOpts.moduleId ?? rootOpts.moduleId,\n moduleIds: pluginOpts.moduleIds ?? rootOpts.moduleIds,\n getModuleId: pluginOpts.getModuleId ?? rootOpts.getModuleId,\n moduleRoot: pluginOpts.moduleRoot ?? rootOpts.moduleRoot,\n });\n };\n}\n\nexport default function getModuleName(\n rootOpts: RootOptions,\n pluginOpts: PluginOptions,\n): string | null {\n const {\n filename,\n filenameRelative = filename,\n sourceRoot = pluginOpts.moduleRoot,\n } = rootOpts;\n\n const {\n moduleId,\n moduleIds = !!moduleId,\n\n getModuleId,\n\n moduleRoot = sourceRoot,\n } = pluginOpts;\n\n if (!moduleIds) return null;\n\n // moduleId is n/a if a `getModuleId()` is provided\n if (moduleId != null && !getModuleId) {\n return moduleId;\n }\n\n let moduleName = moduleRoot != null ? moduleRoot + \"/\" : \"\";\n\n if (filenameRelative) {\n const sourceRootReplacer =\n sourceRoot != null ? new RegExp(\"^\" + sourceRoot + \"/?\") : \"\";\n\n moduleName += filenameRelative\n // remove sourceRoot from filename\n .replace(sourceRootReplacer, \"\")\n // remove extension\n .replace(/\\.\\w*$/, \"\");\n }\n\n // normalize path separators\n moduleName = moduleName.replace(/\\\\/g, \"/\");\n\n if (getModuleId) {\n // If return is falsy, assume they want us to use our generated default name\n return getModuleId(moduleName) || moduleName;\n } else {\n return moduleName;\n }\n}\n"],"mappings":";;;;;;AAamC;EACjC,MAAMA,qBAAqB,GAAGC,aAAa;EAG3CC,OAAA,CAAAC,OAAA,GAAAF,aAAa,GAAG,SAASA,aAAaA,CACpCG,QAAqC,EACrCC,UAAyB,EACV;IAAA,IAAAC,oBAAA,EAAAC,qBAAA,EAAAC,qBAAA,EAAAC,qBAAA;IACf,OAAOT,qBAAqB,CAACI,QAAQ,EAAE;MACrCM,QAAQ,GAAAJ,oBAAA,GAAED,UAAU,CAACK,QAAQ,YAAAJ,oBAAA,GAAIF,QAAQ,CAACM,QAAQ;MAClDC,SAAS,GAAAJ,qBAAA,GAAEF,UAAU,CAACM,SAAS,YAAAJ,qBAAA,GAAIH,QAAQ,CAACO,SAAS;MACrDC,WAAW,GAAAJ,qBAAA,GAAEH,UAAU,CAACO,WAAW,YAAAJ,qBAAA,GAAIJ,QAAQ,CAACQ,WAAW;MAC3DC,UAAU,GAAAJ,qBAAA,GAAEJ,UAAU,CAACQ,UAAU,YAAAJ,qBAAA,GAAIL,QAAQ,CAACS;IAChD,CAAC,CAAC;EACJ,CAAC;AACH;AAEe,SAASZ,aAAaA,CACnCG,QAAqB,EACrBC,UAAyB,EACV;EACf,MAAM;IACJS,QAAQ;IACRC,gBAAgB,GAAGD,QAAQ;IAC3BE,UAAU,GAAGX,UAAU,CAACQ;EAC1B,CAAC,GAAGT,QAAQ;EAEZ,MAAM;IACJM,QAAQ;IACRC,SAAS,GAAG,CAAC,CAACD,QAAQ;IAEtBE,WAAW;IAEXC,UAAU,GAAGG;EACf,CAAC,GAAGX,UAAU;EAEd,IAAI,CAACM,SAAS,EAAE,OAAO,IAAI;EAG3B,IAAID,QAAQ,IAAI,IAAI,IAAI,CAACE,WAAW,EAAE;IACpC,OAAOF,QAAQ;EACjB;EAEA,IAAIO,UAAU,GAAGJ,UAAU,IAAI,IAAI,GAAGA,UAAU,GAAG,GAAG,GAAG,EAAE;EAE3D,IAAIE,gBAAgB,EAAE;IACpB,MAAMG,kBAAkB,GACtBF,UAAU,IAAI,IAAI,GAAG,IAAIG,MAAM,CAAC,GAAG,GAAGH,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE;IAE/DC,UAAU,IAAIF,gBAAgB,CAE3BK,OAAO,CAACF,kBAAkB,EAAE,EAAE,CAAC,CAE/BE,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;EAC1B;EAGAH,UAAU,GAAGA,UAAU,CAACG,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;EAE3C,IAAIR,WAAW,EAAE;IAEf,OAAOA,WAAW,CAACK,UAAU,CAAC,IAAIA,UAAU;EAC9C,CAAC,MAAM;IACL,OAAOA,UAAU;EACnB;AACF","ignoreList":[]} \ No newline at end of file
diff --git a/node_modules/@babel/helper-module-transforms/lib/index.js b/node_modules/@babel/helper-module-transforms/lib/index.js
deleted file mode 100644
index ac884d25..00000000
--- a/node_modules/@babel/helper-module-transforms/lib/index.js
+++ /dev/null
@@ -1,398 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-Object.defineProperty(exports, "buildDynamicImport", {
- enumerable: true,
- get: function () {
- return _dynamicImport.buildDynamicImport;
- }
-});
-exports.buildNamespaceInitStatements = buildNamespaceInitStatements;
-exports.ensureStatementsHoisted = ensureStatementsHoisted;
-Object.defineProperty(exports, "getModuleName", {
- enumerable: true,
- get: function () {
- return _getModuleName.default;
- }
-});
-Object.defineProperty(exports, "hasExports", {
- enumerable: true,
- get: function () {
- return _normalizeAndLoadMetadata.hasExports;
- }
-});
-Object.defineProperty(exports, "isModule", {
- enumerable: true,
- get: function () {
- return _helperModuleImports.isModule;
- }
-});
-Object.defineProperty(exports, "isSideEffectImport", {
- enumerable: true,
- get: function () {
- return _normalizeAndLoadMetadata.isSideEffectImport;
- }
-});
-exports.rewriteModuleStatementsAndPrepareHeader = rewriteModuleStatementsAndPrepareHeader;
-Object.defineProperty(exports, "rewriteThis", {
- enumerable: true,
- get: function () {
- return _rewriteThis.default;
- }
-});
-exports.wrapInterop = wrapInterop;
-var _assert = require("assert");
-var _core = require("@babel/core");
-var _helperModuleImports = require("@babel/helper-module-imports");
-var _rewriteThis = require("./rewrite-this.js");
-var _rewriteLiveReferences = require("./rewrite-live-references.js");
-var _normalizeAndLoadMetadata = require("./normalize-and-load-metadata.js");
-var Lazy = require("./lazy-modules.js");
-var _dynamicImport = require("./dynamic-import.js");
-var _getModuleName = require("./get-module-name.js");
-{
- exports.getDynamicImportSource = require("./dynamic-import").getDynamicImportSource;
-}
-function rewriteModuleStatementsAndPrepareHeader(path, {
- exportName,
- strict,
- allowTopLevelThis,
- strictMode,
- noInterop,
- importInterop = noInterop ? "none" : "babel",
- lazy,
- getWrapperPayload = Lazy.toGetWrapperPayload(lazy != null ? lazy : false),
- wrapReference = Lazy.wrapReference,
- esNamespaceOnly,
- filename,
- constantReexports = arguments[1].loose,
- enumerableModuleMeta = arguments[1].loose,
- noIncompleteNsImportDetection
-}) {
- (0, _normalizeAndLoadMetadata.validateImportInteropOption)(importInterop);
- _assert((0, _helperModuleImports.isModule)(path), "Cannot process module statements in a script");
- path.node.sourceType = "script";
- const meta = (0, _normalizeAndLoadMetadata.default)(path, exportName, {
- importInterop,
- initializeReexports: constantReexports,
- getWrapperPayload,
- esNamespaceOnly,
- filename
- });
- if (!allowTopLevelThis) {
- (0, _rewriteThis.default)(path);
- }
- (0, _rewriteLiveReferences.default)(path, meta, wrapReference);
- if (strictMode !== false) {
- const hasStrict = path.node.directives.some(directive => {
- return directive.value.value === "use strict";
- });
- if (!hasStrict) {
- path.unshiftContainer("directives", _core.types.directive(_core.types.directiveLiteral("use strict")));
- }
- }
- const headers = [];
- if ((0, _normalizeAndLoadMetadata.hasExports)(meta) && !strict) {
- headers.push(buildESModuleHeader(meta, enumerableModuleMeta));
- }
- const nameList = buildExportNameListDeclaration(path, meta);
- if (nameList) {
- meta.exportNameListName = nameList.name;
- headers.push(nameList.statement);
- }
- headers.push(...buildExportInitializationStatements(path, meta, wrapReference, constantReexports, noIncompleteNsImportDetection));
- return {
- meta,
- headers
- };
-}
-function ensureStatementsHoisted(statements) {
- statements.forEach(header => {
- header._blockHoist = 3;
- });
-}
-function wrapInterop(programPath, expr, type) {
- if (type === "none") {
- return null;
- }
- if (type === "node-namespace") {
- return _core.types.callExpression(programPath.hub.addHelper("interopRequireWildcard"), [expr, _core.types.booleanLiteral(true)]);
- } else if (type === "node-default") {
- return null;
- }
- let helper;
- if (type === "default") {
- helper = "interopRequireDefault";
- } else if (type === "namespace") {
- helper = "interopRequireWildcard";
- } else {
- throw new Error(`Unknown interop: ${type}`);
- }
- return _core.types.callExpression(programPath.hub.addHelper(helper), [expr]);
-}
-function buildNamespaceInitStatements(metadata, sourceMetadata, constantReexports = false, wrapReference = Lazy.wrapReference) {
- var _wrapReference;
- const statements = [];
- const srcNamespaceId = _core.types.identifier(sourceMetadata.name);
- for (const localName of sourceMetadata.importsNamespace) {
- if (localName === sourceMetadata.name) continue;
- statements.push(_core.template.statement`var NAME = SOURCE;`({
- NAME: localName,
- SOURCE: _core.types.cloneNode(srcNamespaceId)
- }));
- }
- const srcNamespace = (_wrapReference = wrapReference(srcNamespaceId, sourceMetadata.wrap)) != null ? _wrapReference : srcNamespaceId;
- if (constantReexports) {
- statements.push(...buildReexportsFromMeta(metadata, sourceMetadata, true, wrapReference));
- }
- for (const exportName of sourceMetadata.reexportNamespace) {
- statements.push((!_core.types.isIdentifier(srcNamespace) ? _core.template.statement`
- Object.defineProperty(EXPORTS, "NAME", {
- enumerable: true,
- get: function() {
- return NAMESPACE;
- }
- });
- ` : _core.template.statement`EXPORTS.NAME = NAMESPACE;`)({
- EXPORTS: metadata.exportName,
- NAME: exportName,
- NAMESPACE: _core.types.cloneNode(srcNamespace)
- }));
- }
- if (sourceMetadata.reexportAll) {
- const statement = buildNamespaceReexport(metadata, _core.types.cloneNode(srcNamespace), constantReexports);
- statement.loc = sourceMetadata.reexportAll.loc;
- statements.push(statement);
- }
- return statements;
-}
-const ReexportTemplate = {
- constant: ({
- exports,
- exportName,
- namespaceImport
- }) => _core.template.statement.ast`
- ${exports}.${exportName} = ${namespaceImport};
- `,
- constantComputed: ({
- exports,
- exportName,
- namespaceImport
- }) => _core.template.statement.ast`
- ${exports}["${exportName}"] = ${namespaceImport};
- `,
- spec: ({
- exports,
- exportName,
- namespaceImport
- }) => _core.template.statement.ast`
- Object.defineProperty(${exports}, "${exportName}", {
- enumerable: true,
- get: function() {
- return ${namespaceImport};
- },
- });
- `
-};
-function buildReexportsFromMeta(meta, metadata, constantReexports, wrapReference) {
- var _wrapReference2;
- let namespace = _core.types.identifier(metadata.name);
- namespace = (_wrapReference2 = wrapReference(namespace, metadata.wrap)) != null ? _wrapReference2 : namespace;
- const {
- stringSpecifiers
- } = meta;
- return Array.from(metadata.reexports, ([exportName, importName]) => {
- let namespaceImport = _core.types.cloneNode(namespace);
- if (importName === "default" && metadata.interop === "node-default") {} else if (stringSpecifiers.has(importName)) {
- namespaceImport = _core.types.memberExpression(namespaceImport, _core.types.stringLiteral(importName), true);
- } else {
- namespaceImport = _core.types.memberExpression(namespaceImport, _core.types.identifier(importName));
- }
- const astNodes = {
- exports: meta.exportName,
- exportName,
- namespaceImport
- };
- if (constantReexports || _core.types.isIdentifier(namespaceImport)) {
- if (stringSpecifiers.has(exportName)) {
- return ReexportTemplate.constantComputed(astNodes);
- } else {
- return ReexportTemplate.constant(astNodes);
- }
- } else {
- return ReexportTemplate.spec(astNodes);
- }
- });
-}
-function buildESModuleHeader(metadata, enumerableModuleMeta = false) {
- return (enumerableModuleMeta ? _core.template.statement`
- EXPORTS.__esModule = true;
- ` : _core.template.statement`
- Object.defineProperty(EXPORTS, "__esModule", {
- value: true,
- });
- `)({
- EXPORTS: metadata.exportName
- });
-}
-function buildNamespaceReexport(metadata, namespace, constantReexports) {
- return (constantReexports ? _core.template.statement`
- Object.keys(NAMESPACE).forEach(function(key) {
- if (key === "default" || key === "__esModule") return;
- VERIFY_NAME_LIST;
- if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;
-
- EXPORTS[key] = NAMESPACE[key];
- });
- ` : _core.template.statement`
- Object.keys(NAMESPACE).forEach(function(key) {
- if (key === "default" || key === "__esModule") return;
- VERIFY_NAME_LIST;
- if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;
-
- Object.defineProperty(EXPORTS, key, {
- enumerable: true,
- get: function() {
- return NAMESPACE[key];
- },
- });
- });
- `)({
- NAMESPACE: namespace,
- EXPORTS: metadata.exportName,
- VERIFY_NAME_LIST: metadata.exportNameListName ? (0, _core.template)`
- if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;
- `({
- EXPORTS_LIST: metadata.exportNameListName
- }) : null
- });
-}
-function buildExportNameListDeclaration(programPath, metadata) {
- const exportedVars = Object.create(null);
- for (const data of metadata.local.values()) {
- for (const name of data.names) {
- exportedVars[name] = true;
- }
- }
- let hasReexport = false;
- for (const data of metadata.source.values()) {
- for (const exportName of data.reexports.keys()) {
- exportedVars[exportName] = true;
- }
- for (const exportName of data.reexportNamespace) {
- exportedVars[exportName] = true;
- }
- hasReexport = hasReexport || !!data.reexportAll;
- }
- if (!hasReexport || Object.keys(exportedVars).length === 0) return null;
- const name = programPath.scope.generateUidIdentifier("exportNames");
- delete exportedVars.default;
- return {
- name: name.name,
- statement: _core.types.variableDeclaration("var", [_core.types.variableDeclarator(name, _core.types.valueToNode(exportedVars))])
- };
-}
-function buildExportInitializationStatements(programPath, metadata, wrapReference, constantReexports = false, noIncompleteNsImportDetection = false) {
- const initStatements = [];
- for (const [localName, data] of metadata.local) {
- if (data.kind === "import") {} else if (data.kind === "hoisted") {
- initStatements.push([data.names[0], buildInitStatement(metadata, data.names, _core.types.identifier(localName))]);
- } else if (!noIncompleteNsImportDetection) {
- for (const exportName of data.names) {
- initStatements.push([exportName, null]);
- }
- }
- }
- for (const data of metadata.source.values()) {
- if (!constantReexports) {
- const reexportsStatements = buildReexportsFromMeta(metadata, data, false, wrapReference);
- const reexports = [...data.reexports.keys()];
- for (let i = 0; i < reexportsStatements.length; i++) {
- initStatements.push([reexports[i], reexportsStatements[i]]);
- }
- }
- if (!noIncompleteNsImportDetection) {
- for (const exportName of data.reexportNamespace) {
- initStatements.push([exportName, null]);
- }
- }
- }
- initStatements.sort(([a], [b]) => {
- if (a < b) return -1;
- if (b < a) return 1;
- return 0;
- });
- const results = [];
- if (noIncompleteNsImportDetection) {
- for (const [, initStatement] of initStatements) {
- results.push(initStatement);
- }
- } else {
- const chunkSize = 100;
- for (let i = 0; i < initStatements.length; i += chunkSize) {
- let uninitializedExportNames = [];
- for (let j = 0; j < chunkSize && i + j < initStatements.length; j++) {
- const [exportName, initStatement] = initStatements[i + j];
- if (initStatement !== null) {
- if (uninitializedExportNames.length > 0) {
- results.push(buildInitStatement(metadata, uninitializedExportNames, programPath.scope.buildUndefinedNode()));
- uninitializedExportNames = [];
- }
- results.push(initStatement);
- } else {
- uninitializedExportNames.push(exportName);
- }
- }
- if (uninitializedExportNames.length > 0) {
- results.push(buildInitStatement(metadata, uninitializedExportNames, programPath.scope.buildUndefinedNode()));
- }
- }
- }
- return results;
-}
-const InitTemplate = {
- computed: ({
- exports,
- name,
- value
- }) => _core.template.expression.ast`${exports}["${name}"] = ${value}`,
- default: ({
- exports,
- name,
- value
- }) => _core.template.expression.ast`${exports}.${name} = ${value}`,
- define: ({
- exports,
- name,
- value
- }) => _core.template.expression.ast`
- Object.defineProperty(${exports}, "${name}", {
- enumerable: true,
- value: void 0,
- writable: true
- })["${name}"] = ${value}`
-};
-function buildInitStatement(metadata, exportNames, initExpr) {
- const {
- stringSpecifiers,
- exportName: exports
- } = metadata;
- return _core.types.expressionStatement(exportNames.reduce((value, name) => {
- const params = {
- exports,
- name,
- value
- };
- if (name === "__proto__") {
- return InitTemplate.define(params);
- }
- if (stringSpecifiers.has(name)) {
- return InitTemplate.computed(params);
- }
- return InitTemplate.default(params);
- }, initExpr));
-}
-
-//# sourceMappingURL=index.js.map
diff --git a/node_modules/@babel/helper-module-transforms/lib/index.js.map b/node_modules/@babel/helper-module-transforms/lib/index.js.map
deleted file mode 100644
index ff4c6a61..00000000
--- a/node_modules/@babel/helper-module-transforms/lib/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"names":["_assert","require","_core","_helperModuleImports","_rewriteThis","_rewriteLiveReferences","_normalizeAndLoadMetadata","Lazy","_dynamicImport","_getModuleName","exports","getDynamicImportSource","rewriteModuleStatementsAndPrepareHeader","path","exportName","strict","allowTopLevelThis","strictMode","noInterop","importInterop","lazy","getWrapperPayload","toGetWrapperPayload","wrapReference","esNamespaceOnly","filename","constantReexports","arguments","loose","enumerableModuleMeta","noIncompleteNsImportDetection","validateImportInteropOption","assert","isModule","node","sourceType","meta","normalizeModuleAndLoadMetadata","initializeReexports","rewriteThis","rewriteLiveReferences","hasStrict","directives","some","directive","value","unshiftContainer","t","directiveLiteral","headers","hasExports","push","buildESModuleHeader","nameList","buildExportNameListDeclaration","exportNameListName","name","statement","buildExportInitializationStatements","ensureStatementsHoisted","statements","forEach","header","_blockHoist","wrapInterop","programPath","expr","type","callExpression","hub","addHelper","booleanLiteral","helper","Error","buildNamespaceInitStatements","metadata","sourceMetadata","_wrapReference","srcNamespaceId","identifier","localName","importsNamespace","template","NAME","SOURCE","cloneNode","srcNamespace","wrap","buildReexportsFromMeta","reexportNamespace","isIdentifier","EXPORTS","NAMESPACE","reexportAll","buildNamespaceReexport","loc","ReexportTemplate","constant","namespaceImport","ast","constantComputed","spec","_wrapReference2","namespace","stringSpecifiers","Array","from","reexports","importName","interop","has","memberExpression","stringLiteral","astNodes","VERIFY_NAME_LIST","EXPORTS_LIST","exportedVars","Object","create","data","local","values","names","hasReexport","source","keys","length","scope","generateUidIdentifier","default","variableDeclaration","variableDeclarator","valueToNode","initStatements","kind","buildInitStatement","reexportsStatements","i","sort","a","b","results","initStatement","chunkSize","uninitializedExportNames","j","buildUndefinedNode","InitTemplate","computed","expression","define","exportNames","initExpr","expressionStatement","reduce","params"],"sources":["../src/index.ts"],"sourcesContent":["import assert from \"assert\";\nimport { template, types as t } from \"@babel/core\";\n\nimport { isModule } from \"@babel/helper-module-imports\";\n\nimport rewriteThis from \"./rewrite-this.ts\";\nimport rewriteLiveReferences from \"./rewrite-live-references.ts\";\nimport normalizeModuleAndLoadMetadata, {\n hasExports,\n isSideEffectImport,\n validateImportInteropOption,\n} from \"./normalize-and-load-metadata.ts\";\nimport type {\n ImportInterop,\n InteropType,\n ModuleMetadata,\n SourceModuleMetadata,\n} from \"./normalize-and-load-metadata.ts\";\nimport * as Lazy from \"./lazy-modules.ts\";\nimport type { NodePath } from \"@babel/core\";\n\nexport { buildDynamicImport } from \"./dynamic-import.ts\";\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // eslint-disable-next-line no-restricted-globals\n exports.getDynamicImportSource =\n // eslint-disable-next-line no-restricted-globals, import/extensions\n require(\"./dynamic-import\").getDynamicImportSource;\n}\n\nexport { default as getModuleName } from \"./get-module-name.ts\";\nexport type { PluginOptions } from \"./get-module-name.ts\";\n\nexport { hasExports, isSideEffectImport, isModule, rewriteThis };\n\nexport interface RewriteModuleStatementsAndPrepareHeaderOptions {\n exportName?: string;\n strict: boolean;\n allowTopLevelThis?: boolean;\n strictMode: boolean;\n loose?: boolean;\n importInterop?: ImportInterop;\n noInterop?: boolean;\n lazy?: Lazy.Lazy;\n getWrapperPayload?: (\n source: string,\n metadata: SourceModuleMetadata,\n importNodes: t.Node[],\n ) => unknown;\n wrapReference?: (ref: t.Expression, payload: unknown) => t.Expression | null;\n esNamespaceOnly?: boolean;\n filename: string | undefined;\n constantReexports?: boolean | void;\n enumerableModuleMeta?: boolean | void;\n noIncompleteNsImportDetection?: boolean | void;\n}\n\n/**\n * Perform all of the generic ES6 module rewriting needed to handle initial\n * module processing. This function will rewrite the majority of the given\n * program to reference the modules described by the returned metadata,\n * and returns a list of statements for use when initializing the module.\n */\nexport function rewriteModuleStatementsAndPrepareHeader(\n path: NodePath<t.Program>,\n {\n exportName,\n strict,\n allowTopLevelThis,\n strictMode,\n noInterop,\n importInterop = noInterop ? \"none\" : \"babel\",\n // TODO(Babel 8): After that `lazy` implementation is moved to the CJS\n // transform, remove this parameter.\n lazy,\n getWrapperPayload = Lazy.toGetWrapperPayload(lazy ?? false),\n wrapReference = Lazy.wrapReference,\n esNamespaceOnly,\n filename,\n\n constantReexports = process.env.BABEL_8_BREAKING\n ? undefined\n : arguments[1].loose,\n enumerableModuleMeta = process.env.BABEL_8_BREAKING\n ? undefined\n : arguments[1].loose,\n noIncompleteNsImportDetection,\n }: RewriteModuleStatementsAndPrepareHeaderOptions,\n) {\n validateImportInteropOption(importInterop);\n assert(isModule(path), \"Cannot process module statements in a script\");\n path.node.sourceType = \"script\";\n\n const meta = normalizeModuleAndLoadMetadata(path, exportName, {\n importInterop,\n initializeReexports: constantReexports,\n getWrapperPayload,\n esNamespaceOnly,\n filename,\n });\n\n if (!allowTopLevelThis) {\n rewriteThis(path);\n }\n\n rewriteLiveReferences(path, meta, wrapReference);\n\n if (strictMode !== false) {\n const hasStrict = path.node.directives.some(directive => {\n return directive.value.value === \"use strict\";\n });\n if (!hasStrict) {\n path.unshiftContainer(\n \"directives\",\n t.directive(t.directiveLiteral(\"use strict\")),\n );\n }\n }\n\n const headers = [];\n if (hasExports(meta) && !strict) {\n headers.push(buildESModuleHeader(meta, enumerableModuleMeta));\n }\n\n const nameList = buildExportNameListDeclaration(path, meta);\n\n if (nameList) {\n meta.exportNameListName = nameList.name;\n headers.push(nameList.statement);\n }\n\n // Create all of the statically known named exports.\n headers.push(\n ...buildExportInitializationStatements(\n path,\n meta,\n wrapReference,\n constantReexports,\n noIncompleteNsImportDetection,\n ),\n );\n\n return { meta, headers };\n}\n\n/**\n * Flag a set of statements as hoisted above all else so that module init\n * statements all run before user code.\n */\nexport function ensureStatementsHoisted(statements: t.Statement[]) {\n // Force all of the header fields to be at the top of the file.\n statements.forEach(header => {\n // @ts-expect-error Fixme: handle _blockHoist property\n header._blockHoist = 3;\n });\n}\n\n/**\n * Given an expression for a standard import object, like \"require('foo')\",\n * wrap it in a call to the interop helpers based on the type.\n */\nexport function wrapInterop(\n programPath: NodePath<t.Program>,\n expr: t.Expression,\n type: InteropType,\n): t.CallExpression {\n if (type === \"none\") {\n return null;\n }\n\n if (type === \"node-namespace\") {\n return t.callExpression(\n programPath.hub.addHelper(\"interopRequireWildcard\"),\n [expr, t.booleanLiteral(true)],\n );\n } else if (type === \"node-default\") {\n return null;\n }\n\n let helper;\n if (type === \"default\") {\n helper = \"interopRequireDefault\";\n } else if (type === \"namespace\") {\n helper = \"interopRequireWildcard\";\n } else {\n throw new Error(`Unknown interop: ${type}`);\n }\n\n return t.callExpression(programPath.hub.addHelper(helper), [expr]);\n}\n\n/**\n * Create the runtime initialization statements for a given requested source.\n * These will initialize all of the runtime import/export logic that\n * can't be handled statically by the statements created by\n * buildExportInitializationStatements().\n */\nexport function buildNamespaceInitStatements(\n metadata: ModuleMetadata,\n sourceMetadata: SourceModuleMetadata,\n constantReexports: boolean | void = false,\n wrapReference: (\n ref: t.Identifier,\n payload: unknown,\n ) => t.Expression | null = Lazy.wrapReference,\n) {\n const statements = [];\n\n const srcNamespaceId = t.identifier(sourceMetadata.name);\n\n for (const localName of sourceMetadata.importsNamespace) {\n if (localName === sourceMetadata.name) continue;\n\n // Create and assign binding to namespace object\n statements.push(\n template.statement`var NAME = SOURCE;`({\n NAME: localName,\n SOURCE: t.cloneNode(srcNamespaceId),\n }),\n );\n }\n\n const srcNamespace =\n wrapReference(srcNamespaceId, sourceMetadata.wrap) ?? srcNamespaceId;\n\n if (constantReexports) {\n statements.push(\n ...buildReexportsFromMeta(metadata, sourceMetadata, true, wrapReference),\n );\n }\n for (const exportName of sourceMetadata.reexportNamespace) {\n // Assign export to namespace object.\n statements.push(\n (!t.isIdentifier(srcNamespace)\n ? template.statement`\n Object.defineProperty(EXPORTS, \"NAME\", {\n enumerable: true,\n get: function() {\n return NAMESPACE;\n }\n });\n `\n : template.statement`EXPORTS.NAME = NAMESPACE;`)({\n EXPORTS: metadata.exportName,\n NAME: exportName,\n NAMESPACE: t.cloneNode(srcNamespace),\n }),\n );\n }\n if (sourceMetadata.reexportAll) {\n const statement = buildNamespaceReexport(\n metadata,\n t.cloneNode(srcNamespace),\n constantReexports,\n );\n statement.loc = sourceMetadata.reexportAll.loc;\n\n // Iterate props creating getter for each prop.\n statements.push(statement);\n }\n return statements;\n}\n\ninterface ReexportParts {\n exports: string;\n exportName: string;\n namespaceImport: t.Expression;\n}\n\nconst ReexportTemplate = {\n constant: ({ exports, exportName, namespaceImport }: ReexportParts) =>\n template.statement.ast`\n ${exports}.${exportName} = ${namespaceImport};\n `,\n constantComputed: ({ exports, exportName, namespaceImport }: ReexportParts) =>\n template.statement.ast`\n ${exports}[\"${exportName}\"] = ${namespaceImport};\n `,\n spec: ({ exports, exportName, namespaceImport }: ReexportParts) =>\n template.statement.ast`\n Object.defineProperty(${exports}, \"${exportName}\", {\n enumerable: true,\n get: function() {\n return ${namespaceImport};\n },\n });\n `,\n};\n\nfunction buildReexportsFromMeta(\n meta: ModuleMetadata,\n metadata: SourceModuleMetadata,\n constantReexports: boolean,\n wrapReference: (ref: t.Expression, payload: unknown) => t.Expression | null,\n): t.Statement[] {\n let namespace: t.Expression = t.identifier(metadata.name);\n namespace = wrapReference(namespace, metadata.wrap) ?? namespace;\n\n const { stringSpecifiers } = meta;\n return Array.from(metadata.reexports, ([exportName, importName]) => {\n let namespaceImport: t.Expression = t.cloneNode(namespace);\n if (importName === \"default\" && metadata.interop === \"node-default\") {\n // Nothing, it's ok as-is\n } else if (stringSpecifiers.has(importName)) {\n namespaceImport = t.memberExpression(\n namespaceImport,\n t.stringLiteral(importName),\n true,\n );\n } else {\n namespaceImport = t.memberExpression(\n namespaceImport,\n t.identifier(importName),\n );\n }\n const astNodes: ReexportParts = {\n exports: meta.exportName,\n exportName,\n namespaceImport,\n };\n if (constantReexports || t.isIdentifier(namespaceImport)) {\n if (stringSpecifiers.has(exportName)) {\n return ReexportTemplate.constantComputed(astNodes);\n } else {\n return ReexportTemplate.constant(astNodes);\n }\n } else {\n return ReexportTemplate.spec(astNodes);\n }\n });\n}\n\n/**\n * Build an \"__esModule\" header statement setting the property on a given object.\n */\nfunction buildESModuleHeader(\n metadata: ModuleMetadata,\n enumerableModuleMeta: boolean | void = false,\n) {\n return (\n enumerableModuleMeta\n ? template.statement`\n EXPORTS.__esModule = true;\n `\n : template.statement`\n Object.defineProperty(EXPORTS, \"__esModule\", {\n value: true,\n });\n `\n )({ EXPORTS: metadata.exportName });\n}\n\n/**\n * Create a re-export initialization loop for a specific imported namespace.\n */\nfunction buildNamespaceReexport(\n metadata: ModuleMetadata,\n namespace: t.Expression,\n constantReexports: boolean | void,\n) {\n return (\n constantReexports\n ? template.statement`\n Object.keys(NAMESPACE).forEach(function(key) {\n if (key === \"default\" || key === \"__esModule\") return;\n VERIFY_NAME_LIST;\n if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;\n\n EXPORTS[key] = NAMESPACE[key];\n });\n `\n : // Also skip already assigned bindings if they are strictly equal\n // to be somewhat more spec-compliant when a file has multiple\n // namespace re-exports that would cause a binding to be exported\n // multiple times. However, multiple bindings of the same name that\n // export the same primitive value are silently skipped\n // (the spec requires an \"ambiguous bindings\" early error here).\n template.statement`\n Object.keys(NAMESPACE).forEach(function(key) {\n if (key === \"default\" || key === \"__esModule\") return;\n VERIFY_NAME_LIST;\n if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;\n\n Object.defineProperty(EXPORTS, key, {\n enumerable: true,\n get: function() {\n return NAMESPACE[key];\n },\n });\n });\n `\n )({\n NAMESPACE: namespace,\n EXPORTS: metadata.exportName,\n VERIFY_NAME_LIST: metadata.exportNameListName\n ? template`\n if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;\n `({ EXPORTS_LIST: metadata.exportNameListName })\n : null,\n });\n}\n\n/**\n * Build a statement declaring a variable that contains all of the exported\n * variable names in an object so they can easily be referenced from an\n * export * from statement to check for conflicts.\n */\nfunction buildExportNameListDeclaration(\n programPath: NodePath,\n metadata: ModuleMetadata,\n) {\n const exportedVars = Object.create(null);\n for (const data of metadata.local.values()) {\n for (const name of data.names) {\n exportedVars[name] = true;\n }\n }\n\n let hasReexport = false;\n for (const data of metadata.source.values()) {\n for (const exportName of data.reexports.keys()) {\n exportedVars[exportName] = true;\n }\n for (const exportName of data.reexportNamespace) {\n exportedVars[exportName] = true;\n }\n\n hasReexport = hasReexport || !!data.reexportAll;\n }\n\n if (!hasReexport || Object.keys(exportedVars).length === 0) return null;\n\n const name = programPath.scope.generateUidIdentifier(\"exportNames\");\n\n delete exportedVars.default;\n\n return {\n name: name.name,\n statement: t.variableDeclaration(\"var\", [\n t.variableDeclarator(name, t.valueToNode(exportedVars)),\n ]),\n };\n}\n\n/**\n * Create a set of statements that will initialize all of the statically-known\n * export names with their expected values.\n */\nfunction buildExportInitializationStatements(\n programPath: NodePath,\n metadata: ModuleMetadata,\n wrapReference: (ref: t.Expression, payload: unknown) => t.Expression | null,\n constantReexports: boolean | void = false,\n noIncompleteNsImportDetection: boolean | void = false,\n) {\n const initStatements: Array<[string, t.Statement | null]> = [];\n\n for (const [localName, data] of metadata.local) {\n if (data.kind === \"import\") {\n // No-open since these are explicitly set with the \"reexports\" block.\n } else if (data.kind === \"hoisted\") {\n initStatements.push([\n // data.names is always of length 1 because a hoisted export\n // name must be id of a function declaration\n data.names[0],\n buildInitStatement(metadata, data.names, t.identifier(localName)),\n ]);\n } else if (!noIncompleteNsImportDetection) {\n for (const exportName of data.names) {\n initStatements.push([exportName, null]);\n }\n }\n }\n\n for (const data of metadata.source.values()) {\n if (!constantReexports) {\n const reexportsStatements = buildReexportsFromMeta(\n metadata,\n data,\n false,\n wrapReference,\n );\n const reexports = [...data.reexports.keys()];\n for (let i = 0; i < reexportsStatements.length; i++) {\n initStatements.push([reexports[i], reexportsStatements[i]]);\n }\n }\n if (!noIncompleteNsImportDetection) {\n for (const exportName of data.reexportNamespace) {\n initStatements.push([exportName, null]);\n }\n }\n }\n\n // https://tc39.es/ecma262/#sec-module-namespace-exotic-objects\n // The [Exports] list is ordered as if an Array of those String values\n // had been sorted using %Array.prototype.sort% using undefined as comparefn\n initStatements.sort(([a], [b]) => {\n if (a < b) return -1;\n if (b < a) return 1;\n return 0;\n });\n\n const results = [];\n if (noIncompleteNsImportDetection) {\n for (const [, initStatement] of initStatements) {\n results.push(initStatement);\n }\n } else {\n // We generate init statements (`exports.a = exports.b = ... = void 0`)\n // for every 100 exported names to avoid deeply-nested AST structures.\n const chunkSize = 100;\n for (let i = 0; i < initStatements.length; i += chunkSize) {\n let uninitializedExportNames = [];\n for (let j = 0; j < chunkSize && i + j < initStatements.length; j++) {\n const [exportName, initStatement] = initStatements[i + j];\n if (initStatement !== null) {\n if (uninitializedExportNames.length > 0) {\n results.push(\n buildInitStatement(\n metadata,\n uninitializedExportNames,\n programPath.scope.buildUndefinedNode(),\n ),\n );\n // reset after uninitializedExportNames has been transformed\n // to init statements\n uninitializedExportNames = [];\n }\n results.push(initStatement);\n } else {\n uninitializedExportNames.push(exportName);\n }\n }\n if (uninitializedExportNames.length > 0) {\n results.push(\n buildInitStatement(\n metadata,\n uninitializedExportNames,\n programPath.scope.buildUndefinedNode(),\n ),\n );\n }\n }\n }\n\n return results;\n}\n\ninterface InitParts {\n exports: string;\n name: string;\n value: t.Expression;\n}\n\n/**\n * Given a set of export names, create a set of nested assignments to\n * initialize them all to a given expression.\n */\nconst InitTemplate = {\n computed: ({ exports, name, value }: InitParts) =>\n template.expression.ast`${exports}[\"${name}\"] = ${value}`,\n default: ({ exports, name, value }: InitParts) =>\n template.expression.ast`${exports}.${name} = ${value}`,\n define: ({ exports, name, value }: InitParts) =>\n template.expression.ast`\n Object.defineProperty(${exports}, \"${name}\", {\n enumerable: true,\n value: void 0,\n writable: true\n })[\"${name}\"] = ${value}`,\n};\n\nfunction buildInitStatement(\n metadata: ModuleMetadata,\n exportNames: string[],\n initExpr: t.Expression,\n) {\n const { stringSpecifiers, exportName: exports } = metadata;\n return t.expressionStatement(\n exportNames.reduce((value, name) => {\n const params = {\n exports,\n name,\n value,\n };\n\n if (name === \"__proto__\") {\n return InitTemplate.define(params);\n }\n\n if (stringSpecifiers.has(name)) {\n return InitTemplate.computed(params);\n }\n\n return InitTemplate.default(params);\n }, initExpr),\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,oBAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,yBAAA,GAAAL,OAAA;AAWA,IAAAM,IAAA,GAAAN,OAAA;AAGA,IAAAO,cAAA,GAAAP,OAAA;AASA,IAAAQ,cAAA,GAAAR,OAAA;AAPiE;EAE/DS,OAAO,CAACC,sBAAsB,GAE5BV,OAAO,CAAC,kBAAkB,CAAC,CAACU,sBAAsB;AACtD;AAmCO,SAASC,uCAAuCA,CACrDC,IAA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AEA,IAAInD,gBAAgB,CAACM,GAAG,CAACtD,IAAI,CAAC,EAAE;MAC9B,OAAO2F,YAAY,CAACC,QAAQ,CAACO,MAAM,CAAC;IACtC;IAEA,OAAOR,YAAY,CAAClB,OAAO,CAAC0B,MAAM,CAAC;EACrC,CAAC,EAAEH,QAAQ,CACb,CAAC;AACH","ignoreList":[]} \ No newline at end of file
diff --git a/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js b/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js
deleted file mode 100644
index acc89fff..00000000
--- a/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js
+++ /dev/null
@@ -1,31 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.toGetWrapperPayload = toGetWrapperPayload;
-exports.wrapReference = wrapReference;
-var _core = require("@babel/core");
-var _normalizeAndLoadMetadata = require("./normalize-and-load-metadata.js");
-function toGetWrapperPayload(lazy) {
- return (source, metadata) => {
- if (lazy === false) return null;
- if ((0, _normalizeAndLoadMetadata.isSideEffectImport)(metadata) || metadata.reexportAll) return null;
- if (lazy === true) {
- return source.includes(".") ? null : "lazy";
- }
- if (Array.isArray(lazy)) {
- return !lazy.includes(source) ? null : "lazy";
- }
- if (typeof lazy === "function") {
- return lazy(source) ? "lazy" : null;
- }
- throw new Error(`.lazy must be a boolean, string array, or function`);
- };
-}
-function wrapReference(ref, payload) {
- if (payload === "lazy") return _core.types.callExpression(ref, []);
- return null;
-}
-
-//# sourceMappingURL=lazy-modules.js.map
diff --git a/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js.map b/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js.map
deleted file mode 100644
index 890839bc..00000000
--- a/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"names":["_core","require","_normalizeAndLoadMetadata","toGetWrapperPayload","lazy","source","metadata","isSideEffectImport","reexportAll","includes","Array","isArray","Error","wrapReference","ref","payload","t","callExpression"],"sources":["../src/lazy-modules.ts"],"sourcesContent":["// TODO: Move `lazy` implementation logic into the CommonJS plugin, since other\n// modules systems do not support `lazy`.\n\nimport { types as t } from \"@babel/core\";\nimport {\n type SourceModuleMetadata,\n isSideEffectImport,\n} from \"./normalize-and-load-metadata.ts\";\n\nexport type Lazy = boolean | string[] | ((source: string) => boolean);\n\nexport function toGetWrapperPayload(lazy: Lazy) {\n return (source: string, metadata: SourceModuleMetadata): null | \"lazy\" => {\n if (lazy === false) return null;\n if (isSideEffectImport(metadata) || metadata.reexportAll) return null;\n if (lazy === true) {\n // 'true' means that local relative files are eagerly loaded and\n // dependency modules are loaded lazily.\n return source.includes(\".\") ? null : \"lazy\";\n }\n if (Array.isArray(lazy)) {\n return !lazy.includes(source) ? null : \"lazy\";\n }\n if (typeof lazy === \"function\") {\n return lazy(source) ? \"lazy\" : null;\n }\n throw new Error(`.lazy must be a boolean, string array, or function`);\n };\n}\n\nexport function wrapReference(\n ref: t.Identifier,\n payload: unknown,\n): t.Expression | null {\n if (payload === \"lazy\") return t.callExpression(ref, []);\n return null;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,yBAAA,GAAAD,OAAA;AAOO,SAASE,mBAAmBA,CAACC,IAAU,EAAE;EAC9C,OAAO,CAACC,MAAc,EAAEC,QAA8B,KAAoB;IACxE,IAAIF,IAAI,KAAK,KAAK,EAAE,OAAO,IAAI;IAC/B,IAAI,IAAAG,4CAAkB,EAACD,QAAQ,CAAC,IAAIA,QAAQ,CAACE,WAAW,EAAE,OAAO,IAAI;IACrE,IAAIJ,IAAI,KAAK,IAAI,EAAE;MAGjB,OAAOC,MAAM,CAACI,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,MAAM;IAC7C;IACA,IAAIC,KAAK,CAACC,OAAO,CAACP,IAAI,CAAC,EAAE;MACvB,OAAO,CAACA,IAAI,CAACK,QAAQ,CAACJ,MAAM,CAAC,GAAG,IAAI,GAAG,MAAM;IAC/C;IACA,IAAI,OAAOD,IAAI,KAAK,UAAU,EAAE;MAC9B,OAAOA,IAAI,CAACC,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI;IACrC;IACA,MAAM,IAAIO,KAAK,CAAC,oDAAoD,CAAC;EACvE,CAAC;AACH;AAEO,SAASC,aAAaA,CAC3BC,GAAiB,EACjBC,OAAgB,EACK;EACrB,IAAIA,OAAO,KAAK,MAAM,EAAE,OAAOC,WAAC,CAACC,cAAc,CAACH,GAAG,EAAE,EAAE,CAAC;EACxD,OAAO,IAAI;AACb","ignoreList":[]} \ No newline at end of file
diff --git a/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js b/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js
deleted file mode 100644
index 00b0a531..00000000
--- a/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js
+++ /dev/null
@@ -1,361 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = normalizeModuleAndLoadMetadata;
-exports.hasExports = hasExports;
-exports.isSideEffectImport = isSideEffectImport;
-exports.validateImportInteropOption = validateImportInteropOption;
-var _path = require("path");
-var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
-function hasExports(metadata) {
- return metadata.hasExports;
-}
-function isSideEffectImport(source) {
- return source.imports.size === 0 && source.importsNamespace.size === 0 && source.reexports.size === 0 && source.reexportNamespace.size === 0 && !source.reexportAll;
-}
-function validateImportInteropOption(importInterop) {
- if (typeof importInterop !== "function" && importInterop !== "none" && importInterop !== "babel" && importInterop !== "node") {
- throw new Error(`.importInterop must be one of "none", "babel", "node", or a function returning one of those values (received ${importInterop}).`);
- }
- return importInterop;
-}
-function resolveImportInterop(importInterop, source, filename) {
- if (typeof importInterop === "function") {
- return validateImportInteropOption(importInterop(source, filename));
- }
- return importInterop;
-}
-function normalizeModuleAndLoadMetadata(programPath, exportName, {
- importInterop,
- initializeReexports = false,
- getWrapperPayload,
- esNamespaceOnly = false,
- filename
-}) {
- if (!exportName) {
- exportName = programPath.scope.generateUidIdentifier("exports").name;
- }
- const stringSpecifiers = new Set();
- nameAnonymousExports(programPath);
- const {
- local,
- sources,
- hasExports
- } = getModuleMetadata(programPath, {
- initializeReexports,
- getWrapperPayload
- }, stringSpecifiers);
- removeImportExportDeclarations(programPath);
- for (const [source, metadata] of sources) {
- const {
- importsNamespace,
- imports
- } = metadata;
- if (importsNamespace.size > 0 && imports.size === 0) {
- const [nameOfnamespace] = importsNamespace;
- metadata.name = nameOfnamespace;
- }
- const resolvedInterop = resolveImportInterop(importInterop, source, filename);
- if (resolvedInterop === "none") {
- metadata.interop = "none";
- } else if (resolvedInterop === "node" && metadata.interop === "namespace") {
- metadata.interop = "node-namespace";
- } else if (resolvedInterop === "node" && metadata.interop === "default") {
- metadata.interop = "node-default";
- } else if (esNamespaceOnly && metadata.interop === "namespace") {
- metadata.interop = "default";
- }
- }
- return {
- exportName,
- exportNameListName: null,
- hasExports,
- local,
- source: sources,
- stringSpecifiers
- };
-}
-function getExportSpecifierName(path, stringSpecifiers) {
- if (path.isIdentifier()) {
- return path.node.name;
- } else if (path.isStringLiteral()) {
- const stringValue = path.node.value;
- if (!(0, _helperValidatorIdentifier.isIdentifierName)(stringValue)) {
- stringSpecifiers.add(stringValue);
- }
- return stringValue;
- } else {
- throw new Error(`Expected export specifier to be either Identifier or StringLiteral, got ${path.node.type}`);
- }
-}
-function assertExportSpecifier(path) {
- if (path.isExportSpecifier()) {
- return;
- } else if (path.isExportNamespaceSpecifier()) {
- throw path.buildCodeFrameError("Export namespace should be first transformed by `@babel/plugin-transform-export-namespace-from`.");
- } else {
- throw path.buildCodeFrameError("Unexpected export specifier type");
- }
-}
-function getModuleMetadata(programPath, {
- getWrapperPayload,
- initializeReexports
-}, stringSpecifiers) {
- const localData = getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers);
- const importNodes = new Map();
- const sourceData = new Map();
- const getData = (sourceNode, node) => {
- const source = sourceNode.value;
- let data = sourceData.get(source);
- if (!data) {
- data = {
- name: programPath.scope.generateUidIdentifier((0, _path.basename)(source, (0, _path.extname)(source))).name,
- interop: "none",
- loc: null,
- imports: new Map(),
- importsNamespace: new Set(),
- reexports: new Map(),
- reexportNamespace: new Set(),
- reexportAll: null,
- wrap: null,
- get lazy() {
- return this.wrap === "lazy";
- },
- referenced: false
- };
- sourceData.set(source, data);
- importNodes.set(source, [node]);
- } else {
- importNodes.get(source).push(node);
- }
- return data;
- };
- let hasExports = false;
- programPath.get("body").forEach(child => {
- if (child.isImportDeclaration()) {
- const data = getData(child.node.source, child.node);
- if (!data.loc) data.loc = child.node.loc;
- child.get("specifiers").forEach(spec => {
- if (spec.isImportDefaultSpecifier()) {
- const localName = spec.get("local").node.name;
- data.imports.set(localName, "default");
- const reexport = localData.get(localName);
- if (reexport) {
- localData.delete(localName);
- reexport.names.forEach(name => {
- data.reexports.set(name, "default");
- });
- data.referenced = true;
- }
- } else if (spec.isImportNamespaceSpecifier()) {
- const localName = spec.get("local").node.name;
- data.importsNamespace.add(localName);
- const reexport = localData.get(localName);
- if (reexport) {
- localData.delete(localName);
- reexport.names.forEach(name => {
- data.reexportNamespace.add(name);
- });
- data.referenced = true;
- }
- } else if (spec.isImportSpecifier()) {
- const importName = getExportSpecifierName(spec.get("imported"), stringSpecifiers);
- const localName = spec.get("local").node.name;
- data.imports.set(localName, importName);
- const reexport = localData.get(localName);
- if (reexport) {
- localData.delete(localName);
- reexport.names.forEach(name => {
- data.reexports.set(name, importName);
- });
- data.referenced = true;
- }
- }
- });
- } else if (child.isExportAllDeclaration()) {
- hasExports = true;
- const data = getData(child.node.source, child.node);
- if (!data.loc) data.loc = child.node.loc;
- data.reexportAll = {
- loc: child.node.loc
- };
- data.referenced = true;
- } else if (child.isExportNamedDeclaration() && child.node.source) {
- hasExports = true;
- const data = getData(child.node.source, child.node);
- if (!data.loc) data.loc = child.node.loc;
- child.get("specifiers").forEach(spec => {
- assertExportSpecifier(spec);
- const importName = getExportSpecifierName(spec.get("local"), stringSpecifiers);
- const exportName = getExportSpecifierName(spec.get("exported"), stringSpecifiers);
- data.reexports.set(exportName, importName);
- data.referenced = true;
- if (exportName === "__esModule") {
- throw spec.get("exported").buildCodeFrameError('Illegal export "__esModule".');
- }
- });
- } else if (child.isExportNamedDeclaration() || child.isExportDefaultDeclaration()) {
- hasExports = true;
- }
- });
- for (const metadata of sourceData.values()) {
- let needsDefault = false;
- let needsNamed = false;
- if (metadata.importsNamespace.size > 0) {
- needsDefault = true;
- needsNamed = true;
- }
- if (metadata.reexportAll) {
- needsNamed = true;
- }
- for (const importName of metadata.imports.values()) {
- if (importName === "default") needsDefault = true;else needsNamed = true;
- }
- for (const importName of metadata.reexports.values()) {
- if (importName === "default") needsDefault = true;else needsNamed = true;
- }
- if (needsDefault && needsNamed) {
- metadata.interop = "namespace";
- } else if (needsDefault) {
- metadata.interop = "default";
- }
- }
- if (getWrapperPayload) {
- for (const [source, metadata] of sourceData) {
- metadata.wrap = getWrapperPayload(source, metadata, importNodes.get(source));
- }
- }
- return {
- hasExports,
- local: localData,
- sources: sourceData
- };
-}
-function getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers) {
- const bindingKindLookup = new Map();
- programPath.get("body").forEach(child => {
- let kind;
- if (child.isImportDeclaration()) {
- kind = "import";
- } else {
- if (child.isExportDefaultDeclaration()) {
- child = child.get("declaration");
- }
- if (child.isExportNamedDeclaration()) {
- if (child.node.declaration) {
- child = child.get("declaration");
- } else if (initializeReexports && child.node.source && child.get("source").isStringLiteral()) {
- child.get("specifiers").forEach(spec => {
- assertExportSpecifier(spec);
- bindingKindLookup.set(spec.get("local").node.name, "block");
- });
- return;
- }
- }
- if (child.isFunctionDeclaration()) {
- kind = "hoisted";
- } else if (child.isClassDeclaration()) {
- kind = "block";
- } else if (child.isVariableDeclaration({
- kind: "var"
- })) {
- kind = "var";
- } else if (child.isVariableDeclaration()) {
- kind = "block";
- } else {
- return;
- }
- }
- Object.keys(child.getOuterBindingIdentifiers()).forEach(name => {
- bindingKindLookup.set(name, kind);
- });
- });
- const localMetadata = new Map();
- const getLocalMetadata = idPath => {
- const localName = idPath.node.name;
- let metadata = localMetadata.get(localName);
- if (!metadata) {
- const kind = bindingKindLookup.get(localName);
- if (kind === undefined) {
- throw idPath.buildCodeFrameError(`Exporting local "${localName}", which is not declared.`);
- }
- metadata = {
- names: [],
- kind
- };
- localMetadata.set(localName, metadata);
- }
- return metadata;
- };
- programPath.get("body").forEach(child => {
- if (child.isExportNamedDeclaration() && (initializeReexports || !child.node.source)) {
- if (child.node.declaration) {
- const declaration = child.get("declaration");
- const ids = declaration.getOuterBindingIdentifierPaths();
- Object.keys(ids).forEach(name => {
- if (name === "__esModule") {
- throw declaration.buildCodeFrameError('Illegal export "__esModule".');
- }
- getLocalMetadata(ids[name]).names.push(name);
- });
- } else {
- child.get("specifiers").forEach(spec => {
- const local = spec.get("local");
- const exported = spec.get("exported");
- const localMetadata = getLocalMetadata(local);
- const exportName = getExportSpecifierName(exported, stringSpecifiers);
- if (exportName === "__esModule") {
- throw exported.buildCodeFrameError('Illegal export "__esModule".');
- }
- localMetadata.names.push(exportName);
- });
- }
- } else if (child.isExportDefaultDeclaration()) {
- const declaration = child.get("declaration");
- if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) {
- getLocalMetadata(declaration.get("id")).names.push("default");
- } else {
- throw declaration.buildCodeFrameError("Unexpected default expression export.");
- }
- }
- });
- return localMetadata;
-}
-function nameAnonymousExports(programPath) {
- programPath.get("body").forEach(child => {
- if (!child.isExportDefaultDeclaration()) return;
- {
- var _child$splitExportDec;
- (_child$splitExportDec = child.splitExportDeclaration) != null ? _child$splitExportDec : child.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
- }
- child.splitExportDeclaration();
- });
-}
-function removeImportExportDeclarations(programPath) {
- programPath.get("body").forEach(child => {
- if (child.isImportDeclaration()) {
- child.remove();
- } else if (child.isExportNamedDeclaration()) {
- if (child.node.declaration) {
- child.node.declaration._blockHoist = child.node._blockHoist;
- child.replaceWith(child.node.declaration);
- } else {
- child.remove();
- }
- } else if (child.isExportDefaultDeclaration()) {
- const declaration = child.get("declaration");
- if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) {
- declaration._blockHoist = child.node._blockHoist;
- child.replaceWith(declaration);
- } else {
- throw declaration.buildCodeFrameError("Unexpected default expression export.");
- }
- } else if (child.isExportAllDeclaration()) {
- child.remove();
- }
- });
-}
-
-//# sourceMappingURL=normalize-and-load-metadata.js.map
diff --git a/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js.map b/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js.map
deleted file mode 100644
index ff5dc404..00000000
--- a/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"names":["_path","require","_helperValidatorIdentifier","hasExports","metadata","isSideEffectImport","source","imports","size","importsNamespace","reexports","reexportNamespace","reexportAll","validateImportInteropOption","importInterop","Error","resolveImportInterop","filename","normalizeModuleAndLoadMetadata","programPath","exportName","initializeReexports","getWrapperPayload","esNamespaceOnly","scope","generateUidIdentifier","name","stringSpecifiers","Set","nameAnonymousExports","local","sources","getModuleMetadata","removeImportExportDeclarations","nameOfnamespace","resolvedInterop","interop","exportNameListName","getExportSpecifierName","path","isIdentifier","node","isStringLiteral","stringValue","value","isIdentifierName","add","type","assertExportSpecifier","isExportSpecifier","isExportNamespaceSpecifier","buildCodeFrameError","localData","getLocalExportMetadata","importNodes","Map","sourceData","getData","sourceNode","data","get","basename","extname","loc","wrap","lazy","referenced","set","push","forEach","child","isImportDeclaration","spec","isImportDefaultSpecifier","localName","reexport","delete","names","isImportNamespaceSpecifier","isImportSpecifier","importName","isExportAllDeclaration","isExportNamedDeclaration","isExportDefaultDeclaration","values","needsDefault","needsNamed","bindingKindLookup","kind","declaration","isFunctionDeclaration","isClassDeclaration","isVariableDeclaration","Object","keys","getOuterBindingIdentifiers","localMetadata","getLocalMetadata","idPath","undefined","ids","getOuterBindingIdentifierPaths","exported","_child$splitExportDec","splitExportDeclaration","NodePath","prototype","remove","_blockHoist","replaceWith"],"sources":["../src/normalize-and-load-metadata.ts"],"sourcesContent":["import { basename, extname } from \"path\";\nimport type { types as t, NodePath } from \"@babel/core\";\n\nimport { isIdentifierName } from \"@babel/helper-validator-identifier\";\n\nexport interface ModuleMetadata {\n exportName: string;\n // The name of the variable that will reference an object containing export names.\n exportNameListName: null | string;\n hasExports: boolean;\n // Lookup from local binding to export information.\n local: Map<string, LocalExportMetadata>;\n // Lookup of source file to source file metadata.\n source: Map<string, SourceModuleMetadata>;\n // List of names that should only be printed as string literals.\n // i.e. `import { \"any unicode\" as foo } from \"some-module\"`\n // `stringSpecifiers` is Set(1) [\"any unicode\"]\n // In most cases `stringSpecifiers` is an empty Set\n stringSpecifiers: Set<string>;\n}\n\nexport type InteropType =\n | \"default\" // Babel interop for default-only imports\n | \"namespace\" // Babel interop for namespace or default+named imports\n | \"node-default\" // Node.js interop for default-only imports\n | \"node-namespace\" // Node.js interop for namespace or default+named imports\n | \"none\"; // No interop, or named-only imports\n\nexport type ImportInterop =\n | \"none\"\n | \"babel\"\n | \"node\"\n | ((source: string, filename?: string) => \"none\" | \"babel\" | \"node\");\n\nexport interface SourceModuleMetadata {\n // A unique variable name to use for this namespace object. Centralized for simplicity.\n name: string;\n loc: t.SourceLocation | undefined | null;\n interop: InteropType;\n // Local binding to reference from this source namespace. Key: Local name, value: Import name\n imports: Map<string, string>;\n // Local names that reference namespace object.\n importsNamespace: Set<string>;\n // Reexports to create for namespace. Key: Export name, value: Import name\n reexports: Map<string, string>;\n // List of names to re-export namespace as.\n reexportNamespace: Set<string>;\n // Tracks if the source should be re-exported.\n reexportAll: null | {\n loc: t.SourceLocation | undefined | null;\n };\n wrap?: unknown;\n referenced: boolean;\n}\n\nexport interface LocalExportMetadata {\n names: Array<string>; // names of exports,\n kind: \"import\" | \"hoisted\" | \"block\" | \"var\";\n}\n\n/**\n * Check if the module has any exports that need handling.\n */\nexport function hasExports(metadata: ModuleMetadata) {\n return metadata.hasExports;\n}\n\n/**\n * Check if a given source is an anonymous import, e.g. \"import 'foo';\"\n */\nexport function isSideEffectImport(source: SourceModuleMetadata) {\n return (\n source.imports.size === 0 &&\n source.importsNamespace.size === 0 &&\n source.reexports.size === 0 &&\n source.reexportNamespace.size === 0 &&\n !source.reexportAll\n );\n}\n\nexport function validateImportInteropOption(\n importInterop: any,\n): importInterop is ImportInterop {\n if (\n typeof importInterop !== \"function\" &&\n importInterop !== \"none\" &&\n importInterop !== \"babel\" &&\n importInterop !== \"node\"\n ) {\n throw new Error(\n `.importInterop must be one of \"none\", \"babel\", \"node\", or a function returning one of those values (received ${importInterop}).`,\n );\n }\n return importInterop;\n}\n\nfunction resolveImportInterop(\n importInterop: ImportInterop,\n source: string,\n filename: string | undefined,\n) {\n if (typeof importInterop === \"function\") {\n return validateImportInteropOption(importInterop(source, filename));\n }\n return importInterop;\n}\n\n/**\n * Remove all imports and exports from the file, and return all metadata\n * needed to reconstruct the module's behavior.\n */\nexport default function normalizeModuleAndLoadMetadata(\n programPath: NodePath<t.Program>,\n exportName: string,\n {\n importInterop,\n initializeReexports = false,\n getWrapperPayload,\n esNamespaceOnly = false,\n filename,\n }: {\n importInterop: ImportInterop;\n initializeReexports: boolean | void;\n getWrapperPayload?: (\n source: string,\n metadata: SourceModuleMetadata,\n importNodes: t.Node[],\n ) => unknown;\n esNamespaceOnly: boolean;\n filename: string;\n },\n): ModuleMetadata {\n if (!exportName) {\n exportName = programPath.scope.generateUidIdentifier(\"exports\").name;\n }\n const stringSpecifiers = new Set<string>();\n\n nameAnonymousExports(programPath);\n\n const { local, sources, hasExports } = getModuleMetadata(\n programPath,\n { initializeReexports, getWrapperPayload },\n stringSpecifiers,\n );\n\n removeImportExportDeclarations(programPath);\n\n // Reuse the imported namespace name if there is one.\n for (const [source, metadata] of sources) {\n const { importsNamespace, imports } = metadata;\n // If there is at least one namespace import and other imports, it may collipse with local ident, can be seen in issue 15879.\n if (importsNamespace.size > 0 && imports.size === 0) {\n const [nameOfnamespace] = importsNamespace;\n metadata.name = nameOfnamespace;\n }\n\n const resolvedInterop = resolveImportInterop(\n importInterop,\n source,\n filename,\n );\n\n if (resolvedInterop === \"none\") {\n metadata.interop = \"none\";\n } else if (resolvedInterop === \"node\" && metadata.interop === \"namespace\") {\n metadata.interop = \"node-namespace\";\n } else if (resolvedInterop === \"node\" && metadata.interop === \"default\") {\n metadata.interop = \"node-default\";\n } else if (esNamespaceOnly && metadata.interop === \"namespace\") {\n // Both the default and namespace interops pass through __esModule\n // objects, but the namespace interop is used to enable Babel's\n // destructuring-like interop behavior for normal CommonJS.\n // Since some tooling has started to remove that behavior, we expose\n // it as the `esNamespace` option.\n metadata.interop = \"default\";\n }\n }\n\n return {\n exportName,\n exportNameListName: null,\n hasExports,\n local,\n source: sources,\n stringSpecifiers,\n };\n}\n\nfunction getExportSpecifierName(\n path: NodePath,\n stringSpecifiers: Set<string>,\n): string {\n if (path.isIdentifier()) {\n return path.node.name;\n } else if (path.isStringLiteral()) {\n const stringValue = path.node.value;\n // add specifier value to `stringSpecifiers` only when it can not be converted to an identifier name\n // i.e In `import { \"foo\" as bar }`\n // we do not consider `\"foo\"` to be a `stringSpecifier` because we can treat it as\n // `import { foo as bar }`\n // This helps minimize the size of `stringSpecifiers` and reduce overhead of checking valid identifier names\n // when building transpiled code from metadata\n if (!isIdentifierName(stringValue)) {\n stringSpecifiers.add(stringValue);\n }\n return stringValue;\n } else {\n throw new Error(\n `Expected export specifier to be either Identifier or StringLiteral, got ${path.node.type}`,\n );\n }\n}\n\nfunction assertExportSpecifier(\n path: NodePath,\n): asserts path is NodePath<t.ExportSpecifier> {\n if (path.isExportSpecifier()) {\n return;\n } else if (path.isExportNamespaceSpecifier()) {\n throw path.buildCodeFrameError(\n \"Export namespace should be first transformed by `@babel/plugin-transform-export-namespace-from`.\",\n );\n } else {\n throw path.buildCodeFrameError(\"Unexpected export specifier type\");\n }\n}\n\n/**\n * Get metadata about the imports and exports present in this module.\n */\nfunction getModuleMetadata(\n programPath: NodePath<t.Program>,\n {\n getWrapperPayload,\n initializeReexports,\n }: {\n getWrapperPayload?: (\n source: string,\n metadata: SourceModuleMetadata,\n importNodes: t.Node[],\n ) => unknown;\n initializeReexports: boolean | void;\n },\n stringSpecifiers: Set<string>,\n) {\n const localData = getLocalExportMetadata(\n programPath,\n initializeReexports,\n stringSpecifiers,\n );\n\n const importNodes = new Map<string, t.Node[]>();\n const sourceData = new Map<string, SourceModuleMetadata>();\n const getData = (sourceNode: t.StringLiteral, node: t.Node) => {\n const source = sourceNode.value;\n\n let data = sourceData.get(source);\n if (!data) {\n data = {\n name: programPath.scope.generateUidIdentifier(\n basename(source, extname(source)),\n ).name,\n\n interop: \"none\",\n\n loc: null,\n\n // Data about the requested sources and names.\n imports: new Map(),\n importsNamespace: new Set(),\n\n // Metadata about data that is passed directly from source to export.\n reexports: new Map(),\n reexportNamespace: new Set(),\n reexportAll: null,\n\n wrap: null,\n\n // @ts-expect-error lazy is not listed in the type.\n // This is needed for compatibility with older version of the commonjs\n // plusing.\n // TODO(Babel 8): Remove this\n get lazy() {\n return this.wrap === \"lazy\";\n },\n\n referenced: false,\n };\n sourceData.set(source, data);\n importNodes.set(source, [node]);\n } else {\n importNodes.get(source).push(node);\n }\n return data;\n };\n let hasExports = false;\n programPath.get(\"body\").forEach(child => {\n if (child.isImportDeclaration()) {\n const data = getData(child.node.source, child.node);\n if (!data.loc) data.loc = child.node.loc;\n\n child.get(\"specifiers\").forEach(spec => {\n if (spec.isImportDefaultSpecifier()) {\n const localName = spec.get(\"local\").node.name;\n\n data.imports.set(localName, \"default\");\n\n const reexport = localData.get(localName);\n if (reexport) {\n localData.delete(localName);\n\n reexport.names.forEach(name => {\n data.reexports.set(name, \"default\");\n });\n data.referenced = true;\n }\n } else if (spec.isImportNamespaceSpecifier()) {\n const localName = spec.get(\"local\").node.name;\n\n data.importsNamespace.add(localName);\n const reexport = localData.get(localName);\n if (reexport) {\n localData.delete(localName);\n\n reexport.names.forEach(name => {\n data.reexportNamespace.add(name);\n });\n data.referenced = true;\n }\n } else if (spec.isImportSpecifier()) {\n const importName = getExportSpecifierName(\n spec.get(\"imported\"),\n stringSpecifiers,\n );\n const localName = spec.get(\"local\").node.name;\n\n data.imports.set(localName, importName);\n\n const reexport = localData.get(localName);\n if (reexport) {\n localData.delete(localName);\n\n reexport.names.forEach(name => {\n data.reexports.set(name, importName);\n });\n data.referenced = true;\n }\n }\n });\n } else if (child.isExportAllDeclaration()) {\n hasExports = true;\n const data = getData(child.node.source, child.node);\n if (!data.loc) data.loc = child.node.loc;\n\n data.reexportAll = {\n loc: child.node.loc,\n };\n data.referenced = true;\n } else if (child.isExportNamedDeclaration() && child.node.source) {\n hasExports = true;\n const data = getData(child.node.source, child.node);\n if (!data.loc) data.loc = child.node.loc;\n\n child.get(\"specifiers\").forEach(spec => {\n assertExportSpecifier(spec);\n const importName = getExportSpecifierName(\n spec.get(\"local\"),\n stringSpecifiers,\n );\n const exportName = getExportSpecifierName(\n spec.get(\"exported\"),\n stringSpecifiers,\n );\n\n data.reexports.set(exportName, importName);\n data.referenced = true;\n\n if (exportName === \"__esModule\") {\n throw spec\n .get(\"exported\")\n .buildCodeFrameError('Illegal export \"__esModule\".');\n }\n });\n } else if (\n child.isExportNamedDeclaration() ||\n child.isExportDefaultDeclaration()\n ) {\n hasExports = true;\n }\n });\n\n for (const metadata of sourceData.values()) {\n let needsDefault = false;\n let needsNamed = false;\n\n if (metadata.importsNamespace.size > 0) {\n needsDefault = true;\n needsNamed = true;\n }\n\n if (metadata.reexportAll) {\n needsNamed = true;\n }\n\n for (const importName of metadata.imports.values()) {\n if (importName === \"default\") needsDefault = true;\n else needsNamed = true;\n }\n for (const importName of metadata.reexports.values()) {\n if (importName === \"default\") needsDefault = true;\n else needsNamed = true;\n }\n\n if (needsDefault && needsNamed) {\n // TODO(logan): Using the namespace interop here is unfortunate. Revisit.\n metadata.interop = \"namespace\";\n } else if (needsDefault) {\n metadata.interop = \"default\";\n }\n }\n\n if (getWrapperPayload) {\n for (const [source, metadata] of sourceData) {\n metadata.wrap = getWrapperPayload(\n source,\n metadata,\n importNodes.get(source),\n );\n }\n }\n\n return {\n hasExports,\n local: localData,\n sources: sourceData,\n };\n}\n\ntype ModuleBindingKind = \"import\" | \"hoisted\" | \"block\" | \"var\";\n/**\n * Get metadata about local variables that are exported.\n */\nfunction getLocalExportMetadata(\n programPath: NodePath<t.Program>,\n initializeReexports: boolean | void,\n stringSpecifiers: Set<string>,\n): Map<string, LocalExportMetadata> {\n const bindingKindLookup = new Map();\n\n programPath.get(\"body\").forEach((child: NodePath) => {\n let kind: ModuleBindingKind;\n if (child.isImportDeclaration()) {\n kind = \"import\";\n } else {\n if (child.isExportDefaultDeclaration()) {\n child = child.get(\"declaration\");\n }\n if (child.isExportNamedDeclaration()) {\n if (child.node.declaration) {\n child = child.get(\"declaration\");\n } else if (\n initializeReexports &&\n child.node.source &&\n child.get(\"source\").isStringLiteral()\n ) {\n child.get(\"specifiers\").forEach(spec => {\n assertExportSpecifier(spec);\n bindingKindLookup.set(spec.get(\"local\").node.name, \"block\");\n });\n return;\n }\n }\n\n if (child.isFunctionDeclaration()) {\n kind = \"hoisted\";\n } else if (child.isClassDeclaration()) {\n kind = \"block\";\n } else if (child.isVariableDeclaration({ kind: \"var\" })) {\n kind = \"var\";\n } else if (child.isVariableDeclaration()) {\n kind = \"block\";\n } else {\n return;\n }\n }\n\n Object.keys(child.getOuterBindingIdentifiers()).forEach(name => {\n bindingKindLookup.set(name, kind);\n });\n });\n\n const localMetadata = new Map();\n const getLocalMetadata = (idPath: NodePath<t.Identifier>) => {\n const localName = idPath.node.name;\n let metadata = localMetadata.get(localName);\n\n if (!metadata) {\n const kind = bindingKindLookup.get(localName);\n\n if (kind === undefined) {\n throw idPath.buildCodeFrameError(\n `Exporting local \"${localName}\", which is not declared.`,\n );\n }\n\n metadata = {\n names: [],\n kind,\n };\n localMetadata.set(localName, metadata);\n }\n return metadata;\n };\n\n programPath.get(\"body\").forEach(child => {\n if (\n child.isExportNamedDeclaration() &&\n (initializeReexports || !child.node.source)\n ) {\n if (child.node.declaration) {\n const declaration = child.get(\"declaration\");\n const ids = declaration.getOuterBindingIdentifierPaths();\n Object.keys(ids).forEach(name => {\n if (name === \"__esModule\") {\n throw declaration.buildCodeFrameError(\n 'Illegal export \"__esModule\".',\n );\n }\n getLocalMetadata(ids[name]).names.push(name);\n });\n } else {\n child.get(\"specifiers\").forEach(spec => {\n const local = spec.get(\"local\");\n const exported = spec.get(\"exported\");\n const localMetadata = getLocalMetadata(local);\n const exportName = getExportSpecifierName(exported, stringSpecifiers);\n\n if (exportName === \"__esModule\") {\n throw exported.buildCodeFrameError('Illegal export \"__esModule\".');\n }\n localMetadata.names.push(exportName);\n });\n }\n } else if (child.isExportDefaultDeclaration()) {\n const declaration = child.get(\"declaration\");\n if (\n declaration.isFunctionDeclaration() ||\n declaration.isClassDeclaration()\n ) {\n getLocalMetadata(declaration.get(\"id\")).names.push(\"default\");\n } else {\n // These should have been removed by the nameAnonymousExports() call.\n throw declaration.buildCodeFrameError(\n \"Unexpected default expression export.\",\n );\n }\n }\n });\n return localMetadata;\n}\n\n/**\n * Ensure that all exported values have local binding names.\n */\nfunction nameAnonymousExports(programPath: NodePath<t.Program>) {\n // Name anonymous exported locals.\n programPath.get(\"body\").forEach(child => {\n if (!child.isExportDefaultDeclaration()) return;\n if (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // polyfill when being run by an older Babel version\n child.splitExportDeclaration ??=\n // eslint-disable-next-line no-restricted-globals\n require(\"@babel/traverse\").NodePath.prototype.splitExportDeclaration;\n }\n child.splitExportDeclaration();\n });\n}\n\nfunction removeImportExportDeclarations(programPath: NodePath<t.Program>) {\n programPath.get(\"body\").forEach(child => {\n if (child.isImportDeclaration()) {\n child.remove();\n } else if (child.isExportNamedDeclaration()) {\n if (child.node.declaration) {\n // @ts-expect-error todo(flow->ts): avoid mutations\n child.node.declaration._blockHoist = child.node._blockHoist;\n child.replaceWith(child.node.declaration);\n } else {\n child.remove();\n }\n } else if (child.isExportDefaultDeclaration()) {\n // export default foo;\n const declaration = child.get(\"declaration\");\n if (\n declaration.isFunctionDeclaration() ||\n declaration.isClassDeclaration()\n ) {\n // @ts-expect-error todo(flow->ts): avoid mutations\n declaration._blockHoist = child.node._blockHoist;\n child.replaceWith(declaration);\n } else {\n // These should have been removed by the nameAnonymousExports() call.\n throw declaration.buildCodeFrameError(\n \"Unexpected default expression export.\",\n );\n }\n } else if (child.isExportAllDeclaration()) {\n child.remove();\n }\n });\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,0BAAA,GAAAD,OAAA;AA4DO,SAASE,UAAUA,CAACC,QAAwB,EAAE;EACnD,OAAOA,QAAQ,CAACD,UAAU;AAC5B;AAKO,SAASE,kBAAkBA,CAACC,MAA4B,EAAE;EAC/D,OACEA,MAAM,CAACC,OAAO,CAACC,IAAI,KAAK,CAAC,IACzBF,MAAM,CAACG,gBAAgB,CAACD,IAAI,KAAK,CAAC,IAClCF,MAAM,CAACI,SAAS,CAACF,IAAI,KAAK,CAAC,IAC3BF,MAAM,CAACK,iBAAiB,CAACH,IAAI,KAAK,CAAC,IACnC,CAACF,MAAM,CAACM,WAAW;AAEvB;AAEO,SAASC,2BAA2BA,CACzCC,aAAkB,EACc;EAChC,IACE,OAAOA,aAAa,KAAK,UAAU,IACnCA,aAAa,KAAK,MAAM,IACxBA,aAAa,KAAK,OAAO,IACzBA,aAAa,KAAK,MAAM,EACxB;IACA,MAAM,IAAIC,KAAK,CACb,gHAAgHD,aAAa,IAC/H,CAAC;EACH;EACA,OAAOA,aAAa;AACtB;AAEA,SAASE,oBAAoBA,CAC3BF,aAA4B,EAC5BR,MAAc,EACdW,QA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tC,KAAK,CAAC7B,IAAI,CAACmE,WAAW;QAC3DtC,KAAK,CAACuC,WAAW,CAACvC,KAAK,CAAC7B,IAAI,CAACgD,WAAW,CAAC;MAC3C,CAAC,MAAM;QACLnB,KAAK,CAACqC,MAAM,CAAC,CAAC;MAChB;IACF,CAAC,MAAM,IAAIrC,KAAK,CAACa,0BAA0B,CAAC,CAAC,EAAE;MAE7C,MAAMM,WAAW,GAAGnB,KAAK,CAACV,GAAG,CAAC,aAAa,CAAC;MAC5C,IACE6B,WAAW,CAACC,qBAAqB,CAAC,CAAC,IACnCD,WAAW,CAACE,kBAAkB,CAAC,CAAC,EAChC;QAEAF,WAAW,CAACmB,WAAW,GAAGtC,KAAK,CAAC7B,IAAI,CAACmE,WAAW;QAChDtC,KAAK,CAACuC,WAAW,CAACpB,WAAW,CAAC;MAChC,CAAC,MAAM;QAEL,MAAMA,WAAW,CAACtC,mBAAmB,CACnC,uCACF,CAAC;MACH;IACF,CAAC,MAAM,IAAImB,KAAK,CAACW,sBAAsB,CAAC,CAAC,EAAE;MACzCX,KAAK,CAACqC,MAAM,CAAC,CAAC;IAChB;EACF,CAAC,CAAC;AACJ","ignoreList":[]} \ No newline at end of file
diff --git a/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js b/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js
deleted file mode 100644
index d856a197..00000000
--- a/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js
+++ /dev/null
@@ -1,355 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = rewriteLiveReferences;
-var _assert = require("assert");
-var _core = require("@babel/core");
-var _helperSimpleAccess = require("@babel/helper-simple-access");
-function isInType(path) {
- do {
- switch (path.parent.type) {
- case "TSTypeAnnotation":
- case "TSTypeAliasDeclaration":
- case "TSTypeReference":
- case "TypeAnnotation":
- case "TypeAlias":
- return true;
- case "ExportSpecifier":
- return path.parentPath.parent.exportKind === "type";
- default:
- if (path.parentPath.isStatement() || path.parentPath.isExpression()) {
- return false;
- }
- }
- } while (path = path.parentPath);
-}
-function rewriteLiveReferences(programPath, metadata, wrapReference) {
- const imported = new Map();
- const exported = new Map();
- const requeueInParent = path => {
- programPath.requeue(path);
- };
- for (const [source, data] of metadata.source) {
- for (const [localName, importName] of data.imports) {
- imported.set(localName, [source, importName, null]);
- }
- for (const localName of data.importsNamespace) {
- imported.set(localName, [source, null, localName]);
- }
- }
- for (const [local, data] of metadata.local) {
- let exportMeta = exported.get(local);
- if (!exportMeta) {
- exportMeta = [];
- exported.set(local, exportMeta);
- }
- exportMeta.push(...data.names);
- }
- const rewriteBindingInitVisitorState = {
- metadata,
- requeueInParent,
- scope: programPath.scope,
- exported
- };
- programPath.traverse(rewriteBindingInitVisitor, rewriteBindingInitVisitorState);
- const bindingNames = new Set([...Array.from(imported.keys()), ...Array.from(exported.keys())]);
- {
- (0, _helperSimpleAccess.default)(programPath, bindingNames, false);
- }
- const rewriteReferencesVisitorState = {
- seen: new WeakSet(),
- metadata,
- requeueInParent,
- scope: programPath.scope,
- imported,
- exported,
- buildImportReference([source, importName, localName], identNode) {
- const meta = metadata.source.get(source);
- meta.referenced = true;
- if (localName) {
- if (meta.wrap) {
- var _wrapReference;
- identNode = (_wrapReference = wrapReference(identNode, meta.wrap)) != null ? _wrapReference : identNode;
- }
- return identNode;
- }
- let namespace = _core.types.identifier(meta.name);
- if (meta.wrap) {
- var _wrapReference2;
- namespace = (_wrapReference2 = wrapReference(namespace, meta.wrap)) != null ? _wrapReference2 : namespace;
- }
- if (importName === "default" && meta.interop === "node-default") {
- return namespace;
- }
- const computed = metadata.stringSpecifiers.has(importName);
- return _core.types.memberExpression(namespace, computed ? _core.types.stringLiteral(importName) : _core.types.identifier(importName), computed);
- }
- };
- programPath.traverse(rewriteReferencesVisitor, rewriteReferencesVisitorState);
-}
-const rewriteBindingInitVisitor = {
- Scope(path) {
- path.skip();
- },
- ClassDeclaration(path) {
- const {
- requeueInParent,
- exported,
- metadata
- } = this;
- const {
- id
- } = path.node;
- if (!id) throw new Error("Expected class to have a name");
- const localName = id.name;
- const exportNames = exported.get(localName) || [];
- if (exportNames.length > 0) {
- const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exportNames, _core.types.identifier(localName), path.scope));
- statement._blockHoist = path.node._blockHoist;
- requeueInParent(path.insertAfter(statement)[0]);
- }
- },
- VariableDeclaration(path) {
- const {
- requeueInParent,
- exported,
- metadata
- } = this;
- const isVar = path.node.kind === "var";
- for (const decl of path.get("declarations")) {
- const {
- id
- } = decl.node;
- let {
- init
- } = decl.node;
- if (_core.types.isIdentifier(id) && exported.has(id.name) && !_core.types.isArrowFunctionExpression(init) && (!_core.types.isFunctionExpression(init) || init.id) && (!_core.types.isClassExpression(init) || init.id)) {
- if (!init) {
- if (isVar) {
- continue;
- } else {
- init = path.scope.buildUndefinedNode();
- }
- }
- decl.node.init = buildBindingExportAssignmentExpression(metadata, exported.get(id.name), init, path.scope);
- requeueInParent(decl.get("init"));
- } else {
- for (const localName of Object.keys(decl.getOuterBindingIdentifiers())) {
- if (exported.has(localName)) {
- const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exported.get(localName), _core.types.identifier(localName), path.scope));
- statement._blockHoist = path.node._blockHoist;
- requeueInParent(path.insertAfter(statement)[0]);
- }
- }
- }
- }
- }
-};
-const buildBindingExportAssignmentExpression = (metadata, exportNames, localExpr, scope) => {
- const exportsObjectName = metadata.exportName;
- for (let currentScope = scope; currentScope != null; currentScope = currentScope.parent) {
- if (currentScope.hasOwnBinding(exportsObjectName)) {
- currentScope.rename(exportsObjectName);
- }
- }
- return (exportNames || []).reduce((expr, exportName) => {
- const {
- stringSpecifiers
- } = metadata;
- const computed = stringSpecifiers.has(exportName);
- return _core.types.assignmentExpression("=", _core.types.memberExpression(_core.types.identifier(exportsObjectName), computed ? _core.types.stringLiteral(exportName) : _core.types.identifier(exportName), computed), expr);
- }, localExpr);
-};
-const buildImportThrow = localName => {
- return _core.template.expression.ast`
- (function() {
- throw new Error('"' + '${localName}' + '" is read-only.');
- })()
- `;
-};
-const rewriteReferencesVisitor = {
- ReferencedIdentifier(path) {
- const {
- seen,
- buildImportReference,
- scope,
- imported,
- requeueInParent
- } = this;
- if (seen.has(path.node)) return;
- seen.add(path.node);
- const localName = path.node.name;
- const importData = imported.get(localName);
- if (importData) {
- if (isInType(path)) {
- throw path.buildCodeFrameError(`Cannot transform the imported binding "${localName}" since it's also used in a type annotation. ` + `Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.`);
- }
- const localBinding = path.scope.getBinding(localName);
- const rootBinding = scope.getBinding(localName);
- if (rootBinding !== localBinding) return;
- const ref = buildImportReference(importData, path.node);
- ref.loc = path.node.loc;
- if ((path.parentPath.isCallExpression({
- callee: path.node
- }) || path.parentPath.isOptionalCallExpression({
- callee: path.node
- }) || path.parentPath.isTaggedTemplateExpression({
- tag: path.node
- })) && _core.types.isMemberExpression(ref)) {
- path.replaceWith(_core.types.sequenceExpression([_core.types.numericLiteral(0), ref]));
- } else if (path.isJSXIdentifier() && _core.types.isMemberExpression(ref)) {
- const {
- object,
- property
- } = ref;
- path.replaceWith(_core.types.jsxMemberExpression(_core.types.jsxIdentifier(object.name), _core.types.jsxIdentifier(property.name)));
- } else {
- path.replaceWith(ref);
- }
- requeueInParent(path);
- path.skip();
- }
- },
- UpdateExpression(path) {
- const {
- scope,
- seen,
- imported,
- exported,
- requeueInParent,
- buildImportReference
- } = this;
- if (seen.has(path.node)) return;
- seen.add(path.node);
- const arg = path.get("argument");
- if (arg.isMemberExpression()) return;
- const update = path.node;
- if (arg.isIdentifier()) {
- const localName = arg.node.name;
- if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {
- return;
- }
- const exportedNames = exported.get(localName);
- const importData = imported.get(localName);
- if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) {
- if (importData) {
- path.replaceWith(_core.types.assignmentExpression(update.operator[0] + "=", buildImportReference(importData, arg.node), buildImportThrow(localName)));
- } else if (update.prefix) {
- path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.cloneNode(update), path.scope));
- } else {
- const ref = scope.generateDeclaredUidIdentifier(localName);
- path.replaceWith(_core.types.sequenceExpression([_core.types.assignmentExpression("=", _core.types.cloneNode(ref), _core.types.cloneNode(update)), buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.identifier(localName), path.scope), _core.types.cloneNode(ref)]));
- }
- }
- }
- requeueInParent(path);
- path.skip();
- },
- AssignmentExpression: {
- exit(path) {
- const {
- scope,
- seen,
- imported,
- exported,
- requeueInParent,
- buildImportReference
- } = this;
- if (seen.has(path.node)) return;
- seen.add(path.node);
- const left = path.get("left");
- if (left.isMemberExpression()) return;
- if (left.isIdentifier()) {
- const localName = left.node.name;
- if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {
- return;
- }
- const exportedNames = exported.get(localName);
- const importData = imported.get(localName);
- if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) {
- _assert(path.node.operator === "=", "Path was not simplified");
- const assignment = path.node;
- if (importData) {
- assignment.left = buildImportReference(importData, left.node);
- assignment.right = _core.types.sequenceExpression([assignment.right, buildImportThrow(localName)]);
- }
- path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, assignment, path.scope));
- requeueInParent(path);
- }
- } else {
- const ids = left.getOuterBindingIdentifiers();
- const programScopeIds = Object.keys(ids).filter(localName => scope.getBinding(localName) === path.scope.getBinding(localName));
- const id = programScopeIds.find(localName => imported.has(localName));
- if (id) {
- path.node.right = _core.types.sequenceExpression([path.node.right, buildImportThrow(id)]);
- }
- const items = [];
- programScopeIds.forEach(localName => {
- const exportedNames = exported.get(localName) || [];
- if (exportedNames.length > 0) {
- items.push(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.identifier(localName), path.scope));
- }
- });
- if (items.length > 0) {
- let node = _core.types.sequenceExpression(items);
- if (path.parentPath.isExpressionStatement()) {
- node = _core.types.expressionStatement(node);
- node._blockHoist = path.parentPath.node._blockHoist;
- }
- const statement = path.insertAfter(node)[0];
- requeueInParent(statement);
- }
- }
- }
- },
- "ForOfStatement|ForInStatement"(path) {
- const {
- scope,
- node
- } = path;
- const {
- left
- } = node;
- const {
- exported,
- imported,
- scope: programScope
- } = this;
- if (!_core.types.isVariableDeclaration(left)) {
- let didTransformExport = false,
- importConstViolationName;
- const loopBodyScope = path.get("body").scope;
- for (const name of Object.keys(_core.types.getOuterBindingIdentifiers(left))) {
- if (programScope.getBinding(name) === scope.getBinding(name)) {
- if (exported.has(name)) {
- didTransformExport = true;
- if (loopBodyScope.hasOwnBinding(name)) {
- loopBodyScope.rename(name);
- }
- }
- if (imported.has(name) && !importConstViolationName) {
- importConstViolationName = name;
- }
- }
- }
- if (!didTransformExport && !importConstViolationName) {
- return;
- }
- path.ensureBlock();
- const bodyPath = path.get("body");
- const newLoopId = scope.generateUidIdentifierBasedOnNode(left);
- path.get("left").replaceWith(_core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.cloneNode(newLoopId))]));
- scope.registerDeclaration(path.get("left"));
- if (didTransformExport) {
- bodyPath.unshiftContainer("body", _core.types.expressionStatement(_core.types.assignmentExpression("=", left, newLoopId)));
- }
- if (importConstViolationName) {
- bodyPath.unshiftContainer("body", _core.types.expressionStatement(buildImportThrow(importConstViolationName)));
- }
- }
- }
-};
-
-//# sourceMappingURL=rewrite-live-references.js.map
diff --git a/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js.map b/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js.map
deleted file mode 100644
index 793dda5e..00000000
--- a/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"names":["_assert","require","_core","_helperSimpleAccess","isInType","path","parent","type","parentPath","exportKind","isStatement","isExpression","rewriteLiveReferences","programPath","metadata","wrapReference","imported","Map","exported","requeueInParent","requeue","source","data","localName","importName","imports","set","importsNamespace","local","exportMeta","get","push","names","rewriteBindingInitVisitorState","scope","traverse","rewriteBindingInitVisitor","bindingNames","Set","Array","from","keys","simplifyAccess","rewriteReferencesVisitorState","seen","WeakSet","buildImportReference","identNode","meta","referenced","wrap","_wrapReference","namespace","t","identifier","name","_wrapReference2","interop","computed","stringSpecifiers","has","memberExpression","stringLiteral","rewriteReferencesVisitor","Scope","skip","ClassDeclaration","id","node","Error","exportNames","length","statement","expressionStatement","buildBindingExportAssignmentExpression","_blockHoist","insertAfter","VariableDeclaration","isVar","kind","decl","init","isIdentifier","isArrowFunctionExpression","isFunctionExpression","isClassExpression","buildUndefinedNode","Object","getOuterBindingIdentifiers","localExpr","exportsObjectName","exportName","currentScope","hasOwnBinding","rename","reduce","expr","assignmentExpression","buildImportThrow","template","expression","ast","ReferencedIdentifier","add","importData","buildCodeFrameError","localBinding","getBinding","rootBinding","ref","loc","isCallExpression","callee","isOptionalCallExpression","isTaggedTemplateExpression","tag","isMemberExpression","replaceWith","sequenceExpression","numericLiteral","isJSXIdentifier","object","property","jsxMemberExpression","jsxIdentifier","UpdateExpression","arg","update","exportedNames","operator","prefix","cloneNode","generateDeclaredUidIdentifier","AssignmentExpression","exit","left","assert","assignment","right","ids","programScopeIds","filter","find","items","forEach","isExpressionStatement","ForOfStatement|ForInStatement","programScope","isVariableDeclaration","didTransformExport","importConstViolationName","loopBodyScope","ensureBlock","bodyPath","newLoopId","generateUidIdentifierBasedOnNode","variableDeclaration","variableDeclarator","registerDeclaration","unshiftContainer"],"sources":["../src/rewrite-live-references.ts"],"sourcesContent":["import assert from \"assert\";\nimport { template, types as t } from \"@babel/core\";\nimport type { NodePath, Visitor, Scope } from \"@babel/core\";\nimport simplifyAccess from \"@babel/helper-simple-access\";\n\nimport type { ModuleMetadata } from \"./normalize-and-load-metadata.ts\";\n\ninterface RewriteReferencesVisitorState {\n exported: Map<any, any>;\n metadata: ModuleMetadata;\n requeueInParent: (path: NodePath) => void;\n scope: Scope;\n imported: Map<any, any>;\n buildImportReference: (\n [source, importName, localName]: readonly [string, string, string],\n identNode: t.Identifier | t.CallExpression | t.JSXIdentifier,\n ) => any;\n seen: WeakSet<object>;\n}\n\ninterface RewriteBindingInitVisitorState {\n exported: Map<any, any>;\n metadata: ModuleMetadata;\n requeueInParent: (path: NodePath) => void;\n scope: Scope;\n}\n\nfunction isInType(path: NodePath) {\n do {\n switch (path.parent.type) {\n case \"TSTypeAnnotation\":\n case \"TSTypeAliasDeclaration\":\n case \"TSTypeReference\":\n case \"TypeAnnotation\":\n case \"TypeAlias\":\n return true;\n case \"ExportSpecifier\":\n return (\n (\n path.parentPath.parent as\n | t.ExportDefaultDeclaration\n | t.ExportNamedDeclaration\n ).exportKind === \"type\"\n );\n default:\n if (path.parentPath.isStatement() || path.parentPath.isExpression()) {\n return false;\n }\n }\n } while ((path = path.parentPath));\n}\n\nexport default function rewriteLiveReferences(\n programPath: NodePath<t.Program>,\n metadata: ModuleMetadata,\n wrapReference: (ref: t.Expression, payload: unknown) => null | t.Expression,\n) {\n const imported = new Map();\n const exported = new Map();\n const requeueInParent = (path: NodePath) => {\n // Manually re-queue `exports.default =` expressions so that the ES3\n // transform has an opportunity to convert them. Ideally this would\n // happen automatically from the replaceWith above. See #4140 for\n // more info.\n programPath.requeue(path);\n };\n\n for (const [source, data] of metadata.source) {\n for (const [localName, importName] of data.imports) {\n imported.set(localName, [source, importName, null]);\n }\n for (const localName of data.importsNamespace) {\n imported.set(localName, [source, null, localName]);\n }\n }\n\n for (const [local, data] of metadata.local) {\n let exportMeta = exported.get(local);\n if (!exportMeta) {\n exportMeta = [];\n exported.set(local, exportMeta);\n }\n\n exportMeta.push(...data.names);\n }\n\n // Rewrite initialization of bindings to update exports.\n const rewriteBindingInitVisitorState: RewriteBindingInitVisitorState = {\n metadata,\n requeueInParent,\n scope: programPath.scope,\n exported, // local name => exported name list\n };\n programPath.traverse(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n rewriteBindingInitVisitor,\n rewriteBindingInitVisitorState,\n );\n\n // NOTE(logan): The 'Array.from' calls are to make this code with in loose mode.\n const bindingNames = new Set([\n ...Array.from(imported.keys()),\n ...Array.from(exported.keys()),\n ]);\n if (process.env.BABEL_8_BREAKING) {\n simplifyAccess(programPath, bindingNames);\n } else {\n // @ts-ignore(Babel 7 vs Babel 8) The third param has been removed in Babel 8.\n simplifyAccess(programPath, bindingNames, false);\n }\n\n // Rewrite reads/writes from imports and exports to have the correct behavior.\n const rewriteReferencesVisitorState: RewriteReferencesVisitorState = {\n seen: new WeakSet(),\n metadata,\n requeueInParent,\n scope: programPath.scope,\n imported, // local / import\n exported, // local name => exported name list\n buildImportReference([source, importName, localName], identNode) {\n const meta = metadata.source.get(source);\n meta.referenced = true;\n\n if (localName) {\n if (meta.wrap) {\n // @ts-expect-error Fixme: we should handle the case when identNode is a JSXIdentifier\n identNode = wrapReference(identNode, meta.wrap) ?? identNode;\n }\n return identNode;\n }\n\n let namespace: t.Expression = t.identifier(meta.name);\n if (meta.wrap) {\n namespace = wrapReference(namespace, meta.wrap) ?? namespace;\n }\n\n if (importName === \"default\" && meta.interop === \"node-default\") {\n return namespace;\n }\n\n const computed = metadata.stringSpecifiers.has(importName);\n\n return t.memberExpression(\n namespace,\n computed ? t.stringLiteral(importName) : t.identifier(importName),\n computed,\n );\n },\n };\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n programPath.traverse(rewriteReferencesVisitor, rewriteReferencesVisitorState);\n}\n\n/**\n * A visitor to inject export update statements during binding initialization.\n */\nconst rewriteBindingInitVisitor: Visitor<RewriteBindingInitVisitorState> = {\n Scope(path) {\n path.skip();\n },\n ClassDeclaration(path) {\n const { requeueInParent, exported, metadata } = this;\n\n const { id } = path.node;\n if (!id) throw new Error(\"Expected class to have a name\");\n const localName = id.name;\n\n const exportNames = exported.get(localName) || [];\n if (exportNames.length > 0) {\n const statement = t.expressionStatement(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n buildBindingExportAssignmentExpression(\n metadata,\n exportNames,\n t.identifier(localName),\n path.scope,\n ),\n );\n // @ts-expect-error todo(flow->ts): avoid mutations\n statement._blockHoist = path.node._blockHoist;\n\n requeueInParent(path.insertAfter(statement)[0]);\n }\n },\n VariableDeclaration(path) {\n const { requeueInParent, exported, metadata } = this;\n\n const isVar = path.node.kind === \"var\";\n\n for (const decl of path.get(\"declarations\")) {\n const { id } = decl.node;\n let { init } = decl.node;\n if (\n t.isIdentifier(id) &&\n exported.has(id.name) &&\n !t.isArrowFunctionExpression(init) &&\n (!t.isFunctionExpression(init) || init.id) &&\n (!t.isClassExpression(init) || init.id)\n ) {\n if (!init) {\n if (isVar) {\n // This variable might have already been assigned to, and the\n // uninitalized declaration doesn't set it to `undefined` and does\n // not updated the exported value.\n continue;\n } else {\n init = path.scope.buildUndefinedNode();\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n decl.node.init = buildBindingExportAssignmentExpression(\n metadata,\n exported.get(id.name),\n init,\n path.scope,\n );\n requeueInParent(decl.get(\"init\"));\n } else {\n for (const localName of Object.keys(\n decl.getOuterBindingIdentifiers(),\n )) {\n if (exported.has(localName)) {\n const statement = t.expressionStatement(\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n buildBindingExportAssignmentExpression(\n metadata,\n exported.get(localName),\n t.identifier(localName),\n path.scope,\n ),\n );\n // @ts-expect-error todo(flow->ts): avoid mutations\n statement._blockHoist = path.node._blockHoist;\n\n requeueInParent(path.insertAfter(statement)[0]);\n }\n }\n }\n }\n },\n};\n\nconst buildBindingExportAssignmentExpression = (\n metadata: ModuleMetadata,\n exportNames: string[],\n localExpr: t.Expression,\n scope: Scope,\n) => {\n const exportsObjectName = metadata.exportName;\n for (\n let currentScope = scope;\n currentScope != null;\n currentScope = currentScope.parent\n ) {\n if (currentScope.hasOwnBinding(exportsObjectName)) {\n currentScope.rename(exportsObjectName);\n }\n }\n return (exportNames || []).reduce((expr, exportName) => {\n // class Foo {} export { Foo, Foo as Bar };\n // as\n // class Foo {} exports.Foo = exports.Bar = Foo;\n const { stringSpecifiers } = metadata;\n const computed = stringSpecifiers.has(exportName);\n return t.assignmentExpression(\n \"=\",\n t.memberExpression(\n t.identifier(exportsObjectName),\n computed ? t.stringLiteral(exportName) : t.identifier(exportName),\n /* computed */ computed,\n ),\n expr,\n );\n }, localExpr);\n};\n\nconst buildImportThrow = (localName: string) => {\n return template.expression.ast`\n (function() {\n throw new Error('\"' + '${localName}' + '\" is read-only.');\n })()\n `;\n};\n\nconst rewriteReferencesVisitor: Visitor<RewriteReferencesVisitorState> = {\n ReferencedIdentifier(path) {\n const { seen, buildImportReference, scope, imported, requeueInParent } =\n this;\n if (seen.has(path.node)) return;\n seen.add(path.node);\n\n const localName = path.node.name;\n\n const importData = imported.get(localName);\n if (importData) {\n if (isInType(path)) {\n throw path.buildCodeFrameError(\n `Cannot transform the imported binding \"${localName}\" since it's also used in a type annotation. ` +\n `Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.`,\n );\n }\n\n const localBinding = path.scope.getBinding(localName);\n const rootBinding = scope.getBinding(localName);\n\n // redeclared in this scope\n if (rootBinding !== localBinding) return;\n\n const ref = buildImportReference(importData, path.node);\n\n // Preserve the binding location so that sourcemaps are nicer.\n ref.loc = path.node.loc;\n\n if (\n (path.parentPath.isCallExpression({ callee: path.node }) ||\n path.parentPath.isOptionalCallExpression({ callee: path.node }) ||\n path.parentPath.isTaggedTemplateExpression({ tag: path.node })) &&\n t.isMemberExpression(ref)\n ) {\n path.replaceWith(t.sequenceExpression([t.numericLiteral(0), ref]));\n } else if (path.isJSXIdentifier() && t.isMemberExpression(ref)) {\n const { object, property } = ref;\n path.replaceWith(\n t.jsxMemberExpression(\n // @ts-expect-error todo(flow->ts): possible bug `object` might not have a name\n t.jsxIdentifier(object.name),\n // @ts-expect-error todo(flow->ts): possible bug `property` might not have a name\n t.jsxIdentifier(property.name),\n ),\n );\n } else {\n path.replaceWith(ref);\n }\n\n requeueInParent(path);\n\n // The path could have been replaced with an identifier that would\n // otherwise be re-visited, so we skip processing its children.\n path.skip();\n }\n },\n\n UpdateExpression(path) {\n const {\n scope,\n seen,\n imported,\n exported,\n requeueInParent,\n buildImportReference,\n } = this;\n\n if (seen.has(path.node)) return;\n\n seen.add(path.node);\n\n const arg = path.get(\"argument\");\n\n // No change needed\n if (arg.isMemberExpression()) return;\n\n const update = path.node;\n\n if (arg.isIdentifier()) {\n const localName = arg.node.name;\n\n // redeclared in this scope\n if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {\n return;\n }\n\n const exportedNames = exported.get(localName);\n const importData = imported.get(localName);\n\n if (exportedNames?.length > 0 || importData) {\n if (importData) {\n path.replaceWith(\n t.assignmentExpression(\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n (update.operator[0] + \"=\") as t.AssignmentExpression[\"operator\"],\n buildImportReference(importData, arg.node),\n buildImportThrow(localName),\n ),\n );\n } else if (update.prefix) {\n // ++foo\n // => exports.foo = ++foo\n path.replaceWith(\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n t.cloneNode(update),\n path.scope,\n ),\n );\n } else {\n // foo++\n // => (ref = i++, exports.i = i, ref)\n const ref = scope.generateDeclaredUidIdentifier(localName);\n\n path.replaceWith(\n t.sequenceExpression([\n t.assignmentExpression(\n \"=\",\n t.cloneNode(ref),\n t.cloneNode(update),\n ),\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n t.identifier(localName),\n path.scope,\n ),\n t.cloneNode(ref),\n ]),\n );\n }\n }\n }\n\n requeueInParent(path);\n path.skip();\n },\n\n AssignmentExpression: {\n exit(path) {\n const {\n scope,\n seen,\n imported,\n exported,\n requeueInParent,\n buildImportReference,\n } = this;\n\n if (seen.has(path.node)) return;\n seen.add(path.node);\n\n const left = path.get(\"left\");\n\n // No change needed\n if (left.isMemberExpression()) return;\n\n if (left.isIdentifier()) {\n // Simple update-assign foo += 1; export { foo };\n // => exports.foo = (foo += 1);\n const localName = left.node.name;\n\n // redeclared in this scope\n if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {\n return;\n }\n\n const exportedNames = exported.get(localName);\n const importData = imported.get(localName);\n if (exportedNames?.length > 0 || importData) {\n assert(path.node.operator === \"=\", \"Path was not simplified\");\n\n const assignment = path.node;\n\n if (importData) {\n assignment.left = buildImportReference(importData, left.node);\n\n assignment.right = t.sequenceExpression([\n assignment.right,\n buildImportThrow(localName),\n ]);\n }\n\n path.replaceWith(\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n assignment,\n path.scope,\n ),\n );\n requeueInParent(path);\n }\n } else {\n const ids = left.getOuterBindingIdentifiers();\n const programScopeIds = Object.keys(ids).filter(\n localName =>\n scope.getBinding(localName) === path.scope.getBinding(localName),\n );\n const id = programScopeIds.find(localName => imported.has(localName));\n\n if (id) {\n path.node.right = t.sequenceExpression([\n path.node.right,\n buildImportThrow(id),\n ]);\n }\n\n // Complex ({a, b, c} = {}); export { a, c };\n // => ({a, b, c} = {}), (exports.a = a, exports.c = c);\n const items: t.Expression[] = [];\n programScopeIds.forEach(localName => {\n const exportedNames = exported.get(localName) || [];\n if (exportedNames.length > 0) {\n items.push(\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n t.identifier(localName),\n path.scope,\n ),\n );\n }\n });\n\n if (items.length > 0) {\n let node: t.Node = t.sequenceExpression(items);\n if (path.parentPath.isExpressionStatement()) {\n node = t.expressionStatement(node);\n // @ts-expect-error todo(flow->ts): avoid mutations\n node._blockHoist = path.parentPath.node._blockHoist;\n }\n\n const statement = path.insertAfter(node)[0];\n requeueInParent(statement);\n }\n }\n },\n },\n \"ForOfStatement|ForInStatement\"(\n path: NodePath<t.ForOfStatement | t.ForInStatement>,\n ) {\n const { scope, node } = path;\n const { left } = node;\n const { exported, imported, scope: programScope } = this;\n\n if (!t.isVariableDeclaration(left)) {\n let didTransformExport = false,\n importConstViolationName;\n const loopBodyScope = path.get(\"body\").scope;\n for (const name of Object.keys(t.getOuterBindingIdentifiers(left))) {\n if (programScope.getBinding(name) === scope.getBinding(name)) {\n if (exported.has(name)) {\n didTransformExport = true;\n if (loopBodyScope.hasOwnBinding(name)) {\n loopBodyScope.rename(name);\n }\n }\n if (imported.has(name) && !importConstViolationName) {\n importConstViolationName = name;\n }\n }\n }\n if (!didTransformExport && !importConstViolationName) {\n return;\n }\n\n path.ensureBlock();\n const bodyPath = path.get(\"body\") as NodePath<t.BlockStatement>;\n\n const newLoopId = scope.generateUidIdentifierBasedOnNode(left);\n path\n .get(\"left\")\n .replaceWith(\n t.variableDeclaration(\"let\", [\n t.variableDeclarator(t.cloneNode(newLoopId)),\n ]),\n );\n scope.registerDeclaration(path.get(\"left\"));\n\n if (didTransformExport) {\n bodyPath.unshiftContainer(\n \"body\",\n t.expressionStatement(t.assignmentExpression(\"=\", left, newLoopId)),\n );\n }\n if (importConstViolationName) {\n bodyPath.unshiftContainer(\n \"body\",\n t.expressionStatement(buildImportThrow(importConstViolationName)),\n );\n }\n }\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,mBAAA,GAAAF,OAAA;AAwBA,SAASG,QAAQA,CAACC,IAAc,EAAE;EAChC,GAAG;IACD,QAAQA,IAAI,CAACC,MAAM,CAACC,IAAI;MACtB,KAAK,kBAAkB;MACvB,KAAK,wBAAwB;MAC7B,KAAK,iBAAiB;MACtB,KAAK,gBAAgB;MACrB,KAAK,WAAW;QACd,OAAO,IAAI;MACb,KAAK,iBAAiB;QACpB,OAEIF,IAAI,CAACG,UAAU,CAACF,MAAM,CAGtBG,UAAU,KAAK,MAAM;MAE3B;QACE,IAAIJ,IAAI,CAACG,UAAU,CAACE,WAAW,CAAC,CAAC,IAAIL,IAAI,CAACG,UAAU,CAACG,YAAY,CAAC,CAAC,EAAE;UACnE,OAAO,KAAK;QACd;IACJ;EACF,CAAC,QAASN,IAAI,GAAGA,IAAI,CAACG,UAAU;AAClC;AAEe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4H,mBAAmB,CAACzJ,IAAI,CAACyB,GAAG,CAAC,MAAM,CAAC,CAAC;MAE3C,IAAIuH,kBAAkB,EAAE;QACtBI,QAAQ,CAACM,gBAAgB,CACvB,MAAM,EACN1G,WAAC,CAACoB,mBAAmB,CAACpB,WAAC,CAAC4C,oBAAoB,CAAC,GAAG,EAAEsC,IAAI,EAAEmB,SAAS,CAAC,CACpE,CAAC;MACH;MACA,IAAIJ,wBAAwB,EAAE;QAC5BG,QAAQ,CAACM,gBAAgB,CACvB,MAAM,EACN1G,WAAC,CAACoB,mBAAmB,CAACyB,gBAAgB,CAACoD,wBAAwB,CAAC,CAClE,CAAC;MACH;IACF;EACF;AACF,CAAC","ignoreList":[]} \ No newline at end of file
diff --git a/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js b/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js
deleted file mode 100644
index b5376524..00000000
--- a/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js
+++ /dev/null
@@ -1,22 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = rewriteThis;
-var _core = require("@babel/core");
-var _traverse = require("@babel/traverse");
-let rewriteThisVisitor;
-function rewriteThis(programPath) {
- if (!rewriteThisVisitor) {
- rewriteThisVisitor = _traverse.visitors.environmentVisitor({
- ThisExpression(path) {
- path.replaceWith(_core.types.unaryExpression("void", _core.types.numericLiteral(0), true));
- }
- });
- rewriteThisVisitor.noScope = true;
- }
- (0, _traverse.default)(programPath.node, rewriteThisVisitor);
-}
-
-//# sourceMappingURL=rewrite-this.js.map
diff --git a/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js.map b/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js.map
deleted file mode 100644
index 3cdfc3f8..00000000
--- a/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"names":["_core","require","_traverse","rewriteThisVisitor","rewriteThis","programPath","visitors","environmentVisitor","ThisExpression","path","replaceWith","t","unaryExpression","numericLiteral","noScope","traverse","node"],"sources":["../src/rewrite-this.ts"],"sourcesContent":["import { types as t } from \"@babel/core\";\nimport traverse, { visitors, type NodePath } from \"@babel/traverse\";\n\n/**\n * A lazily constructed visitor to walk the tree, rewriting all `this` references in the\n * top-level scope to be `void 0` (undefined).\n *\n */\nlet rewriteThisVisitor: Parameters<typeof traverse>[1];\n\nexport default function rewriteThis(programPath: NodePath) {\n if (!rewriteThisVisitor) {\n rewriteThisVisitor = visitors.environmentVisitor({\n ThisExpression(path) {\n path.replaceWith(t.unaryExpression(\"void\", t.numericLiteral(0), true));\n },\n });\n rewriteThisVisitor.noScope = true;\n }\n // Rewrite \"this\" to be \"undefined\".\n traverse(programPath.node, rewriteThisVisitor);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAOA,IAAIE,kBAAkD;AAEvC,SAASC,WAAWA,CAACC,WAAqB,EAAE;EACzD,IAAI,CAACF,kBAAkB,EAAE;IACvBA,kBAAkB,GAAGG,kBAAQ,CAACC,kBAAkB,CAAC;MAC/CC,cAAcA,CAACC,IAAI,EAAE;QACnBA,IAAI,CAACC,WAAW,CAACC,WAAC,CAACC,eAAe,CAAC,MAAM,EAAED,WAAC,CAACE,cAAc,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;MACxE;IACF,CAAC,CAAC;IACFV,kBAAkB,CAACW,OAAO,GAAG,IAAI;EACnC;EAEA,IAAAC,iBAAQ,EAACV,WAAW,CAACW,IAAI,EAAEb,kBAAkB,CAAC;AAChD","ignoreList":[]} \ No newline at end of file