Skip to content
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

Stop using relative module imports #332

Merged
merged 1 commit into from
Sep 5, 2023
Merged

Stop using relative module imports #332

merged 1 commit into from
Sep 5, 2023

Conversation

dabreegster
Copy link
Contributor

@yongrenjie pointed me at this awesome trick, which'll let us stop using relative paths for imports and instead treat src/ as our root. This would make changing directory structure way easier. Pete, if this sample change looks good and it works in your IDE, I'll make it everywhere!

@Pete-Y-CS
Copy link
Contributor

This looks amazing! Will have a quick look locally but I don't see why it would be an issue! Sure I can make VSCode work with it

@Pete-Y-CS
Copy link
Contributor

Yup gave it a quick test drive! Fire at will!

@dabreegster dabreegster marked this pull request as ready for review September 5, 2023 15:02
@dabreegster
Copy link
Contributor Author

Alright, used pretty much everywhere, except in a few cases for "package private" stuff. Manual testing shows no behavioral diff. Once playwright tests pass, I'll merge.

As a future followup, I'd like to consider moving most things in src/*ts into src/lib. There's not a great reason for the separation right now, and importing from "types", "stores", etc feels confusingly like it could be an NPM package.

@dabreegster dabreegster merged commit 8a05181 into main Sep 5, 2023
2 checks passed
@dabreegster dabreegster deleted the import_abs_paths branch September 5, 2023 15:10
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