Skip to content

Commit

Permalink
Don't build typedefs for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
steveluscher committed Dec 29, 2022
1 parent 7c15a7f commit 3df3caf
Show file tree
Hide file tree
Showing 8 changed files with 6,938 additions and 7,122 deletions.
7 changes: 3 additions & 4 deletions web3.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@
"clean": "rimraf ./coverage ./lib",
"codecov": "set -ex; npm run test:cover; cat ./coverage/lcov.info | codecov",
"dev": "cross-env NODE_ENV=development rollup -c",
"doc": "set -ex; typedoc --treatWarningsAsErrors",
"doc": "set -ex; typedoc --tsconfig ./tsconfig.library.json --treatWarningsAsErrors",
"type:gen": "./scripts/typegen.sh",
"lint": "set -ex; npm run pretty; eslint . --ext .js,.ts",
"lint:fix": "npm run pretty:fix && eslint . --fix --ext .js,.ts",
"type:check": "tsc -p tsconfig.json --noEmit",
"type:check": "tsc -p tsconfig.library.json --noEmit && tsc -p tsconfig.tests.json --noEmit",
"ok": "run-s lint test doc type:check",
"pretty": "prettier --check '{,{src,test}/**/}*.{j,t}s'",
"pretty:fix": "prettier --write '{,{src,test}/**/}*.{j,t}s'",
"re": "semantic-release --repository-url git@github.com:solana-labs/solana-web3.js.git",
"test": "cross-env NODE_ENV=test TS_NODE_COMPILER_OPTIONS='{ \"module\": \"commonjs\", \"target\": \"es2019\" }' ts-mocha --require esm './test/**/*.test.ts'",
"test": "cross-env NODE_ENV=test TS_NODE_COMPILER_OPTIONS='{ \"module\": \"commonjs\", \"target\": \"es2019\" }' ts-mocha -p ./tsconfig.tests.json --require esm './test/**/*.test.ts'",
"test:cover": "nyc --reporter=lcov npm run test",
"test:live": "TEST_LIVE=1 npm run test",
"test:live-with-test-validator": "start-server-and-test 'solana-test-validator --reset --quiet' http://localhost:8899/health test:live"
Expand Down Expand Up @@ -112,7 +112,6 @@
"eslint-plugin-mocha": "^10.1.0",
"eslint-plugin-prettier": "^4.2.1",
"esm": "^3.2.25",
"graphql-tools": "^8.3.14",
"mocha": "^10.1.0",
"mockttp": "^3.6.2",
"mz": "^2.7.0",
Expand Down
2 changes: 1 addition & 1 deletion web3.js/rollup.config.types.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dts from 'rollup-plugin-dts';

export default {
input: './declarations/src/index.d.ts',
input: './declarations/index.d.ts',
output: [{file: 'lib/index.d.ts', format: 'es'}],
plugins: [dts()],
external: ['http', 'https'],
Expand Down
2 changes: 1 addition & 1 deletion web3.js/tsconfig.d.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"extends": "./tsconfig.library.json",
"compilerOptions": {
"emitDeclarationOnly": true,
"stripInternal": true
Expand Down
23 changes: 5 additions & 18 deletions web3.js/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
{
"compilerOptions": {
"target": "esnext",
"allowJs": true,
"declaration": true,
"declarationDir": "declarations",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"baseUrl": "src",
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedParameters": true,
"noUnusedLocals": true
"composite": true
},
"include": ["src", "test/**/*.test.ts"]
"references": [
{"path": "./tsconfig.library.json"},
{"path": "./tsconfig.tests.json"}
]
}
8 changes: 8 additions & 0 deletions web3.js/tsconfig.library.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"declaration": true,
"declarationDir": "declarations"
},
"extends": "./tsconfig.shared.json",
"include": ["src"]
}
18 changes: 18 additions & 0 deletions web3.js/tsconfig.shared.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"module": "esnext",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"resolveJsonModule": true,
"strict": true,
"target": "esnext"
}
}
7 changes: 7 additions & 0 deletions web3.js/tsconfig.tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"declaration": false
},
"extends": "./tsconfig.shared.json",
"include": ["test"]
}
13,993 changes: 6,895 additions & 7,098 deletions web3.js/yarn.lock

Large diffs are not rendered by default.

0 comments on commit 3df3caf

Please sign in to comment.