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

Engine separation keep playground #672

Merged
merged 54 commits into from
Jan 26, 2024
Merged

Conversation

ErinvanderVeen
Copy link
Collaborator

@ErinvanderVeen ErinvanderVeen commented Jan 25, 2024

An attempt to implement #643 without having to deprecate the playground.

The main idea here is to vendor the git crates that we absolutely depend on for the Topiary, and eventually publishing them under the topiary-* crate.

Since this PR is very large, I want to reason about all the changes I have made:

Clippy CI phase not running on MacOS

Unfortunately there seems to be something in our Nix config/Cargo.toml that makes cargo clippy attempt to try and build the playground on MacOS. This, in combination with a undetermined bug with building the playground on MacOS, led me to disable it for now.

Building the playground on MacOS manually nix build .#topiary-playground works fine.

Removing the .vscode directory

I don't think .vscode has a place in an otherwise editor agnostic repository.

Removing the patch versions of some of our packages

Generally, Cargo will favour newer versions over older versions anyway. Assuming the packages abide to SemVer (even below 1.0) it should therefore generally not be a problem to not specify the patch level. In some cases this might ensure that we don't build duplicate versions of packages

removing the SupportedLanguages enum

This was done to make separating the topiary-config crate easier. With eyes on the future, this will also make it easier for us to maker it easier for external contributors to add language support to Topiary.

new DevShell

I got annoyed I could not build the Topiary Playground locally with cargo, so I exposed a second devShell named wasm to build wasm targets. Ideally, we would find a way to combine these.

Error changes

With topiary-config becoming its own crate, it needed its own errors. With this, I changed some of our Errors to be more in line with what is common in the Rust ecosystem, with eyes on the thiserror crate in the future.

Moving the samples and using the cli to test them

Since the core topiary crate no longer depends on all the tree-sitter grammars, this crate could no longer be responsible for the testing. All the configuration was already done in the topiary-cli crate, so I moved the sample testing there.

Vendoring the tree-sitter-* crates

We are moving to a moment where we publish topiary-core on crates.io. With this move we need to publish updated version of web-tree-sitter-sys and tree-sitter-facade. We could ask for ownership of the crates, but generally, I like prefixing them with topiary-.

This prevents people from assuming they are useful for anything else.

We might in the future ask for ownership and maintain them, but we don't have the manpower for that right now.

npm update

The puppeteer package that we use uses a package called browsers to install specific versions of chrome. Unfortunately, Google made the specific version of chrome that we used unavailable. This was long fixed upstream, so a simple npm update resolved the issue.

Erin van der Veen and others added 30 commits January 25, 2024 11:54
This includes moving the sample tests to Topiary cli (because topiary no longer knows about languages).

Additionally, bash was reverted back to an older version due to a regression that needs to be investigated.
At this point, the LanguageDefinition contained only a single value, and was thus mostly useless
@ErinvanderVeen ErinvanderVeen force-pushed the engine-separation-keep-playground branch from 8f4d1b4 to 550cba9 Compare January 25, 2024 11:49
@ErinvanderVeen ErinvanderVeen force-pushed the engine-separation-keep-playground branch 2 times, most recently from 173be1a to 5efa44a Compare January 25, 2024 13:05
Erin van der Veen added 2 commits January 25, 2024 14:05
See the comment in that module for more information.
But only if not in wasm
@ErinvanderVeen ErinvanderVeen force-pushed the engine-separation-keep-playground branch from 5efa44a to df18e4b Compare January 25, 2024 13:05
@Xophmeister
Copy link
Member

Presumably this supersedes #643

@ErinvanderVeen
Copy link
Collaborator Author

Presumably this supersedes #643

Absolutely, but I want to keep it until we are sure we can merge this.

@ErinvanderVeen ErinvanderVeen marked this pull request as ready for review January 25, 2024 16:21
@Xophmeister
Copy link
Member

0e9fba9 resolves #665? Nice 👍

@ErinvanderVeen
Copy link
Collaborator Author

0e9fba9 resolves #665? Nice 👍

Sure looks like it ;)

topiary-config/src/serde.rs Show resolved Hide resolved
topiary-config/src/source.rs Outdated Show resolved Hide resolved
topiary-playground/src/lib.rs Outdated Show resolved Hide resolved
@Xophmeister Xophmeister merged commit a30cd32 into main Jan 26, 2024
1 of 3 checks passed
@Xophmeister Xophmeister deleted the engine-separation-keep-playground branch January 26, 2024 12:20
@nbacquey nbacquey mentioned this pull request Oct 29, 2024
2 tasks
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