feat: refactoring project

This commit is contained in:
Carlos
2024-11-23 14:56:07 -05:00
parent f0c2a50c18
commit 1c6db5818d
2351 changed files with 39323 additions and 60326 deletions

View File

@@ -10,7 +10,7 @@ var _default = exports.default = (0, _helperPluginUtils.declare)(api => {
api.assertVersion(7);
return {
name: "transform-export-namespace-from",
inherits: api.version[0] === "8" ? undefined : require("@babel/plugin-syntax-export-namespace-from").default,
manipulateOptions: (_, parser) => parser.plugins.push("exportNamespaceFrom"),
visitor: {
ExportNamedDeclaration(path) {
var _exported$name;

View File

@@ -1 +1 @@
{"version":3,"names":["_helperPluginUtils","require","_core","_default","exports","default","declare","api","assertVersion","name","inherits","version","undefined","visitor","ExportNamedDeclaration","path","_exported$name","node","scope","specifiers","index","t","isExportDefaultSpecifier","isExportNamespaceSpecifier","nodes","push","exportNamedDeclaration","shift","source","specifier","exported","uid","generateUidIdentifier","value","importDeclaration","importNamespaceSpecifier","cloneNode","exportSpecifier","length","replaceWithMultiple","registerDeclaration"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n return {\n name: \"transform-export-namespace-from\",\n inherits:\n USE_ESM || IS_STANDALONE || api.version[0] === \"8\"\n ? undefined\n : // eslint-disable-next-line no-restricted-globals\n require(\"@babel/plugin-syntax-export-namespace-from\").default,\n\n visitor: {\n ExportNamedDeclaration(path) {\n const { node, scope } = path;\n const { specifiers } = node;\n\n const index = t.isExportDefaultSpecifier(specifiers[0]) ? 1 : 0;\n if (!t.isExportNamespaceSpecifier(specifiers[index])) return;\n\n const nodes = [];\n\n if (index === 1) {\n nodes.push(\n t.exportNamedDeclaration(null, [specifiers.shift()], node.source),\n );\n }\n\n const specifier = specifiers.shift();\n const { exported } = specifier;\n const uid = scope.generateUidIdentifier(\n // @ts-expect-error Identifier ?? StringLiteral\n exported.name ?? exported.value,\n );\n\n nodes.push(\n t.importDeclaration(\n [t.importNamespaceSpecifier(uid)],\n t.cloneNode(node.source),\n ),\n t.exportNamedDeclaration(null, [\n t.exportSpecifier(t.cloneNode(uid), exported),\n ]),\n );\n\n if (node.specifiers.length >= 1) {\n nodes.push(node);\n }\n\n const [importDeclaration] = path.replaceWithMultiple(nodes);\n path.scope.registerDeclaration(importDeclaration);\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAyC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE1B,IAAAC,0BAAO,EAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,CAAkB,CAAE,CAAC;EAEtC,OAAO;IACLC,IAAI,EAAE,iCAAiC;IACvCC,QAAQ,EACsBH,GAAG,CAACI,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,GAC9CC,SAAS,GAETX,OAAO,CAAC,4CAA4C,CAAC,CAACI,OAAO;IAEnEQ,OAAO,EAAE;MACPC,sBAAsBA,CAACC,IAAI,EAAE;QAAA,IAAAC,cAAA;QAC3B,MAAM;UAAEC,IAAI;UAAEC;QAAM,CAAC,GAAGH,IAAI;QAC5B,MAAM;UAAEI;QAAW,CAAC,GAAGF,IAAI;QAE3B,MAAMG,KAAK,GAAGC,WAAC,CAACC,wBAAwB,CAACH,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QAC/D,IAAI,CAACE,WAAC,CAACE,0BAA0B,CAACJ,UAAU,CAACC,KAAK,CAAC,CAAC,EAAE;QAEtD,MAAMI,KAAK,GAAG,EAAE;QAEhB,IAAIJ,KAAK,KAAK,CAAC,EAAE;UACfI,KAAK,CAACC,IAAI,CACRJ,WAAC,CAACK,sBAAsB,CAAC,IAAI,EAAE,CAACP,UAAU,CAACQ,KAAK,CAAC,CAAC,CAAC,EAAEV,IAAI,CAACW,MAAM,CAClE,CAAC;QACH;QAEA,MAAMC,SAAS,GAAGV,UAAU,CAACQ,KAAK,CAAC,CAAC;QACpC,MAAM;UAAEG;QAAS,CAAC,GAAGD,SAAS;QAC9B,MAAME,GAAG,GAAGb,KAAK,CAACc,qBAAqB,EAAAhB,cAAA,GAErCc,QAAQ,CAACrB,IAAI,YAAAO,cAAA,GAAIc,QAAQ,CAACG,KAC5B,CAAC;QAEDT,KAAK,CAACC,IAAI,CACRJ,WAAC,CAACa,iBAAiB,CACjB,CAACb,WAAC,CAACc,wBAAwB,CAACJ,GAAG,CAAC,CAAC,EACjCV,WAAC,CAACe,SAAS,CAACnB,IAAI,CAACW,MAAM,CACzB,CAAC,EACDP,WAAC,CAACK,sBAAsB,CAAC,IAAI,EAAE,CAC7BL,WAAC,CAACgB,eAAe,CAAChB,WAAC,CAACe,SAAS,CAACL,GAAG,CAAC,EAAED,QAAQ,CAAC,CAC9C,CACH,CAAC;QAED,IAAIb,IAAI,CAACE,UAAU,CAACmB,MAAM,IAAI,CAAC,EAAE;UAC/Bd,KAAK,CAACC,IAAI,CAACR,IAAI,CAAC;QAClB;QAEA,MAAM,CAACiB,iBAAiB,CAAC,GAAGnB,IAAI,CAACwB,mBAAmB,CAACf,KAAK,CAAC;QAC3DT,IAAI,CAACG,KAAK,CAACsB,mBAAmB,CAACN,iBAAiB,CAAC;MACnD;IACF;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
{"version":3,"names":["_helperPluginUtils","require","_core","_default","exports","default","declare","api","assertVersion","name","manipulateOptions","_","parser","plugins","push","visitor","ExportNamedDeclaration","path","_exported$name","node","scope","specifiers","index","t","isExportDefaultSpecifier","isExportNamespaceSpecifier","nodes","exportNamedDeclaration","shift","source","specifier","exported","uid","generateUidIdentifier","value","importDeclaration","importNamespaceSpecifier","cloneNode","exportSpecifier","length","replaceWithMultiple","registerDeclaration"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n return {\n name: \"transform-export-namespace-from\",\n manipulateOptions: process.env.BABEL_8_BREAKING\n ? undefined\n : (_, parser) => parser.plugins.push(\"exportNamespaceFrom\"),\n\n visitor: {\n ExportNamedDeclaration(path) {\n const { node, scope } = path;\n const { specifiers } = node;\n\n const index = t.isExportDefaultSpecifier(specifiers[0]) ? 1 : 0;\n if (!t.isExportNamespaceSpecifier(specifiers[index])) return;\n\n const nodes = [];\n\n if (index === 1) {\n nodes.push(\n t.exportNamedDeclaration(null, [specifiers.shift()], node.source),\n );\n }\n\n const specifier = specifiers.shift();\n const { exported } = specifier;\n const uid = scope.generateUidIdentifier(\n // @ts-expect-error Identifier ?? StringLiteral\n exported.name ?? exported.value,\n );\n\n nodes.push(\n t.importDeclaration(\n [t.importNamespaceSpecifier(uid)],\n t.cloneNode(node.source),\n ),\n t.exportNamedDeclaration(null, [\n t.exportSpecifier(t.cloneNode(uid), exported),\n ]),\n );\n\n if (node.specifiers.length >= 1) {\n nodes.push(node);\n }\n\n const [importDeclaration] = path.replaceWithMultiple(nodes);\n path.scope.registerDeclaration(importDeclaration);\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAyC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE1B,IAAAC,0BAAO,EAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,CAAkB,CAAE,CAAC;EAEtC,OAAO;IACLC,IAAI,EAAE,iCAAiC;IACvCC,iBAAiB,EAEbA,CAACC,CAAC,EAAEC,MAAM,KAAKA,MAAM,CAACC,OAAO,CAACC,IAAI,CAAC,qBAAqB,CAAC;IAE7DC,OAAO,EAAE;MACPC,sBAAsBA,CAACC,IAAI,EAAE;QAAA,IAAAC,cAAA;QAC3B,MAAM;UAAEC,IAAI;UAAEC;QAAM,CAAC,GAAGH,IAAI;QAC5B,MAAM;UAAEI;QAAW,CA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mB,CAACN,iBAAiB,CAAC;MACnD;IACF;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]}

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/plugin-transform-export-namespace-from",
"version": "7.24.7",
"version": "7.25.9",
"description": "Compile export namespace to ES2015",
"repository": {
"type": "git",
@@ -16,15 +16,14 @@
"babel-plugin"
],
"dependencies": {
"@babel/helper-plugin-utils": "^7.24.7",
"@babel/plugin-syntax-export-namespace-from": "^7.8.3"
"@babel/helper-plugin-utils": "^7.25.9"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.24.7",
"@babel/helper-plugin-test-runner": "^7.24.7"
"@babel/core": "^7.25.9",
"@babel/helper-plugin-test-runner": "^7.25.9"
},
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-export-namespace-from",
"engines": {

View File

@@ -1,17 +0,0 @@
/* This file is automatically generated by scripts/generators/tsconfig.js */
{
"extends": [
"../../tsconfig.base.json",
"../../tsconfig.paths.json"
],
"include": [
"../../packages/babel-plugin-transform-export-namespace-from/src/**/*.ts",
"../../lib/globals.d.ts",
"../../scripts/repo-utils/*.d.ts"
],
"references": [
{
"path": "../../packages/babel-helper-plugin-utils"
}
]
}

File diff suppressed because one or more lines are too long