Skip to content

smakosh/ontwik-ui

Repository files navigation

Ontwik-ui

A headless UI library and CLI theme generator

Powered by:

  • 🏎 Turborepo — High-performance build system for Monorepos
  • 🚀 React — JavaScript library for user interfaces
  • 🛠 Tsup — TypeScript bundler powered by esbuild
  • 📖 Storybook — UI component environment powered by Vite

As well as a few others tools preconfigured:

Getting Started

Docs

Useful Commands

  • yarn dev - Run all packages locally and preview with Storybook
  • yarn build - Build all packages including the Storybook site
  • yarn lint - Lint all packages
  • yarn changeset - Generate a changeset
  • yarn clean - Clean up all node_modules and dist folders (runs each package's clean script)

Apps & Packages

This monorepo includes the following packages and applications:

  • apps/docs: Component documentation site with Storybook
  • apps/public-docs: Public Docs powered by Nextra
  • packages/ontwik-ui: Core React components

Each package and app is 90% TypeScript. Yarn Workspaces enables us to "hoist" dependencies that are shared between packages to the root package.json. This means smaller node_modules folders and a better local dev experience. To install a dependency for the entire monorepo, use the -W workspaces flag with yarn add.

Versioning & Publishing Packages

This repository uses Changesets to manage versions, create changelogs, and publish to npm. It's preconfigured so you can start publishing packages immediatley.

Generating the Changelog

To generate your changelog, run yarn changeset locally:

  1. Which packages would you like to include? – This shows which packages and changed and which have remained the same. By default, no packages are included. Press space to select the packages you want to include in the changeset.
  2. Which packages should have a major bump? – Press space to select the packages you want to bump versions for.
  3. If doing the first major version, confirm you want to release.
  4. Write a summary for the changes.
  5. Confirm the changeset looks as expected.
  6. A new Markdown file will be created in the changeset folder with the summary and a list of the packages included.

Releasing

When you push your code to GitHub, the GitHub Action will run the release script defined in the root package.json:

turbo run build --filter=docs^... --filter=public-docs^... && changeset publish

Turborepo runs the build script for all publishable packages (excluding docs & public-docs) and publishes the packages to npm.