Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"download-spec-tests": "pnpm -r download-spec-tests",
"test:spec": "vitest run --project spec-minimal --project spec-mainnet",
"benchmark": "pnpm benchmark:files 'packages/*/test/perf/**/*.test.ts'",
"benchmark:files": "NODE_OPTIONS='--max-old-space-size=8192 --loader=ts-node/esm' benchmark --config .benchrc.yaml --defaultBranch unstable",
"benchmark:files": "NODE_OPTIONS='--max-old-space-size=8192 --import tsx' benchmark --config .benchrc.yaml --defaultBranch unstable",
"release:create-rc": "node scripts/release/create_rc.mjs",
"release:tag-rc": "node scripts/release/tag_rc.mjs",
"release:tag-stable": "node scripts/release/tag_stable.mjs",
Expand Down Expand Up @@ -65,7 +65,7 @@
"prettier": "^3.2.5",
"pretty-format": "^29.7.0",
"semver": "^7.7.3",
"ts-node": "^11.0.0-beta.1",
"tsx": "^4.23.0",
"typescript": "^6.0.1-rc",
"vite": "^6.0.11",
"vite-plugin-node-polyfills": "^0.24.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"lint:fix": "pnpm run lint --write",
"test": "pnpm test:unit",
"test:unit": "vitest run --project unit --project unit-minimal",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"dependencies": {
"@chainsafe/persistent-merkle-tree": "^1.2.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/beacon-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@
"test:e2e": "vitest run --project e2e --project e2e-mainnet",
"test:sim": "vitest run test/sim/**/*.test.ts",
"test:sim:blobs": "vitest run test/sim/4844-interop.test.ts",
"download-spec-tests": "node --loader=ts-node/esm test/spec/downloadTests.ts",
"download-spec-tests": "node --import tsx test/spec/downloadTests.ts",
"test:spec:bls": "vitest run --project spec-minimal test/spec/bls/",
"test:spec:general": "vitest run --project spec-minimal test/spec/general/",
"test:spec:minimal": "vitest run --project spec-minimal test/spec/presets/",
"test:spec:mainnet": "vitest run --project spec-mainnet test/spec/presets/",
"test:spec": "pnpm test:spec:bls && pnpm test:spec:general && pnpm test:spec:minimal && pnpm test:spec:mainnet",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"dependencies": {
"@chainsafe/as-sha256": "^1.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {newZeroedArray} from "@lodestar/state-transition";
//
// # How to use
// ```
// INFURA_ETH2_URL=https://someurl ../../node_modules/.bin/ts-node test/scripts/blsPubkeyBytesFrequency.ts collisions
// INFURA_ETH2_URL=https://someurl ../../node_modules/.bin/tsx test/scripts/blsPubkeyBytesFrequency.ts collisions
// ```
// Available commands:
// - `frequency`
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/docsgen/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {renderCommandPage} from "./markdown.js";
// Outputs a markdown format ready to be consumed
//
// Usage:
// ts-node packages/cli/docsgen
// tsx packages/cli/docsgen
//
// After generation the resulting .md files, they are written to the path expected
// by the docusaurus index and other existing paths in the documentation
Expand Down
12 changes: 6 additions & 6 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
"write-git-data": "node lib/util/gitData/writeGitData.js",
"check-build": "node -e \"(async function() { await import('./lib/index.js') })()\" lodestar --help",
"check-types": "tsgo",
"docs:build": "node --loader ts-node/esm ./docsgen/index.ts",
"docs:build": "node --import tsx ./docsgen/index.ts",
"lint": "biome check src/ test/",
"lint:fix": "pnpm run lint --write",
"test:unit": "vitest run --project unit --project unit-minimal",
"test:e2e": "vitest run --project e2e --project e2e-mainnet",
"test:sim:multifork": "LODESTAR_PRESET=minimal DOTENV_CONFIG_PATH=../../.env.test node -r dotenv/config --loader ts-node/esm test/sim/multiFork.test.ts",
"test:sim:mixedclient": "LODESTAR_PRESET=minimal DOTENV_CONFIG_PATH=../../.env.test node -r dotenv/config --loader ts-node/esm test/sim/mixedClient.test.ts",
"test:sim:endpoints": "LODESTAR_PRESET=minimal DOTENV_CONFIG_PATH=../../.env.test node -r dotenv/config --loader ts-node/esm test/sim/endpoints.test.ts",
"test:sim:backup_eth_provider": "LODESTAR_PRESET=minimal DOTENV_CONFIG_PATH=../../.env.test node -r dotenv/config --loader ts-node/esm test/sim/backupEthProvider.test.ts",
"test:sim:multifork": "LODESTAR_PRESET=minimal DOTENV_CONFIG_PATH=../../.env.test node -r dotenv/config --import tsx test/sim/multiFork.test.ts",
"test:sim:mixedclient": "LODESTAR_PRESET=minimal DOTENV_CONFIG_PATH=../../.env.test node -r dotenv/config --import tsx test/sim/mixedClient.test.ts",
"test:sim:endpoints": "LODESTAR_PRESET=minimal DOTENV_CONFIG_PATH=../../.env.test node -r dotenv/config --import tsx test/sim/endpoints.test.ts",
"test:sim:backup_eth_provider": "LODESTAR_PRESET=minimal DOTENV_CONFIG_PATH=../../.env.test node -r dotenv/config --import tsx test/sim/backupEthProvider.test.ts",
"test": "pnpm test:unit && pnpm test:e2e",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"lint:fix": "pnpm run lint --write",
"test": "pnpm test:unit",
"test:unit": "pnpm vitest run --project unit --project unit-minimal",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"test": "pnpm test:unit",
"test:unit": "vitest run --project unit --project unit-minimal",
"test:e2e": "vitest run --project e2e",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"dependencies": {
"@chainsafe/ssz": "^1.4.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/era/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"lint:fix": "pnpm run lint --write",
"test": "pnpm test:unit",
"test:unit": "vitest run --project unit --project unit-minimal",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"dependencies": {
"@chainsafe/blst": "^2.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/fork-choice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"lint:fix": "pnpm run lint --write",
"test": "pnpm test:unit",
"test:unit": "vitest run --project unit --project unit-minimal",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"dependencies": {
"@chainsafe/ssz": "^1.4.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"test:unit": "vitest run --project unit --project unit-minimal",
"test:browsers": "vitest run --project browser",
"test:e2e": "vitest run --project e2e --project e2e-mainnet",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"types": "lib/index.d.ts",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/params/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"test:unit": "vitest run --project unit --project unit-minimal",
"test:browsers": "vitest run --project browser",
"test:e2e": "vitest run --project e2e --project e2e-mainnet",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions packages/params/test/e2e/overridePreset.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
const __dirname = path.dirname(fileURLToPath(import.meta.url));

describe("Override preset", () => {
// Allow time for ts-node to compile Typescript source
// Allow time for tsx to compile Typescript source
vi.setConfig({testTimeout: 30_000});

it("Should correctly override preset", async () => {
// `LODESTAR_PRESET` must not be set to properly test preset override
if (process.env.LODESTAR_PRESET) delete process.env.LODESTAR_PRESET;

await exec(`node --loader ts-node/esm ${path.join(__dirname, scriptNames.ok)}`);
await exec(`node --import tsx ${path.join(__dirname, scriptNames.ok)}`);

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium test

This shell command depends on an uncontrolled
absolute path
.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
});

it("Should throw trying to override preset in the wrong order", async () => {
await expect(exec(`node --loader ts-node/esm ${path.join(__dirname, scriptNames.error)}`)).rejects.toThrow(
await expect(exec(`node --import tsx ${path.join(__dirname, scriptNames.error)}`)).rejects.toThrow(

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium test

This shell command depends on an uncontrolled
absolute path
.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
"Lodestar preset is already frozen"
);
});
Expand Down
6 changes: 3 additions & 3 deletions packages/params/test/e2e/setPreset.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
const __dirname = path.dirname(fileURLToPath(import.meta.url));

describe("setPreset", () => {
// Allow time for ts-node to compile Typescript source
// Allow time for tsx to compile Typescript source
vi.setConfig({testTimeout: 30_000});

it("Should correctly set preset", async () => {
// `LODESTAR_PRESET` must not be set to properly test setting preset
if (process.env.LODESTAR_PRESET) delete process.env.LODESTAR_PRESET;

await exec(`node --loader ts-node/esm ${path.join(__dirname, scriptNames.ok)}`);
await exec(`node --import tsx ${path.join(__dirname, scriptNames.ok)}`);

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium test

This shell command depends on an uncontrolled
absolute path
.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
});

it("Should throw trying to set preset in the wrong order", async () => {
await expect(exec(`node --loader ts-node/esm ${path.join(__dirname, scriptNames.error)}`)).rejects.toThrow(
await expect(exec(`node --import tsx ${path.join(__dirname, scriptNames.error)}`)).rejects.toThrow(

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium test

This shell command depends on an uncontrolled
absolute path
.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
"Lodestar preset is already frozen"
);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/reqresp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"lint:fix": "pnpm run lint --write",
"test": "pnpm test:unit",
"test:unit": "vitest run --project unit --project unit-minimal",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"dependencies": {
"@chainsafe/fast-crc32c": "^4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/spec-test-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"test": "pnpm test:unit && pnpm test:e2e",
"test:unit": "vitest run --project unit --project unit-minimal",
"test:e2e": "vitest run --project e2e --project e2e-mainnet",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/spec-test-util/src/downloadTestsCli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ts-node
#!/usr/bin/env node

import {downloadTests} from "./downloadTests.js";

Expand Down
2 changes: 1 addition & 1 deletion packages/state-transition/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"lint:fix": "pnpm run lint --write",
"test": "pnpm test:unit",
"test:unit": "vitest run --project unit --project unit-minimal",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"types": "lib/index.d.ts",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/state-transition/test/perf/analyzeEpochs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {csvAppend, readCsv} from "./csv.js";
// To run do:
//
// ```
// NETWORK=mainnet node_modules/.bin/ts-node packages/state-transition/test/perf/analyzeEpochs.ts
// NETWORK=mainnet node_modules/.bin/tsx packages/state-transition/test/perf/analyzeEpochs.ts
// ```
//
// Example of output CSV
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"lint": "biome check src/",
"lint:fix": "pnpm run lint --write",
"test:unit": "echo 'No unit tests for @lodestar/test-utils'",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"repository": {
"type": "git",
Expand Down
16 changes: 8 additions & 8 deletions packages/test-utils/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ export async function runCliCommand<T>(
export function execCliCommand(
command: string,
args: string[],
opts?: ExecChildProcessOptions & {runWith?: "node" | "ts-node"}
opts?: ExecChildProcessOptions & {runWith?: "node" | "tsx"}
): Promise<string> {
const commandPrefixed = nodeJsBinaryPath;

const argsPrefixed =
opts?.runWith === "ts-node"
? // node --loader ts-node/esm cli.ts
["--loader", "ts-node/esm", repoRootPath(command), ...args]
opts?.runWith === "tsx"
? // node --import tsx cli.ts
["--import", "tsx", repoRootPath(command), ...args]
: // node cli.js
[repoRootPath(command), ...args];

Expand All @@ -84,14 +84,14 @@ export function execCliCommand(
export async function spawnCliCommand(
command: string,
args: string[],
opts?: SpawnChildProcessOptions & {runWith?: "node" | "ts-node"}
opts?: SpawnChildProcessOptions & {runWith?: "node" | "tsx"}
): Promise<childProcess.ChildProcessWithoutNullStreams> {
const commandPrefixed = nodeJsBinaryPath;

const argsPrefixed =
opts?.runWith === "ts-node"
? // node --loader ts-node/esm cli.ts
["--loader", "ts-node/esm", repoRootPath(command), ...args]
opts?.runWith === "tsx"
? // node --import tsx cli.ts
["--import", "tsx", repoRootPath(command), ...args]
: // node cli.js
[repoRootPath(command), ...args];

Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"test": "pnpm test:unit",
"test:unit": "vitest run --project unit --project unit-minimal",
"test:browsers": "vitest run --project browser",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"types": "lib/index.d.ts",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"lint:fix": "pnpm run lint --write",
"test:unit": "vitest run --project unit --project unit-minimal",
"test:browsers": "vitest run --project browser",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"types": "lib/index.d.ts",
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/validator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"test": "pnpm test:unit && pnpm test:e2e",
"test:spec": "vitest run --project spec-minimal",
"test:e2e": "vitest run --project e2e --project e2e-mainnet",
"download-spec-tests": "node --loader=ts-node/esm test/spec/downloadTests.ts",
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
"download-spec-tests": "node --import tsx test/spec/downloadTests.ts",
"check-readme": "pnpm exec tsx ../../scripts/check_readme.ts"
},
"repository": {
"type": "git",
Expand Down
Loading
Loading