Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches:
- main

concurrency:
group: release
cancel-in-progress: false

jobs:
release-please:
name: Release PR
Expand All @@ -23,7 +27,11 @@ jobs:
name: Publish to NPM
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.releases_created }}
if: github.repository == 'aprendendofelipe/react-stack' && needs.release-please.outputs.releases_created

permissions:
id-token: write # Required for trusted publishing
contents: read

steps:
- name: Checkout Repository
Expand All @@ -37,12 +45,10 @@ jobs:
cache: 'npm'

- name: Install Dependencies
run: npm ci
run: npm ci --ignore-scripts

# Release Please has already incremented versions and published tags,
# so we just need to publish all unpublished versions to NPM here.
- name: Publish to NPM
run: npx lerna publish from-package --no-push --no-private --yes
timeout-minutes: 2
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 TabNews
Copyright (c) 2025 Barso

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Packages for Next/React Applications

(_[🇧🇷 Versão em português](#bibliotecas-para-aplica%C3%A7%C3%B5es-nextreact-)_)

This repository currently contains packages under the `@barso` scope:

- [`@barso/forms`](https://www.npmjs.com/package/@barso/forms): Form validation and management.
- [`@barso/helpers`](https://www.npmjs.com/package/@barso/helpers): Utility functions.
- [`@barso/hooks`](https://www.npmjs.com/package/@barso/hooks): Custom React hooks.
- [`@barso/infra`](https://www.npmjs.com/package/@barso/infra): Infrastructure utilities, such as logging.
- [`@barso/ui`](https://www.npmjs.com/package/@barso/ui): UI components.

Until the versions below, this repository was also the home for the `@tabnews` packages:

| @tabnews (up to version) | @barso (corresponding version) |
| -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| [@tabnews/forms@0.4.1](https://www.npmjs.com/package/@tabnews/forms/v/0.4.1) | [@barso/forms@0.4.1](https://www.npmjs.com/package/@barso/forms/v/0.4.1) |
| [@tabnews/helpers@0.4.1](https://www.npmjs.com/package/@tabnews/helpers/v/0.4.1) | [@barso/helpers@0.4.1](https://www.npmjs.com/package/@barso/helpers/v/0.4.1) |
| [@tabnews/hooks@0.1.7](https://www.npmjs.com/package/@tabnews/hooks/v/0.1.7) | [@barso/hooks@0.1.7](https://www.npmjs.com/package/@barso/hooks/v/0.1.7) |
| [@tabnews/infra@0.0.7](https://www.npmjs.com/package/@tabnews/infra/v/0.0.7) | [@barso/infra@0.0.7](https://www.npmjs.com/package/@barso/infra/v/0.0.7) |
| [@tabnews/ui@0.6.2](https://www.npmjs.com/package/@tabnews/ui/v/0.6.2) | [@barso/ui@0.6.2](https://www.npmjs.com/package/@barso/ui/v/0.6.2) |

For easier migration, the versions above are identical in both packages, but may diverge in the future.

Development of the `@tabnews` packages, if continued, will take place at [`filipedeschamps/tabnews`](https://github.com/filipedeschamps/tabnews).

---

# Bibliotecas para Aplicações Next/React 🇧🇷

Este repositório contém bibliotecas sob o escopo `@barso`:

- [`@barso/forms`](https://www.npmjs.com/package/@barso/forms): Validação e manipulação de formulários.
- [`@barso/helpers`](https://www.npmjs.com/package/@barso/helpers): Funções utilitárias diversas.
- [`@barso/hooks`](https://www.npmjs.com/package/@barso/hooks): Hooks personalizados para React.
- [`@barso/infra`](https://www.npmjs.com/package/@barso/infra): Funcionalidades de infraestrutura, como logging.
- [`@barso/ui`](https://www.npmjs.com/package/@barso/ui): Componentes de interface do usuário.

Até as versões abaixo, este repositório também foi o local das bibliotecas `@tabnews`:

| @tabnews (até a versão) | @barso (versão correspondente) |
| -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| [@tabnews/forms@0.4.1](https://www.npmjs.com/package/@tabnews/forms/v/0.4.1) | [@barso/forms@0.4.1](https://www.npmjs.com/package/@barso/forms/v/0.4.1) |
| [@tabnews/helpers@0.4.1](https://www.npmjs.com/package/@tabnews/helpers/v/0.4.1) | [@barso/helpers@0.4.1](https://www.npmjs.com/package/@barso/helpers/v/0.4.1) |
| [@tabnews/hooks@0.1.7](https://www.npmjs.com/package/@tabnews/hooks/v/0.1.7) | [@barso/hooks@0.1.7](https://www.npmjs.com/package/@barso/hooks/v/0.1.7) |
| [@tabnews/infra@0.0.7](https://www.npmjs.com/package/@tabnews/infra/v/0.0.7) | [@barso/infra@0.0.7](https://www.npmjs.com/package/@barso/infra/v/0.0.7) |
| [@tabnews/ui@0.6.2](https://www.npmjs.com/package/@tabnews/ui/v/0.6.2) | [@barso/ui@0.6.2](https://www.npmjs.com/package/@barso/ui/v/0.6.2) |

Para facilitar a migração, as versões acima são idênticas nas duas bibliotecas, mas podem divergir em futuras versões.

O desenvolvimento das bibliotecas `@tabnews`, caso mantido, irá ocorrer no repositório [`filipedeschamps/tabnews`](https://github.com/filipedeschamps/tabnews).
4 changes: 2 additions & 2 deletions examples/form/app/layout.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PrimerRoot } from '@tabnews/ui';
import '@tabnews/ui/css';
import { PrimerRoot } from '@barso/ui';
import '@barso/ui/css';

import { DefaultLayout } from '../components/DefaultLayout.jsx';
import { NotificationsProvider } from '../components/Notifications';
Expand Down
6 changes: 3 additions & 3 deletions examples/form/components/Checkout.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';
import { useForm } from '@tabnews/forms';
import { Box, Button, Flash, FormField, Heading, TabNav, Text } from '@tabnews/ui';
import { Link } from '@tabnews/ui/primer';
import { useForm } from '@barso/forms';
import { Box, Button, Flash, FormField, Heading, TabNav, Text } from '@barso/ui';
import { Link } from '@barso/ui/primer';
import { FaCreditCard, FaPix } from 'react-icons/fa6';

import { SubmittedFields } from './SubmittedFields.jsx';
Expand Down
2 changes: 1 addition & 1 deletion examples/form/components/DefaultLayout.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, GoToTopButton } from '@tabnews/ui';
import { Box, GoToTopButton } from '@barso/ui';

import { Header } from './Header.jsx';

Expand Down
2 changes: 1 addition & 1 deletion examples/form/components/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client';
import { Header as PrimerHeader } from '@tabnews/ui/primer';
import { Header as PrimerHeader } from '@barso/ui/primer';
import NextLink from 'next/link';

import { NotificationCenter } from './Notifications';
Expand Down
6 changes: 3 additions & 3 deletions examples/form/components/Login.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useForm } from '@tabnews/forms';
import { Button, Flash, FormField, Heading } from '@tabnews/ui';
import { Link } from '@tabnews/ui/primer';
import { useForm } from '@barso/forms';
import { Button, Flash, FormField, Heading } from '@barso/ui';
import { Link } from '@barso/ui/primer';

import { SubmittedFields } from './SubmittedFields.jsx';

Expand Down
6 changes: 3 additions & 3 deletions examples/form/components/Notifications/Notifications.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use client';
import { CheckIcon, CommentIcon, NoteIcon, SquareCircleIcon, TrashIcon } from '@primer/octicons-react';
import {
Button,
Heading,
NotificationList,
NotificationMenu,
NotificationsProvider as Provider,
useNotifications,
} from '@tabnews/ui';
import { Link as PrimerLink } from '@tabnews/ui/primer';
} from '@barso/ui';
import { Link as PrimerLink } from '@barso/ui/primer';
import { CheckIcon, CommentIcon, NoteIcon, SquareCircleIcon, TrashIcon } from '@primer/octicons-react';
import NextLink from 'next/link';
import { useRouter } from 'next/navigation';
import { useEffect, useState } from 'react';
Expand Down
6 changes: 3 additions & 3 deletions examples/form/components/Registration.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useForm } from '@tabnews/forms';
import { Box, Button, Flash, FormField, Heading, Text } from '@tabnews/ui';
import { Link } from '@tabnews/ui/primer';
import { useForm } from '@barso/forms';
import { Box, Button, Flash, FormField, Heading, Text } from '@barso/ui';
import { Link } from '@barso/ui/primer';

import { SubmittedFields } from './SubmittedFields.jsx';

Expand Down
2 changes: 1 addition & 1 deletion examples/form/components/SubmittedFields.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Dialog } from '@tabnews/ui';
import { Dialog } from '@barso/ui';

export function SubmittedFields({ state, updateState }) {
const value = state.dialog.value;
Expand Down
2 changes: 1 addition & 1 deletion examples/form/components/ThemeSwitcher.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button, useTheme } from '@barso/ui';
import { MoonIcon, SunIcon } from '@primer/octicons-react';
import { Button, useTheme } from '@tabnews/ui';

export function ThemeSwitcher() {
const { resolvedColorMode: mode, setColorMode } = useTheme();
Expand Down
2 changes: 1 addition & 1 deletion examples/form/form-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
state,
street,
username,
} from '@tabnews/forms';
} from '@barso/forms';

export const product = {
cta: 'Encontrou aquele Produto Top que você queria',
Expand Down
2 changes: 1 addition & 1 deletion examples/form/next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
transpilePackages: ['@primer/react', '@tabnews/ui'],
transpilePackages: ['@barso/ui', '@primer/react'],
};
4 changes: 2 additions & 2 deletions examples/form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"dependencies": {
"@faker-js/faker": "9.9.0",
"@primer/octicons-react": "19.15.2",
"@tabnews/forms": "0.4.1",
"@tabnews/ui": "0.6.2",
"@barso/forms": "0.4.1",
"@barso/ui": "0.6.2",
"next": "15.3.2",
"react": "18.3.1",
"react-dom": "18.3.1",
Expand Down
4 changes: 2 additions & 2 deletions examples/form/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AutoThemeProvider } from '@tabnews/ui';
import '@tabnews/ui/css';
import { AutoThemeProvider } from '@barso/ui';
import '@barso/ui/css';

import { NotificationsProvider } from '../components/Notifications';

Expand Down
2 changes: 1 addition & 1 deletion examples/form/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { configureDocument, Document } from '@tabnews/ui/document';
import { configureDocument, Document } from '@barso/ui/document';

configureDocument({
htmlProps: {
Expand Down
4 changes: 2 additions & 2 deletions examples/markdown/app/layout.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PrimerRoot } from '@tabnews/ui';
import '@tabnews/ui/css';
import { PrimerRoot } from '@barso/ui';
import '@barso/ui/css';

import { DefaultLayout } from '../components/DefaultLayout.jsx';

Expand Down
2 changes: 1 addition & 1 deletion examples/markdown/app/page.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client';
import { MarkdownEditor } from '@tabnews/ui/markdown';
import { MarkdownEditor } from '@barso/ui/markdown';
import { useState } from 'react';

import { mdContent, shouldAddNofollow } from '../md-example.js';
Expand Down
2 changes: 1 addition & 1 deletion examples/markdown/components/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use client';
import { Header as PrimerHeader } from '@tabnews/ui/primer';
import { Header as PrimerHeader } from '@barso/ui/primer';
import NextLink from 'next/link';

import { ThemeSwitcher } from './ThemeSwitcher.jsx';
Expand Down
2 changes: 1 addition & 1 deletion examples/markdown/components/ThemeSwitcher.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button, useTheme } from '@barso/ui';
import { MoonIcon, SunIcon } from '@primer/octicons-react';
import { Button, useTheme } from '@tabnews/ui';

export function ThemeSwitcher() {
const { resolvedColorMode: mode, setColorMode } = useTheme();
Expand Down
2 changes: 1 addition & 1 deletion examples/markdown/md-example.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isTrustedDomain } from '@tabnews/helpers';
import { isTrustedDomain } from '@barso/helpers';

export const shouldAddNofollow = (url) => !isTrustedDomain(url);

Expand Down
2 changes: 1 addition & 1 deletion examples/markdown/next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
transpilePackages: ['@primer/react', '@tabnews/ui'],
transpilePackages: ['@barso/ui', '@primer/react'],
};
4 changes: 2 additions & 2 deletions examples/markdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"start": "next start"
},
"dependencies": {
"@tabnews/helpers": "0.4.1",
"@tabnews/ui": "0.6.2",
"@barso/helpers": "0.4.1",
"@barso/ui": "0.6.2",
"next": "15.3.2",
"react": "18.3.1",
"react-dom": "18.3.1"
Expand Down
4 changes: 2 additions & 2 deletions examples/markdown/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AutoThemeProvider } from '@tabnews/ui';
import '@tabnews/ui/css';
import { AutoThemeProvider } from '@barso/ui';
import '@barso/ui/css';

import { DefaultLayout } from '../components/DefaultLayout';

Expand Down
2 changes: 1 addition & 1 deletion examples/markdown/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { configureDocument, Document } from '@tabnews/ui/document';
import { configureDocument, Document } from '@barso/ui/document';

configureDocument({
htmlProps: {
Expand Down
2 changes: 1 addition & 1 deletion examples/markdown/pages/viewer.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MarkdownViewer } from '@tabnews/ui/markdown';
import { MarkdownViewer } from '@barso/ui/markdown';

import { mdContent, shouldAddNofollow } from '../md-example.js';

Expand Down
Loading