lami-ui
v0.1.4
Published
Pantheon is the [Lami's](https://www.lamimed.it/) UI Design System library, built with react, typescript and storybook. It's meant to be published at npmjs and to be distributed in Lami's React products.
Downloads
8
Readme
Pantheon
Pantheon is the Lami's UI Design System library, built with react, typescript and storybook. It's meant to be published at npmjs and to be distributed in Lami's React products.
TSDX
This library uses TSDX as a template. To learn more about TSDX, checkout TSDX's docs
Commands
The recommended workflow is to run TSDX in one terminal:
npm start # or yarn start
This builds to /dist
and runs the project in watch mode so any edits you save inside src
causes a rebuild to /dist
.
Then run either Storybook:
Storybook
Run inside another terminal:
yarn storybook
This loads the stories from each components folder.
NOTE: Stories should reference the components as if using the library, similar to the example playground. This means importing from the root project directory. This has been aliased in the tsconfig and the storybook webpack config as a helper.
To do a one-off build, use yarn build
.
Building components
This library uses plop to generate components automatically.
yarn generate
Don't forget to export the component in the src/index.tsx file, with it's meant to be distributed.
Publishing the library
To update the package, after beign assure that the build has been done, change de version in package.json, login in npm and publish the package.
npm login
Write the username and the password. And then:
npm publish
Configuration
Code quality is set up for you with prettier
, husky
, and lint-staged
. Adjust the respective fields in package.json
accordingly.
Jest
Jest tests are set up to run with yarn test
.
Bundle analysis
Calculates the real cost of your library using size-limit with npm run size
and visulize it with npm run analyze
.
Setup Files
This is the folder structure we set up for you:
/src
index.tsx # EDIT THIS
/test
blah.test.tsx # EDIT THIS
/.storybook
main.js
preview.js
.gitignore
package.json
README.md # EDIT THIS
tsconfig.json
React Testing Library
We do not set up react-testing-library
for you yet, we welcome contributions and documentation on this.
Rollup
TSDX uses Rollup as a bundler and generates multiple rollup configs for various module formats and build settings. See Optimizations for details.
TypeScript
tsconfig.json
is set up to interpret dom
and esnext
types, as well as react
for jsx
. Adjust according to your needs.
Continuous Integration
GitHub Actions
Two actions are added by default:
main
which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrixsize
which comments cost comparison of your library on every pull request using size-limit
Optimizations
Please see the main tsdx
optimizations docs. In particular, know that you can take advantage of development-only optimizations:
// ./types/index.d.ts
declare var __DEV__: boolean;
// inside your code...
if (__DEV__) {
console.log('foo');
}
You can also choose to install and use invariant and warning functions.
Module Formats
CJS, ESModules, and UMD module formats are supported.
The appropriate paths are configured in package.json
and dist/index.js
accordingly. Please report if any issues are found.