-
Notifications
You must be signed in to change notification settings - Fork 173
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
fix(templates): fix templates tsc errors and add test #2036
Changes from 6 commits
003e2b7
76b54b6
563f079
9455328
b675f08
cf533e5
c82181a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Setup prerequisites | ||
description: Setup pnpm, Node.js, and Foundry | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.x | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .nvmrc | ||
registry-url: https://registry.npmjs.org | ||
cache: pnpm | ||
|
||
- name: Setup foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Test published packages | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
tag-or-version: | ||
required: true | ||
type: string | ||
workflow_dispatch: | ||
inputs: | ||
tag-or-version: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
test-create-mud-project: | ||
name: Test create-mud project | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
template: [vanilla, react, react-ecs, phaser, threejs] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
sparse-checkout: .github | ||
|
||
- name: Setup | ||
uses: ./.github/actions/setup-prerequisites | ||
|
||
- name: Test | ||
run: | | ||
pnpm create mud@${{ inputs.tag-or-version }} project --template ${{ matrix.template }} | ||
pnpm --dir project run test |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -24,6 +24,7 @@ | |||||||||
"viem": "1.14.0" | ||||||||||
}, | ||||||||||
"devDependencies": { | ||||||||||
"@types/react-dom": "18.2.7", | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume any TS errors here come from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for your review! dev-tools is compiled into JS files, but I confirmed that TS files are referred to by template projects based on their tsconfig.json. mud/packages/dev-tools/package.json Lines 12 to 15 in c8ffd09
With moduleResolution: node/node10, the types field is prioritized over the exports field. Other templates, except for vanilla, already include |
||||||||||
"vite": "^4.2.1", | ||||||||||
"wait-port": "^1.0.4" | ||||||||||
} | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
likewise here, I don't think we're using any of these packages directly, but getting this via the cli dep?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cli is not relevant to this diff.
prettier and debug are added as dependencies at the workspace root because both contracts and client require them. Similarly, typescript is also a dependency in the workspace root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And both contracts and client use the TS files from common (via typesVersions), and common uses prettier and debug.