keycloakify 10.1.0-rc.1 → 10.1.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/PUBLIC_URL.js +2 -2
- package/PUBLIC_URL.js.map +1 -1
- package/account/KcContext/kcContextMocks.js +3 -3
- package/account/KcContext/kcContextMocks.js.map +1 -1
- package/bin/193.index.js +198 -62
- package/bin/{365.index.js → 20.index.js} +302 -263
- package/bin/31.index.js +15 -23
- package/bin/{430.index.js → 33.index.js} +579 -4
- package/bin/{678.index.js → 36.index.js} +2 -577
- package/bin/{440.index.js → 499.index.js} +259 -181
- package/bin/526.index.js +12 -793
- package/bin/599.index.js +4 -1
- package/bin/780.index.js +1 -1
- package/bin/{525.index.js → 903.index.js} +4840 -97
- package/bin/932.index.js +115 -886
- package/bin/main.js +4 -4
- package/bin/shared/buildContext.d.ts +0 -2
- package/bin/shared/buildContext.js.map +1 -1
- package/bin/shared/constants.d.ts +5 -6
- package/bin/shared/constants.js +5 -6
- package/bin/shared/constants.js.map +1 -1
- package/bin/shared/copyKeycloakResourcesToPublic.d.ts +2 -4
- package/bin/shared/copyKeycloakResourcesToPublic.js.map +1 -1
- package/login/KcContext/KcContext.d.ts +9 -18
- package/login/KcContext/KcContext.js.map +1 -1
- package/login/KcContext/kcContextMocks.js +6 -10
- package/login/KcContext/kcContextMocks.js.map +1 -1
- package/login/Template.js +4 -59
- package/login/Template.js.map +1 -1
- package/login/Template.useStylesAndScripts.d.ts +17 -0
- package/login/Template.useStylesAndScripts.js +69 -0
- package/login/Template.useStylesAndScripts.js.map +1 -0
- package/login/pages/Login.js +1 -1
- package/login/pages/Login.js.map +1 -1
- package/login/pages/LoginIdpLinkConfirmOverride.js +0 -1
- package/login/pages/LoginIdpLinkConfirmOverride.js.map +1 -1
- package/login/pages/LoginPasskeysConditionalAuthenticate.js +6 -49
- package/login/pages/LoginPasskeysConditionalAuthenticate.js.map +1 -1
- package/login/pages/LoginPasskeysConditionalAuthenticate.useScript.d.ts +20 -0
- package/login/pages/LoginPasskeysConditionalAuthenticate.useScript.js +49 -0
- package/login/pages/LoginPasskeysConditionalAuthenticate.useScript.js.map +1 -0
- package/login/pages/LoginRecoveryAuthnCodeConfig.js +4 -126
- package/login/pages/LoginRecoveryAuthnCodeConfig.js.map +1 -1
- package/login/pages/LoginRecoveryAuthnCodeConfig.useScript.d.ts +9 -0
- package/login/pages/LoginRecoveryAuthnCodeConfig.useScript.js +133 -0
- package/login/pages/LoginRecoveryAuthnCodeConfig.useScript.js.map +1 -0
- package/login/pages/LoginUsername.js +1 -1
- package/login/pages/LoginUsername.js.map +1 -1
- package/login/pages/Register.js +6 -3
- package/login/pages/Register.js.map +1 -1
- package/login/pages/WebauthnAuthenticate.js +13 -116
- package/login/pages/WebauthnAuthenticate.js.map +1 -1
- package/login/pages/WebauthnAuthenticate.useScript.d.ts +21 -0
- package/login/pages/WebauthnAuthenticate.useScript.js +41 -0
- package/login/pages/WebauthnAuthenticate.useScript.js.map +1 -0
- package/login/pages/WebauthnRegister.js +8 -178
- package/login/pages/WebauthnRegister.js.map +1 -1
- package/login/pages/WebauthnRegister.useScript.d.ts +27 -0
- package/login/pages/WebauthnRegister.useScript.js +49 -0
- package/login/pages/WebauthnRegister.useScript.js.map +1 -0
- package/package.json +125 -15
- package/res/account-v1/account.ftl +70 -0
- package/res/account-v1/applications.ftl +76 -0
- package/res/account-v1/federatedIdentity.ftl +42 -0
- package/res/account-v1/log.ftl +35 -0
- package/res/account-v1/messages/messages_ar.properties +406 -0
- package/res/account-v1/messages/messages_ca.properties +147 -0
- package/res/account-v1/messages/messages_cs.properties +171 -0
- package/res/account-v1/messages/messages_da.properties +339 -0
- package/res/account-v1/messages/messages_de.properties +353 -0
- package/res/account-v1/messages/messages_en.properties +404 -0
- package/res/account-v1/messages/messages_es.properties +147 -0
- package/res/account-v1/messages/messages_fi.properties +400 -0
- package/res/account-v1/messages/messages_fr.properties +180 -0
- package/res/account-v1/messages/messages_hu.properties +334 -0
- package/res/account-v1/messages/messages_it.properties +336 -0
- package/res/account-v1/messages/messages_ja.properties +335 -0
- package/res/account-v1/messages/messages_lt.properties +154 -0
- package/res/account-v1/messages/messages_lv.properties +197 -0
- package/res/account-v1/messages/messages_nl.properties +371 -0
- package/res/account-v1/messages/messages_no.properties +152 -0
- package/res/account-v1/messages/messages_pl.properties +248 -0
- package/res/account-v1/messages/messages_pt_BR.properties +349 -0
- package/res/account-v1/messages/messages_ru.properties +235 -0
- package/res/account-v1/messages/messages_sk.properties +196 -0
- package/res/account-v1/messages/messages_sv.properties +150 -0
- package/res/account-v1/messages/messages_tr.properties +315 -0
- package/res/account-v1/messages/messages_zh_CN.properties +153 -0
- package/res/account-v1/password.ftl +59 -0
- package/res/account-v1/resource-detail.ftl +277 -0
- package/res/account-v1/resources/css/account.css +277 -0
- package/res/account-v1/resources/img/icon-sidebar-active.png +0 -0
- package/res/account-v1/resources/img/keycloak-logo.png +0 -0
- package/res/account-v1/resources/img/logo.png +0 -0
- package/res/account-v1/resources/resources-common/img/favicon.ico +0 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/css/patternfly-additions.min.css +5 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/css/patternfly.min.css +8 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.woff2 +0 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Light-webfont.woff2 +0 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Regular-webfont.woff2 +0 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Semibold-webfont.woff2 +0 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.ttf +0 -0
- package/res/account-v1/resources/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.woff +0 -0
- package/res/account-v1/resources.ftl +403 -0
- package/res/account-v1/sessions.ftl +44 -0
- package/res/account-v1/template.ftl +88 -0
- package/res/account-v1/theme.properties +14 -0
- package/res/account-v1/totp.ftl +141 -0
- package/res/public/.keycloakify/account/css/account.css +277 -0
- package/res/public/.keycloakify/account/img/icon-sidebar-active.png +0 -0
- package/res/public/.keycloakify/account/img/keycloak-logo.png +0 -0
- package/res/public/.keycloakify/account/img/logo.png +0 -0
- package/res/public/.keycloakify/account/resources-common/img/favicon.ico +0 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/css/patternfly-additions.min.css +5 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/css/patternfly.min.css +8 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.woff2 +0 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Light-webfont.woff2 +0 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Regular-webfont.woff2 +0 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Semibold-webfont.woff2 +0 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.ttf +0 -0
- package/res/public/.keycloakify/account/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.woff +0 -0
- package/res/public/.keycloakify/login/css/login.css +629 -0
- package/res/public/.keycloakify/login/img/feedback-error-arrow-down.png +0 -0
- package/res/public/.keycloakify/login/img/feedback-error-sign.png +0 -0
- package/res/public/.keycloakify/login/img/feedback-success-arrow-down.png +0 -0
- package/res/public/.keycloakify/login/img/feedback-success-sign.png +0 -0
- package/res/public/.keycloakify/login/img/feedback-warning-arrow-down.png +0 -0
- package/res/public/.keycloakify/login/img/feedback-warning-sign.png +0 -0
- package/res/public/.keycloakify/login/img/keycloak-bg.png +0 -0
- package/res/public/.keycloakify/login/img/keycloak-logo-text.png +0 -0
- package/res/public/.keycloakify/login/img/keycloak-logo.png +0 -0
- package/res/public/.keycloakify/login/js/authChecker.js +49 -0
- package/res/public/.keycloakify/login/js/common.js +48 -0
- package/res/public/.keycloakify/login/js/kcMultivalued.js +106 -0
- package/res/public/.keycloakify/login/js/kcNumberFormat.js +21 -0
- package/res/public/.keycloakify/login/js/kcNumberUnFormat.js +19 -0
- package/res/public/.keycloakify/login/js/menu-button-links.js +315 -0
- package/{src/bin/shared/downloadKeycloakDefaultTheme/extra-assets → res/public/.keycloakify/login/js}/passkeysConditionalAuth.js +1 -1
- package/res/public/.keycloakify/login/js/passwordVisibility.js +15 -0
- package/res/public/.keycloakify/login/js/userProfile.js +71 -0
- package/res/public/.keycloakify/login/js/webauthnRegister.js +140 -0
- package/res/public/.keycloakify/login/resources-common/img/favicon.ico +0 -0
- package/res/public/.keycloakify/login/resources-common/lib/pficon/pficon.css +22 -0
- package/res/public/.keycloakify/login/resources-common/lib/pficon/pficon.woff2 +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/@patternfly/patternfly/patternfly.min.css +2 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/jquery/dist/jquery.min.js +2 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/css/patternfly-additions.min.css +5 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/css/patternfly.min.css +8 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.ttf +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.woff2 +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Light-webfont.woff2 +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Regular-webfont.woff2 +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Semibold-webfont.woff2 +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.ttf +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.woff +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/fonts/fontawesome-webfont.woff2 +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/patternfly/dist/img/bg-login.jpg +0 -0
- package/res/public/.keycloakify/login/resources-common/node_modules/rfc4648/lib/rfc4648.js +178 -0
- package/src/PUBLIC_URL.ts +5 -3
- package/src/account/KcContext/kcContextMocks.ts +3 -3
- package/src/bin/copy-keycloak-resources-to-public.ts +1 -1
- package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +4 -1
- package/src/bin/initialize-email-theme.ts +28 -8
- package/src/bin/keycloakify/buildJars/buildJar.ts +3 -7
- package/src/bin/keycloakify/generateFtl/generateFtl.ts +3 -7
- package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +65 -90
- package/src/bin/keycloakify/keycloakify.ts +38 -21
- package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +2 -2
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts +3 -3
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts +3 -3
- package/src/bin/shared/buildContext.ts +1 -8
- package/src/bin/shared/constants.ts +5 -7
- package/src/bin/shared/copyKeycloakResourcesToPublic.ts +30 -40
- package/src/bin/start-keycloak/start-keycloak.ts +10 -12
- package/src/login/KcContext/KcContext.ts +9 -18
- package/src/login/KcContext/kcContextMocks.ts +5 -13
- package/src/login/Template.tsx +4 -67
- package/src/login/Template.useStylesAndScripts.ts +94 -0
- package/src/login/pages/Login.tsx +1 -1
- package/src/login/pages/LoginIdpLinkConfirmOverride.tsx +0 -1
- package/src/login/pages/LoginPasskeysConditionalAuthenticate.tsx +6 -81
- package/src/login/pages/LoginPasskeysConditionalAuthenticate.useScript.tsx +72 -0
- package/src/login/pages/LoginRecoveryAuthnCodeConfig.tsx +4 -126
- package/src/login/pages/LoginRecoveryAuthnCodeConfig.useScript.tsx +142 -0
- package/src/login/pages/LoginUsername.tsx +1 -1
- package/src/login/pages/Register.tsx +35 -13
- package/src/login/pages/WebauthnAuthenticate.tsx +20 -133
- package/src/login/pages/WebauthnAuthenticate.useScript.tsx +64 -0
- package/src/login/pages/WebauthnRegister.tsx +8 -195
- package/src/login/pages/WebauthnRegister.useScript.tsx +93 -0
- package/src/tools/useInsertScriptTags.ts +14 -4
- package/src/vite-plugin/vite-plugin.ts +11 -15
- package/tools/useInsertScriptTags.d.ts +2 -2
- package/tools/useInsertScriptTags.js +8 -2
- package/tools/useInsertScriptTags.js.map +1 -1
- package/vite-plugin/index.js +3357 -47132
- package/bin/697.index.js +0 -4749
- package/bin/shared/downloadKeycloakStaticResources.d.ts +0 -9
- package/bin/shared/downloadKeycloakStaticResources.js.map +0 -1
- package/src/bin/keycloakify/generateResources/bringInAccountV1.ts +0 -89
- package/src/bin/shared/downloadKeycloakDefaultTheme/downloadKeycloakDefaultTheme.ts +0 -338
- package/src/bin/shared/downloadKeycloakDefaultTheme/index.ts +0 -1
- package/src/bin/shared/downloadKeycloakStaticResources.ts +0 -53
- /package/{src/bin/shared/downloadKeycloakDefaultTheme/extra-assets → res/public/.keycloakify/login/js}/webauthnAuthenticate.js +0 -0
@@ -1,181 +1,331 @@
|
|
1
1
|
"use strict";
|
2
|
-
exports.id =
|
3
|
-
exports.ids = [
|
2
|
+
exports.id = 20;
|
3
|
+
exports.ids = [20];
|
4
4
|
exports.modules = {
|
5
5
|
|
6
|
-
/***/
|
6
|
+
/***/ 97189:
|
7
7
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
8
8
|
|
9
9
|
|
10
10
|
// EXPORTS
|
11
11
|
__webpack_require__.d(__webpack_exports__, {
|
12
|
-
"
|
12
|
+
"_": () => (/* binding */ getLatestsSemVersionedTag)
|
13
13
|
});
|
14
14
|
|
15
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/octokit-addons/listTags.js
|
16
|
+
var __await = (undefined && undefined.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
17
|
+
var __asyncGenerator = (undefined && undefined.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
18
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
19
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
20
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
21
|
+
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
22
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
23
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
24
|
+
function fulfill(value) { resume("next", value); }
|
25
|
+
function reject(value) { resume("throw", value); }
|
26
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
27
|
+
};
|
28
|
+
const per_page = 99;
|
29
|
+
function listTagsFactory(params) {
|
30
|
+
const { octokit } = params;
|
31
|
+
const octokit_repo_listTags = async (params) => {
|
32
|
+
return octokit.repos.listTags(params);
|
33
|
+
};
|
34
|
+
function listTags(params) {
|
35
|
+
return __asyncGenerator(this, arguments, function* listTags_1() {
|
36
|
+
const { owner, repo } = params;
|
37
|
+
let page = 1;
|
38
|
+
while (true) {
|
39
|
+
const resp = yield __await(octokit_repo_listTags({
|
40
|
+
owner,
|
41
|
+
repo,
|
42
|
+
per_page,
|
43
|
+
page: page++
|
44
|
+
}));
|
45
|
+
for (const branch of resp.data.map(({ name }) => name)) {
|
46
|
+
yield yield __await(branch);
|
47
|
+
}
|
48
|
+
if (resp.data.length < 99) {
|
49
|
+
break;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
});
|
53
|
+
}
|
54
|
+
/** Returns the same "latest" tag as deno.land/x, not actually the latest though */
|
55
|
+
async function getLatestTag(params) {
|
56
|
+
const { owner, repo } = params;
|
57
|
+
const itRes = await listTags({ owner, repo }).next();
|
58
|
+
if (itRes.done) {
|
59
|
+
return undefined;
|
60
|
+
}
|
61
|
+
return itRes.value;
|
62
|
+
}
|
63
|
+
return { listTags, getLatestTag };
|
64
|
+
}
|
65
|
+
//# sourceMappingURL=listTags.js.map
|
66
|
+
// EXTERNAL MODULE: ./dist/bin/tools/SemVer.js
|
67
|
+
var SemVer = __webpack_require__(12171);
|
68
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/octokit-addons/getLatestsSemVersionedTag.js
|
69
|
+
var __asyncValues = (undefined && undefined.__asyncValues) || function (o) {
|
70
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
71
|
+
var m = o[Symbol.asyncIterator], i;
|
72
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
73
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
74
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
75
|
+
};
|
76
|
+
|
77
|
+
|
78
|
+
function getLatestsSemVersionedTagFactory(params) {
|
79
|
+
const { octokit } = params;
|
80
|
+
async function getLatestsSemVersionedTag(params) {
|
81
|
+
var _a, e_1, _b, _c;
|
82
|
+
const { owner, repo, count, doIgnoreReleaseCandidates } = params;
|
83
|
+
const semVersionedTags = [];
|
84
|
+
const { listTags } = listTagsFactory({ octokit });
|
85
|
+
try {
|
86
|
+
for (var _d = true, _e = __asyncValues(listTags({ owner, repo })), _f; _f = await _e.next(), _a = _f.done, !_a;) {
|
87
|
+
_c = _f.value;
|
88
|
+
_d = false;
|
89
|
+
try {
|
90
|
+
const tag = _c;
|
91
|
+
let version;
|
92
|
+
try {
|
93
|
+
version = SemVer/* SemVer.parse */.h.parse(tag.replace(/^[vV]?/, ""));
|
94
|
+
}
|
95
|
+
catch (_g) {
|
96
|
+
continue;
|
97
|
+
}
|
98
|
+
if (doIgnoreReleaseCandidates && version.rc !== undefined) {
|
99
|
+
continue;
|
100
|
+
}
|
101
|
+
semVersionedTags.push({ tag, version });
|
102
|
+
}
|
103
|
+
finally {
|
104
|
+
_d = true;
|
105
|
+
}
|
106
|
+
}
|
107
|
+
}
|
108
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
109
|
+
finally {
|
110
|
+
try {
|
111
|
+
if (!_d && !_a && (_b = _e.return)) await _b.call(_e);
|
112
|
+
}
|
113
|
+
finally { if (e_1) throw e_1.error; }
|
114
|
+
}
|
115
|
+
return semVersionedTags
|
116
|
+
.sort(({ version: vX }, { version: vY }) => SemVer/* SemVer.compare */.h.compare(vY, vX))
|
117
|
+
.slice(0, count);
|
118
|
+
}
|
119
|
+
return { getLatestsSemVersionedTag };
|
120
|
+
}
|
121
|
+
//# sourceMappingURL=getLatestsSemVersionedTag.js.map
|
122
|
+
// EXTERNAL MODULE: ./node_modules/@octokit/rest/dist-node/index.js
|
123
|
+
var dist_node = __webpack_require__(55375);
|
15
124
|
// EXTERNAL MODULE: external "path"
|
16
125
|
var external_path_ = __webpack_require__(71017);
|
126
|
+
// EXTERNAL MODULE: external "fs"
|
127
|
+
var external_fs_ = __webpack_require__(57147);
|
128
|
+
// EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
|
129
|
+
var lib = __webpack_require__(52300);
|
17
130
|
// EXTERNAL MODULE: ./node_modules/tsafe/assert.js
|
18
131
|
var assert = __webpack_require__(88078);
|
19
|
-
// EXTERNAL MODULE: ./
|
20
|
-
var
|
21
|
-
// EXTERNAL MODULE: ./
|
22
|
-
var
|
23
|
-
// EXTERNAL MODULE: ./
|
24
|
-
var
|
25
|
-
|
26
|
-
|
27
|
-
|
132
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/id.js
|
133
|
+
var id = __webpack_require__(43047);
|
134
|
+
// EXTERNAL MODULE: ./node_modules/evt/tools/inDepth/same.js
|
135
|
+
var same = __webpack_require__(33805);
|
136
|
+
// EXTERNAL MODULE: ./node_modules/make-fetch-happen/lib/index.js
|
137
|
+
var make_fetch_happen_lib = __webpack_require__(9525);
|
138
|
+
var lib_default = /*#__PURE__*/__webpack_require__.n(make_fetch_happen_lib);
|
139
|
+
;// CONCATENATED MODULE: ./dist/bin/shared/getLatestsSemVersionedTag.js
|
140
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
141
|
+
var t = {};
|
142
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
143
|
+
t[p] = s[p];
|
144
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
145
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
146
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
147
|
+
t[p[i]] = s[p[i]];
|
148
|
+
}
|
149
|
+
return t;
|
150
|
+
};
|
151
|
+
|
28
152
|
|
29
153
|
|
30
154
|
|
31
155
|
|
32
156
|
|
33
157
|
|
158
|
+
|
159
|
+
|
160
|
+
let getLatestsSemVersionedTag_stateless = undefined;
|
161
|
+
const CACHE_VERSION = 1;
|
34
162
|
(0,assert.assert)();
|
35
|
-
async function
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
uniqueIdOfOnArchiveFile: "downloadKeycloakDefaultTheme",
|
45
|
-
onArchiveFile: async (params) => {
|
46
|
-
const fileRelativePath = (0,external_path_.relative)("theme", params.fileRelativePath);
|
47
|
-
if (fileRelativePath.startsWith("..")) {
|
48
|
-
return;
|
163
|
+
async function getLatestsSemVersionedTag(_a) {
|
164
|
+
var { buildContext } = _a, params = __rest(_a, ["buildContext"]);
|
165
|
+
const cacheFilePath = (0,external_path_.join)(buildContext.cacheDirPath, "latest-sem-versioned-tags.json");
|
166
|
+
const cacheLookupResult = (() => {
|
167
|
+
const getResult_currentCache = (currentCacheEntries) => ({
|
168
|
+
hasCachedResult: false,
|
169
|
+
currentCache: {
|
170
|
+
version: CACHE_VERSION,
|
171
|
+
entries: currentCacheEntries
|
49
172
|
}
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
skip_lib: {
|
68
|
-
if (!fileRelativePath.startsWith((0,external_path_.join)("keycloak", "common", "resources", "lib"))) {
|
69
|
-
break skip_lib;
|
70
|
-
}
|
71
|
-
return;
|
72
|
-
}
|
73
|
-
skip_node_modules: {
|
74
|
-
const nodeModulesRelativeDirPath = (0,external_path_.join)("keycloak", "common", "resources", "node_modules");
|
75
|
-
if (!fileRelativePath.startsWith(nodeModulesRelativeDirPath)) {
|
76
|
-
break skip_node_modules;
|
77
|
-
}
|
78
|
-
if (kcNodeModulesKeepFilePaths_lastAccountV1 === undefined) {
|
79
|
-
kcNodeModulesKeepFilePaths_lastAccountV1 = new Set([
|
80
|
-
(0,external_path_.join)("patternfly", "dist", "css", "patternfly.min.css"),
|
81
|
-
(0,external_path_.join)("patternfly", "dist", "css", "patternfly-additions.min.css"),
|
82
|
-
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Regular-webfont.woff2"),
|
83
|
-
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Bold-webfont.woff2"),
|
84
|
-
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Light-webfont.woff2"),
|
85
|
-
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Semibold-webfont.woff2"),
|
86
|
-
(0,external_path_.join)("patternfly", "dist", "fonts", "PatternFlyIcons-webfont.ttf"),
|
87
|
-
(0,external_path_.join)("patternfly", "dist", "fonts", "PatternFlyIcons-webfont.woff")
|
88
|
-
]);
|
89
|
-
}
|
90
|
-
const fileRelativeToNodeModulesPath = fileRelativePath.substring(nodeModulesRelativeDirPath.length + 1);
|
91
|
-
if (kcNodeModulesKeepFilePaths_lastAccountV1.has(fileRelativeToNodeModulesPath)) {
|
92
|
-
break skip_node_modules;
|
93
|
-
}
|
94
|
-
return;
|
95
|
-
}
|
96
|
-
patch_account_css: {
|
97
|
-
if (fileRelativePath !==
|
98
|
-
(0,external_path_.join)("keycloak", "account", "resources", "css", "account.css")) {
|
99
|
-
break patch_account_css;
|
100
|
-
}
|
101
|
-
await writeFile({
|
102
|
-
fileRelativePath,
|
103
|
-
modifiedData: Buffer.from((await readFile())
|
104
|
-
.toString("utf8")
|
105
|
-
.replace("top: -34px;", "top: -34px !important;"), "utf8")
|
106
|
-
});
|
107
|
-
return;
|
108
|
-
}
|
109
|
-
}
|
110
|
-
copy_extra_assets: {
|
111
|
-
if (keycloakVersion !== "24.0.4") {
|
112
|
-
break copy_extra_assets;
|
113
|
-
}
|
114
|
-
if (areExtraAssetsFor24Copied) {
|
115
|
-
break copy_extra_assets;
|
116
|
-
}
|
117
|
-
const extraAssetsDirPath = (0,external_path_.join)((0,getThisCodebaseRootDirPath/* getThisCodebaseRootDirPath */.e)(), "src", "bin", "shared", "downloadKeycloakDefaultTheme", "extra-assets");
|
118
|
-
await Promise.all(["webauthnAuthenticate.js", "passkeysConditionalAuth.js"].map(async (fileBasename) => writeFile({
|
119
|
-
fileRelativePath: (0,external_path_.join)("base", "login", "resources", "js", fileBasename),
|
120
|
-
modifiedData: await promises_.readFile((0,external_path_.join)(extraAssetsDirPath, fileBasename))
|
121
|
-
})));
|
122
|
-
}
|
123
|
-
skip_unused_resources: {
|
124
|
-
if (keycloakVersion !== "24.0.4") {
|
125
|
-
break skip_unused_resources;
|
126
|
-
}
|
127
|
-
skip_node_modules: {
|
128
|
-
const nodeModulesRelativeDirPath = (0,external_path_.join)("keycloak", "common", "resources", "node_modules");
|
129
|
-
if (!fileRelativePath.startsWith(nodeModulesRelativeDirPath)) {
|
130
|
-
break skip_node_modules;
|
131
|
-
}
|
132
|
-
if (kcNodeModulesKeepFilePaths === undefined) {
|
133
|
-
kcNodeModulesKeepFilePaths = new Set([
|
134
|
-
(0,external_path_.join)("@patternfly", "patternfly", "patternfly.min.css"),
|
135
|
-
(0,external_path_.join)("patternfly", "dist", "css", "patternfly.min.css"),
|
136
|
-
(0,external_path_.join)("patternfly", "dist", "css", "patternfly-additions.min.css"),
|
137
|
-
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Regular-webfont.woff2"),
|
138
|
-
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Light-webfont.woff2"),
|
139
|
-
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Bold-webfont.woff2"),
|
140
|
-
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Bold-webfont.woff"),
|
141
|
-
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Bold-webfont.ttf"),
|
142
|
-
(0,external_path_.join)("patternfly", "dist", "fonts", "fontawesome-webfont.woff2"),
|
143
|
-
(0,external_path_.join)("patternfly", "dist", "fonts", "PatternFlyIcons-webfont.ttf"),
|
144
|
-
(0,external_path_.join)("patternfly", "dist", "fonts", "PatternFlyIcons-webfont.woff"),
|
145
|
-
(0,external_path_.join)("patternfly", "dist", "fonts", "OpenSans-Semibold-webfont.woff2"),
|
146
|
-
(0,external_path_.join)("patternfly", "dist", "img", "bg-login.jpg"),
|
147
|
-
(0,external_path_.join)("jquery", "dist", "jquery.min.js")
|
148
|
-
]);
|
149
|
-
}
|
150
|
-
const fileRelativeToNodeModulesPath = fileRelativePath.substring(nodeModulesRelativeDirPath.length + 1);
|
151
|
-
if (kcNodeModulesKeepFilePaths.has(fileRelativeToNodeModulesPath)) {
|
152
|
-
break skip_node_modules;
|
153
|
-
}
|
154
|
-
return;
|
155
|
-
}
|
156
|
-
skip_vendor: {
|
157
|
-
if (!fileRelativePath.startsWith((0,external_path_.join)("keycloak", "common", "resources", "vendor"))) {
|
158
|
-
break skip_vendor;
|
159
|
-
}
|
160
|
-
return;
|
161
|
-
}
|
162
|
-
skip_rollup_config: {
|
163
|
-
if (fileRelativePath !==
|
164
|
-
(0,external_path_.join)("keycloak", "common", "resources", "rollup.config.js")) {
|
165
|
-
break skip_rollup_config;
|
166
|
-
}
|
167
|
-
return;
|
168
|
-
}
|
169
|
-
}
|
170
|
-
await writeFile({ fileRelativePath });
|
173
|
+
});
|
174
|
+
if (!external_fs_.existsSync(cacheFilePath)) {
|
175
|
+
return getResult_currentCache([]);
|
176
|
+
}
|
177
|
+
let cache_json;
|
178
|
+
try {
|
179
|
+
cache_json = external_fs_.readFileSync(cacheFilePath).toString("utf8");
|
180
|
+
}
|
181
|
+
catch (_a) {
|
182
|
+
return getResult_currentCache([]);
|
183
|
+
}
|
184
|
+
let cache_json_parsed;
|
185
|
+
try {
|
186
|
+
cache_json_parsed = JSON.parse(cache_json);
|
187
|
+
}
|
188
|
+
catch (_b) {
|
189
|
+
return getResult_currentCache([]);
|
171
190
|
}
|
191
|
+
const zSemVer = (() => {
|
192
|
+
const zTargetType = lib.z.object({
|
193
|
+
major: lib.z.number(),
|
194
|
+
minor: lib.z.number(),
|
195
|
+
patch: lib.z.number(),
|
196
|
+
rc: lib.z.number().optional(),
|
197
|
+
parsedFrom: lib.z.string()
|
198
|
+
});
|
199
|
+
(0,assert.assert)();
|
200
|
+
return (0,id.id)(zTargetType);
|
201
|
+
})();
|
202
|
+
const zCache = (() => {
|
203
|
+
const zTargetType = lib.z.object({
|
204
|
+
version: lib.z.literal(CACHE_VERSION),
|
205
|
+
entries: lib.z.array(lib.z.object({
|
206
|
+
time: lib.z.number(),
|
207
|
+
params: lib.z.object({
|
208
|
+
owner: lib.z.string(),
|
209
|
+
repo: lib.z.string(),
|
210
|
+
count: lib.z.number(),
|
211
|
+
doIgnoreReleaseCandidates: lib.z.boolean()
|
212
|
+
}),
|
213
|
+
result: lib.z.array(lib.z.object({
|
214
|
+
tag: lib.z.string(),
|
215
|
+
version: zSemVer
|
216
|
+
}))
|
217
|
+
}))
|
218
|
+
});
|
219
|
+
(0,assert.assert)();
|
220
|
+
return (0,id.id)(zTargetType);
|
221
|
+
})();
|
222
|
+
let cache;
|
223
|
+
try {
|
224
|
+
cache = zCache.parse(cache_json_parsed);
|
225
|
+
}
|
226
|
+
catch (_c) {
|
227
|
+
return getResult_currentCache([]);
|
228
|
+
}
|
229
|
+
const cacheEntry = cache.entries.find(e => (0,same.same)(e.params, params));
|
230
|
+
if (cacheEntry === undefined) {
|
231
|
+
return getResult_currentCache(cache.entries);
|
232
|
+
}
|
233
|
+
if (Date.now() - cacheEntry.time > 3600000) {
|
234
|
+
return getResult_currentCache(cache.entries.filter(e => e !== cacheEntry));
|
235
|
+
}
|
236
|
+
return {
|
237
|
+
hasCachedResult: true,
|
238
|
+
cachedResult: cacheEntry.result
|
239
|
+
};
|
240
|
+
})();
|
241
|
+
if (cacheLookupResult.hasCachedResult) {
|
242
|
+
return cacheLookupResult.cachedResult;
|
243
|
+
}
|
244
|
+
const { currentCache } = cacheLookupResult;
|
245
|
+
getLatestsSemVersionedTag_stateless !== null && getLatestsSemVersionedTag_stateless !== void 0 ? getLatestsSemVersionedTag_stateless : (getLatestsSemVersionedTag_stateless = (() => {
|
246
|
+
const octokit = (() => {
|
247
|
+
const githubToken = process.env.GITHUB_TOKEN;
|
248
|
+
const octokit = new dist_node.Octokit(Object.assign(Object.assign({}, (githubToken === undefined ? {} : { auth: githubToken })), { request: {
|
249
|
+
fetch: (url, options) => lib_default()(url, Object.assign(Object.assign({}, options), buildContext.fetchOptions))
|
250
|
+
} }));
|
251
|
+
return octokit;
|
252
|
+
})();
|
253
|
+
const { getLatestsSemVersionedTag } = getLatestsSemVersionedTagFactory({
|
254
|
+
octokit
|
255
|
+
});
|
256
|
+
return getLatestsSemVersionedTag;
|
257
|
+
})());
|
258
|
+
const result = await getLatestsSemVersionedTag_stateless(params);
|
259
|
+
currentCache.entries.push({
|
260
|
+
time: Date.now(),
|
261
|
+
params,
|
262
|
+
result
|
172
263
|
});
|
173
|
-
|
264
|
+
{
|
265
|
+
const dirPath = (0,external_path_.dirname)(cacheFilePath);
|
266
|
+
if (!external_fs_.existsSync(dirPath)) {
|
267
|
+
external_fs_.mkdirSync(dirPath, { recursive: true });
|
268
|
+
}
|
269
|
+
}
|
270
|
+
external_fs_.writeFileSync(cacheFilePath, JSON.stringify(currentCache, null, 2));
|
271
|
+
return result;
|
174
272
|
}
|
175
|
-
//# sourceMappingURL=
|
176
|
-
;// CONCATENATED MODULE: ./dist/bin/shared/downloadKeycloakDefaultTheme/index.js
|
273
|
+
//# sourceMappingURL=getLatestsSemVersionedTag.js.map
|
177
274
|
|
178
|
-
|
275
|
+
/***/ }),
|
276
|
+
|
277
|
+
/***/ 82635:
|
278
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
279
|
+
|
280
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
281
|
+
/* harmony export */ "s": () => (/* binding */ promptKeycloakVersion)
|
282
|
+
/* harmony export */ });
|
283
|
+
/* harmony import */ var _getLatestsSemVersionedTag__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97189);
|
284
|
+
/* harmony import */ var cli_select__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99398);
|
285
|
+
/* harmony import */ var cli_select__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(cli_select__WEBPACK_IMPORTED_MODULE_1__);
|
286
|
+
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88078);
|
287
|
+
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(tsafe_assert__WEBPACK_IMPORTED_MODULE_2__);
|
288
|
+
/* harmony import */ var _tools_SemVer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12171);
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_2__.assert)();
|
294
|
+
async function promptKeycloakVersion(params) {
|
295
|
+
const { startingFromMajor, excludeMajorVersions, doOmitPatch, buildContext } = params;
|
296
|
+
const semVersionedTagByMajor = new Map();
|
297
|
+
const semVersionedTags = await (0,_getLatestsSemVersionedTag__WEBPACK_IMPORTED_MODULE_0__/* .getLatestsSemVersionedTag */ ._)({
|
298
|
+
count: 50,
|
299
|
+
owner: "keycloak",
|
300
|
+
repo: "keycloak",
|
301
|
+
doIgnoreReleaseCandidates: true,
|
302
|
+
buildContext
|
303
|
+
});
|
304
|
+
semVersionedTags.forEach(semVersionedTag => {
|
305
|
+
if (startingFromMajor !== undefined &&
|
306
|
+
semVersionedTag.version.major < startingFromMajor) {
|
307
|
+
return;
|
308
|
+
}
|
309
|
+
if (excludeMajorVersions.includes(semVersionedTag.version.major)) {
|
310
|
+
return;
|
311
|
+
}
|
312
|
+
const currentSemVersionedTag = semVersionedTagByMajor.get(semVersionedTag.version.major);
|
313
|
+
if (currentSemVersionedTag !== undefined &&
|
314
|
+
_tools_SemVer__WEBPACK_IMPORTED_MODULE_3__/* .SemVer.compare */ .h.compare(semVersionedTag.version, currentSemVersionedTag.version) === -1) {
|
315
|
+
return;
|
316
|
+
}
|
317
|
+
semVersionedTagByMajor.set(semVersionedTag.version.major, semVersionedTag);
|
318
|
+
});
|
319
|
+
const lastMajorVersions = Array.from(semVersionedTagByMajor.values()).map(({ version }) => `${version.major}.${version.minor}${doOmitPatch ? "" : `.${version.patch}`}`);
|
320
|
+
const { value } = await cli_select__WEBPACK_IMPORTED_MODULE_1___default()({
|
321
|
+
values: lastMajorVersions
|
322
|
+
}).catch(() => {
|
323
|
+
process.exit(-1);
|
324
|
+
});
|
325
|
+
const keycloakVersion = value.split(" ")[0];
|
326
|
+
return { keycloakVersion };
|
327
|
+
}
|
328
|
+
//# sourceMappingURL=promptKeycloakVersion.js.map
|
179
329
|
|
180
330
|
/***/ }),
|
181
331
|
|
@@ -632,117 +782,6 @@ async function checkDirExists(dirPath) {
|
|
632
782
|
}
|
633
783
|
//# sourceMappingURL=fs.rm.js.map
|
634
784
|
|
635
|
-
/***/ }),
|
636
|
-
|
637
|
-
/***/ 89693:
|
638
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
639
|
-
|
640
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
641
|
-
/* harmony export */ "a": () => (/* binding */ rmSync)
|
642
|
-
/* harmony export */ });
|
643
|
-
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
|
644
|
-
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
645
|
-
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
|
646
|
-
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
647
|
-
/* harmony import */ var _SemVer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12171);
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
/**
|
652
|
-
* Polyfill of fs.rmSync(dirPath, { "recursive": true })
|
653
|
-
* For older version of Node
|
654
|
-
*/
|
655
|
-
function rmSync(dirPath, options) {
|
656
|
-
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) {
|
657
|
-
fs__WEBPACK_IMPORTED_MODULE_0__.rmSync(dirPath, options);
|
658
|
-
return;
|
659
|
-
}
|
660
|
-
const { force = true } = options;
|
661
|
-
if (force && !fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(dirPath)) {
|
662
|
-
return;
|
663
|
-
}
|
664
|
-
const removeDir_rec = (dirPath) => fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(dirPath).forEach(basename => {
|
665
|
-
const fileOrDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
|
666
|
-
if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(fileOrDirPath).isDirectory()) {
|
667
|
-
removeDir_rec(fileOrDirPath);
|
668
|
-
return;
|
669
|
-
}
|
670
|
-
else {
|
671
|
-
fs__WEBPACK_IMPORTED_MODULE_0__.unlinkSync(fileOrDirPath);
|
672
|
-
}
|
673
|
-
});
|
674
|
-
removeDir_rec(dirPath);
|
675
|
-
}
|
676
|
-
//# sourceMappingURL=fs.rmSync.js.map
|
677
|
-
|
678
|
-
/***/ }),
|
679
|
-
|
680
|
-
/***/ 60332:
|
681
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
682
|
-
|
683
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
684
|
-
/* harmony export */ "N": () => (/* binding */ transformCodebase)
|
685
|
-
/* harmony export */ });
|
686
|
-
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
|
687
|
-
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
688
|
-
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
|
689
|
-
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
690
|
-
/* harmony import */ var _crawl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73036);
|
691
|
-
/* harmony import */ var _tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(89693);
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
/**
|
697
|
-
* Apply a transformation function to every file of directory
|
698
|
-
* If source and destination are the same this function can be used to apply the transformation in place
|
699
|
-
* like filtering out some files or modifying them.
|
700
|
-
* */
|
701
|
-
function transformCodebase(params) {
|
702
|
-
const { srcDirPath, transformSourceCode } = params;
|
703
|
-
const isTargetSameAsSource = path__WEBPACK_IMPORTED_MODULE_1__.relative(srcDirPath, params.destDirPath) === "";
|
704
|
-
const destDirPath = isTargetSameAsSource
|
705
|
-
? path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, "..", "tmp_xOsPdkPsTdzPs34sOkHs")
|
706
|
-
: params.destDirPath;
|
707
|
-
fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(destDirPath, {
|
708
|
-
recursive: true
|
709
|
-
});
|
710
|
-
for (const fileRelativePath of (0,_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
|
711
|
-
dirPath: srcDirPath,
|
712
|
-
returnedPathsType: "relative to dirPath"
|
713
|
-
})) {
|
714
|
-
const filePath = path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, fileRelativePath);
|
715
|
-
const destFilePath = path__WEBPACK_IMPORTED_MODULE_1__.join(destDirPath, fileRelativePath);
|
716
|
-
// NOTE: Optimization, if we don't need to transform the file, just copy
|
717
|
-
// it using the lower level implementation.
|
718
|
-
if (transformSourceCode === undefined) {
|
719
|
-
fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
|
720
|
-
recursive: true
|
721
|
-
});
|
722
|
-
fs__WEBPACK_IMPORTED_MODULE_0__.copyFileSync(filePath, destFilePath);
|
723
|
-
continue;
|
724
|
-
}
|
725
|
-
const transformSourceCodeResult = transformSourceCode({
|
726
|
-
sourceCode: fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(filePath),
|
727
|
-
filePath,
|
728
|
-
fileRelativePath
|
729
|
-
});
|
730
|
-
if (transformSourceCodeResult === undefined) {
|
731
|
-
continue;
|
732
|
-
}
|
733
|
-
fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
|
734
|
-
recursive: true
|
735
|
-
});
|
736
|
-
const { newFileName, modifiedSourceCode } = transformSourceCodeResult;
|
737
|
-
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);
|
738
|
-
}
|
739
|
-
if (isTargetSameAsSource) {
|
740
|
-
(0,_tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__/* .rmSync */ .a)(srcDirPath, { recursive: true });
|
741
|
-
fs__WEBPACK_IMPORTED_MODULE_0__.renameSync(destDirPath, srcDirPath);
|
742
|
-
}
|
743
|
-
}
|
744
|
-
//# sourceMappingURL=transformCodebase.js.map
|
745
|
-
|
746
785
|
/***/ })
|
747
786
|
|
748
787
|
};
|