Skip to content

Conversation

@c-ciobanu
Copy link
Contributor

@c-ciobanu c-ciobanu commented Jul 6, 2025

This allows to run additional scripts when executing yarn rw dev.
This is enabled by updating the redwood.toml, e.g.

[experimental.sides.app]
  workspace = "app"
  devScript = "android"
[experimental.dev]
  defaultSides = ["api", "app"]

Now when you run yarn rw dev it will also execute the android script present in the app workspace.
It also allows to run yarn rw dev app wich will only run the app side.

I'm not completely set on this configuration, let me know your opinion.

One small issue with this is that if you have interactive CLI scripts they will not work, cannot really be fixed with the solution in place right now.

@netlify
Copy link

netlify bot commented Jul 6, 2025

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit 41aa04b
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/686e8b8fc7dee20008d8282b

expect(generateCommand.command).toEqual('yarn rw-gen-watch')
})

it('Should run custom side', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for adding a test 🙏

@Tobbe
Copy link
Member

Tobbe commented Jul 6, 2025

Not saying we should do it like this – just a question:

Could we look at the root package.json to figure out what sides are available?

"workspaces": {
  "packages": [
    "api",
    "web"
  ]
},

So to add more sides you add another package to the list there.
And then we can use redwood.toml to configure the side

@c-ciobanu
Copy link
Contributor Author

Not saying we should do it like this – just a question:

Could we look at the root package.json to figure out what sides are available?

"workspaces": {
  "packages": [
    "api",
    "web"
  ]
},

So to add more sides you add another package to the list there. And then we can use redwood.toml to configure the side

Most of the times the workspaces are defined like ./packages/* or similar where they have multiple packages in the same folder.
Don't think is too useful for us to automatically pick up possibly a lot of "sides" depending on the packages.

@Tobbe
Copy link
Member

Tobbe commented Jul 6, 2025

This made me realize something:

Currently when you run yarn install in the root it'll also install the packages for the web and api sides.
If you add a different side, will it install the packages for that side too?

@c-ciobanu
Copy link
Contributor Author

This made me realize something:

Currently when you run yarn install in the root it'll also install the packages for the web and api sides. If you add a different side, will it install the packages for that side too?

If it's added to the workspaces yes.

c-ciobanu and others added 2 commits July 7, 2025 16:43
Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
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