Rename generateTheme to generateSrcMainResources
This commit is contained in:
parent
64f71d4265
commit
a80449333c
@ -12,8 +12,11 @@ export type BuildOptionsLike = BuildOptionsLike_buildJar & {
|
||||
|
||||
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
||||
|
||||
export async function buildJars(params: { doesImplementAccountTheme: boolean; buildOptions: BuildOptionsLike }): Promise<void> {
|
||||
const { doesImplementAccountTheme, buildOptions } = params;
|
||||
export async function buildJars(params: { buildOptions: BuildOptionsLike }): Promise<void> {
|
||||
const { buildOptions } = params;
|
||||
|
||||
// TODO:
|
||||
const doesImplementAccountTheme= ;
|
||||
|
||||
await Promise.all(
|
||||
keycloakAccountV1Versions
|
||||
|
@ -1,27 +1,26 @@
|
||||
import type { BuildOptions } from "../../shared/buildOptions";
|
||||
import { assert } from "tsafe/assert";
|
||||
import { generateSrcMainResources, type BuildOptionsLike as BuildOptionsLike_generateSrcMainResources } from "./generateSrcMainResources";
|
||||
import { generateThemeVariations } from "./generateThemeVariants";
|
||||
import { generateSrcMainResourcesForMainTheme, type BuildOptionsLike as BuildOptionsLike_generateSrcMainResourcesForMainTheme } from "./generateSrcMainResourcesForMainTheme";
|
||||
import { generateSrcMainResourcesForThemeVariant } from "./generateSrcMainResourcesForThemeVariant";
|
||||
|
||||
export type BuildOptionsLike = BuildOptionsLike_generateSrcMainResources & {
|
||||
keycloakifyBuildDirPath: string;
|
||||
export type BuildOptionsLike = BuildOptionsLike_generateSrcMainResourcesForMainTheme & {
|
||||
themeNames: string[];
|
||||
};
|
||||
|
||||
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
||||
|
||||
export async function generateTheme(params: { buildOptions: BuildOptionsLike }): Promise<void> {
|
||||
export async function generateSrcMainResources(params: { buildOptions: BuildOptionsLike }): Promise<void> {
|
||||
const { buildOptions } = params;
|
||||
|
||||
const [themeName, ...themeVariantNames] = buildOptions.themeNames;
|
||||
|
||||
await generateSrcMainResources({
|
||||
await generateSrcMainResourcesForMainTheme({
|
||||
themeName,
|
||||
buildOptions
|
||||
});
|
||||
|
||||
for (const themeVariantName of themeVariantNames) {
|
||||
generateThemeVariations({
|
||||
generateSrcMainResourcesForThemeVariant({
|
||||
themeName,
|
||||
themeVariantName,
|
||||
buildOptions
|
@ -40,7 +40,10 @@ export type BuildOptionsLike = {
|
||||
|
||||
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
||||
|
||||
export async function generateSrcMainResources(params: { themeName: string; buildOptions: BuildOptionsLike }): Promise<void> {
|
||||
export async function generateSrcMainResourcesForMainTheme(params: {
|
||||
themeName: string;
|
||||
buildOptions: BuildOptionsLike
|
||||
}): Promise<void> {
|
||||
const { themeName, buildOptions } = params;
|
||||
|
||||
const { themeSrcDirPath } = getThemeSrcDirPath({ "reactAppRootDirPath": buildOptions.reactAppRootDirPath });
|
@ -10,7 +10,7 @@ export type BuildOptionsLike = {
|
||||
|
||||
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
||||
|
||||
export function generateThemeVariations(params: { themeName: string; themeVariantName: string; buildOptions: BuildOptionsLike }) {
|
||||
export function generateSrcMainResourcesForThemeVariant(params: { themeName: string; themeVariantName: string; buildOptions: BuildOptionsLike }) {
|
||||
const { themeName, themeVariantName, buildOptions } = params;
|
||||
|
||||
const mainThemeDirPath = pathJoin(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources", "theme", themeName);
|
1
src/bin/keycloakify/generateSrcMainResources/index.ts
Normal file
1
src/bin/keycloakify/generateSrcMainResources/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from "./generateSrcMainResources";
|
@ -1 +0,0 @@
|
||||
export * from "./generateTheme";
|
@ -1,4 +1,4 @@
|
||||
import { generateTheme } from "./generateTheme";
|
||||
import { generateSrcMainResources } from "./generateSrcMainResources";
|
||||
import { join as pathJoin, relative as pathRelative, sep as pathSep } from "path";
|
||||
import * as child_process from "child_process";
|
||||
import * as fs from "fs";
|
||||
@ -25,7 +25,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
||||
fs.writeFileSync(pathJoin(buildOptions.keycloakifyBuildDirPath, ".gitignore"), Buffer.from("*", "utf8"));
|
||||
}
|
||||
|
||||
await generateTheme({ buildOptions });
|
||||
await generateSrcMainResources({ buildOptions });
|
||||
|
||||
run_post_build_script: {
|
||||
if (buildOptions.bundler !== "vite") {
|
||||
@ -41,13 +41,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: find from META-INF/keycloak-themes.json
|
||||
const doesImplementAccountTheme = true;
|
||||
|
||||
await buildJars({
|
||||
doesImplementAccountTheme,
|
||||
buildOptions
|
||||
});
|
||||
await buildJars({ buildOptions });
|
||||
|
||||
logger.log(
|
||||
`✅ Your keycloak theme has been generated and bundled into .${pathSep}${pathJoin(
|
||||
|
Loading…
x
Reference in New Issue
Block a user