keycloakify 10.0.0-rc.44 → 10.0.0-rc.46
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/{322.index.js → 190.index.js} +58 -61
- package/bin/193.index.js +0 -51
- package/bin/3.index.js +93 -96
- package/bin/526.index.js +80 -49
- package/bin/538.index.js +5 -3
- package/bin/932.index.js +535 -1
- package/bin/98.index.js +5 -3
- package/bin/{944.index.js → 991.index.js} +74 -5
- package/bin/main.js +4 -16
- package/bin/shared/buildContext.d.ts +1 -1
- package/bin/shared/constants.d.ts +1 -1
- package/bin/shared/constants.js +1 -1
- package/bin/shared/constants.js.map +1 -1
- package/package.json +3 -6
- package/src/bin/keycloakify/buildJars/buildJar.ts +9 -21
- package/src/bin/keycloakify/buildJars/buildJars.ts +15 -4
- package/src/bin/keycloakify/buildJars/extensionVersions.ts +1 -1
- package/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts +9 -2
- package/src/bin/keycloakify/generateSrcMainResources/bringInAccountV1.ts +6 -7
- package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResources.ts +11 -3
- package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts +6 -18
- package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForThemeVariant.ts +9 -15
- package/src/bin/keycloakify/keycloakify.ts +20 -9
- package/src/bin/main.ts +0 -14
- package/src/bin/shared/KeycloakVersionRange.ts +1 -1
- package/src/bin/shared/buildContext.ts +7 -3
- package/src/bin/shared/constants.ts +1 -1
- package/src/bin/shared/metaInfKeycloakThemes.ts +37 -14
- package/src/bin/start-keycloak/keycloakifyBuild.ts +4 -4
- package/src/bin/start-keycloak/start-keycloak.ts +62 -67
- package/src/vite-plugin/vite-plugin.ts +4 -0
- package/vite-plugin/index.js +6 -3
- package/bin/961.index.js +0 -263
- package/src/bin/download-keycloak-default-theme.ts +0 -63
- package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +0 -74
package/bin/932.index.js
CHANGED
@@ -10,7 +10,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
10
10
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
11
11
|
/* harmony export */ "command": () => (/* binding */ command)
|
12
12
|
/* harmony export */ });
|
13
|
-
/* harmony import */ var _shared_downloadKeycloakDefaultTheme__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
13
|
+
/* harmony import */ var _shared_downloadKeycloakDefaultTheme__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(47802);
|
14
14
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
|
15
15
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
16
16
|
/* harmony import */ var _tools_transformCodebase__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60332);
|
@@ -62,6 +62,391 @@ async function command(params) {
|
|
62
62
|
|
63
63
|
/***/ }),
|
64
64
|
|
65
|
+
/***/ 47802:
|
66
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
67
|
+
|
68
|
+
|
69
|
+
// EXPORTS
|
70
|
+
__webpack_require__.d(__webpack_exports__, {
|
71
|
+
"x": () => (/* binding */ downloadKeycloakDefaultTheme)
|
72
|
+
});
|
73
|
+
|
74
|
+
// EXTERNAL MODULE: external "path"
|
75
|
+
var external_path_ = __webpack_require__(71017);
|
76
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/assert.js
|
77
|
+
var assert = __webpack_require__(88078);
|
78
|
+
// EXTERNAL MODULE: ./dist/bin/shared/constants.js
|
79
|
+
var constants = __webpack_require__(173);
|
80
|
+
// EXTERNAL MODULE: ./node_modules/make-fetch-happen/lib/index.js
|
81
|
+
var lib = __webpack_require__(9525);
|
82
|
+
var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
|
83
|
+
// EXTERNAL MODULE: external "fs/promises"
|
84
|
+
var promises_ = __webpack_require__(73292);
|
85
|
+
// EXTERNAL MODULE: ./dist/bin/tools/extractArchive.js
|
86
|
+
var extractArchive = __webpack_require__(29121);
|
87
|
+
// EXTERNAL MODULE: ./dist/bin/tools/fs.existsAsync.js
|
88
|
+
var fs_existsAsync = __webpack_require__(43765);
|
89
|
+
// EXTERNAL MODULE: external "child_process"
|
90
|
+
var external_child_process_ = __webpack_require__(32081);
|
91
|
+
// EXTERNAL MODULE: external "util"
|
92
|
+
var external_util_ = __webpack_require__(73837);
|
93
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/downloadAndExtractArchive/fetchProxyOptions.js
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
function ensureArray(arg0) {
|
98
|
+
return Array.isArray(arg0) ? arg0 : typeof arg0 === "undefined" ? [] : [arg0];
|
99
|
+
}
|
100
|
+
function ensureSingleOrNone(arg0) {
|
101
|
+
if (!Array.isArray(arg0))
|
102
|
+
return arg0;
|
103
|
+
if (arg0.length === 0)
|
104
|
+
return undefined;
|
105
|
+
if (arg0.length === 1)
|
106
|
+
return arg0[0];
|
107
|
+
throw new Error("Illegal configuration, expected a single value but found multiple: " +
|
108
|
+
arg0.map(String).join(", "));
|
109
|
+
}
|
110
|
+
/**
|
111
|
+
* Get npm configuration as map
|
112
|
+
*/
|
113
|
+
async function getNmpConfig(params) {
|
114
|
+
const { npmWorkspaceRootDirPath } = params;
|
115
|
+
const exec = (0,external_util_.promisify)(external_child_process_.exec);
|
116
|
+
const stdout = await exec("npm config get", {
|
117
|
+
encoding: "utf8",
|
118
|
+
cwd: npmWorkspaceRootDirPath
|
119
|
+
}).then(({ stdout }) => stdout);
|
120
|
+
const npmConfigReducer = (cfg, [key, value]) => key in cfg
|
121
|
+
? Object.assign(Object.assign({}, cfg), { [key]: [...ensureArray(cfg[key]), value] }) : Object.assign(Object.assign({}, cfg), { [key]: value });
|
122
|
+
return stdout
|
123
|
+
.split("\n")
|
124
|
+
.filter(line => !line.startsWith(";"))
|
125
|
+
.map(line => line.trim())
|
126
|
+
.map(line => line.split("=", 2))
|
127
|
+
.reduce(npmConfigReducer, {});
|
128
|
+
}
|
129
|
+
async function getProxyFetchOptions(params) {
|
130
|
+
var _a, _b, _c;
|
131
|
+
const { npmWorkspaceRootDirPath } = params;
|
132
|
+
const cfg = await getNmpConfig({ npmWorkspaceRootDirPath });
|
133
|
+
const proxy = ensureSingleOrNone((_a = cfg["https-proxy"]) !== null && _a !== void 0 ? _a : cfg["proxy"]);
|
134
|
+
const noProxy = (_b = cfg["noproxy"]) !== null && _b !== void 0 ? _b : cfg["no-proxy"];
|
135
|
+
function maybeBoolean(arg0) {
|
136
|
+
return typeof arg0 === "undefined" ? undefined : Boolean(arg0);
|
137
|
+
}
|
138
|
+
const strictSSL = maybeBoolean(ensureSingleOrNone(cfg["strict-ssl"]));
|
139
|
+
const cert = cfg["cert"];
|
140
|
+
const ca = ensureArray((_c = cfg["ca"]) !== null && _c !== void 0 ? _c : cfg["ca[]"]);
|
141
|
+
const cafile = ensureSingleOrNone(cfg["cafile"]);
|
142
|
+
if (typeof cafile !== "undefined" && cafile !== "null") {
|
143
|
+
ca.push(...(await (async () => {
|
144
|
+
function chunks(arr, size = 2) {
|
145
|
+
return arr
|
146
|
+
.map((_, i) => i % size == 0 && arr.slice(i, i + size))
|
147
|
+
.filter(Boolean);
|
148
|
+
}
|
149
|
+
const cafileContent = await (0,promises_.readFile)(cafile, "utf-8");
|
150
|
+
return chunks(cafileContent.split(/(-----END CERTIFICATE-----)/), 2).map(ca => ca.join("").replace(/^\n/, "").replace(/\n/g, "\\n"));
|
151
|
+
})()));
|
152
|
+
}
|
153
|
+
return {
|
154
|
+
proxy,
|
155
|
+
noProxy,
|
156
|
+
strictSSL,
|
157
|
+
cert,
|
158
|
+
ca: ca.length === 0 ? undefined : ca
|
159
|
+
};
|
160
|
+
}
|
161
|
+
//# sourceMappingURL=fetchProxyOptions.js.map
|
162
|
+
// EXTERNAL MODULE: external "crypto"
|
163
|
+
var external_crypto_ = __webpack_require__(6113);
|
164
|
+
// EXTERNAL MODULE: ./dist/bin/tools/fs.rm.js
|
165
|
+
var fs_rm = __webpack_require__(8699);
|
166
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/downloadAndExtractArchive/downloadAndExtractArchive.js
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
async function downloadAndExtractArchive(params) {
|
177
|
+
var _a;
|
178
|
+
const { url, uniqueIdOfOnOnArchiveFile, onArchiveFile, cacheDirPath, npmWorkspaceRootDirPath } = params;
|
179
|
+
const archiveFileBasename = url.split("?")[0].split("/").reverse()[0];
|
180
|
+
const archiveFilePath = (0,external_path_.join)(cacheDirPath, archiveFileBasename);
|
181
|
+
download: {
|
182
|
+
if (await (0,fs_existsAsync/* existsAsync */.o)(archiveFilePath)) {
|
183
|
+
const isDownloaded = await SuccessTracker.getIsDownloaded({
|
184
|
+
cacheDirPath,
|
185
|
+
archiveFileBasename
|
186
|
+
});
|
187
|
+
if (isDownloaded) {
|
188
|
+
break download;
|
189
|
+
}
|
190
|
+
await (0,promises_.unlink)(archiveFilePath);
|
191
|
+
await SuccessTracker.removeFromDownloaded({
|
192
|
+
cacheDirPath,
|
193
|
+
archiveFileBasename
|
194
|
+
});
|
195
|
+
}
|
196
|
+
await (0,promises_.mkdir)((0,external_path_.dirname)(archiveFilePath), { recursive: true });
|
197
|
+
const response = await lib_default()(url, await getProxyFetchOptions({ npmWorkspaceRootDirPath }));
|
198
|
+
(_a = response.body) === null || _a === void 0 ? void 0 : _a.setMaxListeners(Number.MAX_VALUE);
|
199
|
+
(0,assert.assert)(typeof response.body !== "undefined" && response.body != null);
|
200
|
+
await (0,promises_.writeFile)(archiveFilePath, response.body);
|
201
|
+
await SuccessTracker.markAsDownloaded({
|
202
|
+
cacheDirPath,
|
203
|
+
archiveFileBasename
|
204
|
+
});
|
205
|
+
}
|
206
|
+
const extractDirBasename = `${archiveFileBasename.split(".")[0]}_${uniqueIdOfOnOnArchiveFile}_${external_crypto_.createHash("sha256")
|
207
|
+
.update(onArchiveFile.toString())
|
208
|
+
.digest("hex")
|
209
|
+
.substring(0, 5)}`;
|
210
|
+
await Promise.all((await (0,promises_.readdir)(cacheDirPath))
|
211
|
+
.filter((() => {
|
212
|
+
const prefix = extractDirBasename
|
213
|
+
.split("_")
|
214
|
+
.reverse()
|
215
|
+
.slice(1)
|
216
|
+
.reverse()
|
217
|
+
.join("_");
|
218
|
+
return basename => basename !== extractDirBasename && basename.startsWith(prefix);
|
219
|
+
})())
|
220
|
+
.map(async (extractDirBasename) => {
|
221
|
+
await (0,fs_rm.rm)((0,external_path_.join)(cacheDirPath, extractDirBasename), { recursive: true });
|
222
|
+
await SuccessTracker.removeFromExtracted({
|
223
|
+
cacheDirPath,
|
224
|
+
extractDirBasename
|
225
|
+
});
|
226
|
+
}));
|
227
|
+
const extractedDirPath = (0,external_path_.join)(cacheDirPath, extractDirBasename);
|
228
|
+
extract_and_transform: {
|
229
|
+
if (await (0,fs_existsAsync/* existsAsync */.o)(extractedDirPath)) {
|
230
|
+
const isExtracted = await SuccessTracker.getIsExtracted({
|
231
|
+
cacheDirPath,
|
232
|
+
extractDirBasename
|
233
|
+
});
|
234
|
+
if (isExtracted) {
|
235
|
+
break extract_and_transform;
|
236
|
+
}
|
237
|
+
await (0,fs_rm.rm)(extractedDirPath, { recursive: true });
|
238
|
+
await SuccessTracker.removeFromExtracted({
|
239
|
+
cacheDirPath,
|
240
|
+
extractDirBasename
|
241
|
+
});
|
242
|
+
}
|
243
|
+
await (0,extractArchive/* extractArchive */.N)({
|
244
|
+
archiveFilePath,
|
245
|
+
onArchiveFile: async ({ relativeFilePathInArchive, readFile, writeFile }) => onArchiveFile({
|
246
|
+
fileRelativePath: relativeFilePathInArchive,
|
247
|
+
readFile,
|
248
|
+
writeFile: ({ fileRelativePath, modifiedData }) => writeFile({
|
249
|
+
filePath: (0,external_path_.join)(extractedDirPath, fileRelativePath),
|
250
|
+
modifiedData
|
251
|
+
})
|
252
|
+
})
|
253
|
+
});
|
254
|
+
await SuccessTracker.markAsExtracted({
|
255
|
+
cacheDirPath,
|
256
|
+
extractDirBasename
|
257
|
+
});
|
258
|
+
}
|
259
|
+
return { extractedDirPath };
|
260
|
+
}
|
261
|
+
var SuccessTracker;
|
262
|
+
(function (SuccessTracker) {
|
263
|
+
async function read(params) {
|
264
|
+
const { cacheDirPath } = params;
|
265
|
+
const filePath = (0,external_path_.join)(cacheDirPath, "downloadAndExtractArchive.json");
|
266
|
+
if (!(await (0,fs_existsAsync/* existsAsync */.o)(filePath))) {
|
267
|
+
return { archiveFileBasenames: [], extractDirBasenames: [] };
|
268
|
+
}
|
269
|
+
return JSON.parse((await (0,promises_.readFile)(filePath)).toString("utf8"));
|
270
|
+
}
|
271
|
+
async function write(params) {
|
272
|
+
const { cacheDirPath, successTracker } = params;
|
273
|
+
const filePath = (0,external_path_.join)(cacheDirPath, "downloadAndExtractArchive.json");
|
274
|
+
{
|
275
|
+
const dirPath = (0,external_path_.dirname)(filePath);
|
276
|
+
if (!(await (0,fs_existsAsync/* existsAsync */.o)(dirPath))) {
|
277
|
+
await (0,promises_.mkdir)(dirPath, { recursive: true });
|
278
|
+
}
|
279
|
+
}
|
280
|
+
await (0,promises_.writeFile)(filePath, JSON.stringify(successTracker));
|
281
|
+
}
|
282
|
+
async function markAsDownloaded(params) {
|
283
|
+
const { cacheDirPath, archiveFileBasename } = params;
|
284
|
+
const successTracker = await read({ cacheDirPath });
|
285
|
+
successTracker.archiveFileBasenames.push(archiveFileBasename);
|
286
|
+
await write({ cacheDirPath, successTracker });
|
287
|
+
}
|
288
|
+
SuccessTracker.markAsDownloaded = markAsDownloaded;
|
289
|
+
async function getIsDownloaded(params) {
|
290
|
+
const { cacheDirPath, archiveFileBasename } = params;
|
291
|
+
const successTracker = await read({ cacheDirPath });
|
292
|
+
return successTracker.archiveFileBasenames.includes(archiveFileBasename);
|
293
|
+
}
|
294
|
+
SuccessTracker.getIsDownloaded = getIsDownloaded;
|
295
|
+
async function removeFromDownloaded(params) {
|
296
|
+
const { cacheDirPath, archiveFileBasename } = params;
|
297
|
+
const successTracker = await read({ cacheDirPath });
|
298
|
+
successTracker.archiveFileBasenames = successTracker.archiveFileBasenames.filter(basename => basename !== archiveFileBasename);
|
299
|
+
await write({ cacheDirPath, successTracker });
|
300
|
+
}
|
301
|
+
SuccessTracker.removeFromDownloaded = removeFromDownloaded;
|
302
|
+
async function markAsExtracted(params) {
|
303
|
+
const { cacheDirPath, extractDirBasename } = params;
|
304
|
+
const successTracker = await read({ cacheDirPath });
|
305
|
+
successTracker.extractDirBasenames.push(extractDirBasename);
|
306
|
+
await write({ cacheDirPath, successTracker });
|
307
|
+
}
|
308
|
+
SuccessTracker.markAsExtracted = markAsExtracted;
|
309
|
+
async function getIsExtracted(params) {
|
310
|
+
const { cacheDirPath, extractDirBasename } = params;
|
311
|
+
const successTracker = await read({ cacheDirPath });
|
312
|
+
return successTracker.extractDirBasenames.includes(extractDirBasename);
|
313
|
+
}
|
314
|
+
SuccessTracker.getIsExtracted = getIsExtracted;
|
315
|
+
async function removeFromExtracted(params) {
|
316
|
+
const { cacheDirPath, extractDirBasename } = params;
|
317
|
+
const successTracker = await read({ cacheDirPath });
|
318
|
+
successTracker.extractDirBasenames = successTracker.extractDirBasenames.filter(basename => basename !== extractDirBasename);
|
319
|
+
await write({ cacheDirPath, successTracker });
|
320
|
+
}
|
321
|
+
SuccessTracker.removeFromExtracted = removeFromExtracted;
|
322
|
+
})(SuccessTracker || (SuccessTracker = {}));
|
323
|
+
//# sourceMappingURL=downloadAndExtractArchive.js.map
|
324
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/downloadAndExtractArchive/index.js
|
325
|
+
|
326
|
+
//# sourceMappingURL=index.js.map
|
327
|
+
// EXTERNAL MODULE: ./dist/bin/tools/isInside.js
|
328
|
+
var isInside = __webpack_require__(90665);
|
329
|
+
;// CONCATENATED MODULE: ./dist/bin/shared/downloadKeycloakDefaultTheme.js
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
(0,assert.assert)();
|
336
|
+
async function downloadKeycloakDefaultTheme(params) {
|
337
|
+
const { keycloakVersion, buildContext } = params;
|
338
|
+
const { extractedDirPath } = await downloadAndExtractArchive({
|
339
|
+
url: `https://repo1.maven.org/maven2/org/keycloak/keycloak-themes/${keycloakVersion}/keycloak-themes-${keycloakVersion}.jar`,
|
340
|
+
cacheDirPath: buildContext.cacheDirPath,
|
341
|
+
npmWorkspaceRootDirPath: buildContext.npmWorkspaceRootDirPath,
|
342
|
+
uniqueIdOfOnOnArchiveFile: "downloadKeycloakDefaultTheme",
|
343
|
+
onArchiveFile: async (params) => {
|
344
|
+
if (!(0,isInside/* isInside */.V)({ dirPath: "theme", filePath: params.fileRelativePath })) {
|
345
|
+
return;
|
346
|
+
}
|
347
|
+
const { readFile, writeFile } = params;
|
348
|
+
const fileRelativePath = (0,external_path_.relative)("theme", params.fileRelativePath);
|
349
|
+
skip_keycloak_v2: {
|
350
|
+
if (!(0,isInside/* isInside */.V)({
|
351
|
+
dirPath: (0,external_path_.join)("keycloak.v2"),
|
352
|
+
filePath: fileRelativePath
|
353
|
+
})) {
|
354
|
+
break skip_keycloak_v2;
|
355
|
+
}
|
356
|
+
return;
|
357
|
+
}
|
358
|
+
last_account_v1_transformations: {
|
359
|
+
if (constants/* lastKeycloakVersionWithAccountV1 */.v$ !== keycloakVersion) {
|
360
|
+
break last_account_v1_transformations;
|
361
|
+
}
|
362
|
+
patch_account_css: {
|
363
|
+
if (fileRelativePath !==
|
364
|
+
(0,external_path_.join)("keycloak", "account", "resources", "css", "account.css")) {
|
365
|
+
break patch_account_css;
|
366
|
+
}
|
367
|
+
await writeFile({
|
368
|
+
fileRelativePath,
|
369
|
+
modifiedData: Buffer.from((await readFile())
|
370
|
+
.toString("utf8")
|
371
|
+
.replace("top: -34px;", "top: -34px !important;"), "utf8")
|
372
|
+
});
|
373
|
+
return;
|
374
|
+
}
|
375
|
+
skip_web_modules: {
|
376
|
+
if (!(0,isInside/* isInside */.V)({
|
377
|
+
dirPath: (0,external_path_.join)("keycloak", "common", "resources", "web_modules"),
|
378
|
+
filePath: fileRelativePath
|
379
|
+
})) {
|
380
|
+
break skip_web_modules;
|
381
|
+
}
|
382
|
+
return;
|
383
|
+
}
|
384
|
+
skip_unused_node_modules: {
|
385
|
+
const nodeModulesDirPath = (0,external_path_.join)("keycloak", "common", "resources", "node_modules");
|
386
|
+
if (!(0,isInside/* isInside */.V)({
|
387
|
+
dirPath: nodeModulesDirPath,
|
388
|
+
filePath: fileRelativePath
|
389
|
+
})) {
|
390
|
+
break skip_unused_node_modules;
|
391
|
+
}
|
392
|
+
const toKeepPrefixes = [
|
393
|
+
...[
|
394
|
+
"patternfly.min.css",
|
395
|
+
"patternfly-additions.min.css",
|
396
|
+
"patternfly-additions.min.css"
|
397
|
+
].map(fileBasename => (0,external_path_.join)(nodeModulesDirPath, "patternfly", "dist", "css", fileBasename)),
|
398
|
+
(0,external_path_.join)(nodeModulesDirPath, "patternfly", "dist", "fonts")
|
399
|
+
];
|
400
|
+
if (toKeepPrefixes.find(prefix => fileRelativePath.startsWith(prefix)) !== undefined) {
|
401
|
+
break skip_unused_node_modules;
|
402
|
+
}
|
403
|
+
return;
|
404
|
+
}
|
405
|
+
}
|
406
|
+
skip_unused_resources: {
|
407
|
+
if (keycloakVersion !== "24.0.4") {
|
408
|
+
break skip_unused_resources;
|
409
|
+
}
|
410
|
+
for (const dirBasename of [
|
411
|
+
"@patternfly-v5",
|
412
|
+
"@rollup",
|
413
|
+
"rollup",
|
414
|
+
"react",
|
415
|
+
"react-dom",
|
416
|
+
"shx",
|
417
|
+
".pnpm"
|
418
|
+
]) {
|
419
|
+
if ((0,isInside/* isInside */.V)({
|
420
|
+
dirPath: (0,external_path_.join)("keycloak", "common", "resources", "node_modules", dirBasename),
|
421
|
+
filePath: fileRelativePath
|
422
|
+
})) {
|
423
|
+
return;
|
424
|
+
}
|
425
|
+
}
|
426
|
+
for (const dirBasename of ["react", "react-dom"]) {
|
427
|
+
if ((0,isInside/* isInside */.V)({
|
428
|
+
dirPath: (0,external_path_.join)("keycloak", "common", "resources", "vendor", dirBasename),
|
429
|
+
filePath: fileRelativePath
|
430
|
+
})) {
|
431
|
+
return;
|
432
|
+
}
|
433
|
+
}
|
434
|
+
if ((0,isInside/* isInside */.V)({
|
435
|
+
dirPath: (0,external_path_.join)("keycloak", "common", "resources", "node_modules", "@patternfly", "react-core"),
|
436
|
+
filePath: fileRelativePath
|
437
|
+
})) {
|
438
|
+
return;
|
439
|
+
}
|
440
|
+
}
|
441
|
+
await writeFile({ fileRelativePath });
|
442
|
+
}
|
443
|
+
});
|
444
|
+
return { defaultThemeDirPath: extractedDirPath };
|
445
|
+
}
|
446
|
+
//# sourceMappingURL=downloadKeycloakDefaultTheme.js.map
|
447
|
+
|
448
|
+
/***/ }),
|
449
|
+
|
65
450
|
/***/ 39216:
|
66
451
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
67
452
|
|
@@ -322,6 +707,155 @@ async function promptKeycloakVersion(params) {
|
|
322
707
|
}
|
323
708
|
//# sourceMappingURL=promptKeycloakVersion.js.map
|
324
709
|
|
710
|
+
/***/ }),
|
711
|
+
|
712
|
+
/***/ 73036:
|
713
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
714
|
+
|
715
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
716
|
+
/* harmony export */ "J": () => (/* binding */ crawl)
|
717
|
+
/* harmony export */ });
|
718
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
|
719
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
720
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
|
721
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
722
|
+
|
723
|
+
|
724
|
+
const crawlRec = (dirPath, filePaths) => {
|
725
|
+
for (const basename of fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(dirPath)) {
|
726
|
+
const fileOrDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
|
727
|
+
if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(fileOrDirPath).isDirectory()) {
|
728
|
+
crawlRec(fileOrDirPath, filePaths);
|
729
|
+
continue;
|
730
|
+
}
|
731
|
+
filePaths.push(fileOrDirPath);
|
732
|
+
}
|
733
|
+
};
|
734
|
+
/** List all files in a given directory return paths relative to the dir_path */
|
735
|
+
function crawl(params) {
|
736
|
+
const { dirPath, returnedPathsType } = params;
|
737
|
+
const filePaths = [];
|
738
|
+
crawlRec(dirPath, filePaths);
|
739
|
+
switch (returnedPathsType) {
|
740
|
+
case "absolute":
|
741
|
+
return filePaths;
|
742
|
+
case "relative to dirPath":
|
743
|
+
return filePaths.map(filePath => (0,path__WEBPACK_IMPORTED_MODULE_1__.relative)(dirPath, filePath));
|
744
|
+
}
|
745
|
+
}
|
746
|
+
//# sourceMappingURL=crawl.js.map
|
747
|
+
|
748
|
+
/***/ }),
|
749
|
+
|
750
|
+
/***/ 89693:
|
751
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
752
|
+
|
753
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
754
|
+
/* harmony export */ "a": () => (/* binding */ rmSync)
|
755
|
+
/* harmony export */ });
|
756
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
|
757
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
758
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
|
759
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
760
|
+
/* harmony import */ var _SemVer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12171);
|
761
|
+
|
762
|
+
|
763
|
+
|
764
|
+
/**
|
765
|
+
* Polyfill of fs.rmSync(dirPath, { "recursive": true })
|
766
|
+
* For older version of Node
|
767
|
+
*/
|
768
|
+
function rmSync(dirPath, options) {
|
769
|
+
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) {
|
770
|
+
fs__WEBPACK_IMPORTED_MODULE_0__.rmSync(dirPath, options);
|
771
|
+
return;
|
772
|
+
}
|
773
|
+
const { force = true } = options;
|
774
|
+
if (force && !fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(dirPath)) {
|
775
|
+
return;
|
776
|
+
}
|
777
|
+
const removeDir_rec = (dirPath) => fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(dirPath).forEach(basename => {
|
778
|
+
const fileOrDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
|
779
|
+
if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(fileOrDirPath).isDirectory()) {
|
780
|
+
removeDir_rec(fileOrDirPath);
|
781
|
+
return;
|
782
|
+
}
|
783
|
+
else {
|
784
|
+
fs__WEBPACK_IMPORTED_MODULE_0__.unlinkSync(fileOrDirPath);
|
785
|
+
}
|
786
|
+
});
|
787
|
+
removeDir_rec(dirPath);
|
788
|
+
}
|
789
|
+
//# sourceMappingURL=fs.rmSync.js.map
|
790
|
+
|
791
|
+
/***/ }),
|
792
|
+
|
793
|
+
/***/ 60332:
|
794
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
795
|
+
|
796
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
797
|
+
/* harmony export */ "N": () => (/* binding */ transformCodebase)
|
798
|
+
/* harmony export */ });
|
799
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
|
800
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
801
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
|
802
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
803
|
+
/* harmony import */ var _crawl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73036);
|
804
|
+
/* harmony import */ var _tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(89693);
|
805
|
+
|
806
|
+
|
807
|
+
|
808
|
+
|
809
|
+
/**
|
810
|
+
* Apply a transformation function to every file of directory
|
811
|
+
* If source and destination are the same this function can be used to apply the transformation in place
|
812
|
+
* like filtering out some files or modifying them.
|
813
|
+
* */
|
814
|
+
function transformCodebase(params) {
|
815
|
+
const { srcDirPath, transformSourceCode } = params;
|
816
|
+
const isTargetSameAsSource = path__WEBPACK_IMPORTED_MODULE_1__.relative(srcDirPath, params.destDirPath) === "";
|
817
|
+
const destDirPath = isTargetSameAsSource
|
818
|
+
? path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, "..", "tmp_xOsPdkPsTdzPs34sOkHs")
|
819
|
+
: params.destDirPath;
|
820
|
+
fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(destDirPath, {
|
821
|
+
recursive: true
|
822
|
+
});
|
823
|
+
for (const fileRelativePath of (0,_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
|
824
|
+
dirPath: srcDirPath,
|
825
|
+
returnedPathsType: "relative to dirPath"
|
826
|
+
})) {
|
827
|
+
const filePath = path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, fileRelativePath);
|
828
|
+
const destFilePath = path__WEBPACK_IMPORTED_MODULE_1__.join(destDirPath, fileRelativePath);
|
829
|
+
// NOTE: Optimization, if we don't need to transform the file, just copy
|
830
|
+
// it using the lower level implementation.
|
831
|
+
if (transformSourceCode === undefined) {
|
832
|
+
fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
|
833
|
+
recursive: true
|
834
|
+
});
|
835
|
+
fs__WEBPACK_IMPORTED_MODULE_0__.copyFileSync(filePath, destFilePath);
|
836
|
+
continue;
|
837
|
+
}
|
838
|
+
const transformSourceCodeResult = transformSourceCode({
|
839
|
+
sourceCode: fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(filePath),
|
840
|
+
filePath,
|
841
|
+
fileRelativePath
|
842
|
+
});
|
843
|
+
if (transformSourceCodeResult === undefined) {
|
844
|
+
continue;
|
845
|
+
}
|
846
|
+
fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
|
847
|
+
recursive: true
|
848
|
+
});
|
849
|
+
const { newFileName, modifiedSourceCode } = transformSourceCodeResult;
|
850
|
+
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);
|
851
|
+
}
|
852
|
+
if (isTargetSameAsSource) {
|
853
|
+
(0,_tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__/* .rmSync */ .a)(srcDirPath, { recursive: true });
|
854
|
+
fs__WEBPACK_IMPORTED_MODULE_0__.renameSync(destDirPath, srcDirPath);
|
855
|
+
}
|
856
|
+
}
|
857
|
+
//# sourceMappingURL=transformCodebase.js.map
|
858
|
+
|
325
859
|
/***/ })
|
326
860
|
|
327
861
|
};
|
package/bin/98.index.js
CHANGED
@@ -156,7 +156,9 @@ function getBuildContext(params) {
|
|
156
156
|
if (typeof buildOptions.themeName === "string") {
|
157
157
|
return [buildOptions.themeName];
|
158
158
|
}
|
159
|
-
|
159
|
+
const [mainThemeName, ...themeVariantNames] = buildOptions.themeName;
|
160
|
+
(0,tsafe.assert)(mainThemeName !== undefined);
|
161
|
+
return [mainThemeName, ...themeVariantNames];
|
160
162
|
})();
|
161
163
|
const projectBuildDirPath = (() => {
|
162
164
|
var _a;
|
@@ -285,6 +287,7 @@ function getBuildContext(params) {
|
|
285
287
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
286
288
|
|
287
289
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
290
|
+
/* harmony export */ "Dv": () => (/* binding */ onlyBuildJarFileBasenameEnvName),
|
288
291
|
/* harmony export */ "M": () => (/* binding */ basenameOfTheKeycloakifyResourcesDir),
|
289
292
|
/* harmony export */ "N$": () => (/* binding */ keycloak_resources),
|
290
293
|
/* harmony export */ "UX": () => (/* binding */ accountThemePageIds),
|
@@ -294,7 +297,6 @@ function getBuildContext(params) {
|
|
294
297
|
/* harmony export */ "lg": () => (/* binding */ nameOfTheLocalizationRealmOverridesUserProfileProperty),
|
295
298
|
/* harmony export */ "rO": () => (/* binding */ themeTypes),
|
296
299
|
/* harmony export */ "sj": () => (/* binding */ loginThemePageIds),
|
297
|
-
/* harmony export */ "uo": () => (/* binding */ skipBuildJarsEnvName),
|
298
300
|
/* harmony export */ "v$": () => (/* binding */ lastKeycloakVersionWithAccountV1),
|
299
301
|
/* harmony export */ "y_": () => (/* binding */ accountV1ThemeName),
|
300
302
|
/* harmony export */ "z0": () => (/* binding */ resources_common)
|
@@ -311,7 +313,7 @@ const vitePluginSubScriptEnvNames = {
|
|
311
313
|
runPostBuildScript: "KEYCLOAKIFY_RUN_POST_BUILD_SCRIPT",
|
312
314
|
resolveViteConfig: "KEYCLOAKIFY_RESOLVE_VITE_CONFIG"
|
313
315
|
};
|
314
|
-
const
|
316
|
+
const onlyBuildJarFileBasenameEnvName = "KEYCLOAKIFY_ONLY_BUILD_JAR_FILE_BASENAME";
|
315
317
|
const loginThemePageIds = [
|
316
318
|
"login.ftl",
|
317
319
|
"login-username.ftl",
|