Spaces:
Sleeping
Sleeping
Include updated package-lock.json (part 3)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- node_modules/@babel/helper-module-imports/lib/import-injector.js.map +1 -0
- node_modules/@babel/helper-module-imports/lib/index.js +37 -0
- node_modules/@babel/helper-module-imports/lib/index.js.map +1 -0
- node_modules/@babel/helper-module-imports/lib/is-module.js +11 -0
- node_modules/@babel/helper-module-imports/lib/is-module.js.map +1 -0
- node_modules/@babel/helper-module-imports/package.json +28 -0
- node_modules/@babel/helper-module-transforms/LICENSE +22 -0
- node_modules/@babel/helper-module-transforms/README.md +19 -0
- node_modules/@babel/helper-module-transforms/lib/dynamic-import.js +46 -0
- node_modules/@babel/helper-module-transforms/lib/dynamic-import.js.map +1 -0
- node_modules/@babel/helper-module-transforms/lib/get-module-name.js +46 -0
- node_modules/@babel/helper-module-transforms/lib/get-module-name.js.map +1 -0
- node_modules/@babel/helper-module-transforms/lib/index.js +396 -0
- node_modules/@babel/helper-module-transforms/lib/index.js.map +1 -0
- node_modules/@babel/helper-module-transforms/lib/lazy-modules.js +31 -0
- node_modules/@babel/helper-module-transforms/lib/lazy-modules.js.map +1 -0
- node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js +362 -0
- node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js.map +1 -0
- node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js +360 -0
- node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js.map +1 -0
- node_modules/@babel/helper-module-transforms/lib/rewrite-this.js +22 -0
- node_modules/@babel/helper-module-transforms/lib/rewrite-this.js.map +1 -0
- node_modules/@babel/helper-module-transforms/package.json +32 -0
- node_modules/@babel/helper-optimise-call-expression/LICENSE +22 -0
- node_modules/@babel/helper-optimise-call-expression/README.md +19 -0
- node_modules/@babel/helper-optimise-call-expression/lib/index.js +33 -0
- node_modules/@babel/helper-optimise-call-expression/lib/index.js.map +1 -0
- node_modules/@babel/helper-optimise-call-expression/package.json +28 -0
- node_modules/@babel/helper-plugin-utils/LICENSE +22 -0
- node_modules/@babel/helper-plugin-utils/README.md +19 -0
- node_modules/@babel/helper-plugin-utils/lib/index.js +74 -0
- node_modules/@babel/helper-plugin-utils/lib/index.js.map +1 -0
- node_modules/@babel/helper-plugin-utils/package.json +24 -0
- node_modules/@babel/helper-remap-async-to-generator/LICENSE +22 -0
- node_modules/@babel/helper-remap-async-to-generator/README.md +19 -0
- node_modules/@babel/helper-remap-async-to-generator/lib/index.js +68 -0
- node_modules/@babel/helper-remap-async-to-generator/lib/index.js.map +1 -0
- node_modules/@babel/helper-remap-async-to-generator/package.json +32 -0
- node_modules/@babel/helper-replace-supers/LICENSE +22 -0
- node_modules/@babel/helper-replace-supers/README.md +19 -0
- node_modules/@babel/helper-replace-supers/lib/index.js +303 -0
- node_modules/@babel/helper-replace-supers/lib/index.js.map +1 -0
- node_modules/@babel/helper-replace-supers/package.json +32 -0
- node_modules/@babel/helper-skip-transparent-expression-wrappers/LICENSE +22 -0
- node_modules/@babel/helper-skip-transparent-expression-wrappers/README.md +19 -0
- node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js +34 -0
- node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js.map +1 -0
- node_modules/@babel/helper-skip-transparent-expression-wrappers/package.json +31 -0
- node_modules/@babel/helper-string-parser/LICENSE +22 -0
- node_modules/@babel/helper-string-parser/README.md +19 -0
node_modules/@babel/helper-module-imports/lib/import-injector.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_assert","require","_t","_importBuilder","_isModule","identifier","importSpecifier","numericLiteral","sequenceExpression","isImportDeclaration","ImportInjector","constructor","path","importedSource","opts","_defaultOpts","importedType","importedInterop","importingInterop","ensureLiveReference","ensureNoContext","importPosition","programPath","find","p","isProgram","_programPath","_programScope","scope","_hub","hub","_applyDefaults","addDefault","importedSourceIn","addNamed","importName","assert","_generateImport","addNamespace","addSideEffect","isInit","newOpts","Object","assign","nameHint","undefined","blockHoist","isDefault","isNamed","isNamespace","name","isMod","isModule","isModuleForNode","isModuleForBabel","Error","builder","ImportBuilder","import","namespace","named","es6Default","default","var","wildcardInterop","defaultInterop","read","prop","statements","resultName","done","_insertStatements","type","_insertStatementsAfter","_insertStatementsBefore","unshiftContainer","length","isValueImport","firstImportDecl","get","node","source","value","maybeAppendImportSpecifiers","forEach","_blockHoist","targetPath","val","Number","isFinite","insertBefore","statementsSet","Set","importDeclarations","Map","statement","has","set","push","lastImportPath","bodyStmt","newImports","decl","delete","size","insertAfter","Array","from","exports","importKind","hasNamespaceImport","specifiers","hasDefaultImport","target","local","unshift","shift"],"sources":["../src/import-injector.ts"],"sourcesContent":["import assert from \"node:assert\";\nimport {\n identifier,\n importSpecifier,\n numericLiteral,\n sequenceExpression,\n isImportDeclaration,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { NodePath, Scope, HubInterface } from \"@babel/traverse\";\n\nimport ImportBuilder from \"./import-builder.ts\";\nimport isModule from \"./is-module.ts\";\n\nexport type ImportOptions = {\n /**\n * The module being referenced.\n */\n importedSource: string | null;\n /**\n * The type of module being imported:\n *\n * * 'es6' - An ES6 module.\n * * 'commonjs' - A CommonJS module. (Default)\n */\n importedType: \"es6\" | \"commonjs\";\n /**\n * The type of interop behavior for namespace/default/named when loading\n * CommonJS modules.\n *\n * ## 'babel' (Default)\n *\n * Load using Babel's interop.\n *\n * If '.__esModule' is true, treat as 'compiled', else:\n *\n * * Namespace: A copy of the module.exports with .default\n * populated by the module.exports object.\n * * Default: The module.exports value.\n * * Named: The .named property of module.exports.\n *\n * The 'ensureLiveReference' has no effect on the liveness of these.\n *\n * ## 'compiled'\n *\n * Assume the module is ES6 compiled to CommonJS. Useful to avoid injecting\n * interop logic if you are confident that the module is a certain format.\n *\n * * Namespace: The root module.exports object.\n * * Default: The .default property of the namespace.\n * * Named: The .named property of the namespace.\n *\n * Will return erroneous results if the imported module is _not_ compiled\n * from ES6 with Babel.\n *\n * ## 'uncompiled'\n *\n * Assume the module is _not_ ES6 compiled to CommonJS. Used a simplified\n * access pattern that doesn't require additional function calls.\n *\n * Will return erroneous results if the imported module _is_ compiled\n * from ES6 with Babel.\n *\n * * Namespace: The module.exports object.\n * * Default: The module.exports object.\n * * Named: The .named property of module.exports.\n */\n importedInterop: \"babel\" | \"node\" | \"compiled\" | \"uncompiled\";\n /**\n * The type of CommonJS interop included in the environment that will be\n * loading the output code.\n *\n * * 'babel' - CommonJS modules load with Babel's interop. (Default)\n * * 'node' - CommonJS modules load with Node's interop.\n *\n * See descriptions in 'importedInterop' for more details.\n */\n importingInterop: \"babel\" | \"node\";\n /**\n * Define whether we explicitly care that the import be a live reference.\n * Only applies when importing default and named imports, not the namespace.\n *\n * * true - Force imported values to be live references.\n * * false - No particular requirements. Keeps the code simplest. (Default)\n */\n ensureLiveReference: boolean;\n /**\n * Define if we explicitly care that the result not be a property reference.\n *\n * * true - Force calls to exclude context. Useful if the value is going to\n * be used as function callee.\n * * false - No particular requirements for context of the access. (Default)\n */\n ensureNoContext: boolean;\n /**\n * Define whether the import should be loaded before or after the existing imports.\n * \"after\" is only allowed inside ECMAScript modules, since it's not possible to\n * reliably pick the location _after_ require() calls but _before_ other code in CJS.\n */\n importPosition: \"before\" | \"after\";\n\n nameHint?: string;\n blockHoist?: number;\n};\n\n/**\n * A general helper classes add imports via transforms. See README for usage.\n */\nexport default class ImportInjector {\n /**\n * The path used for manipulation.\n */\n declare _programPath: NodePath<t.Program>;\n\n /**\n * The scope used to generate unique variable names.\n */\n declare _programScope: Scope;\n\n /**\n * The file used to inject helpers and resolve paths.\n */\n declare _hub: HubInterface;\n\n /**\n * The default options to use with this instance when imports are added.\n */\n _defaultOpts: ImportOptions = {\n importedSource: null,\n importedType: \"commonjs\",\n importedInterop: \"babel\",\n importingInterop: \"babel\",\n ensureLiveReference: false,\n ensureNoContext: false,\n importPosition: \"before\",\n };\n\n constructor(\n path: NodePath,\n importedSource?: string,\n opts?: Partial<ImportOptions>,\n ) {\n const programPath = path.find(p => p.isProgram()) as NodePath<t.Program>;\n\n this._programPath = programPath;\n this._programScope = programPath.scope;\n this._hub = programPath.hub;\n\n this._defaultOpts = this._applyDefaults(importedSource, opts, true);\n }\n\n addDefault(importedSourceIn: string, opts: Partial<ImportOptions>) {\n return this.addNamed(\"default\", importedSourceIn, opts);\n }\n\n addNamed(\n importName: string,\n importedSourceIn: string,\n opts: Partial<ImportOptions>,\n ) {\n assert(typeof importName === \"string\");\n\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n importName,\n );\n }\n\n addNamespace(importedSourceIn: string, opts: Partial<ImportOptions>) {\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n null,\n );\n }\n\n addSideEffect(importedSourceIn: string, opts: Partial<ImportOptions>) {\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n void 0,\n );\n }\n\n _applyDefaults(\n importedSource: string | Partial<ImportOptions>,\n opts: Partial<ImportOptions> | undefined,\n isInit = false,\n ) {\n let newOpts: ImportOptions;\n if (typeof importedSource === \"string\") {\n newOpts = { ...this._defaultOpts, importedSource, ...opts };\n } else {\n assert(!opts, \"Unexpected secondary arguments.\");\n newOpts = { ...this._defaultOpts, ...importedSource };\n }\n\n if (!isInit && opts) {\n if (opts.nameHint !== undefined) newOpts.nameHint = opts.nameHint;\n if (opts.blockHoist !== undefined) newOpts.blockHoist = opts.blockHoist;\n }\n return newOpts;\n }\n\n _generateImport(\n opts: Partial<ImportOptions>,\n importName: string | null | undefined,\n ) {\n const isDefault = importName === \"default\";\n const isNamed = !!importName && !isDefault;\n const isNamespace = importName === null;\n\n const {\n importedSource,\n importedType,\n importedInterop,\n importingInterop,\n ensureLiveReference,\n ensureNoContext,\n nameHint,\n importPosition,\n\n // Not meant for public usage. Allows code that absolutely must control\n // ordering to set a specific hoist value on the import nodes.\n // This is ignored when \"importPosition\" is \"after\".\n blockHoist,\n } = opts;\n\n // Provide a hint for generateUidIdentifier for the local variable name\n // to use for the import, if the code will generate a simple assignment\n // to a variable.\n let name = nameHint || importName;\n\n const isMod = isModule(this._programPath);\n const isModuleForNode = isMod && importingInterop === \"node\";\n const isModuleForBabel = isMod && importingInterop === \"babel\";\n\n if (importPosition === \"after\" && !isMod) {\n throw new Error(`\"importPosition\": \"after\" is only supported in modules`);\n }\n\n const builder = new ImportBuilder(\n importedSource,\n this._programScope,\n this._hub,\n );\n\n if (importedType === \"es6\") {\n if (!isModuleForNode && !isModuleForBabel) {\n throw new Error(\"Cannot import an ES6 module from CommonJS\");\n }\n\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n builder.import();\n if (isNamespace) {\n builder.namespace(nameHint || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else if (importedType !== \"commonjs\") {\n throw new Error(`Unexpected interopType \"${importedType}\"`);\n } else if (importedInterop === \"babel\") {\n if (isModuleForNode) {\n // import _tmp from ''; var namespace = interopRequireWildcard(_tmp); namespace\n // import _tmp from ''; var def = interopRequireDefault(_tmp).default; def\n // import _tmp from ''; _tmp.named\n name = name !== \"default\" ? name : importedSource;\n const es6Default = `${importedSource}$es6Default`;\n\n builder.import();\n if (isNamespace) {\n builder\n .default(es6Default)\n .var(name || importedSource)\n .wildcardInterop();\n } else if (isDefault) {\n if (ensureLiveReference) {\n builder\n .default(es6Default)\n .var(name || importedSource)\n .defaultInterop()\n .read(\"default\");\n } else {\n builder\n .default(es6Default)\n .var(name)\n .defaultInterop()\n .prop(importName);\n }\n } else if (isNamed) {\n builder.default(es6Default).read(importName);\n }\n } else if (isModuleForBabel) {\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n builder.import();\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = interopRequireWildcard(require(''));\n // var def = interopRequireDefault(require('')).default; def\n // var named = require('').named; named\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource).wildcardInterop();\n } else if ((isDefault || isNamed) && ensureLiveReference) {\n if (isDefault) {\n name = name !== \"default\" ? name : importedSource;\n builder.var(name).read(importName);\n builder.defaultInterop();\n } else {\n builder.var(importedSource).read(importName);\n }\n } else if (isDefault) {\n builder.var(name).defaultInterop().prop(importName);\n } else if (isNamed) {\n builder.var(name).prop(importName);\n }\n }\n } else if (importedInterop === \"compiled\") {\n if (isModuleForNode) {\n // import namespace from ''; namespace\n // import namespace from ''; namespace.default\n // import namespace from ''; namespace.named\n\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.default(importedSource).read(name);\n }\n } else if (isModuleForBabel) {\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n // Note: These lookups will break if the module has no __esModule set,\n // hence the warning that 'compiled' will not work on standard CommonJS.\n\n builder.import();\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = require(''); namespace\n // var namespace = require(''); namespace.default\n // var namespace = require(''); namespace.named\n // var named = require('').named;\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource);\n } else if (isDefault || isNamed) {\n if (ensureLiveReference) {\n builder.var(importedSource).read(name);\n } else {\n builder.prop(importName).var(name);\n }\n }\n }\n } else if (importedInterop === \"uncompiled\") {\n if (isDefault && ensureLiveReference) {\n throw new Error(\"No live reference for commonjs default\");\n }\n\n if (isModuleForNode) {\n // import namespace from ''; namespace\n // import def from ''; def;\n // import namespace from ''; namespace.named\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault) {\n builder.default(name);\n } else if (isNamed) {\n builder.default(importedSource).read(name);\n }\n } else if (isModuleForBabel) {\n // import namespace from '';\n // import def from '';\n // import { named } from ''; named;\n // Note: These lookups will break if the module has __esModule set,\n // hence the warning that 'uncompiled' will not work on ES6 transpiled\n // to CommonJS.\n\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault) {\n builder.default(name);\n } else if (isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = require(''); namespace\n // var def = require(''); def\n // var namespace = require(''); namespace.named\n // var named = require('').named;\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource);\n } else if (isDefault) {\n builder.var(name);\n } else if (isNamed) {\n if (ensureLiveReference) {\n builder.var(importedSource).read(name);\n } else {\n builder.var(name).prop(importName);\n }\n }\n }\n } else {\n throw new Error(`Unknown importedInterop \"${importedInterop}\".`);\n }\n\n const { statements, resultName } = builder.done();\n\n this._insertStatements(statements, importPosition, blockHoist);\n\n if (\n (isDefault || isNamed) &&\n ensureNoContext &&\n resultName.type !== \"Identifier\"\n ) {\n return sequenceExpression([numericLiteral(0), resultName]);\n }\n return resultName;\n }\n\n _insertStatements(\n statements: t.Statement[],\n importPosition = \"before\",\n blockHoist = 3,\n ) {\n if (importPosition === \"after\") {\n if (this._insertStatementsAfter(statements)) return;\n } else {\n if (this._insertStatementsBefore(statements, blockHoist)) return;\n }\n\n this._programPath.unshiftContainer(\"body\", statements);\n }\n\n _insertStatementsBefore(statements: t.Statement[], blockHoist: number) {\n if (\n statements.length === 1 &&\n isImportDeclaration(statements[0]) &&\n isValueImport(statements[0])\n ) {\n const firstImportDecl = this._programPath\n .get(\"body\")\n .find((p): p is NodePath<t.ImportDeclaration> => {\n return p.isImportDeclaration() && isValueImport(p.node);\n });\n\n if (\n firstImportDecl?.node.source.value === statements[0].source.value &&\n maybeAppendImportSpecifiers(firstImportDecl.node, statements[0])\n ) {\n return true;\n }\n }\n\n statements.forEach(node => {\n // @ts-expect-error handle _blockHoist\n node._blockHoist = blockHoist;\n });\n\n const targetPath = this._programPath.get(\"body\").find(p => {\n // @ts-expect-error todo(flow->ts): avoid mutations\n const val = p.node._blockHoist;\n return Number.isFinite(val) && val < 4;\n });\n\n if (targetPath) {\n targetPath.insertBefore(statements);\n return true;\n }\n\n return false;\n }\n\n _insertStatementsAfter(statements: t.Statement[]): boolean {\n const statementsSet = new Set(statements);\n const importDeclarations = new Map<string, t.ImportDeclaration[]>();\n\n for (const statement of statements) {\n if (isImportDeclaration(statement) && isValueImport(statement)) {\n const source = statement.source.value;\n if (!importDeclarations.has(source)) importDeclarations.set(source, []);\n importDeclarations.get(source).push(statement);\n }\n }\n\n let lastImportPath = null;\n for (const bodyStmt of this._programPath.get(\"body\")) {\n if (bodyStmt.isImportDeclaration() && isValueImport(bodyStmt.node)) {\n lastImportPath = bodyStmt;\n\n const source = bodyStmt.node.source.value;\n const newImports = importDeclarations.get(source);\n if (!newImports) continue;\n\n for (const decl of newImports) {\n if (!statementsSet.has(decl)) continue;\n if (maybeAppendImportSpecifiers(bodyStmt.node, decl)) {\n statementsSet.delete(decl);\n }\n }\n }\n }\n\n if (statementsSet.size === 0) return true;\n\n if (lastImportPath) lastImportPath.insertAfter(Array.from(statementsSet));\n\n return !!lastImportPath;\n }\n}\n\nfunction isValueImport(node: t.ImportDeclaration) {\n return node.importKind !== \"type\" && node.importKind !== \"typeof\";\n}\n\nfunction hasNamespaceImport(node: t.ImportDeclaration) {\n return (\n (node.specifiers.length === 1 &&\n node.specifiers[0].type === \"ImportNamespaceSpecifier\") ||\n (node.specifiers.length === 2 &&\n node.specifiers[1].type === \"ImportNamespaceSpecifier\")\n );\n}\n\nfunction hasDefaultImport(node: t.ImportDeclaration) {\n return (\n node.specifiers.length > 0 &&\n node.specifiers[0].type === \"ImportDefaultSpecifier\"\n );\n}\n\nfunction maybeAppendImportSpecifiers(\n target: t.ImportDeclaration,\n source: t.ImportDeclaration,\n): boolean {\n if (!target.specifiers.length) {\n target.specifiers = source.specifiers;\n return true;\n }\n if (!source.specifiers.length) return true;\n\n if (hasNamespaceImport(target) || hasNamespaceImport(source)) return false;\n\n if (hasDefaultImport(source)) {\n if (hasDefaultImport(target)) {\n source.specifiers[0] = importSpecifier(\n source.specifiers[0].local,\n identifier(\"default\"),\n );\n } else {\n target.specifiers.unshift(source.specifiers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,CAAC,EAAE,OAAO,KAAK;EAE1E,IAAI+B,gBAAgB,CAAC/B,MAAM,CAAC,EAAE;IAC5B,IAAI+B,gBAAgB,CAACC,MAAM,CAAC,EAAE;MAC5BhC,MAAM,CAAC8B,UAAU,CAAC,CAAC,CAAC,GAAGzG,eAAe,CACpC2E,MAAM,CAAC8B,UAAU,CAAC,CAAC,CAAC,CAACG,KAAK,EAC1B7G,UAAU,CAAC,SAAS,CACtB,CAAC;IACH,CAAC,MAAM;MACL4G,MAAM,CAACF,UAAU,CAACI,OAAO,CAAClC,MAAM,CAAC8B,UAAU,CAACK,KAAK,CAAC,CAAC,CAAC;IACtD;EACF;EAEAH,MAAM,CAACF,UAAU,CAACb,IAAI,CAAC,GAAGjB,MAAM,CAAC8B,UAAU,CAAC;EAE5C,OAAO,IAAI;AACb","ignoreList":[]}
|
node_modules/@babel/helper-module-imports/lib/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
Object.defineProperty(exports, "ImportInjector", {
|
| 7 |
+
enumerable: true,
|
| 8 |
+
get: function () {
|
| 9 |
+
return _importInjector.default;
|
| 10 |
+
}
|
| 11 |
+
});
|
| 12 |
+
exports.addDefault = addDefault;
|
| 13 |
+
exports.addNamed = addNamed;
|
| 14 |
+
exports.addNamespace = addNamespace;
|
| 15 |
+
exports.addSideEffect = addSideEffect;
|
| 16 |
+
Object.defineProperty(exports, "isModule", {
|
| 17 |
+
enumerable: true,
|
| 18 |
+
get: function () {
|
| 19 |
+
return _isModule.default;
|
| 20 |
+
}
|
| 21 |
+
});
|
| 22 |
+
var _importInjector = require("./import-injector.js");
|
| 23 |
+
var _isModule = require("./is-module.js");
|
| 24 |
+
function addDefault(path, importedSource, opts) {
|
| 25 |
+
return new _importInjector.default(path).addDefault(importedSource, opts);
|
| 26 |
+
}
|
| 27 |
+
function addNamed(path, name, importedSource, opts) {
|
| 28 |
+
return new _importInjector.default(path).addNamed(name, importedSource, opts);
|
| 29 |
+
}
|
| 30 |
+
function addNamespace(path, importedSource, opts) {
|
| 31 |
+
return new _importInjector.default(path).addNamespace(importedSource, opts);
|
| 32 |
+
}
|
| 33 |
+
function addSideEffect(path, importedSource, opts) {
|
| 34 |
+
return new _importInjector.default(path).addSideEffect(importedSource, opts);
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@babel/helper-module-imports/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_importInjector","require","_isModule","addDefault","path","importedSource","opts","ImportInjector","addNamed","name","addNamespace","addSideEffect"],"sources":["../src/index.ts"],"sourcesContent":["import ImportInjector, { type ImportOptions } from \"./import-injector.ts\";\nimport type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\n\nexport { ImportInjector };\n\nexport { default as isModule } from \"./is-module.ts\";\n\nexport function addDefault(\n path: NodePath,\n importedSource: string,\n opts?: Partial<ImportOptions>,\n) {\n return new ImportInjector(path).addDefault(importedSource, opts);\n}\n\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Omit<\n Partial<ImportOptions>,\n \"ensureLiveReference\" | \"ensureNoContext\"\n >,\n): t.Identifier;\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Omit<Partial<ImportOptions>, \"ensureLiveReference\"> & {\n ensureLiveReference: true;\n },\n): t.MemberExpression;\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Omit<Partial<ImportOptions>, \"ensureNoContext\"> & {\n ensureNoContext: true;\n },\n): t.SequenceExpression;\n/**\n * add a named import to the program path of given path\n *\n * @export\n * @param {NodePath} path The starting path to find a program path\n * @param {string} name The name of the generated binding. Babel will prefix it with `_`\n * @param {string} importedSource The source of the import\n * @param {Partial<ImportOptions>} [opts]\n * @returns {t.Identifier | t.MemberExpression | t.SequenceExpression} If opts.ensureNoContext is true, returns a SequenceExpression,\n * else if opts.ensureLiveReference is true, returns a MemberExpression, else returns an Identifier\n */\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Partial<ImportOptions>,\n) {\n return new ImportInjector(path).addNamed(name, importedSource, opts);\n}\nexport { addNamed };\n\nexport function addNamespace(\n path: NodePath,\n importedSource: string,\n opts?: Partial<ImportOptions>,\n) {\n return new ImportInjector(path).addNamespace(importedSource, opts);\n}\n\nexport function addSideEffect(\n path: NodePath,\n importedSource: string,\n opts?: Partial<ImportOptions>,\n) {\n return new ImportInjector(path).addSideEffect(importedSource, opts);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAD,OAAA;AAEO,SAASE,UAAUA,CACxBC,IAAc,EACdC,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACD,UAAU,CAACE,cAAc,EAAEC,IAAI,CAAC;AAClE;AAsCA,SAASE,QAAQA,CACfJ,IAAc,EACdK,IAAY,EACZJ,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACI,QAAQ,CAACC,IAAI,EAAEJ,cAAc,EAAEC,IAAI,CAAC;AACtE;AAGO,SAASI,YAAYA,CAC1BN,IAAc,EACdC,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACM,YAAY,CAACL,cAAc,EAAEC,IAAI,CAAC;AACpE;AAEO,SAASK,aAAaA,CAC3BP,IAAc,EACdC,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACO,aAAa,CAACN,cAAc,EAAEC,IAAI,CAAC;AACrE","ignoreList":[]}
|
node_modules/@babel/helper-module-imports/lib/is-module.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.default = isModule;
|
| 7 |
+
function isModule(path) {
|
| 8 |
+
return path.node.sourceType === "module";
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
//# sourceMappingURL=is-module.js.map
|
node_modules/@babel/helper-module-imports/lib/is-module.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["isModule","path","node","sourceType"],"sources":["../src/is-module.ts"],"sourcesContent":["import type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\n\n/**\n * A small utility to check if a file qualifies as a module.\n */\nexport default function isModule(path: NodePath<t.Program>) {\n return path.node.sourceType === \"module\";\n}\n"],"mappings":";;;;;;AAMe,SAASA,QAAQA,CAACC,IAAyB,EAAE;EAC1D,OAAOA,IAAI,CAACC,IAAI,CAACC,UAAU,KAAK,QAAQ;AAC1C","ignoreList":[]}
|
node_modules/@babel/helper-module-imports/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@babel/helper-module-imports",
|
| 3 |
+
"version": "7.29.7",
|
| 4 |
+
"description": "Babel helper functions for inserting module loads",
|
| 5 |
+
"author": "The Babel Team (https://babel.dev/team)",
|
| 6 |
+
"homepage": "https://babel.dev/docs/en/next/babel-helper-module-imports",
|
| 7 |
+
"license": "MIT",
|
| 8 |
+
"publishConfig": {
|
| 9 |
+
"access": "public"
|
| 10 |
+
},
|
| 11 |
+
"repository": {
|
| 12 |
+
"type": "git",
|
| 13 |
+
"url": "https://github.com/babel/babel.git",
|
| 14 |
+
"directory": "packages/babel-helper-module-imports"
|
| 15 |
+
},
|
| 16 |
+
"main": "./lib/index.js",
|
| 17 |
+
"dependencies": {
|
| 18 |
+
"@babel/traverse": "^7.29.7",
|
| 19 |
+
"@babel/types": "^7.29.7"
|
| 20 |
+
},
|
| 21 |
+
"devDependencies": {
|
| 22 |
+
"@babel/core": "^7.29.7"
|
| 23 |
+
},
|
| 24 |
+
"engines": {
|
| 25 |
+
"node": ">=6.9.0"
|
| 26 |
+
},
|
| 27 |
+
"type": "commonjs"
|
| 28 |
+
}
|
node_modules/@babel/helper-module-transforms/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 6 |
+
a copy of this software and associated documentation files (the
|
| 7 |
+
"Software"), to deal in the Software without restriction, including
|
| 8 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 9 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 10 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 11 |
+
the following conditions:
|
| 12 |
+
|
| 13 |
+
The above copyright notice and this permission notice shall be
|
| 14 |
+
included in all copies or substantial portions of the Software.
|
| 15 |
+
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 17 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 18 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 19 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
| 20 |
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
| 21 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
| 22 |
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
node_modules/@babel/helper-module-transforms/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @babel/helper-module-transforms
|
| 2 |
+
|
| 3 |
+
> Babel helper functions for implementing ES6 module transformations
|
| 4 |
+
|
| 5 |
+
See our website [@babel/helper-module-transforms](https://babeljs.io/docs/babel-helper-module-transforms) for more information.
|
| 6 |
+
|
| 7 |
+
## Install
|
| 8 |
+
|
| 9 |
+
Using npm:
|
| 10 |
+
|
| 11 |
+
```sh
|
| 12 |
+
npm install --save @babel/helper-module-transforms
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
or using yarn:
|
| 16 |
+
|
| 17 |
+
```sh
|
| 18 |
+
yarn add @babel/helper-module-transforms
|
| 19 |
+
```
|
node_modules/@babel/helper-module-transforms/lib/dynamic-import.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.buildDynamicImport = buildDynamicImport;
|
| 7 |
+
var _core = require("@babel/core");
|
| 8 |
+
exports.getDynamicImportSource = function getDynamicImportSource(node) {
|
| 9 |
+
const [source] = node.arguments;
|
| 10 |
+
return _core.types.isStringLiteral(source) || _core.types.isTemplateLiteral(source) ? source : _core.template.expression.ast`\`\${${source}}\``;
|
| 11 |
+
};
|
| 12 |
+
function buildDynamicImport(node, deferToThen, wrapWithPromise, builder) {
|
| 13 |
+
const specifier = _core.types.isCallExpression(node) ? node.arguments[0] : node.source;
|
| 14 |
+
if (_core.types.isStringLiteral(specifier) || _core.types.isTemplateLiteral(specifier) && specifier.quasis.length === 0) {
|
| 15 |
+
if (deferToThen) {
|
| 16 |
+
return _core.template.expression.ast`
|
| 17 |
+
Promise.resolve().then(() => ${builder(specifier)})
|
| 18 |
+
`;
|
| 19 |
+
} else return builder(specifier);
|
| 20 |
+
}
|
| 21 |
+
const specifierToString = _core.types.isTemplateLiteral(specifier) ? _core.types.identifier("specifier") : _core.types.templateLiteral([_core.types.templateElement({
|
| 22 |
+
raw: ""
|
| 23 |
+
}), _core.types.templateElement({
|
| 24 |
+
raw: ""
|
| 25 |
+
})], [_core.types.identifier("specifier")]);
|
| 26 |
+
if (deferToThen) {
|
| 27 |
+
return _core.template.expression.ast`
|
| 28 |
+
(specifier =>
|
| 29 |
+
new Promise(r => r(${specifierToString}))
|
| 30 |
+
.then(s => ${builder(_core.types.identifier("s"))})
|
| 31 |
+
)(${specifier})
|
| 32 |
+
`;
|
| 33 |
+
} else if (wrapWithPromise) {
|
| 34 |
+
return _core.template.expression.ast`
|
| 35 |
+
(specifier =>
|
| 36 |
+
new Promise(r => r(${builder(specifierToString)}))
|
| 37 |
+
)(${specifier})
|
| 38 |
+
`;
|
| 39 |
+
} else {
|
| 40 |
+
return _core.template.expression.ast`
|
| 41 |
+
(specifier => ${builder(specifierToString)})(${specifier})
|
| 42 |
+
`;
|
| 43 |
+
}
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
//# sourceMappingURL=dynamic-import.js.map
|
node_modules/@babel/helper-module-transforms/lib/dynamic-import.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"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;AAIEC,OAAO,CAACC,sBAAsB,GAAG,SAASA,sBAAsBA,CAC9DC,IAAsB,EACe;EACrC,MAAM,CAACC,MAAM,CAAC,GAAGD,IAAI,CAACE,SAAS;EAE/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;AACvE,CAAC;AAGI,SAASQ,kBAAkBA,CAChCT,IAA2C,EAC3CU,WAAoB,EACpBC,eAAwB,EACxBC,OAAkD,EACpC;EACd,MAAMC,SAAS,GAAGV,WAAC,CAACW,gBAAgB,CAACd,IAAI,CAAC,GAAGA,IAA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;AACF","ignoreList":[]}
|
node_modules/@babel/helper-module-transforms/lib/get-module-name.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.default = getModuleName;
|
| 7 |
+
const originalGetModuleName = getModuleName;
|
| 8 |
+
exports.default = getModuleName = function getModuleName(rootOpts, pluginOpts) {
|
| 9 |
+
var _pluginOpts$moduleId, _pluginOpts$moduleIds, _pluginOpts$getModule, _pluginOpts$moduleRoo;
|
| 10 |
+
return originalGetModuleName(rootOpts, {
|
| 11 |
+
moduleId: (_pluginOpts$moduleId = pluginOpts.moduleId) != null ? _pluginOpts$moduleId : rootOpts.moduleId,
|
| 12 |
+
moduleIds: (_pluginOpts$moduleIds = pluginOpts.moduleIds) != null ? _pluginOpts$moduleIds : rootOpts.moduleIds,
|
| 13 |
+
getModuleId: (_pluginOpts$getModule = pluginOpts.getModuleId) != null ? _pluginOpts$getModule : rootOpts.getModuleId,
|
| 14 |
+
moduleRoot: (_pluginOpts$moduleRoo = pluginOpts.moduleRoot) != null ? _pluginOpts$moduleRoo : rootOpts.moduleRoot
|
| 15 |
+
});
|
| 16 |
+
};
|
| 17 |
+
function getModuleName(rootOpts, pluginOpts) {
|
| 18 |
+
const {
|
| 19 |
+
filename,
|
| 20 |
+
filenameRelative = filename,
|
| 21 |
+
sourceRoot = pluginOpts.moduleRoot
|
| 22 |
+
} = rootOpts;
|
| 23 |
+
const {
|
| 24 |
+
moduleId,
|
| 25 |
+
moduleIds = !!moduleId,
|
| 26 |
+
getModuleId,
|
| 27 |
+
moduleRoot = sourceRoot
|
| 28 |
+
} = pluginOpts;
|
| 29 |
+
if (!moduleIds) return null;
|
| 30 |
+
if (moduleId != null && !getModuleId) {
|
| 31 |
+
return moduleId;
|
| 32 |
+
}
|
| 33 |
+
let moduleName = moduleRoot != null ? moduleRoot + "/" : "";
|
| 34 |
+
if (filenameRelative) {
|
| 35 |
+
const sourceRootReplacer = sourceRoot != null ? new RegExp("^" + sourceRoot + "/?") : "";
|
| 36 |
+
moduleName += filenameRelative.replace(sourceRootReplacer, "").replace(/\.\w*$/, "");
|
| 37 |
+
}
|
| 38 |
+
moduleName = moduleName.replace(/\\/g, "/");
|
| 39 |
+
if (getModuleId) {
|
| 40 |
+
return getModuleId(moduleName) || moduleName;
|
| 41 |
+
} else {
|
| 42 |
+
return moduleName;
|
| 43 |
+
}
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
//# sourceMappingURL=get-module-name.js.map
|
node_modules/@babel/helper-module-transforms/lib/get-module-name.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"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":";;;;;;AAcE,MAAMA,qBAAqB,GAAGC,aAAa;AAG3CC,OAAA,CAAAC,OAAA,GAAAF,aAAa,GAAG,SAASA,aAAaA,CACpCG,QAAqC,EACrCC,UAAyB,EACV;EAAA,IAAAC,oBAAA,EAAAC,qBAAA,EAAAC,qBAAA,EAAAC,qBAAA;EACf,OAAOT,qBAAqB,CAACI,QAAQ,EAAE;IACrCM,QAAQ,GAAA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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
Object.defineProperty(exports, "buildDynamicImport", {
|
| 7 |
+
enumerable: true,
|
| 8 |
+
get: function () {
|
| 9 |
+
return _dynamicImport.buildDynamicImport;
|
| 10 |
+
}
|
| 11 |
+
});
|
| 12 |
+
exports.buildNamespaceInitStatements = buildNamespaceInitStatements;
|
| 13 |
+
exports.ensureStatementsHoisted = ensureStatementsHoisted;
|
| 14 |
+
Object.defineProperty(exports, "getModuleName", {
|
| 15 |
+
enumerable: true,
|
| 16 |
+
get: function () {
|
| 17 |
+
return _getModuleName.default;
|
| 18 |
+
}
|
| 19 |
+
});
|
| 20 |
+
Object.defineProperty(exports, "hasExports", {
|
| 21 |
+
enumerable: true,
|
| 22 |
+
get: function () {
|
| 23 |
+
return _normalizeAndLoadMetadata.hasExports;
|
| 24 |
+
}
|
| 25 |
+
});
|
| 26 |
+
Object.defineProperty(exports, "isModule", {
|
| 27 |
+
enumerable: true,
|
| 28 |
+
get: function () {
|
| 29 |
+
return _helperModuleImports.isModule;
|
| 30 |
+
}
|
| 31 |
+
});
|
| 32 |
+
Object.defineProperty(exports, "isSideEffectImport", {
|
| 33 |
+
enumerable: true,
|
| 34 |
+
get: function () {
|
| 35 |
+
return _normalizeAndLoadMetadata.isSideEffectImport;
|
| 36 |
+
}
|
| 37 |
+
});
|
| 38 |
+
exports.rewriteModuleStatementsAndPrepareHeader = rewriteModuleStatementsAndPrepareHeader;
|
| 39 |
+
Object.defineProperty(exports, "rewriteThis", {
|
| 40 |
+
enumerable: true,
|
| 41 |
+
get: function () {
|
| 42 |
+
return _rewriteThis.default;
|
| 43 |
+
}
|
| 44 |
+
});
|
| 45 |
+
exports.wrapInterop = wrapInterop;
|
| 46 |
+
var _assert = require("assert");
|
| 47 |
+
var _core = require("@babel/core");
|
| 48 |
+
var _helperModuleImports = require("@babel/helper-module-imports");
|
| 49 |
+
var _rewriteThis = require("./rewrite-this.js");
|
| 50 |
+
var _rewriteLiveReferences = require("./rewrite-live-references.js");
|
| 51 |
+
var _normalizeAndLoadMetadata = require("./normalize-and-load-metadata.js");
|
| 52 |
+
var Lazy = require("./lazy-modules.js");
|
| 53 |
+
var _dynamicImport = require("./dynamic-import.js");
|
| 54 |
+
var _getModuleName = require("./get-module-name.js");
|
| 55 |
+
exports.getDynamicImportSource = require("./dynamic-import").getDynamicImportSource;
|
| 56 |
+
function rewriteModuleStatementsAndPrepareHeader(path, {
|
| 57 |
+
exportName,
|
| 58 |
+
strict,
|
| 59 |
+
allowTopLevelThis,
|
| 60 |
+
strictMode,
|
| 61 |
+
noInterop,
|
| 62 |
+
importInterop = noInterop ? "none" : "babel",
|
| 63 |
+
lazy,
|
| 64 |
+
getWrapperPayload = Lazy.toGetWrapperPayload(lazy != null ? lazy : false),
|
| 65 |
+
wrapReference = Lazy.wrapReference,
|
| 66 |
+
esNamespaceOnly,
|
| 67 |
+
filename,
|
| 68 |
+
constantReexports = arguments[1].loose,
|
| 69 |
+
enumerableModuleMeta = arguments[1].loose,
|
| 70 |
+
noIncompleteNsImportDetection
|
| 71 |
+
}) {
|
| 72 |
+
(0, _normalizeAndLoadMetadata.validateImportInteropOption)(importInterop);
|
| 73 |
+
_assert((0, _helperModuleImports.isModule)(path), "Cannot process module statements in a script");
|
| 74 |
+
path.node.sourceType = "script";
|
| 75 |
+
const meta = (0, _normalizeAndLoadMetadata.default)(path, exportName, {
|
| 76 |
+
importInterop,
|
| 77 |
+
initializeReexports: constantReexports,
|
| 78 |
+
getWrapperPayload,
|
| 79 |
+
esNamespaceOnly,
|
| 80 |
+
filename
|
| 81 |
+
});
|
| 82 |
+
if (!allowTopLevelThis) {
|
| 83 |
+
(0, _rewriteThis.default)(path);
|
| 84 |
+
}
|
| 85 |
+
(0, _rewriteLiveReferences.default)(path, meta, wrapReference);
|
| 86 |
+
if (strictMode !== false) {
|
| 87 |
+
const hasStrict = path.node.directives.some(directive => {
|
| 88 |
+
return directive.value.value === "use strict";
|
| 89 |
+
});
|
| 90 |
+
if (!hasStrict) {
|
| 91 |
+
path.unshiftContainer("directives", _core.types.directive(_core.types.directiveLiteral("use strict")));
|
| 92 |
+
}
|
| 93 |
+
}
|
| 94 |
+
const headers = [];
|
| 95 |
+
if ((0, _normalizeAndLoadMetadata.hasExports)(meta) && !strict) {
|
| 96 |
+
headers.push(buildESModuleHeader(meta, enumerableModuleMeta));
|
| 97 |
+
}
|
| 98 |
+
const nameList = buildExportNameListDeclaration(path, meta);
|
| 99 |
+
if (nameList) {
|
| 100 |
+
meta.exportNameListName = nameList.name;
|
| 101 |
+
headers.push(nameList.statement);
|
| 102 |
+
}
|
| 103 |
+
headers.push(...buildExportInitializationStatements(path, meta, wrapReference, constantReexports, noIncompleteNsImportDetection));
|
| 104 |
+
return {
|
| 105 |
+
meta,
|
| 106 |
+
headers
|
| 107 |
+
};
|
| 108 |
+
}
|
| 109 |
+
function ensureStatementsHoisted(statements) {
|
| 110 |
+
statements.forEach(header => {
|
| 111 |
+
header._blockHoist = 3;
|
| 112 |
+
});
|
| 113 |
+
}
|
| 114 |
+
function wrapInterop(programPath, expr, type) {
|
| 115 |
+
if (type === "none") {
|
| 116 |
+
return null;
|
| 117 |
+
}
|
| 118 |
+
if (type === "node-namespace") {
|
| 119 |
+
return _core.types.callExpression(programPath.hub.addHelper("interopRequireWildcard"), [expr, _core.types.booleanLiteral(true)]);
|
| 120 |
+
} else if (type === "node-default") {
|
| 121 |
+
return null;
|
| 122 |
+
}
|
| 123 |
+
let helper;
|
| 124 |
+
if (type === "default") {
|
| 125 |
+
helper = "interopRequireDefault";
|
| 126 |
+
} else if (type === "namespace") {
|
| 127 |
+
helper = "interopRequireWildcard";
|
| 128 |
+
} else {
|
| 129 |
+
throw new Error(`Unknown interop: ${type}`);
|
| 130 |
+
}
|
| 131 |
+
return _core.types.callExpression(programPath.hub.addHelper(helper), [expr]);
|
| 132 |
+
}
|
| 133 |
+
function buildNamespaceInitStatements(metadata, sourceMetadata, constantReexports = false, wrapReference = Lazy.wrapReference) {
|
| 134 |
+
var _wrapReference;
|
| 135 |
+
const statements = [];
|
| 136 |
+
const srcNamespaceId = _core.types.identifier(sourceMetadata.name);
|
| 137 |
+
for (const localName of sourceMetadata.importsNamespace) {
|
| 138 |
+
if (localName === sourceMetadata.name) continue;
|
| 139 |
+
statements.push(_core.template.statement`var NAME = SOURCE;`({
|
| 140 |
+
NAME: localName,
|
| 141 |
+
SOURCE: _core.types.cloneNode(srcNamespaceId)
|
| 142 |
+
}));
|
| 143 |
+
}
|
| 144 |
+
const srcNamespace = (_wrapReference = wrapReference(srcNamespaceId, sourceMetadata.wrap)) != null ? _wrapReference : srcNamespaceId;
|
| 145 |
+
if (constantReexports) {
|
| 146 |
+
statements.push(...buildReexportsFromMeta(metadata, sourceMetadata, true, wrapReference));
|
| 147 |
+
}
|
| 148 |
+
for (const exportName of sourceMetadata.reexportNamespace) {
|
| 149 |
+
statements.push((!_core.types.isIdentifier(srcNamespace) ? _core.template.statement`
|
| 150 |
+
Object.defineProperty(EXPORTS, "NAME", {
|
| 151 |
+
enumerable: true,
|
| 152 |
+
get: function() {
|
| 153 |
+
return NAMESPACE;
|
| 154 |
+
}
|
| 155 |
+
});
|
| 156 |
+
` : _core.template.statement`EXPORTS.NAME = NAMESPACE;`)({
|
| 157 |
+
EXPORTS: metadata.exportName,
|
| 158 |
+
NAME: exportName,
|
| 159 |
+
NAMESPACE: _core.types.cloneNode(srcNamespace)
|
| 160 |
+
}));
|
| 161 |
+
}
|
| 162 |
+
if (sourceMetadata.reexportAll) {
|
| 163 |
+
const statement = buildNamespaceReexport(metadata, _core.types.cloneNode(srcNamespace), constantReexports);
|
| 164 |
+
statement.loc = sourceMetadata.reexportAll.loc;
|
| 165 |
+
statements.push(statement);
|
| 166 |
+
}
|
| 167 |
+
return statements;
|
| 168 |
+
}
|
| 169 |
+
const ReexportTemplate = {
|
| 170 |
+
constant: ({
|
| 171 |
+
exports,
|
| 172 |
+
exportName,
|
| 173 |
+
namespaceImport
|
| 174 |
+
}) => _core.template.statement.ast`
|
| 175 |
+
${exports}.${exportName} = ${namespaceImport};
|
| 176 |
+
`,
|
| 177 |
+
constantComputed: ({
|
| 178 |
+
exports,
|
| 179 |
+
exportName,
|
| 180 |
+
namespaceImport
|
| 181 |
+
}) => _core.template.statement.ast`
|
| 182 |
+
${exports}["${exportName}"] = ${namespaceImport};
|
| 183 |
+
`,
|
| 184 |
+
spec: ({
|
| 185 |
+
exports,
|
| 186 |
+
exportName,
|
| 187 |
+
namespaceImport
|
| 188 |
+
}) => _core.template.statement.ast`
|
| 189 |
+
Object.defineProperty(${exports}, "${exportName}", {
|
| 190 |
+
enumerable: true,
|
| 191 |
+
get: function() {
|
| 192 |
+
return ${namespaceImport};
|
| 193 |
+
},
|
| 194 |
+
});
|
| 195 |
+
`
|
| 196 |
+
};
|
| 197 |
+
function buildReexportsFromMeta(meta, metadata, constantReexports, wrapReference) {
|
| 198 |
+
var _wrapReference2;
|
| 199 |
+
let namespace = _core.types.identifier(metadata.name);
|
| 200 |
+
namespace = (_wrapReference2 = wrapReference(namespace, metadata.wrap)) != null ? _wrapReference2 : namespace;
|
| 201 |
+
const {
|
| 202 |
+
stringSpecifiers
|
| 203 |
+
} = meta;
|
| 204 |
+
return Array.from(metadata.reexports, ([exportName, importName]) => {
|
| 205 |
+
let namespaceImport = _core.types.cloneNode(namespace);
|
| 206 |
+
if (importName === "default" && metadata.interop === "node-default") {} else if (stringSpecifiers.has(importName)) {
|
| 207 |
+
namespaceImport = _core.types.memberExpression(namespaceImport, _core.types.stringLiteral(importName), true);
|
| 208 |
+
} else {
|
| 209 |
+
namespaceImport = _core.types.memberExpression(namespaceImport, _core.types.identifier(importName));
|
| 210 |
+
}
|
| 211 |
+
const astNodes = {
|
| 212 |
+
exports: meta.exportName,
|
| 213 |
+
exportName,
|
| 214 |
+
namespaceImport
|
| 215 |
+
};
|
| 216 |
+
if (constantReexports || _core.types.isIdentifier(namespaceImport)) {
|
| 217 |
+
if (stringSpecifiers.has(exportName)) {
|
| 218 |
+
return ReexportTemplate.constantComputed(astNodes);
|
| 219 |
+
} else {
|
| 220 |
+
return ReexportTemplate.constant(astNodes);
|
| 221 |
+
}
|
| 222 |
+
} else {
|
| 223 |
+
return ReexportTemplate.spec(astNodes);
|
| 224 |
+
}
|
| 225 |
+
});
|
| 226 |
+
}
|
| 227 |
+
function buildESModuleHeader(metadata, enumerableModuleMeta = false) {
|
| 228 |
+
return (enumerableModuleMeta ? _core.template.statement`
|
| 229 |
+
EXPORTS.__esModule = true;
|
| 230 |
+
` : _core.template.statement`
|
| 231 |
+
Object.defineProperty(EXPORTS, "__esModule", {
|
| 232 |
+
value: true,
|
| 233 |
+
});
|
| 234 |
+
`)({
|
| 235 |
+
EXPORTS: metadata.exportName
|
| 236 |
+
});
|
| 237 |
+
}
|
| 238 |
+
function buildNamespaceReexport(metadata, namespace, constantReexports) {
|
| 239 |
+
return (constantReexports ? _core.template.statement`
|
| 240 |
+
Object.keys(NAMESPACE).forEach(function(key) {
|
| 241 |
+
if (key === "default" || key === "__esModule") return;
|
| 242 |
+
VERIFY_NAME_LIST;
|
| 243 |
+
if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;
|
| 244 |
+
|
| 245 |
+
EXPORTS[key] = NAMESPACE[key];
|
| 246 |
+
});
|
| 247 |
+
` : _core.template.statement`
|
| 248 |
+
Object.keys(NAMESPACE).forEach(function(key) {
|
| 249 |
+
if (key === "default" || key === "__esModule") return;
|
| 250 |
+
VERIFY_NAME_LIST;
|
| 251 |
+
if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;
|
| 252 |
+
|
| 253 |
+
Object.defineProperty(EXPORTS, key, {
|
| 254 |
+
enumerable: true,
|
| 255 |
+
get: function() {
|
| 256 |
+
return NAMESPACE[key];
|
| 257 |
+
},
|
| 258 |
+
});
|
| 259 |
+
});
|
| 260 |
+
`)({
|
| 261 |
+
NAMESPACE: namespace,
|
| 262 |
+
EXPORTS: metadata.exportName,
|
| 263 |
+
VERIFY_NAME_LIST: metadata.exportNameListName ? (0, _core.template)`
|
| 264 |
+
if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;
|
| 265 |
+
`({
|
| 266 |
+
EXPORTS_LIST: metadata.exportNameListName
|
| 267 |
+
}) : null
|
| 268 |
+
});
|
| 269 |
+
}
|
| 270 |
+
function buildExportNameListDeclaration(programPath, metadata) {
|
| 271 |
+
const exportedVars = Object.create(null);
|
| 272 |
+
for (const data of metadata.local.values()) {
|
| 273 |
+
for (const name of data.names) {
|
| 274 |
+
exportedVars[name] = true;
|
| 275 |
+
}
|
| 276 |
+
}
|
| 277 |
+
let hasReexport = false;
|
| 278 |
+
for (const data of metadata.source.values()) {
|
| 279 |
+
for (const exportName of data.reexports.keys()) {
|
| 280 |
+
exportedVars[exportName] = true;
|
| 281 |
+
}
|
| 282 |
+
for (const exportName of data.reexportNamespace) {
|
| 283 |
+
exportedVars[exportName] = true;
|
| 284 |
+
}
|
| 285 |
+
hasReexport = hasReexport || !!data.reexportAll;
|
| 286 |
+
}
|
| 287 |
+
if (!hasReexport || Object.keys(exportedVars).length === 0) return null;
|
| 288 |
+
const name = programPath.scope.generateUidIdentifier("exportNames");
|
| 289 |
+
delete exportedVars.default;
|
| 290 |
+
return {
|
| 291 |
+
name: name.name,
|
| 292 |
+
statement: _core.types.variableDeclaration("var", [_core.types.variableDeclarator(name, _core.types.valueToNode(exportedVars))])
|
| 293 |
+
};
|
| 294 |
+
}
|
| 295 |
+
function buildExportInitializationStatements(programPath, metadata, wrapReference, constantReexports = false, noIncompleteNsImportDetection = false) {
|
| 296 |
+
const initStatements = [];
|
| 297 |
+
for (const [localName, data] of metadata.local) {
|
| 298 |
+
if (data.kind === "import") {} else if (data.kind === "hoisted") {
|
| 299 |
+
initStatements.push([data.names[0], buildInitStatement(metadata, data.names, _core.types.identifier(localName))]);
|
| 300 |
+
} else if (!noIncompleteNsImportDetection) {
|
| 301 |
+
for (const exportName of data.names) {
|
| 302 |
+
initStatements.push([exportName, null]);
|
| 303 |
+
}
|
| 304 |
+
}
|
| 305 |
+
}
|
| 306 |
+
for (const data of metadata.source.values()) {
|
| 307 |
+
if (!constantReexports) {
|
| 308 |
+
const reexportsStatements = buildReexportsFromMeta(metadata, data, false, wrapReference);
|
| 309 |
+
const reexports = [...data.reexports.keys()];
|
| 310 |
+
for (let i = 0; i < reexportsStatements.length; i++) {
|
| 311 |
+
initStatements.push([reexports[i], reexportsStatements[i]]);
|
| 312 |
+
}
|
| 313 |
+
}
|
| 314 |
+
if (!noIncompleteNsImportDetection) {
|
| 315 |
+
for (const exportName of data.reexportNamespace) {
|
| 316 |
+
initStatements.push([exportName, null]);
|
| 317 |
+
}
|
| 318 |
+
}
|
| 319 |
+
}
|
| 320 |
+
initStatements.sort(([a], [b]) => {
|
| 321 |
+
if (a < b) return -1;
|
| 322 |
+
if (b < a) return 1;
|
| 323 |
+
return 0;
|
| 324 |
+
});
|
| 325 |
+
const results = [];
|
| 326 |
+
if (noIncompleteNsImportDetection) {
|
| 327 |
+
for (const [, initStatement] of initStatements) {
|
| 328 |
+
results.push(initStatement);
|
| 329 |
+
}
|
| 330 |
+
} else {
|
| 331 |
+
const chunkSize = 100;
|
| 332 |
+
for (let i = 0; i < initStatements.length; i += chunkSize) {
|
| 333 |
+
let uninitializedExportNames = [];
|
| 334 |
+
for (let j = 0; j < chunkSize && i + j < initStatements.length; j++) {
|
| 335 |
+
const [exportName, initStatement] = initStatements[i + j];
|
| 336 |
+
if (initStatement !== null) {
|
| 337 |
+
if (uninitializedExportNames.length > 0) {
|
| 338 |
+
results.push(buildInitStatement(metadata, uninitializedExportNames, programPath.scope.buildUndefinedNode()));
|
| 339 |
+
uninitializedExportNames = [];
|
| 340 |
+
}
|
| 341 |
+
results.push(initStatement);
|
| 342 |
+
} else {
|
| 343 |
+
uninitializedExportNames.push(exportName);
|
| 344 |
+
}
|
| 345 |
+
}
|
| 346 |
+
if (uninitializedExportNames.length > 0) {
|
| 347 |
+
results.push(buildInitStatement(metadata, uninitializedExportNames, programPath.scope.buildUndefinedNode()));
|
| 348 |
+
}
|
| 349 |
+
}
|
| 350 |
+
}
|
| 351 |
+
return results;
|
| 352 |
+
}
|
| 353 |
+
const InitTemplate = {
|
| 354 |
+
computed: ({
|
| 355 |
+
exports,
|
| 356 |
+
name,
|
| 357 |
+
value
|
| 358 |
+
}) => _core.template.expression.ast`${exports}["${name}"] = ${value}`,
|
| 359 |
+
default: ({
|
| 360 |
+
exports,
|
| 361 |
+
name,
|
| 362 |
+
value
|
| 363 |
+
}) => _core.template.expression.ast`${exports}.${name} = ${value}`,
|
| 364 |
+
define: ({
|
| 365 |
+
exports,
|
| 366 |
+
name,
|
| 367 |
+
value
|
| 368 |
+
}) => _core.template.expression.ast`
|
| 369 |
+
Object.defineProperty(${exports}, "${name}", {
|
| 370 |
+
enumerable: true,
|
| 371 |
+
value: void 0,
|
| 372 |
+
writable: true
|
| 373 |
+
})["${name}"] = ${value}`
|
| 374 |
+
};
|
| 375 |
+
function buildInitStatement(metadata, exportNames, initExpr) {
|
| 376 |
+
const {
|
| 377 |
+
stringSpecifiers,
|
| 378 |
+
exportName: exports
|
| 379 |
+
} = metadata;
|
| 380 |
+
return _core.types.expressionStatement(exportNames.reduce((value, name) => {
|
| 381 |
+
const params = {
|
| 382 |
+
exports,
|
| 383 |
+
name,
|
| 384 |
+
value
|
| 385 |
+
};
|
| 386 |
+
if (name === "__proto__") {
|
| 387 |
+
return InitTemplate.define(params);
|
| 388 |
+
}
|
| 389 |
+
if (stringSpecifiers.has(name)) {
|
| 390 |
+
return InitTemplate.computed(params);
|
| 391 |
+
}
|
| 392 |
+
return InitTemplate.default(params);
|
| 393 |
+
}, initExpr));
|
| 394 |
+
}
|
| 395 |
+
|
| 396 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@babel/helper-module-transforms/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"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 \"node: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: [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;AALES,OAAO,CAACC,sBAAsB,GAE5BV,OAAO,CAAC,kBAAkB,CAAC,CAACU,sBAAsB;AAoC/C,SAASC,uCAAuCA,CACrDC,IAAy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EA,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":[]}
|
node_modules/@babel/helper-module-transforms/lib/lazy-modules.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.toGetWrapperPayload = toGetWrapperPayload;
|
| 7 |
+
exports.wrapReference = wrapReference;
|
| 8 |
+
var _core = require("@babel/core");
|
| 9 |
+
var _normalizeAndLoadMetadata = require("./normalize-and-load-metadata.js");
|
| 10 |
+
function toGetWrapperPayload(lazy) {
|
| 11 |
+
return (source, metadata) => {
|
| 12 |
+
if (lazy === false) return null;
|
| 13 |
+
if ((0, _normalizeAndLoadMetadata.isSideEffectImport)(metadata) || metadata.reexportAll) return null;
|
| 14 |
+
if (lazy === true) {
|
| 15 |
+
return source.includes(".") ? null : "lazy";
|
| 16 |
+
}
|
| 17 |
+
if (Array.isArray(lazy)) {
|
| 18 |
+
return !lazy.includes(source) ? null : "lazy";
|
| 19 |
+
}
|
| 20 |
+
if (typeof lazy === "function") {
|
| 21 |
+
return lazy(source) ? "lazy" : null;
|
| 22 |
+
}
|
| 23 |
+
throw new Error(`.lazy must be a boolean, string array, or function`);
|
| 24 |
+
};
|
| 25 |
+
}
|
| 26 |
+
function wrapReference(ref, payload) {
|
| 27 |
+
if (payload === "lazy") return _core.types.callExpression(ref, []);
|
| 28 |
+
return null;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
//# sourceMappingURL=lazy-modules.js.map
|
node_modules/@babel/helper-module-transforms/lib/lazy-modules.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"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,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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.default = normalizeModuleAndLoadMetadata;
|
| 7 |
+
exports.hasExports = hasExports;
|
| 8 |
+
exports.isSideEffectImport = isSideEffectImport;
|
| 9 |
+
exports.validateImportInteropOption = validateImportInteropOption;
|
| 10 |
+
var _path = require("path");
|
| 11 |
+
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
|
| 12 |
+
function hasExports(metadata) {
|
| 13 |
+
return metadata.hasExports;
|
| 14 |
+
}
|
| 15 |
+
function isSideEffectImport(source) {
|
| 16 |
+
return source.imports.size === 0 && source.importsNamespace.size === 0 && source.reexports.size === 0 && source.reexportNamespace.size === 0 && !source.reexportAll;
|
| 17 |
+
}
|
| 18 |
+
function validateImportInteropOption(importInterop) {
|
| 19 |
+
if (typeof importInterop !== "function" && importInterop !== "none" && importInterop !== "babel" && importInterop !== "node") {
|
| 20 |
+
throw new Error(`.importInterop must be one of "none", "babel", "node", or a function returning one of those values (received ${importInterop}).`);
|
| 21 |
+
}
|
| 22 |
+
return importInterop;
|
| 23 |
+
}
|
| 24 |
+
function resolveImportInterop(importInterop, source, filename) {
|
| 25 |
+
if (typeof importInterop === "function") {
|
| 26 |
+
return validateImportInteropOption(importInterop(source, filename));
|
| 27 |
+
}
|
| 28 |
+
return importInterop;
|
| 29 |
+
}
|
| 30 |
+
function normalizeModuleAndLoadMetadata(programPath, exportName, {
|
| 31 |
+
importInterop,
|
| 32 |
+
initializeReexports = false,
|
| 33 |
+
getWrapperPayload,
|
| 34 |
+
esNamespaceOnly = false,
|
| 35 |
+
filename
|
| 36 |
+
}) {
|
| 37 |
+
if (!exportName) {
|
| 38 |
+
exportName = programPath.scope.generateUidIdentifier("exports").name;
|
| 39 |
+
}
|
| 40 |
+
const stringSpecifiers = new Set();
|
| 41 |
+
nameAnonymousExports(programPath);
|
| 42 |
+
const {
|
| 43 |
+
local,
|
| 44 |
+
sources,
|
| 45 |
+
hasExports
|
| 46 |
+
} = getModuleMetadata(programPath, {
|
| 47 |
+
initializeReexports,
|
| 48 |
+
getWrapperPayload
|
| 49 |
+
}, stringSpecifiers);
|
| 50 |
+
removeImportExportDeclarations(programPath);
|
| 51 |
+
for (const [source, metadata] of sources) {
|
| 52 |
+
const {
|
| 53 |
+
importsNamespace,
|
| 54 |
+
imports
|
| 55 |
+
} = metadata;
|
| 56 |
+
if (importsNamespace.size > 0 && imports.size === 0) {
|
| 57 |
+
const [nameOfnamespace] = importsNamespace;
|
| 58 |
+
metadata.name = nameOfnamespace;
|
| 59 |
+
}
|
| 60 |
+
const resolvedInterop = resolveImportInterop(importInterop, source, filename);
|
| 61 |
+
if (resolvedInterop === "none") {
|
| 62 |
+
metadata.interop = "none";
|
| 63 |
+
} else if (resolvedInterop === "node" && metadata.interop === "namespace") {
|
| 64 |
+
metadata.interop = "node-namespace";
|
| 65 |
+
} else if (resolvedInterop === "node" && metadata.interop === "default") {
|
| 66 |
+
metadata.interop = "node-default";
|
| 67 |
+
} else if (esNamespaceOnly && metadata.interop === "namespace") {
|
| 68 |
+
metadata.interop = "default";
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
return {
|
| 72 |
+
exportName,
|
| 73 |
+
exportNameListName: null,
|
| 74 |
+
hasExports,
|
| 75 |
+
local,
|
| 76 |
+
source: sources,
|
| 77 |
+
stringSpecifiers
|
| 78 |
+
};
|
| 79 |
+
}
|
| 80 |
+
function getExportSpecifierName(path, stringSpecifiers) {
|
| 81 |
+
if (path.isIdentifier()) {
|
| 82 |
+
return path.node.name;
|
| 83 |
+
} else if (path.isStringLiteral()) {
|
| 84 |
+
const stringValue = path.node.value;
|
| 85 |
+
if (!(0, _helperValidatorIdentifier.isIdentifierName)(stringValue)) {
|
| 86 |
+
stringSpecifiers.add(stringValue);
|
| 87 |
+
}
|
| 88 |
+
return stringValue;
|
| 89 |
+
} else {
|
| 90 |
+
throw new Error(`Expected export specifier to be either Identifier or StringLiteral, got ${path.node.type}`);
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
function assertExportSpecifier(path) {
|
| 94 |
+
if (path.isExportSpecifier()) {
|
| 95 |
+
return;
|
| 96 |
+
} else if (path.isExportNamespaceSpecifier()) {
|
| 97 |
+
throw path.buildCodeFrameError("Export namespace should be first transformed by `@babel/plugin-transform-export-namespace-from`.");
|
| 98 |
+
} else {
|
| 99 |
+
throw path.buildCodeFrameError("Unexpected export specifier type");
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
function getModuleMetadata(programPath, {
|
| 103 |
+
getWrapperPayload,
|
| 104 |
+
initializeReexports
|
| 105 |
+
}, stringSpecifiers) {
|
| 106 |
+
const localData = getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers);
|
| 107 |
+
const importNodes = new Map();
|
| 108 |
+
const sourceData = new Map();
|
| 109 |
+
const getData = (sourceNode, node) => {
|
| 110 |
+
const source = sourceNode.value;
|
| 111 |
+
let data = sourceData.get(source);
|
| 112 |
+
if (!data) {
|
| 113 |
+
data = {
|
| 114 |
+
name: programPath.scope.generateUidIdentifier((0, _path.basename)(source, (0, _path.extname)(source))).name,
|
| 115 |
+
interop: "none",
|
| 116 |
+
loc: null,
|
| 117 |
+
imports: new Map(),
|
| 118 |
+
importsNamespace: new Set(),
|
| 119 |
+
reexports: new Map(),
|
| 120 |
+
reexportNamespace: new Set(),
|
| 121 |
+
reexportAll: null,
|
| 122 |
+
wrap: null,
|
| 123 |
+
get lazy() {
|
| 124 |
+
return this.wrap === "lazy";
|
| 125 |
+
},
|
| 126 |
+
referenced: false
|
| 127 |
+
};
|
| 128 |
+
sourceData.set(source, data);
|
| 129 |
+
importNodes.set(source, [node]);
|
| 130 |
+
} else {
|
| 131 |
+
importNodes.get(source).push(node);
|
| 132 |
+
}
|
| 133 |
+
return data;
|
| 134 |
+
};
|
| 135 |
+
let hasExports = false;
|
| 136 |
+
programPath.get("body").forEach(child => {
|
| 137 |
+
if (child.isImportDeclaration()) {
|
| 138 |
+
const data = getData(child.node.source, child.node);
|
| 139 |
+
if (!data.loc) data.loc = child.node.loc;
|
| 140 |
+
child.get("specifiers").forEach(spec => {
|
| 141 |
+
if (spec.isImportDefaultSpecifier()) {
|
| 142 |
+
const localName = spec.get("local").node.name;
|
| 143 |
+
data.imports.set(localName, "default");
|
| 144 |
+
const reexport = localData.get(localName);
|
| 145 |
+
if (reexport) {
|
| 146 |
+
localData.delete(localName);
|
| 147 |
+
reexport.names.forEach(name => {
|
| 148 |
+
data.reexports.set(name, "default");
|
| 149 |
+
});
|
| 150 |
+
data.referenced = true;
|
| 151 |
+
}
|
| 152 |
+
} else if (spec.isImportNamespaceSpecifier()) {
|
| 153 |
+
const localName = spec.get("local").node.name;
|
| 154 |
+
data.importsNamespace.add(localName);
|
| 155 |
+
const reexport = localData.get(localName);
|
| 156 |
+
if (reexport) {
|
| 157 |
+
localData.delete(localName);
|
| 158 |
+
reexport.names.forEach(name => {
|
| 159 |
+
data.reexportNamespace.add(name);
|
| 160 |
+
});
|
| 161 |
+
data.referenced = true;
|
| 162 |
+
}
|
| 163 |
+
} else if (spec.isImportSpecifier()) {
|
| 164 |
+
const importName = getExportSpecifierName(spec.get("imported"), stringSpecifiers);
|
| 165 |
+
const localName = spec.get("local").node.name;
|
| 166 |
+
data.imports.set(localName, importName);
|
| 167 |
+
const reexport = localData.get(localName);
|
| 168 |
+
if (reexport) {
|
| 169 |
+
localData.delete(localName);
|
| 170 |
+
reexport.names.forEach(name => {
|
| 171 |
+
data.reexports.set(name, importName);
|
| 172 |
+
});
|
| 173 |
+
data.referenced = true;
|
| 174 |
+
}
|
| 175 |
+
}
|
| 176 |
+
});
|
| 177 |
+
} else if (child.isExportAllDeclaration()) {
|
| 178 |
+
hasExports = true;
|
| 179 |
+
const data = getData(child.node.source, child.node);
|
| 180 |
+
if (!data.loc) data.loc = child.node.loc;
|
| 181 |
+
data.reexportAll = {
|
| 182 |
+
loc: child.node.loc
|
| 183 |
+
};
|
| 184 |
+
data.referenced = true;
|
| 185 |
+
} else if (child.isExportNamedDeclaration() && child.node.source) {
|
| 186 |
+
hasExports = true;
|
| 187 |
+
const data = getData(child.node.source, child.node);
|
| 188 |
+
if (!data.loc) data.loc = child.node.loc;
|
| 189 |
+
child.get("specifiers").forEach(spec => {
|
| 190 |
+
assertExportSpecifier(spec);
|
| 191 |
+
const importName = getExportSpecifierName(spec.get("local"), stringSpecifiers);
|
| 192 |
+
const exportName = getExportSpecifierName(spec.get("exported"), stringSpecifiers);
|
| 193 |
+
data.reexports.set(exportName, importName);
|
| 194 |
+
data.referenced = true;
|
| 195 |
+
if (exportName === "__esModule") {
|
| 196 |
+
throw spec.get("exported").buildCodeFrameError('Illegal export "__esModule".');
|
| 197 |
+
}
|
| 198 |
+
});
|
| 199 |
+
} else if (child.isExportNamedDeclaration() || child.isExportDefaultDeclaration()) {
|
| 200 |
+
hasExports = true;
|
| 201 |
+
}
|
| 202 |
+
});
|
| 203 |
+
for (const metadata of sourceData.values()) {
|
| 204 |
+
let needsDefault = false;
|
| 205 |
+
let needsNamed = false;
|
| 206 |
+
if (metadata.importsNamespace.size > 0) {
|
| 207 |
+
needsDefault = true;
|
| 208 |
+
needsNamed = true;
|
| 209 |
+
}
|
| 210 |
+
if (metadata.reexportAll) {
|
| 211 |
+
needsNamed = true;
|
| 212 |
+
}
|
| 213 |
+
for (const importName of metadata.imports.values()) {
|
| 214 |
+
if (importName === "default") needsDefault = true;else needsNamed = true;
|
| 215 |
+
}
|
| 216 |
+
for (const importName of metadata.reexports.values()) {
|
| 217 |
+
if (importName === "default") needsDefault = true;else needsNamed = true;
|
| 218 |
+
}
|
| 219 |
+
if (needsDefault && needsNamed) {
|
| 220 |
+
metadata.interop = "namespace";
|
| 221 |
+
} else if (needsDefault) {
|
| 222 |
+
metadata.interop = "default";
|
| 223 |
+
}
|
| 224 |
+
}
|
| 225 |
+
if (getWrapperPayload) {
|
| 226 |
+
for (const [source, metadata] of sourceData) {
|
| 227 |
+
metadata.wrap = getWrapperPayload(source, metadata, importNodes.get(source));
|
| 228 |
+
}
|
| 229 |
+
}
|
| 230 |
+
return {
|
| 231 |
+
hasExports,
|
| 232 |
+
local: localData,
|
| 233 |
+
sources: sourceData
|
| 234 |
+
};
|
| 235 |
+
}
|
| 236 |
+
function getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers) {
|
| 237 |
+
const bindingKindLookup = new Map();
|
| 238 |
+
const programScope = programPath.scope;
|
| 239 |
+
const programChildren = programPath.get("body");
|
| 240 |
+
programChildren.forEach(child => {
|
| 241 |
+
let kind;
|
| 242 |
+
if (child.isImportDeclaration()) {
|
| 243 |
+
kind = "import";
|
| 244 |
+
} else {
|
| 245 |
+
if (child.isExportDefaultDeclaration()) {
|
| 246 |
+
child = child.get("declaration");
|
| 247 |
+
}
|
| 248 |
+
if (child.isExportNamedDeclaration()) {
|
| 249 |
+
if (child.node.declaration) {
|
| 250 |
+
child = child.get("declaration");
|
| 251 |
+
} else if (initializeReexports && child.node.source && child.get("source").isStringLiteral()) {
|
| 252 |
+
child.get("specifiers").forEach(spec => {
|
| 253 |
+
assertExportSpecifier(spec);
|
| 254 |
+
bindingKindLookup.set(spec.get("local").node.name, "block");
|
| 255 |
+
});
|
| 256 |
+
return;
|
| 257 |
+
}
|
| 258 |
+
}
|
| 259 |
+
if (child.isFunctionDeclaration()) {
|
| 260 |
+
kind = "hoisted";
|
| 261 |
+
} else if (child.isClassDeclaration()) {
|
| 262 |
+
kind = "block";
|
| 263 |
+
} else if (child.isVariableDeclaration({
|
| 264 |
+
kind: "var"
|
| 265 |
+
})) {
|
| 266 |
+
kind = "var";
|
| 267 |
+
} else if (child.isVariableDeclaration()) {
|
| 268 |
+
kind = "block";
|
| 269 |
+
} else {
|
| 270 |
+
return;
|
| 271 |
+
}
|
| 272 |
+
}
|
| 273 |
+
Object.keys(child.getOuterBindingIdentifiers()).forEach(name => {
|
| 274 |
+
bindingKindLookup.set(name, kind);
|
| 275 |
+
});
|
| 276 |
+
});
|
| 277 |
+
const localMetadata = new Map();
|
| 278 |
+
const getLocalMetadata = idPath => {
|
| 279 |
+
const localName = idPath.node.name;
|
| 280 |
+
let metadata = localMetadata.get(localName);
|
| 281 |
+
if (!metadata) {
|
| 282 |
+
var _bindingKindLookup$ge, _programScope$getBind;
|
| 283 |
+
const kind = (_bindingKindLookup$ge = bindingKindLookup.get(localName)) != null ? _bindingKindLookup$ge : (_programScope$getBind = programScope.getBinding(localName)) == null ? void 0 : _programScope$getBind.kind;
|
| 284 |
+
if (kind === undefined) {
|
| 285 |
+
throw idPath.buildCodeFrameError(`Exporting local "${localName}", which is not declared.`);
|
| 286 |
+
}
|
| 287 |
+
metadata = {
|
| 288 |
+
names: [],
|
| 289 |
+
kind
|
| 290 |
+
};
|
| 291 |
+
localMetadata.set(localName, metadata);
|
| 292 |
+
}
|
| 293 |
+
return metadata;
|
| 294 |
+
};
|
| 295 |
+
programChildren.forEach(child => {
|
| 296 |
+
if (child.isExportNamedDeclaration() && (initializeReexports || !child.node.source)) {
|
| 297 |
+
if (child.node.declaration) {
|
| 298 |
+
const declaration = child.get("declaration");
|
| 299 |
+
const ids = declaration.getOuterBindingIdentifierPaths();
|
| 300 |
+
Object.keys(ids).forEach(name => {
|
| 301 |
+
if (name === "__esModule") {
|
| 302 |
+
throw declaration.buildCodeFrameError('Illegal export "__esModule".');
|
| 303 |
+
}
|
| 304 |
+
getLocalMetadata(ids[name]).names.push(name);
|
| 305 |
+
});
|
| 306 |
+
} else {
|
| 307 |
+
child.get("specifiers").forEach(spec => {
|
| 308 |
+
const local = spec.get("local");
|
| 309 |
+
const exported = spec.get("exported");
|
| 310 |
+
const localMetadata = getLocalMetadata(local);
|
| 311 |
+
const exportName = getExportSpecifierName(exported, stringSpecifiers);
|
| 312 |
+
if (exportName === "__esModule") {
|
| 313 |
+
throw exported.buildCodeFrameError('Illegal export "__esModule".');
|
| 314 |
+
}
|
| 315 |
+
localMetadata.names.push(exportName);
|
| 316 |
+
});
|
| 317 |
+
}
|
| 318 |
+
} else if (child.isExportDefaultDeclaration()) {
|
| 319 |
+
const declaration = child.get("declaration");
|
| 320 |
+
if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) {
|
| 321 |
+
getLocalMetadata(declaration.get("id")).names.push("default");
|
| 322 |
+
} else {
|
| 323 |
+
throw declaration.buildCodeFrameError("Unexpected default expression export.");
|
| 324 |
+
}
|
| 325 |
+
}
|
| 326 |
+
});
|
| 327 |
+
return localMetadata;
|
| 328 |
+
}
|
| 329 |
+
function nameAnonymousExports(programPath) {
|
| 330 |
+
programPath.get("body").forEach(child => {
|
| 331 |
+
var _child$splitExportDec;
|
| 332 |
+
if (!child.isExportDefaultDeclaration()) return;
|
| 333 |
+
(_child$splitExportDec = child.splitExportDeclaration) != null ? _child$splitExportDec : child.splitExportDeclaration = require("@babel/traverse").NodePath.prototype.splitExportDeclaration;
|
| 334 |
+
child.splitExportDeclaration();
|
| 335 |
+
});
|
| 336 |
+
}
|
| 337 |
+
function removeImportExportDeclarations(programPath) {
|
| 338 |
+
programPath.get("body").forEach(child => {
|
| 339 |
+
if (child.isImportDeclaration()) {
|
| 340 |
+
child.remove();
|
| 341 |
+
} else if (child.isExportNamedDeclaration()) {
|
| 342 |
+
if (child.node.declaration) {
|
| 343 |
+
child.node.declaration._blockHoist = child.node._blockHoist;
|
| 344 |
+
child.replaceWith(child.node.declaration);
|
| 345 |
+
} else {
|
| 346 |
+
child.remove();
|
| 347 |
+
}
|
| 348 |
+
} else if (child.isExportDefaultDeclaration()) {
|
| 349 |
+
const declaration = child.get("declaration");
|
| 350 |
+
if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) {
|
| 351 |
+
declaration._blockHoist = child.node._blockHoist;
|
| 352 |
+
child.replaceWith(declaration);
|
| 353 |
+
} else {
|
| 354 |
+
throw declaration.buildCodeFrameError("Unexpected default expression export.");
|
| 355 |
+
}
|
| 356 |
+
} else if (child.isExportAllDeclaration()) {
|
| 357 |
+
child.remove();
|
| 358 |
+
}
|
| 359 |
+
});
|
| 360 |
+
}
|
| 361 |
+
|
| 362 |
+
//# sourceMappingURL=normalize-and-load-metadata.js.map
|
node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"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","programScope","programChildren","kind","declaration","isFunctionDeclaration","isClassDeclaration","isVariableDeclaration","Object","keys","getOuterBindingIdentifiers","localMetadata","getLocalMetadata","idPath","_bindingKindLookup$ge","_programScope$getBind","getBinding","undefined","ids","getOuterBindingIdentifierPaths","exported","_child$splitExportDec","splitExportDeclaration","NodePath","prototype","remove","_blockHoist","replaceWith"],"sources":["../src/normalize-and-load-metadata.ts"],"sourcesContent":["import { basename, extname } from \"node: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: 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 // plugins.\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 const programScope = programPath.scope;\n const programChildren = programPath.get(\"body\");\n\n programChildren.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 // If localName is not found in the bindingKindLookup generated\n // from top level declarations, it could be a reference to a var\n // declaration defined within block statement or switch case\n const kind: ModuleBindingKind =\n bindingKindLookup.get(localName) ??\n (programScope.getBinding(localName)?.kind as \"var\" | undefined);\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 programChildren.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,QAA4B,EAC5B;EACA,IAAI,OAAOH,aAAa,KAAK,UAAU,EAAE;IACvC,OAAOD,2BAA2B,CAACC,aAAa,CAACR,MAAM,EAAEW,QAAQ,CAAC,CAAC;EACrE;EACA,OAAOH,aAAa;AACtB;AAMe,SAASI,8BAA8BA,CACpDC,WAAgC,EAChCC,UAAkB,EAClB;EACEN,aAAa;EACbO,mBAAmB,GAAG,KAAK;EAC3BC,iBAAiB;EACjBC,eAAe,GAAG,KAAK;EACvBN;AAWF,CAAC,EACe;EAChB,IAAI,CAACG,UAAU,EAAE;IACfA,UAAU,GAAGD,WAAW,CAACK,KAAK,CAACC,qBAAqB,CAAC,S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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.default = rewriteLiveReferences;
|
| 7 |
+
var _core = require("@babel/core");
|
| 8 |
+
function isInType(path) {
|
| 9 |
+
do {
|
| 10 |
+
switch (path.parent.type) {
|
| 11 |
+
case "TSTypeAnnotation":
|
| 12 |
+
case "TSTypeAliasDeclaration":
|
| 13 |
+
case "TSTypeReference":
|
| 14 |
+
case "TypeAnnotation":
|
| 15 |
+
case "TypeAlias":
|
| 16 |
+
return true;
|
| 17 |
+
case "ExportSpecifier":
|
| 18 |
+
return path.parentPath.parent.exportKind === "type";
|
| 19 |
+
default:
|
| 20 |
+
if (path.parentPath.isStatement() || path.parentPath.isExpression()) {
|
| 21 |
+
return false;
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
} while (path = path.parentPath);
|
| 25 |
+
}
|
| 26 |
+
function rewriteLiveReferences(programPath, metadata, wrapReference) {
|
| 27 |
+
const imported = new Map();
|
| 28 |
+
const exported = new Map();
|
| 29 |
+
const requeueInParent = path => {
|
| 30 |
+
programPath.requeue(path);
|
| 31 |
+
};
|
| 32 |
+
for (const [source, data] of metadata.source) {
|
| 33 |
+
for (const [localName, importName] of data.imports) {
|
| 34 |
+
imported.set(localName, [source, importName, null]);
|
| 35 |
+
}
|
| 36 |
+
for (const localName of data.importsNamespace) {
|
| 37 |
+
imported.set(localName, [source, null, localName]);
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
for (const [local, data] of metadata.local) {
|
| 41 |
+
let exportMeta = exported.get(local);
|
| 42 |
+
if (!exportMeta) {
|
| 43 |
+
exportMeta = [];
|
| 44 |
+
exported.set(local, exportMeta);
|
| 45 |
+
}
|
| 46 |
+
exportMeta.push(...data.names);
|
| 47 |
+
}
|
| 48 |
+
const rewriteBindingInitVisitorState = {
|
| 49 |
+
metadata,
|
| 50 |
+
requeueInParent,
|
| 51 |
+
scope: programPath.scope,
|
| 52 |
+
exported
|
| 53 |
+
};
|
| 54 |
+
programPath.traverse(rewriteBindingInitVisitor, rewriteBindingInitVisitorState);
|
| 55 |
+
const rewriteReferencesVisitorState = {
|
| 56 |
+
seen: new WeakSet(),
|
| 57 |
+
metadata,
|
| 58 |
+
requeueInParent,
|
| 59 |
+
scope: programPath.scope,
|
| 60 |
+
imported,
|
| 61 |
+
exported,
|
| 62 |
+
buildImportReference([source, importName, localName], identNode) {
|
| 63 |
+
const meta = metadata.source.get(source);
|
| 64 |
+
meta.referenced = true;
|
| 65 |
+
if (localName) {
|
| 66 |
+
if (meta.wrap) {
|
| 67 |
+
var _wrapReference;
|
| 68 |
+
identNode = (_wrapReference = wrapReference(identNode, meta.wrap)) != null ? _wrapReference : identNode;
|
| 69 |
+
}
|
| 70 |
+
return identNode;
|
| 71 |
+
}
|
| 72 |
+
let namespace = _core.types.identifier(meta.name);
|
| 73 |
+
if (meta.wrap) {
|
| 74 |
+
var _wrapReference2;
|
| 75 |
+
namespace = (_wrapReference2 = wrapReference(namespace, meta.wrap)) != null ? _wrapReference2 : namespace;
|
| 76 |
+
}
|
| 77 |
+
if (importName === "default" && meta.interop === "node-default") {
|
| 78 |
+
return namespace;
|
| 79 |
+
}
|
| 80 |
+
const computed = metadata.stringSpecifiers.has(importName);
|
| 81 |
+
return _core.types.memberExpression(namespace, computed ? _core.types.stringLiteral(importName) : _core.types.identifier(importName), computed);
|
| 82 |
+
}
|
| 83 |
+
};
|
| 84 |
+
programPath.traverse(rewriteReferencesVisitor, rewriteReferencesVisitorState);
|
| 85 |
+
}
|
| 86 |
+
const rewriteBindingInitVisitor = {
|
| 87 |
+
Scope(path) {
|
| 88 |
+
path.skip();
|
| 89 |
+
},
|
| 90 |
+
ClassDeclaration(path) {
|
| 91 |
+
const {
|
| 92 |
+
requeueInParent,
|
| 93 |
+
exported,
|
| 94 |
+
metadata
|
| 95 |
+
} = this;
|
| 96 |
+
const {
|
| 97 |
+
id
|
| 98 |
+
} = path.node;
|
| 99 |
+
if (!id) throw new Error("Expected class to have a name");
|
| 100 |
+
const localName = id.name;
|
| 101 |
+
const exportNames = exported.get(localName) || [];
|
| 102 |
+
if (exportNames.length > 0) {
|
| 103 |
+
const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exportNames, _core.types.identifier(localName), path.scope));
|
| 104 |
+
statement._blockHoist = path.node._blockHoist;
|
| 105 |
+
requeueInParent(path.insertAfter(statement)[0]);
|
| 106 |
+
}
|
| 107 |
+
},
|
| 108 |
+
VariableDeclaration(path) {
|
| 109 |
+
const {
|
| 110 |
+
requeueInParent,
|
| 111 |
+
exported,
|
| 112 |
+
metadata
|
| 113 |
+
} = this;
|
| 114 |
+
const isVar = path.node.kind === "var";
|
| 115 |
+
for (const decl of path.get("declarations")) {
|
| 116 |
+
const {
|
| 117 |
+
id
|
| 118 |
+
} = decl.node;
|
| 119 |
+
let {
|
| 120 |
+
init
|
| 121 |
+
} = decl.node;
|
| 122 |
+
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)) {
|
| 123 |
+
if (!init) {
|
| 124 |
+
if (isVar) {
|
| 125 |
+
continue;
|
| 126 |
+
} else {
|
| 127 |
+
init = path.scope.buildUndefinedNode();
|
| 128 |
+
}
|
| 129 |
+
}
|
| 130 |
+
decl.node.init = buildBindingExportAssignmentExpression(metadata, exported.get(id.name), init, path.scope);
|
| 131 |
+
requeueInParent(decl.get("init"));
|
| 132 |
+
} else {
|
| 133 |
+
for (const localName of Object.keys(decl.getOuterBindingIdentifiers())) {
|
| 134 |
+
if (exported.has(localName)) {
|
| 135 |
+
const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exported.get(localName), _core.types.identifier(localName), path.scope));
|
| 136 |
+
statement._blockHoist = path.node._blockHoist;
|
| 137 |
+
requeueInParent(path.insertAfter(statement)[0]);
|
| 138 |
+
}
|
| 139 |
+
}
|
| 140 |
+
}
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
};
|
| 144 |
+
const buildBindingExportAssignmentExpression = (metadata, exportNames, localExpr, scope) => {
|
| 145 |
+
const exportsObjectName = metadata.exportName;
|
| 146 |
+
for (let currentScope = scope; currentScope != null; currentScope = currentScope.parent) {
|
| 147 |
+
if (currentScope.hasOwnBinding(exportsObjectName)) {
|
| 148 |
+
currentScope.rename(exportsObjectName);
|
| 149 |
+
}
|
| 150 |
+
}
|
| 151 |
+
return (exportNames || []).reduce((expr, exportName) => {
|
| 152 |
+
const {
|
| 153 |
+
stringSpecifiers
|
| 154 |
+
} = metadata;
|
| 155 |
+
const computed = stringSpecifiers.has(exportName);
|
| 156 |
+
return _core.types.assignmentExpression("=", _core.types.memberExpression(_core.types.identifier(exportsObjectName), computed ? _core.types.stringLiteral(exportName) : _core.types.identifier(exportName), computed), expr);
|
| 157 |
+
}, localExpr);
|
| 158 |
+
};
|
| 159 |
+
const buildImportThrow = localName => {
|
| 160 |
+
return _core.template.expression.ast`
|
| 161 |
+
(function() {
|
| 162 |
+
throw new Error('"' + '${localName}' + '" is read-only.');
|
| 163 |
+
})()
|
| 164 |
+
`;
|
| 165 |
+
};
|
| 166 |
+
const rewriteReferencesVisitor = {
|
| 167 |
+
ReferencedIdentifier(path) {
|
| 168 |
+
const {
|
| 169 |
+
seen,
|
| 170 |
+
buildImportReference,
|
| 171 |
+
scope,
|
| 172 |
+
imported,
|
| 173 |
+
requeueInParent
|
| 174 |
+
} = this;
|
| 175 |
+
if (seen.has(path.node)) return;
|
| 176 |
+
seen.add(path.node);
|
| 177 |
+
const localName = path.node.name;
|
| 178 |
+
const importData = imported.get(localName);
|
| 179 |
+
if (importData) {
|
| 180 |
+
if (isInType(path)) {
|
| 181 |
+
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.`);
|
| 182 |
+
}
|
| 183 |
+
const localBinding = path.scope.getBinding(localName);
|
| 184 |
+
const rootBinding = scope.getBinding(localName);
|
| 185 |
+
if (rootBinding !== localBinding) return;
|
| 186 |
+
const ref = buildImportReference(importData, path.node);
|
| 187 |
+
ref.loc = path.node.loc;
|
| 188 |
+
if ((path.parentPath.isCallExpression({
|
| 189 |
+
callee: path.node
|
| 190 |
+
}) || path.parentPath.isOptionalCallExpression({
|
| 191 |
+
callee: path.node
|
| 192 |
+
}) || path.parentPath.isTaggedTemplateExpression({
|
| 193 |
+
tag: path.node
|
| 194 |
+
})) && _core.types.isMemberExpression(ref)) {
|
| 195 |
+
path.replaceWith(_core.types.sequenceExpression([_core.types.numericLiteral(0), ref]));
|
| 196 |
+
} else if (path.isJSXIdentifier() && _core.types.isMemberExpression(ref)) {
|
| 197 |
+
const {
|
| 198 |
+
object,
|
| 199 |
+
property
|
| 200 |
+
} = ref;
|
| 201 |
+
path.replaceWith(_core.types.jsxMemberExpression(_core.types.jsxIdentifier(object.name), _core.types.jsxIdentifier(property.name)));
|
| 202 |
+
} else {
|
| 203 |
+
path.replaceWith(ref);
|
| 204 |
+
}
|
| 205 |
+
requeueInParent(path);
|
| 206 |
+
path.skip();
|
| 207 |
+
}
|
| 208 |
+
},
|
| 209 |
+
UpdateExpression(path) {
|
| 210 |
+
const {
|
| 211 |
+
scope,
|
| 212 |
+
seen,
|
| 213 |
+
imported,
|
| 214 |
+
exported,
|
| 215 |
+
requeueInParent,
|
| 216 |
+
buildImportReference
|
| 217 |
+
} = this;
|
| 218 |
+
if (seen.has(path.node)) return;
|
| 219 |
+
seen.add(path.node);
|
| 220 |
+
const arg = path.get("argument");
|
| 221 |
+
if (arg.isMemberExpression()) return;
|
| 222 |
+
const update = path.node;
|
| 223 |
+
if (arg.isIdentifier()) {
|
| 224 |
+
const localName = arg.node.name;
|
| 225 |
+
if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {
|
| 226 |
+
return;
|
| 227 |
+
}
|
| 228 |
+
const exportedNames = exported.get(localName);
|
| 229 |
+
const importData = imported.get(localName);
|
| 230 |
+
if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) {
|
| 231 |
+
if (importData) {
|
| 232 |
+
path.replaceWith(_core.types.assignmentExpression(update.operator[0] + "=", buildImportReference(importData, arg.node), buildImportThrow(localName)));
|
| 233 |
+
} else if (update.prefix) {
|
| 234 |
+
path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.cloneNode(update), path.scope));
|
| 235 |
+
} else {
|
| 236 |
+
const ref = scope.generateDeclaredUidIdentifier(localName);
|
| 237 |
+
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)]));
|
| 238 |
+
}
|
| 239 |
+
}
|
| 240 |
+
}
|
| 241 |
+
requeueInParent(path);
|
| 242 |
+
path.skip();
|
| 243 |
+
},
|
| 244 |
+
AssignmentExpression: {
|
| 245 |
+
exit(path) {
|
| 246 |
+
const {
|
| 247 |
+
scope,
|
| 248 |
+
seen,
|
| 249 |
+
imported,
|
| 250 |
+
exported,
|
| 251 |
+
requeueInParent,
|
| 252 |
+
buildImportReference
|
| 253 |
+
} = this;
|
| 254 |
+
if (seen.has(path.node)) return;
|
| 255 |
+
seen.add(path.node);
|
| 256 |
+
const left = path.get("left");
|
| 257 |
+
if (left.isMemberExpression()) return;
|
| 258 |
+
if (left.isIdentifier()) {
|
| 259 |
+
const localName = left.node.name;
|
| 260 |
+
if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {
|
| 261 |
+
return;
|
| 262 |
+
}
|
| 263 |
+
const exportedNames = exported.get(localName);
|
| 264 |
+
const importData = imported.get(localName);
|
| 265 |
+
if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) {
|
| 266 |
+
const assignment = path.node;
|
| 267 |
+
if (importData) {
|
| 268 |
+
assignment.left = buildImportReference(importData, left.node);
|
| 269 |
+
assignment.right = _core.types.sequenceExpression([assignment.right, buildImportThrow(localName)]);
|
| 270 |
+
}
|
| 271 |
+
const {
|
| 272 |
+
operator
|
| 273 |
+
} = assignment;
|
| 274 |
+
let newExpr;
|
| 275 |
+
if (operator === "=") {
|
| 276 |
+
newExpr = assignment;
|
| 277 |
+
} else if (operator === "&&=" || operator === "||=" || operator === "??=") {
|
| 278 |
+
newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.logicalExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right));
|
| 279 |
+
} else {
|
| 280 |
+
newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.binaryExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right));
|
| 281 |
+
}
|
| 282 |
+
path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, newExpr, path.scope));
|
| 283 |
+
requeueInParent(path);
|
| 284 |
+
path.skip();
|
| 285 |
+
}
|
| 286 |
+
} else {
|
| 287 |
+
const ids = left.getOuterBindingIdentifiers();
|
| 288 |
+
const programScopeIds = Object.keys(ids).filter(localName => scope.getBinding(localName) === path.scope.getBinding(localName));
|
| 289 |
+
const id = programScopeIds.find(localName => imported.has(localName));
|
| 290 |
+
if (id) {
|
| 291 |
+
path.node.right = _core.types.sequenceExpression([path.node.right, buildImportThrow(id)]);
|
| 292 |
+
}
|
| 293 |
+
const items = [];
|
| 294 |
+
programScopeIds.forEach(localName => {
|
| 295 |
+
const exportedNames = exported.get(localName) || [];
|
| 296 |
+
if (exportedNames.length > 0) {
|
| 297 |
+
items.push(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.identifier(localName), path.scope));
|
| 298 |
+
}
|
| 299 |
+
});
|
| 300 |
+
if (items.length > 0) {
|
| 301 |
+
let node = _core.types.sequenceExpression(items);
|
| 302 |
+
if (path.parentPath.isExpressionStatement()) {
|
| 303 |
+
node = _core.types.expressionStatement(node);
|
| 304 |
+
node._blockHoist = path.parentPath.node._blockHoist;
|
| 305 |
+
}
|
| 306 |
+
const statement = path.insertAfter(node)[0];
|
| 307 |
+
requeueInParent(statement);
|
| 308 |
+
}
|
| 309 |
+
}
|
| 310 |
+
}
|
| 311 |
+
},
|
| 312 |
+
ForXStatement(path) {
|
| 313 |
+
const {
|
| 314 |
+
scope,
|
| 315 |
+
node
|
| 316 |
+
} = path;
|
| 317 |
+
const {
|
| 318 |
+
left
|
| 319 |
+
} = node;
|
| 320 |
+
const {
|
| 321 |
+
exported,
|
| 322 |
+
imported,
|
| 323 |
+
scope: programScope
|
| 324 |
+
} = this;
|
| 325 |
+
if (!_core.types.isVariableDeclaration(left)) {
|
| 326 |
+
let didTransformExport = false,
|
| 327 |
+
importConstViolationName;
|
| 328 |
+
const loopBodyScope = path.get("body").scope;
|
| 329 |
+
for (const name of Object.keys(_core.types.getOuterBindingIdentifiers(left))) {
|
| 330 |
+
if (programScope.getBinding(name) === scope.getBinding(name)) {
|
| 331 |
+
if (exported.has(name)) {
|
| 332 |
+
didTransformExport = true;
|
| 333 |
+
if (loopBodyScope.hasOwnBinding(name)) {
|
| 334 |
+
loopBodyScope.rename(name);
|
| 335 |
+
}
|
| 336 |
+
}
|
| 337 |
+
if (imported.has(name) && !importConstViolationName) {
|
| 338 |
+
importConstViolationName = name;
|
| 339 |
+
}
|
| 340 |
+
}
|
| 341 |
+
}
|
| 342 |
+
if (!didTransformExport && !importConstViolationName) {
|
| 343 |
+
return;
|
| 344 |
+
}
|
| 345 |
+
path.ensureBlock();
|
| 346 |
+
const bodyPath = path.get("body");
|
| 347 |
+
const newLoopId = scope.generateUidIdentifierBasedOnNode(left);
|
| 348 |
+
path.get("left").replaceWith(_core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.cloneNode(newLoopId))]));
|
| 349 |
+
scope.registerDeclaration(path.get("left"));
|
| 350 |
+
if (didTransformExport) {
|
| 351 |
+
bodyPath.unshiftContainer("body", _core.types.expressionStatement(_core.types.assignmentExpression("=", left, newLoopId)));
|
| 352 |
+
}
|
| 353 |
+
if (importConstViolationName) {
|
| 354 |
+
bodyPath.unshiftContainer("body", _core.types.expressionStatement(buildImportThrow(importConstViolationName)));
|
| 355 |
+
}
|
| 356 |
+
}
|
| 357 |
+
}
|
| 358 |
+
};
|
| 359 |
+
|
| 360 |
+
//# sourceMappingURL=rewrite-live-references.js.map
|
node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_core","require","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","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","keys","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","assignment","right","newExpr","logicalExpression","slice","binaryExpression","ids","programScopeIds","filter","find","items","forEach","isExpressionStatement","ForXStatement","programScope","isVariableDeclaration","didTransformExport","importConstViolationName","loopBodyScope","ensureBlock","bodyPath","newLoopId","generateUidIdentifierBasedOnNode","variableDeclaration","variableDeclarator","registerDeclaration","unshiftContainer"],"sources":["../src/rewrite-live-references.ts"],"sourcesContent":["import { template, types as t } from \"@babel/core\";\nimport type { NodePath, Visitor, Scope } from \"@babel/core\";\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 // 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 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 const { operator } = assignment;\n let newExpr;\n if (operator === \"=\") {\n newExpr = assignment;\n } else if (\n operator === \"&&=\" ||\n operator === \"||=\" ||\n operator === \"??=\"\n ) {\n newExpr = t.assignmentExpression(\n \"=\",\n assignment.left,\n t.logicalExpression(\n operator.slice(0, -1) as t.LogicalExpression[\"operator\"],\n t.cloneNode(assignment.left) as t.Expression,\n assignment.right,\n ),\n );\n } else {\n newExpr = t.assignmentExpression(\n \"=\",\n assignment.left,\n t.binaryExpression(\n operator.slice(0, -1) as t.BinaryExpression[\"operator\"],\n t.cloneNode(assignment.left) as t.Expression,\n assignment.right,\n ),\n );\n }\n\n path.replaceWith(\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n newExpr,\n path.scope,\n ),\n );\n\n requeueInParent(path);\n\n path.skip();\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 ForXStatement(path) {\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,KAAA,GAAAC,OAAA;AAyBA,SAASC,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,SAASI,q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J,WAAW,CAAC,CAAC;MAClB,MAAMC,QAAQ,GAAGlJ,IAAI,CAACyB,GAAG,CAAC,MAAM,CAA+B;MAE/D,MAAM0H,SAAS,GAAGtH,KAAK,CAACuH,gCAAgC,CAACvB,IAAI,CAAC;MAC9D7H,IAAI,CACDyB,GAAG,CAAC,MAAM,CAAC,CACXkF,WAAW,CACVjE,WAAC,CAAC2G,mBAAmB,CAAC,KAAK,EAAE,CAC3B3G,WAAC,CAAC4G,kBAAkB,CAAC5G,WAAC,CAAC+E,SAAS,CAAC0B,SAAS,CAAC,CAAC,CAC7C,CACH,CAAC;MACHtH,KAAK,CAAC0H,mBAAmB,CAACvJ,IAAI,CAACyB,GAAG,CAAC,MAAM,CAAC,CAAC;MAE3C,IAAIqH,kBAAkB,EAAE;QACtBI,QAAQ,CAACM,gBAAgB,CACvB,MAAM,EACN9G,WAAC,CAACoB,mBAAmB,CAACpB,WAAC,CAAC6C,oBAAoB,CAAC,GAAG,EAAEsC,IAAI,EAAEsB,SAAS,CAAC,CACpE,CAAC;MACH;MACA,IAAIJ,wBAAwB,EAAE;QAC5BG,QAAQ,CAACM,gBAAgB,CACvB,MAAM,EACN9G,WAAC,CAACoB,mBAAmB,CAAC0B,gBAAgB,CAACuD,wBAAwB,CAAC,CAClE,CAAC;MACH;IACF;EACF;AACF,CAAC","ignoreList":[]}
|
node_modules/@babel/helper-module-transforms/lib/rewrite-this.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.default = rewriteThis;
|
| 7 |
+
var _core = require("@babel/core");
|
| 8 |
+
var _traverse = require("@babel/traverse");
|
| 9 |
+
let rewriteThisVisitor;
|
| 10 |
+
function rewriteThis(programPath) {
|
| 11 |
+
if (!rewriteThisVisitor) {
|
| 12 |
+
rewriteThisVisitor = _traverse.visitors.environmentVisitor({
|
| 13 |
+
ThisExpression(path) {
|
| 14 |
+
path.replaceWith(_core.types.unaryExpression("void", _core.types.numericLiteral(0), true));
|
| 15 |
+
}
|
| 16 |
+
});
|
| 17 |
+
rewriteThisVisitor.noScope = true;
|
| 18 |
+
}
|
| 19 |
+
(0, _traverse.default)(programPath.node, rewriteThisVisitor);
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
//# sourceMappingURL=rewrite-this.js.map
|
node_modules/@babel/helper-module-transforms/lib/rewrite-this.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"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":[]}
|
node_modules/@babel/helper-module-transforms/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@babel/helper-module-transforms",
|
| 3 |
+
"version": "7.29.7",
|
| 4 |
+
"description": "Babel helper functions for implementing ES6 module transformations",
|
| 5 |
+
"author": "The Babel Team (https://babel.dev/team)",
|
| 6 |
+
"homepage": "https://babel.dev/docs/en/next/babel-helper-module-transforms",
|
| 7 |
+
"license": "MIT",
|
| 8 |
+
"publishConfig": {
|
| 9 |
+
"access": "public"
|
| 10 |
+
},
|
| 11 |
+
"repository": {
|
| 12 |
+
"type": "git",
|
| 13 |
+
"url": "https://github.com/babel/babel.git",
|
| 14 |
+
"directory": "packages/babel-helper-module-transforms"
|
| 15 |
+
},
|
| 16 |
+
"main": "./lib/index.js",
|
| 17 |
+
"dependencies": {
|
| 18 |
+
"@babel/helper-module-imports": "^7.29.7",
|
| 19 |
+
"@babel/helper-validator-identifier": "^7.29.7",
|
| 20 |
+
"@babel/traverse": "^7.29.7"
|
| 21 |
+
},
|
| 22 |
+
"devDependencies": {
|
| 23 |
+
"@babel/core": "^7.29.7"
|
| 24 |
+
},
|
| 25 |
+
"peerDependencies": {
|
| 26 |
+
"@babel/core": "^7.0.0"
|
| 27 |
+
},
|
| 28 |
+
"engines": {
|
| 29 |
+
"node": ">=6.9.0"
|
| 30 |
+
},
|
| 31 |
+
"type": "commonjs"
|
| 32 |
+
}
|
node_modules/@babel/helper-optimise-call-expression/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 6 |
+
a copy of this software and associated documentation files (the
|
| 7 |
+
"Software"), to deal in the Software without restriction, including
|
| 8 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 9 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 10 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 11 |
+
the following conditions:
|
| 12 |
+
|
| 13 |
+
The above copyright notice and this permission notice shall be
|
| 14 |
+
included in all copies or substantial portions of the Software.
|
| 15 |
+
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 17 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 18 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 19 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
| 20 |
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
| 21 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
| 22 |
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
node_modules/@babel/helper-optimise-call-expression/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @babel/helper-optimise-call-expression
|
| 2 |
+
|
| 3 |
+
> Helper function to optimise call expression
|
| 4 |
+
|
| 5 |
+
See our website [@babel/helper-optimise-call-expression](https://babeljs.io/docs/babel-helper-optimise-call-expression) for more information.
|
| 6 |
+
|
| 7 |
+
## Install
|
| 8 |
+
|
| 9 |
+
Using npm:
|
| 10 |
+
|
| 11 |
+
```sh
|
| 12 |
+
npm install --save @babel/helper-optimise-call-expression
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
or using yarn:
|
| 16 |
+
|
| 17 |
+
```sh
|
| 18 |
+
yarn add @babel/helper-optimise-call-expression
|
| 19 |
+
```
|
node_modules/@babel/helper-optimise-call-expression/lib/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.default = optimiseCallExpression;
|
| 7 |
+
var _t = require("@babel/types");
|
| 8 |
+
const {
|
| 9 |
+
callExpression,
|
| 10 |
+
identifier,
|
| 11 |
+
isIdentifier,
|
| 12 |
+
isSpreadElement,
|
| 13 |
+
memberExpression,
|
| 14 |
+
optionalCallExpression,
|
| 15 |
+
optionalMemberExpression
|
| 16 |
+
} = _t;
|
| 17 |
+
function optimiseCallExpression(callee, thisNode, args, optional) {
|
| 18 |
+
if (args.length === 1 && isSpreadElement(args[0]) && isIdentifier(args[0].argument, {
|
| 19 |
+
name: "arguments"
|
| 20 |
+
})) {
|
| 21 |
+
if (optional) {
|
| 22 |
+
return optionalCallExpression(optionalMemberExpression(callee, identifier("apply"), false, true), [thisNode, args[0].argument], false);
|
| 23 |
+
}
|
| 24 |
+
return callExpression(memberExpression(callee, identifier("apply")), [thisNode, args[0].argument]);
|
| 25 |
+
} else {
|
| 26 |
+
if (optional) {
|
| 27 |
+
return optionalCallExpression(optionalMemberExpression(callee, identifier("call"), false, true), [thisNode, ...args], false);
|
| 28 |
+
}
|
| 29 |
+
return callExpression(memberExpression(callee, identifier("call")), [thisNode, ...args]);
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@babel/helper-optimise-call-expression/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","callExpression","identifier","isIdentifier","isSpreadElement","memberExpression","optionalCallExpression","optionalMemberExpression","optimiseCallExpression","callee","thisNode","args","optional","length","argument","name"],"sources":["../src/index.ts"],"sourcesContent":["import {\n callExpression,\n identifier,\n isIdentifier,\n isSpreadElement,\n memberExpression,\n optionalCallExpression,\n optionalMemberExpression,\n} from \"@babel/types\";\nimport type {\n CallExpression,\n Expression,\n OptionalCallExpression,\n} from \"@babel/types\";\n\n/**\n * A helper function that generates a new call expression with given thisNode.\n It will also optimize `(...arguments)` to `.apply(arguments)`\n *\n * @export\n * @param {Expression} callee The callee of call expression\n * @param {Expression} thisNode The desired this of call expression\n * @param {Readonly<CallExpression[\"arguments\"]>} args The arguments of call expression\n * @param {boolean} optional Whether the call expression is optional\n * @returns {CallExpression | OptionalCallExpression} The generated new call expression\n */\nexport default function optimiseCallExpression(\n callee: Expression,\n thisNode: Expression,\n args: Readonly<CallExpression[\"arguments\"]>,\n optional: boolean,\n): CallExpression | OptionalCallExpression {\n if (\n args.length === 1 &&\n isSpreadElement(args[0]) &&\n isIdentifier(args[0].argument, { name: \"arguments\" })\n ) {\n // a.b?.(...arguments);\n if (optional) {\n return optionalCallExpression(\n optionalMemberExpression(callee, identifier(\"apply\"), false, true),\n [thisNode, args[0].argument],\n false,\n );\n }\n // a.b(...arguments);\n return callExpression(memberExpression(callee, identifier(\"apply\")), [\n thisNode,\n args[0].argument,\n ]);\n } else {\n // a.b?.(arg1, arg2)\n if (optional) {\n return optionalCallExpression(\n optionalMemberExpression(callee, identifier(\"call\"), false, true),\n [thisNode, ...args],\n false,\n );\n }\n // a.b(arg1, arg2)\n return callExpression(memberExpression(callee, identifier(\"call\")), [\n thisNode,\n ...args,\n ]);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,EAAA,GAAAC,OAAA;AAQsB;EAPpBC,cAAc;EACdC,UAAU;EACVC,YAAY;EACZC,eAAe;EACfC,gBAAgB;EAChBC,sBAAsB;EACtBC;AAAwB,IAAAR,EAAA;AAmBX,SAASS,sBAAsBA,CAC5CC,MAAkB,EAClBC,QAAoB,EACpBC,IAA2C,EAC3CC,QAAiB,EACwB;EACzC,IACED,IAAI,CAACE,MAAM,KAAK,CAAC,IACjBT,eAAe,CAACO,IAAI,CAAC,CAAC,CAAC,CAAC,IACxBR,YAAY,CAACQ,IAAI,CAAC,CAAC,CAAC,CAACG,QAAQ,EAAE;IAAEC,IAAI,EAAE;EAAY,CAAC,CAAC,EACrD;IAEA,IAAIH,QAAQ,EAAE;MACZ,OAAON,sBAAsB,CAC3BC,wBAAwB,CAACE,MAAM,EAAEP,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EAClE,CAACQ,QAAQ,EAAEC,IAAI,CAAC,CAAC,CAAC,CAACG,QAAQ,CAAC,EAC5B,KACF,CAAC;IACH;IAEA,OAAOb,cAAc,CAACI,gBAAgB,CAACI,MAAM,EAAEP,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CACnEQ,QAAQ,EACRC,IAAI,CAAC,CAAC,CAAC,CAACG,QAAQ,CACjB,CAAC;EACJ,CAAC,MAAM;IAEL,IAAIF,QAAQ,EAAE;MACZ,OAAON,sBAAsB,CAC3BC,wBAAwB,CAACE,MAAM,EAAEP,UAAU,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EACjE,CAACQ,QAAQ,EAAE,GAAGC,IAAI,CAAC,EACnB,KACF,CAAC;IACH;IAEA,OAAOV,cAAc,CAACI,gBAAgB,CAACI,MAAM,EAAEP,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAClEQ,QAAQ,EACR,GAAGC,IAAI,CACR,CAAC;EACJ;AACF","ignoreList":[]}
|
node_modules/@babel/helper-optimise-call-expression/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@babel/helper-optimise-call-expression",
|
| 3 |
+
"version": "7.29.7",
|
| 4 |
+
"description": "Helper function to optimise call expression",
|
| 5 |
+
"repository": {
|
| 6 |
+
"type": "git",
|
| 7 |
+
"url": "https://github.com/babel/babel.git",
|
| 8 |
+
"directory": "packages/babel-helper-optimise-call-expression"
|
| 9 |
+
},
|
| 10 |
+
"homepage": "https://babel.dev/docs/en/next/babel-helper-optimise-call-expression",
|
| 11 |
+
"license": "MIT",
|
| 12 |
+
"publishConfig": {
|
| 13 |
+
"access": "public"
|
| 14 |
+
},
|
| 15 |
+
"main": "./lib/index.js",
|
| 16 |
+
"dependencies": {
|
| 17 |
+
"@babel/types": "^7.29.7"
|
| 18 |
+
},
|
| 19 |
+
"devDependencies": {
|
| 20 |
+
"@babel/generator": "^7.29.7",
|
| 21 |
+
"@babel/parser": "^7.29.7"
|
| 22 |
+
},
|
| 23 |
+
"engines": {
|
| 24 |
+
"node": ">=6.9.0"
|
| 25 |
+
},
|
| 26 |
+
"author": "The Babel Team (https://babel.dev/team)",
|
| 27 |
+
"type": "commonjs"
|
| 28 |
+
}
|
node_modules/@babel/helper-plugin-utils/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 6 |
+
a copy of this software and associated documentation files (the
|
| 7 |
+
"Software"), to deal in the Software without restriction, including
|
| 8 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 9 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 10 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 11 |
+
the following conditions:
|
| 12 |
+
|
| 13 |
+
The above copyright notice and this permission notice shall be
|
| 14 |
+
included in all copies or substantial portions of the Software.
|
| 15 |
+
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 17 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 18 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 19 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
| 20 |
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
| 21 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
| 22 |
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
node_modules/@babel/helper-plugin-utils/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @babel/helper-plugin-utils
|
| 2 |
+
|
| 3 |
+
> General utilities for plugins to use
|
| 4 |
+
|
| 5 |
+
See our website [@babel/helper-plugin-utils](https://babeljs.io/docs/babel-helper-plugin-utils) for more information.
|
| 6 |
+
|
| 7 |
+
## Install
|
| 8 |
+
|
| 9 |
+
Using npm:
|
| 10 |
+
|
| 11 |
+
```sh
|
| 12 |
+
npm install --save @babel/helper-plugin-utils
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
or using yarn:
|
| 16 |
+
|
| 17 |
+
```sh
|
| 18 |
+
yarn add @babel/helper-plugin-utils
|
| 19 |
+
```
|
node_modules/@babel/helper-plugin-utils/lib/index.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.declare = declare;
|
| 7 |
+
exports.declarePreset = void 0;
|
| 8 |
+
const apiPolyfills = {
|
| 9 |
+
assertVersion: api => range => {
|
| 10 |
+
throwVersionError(range, api.version);
|
| 11 |
+
}
|
| 12 |
+
};
|
| 13 |
+
Object.assign(apiPolyfills, {
|
| 14 |
+
targets: () => () => {
|
| 15 |
+
return {};
|
| 16 |
+
},
|
| 17 |
+
assumption: () => () => {
|
| 18 |
+
return undefined;
|
| 19 |
+
},
|
| 20 |
+
addExternalDependency: () => () => {}
|
| 21 |
+
});
|
| 22 |
+
function declare(builder) {
|
| 23 |
+
return (api, options, dirname) => {
|
| 24 |
+
let clonedApi;
|
| 25 |
+
for (const name of Object.keys(apiPolyfills)) {
|
| 26 |
+
if (api[name]) continue;
|
| 27 |
+
clonedApi != null ? clonedApi : clonedApi = copyApiObject(api);
|
| 28 |
+
clonedApi[name] = apiPolyfills[name](clonedApi);
|
| 29 |
+
}
|
| 30 |
+
return builder(clonedApi != null ? clonedApi : api, options || {}, dirname);
|
| 31 |
+
};
|
| 32 |
+
}
|
| 33 |
+
const declarePreset = exports.declarePreset = declare;
|
| 34 |
+
function copyApiObject(api) {
|
| 35 |
+
let proto = null;
|
| 36 |
+
if (typeof api.version === "string" && api.version.startsWith("7.")) {
|
| 37 |
+
proto = Object.getPrototypeOf(api);
|
| 38 |
+
if (proto && (!hasOwnProperty.call(proto, "version") || !hasOwnProperty.call(proto, "transform") || !hasOwnProperty.call(proto, "template") || !hasOwnProperty.call(proto, "types"))) {
|
| 39 |
+
proto = null;
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
return Object.assign({}, proto, api);
|
| 43 |
+
}
|
| 44 |
+
function throwVersionError(range, version) {
|
| 45 |
+
if (typeof range === "number") {
|
| 46 |
+
if (!Number.isInteger(range)) {
|
| 47 |
+
throw new Error("Expected string or integer value.");
|
| 48 |
+
}
|
| 49 |
+
range = `^${range}.0.0-0`;
|
| 50 |
+
}
|
| 51 |
+
if (typeof range !== "string") {
|
| 52 |
+
throw new Error("Expected string or integer value.");
|
| 53 |
+
}
|
| 54 |
+
const limit = Error.stackTraceLimit;
|
| 55 |
+
if (typeof limit === "number" && limit < 25) {
|
| 56 |
+
Error.stackTraceLimit = 25;
|
| 57 |
+
}
|
| 58 |
+
let err;
|
| 59 |
+
if (version.startsWith("7.")) {
|
| 60 |
+
err = new Error(`Requires Babel "^7.0.0-beta.41", but was loaded with "${version}". ` + `You'll need to update your @babel/core version.`);
|
| 61 |
+
} else {
|
| 62 |
+
err = new Error(`Requires Babel "${range}", but was loaded with "${version}". ` + `If you are sure you have a compatible version of @babel/core, ` + `it is likely that something in your build process is loading the ` + `wrong version. Inspect the stack trace of this error to look for ` + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + `to see what is calling Babel.`);
|
| 63 |
+
}
|
| 64 |
+
if (typeof limit === "number") {
|
| 65 |
+
Error.stackTraceLimit = limit;
|
| 66 |
+
}
|
| 67 |
+
throw Object.assign(err, {
|
| 68 |
+
code: "BABEL_VERSION_UNSUPPORTED",
|
| 69 |
+
version,
|
| 70 |
+
range
|
| 71 |
+
});
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@babel/helper-plugin-utils/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["apiPolyfills","assertVersion","api","range","throwVersionError","version","Object","assign","targets","assumption","undefined","addExternalDependency","declare","builder","options","dirname","clonedApi","name","keys","copyApiObject","declarePreset","exports","proto","startsWith","getPrototypeOf","hasOwnProperty","call","Number","isInteger","Error","limit","stackTraceLimit","err","code"],"sources":["../src/index.ts"],"sourcesContent":["import type {\n PluginAPI,\n PluginObject,\n PluginPass,\n PresetAPI,\n PresetObject,\n} from \"@babel/core\";\n\ntype APIPolyfillFactory<T extends keyof PluginAPI> = (\n api: PluginAPI,\n) => PluginAPI[T];\n\ntype APIPolyfills = {\n assertVersion: APIPolyfillFactory<\"assertVersion\">;\n};\n\nconst apiPolyfills: APIPolyfills = {\n // Not supported by Babel 7 and early versions of Babel 7 beta.\n // It's important that this is polyfilled for older Babel versions\n // since it's needed to report the version mismatch.\n assertVersion: (api: PluginAPI) => (range: number | string) => {\n throwVersionError(range, api.version);\n },\n};\nif (!process.env.BABEL_8_BREAKING) {\n Object.assign(apiPolyfills, {\n // This is supported starting from Babel 7.13\n targets: () => (): any => {\n return {};\n },\n // This is supported starting from Babel 7.13\n assumption: () => (): any => {\n return undefined;\n },\n // This is supported starting from Babel 7.17\n addExternalDependency: () => () => {},\n });\n}\n\nexport function declare<State = object, Option = object>(\n builder: (\n api: PluginAPI,\n options: Option,\n dirname: string,\n ) => PluginObject<State & PluginPass>,\n): (\n api: PluginAPI,\n options: Option,\n dirname: string,\n) => PluginObject<State & PluginPass> {\n return (api, options: Option, dirname: string) => {\n let clonedApi: PluginAPI;\n\n for (const name of Object.keys(\n apiPolyfills,\n ) as (keyof typeof apiPolyfills)[]) {\n if (api[name]) continue;\n\n clonedApi ??= copyApiObject(api);\n clonedApi[name] = apiPolyfills[name](clonedApi);\n }\n\n // @ts-expect-error options || {} may not be assigned to Options\n return builder(clonedApi ?? api, options || {}, dirname);\n };\n}\n\nexport const declarePreset = declare as <Option = object>(\n builder: (api: PresetAPI, options: Option, dirname: string) => PresetObject,\n) => (api: PresetAPI, options: Option, dirname: string) => PresetObject;\n\nfunction copyApiObject(api: PluginAPI): PluginAPI {\n // Babel >= 7 <= beta.41 passed the API as a new object that had\n // babel/core as the prototype. While slightly faster, it also\n // means that the Object.assign copy below fails. Rather than\n // keep complexity, the Babel 6 behavior has been reverted and this\n // normalizes all that for Babel 7.\n let proto = null;\n if (typeof api.version === \"string\" && api.version.startsWith(\"7.\")) {\n proto = Object.getPrototypeOf(api);\n if (\n proto &&\n (!Object.hasOwn(proto, \"version\") ||\n !Object.hasOwn(proto, \"transform\") ||\n !Object.hasOwn(proto, \"template\") ||\n !Object.hasOwn(proto, \"types\"))\n ) {\n proto = null;\n }\n }\n\n return {\n ...proto,\n ...api,\n };\n}\n\nfunction throwVersionError(range: string | number, version: string) {\n if (typeof range === \"number\") {\n if (!Number.isInteger(range)) {\n throw new Error(\"Expected string or integer value.\");\n }\n range = `^${range}.0.0-0`;\n }\n if (typeof range !== \"string\") {\n throw new Error(\"Expected string or integer value.\");\n }\n\n const limit = Error.stackTraceLimit;\n\n if (typeof limit === \"number\" && limit < 25) {\n // Bump up the limit if needed so that users are more likely\n // to be able to see what is calling Babel.\n Error.stackTraceLimit = 25;\n }\n\n let err;\n if (version.startsWith(\"7.\")) {\n err = new Error(\n `Requires Babel \"^7.0.0-beta.41\", but was loaded with \"${version}\". ` +\n `You'll need to update your @babel/core version.`,\n );\n } else {\n err = new Error(\n `Requires Babel \"${range}\", but was loaded with \"${version}\". ` +\n `If you are sure you have a compatible version of @babel/core, ` +\n `it is likely that something in your build process is loading the ` +\n `wrong version. Inspect the stack trace of this error to look for ` +\n `the first entry that doesn't mention \"@babel/core\" or \"babel-core\" ` +\n `to see what is calling Babel.`,\n );\n }\n\n if (typeof limit === \"number\") {\n Error.stackTraceLimit = limit;\n }\n\n throw Object.assign(err, {\n code: \"BABEL_VERSION_UNSUPPORTED\",\n version,\n range,\n } as any);\n}\n"],"mappings":";;;;;;;AAgBA,MAAMA,YAA0B,GAAG;EAIjC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K,KAAK,QAAQ,EAAE;IAC7BD,KAAK,CAACE,eAAe,GAAGD,KAAK;EAC/B;EAEA,MAAMxB,MAAM,CAACC,MAAM,CAACyB,GAAG,EAAE;IACvBC,IAAI,EAAE,2BAA2B;IACjC5B,OAAO;IACPF;EACF,CAAQ,CAAC;AACX","ignoreList":[]}
|
node_modules/@babel/helper-plugin-utils/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@babel/helper-plugin-utils",
|
| 3 |
+
"version": "7.29.7",
|
| 4 |
+
"description": "General utilities for plugins to use",
|
| 5 |
+
"author": "The Babel Team (https://babel.dev/team)",
|
| 6 |
+
"homepage": "https://babel.dev/docs/en/next/babel-helper-plugin-utils",
|
| 7 |
+
"license": "MIT",
|
| 8 |
+
"publishConfig": {
|
| 9 |
+
"access": "public"
|
| 10 |
+
},
|
| 11 |
+
"repository": {
|
| 12 |
+
"type": "git",
|
| 13 |
+
"url": "https://github.com/babel/babel.git",
|
| 14 |
+
"directory": "packages/babel-helper-plugin-utils"
|
| 15 |
+
},
|
| 16 |
+
"main": "./lib/index.js",
|
| 17 |
+
"engines": {
|
| 18 |
+
"node": ">=6.9.0"
|
| 19 |
+
},
|
| 20 |
+
"devDependencies": {
|
| 21 |
+
"@babel/core": "^7.29.7"
|
| 22 |
+
},
|
| 23 |
+
"type": "commonjs"
|
| 24 |
+
}
|
node_modules/@babel/helper-remap-async-to-generator/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 6 |
+
a copy of this software and associated documentation files (the
|
| 7 |
+
"Software"), to deal in the Software without restriction, including
|
| 8 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 9 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 10 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 11 |
+
the following conditions:
|
| 12 |
+
|
| 13 |
+
The above copyright notice and this permission notice shall be
|
| 14 |
+
included in all copies or substantial portions of the Software.
|
| 15 |
+
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 17 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 18 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 19 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
| 20 |
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
| 21 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
| 22 |
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
node_modules/@babel/helper-remap-async-to-generator/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @babel/helper-remap-async-to-generator
|
| 2 |
+
|
| 3 |
+
> Helper function to remap async functions to generators
|
| 4 |
+
|
| 5 |
+
See our website [@babel/helper-remap-async-to-generator](https://babeljs.io/docs/babel-helper-remap-async-to-generator) for more information.
|
| 6 |
+
|
| 7 |
+
## Install
|
| 8 |
+
|
| 9 |
+
Using npm:
|
| 10 |
+
|
| 11 |
+
```sh
|
| 12 |
+
npm install --save @babel/helper-remap-async-to-generator
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
or using yarn:
|
| 16 |
+
|
| 17 |
+
```sh
|
| 18 |
+
yarn add @babel/helper-remap-async-to-generator
|
| 19 |
+
```
|
node_modules/@babel/helper-remap-async-to-generator/lib/index.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.default = _default;
|
| 7 |
+
var _helperWrapFunction = require("@babel/helper-wrap-function");
|
| 8 |
+
var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure");
|
| 9 |
+
var _core = require("@babel/core");
|
| 10 |
+
var _traverse = require("@babel/traverse");
|
| 11 |
+
const {
|
| 12 |
+
callExpression,
|
| 13 |
+
cloneNode,
|
| 14 |
+
isIdentifier,
|
| 15 |
+
isThisExpression,
|
| 16 |
+
yieldExpression
|
| 17 |
+
} = _core.types;
|
| 18 |
+
const awaitVisitor = _traverse.visitors.environmentVisitor({
|
| 19 |
+
ArrowFunctionExpression(path) {
|
| 20 |
+
path.skip();
|
| 21 |
+
},
|
| 22 |
+
AwaitExpression(path, {
|
| 23 |
+
wrapAwait
|
| 24 |
+
}) {
|
| 25 |
+
const argument = path.get("argument");
|
| 26 |
+
path.replaceWith(yieldExpression(wrapAwait ? callExpression(cloneNode(wrapAwait), [argument.node]) : argument.node));
|
| 27 |
+
}
|
| 28 |
+
});
|
| 29 |
+
function _default(path, helpers, noNewArrows, ignoreFunctionLength) {
|
| 30 |
+
path.traverse(awaitVisitor, {
|
| 31 |
+
wrapAwait: helpers.wrapAwait
|
| 32 |
+
});
|
| 33 |
+
const isIIFE = checkIsIIFE(path);
|
| 34 |
+
path.node.async = false;
|
| 35 |
+
path.node.generator = true;
|
| 36 |
+
(0, _helperWrapFunction.default)(path, cloneNode(helpers.wrapAsync), noNewArrows, ignoreFunctionLength);
|
| 37 |
+
const isProperty = path.isObjectMethod() || path.isClassMethod() || path.parentPath.isObjectProperty() || path.parentPath.isClassProperty();
|
| 38 |
+
if (!isProperty && !isIIFE && path.isExpression()) {
|
| 39 |
+
(0, _helperAnnotateAsPure.default)(path);
|
| 40 |
+
}
|
| 41 |
+
function checkIsIIFE(path) {
|
| 42 |
+
if (path.parentPath.isCallExpression({
|
| 43 |
+
callee: path.node
|
| 44 |
+
})) {
|
| 45 |
+
return true;
|
| 46 |
+
}
|
| 47 |
+
const {
|
| 48 |
+
parentPath
|
| 49 |
+
} = path;
|
| 50 |
+
if (parentPath.isMemberExpression()) {
|
| 51 |
+
if (isIdentifier(parentPath.node.property, {
|
| 52 |
+
name: "bind"
|
| 53 |
+
})) {
|
| 54 |
+
const {
|
| 55 |
+
parentPath: bindCall
|
| 56 |
+
} = parentPath;
|
| 57 |
+
return (bindCall.isCallExpression() && bindCall.node.arguments.length === 1 && isThisExpression(bindCall.node.arguments[0]) && bindCall.parentPath.isCallExpression({
|
| 58 |
+
callee: bindCall.node
|
| 59 |
+
})
|
| 60 |
+
);
|
| 61 |
+
}
|
| 62 |
+
return true;
|
| 63 |
+
}
|
| 64 |
+
return false;
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@babel/helper-remap-async-to-generator/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_helperWrapFunction","require","_helperAnnotateAsPure","_core","_traverse","callExpression","cloneNode","isIdentifier","isThisExpression","yieldExpression","t","awaitVisitor","visitors","environmentVisitor","ArrowFunctionExpression","path","skip","AwaitExpression","wrapAwait","argument","get","replaceWith","node","_default","helpers","noNewArrows","ignoreFunctionLength","traverse","isIIFE","checkIsIIFE","async","generator","wrapFunction","wrapAsync","isProperty","isObjectMethod","isClassMethod","parentPath","isObjectProperty","isClassProperty","isExpression","annotateAsPure","isCallExpression","callee","isMemberExpression","property","name","bindCall","arguments","length"],"sources":["../src/index.ts"],"sourcesContent":["import type { NodePath } from \"@babel/core\";\nimport wrapFunction from \"@babel/helper-wrap-function\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\nimport { types as t } from \"@babel/core\";\nimport { visitors } from \"@babel/traverse\";\nconst {\n callExpression,\n cloneNode,\n isIdentifier,\n isThisExpression,\n yieldExpression,\n} = t;\n\nconst awaitVisitor = visitors.environmentVisitor<{ wrapAwait: t.Expression }>({\n ArrowFunctionExpression(path) {\n path.skip();\n },\n\n AwaitExpression(path, { wrapAwait }) {\n const argument = path.get(\"argument\");\n\n path.replaceWith(\n yieldExpression(\n wrapAwait\n ? callExpression(cloneNode(wrapAwait), [argument.node])\n : argument.node,\n ),\n );\n },\n});\n\nexport default function (\n path: NodePath<t.Function>,\n helpers: {\n wrapAsync: t.Expression;\n wrapAwait?: t.Expression;\n },\n noNewArrows?: boolean,\n ignoreFunctionLength?: boolean,\n) {\n path.traverse(awaitVisitor, {\n wrapAwait: helpers.wrapAwait,\n });\n\n const isIIFE = checkIsIIFE(path);\n\n path.node.async = false;\n path.node.generator = true;\n\n wrapFunction(\n path,\n cloneNode(helpers.wrapAsync),\n noNewArrows,\n ignoreFunctionLength,\n );\n\n const isProperty =\n path.isObjectMethod() ||\n path.isClassMethod() ||\n path.parentPath.isObjectProperty() ||\n path.parentPath.isClassProperty();\n\n if (!isProperty && !isIIFE && path.isExpression()) {\n annotateAsPure(path);\n }\n\n function checkIsIIFE(path: NodePath) {\n if (path.parentPath.isCallExpression({ callee: path.node })) {\n return true;\n }\n\n // try to catch calls to Function#bind, as emitted by arrowFunctionToExpression in spec mode\n // this may also catch .bind(this) written by users, but does it matter? 🤔\n const { parentPath } = path;\n if (parentPath.isMemberExpression()) {\n if (isIdentifier(parentPath.node.property, { name: \"bind\" })) {\n const { parentPath: bindCall } = parentPath;\n\n // (function () { ... }).bind(this)()\n\n return (\n // first, check if the .bind is actually being called\n bindCall.isCallExpression() &&\n // and whether its sole argument is 'this'\n bindCall.node.arguments.length === 1 &&\n isThisExpression(bindCall.node.arguments[0]) &&\n // and whether the result of the .bind(this) is being called\n bindCall.parentPath.isCallExpression({ callee: bindCall.node })\n );\n }\n return true;\n }\n\n return false;\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,MAAM;EACJI,cAAc;EACdC,SAAS;EACTC,YAAY;EACZC,gBAAgB;EAChBC;AACF,CAAC,GAAGC,WAAC;AAEL,MAAMC,YAAY,GAAGC,kBAAQ,CAACC,kBAAkB,CAA8B;EAC5EC,uBAAuBA,CAACC,IAAI,EAAE;IAC5BA,IAAI,CAACC,IAAI,CAAC,CAAC;EACb,CAAC;EAEDC,eAAeA,CA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O,IAAI;IACb;IAIA,MAAM;MAAEe;IAAW,CAAC,GAAGtB,IAAI;IAC3B,IAAIsB,UAAU,CAACO,kBAAkB,CAAC,CAAC,EAAE;MACnC,IAAIrC,YAAY,CAAC8B,UAAU,CAACf,IAAI,CAACuB,QAAQ,EAAE;QAAEC,IAAI,EAAE;MAAO,CAAC,CAAC,EAAE;QAC5D,MAAM;UAAET,UAAU,EAAEU;QAAS,CAAC,GAAGV,UAAU;QAI3C,QAEEU,QAAQ,CAACL,gBAAgB,CAAC,CAAC,IAE3BK,QAAQ,CAACzB,IAAI,CAAC0B,SAAS,CAACC,MAAM,KAAK,CAAC,IACpCzC,gBAAgB,CAACuC,QAAQ,CAACzB,IAAI,CAAC0B,SAAS,CAAC,CAAC,CAAC,CAAC,IAE5CD,QAAQ,CAACV,UAAU,CAACK,gBAAgB,CAAC;YAAEC,MAAM,EAAEI,QAAQ,CAACzB;UAAK,CAAC;QAAC;MAEnE;MACA,OAAO,IAAI;IACb;IAEA,OAAO,KAAK;EACd;AACF","ignoreList":[]}
|
node_modules/@babel/helper-remap-async-to-generator/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@babel/helper-remap-async-to-generator",
|
| 3 |
+
"version": "7.29.7",
|
| 4 |
+
"description": "Helper function to remap async functions to generators",
|
| 5 |
+
"repository": {
|
| 6 |
+
"type": "git",
|
| 7 |
+
"url": "https://github.com/babel/babel.git",
|
| 8 |
+
"directory": "packages/babel-helper-remap-async-to-generator"
|
| 9 |
+
},
|
| 10 |
+
"homepage": "https://babel.dev/docs/en/next/babel-helper-remap-async-to-generator",
|
| 11 |
+
"license": "MIT",
|
| 12 |
+
"publishConfig": {
|
| 13 |
+
"access": "public"
|
| 14 |
+
},
|
| 15 |
+
"main": "./lib/index.js",
|
| 16 |
+
"dependencies": {
|
| 17 |
+
"@babel/helper-annotate-as-pure": "^7.29.7",
|
| 18 |
+
"@babel/helper-wrap-function": "^7.29.7",
|
| 19 |
+
"@babel/traverse": "^7.29.7"
|
| 20 |
+
},
|
| 21 |
+
"devDependencies": {
|
| 22 |
+
"@babel/core": "^7.29.7"
|
| 23 |
+
},
|
| 24 |
+
"peerDependencies": {
|
| 25 |
+
"@babel/core": "^7.0.0"
|
| 26 |
+
},
|
| 27 |
+
"engines": {
|
| 28 |
+
"node": ">=6.9.0"
|
| 29 |
+
},
|
| 30 |
+
"author": "The Babel Team (https://babel.dev/team)",
|
| 31 |
+
"type": "commonjs"
|
| 32 |
+
}
|
node_modules/@babel/helper-replace-supers/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 6 |
+
a copy of this software and associated documentation files (the
|
| 7 |
+
"Software"), to deal in the Software without restriction, including
|
| 8 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 9 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 10 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 11 |
+
the following conditions:
|
| 12 |
+
|
| 13 |
+
The above copyright notice and this permission notice shall be
|
| 14 |
+
included in all copies or substantial portions of the Software.
|
| 15 |
+
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 17 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 18 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 19 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
| 20 |
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
| 21 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
| 22 |
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
node_modules/@babel/helper-replace-supers/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @babel/helper-replace-supers
|
| 2 |
+
|
| 3 |
+
> Helper function to replace supers
|
| 4 |
+
|
| 5 |
+
See our website [@babel/helper-replace-supers](https://babeljs.io/docs/babel-helper-replace-supers) for more information.
|
| 6 |
+
|
| 7 |
+
## Install
|
| 8 |
+
|
| 9 |
+
Using npm:
|
| 10 |
+
|
| 11 |
+
```sh
|
| 12 |
+
npm install --save @babel/helper-replace-supers
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
or using yarn:
|
| 16 |
+
|
| 17 |
+
```sh
|
| 18 |
+
yarn add @babel/helper-replace-supers
|
| 19 |
+
```
|
node_modules/@babel/helper-replace-supers/lib/index.js
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.default = void 0;
|
| 7 |
+
var _helperMemberExpressionToFunctions = require("@babel/helper-member-expression-to-functions");
|
| 8 |
+
var _helperOptimiseCallExpression = require("@babel/helper-optimise-call-expression");
|
| 9 |
+
var _core = require("@babel/core");
|
| 10 |
+
var _traverse = require("@babel/traverse");
|
| 11 |
+
const {
|
| 12 |
+
assignmentExpression,
|
| 13 |
+
callExpression,
|
| 14 |
+
cloneNode,
|
| 15 |
+
identifier,
|
| 16 |
+
memberExpression,
|
| 17 |
+
sequenceExpression,
|
| 18 |
+
stringLiteral,
|
| 19 |
+
thisExpression
|
| 20 |
+
} = _core.types;
|
| 21 |
+
exports.environmentVisitor = _traverse.visitors.environmentVisitor({});
|
| 22 |
+
exports.skipAllButComputedKey = function skipAllButComputedKey(path) {
|
| 23 |
+
path.skip();
|
| 24 |
+
if (path.node.computed) {
|
| 25 |
+
path.context.maybeQueue(path.get("key"));
|
| 26 |
+
}
|
| 27 |
+
};
|
| 28 |
+
const visitor = _traverse.visitors.environmentVisitor({
|
| 29 |
+
Super(path, state) {
|
| 30 |
+
const {
|
| 31 |
+
node,
|
| 32 |
+
parentPath
|
| 33 |
+
} = path;
|
| 34 |
+
if (!parentPath.isMemberExpression({
|
| 35 |
+
object: node
|
| 36 |
+
})) return;
|
| 37 |
+
state.handle(parentPath);
|
| 38 |
+
}
|
| 39 |
+
});
|
| 40 |
+
const unshadowSuperBindingVisitor = _traverse.visitors.environmentVisitor({
|
| 41 |
+
Scopable(path, {
|
| 42 |
+
refName
|
| 43 |
+
}) {
|
| 44 |
+
const binding = path.scope.getOwnBinding(refName);
|
| 45 |
+
if ((binding == null ? void 0 : binding.identifier.name) === refName) {
|
| 46 |
+
path.scope.rename(refName);
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
});
|
| 50 |
+
const specHandlers = {
|
| 51 |
+
memoise(superMember, count) {
|
| 52 |
+
const {
|
| 53 |
+
scope,
|
| 54 |
+
node
|
| 55 |
+
} = superMember;
|
| 56 |
+
const {
|
| 57 |
+
computed,
|
| 58 |
+
property
|
| 59 |
+
} = node;
|
| 60 |
+
if (!computed) {
|
| 61 |
+
return;
|
| 62 |
+
}
|
| 63 |
+
const memo = scope.maybeGenerateMemoised(property);
|
| 64 |
+
if (!memo) {
|
| 65 |
+
return;
|
| 66 |
+
}
|
| 67 |
+
this.memoiser.set(property, memo, count);
|
| 68 |
+
},
|
| 69 |
+
prop(superMember) {
|
| 70 |
+
const {
|
| 71 |
+
computed,
|
| 72 |
+
property
|
| 73 |
+
} = superMember.node;
|
| 74 |
+
if (this.memoiser.has(property)) {
|
| 75 |
+
return cloneNode(this.memoiser.get(property));
|
| 76 |
+
}
|
| 77 |
+
if (computed) {
|
| 78 |
+
return cloneNode(property);
|
| 79 |
+
}
|
| 80 |
+
return stringLiteral(property.name);
|
| 81 |
+
},
|
| 82 |
+
_getPrototypeOfExpression() {
|
| 83 |
+
const objectRef = cloneNode(this.getObjectRef());
|
| 84 |
+
const targetRef = this.isStatic || this.isPrivateMethod ? objectRef : memberExpression(objectRef, identifier("prototype"));
|
| 85 |
+
return callExpression(this.file.addHelper("getPrototypeOf"), [targetRef]);
|
| 86 |
+
},
|
| 87 |
+
get(superMember) {
|
| 88 |
+
const objectRef = cloneNode(this.getObjectRef());
|
| 89 |
+
return callExpression(this.file.addHelper("superPropGet"), [this.isDerivedConstructor ? sequenceExpression([thisExpression(), objectRef]) : objectRef, this.prop(superMember), thisExpression(), ...(this.isStatic || this.isPrivateMethod ? [] : [_core.types.numericLiteral(1)])]);
|
| 90 |
+
},
|
| 91 |
+
_call(superMember, args, optional) {
|
| 92 |
+
const objectRef = cloneNode(this.getObjectRef());
|
| 93 |
+
let argsNode;
|
| 94 |
+
if (args.length === 1 && _core.types.isSpreadElement(args[0]) && (_core.types.isIdentifier(args[0].argument) || _core.types.isArrayExpression(args[0].argument))) {
|
| 95 |
+
argsNode = args[0].argument;
|
| 96 |
+
} else {
|
| 97 |
+
argsNode = _core.types.arrayExpression(args);
|
| 98 |
+
}
|
| 99 |
+
const call = _core.types.callExpression(this.file.addHelper("superPropGet"), [this.isDerivedConstructor ? sequenceExpression([thisExpression(), objectRef]) : objectRef, this.prop(superMember), thisExpression(), _core.types.numericLiteral(2 | (this.isStatic || this.isPrivateMethod ? 0 : 1))]);
|
| 100 |
+
if (optional) {
|
| 101 |
+
return _core.types.optionalCallExpression(call, [argsNode], true);
|
| 102 |
+
}
|
| 103 |
+
return callExpression(call, [argsNode]);
|
| 104 |
+
},
|
| 105 |
+
set(superMember, value) {
|
| 106 |
+
const objectRef = cloneNode(this.getObjectRef());
|
| 107 |
+
return callExpression(this.file.addHelper("superPropSet"), [this.isDerivedConstructor ? sequenceExpression([thisExpression(), objectRef]) : objectRef, this.prop(superMember), value, thisExpression(), _core.types.numericLiteral(superMember.isInStrictMode() ? 1 : 0), ...(this.isStatic || this.isPrivateMethod ? [] : [_core.types.numericLiteral(1)])]);
|
| 108 |
+
},
|
| 109 |
+
destructureSet(superMember) {
|
| 110 |
+
throw superMember.buildCodeFrameError(`Destructuring to a super field is not supported yet.`);
|
| 111 |
+
},
|
| 112 |
+
call(superMember, args) {
|
| 113 |
+
return this._call(superMember, args, false);
|
| 114 |
+
},
|
| 115 |
+
optionalCall(superMember, args) {
|
| 116 |
+
return this._call(superMember, args, true);
|
| 117 |
+
},
|
| 118 |
+
delete(superMember) {
|
| 119 |
+
if (superMember.node.computed) {
|
| 120 |
+
return sequenceExpression([callExpression(this.file.addHelper("toPropertyKey"), [cloneNode(superMember.node.property)]), _core.template.expression.ast`
|
| 121 |
+
function () { throw new ReferenceError("'delete super[expr]' is invalid"); }()
|
| 122 |
+
`]);
|
| 123 |
+
} else {
|
| 124 |
+
return _core.template.expression.ast`
|
| 125 |
+
function () { throw new ReferenceError("'delete super.prop' is invalid"); }()
|
| 126 |
+
`;
|
| 127 |
+
}
|
| 128 |
+
}
|
| 129 |
+
};
|
| 130 |
+
const specHandlers_old = {
|
| 131 |
+
memoise(superMember, count) {
|
| 132 |
+
const {
|
| 133 |
+
scope,
|
| 134 |
+
node
|
| 135 |
+
} = superMember;
|
| 136 |
+
const {
|
| 137 |
+
computed,
|
| 138 |
+
property
|
| 139 |
+
} = node;
|
| 140 |
+
if (!computed) {
|
| 141 |
+
return;
|
| 142 |
+
}
|
| 143 |
+
const memo = scope.maybeGenerateMemoised(property);
|
| 144 |
+
if (!memo) {
|
| 145 |
+
return;
|
| 146 |
+
}
|
| 147 |
+
this.memoiser.set(property, memo, count);
|
| 148 |
+
},
|
| 149 |
+
prop(superMember) {
|
| 150 |
+
const {
|
| 151 |
+
computed,
|
| 152 |
+
property
|
| 153 |
+
} = superMember.node;
|
| 154 |
+
if (this.memoiser.has(property)) {
|
| 155 |
+
return cloneNode(this.memoiser.get(property));
|
| 156 |
+
}
|
| 157 |
+
if (computed) {
|
| 158 |
+
return cloneNode(property);
|
| 159 |
+
}
|
| 160 |
+
return stringLiteral(property.name);
|
| 161 |
+
},
|
| 162 |
+
_getPrototypeOfExpression() {
|
| 163 |
+
const objectRef = cloneNode(this.getObjectRef());
|
| 164 |
+
const targetRef = this.isStatic || this.isPrivateMethod ? objectRef : memberExpression(objectRef, identifier("prototype"));
|
| 165 |
+
return callExpression(this.file.addHelper("getPrototypeOf"), [targetRef]);
|
| 166 |
+
},
|
| 167 |
+
get(superMember) {
|
| 168 |
+
return this._get(superMember);
|
| 169 |
+
},
|
| 170 |
+
_get(superMember) {
|
| 171 |
+
const proto = this._getPrototypeOfExpression();
|
| 172 |
+
return callExpression(this.file.addHelper("get"), [this.isDerivedConstructor ? sequenceExpression([thisExpression(), proto]) : proto, this.prop(superMember), thisExpression()]);
|
| 173 |
+
},
|
| 174 |
+
set(superMember, value) {
|
| 175 |
+
const proto = this._getPrototypeOfExpression();
|
| 176 |
+
return callExpression(this.file.addHelper("set"), [this.isDerivedConstructor ? sequenceExpression([thisExpression(), proto]) : proto, this.prop(superMember), value, thisExpression(), _core.types.booleanLiteral(superMember.isInStrictMode())]);
|
| 177 |
+
},
|
| 178 |
+
destructureSet(superMember) {
|
| 179 |
+
throw superMember.buildCodeFrameError(`Destructuring to a super field is not supported yet.`);
|
| 180 |
+
},
|
| 181 |
+
call(superMember, args) {
|
| 182 |
+
return (0, _helperOptimiseCallExpression.default)(this._get(superMember), thisExpression(), args, false);
|
| 183 |
+
},
|
| 184 |
+
optionalCall(superMember, args) {
|
| 185 |
+
return (0, _helperOptimiseCallExpression.default)(this._get(superMember), cloneNode(thisExpression()), args, true);
|
| 186 |
+
},
|
| 187 |
+
delete(superMember) {
|
| 188 |
+
if (superMember.node.computed) {
|
| 189 |
+
return sequenceExpression([callExpression(this.file.addHelper("toPropertyKey"), [cloneNode(superMember.node.property)]), _core.template.expression.ast`
|
| 190 |
+
function () { throw new ReferenceError("'delete super[expr]' is invalid"); }()
|
| 191 |
+
`]);
|
| 192 |
+
} else {
|
| 193 |
+
return _core.template.expression.ast`
|
| 194 |
+
function () { throw new ReferenceError("'delete super.prop' is invalid"); }()
|
| 195 |
+
`;
|
| 196 |
+
}
|
| 197 |
+
}
|
| 198 |
+
};
|
| 199 |
+
const looseHandlers = Object.assign({}, specHandlers, {
|
| 200 |
+
prop(superMember) {
|
| 201 |
+
const {
|
| 202 |
+
property
|
| 203 |
+
} = superMember.node;
|
| 204 |
+
if (this.memoiser.has(property)) {
|
| 205 |
+
return cloneNode(this.memoiser.get(property));
|
| 206 |
+
}
|
| 207 |
+
return cloneNode(property);
|
| 208 |
+
},
|
| 209 |
+
get(superMember) {
|
| 210 |
+
const {
|
| 211 |
+
isStatic,
|
| 212 |
+
getSuperRef
|
| 213 |
+
} = this;
|
| 214 |
+
const {
|
| 215 |
+
computed
|
| 216 |
+
} = superMember.node;
|
| 217 |
+
const prop = this.prop(superMember);
|
| 218 |
+
let object;
|
| 219 |
+
if (isStatic) {
|
| 220 |
+
var _getSuperRef;
|
| 221 |
+
object = (_getSuperRef = getSuperRef()) != null ? _getSuperRef : memberExpression(identifier("Function"), identifier("prototype"));
|
| 222 |
+
} else {
|
| 223 |
+
var _getSuperRef2;
|
| 224 |
+
object = memberExpression((_getSuperRef2 = getSuperRef()) != null ? _getSuperRef2 : identifier("Object"), identifier("prototype"));
|
| 225 |
+
}
|
| 226 |
+
return memberExpression(object, prop, computed);
|
| 227 |
+
},
|
| 228 |
+
set(superMember, value) {
|
| 229 |
+
const {
|
| 230 |
+
computed
|
| 231 |
+
} = superMember.node;
|
| 232 |
+
const prop = this.prop(superMember);
|
| 233 |
+
return assignmentExpression("=", memberExpression(thisExpression(), prop, computed), value);
|
| 234 |
+
},
|
| 235 |
+
destructureSet(superMember) {
|
| 236 |
+
const {
|
| 237 |
+
computed
|
| 238 |
+
} = superMember.node;
|
| 239 |
+
const prop = this.prop(superMember);
|
| 240 |
+
return memberExpression(thisExpression(), prop, computed);
|
| 241 |
+
},
|
| 242 |
+
call(superMember, args) {
|
| 243 |
+
return (0, _helperOptimiseCallExpression.default)(this.get(superMember), thisExpression(), args, false);
|
| 244 |
+
},
|
| 245 |
+
optionalCall(superMember, args) {
|
| 246 |
+
return (0, _helperOptimiseCallExpression.default)(this.get(superMember), thisExpression(), args, true);
|
| 247 |
+
}
|
| 248 |
+
});
|
| 249 |
+
class ReplaceSupers {
|
| 250 |
+
constructor(opts) {
|
| 251 |
+
var _opts$constantSuper;
|
| 252 |
+
const path = opts.methodPath;
|
| 253 |
+
this.methodPath = path;
|
| 254 |
+
this.isDerivedConstructor = path.isClassMethod({
|
| 255 |
+
kind: "constructor"
|
| 256 |
+
}) && !!opts.superRef;
|
| 257 |
+
this.isStatic = path.isObjectMethod() || path.node.static || (path.isStaticBlock == null ? void 0 : path.isStaticBlock());
|
| 258 |
+
this.isPrivateMethod = path.isPrivate() && path.isMethod();
|
| 259 |
+
this.file = opts.file;
|
| 260 |
+
this.constantSuper = (_opts$constantSuper = opts.constantSuper) != null ? _opts$constantSuper : opts.isLoose;
|
| 261 |
+
this.opts = opts;
|
| 262 |
+
}
|
| 263 |
+
getObjectRef() {
|
| 264 |
+
return cloneNode(this.opts.objectRef || this.opts.getObjectRef());
|
| 265 |
+
}
|
| 266 |
+
getSuperRef() {
|
| 267 |
+
if (this.opts.superRef) return cloneNode(this.opts.superRef);
|
| 268 |
+
if (this.opts.getSuperRef) {
|
| 269 |
+
return cloneNode(this.opts.getSuperRef());
|
| 270 |
+
}
|
| 271 |
+
}
|
| 272 |
+
replace() {
|
| 273 |
+
const {
|
| 274 |
+
methodPath
|
| 275 |
+
} = this;
|
| 276 |
+
if (this.opts.refToPreserve) {
|
| 277 |
+
methodPath.traverse(unshadowSuperBindingVisitor, {
|
| 278 |
+
refName: this.opts.refToPreserve.name
|
| 279 |
+
});
|
| 280 |
+
}
|
| 281 |
+
const handler = this.constantSuper ? looseHandlers : this.file.availableHelper("superPropSet") ? specHandlers : specHandlers_old;
|
| 282 |
+
visitor.shouldSkip = path => {
|
| 283 |
+
if (path.parentPath === methodPath) {
|
| 284 |
+
if (path.parentKey === "decorators" || path.parentKey === "key") {
|
| 285 |
+
return true;
|
| 286 |
+
}
|
| 287 |
+
}
|
| 288 |
+
};
|
| 289 |
+
(0, _helperMemberExpressionToFunctions.default)(methodPath, visitor, Object.assign({
|
| 290 |
+
file: this.file,
|
| 291 |
+
scope: this.methodPath.scope,
|
| 292 |
+
isDerivedConstructor: this.isDerivedConstructor,
|
| 293 |
+
isStatic: this.isStatic,
|
| 294 |
+
isPrivateMethod: this.isPrivateMethod,
|
| 295 |
+
getObjectRef: this.getObjectRef.bind(this),
|
| 296 |
+
getSuperRef: this.getSuperRef.bind(this),
|
| 297 |
+
boundGet: handler.get
|
| 298 |
+
}, handler));
|
| 299 |
+
}
|
| 300 |
+
}
|
| 301 |
+
exports.default = ReplaceSupers;
|
| 302 |
+
|
| 303 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@babel/helper-replace-supers/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_helperMemberExpressionToFunctions","require","_helperOptimiseCallExpression","_core","_traverse","assignmentExpression","callExpression","cloneNode","identifier","memberExpression","sequenceExpression","stringLiteral","thisExpression","t","exports","environmentVisitor","visitors","skipAllButComputedKey","path","skip","node","computed","context","maybeQueue","get","visitor","Super","state","parentPath","isMemberExpression","object","handle","unshadowSuperBindingVisitor","Scopable","refName","binding","scope","getOwnBinding","name","rename","specHandlers","memoise","superMember","count","property","memo","maybeGenerateMemoised","memoiser","set","prop","has","_getPrototypeOfExpression","objectRef","getObjectRef","targetRef","isStatic","isPrivateMethod","file","addHelper","isDerivedConstructor","numericLiteral","_call","args","optional","argsNode","length","isSpreadElement","isIdentifier","argument","isArrayExpression","arrayExpression","call","optionalCallExpression","value","isInStrictMode","destructureSet","buildCodeFrameError","optionalCall","delete","template","expression","ast","specHandlers_old","_get","proto","booleanLiteral","optimiseCall","looseHandlers","Object","assign","getSuperRef","_getSuperRef","_getSuperRef2","ReplaceSupers","constructor","opts","_opts$constantSuper","methodPath","isClassMethod","kind","superRef","isObjectMethod","static","isStaticBlock","isPrivate","isMethod","constantSuper","isLoose","replace","refToPreserve","traverse","handler","availableHelper","shouldSkip","parentKey","memberExpressionToFunctions","bind","boundGet","default"],"sources":["../src/index.ts"],"sourcesContent":["import type { File, NodePath, Scope } from \"@babel/core\";\nimport memberExpressionToFunctions from \"@babel/helper-member-expression-to-functions\";\nimport type { HandlerState } from \"@babel/helper-member-expression-to-functions\";\nimport optimiseCall from \"@babel/helper-optimise-call-expression\";\nimport { template, types as t } from \"@babel/core\";\nimport { visitors } from \"@babel/traverse\";\nconst {\n assignmentExpression,\n callExpression,\n cloneNode,\n identifier,\n memberExpression,\n sequenceExpression,\n stringLiteral,\n thisExpression,\n} = t;\n\nif (!process.env.BABEL_8_BREAKING && !USE_ESM && !IS_STANDALONE) {\n // eslint-disable-next-line no-restricted-globals\n exports.environmentVisitor = visitors.environmentVisitor({});\n // eslint-disable-next-line no-restricted-globals\n exports.skipAllButComputedKey = function skipAllButComputedKey(\n path: NodePath<t.Method | t.ClassProperty>,\n ) {\n path.skip();\n if (path.node.computed) {\n path.context.maybeQueue(path.get(\"key\"));\n }\n };\n}\n\nconst visitor = visitors.environmentVisitor<\n HandlerState<ReplaceState> & ReplaceState\n>({\n Super(path, state) {\n const { node, parentPath } = path;\n if (!parentPath.isMemberExpression({ object: node })) return;\n state.handle(parentPath);\n },\n});\n\nconst unshadowSuperBindingVisitor = visitors.environmentVisitor<{\n refName: string;\n}>({\n Scopable(path, { refName }) {\n // https://github.com/Zzzen/babel/pull/1#pullrequestreview-564833183\n const binding = path.scope.getOwnBinding(refName);\n if (binding?.identifier.name === refName) {\n path.scope.rename(refName);\n }\n },\n});\n\ntype SharedState = {\n file: File;\n scope: Scope;\n isDerivedConstructor: boolean;\n isStatic: boolean;\n isPrivateMethod: boolean;\n getObjectRef: () => t.Identifier;\n getSuperRef: () => t.Identifier;\n // we dont need boundGet here, but memberExpressionToFunctions handler needs it.\n boundGet: HandlerState[\"get\"];\n};\n\ntype Handler = HandlerState<SharedState> & SharedState;\ntype SuperMember = NodePath<\n t.MemberExpression & {\n object: t.Super;\n property: Exclude<t.MemberExpression[\"property\"], t.PrivateName>;\n }\n>;\n\nconst enum Flags {\n Prototype = 0b1,\n Call = 0b10,\n}\n\ninterface SpecHandler\n extends Pick<\n Handler,\n | \"memoise\"\n | \"get\"\n | \"set\"\n | \"destructureSet\"\n | \"call\"\n | \"optionalCall\"\n | \"delete\"\n > {\n _get?(\n this: Handler & SpecHandler,\n superMember: SuperMember,\n ): t.CallExpression;\n _call?(\n this: Handler & SpecHandler,\n superMember: SuperMember,\n args: t.CallExpression[\"arguments\"],\n optional: boolean,\n ): t.CallExpression | t.OptionalCallExpression;\n _getPrototypeOfExpression(this: Handler & SpecHandler): t.CallExpression;\n prop(this: Handler & SpecHandler, superMember: SuperMember): t.Expression;\n}\n\nconst specHandlers: SpecHandler = {\n memoise(\n this: Handler & SpecHandler,\n superMember: SuperMember,\n count: number,\n ) {\n const { scope, node } = superMember;\n const { computed, property } = node;\n if (!computed) {\n return;\n }\n\n const memo = scope.maybeGenerateMemoised(property);\n if (!memo) {\n return;\n }\n\n this.memoiser.set(property, memo, count);\n },\n\n prop(this: Handler & SpecHandler, superMember: SuperMember) {\n const { computed, property } = superMember.node;\n if (this.memoiser.has(property)) {\n return cloneNode(this.memoiser.get(property));\n }\n\n if (computed) {\n return cloneNode(property);\n }\n\n return stringLiteral((property as t.Identifier).name);\n },\n\n /**\n * Creates an expression which result is the proto of objectRef.\n *\n * @example <caption>isStatic === true</caption>\n *\n * helpers.getPrototypeOf(CLASS)\n *\n * @example <caption>isStatic === false</caption>\n *\n * helpers.getPrototypeOf(CLASS.prototype)\n */\n _getPrototypeOfExpression(this: Handler & SpecHandler) {\n const objectRef = cloneNode(this.getObjectRef());\n const targetRef =\n this.isStatic || this.isPrivateMethod\n ? objectRef\n : memberExpression(objectRef, identifier(\"prototype\"));\n\n return callExpression(this.file.addHelper(\"getPrototypeOf\"), [targetRef]);\n },\n\n get(this: Handler & SpecHandler, superMember: SuperMember) {\n const objectRef = cloneNode(this.getObjectRef());\n return callExpression(this.file.addHelper(\"superPropGet\"), [\n this.isDerivedConstructor\n ? sequenceExpression([thisExpression(), objectRef])\n : objectRef,\n this.prop(superMember),\n thisExpression(),\n ...(this.isStatic || this.isPrivateMethod\n ? []\n : [t.numericLiteral(Flags.Prototype)]),\n ]);\n },\n\n _call(\n this: Handler & SpecHandler,\n superMember: SuperMember,\n args: t.CallExpression[\"arguments\"],\n optional: boolean,\n ): t.CallExpression | t.OptionalCallExpression {\n const objectRef = cloneNode(this.getObjectRef());\n let argsNode: t.ArrayExpression | t.Identifier;\n if (\n args.length === 1 &&\n t.isSpreadElement(args[0]) &&\n (t.isIdentifier(args[0].argument) ||\n t.isArrayExpression(args[0].argument))\n ) {\n argsNode = args[0].argument;\n } else {\n argsNode = t.arrayExpression(args as t.Expression[]);\n }\n\n const call = t.callExpression(this.file.addHelper(\"superPropGet\"), [\n this.isDerivedConstructor\n ? sequenceExpression([thisExpression(), objectRef])\n : objectRef,\n this.prop(superMember),\n thisExpression(),\n t.numericLiteral(\n Flags.Call |\n (this.isStatic || this.isPrivateMethod ? 0 : Flags.Prototype),\n ),\n ]);\n if (optional) {\n return t.optionalCallExpression(call, [argsNode], true);\n }\n return callExpression(call, [argsNode]);\n },\n\n set(\n this: Handler & SpecHandler,\n superMember: SuperMember,\n value: t.Expression,\n ) {\n const objectRef = cloneNode(this.getObjectRef());\n\n return callExpression(this.file.addHelper(\"superPropSet\"), [\n this.isDerivedConstructor\n ? sequenceExpression([thisExpression(), objectRef])\n : objectRef,\n this.prop(superMember),\n value,\n thisExpression(),\n t.numericLiteral(superMember.isInStrictMode() ? 1 : 0),\n ...(this.isStatic || this.isPrivateMethod ? [] : [t.numericLiteral(1)]),\n ]);\n },\n\n destructureSet(this: Handler & SpecHandler, superMember: SuperMember) {\n throw superMember.buildCodeFrameError(\n `Destructuring to a super field is not supported yet.`,\n );\n },\n\n call(\n this: Handler & SpecHandler,\n superMember: SuperMember,\n args: t.CallExpression[\"arguments\"],\n ) {\n return this._call(superMember, args, false);\n },\n\n optionalCall(\n this: Handler & SpecHandler,\n superMember: SuperMember,\n args: t.CallExpression[\"arguments\"],\n ) {\n return this._call(superMember, args, true);\n },\n\n delete(this: Handler & SpecHandler, superMember: SuperMember) {\n if (superMember.node.computed) {\n return sequenceExpression([\n callExpression(this.file.addHelper(\"toPropertyKey\"), [\n cloneNode(superMember.node.property),\n ]),\n template.expression.ast`\n function () { throw new ReferenceError(\"'delete super[expr]' is invalid\"); }()\n `,\n ]);\n } else {\n return template.expression.ast`\n function () { throw new ReferenceError(\"'delete super.prop' is invalid\"); }()\n `;\n }\n },\n};\n\nconst specHandlers_old: SpecHandler = {\n memoise(\n this: Handler & SpecHandler,\n superMember: SuperMember,\n count: number,\n ) {\n const { scope, node } = superMember;\n const { computed, property } = node;\n if (!computed) {\n return;\n }\n\n const memo = scope.maybeGenerateMemoised(property);\n if (!memo) {\n return;\n }\n\n this.memoiser.set(property, memo, count);\n },\n\n prop(this: Handler & SpecHandler, superMember: SuperMember) {\n const { computed, property } = superMember.node;\n if (this.memoiser.has(property)) {\n return cloneNode(this.memoiser.get(property));\n }\n\n if (computed) {\n return cloneNode(property);\n }\n\n return stringLiteral((property as t.Identifier).name);\n },\n\n /**\n * Creates an expression which result is the proto of objectRef.\n *\n * @example <caption>isStatic === true</caption>\n *\n * helpers.getPrototypeOf(CLASS)\n *\n * @example <caption>isStatic === false</caption>\n *\n * helpers.getPrototypeOf(CLASS.prototype)\n */\n _getPrototypeOfExpression(this: Handler & SpecHandler) {\n const objectRef = cloneNode(this.getObjectRef());\n const targetRef =\n this.isStatic || this.isPrivateMethod\n ? objectRef\n : memberExpression(objectRef, identifier(\"prototype\"));\n\n return callExpression(this.file.addHelper(\"getPrototypeOf\"), [targetRef]);\n },\n\n get(this: Handler & SpecHandler, superMember: SuperMember) {\n return this._get(superMember);\n },\n\n _get(this: Handler & SpecHandler, superMember: SuperMember) {\n const proto = this._getPrototypeOfExpression();\n return callExpression(this.file.addHelper(\"get\"), [\n this.isDerivedConstructor\n ? sequenceExpression([thisExpression(), proto])\n : proto,\n this.prop(superMember),\n thisExpression(),\n ]);\n },\n\n set(\n this: Handler & SpecHandler,\n superMember: SuperMember,\n value: t.Expression,\n ) {\n const proto = this._getPrototypeOfExpression();\n\n return callExpression(this.file.addHelper(\"set\"), [\n this.isDerivedConstructor\n ? sequenceExpression([thisExpression(), proto])\n : proto,\n this.prop(superMember),\n value,\n thisExpression(),\n t.booleanLiteral(superMember.isInStrictMode()),\n ]);\n },\n\n destructureSet(this: Handler & SpecHandler, superMember: SuperMember) {\n throw superMember.buildCodeFrameError(\n `Destructuring to a super field is not supported yet.`,\n );\n },\n\n call(\n this: Handler & SpecHandler,\n superMember: SuperMember,\n args: t.CallExpression[\"arguments\"],\n ) {\n return optimiseCall(this._get(superMember), thisExpression(), args, false);\n },\n\n optionalCall(\n this: Handler & SpecHandler,\n superMember: SuperMember,\n args: t.CallExpression[\"arguments\"],\n ) {\n return optimiseCall(\n this._get(superMember),\n cloneNode(thisExpression()),\n args,\n true,\n );\n },\n\n delete(this: Handler & SpecHandler, superMember: SuperMember) {\n if (superMember.node.computed) {\n return sequenceExpression([\n callExpression(this.file.addHelper(\"toPropertyKey\"), [\n cloneNode(superMember.node.property),\n ]),\n template.expression.ast`\n function () { throw new ReferenceError(\"'delete super[expr]' is invalid\"); }()\n `,\n ]);\n } else {\n return template.expression.ast`\n function () { throw new ReferenceError(\"'delete super.prop' is invalid\"); }()\n `;\n }\n },\n};\n\nconst looseHandlers = {\n ...specHandlers,\n\n prop(this: Handler & typeof specHandlers, superMember: SuperMember) {\n const { property } = superMember.node;\n if (this.memoiser.has(property)) {\n return cloneNode(this.memoiser.get(property));\n }\n\n return cloneNode(property);\n },\n\n get(this: Handler & typeof specHandlers, superMember: SuperMember) {\n const { isStatic, getSuperRef } = this;\n const { computed } = superMember.node;\n const prop = this.prop(superMember);\n\n let object;\n if (isStatic) {\n object =\n getSuperRef() ??\n memberExpression(identifier(\"Function\"), identifier(\"prototype\"));\n } else {\n object = memberExpression(\n getSuperRef() ?? identifier(\"Object\"),\n identifier(\"prototype\"),\n );\n }\n\n return memberExpression(object, prop, computed);\n },\n\n set(\n this: Handler & typeof specHandlers,\n superMember: SuperMember,\n value: t.Expression,\n ) {\n const { computed } = superMember.node;\n const prop = this.prop(superMember);\n\n return assignmentExpression(\n \"=\",\n memberExpression(thisExpression(), prop, computed),\n value,\n );\n },\n\n destructureSet(\n this: Handler & typeof specHandlers,\n superMember: SuperMember,\n ) {\n const { computed } = superMember.node;\n const prop = this.prop(superMember);\n\n return memberExpression(thisExpression(), prop, computed);\n },\n\n call(\n this: Handler & typeof specHandlers,\n superMember: SuperMember,\n args: t.CallExpression[\"arguments\"],\n ) {\n return optimiseCall(this.get(superMember), thisExpression(), args, false);\n },\n\n optionalCall(\n this: Handler & typeof specHandlers,\n superMember: SuperMember,\n args: t.CallExpression[\"arguments\"],\n ) {\n return optimiseCall(this.get(superMember), thisExpression(), args, true);\n },\n};\n\ntype ReplaceSupersOptionsBase = {\n methodPath: NodePath<\n | t.ClassMethod\n | t.ClassProperty\n | t.ObjectMethod\n | t.ClassPrivateMethod\n | t.ClassPrivateProperty\n | t.StaticBlock\n >;\n constantSuper?: boolean;\n file: File;\n // objectRef might have been shadowed in child scopes,\n // in that case, we need to rename related variables.\n refToPreserve?: t.Identifier;\n};\n\ntype ReplaceSupersOptions = ReplaceSupersOptionsBase &\n (\n | { objectRef?: undefined; getObjectRef: () => t.Node }\n | { objectRef: t.Node; getObjectRef?: undefined }\n ) &\n (\n | { superRef?: undefined; getSuperRef: () => t.Node }\n | { superRef: t.Node; getSuperRef?: undefined }\n );\n\ninterface ReplaceState {\n file: File;\n scope: Scope;\n isDerivedConstructor: boolean;\n isStatic: boolean;\n isPrivateMethod: boolean;\n getObjectRef: ReplaceSupers[\"getObjectRef\"];\n getSuperRef: ReplaceSupers[\"getSuperRef\"];\n}\n\nexport default class ReplaceSupers {\n constructor(opts: ReplaceSupersOptions) {\n const path = opts.methodPath;\n\n this.methodPath = path;\n this.isDerivedConstructor =\n path.isClassMethod({ kind: \"constructor\" }) && !!opts.superRef;\n this.isStatic =\n path.isObjectMethod() ||\n // @ts-expect-error static is not in ClassPrivateMethod\n path.node.static ||\n path.isStaticBlock?.();\n this.isPrivateMethod = path.isPrivate() && path.isMethod();\n\n this.file = opts.file;\n this.constantSuper = process.env.BABEL_8_BREAKING\n ? opts.constantSuper\n : // Fallback to isLoose for backward compatibility\n (opts.constantSuper ?? (opts as any).isLoose);\n this.opts = opts;\n }\n\n declare file: File;\n declare isDerivedConstructor: boolean;\n declare constantSuper: boolean;\n declare isPrivateMethod: boolean;\n declare isStatic: boolean;\n declare methodPath: NodePath;\n declare opts: ReplaceSupersOptions;\n\n getObjectRef() {\n return cloneNode(this.opts.objectRef || this.opts.getObjectRef());\n }\n\n getSuperRef() {\n if (this.opts.superRef) return cloneNode(this.opts.superRef);\n if (this.opts.getSuperRef) {\n return cloneNode(this.opts.getSuperRef());\n }\n }\n\n replace() {\n const { methodPath } = this;\n // https://github.com/babel/babel/issues/11994\n if (this.opts.refToPreserve) {\n methodPath.traverse(unshadowSuperBindingVisitor, {\n refName: this.opts.refToPreserve.name,\n });\n }\n\n const handler = this.constantSuper\n ? looseHandlers\n : process.env.BABEL_8_BREAKING ||\n this.file.availableHelper(\"superPropSet\")\n ? specHandlers\n : specHandlers_old;\n\n // todo: this should have been handled by the environmentVisitor,\n // consider add visitSelf support for the path.traverse\n // @ts-expect-error: Refine typings in packages/babel-traverse/src/types.ts\n // shouldSkip is accepted in traverseNode\n visitor.shouldSkip = (path: NodePath) => {\n if (path.parentPath === methodPath) {\n if (path.parentKey === \"decorators\" || path.parentKey === \"key\") {\n return true;\n }\n }\n };\n\n memberExpressionToFunctions<ReplaceState>(methodPath, visitor, {\n file: this.file,\n scope: this.methodPath.scope,\n isDerivedConstructor: this.isDerivedConstructor,\n isStatic: this.isStatic,\n isPrivateMethod: this.isPrivateMethod,\n getObjectRef: this.getObjectRef.bind(this),\n getSuperRef: this.getSuperRef.bind(this),\n // we dont need boundGet here, but memberExpressionToFunctions handler needs it.\n boundGet: handler.get,\n ...handler,\n });\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,kCAAA,GAAAC,OAAA;AAEA,IAAAC,6BAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,MAAM;EACJI,oBAAoB;EACpBC,cAAc;EACdC,SAAS;EACTC,UAAU;EACVC,gBAAgB;EAChBC,kBAAkB;EAClBC,aAAa;EACbC;AACF,CAAC,GAAGC,WAAC;AAIHC,OAAO,CAACC,kBAAkB,GAAGC,kBAAQ,CAACD,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAE5DD,OAAO,CAACG,qBAAqB,GAAG,SAASA,qBAAqBA,CAC5DC,IAA0C,EAC1C;EACAA,IAAI,CAACC,IAAI,CAAC,CAAC;EACX,IAAID,IAAI,CAACE,IAAI,CAACC,QAAQ,EAAE;IACtBH,IAAI,CAACI,OAAO,CAACC,UAAU,CAACL,IAAI,CAACM,GAAG,CAAC,KAAK,CAAC,CAAC;EAC1C;AACF,CAAC;AAGH,MAAMC,OAAO,GAAGT,kBAAQ,CAACD,kBAAkB,CAEzC;EACAW,KAAKA,CAACR,IAAI,EAAES,KAAK,EAAE;IACjB,MAAM;MAAEP,IAAI;M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A,QAAQ;MACvBC,eAAe,EAAE,IAAI,CAACA,eAAe;MACrCH,YAAY,EAAE,IAAI,CAACA,YAAY,CAAC+D,IAAI,CAAC,IAAI,CAAC;MAC1C1B,WAAW,EAAE,IAAI,CAACA,WAAW,CAAC0B,IAAI,CAAC,IAAI,CAAC;MAExCC,QAAQ,EAAEN,OAAO,CAACvF;IAAG,GAClBuF,OAAO,CACX,CAAC;EACJ;AACF;AAACjG,OAAA,CAAAwG,OAAA,GAAAzB,aAAA","ignoreList":[]}
|
node_modules/@babel/helper-replace-supers/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@babel/helper-replace-supers",
|
| 3 |
+
"version": "7.29.7",
|
| 4 |
+
"description": "Helper function to replace supers",
|
| 5 |
+
"repository": {
|
| 6 |
+
"type": "git",
|
| 7 |
+
"url": "https://github.com/babel/babel.git",
|
| 8 |
+
"directory": "packages/babel-helper-replace-supers"
|
| 9 |
+
},
|
| 10 |
+
"homepage": "https://babel.dev/docs/en/next/babel-helper-replace-supers",
|
| 11 |
+
"license": "MIT",
|
| 12 |
+
"publishConfig": {
|
| 13 |
+
"access": "public"
|
| 14 |
+
},
|
| 15 |
+
"main": "./lib/index.js",
|
| 16 |
+
"dependencies": {
|
| 17 |
+
"@babel/helper-member-expression-to-functions": "^7.29.7",
|
| 18 |
+
"@babel/helper-optimise-call-expression": "^7.29.7",
|
| 19 |
+
"@babel/traverse": "^7.29.7"
|
| 20 |
+
},
|
| 21 |
+
"devDependencies": {
|
| 22 |
+
"@babel/core": "^7.29.7"
|
| 23 |
+
},
|
| 24 |
+
"peerDependencies": {
|
| 25 |
+
"@babel/core": "^7.0.0"
|
| 26 |
+
},
|
| 27 |
+
"engines": {
|
| 28 |
+
"node": ">=6.9.0"
|
| 29 |
+
},
|
| 30 |
+
"author": "The Babel Team (https://babel.dev/team)",
|
| 31 |
+
"type": "commonjs"
|
| 32 |
+
}
|
node_modules/@babel/helper-skip-transparent-expression-wrappers/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 6 |
+
a copy of this software and associated documentation files (the
|
| 7 |
+
"Software"), to deal in the Software without restriction, including
|
| 8 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 9 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 10 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 11 |
+
the following conditions:
|
| 12 |
+
|
| 13 |
+
The above copyright notice and this permission notice shall be
|
| 14 |
+
included in all copies or substantial portions of the Software.
|
| 15 |
+
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 17 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 18 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 19 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
| 20 |
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
| 21 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
| 22 |
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
node_modules/@babel/helper-skip-transparent-expression-wrappers/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @babel/helper-skip-transparent-expression-wrappers
|
| 2 |
+
|
| 3 |
+
> Helper which skips types and parentheses
|
| 4 |
+
|
| 5 |
+
See our website [@babel/helper-skip-transparent-expression-wrappers](https://babeljs.io/docs/babel-helper-skip-transparent-expression-wrappers) for more information.
|
| 6 |
+
|
| 7 |
+
## Install
|
| 8 |
+
|
| 9 |
+
Using npm:
|
| 10 |
+
|
| 11 |
+
```sh
|
| 12 |
+
npm install --save @babel/helper-skip-transparent-expression-wrappers
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
or using yarn:
|
| 16 |
+
|
| 17 |
+
```sh
|
| 18 |
+
yarn add @babel/helper-skip-transparent-expression-wrappers
|
| 19 |
+
```
|
node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
|
| 3 |
+
Object.defineProperty(exports, "__esModule", {
|
| 4 |
+
value: true
|
| 5 |
+
});
|
| 6 |
+
exports.isTransparentExprWrapper = isTransparentExprWrapper;
|
| 7 |
+
exports.skipTransparentExprWrapperNodes = skipTransparentExprWrapperNodes;
|
| 8 |
+
exports.skipTransparentExprWrappers = skipTransparentExprWrappers;
|
| 9 |
+
var _t = require("@babel/types");
|
| 10 |
+
const {
|
| 11 |
+
isParenthesizedExpression,
|
| 12 |
+
isTSAsExpression,
|
| 13 |
+
isTSNonNullExpression,
|
| 14 |
+
isTSSatisfiesExpression,
|
| 15 |
+
isTSTypeAssertion,
|
| 16 |
+
isTypeCastExpression
|
| 17 |
+
} = _t;
|
| 18 |
+
function isTransparentExprWrapper(node) {
|
| 19 |
+
return isTSAsExpression(node) || isTSSatisfiesExpression(node) || isTSTypeAssertion(node) || isTSNonNullExpression(node) || isTypeCastExpression(node) || isParenthesizedExpression(node);
|
| 20 |
+
}
|
| 21 |
+
function skipTransparentExprWrappers(path) {
|
| 22 |
+
while (isTransparentExprWrapper(path.node)) {
|
| 23 |
+
path = path.get("expression");
|
| 24 |
+
}
|
| 25 |
+
return path;
|
| 26 |
+
}
|
| 27 |
+
function skipTransparentExprWrapperNodes(node) {
|
| 28 |
+
while (isTransparentExprWrapper(node)) {
|
| 29 |
+
node = node.expression;
|
| 30 |
+
}
|
| 31 |
+
return node;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
//# sourceMappingURL=index.js.map
|
node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"names":["_t","require","isParenthesizedExpression","isTSAsExpression","isTSNonNullExpression","isTSSatisfiesExpression","isTSTypeAssertion","isTypeCastExpression","isTransparentExprWrapper","node","skipTransparentExprWrappers","path","get","skipTransparentExprWrapperNodes","expression"],"sources":["../src/index.ts"],"sourcesContent":["import {\n isParenthesizedExpression,\n isTSAsExpression,\n isTSNonNullExpression,\n isTSSatisfiesExpression,\n isTSTypeAssertion,\n isTypeCastExpression,\n} from \"@babel/types\";\n\nimport type * as t from \"@babel/types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nexport type TransparentExprWrapper =\n | t.TSAsExpression\n | t.TSSatisfiesExpression\n | t.TSTypeAssertion\n | t.TSNonNullExpression\n | t.TypeCastExpression\n | t.ParenthesizedExpression;\n\n// A transparent expression wrapper is an AST node that most plugins will wish\n// to skip, as its presence does not affect the behaviour of the code. This\n// includes expressions used for types, and extra parenthesis. For example, in\n// (a as any)(), this helper can be used to skip the TSAsExpression when\n// determining the callee.\nexport function isTransparentExprWrapper(\n node: t.Node,\n): node is TransparentExprWrapper {\n return (\n isTSAsExpression(node) ||\n isTSSatisfiesExpression(node) ||\n isTSTypeAssertion(node) ||\n isTSNonNullExpression(node) ||\n isTypeCastExpression(node) ||\n isParenthesizedExpression(node)\n );\n}\n\nexport function skipTransparentExprWrappers(\n path: NodePath<t.Expression>,\n): NodePath<t.Expression> {\n while (isTransparentExprWrapper(path.node)) {\n path = path.get(\"expression\");\n }\n return path;\n}\n\nexport function skipTransparentExprWrapperNodes(\n node: t.Expression | t.Super,\n): t.Expression | t.Super {\n while (isTransparentExprWrapper(node)) {\n node = node.expression;\n }\n return node;\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,EAAA,GAAAC,OAAA;AAOsB;EANpBC,yBAAyB;EACzBC,gBAAgB;EAChBC,qBAAqB;EACrBC,uBAAuB;EACvBC,iBAAiB;EACjBC;AAAoB,IAAAP,EAAA;AAmBf,SAASQ,wBAAwBA,CACtCC,IAAY,EACoB;EAChC,OACEN,gBAAgB,CAACM,IAAI,CAAC,IACtBJ,uBAAuB,CAACI,IAAI,CAAC,IAC7BH,iBAAiB,CAACG,IAAI,CAAC,IACvBL,qBAAqB,CAACK,IAAI,CAAC,IAC3BF,oBAAoB,CAACE,IAAI,CAAC,IAC1BP,yBAAyB,CAACO,IAAI,CAAC;AAEnC;AAEO,SAASC,2BAA2BA,CACzCC,IAA4B,EACJ;EACxB,OAAOH,wBAAwB,CAACG,IAAI,CAACF,IAAI,CAAC,EAAE;IAC1CE,IAAI,GAAGA,IAAI,CAACC,GAAG,CAAC,YAAY,CAAC;EAC/B;EACA,OAAOD,IAAI;AACb;AAEO,SAASE,+BAA+BA,CAC7CJ,IAA4B,EACJ;EACxB,OAAOD,wBAAwB,CAACC,IAAI,CAAC,EAAE;IACrCA,IAAI,GAAGA,IAAI,CAACK,UAAU;EACxB;EACA,OAAOL,IAAI;AACb","ignoreList":[]}
|
node_modules/@babel/helper-skip-transparent-expression-wrappers/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@babel/helper-skip-transparent-expression-wrappers",
|
| 3 |
+
"version": "7.29.7",
|
| 4 |
+
"description": "Helper which skips types and parentheses",
|
| 5 |
+
"repository": {
|
| 6 |
+
"type": "git",
|
| 7 |
+
"url": "https://github.com/babel/babel.git",
|
| 8 |
+
"directory": "packages/babel-helper-skip-transparent-expression-wrappers"
|
| 9 |
+
},
|
| 10 |
+
"license": "MIT",
|
| 11 |
+
"publishConfig": {
|
| 12 |
+
"access": "public"
|
| 13 |
+
},
|
| 14 |
+
"main": "./lib/index.js",
|
| 15 |
+
"exports": {
|
| 16 |
+
".": {
|
| 17 |
+
"types": "./lib/index.d.ts",
|
| 18 |
+
"default": "./lib/index.js"
|
| 19 |
+
},
|
| 20 |
+
"./package.json": "./package.json"
|
| 21 |
+
},
|
| 22 |
+
"dependencies": {
|
| 23 |
+
"@babel/traverse": "^7.29.7",
|
| 24 |
+
"@babel/types": "^7.29.7"
|
| 25 |
+
},
|
| 26 |
+
"engines": {
|
| 27 |
+
"node": ">=6.9.0"
|
| 28 |
+
},
|
| 29 |
+
"author": "The Babel Team (https://babel.dev/team)",
|
| 30 |
+
"type": "commonjs"
|
| 31 |
+
}
|
node_modules/@babel/helper-string-parser/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 6 |
+
a copy of this software and associated documentation files (the
|
| 7 |
+
"Software"), to deal in the Software without restriction, including
|
| 8 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 9 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 10 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 11 |
+
the following conditions:
|
| 12 |
+
|
| 13 |
+
The above copyright notice and this permission notice shall be
|
| 14 |
+
included in all copies or substantial portions of the Software.
|
| 15 |
+
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 17 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 18 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 19 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
| 20 |
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
| 21 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
| 22 |
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
node_modules/@babel/helper-string-parser/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @babel/helper-string-parser
|
| 2 |
+
|
| 3 |
+
> A utility package to parse strings
|
| 4 |
+
|
| 5 |
+
See our website [@babel/helper-string-parser](https://babeljs.io/docs/babel-helper-string-parser) for more information.
|
| 6 |
+
|
| 7 |
+
## Install
|
| 8 |
+
|
| 9 |
+
Using npm:
|
| 10 |
+
|
| 11 |
+
```sh
|
| 12 |
+
npm install --save @babel/helper-string-parser
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
or using yarn:
|
| 16 |
+
|
| 17 |
+
```sh
|
| 18 |
+
yarn add @babel/helper-string-parser
|
| 19 |
+
```
|