keycloakify 10.0.0-rc.65 → 10.0.0-rc.67

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.
Files changed (53) hide show
  1. package/bin/193.index.js +51 -0
  2. package/bin/246.index.js +371 -75118
  3. package/bin/363.index.js +64 -165
  4. package/bin/453.index.js +603 -23
  5. package/bin/{890.index.js → 456.index.js} +1831 -3
  6. package/bin/490.index.js +75195 -0
  7. package/bin/526.index.js +294 -173
  8. package/bin/538.index.js +1 -509
  9. package/bin/{203.index.js → 751.index.js} +306 -305
  10. package/bin/772.index.js +1 -1
  11. package/bin/{190.index.js → 837.index.js} +259 -35
  12. package/bin/932.index.js +1 -578
  13. package/bin/97.index.js +594 -14
  14. package/bin/main.js +8 -8
  15. package/bin/shared/KeycloakVersionRange.d.ts +5 -0
  16. package/bin/shared/KeycloakVersionRange.js.map +1 -0
  17. package/bin/shared/buildContext.d.ts +16 -0
  18. package/bin/shared/buildContext.js.map +1 -0
  19. package/bin/shared/constants.d.ts +1 -1
  20. package/bin/shared/constants.js.map +1 -1
  21. package/bin/shared/copyKeycloakResourcesToPublic.d.ts +8 -0
  22. package/bin/shared/copyKeycloakResourcesToPublic.js.map +1 -0
  23. package/bin/shared/downloadKeycloakDefaultTheme.d.ts +10 -0
  24. package/bin/shared/downloadKeycloakDefaultTheme.js.map +1 -0
  25. package/bin/shared/downloadKeycloakStaticResources.d.ts +9 -0
  26. package/bin/shared/downloadKeycloakStaticResources.js.map +1 -0
  27. package/bin/shared/generateKcGenTs.d.ts +12 -0
  28. package/bin/shared/generateKcGenTs.js.map +1 -0
  29. package/bin/shared/metaInfKeycloakThemes.d.ts +13 -0
  30. package/bin/shared/metaInfKeycloakThemes.js.map +1 -0
  31. package/bin/shared/promptKeycloakVersion.d.ts +7 -0
  32. package/bin/shared/promptKeycloakVersion.js.map +1 -0
  33. package/package.json +21 -12
  34. package/src/bin/add-story.ts +1 -6
  35. package/src/bin/eject-page.ts +7 -8
  36. package/src/bin/initialize-email-theme.ts +1 -6
  37. package/src/bin/keycloakify/buildJars/buildJars.ts +23 -49
  38. package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +15 -20
  39. package/src/bin/keycloakify/keycloakify.ts +6 -8
  40. package/src/bin/shared/buildContext.ts +434 -42
  41. package/src/bin/shared/constants.ts +2 -1
  42. package/src/bin/shared/generateKcGenTs.ts +2 -6
  43. package/src/bin/start-keycloak/keycloakifyBuild.ts +4 -4
  44. package/src/bin/start-keycloak/start-keycloak.ts +40 -83
  45. package/src/vite-plugin/vite-plugin.ts +5 -4
  46. package/vite-plugin/index.js +341 -117
  47. package/bin/480.index.js +0 -466
  48. package/bin/818.index.js +0 -1802
  49. package/bin/827.index.js +0 -1094
  50. package/bin/shared/constants.js +0 -59
  51. package/src/bin/shared/getImplementedThemeTypes.ts +0 -38
  52. package/src/bin/shared/getJarFileBasename.ts +0 -11
  53. package/src/bin/shared/getThemeSrcDirPath.ts +0 -62
package/bin/538.index.js CHANGED
@@ -3,478 +3,6 @@ exports.id = 538;
3
3
  exports.ids = [538];
