-
Notifications
You must be signed in to change notification settings - Fork 44
Don't treat mts/cts files as config files by using same check as dt-tools #488
Don't treat mts/cts files as config files by using same check as dt-tools #488
Conversation
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 adds 1000 lines to the package-json; I can copy the glob out instead if that feels better. I doubt it will change.
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.
Slightly better after refactoring dt-tools, but still pulling in stuff. Maybe that's okay.
@@ -9,7 +9,7 @@ | |||
"responseComments": [ | |||
{ | |||
"tag": "welcome", | |||
"status": "@andrewbranch Thank you for submitting this PR!\n\n***This is a live comment which I will keep updated.***\n\n## 3 packages in this PR\n\n* `ansicolors` — [on npm](https://www.npmjs.com/package/ansicolors), [on unpkg](https://unpkg.com/browse/ansicolors@latest/)\n* `cardinal` (*new!*) — [on npm](https://www.npmjs.com/package/cardinal), [on unpkg](https://unpkg.com/browse/cardinal@latest/)\n - 1 added owner: ✎@andrewbranch\n - Config files to check:\n - [`cardinal/tslint.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/67090/files/bb7d42f514b9f9cfca6b9a84dc99fac76ac35643#diff-9f471f9ba6ffa73024ae9aeb049dd98078364c565db83ee831e0498cbb678d67): edited\n* `marked-terminal` — [on npm](https://www.npmjs.com/package/marked-terminal), [on unpkg](https://unpkg.com/browse/marked-terminal@latest/)\n - Config files to check:\n - [`marked-terminal/index.d.cts`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/67090/files/bb7d42f514b9f9cfca6b9a84dc99fac76ac35643#diff-5e4cfea677a3d26cff8f1c90abf32caa2f3c310beee12f6f84364821c728aef6): edited\n - [`marked-terminal/marked-terminal-tests.cts`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/67090/files/bb7d42f514b9f9cfca6b9a84dc99fac76ac35643#diff-c57707862a9de137333983d3c0ee294d8a046f4f23a7e2557f7c4f4c77529dd7): edited\n\n## Code Reviews\n\nThis PR adds a new definition, so it needs to be reviewed by a DT maintainer before it can be merged.\n\nYou can test the changes of this PR [in the Playground](https://www.typescriptlang.org/play/?dtPR=67090&install-plugin=playground-dt-review).\n\n## Status\n\n * ✅ No merge conflicts\n * ❌ Continuous integration tests have failed\n * 🕐 Only a DT maintainer can approve changes when there are new packages added\n\nOnce every item on this list is checked, I'll ask you for permission to merge and publish the changes.\n\n----------------------\n... diagnostics scrubbed ..." | |||
"status": "@andrewbranch Thank you for submitting this PR!\n\n***This is a live comment which I will keep updated.***\n\n## 3 packages in this PR\n\n* `ansicolors` — [on npm](https://www.npmjs.com/package/ansicolors), [on unpkg](https://unpkg.com/browse/ansicolors@latest/)\n* `cardinal` (*new!*) — [on npm](https://www.npmjs.com/package/cardinal), [on unpkg](https://unpkg.com/browse/cardinal@latest/)\n - 1 added owner: ✎@andrewbranch\n - Config files to check:\n - [`cardinal/tslint.json`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/67090/files/bb7d42f514b9f9cfca6b9a84dc99fac76ac35643#diff-9f471f9ba6ffa73024ae9aeb049dd98078364c565db83ee831e0498cbb678d67): edited\n* `marked-terminal` — [on npm](https://www.npmjs.com/package/marked-terminal), [on unpkg](https://unpkg.com/browse/marked-terminal@latest/)\n - Config files to check:\n - [`marked-terminal/marked-terminal-tests.cts`](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/67090/files/bb7d42f514b9f9cfca6b9a84dc99fac76ac35643#diff-c57707862a9de137333983d3c0ee294d8a046f4f23a7e2557f7c4f4c77529dd7): edited\n\n## Code Reviews\n\nThis PR adds a new definition, so it needs to be reviewed by a DT maintainer before it can be merged.\n\nYou can test the changes of this PR [in the Playground](https://www.typescriptlang.org/play/?dtPR=67090&install-plugin=playground-dt-review).\n\n## Status\n\n * ✅ No merge conflicts\n * ❌ Continuous integration tests have failed\n * 🕐 Only a DT maintainer can approve changes when there are new packages added\n\nOnce every item on this list is checked, I'll ask you for permission to merge and publish the changes.\n\n----------------------\n... diagnostics scrubbed ..." |
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.
Looks like we need to account for non-declaration test files too:
- Config files to check:\n - [
marked-terminal/marked-terminal-tests.cts
]
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.
Aha, yes.
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.
There's even more weird edge cases here... may do a little refactoring to fix them.
} | ||
|
||
if (isDeclarationPath(path)) return [pkg, { path, kind: "definition" }]; | ||
if (/\.[cm]?tsx?$/.test(path)) return [pkg, { path, kind: "test" }]; |
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.
Any concern that this allows mtsx
? Seems benign but I have to ask
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 guess it does, but something else will error. But, I'll fix the regex.
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.
Noticed on DefinitelyTyped/DefinitelyTyped#68772 that cts/mts files are being considered config files. That's not right.