diff --git a/package.json b/package.json index b9a0cb8d..6abd30ad 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,11 @@ "copy-files": "copyfiles -u 1 src/**/*.ftl", "pretest": "yarn build:test", "test": "node dist_test/test/bin && node dist_test/test/lib", - "generate-messages": "node dist/bin/generate-i18n-messages.js", - "link_in_test_app": "node dist/bin/link_in_test_app.js", "_format": "prettier '**/*.{ts,tsx,json,md}'", "format": "yarn _format --write", "format:check": "yarn _format --list-different", "link-in-app": "ts-node --skipProject src/scripts/link-in-app.ts", + "generate-messages": "ts-node --skipProject src/scripts/generate-i18n-messages.ts", "link-in-starter": "yarn link-in-app keycloakify-advanced-starter", "tsc-watch": "tsc -p src/bin -w & tsc -p src/lib -w " }, diff --git a/src/lib/components/KcApp.tsx b/src/lib/KcApp.tsx similarity index 68% rename from src/lib/components/KcApp.tsx rename to src/lib/KcApp.tsx index fd34d1b1..8efcdd24 100644 --- a/src/lib/components/KcApp.tsx +++ b/src/lib/KcApp.tsx @@ -1,31 +1,31 @@ import React, { lazy, Suspense } from "react"; -import { __unsafe_useI18n as useI18n } from "../i18n"; -import DefaultTemplate from "./Template"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; -import type { I18nBase } from "../i18n"; +import { __unsafe_useI18n as useI18n } from "./i18n"; +import DefaultTemplate from "./pages/Template"; +import type { KcContextBase } from "./kcContext/KcContextBase"; +import type { PageProps } from "./KcProps"; +import type { I18nBase } from "./i18n"; -const Login = lazy(() => import("./Login")); -const Register = lazy(() => import("./Register")); -const RegisterUserProfile = lazy(() => import("./RegisterUserProfile")); -const Info = lazy(() => import("./Info")); -const Error = lazy(() => import("./Error")); -const LoginResetPassword = lazy(() => import("./LoginResetPassword")); -const LoginVerifyEmail = lazy(() => import("./LoginVerifyEmail")); -const Terms = lazy(() => import("./Terms")); -const LoginOtp = lazy(() => import("./LoginOtp")); -const LoginPassword = lazy(() => import("./LoginPassword")); -const LoginUsername = lazy(() => import("./LoginUsername")); -const WebauthnAuthenticate = lazy(() => import("./WebauthnAuthenticate")); -const LoginUpdatePassword = lazy(() => import("./LoginUpdatePassword")); -const LoginUpdateProfile = lazy(() => import("./LoginUpdateProfile")); -const LoginIdpLinkConfirm = lazy(() => import("./LoginIdpLinkConfirm")); -const LoginPageExpired = lazy(() => import("./LoginPageExpired")); -const LoginIdpLinkEmail = lazy(() => import("./LoginIdpLinkEmail")); -const LoginConfigTotp = lazy(() => import("./LoginConfigTotp")); -const LogoutConfirm = lazy(() => import("./LogoutConfirm")); -const UpdateUserProfile = lazy(() => import("./UpdateUserProfile")); -const IdpReviewUserProfile = lazy(() => import("./IdpReviewUserProfile")); +const Login = lazy(() => import("./pages/Login")); +const Register = lazy(() => import("./pages/Register")); +const RegisterUserProfile = lazy(() => import("./pages/RegisterUserProfile")); +const Info = lazy(() => import("./pages/Info")); +const Error = lazy(() => import("./pages/Error")); +const LoginResetPassword = lazy(() => import("./pages/LoginResetPassword")); +const LoginVerifyEmail = lazy(() => import("./pages/LoginVerifyEmail")); +const Terms = lazy(() => import("./pages/Terms")); +const LoginOtp = lazy(() => import("./pages/LoginOtp")); +const LoginPassword = lazy(() => import("./pages/LoginPassword")); +const LoginUsername = lazy(() => import("./pages/LoginUsername")); +const WebauthnAuthenticate = lazy(() => import("./pages/WebauthnAuthenticate")); +const LoginUpdatePassword = lazy(() => import("./pages/LoginUpdatePassword")); +const LoginUpdateProfile = lazy(() => import("./pages/LoginUpdateProfile")); +const LoginIdpLinkConfirm = lazy(() => import("./pages/LoginIdpLinkConfirm")); +const LoginPageExpired = lazy(() => import("./pages/LoginPageExpired")); +const LoginIdpLinkEmail = lazy(() => import("./pages/LoginIdpLinkEmail")); +const LoginConfigTotp = lazy(() => import("./pages/LoginConfigTotp")); +const LogoutConfirm = lazy(() => import("./pages/LogoutConfirm")); +const UpdateUserProfile = lazy(() => import("./pages/UpdateUserProfile")); +const IdpReviewUserProfile = lazy(() => import("./pages/IdpReviewUserProfile")); export default function KcApp(props_: PageProps) { const { kcContext, i18n: userProvidedI18n, Template = DefaultTemplate, ...kcProps } = props_; diff --git a/src/lib/components/shared/KcProps.ts b/src/lib/KcProps.ts similarity index 98% rename from src/lib/components/shared/KcProps.ts rename to src/lib/KcProps.ts index 50c9a055..6e089fa4 100644 --- a/src/lib/components/shared/KcProps.ts +++ b/src/lib/KcProps.ts @@ -1,8 +1,8 @@ -import { allPropertiesValuesToUndefined } from "../../tools/allPropertiesValuesToUndefined"; +import { allPropertiesValuesToUndefined } from "./tools/allPropertiesValuesToUndefined"; import { assert } from "tsafe/assert"; -import type { KcContextBase } from "../../getKcContext"; +import type { KcContextBase } from "./kcContext"; import type { ReactNode } from "react"; -import { I18nBase } from "../../i18n"; +import { I18nBase } from "./i18n"; /** Class names can be provided as an array or separated by whitespace */ export type KcPropsGeneric = { diff --git a/src/lib/components/shared/Template.tsx b/src/lib/Template.tsx similarity index 96% rename from src/lib/components/shared/Template.tsx rename to src/lib/Template.tsx index 3fac5233..af23a347 100644 --- a/src/lib/components/shared/Template.tsx +++ b/src/lib/Template.tsx @@ -1,13 +1,13 @@ import React, { useReducer, useEffect } from "react"; -import { useCallbackFactory } from "../../tools/useCallbackFactory"; -import { useConstCallback } from "../../tools/useConstCallback"; -import { assert } from "../../tools/assert"; -import { headInsert } from "../../tools/headInsert"; -import { pathJoin } from "../../../bin/tools/pathJoin"; -import { clsx } from "../../tools/clsx"; +import { useCallbackFactory } from "./tools/useCallbackFactory"; +import { useConstCallback } from "./tools/useConstCallback"; +import { assert } from "./tools/assert"; +import { headInsert } from "./tools/headInsert"; +import { pathJoin } from "../bin/tools/pathJoin"; +import { clsx } from "./tools/clsx"; import type { TemplateProps } from "./KcProps"; -import type { KcContextBase } from "../../getKcContext/KcContextBase"; -import type { I18nBase } from "../../i18n"; +import type { KcContextBase } from "./kcContext/KcContextBase"; +import type { I18nBase } from "./i18n"; export default function Template(props: TemplateProps) { const { diff --git a/src/lib/i18n/i18n.tsx b/src/lib/i18n/i18n.tsx index 37204902..785aa6d6 100644 --- a/src/lib/i18n/i18n.tsx +++ b/src/lib/i18n/i18n.tsx @@ -3,7 +3,7 @@ import "minimal-polyfills/Object.fromEntries"; import React, { useEffect, useState, useRef } from "react"; import type baseMessages from "./generated_messages/18.0.1/login/en"; import { assert } from "tsafe/assert"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; +import type { KcContextBase } from "../kcContext/KcContextBase"; import { Markdown } from "../tools/Markdown"; export const fallbackLanguageTag = "en"; diff --git a/src/lib/index.ts b/src/lib/index.ts index 15fd34af..d7c23eee 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -1,13 +1,13 @@ -export * from "./getKcContext"; +export * from "./kcContext"; export * from "./i18n"; -export { useDownloadTerms } from "./components/Terms"; +export { useDownloadTerms } from "./pages/Terms"; -export * from "./components/shared/KcProps"; +export * from "./KcProps"; export * from "./keycloakJsAdapter"; export * from "./useFormValidationSlice"; -import KcApp from "./components/KcApp"; +import KcApp from "./KcApp"; export default KcApp; diff --git a/src/lib/getKcContext/KcContextBase.ts b/src/lib/kcContext/KcContextBase.ts similarity index 99% rename from src/lib/getKcContext/KcContextBase.ts rename to src/lib/kcContext/KcContextBase.ts index be81964c..06e7e1b6 100644 --- a/src/lib/getKcContext/KcContextBase.ts +++ b/src/lib/kcContext/KcContextBase.ts @@ -2,7 +2,7 @@ import type { PageId } from "../../bin/keycloakify/generateFtl"; import { assert } from "tsafe/assert"; import type { Equals } from "tsafe"; import type { MessageKeyBase } from "../i18n"; -import type { KcTemplateClassKey } from "../components/shared/KcProps"; +import type { KcTemplateClassKey } from "../KcProps"; type ExtractAfterStartingWith = StrEnum extends `${Prefix}${infer U}` ? U : never; diff --git a/src/lib/getKcContext/getKcContext.ts b/src/lib/kcContext/getKcContext.ts similarity index 100% rename from src/lib/getKcContext/getKcContext.ts rename to src/lib/kcContext/getKcContext.ts diff --git a/src/lib/getKcContext/getKcContextFromWindow.ts b/src/lib/kcContext/getKcContextFromWindow.ts similarity index 100% rename from src/lib/getKcContext/getKcContextFromWindow.ts rename to src/lib/kcContext/getKcContextFromWindow.ts diff --git a/src/lib/getKcContext/index.ts b/src/lib/kcContext/index.ts similarity index 100% rename from src/lib/getKcContext/index.ts rename to src/lib/kcContext/index.ts diff --git a/src/lib/getKcContext/kcContextMocks/index.ts b/src/lib/kcContext/kcContextMocks/index.ts similarity index 100% rename from src/lib/getKcContext/kcContextMocks/index.ts rename to src/lib/kcContext/kcContextMocks/index.ts diff --git a/src/lib/getKcContext/kcContextMocks/kcContextMocks.ts b/src/lib/kcContext/kcContextMocks/kcContextMocks.ts similarity index 100% rename from src/lib/getKcContext/kcContextMocks/kcContextMocks.ts rename to src/lib/kcContext/kcContextMocks/kcContextMocks.ts diff --git a/src/lib/components/Error.tsx b/src/lib/pages/Error.tsx similarity index 89% rename from src/lib/components/Error.tsx rename to src/lib/pages/Error.tsx index 20f59ba1..c2e703e1 100644 --- a/src/lib/components/Error.tsx +++ b/src/lib/pages/Error.tsx @@ -1,6 +1,6 @@ import React from "react"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function Error(props: PageProps) { diff --git a/src/lib/components/IdpReviewUserProfile.tsx b/src/lib/pages/IdpReviewUserProfile.tsx similarity index 94% rename from src/lib/components/IdpReviewUserProfile.tsx rename to src/lib/pages/IdpReviewUserProfile.tsx index 2147073d..95e58e50 100644 --- a/src/lib/components/IdpReviewUserProfile.tsx +++ b/src/lib/pages/IdpReviewUserProfile.tsx @@ -1,8 +1,8 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { UserProfileFormFields } from "./shared/UserProfileCommons"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function IdpReviewUserProfile(props: PageProps) { diff --git a/src/lib/components/Info.tsx b/src/lib/pages/Info.tsx similarity index 94% rename from src/lib/components/Info.tsx rename to src/lib/pages/Info.tsx index e11e57fe..873ad239 100644 --- a/src/lib/components/Info.tsx +++ b/src/lib/pages/Info.tsx @@ -1,7 +1,7 @@ import React from "react"; import { assert } from "../tools/assert"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function Info(props: PageProps) { diff --git a/src/lib/components/Login.tsx b/src/lib/pages/Login.tsx similarity index 98% rename from src/lib/components/Login.tsx rename to src/lib/pages/Login.tsx index 719fd57d..f48bfef2 100644 --- a/src/lib/components/Login.tsx +++ b/src/lib/pages/Login.tsx @@ -2,8 +2,8 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { useConstCallback } from "../tools/useConstCallback"; import type { FormEventHandler } from "react"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function Login(props: PageProps) { diff --git a/src/lib/components/LoginConfigTotp.tsx b/src/lib/pages/LoginConfigTotp.tsx similarity index 98% rename from src/lib/components/LoginConfigTotp.tsx rename to src/lib/pages/LoginConfigTotp.tsx index cf02aec8..1c1767b8 100644 --- a/src/lib/components/LoginConfigTotp.tsx +++ b/src/lib/pages/LoginConfigTotp.tsx @@ -1,7 +1,7 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function LoginConfigTotp(props: PageProps) { diff --git a/src/lib/components/LoginIdpLinkConfirm.tsx b/src/lib/pages/LoginIdpLinkConfirm.tsx similarity index 94% rename from src/lib/components/LoginIdpLinkConfirm.tsx rename to src/lib/pages/LoginIdpLinkConfirm.tsx index 3d6a7416..c62e529f 100644 --- a/src/lib/components/LoginIdpLinkConfirm.tsx +++ b/src/lib/pages/LoginIdpLinkConfirm.tsx @@ -1,7 +1,7 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function LoginIdpLinkConfirm(props: PageProps) { diff --git a/src/lib/components/LoginIdpLinkEmail.tsx b/src/lib/pages/LoginIdpLinkEmail.tsx similarity index 91% rename from src/lib/components/LoginIdpLinkEmail.tsx rename to src/lib/pages/LoginIdpLinkEmail.tsx index 9956ca2b..017a7294 100644 --- a/src/lib/components/LoginIdpLinkEmail.tsx +++ b/src/lib/pages/LoginIdpLinkEmail.tsx @@ -1,6 +1,6 @@ import React from "react"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function LoginIdpLinkEmail(props: PageProps) { diff --git a/src/lib/components/LoginOtp.tsx b/src/lib/pages/LoginOtp.tsx similarity index 97% rename from src/lib/components/LoginOtp.tsx rename to src/lib/pages/LoginOtp.tsx index 77fd885b..8bb766c2 100644 --- a/src/lib/components/LoginOtp.tsx +++ b/src/lib/pages/LoginOtp.tsx @@ -2,8 +2,8 @@ import React, { useEffect } from "react"; import { headInsert } from "../tools/headInsert"; import { pathJoin } from "../../bin/tools/pathJoin"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function LoginOtp(props: PageProps) { diff --git a/src/lib/components/LoginPageExpired.tsx b/src/lib/pages/LoginPageExpired.tsx similarity index 90% rename from src/lib/components/LoginPageExpired.tsx rename to src/lib/pages/LoginPageExpired.tsx index b2b363a1..38717c46 100644 --- a/src/lib/components/LoginPageExpired.tsx +++ b/src/lib/pages/LoginPageExpired.tsx @@ -1,6 +1,6 @@ import React from "react"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function LoginPageExpired(props: PageProps) { diff --git a/src/lib/components/LoginPassword.tsx b/src/lib/pages/LoginPassword.tsx similarity index 96% rename from src/lib/components/LoginPassword.tsx rename to src/lib/pages/LoginPassword.tsx index aecbfdb0..2e5bd331 100644 --- a/src/lib/components/LoginPassword.tsx +++ b/src/lib/pages/LoginPassword.tsx @@ -2,8 +2,8 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { useConstCallback } from "../tools/useConstCallback"; import type { FormEventHandler } from "react"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function LoginPassword(props: PageProps) { diff --git a/src/lib/components/LoginResetPassword.tsx b/src/lib/pages/LoginResetPassword.tsx similarity index 96% rename from src/lib/components/LoginResetPassword.tsx rename to src/lib/pages/LoginResetPassword.tsx index 317d14a4..870e832f 100644 --- a/src/lib/components/LoginResetPassword.tsx +++ b/src/lib/pages/LoginResetPassword.tsx @@ -1,7 +1,7 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function LoginResetPassword(props: PageProps) { diff --git a/src/lib/components/LoginUpdatePassword.tsx b/src/lib/pages/LoginUpdatePassword.tsx similarity index 97% rename from src/lib/components/LoginUpdatePassword.tsx rename to src/lib/pages/LoginUpdatePassword.tsx index 35a187b0..d68ebc27 100644 --- a/src/lib/components/LoginUpdatePassword.tsx +++ b/src/lib/pages/LoginUpdatePassword.tsx @@ -1,7 +1,7 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function LoginUpdatePassword(props: PageProps) { diff --git a/src/lib/components/LoginUpdateProfile.tsx b/src/lib/pages/LoginUpdateProfile.tsx similarity index 98% rename from src/lib/components/LoginUpdateProfile.tsx rename to src/lib/pages/LoginUpdateProfile.tsx index 50a03b03..50ba53cd 100644 --- a/src/lib/components/LoginUpdateProfile.tsx +++ b/src/lib/pages/LoginUpdateProfile.tsx @@ -1,7 +1,7 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function LoginUpdateProfile(props: PageProps) { diff --git a/src/lib/components/LoginUsername.tsx b/src/lib/pages/LoginUsername.tsx similarity index 98% rename from src/lib/components/LoginUsername.tsx rename to src/lib/pages/LoginUsername.tsx index 8d2aeb54..e9961dac 100644 --- a/src/lib/components/LoginUsername.tsx +++ b/src/lib/pages/LoginUsername.tsx @@ -2,8 +2,8 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { useConstCallback } from "../tools/useConstCallback"; import type { FormEventHandler } from "react"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function LoginUsername(props: PageProps) { diff --git a/src/lib/components/LoginVerifyEmail.tsx b/src/lib/pages/LoginVerifyEmail.tsx similarity index 89% rename from src/lib/components/LoginVerifyEmail.tsx rename to src/lib/pages/LoginVerifyEmail.tsx index 3312da03..0bacdc9e 100644 --- a/src/lib/components/LoginVerifyEmail.tsx +++ b/src/lib/pages/LoginVerifyEmail.tsx @@ -1,6 +1,6 @@ import React from "react"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function LoginVerifyEmail(props: PageProps) { diff --git a/src/lib/components/LogoutConfirm.tsx b/src/lib/pages/LogoutConfirm.tsx similarity index 95% rename from src/lib/components/LogoutConfirm.tsx rename to src/lib/pages/LogoutConfirm.tsx index 1bc29c2b..4fc4103c 100644 --- a/src/lib/components/LogoutConfirm.tsx +++ b/src/lib/pages/LogoutConfirm.tsx @@ -1,7 +1,7 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function LogoutConfirm(props: PageProps) { diff --git a/src/lib/components/Register.tsx b/src/lib/pages/Register.tsx similarity index 98% rename from src/lib/components/Register.tsx rename to src/lib/pages/Register.tsx index 6742eae4..75bca9ff 100644 --- a/src/lib/components/Register.tsx +++ b/src/lib/pages/Register.tsx @@ -1,7 +1,7 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function Register(props: PageProps) { diff --git a/src/lib/components/RegisterUserProfile.tsx b/src/lib/pages/RegisterUserProfile.tsx similarity index 95% rename from src/lib/components/RegisterUserProfile.tsx rename to src/lib/pages/RegisterUserProfile.tsx index 21db54ff..e1b12144 100644 --- a/src/lib/components/RegisterUserProfile.tsx +++ b/src/lib/pages/RegisterUserProfile.tsx @@ -1,8 +1,8 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { UserProfileFormFields } from "./shared/UserProfileCommons"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function RegisterUserProfile(props: PageProps) { diff --git a/src/lib/components/Template.tsx b/src/lib/pages/Template.tsx similarity index 98% rename from src/lib/components/Template.tsx rename to src/lib/pages/Template.tsx index a9438dca..39f72f1e 100644 --- a/src/lib/components/Template.tsx +++ b/src/lib/pages/Template.tsx @@ -1,11 +1,11 @@ import React, { useReducer, useEffect } from "react"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; +import type { KcContextBase } from "../kcContext"; import { assert } from "../tools/assert"; import { useCallbackFactory } from "../tools/useCallbackFactory"; import { headInsert } from "../tools/headInsert"; import { pathJoin } from "../../bin/tools/pathJoin"; import { useConstCallback } from "../tools/useConstCallback"; -import type { TemplateProps } from "./shared/KcProps"; +import type { TemplateProps } from "../KcProps"; import { clsx } from "../tools/clsx"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/components/Terms.tsx b/src/lib/pages/Terms.tsx similarity index 96% rename from src/lib/components/Terms.tsx rename to src/lib/pages/Terms.tsx index 483a0b7d..755864c2 100644 --- a/src/lib/components/Terms.tsx +++ b/src/lib/pages/Terms.tsx @@ -9,8 +9,8 @@ import { useConst } from "../tools/useConst"; import { useConstCallback } from "../tools/useConstCallback"; import { Markdown } from "../tools/Markdown"; import type { Extends } from "tsafe"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function Terms(props: PageProps) { diff --git a/src/lib/components/UpdateUserProfile.tsx b/src/lib/pages/UpdateUserProfile.tsx similarity index 96% rename from src/lib/components/UpdateUserProfile.tsx rename to src/lib/pages/UpdateUserProfile.tsx index c3f1a7b5..a14fab56 100644 --- a/src/lib/components/UpdateUserProfile.tsx +++ b/src/lib/pages/UpdateUserProfile.tsx @@ -1,8 +1,8 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { UserProfileFormFields } from "./shared/UserProfileCommons"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function UpdateUserProfile(props: PageProps) { diff --git a/src/lib/components/WebauthnAuthenticate.tsx b/src/lib/pages/WebauthnAuthenticate.tsx similarity index 98% rename from src/lib/components/WebauthnAuthenticate.tsx rename to src/lib/pages/WebauthnAuthenticate.tsx index 7b40909d..baed08e6 100644 --- a/src/lib/components/WebauthnAuthenticate.tsx +++ b/src/lib/pages/WebauthnAuthenticate.tsx @@ -3,8 +3,8 @@ import { clsx } from "../tools/clsx"; import type { MessageKeyBase } from "../i18n"; import { base64url } from "rfc4648"; import { useConstCallback } from "../tools/useConstCallback"; -import type { KcContextBase } from "../getKcContext/KcContextBase"; -import type { PageProps } from "./shared/KcProps"; +import type { KcContextBase } from "../kcContext"; +import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; export default function WebauthnAuthenticate(props: PageProps) { diff --git a/src/lib/components/shared/UserProfileCommons.tsx b/src/lib/pages/shared/UserProfileCommons.tsx similarity index 98% rename from src/lib/components/shared/UserProfileCommons.tsx rename to src/lib/pages/shared/UserProfileCommons.tsx index f052b6e4..1825d1b7 100644 --- a/src/lib/components/shared/UserProfileCommons.tsx +++ b/src/lib/pages/shared/UserProfileCommons.tsx @@ -1,6 +1,6 @@ import React, { useEffect, Fragment } from "react"; -import type { KcProps } from "./KcProps"; -import type { Attribute } from "../../getKcContext/KcContextBase"; +import type { KcProps } from "../../KcProps"; +import type { Attribute } from "../../kcContext/KcContextBase"; import { clsx } from "../../tools/clsx"; import type { ReactComponent } from "../../tools/ReactComponent"; import { useCallbackFactory } from "../../tools/useCallbackFactory"; diff --git a/src/lib/useFormValidationSlice.tsx b/src/lib/useFormValidationSlice.tsx index 9104410b..aa5cd123 100644 --- a/src/lib/useFormValidationSlice.tsx +++ b/src/lib/useFormValidationSlice.tsx @@ -1,6 +1,6 @@ import "./tools/Array.prototype.every"; import React, { useMemo, useReducer, Fragment } from "react"; -import type { KcContextBase, Validators, Attribute } from "./getKcContext/KcContextBase"; +import type { KcContextBase, Validators, Attribute } from "./kcContext/KcContextBase"; import type { I18nBase, MessageKeyBase } from "./i18n"; import { useConstCallback } from "./tools/useConstCallback"; import { id } from "tsafe/id"; diff --git a/src/bin/generate-i18n-messages.ts b/src/scripts/generate-i18n-messages.ts similarity index 90% rename from src/bin/generate-i18n-messages.ts rename to src/scripts/generate-i18n-messages.ts index f508b70d..eaef1882 100644 --- a/src/bin/generate-i18n-messages.ts +++ b/src/scripts/generate-i18n-messages.ts @@ -1,11 +1,11 @@ import "minimal-polyfills/Object.fromEntries"; import * as fs from "fs"; import { join as pathJoin, relative as pathRelative, dirname as pathDirname } from "path"; -import { crawl } from "./tools/crawl"; -import { downloadBuiltinKeycloakTheme } from "./download-builtin-keycloak-theme"; -import { getProjectRoot } from "./tools/getProjectRoot"; -import { getCliOptions } from "./tools/cliOptions"; -import { getLogger } from "./tools/logger"; +import { crawl } from "../bin/tools/crawl"; +import { downloadBuiltinKeycloakTheme } from "../bin/download-builtin-keycloak-theme"; +import { getProjectRoot } from "../bin/tools/getProjectRoot"; +import { getCliOptions } from "../bin/tools/cliOptions"; +import { getLogger } from "../bin/tools/logger"; //NOTE: To run without argument when we want to generate src/i18n/generated_kcMessages files, // update the version array for generating for newer version.