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/932.index.js CHANGED
@@ -18,8 +18,6 @@ __webpack_require__.r(__webpack_exports__);
18
18
  /* harmony import */ var _shared_buildContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(87751);
19
19
  /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(57147);
20
20
  /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_5__);
21
- /* harmony import */ var _shared_getThemeSrcDirPath__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(39216);
22
-
23
21
 
24
22
 
25
23
 
@@ -29,10 +27,7 @@ __webpack_require__.r(__webpack_exports__);
29
27
  async function command(params) {
30
28
  const { cliCommandOptions } = params;
31
29
  const buildContext = (0,_shared_buildContext__WEBPACK_IMPORTED_MODULE_4__/* .getBuildContext */ .s)({ cliCommandOptions });
32
- const { themeSrcDirPath } = (0,_shared_getThemeSrcDirPath__WEBPACK_IMPORTED_MODULE_6__/* .getThemeSrcDirPath */ .f)({
33
- projectDirPath: buildContext.projectDirPath
34
- });
35
- const emailThemeSrcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(themeSrcDirPath, "email");
30
+ const emailThemeSrcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(buildContext.themeSrcDirPath, "email");
36
31
  if (fs__WEBPACK_IMPORTED_MODULE_5__.existsSync(emailThemeSrcDirPath)) {
37
32
  console.warn(`There is already a ${(0,path__WEBPACK_IMPORTED_MODULE_1__.relative)(process.cwd(), emailThemeSrcDirPath)} directory in your project. Aborting.`);
38
33
  process.exit(-1);
@@ -63,467 +58,6 @@ async function command(params) {
63
58
 
64
59
  /***/ }),
65
60
 
66
- /***/ 47802:
67
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
68
-
69
-
70
- // EXPORTS
71
- __webpack_require__.d(__webpack_exports__, {
72
- "x": () => (/* binding */ downloadKeycloakDefaultTheme)
73
- });
74
-
75
- // EXTERNAL MODULE: external "path"
76
- var external_path_ = __webpack_require__(71017);
77
- // EXTERNAL MODULE: ./node_modules/tsafe/assert.js
78
- var assert = __webpack_require__(88078);
79
- // EXTERNAL MODULE: ./dist/bin/shared/constants.js
80
- var constants = __webpack_require__(173);
81
- // EXTERNAL MODULE: ./node_modules/make-fetch-happen/lib/index.js
82
- var lib = __webpack_require__(9525);
83
- var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
84
- // EXTERNAL MODULE: external "fs/promises"
85
- var promises_ = __webpack_require__(73292);
86
- // EXTERNAL MODULE: ./dist/bin/tools/extractArchive.js
87
- var extractArchive = __webpack_require__(29121);
88
- // EXTERNAL MODULE: ./dist/bin/tools/fs.existsAsync.js
89
- var fs_existsAsync = __webpack_require__(43765);
90
- // EXTERNAL MODULE: external "child_process"
91
- var external_child_process_ = __webpack_require__(32081);
92
- // EXTERNAL MODULE: external "util"
93
- var external_util_ = __webpack_require__(73837);
94
- ;// CONCATENATED MODULE: ./dist/bin/tools/downloadAndExtractArchive/fetchProxyOptions.js
95
-
96
-
97
-
98
- function ensureArray(arg0) {
99
- return Array.isArray(arg0) ? arg0 : typeof arg0 === "undefined" ? [] : [arg0];
100
- }
101
- function ensureSingleOrNone(arg0) {
102
- if (!Array.isArray(arg0))
103
- return arg0;
104
- if (arg0.length === 0)
105
- return undefined;
106
- if (arg0.length === 1)
107
- return arg0[0];
108
- throw new Error("Illegal configuration, expected a single value but found multiple: " +
109
- arg0.map(String).join(", "));
110
- }
111
- /**
112
- * Get npm configuration as map
113
- */
114
- async function getNmpConfig(params) {
115
- const { npmWorkspaceRootDirPath } = params;
116
- const exec = (0,external_util_.promisify)(external_child_process_.exec);
117
- const stdout = await exec("npm config get", {
118
- encoding: "utf8",
119
- cwd: npmWorkspaceRootDirPath
120
- }).then(({ stdout }) => stdout);
121
- const npmConfigReducer = (cfg, [key, value]) => key in cfg
122
- ? Object.assign(Object.assign({}, cfg), { [key]: [...ensureArray(cfg[key]), value] }) : Object.assign(Object.assign({}, cfg), { [key]: value });
123
- return stdout
124
- .split("\n")
125
- .filter(line => !line.startsWith(";"))
126
- .map(line => line.trim())
127
- .map(line => line.split("=", 2))
128
- .reduce(npmConfigReducer, {});
129
- }
130
- async function getProxyFetchOptions(params) {
131
- var _a, _b, _c;
132
- const { npmWorkspaceRootDirPath } = params;
133
- const cfg = await getNmpConfig({ npmWorkspaceRootDirPath });
134
- const proxy = ensureSingleOrNone((_a = cfg["https-proxy"]) !== null && _a !== void 0 ? _a : cfg["proxy"]);
135
- const noProxy = (_b = cfg["noproxy"]) !== null && _b !== void 0 ? _b : cfg["no-proxy"];
136
- function maybeBoolean(arg0) {
137
- return typeof arg0 === "undefined" ? undefined : Boolean(arg0);
138
- }
139
- const strictSSL = maybeBoolean(ensureSingleOrNone(cfg["strict-ssl"]));
140
- const cert = cfg["cert"];
141
- const ca = ensureArray((_c = cfg["ca"]) !== null && _c !== void 0 ? _c : cfg["ca[]"]);
142
- const cafile = ensureSingleOrNone(cfg["cafile"]);
143
- if (typeof cafile !== "undefined" && cafile !== "null") {
144
- ca.push(...(await (async () => {
145
- function chunks(arr, size = 2) {
146
- return arr
147
- .map((_, i) => i % size == 0 && arr.slice(i, i + size))
148
- .filter(Boolean);
149
- }
150
- const cafileContent = await (0,promises_.readFile)(cafile, "utf-8");
151
- const newLinePlaceholder = "NEW_LINE_PLACEHOLDER_xIsPsK23svt";
152
- return chunks(cafileContent.split(/(-----END CERTIFICATE-----)/), 2).map(ca => ca
153
- .join("")
154
- .replace(/\r?\n/g, newLinePlaceholder)
155
- .replace(new RegExp(`^${newLinePlaceholder}`), "")
156
- .replace(new RegExp(newLinePlaceholder, "g"), "\\n"));
157
- })()));
158
- }
159
- return {
160
- proxy,
161
- noProxy,
162
- strictSSL,
163
- cert,
164
- ca: ca.length === 0 ? undefined : ca
165
- };
166
- }
167
- //# sourceMappingURL=fetchProxyOptions.js.map
168
- // EXTERNAL MODULE: external "crypto"
169
- var external_crypto_ = __webpack_require__(6113);
170
- // EXTERNAL MODULE: ./dist/bin/tools/fs.rm.js
171
- var fs_rm = __webpack_require__(8699);
172
- ;// CONCATENATED MODULE: ./dist/bin/tools/downloadAndExtractArchive/downloadAndExtractArchive.js
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
- async function downloadAndExtractArchive(params) {
183
- var _a;
184
- const { url, uniqueIdOfOnOnArchiveFile, onArchiveFile, cacheDirPath, npmWorkspaceRootDirPath } = params;
185
- const archiveFileBasename = url.split("?")[0].split("/").reverse()[0];
186
- const archiveFilePath = (0,external_path_.join)(cacheDirPath, archiveFileBasename);
187
- download: {
188
- if (await (0,fs_existsAsync/* existsAsync */.o)(archiveFilePath)) {
189
- const isDownloaded = await SuccessTracker.getIsDownloaded({
190
- cacheDirPath,
191
- archiveFileBasename
192
- });
193
- if (isDownloaded) {
194
- break download;
195
- }
196
- await (0,promises_.unlink)(archiveFilePath);
197
- await SuccessTracker.removeFromDownloaded({
198
- cacheDirPath,
199
- archiveFileBasename
200
- });
201
- }
202
- await (0,promises_.mkdir)((0,external_path_.dirname)(archiveFilePath), { recursive: true });
203
- const response = await lib_default()(url, await getProxyFetchOptions({ npmWorkspaceRootDirPath }));
204
- (_a = response.body) === null || _a === void 0 ? void 0 : _a.setMaxListeners(Number.MAX_VALUE);
205
- (0,assert.assert)(typeof response.body !== "undefined" && response.body != null);
206
- await (0,promises_.writeFile)(archiveFilePath, response.body);
207
- await SuccessTracker.markAsDownloaded({
208
- cacheDirPath,
209
- archiveFileBasename
210
- });
211
- }
212
- const extractDirBasename = `${archiveFileBasename.split(".")[0]}_${uniqueIdOfOnOnArchiveFile}_${external_crypto_.createHash("sha256")
213
- .update(onArchiveFile.toString())
214
- .digest("hex")
215
- .substring(0, 5)}`;
216
- await Promise.all((await (0,promises_.readdir)(cacheDirPath))
217
- .filter((() => {
218
- const prefix = extractDirBasename
219
- .split("_")
220
- .reverse()
221
- .slice(1)
222
- .reverse()
223
- .join("_");
224
- return basename => basename !== extractDirBasename && basename.startsWith(prefix);
225
- })())
226
- .map(async (extractDirBasename) => {
227
- await (0,fs_rm.rm)((0,external_path_.join)(cacheDirPath, extractDirBasename), { recursive: true });
228
- await SuccessTracker.removeFromExtracted({
229
- cacheDirPath,
230
- extractDirBasename
231
- });
232
- }));
233
- const extractedDirPath = (0,external_path_.join)(cacheDirPath, extractDirBasename);
234
- extract_and_transform: {
235
- if (await (0,fs_existsAsync/* existsAsync */.o)(extractedDirPath)) {
236
- const isExtracted = await SuccessTracker.getIsExtracted({
237
- cacheDirPath,
238
- extractDirBasename
239
- });
240
- if (isExtracted) {
241
- break extract_and_transform;
242
- }
243
- await (0,fs_rm.rm)(extractedDirPath, { recursive: true });
244
- await SuccessTracker.removeFromExtracted({
245
- cacheDirPath,
246
- extractDirBasename
247
- });
248
- }
249
- await (0,extractArchive/* extractArchive */.N)({
250
- archiveFilePath,
251
- onArchiveFile: async ({ relativeFilePathInArchive, readFile, writeFile }) => onArchiveFile({
252
- fileRelativePath: relativeFilePathInArchive,
253
- readFile,
254
- writeFile: ({ fileRelativePath, modifiedData }) => writeFile({
255
- filePath: (0,external_path_.join)(extractedDirPath, fileRelativePath),
256
- modifiedData
257
- })
258
- })
259
- });
260
- await SuccessTracker.markAsExtracted({
261
- cacheDirPath,
262
- extractDirBasename
263
- });
264
- }
265
- return { extractedDirPath };
266
- }
267
- var SuccessTracker;
268
- (function (SuccessTracker) {
269
- async function read(params) {
270
- const { cacheDirPath } = params;
271
- const filePath = (0,external_path_.join)(cacheDirPath, "downloadAndExtractArchive.json");
272
- if (!(await (0,fs_existsAsync/* existsAsync */.o)(filePath))) {
273
- return { archiveFileBasenames: [], extractDirBasenames: [] };
274
- }
275
- return JSON.parse((await (0,promises_.readFile)(filePath)).toString("utf8"));
276
- }
277
- async function write(params) {
278
- const { cacheDirPath, successTracker } = params;
279
- const filePath = (0,external_path_.join)(cacheDirPath, "downloadAndExtractArchive.json");
280
- {
281
- const dirPath = (0,external_path_.dirname)(filePath);
282
- if (!(await (0,fs_existsAsync/* existsAsync */.o)(dirPath))) {
283
- await (0,promises_.mkdir)(dirPath, { recursive: true });
284
- }
285
- }
286
- await (0,promises_.writeFile)(filePath, JSON.stringify(successTracker));
287
- }
288
- async function markAsDownloaded(params) {
289
- const { cacheDirPath, archiveFileBasename } = params;
290
- const successTracker = await read({ cacheDirPath });
291
- successTracker.archiveFileBasenames.push(archiveFileBasename);
292
- await write({ cacheDirPath, successTracker });
293
- }
294
- SuccessTracker.markAsDownloaded = markAsDownloaded;
295
- async function getIsDownloaded(params) {
296
- const { cacheDirPath, archiveFileBasename } = params;
297
- const successTracker = await read({ cacheDirPath });
298
- return successTracker.archiveFileBasenames.includes(archiveFileBasename);
299
- }
300
- SuccessTracker.getIsDownloaded = getIsDownloaded;
301
- async function removeFromDownloaded(params) {
302
- const { cacheDirPath, archiveFileBasename } = params;
303
- const successTracker = await read({ cacheDirPath });
304
- successTracker.archiveFileBasenames = successTracker.archiveFileBasenames.filter(basename => basename !== archiveFileBasename);
305
- await write({ cacheDirPath, successTracker });
306
- }
307
- SuccessTracker.removeFromDownloaded = removeFromDownloaded;
308
- async function markAsExtracted(params) {
309
- const { cacheDirPath, extractDirBasename } = params;
310
- const successTracker = await read({ cacheDirPath });
311
- successTracker.extractDirBasenames.push(extractDirBasename);
312
- await write({ cacheDirPath, successTracker });
313
- }
314
- SuccessTracker.markAsExtracted = markAsExtracted;
315
- async function getIsExtracted(params) {
316
- const { cacheDirPath, extractDirBasename } = params;
317
- const successTracker = await read({ cacheDirPath });
318
- return successTracker.extractDirBasenames.includes(extractDirBasename);
319
- }
320
- SuccessTracker.getIsExtracted = getIsExtracted;
321
- async function removeFromExtracted(params) {
322
- const { cacheDirPath, extractDirBasename } = params;
323
- const successTracker = await read({ cacheDirPath });
324
- successTracker.extractDirBasenames = successTracker.extractDirBasenames.filter(basename => basename !== extractDirBasename);
325
- await write({ cacheDirPath, successTracker });
326
- }
327
- SuccessTracker.removeFromExtracted = removeFromExtracted;
328
- })(SuccessTracker || (SuccessTracker = {}));
329
- //# sourceMappingURL=downloadAndExtractArchive.js.map
330
- ;// CONCATENATED MODULE: ./dist/bin/tools/downloadAndExtractArchive/index.js
331
-
332
- //# sourceMappingURL=index.js.map
333
- ;// CONCATENATED MODULE: ./dist/bin/shared/downloadKeycloakDefaultTheme.js
334
-
335
-
336
-
337
-
338
- (0,assert.assert)();
339
- async function downloadKeycloakDefaultTheme(params) {
340
- const { keycloakVersion, buildContext } = params;
341
- let kcNodeModulesKeepFilePaths = undefined;
342
- let kcNodeModulesKeepFilePaths_lastAccountV1 = undefined;
343
- const { extractedDirPath } = await downloadAndExtractArchive({
344
- url: `https://repo1.maven.org/maven2/org/keycloak/keycloak-themes/${keycloakVersion}/keycloak-themes-${keycloakVersion}.jar`,
345
- cacheDirPath: buildContext.cacheDirPath,
346
- npmWorkspaceRootDirPath: buildContext.npmWorkspaceRootDirPath,
347
- uniqueIdOfOnOnArchiveFile: "downloadKeycloakDefaultTheme",
348
- onArchiveFile: async (params) => {
349
- const fileRelativePath = (0,external_path_.relative)("theme", params.fileRelativePath);
350
- if (fileRelativePath.startsWith("..")) {
351
- return;
352
- }
353
- const { readFile, writeFile } = params;
354
- skip_keycloak_v2: {
355
- if (!fileRelativePath.startsWith((0,external_path_.join)("keycloak.v2"))) {
356
- break skip_keycloak_v2;
357
- }
358
- return;
359
- }
360
- last_account_v1_transformations: {
361
- if (constants/* lastKeycloakVersionWithAccountV1 */.v$ !== keycloakVersion) {
362
- break last_account_v1_transformations;
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
- }
397
- patch_account_css: {
398
- if (fileRelativePath !==
399
- (0,external_path_.join)("keycloak", "account", "resources", "css", "account.css")) {
400
- break patch_account_css;
401
- }
402
- await writeFile({
403
- fileRelativePath,
404
- modifiedData: Buffer.from((await readFile())
405
- .toString("utf8")
406
- .replace("top: -34px;", "top: -34px !important;"), "utf8")
407
- });
408
- return;
409
- }
410
- }
411
- skip_unused_resources: {
412
- if (keycloakVersion !== "24.0.4") {
413
- break skip_unused_resources;
414
- }
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
- ];
429
- }
430
- for (const keepPath of kcNodeModulesKeepFilePaths) {
431
- if (fileRelativePath.endsWith(keepPath)) {
432
- break skip_node_modules;
433
- }
434
- }
435
- return;
436
- }
437
- skip_vendor: {
438
- if (!fileRelativePath.startsWith((0,external_path_.join)("keycloak", "common", "resources", "vendor"))) {
439
- break skip_vendor;
440
- }
441
- return;
442
- }
443
- skip_rollup_config: {
444
- if (fileRelativePath !==
445
- (0,external_path_.join)("keycloak", "common", "resources", "rollup.config.js")) {
446
- break skip_rollup_config;
447
- }
448
- return;
449
- }
450
- }
451
- await writeFile({ fileRelativePath });
452
- }
453
- });
454
- return { defaultThemeDirPath: extractedDirPath };
455
- }
456
- //# sourceMappingURL=downloadKeycloakDefaultTheme.js.map
457
-
458
- /***/ }),
459
-
460
- /***/ 39216:
461
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
462
-
463
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
464
- /* harmony export */ "f": () => (/* binding */ getThemeSrcDirPath)
465
- /* harmony export */ });
466
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
467
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
468
- /* harmony import */ var tsafe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1666);
469
- /* harmony import */ var tsafe__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tsafe__WEBPACK_IMPORTED_MODULE_1__);
470
- /* harmony import */ var _tools_crawl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73036);
471
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71017);
472
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__);
473
- /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(173);
474
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(78818);
475
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_5__);
476
-
477
-
478
-
479
-
480
-
481
-
482
- let cache = undefined;
483
- /** Can't catch error, if the directory isn't found, this function will just exit the process with an error message. */
484
- function getThemeSrcDirPath(params) {
485
- const { projectDirPath } = params;
486
- if (cache !== undefined && cache.projectDirPath === projectDirPath) {
487
- const { themeSrcDirPath } = cache;
488
- return { themeSrcDirPath };
489
- }
490
- cache = undefined;
491
- const { themeSrcDirPath } = (() => {
492
- const srcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(projectDirPath, "src");
493
- const themeSrcDirPath = (0,_tools_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
494
- dirPath: srcDirPath,
495
- returnedPathsType: "relative to dirPath"
496
- })
497
- .map(fileRelativePath => {
498
- for (const themeSrcDirBasename of themeSrcDirBasenames) {
499
- const split = fileRelativePath.split(themeSrcDirBasename);
500
- if (split.length === 2) {
501
- return (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(srcDirPath, split[0] + themeSrcDirBasename);
502
- }
503
- }
504
- return undefined;
505
- })
506
- .filter((0,tsafe__WEBPACK_IMPORTED_MODULE_1__.exclude)(undefined))[0];
507
- if (themeSrcDirPath !== undefined) {
508
- return { themeSrcDirPath };
509
- }
510
- for (const themeType of [..._constants__WEBPACK_IMPORTED_MODULE_4__/* .themeTypes */ .rO, "email"]) {
511
- if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_3__.join)(srcDirPath, themeType))) {
512
- continue;
513
- }
514
- return { themeSrcDirPath: srcDirPath };
515
- }
516
- console.log(chalk__WEBPACK_IMPORTED_MODULE_5___default().red("Can't locate your theme source directory. It should be either: "));
517
- process.exit(-1);
518
- })();
519
- cache = { projectDirPath, themeSrcDirPath };
520
- return { themeSrcDirPath };
521
- }
522
- const themeSrcDirBasenames = ["keycloak-theme", "keycloak_theme"];
523
- //# sourceMappingURL=getThemeSrcDirPath.js.map
524
-
525
- /***/ }),
526
-
527
61
  /***/ 95781:
