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 |
dmiller9911
left a comment
There was a problem hiding this comment.
Added some minor nit pick comments.
| "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.
this actually is probably not needed since the lerna build command should take care of it.
| "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.
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.
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.
| }, | ||
| "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.
this is ran in the root.
| const ROOT_DIR = '..'; | ||
| const PCKGS = `${ROOT_DIR}/packages`; | ||
|
|
||
| const packages = readdirSync(path.resolve(__dirname, PCKGS)) |
There was a problem hiding this comment.
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-reactthis change converts pf-react to use lerna/lerna-semantic-release and introduces monorepo folder
structure
What:
srcfor currentpatternfly-reactintopackages/coredefaultTemplate,inlineTemplate,DOCUMENATION_URLetc.) to be shared module imports (absolute) instead of relative.travisand 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-reactover to@patternfly/react-corebut will live this up to the community...@patternfly/react-consoleis 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