keycloakify 10.0.0-rc.64 → 10.0.0-rc.65
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/account/KcContext/KcContext.d.ts +1 -0
- package/account/KcContext/KcContext.js.map +1 -1
- package/account/KcContext/kcContextMocks.js +2 -1
- package/account/KcContext/kcContextMocks.js.map +1 -1
- package/account/pages/Totp.js +2 -7
- package/account/pages/Totp.js.map +1 -1
- package/bin/190.index.js +563 -0
- package/bin/193.index.js +0 -552
- package/bin/{240.index.js → 203.index.js} +2 -19
- package/bin/363.index.js +15 -543
- package/bin/526.index.js +24 -0
- package/bin/932.index.js +67 -63
- package/bin/main.js +4 -4
- package/package.json +3 -2
- package/src/account/KcContext/KcContext.ts +1 -0
- package/src/account/KcContext/kcContextMocks.ts +2 -1
- package/src/account/pages/Totp.tsx +1 -7
- package/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl +8 -6
- package/src/bin/shared/downloadKeycloakDefaultTheme.ts +135 -108
- package/src/bin/shared/getImplementedThemeTypes.ts +15 -0
- package/vite-plugin/index.js +69 -70
package/bin/932.index.js
CHANGED
@@ -330,33 +330,29 @@ var SuccessTracker;
|
|
330
330
|
;// CONCATENATED MODULE: ./dist/bin/tools/downloadAndExtractArchive/index.js
|
331
331
|
|
332
332
|
//# sourceMappingURL=index.js.map
|
333
|
-
// EXTERNAL MODULE: ./dist/bin/tools/isInside.js
|
334
|
-
var isInside = __webpack_require__(90665);
|
335
333
|
;// CONCATENATED MODULE: ./dist/bin/shared/downloadKeycloakDefaultTheme.js
|
336
334
|
|
337
335
|
|
338
336
|
|
339
337
|
|
340
|
-
|
341
338
|
(0,assert.assert)();
|
342
339
|
async function downloadKeycloakDefaultTheme(params) {
|
343
340
|
const { keycloakVersion, buildContext } = params;
|
341
|
+
let kcNodeModulesKeepFilePaths = undefined;
|
342
|
+
let kcNodeModulesKeepFilePaths_lastAccountV1 = undefined;
|
344
343
|
const { extractedDirPath } = await downloadAndExtractArchive({
|
345
344
|
url: `https://repo1.maven.org/maven2/org/keycloak/keycloak-themes/${keycloakVersion}/keycloak-themes-${keycloakVersion}.jar`,
|
346
345
|
cacheDirPath: buildContext.cacheDirPath,
|
347
346
|
npmWorkspaceRootDirPath: buildContext.npmWorkspaceRootDirPath,
|
348
347
|
uniqueIdOfOnOnArchiveFile: "downloadKeycloakDefaultTheme",
|
349
348
|
onArchiveFile: async (params) => {
|
350
|
-
|
349
|
+
const fileRelativePath = (0,external_path_.relative)("theme", params.fileRelativePath);
|
350
|
+
if (fileRelativePath.startsWith("..")) {
|
351
351
|
return;
|
352
352
|
}
|
353
353
|
const { readFile, writeFile } = params;
|
354
|
-
const fileRelativePath = (0,external_path_.relative)("theme", params.fileRelativePath);
|
355
354
|
skip_keycloak_v2: {
|
356
|
-
if (!(0,
|
357
|
-
dirPath: (0,external_path_.join)("keycloak.v2"),
|
358
|
-
filePath: fileRelativePath
|
359
|
-
})) {
|
355
|
+
if (!fileRelativePath.startsWith((0,external_path_.join)("keycloak.v2"))) {
|
360
356
|
break skip_keycloak_v2;
|
361
357
|
}
|
362
358
|
return;
|
@@ -365,6 +361,39 @@ async function downloadKeycloakDefaultTheme(params) {
|
|
365
361
|
if (constants/* lastKeycloakVersionWithAccountV1 */.v$ !== keycloakVersion) {
|
366
362
|
break last_account_v1_transformations;
|
367
363
|
}
|
364
|
+
skip_web_modules: {
|
365
|
+
if (!fileRelativePath.startsWith((0,external_path_.join)("keycloak", "common", "resources", "web_modules"))) {
|
366
|
+
break skip_web_modules;
|
367
|
+
}
|
368
|
+
return;
|
369
|
+
}
|
370
|
+
skip_lib: {
|
371
|
+
if (!fileRelativePath.startsWith((0,external_path_.join)("keycloak", "common", "resources", "lib"))) {
|
372
|
+
break skip_lib;
|
373
|
+
}
|
374
|
+
return;
|
375
|
+
}
|
376
|
+
skip_node_modules: {
|
377
|
+
if (!fileRelativePath.startsWith((0,external_path_.join)("keycloak", "common", "resources", "node_modules"))) {
|
378
|
+
break skip_node_modules;
|
379
|
+
}
|
380
|
+
if (kcNodeModulesKeepFilePaths_lastAccountV1 === undefined) {
|
381
|
+
kcNodeModulesKeepFilePaths_lastAccountV1 = [
|
382
|
+
(0,external_path_.join)("patternfly", "dist", "css", "patternfly.min.css"),
|
383
|
+
(0,external_path_.join)("patternfly", "dist", "css", "patternfly-additions.min.css"),
|
384
|
+
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Regular-webfont.woff2"),
|
385
|
+
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Bold-webfont.woff2"),
|
386
|
+
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Light-webfont.woff2"),
|
387
|
+
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Semibold-webfont.woff2")
|
388
|
+
];
|
389
|
+
}
|
390
|
+
for (const keepPath of kcNodeModulesKeepFilePaths_lastAccountV1) {
|
391
|
+
if (fileRelativePath.endsWith(keepPath)) {
|
392
|
+
break skip_node_modules;
|
393
|
+
}
|
394
|
+
}
|
395
|
+
return;
|
396
|
+
}
|
368
397
|
patch_account_css: {
|
369
398
|
if (fileRelativePath !==
|
370
399
|
(0,external_path_.join)("keycloak", "account", "resources", "css", "account.css")) {
|
@@ -378,69 +407,44 @@ async function downloadKeycloakDefaultTheme(params) {
|
|
378
407
|
});
|
379
408
|
return;
|
380
409
|
}
|
381
|
-
skip_web_modules: {
|
382
|
-
if (!(0,isInside/* isInside */.V)({
|
383
|
-
dirPath: (0,external_path_.join)("keycloak", "common", "resources", "web_modules"),
|
384
|
-
filePath: fileRelativePath
|
385
|
-
})) {
|
386
|
-
break skip_web_modules;
|
387
|
-
}
|
388
|
-
return;
|
389
|
-
}
|
390
|
-
skip_unused_node_modules: {
|
391
|
-
const nodeModulesDirPath = (0,external_path_.join)("keycloak", "common", "resources", "node_modules");
|
392
|
-
if (!(0,isInside/* isInside */.V)({
|
393
|
-
dirPath: nodeModulesDirPath,
|
394
|
-
filePath: fileRelativePath
|
395
|
-
})) {
|
396
|
-
break skip_unused_node_modules;
|
397
|
-
}
|
398
|
-
const toKeepPrefixes = [
|
399
|
-
...[
|
400
|
-
"patternfly.min.css",
|
401
|
-
"patternfly-additions.min.css",
|
402
|
-
"patternfly-additions.min.css"
|
403
|
-
].map(fileBasename => (0,external_path_.join)(nodeModulesDirPath, "patternfly", "dist", "css", fileBasename)),
|
404
|
-
(0,external_path_.join)(nodeModulesDirPath, "patternfly", "dist", "fonts")
|
405
|
-
];
|
406
|
-
if (toKeepPrefixes.find(prefix => fileRelativePath.startsWith(prefix)) !== undefined) {
|
407
|
-
break skip_unused_node_modules;
|
408
|
-
}
|
409
|
-
return;
|
410
|
-
}
|
411
410
|
}
|
412
411
|
skip_unused_resources: {
|
413
412
|
if (keycloakVersion !== "24.0.4") {
|
414
413
|
break skip_unused_resources;
|
415
414
|
}
|
416
|
-
|
417
|
-
"
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
415
|
+
skip_node_modules: {
|
416
|
+
if (!fileRelativePath.startsWith((0,external_path_.join)("keycloak", "common", "resources", "node_modules"))) {
|
417
|
+
break skip_node_modules;
|
418
|
+
}
|
419
|
+
if (kcNodeModulesKeepFilePaths === undefined) {
|
420
|
+
kcNodeModulesKeepFilePaths = [
|
421
|
+
(0,external_path_.join)("@patternfly", "patternfly", "patternfly.min.css"),
|
422
|
+
(0,external_path_.join)("patternfly", "dist", "css", "patternfly.min.css"),
|
423
|
+
(0,external_path_.join)("patternfly", "dist", "css", "patternfly-additions.min.css"),
|
424
|
+
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Regular-webfont.woff2"),
|
425
|
+
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Light-webfont.woff2"),
|
426
|
+
(0,external_path_.join)("patternfly", "dist", "fonts", "fontawesome-webfont.woff2"),
|
427
|
+
(0,external_path_.join)("jquery", "dist", "jquery.min.js")
|
428
|
+
];
|
430
429
|
}
|
430
|
+
for (const keepPath of kcNodeModulesKeepFilePaths) {
|
431
|
+
if (fileRelativePath.endsWith(keepPath)) {
|
432
|
+
break skip_node_modules;
|
433
|
+
}
|
434
|
+
}
|
435
|
+
return;
|
431
436
|
}
|
432
|
-
|
433
|
-
if ((0,
|
434
|
-
|
435
|
-
filePath: fileRelativePath
|
436
|
-
})) {
|
437
|
-
return;
|
437
|
+
skip_vendor: {
|
438
|
+
if (!fileRelativePath.startsWith((0,external_path_.join)("keycloak", "common", "resources", "vendor"))) {
|
439
|
+
break skip_vendor;
|
438
440
|
}
|
441
|
+
return;
|
439
442
|
}
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
443
|
+
skip_rollup_config: {
|
444
|
+
if (fileRelativePath !==
|
445
|
+
(0,external_path_.join)("keycloak", "common", "resources", "rollup.config.js")) {
|
446
|
+
break skip_rollup_config;
|
447
|
+
}
|
444
448
|
return;
|
445
449
|
}
|
446
450
|
}
|
package/bin/main.js
CHANGED
@@ -9213,7 +9213,7 @@ program
|
|
9213
9213
|
.task({
|
9214
9214
|
skip,
|
9215
9215
|
handler: async (cliCommandOptions) => {
|
9216
|
-
const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(890), __nccwpck_require__.e(818), __nccwpck_require__.e(430), __nccwpck_require__.e(525), __nccwpck_require__.e(246), __nccwpck_require__.e(
|
9216
|
+
const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(890), __nccwpck_require__.e(818), __nccwpck_require__.e(430), __nccwpck_require__.e(525), __nccwpck_require__.e(246), __nccwpck_require__.e(203), __nccwpck_require__.e(190), __nccwpck_require__.e(363)]).then(__nccwpck_require__.bind(__nccwpck_require__, 52363));
|
9217
9217
|
await command({ cliCommandOptions });
|
9218
9218
|
}
|
9219
9219
|
});
|
@@ -9261,7 +9261,7 @@ program
|
|
9261
9261
|
.task({
|
9262
9262
|
skip,
|
9263
9263
|
handler: async (cliCommandOptions) => {
|
9264
|
-
const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(890), __nccwpck_require__.e(818), __nccwpck_require__.e(430), __nccwpck_require__.e(180), __nccwpck_require__.e(36), __nccwpck_require__.e(
|
9264
|
+
const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(890), __nccwpck_require__.e(818), __nccwpck_require__.e(430), __nccwpck_require__.e(180), __nccwpck_require__.e(36), __nccwpck_require__.e(203), __nccwpck_require__.e(526)]).then(__nccwpck_require__.bind(__nccwpck_require__, 80526));
|
9265
9265
|
await command({ cliCommandOptions });
|
9266
9266
|
}
|
9267
9267
|
});
|
@@ -9297,7 +9297,7 @@ program
|
|
9297
9297
|
.task({
|
9298
9298
|
skip,
|
9299
9299
|
handler: async (cliCommandOptions) => {
|
9300
|
-
const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(890), __nccwpck_require__.e(818), __nccwpck_require__.e(430), __nccwpck_require__.e(525), __nccwpck_require__.e(180), __nccwpck_require__.e(
|
9300
|
+
const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(890), __nccwpck_require__.e(818), __nccwpck_require__.e(430), __nccwpck_require__.e(525), __nccwpck_require__.e(180), __nccwpck_require__.e(203), __nccwpck_require__.e(932)]).then(__nccwpck_require__.bind(__nccwpck_require__, 16932));
|
9301
9301
|
await command({ cliCommandOptions });
|
9302
9302
|
}
|
9303
9303
|
});
|
@@ -9309,7 +9309,7 @@ program
|
|
9309
9309
|
.task({
|
9310
9310
|
skip,
|
9311
9311
|
handler: async (cliCommandOptions) => {
|
9312
|
-
const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(890), __nccwpck_require__.e(430), __nccwpck_require__.e(525), __nccwpck_require__.e(
|
9312
|
+
const { command } = await Promise.all(/* import() */[__nccwpck_require__.e(890), __nccwpck_require__.e(430), __nccwpck_require__.e(525), __nccwpck_require__.e(203), __nccwpck_require__.e(190), __nccwpck_require__.e(193)]).then(__nccwpck_require__.bind(__nccwpck_require__, 23193));
|
9313
9313
|
await command({ cliCommandOptions });
|
9314
9314
|
}
|
9315
9315
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "keycloakify",
|
3
|
-
"version": "10.0.0-rc.
|
3
|
+
"version": "10.0.0-rc.65",
|
4
4
|
"description": "Create Keycloak themes using React",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -771,8 +771,9 @@
|
|
771
771
|
"tools/useSetClassName.js.map",
|
772
772
|
"bin/main.js",
|
773
773
|
"bin/180.index.js",
|
774
|
+
"bin/190.index.js",
|
774
775
|
"bin/193.index.js",
|
775
|
-
"bin/
|
776
|
+
"bin/203.index.js",
|
776
777
|
"bin/246.index.js",
|
777
778
|
"bin/36.index.js",
|
778
779
|
"bin/363.index.js",
|
@@ -16,12 +16,6 @@ export default function Totp(props: PageProps<Extract<KcContext, { pageId: "totp
|
|
16
16
|
|
17
17
|
const { msg, msgStr, advancedMsg } = i18n;
|
18
18
|
|
19
|
-
const algToKeyUriAlg: Record<(typeof kcContext)["totp"]["policy"]["algorithm"], string> = {
|
20
|
-
HmacSHA1: "SHA1",
|
21
|
-
HmacSHA256: "SHA256",
|
22
|
-
HmacSHA512: "SHA512"
|
23
|
-
};
|
24
|
-
|
25
19
|
return (
|
26
20
|
<Template {...{ kcContext, i18n, doUseDefaultCss, classes }} active="totp">
|
27
21
|
<>
|
@@ -100,7 +94,7 @@ export default function Totp(props: PageProps<Extract<KcContext, { pageId: "totp
|
|
100
94
|
{msg("totpType")}: {msg(`totp.${totp.policy.type}`)}
|
101
95
|
</li>
|
102
96
|
<li id="kc-totp-algorithm">
|
103
|
-
{msg("totpAlgorithm")}: {
|
97
|
+
{msg("totpAlgorithm")}: {totp.policy.getAlgorithmKey()}
|
104
98
|
</li>
|
105
99
|
<li id="kc-totp-digits">
|
106
100
|
{msg("totpDigits")}: {totp.policy.digits}
|
@@ -305,12 +305,14 @@ function decodeHtmlEntities(htmlStr){
|
|
305
305
|
</#if>
|
306
306
|
|
307
307
|
<#if are_same_path(path, ["totp", "policy", "getAlgorithmKey"])>
|
308
|
-
<#local returnValue = "">
|
309
|
-
<#
|
310
|
-
<#
|
311
|
-
|
312
|
-
<#
|
313
|
-
|
308
|
+
<#local returnValue = "error">
|
309
|
+
<#if mode?? && mode = "manual">
|
310
|
+
<#attempt>
|
311
|
+
<#local returnValue = totp.policy.getAlgorithmKey()>
|
312
|
+
<#recover>
|
313
|
+
<#return "ABORT: Couldn't evaluate totp.policy.getAlgorithmKey()">
|
314
|
+
</#attempt>
|
315
|
+
</#if>
|
314
316
|
<#return 'function(){ return "' + returnValue + '"; }'>
|
315
317
|
</#if>
|
316
318
|
|
@@ -3,7 +3,6 @@ import { type BuildContext } from "./buildContext";
|
|
3
3
|
import { assert } from "tsafe/assert";
|
4
4
|
import { lastKeycloakVersionWithAccountV1 } from "./constants";
|
5
5
|
import { downloadAndExtractArchive } from "../tools/downloadAndExtractArchive";
|
6
|
-
import { isInside } from "../tools/isInside";
|
7
6
|
|
8
7
|
export type BuildContextLike = {
|
9
8
|
cacheDirPath: string;
|
@@ -18,27 +17,25 @@ export async function downloadKeycloakDefaultTheme(params: {
|
|
18
17
|
}): Promise<{ defaultThemeDirPath: string }> {
|
19
18
|
const { keycloakVersion, buildContext } = params;
|
20
19
|
|
20
|
+
let kcNodeModulesKeepFilePaths: string[] | undefined = undefined;
|
21
|
+
let kcNodeModulesKeepFilePaths_lastAccountV1: string[] | undefined = undefined;
|
22
|
+
|
21
23
|
const { extractedDirPath } = await downloadAndExtractArchive({
|
22
24
|
url: `https://repo1.maven.org/maven2/org/keycloak/keycloak-themes/${keycloakVersion}/keycloak-themes-${keycloakVersion}.jar`,
|
23
25
|
cacheDirPath: buildContext.cacheDirPath,
|
24
26
|
npmWorkspaceRootDirPath: buildContext.npmWorkspaceRootDirPath,
|
25
27
|
uniqueIdOfOnOnArchiveFile: "downloadKeycloakDefaultTheme",
|
26
28
|
onArchiveFile: async params => {
|
27
|
-
|
29
|
+
const fileRelativePath = pathRelative("theme", params.fileRelativePath);
|
30
|
+
|
31
|
+
if (fileRelativePath.startsWith("..")) {
|
28
32
|
return;
|
29
33
|
}
|
30
34
|
|
31
35
|
const { readFile, writeFile } = params;
|
32
36
|
|
33
|
-
const fileRelativePath = pathRelative("theme", params.fileRelativePath);
|
34
|
-
|
35
37
|
skip_keycloak_v2: {
|
36
|
-
if (
|
37
|
-
!isInside({
|
38
|
-
dirPath: pathJoin("keycloak.v2"),
|
39
|
-
filePath: fileRelativePath
|
40
|
-
})
|
41
|
-
) {
|
38
|
+
if (!fileRelativePath.startsWith(pathJoin("keycloak.v2"))) {
|
42
39
|
break skip_keycloak_v2;
|
43
40
|
}
|
44
41
|
|
@@ -50,87 +47,102 @@ export async function downloadKeycloakDefaultTheme(params: {
|
|
50
47
|
break last_account_v1_transformations;
|
51
48
|
}
|
52
49
|
|
53
|
-
|
50
|
+
skip_web_modules: {
|
54
51
|
if (
|
55
|
-
fileRelativePath
|
56
|
-
|
52
|
+
!fileRelativePath.startsWith(
|
53
|
+
pathJoin("keycloak", "common", "resources", "web_modules")
|
54
|
+
)
|
57
55
|
) {
|
58
|
-
break
|
56
|
+
break skip_web_modules;
|
59
57
|
}
|
60
58
|
|
61
|
-
await writeFile({
|
62
|
-
fileRelativePath,
|
63
|
-
modifiedData: Buffer.from(
|
64
|
-
(await readFile())
|
65
|
-
.toString("utf8")
|
66
|
-
.replace("top: -34px;", "top: -34px !important;"),
|
67
|
-
"utf8"
|
68
|
-
)
|
69
|
-
});
|
70
|
-
|
71
59
|
return;
|
72
60
|
}
|
73
61
|
|
74
|
-
|
62
|
+
skip_lib: {
|
75
63
|
if (
|
76
|
-
!
|
77
|
-
|
78
|
-
|
79
|
-
"common",
|
80
|
-
"resources",
|
81
|
-
"web_modules"
|
82
|
-
),
|
83
|
-
filePath: fileRelativePath
|
84
|
-
})
|
64
|
+
!fileRelativePath.startsWith(
|
65
|
+
pathJoin("keycloak", "common", "resources", "lib")
|
66
|
+
)
|
85
67
|
) {
|
86
|
-
break
|
68
|
+
break skip_lib;
|
87
69
|
}
|
88
70
|
|
89
71
|
return;
|
90
72
|
}
|
91
73
|
|
92
|
-
|
93
|
-
const nodeModulesDirPath = pathJoin(
|
94
|
-
"keycloak",
|
95
|
-
"common",
|
96
|
-
"resources",
|
97
|
-
"node_modules"
|
98
|
-
);
|
99
|
-
|
74
|
+
skip_node_modules: {
|
100
75
|
if (
|
101
|
-
!
|
102
|
-
|
103
|
-
|
104
|
-
})
|
76
|
+
!fileRelativePath.startsWith(
|
77
|
+
pathJoin("keycloak", "common", "resources", "node_modules")
|
78
|
+
)
|
105
79
|
) {
|
106
|
-
break
|
80
|
+
break skip_node_modules;
|
107
81
|
}
|
108
82
|
|
109
|
-
|
110
|
-
|
111
|
-
"patternfly.min.css",
|
112
|
-
"patternfly-additions.min.css",
|
113
|
-
"patternfly-additions.min.css"
|
114
|
-
].map(fileBasename =>
|
83
|
+
if (kcNodeModulesKeepFilePaths_lastAccountV1 === undefined) {
|
84
|
+
kcNodeModulesKeepFilePaths_lastAccountV1 = [
|
85
|
+
pathJoin("patternfly", "dist", "css", "patternfly.min.css"),
|
115
86
|
pathJoin(
|
116
|
-
nodeModulesDirPath,
|
117
87
|
"patternfly",
|
118
88
|
"dist",
|
119
89
|
"css",
|
120
|
-
|
90
|
+
"patternfly-additions.min.css"
|
91
|
+
),
|
92
|
+
pathJoin(
|
93
|
+
"patternfly",
|
94
|
+
"dist",
|
95
|
+
"fonts",
|
96
|
+
"OpenSans-Regular-webfont.woff2"
|
97
|
+
),
|
98
|
+
pathJoin(
|
99
|
+
"patternfly",
|
100
|
+
"dist",
|
101
|
+
"fonts",
|
102
|
+
"OpenSans-Bold-webfont.woff2"
|
103
|
+
),
|
104
|
+
pathJoin(
|
105
|
+
"patternfly",
|
106
|
+
"dist",
|
107
|
+
"fonts",
|
108
|
+
"OpenSans-Light-webfont.woff2"
|
109
|
+
),
|
110
|
+
pathJoin(
|
111
|
+
"patternfly",
|
112
|
+
"dist",
|
113
|
+
"fonts",
|
114
|
+
"OpenSans-Semibold-webfont.woff2"
|
121
115
|
)
|
122
|
-
|
123
|
-
|
124
|
-
|
116
|
+
];
|
117
|
+
}
|
118
|
+
|
119
|
+
for (const keepPath of kcNodeModulesKeepFilePaths_lastAccountV1) {
|
120
|
+
if (fileRelativePath.endsWith(keepPath)) {
|
121
|
+
break skip_node_modules;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
return;
|
126
|
+
}
|
125
127
|
|
128
|
+
patch_account_css: {
|
126
129
|
if (
|
127
|
-
|
128
|
-
|
129
|
-
) !== undefined
|
130
|
+
fileRelativePath !==
|
131
|
+
pathJoin("keycloak", "account", "resources", "css", "account.css")
|
130
132
|
) {
|
131
|
-
break
|
133
|
+
break patch_account_css;
|
132
134
|
}
|
133
135
|
|
136
|
+
await writeFile({
|
137
|
+
fileRelativePath,
|
138
|
+
modifiedData: Buffer.from(
|
139
|
+
(await readFile())
|
140
|
+
.toString("utf8")
|
141
|
+
.replace("top: -34px;", "top: -34px !important;"),
|
142
|
+
"utf8"
|
143
|
+
)
|
144
|
+
});
|
145
|
+
|
134
146
|
return;
|
135
147
|
}
|
136
148
|
}
|
@@ -140,61 +152,76 @@ export async function downloadKeycloakDefaultTheme(params: {
|
|
140
152
|
break skip_unused_resources;
|
141
153
|
}
|
142
154
|
|
143
|
-
|
144
|
-
"@patternfly-v5",
|
145
|
-
"@rollup",
|
146
|
-
"rollup",
|
147
|
-
"react",
|
148
|
-
"react-dom",
|
149
|
-
"shx",
|
150
|
-
".pnpm"
|
151
|
-
]) {
|
155
|
+
skip_node_modules: {
|
152
156
|
if (
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
"common",
|
157
|
-
"resources",
|
158
|
-
"node_modules",
|
159
|
-
dirBasename
|
160
|
-
),
|
161
|
-
filePath: fileRelativePath
|
162
|
-
})
|
157
|
+
!fileRelativePath.startsWith(
|
158
|
+
pathJoin("keycloak", "common", "resources", "node_modules")
|
159
|
+
)
|
163
160
|
) {
|
164
|
-
|
161
|
+
break skip_node_modules;
|
165
162
|
}
|
163
|
+
|
164
|
+
if (kcNodeModulesKeepFilePaths === undefined) {
|
165
|
+
kcNodeModulesKeepFilePaths = [
|
166
|
+
pathJoin("@patternfly", "patternfly", "patternfly.min.css"),
|
167
|
+
pathJoin("patternfly", "dist", "css", "patternfly.min.css"),
|
168
|
+
pathJoin(
|
169
|
+
"patternfly",
|
170
|
+
"dist",
|
171
|
+
"css",
|
172
|
+
"patternfly-additions.min.css"
|
173
|
+
),
|
174
|
+
pathJoin(
|
175
|
+
"patternfly",
|
176
|
+
"dist",
|
177
|
+
"fonts",
|
178
|
+
"OpenSans-Regular-webfont.woff2"
|
179
|
+
),
|
180
|
+
pathJoin(
|
181
|
+
"patternfly",
|
182
|
+
"dist",
|
183
|
+
"fonts",
|
184
|
+
"OpenSans-Light-webfont.woff2"
|
185
|
+
),
|
186
|
+
pathJoin(
|
187
|
+
"patternfly",
|
188
|
+
"dist",
|
189
|
+
"fonts",
|
190
|
+
"fontawesome-webfont.woff2"
|
191
|
+
),
|
192
|
+
pathJoin("jquery", "dist", "jquery.min.js")
|
193
|
+
];
|
194
|
+
}
|
195
|
+
|
196
|
+
for (const keepPath of kcNodeModulesKeepFilePaths) {
|
197
|
+
if (fileRelativePath.endsWith(keepPath)) {
|
198
|
+
break skip_node_modules;
|
199
|
+
}
|
200
|
+
}
|
201
|
+
|
202
|
+
return;
|
166
203
|
}
|
167
204
|
|
168
|
-
|
205
|
+
skip_vendor: {
|
169
206
|
if (
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
"common",
|
174
|
-
"resources",
|
175
|
-
"vendor",
|
176
|
-
dirBasename
|
177
|
-
),
|
178
|
-
filePath: fileRelativePath
|
179
|
-
})
|
207
|
+
!fileRelativePath.startsWith(
|
208
|
+
pathJoin("keycloak", "common", "resources", "vendor")
|
209
|
+
)
|
180
210
|
) {
|
181
|
-
|
211
|
+
break skip_vendor;
|
182
212
|
}
|
213
|
+
|
214
|
+
return;
|
183
215
|
}
|
184
216
|
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
"react-core"
|
194
|
-
),
|
195
|
-
filePath: fileRelativePath
|
196
|
-
})
|
197
|
-
) {
|
217
|
+
skip_rollup_config: {
|
218
|
+
if (
|
219
|
+
fileRelativePath !==
|
220
|
+
pathJoin("keycloak", "common", "resources", "rollup.config.js")
|
221
|
+
) {
|
222
|
+
break skip_rollup_config;
|
223
|
+
}
|
224
|
+
|
198
225
|
return;
|
199
226
|
}
|
200
227
|
}
|
@@ -4,9 +4,22 @@ import * as fs from "fs";
|
|
4
4
|
import { type ThemeType } from "./constants";
|
5
5
|
import { getThemeSrcDirPath } from "./getThemeSrcDirPath";
|
6
6
|
|
7
|
+
type ImplementedThemeTypes = Readonly<Record<ThemeType | "email", boolean>>;
|
8
|
+
|
9
|
+
let cache:
|
10
|
+
| { projectDirPath: string; implementedThemeTypes: ImplementedThemeTypes }
|
11
|
+
| undefined;
|
12
|
+
|
7
13
|
export function getImplementedThemeTypes(params: { projectDirPath: string }) {
|
8
14
|
const { projectDirPath } = params;
|
9
15
|
|
16
|
+
if (cache !== undefined && cache.projectDirPath === projectDirPath) {
|
17
|
+
const { implementedThemeTypes } = cache;
|
18
|
+
return { implementedThemeTypes };
|
19
|
+
}
|
20
|
+
|
21
|
+
cache = undefined;
|
22
|
+
|
10
23
|
const { themeSrcDirPath } = getThemeSrcDirPath({
|
11
24
|
projectDirPath
|
12
25
|
});
|
@@ -19,5 +32,7 @@ export function getImplementedThemeTypes(params: { projectDirPath: string }) {
|
|
19
32
|
])
|
20
33
|
);
|
21
34
|
|
35
|
+
cache = { projectDirPath, implementedThemeTypes };
|
36
|
+
|
22
37
|
return { implementedThemeTypes };
|
23
38
|
}
|