Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: POC Typescript Project References #1954

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ yalc.lock
package-lock.json

docs/

.rollup.cache/
tsconfig.tsbuildinfo
1 change: 1 addition & 0 deletions packages/blockchain-data/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"scripts": {
"build": "NODE_ENV=production rollup --config rollup.config.js",
"dev": "rollup --config rollup.config.js -w",
"dev:ts": "yarn tsc -b && yarn tsc --noEmit false --incremental --watch --declaration",
"generate-types": "typechain --target=ethers-v5 --out-dir=src/typechain/types 'abi/*.json'",
"lint": "eslint ./src --ext .ts,.jsx,.tsx --max-warnings=0",
"test": "jest",
Expand Down
12 changes: 9 additions & 3 deletions packages/blockchain-data/sdk/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"compilerOptions": {
"composite": true,
"outDir": "./dist",
"rootDirs": ["src"],
"rootDir": "./src",
// "rootDirs": ["src"],
"target": "es2022",
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noEmit": false,
"allowJs": false,
"removeComments": false,
"strict": true,
Expand All @@ -17,5 +19,9 @@
"skipLibCheck": true
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
"exclude": ["node_modules", "dist"],
"references": [
{ "path": "../../config" },
{ "path": "../../internal/generated-clients" },
]
}
1 change: 1 addition & 0 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"scripts": {
"build": "NODE_ENV=production rollup --config rollup.config.js",
"dev": "rollup --config rollup.config.js -w",
"dev:ts": "yarn tsc -b && yarn tsc --noEmit false --incremental --watch --declaration",
"lint": "eslint ./src --ext .ts,.jsx,.tsx --max-warnings=0",
"test": "jest",
"test:watch": "jest --watch",
Expand Down
11 changes: 8 additions & 3 deletions packages/config/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"compilerOptions": {
"composite": true,
"outDir": "./dist",
"rootDirs": ["src"],
"rootDir": "./src",
// "rootDirs": ["src"],
"target": "es2022",
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noEmit": false,
"allowJs": false,
"removeComments": false,
"strict": true,
Expand All @@ -17,5 +19,8 @@
"skipLibCheck": true
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
"exclude": ["node_modules", "dist"],
"references": [
{ "path": "../internal/metrics" },
]
}
6 changes: 4 additions & 2 deletions packages/internal/generated-clients/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"compilerOptions": {
"composite": true,
"outDir": "./dist",
"rootDirs": ["src"],
"rootDir": "./src",
// "rootDirs": ["src"],
"target": "es2022",
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noEmit": false,
"allowJs": false,
"removeComments": false,
"strict": true,
Expand Down
8 changes: 4 additions & 4 deletions packages/internal/metrics/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
"composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
Expand All @@ -26,10 +26,10 @@

/* Modules */
"module": "esnext", /* Specify what module code is generated. */
// "rootDir": "./src", /* Specify the root folder within your source files. */
"rootDir": "./src", /* Specify the root folder within your source files. */
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
"rootDirs": ["src"], /* Allow multiple folders to be treated as one when resolving modules. */
// "rootDirs": ["./src"], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
Expand Down Expand Up @@ -100,7 +100,7 @@
"skipLibCheck": true, /* Skip type checking all .d.ts files. */

/* Advanced */
// "noEmit": true,
"noEmit": false,
// "allowJs": false,
// "allowSyntheticDefaultImports": true,
// "resolveJsonModule": true,
Expand Down
1 change: 1 addition & 0 deletions packages/x-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"scripts": {
"build": "NODE_ENV=production rollup --config rollup.config.js",
"dev": "rollup --config rollup.config.js -w",
"dev:ts": "yarn tsc -b && yarn tsc --noEmit false --incremental --watch --declaration",
"lint": "eslint ./src --ext .ts,.jsx,.tsx --max-warnings=0",
"test": "jest",
"typecheck": "tsc --noEmit --jsx preserve"
Expand Down
11 changes: 8 additions & 3 deletions packages/x-client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"compilerOptions": {
"outDir": "./dist",
"rootDirs": ["src"],
"rootDir": "./src",
// "rootDirs": ["src"],
"target": "es2022",
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noEmit": false,
"allowJs": false,
"removeComments": false,
"strict": true,
Expand All @@ -17,5 +18,9 @@
"skipLibCheck": true
},
"include": ["src"],
"exclude": ["node_modules", "dist", "node_modules/elliptic"]
"exclude": ["node_modules", "dist", "node_modules/elliptic"],
"references": [
{ "path": "../internal/generated-clients" },
{ "path": "../config" },
]
}
7 changes: 6 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,10 @@
"compilerOptions": {
"module": "commonjs"
}
}
},
"references": [
{ "path": "./packages/blockchain-data/sdk" },
{ "path": "./packages/config" },
{ "path": "./packages/internal/metrics" }
]
}
Loading