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

Move node dependencies out of commons and engine #2500

Merged
merged 28 commits into from
Jul 13, 2024

Conversation

AndreasArvidsson
Copy link
Member

@AndreasArvidsson AndreasArvidsson commented Jul 12, 2024

This is all about getting node out of commons. A lot of our file system interaction had to do with running tests and reading/writing test fixtures so I created a separate node test package.

To avoid circular dependencies I had to move a bunch of types from the engine to commons. This make it so we now have changes in imports in a bunch of different files. Most of the changes are quite mechanical or boilerplate. The only actual new code is the two storage providers to ScopeTestRecorder and TestCaseRecorder. The latter one is quite lacking in implementation. This is just about unblocking cursorless everywhere. A better abstraction is something we can workshop together.

And before you ask: no I can't split this into smaller pr. It feels like a small miracle that I could solve all of the circular dependency problems I had already :)

I wonder if we in a follow up want to move everything test related to the test package? Generally I prefer to have test as close to the source code as possible but in this case it's getting problematic to keeping track of all the dependencies. If we had a test package we could make sure that a lot of the dependencies only existed in that package and we could add lint rules preventing them in the other packages.

Checklist

  • [/] I have added tests
  • [/] I have updated the docs and cheatsheet
  • [/] I have not broken the cheatsheet

@@ -46,7 +46,7 @@ export class NormalizedIDE extends PassthroughIDEBase {
hatStability: this.configuration.getOwnConfiguration(
"experimental.hatStability",
),
snippetsDir: getFixturePath("cursorless-snippets"),
snippetsDir: this.cursorlessSnippetsDir,
Copy link
Member Author

@AndreasArvidsson AndreasArvidsson Jul 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation I'm not quite happy with. The problem is that normalized ide is used in the extension bundle and uses a environment fixture path. I will happily take any suggestions here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean NormalizedIDE is really test / dev code, so probalby shouldn't be in engine / common. But I'm ok with this for now

@AndreasArvidsson AndreasArvidsson changed the title Added node test package Added node test and test recorder packages Jul 13, 2024
@AndreasArvidsson AndreasArvidsson changed the title Added node test and test recorder packages Move node dependencies out of commons and engine Jul 13, 2024
Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a couple tweaks. Seemed better to check for relative in the engine for consistency. Merge if you're happy with my changes https://github.com/cursorless-dev/cursorless/pull/2500/files/cd71783e6aa8f73e026a7e46e6b2d78e8c867cc5..73a2f35febe5af8362c2f982070d1f28f805acd8

@AndreasArvidsson
Copy link
Member Author

Looks good. Thanks for reviewing this many changes so quickly :)

@AndreasArvidsson AndreasArvidsson added this pull request to the merge queue Jul 13, 2024
Merged via the queue into main with commit b9590b4 Jul 13, 2024
15 checks passed
@AndreasArvidsson AndreasArvidsson deleted the testRecorderProvider branch July 13, 2024 14:04
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.

None yet

2 participants