From 414ab938e1058d94dd1e4e58b689cadc45c94faa Mon Sep 17 00:00:00 2001 From: Roman Date: Sun, 15 Feb 2026 23:39:02 +0000 Subject: [PATCH 1/6] babel 8 --- bun.lock | 147 +++++---------------- package.json | 15 +-- src/plugin-transform-typescript/enum.ts | 18 +-- src/plugin-transform-typescript/index.ts | 45 ++----- src/preset-typescript/normalize-options.ts | 6 - 5 files changed, 61 insertions(+), 170 deletions(-) diff --git a/bun.lock b/bun.lock index 5ac2e5e..60942a1 100644 --- a/bun.lock +++ b/bun.lock @@ -5,19 +5,18 @@ "": { "name": "rolldown-plugin-solid", "dependencies": { - "@babel/core": "^7.28.6", - "@babel/helper-module-imports": "7.28.6", - "@babel/helper-plugin-utils": "^7.28.6", - "@babel/helper-validator-option": "^7.27.1", - "@babel/template": "7.28.6", - "@babel/traverse": "7.29.0", - "@babel/types": "7.29.0", + "@babel/core": "8.0.0-rc.1", + "@babel/helper-module-imports": "8.0.0-rc.1", + "@babel/helper-plugin-utils": "8.0.0-rc.1", + "@babel/helper-validator-option": "8.0.0-rc.1", + "@babel/template": "8.0.0-rc.1", + "@babel/traverse": "8.0.0-rc.1", + "@babel/types": "8.0.0-rc.1", "html-entities": "2.6.0", "parse5": "^8.0.0", }, "devDependencies": { "@biomejs/biome": "2.4.0", - "@types/babel__core": "^7.20.5", "@types/bun": "^1.3.9", "@types/node": "^25.2.3", "solid-js": "1.9.11", @@ -32,39 +31,37 @@ }, }, "packages": { - "@babel/code-frame": ["@babel/code-frame@7.29.0", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="], + "@babel/code-frame": ["@babel/code-frame@8.0.0-rc.2", "", { "dependencies": { "@babel/helper-validator-identifier": "^8.0.0-rc.2", "js-tokens": "^10.0.0" } }, "sha512-zbPFBDbQdChkGN02WRc/BcOvZLDTctFJZVeWkciVr82T5V0GVBXztq4/Wi4Ca+ZKx7U+Kdt5b862cpFJ4Cjf1A=="], - "@babel/compat-data": ["@babel/compat-data@7.28.6", "", {}, "sha512-2lfu57JtzctfIrcGMz992hyLlByuzgIk58+hhGCxjKZ3rWI82NnVLjXcaTqkI2NvlcvOskZaiZ5kjUALo3Lpxg=="], + "@babel/compat-data": ["@babel/compat-data@8.0.0-rc.2", "", {}, "sha512-zDrQeMrDVCkisxxjZmP+xeAyGfZCVOwP+7VECgOvMXttb+1pTUMpeEYI0LaozIzeES/Uvu7OqhHLb3oN1qo6Wg=="], - "@babel/core": ["@babel/core@7.29.0", "", { "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", "@babel/helper-compilation-targets": "^7.28.6", "@babel/helper-module-transforms": "^7.28.6", "@babel/helpers": "^7.28.6", "@babel/parser": "^7.29.0", "@babel/template": "^7.28.6", "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA=="], + "@babel/core": ["@babel/core@8.0.0-rc.1", "", { "dependencies": { "@babel/code-frame": "^8.0.0-rc.1", "@babel/generator": "^8.0.0-rc.1", "@babel/helper-compilation-targets": "^8.0.0-rc.1", "@babel/helpers": "^8.0.0-rc.1", "@babel/parser": "^8.0.0-rc.1", "@babel/template": "^8.0.0-rc.1", "@babel/traverse": "^8.0.0-rc.1", "@babel/types": "^8.0.0-rc.1", "@jridgewell/remapping": "^2.3.5", "@types/gensync": "^1.0.0", "convert-source-map": "^2.0.0", "gensync": "^1.0.0-beta.2", "import-meta-resolve": "^4.2.0", "json5": "^2.2.3", "obug": "^2.1.1", "semver": "^7.7.3" }, "peerDependencies": { "@babel/preset-typescript": "^8.0.0-0" }, "optionalPeers": ["@babel/preset-typescript"] }, "sha512-oTiaza5UaPxaErnPc9VbG/xk2b6nH96e/FgsoRwtgXvNKA9HXzJe0balrZdP6sacjZ1+YsYXW6fTvUfu+vKn8g=="], - "@babel/generator": ["@babel/generator@7.29.1", "", { "dependencies": { "@babel/parser": "^7.29.0", "@babel/types": "^7.29.0", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw=="], + "@babel/generator": ["@babel/generator@8.0.0-rc.1", "", { "dependencies": { "@babel/parser": "^8.0.0-rc.1", "@babel/types": "^8.0.0-rc.1", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "@types/jsesc": "^2.5.0", "jsesc": "^3.0.2" } }, "sha512-3ypWOOiC4AYHKr8vYRVtWtWmyvcoItHtVqF8paFax+ydpmUdPsJpLBkBBs5ItmhdrwC3a0ZSqqFAdzls4ODP3w=="], - "@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.28.6", "", { "dependencies": { "@babel/compat-data": "^7.28.6", "@babel/helper-validator-option": "^7.27.1", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA=="], + "@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@8.0.0-rc.2", "", { "dependencies": { "@babel/compat-data": "^8.0.0-rc.2", "@babel/helper-validator-option": "^8.0.0-rc.2", "browserslist": "^4.24.0", "lru-cache": "^7.14.1", "semver": "^7.7.3" } }, "sha512-oMIhKru9gl3mj0eKDyKW6wBDAvyWoZd28d6V/m4JTeeiFsJLfOYnqu+s+cnK4jSo87cg/oj4hsATgkmZ3AzsDQ=="], - "@babel/helper-globals": ["@babel/helper-globals@7.28.0", "", {}, "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw=="], + "@babel/helper-globals": ["@babel/helper-globals@8.0.0-rc.2", "", {}, "sha512-Q1AIOaW4EOxkI/8wYJKyLI59gfqTK3imFUfIqxuve0Q3GlOSrOTVmvHU6Gb3Y5GxtoS1hIzhO47k5GkfyGTQEQ=="], - "@babel/helper-module-imports": ["@babel/helper-module-imports@7.28.6", "", { "dependencies": { "@babel/traverse": "^7.28.6", "@babel/types": "^7.28.6" } }, "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw=="], + "@babel/helper-module-imports": ["@babel/helper-module-imports@8.0.0-rc.1", "", { "dependencies": { "@babel/traverse": "^8.0.0-rc.1", "@babel/types": "^8.0.0-rc.1" } }, "sha512-5SyNnANbHRhh7lOppJhoIMwVVNwgcO9jc1khnbcb7Yt6HyQtgF44eREBJoGzfNda/pf4REJxjlif9CFxxTeVPA=="], - "@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.28.6", "", { "dependencies": { "@babel/helper-module-imports": "^7.28.6", "@babel/helper-validator-identifier": "^7.28.5", "@babel/traverse": "^7.28.6" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA=="], + "@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@8.0.0-rc.1", "", { "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-4H10QaLyEonFWEpd0QoKwxKHaJMJ7P5DiA16oLh8iCXdcu3GOpjC6KAWUrgtmUXtN34NKELQ/LrAWYAcohE+7g=="], - "@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.28.6", "", {}, "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug=="], + "@babel/helper-string-parser": ["@babel/helper-string-parser@8.0.0-rc.2", "", {}, "sha512-noLx87RwlBEMrTzncWd/FvTxoJ9+ycHNg0n8yyYydIoDsLZuxknKgWRJUqcrVkNrJ74uGyhWQzQaS3q8xfGAhQ=="], - "@babel/helper-string-parser": ["@babel/helper-string-parser@7.27.1", "", {}, "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA=="], + "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@8.0.0-rc.1", "", {}, "sha512-I4YnARytXC2RzkLNVnf5qFNFMzp679qZpmtw/V3Jt2uGnWiIxyJtaukjG7R8pSx8nG2NamICpGfljQsogj+FbQ=="], - "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.28.5", "", {}, "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q=="], + "@babel/helper-validator-option": ["@babel/helper-validator-option@8.0.0-rc.1", "", {}, "sha512-U8BllC1YwIyD29oeMTIpQlLvlCLwbj34Wdd2CxAORNDIQUXnKnAiSsC+NXRXF4htL34aSx0eQ4+/+ZBe75piSg=="], - "@babel/helper-validator-option": ["@babel/helper-validator-option@7.27.1", "", {}, "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg=="], + "@babel/helpers": ["@babel/helpers@8.0.0-rc.2", "", { "dependencies": { "@babel/template": "^8.0.0-rc.2", "@babel/types": "^8.0.0-rc.2" } }, "sha512-Cc2IpMRiu8PDBUxtQ6oSkML0etJ27kZGnf3XE+qqAJJFGtVl549kyfvDWLywCAFhq16kHUe2WMZMdFUtPz6kWw=="], - "@babel/helpers": ["@babel/helpers@7.28.6", "", { "dependencies": { "@babel/template": "^7.28.6", "@babel/types": "^7.28.6" } }, "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw=="], + "@babel/parser": ["@babel/parser@8.0.0-rc.1", "", { "dependencies": { "@babel/types": "^8.0.0-rc.1" }, "bin": "./bin/babel-parser.js" }, "sha512-6HyyU5l1yK/7h9Ki52i5h6mDAx4qJdiLQO4FdCyJNoB/gy3T3GGJdhQzzbZgvgZCugYBvwtQiWRt94QKedHnkA=="], - "@babel/parser": ["@babel/parser@7.28.0", "", { "dependencies": { "@babel/types": "7.28.2" }, "bin": "./bin/babel-parser.js" }, "sha512-jVZGvOxOuNSsuQuLRTh13nU0AogFlw32w/MT+LV6D3sP5WdbW61E77RnkbaO2dUvmPAYrBDJXGn5gGS6tH4j8g=="], + "@babel/template": ["@babel/template@8.0.0-rc.1", "", { "dependencies": { "@babel/code-frame": "^8.0.0-rc.1", "@babel/parser": "^8.0.0-rc.1", "@babel/types": "^8.0.0-rc.1" } }, "sha512-GAUU9dpcIgBO1u7sxDgAOEBctMAqM8WWILwNSz6z6CcLNl6vbNQmQF2puCP4uLFiDUD/Z0LDlliFJFuGTW4p5g=="], - "@babel/template": ["@babel/template@7.28.6", "", { "dependencies": { "@babel/code-frame": "^7.28.6", "@babel/parser": "^7.28.6", "@babel/types": "^7.28.6" } }, "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ=="], + "@babel/traverse": ["@babel/traverse@8.0.0-rc.1", "", { "dependencies": { "@babel/code-frame": "^8.0.0-rc.1", "@babel/generator": "^8.0.0-rc.1", "@babel/helper-globals": "^8.0.0-rc.1", "@babel/parser": "^8.0.0-rc.1", "@babel/template": "^8.0.0-rc.1", "@babel/types": "^8.0.0-rc.1", "obug": "^2.1.1" } }, "sha512-jgII+S7JB//VQRzzFGIs26ec9vjEoftBuxSjoMHYQKB98xeWLKACktC4vESfJHKLyLlujJXfksnBuFQFMn+ykQ=="], - "@babel/traverse": ["@babel/traverse@7.29.0", "", { "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", "@babel/helper-globals": "^7.28.0", "@babel/parser": "^7.29.0", "@babel/template": "^7.28.6", "@babel/types": "^7.29.0", "debug": "^4.3.1" } }, "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA=="], - - "@babel/types": ["@babel/types@7.29.0", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A=="], + "@babel/types": ["@babel/types@8.0.0-rc.1", "", { "dependencies": { "@babel/helper-string-parser": "^8.0.0-rc.1", "@babel/helper-validator-identifier": "^8.0.0-rc.1" } }, "sha512-ubmJ6TShyaD69VE9DQrlXcdkvJbmwWPB8qYj0H2kaJi29O7vJT9ajSdBd2W8CG34pwL9pYA74fi7RHC1qbLoVQ=="], "@biomejs/biome": ["@biomejs/biome@2.4.0", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.4.0", "@biomejs/cli-darwin-x64": "2.4.0", "@biomejs/cli-linux-arm64": "2.4.0", "@biomejs/cli-linux-arm64-musl": "2.4.0", "@biomejs/cli-linux-x64": "2.4.0", "@biomejs/cli-linux-x64-musl": "2.4.0", "@biomejs/cli-win32-arm64": "2.4.0", "@biomejs/cli-win32-x64": "2.4.0" }, "bin": { "biome": "bin/biome" } }, "sha512-iluT61cORUDIC5i/y42ljyQraCemmmcgbMLLCnYO+yh+2hjTmcMFcwY8G0zTzWCsPb3t3AyKc+0t/VuhPZULUg=="], @@ -136,18 +133,12 @@ "@tybys/wasm-util": ["@tybys/wasm-util@0.10.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg=="], - "@types/babel__core": ["@types/babel__core@7.20.5", "", { "dependencies": { "@babel/parser": "7.28.0", "@babel/types": "7.28.2", "@types/babel__generator": "7.27.0", "@types/babel__template": "7.4.4", "@types/babel__traverse": "7.28.0" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="], - - "@types/babel__generator": ["@types/babel__generator@7.27.0", "", { "dependencies": { "@babel/types": "7.28.2" } }, "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg=="], - - "@types/babel__template": ["@types/babel__template@7.4.4", "", { "dependencies": { "@babel/parser": "7.28.0", "@babel/types": "7.28.2" } }, "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A=="], - - "@types/babel__traverse": ["@types/babel__traverse@7.28.0", "", { "dependencies": { "@babel/types": "7.28.2" } }, "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q=="], - "@types/bun": ["@types/bun@1.3.9", "", { "dependencies": { "bun-types": "1.3.9" } }, "sha512-KQ571yULOdWJiMH+RIWIOZ7B2RXQGpL1YQrBtLIV3FqDcCu6FsbFUBwhdKUlCKUpS3PJDsHlJ1QKlpxoVR+xtw=="], "@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="], + "@types/gensync": ["@types/gensync@1.0.4", "", {}, "sha512-C3YYeRQWp2fmq9OryX+FoDy8nXS6scQ7dPptD8LnFDAUNcKWJjXQKDNJD3HVm+kOUsXhTOkpi69vI4EuAr95bA=="], + "@types/jsesc": ["@types/jsesc@2.5.1", "", {}, "sha512-9VN+6yxLOPLOav+7PwjZbxiID2bVaeq0ED4qSQmdQTdjnXJSaCVKTR58t15oqH1H5t8Ng2ZX1SabJVoN9Q34bw=="], "@types/node": ["@types/node@25.2.3", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-m0jEgYlYz+mDJZ2+F4v8D1AyQb+QzsNqRuI7xg1VQX/KlKS0qT9r1Mo16yo5F/MtifXFgaofIFsdFMox2SxIbQ=="], @@ -170,8 +161,6 @@ "csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="], - "debug": ["debug@4.4.1", "", { "dependencies": { "ms": "2.1.3" } }, "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ=="], - "defu": ["defu@6.1.4", "", {}, "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg=="], "dts-resolver": ["dts-resolver@2.1.3", "", { "peerDependencies": { "oxc-resolver": ">=11.0.0" }, "optionalPeers": ["oxc-resolver"] }, "sha512-bihc7jPC90VrosXNzK0LTE2cuLP6jr0Ro8jk+kMugHReJVLIpHz/xadeq3MhuwyO4TD4OA3L1Q8pBBFRc08Tsw=="], @@ -196,17 +185,17 @@ "html-entities": ["html-entities@2.6.0", "", {}, "sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ=="], + "import-meta-resolve": ["import-meta-resolve@4.2.0", "", {}, "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg=="], + "import-without-cache": ["import-without-cache@0.2.5", "", {}, "sha512-B6Lc2s6yApwnD2/pMzFh/d5AVjdsDXjgkeJ766FmFuJELIGHNycKRj+l3A39yZPM4CchqNCB4RITEAYB1KUM6A=="], - "js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + "js-tokens": ["js-tokens@10.0.0", "", {}, "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q=="], "jsesc": ["jsesc@3.1.0", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="], "json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="], - "lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "3.1.1" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="], - - "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], + "lru-cache": ["lru-cache@7.18.3", "", {}, "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA=="], "node-releases": ["node-releases@2.0.19", "", {}, "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw=="], @@ -254,82 +243,16 @@ "update-browserslist-db": ["update-browserslist-db@1.1.3", "", { "dependencies": { "escalade": "3.2.0", "picocolors": "1.1.1" }, "peerDependencies": { "browserslist": "4.25.1" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw=="], - "yallist": ["yallist@3.1.1", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="], - - "@babel/core/@babel/parser": ["@babel/parser@7.29.0", "", { "dependencies": { "@babel/types": "^7.29.0" }, "bin": "./bin/babel-parser.js" }, "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww=="], - - "@babel/core/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], - - "@babel/generator/@babel/parser": ["@babel/parser@7.29.0", "", { "dependencies": { "@babel/types": "^7.29.0" }, "bin": "./bin/babel-parser.js" }, "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww=="], - - "@babel/helper-compilation-targets/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], - - "@babel/helper-module-imports/@babel/traverse": ["@babel/traverse@7.28.6", "", { "dependencies": { "@babel/code-frame": "^7.28.6", "@babel/generator": "^7.28.6", "@babel/helper-globals": "^7.28.0", "@babel/parser": "^7.28.6", "@babel/template": "^7.28.6", "@babel/types": "^7.28.6", "debug": "^4.3.1" } }, "sha512-fgWX62k02qtjqdSNTAGxmKYY/7FSL9WAS1o2Hu5+I5m9T0yxZzr4cnrfXQ/MX0rIifthCSs6FKTlzYbJcPtMNg=="], - - "@babel/helper-module-imports/@babel/types": ["@babel/types@7.28.6", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg=="], - - "@babel/helper-module-transforms/@babel/traverse": ["@babel/traverse@7.28.6", "", { "dependencies": { "@babel/code-frame": "^7.28.6", "@babel/generator": "^7.28.6", "@babel/helper-globals": "^7.28.0", "@babel/parser": "^7.28.6", "@babel/template": "^7.28.6", "@babel/types": "^7.28.6", "debug": "^4.3.1" } }, "sha512-fgWX62k02qtjqdSNTAGxmKYY/7FSL9WAS1o2Hu5+I5m9T0yxZzr4cnrfXQ/MX0rIifthCSs6FKTlzYbJcPtMNg=="], - - "@babel/helpers/@babel/types": ["@babel/types@7.28.6", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg=="], - - "@babel/parser/@babel/types": ["@babel/types@7.28.2", "", { "dependencies": { "@babel/helper-string-parser": "7.27.1", "@babel/helper-validator-identifier": "7.27.1" } }, "sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ=="], - - "@babel/template/@babel/code-frame": ["@babel/code-frame@7.28.6", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q=="], - - "@babel/template/@babel/parser": ["@babel/parser@7.28.6", "", { "dependencies": { "@babel/types": "^7.28.6" }, "bin": "./bin/babel-parser.js" }, "sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ=="], - - "@babel/template/@babel/types": ["@babel/types@7.28.6", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg=="], - - "@babel/traverse/@babel/parser": ["@babel/parser@7.29.0", "", { "dependencies": { "@babel/types": "^7.29.0" }, "bin": "./bin/babel-parser.js" }, "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww=="], - - "@types/babel__core/@babel/types": ["@babel/types@7.28.2", "", { "dependencies": { "@babel/helper-string-parser": "7.27.1", "@babel/helper-validator-identifier": "7.27.1" } }, "sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ=="], - - "@types/babel__generator/@babel/types": ["@babel/types@7.28.2", "", { "dependencies": { "@babel/helper-string-parser": "7.27.1", "@babel/helper-validator-identifier": "7.27.1" } }, "sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ=="], - - "@types/babel__template/@babel/types": ["@babel/types@7.28.2", "", { "dependencies": { "@babel/helper-string-parser": "7.27.1", "@babel/helper-validator-identifier": "7.27.1" } }, "sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ=="], - - "@types/babel__traverse/@babel/types": ["@babel/types@7.28.2", "", { "dependencies": { "@babel/helper-string-parser": "7.27.1", "@babel/helper-validator-identifier": "7.27.1" } }, "sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ=="], - - "ast-kit/@babel/parser": ["@babel/parser@8.0.0-rc.1", "", { "dependencies": { "@babel/types": "^8.0.0-rc.1" }, "bin": "./bin/babel-parser.js" }, "sha512-6HyyU5l1yK/7h9Ki52i5h6mDAx4qJdiLQO4FdCyJNoB/gy3T3GGJdhQzzbZgvgZCugYBvwtQiWRt94QKedHnkA=="], - - "rolldown-plugin-dts/@babel/generator": ["@babel/generator@8.0.0-rc.1", "", { "dependencies": { "@babel/parser": "^8.0.0-rc.1", "@babel/types": "^8.0.0-rc.1", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "@types/jsesc": "^2.5.0", "jsesc": "^3.0.2" } }, "sha512-3ypWOOiC4AYHKr8vYRVtWtWmyvcoItHtVqF8paFax+ydpmUdPsJpLBkBBs5ItmhdrwC3a0ZSqqFAdzls4ODP3w=="], - - "rolldown-plugin-dts/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@8.0.0-rc.1", "", {}, "sha512-I4YnARytXC2RzkLNVnf5qFNFMzp679qZpmtw/V3Jt2uGnWiIxyJtaukjG7R8pSx8nG2NamICpGfljQsogj+FbQ=="], - - "rolldown-plugin-dts/@babel/parser": ["@babel/parser@8.0.0-rc.1", "", { "dependencies": { "@babel/types": "^8.0.0-rc.1" }, "bin": "./bin/babel-parser.js" }, "sha512-6HyyU5l1yK/7h9Ki52i5h6mDAx4qJdiLQO4FdCyJNoB/gy3T3GGJdhQzzbZgvgZCugYBvwtQiWRt94QKedHnkA=="], - - "rolldown-plugin-dts/@babel/types": ["@babel/types@8.0.0-rc.1", "", { "dependencies": { "@babel/helper-string-parser": "^8.0.0-rc.1", "@babel/helper-validator-identifier": "^8.0.0-rc.1" } }, "sha512-ubmJ6TShyaD69VE9DQrlXcdkvJbmwWPB8qYj0H2kaJi29O7vJT9ajSdBd2W8CG34pwL9pYA74fi7RHC1qbLoVQ=="], - - "@babel/helper-module-imports/@babel/traverse/@babel/code-frame": ["@babel/code-frame@7.28.6", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q=="], - - "@babel/helper-module-imports/@babel/traverse/@babel/generator": ["@babel/generator@7.28.6", "", { "dependencies": { "@babel/parser": "^7.28.6", "@babel/types": "^7.28.6", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-lOoVRwADj8hjf7al89tvQ2a1lf53Z+7tiXMgpZJL3maQPDxh0DgLMN62B2MKUOFcoodBHLMbDM6WAbKgNy5Suw=="], - - "@babel/helper-module-imports/@babel/traverse/@babel/parser": ["@babel/parser@7.28.6", "", { "dependencies": { "@babel/types": "^7.28.6" }, "bin": "./bin/babel-parser.js" }, "sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ=="], - - "@babel/helper-module-transforms/@babel/traverse/@babel/code-frame": ["@babel/code-frame@7.28.6", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q=="], - - "@babel/helper-module-transforms/@babel/traverse/@babel/generator": ["@babel/generator@7.28.6", "", { "dependencies": { "@babel/parser": "^7.28.6", "@babel/types": "^7.28.6", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-lOoVRwADj8hjf7al89tvQ2a1lf53Z+7tiXMgpZJL3maQPDxh0DgLMN62B2MKUOFcoodBHLMbDM6WAbKgNy5Suw=="], - - "@babel/helper-module-transforms/@babel/traverse/@babel/parser": ["@babel/parser@7.28.6", "", { "dependencies": { "@babel/types": "^7.28.6" }, "bin": "./bin/babel-parser.js" }, "sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ=="], - - "@babel/helper-module-transforms/@babel/traverse/@babel/types": ["@babel/types@7.28.6", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg=="], - - "@babel/parser/@babel/types/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.27.1", "", {}, "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow=="], - - "@types/babel__core/@babel/types/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.27.1", "", {}, "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow=="], - - "@types/babel__generator/@babel/types/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.27.1", "", {}, "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow=="], - - "@types/babel__template/@babel/types/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.27.1", "", {}, "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow=="], + "@babel/code-frame/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@8.0.0-rc.2", "", {}, "sha512-xExUBkuXWJjVuIbO7z6q7/BA9bgfJDEhVL0ggrggLMbg0IzCUWGT1hZGE8qUH7Il7/RD/a6cZ3AAFrrlp1LF/A=="], - "@types/babel__traverse/@babel/types/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.27.1", "", {}, "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow=="], + "@babel/helper-compilation-targets/@babel/helper-validator-option": ["@babel/helper-validator-option@8.0.0-rc.2", "", {}, "sha512-EtxQopsocKue0ZdjnX5INoDiRN+RCBb1TDh3d0N8bM6aX0lyUhQfRNRQaKB+vCx+YvGjXWRf3JD6/YvTsf2qgQ=="], - "ast-kit/@babel/parser/@babel/types": ["@babel/types@8.0.0-rc.1", "", { "dependencies": { "@babel/helper-string-parser": "^8.0.0-rc.1", "@babel/helper-validator-identifier": "^8.0.0-rc.1" } }, "sha512-ubmJ6TShyaD69VE9DQrlXcdkvJbmwWPB8qYj0H2kaJi29O7vJT9ajSdBd2W8CG34pwL9pYA74fi7RHC1qbLoVQ=="], + "@babel/helpers/@babel/template": ["@babel/template@8.0.0-rc.2", "", { "dependencies": { "@babel/code-frame": "^8.0.0-rc.2", "@babel/parser": "^8.0.0-rc.2", "@babel/types": "^8.0.0-rc.2" } }, "sha512-INp+KufeQpvU+V+gxR7xoiVzU6sRRQo8oOsCU/sTe0wtJ/Adrfgyet0i19qvXXSeuyiZ9+PV8IF/eEPzyJ527g=="], - "rolldown-plugin-dts/@babel/types/@babel/helper-string-parser": ["@babel/helper-string-parser@8.0.0-rc.2", "", {}, "sha512-noLx87RwlBEMrTzncWd/FvTxoJ9+ycHNg0n8yyYydIoDsLZuxknKgWRJUqcrVkNrJ74uGyhWQzQaS3q8xfGAhQ=="], + "@babel/helpers/@babel/types": ["@babel/types@8.0.0-rc.2", "", { "dependencies": { "@babel/helper-string-parser": "^8.0.0-rc.2", "@babel/helper-validator-identifier": "^8.0.0-rc.2" } }, "sha512-91gAaWRznDwSX4E2tZ1YjBuIfnQVOFDCQ2r0Toby0gu4XEbyF623kXLMA8d4ZbCu+fINcrudkmEcwSUHgDDkNw=="], - "ast-kit/@babel/parser/@babel/types/@babel/helper-string-parser": ["@babel/helper-string-parser@8.0.0-rc.2", "", {}, "sha512-noLx87RwlBEMrTzncWd/FvTxoJ9+ycHNg0n8yyYydIoDsLZuxknKgWRJUqcrVkNrJ74uGyhWQzQaS3q8xfGAhQ=="], + "@babel/helpers/@babel/template/@babel/parser": ["@babel/parser@8.0.0-rc.2", "", { "dependencies": { "@babel/types": "^8.0.0-rc.2" }, "bin": "./bin/babel-parser.js" }, "sha512-29AhEtcq4x8Dp3T72qvUMZHx0OMXCj4Jy/TEReQa+KWLln524Cj1fWb3QFi0l/xSpptQBR6y9RNEXuxpFvwiUQ=="], - "ast-kit/@babel/parser/@babel/types/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@8.0.0-rc.1", "", {}, "sha512-I4YnARytXC2RzkLNVnf5qFNFMzp679qZpmtw/V3Jt2uGnWiIxyJtaukjG7R8pSx8nG2NamICpGfljQsogj+FbQ=="], + "@babel/helpers/@babel/types/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@8.0.0-rc.2", "", {}, "sha512-xExUBkuXWJjVuIbO7z6q7/BA9bgfJDEhVL0ggrggLMbg0IzCUWGT1hZGE8qUH7Il7/RD/a6cZ3AAFrrlp1LF/A=="], } } diff --git a/package.json b/package.json index ab43d60..d641782 100644 --- a/package.json +++ b/package.json @@ -30,19 +30,18 @@ "prepublishOnly": "bun run build" }, "dependencies": { - "@babel/helper-plugin-utils": "^7.28.6", - "@babel/helper-validator-option": "^7.27.1", - "@babel/core": "^7.28.6", - "@babel/helper-module-imports": "7.28.6", - "@babel/template": "7.28.6", - "@babel/traverse": "7.29.0", - "@babel/types": "7.29.0", + "@babel/helper-plugin-utils": "8.0.0-rc.1", + "@babel/helper-validator-option": "8.0.0-rc.1", + "@babel/core": "8.0.0-rc.1", + "@babel/helper-module-imports": "8.0.0-rc.1", + "@babel/template": "8.0.0-rc.1", + "@babel/traverse": "8.0.0-rc.1", + "@babel/types": "8.0.0-rc.1", "html-entities": "2.6.0", "parse5": "^8.0.0" }, "devDependencies": { "@biomejs/biome": "2.4.0", - "@types/babel__core": "^7.20.5", "@types/bun": "^1.3.9", "@types/node": "^25.2.3", "solid-js": "1.9.11", diff --git a/src/plugin-transform-typescript/enum.ts b/src/plugin-transform-typescript/enum.ts index 6eea752..8088884 100644 --- a/src/plugin-transform-typescript/enum.ts +++ b/src/plugin-transform-typescript/enum.ts @@ -153,12 +153,9 @@ const buildEnumMember = (isString: boolean, options: Record) => */ function enumFill(path: NodePath, t: t, id: t.Identifier) { const { enumValues, data, isPure } = translateEnumValues(path, t); - const enumMembers: NodePath[] = undefined - ? // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST - path - .get("body") - .get("members") - : path.get("members"); + const enumMembers: NodePath[] = path + .get("body") + .get("members"); const assignments = []; for (let i = 0; i < enumMembers.length; i++) { const [memberName, memberValue] = enumValues[i]; @@ -268,12 +265,9 @@ export function translateEnumValues(path: NodePath, t: t) { let lastName: string; let isPure = true; - const enumMembers: NodePath[] = undefined - ? // @ts-ignore(Babel 7 vs Babel 8) Babel 8 AST - path - .get("body") - .get("members") - : path.get("members"); + const enumMembers: NodePath[] = path + .get("body") + .get("members"); const enumValues: [name: string, value: t.Expression][] = enumMembers.map( (memberPath) => { diff --git a/src/plugin-transform-typescript/index.ts b/src/plugin-transform-typescript/index.ts index 1152dda..35419a2 100644 --- a/src/plugin-transform-typescript/index.ts +++ b/src/plugin-transform-typescript/index.ts @@ -1,5 +1,4 @@ import type { PluginPass } from "@babel/core"; -// @ts-expect-error: Babel types are not installed import { declare } from "@babel/helper-plugin-utils"; import type { Binding, NodePath } from "@babel/traverse"; import * as t from "@babel/types"; @@ -15,8 +14,8 @@ import syntaxTypeScript from "./plugin-syntax-typescript"; function isInType(path: NodePath) { switch (path.parent.type) { case "TSTypeReference": - case "TSExpressionWithTypeArguments": - case "TSExpressionWithTypeArguments": + case "TSClassImplements": + case "TSInterfaceHeritage": case "TSTypeQuery": return true; case "TSQualifiedName": @@ -367,9 +366,6 @@ const pluginTransformTypescript = declare((api, opts: Options) => { const binding = stmt.scope.getBinding(id.name); if ( binding && - (undefined || - // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST - !stmt.node.isExport) && isImportTypeOnly({ binding, programPath: path, @@ -429,7 +425,7 @@ const pluginTransformTypescript = declare((api, opts: Options) => { return; } - if (undefined && t.isTSImportEqualsDeclaration(path.node.declaration)) { + if (t.isTSImportEqualsDeclaration(path.node.declaration)) { return; } @@ -562,7 +558,7 @@ const pluginTransformTypescript = declare((api, opts: Options) => { if (node.typeParameters) node.typeParameters = null; - if (node.superTypeParameters) node.superTypeParameters = null; + if (node.superTypeArguments) node.superTypeArguments = null; if (node.implements) node.implements = null; if (node.abstract) node.abstract = null; @@ -678,10 +674,9 @@ const pluginTransformTypescript = declare((api, opts: Options) => { path.replaceWith(path.node.expression); }, - [`TSAsExpression${ - // Added in Babel 7.20.0 - t.tsSatisfiesExpression ? "|TSSatisfiesExpression" : "" - }`](path: NodePath) { + ["TSAsExpression|TSSatisfiesExpression"]( + path: NodePath, + ) { let { node }: { node: t.Expression } = path; do { node = node.expression; @@ -689,21 +684,7 @@ const pluginTransformTypescript = declare((api, opts: Options) => { path.replaceWith(node); }, - [undefined - ? "TSNonNullExpression|TSInstantiationExpression" - : /* This has been introduced in Babel 7.18.0 - We use api.types.* and not t.* for feature detection, - because the Babel version that is running this plugin - (where we check if the visitor is valid) might be different - from the Babel version that we resolve with `import "@babel/core"`. - This happens, for example, with Next.js that bundled `@babel/core` - but allows loading unbundled plugin (which cannot obviously import - the bundled `@babel/core` version). - */ - - api.types.tsInstantiationExpression - ? "TSNonNullExpression|TSInstantiationExpression" - : "TSNonNullExpression"]( + ["TSNonNullExpression|TSInstantiationExpression"]( path: NodePath, ) { path.replaceWith(path.node.expression); @@ -712,35 +693,35 @@ const pluginTransformTypescript = declare((api, opts: Options) => { CallExpression(path) { { // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8 - path.node.typeParameters = null; + path.node.typeArguments = null; } }, OptionalCallExpression(path) { { // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8 - path.node.typeParameters = null; + path.node.typeArguments = null; } }, NewExpression(path) { { // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8 - path.node.typeParameters = null; + path.node.typeArguments = null; } }, JSXOpeningElement(path) { { // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8 - path.node.typeParameters = null; + path.node.typeArguments = null; } }, TaggedTemplateExpression(path) { { // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8 - path.node.typeParameters = null; + path.node.typeArguments = null; } }, }, diff --git a/src/preset-typescript/normalize-options.ts b/src/preset-typescript/normalize-options.ts index 6aca838..16bfcac 100644 --- a/src/preset-typescript/normalize-options.ts +++ b/src/preset-typescript/normalize-options.ts @@ -37,9 +37,6 @@ export interface Options { onlyRemoveTypeImports?: boolean; optimizeConstEnums?: boolean; rewriteImportExtensions?: boolean; - - // TODO: Remove in Babel 8 - allExtensions?: boolean; isTSX?: boolean; } @@ -57,9 +54,6 @@ export default function normalizeOptions(options: Options = {}): Options { onlyRemoveTypeImports: "onlyRemoveTypeImports", optimizeConstEnums: "optimizeConstEnums", rewriteImportExtensions: "rewriteImportExtensions", - - // TODO: Remove in Babel 8 - allExtensions: "allExtensions", isTSX: "isTSX", }; From e5fa0b0dfe047a4cfc681f068a4eb4a2b45dde26 Mon Sep 17 00:00:00 2001 From: Roman Date: Sun, 15 Feb 2026 23:59:07 +0000 Subject: [PATCH 2/6] wip --- bun.lock | 39 +++++++++++++++++++-------------------- package.json | 25 ++++++++++++++++++------- 2 files changed, 37 insertions(+), 27 deletions(-) diff --git a/bun.lock b/bun.lock index 60942a1..ce8a655 100644 --- a/bun.lock +++ b/bun.lock @@ -5,13 +5,13 @@ "": { "name": "rolldown-plugin-solid", "dependencies": { - "@babel/core": "8.0.0-rc.1", - "@babel/helper-module-imports": "8.0.0-rc.1", - "@babel/helper-plugin-utils": "8.0.0-rc.1", - "@babel/helper-validator-option": "8.0.0-rc.1", - "@babel/template": "8.0.0-rc.1", - "@babel/traverse": "8.0.0-rc.1", - "@babel/types": "8.0.0-rc.1", + "@babel/core": "^8.0.0-rc.1", + "@babel/helper-module-imports": "^8.0.0-rc.1", + "@babel/helper-plugin-utils": "^8.0.0-rc.1", + "@babel/helper-validator-option": "^8.0.0-rc.1", + "@babel/template": "^8.0.0-rc.1", + "@babel/traverse": "^8.0.0-rc.1", + "@babel/types": "^8.0.0-rc.1", "html-entities": "2.6.0", "parse5": "^8.0.0", }, @@ -30,8 +30,19 @@ }, }, }, + "overrides": { + "@babel/code-frame": "8.0.0-rc.1", + "@babel/core": "8.0.0-rc.1", + "@babel/helper-module-imports": "8.0.0-rc.1", + "@babel/helper-plugin-utils": "8.0.0-rc.1", + "@babel/helper-validator-identifier": "8.0.0-rc.1", + "@babel/helper-validator-option": "8.0.0-rc.1", + "@babel/template": "8.0.0-rc.1", + "@babel/traverse": "8.0.0-rc.1", + "@babel/types": "8.0.0-rc.1", + }, "packages": { - "@babel/code-frame": ["@babel/code-frame@8.0.0-rc.2", "", { "dependencies": { "@babel/helper-validator-identifier": "^8.0.0-rc.2", "js-tokens": "^10.0.0" } }, "sha512-zbPFBDbQdChkGN02WRc/BcOvZLDTctFJZVeWkciVr82T5V0GVBXztq4/Wi4Ca+ZKx7U+Kdt5b862cpFJ4Cjf1A=="], + "@babel/code-frame": ["@babel/code-frame@8.0.0-rc.1", "", { "dependencies": { "@babel/helper-validator-identifier": "^8.0.0-rc.1", "js-tokens": "^10.0.0" } }, "sha512-z8WOUq8TbgYpnNd+hdMF9jyhRRGAbYzSLo7RvgCdjZGxHQGJrSFp2IF5uRTzhQnkaXZ/1TQ9fljSAA5Q0j9Ntw=="], "@babel/compat-data": ["@babel/compat-data@8.0.0-rc.2", "", {}, "sha512-zDrQeMrDVCkisxxjZmP+xeAyGfZCVOwP+7VECgOvMXttb+1pTUMpeEYI0LaozIzeES/Uvu7OqhHLb3oN1qo6Wg=="], @@ -242,17 +253,5 @@ "unrun": ["unrun@0.2.27", "", { "dependencies": { "rolldown": "1.0.0-rc.3" }, "peerDependencies": { "synckit": "^0.11.11" }, "optionalPeers": ["synckit"], "bin": { "unrun": "dist/cli.mjs" } }, "sha512-Mmur1UJpIbfxasLOhPRvox/QS4xBiDii71hMP7smfRthGcwFL2OAmYRgduLANOAU4LUkvVamuP+02U+c90jlrw=="], "update-browserslist-db": ["update-browserslist-db@1.1.3", "", { "dependencies": { "escalade": "3.2.0", "picocolors": "1.1.1" }, "peerDependencies": { "browserslist": "4.25.1" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw=="], - - "@babel/code-frame/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@8.0.0-rc.2", "", {}, "sha512-xExUBkuXWJjVuIbO7z6q7/BA9bgfJDEhVL0ggrggLMbg0IzCUWGT1hZGE8qUH7Il7/RD/a6cZ3AAFrrlp1LF/A=="], - - "@babel/helper-compilation-targets/@babel/helper-validator-option": ["@babel/helper-validator-option@8.0.0-rc.2", "", {}, "sha512-EtxQopsocKue0ZdjnX5INoDiRN+RCBb1TDh3d0N8bM6aX0lyUhQfRNRQaKB+vCx+YvGjXWRf3JD6/YvTsf2qgQ=="], - - "@babel/helpers/@babel/template": ["@babel/template@8.0.0-rc.2", "", { "dependencies": { "@babel/code-frame": "^8.0.0-rc.2", "@babel/parser": "^8.0.0-rc.2", "@babel/types": "^8.0.0-rc.2" } }, "sha512-INp+KufeQpvU+V+gxR7xoiVzU6sRRQo8oOsCU/sTe0wtJ/Adrfgyet0i19qvXXSeuyiZ9+PV8IF/eEPzyJ527g=="], - - "@babel/helpers/@babel/types": ["@babel/types@8.0.0-rc.2", "", { "dependencies": { "@babel/helper-string-parser": "^8.0.0-rc.2", "@babel/helper-validator-identifier": "^8.0.0-rc.2" } }, "sha512-91gAaWRznDwSX4E2tZ1YjBuIfnQVOFDCQ2r0Toby0gu4XEbyF623kXLMA8d4ZbCu+fINcrudkmEcwSUHgDDkNw=="], - - "@babel/helpers/@babel/template/@babel/parser": ["@babel/parser@8.0.0-rc.2", "", { "dependencies": { "@babel/types": "^8.0.0-rc.2" }, "bin": "./bin/babel-parser.js" }, "sha512-29AhEtcq4x8Dp3T72qvUMZHx0OMXCj4Jy/TEReQa+KWLln524Cj1fWb3QFi0l/xSpptQBR6y9RNEXuxpFvwiUQ=="], - - "@babel/helpers/@babel/types/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@8.0.0-rc.2", "", {}, "sha512-xExUBkuXWJjVuIbO7z6q7/BA9bgfJDEhVL0ggrggLMbg0IzCUWGT1hZGE8qUH7Il7/RD/a6cZ3AAFrrlp1LF/A=="], } } diff --git a/package.json b/package.json index d641782..6e4d849 100644 --- a/package.json +++ b/package.json @@ -30,13 +30,13 @@ "prepublishOnly": "bun run build" }, "dependencies": { - "@babel/helper-plugin-utils": "8.0.0-rc.1", - "@babel/helper-validator-option": "8.0.0-rc.1", - "@babel/core": "8.0.0-rc.1", - "@babel/helper-module-imports": "8.0.0-rc.1", - "@babel/template": "8.0.0-rc.1", - "@babel/traverse": "8.0.0-rc.1", - "@babel/types": "8.0.0-rc.1", + "@babel/helper-plugin-utils": "^8.0.0-rc.1", + "@babel/helper-validator-option": "^8.0.0-rc.1", + "@babel/core": "^8.0.0-rc.1", + "@babel/helper-module-imports": "^8.0.0-rc.1", + "@babel/template": "^8.0.0-rc.1", + "@babel/traverse": "^8.0.0-rc.1", + "@babel/types": "^8.0.0-rc.1", "html-entities": "2.6.0", "parse5": "^8.0.0" }, @@ -55,5 +55,16 @@ }, "engines": { "node": ">=20.0.0" + }, + "overrides": { + "@babel/helper-plugin-utils": "8.0.0-rc.1", + "@babel/helper-validator-identifier": "8.0.0-rc.1", + "@babel/helper-validator-option": "8.0.0-rc.1", + "@babel/code-frame": "8.0.0-rc.1", + "@babel/core": "8.0.0-rc.1", + "@babel/helper-module-imports": "8.0.0-rc.1", + "@babel/template": "8.0.0-rc.1", + "@babel/traverse": "8.0.0-rc.1", + "@babel/types": "8.0.0-rc.1" } } From a627921af91d3a600c69ddb6b650a04a8f49b85e Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 16 Feb 2026 00:13:16 +0000 Subject: [PATCH 3/6] wip --- .../babel-plugin-jsx-dom-expressions/index.ts | 1 - .../shared/validate.ts | 10 ++++++++-- src/plugin-transform-typescript/enum.ts | 2 +- src/plugin-transform-typescript/index.ts | 12 ++++++------ .../plugin-syntax-typescript.ts | 8 +------- src/preset-typescript/index.ts | 4 +--- src/preset-typescript/normalize-options.ts | 17 ----------------- .../plugin-rewrite-ts-imports.ts | 3 +-- 8 files changed, 18 insertions(+), 39 deletions(-) diff --git a/src/babel-plugin-jsx-dom-expressions/babel-plugin-jsx-dom-expressions/index.ts b/src/babel-plugin-jsx-dom-expressions/babel-plugin-jsx-dom-expressions/index.ts index 1af8dd2..ac7545f 100644 --- a/src/babel-plugin-jsx-dom-expressions/babel-plugin-jsx-dom-expressions/index.ts +++ b/src/babel-plugin-jsx-dom-expressions/babel-plugin-jsx-dom-expressions/index.ts @@ -1,4 +1,3 @@ -// @ts-expect-error: Babel types are not installed import { declare } from "@babel/helper-plugin-utils"; import type { Visitor } from "@babel/traverse"; import postprocess from "./shared/postprocess"; diff --git a/src/babel-plugin-jsx-dom-expressions/babel-plugin-jsx-dom-expressions/shared/validate.ts b/src/babel-plugin-jsx-dom-expressions/babel-plugin-jsx-dom-expressions/shared/validate.ts index 89e31e6..df9dbc7 100644 --- a/src/babel-plugin-jsx-dom-expressions/babel-plugin-jsx-dom-expressions/shared/validate.ts +++ b/src/babel-plugin-jsx-dom-expressions/babel-plugin-jsx-dom-expressions/shared/validate.ts @@ -3,7 +3,7 @@ import * as parse5 from "parse5"; /** `bodyElement` will be used as a `context` (The place where we run `innerHTML`) */ const bodyElement = parse5.parse( ``, - // @ts-ignore + // @ts-expect-error ).childNodes[1]!.childNodes[1]; function innerHTML(htmlFragment: string) { @@ -23,7 +23,13 @@ function innerHTML(htmlFragment: string) { * browser: string; // what the browser returned from evaluating `html` * } | null} */ -export function isInvalidMarkup(html: string) { +export function isInvalidMarkup(html: string): + | { + html: string; // html stripped of attributives and content + browser: string; // what the browser returned from evaluating `html` + } + | null + | undefined { html = html // normalize dom-expressions comments, so comments location are also validated diff --git a/src/plugin-transform-typescript/enum.ts b/src/plugin-transform-typescript/enum.ts index 8088884..aea526b 100644 --- a/src/plugin-transform-typescript/enum.ts +++ b/src/plugin-transform-typescript/enum.ts @@ -182,7 +182,7 @@ function enumFill(path: NodePath, t: t, id: t.Identifier) { } function isSyntacticallyString(expr: t.Expression): boolean { - // @ts-ignore(Babel 7 vs Babel 8) Type 'Expression | Super' is not assignable to type 'Expression' in Babel 8 + // @ts-expect-error(Babel 7 vs Babel 8) Type 'Expression | Super' is not assignable to type 'Expression' in Babel 8 expr = skipTransparentExprWrapperNodes(expr); switch (expr.type) { case "BinaryExpression": { diff --git a/src/plugin-transform-typescript/index.ts b/src/plugin-transform-typescript/index.ts index 35419a2..7db1767 100644 --- a/src/plugin-transform-typescript/index.ts +++ b/src/plugin-transform-typescript/index.ts @@ -651,7 +651,7 @@ const pluginTransformTypescript = declare((api, opts: Options) => { { path.replaceWith( - // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST + // @ts-expect-error(Babel 7 vs Babel 8) Babel 7 AST path.node.isExport ? t.exportNamedDeclaration(newNode) : newNode, ); } @@ -692,35 +692,35 @@ const pluginTransformTypescript = declare((api, opts: Options) => { CallExpression(path) { { - // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8 + // @ts-expect-error(Babel 7 vs Babel 8) Removed in Babel 8 path.node.typeArguments = null; } }, OptionalCallExpression(path) { { - // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8 + // @ts-expect-error(Babel 7 vs Babel 8) Removed in Babel 8 path.node.typeArguments = null; } }, NewExpression(path) { { - // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8 + // @ts-expect-error(Babel 7 vs Babel 8) Removed in Babel 8 path.node.typeArguments = null; } }, JSXOpeningElement(path) { { - // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8 + // @ts-expect-error(Babel 7 vs Babel 8) Removed in Babel 8 path.node.typeArguments = null; } }, TaggedTemplateExpression(path) { { - // @ts-ignore(Babel 7 vs Babel 8) Removed in Babel 8 + // @ts-expect-error(Babel 7 vs Babel 8) Removed in Babel 8 path.node.typeArguments = null; } }, diff --git a/src/plugin-transform-typescript/plugin-syntax-typescript.ts b/src/plugin-transform-typescript/plugin-syntax-typescript.ts index aca2a91..def3f3d 100644 --- a/src/plugin-transform-typescript/plugin-syntax-typescript.ts +++ b/src/plugin-transform-typescript/plugin-syntax-typescript.ts @@ -1,7 +1,6 @@ import { declare } from "@babel/helper-plugin-utils"; -// eslint-disable-next-line no-var -var removePlugin = function (plugins: any[], name: string) { +const removePlugin = function (plugins: any[], name: string) { const indices: number[] = []; plugins.forEach((plugin, i) => { const n = Array.isArray(plugin) ? plugin[0] : plugin; @@ -41,11 +40,6 @@ const syntaxTypeScript = declare((api, opts: Options) => { // in TS depends on the extensions, and is purely dependent on 'isTSX'. removePlugin(plugins, "jsx"); - // These are now enabled by default in @babel/parser, but we push - // them for compat with older versions. - // @ts-ignore(Babel 7 vs Babel 8) These plugins have been removed - plugins.push("objectRestSpread", "classProperties"); - if (isTSX) { plugins.push("jsx"); } diff --git a/src/preset-typescript/index.ts b/src/preset-typescript/index.ts index 59c1a71..fa23be0 100644 --- a/src/preset-typescript/index.ts +++ b/src/preset-typescript/index.ts @@ -1,5 +1,4 @@ import type { PluginItem } from "@babel/core"; -// @ts-expect-error: Babel types are not installed import { declarePreset } from "@babel/helper-plugin-utils"; import transformTypeScript from "../plugin-transform-typescript"; import type { Options } from "./normalize-options"; @@ -10,7 +9,6 @@ export type { Options as PresetTypescriptOptions }; const presetTypescript: unknown = declarePreset((api, opts: Options) => { const { - allExtensions, ignoreExtensions, allowNamespaces, disallowAmbiguousJSXLike, @@ -41,7 +39,7 @@ const presetTypescript: unknown = declarePreset((api, opts: Options) => { ]; }; - const disableExtensionDetect = allExtensions || ignoreExtensions; + const disableExtensionDetect = ignoreExtensions; return { plugins: rewriteImportExtensions ? [pluginRewriteTSImports] : [], diff --git a/src/preset-typescript/normalize-options.ts b/src/preset-typescript/normalize-options.ts index 16bfcac..6238a31 100644 --- a/src/preset-typescript/normalize-options.ts +++ b/src/preset-typescript/normalize-options.ts @@ -1,4 +1,3 @@ -// @ts-expect-error: Babel types are not installed import { OptionValidator } from "@babel/helper-validator-option"; interface BabelOptionValidator { @@ -63,20 +62,11 @@ export default function normalizeOptions(options: Options = {}): Options { "React.Fragment", ); - const allExtensions = v.validateBooleanOption( - TopLevelOptions.allExtensions, - options.allExtensions, - false, - ); - const isTSX = v.validateBooleanOption( TopLevelOptions.isTSX, options.isTSX, false, ); - if (isTSX) { - v.invariant(allExtensions, "isTSX:true requires allExtensions:true"); - } const ignoreExtensions = v.validateBooleanOption( TopLevelOptions.ignoreExtensions, @@ -89,12 +79,6 @@ export default function normalizeOptions(options: Options = {}): Options { options.disallowAmbiguousJSXLike, false, ); - if (disallowAmbiguousJSXLike) { - v.invariant( - allExtensions, - "disallowAmbiguousJSXLike:true requires allExtensions:true", - ); - } const optimizeConstEnums = v.validateBooleanOption( TopLevelOptions.optimizeConstEnums, @@ -117,7 +101,6 @@ export default function normalizeOptions(options: Options = {}): Options { onlyRemoveTypeImports, optimizeConstEnums, rewriteImportExtensions, - allExtensions, isTSX, }; diff --git a/src/preset-typescript/plugin-rewrite-ts-imports.ts b/src/preset-typescript/plugin-rewrite-ts-imports.ts index 4d0c454..21c4c50 100644 --- a/src/preset-typescript/plugin-rewrite-ts-imports.ts +++ b/src/preset-typescript/plugin-rewrite-ts-imports.ts @@ -1,12 +1,11 @@ import type { PluginPass } from "@babel/core"; -// @ts-expect-error: Babel types are not installed import { declare } from "@babel/helper-plugin-utils"; import type { NodePath } from "@babel/traverse"; import * as t from "@babel/types"; const pluginRewriteTSImports = declare(({ types: t, template }) => { function maybeReplace( - source: t.ArgumentPlaceholder | t.Expression, + source: t.ArgumentPlaceholder | t.Expression | null | undefined, path: NodePath, state: PluginPass, ) { From d1bb7e972c895c208fbda5da94ed42a96c6a3c64 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 16 Feb 2026 00:26:21 +0000 Subject: [PATCH 4/6] wip --- src/plugin-transform-typescript/const-enum.ts | 2 +- src/plugin-transform-typescript/index.ts | 33 ------------------- src/plugin-transform-typescript/namespace.ts | 3 -- src/preset-typescript/normalize-options.ts | 6 ++-- 4 files changed, 5 insertions(+), 39 deletions(-) diff --git a/src/plugin-transform-typescript/const-enum.ts b/src/plugin-transform-typescript/const-enum.ts index 84c3b70..3d680e2 100644 --- a/src/plugin-transform-typescript/const-enum.ts +++ b/src/plugin-transform-typescript/const-enum.ts @@ -55,7 +55,7 @@ export default function transpileConstEnum( ); } else { path.replaceWith( - t.variableDeclaration(undefined ? "const" : "var", [ + t.variableDeclaration("const", [ t.variableDeclarator(path.node.id, obj), ]), ); diff --git a/src/plugin-transform-typescript/index.ts b/src/plugin-transform-typescript/index.ts index 7db1767..9241e84 100644 --- a/src/plugin-transform-typescript/index.ts +++ b/src/plugin-transform-typescript/index.ts @@ -109,11 +109,6 @@ const pluginTransformTypescript = declare((api, opts: Options) => { optimizeConstEnums = false, } = opts; - if (true) { - // eslint-disable-next-line no-var - var { allowDeclareFields = false } = opts; - } - const classMemberVisitors = { field( path: NodePath< @@ -123,14 +118,6 @@ const pluginTransformTypescript = declare((api, opts: Options) => { ) { const { node } = path; - if (true) { - if (!allowDeclareFields && node.declare) { - throw path.buildCodeFrameError( - `The 'declare' modifier is only allowed when the 'allowDeclareFields' option of ` + - `@babel/plugin-transform-typescript or @babel/preset-typescript is enabled.`, - ); - } - } if (node.declare) { if (node.value) { throw path.buildCodeFrameError( @@ -146,28 +133,8 @@ const pluginTransformTypescript = declare((api, opts: Options) => { `Definitely assigned fields cannot be initialized here, but only in the constructor`, ); } - if (true) { - // keep the definitely assigned fields only when `allowDeclareFields` (equivalent of - // Typescript's `useDefineForClassFields`) is true - if ( - !allowDeclareFields && - !node.decorators && - !t.isClassPrivateProperty(node) - ) { - path.remove(); - } - } } else if (node.abstract) { path.remove(); - } else if (true) { - if ( - !allowDeclareFields && - !node.value && - !node.decorators && - !t.isClassPrivateProperty(node) - ) { - path.remove(); - } } if (node.accessibility) node.accessibility = null; diff --git a/src/plugin-transform-typescript/namespace.ts b/src/plugin-transform-typescript/namespace.ts index 0ffcc01..1fc2d68 100644 --- a/src/plugin-transform-typescript/namespace.ts +++ b/src/plugin-transform-typescript/namespace.ts @@ -10,7 +10,6 @@ export function getFirstIdentifier(node: t.TSEntityName): t.Identifier { } // In Babel 8 TSEntityName also includes ThisExpression, however, a namespace // id must not be a ThisExpression or a TSQualifiedName { left: ThisExpression }. - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion return getFirstIdentifier((node as t.TSQualifiedName).left); } @@ -105,7 +104,6 @@ function handleVariableDeclaration( const bindingIdentifiers = t.getBindingIdentifiers(node); const assignments = []; // getBindingIdentifiers returns an object without prototype. - // eslint-disable-next-line guard-for-in for (const idName in bindingIdentifiers) { assignments.push( t.assignmentExpression( @@ -191,7 +189,6 @@ function handleNested( case "VariableDeclaration": { isEmpty = false; // getBindingIdentifiers returns an object without prototype. - // eslint-disable-next-line guard-for-in for (const name in t.getBindingIdentifiers(subNode)) { names.add(name); } diff --git a/src/preset-typescript/normalize-options.ts b/src/preset-typescript/normalize-options.ts index 6238a31..33fb30d 100644 --- a/src/preset-typescript/normalize-options.ts +++ b/src/preset-typescript/normalize-options.ts @@ -39,7 +39,9 @@ export interface Options { isTSX?: boolean; } -export default function normalizeOptions(options: Options = {}): Options { +export default function normalizeOptions( + options: Options = {}, +): Required> { const { allowNamespaces = true, jsxPragma, onlyRemoveTypeImports } = options; const TopLevelOptions: { @@ -92,7 +94,7 @@ export default function normalizeOptions(options: Options = {}): Options { false, ); - const normalized: Options = { + const normalized = { ignoreExtensions, allowNamespaces, disallowAmbiguousJSXLike, From 69329fad0bf8c4145f926b4521d5cf7ad941c248 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 17 Feb 2026 22:53:58 +0000 Subject: [PATCH 5/6] v0.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6e4d849..a312f6b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rolldown-plugin/solid", - "version": "0.0.1", + "version": "0.0.2", "description": "A Rolldown plugin for compiling SolidJS JSX/TSX files", "license": "MIT", "author": "gameroman", From 04bb431f7146244b0105de1cd0b63c3d1fd4f1f9 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 17 Feb 2026 22:56:52 +0000 Subject: [PATCH 6/6] wip --- .../typescript-class-features.test.ts.snap | 10 ++++++++++ .../__snapshots__/typescript-plugin.test.ts.snap | 16 ++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/tests/__snapshots__/typescript-class-features.test.ts.snap b/tests/__snapshots__/typescript-class-features.test.ts.snap index d088901..2834587 100644 --- a/tests/__snapshots__/typescript-class-features.test.ts.snap +++ b/tests/__snapshots__/typescript-class-features.test.ts.snap @@ -777,6 +777,7 @@ function cleanChildren(parent, current, marker, replacement) { //#region tests/fixtures/typescript-class-features.tsx var _tmpl$ = /* @__PURE__ */ template(\`

Count: