Bits, the front-end component library for 24 ways
Requirements
Bits is built upon Fractal, a tool that enables the rapid development of components, templates and pages. Fractal uses a number of ES6 features, so this project requires Node.js v4.0+ to be installed locally. A global install of Gulp is also recommended.
Installation
To get the project up and running, and view components in the browser, complete the following steps:
- Download and install Node: https://nodejs.org/
- Clone this repo:
git clone [email protected]:24ways/frontend.git
(SSH) orgit clone https://github.com/24ways/frontend.git
(HTTPS) - [Optional] Install Gulp globally:
npm install gulp -g
- [Optional] Install Fractal globally:
npm install fractal -g
- Install project dependancies:
npm install
- Start the development environment:
npm start
- Open your browser and visit http://localhost:3000
Development
When developing components, you may want assets automatically compiled and the browser to refresh automatically. To do this, run the following task:
npm run dev
Creating a static build
To create a static instance of this project, run the following task:
npm run build
This will create a folder called www
, into which the required files will be created.
Deployment
To make this project publicly accessible, you can deploy a static instance by running the following task:
npm run publish
This will publish the contents of public
to your gh-pages
branch.
Repo structure
Sometimes itโs helpful to know what all these different files are forโฆ
/
โโ src/
โ โโ assets/ # Assets
โ โ โโ icons/ # Favicon and home screen icons
โ โ โโ images/ # Raster images (used in component examples)
โ โ โโ scripts/ # JavaScript files
โ โ โโ styles/ # CSS files
โ โ โโ vectors/ # SVG images, icons and logos
โ โ
โ โโ components/ # Components
โ โ โโ _partials/ # โฆthat render component previews
โ โ โโ common/ # โฆthat may appear anywhere
โ โ โโ global/ # โฆthat appear on every page
โ โ โโ layouts/ # โฆthat govern macro layout
โ โ โโ scopes/ # โฆthat style undecorated markup
โ โ โโ templates/ # โฆthat combine components to render page types
โ โ โโ utilities/ # โฆthat have a single purpose/role
โ โ
โ โโ docs/ # Documentation
โ โ โโ _partials/ # Partials for rendering documentation
โ โ โโ โฆ # Documentation files
โ โ
โ โโ tokens/ # Design tokens
โ
โโ tmp/ # Files required for dynamic builds (ignored by Git)
โโ www/ # Public build (ignored by Git)
โ
โโ .editorconfig # Code style definitions
โโ .gitignore # List of files and folders not tracked by Git
โโ .eslintrc # Linting preferences for JavasScript
โโ fractal.configjs # Configuration for Fractal
โโ gulpfile.js # Configuration for Gulp tasks
โโ LICENSE # License information for this project
โโ package.json # Project manifest
โโ README.md # This file