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

Turbo-ize #164

Merged
merged 8 commits into from
Jun 22, 2024
Merged

Turbo-ize #164

merged 8 commits into from
Jun 22, 2024

Conversation

lishaduck
Copy link
Contributor

@lishaduck lishaduck commented Jun 22, 2024

Depends on #163
Relates to #156

npm-run-all kept acting up, so I went ahead and migrated elm-review to turbo.
Key things: everything is parallelized now. It's also cached.

To run tasks, use turbo ... instead of npm run ..., which is installable via npm install -g turbo
You can also use npx turbo. They both run using our pinned turbo, the global one just proxies to the local one.
And, of course, you can still run npm run ..., it just won't get cached.

If you want to add a task, just add it in the package.json. It'll automatically get cached. If you find it gets invalidated too much, you can add it to turbo.json.

Here's the diff as GH doesn't play well with stacks from forks: lishaduck/node-elm-review@bump-deps-2...turbo
I also updated CI. I hope you don't mind.

TS 5.5 infers predicates when they're more explicit.
Bumps everything but Jest to the latest version supporting Node 16.
Node 14 is required now.
Copy link

@lishaduck lishaduck mentioned this pull request Jun 22, 2024
Copy link
Owner

@jfmengels jfmengels left a comment

Choose a reason for hiding this comment

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

Thank you for the PR. I'm willing to try turbo out.

Can you tell me where I can find the docs for turbo? I'm having trouble finding it.
It's at https://turbo.build/repo/docs
I kept getting confused because I though turbo was a different tool than turborepo.

Do you also know if there's a way to not have the interactive window showing up? Mostly out of curiosity.

npm-run-all kept acting up

Do you remember what kind of problems you were encountering?

@@ -9,16 +9,13 @@
"packageManager": "[email protected]",
"scripts": {
"elm-format": "elm-format --validate ast-codec init-templates new-package parseElm review template",
"test": "npm-run-all --print-name --silent elm-tests elm-format tsc eslint-check prettier-check test-run",
Copy link
Owner

Choose a reason for hiding this comment

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

Do you know if it's possible to keep a test script so that I can just run npm test ?

@jfmengels jfmengels merged commit 6755630 into jfmengels:main Jun 22, 2024
3 checks passed
@lishaduck
Copy link
Contributor Author

Can you tell me where I can find the docs for turbo? I'm having trouble finding it. It's at https://turbo.build/repo/docs I kept getting confused because I though turbo was a different tool than turborepo.

Yeah. turbo is the cli, which came first. Then they made turbopack, so they retroactively named it turborepo, but they share a cli (well, they will eventually).

Do you also know if there's a way to not have the interactive window showing up? Mostly out of curiosity.

The --log-order flag. You can pass either --log-order=grouped or --log-order=stream.
stream is essentially npm-run-all

npm-run-all kept acting up

Do you remember what kind of problems you were encountering?

It wasn't injecting node_modules/.bin into the path, so some tests were failing.

Do you know if it's possible to keep a test script so that I can just run npm test ?

Yeah. I can rename test to, say, testing, and then alias npm test to turbo testing. It's meant to be used in a monorepo where you do that for all your tasks in your root, then use turbo in the individual packages, but it works well in single package repos as well.

@lishaduck lishaduck deleted the turbo branch June 22, 2024 13:46
@jfmengels
Copy link
Owner

jfmengels commented Jun 22, 2024

I can rename test to, say, testing, and then alias npm test to turbo testing

I think this would be great. npm test (or actually npm t) is a very ingrained shortcut for me 😄

I've pushed the change now 👍

@lishaduck
Copy link
Contributor Author

If you prefer the log-order flags, I just found out you can set an env variable:
Set export TURBO_UI=0 and export TURBO_LOG_ORDER=streamed (or grouped) in your .zshrc (or .bash_profile or whatever)

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