keycloakify 11.8.32 → 11.8.34

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/97.index.js CHANGED
@@ -303,6 +303,18 @@ function computeHash(data) {
303
303
  async function getExtensionModuleFileSourceCodeReadyToBeCopied(params) {
304
304
  const { buildContext, extensionModuleDirPath, fileRelativePath, isOwnershipAction, extensionModuleName, extensionModuleVersion } = params;
305
305
  let sourceCode = (await fs_promises__WEBPACK_IMPORTED_MODULE_1__.readFile((0,path__WEBPACK_IMPORTED_MODULE_2__.join)(extensionModuleDirPath, _shared_constants__WEBPACK_IMPORTED_MODULE_4__/* .KEYCLOAK_THEME */ .PC, fileRelativePath))).toString("utf8");
306
+ add_eslint_disable: {
307
+ if (isOwnershipAction) {
308
+ break add_eslint_disable;
309
+ }
310
+ if (!fileRelativePath.endsWith(".ts") && !fileRelativePath.endsWith(".tsx")) {
311
+ break add_eslint_disable;
312
+ }
313
+ if (sourceCode.includes("/* eslint-disable */")) {
314
+ break add_eslint_disable;
315
+ }
316
+ sourceCode = ["/* eslint-disable */", "", sourceCode].join("\n");
317
+ }
306
318
  sourceCode = addCommentToSourceCode({
307
319
  sourceCode,
308
320
  fileRelativePath,
package/bin/main.js CHANGED
@@ -15540,11 +15540,17 @@ function getBuildContext(params) {
15540
15540
  if (themeSrcDirPath !== undefined) {
15541
15541
  return { themeSrcDirPath };
15542
15542
  }
15543
- for (const themeType of [...constants/* THEME_TYPES */.Jh, "email"]) {
15544
- if (!external_fs_.existsSync((0,external_path_.join)(srcDirPath, themeType))) {
15545
- continue;
15543
+ {
15544
+ const basenames = external_fs_.readdirSync(srcDirPath);
15545
+ for (const basename of basenames) {
15546
+ const path = (0,external_path_.join)(srcDirPath, basename);
15547
+ if (!external_fs_.statSync(path).isFile()) {
15548
+ continue;
15549
+ }
15550
+ if (external_fs_.readFileSync(path).toString("utf8").includes("./kc.gen")) {
15551
+ return { themeSrcDirPath: srcDirPath };
15552
+ }
15546
15553
  }
15547
- return { themeSrcDirPath: srcDirPath };
15548
15554
  }
15549
15555
  console.log(source_default().red([
15550
15556
  `Can't locate your Keycloak theme source directory in .${external_path_.sep}${(0,external_path_.relative)(process.cwd(), srcDirPath)}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keycloakify",
3
- "version": "11.8.32",
3
+ "version": "11.8.34",
4
4
  "description": "Framework to create custom Keycloak UIs",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,7 +18,7 @@ import {
18
18
  import type { KeycloakVersionRange } from "./KeycloakVersionRange";
19
19
  import { exclude } from "tsafe";
20
20
  import { crawl } from "../tools/crawl";
21
- import { THEME_TYPES, KEYCLOAK_THEME, type ThemeType } from "./constants";
21
+ import { KEYCLOAK_THEME, type ThemeType } from "./constants";
22
22
  import { objectEntries } from "tsafe/objectEntries";
23
23
  import { id } from "tsafe/id";
24
24
  import chalk from "chalk";
@@ -166,11 +166,20 @@ export function getBuildContext(params: {
166
166
  return { themeSrcDirPath };
167
167
  }
168
168
 
169
- for (const themeType of [...THEME_TYPES, "email"]) {
170
- if (!fs.existsSync(pathJoin(srcDirPath, themeType))) {
171
- continue;
169
+ {
170
+ const basenames = fs.readdirSync(srcDirPath);
171
+
172
+ for (const basename of basenames) {
173
+ const path = pathJoin(srcDirPath, basename);
174
+
175
+ if (!fs.statSync(path).isFile()) {
176
+ continue;
177
+ }
178
+
179
+ if (fs.readFileSync(path).toString("utf8").includes("./kc.gen")) {
180
+ return { themeSrcDirPath: srcDirPath };
181
+ }
172
182
  }
173
- return { themeSrcDirPath: srcDirPath };
174
183
  }
175
184
 
176
185
  console.log(
@@ -34,6 +34,22 @@ export async function getExtensionModuleFileSourceCodeReadyToBeCopied(params: {
34
34
  )
35
35
  ).toString("utf8");
36
36
 
37
+ add_eslint_disable: {
38
+ if (isOwnershipAction) {
39
+ break add_eslint_disable;
40
+ }
41
+
42
+ if (!fileRelativePath.endsWith(".ts") && !fileRelativePath.endsWith(".tsx")) {
43
+ break add_eslint_disable;
44
+ }
45
+
46
+ if (sourceCode.includes("/* eslint-disable */")) {
47
+ break add_eslint_disable;
48
+ }
49
+
50
+ sourceCode = ["/* eslint-disable */", "", sourceCode].join("\n");
51
+ }
52
+
37
53
  sourceCode = addCommentToSourceCode({
38
54
  sourceCode,
39
55
  fileRelativePath,
@@ -408,11 +408,17 @@ function getBuildContext(params) {
408
408
  if (themeSrcDirPath !== undefined) {
409
409
  return { themeSrcDirPath };
410
410
  }
411
- for (const themeType of [...constants.THEME_TYPES, "email"]) {
412
- if (!external_fs_.existsSync((0,external_path_.join)(srcDirPath, themeType))) {
413
- continue;
411
+ {
412
+ const basenames = external_fs_.readdirSync(srcDirPath);
413
+ for (const basename of basenames) {
414
+ const path = (0,external_path_.join)(srcDirPath, basename);
415
+ if (!external_fs_.statSync(path).isFile()) {
416
+ continue;
417
+ }
418
+ if (external_fs_.readFileSync(path).toString("utf8").includes("./kc.gen")) {
419
+ return { themeSrcDirPath: srcDirPath };
420
+ }
414
421
  }
415
- return { themeSrcDirPath: srcDirPath };
416
422
  }
417
423
  console.log(source_default().red([
418
424
  `Can't locate your Keycloak theme source directory in .${external_path_.sep}${(0,external_path_.relative)(process.cwd(), srcDirPath)}`,