4
4
  exports.modules = {
5
5
 
6
- /***/ 87751:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
-
10
- // EXPORTS
11
- __webpack_require__.d(__webpack_exports__, {
12
- "s": () => (/* binding */ getBuildContext)
13
- });
14
-
15
- // EXTERNAL MODULE: external "url"
16
- var external_url_ = __webpack_require__(57310);
17
- // EXTERNAL MODULE: external "path"
18
- var external_path_ = __webpack_require__(71017);
19
- // EXTERNAL MODULE: ./dist/bin/tools/getAbsoluteAndInOsFormatPath.js
20
- var getAbsoluteAndInOsFormatPath = __webpack_require__(86644);
21
- // EXTERNAL MODULE: external "child_process"
22
- var external_child_process_ = __webpack_require__(32081);
23
- // EXTERNAL MODULE: ./node_modules/tsafe/assert.js
24
- var assert = __webpack_require__(88078);
25
- // EXTERNAL MODULE: external "fs"
26
- var external_fs_ = __webpack_require__(57147);
27
- ;// CONCATENATED MODULE: ./dist/bin/tools/getNpmWorkspaceRootDirPath.js
28
-
29
-
30
-
31
-
32
- function getNpmWorkspaceRootDirPath(params) {
33
- const { projectDirPath, dependencyExpected } = params;
34
- const npmWorkspaceRootDirPath = (function callee(depth) {
35
- const cwd = (0,external_path_.resolve)((0,external_path_.join)(...[projectDirPath, ...Array(depth).fill("..")]));
36
- (0,assert.assert)(cwd !== external_path_.sep, "NPM workspace not found");
37
- try {
38
- external_child_process_.execSync("npm config get", {
39
- cwd,
40
- stdio: "ignore"
41
- });
42
- }
43
- catch (error) {
44
- if (String(error).includes("ENOWORKSPACES")) {
45
- return callee(depth + 1);
46
- }
47
- throw error;
48
- }
49
- const packageJsonFilePath = (0,external_path_.join)(cwd, "package.json");
50
- if (!external_fs_.existsSync(packageJsonFilePath)) {
51
- return callee(depth + 1);
52
- }
53
- (0,assert.assert)(external_fs_.existsSync(packageJsonFilePath));
54
- const parsedPackageJson = JSON.parse(external_fs_.readFileSync(packageJsonFilePath).toString("utf8"));
55
- let isExpectedDependencyFound = false;
56
- for (const dependenciesOrDevDependencies of [
57
- "dependencies",
58
- "devDependencies"
59
- ]) {
60
- const dependencies = parsedPackageJson[dependenciesOrDevDependencies];
61
- if (dependencies === undefined) {
62
- continue;
63
- }
64
- (0,assert.assert)(dependencies instanceof Object);
65
- if (dependencies[dependencyExpected] === undefined) {
66
- continue;
67
- }
68
- isExpectedDependencyFound = true;
69
- }
70
- if (!isExpectedDependencyFound && parsedPackageJson.name !== dependencyExpected) {
71
- return callee(depth + 1);
72
- }
73
- return cwd;
74
- })(0);
75
- return { npmWorkspaceRootDirPath };
76
- }
77
- //# sourceMappingURL=getNpmWorkspaceRootDirPath.js.map
78
- // EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
79
- var lib = __webpack_require__(52300);
80
- // EXTERNAL MODULE: ./node_modules/tsafe/index.js
81
- var tsafe = __webpack_require__(1666);
82
- // EXTERNAL MODULE: ./dist/bin/shared/constants.js
83
- var constants = __webpack_require__(173);
84
- ;// CONCATENATED MODULE: ./dist/bin/shared/buildContext.js
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
- function getBuildContext(params) {
95
- var _a, _b, _c, _d, _e, _f;
96
- const { cliCommandOptions } = params;
97
- const projectDirPath = (() => {
98
- if (cliCommandOptions.projectDirPath === undefined) {
99
- return process.cwd();
100
- }
101
- return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
102
- pathIsh: cliCommandOptions.projectDirPath,
103
- cwd: process.cwd()
104
- });
105
- })();
106
- const { resolvedViteConfig } = (() => {
107
- if (external_fs_.readdirSync(projectDirPath)
108
- .find(fileBasename => fileBasename.startsWith("vite.config")) ===
109
- undefined) {
110
- return { resolvedViteConfig: undefined };
111
- }
112
- const output = external_child_process_.execSync("npx vite", {
113
- cwd: projectDirPath,
114
- env: Object.assign(Object.assign({}, process.env), { [constants/* vitePluginSubScriptEnvNames.resolveViteConfig */.fe.resolveViteConfig]: "true" })
115
- })
116
- .toString("utf8");
117
- (0,tsafe.assert)(output.includes(constants/* vitePluginSubScriptEnvNames.resolveViteConfig */.fe.resolveViteConfig), "Seems like the Keycloakify's Vite plugin is not installed.");
118
- const resolvedViteConfigStr = output
119
- .split(constants/* vitePluginSubScriptEnvNames.resolveViteConfig */.fe.resolveViteConfig)
120
- .reverse()[0];
121
- const resolvedViteConfig = JSON.parse(resolvedViteConfigStr);
122
- return { resolvedViteConfig };
123
- })();
124
- const parsedPackageJson = (() => {
125
- {
126
- (0,tsafe.assert)();
127
- }
128
- const zParsedPackageJson = lib.z.object({
129
- name: lib.z.string(),
130
- version: lib.z.string().optional(),
131
- homepage: lib.z.string().optional(),
132
- keycloakify: lib.z.object({
133
- extraThemeProperties: lib.z.array(lib.z.string()).optional(),
134
- artifactId: lib.z.string().optional(),
135
- groupId: lib.z.string().optional(),
136
- loginThemeResourcesFromKeycloakVersion: lib.z.string().optional(),
137
- projectBuildDirPath: lib.z.string().optional(),
138
- keycloakifyBuildDirPath: lib.z.string().optional(),
139
- kcContextExclusionsFtl: lib.z.string().optional(),
140
- environmentVariables: lib.z.array(lib.z.object({
141
- name: lib.z.string(),
142
- default: lib.z.string()
143
- }))
144
- .optional(),
145
- themeName: lib.z.union([lib.z.string(), lib.z.array(lib.z.string())]).optional()
146
- })
147
- .optional()
148
- });
149
- {
150
- (0,tsafe.assert)();
151
- }
152
- return zParsedPackageJson.parse(JSON.parse(external_fs_.readFileSync((0,external_path_.join)(projectDirPath, "package.json")).toString("utf8")));
153
- })();
154
- const buildOptions = Object.assign(Object.assign({}, parsedPackageJson.keycloakify), resolvedViteConfig === null || resolvedViteConfig === void 0 ? void 0 : resolvedViteConfig.buildOptions);
155
- const themeNames = (() => {
156
- if (buildOptions.themeName === undefined) {
157
- return [
158
- parsedPackageJson.name
159
- .replace(/^@(.*)/, "$1")
160
- .split("/")
161
- .join("-")
162
- ];
163
- }
164
- if (typeof buildOptions.themeName === "string") {
165
- return [buildOptions.themeName];
166
- }
167
- const [mainThemeName, ...themeVariantNames] = buildOptions.themeName;
168
- (0,tsafe.assert)(mainThemeName !== undefined);
169
- return [mainThemeName, ...themeVariantNames];
170
- })();
171
- const projectBuildDirPath = (() => {
172
- var _a;
173
- webpack: {
174
- if (resolvedViteConfig !== undefined) {
175
- break webpack;
176
- }
177
- if (((_a = parsedPackageJson.keycloakify) === null || _a === void 0 ? void 0 : _a.projectBuildDirPath) !== undefined) {
178
- return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
179
- pathIsh: parsedPackageJson.keycloakify.projectBuildDirPath,
180
- cwd: projectDirPath
181
- });
182
- }
183
- return (0,external_path_.join)(projectDirPath, "build");
184
- }
185
- return (0,external_path_.join)(projectDirPath, resolvedViteConfig.buildDir);
186
- })();
187
- const { npmWorkspaceRootDirPath } = getNpmWorkspaceRootDirPath({
188
- projectDirPath,
189
- dependencyExpected: "keycloakify"
190
- });
191
- return {
192
- bundler: resolvedViteConfig !== undefined ? "vite" : "webpack",
193
- themeVersion: (_b = (_a = process.env.KEYCLOAKIFY_THEME_VERSION) !== null && _a !== void 0 ? _a : parsedPackageJson.version) !== null && _b !== void 0 ? _b : "0.0.0",
194
- themeNames,
195
- extraThemeProperties: buildOptions.extraThemeProperties,
196
- groupId: (() => {
197
- var _a, _b, _c, _d, _e;
198
- const fallbackGroupId = `${themeNames[0]}.keycloak`;
199
- return ((_b = (_a = process.env.KEYCLOAKIFY_GROUP_ID) !== null && _a !== void 0 ? _a : buildOptions.groupId) !== null && _b !== void 0 ? _b : (parsedPackageJson.homepage === undefined
200
- ? fallbackGroupId
201
- : (_e = (_d = (_c = (0,external_url_.parse)(parsedPackageJson.homepage)
202
- .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");
203
- })(),
204
- artifactId: (_d = (_c = process.env.KEYCLOAKIFY_ARTIFACT_ID) !== null && _c !== void 0 ? _c : buildOptions.artifactId) !== null && _d !== void 0 ? _d : `${themeNames[0]}-keycloak-theme`,
205
- loginThemeResourcesFromKeycloakVersion: (_e = buildOptions.loginThemeResourcesFromKeycloakVersion) !== null && _e !== void 0 ? _e : "24.0.4",
206
- projectDirPath,
207
- projectBuildDirPath,
208
- keycloakifyBuildDirPath: (() => {
209
- if (buildOptions.keycloakifyBuildDirPath !== undefined) {
210
- return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
211
- pathIsh: buildOptions.keycloakifyBuildDirPath,
212
- cwd: projectDirPath
213
- });
214
- }
215
- return (0,external_path_.join)(projectDirPath, (resolvedViteConfig === null || resolvedViteConfig === void 0 ? void 0 : resolvedViteConfig.buildDir) === undefined
216
- ? "build_keycloak"
217
- : `${resolvedViteConfig.buildDir}_keycloak`);
218
- })(),
219
- publicDirPath: (() => {
220
- webpack: {
221
- if (resolvedViteConfig !== undefined) {
222
- break webpack;
223
- }
224
- if (process.env.PUBLIC_DIR_PATH !== undefined) {
225
- return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
226
- pathIsh: process.env.PUBLIC_DIR_PATH,
227
- cwd: projectDirPath
228
- });
229
- }
230
- return (0,external_path_.join)(projectDirPath, "public");
231
- }
232
- return (0,external_path_.join)(projectDirPath, resolvedViteConfig.publicDir);
233
- })(),
234
- cacheDirPath: (() => {
235
- const cacheDirPath = (0,external_path_.join)((() => {
236
- if (process.env.XDG_CACHE_HOME !== undefined) {
237
- return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
238
- pathIsh: process.env.XDG_CACHE_HOME,
239
- cwd: process.cwd()
240
- });
241
- }
242
- return (0,external_path_.join)(npmWorkspaceRootDirPath, "node_modules", ".cache");
243
- })(), "keycloakify");
244
- return cacheDirPath;
245
- })(),
246
- urlPathname: (() => {
247
- webpack: {
248
- if (resolvedViteConfig !== undefined) {
249
- break webpack;
250
- }
251
- const { homepage } = parsedPackageJson;
252
- let url = undefined;
253
- if (homepage !== undefined) {
254
- url = new URL(homepage);
255
- }
256
- if (url === undefined) {
257
- return undefined;
258
- }
259
- const out = url.pathname.replace(/([^/])$/, "$1/");
260
- return out === "/" ? undefined : out;
261
- }
262
- return resolvedViteConfig.urlPathname;
263
- })(),
264
- assetsDirPath: (() => {
265
- webpack: {
266
- if (resolvedViteConfig !== undefined) {
267
- break webpack;
268
- }
269
- return (0,external_path_.join)(projectBuildDirPath, "static");
270
- }
271
- return (0,external_path_.join)(projectBuildDirPath, resolvedViteConfig.assetsDir);
272
- })(),
273
- npmWorkspaceRootDirPath,
274
- kcContextExclusionsFtlCode: (() => {
275
- if (buildOptions.kcContextExclusionsFtl === undefined) {
276
- return undefined;
277
- }
278
- if (buildOptions.kcContextExclusionsFtl.endsWith(".ftl")) {
279
- const kcContextExclusionsFtlPath = (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
280
- pathIsh: buildOptions.kcContextExclusionsFtl,
281
- cwd: projectDirPath
282
- });
283
- return external_fs_.readFileSync(kcContextExclusionsFtlPath).toString("utf8");
284
- }
285
- return buildOptions.kcContextExclusionsFtl;
286
- })(),
287
- environmentVariables: (_f = buildOptions.environmentVariables) !== null && _f !== void 0 ? _f : []
288
- };
289
- }
290
- //# sourceMappingURL=buildContext.js.map
291
-
292
- /***/ }),
293
-
294
- /***/ 173:
295
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
296
-
297
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
298
- /* harmony export */ "Dv": () => (/* binding */ onlyBuildJarFileBasenameEnvName),
299
- /* harmony export */ "M": () => (/* binding */ basenameOfTheKeycloakifyResourcesDir),
300
- /* harmony export */ "N$": () => (/* binding */ keycloak_resources),
301
- /* harmony export */ "UX": () => (/* binding */ accountThemePageIds),
302
- /* harmony export */ "fe": () => (/* binding */ vitePluginSubScriptEnvNames),
303
- /* harmony export */ "h6": () => (/* binding */ containerName),
304
- /* harmony export */ "lg": () => (/* binding */ nameOfTheLocalizationRealmOverridesUserProfileProperty),
305
- /* harmony export */ "rO": () => (/* binding */ themeTypes),
306
- /* harmony export */ "sj": () => (/* binding */ loginThemePageIds),
307
- /* harmony export */ "v$": () => (/* binding */ lastKeycloakVersionWithAccountV1),
308
- /* harmony export */ "y_": () => (/* binding */ accountV1ThemeName),
309
- /* harmony export */ "z0": () => (/* binding */ resources_common)
310
- /* harmony export */ });
311
- const nameOfTheLocalizationRealmOverridesUserProfileProperty = "__localizationRealmOverridesUserProfile";
312
- const keycloak_resources = "keycloak-resources";
313
- const resources_common = "resources-common";
314
- const lastKeycloakVersionWithAccountV1 = "21.1.2";
315
- const basenameOfTheKeycloakifyResourcesDir = "build";
316
- const themeTypes = ["login", "account"];
317
- const accountV1ThemeName = "account-v1";
318
- const vitePluginSubScriptEnvNames = {
319
- runPostBuildScript: "KEYCLOAKIFY_RUN_POST_BUILD_SCRIPT",
320
- resolveViteConfig: "KEYCLOAKIFY_RESOLVE_VITE_CONFIG"
321
- };
322
- const onlyBuildJarFileBasenameEnvName = "KEYCLOAKIFY_ONLY_BUILD_JAR_FILE_BASENAME";
323
- const loginThemePageIds = [
324
- "login.ftl",
325
- "login-username.ftl",
326
- "login-password.ftl",
327
- "webauthn-authenticate.ftl",
328
- "webauthn-register.ftl",
329
- "register.ftl",
330
- "info.ftl",
331
- "error.ftl",
332
- "login-reset-password.ftl",
333
- "login-verify-email.ftl",
334
- "terms.ftl",
335
- "login-oauth2-device-verify-user-code.ftl",
336
- "login-oauth-grant.ftl",
337
- "login-otp.ftl",
338
- "login-update-profile.ftl",
339
- "login-update-password.ftl",
340
- "login-idp-link-confirm.ftl",
341
- "login-idp-link-email.ftl",
342
- "login-page-expired.ftl",
343
- "login-config-totp.ftl",
344
- "logout-confirm.ftl",
345
- "idp-review-user-profile.ftl",
346
- "update-email.ftl",
347
- "select-authenticator.ftl",
348
- "saml-post-form.ftl",
349
- "delete-credential.ftl",
350
- "code.ftl",
351
- "delete-account-confirm.ftl",
352
- "frontchannel-logout.ftl",
353
- "login-recovery-authn-code-config.ftl",
354
- "login-recovery-authn-code-input.ftl",
355
- "login-reset-otp.ftl",
356
- "login-x509-info.ftl",
357
- "webauthn-error.ftl"
358
- ];
359
- const accountThemePageIds = [
360
- "password.ftl",
361
- "account.ftl",
362
- "sessions.ftl",
363
- "totp.ftl",
364
- "applications.ftl",
365
- "log.ftl",
366
- "federatedIdentity.ftl"
367
- ];
368
- const containerName = "keycloak-keycloakify";
369
- //# sourceMappingURL=constants.js.map
370
-
371
- /***/ }),
372
-
373
- /***/ 39216:
374
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
375
-
376
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
377
- /* harmony export */ "f": () => (/* binding */ getThemeSrcDirPath)
378
- /* harmony export */ });
379
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
380
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
381
- /* harmony import */ var tsafe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1666);
382
- /* harmony import */ var tsafe__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tsafe__WEBPACK_IMPORTED_MODULE_1__);
383
- /* harmony import */ var _tools_crawl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73036);
384
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71017);
385
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__);
386
- /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(173);
387
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(78818);
388
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_5__);
389
-
390
-
391
-
392
-
393
-
394
-
395
- let cache = undefined;
396
- /** Can't catch error, if the directory isn't found, this function will just exit the process with an error message. */
397
- function getThemeSrcDirPath(params) {
398
- const { projectDirPath } = params;
399
- if (cache !== undefined && cache.projectDirPath === projectDirPath) {
400
- const { themeSrcDirPath } = cache;
401
- return { themeSrcDirPath };
402
- }
403
- cache = undefined;
404
- const { themeSrcDirPath } = (() => {
405
- const srcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(projectDirPath, "src");
406
- const themeSrcDirPath = (0,_tools_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
407
- dirPath: srcDirPath,
408
- returnedPathsType: "relative to dirPath"
409
- })
410
- .map(fileRelativePath => {
411
- for (const themeSrcDirBasename of themeSrcDirBasenames) {
412
- const split = fileRelativePath.split(themeSrcDirBasename);
413
- if (split.length === 2) {
414
- return (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(srcDirPath, split[0] + themeSrcDirBasename);
415
- }
416
- }
417
- return undefined;
418
- })
419
- .filter((0,tsafe__WEBPACK_IMPORTED_MODULE_1__.exclude)(undefined))[0];
420
- if (themeSrcDirPath !== undefined) {
421
- return { themeSrcDirPath };
422
- }
423
- for (const themeType of [..._constants__WEBPACK_IMPORTED_MODULE_4__/* .themeTypes */ .rO, "email"]) {
424
- if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_3__.join)(srcDirPath, themeType))) {
425
- continue;
426
- }
427
- return { themeSrcDirPath: srcDirPath };
428
- }
429
- console.log(chalk__WEBPACK_IMPORTED_MODULE_5___default().red("Can't locate your theme source directory. It should be either: "));
430
- process.exit(-1);
431
- })();
432
- cache = { projectDirPath, themeSrcDirPath };
433
- return { themeSrcDirPath };
434
- }
435
- const themeSrcDirBasenames = ["keycloak-theme", "keycloak_theme"];
436
- //# sourceMappingURL=getThemeSrcDirPath.js.map
437
-
438
- /***/ }),
439
-
440
- /***/ 73036:
441
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
442
-
443
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
444
- /* harmony export */ "J": () => (/* binding */ crawl)
445
- /* harmony export */ });
446
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
447
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
448
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
449
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
450
-
451
-
452
- const crawlRec = (dirPath, filePaths) => {
453
- for (const basename of fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(dirPath)) {
454
- const fileOrDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
455
- if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(fileOrDirPath).isDirectory()) {
456
- crawlRec(fileOrDirPath, filePaths);
457
- continue;
458
- }
459
- filePaths.push(fileOrDirPath);
460
- }
461
- };
462
- /** List all files in a given directory return paths relative to the dir_path */
463
- function crawl(params) {
464
- const { dirPath, returnedPathsType } = params;
465
- const filePaths = [];
466
- crawlRec(dirPath, filePaths);
467
- switch (returnedPathsType) {
468
- case "absolute":
469
- return filePaths;
470
- case "relative to dirPath":
471
- return filePaths.map(filePath => (0,path__WEBPACK_IMPORTED_MODULE_1__.relative)(dirPath, filePath));
472
- }
473
- }
474
- //# sourceMappingURL=crawl.js.map
475
-
476
- /***/ }),
477
-
478
6
  /***/ 43765:
