@cupcodev/ui 1.4.0 → 2.0.0
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 +16 -0
- package/dist/index.cjs +875 -563
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +952 -643
- package/dist/styles.css +1 -1
- package/package.json +1 -1
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.
|