https://github.com/navono/lerna-ts-react
A monorepo demo that use Lerna, Typescript, React and Redux
https://github.com/navono/lerna-ts-react
lerna react redux rollup typescript
Last synced: 2 months ago
JSON representation
A monorepo demo that use Lerna, Typescript, React and Redux
- Host: GitHub
- URL: https://github.com/navono/lerna-ts-react
- Owner: navono
- License: mit
- Created: 2021-03-30T01:12:33.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-07-13T11:36:30.000Z (almost 4 years ago)
- Last Synced: 2025-06-12T16:04:44.621Z (about 1 year ago)
- Topics: lerna, react, redux, rollup, typescript
- Language: JavaScript
- Homepage:
- Size: 764 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Typescript-React-Template
`master` branch integrate `TypeScript`, `ESlint`, `React`, `Redux` features.
## Lerna part
## create component
Using --yes to skip prompts
> lerna create @cddev/phoenix-builder --yes
>
Add phoenix-button dependency into phoenix
> lerna add @cddev/phoenix-button --scope=@cddev/phoenix
>
We are going to use React for the two UI components, let's add it as dev dependency first for local testing
>lerna add react --dev --scope '{@cddev/phoenix-button,@cddev/phoenix-text}'
>
And as a peer dependency using major latest version for consuming applications
> lerna add react --peer --scope '{@cddev/phoenix-button,@cddev/phoenix-text}'
>
We are also going to use an utility to toggle classes as needed on the components called "clsx"
> lerna add clsx --scope '{@cddev/phoenix-button,@cddev/phoenix-text}'
>
wire the phoenix-builder to our individual components
> lerna add @cddev/phoenix-builder --dev --scope '{@cddev/phoenix,@cddev/phoenix-button,@cddev/phoenix-text}'
>
### Compile the JS with Rollup
> lerna add rollup --scope=@cddev/phoenix-builder
>
> lerna add @babel/core --scope=@cddev/phoenix-builder
>
> lerna add @babel/preset-env --scope=@cddev/phoenix-builder
>
> lerna add @babel/preset-react --scope=@cddev/phoenix-builder
>
> lerna add @rollup/plugin-babel --scope=@cddev/phoenix-builder
>
> lerna add @rollup/plugin-node-resolve --scope=@cddev/phoenix-builder
We are going to use the Javascript API in rollup and produce 2 bundles:
1. CommonJS (CJS) for older clients.
2. ECMAScript Modules (ESM) for newer clients.
### Storybook
> npx -p @storybook/cli sb init --type react
>
delete top level stories.