479
7
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
480
8
 
@@ -499,36 +27,6 @@ async function existsAsync(path) {
499
27
 
500
28
  /***/ }),
501
29
 
502
- /***/ 86644:
503
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
504
-
505
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
506
- /* harmony export */ "c": () => (/* binding */ getAbsoluteAndInOsFormatPath)
507
- /* harmony export */ });
508
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
509
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
510
- /* harmony import */ var os__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22037);
511
- /* harmony import */ var os__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(os__WEBPACK_IMPORTED_MODULE_1__);
512
-
513
-
514
- function getAbsoluteAndInOsFormatPath(params) {
515
- const { pathIsh, cwd } = params;
516
- let pathOut = pathIsh;
517
- pathOut = pathOut.replace(/\//g, path__WEBPACK_IMPORTED_MODULE_0__.sep);
518
- if (pathOut.startsWith("~")) {
519
- pathOut = pathOut.replace("~", os__WEBPACK_IMPORTED_MODULE_1__.homedir());
520
- }
521
- pathOut = pathOut.endsWith(path__WEBPACK_IMPORTED_MODULE_0__.sep) ? pathOut.slice(0, -1) : pathOut;
522
- if (!(0,path__WEBPACK_IMPORTED_MODULE_0__.isAbsolute)(pathOut)) {
523
- pathOut = (0,path__WEBPACK_IMPORTED_MODULE_0__.join)(cwd, pathOut);
524
- }
525
- pathOut = (0,path__WEBPACK_IMPORTED_MODULE_0__.resolve)(pathOut);
526
- return pathOut;
527
- }
528
- //# sourceMappingURL=getAbsoluteAndInOsFormatPath.js.map
529
-
530
- /***/ }),
531
-
532
30
  /***/ 1538:
