@cupcodev/ui 1.4.0 → 2.0.1

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/README.md CHANGED
@@ -64,6 +64,7 @@ Para componentes que dependem de env em runtime (chat/supabase/telescup), config
64
64
  import { setCupcodeRuntimeEnv } from "@cupcodev/ui";
65
65
 
66
66
  setCupcodeRuntimeEnv({
67
+ VITE_APP_VERSION: import.meta.env.VITE_APP_VERSION,
67
68
  VITE_SUPABASE_URL: import.meta.env.VITE_SUPABASE_URL,
68
69
  VITE_SUPABASE_ANON_KEY: import.meta.env.VITE_SUPABASE_ANON_KEY,
69
70
  VITE_TELESCUP_BASE_URL: import.meta.env.VITE_TELESCUP_BASE_URL,
@@ -71,6 +72,21 @@ setCupcodeRuntimeEnv({
71
72
  });
72
73
  ```
73
74
 
75
+ Para manter a versão do menu do usuário sincronizada com o `package.json` do app consumidor, injete `VITE_APP_VERSION` via Vite:
76
+
77
+ ```ts
78
+ // vite.config.ts
79
+ import packageJson from "./package.json" with { type: "json" };
80
+
81
+ export default defineConfig({
82
+ define: {
83
+ "import.meta.env.VITE_APP_VERSION": JSON.stringify(packageJson.version),
84
+ },
85
+ });
86
+ ```
87
+
88
+ `UserMenuCupcode` (e `MainNavbar`) aceitam `appVersion` para override explícito. Sem prop, o menu resolve a versão via runtime env pelas chaves exportadas em `CUPCODE_APP_VERSION_ENV_KEYS`.
89
+
74
90
  Observação:
75
91
  - Ao instalar/atualizar `@cupcodev/ui`, o pacote exibe esse lembrete no `postinstall`.
76
92
  - Se o projeto usa `npm install --ignore-scripts`, esse aviso não aparece; nesse caso, aplique a configuração manualmente.
@@ -160,6 +176,8 @@ Para configurar o chat com dados reais e notificacoes em tempo real:
160
176
  - `scripts/supabase/chat/03_enable_realtime.sql`
161
177
  - `scripts/supabase/chat/04_verify_realtime.sql`
162
178
  - `scripts/supabase/chat/06_fix_rls_and_avatars_for_external_auth.sql` (se usar auth externa)
179
+ - `scripts/supabase/chat/15_enable_presence_global_realtime.sql` (presenca global com idle auto)
180
+ - `scripts/supabase/chat/16_verify_presence_global_realtime.sql`
163
181
  3. Reinicie o app: `npm run dev`.
164
182
  4. Valide o fluxo com `scripts/supabase/chat/05_acceptance_checks.sql`.
165
183