1.1.26 • Published 4 years ago

ui-x-library v1.1.26

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

UI Components Library

Build and upload ReactJS components to NPM

Typed with TypeScript npm.io code style: prettier PRs Welcome

Rationale

In essence, this application allows you to build UI components library in isolation using Styleguidist - in other words you can build and preview them independently from any particular brand. Also generates a dist folder ready to be pushed to the NPM using a few familiar commands.

Building and Running

:warning: Check .env.example file for required variables!

Install all required dependencies:

yarn

Launch Styleguidist ( initial load takes time, subsequently webpack cache kicks in )

yarn styleguide

Launch Create React App if you want to preview components outside of Styleguidist

yarn start

Generate NPM dist package using Rollup:

yarn build-for-npm

Run tests:

yarn test

How to test your NPM module without publishing!

Use yalc !

Better workflow than npm | yarn link for package authors - read docs.

Install yalc globally:

yarn global add yalc

Inside ui-library root execute:

yarn build-for-npm

Then publish to yalc (located ~/.yalc):

yalc publish

Add to another local FE project:

yalc add ui-library

To update library after some changes

yarn build-for-npm && yalc publish --push

Publish to NPM

:warning: Don't forget to bump ui-library package version!

Versioning

CommandDescription
yarn version --patchBump version in package.json -> patch
yarn version --minorBump version in package.json -> minor
yarn version --majorBump version in package.json -> major

Then run npm publish - assuming you have \${NPM_TOKEN} set on your local machine in your ~/.profile or logged into npm via CLI.

See npm docs for more info.

Project Structure

NameDescription
.vscodeContains VS Code specific settings
distContains built output for the NPM registry
node_modulesContains all npm dependencies
publicReact application public folder
src/libComponent in this folder will become dist package
src/styleguideStyleguidist specific files e.g ContextProvider
.env.exampleDefines ENV variables that you need to set in .env file
.eslintignoreContain patterns that should be ignored by ESLint
.eslintrcConfig settings for ESLint code style checking
.gitignoreContain patterns that should be ignored in Git
.npmignoreFile to keep stuff out of your dist package
.npmrcContains config settings for the NPM
.prettierrcPrettier configuration file
CHANGELOG.mdAll notable NPM package changes will be documented in this file
package.jsonFile that or orchestrates this project
README.mdFile you are reading right now
rollup.config.jsRollup bundler configuration file, creates dist folder
styleguide.config.jsStyleguidist configuration file
styleguide.styles.jsStyleguidist theme file
tsconfig.jsonConfig settings for compiling code written in TypeScript
yarn.lockAuto-generated file to get consistent installs across machines

Changelogs

Use a CHANGELOG markdown file to keep changes of repository in an ordered and structured way.

Recommended template to use for each bullet of the changelog.

## [1.0.0] - YYYY-MM-DD

### Changes

- commit message
1.1.26

4 years ago

1.1.25

4 years ago

1.1.24

4 years ago

1.1.23

4 years ago

1.1.22

4 years ago

1.1.21

4 years ago

1.1.20

4 years ago

1.1.19

4 years ago

1.1.18

4 years ago

1.1.16

4 years ago

1.1.17

4 years ago

1.1.12

4 years ago

1.1.11

4 years ago

1.1.15

4 years ago

1.1.14

4 years ago

1.1.13

4 years ago

1.1.10

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago