-
Notifications
You must be signed in to change notification settings - Fork 165
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
"Monorepo" refactor spike remove lerna #135
"Monorepo" refactor spike remove lerna #135
Conversation
tests not working yet
using jest, and removed CRA dependency, updated babel config for babel 7 and stubbed css files for jest tests for css node modules
CRA had it's own linter internally, so added linting + dependencies
see PR description for more details
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.
(didn't know where to comment this):
removed .stylelintrc in favour of .eslintrc?
Bring this back - .stylelintrc is a tool to lint .css files - .eslintrc doesn't deal with those which is why we have both files
I'll check this out properly and review on my machine also.
Could we also add in an npm script for the demo page? |
Thanks @jamesdools , re npm script for the demo page, what would you like the script to do? at the moment the demo page shows up in the storybook (which will be published to our github pages and replace current demo app) But there's also a way to get a direct link to the demo app as a full screen page via storybook (which is then similar to the current/previous demo app page) eg as shown in the README:
link wouldn't work yet, coz we haven't published storybook to github pages yet |
Bringing back |
playtime on display is double of actual total playtime
in media player to stop moving while playing
Happy for you to |
* Task: added lerna * WIP: storybook conversion * mend * WIP: adding MediaPlayer * move TimedTextEditor, TranscriptEditor and adapters util to packages (#128) * moved TimedTextEditor and TranscriptEditor to packages also created stories, and package.json for each, but can't test them in storybook coz they have dependencies on adapters in Util folder * moved Util and demdemo app * got storybook working * added demo app to storybook * mend * Fix: commenting out demo * Changed repo packages folder structure (#129) * cleaned up adapters * changed folder structure * fixed timecode converter duplice module * made all packages private except for TranscriptEditor * working * "Monorepo" refactor spike remove lerna (#135) * got storybook working tests not working yet * fixed tests using jest, and removed CRA dependency, updated babel config for babel 7 and stubbed css files for jest tests for css node modules * Added support for demo app in storybook * fixed eslint CRA had it's own linter internally, so added linting + dependencies * cleaned up export scripts in package.json * updated README * finalised refactor see PR description for more details * rename demo app editor to demoTranscript * bringing back style lint, and fixing lint in storybook config * updated with current master AWS adapter * linting * fix #132 playtime displaied double playtime on display is double of actual total playtime * temporary fix #73 monospace duration and current time in media player to stop moving while playing * Feature: Added custom css loading to storybook (#136) * Resolved conflict iwth AWS adapter
making a note that to push to npm keeping
Doing it this way, the "main": "index.js",
...
"scripts": {
...
"publish:public": "npm run build:component && rm ./dist/package.json || true && cp package.json ./dist/package.json && npm publish dist --access public",
... |
Is your Pull Request request related to another issue in this repository ?
This PR #130 in particular addressing this comment
Describe what the PR does
npm start
ornpm run storybook
.stylelintrc
in favour of.eslintrc
?npm run test
, andnpm run test:ci
for travis CI, andnpm run test:watch
for developmentwebpack.config.js
- see more info belowTimedTextEditor
onlyimport TimedTextEditor from '@bbc/react-transcript-editor/TimedTextEditor';
import { TimedTextEditor } from '@bbc/react-transcript-editor';
- see below for more details and reasoning behind the need for this.Todo after merge to master
npm run publish:public
npm run deploy:ghpages
style-loader
andcss-loader
webpack loaders. However it should be possible to bundle it separately, but couldn't get this to work.Storybook css modules
storybook/webpack.config.js
augments the storybook one with support for css moduleswebpack
Webpack is now used for bundling the component for npm distribution.
Biggest change is that the build script now uses webpack instead of simply using babel
see
webpack.config.js
for more details, and these two blog posts for background.import only certain components
Using Webpack code splitting entry points as well as exporting from
packages/index.js
for max flexibility.As explained in the README you can now do both
The difference is that
At the moment webpack complains that some files are above the recommended size limit. It be interesting to see if there's a way to reduce this with some further optimization eg lazyloading etc.. but I'd leave it for a subsequent PR for now
Excluding tests and sample json
webpack works out the dependency tree from the entry points as it's making it's own dependency graph, and because sample and tests files are not used or imported in production, then they are be automatically excluded in the bundle process.
Jest config
To run jest across the react components, we have to stub the css file dependencies using
moduleNameMapper
under the jest attribute inpackage.json
Other things to think about
This could be done as separate repo, but if it's no longer a "mono repo" (in the sense of using lerna, workspaces etc.. where each package is published independently to npm) then some of the naming could be changed as follows
packages
folder could be renamed tolib
package.json
(main
,module
, andfiles
attributes as well as the variousscripts
),webpack.config.js
,.storybook/config.js
as well as various components imports etc.. across the repo.State whether the PR is ready for review or whether it needs extra work
Ready for review, cc @jamesdools
Additional context