summaryrefslogtreecommitdiff
path: root/node_modules/@babel/plugin-transform-class-static-block
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-05-14 14:05:49 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-05-14 14:05:49 +0800
commit06823fbf1c2e763a5bf76c3990ca98fbbcd98691 (patch)
tree4280bece3888d12a022093bf1a9cd1b049393602 /node_modules/@babel/plugin-transform-class-static-block
parent1368909b3cd552dbb0d12d5863c597f5be46177d (diff)
updated node_modules
Diffstat (limited to 'node_modules/@babel/plugin-transform-class-static-block')
-rw-r--r--node_modules/@babel/plugin-transform-class-static-block/lib/index.js7
-rw-r--r--node_modules/@babel/plugin-transform-class-static-block/lib/index.js.map2
-rw-r--r--node_modules/@babel/plugin-transform-class-static-block/package.json15
3 files changed, 13 insertions, 11 deletions
diff --git a/node_modules/@babel/plugin-transform-class-static-block/lib/index.js b/node_modules/@babel/plugin-transform-class-static-block/lib/index.js
index 94282972..10d7ce35 100644
--- a/node_modules/@babel/plugin-transform-class-static-block/lib/index.js
+++ b/node_modules/@babel/plugin-transform-class-static-block/lib/index.js
@@ -19,12 +19,13 @@ function generateUid(scope, denyList) {
var _default = exports.default = (0, _helperPluginUtils.declare)(({
types: t,
template,
- assertVersion
+ assertVersion,
+ version
}) => {
- assertVersion("^7.12.0");
+ assertVersion("^7.12.0 || >8.0.0-alpha <8.0.0-beta");
return {
name: "transform-class-static-block",
- inherits: require("@babel/plugin-syntax-class-static-block").default,
+ inherits: version[0] === "8" ? undefined : require("@babel/plugin-syntax-class-static-block").default,
pre() {
(0, _helperCreateClassFeaturesPlugin.enableFeature)(this.file, _helperCreateClassFeaturesPlugin.FEATURES.staticBlocks, false);
},
diff --git a/node_modules/@babel/plugin-transform-class-static-block/lib/index.js.map b/node_modules/@babel/plugin-transform-class-static-block/lib/index.js.map
index d3d98cb4..f4ca1b54 100644
--- a/node_modules/@babel/plugin-transform-class-static-block/lib/index.js.map
+++ b/node_modules/@babel/plugin-transform-class-static-block/lib/index.js.map
@@ -1 +1 @@
-{"version":3,"names":["_helperPluginUtils","require","_helperCreateClassFeaturesPlugin","generateUid","scope","denyList","name","uid","i","_generateUid","has","_default","exports","default","declare","types","t","template","assertVersion","inherits","pre","enableFeature","file","FEATURES","staticBlocks","visitor","ClassBody","classBody","privateNames","Set","body","get","path","isPrivate","add","node","isStaticBlock","staticBlockPrivateId","staticBlockRef","privateName","identifier","replacement","blockBody","length","isExpressionStatement","inheritsComments","expression","ast","replaceWith","classPrivateProperty"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport type { Scope } from \"@babel/traverse\";\n\nimport {\n enableFeature,\n FEATURES,\n} from \"@babel/helper-create-class-features-plugin\";\n\n/**\n * Generate a uid that is not in `denyList`\n *\n * @param {Scope} scope\n * @param {Set<string>} denyList a deny list that the generated uid should avoid\n * @returns\n */\nfunction generateUid(scope: Scope, denyList: Set<string>) {\n const name = \"\";\n let uid;\n let i = 1;\n do {\n uid = scope._generateUid(name, i);\n i++;\n } while (denyList.has(uid));\n return uid;\n}\n\nexport default declare(({ types: t, template, assertVersion }) => {\n assertVersion(\n process.env.BABEL_8_BREAKING && process.env.IS_PUBLISH\n ? PACKAGE_JSON.version\n : \"^7.12.0\",\n );\n\n return {\n name: \"transform-class-static-block\",\n inherits: USE_ESM\n ? undefined\n : IS_STANDALONE\n ? undefined\n : // eslint-disable-next-line no-restricted-globals\n require(\"@babel/plugin-syntax-class-static-block\").default,\n\n pre() {\n // Enable this in @babel/helper-create-class-features-plugin, so that it\n // can be handled by the private fields and methods transform.\n enableFeature(this.file, FEATURES.staticBlocks, /* loose */ false);\n },\n\n visitor: {\n // Run on ClassBody and not on class so that if @babel/helper-create-class-features-plugin\n // is enabled it can generate optimized output without passing from the intermediate\n // private fields representation.\n ClassBody(classBody) {\n const { scope } = classBody;\n const privateNames = new Set<string>();\n const body = classBody.get(\"body\");\n for (const path of body) {\n if (path.isPrivate()) {\n privateNames.add(path.get(\"key.id\").node.name);\n }\n }\n for (const path of body) {\n if (!path.isStaticBlock()) continue;\n const staticBlockPrivateId = generateUid(scope, privateNames);\n privateNames.add(staticBlockPrivateId);\n const staticBlockRef = t.privateName(\n t.identifier(staticBlockPrivateId),\n );\n\n let replacement;\n const blockBody = path.node.body;\n // We special-case the single expression case to avoid the iife, since\n // it's common.\n if (blockBody.length === 1 && t.isExpressionStatement(blockBody[0])) {\n replacement = t.inheritsComments(\n blockBody[0].expression,\n blockBody[0],\n );\n } else {\n replacement = template.expression.ast`(() => { ${blockBody} })()`;\n }\n\n path.replaceWith(\n t.classPrivateProperty(\n staticBlockRef,\n replacement,\n [],\n /* static */ true,\n ),\n );\n }\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAGA,IAAAC,gCAAA,GAAAD,OAAA;AAYA,SAASE,WAAWA,CAACC,KAAY,EAAEC,QAAqB,EAAE;EACxD,MAAMC,IAAI,GAAG,EAAE;EACf,IAAIC,GAAG;EACP,IAAIC,CAAC,GAAG,CAAC;EACT,GAAG;IACDD,GAAG,GAAGH,KAAK,CAACK,YAAY,CAACH,IAAI,EAAEE,CAAC,CAAC;IACjCA,CAAC,EAAE;EACL,CAAC,QAAQH,QAAQ,CAACK,GAAG,CAACH,GAAG,CAAC;EAC1B,OAAOA,GAAG;AACZ;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,0BAAO,EAAC,CAAC;EAAEC,KAAK,EAAEC,CAAC;EAAEC,QAAQ;EAAEC;AAAc,CAAC,KAAK;EAChEA,aAAa,CAGP,SACN,CAAC;EAED,OAAO;IACLZ,IAAI,EAAE,8BAA8B;IACpCa,QAAQ,EAKFlB,OAAO,CAAC,yCAAyC,CAAC,CAACY,OAAO;IAEhEO,GAAGA,CAAA,EAAG;MAGJ,IAAAC,8CAAa,EAAC,IAAI,CAACC,IAAI,EAAEC,yCAAQ,CAACC,YAAY,EAAc,KAAK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,EACdG,WAAW,EACX,EAAE,EACW,IACf,CACF,CAAC;QACH;MACF;IACF;EACF,CAAC;AACH,CAAC,CAAC"} \ No newline at end of file
+{"version":3,"names":["_helperPluginUtils","require","_helperCreateClassFeaturesPlugin","generateUid","scope","denyList","name","uid","i","_generateUid","has","_default","exports","default","declare","types","t","template","assertVersion","version","inherits","undefined","pre","enableFeature","file","FEATURES","staticBlocks","visitor","ClassBody","classBody","privateNames","Set","body","get","path","isPrivate","add","node","isStaticBlock","staticBlockPrivateId","staticBlockRef","privateName","identifier","replacement","blockBody","length","isExpressionStatement","inheritsComments","expression","ast","replaceWith","classPrivateProperty"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport type { Scope } from \"@babel/traverse\";\n\nimport {\n enableFeature,\n FEATURES,\n} from \"@babel/helper-create-class-features-plugin\";\n\n/**\n * Generate a uid that is not in `denyList`\n *\n * @param {Scope} scope\n * @param {Set<string>} denyList a deny list that the generated uid should avoid\n * @returns\n */\nfunction generateUid(scope: Scope, denyList: Set<string>) {\n const name = \"\";\n let uid;\n let i = 1;\n do {\n uid = scope._generateUid(name, i);\n i++;\n } while (denyList.has(uid));\n return uid;\n}\n\nexport default declare(({ types: t, template, assertVersion, version }) => {\n assertVersion(REQUIRED_VERSION(\"^7.12.0\"));\n\n return {\n name: \"transform-class-static-block\",\n inherits:\n USE_ESM || IS_STANDALONE || version[0] === \"8\"\n ? undefined\n : // eslint-disable-next-line no-restricted-globals\n require(\"@babel/plugin-syntax-class-static-block\").default,\n\n pre() {\n // Enable this in @babel/helper-create-class-features-plugin, so that it\n // can be handled by the private fields and methods transform.\n enableFeature(this.file, FEATURES.staticBlocks, /* loose */ false);\n },\n\n visitor: {\n // Run on ClassBody and not on class so that if @babel/helper-create-class-features-plugin\n // is enabled it can generate optimized output without passing from the intermediate\n // private fields representation.\n ClassBody(classBody) {\n const { scope } = classBody;\n const privateNames = new Set<string>();\n const body = classBody.get(\"body\");\n for (const path of body) {\n if (path.isPrivate()) {\n privateNames.add(path.get(\"key.id\").node.name);\n }\n }\n for (const path of body) {\n if (!path.isStaticBlock()) continue;\n const staticBlockPrivateId = generateUid(scope, privateNames);\n privateNames.add(staticBlockPrivateId);\n const staticBlockRef = t.privateName(\n t.identifier(staticBlockPrivateId),\n );\n\n let replacement;\n const blockBody = path.node.body;\n // We special-case the single expression case to avoid the iife, since\n // it's common.\n if (blockBody.length === 1 && t.isExpressionStatement(blockBody[0])) {\n replacement = t.inheritsComments(\n blockBody[0].expression,\n blockBody[0],\n );\n } else {\n replacement = template.expression.ast`(() => { ${blockBody} })()`;\n }\n\n path.replaceWith(\n t.classPrivateProperty(\n staticBlockRef,\n replacement,\n [],\n /* static */ true,\n ),\n );\n }\n },\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAGA,IAAAC,gCAAA,GAAAD,OAAA;AAYA,SAASE,WAAWA,CAACC,KAAY,EAAEC,QAAqB,EAAE;EACxD,MAAMC,IAAI,GAAG,EAAE;EACf,IAAIC,GAAG;EACP,IAAIC,CAAC,GAAG,CAAC;EACT,GAAG;IACDD,GAAG,GAAGH,KAAK,CAACK,YAAY,CAACH,IAAI,EAAEE,CAAC,CAAC;IACjCA,CAAC,EAAE;EACL,CAAC,QAAQH,QAAQ,CAACK,GAAG,CAACH,GAAG,CAAC;EAC1B,OAAOA,GAAG;AACZ;AAAC,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,0BAAO,EAAC,CAAC;EAAEC,KAAK,EAAEC,CAAC;EAAEC,QAAQ;EAAEC,aAAa;EAAEC;AAAQ,CAAC,KAAK;EACzED,aAAa,sCAA4B,CAAC;EAE1C,OAAO;IACLZ,IAAI,EAAE,8BAA8B;IACpCc,QAAQ,EACsBD,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,GAC1CE,SAAS,GAETpB,OAAO,CAAC,yCAAyC,CAAC,CAACY,OAAO;IAEhES,GA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ACC,GAAI,YAAWL,SAAU,OAAM;UACnE;UAEAV,IAAI,CAACgB,WAAW,CACdlC,CAAC,CAACmC,oBAAoB,CACpBX,cAAc,EACdG,WAAW,EACX,EAAE,EACW,IACf,CACF,CAAC;QACH;MACF;IACF;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]} \ No newline at end of file
diff --git a/node_modules/@babel/plugin-transform-class-static-block/package.json b/node_modules/@babel/plugin-transform-class-static-block/package.json
index 0c3b4285..4e88f4c6 100644
--- a/node_modules/@babel/plugin-transform-class-static-block/package.json
+++ b/node_modules/@babel/plugin-transform-class-static-block/package.json
@@ -1,6 +1,6 @@
{
"name": "@babel/plugin-transform-class-static-block",
- "version": "7.23.4",
+ "version": "7.24.4",
"description": "Transform class static blocks",
"repository": {
"type": "git",
@@ -20,18 +20,19 @@
"babel-plugin"
],
"dependencies": {
- "@babel/helper-create-class-features-plugin": "^7.22.15",
- "@babel/helper-plugin-utils": "^7.22.5",
+ "@babel/helper-create-class-features-plugin": "^7.24.4",
+ "@babel/helper-plugin-utils": "^7.24.0",
"@babel/plugin-syntax-class-static-block": "^7.14.5"
},
"peerDependencies": {
"@babel/core": "^7.12.0"
},
"devDependencies": {
- "@babel/core": "^7.23.3",
- "@babel/helper-plugin-test-runner": "^7.22.5",
- "@babel/traverse": "^7.23.4",
- "@babel/types": "^7.23.4"
+ "@babel/core": "^7.24.4",
+ "@babel/helper-plugin-test-runner": "^7.24.1",
+ "@babel/plugin-external-helpers": "^7.24.1",
+ "@babel/traverse": "^7.24.1",
+ "@babel/types": "^7.24.0"
},
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-class-static-block",
"engines": {