{"version":3,"names":["_helperPluginUtils","require","_helperHoistVariables","_core","_helperModuleTransforms","_helperValidatorIdentifier","buildTemplate","template","statement","buildExportAll","MISSING_PLUGIN_WARNING","MISSING_PLUGIN_ERROR","getExportSpecifierName","node","stringSpecifiers","type","name","stringValue","value","isIdentifierName","add","Error","constructExportCall","path","exportIdent","exportNames","exportValues","exportStarTarget","statements","length","push","t","expressionStatement","callExpression","stringLiteral","objectProperties","i","exportName","exportValue","objectProperty","has","identifier","objectExpression","exportObj","scope","generateUid","variableDeclaration","variableDeclarator","KEY","generateUidIdentifier","EXPORT_OBJ","TARGET","assignmentExpression","memberExpression","_default","declare","api","options","assertVersion","systemGlobal","allowTopLevelThis","reassignmentVisited","WeakSet","reassignmentVisitor","AssignmentExpression|UpdateExpression","arg","isAssignmentExpression","get","isObjectPattern","isArrayPattern","exprs","Object","keys","getBindingIdentifiers","getBinding","exportedNames","exports","exportedName","buildCall","expression","replaceWith","sequenceExpression","isIdentifier","isPostUpdateExpression","isUpdateExpression","prefix","binaryExpression","operator","unaryExpression","cloneNode","argument","numericLiteral","pre","file","set","visitor","types","importExpression","state","isCallExpression","isImport","callee","console","warn","buildDynamicImport","specifier","contextIdent","MetaProperty","meta","property","ReferencedIdentifier","hasBinding","Program","enter","Set","rewriteThis","exit","exportMap","create","modules","beforeBody","setters","sources","variableIds","removedPaths","addExportName","key","val","pushModule","source","specifiers","module","forEach","m","imports","concat","buildExportCall","body","isFunctionDeclaration","isClassDeclaration","id","toExpression","isVariableDeclaration","kind","isImportDeclaration","removeBinding","remove","isExportAllDeclaration","isExportDefaultDeclaration","declar","declaration","buildUndefinedNode","isExportNamedDeclaration","isFunction","isClass","nodes","local","exported","binding","replaceWithMultiple","setterBody","target","isImportNamespaceSpecifier","isImportDefaultSpecifier","importSpecifier","isImportSpecifier","imported","hasExportStar","isExportSpecifier","isStringLiteral","functionExpression","blockStatement","moduleName","getModuleName","opts","hoistVariables","hasInit","unshift","map","traverse","hasTLA","AwaitExpression","stop","Function","skip","noScope","SYSTEM_REGISTER","BEFORE_BODY","MODULE_NAME","SETTERS","arrayExpression","EXECUTE","SOURCES","EXPORT_IDENTIFIER","CONTEXT_IDENTIFIER","default"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport hoistVariables from \"@babel/helper-hoist-variables\";\nimport { template, types as t, type PluginPass } from \"@babel/core\";\nimport {\n buildDynamicImport,\n getModuleName,\n rewriteThis,\n} from \"@babel/helper-module-transforms\";\nimport type { PluginOptions } from \"@babel/helper-module-transforms\";\nimport { isIdentifierName } from \"@babel/helper-validator-identifier\";\nimport type { NodePath, Scope, Visitor } from \"@babel/traverse\";\n\nconst buildTemplate = template.statement(`\n SYSTEM_REGISTER(MODULE_NAME, SOURCES, function (EXPORT_IDENTIFIER, CONTEXT_IDENTIFIER) {\n \"use strict\";\n BEFORE_BODY;\n return {\n setters: SETTERS,\n execute: EXECUTE,\n };\n });\n`);\n\nconst buildExportAll = template.statement(`\n for (var KEY in TARGET) {\n if (KEY !== \"default\" && KEY !== \"__esModule\") EXPORT_OBJ[KEY] = TARGET[KEY];\n }\n`);\n\nconst MISSING_PLUGIN_WARNING = `\\\nWARNING: Dynamic import() transformation must be enabled using the\n @babel/plugin-transform-dynamic-import plugin. Babel 8 will\n no longer transform import() without using that plugin.\n`;\n\nconst MISSING_PLUGIN_ERROR = `\\\nERROR: Dynamic import() transformation must be enabled using the\n @babel/plugin-transform-dynamic-import plugin. Babel 8\n no longer transforms import() without using that plugin.\n`;\n\n//todo: use getExportSpecifierName in `helper-module-transforms` when this library is refactored to NodePath usage.\n\nexport function getExportSpecifierName(\n node: t.Node,\n stringSpecifiers: Set,\n): string {\n if (node.type === \"Identifier\") {\n return node.name;\n } else if (node.type === \"StringLiteral\") {\n const stringValue = 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 ${node.type}`,\n );\n }\n}\n\ntype PluginState = {\n contextIdent: string;\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;\n};\n\ntype ModuleMetadata = {\n key: string;\n imports: any[];\n exports: any[];\n};\n\nfunction constructExportCall(\n path: NodePath,\n exportIdent: t.Identifier,\n exportNames: string[],\n exportValues: t.Expression[],\n exportStarTarget: t.Identifier | null,\n stringSpecifiers: Set,\n) {\n const statements = [];\n if (!exportStarTarget) {\n if (exportNames.length === 1) {\n statements.push(\n t.expressionStatement(\n t.callExpression(exportIdent, [\n t.stringLiteral(exportNames[0]),\n exportValues[0],\n ]),\n ),\n );\n } else {\n const objectProperties = [];\n for (let i = 0; i < exportNames.length; i++) {\n const exportName = exportNames[i];\n const exportValue = exportValues[i];\n objectProperties.push(\n t.objectProperty(\n stringSpecifiers.has(exportName)\n ? t.stringLiteral(exportName)\n : t.identifier(exportName),\n exportValue,\n ),\n );\n }\n statements.push(\n t.expressionStatement(\n t.callExpression(exportIdent, [t.objectExpression(objectProperties)]),\n ),\n );\n }\n } else {\n const exportObj = path.scope.generateUid(\"exportObj\");\n\n statements.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.identifier(exportObj), t.objectExpression([])),\n ]),\n );\n\n statements.push(\n buildExportAll({\n KEY: path.scope.generateUidIdentifier(\"key\"),\n EXPORT_OBJ: t.identifier(exportObj),\n TARGET: exportStarTarget,\n }),\n );\n\n for (let i = 0; i < exportNames.length; i++) {\n const exportName = exportNames[i];\n const exportValue = exportValues[i];\n\n statements.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.memberExpression(\n t.identifier(exportObj),\n t.identifier(exportName),\n ),\n exportValue,\n ),\n ),\n );\n }\n\n statements.push(\n t.expressionStatement(\n t.callExpression(exportIdent, [t.identifier(exportObj)]),\n ),\n );\n }\n return statements;\n}\n\nexport interface Options extends PluginOptions {\n allowTopLevelThis?: boolean;\n systemGlobal?: string;\n}\n\ntype ReassignmentVisitorState = {\n scope: Scope;\n exports: any;\n buildCall: (name: string, value: t.Expression) => t.ExpressionStatement;\n};\n\nexport default declare((api, options: Options) => {\n api.assertVersion(7);\n\n const { systemGlobal = \"System\", allowTopLevelThis = false } = options;\n const reassignmentVisited = new WeakSet();\n\n const reassignmentVisitor: Visitor = {\n \"AssignmentExpression|UpdateExpression\"(\n path: NodePath,\n ) {\n if (reassignmentVisited.has(path.node)) return;\n reassignmentVisited.add(path.node);\n\n const arg = path.isAssignmentExpression()\n ? path.get(\"left\")\n : path.get(\"argument\");\n\n if (arg.isObjectPattern() || arg.isArrayPattern()) {\n const exprs: t.SequenceExpression[\"expressions\"] = [path.node];\n for (const name of Object.keys(arg.getBindingIdentifiers())) {\n if (this.scope.getBinding(name) !== path.scope.getBinding(name)) {\n return;\n }\n const exportedNames = this.exports[name];\n if (!exportedNames) continue;\n for (const exportedName of exportedNames) {\n exprs.push(\n this.buildCall(exportedName, t.identifier(name)).expression,\n );\n }\n }\n path.replaceWith(t.sequenceExpression(exprs));\n return;\n }\n\n if (!arg.isIdentifier()) return;\n\n const name = arg.node.name;\n\n // redeclared in this scope\n if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return;\n\n const exportedNames = this.exports[name];\n if (!exportedNames) return;\n\n let node: t.Expression = path.node;\n\n // if it is a non-prefix update expression (x++ etc)\n // then we must replace with the expression (_export('x', x + 1), x++)\n // in order to ensure the same update expression value\n const isPostUpdateExpression = t.isUpdateExpression(node, {\n prefix: false,\n });\n if (isPostUpdateExpression) {\n node = t.binaryExpression(\n // @ts-expect-error The operator of a post-update expression must be \"++\" | \"--\"\n node.operator[0],\n t.unaryExpression(\n \"+\",\n t.cloneNode(\n // @ts-expect-error node is UpdateExpression\n node.argument,\n ),\n ),\n t.numericLiteral(1),\n );\n }\n\n for (const exportedName of exportedNames) {\n node = this.buildCall(exportedName, node).expression;\n }\n\n if (isPostUpdateExpression) {\n node = t.sequenceExpression([node, path.node]);\n }\n\n path.replaceWith(node);\n },\n };\n\n return {\n name: \"transform-modules-systemjs\",\n\n pre() {\n this.file.set(\"@babel/plugin-transform-modules-*\", \"systemjs\");\n },\n\n visitor: {\n [\"CallExpression\" +\n (api.types.importExpression ? \"|ImportExpression\" : \"\")](\n this: PluginPass & PluginState,\n path: NodePath,\n state: PluginState,\n ) {\n if (path.isCallExpression() && !t.isImport(path.node.callee)) return;\n if (path.isCallExpression()) {\n if (!this.file.has(\"@babel/plugin-proposal-dynamic-import\")) {\n if (process.env.BABEL_8_BREAKING) {\n throw new Error(MISSING_PLUGIN_ERROR);\n } else {\n console.warn(MISSING_PLUGIN_WARNING);\n }\n }\n } else {\n // when createImportExpressions is true, we require the dynamic import transform\n if (!this.file.has(\"@babel/plugin-proposal-dynamic-import\")) {\n throw new Error(MISSING_PLUGIN_ERROR);\n }\n }\n path.replaceWith(\n buildDynamicImport(path.node, false, true, specifier =>\n t.callExpression(\n t.memberExpression(\n t.identifier(state.contextIdent),\n t.identifier(\"import\"),\n ),\n [specifier],\n ),\n ),\n );\n },\n\n MetaProperty(path, state: PluginState) {\n if (\n path.node.meta.name === \"import\" &&\n path.node.property.name === \"meta\"\n ) {\n path.replaceWith(\n t.memberExpression(\n t.identifier(state.contextIdent),\n t.identifier(\"meta\"),\n ),\n );\n }\n },\n\n ReferencedIdentifier(path, state) {\n if (\n path.node.name === \"__moduleName\" &&\n !path.scope.hasBinding(\"__moduleName\")\n ) {\n path.replaceWith(\n t.memberExpression(\n t.identifier(state.contextIdent),\n t.identifier(\"id\"),\n ),\n );\n }\n },\n\n Program: {\n enter(path, state) {\n state.contextIdent = path.scope.generateUid(\"context\");\n state.stringSpecifiers = new Set();\n if (!allowTopLevelThis) {\n rewriteThis(path);\n }\n },\n exit(path, state) {\n const scope = path.scope;\n const exportIdent = scope.generateUid(\"export\");\n const { contextIdent, stringSpecifiers } = state;\n\n const exportMap: Record = Object.create(null);\n const modules: ModuleMetadata[] = [];\n\n const beforeBody = [];\n const setters: t.Expression[] = [];\n const sources: t.StringLiteral[] = [];\n const variableIds = [];\n const removedPaths = [];\n\n function addExportName(key: string, val: string) {\n exportMap[key] = exportMap[key] || [];\n exportMap[key].push(val);\n }\n\n function pushModule(\n source: string,\n key: \"imports\" | \"exports\",\n specifiers: t.ModuleSpecifier[] | t.ExportAllDeclaration,\n ) {\n let module: ModuleMetadata;\n modules.forEach(function (m) {\n if (m.key === source) {\n module = m;\n }\n });\n if (!module) {\n modules.push(\n (module = { key: source, imports: [], exports: [] }),\n );\n }\n module[key] = module[key].concat(specifiers);\n }\n\n function buildExportCall(name: string, val: t.Expression) {\n return t.expressionStatement(\n t.callExpression(t.identifier(exportIdent), [\n t.stringLiteral(name),\n val,\n ]),\n );\n }\n\n const exportNames = [];\n const exportValues: t.Expression[] = [];\n\n const body = path.get(\"body\");\n\n for (const path of body) {\n if (path.isFunctionDeclaration()) {\n beforeBody.push(path.node);\n removedPaths.push(path);\n } else if (path.isClassDeclaration()) {\n variableIds.push(t.cloneNode(path.node.id));\n path.replaceWith(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.cloneNode(path.node.id),\n t.toExpression(path.node),\n ),\n ),\n );\n } else if (path.isVariableDeclaration()) {\n // Convert top-level variable declarations to \"var\",\n // because they must be hoisted\n path.node.kind = \"var\";\n } else if (path.isImportDeclaration()) {\n const source = path.node.source.value;\n pushModule(source, \"imports\", path.node.specifiers);\n for (const name of Object.keys(path.getBindingIdentifiers())) {\n scope.removeBinding(name);\n variableIds.push(t.identifier(name));\n }\n path.remove();\n } else if (path.isExportAllDeclaration()) {\n pushModule(path.node.source.value, \"exports\", path.node);\n path.remove();\n } else if (path.isExportDefaultDeclaration()) {\n const declar = path.node.declaration;\n if (t.isClassDeclaration(declar)) {\n const id = declar.id;\n if (id) {\n exportNames.push(\"default\");\n exportValues.push(scope.buildUndefinedNode());\n variableIds.push(t.cloneNode(id));\n addExportName(id.name, \"default\");\n path.replaceWith(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.cloneNode(id),\n t.toExpression(declar),\n ),\n ),\n );\n } else {\n exportNames.push(\"default\");\n exportValues.push(t.toExpression(declar));\n removedPaths.push(path);\n }\n } else if (t.isFunctionDeclaration(declar)) {\n const id = declar.id;\n if (id) {\n beforeBody.push(declar);\n exportNames.push(\"default\");\n exportValues.push(t.cloneNode(id));\n addExportName(id.name, \"default\");\n } else {\n exportNames.push(\"default\");\n exportValues.push(t.toExpression(declar));\n }\n removedPaths.push(path);\n } else {\n // @ts-expect-error TSDeclareFunction is not expected here\n path.replaceWith(buildExportCall(\"default\", declar));\n }\n } else if (path.isExportNamedDeclaration()) {\n const declar = path.node.declaration;\n\n if (declar) {\n path.replaceWith(declar);\n\n if (t.isFunction(declar)) {\n const name = declar.id.name;\n addExportName(name, name);\n beforeBody.push(declar);\n exportNames.push(name);\n exportValues.push(t.cloneNode(declar.id));\n removedPaths.push(path);\n } else if (t.isClass(declar)) {\n const name = declar.id.name;\n exportNames.push(name);\n exportValues.push(scope.buildUndefinedNode());\n variableIds.push(t.cloneNode(declar.id));\n path.replaceWith(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.cloneNode(declar.id),\n t.toExpression(declar),\n ),\n ),\n );\n addExportName(name, name);\n } else {\n if (t.isVariableDeclaration(declar)) {\n // Convert top-level variable declarations to \"var\",\n // because they must be hoisted\n declar.kind = \"var\";\n }\n for (const name of Object.keys(\n t.getBindingIdentifiers(declar),\n )) {\n addExportName(name, name);\n }\n }\n } else {\n const specifiers = path.node.specifiers;\n if (specifiers?.length) {\n if (path.node.source) {\n pushModule(path.node.source.value, \"exports\", specifiers);\n path.remove();\n } else {\n const nodes = [];\n\n for (const specifier of specifiers) {\n // @ts-expect-error This isn't an \"export ... from\" declaration\n // because path.node.source is falsy, so the local specifier exists.\n const { local, exported } = specifier;\n\n const binding = scope.getBinding(local.name);\n const exportedName = getExportSpecifierName(\n exported,\n stringSpecifiers,\n );\n // hoisted function export\n if (\n binding &&\n t.isFunctionDeclaration(binding.path.node)\n ) {\n exportNames.push(exportedName);\n exportValues.push(t.cloneNode(local));\n }\n // only globals also exported this way\n else if (!binding) {\n nodes.push(buildExportCall(exportedName, local));\n }\n addExportName(local.name, exportedName);\n }\n\n path.replaceWithMultiple(nodes);\n }\n } else {\n path.remove();\n }\n }\n }\n }\n\n modules.forEach(function (specifiers) {\n const setterBody = [];\n const target = scope.generateUid(specifiers.key);\n\n for (let specifier of specifiers.imports) {\n if (t.isImportNamespaceSpecifier(specifier)) {\n setterBody.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n specifier.local,\n t.identifier(target),\n ),\n ),\n );\n } else if (t.isImportDefaultSpecifier(specifier)) {\n specifier = t.importSpecifier(\n specifier.local,\n t.identifier(\"default\"),\n );\n }\n\n if (t.isImportSpecifier(specifier)) {\n const { imported } = specifier;\n setterBody.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n specifier.local,\n t.memberExpression(\n t.identifier(target),\n specifier.imported,\n /* computed */ imported.type === \"StringLiteral\",\n ),\n ),\n ),\n );\n }\n }\n\n if (specifiers.exports.length) {\n const exportNames = [];\n const exportValues = [];\n let hasExportStar = false;\n\n for (const node of specifiers.exports) {\n if (t.isExportAllDeclaration(node)) {\n hasExportStar = true;\n } else if (t.isExportSpecifier(node)) {\n const exportedName = getExportSpecifierName(\n node.exported,\n stringSpecifiers,\n );\n exportNames.push(exportedName);\n exportValues.push(\n t.memberExpression(\n t.identifier(target),\n node.local,\n t.isStringLiteral(node.local),\n ),\n );\n } else {\n // todo\n }\n }\n\n setterBody.push(\n ...constructExportCall(\n path,\n t.identifier(exportIdent),\n exportNames,\n exportValues,\n hasExportStar ? t.identifier(target) : null,\n stringSpecifiers,\n ),\n );\n }\n\n sources.push(t.stringLiteral(specifiers.key));\n setters.push(\n t.functionExpression(\n null,\n [t.identifier(target)],\n t.blockStatement(setterBody),\n ),\n );\n });\n\n let moduleName = getModuleName(this.file.opts, options);\n // @ts-expect-error todo(flow->ts): do not reuse variables\n if (moduleName) moduleName = t.stringLiteral(moduleName);\n\n hoistVariables(path, (id, name, hasInit) => {\n variableIds.push(id);\n if (!hasInit && name in exportMap) {\n for (const exported of exportMap[name]) {\n exportNames.push(exported);\n exportValues.push(scope.buildUndefinedNode());\n }\n }\n });\n\n if (variableIds.length) {\n beforeBody.unshift(\n t.variableDeclaration(\n \"var\",\n variableIds.map(id => t.variableDeclarator(id)),\n ),\n );\n }\n\n if (exportNames.length) {\n beforeBody.push(\n ...constructExportCall(\n path,\n t.identifier(exportIdent),\n exportNames,\n exportValues,\n null,\n stringSpecifiers,\n ),\n );\n }\n\n path.traverse(reassignmentVisitor, {\n exports: exportMap,\n buildCall: buildExportCall,\n scope,\n });\n\n for (const path of removedPaths) {\n path.remove();\n }\n\n let hasTLA = false;\n path.traverse({\n AwaitExpression(path) {\n hasTLA = true;\n path.stop();\n },\n Function(path) {\n path.skip();\n },\n // @ts-expect-error - todo: add noScope to type definitions\n noScope: true,\n });\n\n path.node.body = [\n buildTemplate({\n SYSTEM_REGISTER: t.memberExpression(\n t.identifier(systemGlobal),\n t.identifier(\"register\"),\n ),\n BEFORE_BODY: beforeBody,\n MODULE_NAME: moduleName,\n SETTERS: t.arrayExpression(setters),\n EXECUTE: t.functionExpression(\n null,\n [],\n t.blockStatement(path.node.body),\n false,\n hasTLA,\n ),\n SOURCES: t.arrayExpression(sources),\n EXPORT_IDENTIFIER: t.identifier(exportIdent),\n CONTEXT_IDENTIFIER: t.identifier(contextIdent),\n }),\n ];\n },\n },\n },\n };\n});\n"],"mappings":";;;;;;;AAAA,IAAAA,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