npm.io
0.1.5 • Published yesterday

@mateusho/matech-components

Licence
Version
0.1.5
Deps
0
Size
36 kB
Vulns
0
Weekly
0

@mateusho/matech-components

Biblioteca de componentes compartilhados da Matech.

Instalacao

npm install @mateusho/matech-components

Uso rapido

import { Button } from '@mateusho/matech-components';

export function Example() {
  return <Button>Novo curso</Button>;
}

Documentacao

GitHub

O repositório já pode usar GitHub Actions para:

  • validar a lib em push e pull_request
  • publicar no npm ao subir uma tag v*.*.*

Arquivos:

  • .github/workflows/ci.yml
  • .github/workflows/publish.yml

API publica atual

Componentes:

  • Button
  • Typography

Helpers de tema:

  • createMatechPalette
  • createMatechTheme
  • createMatechThemeOptions
  • getMatechPalette
  • MatechThemeProvider
  • useMatechTheme

Defaults e factories de tema:

  • createMatechDefaultButtonPalette
  • matechDefaultPalette
  • matechDefaultButtonPalette
  • matechDefaultGlobalPalette
  • matechDefaultTypography

Tipos:

  • ButtonSize
  • ButtonProps
  • ButtonVariant
  • TypographyAlign
  • TypographyColor
  • TypographyProps
  • TypographyVariant
  • MatechButtonPalette
  • MatechButtonPaletteVariant
  • MatechButtonTypography
  • MatechGlobalPalette
  • MatechPalette
  • MatechPaletteOptions
  • MatechTextVariant
  • MatechTheme
  • MatechThemeOptions
  • MatechThemeProviderProps
  • MatechTypography
  • MatechTypographyOptions
  • MatechTypographyVariantStyle

Desenvolvimento local

Storybook:

npm run storybook

Se a porta 6006 ja estiver em uso:

npm run storybook -- -p 6007

Build:

npm run build

Testes:

npm test

Coverage:

npm run test:coverage

Validacao antes de publicar:

npm run validate

Validacao completa de release:

npm run release:check

Hook local:

  • o pre-commit roda npm run test:coverage

Publicacao

Fluxo sugerido:

npm version patch
npm run release:check
git push origin main
git push origin --tags

Observacoes:

  • O pacote publica apenas dist.
  • A lib depende apenas de react e react-dom como peerDependencies.
  • Como o pacote usa publishConfig.access = "public", a publicacao sai publica por padrao.
  • Para publicar como @mateusho/matech-components, a conta no npm precisa ter acesso ao escopo @mateusho.
  • o workflow .github/workflows/publish.yml publica no npm quando a tag vX.Y.Z chega no GitHub.

Keywords