**Motivation**
Make the types exports consistent for all packages.
All modern runtimes support [conditional
exports](https://nodejs.org/api/packages.html#conditional-exports) and
there are caveats when we have both conditional exports and normal
exports present in a package.json. This PR tend to make all exports
follow same consistent and modern pattern.
**Description**
- We were using subpath exports for some packages and module exports for
other
- Keep all the types export consistent as subpath exports.
- Remove "types" and "exports` directive from package.json
- Remove `typesVersions`, this is useful only if we have different
version of types for different versions of Typescript. Or having
different types files for different file paths.
**Steps to test or reproduce**
- Run all CI
**Motivation**
Add `src` directory to package sources along with the `lib` files to
have working source map.
**Description**
- Add `src` to the files.
**Steps to test or reproduce**
- Run all tests
**Motivation**
- #7280
**Description**
- Add `"bun"` export to all packages that points to the _typescript
source_ rather than the transpiled javascript
- Allows for bun to use typescript directly
**Motivation**
Use latest `module` and `moduleResolution` for TS.
**Description**
- To use [subpath
imports](https://nodejs.org/api/packages.html#subpath-imports) in the PR
#8320 we need to update the module solution strategy for TS.
- That requires to change the `module` for the TS as well.
- Earlier tried to stay with `node18` or `node20`, but the `ts-node`
does not work with that.
- Maintaining different tsconfig for ts-node is more of hassle on wrong
run.
- So decided to stick with `nodenext` strategy for `moduleResolution`
**Steps to test or reproduce**
Run all tests
---------
Co-authored-by: Cayman <caymannava@gmail.com>
Follow up to https://github.com/ChainSafe/lodestar/pull/7610 with a few
restructuring suggestions, see comments below for detailed changes,
revives constants tests we are no longer running in CI and makes each
package executable separately again, ie. `cd packages/<package-name>`
into `yarn test:unit` works for all packages again.
One major change is that unit tests default should be written with
`mainnet` preset in mind as I noticed that makes a lot more sense for a
bunch of existing tests, eg. we have tests that depend on external
fixtures, like api spec tests for events and those are not compatible
with `minimal` preset. Also there doesn't seem to be much downside in
most cases for unit tests to use `mainnet` preset as it does not run
through all the epoch, like for example a e2e or sim test does. So
overall, it allows us to use mainnet fixtures / more "real world" data
which seems better with little to no downside.
Time comparison running unit tests on `unstable` vs. this branch
**unstable**

**nflaig/restructure-tests**

There is just a difference of 2 seconds (might be a fluke) in a 6 minute
run, this seems acceptable to me considering the benefits of using
`mainnet` preset noted above.
**Motivation**
Vitest workspaces is feature to mimic the package manager workspaces for
the tests only.
It provides following benefits:
1. Minimize the need the bunch of config files at every package root
2. Consolidate vitest configuration in project groups
3. Use consistent test configuration for all projects in the monorepo
4. Providing consistent test environment for all packages
5. Speed up visual interaction with tests in the IDEs (e.g. Visual
Studio Code)
**Description**
- Remove all unnecessary config files
- Update package json scripts to use `--project` flag
Closes#7603
Now we have following test directories.
| Directory | Description | CurrentPreset | Old Preset |
|---|---|---|---|
| test/unit | Unit tests | minimal | Default export from `params`
package |
| test/unit-mainnet | Unit tests | mainnet | mainnet |
| test/e2e | End-to-End Tests | minimal | Default export from `params`
package |
| test/e2e-mainnet | End-to-End Tests | mainnet | Never existed before,
mixed up pattern in different packages |
| test/spec | Spec tests | minimal | Default export from `params`
package, but common perception among team was that it's running with
`minimal` |
| test/spec-mainnet` | Spec tests | mainnet | Never existed as
directory, but mixed up among packages |
| test/browser | Symlink to `unit` for packages which supports browsers
| minimal | Default export from `params` package |
| test/types | Types test | minimal | Default export from `params`
package |
**Steps to test or reproduce**
Run all tests
**Motivation**
Update vitest and browser engine.
**Description**
- Move root level shared configs to `configs` directory
- Update to vitest 3.x
- Migrate from `webdriverio` to `playwright` which is more stable and
recommended by Vitest.
**NOTE**
Reverted the `playwright` upgrade. See the comments.
d2a7af0308/configs/vitest.config.base.browser.ts (L41-L43)
**Steps to test or reproduce**
Run all tests
* Replace eslint with biomejs
* Update the inclusion of word
* Fix the formatting
* Update the lint task to do all checks
* Update biome rules from eslint config
* Replace eslint with biomejs
* Update the inclusion of word
* Fix the formatting
* Update the lint task to do all checks
* Update biome rules from eslint config
* Fix all lint issues
* Fix formatting
* Add extension recomendation for vscode
* Enable recommended rules
* Enable rule noUselessSwitchCase
* Enable rule noUselessConstructor
* Fix the types
* Fix unit tests
* Enforce import extensions
* Update the cli command
* Enforce useConsistentMemberAccessibility
* Update rules
* Fix rules
* Upgrade biomejs to latest version
* Update the rules
* Update and format the config file
* Fix types break during merge
* Fix unused check
* Add comment for explicit-return-type
* Remove eslint file
* Add _e objects for empty catch blocks
* Update formatter config
* Fix formatting
* Variables using .env file
* Add env variable support to normal tests
* Fix the order of variables
* Update the order of jobs
* Export the varible using actions toolkit
* Update the workflow tasks
* Fix the sim workflow
* Add .env.test file support to tests
* Fix the lint
* Update the task description
* Move lodestar preset to env file
* Fix the directory path
* newline
* Update debugging spec tests section
* Update the env variable for preset
* Fix the path for setup files
* Update code as per feedback
* Fix the e2e variables
* Update doc
* Fix the bash script
* Fix sim geth runne
* Update the env file
* Fix e2e tests
* Update the script tasks
* Update the script tasks
* Add minimal for e2e tests
* Add minimal for e2e tests
* Update comments in preset tests
* Downgrade nethermind version
* Load env file in e2e env
* Add the issue link in env variable
* Update bash script for failsafe current dir
* Fix the mistaken genesis extension for el nodes
* Add missing capella wait for one test
* Downgrade the geth version
* Update .env.test
---------
Co-authored-by: Nico Flaig <nflaig@protonmail.com>