cerebral / overmind

Overmind - Frictionless state management
https://overmindjs.org
MIT License
1.58k stars 95 forks source link

Move packages out of node_modules, linting fix, bug fixes #503

Closed maia-tae closed 3 years ago

maia-tae commented 3 years ago

There are 3 kinds of commits in this PR:

  1. Developper experience improvements

To ease the work of people jumping into the Overmind project, we should not ask them to tweak their editors and ways of doing things too much. For this reason, and now that we have a solution for the build system in the monorepo, it makes sense to move packages/node_modules/* to packages/*. This also simplifies build, prettier and all kinds of things that are hard to maintain.

  1. Linting

Somehow, there were many linting errors (mostly unused vars). There fixed as part of the file move operation since I could not commit without fixing them.

  1. ES2020

The modules should be built using the latest version of JS for es target. This means that things like Object.values, async/await and such are now native in this build.

  1. Bug fix

overmind-angular and overmind-react use dependencies that they do not declare. This has weird consequences in build tools such as Snowpack. The biggest issue is that react gets bundled as part of overmind-react (same could happend to angular I guess) and then all Overmind hooks fail.

The bug is really hard to catch and there is no way for end users to fix it without editing package.json inside node_modules.

aultac commented 3 years ago

I ran into the bug today w/ snowpack not bundling properly b/c overmind-react declared react as a file instead of a dependency. It would be great to see this merged in for me for that particular fix as least so I don't have to hand-edit node_modules/overmind-react/package.json.

christianalfoni commented 3 years ago

OMG... I was not aware of this PR 😭

  1. This has been done now

  2. Already did some of the lint updates, but put in the rest now

  3. Updated all packages to ES2020, some of the packages in this PR is removed

  4. Angular is moved to different repo due to big issues with cross dependencies in this monorepo. React updated with peerDependency to React

I am so sorry I did not spot this, but I was forced to take a break with a ready release... and when I got back to it I hoped to just do the release, but I got stuck in similar issues to this and went head on instead of looking at existing PRs 😞