JoshuaKGoldberg/create-typescript-app

๐Ÿ› Bug: Knip schema should be synced to the package's specific version

Closed this issue ยท 5 comments

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Expected

There should be no dependencies in this project on external network requests for core dev functionality.

Actual

"$schema": "https://unpkg.com/knip@latest/schema.json",

Additional Info

@atilafassina mentioned this to me in DM and I agree.

๐Ÿ’–

Co-authored-by: @atilafassina

The reasoning is that unpkg is hardcoded to latest, so it can go out-of-sync if there's a change in schema for a future version and the client app isn't up-to-date.

But using node_modules can be tricky if CTA is used in a monorepo context.

So, perhaps the default should be the sibling node_modules but there should be a new prompt asking for a the node_modules path.

Yeah monorepo context is ... hard. #1064 is still pending. For now I think it's fine to not support it.

For visibility, I plan on doing a big overhaul in #1181 and monorepo support is not going to happen this year.

@all-contributors please add @atilafassina for bug.

๐Ÿค– Beep boop! This comment was added automatically by all-contributors-auto-action.
Not all contributions can be detected from Git & GitHub alone. Please comment any missing contribution types this bot missed.
...and of course, thank you for contributing! ๐Ÿ’™

@JoshuaKGoldberg

I've put up a pull request to add @atilafassina! ๐ŸŽ‰

I couldn't determine any contributions to add, did you specify any contributions?
Please make sure to use valid contribution names.

Welp, https://stackoverflow.com/questions/56712169/how-to-set-a-schema-in-node-modules-as-a-schema:

JSON Schema does not specify a way to do this.

Any way you want to do this needs to be supported by the IDE in question.

...and microsoft/vscode#149461:

Sorry, we have no plans to work on such a feature.

๐Ÿ˜ž

We'll have to go through the exact version set in package.json for Knip.