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/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
- if (!(0,isInside/* isInside */.V)({ dirPath: "theme", filePath: params.fileRelativePath })) {
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,isInside/* isInside */.V)({
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
- for (const dirBasename of [
417
- "@patternfly-v5",
418
- "@rollup",
419
- "rollup",
420
- "react",
421
- "react-dom",
422
- "shx",
423
- ".pnpm"
424
- ]) {
425
- if ((0,isInside/* isInside */.V)({
426
- dirPath: (0,external_path_.join)("keycloak", "common", "resources", "node_modules", dirBasename),
427
- filePath: fileRelativePath
428
- })) {
429
- return;
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
- for (const dirBasename of ["react", "react-dom"]) {
433
- if ((0,isInside/* isInside */.V)({
434
- dirPath: (0,external_path_.join)("keycloak", "common", "resources", "vendor", dirBasename),
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
- if ((0,isInside/* isInside */.V)({
441
- dirPath: (0,external_path_.join)("keycloak", "common", "resources", "node_modules", "@patternfly", "react-core"),
442
- filePath: fileRelativePath
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(240), __nccwpck_require__.e(363)]).then(__nccwpck_require__.bind(__nccwpck_require__, 52363));
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(240), __nccwpck_require__.e(526)]).then(__nccwpck_require__.bind(__nccwpck_require__, 80526));
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(240), __nccwpck_require__.e(932)]).then(__nccwpck_require__.bind(__nccwpck_require__, 16932));
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(240), __nccwpck_require__.e(193)]).then(__nccwpck_require__.bind(__nccwpck_require__, 23193));
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.64",
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/240.index.js",
776
+ "bin/203.index.js",
776
777
  "bin/246.index.js",
777
778
  "bin/36.index.js",
778
779
  "bin/363.index.js",
@@ -166,6 +166,7 @@ export declare namespace KcContext {
166
166
  algorithm: "HmacSHA1" | "HmacSHA256" | "HmacSHA512";
167
167
  digits: number;
168
168
  lookAheadWindow: number;
169
+ getAlgorithmKey: () => string;
169
170
  } & (
170
171
  | {
171
172
  type: "totp";
@@ -148,7 +148,8 @@ export const kcContextMocks: KcContext[] = [
148
148
  digits: 6,
149
149
  lookAheadWindow: 1,
150
150
  type: "totp",
151
- period: 30
151
+ period: 30,
152
+ getAlgorithmKey: () => "SHA1"
152
153
  }
153
154
  },
154
155
  mode: "qr",
@@ -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")}: {algToKeyUriAlg?.[totp.policy.algorithm] ?? totp.policy.algorithm}
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
- <#attempt>
310
- <#local returnValue = totp.policy.getAlgorithmKey()>
311
- <#recover>
312
- <#return "ABORT: Couldn't evaluate totp.policy.getAlgorithmKey()">
313
- </#attempt>
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
- if (!isInside({ dirPath: "theme", filePath: params.fileRelativePath })) {
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
- patch_account_css: {
50
+ skip_web_modules: {
54
51
  if (
55
- fileRelativePath !==
56
- pathJoin("keycloak", "account", "resources", "css", "account.css")
52
+ !fileRelativePath.startsWith(
53
+ pathJoin("keycloak", "common", "resources", "web_modules")
54
+ )
57
55
  ) {
58
- break patch_account_css;
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
- skip_web_modules: {
62
+ skip_lib: {
75
63
  if (
76
- !isInside({
77
- dirPath: pathJoin(
78
- "keycloak",
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 skip_web_modules;
68
+ break skip_lib;
87
69
  }
88
70
 
89
71
  return;
90
72
  }
91
73
 
92
- skip_unused_node_modules: {
93
- const nodeModulesDirPath = pathJoin(
94
- "keycloak",
95
- "common",
96
- "resources",
97
- "node_modules"
98
- );
99
-
74
+ skip_node_modules: {
100
75
  if (
101
- !isInside({
102
- dirPath: nodeModulesDirPath,
103
- filePath: fileRelativePath
104
- })
76
+ !fileRelativePath.startsWith(
77
+ pathJoin("keycloak", "common", "resources", "node_modules")
78
+ )
105
79
  ) {
106
- break skip_unused_node_modules;
80
+ break skip_node_modules;
107
81
  }
108
82
 
109
- const toKeepPrefixes = [
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
- fileBasename
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
- pathJoin(nodeModulesDirPath, "patternfly", "dist", "fonts")
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
- toKeepPrefixes.find(prefix =>
128
- fileRelativePath.startsWith(prefix)
129
- ) !== undefined
130
+ fileRelativePath !==
131
+ pathJoin("keycloak", "account", "resources", "css", "account.css")
130
132
  ) {
131
- break skip_unused_node_modules;
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
- for (const dirBasename of [
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
- isInside({
154
- dirPath: pathJoin(
155
- "keycloak",
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
- return;
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
- for (const dirBasename of ["react", "react-dom"]) {
205
+ skip_vendor: {
169
206
  if (
170
- isInside({
171
- dirPath: pathJoin(
172
- "keycloak",
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
- return;
211
+ break skip_vendor;
182
212
  }
213
+
214
+ return;
183
215
  }
184
216
 
185
- if (
186
- isInside({
187
- dirPath: pathJoin(
188
- "keycloak",
189
- "common",
190
- "resources",
191
- "node_modules",
192
- "@patternfly",
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
  }