@andreyyolkin/keycloakify-vue 0.2.0 → 0.2.2

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
@@ -22,7 +22,7 @@ packaging unchanged.
22
22
  npm install --save-dev @andreyyolkin/keycloakify-vue
23
23
  ```
24
24
 
25
- **Peer dependencies:** `keycloakify ^11.15.1` and `vue ^3.5.0` must be installed in your project.
25
+ **Peer dependencies:** `keycloakify ^11.15.1` and `vue ^3.5.44` must be installed in your project.
26
26
 
27
27
  The easiest way to get started is the official starter template:
28
28
 
@@ -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;
@@ -18,7 +18,11 @@ export declare namespace FormFieldError {
18
18
  };
19
19
  type PasswordPolicy = {
20
20
  type: 'passwordPolicy';
21
- name: keyof PasswordPolicies;
21
+ /**
22
+ * passwordHistory and forceExpiredPasswordChange can't be validated client side
23
+ * (they require the stored credentials), they are only informative.
24
+ */
25
+ name: Exclude<keyof PasswordPolicies, 'passwordHistory' | 'forceExpiredPasswordChange'>;
22
26
  };
23
27
  type Server = {
24
28
  type: 'server';
@@ -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.2",
20
20
  "type": "module",
21
21
  "files": [
22
22
  "keycloakify-vue",
@@ -48,8 +48,8 @@
48
48
  "_keycloakify-custom-handler": "keycloakify-vue/bin/index.js"
49
49
  },
50
50
  "peerDependencies": {
51
- "keycloakify": "^11.16.0",
52
- "vue": "^3.5.0"
51
+ "keycloakify": "^11.16.4",
52
+ "vue": "^3.5.44"
53
53
  },
54
54
  "dependencies": {
55
55
  "tsafe": "^1.8.12"
@@ -72,7 +72,7 @@
72
72
  "eslint-plugin-vue": "^10.2.0",
73
73
  "globals": "^17.6.0",
74
74
  "jsdom": "^29.1.1",
75
- "keycloakify": "^11.16.0",
75
+ "keycloakify": "^11.16.4",
76
76
  "prettier": "^3.8.3",
77
77
  "publint": "^0.3.21",
78
78
  "storybook": "^10",
@@ -81,7 +81,7 @@
81
81
  "typescript-eslint": "^8.60.1",
82
82
  "vite": "^8.0.16",
83
83
  "vitest": "^4.1.9",
84
- "vue": "^3.5.38",
84
+ "vue": "^3.5.44",
85
85
  "vue-eslint-parser": "^10.1.3",
86
86
  "vue-tsc": "^3.3.5"
87
87
  },
@@ -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;
@@ -25,7 +25,11 @@ export namespace FormFieldError {
25
25
  export type Validator = { type: 'validator'; name: keyof Validators };
26
26
  export type PasswordPolicy = {
27
27
  type: 'passwordPolicy';
28
- name: keyof PasswordPolicies;
28
+ /**
29
+ * passwordHistory and forceExpiredPasswordChange can't be validated client side
30
+ * (they require the stored credentials), they are only informative.
31
+ */
32
+ name: Exclude<keyof PasswordPolicies, 'passwordHistory' | 'forceExpiredPasswordChange'>;
29
33
  };
30
34
  export type Server = { type: 'server' };
31
35
  export type Other = {
@@ -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;