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

Turborepo support #557

Merged
merged 39 commits into from
Oct 25, 2022
Merged

Turborepo support #557

merged 39 commits into from
Oct 25, 2022

Conversation

aleksrutins
Copy link
Contributor

closes #456

This PR adds Turborepo support to Nixpacks.

  • Tests are added/updated if needed
  • Docs are updated if needed

examples/fsharp-api/obj/fsac.cache Outdated Show resolved Hide resolved
examples/fsharp-cli/obj/fsac.cache Outdated Show resolved Hide resolved
@AhmedMozaly AhmedMozaly added release/minor Author minor release new provider Add support for a new language labels Sep 16, 2022
Copy link
Collaborator

@Milo123459 Milo123459 left a comment

Choose a reason for hiding this comment

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

I've added some changes to dependsOn, making it snake case, so if you apply one, the other suggestions need to be applied. Good work so far!

docs/pages/docs/providers/node.md Outdated Show resolved Hide resolved
docs/pages/docs/providers/node.md Outdated Show resolved Hide resolved
src/providers/node/turborepo.rs Outdated Show resolved Hide resolved
src/providers/node/turborepo.rs Outdated Show resolved Hide resolved
src/providers/node/mod.rs Outdated Show resolved Hide resolved
src/providers/node/mod.rs Outdated Show resolved Hide resolved
aleksrutins and others added 5 commits September 17, 2022 12:24
Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com>
Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com>
Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com>
src/providers/node/mod.rs Outdated Show resolved Hide resolved
src/providers/node/mod.rs Outdated Show resolved Hide resolved
This also affects the NX provider.
src/providers/node/mod.rs Outdated Show resolved Hide resolved
src/providers/node/mod.rs Outdated Show resolved Hide resolved
src/providers/node/turborepo.rs Show resolved Hide resolved
@Milo123459
Copy link
Collaborator

Could you fix conflicts please?

@productdevbook
Copy link

productdevbook commented Sep 26, 2022

new version 1.5.1 and 1.5.0 -> https://turborepo.org/docs/handbook/deploying-with-docker#the-solution prune support

@Milo123459
Copy link
Collaborator

@aleksrutins any updates?

Copy link
Contributor

@coffee-cup coffee-cup left a comment

Choose a reason for hiding this comment

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

This is looking good! Just a few comments/questions. I am mainly concerned with breaking existing Turbo apps that are being built with Nixpacks currently. In all cases that we can't find a Turbo specific command, we should fallback to the default Node provider behaviour (for the most part this PR does that, just had a few questions in some places).

src/providers/node/mod.rs Outdated Show resolved Hide resolved
src/providers/node/mod.rs Outdated Show resolved Hide resolved
src/providers/node/turborepo.rs Outdated Show resolved Hide resolved
src/providers/node/mod.rs Outdated Show resolved Hide resolved
src/providers/node/mod.rs Show resolved Hide resolved
src/providers/node/mod.rs Outdated Show resolved Hide resolved
tests/generate_plan_tests.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@coffee-cup coffee-cup left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks again for adding this 😄

src/providers/node/mod.rs Show resolved Hide resolved
@coffee-cup coffee-cup merged commit 31f77e0 into railwayapp:main Oct 25, 2022
@wladpaiva
Copy link

Any docs for this?

@aleksrutins
Copy link
Contributor Author

Any docs for this?

See: https://nixpacks.com/docs/providers/node

@wladpaiva
Copy link

Has it been tested with PNPM? I'm getting a weird error during the build phase

Screenshot 2022-12-01 at 9 55 00 am

@AlfreddGco
Copy link

AlfreddGco commented Jan 23, 2025

It seems like this is not working for pnpm (at least for me). After looking a bit into the code and the output of nixpacks it would seem like it prioritizes pnpm over turbo and outputs pnpm command for build instead of turbo command, and hence, it doesn't find the "start" command of the target app in my monorepo

EDIT:
Found the issue. When turborepo.rs tries to read turbo.json, it looks for "pipeline" but turbo uses "tasks" since version 1.7. Although a clear error is not thrown; nixpacks will just say that it didn't find the start command or something like that. Neither I found on the documentation that only turbo < v1.7 is supported.

Possbile fixes:

  • downgrade your turbo to v1.6
  • Add support for "tasks" on this repo (although not sure if we just need to support that json key or if it implies implementing other stuff to support turbo >= v1.7. I created a PR here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new provider Add support for a new language release/minor Author minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

First class support for Turborepo
8 participants