Skip to content

tiwariav/wo-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

873 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wo-library

A TypeScript monorepo providing reusable utilities, React components, web helpers, and shared configuration packages.

Packages

Package Description Docs
@wo-library/js Pure JS/TS utilities (arrays, numbers, objects, colors, SVG) README
@wo-library/react React components (atomic design) and hooks README
@wo-library/web Browser/DOM utilities (fetch, storage, script loading) README
@wo-library/ui CSS styles, themes, and SVG path data README
@wo-library/eslint-config Shared ESLint flat-config presets README
@wo-library/postcss-config Shared PostCSS configuration README
@wo-library/stylelint-config Shared Stylelint configuration README
@wo-library/semantic-release-config Semantic release presets README

Quick Start

# Install dependencies
pnpm install

# Build all packages
pnpm nx run-many --target=build

# Run tests
pnpm nx run-many --target=test

Import Pattern

// Named exports only — no default imports
import { formatNumber, range } from "@wo-library/js";
import { useCalendly, useMethods } from "@wo-library/react";
import { loadScript, WoFetch } from "@wo-library/web";

Key Conventions

  • Named exports only — default exports are not used in public APIs.
  • TypeScript strict mode — no any types; use unknown instead.
  • Indian number localeformatNumber uses en-IN (Lakhs/Crores).
  • CSS Modules — component styles use *.module.css, never inline styles.
  • lodash-es — always use the tree-shakeable ESM build, never lodash.

Optimizations

Providers

  • When using useMethods from the react-use library, memoize the state argument before passing it to the function by wrapping in a useMemo, or the provider would return new state and methods every time, causing extra re-renders.

  • Wrap the returned methods object in another useMemo so that it isn't treated as a new variable even when the state changes.

  • Create two providers: one with the state values and the other with the dispatcher/methods values. Since the methods are fixed, components consuming only the methods will not re-render when the provider state changes.

Contributing

See .ai/instructions.md for coding standards and patterns.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors