Skip to content

Commit

Permalink
fix(readme.md): update readme with live types info, reorganize featur…
Browse files Browse the repository at this point in the history
…es list
  • Loading branch information
waldronmatt committed May 31, 2024
1 parent 6434be7 commit 83930dd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@

A demo react component library. Heavily inspired by [this article](https://dev.to/receter/how-to-create-a-react-component-library-using-vites-library-mode-4lma).

This includes many modern best practices for publishing and consuming in monorepos.

## Features

- Fully tree shakeable (`js` and `css`)
- SSR compatible
- Outputs:
- `esm` and `cjs` source files
- source maps for JavaScript files (`.js.map`)
- `esm` and `cjs` declaration files (`.d.ts` and `.c.ts`)
- `esm` and `cjs` declaration files (`.d.ts` and `.d.cts`)
- `esm` and `cjs` source maps for declaration files (`.d.ts.map` and `.c.ts.map`)
- compiled CSS modules (consuming app is not required to support css modules)
- Subpath exports for explicit path referencing. Will auto map to the right module system
- Component updates auto reflect (hmr) in monorepos when referenced via the `lib` subpath export installed via the `workspace:` protocol
- Live monorepo hmr supported:
- sub-packages in this monorepo install this package via the `pnpm` `workspace:` protocol
- sub-packages in this monorepo reference this package's `lib` subpath export (can be `lib/index.js` or any files under `lib`)
- Live monorepo types supported (approach [detailed here](https://colinhacks.com/essays/live-types-typescript-monorepo)):
- top-level `exports` field defines types for source files
- `publishConfig` defines types for production (will override `exports` when publishing to `npm`)
- Libraries are externalized for a lighter bundle size (`react`, `react/jsx-runtime`)

## Installation
Expand Down

0 comments on commit 83930dd

Please sign in to comment.