533
31
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
534
32
 
@@ -544,8 +42,6 @@ __webpack_require__.d(__webpack_exports__, {
544
42
  var shared_buildContext = __webpack_require__(87751);
545
43
  // EXTERNAL MODULE: ./node_modules/tsafe/assert.js
546
44
  var assert = __webpack_require__(88078);
547
- // EXTERNAL MODULE: ./dist/bin/shared/getThemeSrcDirPath.js
548
- var getThemeSrcDirPath = __webpack_require__(39216);
549
45
  // EXTERNAL MODULE: external "fs/promises"
550
46
  var promises_ = __webpack_require__(73292);
551
47
  // EXTERNAL MODULE: external "path"
@@ -557,14 +53,10 @@ var fs_existsAsync = __webpack_require__(43765);
557
53
 
558
54
 
559
55
 
560
-
561
56
  (0,assert.assert)();
562
57
  async function generateKcGenTs(params) {
563
58
  const { buildContext } = params;
564
- const { themeSrcDirPath } = (0,getThemeSrcDirPath/* getThemeSrcDirPath */.f)({
565
- projectDirPath: buildContext.projectDirPath
566
- });
567
- const filePath = (0,external_path_.join)(themeSrcDirPath, "kc.gen.ts");
59
+ const filePath = (0,external_path_.join)(buildContext.themeSrcDirPath, "kc.gen.ts");
568
60
  const currentContent = (await (0,fs_existsAsync/* existsAsync */.o)(filePath))
569
61
  ? await promises_.readFile(filePath)
570
62
  : undefined;