react-union icon indicating copy to clipboard operation
react-union copied to clipboard

Refactor react-union-scripts structure

Open wafflepie opened this issue 7 years ago • 2 comments

There are a couple of points that I'd like to address:

  1. Rename the lib folder to something like utils.
  2. Move the unionConfig handling code from utils to a separate package (or at least a separate folder or file).
  3. Move webpack.config.js along with the parts to a separate package or a separate folder (or even a file, that would be sufficient).
  4. I don't understand the point of having a separate startDevServer.js file, just merge it with the start.js file.
  5. The scripts directory is a mess of multiple types of files. I'd like it to be a directory with the possible entry points for react-union-scripts and nothing else (test, build, start, that's it).
  6. In my react-union-ssr-server package, I would like to use a couple of useful functions from react-union-scripts (namely the CLI getArgValue function), it makes me think whether we should have a react-union-utils or a react-union-cli package – more small packages will lead to looser coupling and more maintainable code.

The code itself is pretty good, but the directory structure needs a major revamp.

wafflepie avatar Sep 03 '18 14:09 wafflepie

I will look into that. Not everything is priority. We have plans with union-scripts which makes this possible refactor just temporary. But thank you for comments.

tommmyy avatar Sep 04 '18 07:09 tommmyy

Okay, I'll try to stay away from doing any major refactoring in the ssr branch and will only leave comments as to what should be improved so that we don't forget about it.

wafflepie avatar Sep 04 '18 11:09 wafflepie