@andreyyolkin/keycloakify-vue 0.2.0 → 0.2.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
@@ -41,6 +41,14 @@ The easiest way to get started is the official starter template:
41
41
  and `IdpReviewUserProfile`.
42
42
  - **`i18nBuilder`** — factory for wiring Keycloakify's `noJsx` i18n engine into Vue (returns `msg()` /
43
43
  `advancedMsg()` that produce sanitized `VNode`s).
44
+ > **`withCustomTranslations` must be called from a plain `.ts`/`.tsx`/`.js` file, never from a `.vue` SFC.**
45
+ > At build time, `keycloakify`'s `generateMessageProperties` step statically scans your theme source for a
46
+ > `withCustomTranslations({...})` call to produce the server-side `messages_<lang>.properties` bundle — but
47
+ > it only scans files matching `/\.(js|ts|tsx)$/`, so a call placed inside a `<script setup>` block of a
48
+ > `.vue` file is silently skipped and those keys never reach the server bundle (client-side `msg()` still
49
+ > works, which can make the gap easy to miss). Keep your `i18nBuilder(...).withCustomTranslations(...)`
50
+ > call in a dedicated `i18n.ts` (as in this repo's `stories/login/i18n.ts`) and import it from your `.vue`
51
+ > components instead.
44
52
  - **Account theme** — importable from `@andreyyolkin/keycloakify-vue/account`: its own `DefaultPage` + `Template`,
45
53
  the 7 account pages at `@andreyyolkin/keycloakify-vue/account/pages/*.vue`, and an account `i18nBuilder`.
46
54
  - **`bin` handlers** — `_keycloakify-custom-handler` delegates `update-kc-gen`, `eject-page`,
@@ -1,7 +1,7 @@
1
- import { type ClassKey, type TemplateProps } from '../TemplateProps';
1
+ import type { ClassKey } from '../TemplateProps';
2
2
  import type { Component } from 'vue';
3
3
  export type PageProps<NarrowedKcContext, I18n> = {
4
- Template: Component<TemplateProps<NarrowedKcContext, I18n>>;
4
+ Template: Component;
5
5
  kcContext: NarrowedKcContext;
6
6
  i18n: I18n;
7
7
  doUseDefaultCss: boolean;
@@ -1,7 +1,7 @@
1
- import { type ClassKey, type TemplateProps } from '../TemplateProps';
1
+ import type { ClassKey } from '../TemplateProps';
2
2
  import type { Component } from 'vue';
3
3
  export type PageProps<NarrowedKcContext, I18n> = {
4
- Template: Component<TemplateProps<NarrowedKcContext, I18n>>;
4
+ Template: Component;
5
5
  kcContext: NarrowedKcContext;
6
6
  i18n: I18n;
7
7
  doUseDefaultCss: boolean;
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "publishConfig": {
17
17
  "access": "public"
18
18
  },
19
- "version": "0.2.0",
19
+ "version": "0.2.1",
20
20
  "type": "module",
21
21
  "files": [
22
22
  "keycloakify-vue",
@@ -1,8 +1,15 @@
1
- import { type ClassKey, type TemplateProps } from '../TemplateProps';
1
+ import type { ClassKey } from '../TemplateProps';
2
2
  import type { Component } from 'vue';
3
3
 
4
4
  export type PageProps<NarrowedKcContext, I18n> = {
5
- Template: Component<TemplateProps<NarrowedKcContext, I18n>>;
5
+ // Template — это общий shell, который host прокидывает в страницу как есть (импортированный
6
+ // Template.vue). Его тип — `__VLS_WithSlots<DefineComponent<...>>`, и он структурно НЕ
7
+ // присваивается к `Component<TemplateProps<...>>`: расходятся и форма пропсов SFC, и параметр
8
+ // I18n (у host-темы I18n может быть расширен своими message-ключами). В keycloakify-react это
9
+ // не всплывает — там компонент это функция, а функции контравариантны по пропсам. В Vue же
10
+ // строгий чекер (vize) такое присваивание роняет. Страница Template не типизирует (только
11
+ // прокидывает во враппер), поэтому берём непараметризованный `Component`.
12
+ Template: Component;
6
13
  kcContext: NarrowedKcContext;
7
14
  i18n: I18n;
8
15
  doUseDefaultCss: boolean;
@@ -1,8 +1,15 @@
1
- import { type ClassKey, type TemplateProps } from '../TemplateProps';
1
+ import type { ClassKey } from '../TemplateProps';
2
2
  import type { Component } from 'vue';
3
3
 
4
4
  export type PageProps<NarrowedKcContext, I18n> = {
5
- Template: Component<TemplateProps<NarrowedKcContext, I18n>>;
5
+ // Template — это общий shell, который host прокидывает в страницу как есть (импортированный
6
+ // Template.vue). Его тип — `__VLS_WithSlots<DefineComponent<...>>`, и он структурно НЕ
7
+ // присваивается к `Component<TemplateProps<...>>`: расходятся и форма пропсов SFC, и параметр
8
+ // I18n (у host-темы I18n может быть расширен своими message-ключами). В keycloakify-react это
9
+ // не всплывает — там компонент это функция, а функции контравариантны по пропсам. В Vue же
10
+ // строгий чекер (vize) такое присваивание роняет. Страница Template не типизирует (только
11
+ // прокидывает во враппер), поэтому берём непараметризованный `Component`.
12
+ Template: Component;
6
13
  kcContext: NarrowedKcContext;
7
14
  i18n: I18n;
8
15
  doUseDefaultCss: boolean;