Skip to content

Add knip + initial config #469

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

Closed
wants to merge 1 commit into from

Conversation

webpro
Copy link
Contributor

@webpro webpro commented Mar 26, 2025

Hi there! Coming from https://bsky.app/profile/flipvh.bsky.social/post/3llc7vid6bk2j.

This enables to run pnpm knip from the root of the project. The initial results seem promising.

Unfortunately, path aliases in config files aren't supported so I rewrote two imports.

Not sure how to set environments properly? I tried to import 'dotenv/config'; but that doesn't seem to do the trick. Once we got environment variables loaded we can remove backend from ignoreWorkspaces.

@cellajs cellajs deleted a comment from netlify bot Mar 27, 2025
@flipvh
Copy link
Contributor

flipvh commented Mar 27, 2025

thats great @webpro , thnks! I had some rough moments with getting it working with just dotenv a while back so resorted to use @dotenv-run/core: https://www.npmjs.com/package/@dotenv-run/core. I can't remember exactly what were the complications but could again have been related to the aliases and the way the frontend imports some of the backend schemas (and by extension typescript likes the env variables to be present?) .. 😵 . Maybe I should just drop the aliases in the backend... its used here:

dotenv({

@webpro
Copy link
Contributor Author

webpro commented Mar 27, 2025

Yeah I'm not too familiar with the codebase goals and specifics, so I won't prescribe how to run the show with regards to environment variables.

Path aliases should generally not be an issue at all when using knip-bun over knip.

Feel free to mention me here, in other PRs, Discord, you can AMA.

@flipvh flipvh force-pushed the chore/introduce-knip branch from ee81a02 to 5c941e3 Compare April 15, 2025 07:33
@flipvh
Copy link
Contributor

flipvh commented Apr 15, 2025

Merged it #485 ! Will revisit the issue for the backend once I have some time, its already looking pretty useful for the frontend!

@flipvh flipvh closed this Apr 15, 2025
@webpro webpro deleted the chore/introduce-knip branch April 15, 2025 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants