brianzinn / react-babylonjs

React for Babylon 3D engine
https://brianzinn.github.io/react-babylonjs/
818 stars 105 forks source link

Migrate to yarn workspaces #187

Closed benallfree closed 2 years ago

benallfree commented 2 years ago

This is just a file move PR, no code changes.

Down the road, maybe consider a @react-babylonjs package namespace like @react-babylonjs/core so that we can have @react-babylonjs/docs and other packages that might emerge in the future such as @react-babylonjs/xr or whatever :)

brianzinn commented 2 years ago

you are one step ahead of me again!! for v4 there will be a library to accompany each non-core @babylonjs project (gui/materials/etc.). This will break my github workflows and maybe gitub release notes integration, but I will work that out.

brianzinn commented 2 years ago

ugghh! - i need to fix the readme! 😄

benallfree commented 2 years ago

Storybook build is broken too :/

Do we need to fix it?

brianzinn commented 2 years ago

it's OK - i will try to get to it tonight. i'm at ski hill today, so no computer.

benallfree commented 2 years ago

Looking a little deeper, I think it's the main.js aliases plus the spring package referring to a 2.x version of react-babylonjs 🤯

I'll leave it to you. If you have issues it might help to move it out of the workspaces so yarn doesn't hoist the node_modules.

brianzinn commented 2 years ago

I think the spring package is a warning on a peer dependency and is OK. I'll dig into it tonight- I need to keep the storybook for when I want to test out using a build that's local and not in NPM. It can be done with npm link, but need to use the same react version, so it's a bit of a pain to setup otherwise if anybody wants to contribute and easily test. if moving it down to root works i will probably do that - webpack just links the alias to a folder.

benallfree commented 2 years ago

Yarn workspaces should solve that problem. For some reason it was complaining about not finding packages, even after I reset the aliases.

benallfree commented 2 years ago

Good point though, for local dev that codesandbox should change to running a local component. I’ll look into that.

If we had that, would you still want storybook?

brianzinn commented 2 years ago

if the samples in gatsby could run off the local build then I have no use for storybook - it's that the code sandboxes are running off on NPM public repo. Do you know a way around that without publishing?

benallfree commented 2 years ago

Yes we can definitely come up with something that runs the component locally instead of embedding a codesandbox iframe for local dev.