-
Notifications
You must be signed in to change notification settings - Fork 11
Migrate to tsdown #390
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
Migrate to tsdown #390
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
aac7e83 to
1b7f800
Compare
package.json
Outdated
| "typesync": "typesync --dry=fail", | ||
| "typecheck": "turbo run typecheck", | ||
| "knip": "knip", | ||
| "knip": "knip --treat-config-hints-as-errors", |
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.
Just slipping this in (I requested this in webpro-nl/knip#891).
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 would have preferred this as a config option (in the config file, i mean), but it's fine either way.
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.
Agreed, see webpro-nl/knip#1026.
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.
Ha, and then he added it :)
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.
we will wait for him to add this as a config option in the next release. I prefer it.
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 filed #397, I'll revert this from this PR.
| "knip": "knip", | ||
| "knip": "knip --treat-config-hints-as-errors", | ||
| "validate-config": "turbo run validate-config", | ||
| "merge-checks": "pnpm build && turbo run publint manypkg typesync knip typecheck lint validate-config are-the-types-wrong && pnpm check-deduped-deps", |
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.
Yay, this hack is done!
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.
this wasn't a hack. This was here to check if the build was passing before doing the lints and the tests.
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.
Build is called as part of merge-checks (except for docs), putting it before is antithetical to turbo (i.e., the tasks are misconfigured), and slower.
If you'd like it reverted, I will, but I don't see why this would be the desired behavior.
| "knip": "knip", | ||
| "knip": "knip --treat-config-hints-as-errors", | ||
| "validate-config": "turbo run validate-config", | ||
| "merge-checks": "pnpm build && turbo run publint manypkg typesync knip typecheck lint validate-config are-the-types-wrong && pnpm check-deduped-deps", |
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.
this wasn't a hack. This was here to check if the build was passing before doing the lints and the tests.
package.json
Outdated
| "typesync": "typesync --dry=fail", | ||
| "typecheck": "turbo run typecheck", | ||
| "knip": "knip", | ||
| "knip": "knip --treat-config-hints-as-errors", |
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.
we will wait for him to add this as a config option in the next release. I prefer it.
1b7f800 to
5d6c227
Compare
5d6c227 to
3067289
Compare
3067289 to
d4bea46
Compare
4036b54 to
1ee7d45
Compare
1ee7d45 to
5217d0f
Compare
| - esbuild | ||
| - rolldown | ||
| - sharp | ||
| - unrs-resolver |
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.
missing: "@tailwindcss/oxide"
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.
It's not rebased on main, oxide isn't needed (yet)?
| "composite": false, | ||
| "target": "ESNext", | ||
| "module": "Preserve", | ||
| "module": "ESNext", |
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.
this needs to be removed
| platform: 'node', | ||
| clean: true, | ||
| sourcemap: false, | ||
| skipNodeModulesBundle: true, |
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.
We can remove this.
| entry: ['./src/index.ts'], | ||
| format: 'esm', | ||
| target: 'node20', | ||
| platform: 'node', |
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.
This is the default. We can remove this.
| { | ||
| "$schema": "https://json.schemastore.org/tsconfig", | ||
| "include": ["src", "eslint.config.ts"], | ||
| "exclude": ["dist", "build", "node_modules"], |
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.
im not entirely sure why you removed the "excludes", but we want to keep them.
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.
They're already inherited from the base tsconfig, I think?
| import { defineConfig } from 'tsdown'; | ||
|
|
||
| export default defineConfig({ | ||
| entry: ['./src/index.ts'], |
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.
This is the default. We can remove this.
| "typecheck": "tsc", | ||
| "lint": "eslint ./src --max-warnings=0", | ||
| "publint": "publint" | ||
| "prepare": "pnpm build" |
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.
what's this?
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.
Fixed the missing bin warning.
| }, | ||
| }, | ||
| }); | ||
| { ignores: ['tsdown.config.ts'] }, |
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.
This file doesn't need to be modified at all.
| export const allJsExtensions: string = `${jsExtensions},${tsExtensions}`; | ||
|
|
||
| export const allJsxExtensions = `${jsxExtensions},${tsxExtensions}`; | ||
| export const allJsxExtensions: string = `${jsxExtensions},${tsxExtensions}`; | ||
|
|
||
| export const supportedFileTypes = `**/*{${allJsExtensions},${allJsxExtensions},astro}`; | ||
| export const supportedFileTypes: string = `**/*{${allJsExtensions},${allJsxExtensions},astro}`; | ||
|
|
||
| export const testsFilePatterns = [ | ||
| export const testsFilePatterns: string[] = [ | ||
| `**/*.{test,spec}.{${allJsExtensions}}`, | ||
| `**/tests/**/*.{${allJsExtensions}}`, | ||
| `**/__tests__/**/*.{${allJsExtensions}}`, | ||
| ] as const; | ||
|
|
||
| export const ignores = [ | ||
| export const ignores: string[] = [ |
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.
unneded changes.
|
I'm no longer actively using Sheriff (Writing deputy1), and am busy IRL anyway. I'd be happy to finish this up someday, but I doubt I'll find the time anytime soon, so feel free to do it yourself or just stick with tsup. Footnotes
|
Alrighty, got it 👍 |
|
@lishaduck Im excited so see how your solution for optional deps turns out! Its tricky stuff for sure! |
Thanks! It was working pretty well except for some stuff with typechecked rule configs, which didn't like the monorepo. There's some momentum there, so 🤞 I can get back to work on it soon. |
Related Issue
Closes #388.
Other