xertica-ui 2.9.6 → 2.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/bin/cli.ts +1 -1
- package/bin/language-config.ts +1 -1
- package/components/ui/input-otp/input-otp.test.tsx +14 -1
- package/dist/cli.js +2 -2
- package/dist/xertica-ui.css +1 -1
- package/package.json +4 -2
- package/templates/src/pages/LandingPage.tsx +348 -2
package/CHANGELOG.md
CHANGED
|
@@ -11,12 +11,22 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
+
## [2.9.7] — 2026-07-14
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **Suíte de testes com exceção não tratada bloqueando `npm publish`** — o pacote de terceiros `input-otp` agenda três `setTimeout` internos (0ms/10ms/50ms) em um `useEffect` sem função de limpeza no unmount. Ao rodar a suíte completa, o cleanup automático do Testing Library desmontava o `InputOTP` entre um teste e outro sem cancelar esses timers, que disparavam mais tarde — já fora do ambiente jsdom daquele arquivo — lançando `ReferenceError: window is not defined` como exceção não tratada. Isso fazia `vitest run` sair com erro mesmo com todos os 358 testes passando, derrubando a etapa `test:unit` do `prepublishOnly` e, com isso, qualquer tentativa de `npm publish`. Corrigido em `components/ui/input-otp/input-otp.test.tsx` usando `vi.useFakeTimers()`/`vi.useRealTimers()` ao redor de cada teste, impedindo que os timers da lib vazem para fora do ciclo de vida do teste.
|
|
19
|
+
- **`npm publish` alertava sobre correção automática do campo `bin`** — `"bin": "./dist/cli.js"` (string, com prefixo `./`) era normalizado pelo próprio npm no momento do publish, gerando o aviso `npm auto-corrected some errors in your package.json`. Corrigido escrevendo `bin` já na forma canônica esperada (`{ "xertica-ui": "dist/cli.js" }`), sem mudança de comportamento — apenas elimina o aviso.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
14
23
|
## [2.9.6] — 2026-07-14
|
|
15
24
|
|
|
16
25
|
### Added
|
|
17
26
|
|
|
18
27
|
- **CLI `init` pergunta o tipo de projeto antes de tudo** — novo primeiro prompt `O que você deseja criar?` com duas opções: `Full system` (o fluxo completo existente, inalterado: auth, sidebar, páginas, i18n) e `Web page` (um scaffold mínimo com apenas a landing page de marketing). Escolhendo `Web page`, o fluxo se reduz a 3 prompts — idiomas (multiselect), tema (select) e instalação de dependências (confirm) — e o projeto já sai pronto, sem nenhuma outra configuração.
|
|
19
28
|
- **Novo scaffold mínimo para "Web page"** (`initPageProject` em `bin/cli.ts`) — gera um `App.tsx` que renderiza `LandingPage` (via novo `generateLandingAppTsx` em `bin/language-config.ts`) diretamente dentro de `XerticaProvider`, sem `Router`, `QueryClientProvider` ou `AuthProvider`. Não cria `AuthContext.tsx`, `AuthGuard.tsx`, `AppLayout.tsx`, `src/shared/` nem `src/features/` — apenas `src/app/App.tsx`, `src/pages/LandingPage.tsx`, i18n/locales e tokens de tema. Também omite `CLAUDE.md`/`guidelines/` (documentam a arquitetura FSD de auth, inexistente neste scaffold) e `.env.example` (chaves usadas só pelo assistente/mapa).
|
|
29
|
+
- **`src/pages/LandingPage.tsx` do scaffold "Web page" ganha conteúdo de demonstração real** — em vez de um re-export de `xertica-ui/pages`, o template (`templates/src/pages/LandingPage.tsx`) agora traz a composição completa da landing page (Hero, cards, feature rows, "how it works", compliance/stats, CTA, footer) montada localmente a partir de `xertica-ui/blocks`/`xertica-ui/brand`, igual ao padrão já usado pelos demais templates (`HomeContent.tsx` etc.) — o usuário recebe algo editável como base, não uma caixa-preta importada da lib.
|
|
20
30
|
- **`.xertica.json` ganha o campo `projectType: 'page' | 'system'`** — projetos escaffoldados antes desta versão não têm o campo e são tratados como `'system'` em todos os pontos que o leem, preservando compatibilidade.
|
|
21
31
|
|
|
22
32
|
### Changed
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **Enterprise-grade React design system** built on Tailwind CSS v4, Radix UI, and Lucide Icons — with a robust AI-first documentation layer for precise LLM-driven composition and autonomous agent interaction.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/xertica-ui)
|
|
6
6
|
[](./LICENSE)
|
|
7
7
|
|
|
8
8
|
---
|
package/bin/cli.ts
CHANGED
|
@@ -439,7 +439,7 @@ async function initPageProject(targetDir: string, templatesDir: string): Promise
|
|
|
439
439
|
}
|
|
440
440
|
console.log(chalk.cyan(' npm run dev'));
|
|
441
441
|
console.log();
|
|
442
|
-
console.log(chalk.gray('
|
|
442
|
+
console.log(chalk.gray(' Edit the demo content in src/pages/LandingPage.tsx'));
|
|
443
443
|
console.log(chalk.gray(' Customize the theme in src/styles/xertica/tokens.css'));
|
|
444
444
|
console.log(chalk.gray(' To change the theme or languages later: npx xertica-ui update'));
|
|
445
445
|
} catch (error) {
|
package/bin/language-config.ts
CHANGED
|
@@ -374,7 +374,7 @@ export function generateLandingAppTsx(
|
|
|
374
374
|
|
|
375
375
|
return `import React from 'react';
|
|
376
376
|
import { XerticaProvider } from 'xertica-ui/brand';
|
|
377
|
-
import { LandingPage } from '
|
|
377
|
+
import { LandingPage } from '../pages/LandingPage';
|
|
378
378
|
|
|
379
379
|
export default function App() {
|
|
380
380
|
return (
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
import { render, screen, fireEvent } from '@testing-library/react';
|
|
2
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
3
3
|
import { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator } from './input-otp';
|
|
4
4
|
import { OTPInputContext } from 'input-otp';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
describe('InputOTP', () => {
|
|
8
|
+
// input-otp schedules internal setTimeout(0/10/50) calls on mount that it
|
|
9
|
+
// never cancels on unmount. Under real timers those fire after this file's
|
|
10
|
+
// jsdom environment is torn down, throwing `window is not defined` as an
|
|
11
|
+
// unhandled error in later test files. Fake timers keep them from ever
|
|
12
|
+
// firing for real.
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
vi.useFakeTimers();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
afterEach(() => {
|
|
18
|
+
vi.useRealTimers();
|
|
19
|
+
});
|
|
20
|
+
|
|
8
21
|
it('renders children correctly', () => {
|
|
9
22
|
render(
|
|
10
23
|
<OTPInputContext.Provider value={{ slots: [{ char: 'A' }] } as any}>
|
package/dist/cli.js
CHANGED
|
@@ -905,7 +905,7 @@ function generateLandingAppTsx(selectedCodes, disableDarkMode = false) {
|
|
|
905
905
|
const availableLanguagesProp = buildAvailableLanguagesProp(selectedCodes, " ");
|
|
906
906
|
return `import React from 'react';
|
|
907
907
|
import { XerticaProvider } from 'xertica-ui/brand';
|
|
908
|
-
import { LandingPage } from '
|
|
908
|
+
import { LandingPage } from '../pages/LandingPage';
|
|
909
909
|
|
|
910
910
|
export default function App() {
|
|
911
911
|
return (
|
|
@@ -1261,7 +1261,7 @@ async function initPageProject(targetDir, templatesDir) {
|
|
|
1261
1261
|
}
|
|
1262
1262
|
console.log(chalk.cyan(" npm run dev"));
|
|
1263
1263
|
console.log();
|
|
1264
|
-
console.log(chalk.gray("
|
|
1264
|
+
console.log(chalk.gray(" Edit the demo content in src/pages/LandingPage.tsx"));
|
|
1265
1265
|
console.log(chalk.gray(" Customize the theme in src/styles/xertica/tokens.css"));
|
|
1266
1266
|
console.log(chalk.gray(" To change the theme or languages later: npx xertica-ui update"));
|
|
1267
1267
|
} catch (error) {
|