Skip to content

Commit

Permalink
set up tsconfig for templates
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed May 23, 2024
1 parent 85ae639 commit a9f1b0f
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 38 deletions.
7 changes: 7 additions & 0 deletions packages/create-mud/scripts/copy-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,10 @@ find ./dist/templates/* -name ".gitignore" -type f | while read -r file; do
echo "Renaming $file to $newfile"
mv "$file" "$newfile"
done

# Replace root tsconfig in templates with monorepo tsconfig
tsconfig=$(realpath "$(dirname $0)/../../../tsconfig.build.json")
find ./dist/templates/*/tsconfig.json -type f | while read -r file; do
echo "Overwriting $file with $tsconfig"
cp "$tsconfig" "$file"
done
13 changes: 2 additions & 11 deletions templates/vanilla/packages/client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["vite/client"],
"target": "ESNext",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ESNext", "DOM"],
"moduleResolution": "Bundler",
"strict": true,
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"noEmit": true,
"skipLibCheck": true,
"jsx": "react-jsx"
"lib": ["ESNext", "DOM"]
},
"include": ["src"]
}
11 changes: 1 addition & 10 deletions templates/vanilla/packages/contracts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "Preserve",
"strict": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "Bundler"
}
"extends": "../../tsconfig.json"
}
3 changes: 3 additions & 0 deletions templates/vanilla/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../tsconfig.json"
}
18 changes: 18 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"module": "esnext",
"moduleResolution": "Bundler",
"target": "es2021",
"lib": ["ESNext"],
"noEmit": true,
"skipLibCheck": true,
"strict": true,
"declaration": true,
"esModuleInterop": true,
"noErrorTruncation": true,
"resolveJsonModule": true,
"forceConsistentCasingInFileNames": true,
"sourceMap": true
},
"exclude": ["**/dist", "**/node_modules", "**/docs", "**/e2e"]
}
18 changes: 1 addition & 17 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
{
"extends": ["./tsconfig.paths.json"],
"compilerOptions": {
"module": "esnext",
"moduleResolution": "Bundler",
"target": "es2021",
"lib": ["ESNext"],
"noEmit": true,
"skipLibCheck": true,
"strict": true,
"declaration": true,
"esModuleInterop": true,
"noErrorTruncation": true,
"resolveJsonModule": true,
"forceConsistentCasingInFileNames": true,
"sourceMap": true
},
"exclude": ["**/dist", "**/node_modules", "**/docs", "**/e2e"]
"extends": ["./tsconfig.build.json", "./tsconfig.paths.json"]
}

0 comments on commit a9f1b0f

Please sign in to comment.