-
Notifications
You must be signed in to change notification settings - Fork 22
chore: migrate to tsdown #1129
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
Merged
chore: migrate to tsdown #1129
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
67639f1
refactor: tsdown
lishaduck bbabb56
chore: attw
lishaduck a024277
feat: extract out ts patching package
lishaduck 1c36ef2
Merge branch 'main'
JoshuaKGoldberg 967a64d
Merge branch 'main'
JoshuaKGoldberg 8d7351f
fix: delete tsconfig.tsbuildinfos again
lishaduck 55bcbfb
improvements
lishaduck a43eb4d
fix: knip
lishaduck 73c3a6e
fix lockfile
lishaduck e9d570a
ci: cleanup
lishaduck 7918250
fix: typechecking
lishaduck 3270fd0
chore: drop spelling because I'm here
lishaduck e7e8a06
fix: wrap test name in quotes 😂
lishaduck 3516a84
ci: create .astro before linting
lishaduck fbead69
ci: satiate the knip ✂️
lishaduck e5af340
Merge branch 'main' into tsdown
lishaduck b9acbd8
fix: let tsdown build references
lishaduck 077ff4b
ci: drop now-redundant tsc build
lishaduck 4a88c0c
chore: js isn't real
lishaduck 79705fd
Merge branch 'main' into ts-patch
lishaduck e87589b
rm tsconfig.tsbuildinfo
lishaduck 3972957
simpler
lishaduck 908a76f
chore: drop unneeded node types
lishaduck bc4e440
fix: simpler design
lishaduck 5c796d3
fix: lints
lishaduck bfe3d95
even smaller package
lishaduck d189bda
drop more typescripts
lishaduck 252d2a7
improve packaging
lishaduck 74c9865
Merge branch 'ts-patch' into tsdown
lishaduck e9a3c66
fix: references with simpler setup
lishaduck b2e9e18
fix: source map subpath
lishaduck ad79e2c
Merge branch 'ts-patch' into tsdown
lishaduck b9f6166
fix: drop entries from publishconfig
lishaduck d710005
chore: improve internal tsconfig options for improved dx (#1174)
lishaduck 8dbeb23
Revert "chore: improve internal tsconfig options for improved dx (#11…
lishaduck 675d0cd
Merge branch 'main' into tsdown
lishaduck 85e44df
Revert "chore: drop spelling because I'm here"
lishaduck b00e4df
diff
lishaduck 9b887c9
refactor: use tsconfig.test.json
lishaduck dee7258
Merge branch 'main' into tsdown
lishaduck b910535
Merge branch 'main' into tsdown
lishaduck e453268
chore: attw only in ci
lishaduck 940face
chore: add changeset
lishaduck 6d71229
chore: remove root lib from prettier
lishaduck bf64e6d
Merge branch 'main' into tsdown
lishaduck a80eda5
Merge branch 'main' into tsdown
lishaduck 58e07df
Merge branch 'main' into tsdown
lishaduck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| --- | ||
| "@flint.fyi/plugin-performance": patch | ||
| "@flint.fyi/plugin-spelling": patch | ||
| "@flint.fyi/plugin-browser": patch | ||
| "@flint.fyi/plugin-astro": patch | ||
| "@flint.fyi/plugin-flint": patch | ||
| "@flint.fyi/plugin-react": patch | ||
| "@flint.fyi/plugin-solid": patch | ||
| "@flint.fyi/comparisons": patch | ||
| "@flint.fyi/plugin-next": patch | ||
| "@flint.fyi/plugin-node": patch | ||
| "@flint.fyi/plugin-nuxt": patch | ||
| "@flint.fyi/rule-tester": patch | ||
| "@flint.fyi/plugin-jsx": patch | ||
| "@flint.fyi/ts-patch": patch | ||
| "flint": patch | ||
| "@flint.fyi/utils": patch | ||
| "@flint.fyi/core": patch | ||
| "@flint.fyi/json": patch | ||
| "@flint.fyi/site": patch | ||
| "@flint.fyi/text": patch | ||
| "@flint.fyi/yaml": patch | ||
| "@flint.fyi/cli": patch | ||
| "@flint.fyi/md": patch | ||
| "@flint.fyi/ts": patch | ||
| --- | ||
|
|
||
| chore: rework packaging with tsdown |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,6 @@ indent_style = tab | |
| end_of_line = lf | ||
| insert_final_newline = true | ||
| quote_type = double | ||
|
|
||
| [*.yaml] | ||
| indent_style = space | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,5 +2,4 @@ node_modules | |
| packages/*/.astro | ||
| packages/*/dist | ||
| packages/*/lib | ||
| tsconfig.tsbuildinfo | ||
| tsconfig.vitest-temp.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| /.all-contributorsrc | ||
| /.husky | ||
| /lib | ||
| /pnpm-lock.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,11 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "outDir": "lib", | ||
| "rootDir": "src" | ||
| "tsBuildInfoFile": "node_modules/.cache/tsbuild/info.json", | ||
| "rootDir": "src/", | ||
| "outDir": "lib/", | ||
| "types": ["node"] | ||
| }, | ||
| "extends": "../../tsconfig.base.json", | ||
| "include": ["src"], | ||
| "include": ["src", "package.json"], | ||
| "references": [{ "path": "../core" }, { "path": "../utils" }] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { defineConfig } from "tsdown"; | ||
|
|
||
| export default defineConfig({ | ||
| attw: { | ||
| enabled: "ci-only", | ||
| profile: "esm-only", | ||
| }, | ||
| clean: ["./node_modules/.cache/tsbuild/"], | ||
| dts: { build: true, incremental: true }, | ||
| entry: ["src/index.ts"], | ||
|
Member
Author
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. In addition, we should be able to use this after the next tsdown minor: exports: {
devExports: "@flint.fyi/source",
packageJson: false
}, |
||
| failOnWarn: true, | ||
| fixedExtension: false, | ||
| outDir: "lib", | ||
| unbundle: true, | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { defineConfig } from "tsdown"; | ||
|
|
||
| export default defineConfig({ | ||
| attw: { | ||
| enabled: "ci-only", | ||
| profile: "esm-only", | ||
| }, | ||
| clean: ["./node_modules/.cache/tsbuild/"], | ||
| dts: { build: true, incremental: true }, | ||
| entry: ["src/index.ts"], | ||
| failOnWarn: true, | ||
| fixedExtension: false, | ||
| outDir: "lib", | ||
| unbundle: true, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,8 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "outDir": "lib", | ||
| "rootDir": "src" | ||
| }, | ||
| "extends": "../../tsconfig.base.json", | ||
| "include": ["src"], | ||
| "references": [{ "path": "../utils" }] | ||
| "include": [], | ||
| "references": [ | ||
| { "path": "./tsconfig.src.json" }, | ||
| { "path": "./tsconfig.test.json" } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "tsBuildInfoFile": "node_modules/.cache/tsbuild/info.src.json", | ||
| "rootDir": "src/", | ||
| "outDir": "lib/", | ||
| "types": ["node"] | ||
| }, | ||
| "extends": "../../tsconfig.base.json", | ||
| "include": ["src"], | ||
| "exclude": ["src/**/*.test.ts"], | ||
| "references": [{ "path": "../utils" }] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "tsBuildInfoFile": "node_modules/.cache/tsbuild/info.test.json", | ||
| "rootDir": "src/", | ||
| "outDir": "node_modules/.cache/tsbuild/test", | ||
| "types": ["node"] | ||
| }, | ||
| "extends": "../../tsconfig.base.json", | ||
| "include": ["src/**/*.test.ts"], | ||
| "references": [{ "path": "./tsconfig.src.json" }] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
[Question] Are these necessary? Why not go with the default?
Uh oh!
There was an error while loading. Please reload this page.
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.
Yes, we require setting them to disambiguate between
,.test, &.src. Putting them innode_modules/.cache/tsbuildwas a matter of preference (to prevent #1129 (comment) and to collocate with the tsbuild output). We could totally put them in astsconfig.tsbuildinfo,tsconfig.src.tsbuildinfo,tsconfig.test.tsbuildinfo,tsconfig.bin.tsbuildinfo, but that gets noisy quickly.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.
Hmm. I was a little uneasy with the
@flint.fyi/sourceinpackage.json, and now this is a second unusual (to me?) configuration point I haven't seen used elsewhere. What is it about our setups that's forcing these unusual config options uses?Uh oh!
There was an error while loading. Please reload this page.
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.
That's fair, but I'd like to note that offical TS team recommends it as the way to use type-stripping. It's not so much unusual, it's that most projects of our scale haven't migrated to erasableSyntaxOnly, so it's only smaller projects like tinyglobby that use it (irrc tinyglobby uses it, don't quote me, I didn't double-check).
Really? tbh I'd never seen a project (before Flint) that didn't customize tsbuildinfo when using
incremental.Again, I don't think it's so much that options are unusual, it's that the projects you use and the projects I use are generally of different scales.
I was curious, so I ran a quick sourcegraph search of
tsBuildInfoFile, which returns >10k results fortsconfig.json, so, again, I don't think it's very unusual to set it, just that it might be unusual in your circles.EDIT: typescript-eslint uses it :) (not much, surprisingly. I'm curious how they do it now...) https://github.com/search?q=repo%3Atypescript-eslint%2Ftypescript-eslint%20tsBuildInfoFile&type=code
Uh oh!
There was an error while loading. Please reload this page.
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 took a closer look to see how typescript-eslint was using it, given I assume you'd be more comfortable with that approach. It looks like in typescript-eslint, y'all are doing the same thing I'm doing, but you just do it in the more centralized (and thus implicit) manner.
I don't totally love the approach y'all took to centralize it (I don't love how crowded it makes the root, for one), but now that I see how y'all did it, I think I could adapt it pretty nicely here as well.
I assume you'd like that, I'd like that too, I don't know if we want to make it block getting this in. On one hand, auvred said he'd prefer this to land before #1179, but at the same time, a followup would be equally conflicty (though less so than #1201).
I say that because I'm going to try to resist working on Flint tomorrow (gotta finish polishing my WashU app & get back to the MIT app), but we'll see. I don't see myself resisting the lure of code for more than a day though, so 🫡
G'night! Happy new years! (3 more minutes for me 🎉)
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.
Heh, I wasn't on point for setting up tseslint's tooling. That was JamesHenry. I just ramp up to review the PRs once in a while and maybe try to tweak things when they break.
This whole area isn't something I'm very ramped up on. And IMO none of this is blocking - we can always change it later!
Proposal: how about we...
I'm personally happy as long as it all works. From my perspective, it's a win-win:
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.
+1! This is a tooling setup, we can always change it at any moment if we find something we don't like. Let's merge 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.
@lishaduck whenever you feel comfortable, all you!
Uh oh!
There was an error while loading. Please reload this page.
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.
Sounds good to me!
(I am aware that there are conflicts. Feel free to fix them yourself if it's blocking something, or else I'll get it to tomorrow)
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.
Resolved conflicts. 👍🏻