Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up common directory for sharing components between publisher + agency-dashboard #61

Merged
merged 4 commits into from
Oct 7, 2022

Conversation

terryttsai
Copy link
Contributor

@terryttsai terryttsai commented Oct 6, 2022

Description of the change

See guide for setting up a simple React monorepo: https://jibin.tech/blog/monorepo-with-create-react-app/

Configure repo with yarn workspaces, create new agency-dashboard react app + common top level directory for sharing code between publisher and agency-dashboard.

Use react-app-rewired to configure CRA to compile code in common directory.

To use this, you would import common code into your app with from "@justice-counts/common/[directory to your component]";

agency-dashboard is just a skeleton app that demonstrates importing a simple component from the common directory

Type of change

All pull requests must have at least one of the following labels applied (otherwise the PR will fail):

Label Description
Type: Bug non-breaking change that fixes an issue
Type: Feature non-breaking change that adds functionality
Type: Breaking Change fix or feature that would cause existing functionality to not work as expected
Type: Non-breaking refactor change addresses some tech debt item or prepares for a later change, but does not change functionality
Type: Configuration Change adjusts configuration to achieve some end related to functionality, development, performance, or security
Type: Dependency Upgrade upgrades a project dependency - these changes are not included in release notes

Related issues

Closes #XXXX

Checklists

Development

This box MUST be checked by the submitter prior to merging:

  • Double- and triple-checked that there is no Personally Identifiable Information (PII) being mistakenly added in this pull request

These boxes should be checked by the submitter prior to merging:

  • Tests have been written to cover the code changed/added as part of this pull request

Code review

These boxes should be checked by reviewers prior to merging:

  • This pull request has a descriptive title and information useful to a reviewer
  • This pull request has been moved out of a Draft state, has no "Work In Progress" label, and has assigned reviewers
  • Potential security implications or infrastructural changes have been considered, if relevant

@terryttsai terryttsai requested a review from a team October 6, 2022 19:54
@mxosman
Copy link
Contributor

mxosman commented Oct 7, 2022

This is awesome, Terry! I can't wait to explore this new flow. Is it worth it to clean up some of the boilerplate React App code and have a descriptive README in this PR - or will that be in a subsequent PR?

Copy link
Contributor

@mxosman mxosman left a comment

Choose a reason for hiding this comment

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

Left a note about minor clean up - but this LGTM!

@terryttsai
Copy link
Contributor Author

I'll clean up the example app into more of an agency-dashboard app in a follow-up PR, this one is just to focus on setting up the yarn workspace / webpack! (plus a test component to demonstrate it working)

@terryttsai terryttsai merged commit 6314e81 into main Oct 7, 2022
@terryttsai terryttsai deleted the terry/shared-components-1 branch October 7, 2022 17:29
@lilidworkin
Copy link
Collaborator

Great PR description! Excited to try this out. Great job figuring out how to use react-app-rewired, yarn workspaces, etc and plug it all together into a solution that works for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants