keycloakify 10.0.0-rc.102 → 10.0.0-rc.104
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/bin/193.index.js +1 -1
- package/bin/31.index.js +16 -12
- package/bin/440.index.js +107 -47
- package/bin/{893.index.js → 622.index.js} +224 -220
- package/bin/932.index.js +1 -1
- package/bin/main.js +3 -3
- package/bin/shared/KeycloakVersionRange.d.ts +3 -3
- package/bin/shared/buildContext.d.ts +4 -2
- package/bin/shared/buildContext.js.map +1 -1
- package/bin/shared/downloadKeycloakDefaultTheme.js.map +1 -1
- package/package.json +2 -2
- package/src/bin/keycloakify/buildJars/buildJar.ts +15 -2
- package/src/bin/keycloakify/buildJars/buildJars.ts +6 -2
- package/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts +5 -5
- package/src/bin/keycloakify/generateFtl/generateFtl.ts +6 -3
- package/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl +2 -1
- package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +102 -40
- package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +3 -2
- package/src/bin/shared/KeycloakVersionRange.ts +4 -4
- package/src/bin/shared/buildContext.ts +22 -14
- package/src/bin/shared/downloadKeycloakDefaultTheme.ts +1 -1
- package/src/bin/tools/downloadAndExtractArchive.ts +3 -3
- package/vite-plugin/index.js +19 -15
@@ -63,6 +63,7 @@ export type BuildContext = {
|
|
63
63
|
packageJsonDirPath: string;
|
64
64
|
packageJsonScripts: Record<string, string>;
|
65
65
|
};
|
66
|
+
doUseAccountV3: boolean;
|
66
67
|
};
|
67
68
|
|
68
69
|
export type BuildOptions = {
|
@@ -77,16 +78,17 @@ export type BuildOptions = {
|
|
77
78
|
kcContextExclusionsFtl?: string;
|
78
79
|
/** https://docs.keycloakify.dev/v/v10/targetting-specific-keycloak-versions */
|
79
80
|
keycloakVersionTargets?: BuildOptions.KeycloakVersionTargets;
|
81
|
+
doUseAccountV3?: boolean;
|
80
82
|
};
|
81
83
|
|
82
84
|
export namespace BuildOptions {
|
83
85
|
export type KeycloakVersionTargets =
|
84
86
|
| ({ hasAccountTheme: true } & Record<
|
85
|
-
KeycloakVersionRange.
|
87
|
+
KeycloakVersionRange.WithAccountV1Theme,
|
86
88
|
string | boolean
|
87
89
|
>)
|
88
90
|
| ({ hasAccountTheme: false } & Record<
|
89
|
-
KeycloakVersionRange.
|
91
|
+
KeycloakVersionRange.WithoutAccountV1Theme,
|
90
92
|
string | boolean
|
91
93
|
>);
|
92
94
|
}
|
@@ -229,6 +231,7 @@ export function getBuildContext(params: {
|
|
229
231
|
projectBuildDirPath?: string;
|
230
232
|
staticDirPathInProjectBuildDirPath?: string;
|
231
233
|
publicDirPath?: string;
|
234
|
+
doUseAccountV3?: boolean;
|
232
235
|
};
|
233
236
|
|
234
237
|
type ParsedPackageJson = {
|
@@ -297,7 +300,8 @@ export function getBuildContext(params: {
|
|
297
300
|
|
298
301
|
return zKeycloakVersionTargets;
|
299
302
|
})()
|
300
|
-
).optional()
|
303
|
+
).optional(),
|
304
|
+
doUseAccountV3: z.boolean().optional()
|
301
305
|
});
|
302
306
|
|
303
307
|
{
|
@@ -386,6 +390,8 @@ export function getBuildContext(params: {
|
|
386
390
|
|
387
391
|
const bundler = resolvedViteConfig !== undefined ? "vite" : "webpack";
|
388
392
|
|
393
|
+
const doUseAccountV3 = buildOptions.doUseAccountV3 ?? false;
|
394
|
+
|
389
395
|
return {
|
390
396
|
bundler:
|
391
397
|
resolvedViteConfig !== undefined
|
@@ -606,10 +612,10 @@ export function getBuildContext(params: {
|
|
606
612
|
}
|
607
613
|
|
608
614
|
const keycloakVersionRange: KeycloakVersionRange = (() => {
|
609
|
-
const
|
610
|
-
recordIsImplementedByThemeType.account;
|
615
|
+
const doesImplementAccountV1Theme =
|
616
|
+
!doUseAccountV3 && recordIsImplementedByThemeType.account;
|
611
617
|
|
612
|
-
if (
|
618
|
+
if (doesImplementAccountV1Theme) {
|
613
619
|
const keycloakVersionRange = (() => {
|
614
620
|
if (buildForKeycloakMajorVersionNumber <= 21) {
|
615
621
|
return "21-and-below" as const;
|
@@ -631,7 +637,7 @@ export function getBuildContext(params: {
|
|
631
637
|
assert<
|
632
638
|
Equals<
|
633
639
|
typeof keycloakVersionRange,
|
634
|
-
KeycloakVersionRange.
|
640
|
+
KeycloakVersionRange.WithAccountV1Theme
|
635
641
|
>
|
636
642
|
>();
|
637
643
|
|
@@ -648,7 +654,7 @@ export function getBuildContext(params: {
|
|
648
654
|
assert<
|
649
655
|
Equals<
|
650
656
|
typeof keycloakVersionRange,
|
651
|
-
KeycloakVersionRange.
|
657
|
+
KeycloakVersionRange.WithoutAccountV1Theme
|
652
658
|
>
|
653
659
|
>();
|
654
660
|
|
@@ -696,7 +702,7 @@ export function getBuildContext(params: {
|
|
696
702
|
const jarTargets_default = (() => {
|
697
703
|
const jarTargets: BuildContext["jarTargets"] = [];
|
698
704
|
|
699
|
-
if (recordIsImplementedByThemeType.account) {
|
705
|
+
if (!doUseAccountV3 && recordIsImplementedByThemeType.account) {
|
700
706
|
for (const keycloakVersionRange of [
|
701
707
|
"21-and-below",
|
702
708
|
"23",
|
@@ -706,7 +712,7 @@ export function getBuildContext(params: {
|
|
706
712
|
assert<
|
707
713
|
Equals<
|
708
714
|
typeof keycloakVersionRange,
|
709
|
-
KeycloakVersionRange.
|
715
|
+
KeycloakVersionRange.WithAccountV1Theme
|
710
716
|
>
|
711
717
|
>(true);
|
712
718
|
jarTargets.push({
|
@@ -723,7 +729,7 @@ export function getBuildContext(params: {
|
|
723
729
|
assert<
|
724
730
|
Equals<
|
725
731
|
typeof keycloakVersionRange,
|
726
|
-
KeycloakVersionRange.
|
732
|
+
KeycloakVersionRange.WithoutAccountV1Theme
|
727
733
|
>
|
728
734
|
>(true);
|
729
735
|
jarTargets.push({
|
@@ -742,8 +748,9 @@ export function getBuildContext(params: {
|
|
742
748
|
}
|
743
749
|
|
744
750
|
if (
|
745
|
-
buildOptions.keycloakVersionTargets.hasAccountTheme !==
|
746
|
-
|
751
|
+
buildOptions.keycloakVersionTargets.hasAccountTheme !== doUseAccountV3
|
752
|
+
? false
|
753
|
+
: recordIsImplementedByThemeType.account
|
747
754
|
) {
|
748
755
|
console.log(
|
749
756
|
chalk.red(
|
@@ -863,6 +870,7 @@ export function getBuildContext(params: {
|
|
863
870
|
}
|
864
871
|
|
865
872
|
return jarTargets;
|
866
|
-
})()
|
873
|
+
})(),
|
874
|
+
doUseAccountV3
|
867
875
|
};
|
868
876
|
}
|
@@ -24,7 +24,7 @@ export async function downloadKeycloakDefaultTheme(params: {
|
|
24
24
|
url: `https://repo1.maven.org/maven2/org/keycloak/keycloak-themes/${keycloakVersion}/keycloak-themes-${keycloakVersion}.jar`,
|
25
25
|
cacheDirPath: buildContext.cacheDirPath,
|
26
26
|
fetchOptions: buildContext.fetchOptions,
|
27
|
-
|
27
|
+
uniqueIdOfOnArchiveFile: "downloadKeycloakDefaultTheme",
|
28
28
|
onArchiveFile: async params => {
|
29
29
|
const fileRelativePath = pathRelative("theme", params.fileRelativePath);
|
30
30
|
|
@@ -10,7 +10,7 @@ import { rm } from "./fs.rm";
|
|
10
10
|
|
11
11
|
export async function downloadAndExtractArchive(params: {
|
12
12
|
url: string;
|
13
|
-
|
13
|
+
uniqueIdOfOnArchiveFile: string;
|
14
14
|
onArchiveFile: (params: {
|
15
15
|
fileRelativePath: string;
|
16
16
|
readFile: () => Promise<Buffer>;
|
@@ -22,7 +22,7 @@ export async function downloadAndExtractArchive(params: {
|
|
22
22
|
cacheDirPath: string;
|
23
23
|
fetchOptions: FetchOptions | undefined;
|
24
24
|
}): Promise<{ extractedDirPath: string }> {
|
25
|
-
const { url,
|
25
|
+
const { url, uniqueIdOfOnArchiveFile, onArchiveFile, cacheDirPath, fetchOptions } =
|
26
26
|
params;
|
27
27
|
|
28
28
|
const archiveFileBasename = url.split("?")[0].split("/").reverse()[0];
|
@@ -63,7 +63,7 @@ export async function downloadAndExtractArchive(params: {
|
|
63
63
|
});
|
64
64
|
}
|
65
65
|
|
66
|
-
const extractDirBasename = `${archiveFileBasename.split(".")[0]}_${
|
66
|
+
const extractDirBasename = `${archiveFileBasename.split(".")[0]}_${uniqueIdOfOnArchiveFile}_${crypto
|
67
67
|
.createHash("sha256")
|
68
68
|
.update(onArchiveFile.toString())
|
69
69
|
.digest("hex")
|
package/vite-plugin/index.js
CHANGED
@@ -4109,7 +4109,7 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
4109
4109
|
|
4110
4110
|
|
4111
4111
|
function getBuildContext(params) {
|
4112
|
-
var _a, _b, _c, _d, _e, _f;
|
4112
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
4113
4113
|
const { cliCommandOptions } = params;
|
4114
4114
|
const projectDirPath = cliCommandOptions.projectDirPath !== undefined
|
4115
4115
|
? getAbsoluteAndInOsFormatPath({
|
@@ -4240,7 +4240,8 @@ function getBuildContext(params) {
|
|
4240
4240
|
(0,assert.assert)();
|
4241
4241
|
}
|
4242
4242
|
return zKeycloakVersionTargets;
|
4243
|
-
})()).optional()
|
4243
|
+
})()).optional(),
|
4244
|
+
doUseAccountV3: z.boolean().optional()
|
4244
4245
|
});
|
4245
4246
|
{
|
4246
4247
|
(0,assert.assert)();
|
@@ -4298,6 +4299,7 @@ function getBuildContext(params) {
|
|
4298
4299
|
return (0,external_path_.join)(projectDirPath, resolvedViteConfig.buildDir);
|
4299
4300
|
})();
|
4300
4301
|
const bundler = resolvedViteConfig !== undefined ? "vite" : "webpack";
|
4302
|
+
const doUseAccountV3 = (_a = buildOptions.doUseAccountV3) !== null && _a !== void 0 ? _a : false;
|
4301
4303
|
return {
|
4302
4304
|
bundler: resolvedViteConfig !== undefined
|
4303
4305
|
? { type: "vite" }
|
@@ -4312,7 +4314,7 @@ function getBuildContext(params) {
|
|
4312
4314
|
packageJsonScripts: scripts !== null && scripts !== void 0 ? scripts : {}
|
4313
4315
|
};
|
4314
4316
|
})(),
|
4315
|
-
themeVersion: (
|
4317
|
+
themeVersion: (_c = (_b = buildOptions.themeVersion) !== null && _b !== void 0 ? _b : parsedPackageJson.version) !== null && _c !== void 0 ? _c : "0.0.0",
|
4316
4318
|
themeNames,
|
4317
4319
|
extraThemeProperties: buildOptions.extraThemeProperties,
|
4318
4320
|
groupId: (() => {
|
@@ -4323,8 +4325,8 @@ function getBuildContext(params) {
|
|
4323
4325
|
: (_e = (_d = (_c = (0,external_url_.parse)(parsedPackageJson.homepage)
|
4324
4326
|
.host) === null || _c === void 0 ? void 0 : _c.replace(/:[0-9]+$/, "")) === null || _d === void 0 ? void 0 : _d.split(".").reverse().join(".")) !== null && _e !== void 0 ? _e : fallbackGroupId) + ".keycloak");
|
4325
4327
|
})(),
|
4326
|
-
artifactId: (
|
4327
|
-
loginThemeResourcesFromKeycloakVersion: (
|
4328
|
+
artifactId: (_e = (_d = process.env.KEYCLOAKIFY_ARTIFACT_ID) !== null && _d !== void 0 ? _d : buildOptions.artifactId) !== null && _e !== void 0 ? _e : `${themeNames[0]}-keycloak-theme`,
|
4329
|
+
loginThemeResourcesFromKeycloakVersion: (_f = buildOptions.loginThemeResourcesFromKeycloakVersion) !== null && _f !== void 0 ? _f : "24.0.4",
|
4328
4330
|
projectDirPath,
|
4329
4331
|
projectBuildDirPath,
|
4330
4332
|
keycloakifyBuildDirPath: (() => {
|
@@ -4417,7 +4419,7 @@ function getBuildContext(params) {
|
|
4417
4419
|
}
|
4418
4420
|
return buildOptions.kcContextExclusionsFtl;
|
4419
4421
|
})(),
|
4420
|
-
environmentVariables: (
|
4422
|
+
environmentVariables: (_g = buildOptions.environmentVariables) !== null && _g !== void 0 ? _g : [],
|
4421
4423
|
recordIsImplementedByThemeType,
|
4422
4424
|
themeSrcDirPath,
|
4423
4425
|
fetchOptions: getProxyFetchOptions({
|
@@ -4455,8 +4457,8 @@ function getBuildContext(params) {
|
|
4455
4457
|
break build_for_specific_keycloak_major_version;
|
4456
4458
|
}
|
4457
4459
|
const keycloakVersionRange = (() => {
|
4458
|
-
const
|
4459
|
-
if (
|
4460
|
+
const doesImplementAccountV1Theme = !doUseAccountV3 && recordIsImplementedByThemeType.account;
|
4461
|
+
if (doesImplementAccountV1Theme) {
|
4460
4462
|
const keycloakVersionRange = (() => {
|
4461
4463
|
if (buildForKeycloakMajorVersionNumber <= 21) {
|
4462
4464
|
return "21-and-below";
|
@@ -4511,7 +4513,7 @@ function getBuildContext(params) {
|
|
4511
4513
|
}
|
4512
4514
|
const jarTargets_default = (() => {
|
4513
4515
|
const jarTargets = [];
|
4514
|
-
if (recordIsImplementedByThemeType.account) {
|
4516
|
+
if (!doUseAccountV3 && recordIsImplementedByThemeType.account) {
|
4515
4517
|
for (const keycloakVersionRange of [
|
4516
4518
|
"21-and-below",
|
4517
4519
|
"23",
|
@@ -4542,8 +4544,9 @@ function getBuildContext(params) {
|
|
4542
4544
|
if (buildOptions.keycloakVersionTargets === undefined) {
|
4543
4545
|
return jarTargets_default;
|
4544
4546
|
}
|
4545
|
-
if (buildOptions.keycloakVersionTargets.hasAccountTheme !==
|
4546
|
-
|
4547
|
+
if (buildOptions.keycloakVersionTargets.hasAccountTheme !== doUseAccountV3
|
4548
|
+
? false
|
4549
|
+
: recordIsImplementedByThemeType.account) {
|
4547
4550
|
console.log(source_default().red((() => {
|
4548
4551
|
const { keycloakVersionTargets } = buildOptions;
|
4549
4552
|
let message = `Bad ${(0,symToStr/* symToStr */.r)({ keycloakVersionTargets })} configuration.\n`;
|
@@ -4618,7 +4621,8 @@ function getBuildContext(params) {
|
|
4618
4621
|
process.exit(1);
|
4619
4622
|
}
|
4620
4623
|
return jarTargets;
|
4621
|
-
})()
|
4624
|
+
})(),
|
4625
|
+
doUseAccountV3
|
4622
4626
|
};
|
4623
4627
|
}
|
4624
4628
|
//# sourceMappingURL=buildContext.js.map
|
@@ -4941,7 +4945,7 @@ var fs_rm = __nccwpck_require__(8699);
|
|
4941
4945
|
|
4942
4946
|
async function downloadAndExtractArchive(params) {
|
4943
4947
|
var _a;
|
4944
|
-
const { url,
|
4948
|
+
const { url, uniqueIdOfOnArchiveFile, onArchiveFile, cacheDirPath, fetchOptions } = params;
|
4945
4949
|
const archiveFileBasename = url.split("?")[0].split("/").reverse()[0];
|
4946
4950
|
const archiveFilePath = (0,external_path_.join)(cacheDirPath, archiveFileBasename);
|
4947
4951
|
download: {
|
@@ -4969,7 +4973,7 @@ async function downloadAndExtractArchive(params) {
|
|
4969
4973
|
archiveFileBasename
|
4970
4974
|
});
|
4971
4975
|
}
|
4972
|
-
const extractDirBasename = `${archiveFileBasename.split(".")[0]}_${
|
4976
|
+
const extractDirBasename = `${archiveFileBasename.split(".")[0]}_${uniqueIdOfOnArchiveFile}_${external_crypto_.createHash("sha256")
|
4973
4977
|
.update(onArchiveFile.toString())
|
4974
4978
|
.digest("hex")
|
4975
4979
|
.substring(0, 5)}`;
|
@@ -5101,7 +5105,7 @@ async function downloadKeycloakDefaultTheme(params) {
|
|
5101
5105
|
url: `https://repo1.maven.org/maven2/org/keycloak/keycloak-themes/${keycloakVersion}/keycloak-themes-${keycloakVersion}.jar`,
|
5102
5106
|
cacheDirPath: buildContext.cacheDirPath,
|
5103
5107
|
fetchOptions: buildContext.fetchOptions,
|
5104
|
-
|
5108
|
+
uniqueIdOfOnArchiveFile: "downloadKeycloakDefaultTheme",
|
5105
5109
|
onArchiveFile: async (params) => {
|
5106
5110
|
const fileRelativePath = (0,external_path_.relative)("theme", params.fileRelativePath);
|
5107
5111
|
if (fileRelativePath.startsWith("..")) {
|