Skip to content

Commit

Permalink
feat: Use tsx instead of ts-node
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Cory authored and tynes committed Jul 17, 2023
1 parent 12a4691 commit 5bddd3a
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 126 deletions.
16 changes: 8 additions & 8 deletions packages/chain-mon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"dist/*"
],
"scripts": {
"start:balance-mon": "ts-node ./src/balance-mon/service.ts",
"start:wallet-mon": "ts-node ./src/wallet-mon/service.ts",
"start:drippie-mon": "ts-node ./src/drippie-mon/service.ts",
"start:wd-mon": "ts-node ./src/wd-mon/service.ts",
"start:balance-mon": "tsx ./src/balance-mon/service.ts",
"start:wallet-mon": "tsx ./src/wallet-mon/service.ts",
"start:drippie-mon": "tsx ./src/drippie-mon/service.ts",
"start:wd-mon": "tsx ./src/wd-mon/service.ts",
"test:coverage": "echo 'No tests defined.'",
"build": "tsc -p ./tsconfig.json",
"clean": "rimraf dist/ ./tsconfig.tsbuildinfo",
Expand All @@ -35,17 +35,17 @@
},
"dependencies": {
"@eth-optimism/common-ts": "0.8.2",
"@eth-optimism/contracts-periphery": "1.0.8",
"@eth-optimism/contracts-bedrock": "0.15.0",
"@eth-optimism/contracts-periphery": "1.0.8",
"@eth-optimism/core-utils": "0.12.1",
"@eth-optimism/sdk": "3.0.0",
"ethers": "^5.7.0",
"@types/dateformat": "^5.0.0",
"chai-as-promised": "^7.1.1",
"dateformat": "^4.5.1"
"dateformat": "^4.5.1",
"ethers": "^5.7.0"
},
"devDependencies": {
"@ethersproject/abstract-provider": "^5.7.0",
"ts-node": "^10.9.1"
"tsx": "^3.12.7"
}
}
2 changes: 1 addition & 1 deletion packages/common-ts/src/base-service/base-service-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export abstract class BaseServiceV2<
}

// Use commander as a way to communicate info about the service. We don't actually *use*
// commander for anything besides the ability to run `ts-node ./service.ts --help`.
// commander for anything besides the ability to run `tsx ./service.ts --help`.
const program = new Command().allowUnknownOption(true)
for (const [optionName, optionSpec] of Object.entries(params.optionsSpec)) {
// Skip options that are not meant to be used by the user.
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts-bedrock/STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ All test contracts and functions should be organized and named according to the
These guidelines are also encoded in a script which can be run with:

```
ts-node scripts/forge-test-names.ts
tsx scripts/forge-test-names.ts
```

_Note: This is a work in progress, not all test files are compliant with these guidelines._
Expand Down
8 changes: 4 additions & 4 deletions packages/contracts-bedrock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
"build:forge": "forge build",
"build:differential": "go build -o ./scripts/differential-testing/differential-testing ./scripts/differential-testing",
"build:fuzz": "(cd test-case-generator && go build ./cmd/fuzz.go)",
"autogen:invariant-docs": "ts-node scripts/invariant-doc-gen.ts",
"autogen:invariant-docs": "tsx scripts/invariant-doc-gen.ts",
"test": "pnpm build:differential && pnpm build:fuzz && forge test",
"coverage": "pnpm build:differential && pnpm build:fuzz && forge coverage",
"coverage:lcov": "pnpm build:differential && pnpm build:fuzz && forge coverage --report lcov",
"gas-snapshot": "pnpm build:differential && pnpm build:fuzz && forge snapshot --no-match-test 'testDiff|testFuzz|invariant|generateArtifact'",
"storage-snapshot": "./scripts/storage-snapshot.sh",
"validate-deploy-configs": "./scripts/validate-deploy-configs.sh",
"validate-spacers": "forge build && npx ts-node scripts/validate-spacers.ts",
"validate-spacers": "forge build && npx tsx scripts/validate-spacers.ts",
"slither": "./scripts/slither.sh",
"slither:triage": "TRIAGE_MODE=1 ./scripts/slither.sh",
"clean": "rm -rf ./dist ./artifacts ./forge-artifacts ./cache ./tsconfig.tsbuildinfo ./tsconfig.build.tsbuildinfo ./src/contract-artifacts.ts ./test-case-generator/fuzz",
"lint:ts:check": "eslint . --max-warnings=0",
"lint:forge-tests:check": "ts-node scripts/forge-test-names.ts",
"lint:forge-tests:check": "tsx scripts/forge-test-names.ts",
"lint:contracts:check": "pnpm solhint -f table 'contracts/**/!(DisputeTypes|RLPReader).sol' && pnpm prettier --check 'contracts/**/!(DisputeTypes|RLPReader).sol' && pnpm lint:forge-tests:check",
"lint:check": "pnpm lint:contracts:check && pnpm lint:ts:check",
"lint:ts:fix": "eslint --fix .",
Expand All @@ -50,7 +50,7 @@
"forge-std": "github:foundry-rs/forge-std#e8a047e3f40f13fa37af6fe14e6e06283d9a060e",
"solhint": "^3.4.1",
"solhint-plugin-prettier": "^0.0.5",
"ts-node": "^10.9.1",
"tsx": "^3.12.7",
"typescript": "^4.9.3"
}
}
2 changes: 1 addition & 1 deletion packages/fault-detector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Check the list of available metrics via `pnpm start --help`:

```sh
> pnpm start --help
$ ts-node ./src/service.ts --help
$ tsx ./src/service.ts --help
Usage: service [options]

Options:
Expand Down
4 changes: 2 additions & 2 deletions packages/replica-healthcheck/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dist/*"
],
"scripts": {
"start": "ts-node ./src/service",
"start": "tsx ./src/service",
"test:coverage": "echo 'No tests defined.'",
"build": "tsc -p tsconfig.json",
"clean": "rimraf ./dist ./tsconfig.tsbuildinfo",
Expand Down Expand Up @@ -37,6 +37,6 @@
"@ethersproject/abstract-provider": "^5.7.0"
},
"devDependencies": {
"ts-node": "^10.9.1"
"tsx": "^3.12.7"
}
}
121 changes: 12 additions & 109 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5bddd3a

Please sign in to comment.