-
Notifications
You must be signed in to change notification settings - Fork 151
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
chore: first step towards monorepo #26
chore: first step towards monorepo #26
Conversation
Thanks @crondinini, this is such a solid foundation for the project! Everything works perfectly. I am merging this in. If anyone wants to open a discussion regarding the monorepo setup or suggest improvements, please do so in this issue: #27. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few comments, not sure how many should be addressed before merging though, makes sense to iterate and move fast
"type": "git", | ||
"url": "git+https://github.com/Developer-DAO/web3-ui/" | ||
}, | ||
"private": "true", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to https://docs.npmjs.com/creating-a-package-json-file#required-name-and-version-fields, name and version are required fields in package.json files. maybe we should keep some stuff here still for whatever commands might be run from the root directory
"private": "true", | |
"name": "@web3-ui/root", | |
"license": "MIT", | |
"version": "0.0.0", | |
"private": "true", | |
"engines": { | |
"node": ">=16.0.0", | |
"yarn": "^1.5" | |
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@etr2460 From reading the resource you shared, those are all required for a published package. Since the package is private it won't be published. Would you consider all of that still required?
This is not the final version for the package in any case, but just trying to understand.
"node": ">=16.0.0", | ||
"yarn": "^1.5" | ||
}, | ||
"description": "React Typescript Library Boilerplate", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "React Typescript Library Boilerplate", | |
"description": "React components for web3, built with Chakra-UI", |
"type": "git", | ||
"url": "git+https://github.com/Developer-DAO/web3-ui/" | ||
}, | ||
"scripts": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a future question, but do we want these scripts to live at the package level or the root level? I'd be a bit worried that the scripts for each package might diverge, and i'd rather us end up with something like yarn test packages/components
at the root instead of cd packages/components && yarn test
or yarn workspace @web3-ui/components test
. food for thought
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to raise a similar discussion. Chakra has everything in the root folder, so the test and jest config are at the root and the packages only have the test file. So at the root we'd have yarn test
and this would run all tests for example.
My comment in the PR description "Test setup in the root folder (and maybe other root configs too)", was referring to those sort of things so I'm 100% with you.
"yarn": "^1.5" | ||
}, | ||
"description": "React Typescript Library Boilerplate", | ||
"author": "Dhaiwat Pandya", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be Developer DAO? Not sure what you think @Dhaiwat10
"author": "Dhaiwat Pandya", | |
"author": "Developer DAO", |
@@ -0,0 +1,19 @@ | |||
{ | |||
"name": "@web3-ui/hooks", | |||
"version": "1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"version": "1.0.0", | |
"version": "0.0.1", |
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"license": "ISC", | |
"license": "MIT", |
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"author": "", | |
"author": "Developer DAO", |
{ | ||
"name": "@web3-ui/hooks", | ||
"version": "1.0.0", | ||
"description": "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "", | |
"description": "React hooks for web3", |
@@ -0,0 +1,19 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like we're missing a decent amount of properties here that probably should be brought in from the components package.json too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, we are, as I mentioned in the PR description, this was a fake package, a POC of sorts.
"Introduced a fake hooks package and used it in the component package as an example"
Hey @etr2460, I was fast asleep when the comments were made! I see you already addressed some of them, thank you for that. I think they all make sense, but this PR was more like an iterative step rather than a finished work. If we were working already with already published packages, I would have merged this into a feature branch for example. |
Overview
This PR is a first step for the monorepo. It's not the complete setup since it doesn't handle the publishing/building yet, and the hooks folder is just an example but it's possible to develop on the 2 packages separately as of the changes introduced.
I chose to go forward with this despite it being incomplete so we can avoid major conflicts and we can free up people to work on things without the worry of having to solve those git conflicts.
This is what the new folder structure looks like.
Changes
package.json
, which includes theworkspaces
reference + scripts necessary@web3-ui/components
and@web3-ui/hooks
@web3-ui/hooks
as a dependency of@web3-ui/components
Missing
yarn
at the root level and it will link both packages