keycloakify 10.0.0-rc.62 → 10.0.0-rc.64
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/193.index.js +552 -0
- package/bin/{991.index.js → 240.index.js} +40 -2
- package/bin/{952.index.js → 363.index.js} +702 -154
- package/bin/{214.index.js → 430.index.js} +2 -161
- package/bin/526.index.js +111 -93
- package/bin/538.index.js +37 -28
- package/bin/{98.index.js → 827.index.js} +39 -187
- package/bin/{941.index.js → 890.index.js} +159 -2
- package/bin/932.index.js +37 -66
- package/bin/97.index.js +1 -1
- package/bin/main.js +7 -7
- package/package.json +9 -9
- package/src/bin/add-story.ts +1 -1
- package/src/bin/keycloakify/buildJars/buildJar.ts +24 -27
- package/src/bin/keycloakify/buildJars/buildJars.ts +5 -5
- package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +33 -32
- package/src/bin/keycloakify/generateResources/generateResourcesForThemeVariant.ts +22 -26
- package/src/bin/shared/getImplementedThemeTypes.ts +23 -0
- package/src/bin/shared/getThemeSrcDirPath.ts +44 -32
- package/src/bin/shared/metaInfKeycloakThemes.ts +16 -60
- package/src/bin/start-keycloak/appBuild.ts +1 -1
- package/src/bin/start-keycloak/keycloakifyBuild.ts +3 -2
- package/src/bin/start-keycloak/start-keycloak.ts +37 -71
- package/vite-plugin/index.js +1848 -30
- package/bin/190.index.js +0 -597
@@ -1,5 +1,5 @@
|
|
1
|
-
exports.id =
|
2
|
-
exports.ids = [
|
1
|
+
exports.id = 430;
|
2
|
+
exports.ids = [430];
|
3
3
|
exports.modules = {
|
4
4
|
|
5
5
|
/***/ 84794:
|
@@ -478,22 +478,6 @@ function createFromFd(fd, options) {
|
|
478
478
|
}
|
479
479
|
|
480
480
|
|
481
|
-
/***/ }),
|
482
|
-
|
483
|
-
/***/ 31621:
|
484
|
-
/***/ ((module) => {
|
485
|
-
|
486
|
-
"use strict";
|
487
|
-
|
488
|
-
|
489
|
-
module.exports = (flag, argv = process.argv) => {
|
490
|
-
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
491
|
-
const position = argv.indexOf(prefix + flag);
|
492
|
-
const terminatorPosition = argv.indexOf('--');
|
493
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
494
|
-
};
|
495
|
-
|
496
|
-
|
497
481
|
/***/ }),
|
498
482
|
|
499
483
|
/***/ 54833:
|
@@ -556,149 +540,6 @@ function pendGo(self, fn) {
|
|
556
540
|
}
|
557
541
|
|
558
542
|
|
559
|
-
/***/ }),
|
560
|
-
|
561
|
-
/***/ 59318:
|
562
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
563
|
-
|
564
|
-
"use strict";
|
565
|
-
|
566
|
-
const os = __webpack_require__(22037);
|
567
|
-
const tty = __webpack_require__(76224);
|
568
|
-
const hasFlag = __webpack_require__(31621);
|
569
|
-
|
570
|
-
const {env} = process;
|
571
|
-
|
572
|
-
let forceColor;
|
573
|
-
if (hasFlag('no-color') ||
|
574
|
-
hasFlag('no-colors') ||
|
575
|
-
hasFlag('color=false') ||
|
576
|
-
hasFlag('color=never')) {
|
577
|
-
forceColor = 0;
|
578
|
-
} else if (hasFlag('color') ||
|
579
|
-
hasFlag('colors') ||
|
580
|
-
hasFlag('color=true') ||
|
581
|
-
hasFlag('color=always')) {
|
582
|
-
forceColor = 1;
|
583
|
-
}
|
584
|
-
|
585
|
-
if ('FORCE_COLOR' in env) {
|
586
|
-
if (env.FORCE_COLOR === 'true') {
|
587
|
-
forceColor = 1;
|
588
|
-
} else if (env.FORCE_COLOR === 'false') {
|
589
|
-
forceColor = 0;
|
590
|
-
} else {
|
591
|
-
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
592
|
-
}
|
593
|
-
}
|
594
|
-
|
595
|
-
function translateLevel(level) {
|
596
|
-
if (level === 0) {
|
597
|
-
return false;
|
598
|
-
}
|
599
|
-
|
600
|
-
return {
|
601
|
-
level,
|
602
|
-
hasBasic: true,
|
603
|
-
has256: level >= 2,
|
604
|
-
has16m: level >= 3
|
605
|
-
};
|
606
|
-
}
|
607
|
-
|
608
|
-
function supportsColor(haveStream, streamIsTTY) {
|
609
|
-
if (forceColor === 0) {
|
610
|
-
return 0;
|
611
|
-
}
|
612
|
-
|
613
|
-
if (hasFlag('color=16m') ||
|
614
|
-
hasFlag('color=full') ||
|
615
|
-
hasFlag('color=truecolor')) {
|
616
|
-
return 3;
|
617
|
-
}
|
618
|
-
|
619
|
-
if (hasFlag('color=256')) {
|
620
|
-
return 2;
|
621
|
-
}
|
622
|
-
|
623
|
-
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
624
|
-
return 0;
|
625
|
-
}
|
626
|
-
|
627
|
-
const min = forceColor || 0;
|
628
|
-
|
629
|
-
if (env.TERM === 'dumb') {
|
630
|
-
return min;
|
631
|
-
}
|
632
|
-
|
633
|
-
if (process.platform === 'win32') {
|
634
|
-
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
635
|
-
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
636
|
-
const osRelease = os.release().split('.');
|
637
|
-
if (
|
638
|
-
Number(osRelease[0]) >= 10 &&
|
639
|
-
Number(osRelease[2]) >= 10586
|
640
|
-
) {
|
641
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
642
|
-
}
|
643
|
-
|
644
|
-
return 1;
|
645
|
-
}
|
646
|
-
|
647
|
-
if ('CI' in env) {
|
648
|
-
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
649
|
-
return 1;
|
650
|
-
}
|
651
|
-
|
652
|
-
return min;
|
653
|
-
}
|
654
|
-
|
655
|
-
if ('TEAMCITY_VERSION' in env) {
|
656
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
657
|
-
}
|
658
|
-
|
659
|
-
if (env.COLORTERM === 'truecolor') {
|
660
|
-
return 3;
|
661
|
-
}
|
662
|
-
|
663
|
-
if ('TERM_PROGRAM' in env) {
|
664
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
665
|
-
|
666
|
-
switch (env.TERM_PROGRAM) {
|
667
|
-
case 'iTerm.app':
|
668
|
-
return version >= 3 ? 3 : 2;
|
669
|
-
case 'Apple_Terminal':
|
670
|
-
return 2;
|
671
|
-
// No default
|
672
|
-
}
|
673
|
-
}
|
674
|
-
|
675
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
676
|
-
return 2;
|
677
|
-
}
|
678
|
-
|
679
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
680
|
-
return 1;
|
681
|
-
}
|
682
|
-
|
683
|
-
if ('COLORTERM' in env) {
|
684
|
-
return 1;
|
685
|
-
}
|
686
|
-
|
687
|
-
return min;
|
688
|
-
}
|
689
|
-
|
690
|
-
function getSupportLevel(stream) {
|
691
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
692
|
-
return translateLevel(level);
|
693
|
-
}
|
694
|
-
|
695
|
-
module.exports = {
|
696
|
-
supportsColor: getSupportLevel,
|
697
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
698
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
699
|
-
};
|
700
|
-
|
701
|
-
|
702
543
|
/***/ }),
|
703
544
|
|
704
545
|
/***/ 78781:
|
package/bin/526.index.js
CHANGED
@@ -3,6 +3,37 @@ exports.id = 526;
|
|
3
3
|
exports.ids = [526];
|
4
4
|
exports.modules = {
|
5
5
|
|
6
|
+
/***/ 64409:
|
7
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
8
|
+
|
9
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
10
|
+
/* harmony export */ "C": () => (/* binding */ getImplementedThemeTypes)
|
11
|
+
/* harmony export */ });
|
12
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
|
13
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
|
14
|
+
/* harmony import */ var tsafe_objectFromEntries__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(68634);
|
15
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57147);
|
16
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_2__);
|
17
|
+
/* harmony import */ var _getThemeSrcDirPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39216);
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
function getImplementedThemeTypes(params) {
|
23
|
+
const { projectDirPath } = params;
|
24
|
+
const { themeSrcDirPath } = (0,_getThemeSrcDirPath__WEBPACK_IMPORTED_MODULE_3__/* .getThemeSrcDirPath */ .f)({
|
25
|
+
projectDirPath
|
26
|
+
});
|
27
|
+
const implementedThemeTypes = (0,tsafe_objectFromEntries__WEBPACK_IMPORTED_MODULE_1__.objectFromEntries)(["login", "account", "email"].map(themeType => [
|
28
|
+
themeType,
|
29
|
+
fs__WEBPACK_IMPORTED_MODULE_2__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_0__.join)(themeSrcDirPath, themeType))
|
30
|
+
]));
|
31
|
+
return { implementedThemeTypes };
|
32
|
+
}
|
33
|
+
//# sourceMappingURL=getImplementedThemeTypes.js.map
|
34
|
+
|
35
|
+
/***/ }),
|
36
|
+
|
6
37
|
/***/ 2323:
|
7
38
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
8
39
|
|
@@ -18,67 +49,70 @@ function getJarFileBasename(params) {
|
|
18
49
|
|
19
50
|
/***/ }),
|
20
51
|
|
21
|
-
/***/
|
52
|
+
/***/ 39216:
|
22
53
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
23
54
|
|
24
55
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
25
|
-
/* harmony export */ "
|
26
|
-
/* harmony export */ "JJ": () => (/* binding */ writeMetaInfKeycloakThemes),
|
27
|
-
/* harmony export */ "Ju": () => (/* binding */ readMetaInfKeycloakThemes_fromResourcesDirPath),
|
28
|
-
/* harmony export */ "KQ": () => (/* binding */ getMetaInfKeycloakThemesJsonFilePath)
|
56
|
+
/* harmony export */ "f": () => (/* binding */ getThemeSrcDirPath)
|
29
57
|
/* harmony export */ });
|
30
|
-
/* harmony import */ var
|
31
|
-
/* harmony import */ var
|
32
|
-
/* harmony import */ var
|
33
|
-
/* harmony import */ var
|
34
|
-
/* harmony import */ var
|
35
|
-
/* harmony import */ var
|
36
|
-
/* harmony import */ var
|
58
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
|
59
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
60
|
+
/* harmony import */ var tsafe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1666);
|
61
|
+
/* harmony import */ var tsafe__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tsafe__WEBPACK_IMPORTED_MODULE_1__);
|
62
|
+
/* harmony import */ var _tools_crawl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73036);
|
63
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71017);
|
64
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__);
|
65
|
+
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(173);
|
66
|
+
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(78818);
|
67
|
+
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_5__);
|
37
68
|
|
38
69
|
|
39
70
|
|
40
71
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
function
|
46
|
-
const {
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
72
|
+
|
73
|
+
|
74
|
+
let cache = undefined;
|
75
|
+
/** Can't catch error, if the directory isn't found, this function will just exit the process with an error message. */
|
76
|
+
function getThemeSrcDirPath(params) {
|
77
|
+
const { projectDirPath } = params;
|
78
|
+
if (cache !== undefined && cache.projectDirPath === projectDirPath) {
|
79
|
+
const { themeSrcDirPath } = cache;
|
80
|
+
return { themeSrcDirPath };
|
81
|
+
}
|
82
|
+
cache = undefined;
|
83
|
+
const { themeSrcDirPath } = (() => {
|
84
|
+
const srcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(projectDirPath, "src");
|
85
|
+
const themeSrcDirPath = (0,_tools_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
|
86
|
+
dirPath: srcDirPath,
|
87
|
+
returnedPathsType: "relative to dirPath"
|
88
|
+
})
|
89
|
+
.map(fileRelativePath => {
|
90
|
+
for (const themeSrcDirBasename of themeSrcDirBasenames) {
|
91
|
+
const split = fileRelativePath.split(themeSrcDirBasename);
|
92
|
+
if (split.length === 2) {
|
93
|
+
return (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(srcDirPath, split[0] + themeSrcDirBasename);
|
94
|
+
}
|
62
95
|
}
|
96
|
+
return undefined;
|
97
|
+
})
|
98
|
+
.filter((0,tsafe__WEBPACK_IMPORTED_MODULE_1__.exclude)(undefined))[0];
|
99
|
+
if (themeSrcDirPath !== undefined) {
|
100
|
+
return { themeSrcDirPath };
|
63
101
|
}
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
}
|
68
|
-
|
69
|
-
const { resourcesDirPath, metaInfKeycloakThemes } = params;
|
70
|
-
const metaInfKeycloakThemesJsonPath = getMetaInfKeycloakThemesJsonFilePath({
|
71
|
-
resourcesDirPath
|
72
|
-
});
|
73
|
-
{
|
74
|
-
const dirPath = (0,path__WEBPACK_IMPORTED_MODULE_0__.dirname)(metaInfKeycloakThemesJsonPath);
|
75
|
-
if (!fs__WEBPACK_IMPORTED_MODULE_1__.existsSync(dirPath)) {
|
76
|
-
fs__WEBPACK_IMPORTED_MODULE_1__.mkdirSync(dirPath, { recursive: true });
|
102
|
+
for (const themeType of [..._constants__WEBPACK_IMPORTED_MODULE_4__/* .themeTypes */ .rO, "email"]) {
|
103
|
+
if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_3__.join)(srcDirPath, themeType))) {
|
104
|
+
continue;
|
105
|
+
}
|
106
|
+
return { themeSrcDirPath: srcDirPath };
|
77
107
|
}
|
78
|
-
|
79
|
-
|
108
|
+
console.log(chalk__WEBPACK_IMPORTED_MODULE_5___default().red("Can't locate your theme source directory. It should be either: "));
|
109
|
+
process.exit(-1);
|
110
|
+
})();
|
111
|
+
cache = { projectDirPath, themeSrcDirPath };
|
112
|
+
return { themeSrcDirPath };
|
80
113
|
}
|
81
|
-
|
114
|
+
const themeSrcDirBasenames = ["keycloak-theme", "keycloak_theme"];
|
115
|
+
//# sourceMappingURL=getThemeSrcDirPath.js.map
|
82
116
|
|
83
117
|
/***/ }),
|
84
118
|
|
@@ -306,8 +340,8 @@ var shared_buildContext = __webpack_require__(87751);
|
|
306
340
|
var exclude = __webpack_require__(41370);
|
307
341
|
// EXTERNAL MODULE: ./dist/bin/shared/promptKeycloakVersion.js + 2 modules
|
308
342
|
var promptKeycloakVersion = __webpack_require__(95781);
|
309
|
-
// EXTERNAL MODULE: ./dist/bin/shared/
|
310
|
-
var
|
343
|
+
// EXTERNAL MODULE: ./dist/bin/shared/getImplementedThemeTypes.js
|
344
|
+
var getImplementedThemeTypes = __webpack_require__(64409);
|
311
345
|
// EXTERNAL MODULE: ./dist/bin/shared/constants.js
|
312
346
|
var constants = __webpack_require__(173);
|
313
347
|
// EXTERNAL MODULE: ./dist/bin/tools/SemVer.js
|
@@ -414,7 +448,7 @@ async function appBuild(params) {
|
|
414
448
|
}
|
415
449
|
})();
|
416
450
|
const dResult = new Deferred.Deferred();
|
417
|
-
const child = external_child_process_.spawn(command, args, { cwd });
|
451
|
+
const child = external_child_process_.spawn(command, args, { cwd, shell: true });
|
418
452
|
child.stdout.on("data", data => {
|
419
453
|
if (data.toString("utf8").includes("gzip:")) {
|
420
454
|
return;
|
@@ -438,7 +472,8 @@ async function keycloakifyBuild(params) {
|
|
438
472
|
const dResult = new Deferred.Deferred();
|
439
473
|
const child = external_child_process_.spawn("npx", ["keycloakify", "build"], {
|
440
474
|
cwd: buildContext.projectDirPath,
|
441
|
-
env: Object.assign(Object.assign({}, process.env), { [constants/* onlyBuildJarFileBasenameEnvName */.Dv]: onlyBuildJarFileBasename })
|
475
|
+
env: Object.assign(Object.assign({}, process.env), { [constants/* onlyBuildJarFileBasenameEnvName */.Dv]: onlyBuildJarFileBasename }),
|
476
|
+
shell: true
|
442
477
|
});
|
443
478
|
child.stdout.on("data", data => process.stdout.write(data));
|
444
479
|
child.stderr.on("data", data => process.stderr.write(data));
|
@@ -517,38 +552,7 @@ async function command(params) {
|
|
517
552
|
}
|
518
553
|
const { cliCommandOptions } = params;
|
519
554
|
const buildContext = (0,shared_buildContext/* getBuildContext */.s)({ cliCommandOptions });
|
520
|
-
{
|
521
|
-
const { isAppBuildSuccess } = await appBuild({
|
522
|
-
buildContext
|
523
|
-
});
|
524
|
-
if (!isAppBuildSuccess) {
|
525
|
-
console.log(source_default().red(`App build failed, exiting. Try running 'yarn build-keycloak-theme' and see what's wrong.`));
|
526
|
-
process.exit(1);
|
527
|
-
}
|
528
|
-
const { isKeycloakifyBuildSuccess } = await keycloakifyBuild({
|
529
|
-
onlyBuildJarFileBasename: undefined,
|
530
|
-
buildContext
|
531
|
-
});
|
532
|
-
if (!isKeycloakifyBuildSuccess) {
|
533
|
-
console.log(source_default().red(`Keycloakify build failed, exiting. Try running 'yarn build-keycloak-theme' and see what's wrong.`));
|
534
|
-
process.exit(1);
|
535
|
-
}
|
536
|
-
}
|
537
|
-
const { doesImplementAccountTheme } = await (async () => {
|
538
|
-
const latestJarFilePath = external_fs_.readdirSync(buildContext.keycloakifyBuildDirPath)
|
539
|
-
.filter(fileBasename => fileBasename.endsWith(".jar"))
|
540
|
-
.map(fileBasename => (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, fileBasename))
|
541
|
-
.sort((a, b) => external_fs_.statSync(b).mtimeMs - external_fs_.statSync(a).mtimeMs)[0];
|
542
|
-
(0,assert.assert)(latestJarFilePath !== undefined);
|
543
|
-
const metaInfKeycloakThemes = await (0,shared_metaInfKeycloakThemes/* readMetaInfKeycloakThemes_fromJar */.IS)({
|
544
|
-
jarFilePath: latestJarFilePath
|
545
|
-
});
|
546
|
-
const mainThemeEntry = metaInfKeycloakThemes.themes.find(({ name }) => name === buildContext.themeNames[0]);
|
547
|
-
(0,assert.assert)(mainThemeEntry !== undefined);
|
548
|
-
const doesImplementAccountTheme = mainThemeEntry.types.includes("account");
|
549
|
-
return { doesImplementAccountTheme };
|
550
|
-
})();
|
551
|
-
const { keycloakVersion, keycloakMajorNumber: keycloakMajorVersionNumber } = await (async function getKeycloakMajor() {
|
555
|
+
const { keycloakVersion, keycloakMajorNumber: keycloakMajorVersionNumber } = await (async () => {
|
552
556
|
if (cliCommandOptions.keycloakVersion !== undefined) {
|
553
557
|
return {
|
554
558
|
keycloakVersion: cliCommandOptions.keycloakVersion,
|
@@ -564,16 +568,12 @@ async function command(params) {
|
|
564
568
|
});
|
565
569
|
console.log(`→ ${keycloakVersion}`);
|
566
570
|
const keycloakMajorNumber = SemVer/* SemVer.parse */.h.parse(keycloakVersion).major;
|
567
|
-
if (doesImplementAccountTheme && keycloakMajorNumber === 22) {
|
568
|
-
console.log([
|
569
|
-
"Unfortunately, Keycloakify themes that implements an account theme do not work on Keycloak 22",
|
570
|
-
"Please select any other Keycloak version"
|
571
|
-
].join(" "));
|
572
|
-
return getKeycloakMajor();
|
573
|
-
}
|
574
571
|
return { keycloakVersion, keycloakMajorNumber };
|
575
572
|
})();
|
576
573
|
const keycloakVersionRange = (() => {
|
574
|
+
const doesImplementAccountTheme = (0,getImplementedThemeTypes/* getImplementedThemeTypes */.C)({
|
575
|
+
projectDirPath: buildContext.projectDirPath
|
576
|
+
}).implementedThemeTypes.account;
|
577
577
|
if (doesImplementAccountTheme) {
|
578
578
|
const keycloakVersionRange = (() => {
|
579
579
|
if (keycloakMajorVersionNumber <= 21) {
|
@@ -603,6 +603,23 @@ async function command(params) {
|
|
603
603
|
}
|
604
604
|
})();
|
605
605
|
const { jarFileBasename } = (0,getJarFileBasename/* getJarFileBasename */.m)({ keycloakVersionRange });
|
606
|
+
{
|
607
|
+
const { isAppBuildSuccess } = await appBuild({
|
608
|
+
buildContext
|
609
|
+
});
|
610
|
+
if (!isAppBuildSuccess) {
|
611
|
+
console.log(source_default().red(`App build failed, exiting. Try running 'npm run build-keycloak-theme' and see what's wrong.`));
|
612
|
+
process.exit(1);
|
613
|
+
}
|
614
|
+
const { isKeycloakifyBuildSuccess } = await keycloakifyBuild({
|
615
|
+
onlyBuildJarFileBasename: jarFileBasename,
|
616
|
+
buildContext
|
617
|
+
});
|
618
|
+
if (!isKeycloakifyBuildSuccess) {
|
619
|
+
console.log(source_default().red(`Keycloakify build failed, exiting. Try running 'npm run build-keycloak-theme' and see what's wrong.`));
|
620
|
+
process.exit(1);
|
621
|
+
}
|
622
|
+
}
|
606
623
|
console.log(`Using Keycloak ${source_default().bold(jarFileBasename)}`);
|
607
624
|
const realmJsonFilePath = await (async () => {
|
608
625
|
if (cliCommandOptions.realmJsonFilePath !== undefined) {
|
@@ -727,7 +744,8 @@ async function command(params) {
|
|
727
744
|
...(realmJsonFilePath === undefined ? [] : ["--import-realm"])
|
728
745
|
],
|
729
746
|
{
|
730
|
-
cwd: buildContext.keycloakifyBuildDirPath
|
747
|
+
cwd: buildContext.keycloakifyBuildDirPath,
|
748
|
+
shell: true
|
731
749
|
}
|
732
750
|
];
|
733
751
|
const child = external_child_process_.spawn(...spawnArgs);
|
package/bin/538.index.js
CHANGED
@@ -384,46 +384,55 @@ const containerName = "keycloak-keycloakify";
|
|
384
384
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71017);
|
385
385
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__);
|
386
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__);
|
387
389
|
|
388
390
|
|
389
391
|
|
390
392
|
|
391
393
|
|
392
|
-
|
394
|
+
|
395
|
+
let cache = undefined;
|
393
396
|
/** Can't catch error, if the directory isn't found, this function will just exit the process with an error message. */
|
394
397
|
function getThemeSrcDirPath(params) {
|
395
398
|
const { projectDirPath } = params;
|
396
|
-
|
397
|
-
|
398
|
-
dirPath: srcDirPath,
|
399
|
-
returnedPathsType: "relative to dirPath"
|
400
|
-
})
|
401
|
-
.map(fileRelativePath => {
|
402
|
-
for (const themeSrcDirBasename of themeSrcDirBasenames) {
|
403
|
-
const split = fileRelativePath.split(themeSrcDirBasename);
|
404
|
-
if (split.length === 2) {
|
405
|
-
return (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(srcDirPath, split[0] + themeSrcDirBasename);
|
406
|
-
}
|
407
|
-
}
|
408
|
-
return undefined;
|
409
|
-
})
|
410
|
-
.filter((0,tsafe__WEBPACK_IMPORTED_MODULE_1__.exclude)(undefined))[0];
|
411
|
-
if (themeSrcDirPath !== undefined) {
|
399
|
+
if (cache !== undefined && cache.projectDirPath === projectDirPath) {
|
400
|
+
const { themeSrcDirPath } = cache;
|
412
401
|
return { themeSrcDirPath };
|
413
402
|
}
|
414
|
-
|
415
|
-
|
416
|
-
|
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 };
|
417
422
|
}
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
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 };
|
426
434
|
}
|
435
|
+
const themeSrcDirBasenames = ["keycloak-theme", "keycloak_theme"];
|
427
436
|
//# sourceMappingURL=getThemeSrcDirPath.js.map
|
428
437
|
|
429
438
|
/***/ }),
|