Add version in build options
This commit is contained in:
parent
d7960a7dcf
commit
6ec9ba3c01
@ -53,6 +53,7 @@ export type BuildContext = {
|
|||||||
|
|
||||||
export type BuildOptions = {
|
export type BuildOptions = {
|
||||||
themeName?: string | string[];
|
themeName?: string | string[];
|
||||||
|
themeVersion?: string;
|
||||||
environmentVariables?: { name: string; default: string }[];
|
environmentVariables?: { name: string; default: string }[];
|
||||||
extraThemeProperties?: string[];
|
extraThemeProperties?: string[];
|
||||||
artifactId?: string;
|
artifactId?: string;
|
||||||
@ -137,7 +138,7 @@ export function getBuildContext(params: {
|
|||||||
const parsedPackageJson = (() => {
|
const parsedPackageJson = (() => {
|
||||||
type BuildOptions_packageJson = BuildOptions & {
|
type BuildOptions_packageJson = BuildOptions & {
|
||||||
projectBuildDirPath?: string;
|
projectBuildDirPath?: string;
|
||||||
staticDirPathInBuildDirPath?: string;
|
staticDirPathInProjectBuildDirPath?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type ParsedPackageJson = {
|
type ParsedPackageJson = {
|
||||||
@ -170,7 +171,8 @@ export function getBuildContext(params: {
|
|||||||
)
|
)
|
||||||
.optional(),
|
.optional(),
|
||||||
themeName: z.union([z.string(), z.array(z.string())]).optional(),
|
themeName: z.union([z.string(), z.array(z.string())]).optional(),
|
||||||
staticDirPathInBuildDirPath: z.string().optional(),
|
themeVersion: z.string().optional(),
|
||||||
|
staticDirPathInProjectBuildDirPath: z.string().optional(),
|
||||||
keycloakVersionTargets: id<
|
keycloakVersionTargets: id<
|
||||||
z.ZodType<BuildOptions.KeycloakVersionTargets>
|
z.ZodType<BuildOptions.KeycloakVersionTargets>
|
||||||
>(
|
>(
|
||||||
@ -333,8 +335,7 @@ export function getBuildContext(params: {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
bundler,
|
bundler,
|
||||||
themeVersion:
|
themeVersion: buildOptions.themeVersion ?? parsedPackageJson.version ?? "0.0.0",
|
||||||
process.env.KEYCLOAKIFY_THEME_VERSION ?? parsedPackageJson.version ?? "0.0.0",
|
|
||||||
themeNames,
|
themeNames,
|
||||||
extraThemeProperties: buildOptions.extraThemeProperties,
|
extraThemeProperties: buildOptions.extraThemeProperties,
|
||||||
groupId: (() => {
|
groupId: (() => {
|
||||||
@ -440,9 +441,9 @@ export function getBuildContext(params: {
|
|||||||
break webpack;
|
break webpack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buildOptions.staticDirPathInBuildDirPath !== undefined) {
|
if (buildOptions.staticDirPathInProjectBuildDirPath !== undefined) {
|
||||||
getAbsoluteAndInOsFormatPath({
|
getAbsoluteAndInOsFormatPath({
|
||||||
pathIsh: buildOptions.staticDirPathInBuildDirPath,
|
pathIsh: buildOptions.staticDirPathInProjectBuildDirPath,
|
||||||
cwd: projectBuildDirPath
|
cwd: projectBuildDirPath
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user