-
Notifications
You must be signed in to change notification settings - Fork 181
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
build: use tsup and do not bundle dependencies #660
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
tsup looks much more convenient for our use-case. The config is simplified, no plugins and noExternal
hacks
packages/store/package.json
Outdated
"ds-test": "https://github.com/dapphub/ds-test.git#c9ce3f25bde29fc5eb9901842bf02850dfd2d084", | ||
"ethers": "^5.7.2", | ||
"forge-std": "https://github.com/foundry-rs/forge-std.git#b4f121555729b3afb3c5ffccb62ff4b6e2818fd3" |
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.
I think ds-test and forge can be devDeps as they're just for tests? (console is also imported in normal files, but that's just for debugging and should be eventually removed)
packages/world/package.json
Outdated
"ds-test": "https://github.com/dapphub/ds-test.git#c9ce3f25bde29fc5eb9901842bf02850dfd2d084", | ||
"ethers": "^5.7.2", | ||
"forge-std": "https://github.com/foundry-rs/forge-std.git#b4f121555729b3afb3c5ffccb62ff4b6e2818fd3" |
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.
(same here with devDeps)
packages/world/vite.config.ts
Outdated
}, | ||
plugins: [peerDepsExternal()] as any, | ||
}); | ||
export default defineConfig({}); |
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.
You could just remove this file vitest doesn't need a config
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.
are we even using vitest here? I see the dev dep but I don't see it being used
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.
removed in a276ffd
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.
yep it's unused. Vitest was only for config, which is now in its own package
@@ -1,3 +1,4 @@ | |||
/* eslint-disable @typescript-eslint/no-explicit-any */ |
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.
not blocking but I would prefer to not use whole-file disables
we should either 1) decide to disable this globally or 2) ignore individual lines/usages
(I tend to go with the latter)
entry: ["src/index.ts", "src/mud.ts", "src/mud2.ts"], | ||
target: "esnext", | ||
format: ["esm"], | ||
dts: false, |
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.
is dts not needed when doing tsup in this way? or is it because cli doesn't have anything to export aside from bins?
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.
from @dk1a
I don't think we do, since package.json now has "types": "src/index.ts", so the sources themselves replaces dts
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.
thank you for tackling this!
peerDependencies
unless actually necessarytsup
(fromvite
), sincetsup
is 1. faster and 2. the more natural choice for libraries (vite is more focussed on end-user apps/websites and needs more configuration thantsup
if the goal is to bundle a library)