@b12/metronome v1.1.28
Metronome
Metronome is a design system we use for developing consistent user experiences at B12. We recently open sourced it to allow us to use it in other open source projects, and to make the useful and reusable components more widely available to developers outside the company.
How to develop
Root of the repo looks like this. The main parts are: components and style directories, they contain basic components and styles all other files are here to help you develop and test your components. src directory contains files to preview your components in browser, keep in mind that this directory won’t be included in npm package (to see other ignored files and directories see .npmignore file).
.
├── LICENSE
├── README.md
├── components
├── index.es6.js
├── jest
├── node_modules
├── package.json
├── src
├── style
├── third_party
├── webpack.config.js
└── yarn.lock::Warning! By convention, all javascript files should have a *.es6.js file extension.::
Below are basic command you may need:
# Run demo in browser
$ yarn start
# Run tests
$ yarn testIf you are developing on a remote machine and want to view the demo in your browser,
- You'll probably need to edit
webpack.config.jsand changemodule.exports.devServer.portto be an available port on your machine. - You might also need to edit
module.exports.devServer.allowedHoststo include your hostname. The default supportsb12.ioor any subdomain (see the documentation of host formats). - Then you can access the demo interface at
http://your-remote-server.com:{port}.
How can I test my changes in an internal repository without publishing?
Note: If you're using docker, then you should do this outside of docker.
You can do it in five steps:
- In the
metronomerepository link metronome in yarn with commandyarn link; - In the
metronomerepository runyarn install --production; - In your internal repository (
crowdsurfing/product) use your linked version with commandyarn link @b12/metronome; - In your internal repository try to build product with
yarn && yarn dev;
In case you accidentally ran the commands inside of docker and are running into permissions issues
1. In your docker env remove node_modules folder, also remove build/static/build dir;
2. On your host machine recreate build/static/build dir with local user permissions;
3. Go to the internal repository on your host machine and run yarn && yarn dev;
Known issues
- Reinstall
metronomedependencies with--productionflag before testing your changes in an internal repository; - If you see a lot of unexpected
flowerrors runyarn flow stop && yarn dev; - If
yarn install --productioninstalls dev dependencies try npmnpm install --productioninstead;
Steps to take if you continue to get flow, webpack, and duplicate react package errors
In your
metronomerepo, run:rm -rf node_modules;npm i --production;
Then, in the internal repository, run:
rm -rf node_modules;yarn;yarn link @b12/metronome;yarn flow-reboot;
5 months ago
8 months ago
11 months ago
7 months ago
7 months ago
7 months ago
7 months ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
6 years ago