528
62
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
529
63
 
@@ -729,117 +263,6 @@ async function promptKeycloakVersion(params) {
729
263
  }
730
264
  //# sourceMappingURL=promptKeycloakVersion.js.map
731
265
 
732
- /***/ }),
733
-
734
- /***/ 89693:
735
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
736
-
737
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
738
- /* harmony export */ "a": () => (/* binding */ rmSync)
739
- /* harmony export */ });
740
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
741
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
742
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
743
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
744
- /* harmony import */ var _SemVer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12171);
745
-
746
-
747
-
748
- /**
749
- * Polyfill of fs.rmSync(dirPath, { "recursive": true })
750
- * For older version of Node
751
- */
752
- function rmSync(dirPath, options) {
753
- if (_SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.compare */ .h.compare(_SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.parse */ .h.parse(process.version), _SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.parse */ .h.parse("14.14.0")) > 0) {
754
- fs__WEBPACK_IMPORTED_MODULE_0__.rmSync(dirPath, options);
755
- return;
756
- }
757
- const { force = true } = options;
758
- if (force && !fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(dirPath)) {
759
- return;
760
- }
761
- const removeDir_rec = (dirPath) => fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(dirPath).forEach(basename => {
762
- const fileOrDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
763
- if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(fileOrDirPath).isDirectory()) {
764
- removeDir_rec(fileOrDirPath);
765
- return;
766
- }
767
- else {
768
- fs__WEBPACK_IMPORTED_MODULE_0__.unlinkSync(fileOrDirPath);
769
- }
770
- });
771
- removeDir_rec(dirPath);
772
- }
773
- //# sourceMappingURL=fs.rmSync.js.map
774
-
775
- /***/ }),
776
-
777
- /***/ 60332:
778
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
779
-
780
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
781
- /* harmony export */ "N": () => (/* binding */ transformCodebase)
782
- /* harmony export */ });
783
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
784
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
785
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
786
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
787
- /* harmony import */ var _crawl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73036);
788
- /* harmony import */ var _tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(89693);
789
-
790
-
791
-
792
-
793
- /**
794
- * Apply a transformation function to every file of directory
795
- * If source and destination are the same this function can be used to apply the transformation in place
796
- * like filtering out some files or modifying them.
797
- * */
798
- function transformCodebase(params) {
799
- const { srcDirPath, transformSourceCode } = params;
800
- const isTargetSameAsSource = path__WEBPACK_IMPORTED_MODULE_1__.relative(srcDirPath, params.destDirPath) === "";
801
- const destDirPath = isTargetSameAsSource
802
- ? path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, "..", "tmp_xOsPdkPsTdzPs34sOkHs")
803
- : params.destDirPath;
804
- fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(destDirPath, {
805
- recursive: true
806
- });
807
- for (const fileRelativePath of (0,_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
808
- dirPath: srcDirPath,
809
- returnedPathsType: "relative to dirPath"
810
- })) {
811
- const filePath = path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, fileRelativePath);
812
- const destFilePath = path__WEBPACK_IMPORTED_MODULE_1__.join(destDirPath, fileRelativePath);
813
- // NOTE: Optimization, if we don't need to transform the file, just copy
814
- // it using the lower level implementation.
815
- if (transformSourceCode === undefined) {
816
- fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
817
- recursive: true
818
- });
819
- fs__WEBPACK_IMPORTED_MODULE_0__.copyFileSync(filePath, destFilePath);
820
- continue;
821
- }
822
- const transformSourceCodeResult = transformSourceCode({
823
- sourceCode: fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(filePath),
824
- filePath,
825
- fileRelativePath
826
- });
827
- if (transformSourceCodeResult === undefined) {
828
- continue;
829
- }
830
- fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
831
- recursive: true
832
- });
833
- const { newFileName, modifiedSourceCode } = transformSourceCodeResult;
834
- fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(path__WEBPACK_IMPORTED_MODULE_1__.join(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), newFileName !== null && newFileName !== void 0 ? newFileName : path__WEBPACK_IMPORTED_MODULE_1__.basename(destFilePath)), modifiedSourceCode);
835
- }
836
- if (isTargetSameAsSource) {
837
- (0,_tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__/* .rmSync */ .a)(srcDirPath, { recursive: true });
838
- fs__WEBPACK_IMPORTED_MODULE_0__.renameSync(destDirPath, srcDirPath);
839
- }
840
- }
841
- //# sourceMappingURL=transformCodebase.js.map
842
-
843
266
  /***/ })
844
267
 
845
268
  };