borrow-ui can be used as a monorepo project base. It is already configured to use the ui package inside the other packages.
This project is setup to work with yarn workspaces.
The following packages are included:
yarn manages all the cross references between different packages through the workspaces functionality.
curl -LJO https://github.com/borrow-ui/borrow-ui/archive/master.zip;
unzip borrow-ui-master.zip && mv borrow-ui-master my-ui-name;
cd my-ui-name;
find . -type f -print0 | xargs -0 sed -i 's/borrow-ui/my-ui-name/g';
yarn
yarn workspace @my-ui-name/documentation run storybook
Download the latest zip here and extract the content, for example in ~/Downloads/borrow-ui-master.
Now, with your favourite editor (a script is planned) rename all the occurrencies of borrow-ui to my-ui-name.
Alternatively, if you are using Linux (even WSL), you can launch the following command:
find . -type f -print0 | xargs -0 sed -i 's/borrow-ui/my-ui-name/g'
From the main folder, run:
yarn # this will install all the dependencies
As a good practice, initialize the folder as a repository and set a remote origin; if you are using GitHub, you can create an empty repository directly on the website and the run the following command:
git init
git add
git commit -m "Started project from @borrow-ui"
git remote add origin git@github.com:<USERNAME>/<REPOSITORY>.git
git push -u origin master
The packages/ui folder contains the components and their styles, along with the tests.
There are few commands you can use to develop your components. From packages/ui folder, you can run:
Production commands are very similar to the standard list of commands for any React project:
The packages/documentation folders contains this guide backbone and the Storybook configuration files. Two commands are available:
It is also possible to start Storybook from the project root:
yarn workspace @my-ui-name/documentation run storybook
Since we are using yarn workspaces, new packages must be added with a specific command. For example, if you want to add react-dropzone dependency to website-next package, run this command from the main folder:
yarn workspaces @borrow-ui/website-next add react-dropzone
Where:
You can add -D or --dev flag to install the dependency as a Dev Dependency.
To remove a package, use remove instead of add:
yarn workspaces @borrow-ui/website-next remove react-dropzone