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

@@ -50,13 +50,6 @@ function extractElementDescriptor(file, classRef, superRef, path) {
if (path.node.type === "StaticBlock") {
throw path.buildCodeFrameError(`Static blocks are not supported in 2018-09 decorator transform, please specify { "version": "2021-12" } instead.`);
}
if (path.isFunction()) {
{
var _path$ensureFunctionN;
(_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
}
path.ensureFunctionName(false);
}
const {
node,
scope
@@ -71,8 +64,13 @@ function extractElementDescriptor(file, classRef, superRef, path) {
}).replace();
}
const properties = [prop("kind", _core.types.stringLiteral(_core.types.isClassMethod(node) ? node.kind : "field")), prop("decorators", takeDecorators(node)), prop("static", node.static && _core.types.booleanLiteral(true)), prop("key", getKey(node))].filter(Boolean);
if (_core.types.isClassMethod(node)) {
properties.push(prop("value", _core.types.toExpression(node)));
if (isMethod) {
{
var _path$ensureFunctionN;
(_path$ensureFunctionN = path.ensureFunctionName) != null ? _path$ensureFunctionN : path.ensureFunctionName = require("@babel/traverse").NodePath.prototype.ensureFunctionName;
}
path.ensureFunctionName(false);
properties.push(prop("value", _core.types.toExpression(path.node)));
} else if (_core.types.isClassProperty(node) && node.value) {
properties.push(method("value", _core.template.statements.ast`return ${node.value}`));
} else {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -95,12 +95,12 @@ function createClassFeaturePlugin({
(0, _features.enableFeature)(file, feature, loose);
{
if (typeof file.get(versionKey) === "number") {
file.set(versionKey, "7.25.0");
file.set(versionKey, "7.25.9");
return;
}
}
if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.25.0")) {
file.set(versionKey, "7.25.0");
if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.25.9")) {
file.set(versionKey, "7.25.9");
}
},
visitor: {
@@ -108,7 +108,7 @@ function createClassFeaturePlugin({
file
}) {
var _ref;
if (file.get(versionKey) !== "7.25.0") return;
if (file.get(versionKey) !== "7.25.9") return;
if (!(0, _features.shouldTransform)(path, file)) return;
const pathIsClassDeclaration = path.isClassDeclaration();
if (pathIsClassDeclaration) (0, _typescript.assertFieldTransformed)(path);
@@ -229,7 +229,7 @@ function createClassFeaturePlugin({
file
}) {
{
if (file.get(versionKey) !== "7.25.0") return;
if (file.get(versionKey) !== "7.25.9") return;
const decl = path.get("declaration");
if (decl.isClassDeclaration() && (0, _decorators2.hasDecorators)(decl.node)) {
if (decl.node.id) {

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/helper-create-class-features-plugin",
"version": "7.25.0",
"version": "7.25.9",
"author": "The Babel Team (https://babel.dev/team)",
"license": "MIT",
"description": "Compile class public and private fields, private methods and decorators to ES6",
@@ -18,21 +18,21 @@
"babel-plugin"
],
"dependencies": {
"@babel/helper-annotate-as-pure": "^7.24.7",
"@babel/helper-member-expression-to-functions": "^7.24.8",
"@babel/helper-optimise-call-expression": "^7.24.7",
"@babel/helper-replace-supers": "^7.25.0",
"@babel/helper-skip-transparent-expression-wrappers": "^7.24.7",
"@babel/traverse": "^7.25.0",
"@babel/helper-annotate-as-pure": "^7.25.9",
"@babel/helper-member-expression-to-functions": "^7.25.9",
"@babel/helper-optimise-call-expression": "^7.25.9",
"@babel/helper-replace-supers": "^7.25.9",
"@babel/helper-skip-transparent-expression-wrappers": "^7.25.9",
"@babel/traverse": "^7.25.9",
"semver": "^6.3.1"
},
"peerDependencies": {
"@babel/core": "^7.0.0"
},
"devDependencies": {
"@babel/core": "^7.24.9",
"@babel/helper-plugin-test-runner": "^7.24.7",
"@babel/preset-env": "^7.25.0",
"@babel/core": "^7.25.9",
"@babel/helper-plugin-test-runner": "^7.25.9",
"@babel/preset-env": "^7.25.9",
"@types/charcodes": "^0.2.0",
"charcodes": "^0.2.0"
},

View File

@@ -1,32 +0,0 @@
/* This file is automatically generated by scripts/generators/tsconfig.js */
{
"extends": [
"../../tsconfig.base.json",
"../../tsconfig.paths.json"
],
"include": [
"../../packages/babel-helper-create-class-features-plugin/src/**/*.ts",
"../../lib/globals.d.ts",
"../../scripts/repo-utils/*.d.ts"
],
"references": [
{
"path": "../../packages/babel-helper-plugin-utils"
},
{
"path": "../../packages/babel-helper-annotate-as-pure"
},
{
"path": "../../packages/babel-helper-member-expression-to-functions"
},
{
"path": "../../packages/babel-helper-optimise-call-expression"
},
{
"path": "../../packages/babel-helper-replace-supers"
},
{
"path": "../../packages/babel-helper-skip-transparent-expression-wrappers"
}
]
}

File diff suppressed because one or more lines are too long