keycloakify 6.9.1 → 6.10.1
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/README.md +4 -0
- package/bin/create-keycloak-email-directory.js +0 -0
- package/bin/download-builtin-keycloak-theme.d.ts +1 -1
- package/bin/download-builtin-keycloak-theme.js +50 -26
- package/bin/download-builtin-keycloak-theme.js.map +1 -1
- package/bin/keycloakify/generateKeycloakThemeResources.d.ts +2 -2
- package/bin/keycloakify/generateKeycloakThemeResources.js +134 -92
- package/bin/keycloakify/generateKeycloakThemeResources.js.map +1 -1
- package/bin/keycloakify/index.js +0 -0
- package/bin/keycloakify/keycloakify.d.ts +1 -1
- package/bin/keycloakify/keycloakify.js +135 -89
- package/bin/keycloakify/keycloakify.js.map +1 -1
- package/bin/link_in_test_app.js +4 -1
- package/bin/link_in_test_app.js.map +1 -1
- package/bin/tools/downloadAndUnzip.d.ts +2 -3
- package/bin/tools/downloadAndUnzip.js +460 -70
- package/bin/tools/downloadAndUnzip.js.map +1 -1
- package/bin/tools/grant-exec-perms.js +66 -21
- package/bin/tools/grant-exec-perms.js.map +1 -1
- package/bin/tsconfig.tsbuildinfo +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/bin/download-builtin-keycloak-theme.ts +3 -3
- package/src/bin/keycloakify/generateKeycloakThemeResources.ts +4 -6
- package/src/bin/keycloakify/keycloakify.ts +2 -2
- package/src/bin/link_in_test_app.ts +2 -1
- package/src/bin/tools/downloadAndUnzip.ts +267 -58
- package/src/bin/tools/grant-exec-perms.ts +14 -7
package/README.md
CHANGED
@@ -49,6 +49,10 @@
|
|
49
49
|
|
50
50
|
# Changelog highlights
|
51
51
|
|
52
|
+
## 6.10.0
|
53
|
+
|
54
|
+
- Widows compat (thanks to @lordvlad, [see PR](https://github.com/InseeFrLab/keycloakify/pull/226)). WSL is no longer required 🎉
|
55
|
+
|
52
56
|
## 6.8.4
|
53
57
|
|
54
58
|
- `@emotion/react` is no longer a peer dependency of Keycloakify.
|
File without changes
|
@@ -56,27 +56,49 @@ var promptKeycloakVersion_1 = require("./promptKeycloakVersion");
|
|
56
56
|
var cliOptions_1 = require("./tools/cliOptions");
|
57
57
|
var logger_1 = require("./tools/logger");
|
58
58
|
function downloadBuiltinKeycloakTheme(params) {
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
59
|
+
return __awaiter(this, void 0, void 0, function () {
|
60
|
+
var keycloakVersion, destDirPath, isSilent, _a, _b, ext, e_1_1;
|
61
|
+
var e_1, _c;
|
62
|
+
return __generator(this, function (_d) {
|
63
|
+
switch (_d.label) {
|
64
|
+
case 0:
|
65
|
+
keycloakVersion = params.keycloakVersion, destDirPath = params.destDirPath, isSilent = params.isSilent;
|
66
|
+
_d.label = 1;
|
67
|
+
case 1:
|
68
|
+
_d.trys.push([1, 6, 7, 8]);
|
69
|
+
_a = __values(["", "-community"]), _b = _a.next();
|
70
|
+
_d.label = 2;
|
71
|
+
case 2:
|
72
|
+
if (!!_b.done) return [3 /*break*/, 5];
|
73
|
+
ext = _b.value;
|
74
|
+
return [4 /*yield*/, (0, downloadAndUnzip_1.downloadAndUnzip)({
|
75
|
+
"destDirPath": destDirPath,
|
76
|
+
"url": "https://github.com/keycloak/keycloak/archive/refs/tags/".concat(keycloakVersion, ".zip"),
|
77
|
+
"pathOfDirToExtractInArchive": "keycloak-".concat(keycloakVersion, "/themes/src/main/resources").concat(ext, "/theme"),
|
78
|
+
"cacheDirPath": (0, path_1.join)(keycloakify_1.keycloakThemeBuildingDirPath, ".cache"),
|
79
|
+
isSilent: isSilent
|
80
|
+
})];
|
81
|
+
case 3:
|
82
|
+
_d.sent();
|
83
|
+
_d.label = 4;
|
84
|
+
case 4:
|
85
|
+
_b = _a.next();
|
86
|
+
return [3 /*break*/, 2];
|
87
|
+
case 5: return [3 /*break*/, 8];
|
88
|
+
case 6:
|
89
|
+
e_1_1 = _d.sent();
|
90
|
+
e_1 = { error: e_1_1 };
|
91
|
+
return [3 /*break*/, 8];
|
92
|
+
case 7:
|
93
|
+
try {
|
94
|
+
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
95
|
+
}
|
96
|
+
finally { if (e_1) throw e_1.error; }
|
97
|
+
return [7 /*endfinally*/];
|
98
|
+
case 8: return [2 /*return*/];
|
99
|
+
}
|
100
|
+
});
|
101
|
+
});
|
80
102
|
}
|
81
103
|
exports.downloadBuiltinKeycloakTheme = downloadBuiltinKeycloakTheme;
|
82
104
|
if (require.main === module) {
|
@@ -92,11 +114,13 @@ if (require.main === module) {
|
|
92
114
|
keycloakVersion = (_a.sent()).keycloakVersion;
|
93
115
|
destDirPath = (0, path_1.join)(keycloakify_1.keycloakThemeBuildingDirPath, "src", "main", "resources", "theme");
|
94
116
|
logger.log("Downloading builtins theme of Keycloak ".concat(keycloakVersion, " here ").concat(destDirPath));
|
95
|
-
downloadBuiltinKeycloakTheme({
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
117
|
+
return [4 /*yield*/, downloadBuiltinKeycloakTheme({
|
118
|
+
keycloakVersion: keycloakVersion,
|
119
|
+
destDirPath: destDirPath,
|
120
|
+
isSilent: isSilent
|
121
|
+
})];
|
122
|
+
case 2:
|
123
|
+
_a.sent();
|
100
124
|
return [2 /*return*/];
|
101
125
|
}
|
102
126
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"download-builtin-keycloak-theme.js","sourceRoot":"","sources":["../src/bin/download-builtin-keycloak-theme.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,6CAA6D;AAC7D,6BAAwC;AACxC,6DAA4D;AAC5D,iE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AAE,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;oBAEhG,MAAM,CAAC,GAAG,CAAC,iDAA0C,eAAe,mBAAS,WAAW,CAAE,CAAC,CAAC;oBAE5F,qBAAM,4BAA4B,CAAC;4BAC/B,eAAe,iBAAA;4BACf,WAAW,aAAA;4BACX,QAAQ,UAAA;yBACX,CAAC,EAAA;;oBAJF,SAIE,CAAC;;;;SACN,CAAC,EAAE,CAAC;CACR"}
|
@@ -33,6 +33,42 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
33
33
|
__setModuleDefault(result, mod);
|
34
34
|
return result;
|
35
35
|
};
|
36
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
43
|
+
});
|
44
|
+
};
|
45
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
46
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
47
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
48
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
49
|
+
function step(op) {
|
50
|
+
if (f) throw new TypeError("Generator is already executing.");
|
51
|
+
while (_) try {
|
52
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
53
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
54
|
+
switch (op[0]) {
|
55
|
+
case 0: case 1: t = op; break;
|
56
|
+
case 4: _.label++; return { value: op[1], done: false };
|
57
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
58
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
59
|
+
default:
|
60
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
61
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
62
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
63
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
64
|
+
if (t[2]) _.ops.pop();
|
65
|
+
_.trys.pop(); continue;
|
66
|
+
}
|
67
|
+
op = body.call(thisArg, _);
|
68
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
69
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
70
|
+
}
|
71
|
+
};
|
36
72
|
var __read = (this && this.__read) || function (o, n) {
|
37
73
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
38
74
|
if (!m) return o;
|
@@ -67,7 +103,6 @@ var replaceImportsFromStaticInJsCode_1 = require("./replacers/replaceImportsFrom
|
|
67
103
|
var replaceImportsInCssCode_1 = require("./replacers/replaceImportsInCssCode");
|
68
104
|
var generateFtl_1 = require("./generateFtl");
|
69
105
|
var download_builtin_keycloak_theme_1 = require("../download-builtin-keycloak-theme");
|
70
|
-
var child_process = __importStar(require("child_process"));
|
71
106
|
var mockTestingResourcesPath_1 = require("../mockTestingResourcesPath");
|
72
107
|
var isInside_1 = require("../tools/isInside");
|
73
108
|
var assert_1 = require("tsafe/assert");
|
@@ -79,100 +114,107 @@ var logger_1 = require("../tools/logger");
|
|
79
114
|
}
|
80
115
|
function generateKeycloakThemeResources(params) {
|
81
116
|
var _a, _b;
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
117
|
+
return __awaiter(this, void 0, void 0, function () {
|
118
|
+
var reactAppBuildDirPath, keycloakThemeBuildingDirPath, keycloakThemeEmailDirPath, keycloakVersion, buildOptions, logger, themeDirPath, allCssGlobalsToDefine, doBundlesEmailTemplate, generateFtlFilesCode, tmpDirPath, themeResourcesDirPath, reactAppPublicDirPath, keycloakResourcesWithinPublicDirPath;
|
119
|
+
return __generator(this, function (_c) {
|
120
|
+
switch (_c.label) {
|
121
|
+
case 0:
|
122
|
+
reactAppBuildDirPath = params.reactAppBuildDirPath, keycloakThemeBuildingDirPath = params.keycloakThemeBuildingDirPath, keycloakThemeEmailDirPath = params.keycloakThemeEmailDirPath, keycloakVersion = params.keycloakVersion, buildOptions = params.buildOptions;
|
123
|
+
logger = (0, logger_1.getLogger)({ isSilent: buildOptions.isSilent });
|
124
|
+
themeDirPath = (0, path_1.join)(keycloakThemeBuildingDirPath, "src", "main", "resources", "theme", buildOptions.themeName, "login");
|
125
|
+
allCssGlobalsToDefine = {};
|
126
|
+
(0, transformCodebase_1.transformCodebase)({
|
127
|
+
"destDirPath": buildOptions.isStandalone ? (0, path_1.join)(themeDirPath, "resources", "build") : reactAppBuildDirPath,
|
128
|
+
"srcDirPath": reactAppBuildDirPath,
|
129
|
+
"transformSourceCode": function (_a) {
|
130
|
+
var filePath = _a.filePath, sourceCode = _a.sourceCode;
|
131
|
+
//NOTE: Prevent cycles, excludes the folder we generated for debug in public/
|
132
|
+
if (buildOptions.isStandalone &&
|
133
|
+
(0, isInside_1.isInside)({
|
134
|
+
"dirPath": (0, path_1.join)(reactAppBuildDirPath, mockTestingResourcesPath_1.mockTestingSubDirOfPublicDirBasename),
|
135
|
+
filePath: filePath
|
136
|
+
})) {
|
137
|
+
return undefined;
|
138
|
+
}
|
139
|
+
if (/\.css?$/i.test(filePath)) {
|
140
|
+
if (!buildOptions.isStandalone) {
|
141
|
+
return undefined;
|
142
|
+
}
|
143
|
+
var _b = (0, replaceImportsInCssCode_1.replaceImportsInCssCode)({
|
144
|
+
"cssCode": sourceCode.toString("utf8")
|
145
|
+
}), cssGlobalsToDefine = _b.cssGlobalsToDefine, fixedCssCode = _b.fixedCssCode;
|
146
|
+
allCssGlobalsToDefine = __assign(__assign({}, allCssGlobalsToDefine), cssGlobalsToDefine);
|
147
|
+
return { "modifiedSourceCode": Buffer.from(fixedCssCode, "utf8") };
|
148
|
+
}
|
149
|
+
if (/\.js?$/i.test(filePath)) {
|
150
|
+
if (!buildOptions.isStandalone && buildOptions.areAppAndKeycloakServerSharingSameDomain) {
|
151
|
+
return undefined;
|
152
|
+
}
|
153
|
+
var fixedJsCode = (0, replaceImportsFromStaticInJsCode_1.replaceImportsFromStaticInJsCode)({
|
154
|
+
"jsCode": sourceCode.toString("utf8"),
|
155
|
+
buildOptions: buildOptions
|
156
|
+
}).fixedJsCode;
|
157
|
+
return { "modifiedSourceCode": Buffer.from(fixedJsCode, "utf8") };
|
158
|
+
}
|
159
|
+
return buildOptions.isStandalone ? { "modifiedSourceCode": sourceCode } : undefined;
|
160
|
+
}
|
161
|
+
});
|
162
|
+
email: {
|
163
|
+
if (!fs.existsSync(keycloakThemeEmailDirPath)) {
|
164
|
+
logger.log([
|
165
|
+
"Not bundling email template because ".concat((0, path_1.basename)(keycloakThemeEmailDirPath), " does not exist"),
|
166
|
+
"To start customizing the email template, run: \uD83D\uDC49 npx create-keycloak-email-directory \uD83D\uDC48"
|
167
|
+
].join("\n"));
|
168
|
+
doBundlesEmailTemplate = false;
|
169
|
+
break email;
|
170
|
+
}
|
171
|
+
doBundlesEmailTemplate = true;
|
172
|
+
(0, transformCodebase_1.transformCodebase)({
|
173
|
+
"srcDirPath": keycloakThemeEmailDirPath,
|
174
|
+
"destDirPath": (0, path_1.join)(themeDirPath, "..", "email")
|
175
|
+
});
|
176
|
+
}
|
177
|
+
generateFtlFilesCode = (0, generateFtl_1.generateFtlFilesCodeFactory)({
|
178
|
+
"indexHtmlCode": fs.readFileSync((0, path_1.join)(reactAppBuildDirPath, "index.html")).toString("utf8"),
|
179
|
+
"cssGlobalsToDefine": allCssGlobalsToDefine,
|
180
|
+
"buildOptions": buildOptions
|
181
|
+
}).generateFtlFilesCode;
|
182
|
+
__spreadArray(__spreadArray([], __read(generateFtl_1.pageIds), false), __read(((_a = buildOptions.extraPages) !== null && _a !== void 0 ? _a : [])), false).forEach(function (pageId) {
|
183
|
+
var ftlCode = generateFtlFilesCode({ pageId: pageId }).ftlCode;
|
184
|
+
fs.mkdirSync(themeDirPath, { "recursive": true });
|
185
|
+
fs.writeFileSync((0, path_1.join)(themeDirPath, pageId), Buffer.from(ftlCode, "utf8"));
|
186
|
+
});
|
187
|
+
tmpDirPath = (0, path_1.join)(themeDirPath, "..", "tmp_xxKdLpdIdLd");
|
188
|
+
return [4 /*yield*/, (0, download_builtin_keycloak_theme_1.downloadBuiltinKeycloakTheme)({
|
189
|
+
keycloakVersion: keycloakVersion,
|
190
|
+
"destDirPath": tmpDirPath,
|
191
|
+
isSilent: buildOptions.isSilent
|
192
|
+
})];
|
193
|
+
case 1:
|
194
|
+
_c.sent();
|
195
|
+
themeResourcesDirPath = (0, path_1.join)(themeDirPath, "resources");
|
196
|
+
(0, transformCodebase_1.transformCodebase)({
|
197
|
+
"srcDirPath": (0, path_1.join)(tmpDirPath, "keycloak", "login", "resources"),
|
198
|
+
"destDirPath": themeResourcesDirPath
|
199
|
+
});
|
200
|
+
reactAppPublicDirPath = (0, path_1.join)(reactAppBuildDirPath, "..", "public");
|
201
|
+
(0, transformCodebase_1.transformCodebase)({
|
202
|
+
"srcDirPath": (0, path_1.join)(tmpDirPath, "keycloak", "common", "resources"),
|
203
|
+
"destDirPath": (0, path_1.join)(themeResourcesDirPath, (0, path_1.basename)(mockTestingResourcesPath_1.mockTestingResourcesCommonPath))
|
204
|
+
});
|
205
|
+
(0, transformCodebase_1.transformCodebase)({
|
206
|
+
"srcDirPath": themeResourcesDirPath,
|
207
|
+
"destDirPath": (0, path_1.join)(reactAppPublicDirPath, mockTestingResourcesPath_1.mockTestingResourcesPath)
|
208
|
+
});
|
209
|
+
keycloakResourcesWithinPublicDirPath = (0, path_1.join)(reactAppPublicDirPath, mockTestingResourcesPath_1.mockTestingSubDirOfPublicDirBasename);
|
210
|
+
fs.writeFileSync((0, path_1.join)(keycloakResourcesWithinPublicDirPath, "README.txt"), Buffer.from(["This is just a test folder that helps develop", "the login and register page without having to run a Keycloak container"].join(" ")));
|
211
|
+
fs.writeFileSync((0, path_1.join)(keycloakResourcesWithinPublicDirPath, ".gitignore"), Buffer.from("*", "utf8"));
|
212
|
+
fs.rmSync(tmpDirPath, { recursive: true, force: true });
|
213
|
+
fs.writeFileSync((0, path_1.join)(themeDirPath, "theme.properties"), Buffer.from(__spreadArray(["parent=keycloak"], __read(((_b = buildOptions.extraThemeProperties) !== null && _b !== void 0 ? _b : [])), false).join("\n\n"), "utf8"));
|
214
|
+
return [2 /*return*/, { doBundlesEmailTemplate: doBundlesEmailTemplate }];
|
108
215
|
}
|
109
|
-
if (/\.js?$/i.test(filePath)) {
|
110
|
-
if (!buildOptions.isStandalone && buildOptions.areAppAndKeycloakServerSharingSameDomain) {
|
111
|
-
return undefined;
|
112
|
-
}
|
113
|
-
var fixedJsCode = (0, replaceImportsFromStaticInJsCode_1.replaceImportsFromStaticInJsCode)({
|
114
|
-
"jsCode": sourceCode.toString("utf8"),
|
115
|
-
buildOptions: buildOptions
|
116
|
-
}).fixedJsCode;
|
117
|
-
return { "modifiedSourceCode": Buffer.from(fixedJsCode, "utf8") };
|
118
|
-
}
|
119
|
-
return buildOptions.isStandalone ? { "modifiedSourceCode": sourceCode } : undefined;
|
120
|
-
}
|
121
|
-
});
|
122
|
-
var doBundlesEmailTemplate;
|
123
|
-
email: {
|
124
|
-
if (!fs.existsSync(keycloakThemeEmailDirPath)) {
|
125
|
-
logger.log([
|
126
|
-
"Not bundling email template because ".concat((0, path_1.basename)(keycloakThemeEmailDirPath), " does not exist"),
|
127
|
-
"To start customizing the email template, run: \uD83D\uDC49 npx create-keycloak-email-directory \uD83D\uDC48"
|
128
|
-
].join("\n"));
|
129
|
-
doBundlesEmailTemplate = false;
|
130
|
-
break email;
|
131
|
-
}
|
132
|
-
doBundlesEmailTemplate = true;
|
133
|
-
(0, transformCodebase_1.transformCodebase)({
|
134
|
-
"srcDirPath": keycloakThemeEmailDirPath,
|
135
|
-
"destDirPath": (0, path_1.join)(themeDirPath, "..", "email")
|
136
216
|
});
|
137
|
-
}
|
138
|
-
var generateFtlFilesCode = (0, generateFtl_1.generateFtlFilesCodeFactory)({
|
139
|
-
"indexHtmlCode": fs.readFileSync((0, path_1.join)(reactAppBuildDirPath, "index.html")).toString("utf8"),
|
140
|
-
"cssGlobalsToDefine": allCssGlobalsToDefine,
|
141
|
-
"buildOptions": buildOptions
|
142
|
-
}).generateFtlFilesCode;
|
143
|
-
__spreadArray(__spreadArray([], __read(generateFtl_1.pageIds), false), __read(((_a = buildOptions.extraPages) !== null && _a !== void 0 ? _a : [])), false).forEach(function (pageId) {
|
144
|
-
var ftlCode = generateFtlFilesCode({ pageId: pageId }).ftlCode;
|
145
|
-
fs.mkdirSync(themeDirPath, { "recursive": true });
|
146
|
-
fs.writeFileSync((0, path_1.join)(themeDirPath, pageId), Buffer.from(ftlCode, "utf8"));
|
147
217
|
});
|
148
|
-
{
|
149
|
-
var tmpDirPath = (0, path_1.join)(themeDirPath, "..", "tmp_xxKdLpdIdLd");
|
150
|
-
(0, download_builtin_keycloak_theme_1.downloadBuiltinKeycloakTheme)({
|
151
|
-
keycloakVersion: keycloakVersion,
|
152
|
-
"destDirPath": tmpDirPath,
|
153
|
-
isSilent: buildOptions.isSilent
|
154
|
-
});
|
155
|
-
var themeResourcesDirPath = (0, path_1.join)(themeDirPath, "resources");
|
156
|
-
(0, transformCodebase_1.transformCodebase)({
|
157
|
-
"srcDirPath": (0, path_1.join)(tmpDirPath, "keycloak", "login", "resources"),
|
158
|
-
"destDirPath": themeResourcesDirPath
|
159
|
-
});
|
160
|
-
var reactAppPublicDirPath = (0, path_1.join)(reactAppBuildDirPath, "..", "public");
|
161
|
-
(0, transformCodebase_1.transformCodebase)({
|
162
|
-
"srcDirPath": (0, path_1.join)(tmpDirPath, "keycloak", "common", "resources"),
|
163
|
-
"destDirPath": (0, path_1.join)(themeResourcesDirPath, (0, path_1.basename)(mockTestingResourcesPath_1.mockTestingResourcesCommonPath))
|
164
|
-
});
|
165
|
-
(0, transformCodebase_1.transformCodebase)({
|
166
|
-
"srcDirPath": themeResourcesDirPath,
|
167
|
-
"destDirPath": (0, path_1.join)(reactAppPublicDirPath, mockTestingResourcesPath_1.mockTestingResourcesPath)
|
168
|
-
});
|
169
|
-
var keycloakResourcesWithinPublicDirPath = (0, path_1.join)(reactAppPublicDirPath, mockTestingResourcesPath_1.mockTestingSubDirOfPublicDirBasename);
|
170
|
-
fs.writeFileSync((0, path_1.join)(keycloakResourcesWithinPublicDirPath, "README.txt"), Buffer.from(["This is just a test folder that helps develop", "the login and register page without having to run a Keycloak container"].join(" ")));
|
171
|
-
fs.writeFileSync((0, path_1.join)(keycloakResourcesWithinPublicDirPath, ".gitignore"), Buffer.from("*", "utf8"));
|
172
|
-
child_process.execSync("rm -r ".concat(tmpDirPath));
|
173
|
-
}
|
174
|
-
fs.writeFileSync((0, path_1.join)(themeDirPath, "theme.properties"), Buffer.from(__spreadArray(["parent=keycloak"], __read(((_b = buildOptions.extraThemeProperties) !== null && _b !== void 0 ? _b : [])), false).join("\n\n"), "utf8"));
|
175
|
-
return { doBundlesEmailTemplate: doBundlesEmailTemplate };
|
176
218
|
}
|
177
219
|
exports.generateKeycloakThemeResources = generateKeycloakThemeResources;
|
178
220
|
//# sourceMappingURL=generateKeycloakThemeResources.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generateKeycloakThemeResources.js","sourceRoot":"","sources":["../../src/bin/keycloakify/generateKeycloakThemeResources.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"generateKeycloakThemeResources.js","sourceRoot":"","sources":["../../src/bin/keycloakify/generateKeycloakThemeResources.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAA+D;AAC/D,qCAAyB;AACzB,6BAAkE;AAClE,iGAAgG;AAChG,+EAA8E;AAC9E,6CAAqE;AACrE,sFAAkF;AAClF,wEAA6I;AAC7I,8CAA6C;AAE7C,uCAAsC;AACtC,yCAAwC;AACxC,0CAA4C;AAoC5C;IACI,IAAM,YAAY,GAAG,IAAA,iBAAO,GAAgB,CAAC;IAE7C,IAAA,eAAM,GAA+D,CAAC;CACzE;AAED,SAAsB,8BAA8B,CAAC,MAMpD;;;;;;;oBACW,oBAAoB,GAA6F,MAAM,qBAAnG,EAAE,4BAA4B,GAA+D,MAAM,6BAArE,EAAE,yBAAyB,GAAoC,MAAM,0BAA1C,EAAE,eAAe,GAAmB,MAAM,gBAAzB,EAAE,YAAY,GAAK,MAAM,aAAX,CAAY;oBAE1H,MAAM,GAAG,IAAA,kBAAS,EAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;oBACxD,YAAY,GAAG,IAAA,WAAQ,EAAC,4BAA4B,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;oBAE9H,qBAAqB,GAA2B,EAAE,CAAC;oBAEvD,IAAA,qCAAiB,EA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