lundegaard / lundegaard/react-union

Refactor react-union-scripts structure

Open
#110 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

low-priority refactor
Dominant language
JavaScript
Stars
96
Forks
13
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by mapping the lib, utils, scripts, unionConfig, webpack.config.js, startDevServer.js, and start.js paths in react-union-scripts. Review the existing entry points and the CLI getArgValue function, then define a coherent package or folder boundary for each concern. Done means the requested structure is implemented without losing the test, build, or start entry points.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
developer-experience, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.