Skip to content

Commit

Permalink
reconfigure structure for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kyscott18 committed Jul 26, 2023
1 parent d0d5888 commit 66cc6e5
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 215 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
# typescript
*.tsbuildinfo

# @wagmi/cli
test/generated.ts

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
"version": "0.0.0",
"description": "",
"private": true,
"workspaces": [
"packages/*"
],
"type": "module",
"workspaces": ["packages/*"],
"scripts": {
"build": "pnpm --filter 'reverse-mirage' build",
"lint": "pnpm --parallel lint",
Expand All @@ -21,6 +20,7 @@
},
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@wagmi/cli": "^1.3.0",
"rome": "^12.1.3",
"typescript": "^5.1.6"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ yarn-error.log*
*.tsbuildinfo

# @wagmi/cli
src/generated.ts
src/test/generated.ts
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"devDependencies": {
"@uniswap/sdk-core": "^4.0.6",
"@viem/anvil": "^0.0.6",
"@wagmi/cli": "^1.3.0",
"rome": "^12.1.3",
"tsup": "^7.1.0",
"typescript": "^5.1.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/erc20/reads.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import MockERC20 from "../../../../contracts/out/MockERC20.sol/MockERC20.json";
import { mockErc20ABI } from "../../../../test/generated.js";
import { amountEqualTo, makeAmountFromString } from "../amountUtils.js";
import { readAndParse } from "../readUtils.js";
import { ALICE, BOB, mockERC20 } from "../test/constants.js";
import { mockErc20ABI } from "../test/generated.js";
import { publicClient, testClient, walletClient } from "../test/utils.js";
import {
erc20Allowance,
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/erc20/writes.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import MockERC20 from "../../../../contracts/out/MockERC20.sol/MockERC20.json";
import { mockErc20ABI } from "../../../../test/generated.js";
import { amountEqualTo, makeAmountFromString } from "../amountUtils.js";
import { readAndParse } from "../readUtils.js";
import { ALICE, BOB, mockERC20 } from "../test/constants.js";
import { mockErc20ABI } from "../test/generated.js";
import { publicClient, testClient, walletClient } from "../test/utils.js";
import { erc20BalanceOf } from "./reads.js";
import { erc20Transfer } from "./writes.js";
Expand Down
182 changes: 0 additions & 182 deletions packages/core/src/test/generated.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/core/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// This configuration is used for local development and type checking of configuration and script files that are not part of the build.
"include": [
"vitest.config.ts",
"wagmi.config.ts"
],
"compilerOptions": {
"strict": true,
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

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

50 changes: 29 additions & 21 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
{
// This tsconfig file contains the shared config for the build (tsconfig.build.json) and type checking (tsconfig.json) config.
"compilerOptions": {
"target": "ESNext",
"lib": [
"esnext"
],
"module": "esnext",
"moduleResolution": "Node",
"isolatedModules": true,
"incremental": true,
"allowUnreachableCode": false,
"skipLibCheck": false,
"allowUnusedLabels": false,
"alwaysStrict": true,
// Type checking
"strict": true,
"useDefineForClassFields": true, // Not enabled by default in `strict` mode unless we bump `target` to ES2022.
"noFallthroughCasesInSwitch": true, // Not enabled by default in `strict` mode.
"noImplicitReturns": true, // Not enabled by default in `strict` mode.
"useUnknownInCatchVariables": true, // TODO: This would normally be enabled in `strict` mode but would require some adjustments to the codebase.
"noImplicitOverride": true, // Not enabled by default in `strict` mode.
"noUnusedLocals": true, // Not enabled by default in `strict` mode.
"noUnusedParameters": true, // Not enabled by default in `strict` mode.
"exactOptionalPropertyTypes": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitOverride": true,
"noImplicitThis": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strict": true
// JavaScript support
"allowJs": false,
"checkJs": false,
// Interop constraints
"esModuleInterop": false,
"allowSyntheticDefaultImports": false,
"forceConsistentCasingInFileNames": true,
"verbatimModuleSyntax": true,
"importHelpers": true, // This is only used for build validation. Since we do not have `tslib` installed, this will fail if we accidentally make use of anything that'd require injection of helpers.
"resolveJsonModule":true,
// Language and environment
"moduleResolution": "NodeNext",
"module": "ESNext",
"target": "ES2021", // Setting this to `ES2021` enables native support for `Node v16+`: https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping.
"lib": [
"ES2022"
],
// Skip type checking for node modules
"skipLibCheck": true
}
}
2 changes: 1 addition & 1 deletion packages/core/wagmi.config.ts → wagmi.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from "@wagmi/cli";
import { foundry } from "@wagmi/cli/plugins";

export default defineConfig({
out: "src/test/generated.ts",
out: "test/generated.ts",
contracts: [],
plugins: [
foundry({
Expand Down

0 comments on commit 66cc6e5

Please sign in to comment.