mirror of
https://github.com/ChainSafe/lodestar.git
synced 2026-01-10 08:08:16 -05:00
feat: add type support for Bun (#8288)
**Motivation** Add types support for Bun. So we can start using `if(Bun)` in our codebase. **Description** - Add `@types/bun` package **Steps to test or reproduce** - Run all tests
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
"formatter": {
|
||||
"ignore": ["**/lib", "**/.nyc_output", "./packages/*/spec-tests", "**/node_modules", "./packages/*/node_modules/**"]
|
||||
},
|
||||
"javascript": {
|
||||
"globals": ["Bun"]
|
||||
},
|
||||
"organizeImports": {
|
||||
"enabled": true
|
||||
},
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
25
types/bun/index.d.ts
vendored
Normal file
25
types/bun/index.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
// We have to override Bun types to disallow mutating global types provide by NodeJS
|
||||
// This breaks our CI build process
|
||||
// <reference path="../../node_modules/bun-types/globals.d.ts" />
|
||||
|
||||
/// <reference path="../../node_modules/bun-types/s3.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/fetch.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/bun.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/extensions.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/devserver.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/ffi.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/html-rewriter.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/jsc.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/sqlite.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/test.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/wasm.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/overrides.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/deprecated.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/redis.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/shell.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/experimental.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/sql.d.ts" />
|
||||
/// <reference path="../../node_modules/bun-types/security.d.ts" />
|
||||
|
||||
/// <reference path="../../node_modules/bun-types/bun.ns.d.ts" />
|
||||
19
yarn.lock
19
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"
|
||||
|
||||
Reference in New Issue
Block a user