Add themeName option
This commit is contained in:
parent
44402c9571
commit
ee23f629f6
@ -3,8 +3,7 @@ import { id } from "tsafe/id";
|
|||||||
import { parse as urlParse } from "url";
|
import { parse as urlParse } from "url";
|
||||||
import { typeGuard } from "tsafe/typeGuard";
|
import { typeGuard } from "tsafe/typeGuard";
|
||||||
import { symToStr } from "tsafe/symToStr";
|
import { symToStr } from "tsafe/symToStr";
|
||||||
import { bundlers, getParsedPackageJson } from "./parsed-package-json";
|
import { bundlers, getParsedPackageJson, type Bundler } from "./parsedPackageJson";
|
||||||
import type { Bundler } from "./parsed-package-json";
|
|
||||||
import { getAppInputPath, getKeycloakBuildPath } from "./build-paths";
|
import { getAppInputPath, getKeycloakBuildPath } from "./build-paths";
|
||||||
|
|
||||||
/** Consolidated build option gathered form CLI arguments and config in package.json */
|
/** Consolidated build option gathered form CLI arguments and config in package.json */
|
||||||
@ -91,10 +90,12 @@ export function readBuildOptions(params: { CNAME: string | undefined; isExternal
|
|||||||
const { extraPages, extraLoginPages, extraAccountPages, extraThemeProperties, groupId, artifactId, bundler, keycloakVersionDefaultAssets } =
|
const { extraPages, extraLoginPages, extraAccountPages, extraThemeProperties, groupId, artifactId, bundler, keycloakVersionDefaultAssets } =
|
||||||
keycloakify ?? {};
|
keycloakify ?? {};
|
||||||
|
|
||||||
const themeName = name
|
const themeName =
|
||||||
.replace(/^@(.*)/, "$1")
|
keycloakify.themeName ??
|
||||||
.split("/")
|
name
|
||||||
.join("-");
|
.replace(/^@(.*)/, "$1")
|
||||||
|
.split("/")
|
||||||
|
.join("-");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
themeName,
|
themeName,
|
||||||
|
@ -2,7 +2,7 @@ import * as fs from "fs";
|
|||||||
import { exclude } from "tsafe";
|
import { exclude } from "tsafe";
|
||||||
import { crawl } from "../tools/crawl";
|
import { crawl } from "../tools/crawl";
|
||||||
import { pathJoin } from "../tools/pathJoin";
|
import { pathJoin } from "../tools/pathJoin";
|
||||||
import { getParsedPackageJson } from "./parsed-package-json";
|
import { getParsedPackageJson } from "./parsedPackageJson";
|
||||||
|
|
||||||
const DEFAULT_APP_INPUT_PATH = "build";
|
const DEFAULT_APP_INPUT_PATH = "build";
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ type ParsedPackageJson = {
|
|||||||
appInputPath?: string;
|
appInputPath?: string;
|
||||||
keycloakBuildPath?: string;
|
keycloakBuildPath?: string;
|
||||||
customUserAttributes?: string[];
|
customUserAttributes?: string[];
|
||||||
|
themeName?: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -45,7 +46,8 @@ const zParsedPackageJson = z.object({
|
|||||||
"keycloakVersionDefaultAssets": z.string().optional(),
|
"keycloakVersionDefaultAssets": z.string().optional(),
|
||||||
"appInputPath": z.string().optional(),
|
"appInputPath": z.string().optional(),
|
||||||
"keycloakBuildPath": z.string().optional(),
|
"keycloakBuildPath": z.string().optional(),
|
||||||
"customUserAttributes": z.array(z.string()).optional()
|
"customUserAttributes": z.array(z.string()).optional(),
|
||||||
|
"themeName": z.string().optional()
|
||||||
})
|
})
|
||||||
.optional()
|
.optional()
|
||||||
});
|
});
|
Loading…
x
Reference in New Issue
Block a user