Skip to content

Commit

Permalink
attempt to fix template paths
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed May 23, 2024
1 parent 145c5d0 commit 47f736d
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 61 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 local tsconfig with base tsconfig to strip paths used for dev inside monorepo
find ./dist/templates/* -name "tsconfig.base.json" -type f | while read -r file; do
newfile="$(dirname "$file")/tsconfig.json"
echo "Renaming $file to $newfile"
mv "$file" "$newfile"
done
19 changes: 19 additions & 0 deletions templates/phaser/packages/client/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"types": ["vite/client", "phaser"],
"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",
"jsxImportSource": "react"
},
"include": ["src"]
}
18 changes: 1 addition & 17 deletions templates/phaser/packages/client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
{
"compilerOptions": {
"types": ["vite/client", "phaser"],
"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",
"jsxImportSource": "react"
},
"include": ["src"]
"extends": ["./tsconfig.base.json", "../../../../tsconfig.paths.json"]
}
46 changes: 2 additions & 44 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"extends": ["./tsconfig.paths.json"],
"compilerOptions": {
"module": "esnext",
"moduleResolution": "Bundler",
Expand All @@ -12,50 +13,7 @@
"noErrorTruncation": true,
"resolveJsonModule": true,
"forceConsistentCasingInFileNames": true,
"sourceMap": true,
"paths": {
"@latticexyz/abi-ts": ["./packages/abi-ts/src/index.ts"],
"@latticexyz/block-logs-stream": ["./packages/block-logs-stream/src/index.ts"],
"@latticexyz/cli": ["./packages/cli/src/index.ts"],
"@latticexyz/common/actions": ["./packages/common/src/actions/index.ts"],
"@latticexyz/common/chains": ["./packages/common/src/chains/index.ts"],
"@latticexyz/common/codegen": ["./packages/common/src/codegen/index.ts"],
"@latticexyz/common/errors": ["./packages/common/src/errors/index.ts"],
"@latticexyz/common/foundry": ["./packages/common/src/foundry/index.ts"],
"@latticexyz/common/type-utils": ["./packages/common/src/type-utils/index.ts"],
"@latticexyz/common/utils": ["./packages/common/src/utils/index.ts"],
"@latticexyz/common/kms": ["./packages/common/src/exports/kms.ts"],
"@latticexyz/config": ["./packages/config/src/exports/index.ts"],
"@latticexyz/config/*": ["./packages/config/src/exports/*.ts"],
"@latticexyz/config/node": ["./packages/config/src/deprecated/node"],
"@latticexyz/config/library": ["./packages/config/src/deprecated/library"],
"@latticexyz/config/register": ["./packages/config/src/deprecated/register"],
"@latticexyz/gas-report": ["./packages/gas-report/ts/index.ts"],
"@latticexyz/protocol-parser": ["./packages/protocol-parser/src/index.ts"],
"@latticexyz/protocol-parser/*": ["./packages/protocol-parser/src/exports/*"],
"@latticexyz/react": ["./packages/react/src/index.ts"],
"@latticexyz/recs": ["./packages/recs/src/index.ts"],
"@latticexyz/schema-type": ["./packages/schema-type/src/typescript/index.ts"],
"@latticexyz/schema-type/*": ["./packages/schema-type/src/typescript/exports/*"],
"@latticexyz/schema-type/deprecated/*": ["./packages/schema-type/src/typescript/deprecated/*"],
"@latticexyz/store": ["./packages/store/ts/exports/index.ts"],
"@latticexyz/store/mud.config": ["./packages/store/mud.config.ts"],
"@latticexyz/store/codegen": ["./packages/store/ts/codegen/index.ts"],
"@latticexyz/store/config": ["./packages/store/ts/config/index.ts"],
"@latticexyz/store/config/v2": ["./packages/store/ts/config/v2/index.ts"],
"@latticexyz/store/register": ["./packages/store/ts/register/index.ts"],
"@latticexyz/store/*": ["./packages/store/ts/exports/*.ts"],
"@latticexyz/store-sync/*": ["./packages/store-sync/src/*"],
"@latticexyz/utils": ["./packages/utils/src/index.ts"],
"@latticexyz/world": ["./packages/world/ts/exports/index.ts"],
"@latticexyz/world/mud.config": ["./packages/world/mud.config.ts"],
"@latticexyz/world/codegen": ["./packages/world/ts/codegen/index.ts"],
"@latticexyz/world/config/v2": ["./packages/world/ts/config/v2/index.ts"],
"@latticexyz/world/register": ["./packages/world/ts/register/index.ts"],
"@latticexyz/world/node": ["./packages/world/ts/node/index.ts"],
"@latticexyz/world/out/*": ["./packages/world/out/*"],
"@latticexyz/world/*": ["./packages/world/ts/exports/*.ts"]
}
"sourceMap": true
},
"exclude": ["**/dist", "**/node_modules", "**/docs", "**/e2e"]
}
47 changes: 47 additions & 0 deletions tsconfig.paths.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"compilerOptions": {
"paths": {
"@latticexyz/abi-ts": ["./packages/abi-ts/src/index.ts"],
"@latticexyz/block-logs-stream": ["./packages/block-logs-stream/src/index.ts"],
"@latticexyz/cli": ["./packages/cli/src/index.ts"],
"@latticexyz/common/actions": ["./packages/common/src/actions/index.ts"],
"@latticexyz/common/chains": ["./packages/common/src/chains/index.ts"],
"@latticexyz/common/codegen": ["./packages/common/src/codegen/index.ts"],
"@latticexyz/common/errors": ["./packages/common/src/errors/index.ts"],
"@latticexyz/common/foundry": ["./packages/common/src/foundry/index.ts"],
"@latticexyz/common/type-utils": ["./packages/common/src/type-utils/index.ts"],
"@latticexyz/common/utils": ["./packages/common/src/utils/index.ts"],
"@latticexyz/common/kms": ["./packages/common/src/exports/kms.ts"],
"@latticexyz/config": ["./packages/config/src/exports/index.ts"],
"@latticexyz/config/*": ["./packages/config/src/exports/*.ts"],
"@latticexyz/config/node": ["./packages/config/src/deprecated/node"],
"@latticexyz/config/library": ["./packages/config/src/deprecated/library"],
"@latticexyz/config/register": ["./packages/config/src/deprecated/register"],
"@latticexyz/gas-report": ["./packages/gas-report/ts/index.ts"],
"@latticexyz/protocol-parser": ["./packages/protocol-parser/src/index.ts"],
"@latticexyz/protocol-parser/*": ["./packages/protocol-parser/src/exports/*"],
"@latticexyz/react": ["./packages/react/src/index.ts"],
"@latticexyz/recs": ["./packages/recs/src/index.ts"],
"@latticexyz/schema-type": ["./packages/schema-type/src/typescript/index.ts"],
"@latticexyz/schema-type/*": ["./packages/schema-type/src/typescript/exports/*"],
"@latticexyz/schema-type/deprecated/*": ["./packages/schema-type/src/typescript/deprecated/*"],
"@latticexyz/store": ["./packages/store/ts/exports/index.ts"],
"@latticexyz/store/mud.config": ["./packages/store/mud.config.ts"],
"@latticexyz/store/codegen": ["./packages/store/ts/codegen/index.ts"],
"@latticexyz/store/config": ["./packages/store/ts/config/index.ts"],
"@latticexyz/store/config/v2": ["./packages/store/ts/config/v2/index.ts"],
"@latticexyz/store/register": ["./packages/store/ts/register/index.ts"],
"@latticexyz/store/*": ["./packages/store/ts/exports/*.ts"],
"@latticexyz/store-sync/*": ["./packages/store-sync/src/*"],
"@latticexyz/utils": ["./packages/utils/src/index.ts"],
"@latticexyz/world": ["./packages/world/ts/exports/index.ts"],
"@latticexyz/world/mud.config": ["./packages/world/mud.config.ts"],
"@latticexyz/world/codegen": ["./packages/world/ts/codegen/index.ts"],
"@latticexyz/world/config/v2": ["./packages/world/ts/config/v2/index.ts"],
"@latticexyz/world/register": ["./packages/world/ts/register/index.ts"],
"@latticexyz/world/node": ["./packages/world/ts/node/index.ts"],
"@latticexyz/world/out/*": ["./packages/world/out/*"],
"@latticexyz/world/*": ["./packages/world/ts/exports/*.ts"]
}
}
}

0 comments on commit 47f736d

Please sign in to comment.