-
Notifications
You must be signed in to change notification settings - Fork 360
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
feat(monorepo): converts patternfly-react to a lerna monorepo #332
Conversation
affects: @patternfly/react-codemods, @patternfly/react-console, patternfly-react, eslint-plugin-patternfly-react this change converts pf-react to use lerna/lerna-semantic-release and introduces monorepo folder structure
Pull Request Test Coverage Report for Build 1303
π - Coveralls |
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.
Added some minor nit pick comments.
packages/console/package.json
Outdated
"build": "node ../../scripts/runScript.js build:console", | ||
"prepublish": "yarn build" | ||
"prebuild": "yarn build:scripts && yarn build:sass && yarn build:less", | ||
"build:scripts": "babel src --out-dir dist/js --ignore .test.js,__mocks__", |
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.
this actually is probably not needed since the lerna build command should take care of it.
packages/console/package.json
Outdated
"prebuild": "yarn build:scripts && yarn build:sass && yarn build:less", | ||
"build:scripts": "babel src --out-dir dist/js --ignore .test.js,__mocks__", | ||
"build:less": "mkdir -p dist/less && cp -r less/* dist/less", | ||
"build:sass": "mkdir -p dist/sass && cp -r sass/* dist/sass && node-sass --output-style compressed --include-path sass --include-path $npm_package_sassIncludes_patternfly --include-path $npm_package_sassIncludes_bootstrap --include-path $npm_package_sassIncludes_fontAwesome -o dist/css sass/console.scss" |
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.
These could probably live in the root too. It would be nice to have it build similar to babel if possible.
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 agree w/ this, but i'm not quite sure how to accomplish it since we have package specific [file].scss at the end... feel free to give this a go...but i don't think it's really a blocker.
packages/core/package.json
Outdated
}, | ||
"scripts": { | ||
"prebuild": "yarn build:scripts && yarn build:sass && yarn build:less", | ||
"build:scripts": "babel src --out-dir dist/js --ignore .test.js,__mocks__", |
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.
this is ran in the root.
storybook/webpack.config.js
Outdated
const ROOT_DIR = '..'; | ||
const PCKGS = `${ROOT_DIR}/packages`; | ||
|
||
const packages = readdirSync(path.resolve(__dirname, PCKGS)) |
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.
this can actually be replaced with lernas package utils
const PackageUtilities = require('lerna/lib/PackageUtilities');
const Repository = require('lerna/lib/Repository');
const packages = PackageUtilities.getPackages(new Repository());
Each "package" includes the properties here: https://github.com/lerna/lerna/blob/master/core/package/index.js#L36
|
9c27feb
πΊ π―ββοΈ π― π πΊ
affects:
@patternfly/react-codemods, @patternfly/react-console, patternfly-react, eslint-plugin-patternfly-react
this change converts pf-react to use lerna/lerna-semantic-release and introduces monorepo folder
structure
What:
src
for currentpatternfly-react
intopackages/core
defaultTemplate
,inlineTemplate
,DOCUMENATION_URL
etc.) to be shared module imports (absolute) instead of relative.travis
and adopts similar scripts to @karelhala's [POC] refactor(monorepo): Monorepo implementationΒ #252@patternfly/react-codemods
, to show an example of how we can use codemods for migrating imports downstream. This would work now if we choose to movepatternfly-react
over to@patternfly/react-core
but will live this up to the community...@patternfly/react-console
is built with lernaSome things I am still working on...shouldn't take me long... π
updating README/CONTRIBUTING.mdadding in any changes that were merged this week. I was working in a sandbox here all week ;)cc: @jeff-phillips-18 @dmiller9911 @mturley @dgutride @karelhala
Please let me know the final verdict on package namespace names here before we call this one done!
Closes: #201 #218
Link to Storybook:
https://priley86.github.io/patternfly-react
Additional issues:
For anyone interested, I have compiled all of our Lerna/monorepo documentation in this doc and added some additional notes (step for step here).
https://docs.google.com/document/d/1w5_J1OpP4fQGLRP12U7v2DMi-yqBaOvPwrqHuUBI_3I/edit