diff --git a/biome.jsonc b/biome.jsonc index 2db69abc07..1fb780ec5d 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -15,6 +15,9 @@ "formatter": { "ignore": ["**/lib", "**/.nyc_output", "./packages/*/spec-tests", "**/node_modules", "./packages/*/node_modules/**"] }, + "javascript": { + "globals": ["Bun"] + }, "organizeImports": { "enabled": true }, diff --git a/package.json b/package.json index 3c9df60795..09d01bc8b5 100644 --- a/package.json +++ b/package.json @@ -42,12 +42,14 @@ }, "devDependencies": { "@actions/core": "^1.11.1", + "@biomejs/biome": "^1.9.4", "@chainsafe/benchmark": "^1.2.3", "@chainsafe/biomejs-config": "^0.1.2", - "@biomejs/biome": "^1.9.4", "@types/node": "^20.12.8", + "@types/react": "^19.1.12", "@vitest/browser": "3.0.9", "@vitest/coverage-v8": "3.0.9", + "bun-types": "^1.2.21", "crypto-browserify": "^3.12.0", "dotenv": "^16.4.5", "electron": "^26.2.2", diff --git a/tsconfig.build.json b/tsconfig.build.json index 70f63601ae..6902b628a2 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -28,13 +28,17 @@ // TODO: Investigate following errors: // - Cannot find module 'rollup/parseAst' or its corresponding type declarations "skipLibCheck": true, + + "types": ["node", "bun", "vitest"], // Required to run benchmark command from root directory "typeRoots": [ "node_modules/@types", "./types", "${configDir}/node_modules/@types", - "${configDir}/types" + "${configDir}/types", + "../../node_modules/@types", + "../../types", ], } } diff --git a/types/bun/index.d.ts b/types/bun/index.d.ts new file mode 100644 index 0000000000..e87e7b14ce --- /dev/null +++ b/types/bun/index.d.ts @@ -0,0 +1,25 @@ + +// We have to override Bun types to disallow mutating global types provide by NodeJS +// This breaks our CI build process +// + +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +/// \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 28954192ce..c6228a51e0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3538,6 +3538,13 @@ resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== +"@types/react@^19.1.12": + version "19.1.12" + resolved "https://registry.yarnpkg.com/@types/react/-/react-19.1.12.tgz#7bfaa76aabbb0b4fe0493c21a3a7a93d33e8937b" + integrity sha512-cMoR+FoAf/Jyq6+Df2/Z41jISvGZZ2eTlnsaJRptmZ76Caldwy1odD4xTr/gNV9VLj0AWgg/nmkevIyUfIIq5w== + dependencies: + csstype "^3.0.2" + "@types/readable-stream@^2.3.13": version "2.3.15" resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-2.3.15.tgz#3d79c9ceb1b6a57d5f6e6976f489b9b5384321ae" @@ -4766,6 +4773,13 @@ builtins@^5.0.0: dependencies: semver "^7.0.0" +bun-types@^1.2.21: + version "1.2.21" + resolved "https://registry.yarnpkg.com/bun-types/-/bun-types-1.2.21.tgz#7ccd04d4765d7fabaaef8b2d288150305dff2c56" + integrity sha512-sa2Tj77Ijc/NTLS0/Odjq/qngmEPZfbfnOERi0KRUYhT9R8M4VBioWVmMWE5GrYbKMc+5lVybXygLdibHaqVqw== + dependencies: + "@types/node" "*" + byline@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" @@ -5531,6 +5545,11 @@ cssstyle@^3.0.0: dependencies: rrweb-cssom "^0.6.0" +csstype@^3.0.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.3.tgz#d80ff294d114fb0e6ac500fbf85b60137d7eff81" + integrity sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw== + csv-parse@^5.6.0: version "5.6.0" resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-5.6.0.tgz#219beace2a3e9f28929999d2aa417d3fb3071c7f"