@buildo/bento

one lib to rule them all: components, data management, build scripts, example app template.

Usage no npm install needed!

<script type="module">
  import buildoBento from 'https://cdn.skypack.dev/@buildo/bento';
</script>

README

Bento

one lib to rule them all: components, data management, build scripts, example app template.

Detailed documentatin is temporarily hosted here.

Usage

Starting a new project from scratch

Install the create-bento-app command globally:

yarn global add @buildo/create-bento-app

Create a new app:

create-bento-app my-app

Start development:

cd my-app
yarn start

Adding Bento to an existing project

yarn add @buildo/bento

Components

Bento exports a complete set of basic React components from @buildo/bento/components. You can import a component like so:

import Badge from '@buildo/bento/components/Badge'

Read more about how to import and customize a Bento components in the detailed documentation.

Go to http://react-components.buildo.io/ to read docs and see a live demo for every React components exported by Bento.

Utils

MobileDetect

Import:

import MobileDetect from '@buildo/bento/utils/mobileDetect';

const md = new MobileDetect(/* optional: pass custom user agents */)

Please refer to MobileDetect GitHub repository for documentation and examples.

LocalDate

Import:

import LocalDate from '@buildo/bento/utils/localDate'

Please refer to local-date GitHub repository for documentation and examples.

Theme

normalize-css

CSS normalizer based on buildo-normalize-css

Usage:

import 'bento/theme/normalize-css'

NOTE: If your app is fullscreen, you need to import the fullscreenApp module too:

import 'bento/theme/normalize-css'
import 'bento/theme/normalize-css/fullscreenApp'

Bitbucket sync procedure

Assuming two folders inside the same directory, bento (this repo) and bento-bitbucket (bitbucket ~mirror)

  • cd bento-bitbucket && gco master
  • update bento code (including deps, src, create-bento-app template, etc.) rm -rf ./* && cp -r ../bento/* .
  • be sure to copy correctly also any added .dotfiles (the command above doesn't)
  • some files should not be copied: gco -- README.md publish.sh
  • check with diff --brief -Nr --exclude=node_modules --exclude=.git --exclude=*.tgz --exclude=*.log . ../bento: only a few files should differ (README, CHANGELOG, publish.sh, .hophoprc, .smooth-releaserc)
  • git add . && git commit -m "github sync"
  • update the release branch with the new additions: gco release && git merge master
  • fix the react-components dep: yarn remove buildo-react-components; yarn add --no-lockfile ssh://git@bitbucket.aipadmin.com/ben/abbott-react-components.git
  • update all the imports from react-components to refer to abbott-react-components: e.g. search&replace buildo-react-components -> abbott-react-components
  • manual fixes.. try to build and fix errors
  • manual additions.. some components might be available only in abbott-react-components (or viceversa)
  • when build is fine, git push origin release
  • (OPTIONAL) release a new version ./publish.sh <versionNumber>-abbott <-- version number should be updated manually. It should reflect current @buildo/bento version (except for the -abbott suffix that is added)