keycloakify 11.4.0-rc.0 → 11.4.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 +2 -0
- package/account/i18n/noJsx/getI18n.js +5 -7
- package/account/i18n/noJsx/getI18n.js.map +1 -1
- package/account/i18n/withJsx/useI18n.js +15 -4
- package/account/i18n/withJsx/useI18n.js.map +1 -1
- package/bin/20.index.js +0 -85
- package/bin/33.index.js +55 -212
- package/bin/356.index.js +106 -45
- package/bin/36.index.js +1 -2922
- package/bin/{526.index.js → 392.index.js} +107 -3
- package/bin/40.index.js +1 -86
- package/bin/453.index.js +85 -22
- package/bin/573.index.js +5 -86
- package/bin/653.index.js +752 -0
- package/bin/658.index.js +197 -0
- package/bin/735.index.js +343 -116
- package/bin/786.index.js +78 -14
- package/bin/805.index.js +15 -18
- package/bin/921.index.js +79 -18
- package/bin/97.index.js +64 -13
- package/bin/main.js +165 -86
- package/bin/shared/constants.d.ts +2 -0
- package/bin/shared/constants.js +3 -1
- package/bin/shared/constants.js.map +1 -1
- package/bin/start-keycloak/startViteDevServer.d.ts +8 -0
- package/bin/tools/crawlAsync.d.ts +1 -1
- package/bin/tools/isTrackedByGit.d.ts +3 -0
- package/bin/tools/runPrettier.d.ts +5 -5
- package/bin/tools/untrackFromGit.d.ts +3 -0
- package/lib/getKcClsx.js +1 -2
- package/lib/getKcClsx.js.map +1 -1
- package/login/KcContext/KcContext.d.ts +2 -2
- package/login/KcContext/kcContextMocks.d.ts +1 -1
- package/login/TemplateProps.d.ts +0 -1
- package/login/i18n/noJsx/getI18n.js +5 -7
- package/login/i18n/noJsx/getI18n.js.map +1 -1
- package/login/i18n/withJsx/useI18n.js +15 -4
- package/login/i18n/withJsx/useI18n.js.map +1 -1
- package/login/pages/LoginConfigTotp.js +1 -1
- package/login/pages/LoginConfigTotp.js.map +1 -1
- package/login/pages/LoginPasskeysConditionalAuthenticate.js +16 -18
- package/login/pages/LoginPasskeysConditionalAuthenticate.js.map +1 -1
- package/package.json +17 -7
- package/src/account/i18n/noJsx/getI18n.tsx +5 -7
- package/src/account/i18n/withJsx/useI18n.tsx +18 -4
- package/src/bin/eject-page.ts +28 -10
- package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +3 -18
- package/src/bin/initialize-account-theme/updateAccountThemeImplementationInConfig.ts +1 -2
- package/src/bin/keycloakify/generateFtl/generateFtl.ts +6 -1
- package/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl +39 -0
- package/src/bin/keycloakify/generateResources/generateResources.ts +6 -2
- package/src/bin/main.ts +51 -4
- package/src/bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.ts +30 -19
- package/src/bin/postinstall/installUiModulesPeerDependencies.ts +3 -3
- package/src/bin/postinstall/managedGitignoreFile.ts +4 -3
- package/src/bin/postinstall/postinstall.ts +24 -2
- package/src/bin/postinstall/uiModuleMeta.ts +14 -9
- package/src/bin/shared/buildContext.ts +1 -2
- package/src/bin/shared/constants.ts +4 -1
- package/src/bin/start-keycloak/myrealm-realm-25.json +21 -34
- package/src/bin/start-keycloak/myrealm-realm-26.json +32 -35
- package/src/bin/start-keycloak/start-keycloak.ts +94 -1
- package/src/bin/start-keycloak/startViteDevServer.ts +66 -0
- package/src/bin/tools/crawlAsync.ts +6 -6
- package/src/bin/tools/isTrackedByGit.ts +29 -0
- package/src/bin/tools/listInstalledModules.ts +1 -2
- package/src/bin/tools/npmInstall.ts +396 -1
- package/src/bin/tools/runPrettier.ts +63 -14
- package/src/bin/tools/untrackFromGit.ts +24 -0
- package/src/bin/tsconfig.json +1 -1
- package/src/bin/update-kc-gen.ts +17 -2
- package/src/lib/getKcClsx.ts +1 -2
- package/src/login/KcContext/KcContext.ts +2 -2
- package/src/login/KcContext/kcContextMocks.ts +1 -1
- package/src/login/TemplateProps.ts +0 -1
- package/src/login/i18n/noJsx/getI18n.tsx +5 -7
- package/src/login/i18n/withJsx/useI18n.tsx +18 -4
- package/src/login/pages/LoginConfigTotp.tsx +18 -20
- package/src/login/pages/LoginPasskeysConditionalAuthenticate.tsx +51 -52
- package/src/tools/StatefulObservable/StatefulObservable.ts +1 -2
- package/src/tools/deepAssign.ts +1 -2
- package/src/tools/extractLastParenthesisContent.ts +43 -0
- package/src/vite-plugin/vite-plugin.ts +67 -0
- package/stories/login/pages/Info.stories.tsx +3 -39
- package/tools/StatefulObservable/StatefulObservable.js +1 -2
- package/tools/StatefulObservable/StatefulObservable.js.map +1 -1
- package/tools/deepAssign.js +1 -2
- package/tools/deepAssign.js.map +1 -1
- package/tools/extractLastParenthesisContent.d.ts +6 -0
- package/tools/extractLastParenthesisContent.js +36 -0
- package/tools/extractLastParenthesisContent.js.map +1 -0
- package/vite-plugin/index.js +326 -186
- package/bin/124.index.js +0 -348
- package/stories/login/pages/LoginDeviceVerifyUserCode.stories.tsx +0 -18
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
|
-
exports.id =
|
3
|
-
exports.ids = [
|
2
|
+
exports.id = 392;
|
3
|
+
exports.ids = [392];
|
4
4
|
exports.modules = {
|
5
5
|
|
6
|
-
/***/
|
6
|
+
/***/ 18392:
|
7
7
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
8
8
|
|
9
9
|
// ESM COMPAT FLAG
|
@@ -191,6 +191,48 @@ var fs_existsAsync = __webpack_require__(43765);
|
|
191
191
|
var fs_rm = __webpack_require__(8699);
|
192
192
|
// EXTERNAL MODULE: ./dist/bin/tools/downloadAndExtractArchive.js
|
193
193
|
var downloadAndExtractArchive = __webpack_require__(38367);
|
194
|
+
;// CONCATENATED MODULE: ./dist/bin/start-keycloak/startViteDevServer.js
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
(0,assert/* assert */.h)();
|
201
|
+
function startViteDevServer(params) {
|
202
|
+
const { buildContext } = params;
|
203
|
+
console.log(source_default().blue(`$ npx vite dev`));
|
204
|
+
const child = external_child_process_.spawn("npx", ["vite", "dev"], {
|
205
|
+
cwd: buildContext.projectDirPath,
|
206
|
+
env: Object.assign(Object.assign({}, process.env), { [constants/* VITE_PLUGIN_SUB_SCRIPTS_ENV_NAMES.READ_KC_CONTEXT_FROM_URL */.TE.READ_KC_CONTEXT_FROM_URL]: "true" }),
|
207
|
+
shell: true
|
208
|
+
});
|
209
|
+
child.stdout.on("data", data => {
|
210
|
+
if (!data.toString("utf8").includes("[vite] hmr")) {
|
211
|
+
return;
|
212
|
+
}
|
213
|
+
process.stdout.write(data);
|
214
|
+
});
|
215
|
+
child.stderr.on("data", data => process.stderr.write(data));
|
216
|
+
const dPort = new Deferred.Deferred();
|
217
|
+
{
|
218
|
+
const onData = (data) => {
|
219
|
+
//Local: http://localhost:8083/
|
220
|
+
const match = data
|
221
|
+
.toString("utf8")
|
222
|
+
.match(/Local:\s*http:\/\/(?:localhost|127\.0\.0\.1):(\d+)\//);
|
223
|
+
if (match === null) {
|
224
|
+
return;
|
225
|
+
}
|
226
|
+
child.stdout.off("data", onData);
|
227
|
+
const port = parseInt(match[1]);
|
228
|
+
(0,assert/* assert */.h)(!isNaN(port));
|
229
|
+
dPort.resolve(port);
|
230
|
+
};
|
231
|
+
child.stdout.on("data", onData);
|
232
|
+
}
|
233
|
+
return dPort.pr.then(port => ({ port }));
|
234
|
+
}
|
235
|
+
//# sourceMappingURL=startViteDevServer.js.map
|
194
236
|
;// CONCATENATED MODULE: ./dist/bin/start-keycloak/start-keycloak.js
|
195
237
|
|
196
238
|
|
@@ -212,6 +254,7 @@ var downloadAndExtractArchive = __webpack_require__(38367);
|
|
212
254
|
|
213
255
|
|
214
256
|
|
257
|
+
|
215
258
|
|
216
259
|
|
217
260
|
async function command(params) {
|
@@ -428,12 +471,47 @@ async function command(params) {
|
|
428
471
|
catch (_h) { }
|
429
472
|
const DEFAULT_PORT = 8080;
|
430
473
|
const port = (_c = (_b = cliCommandOptions.port) !== null && _b !== void 0 ? _b : buildContext.startKeycloakOptions.port) !== null && _c !== void 0 ? _c : DEFAULT_PORT;
|
474
|
+
const doStartDevServer = (() => {
|
475
|
+
const hasSpaUi = buildContext.implementedThemeTypes.admin.isImplemented ||
|
476
|
+
(buildContext.implementedThemeTypes.account.isImplemented &&
|
477
|
+
buildContext.implementedThemeTypes.account.type === "Single-Page");
|
478
|
+
if (!hasSpaUi) {
|
479
|
+
return false;
|
480
|
+
}
|
481
|
+
if (buildContext.bundler !== "vite") {
|
482
|
+
console.log(source_default().yellow([
|
483
|
+
`WARNING: Since you are using ${buildContext.bundler} instead of Vite,`,
|
484
|
+
`you'll have to wait serval seconds for the changes you made on your account or admin theme to be reflected in the browser.\n`,
|
485
|
+
`For a better development experience, consider migrating to Vite.`
|
486
|
+
].join(" ")));
|
487
|
+
return false;
|
488
|
+
}
|
489
|
+
if (keycloakMajorVersionNumber < 25) {
|
490
|
+
console.log(source_default().yellow([
|
491
|
+
`WARNING: Your account or admin theme can't be tested with hot module replacement on Keycloak ${keycloakMajorVersionNumber}.`,
|
492
|
+
`This mean that you'll have to wait serval seconds for the changes to be reflected in the browser.`,
|
493
|
+
`For a better development experience, select a more recent version of Keycloak.`
|
494
|
+
].join("\n")));
|
495
|
+
return false;
|
496
|
+
}
|
497
|
+
return true;
|
498
|
+
})();
|
499
|
+
let devServerPort = undefined;
|
500
|
+
if (doStartDevServer) {
|
501
|
+
const { port } = await startViteDevServer({ buildContext });
|
502
|
+
devServerPort = port;
|
503
|
+
}
|
431
504
|
const SPACE_PLACEHOLDER = "SPACE_PLACEHOLDER_xKLmdPd";
|
432
505
|
const dockerRunArgs = [
|
433
506
|
`-p${SPACE_PLACEHOLDER}${port}:8080`,
|
434
507
|
`--name${SPACE_PLACEHOLDER}${constants/* CONTAINER_NAME */.sv}`,
|
435
508
|
`-e${SPACE_PLACEHOLDER}KEYCLOAK_ADMIN=admin`,
|
436
509
|
`-e${SPACE_PLACEHOLDER}KEYCLOAK_ADMIN_PASSWORD=admin`,
|
510
|
+
...(devServerPort === undefined
|
511
|
+
? []
|
512
|
+
: [
|
513
|
+
`-e${SPACE_PLACEHOLDER}${constants/* KEYCLOAKIFY_SPA_DEV_SERVER_PORT */.Sz}=${devServerPort}`
|
514
|
+
]),
|
437
515
|
...(buildContext.startKeycloakOptions.dockerExtraArgs.length === 0
|
438
516
|
? []
|
439
517
|
: [
|
@@ -566,6 +644,32 @@ async function command(params) {
|
|
566
644
|
ignoreInitial: true
|
567
645
|
})
|
568
646
|
.on("all", async (...[, filePath]) => {
|
647
|
+
ignore_account_spa: {
|
648
|
+
const doImplementAccountSpa = buildContext.implementedThemeTypes.account.isImplemented &&
|
649
|
+
buildContext.implementedThemeTypes.account.type === "Single-Page";
|
650
|
+
if (!doImplementAccountSpa) {
|
651
|
+
break ignore_account_spa;
|
652
|
+
}
|
653
|
+
if (!(0,isInside/* isInside */.V)({
|
654
|
+
dirPath: (0,external_path_.join)(buildContext.themeSrcDirPath, "account"),
|
655
|
+
filePath
|
656
|
+
})) {
|
657
|
+
break ignore_account_spa;
|
658
|
+
}
|
659
|
+
return;
|
660
|
+
}
|
661
|
+
ignore_admin: {
|
662
|
+
if (!buildContext.implementedThemeTypes.admin.isImplemented) {
|
663
|
+
break ignore_admin;
|
664
|
+
}
|
665
|
+
if (!(0,isInside/* isInside */.V)({
|
666
|
+
dirPath: (0,external_path_.join)(buildContext.themeSrcDirPath, "admin"),
|
667
|
+
filePath
|
668
|
+
})) {
|
669
|
+
break ignore_admin;
|
670
|
+
}
|
671
|
+
return;
|
672
|
+
}
|
569
673
|
console.log(`Detected changes in ${filePath}`);
|
570
674
|
await waitForDebounce();
|
571
675
|
runFullBuild();
|
package/bin/40.index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
exports.id = 40;
|
3
|
-
exports.ids = [40];
|
3
|
+
exports.ids = [40,658];
|
4
4
|
exports.modules = {
|
5
5
|
|
6
6
|
/***/ 18040:
|
@@ -155,91 +155,6 @@ function maybeDelegateCommandToCustomHandler(params) {
|
|
155
155
|
|
156
156
|
/***/ }),
|
157
157
|
|
158
|
-
/***/ 12171:
|
159
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
160
|
-
|
161
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
162
|
-
/* harmony export */ "h": () => (/* binding */ SemVer)
|
163
|
-
/* harmony export */ });
|
164
|
-
var SemVer;
|
165
|
-
(function (SemVer) {
|
166
|
-
const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
|
167
|
-
function parse(versionStr) {
|
168
|
-
const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
|
169
|
-
if (!match) {
|
170
|
-
throw new Error(`${versionStr} is not a valid semantic version`);
|
171
|
-
}
|
172
|
-
const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
|
173
|
-
const str = match[3];
|
174
|
-
return str === undefined ? 0 : parseInt(str);
|
175
|
-
})() }, (() => {
|
176
|
-
const str = match[4];
|
177
|
-
return str === undefined ? {} : { rc: parseInt(str) };
|
178
|
-
})());
|
179
|
-
const initialStr = stringify(semVer);
|
180
|
-
Object.defineProperty(semVer, "parsedFrom", {
|
181
|
-
enumerable: true,
|
182
|
-
get: function () {
|
183
|
-
const currentStr = stringify(this);
|
184
|
-
if (currentStr !== initialStr) {
|
185
|
-
throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
|
186
|
-
}
|
187
|
-
return versionStr;
|
188
|
-
}
|
189
|
-
});
|
190
|
-
return semVer;
|
191
|
-
}
|
192
|
-
SemVer.parse = parse;
|
193
|
-
function stringify(v) {
|
194
|
-
return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
|
195
|
-
}
|
196
|
-
SemVer.stringify = stringify;
|
197
|
-
/**
|
198
|
-
*
|
199
|
-
* v1 < v2 => -1
|
200
|
-
* v1 === v2 => 0
|
201
|
-
* v1 > v2 => 1
|
202
|
-
*
|
203
|
-
*/
|
204
|
-
function compare(v1, v2) {
|
205
|
-
const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
|
206
|
-
const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
|
207
|
-
for (const level of ["major", "minor", "patch", "rc"]) {
|
208
|
-
if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
|
209
|
-
return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
|
210
|
-
}
|
211
|
-
}
|
212
|
-
return 0;
|
213
|
-
}
|
214
|
-
SemVer.compare = compare;
|
215
|
-
/*
|
216
|
-
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
|
217
|
-
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
|
218
|
-
console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
|
219
|
-
*/
|
220
|
-
function bumpType(params) {
|
221
|
-
const versionAhead = typeof params.versionAhead === "string"
|
222
|
-
? parse(params.versionAhead)
|
223
|
-
: params.versionAhead;
|
224
|
-
const versionBehind = typeof params.versionBehind === "string"
|
225
|
-
? parse(params.versionBehind)
|
226
|
-
: params.versionBehind;
|
227
|
-
if (compare(versionBehind, versionAhead) === 1) {
|
228
|
-
throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
|
229
|
-
}
|
230
|
-
for (const level of ["major", "minor", "patch", "rc"]) {
|
231
|
-
if (versionBehind[level] !== versionAhead[level]) {
|
232
|
-
return level;
|
233
|
-
}
|
234
|
-
}
|
235
|
-
return "no bump";
|
236
|
-
}
|
237
|
-
SemVer.bumpType = bumpType;
|
238
|
-
})(SemVer || (SemVer = {}));
|
239
|
-
//# sourceMappingURL=SemVer.js.map
|
240
|
-
|
241
|
-
/***/ }),
|
242
|
-
|
243
158
|
/***/ 89693:
|
244
159
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
245
160
|
|
package/bin/453.index.js
CHANGED
@@ -69,21 +69,24 @@ async function command(params) {
|
|
69
69
|
});
|
70
70
|
return value;
|
71
71
|
})();
|
72
|
-
if (themeType === "admin"
|
73
|
-
(
|
74
|
-
|
75
|
-
|
76
|
-
|
72
|
+
if (themeType === "admin") {
|
73
|
+
console.log("Use `npx keycloakify eject-file` command instead, see documentation");
|
74
|
+
process.exit(-1);
|
75
|
+
}
|
76
|
+
if (themeType === "account" &&
|
77
|
+
((0,tsafe_assert__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .h)(buildContext.implementedThemeTypes.account.isImplemented),
|
78
|
+
buildContext.implementedThemeTypes.account.type === "Single-Page")) {
|
79
|
+
const srcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_4__.join)((0,path__WEBPACK_IMPORTED_MODULE_4__.dirname)(buildContext.packageJsonFilePath), "node_modules", "@keycloakify", `keycloak-account-ui`, "src");
|
77
80
|
console.log([
|
78
|
-
`There isn't an interactive CLI to eject components of the
|
81
|
+
`There isn't an interactive CLI to eject components of the Account SPA UI.`,
|
79
82
|
`You can however copy paste into your codebase the any file or directory from the following source directory:`,
|
80
83
|
``,
|
81
84
|
`${chalk__WEBPACK_IMPORTED_MODULE_6___default().bold((0,path__WEBPACK_IMPORTED_MODULE_4__.join)((0,path__WEBPACK_IMPORTED_MODULE_4__.relative)(process.cwd(), srcDirPath)))}`,
|
82
85
|
``
|
83
86
|
].join("\n"));
|
84
87
|
eject_entrypoint: {
|
85
|
-
const kcUiTsxFileRelativePath = `
|
86
|
-
const themeSrcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_4__.join)(buildContext.themeSrcDirPath,
|
88
|
+
const kcUiTsxFileRelativePath = `KcAccountUi.tsx`;
|
89
|
+
const themeSrcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_4__.join)(buildContext.themeSrcDirPath, "account");
|
87
90
|
const targetFilePath = (0,path__WEBPACK_IMPORTED_MODULE_4__.join)(themeSrcDirPath, kcUiTsxFileRelativePath);
|
88
91
|
if (fs__WEBPACK_IMPORTED_MODULE_3__.existsSync(targetFilePath)) {
|
89
92
|
break eject_entrypoint;
|
@@ -93,7 +96,16 @@ async function command(params) {
|
|
93
96
|
const kcPageTsxFilePath = (0,path__WEBPACK_IMPORTED_MODULE_4__.join)(themeSrcDirPath, "KcPage.tsx");
|
94
97
|
const kcPageTsxCode = fs__WEBPACK_IMPORTED_MODULE_3__.readFileSync(kcPageTsxFilePath).toString("utf8");
|
95
98
|
const componentName = (0,path__WEBPACK_IMPORTED_MODULE_4__.basename)(kcUiTsxFileRelativePath).replace(/.tsx$/, "");
|
96
|
-
|
99
|
+
let modifiedKcPageTsxCode = kcPageTsxCode.replace(`@keycloakify/keycloak-account-ui/${componentName}`, `./${componentName}`);
|
100
|
+
run_prettier: {
|
101
|
+
if (!(await (0,_tools_runPrettier__WEBPACK_IMPORTED_MODULE_8__/* .getIsPrettierAvailable */ .MT)())) {
|
102
|
+
break run_prettier;
|
103
|
+
}
|
104
|
+
modifiedKcPageTsxCode = await (0,_tools_runPrettier__WEBPACK_IMPORTED_MODULE_8__/* .runPrettier */ .eY)({
|
105
|
+
filePath: kcPageTsxFilePath,
|
106
|
+
sourceCode: modifiedKcPageTsxCode
|
107
|
+
});
|
108
|
+
}
|
97
109
|
fs__WEBPACK_IMPORTED_MODULE_3__.writeFileSync(kcPageTsxFilePath, Buffer.from(modifiedKcPageTsxCode, "utf8"));
|
98
110
|
}
|
99
111
|
const routesTsxFilePath = (0,path__WEBPACK_IMPORTED_MODULE_4__.relative)(process.cwd(), (0,path__WEBPACK_IMPORTED_MODULE_4__.join)(srcDirPath, "routes.tsx"));
|
@@ -381,8 +393,8 @@ function getNodeModulesBinDirPath() {
|
|
381
393
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
382
394
|
|
383
395
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
396
|
+
/* harmony export */ "LG": () => (/* binding */ getPrettier),
|
384
397
|
/* harmony export */ "MT": () => (/* binding */ getIsPrettierAvailable),
|
385
|
-
/* harmony export */ "cI": () => (/* binding */ getPrettierAndConfig),
|
386
398
|
/* harmony export */ "eY": () => (/* binding */ runPrettier)
|
387
399
|
/* harmony export */ });
|
388
400
|
/* harmony import */ var _nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73776);
|
@@ -390,17 +402,24 @@ function getNodeModulesBinDirPath() {
|
|
390
402
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
391
403
|
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73292);
|
392
404
|
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_2__);
|
393
|
-
/* harmony import */ var
|
405
|
+
/* harmony import */ var tsafe_id__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(38469);
|
394
406
|
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29041);
|
395
407
|
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(78818);
|
396
408
|
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_4__);
|
409
|
+
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6113);
|
410
|
+
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_5__);
|
411
|
+
/* harmony import */ var tsafe_symToStr__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(76030);
|
412
|
+
/* harmony import */ var _readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(64795);
|
413
|
+
|
397
414
|
|
398
415
|
|
399
416
|
|
400
417
|
|
401
418
|
|
402
419
|
|
403
|
-
|
420
|
+
|
421
|
+
|
422
|
+
getIsPrettierAvailable.cache = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_7__.id)(undefined);
|
404
423
|
async function getIsPrettierAvailable() {
|
405
424
|
var _a;
|
406
425
|
if (getIsPrettierAvailable.cache !== undefined) {
|
@@ -413,26 +432,53 @@ async function getIsPrettierAvailable() {
|
|
413
432
|
getIsPrettierAvailable.cache = isPrettierAvailable;
|
414
433
|
return isPrettierAvailable;
|
415
434
|
}
|
416
|
-
|
417
|
-
async function
|
435
|
+
getPrettier.cache = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_7__.id)(undefined);
|
436
|
+
async function getPrettier() {
|
418
437
|
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .h)(getIsPrettierAvailable());
|
419
|
-
if (
|
420
|
-
return
|
438
|
+
if (getPrettier.cache !== undefined) {
|
439
|
+
return getPrettier.cache;
|
421
440
|
}
|
422
|
-
|
441
|
+
let prettier = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_7__.id)(undefined);
|
442
|
+
import_prettier: {
|
443
|
+
// NOTE: When module is linked we want to make sure we import the correct version
|
444
|
+
// of prettier, that is the one of the project, not the one of this repo.
|
445
|
+
// So we do a sketchy eval to bypass ncc.
|
446
|
+
// We make sure to only do that when linking, otherwise we import properly.
|
447
|
+
if ((0,_readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_6__/* .readThisNpmPackageVersion */ .K)().startsWith("0.0.0")) {
|
448
|
+
eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_8__/* .symToStr */ .r)({ prettier })} = require("${(0,path__WEBPACK_IMPORTED_MODULE_1__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)(), "..", "prettier"))}")`);
|
449
|
+
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .h)(!(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__.is)(prettier));
|
450
|
+
break import_prettier;
|
451
|
+
}
|
452
|
+
prettier = await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 79421, 23));
|
453
|
+
}
|
454
|
+
const configHash = await (async () => {
|
455
|
+
const configFilePath = await prettier.resolveConfigFile((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)(), ".."));
|
456
|
+
if (configFilePath === null) {
|
457
|
+
return "";
|
458
|
+
}
|
459
|
+
const data = await fs_promises__WEBPACK_IMPORTED_MODULE_2__.readFile(configFilePath);
|
460
|
+
return crypto__WEBPACK_IMPORTED_MODULE_5__.createHash("sha256").update(data).digest("hex");
|
461
|
+
})();
|
423
462
|
const prettierAndConfig = {
|
424
463
|
prettier,
|
425
|
-
|
464
|
+
configHash
|
426
465
|
};
|
427
|
-
|
466
|
+
getPrettier.cache = prettierAndConfig;
|
428
467
|
return prettierAndConfig;
|
429
468
|
}
|
430
469
|
async function runPrettier(params) {
|
431
470
|
const { sourceCode, filePath } = params;
|
432
471
|
let formattedSourceCode;
|
433
472
|
try {
|
434
|
-
const { prettier
|
435
|
-
|
473
|
+
const { prettier } = await getPrettier();
|
474
|
+
const { ignored, inferredParser } = await prettier.getFileInfo(filePath, {
|
475
|
+
resolveConfig: true
|
476
|
+
});
|
477
|
+
if (ignored) {
|
478
|
+
return sourceCode;
|
479
|
+
}
|
480
|
+
const config = await prettier.resolveConfig(filePath);
|
481
|
+
formattedSourceCode = await prettier.format(sourceCode, Object.assign(Object.assign({}, config), { filePath, parser: inferredParser !== null && inferredParser !== void 0 ? inferredParser : undefined }));
|
436
482
|
}
|
437
483
|
catch (error) {
|
438
484
|
console.log(chalk__WEBPACK_IMPORTED_MODULE_4___default().red(`You probably need to upgrade the version of prettier in your project`));
|
@@ -1021,7 +1067,6 @@ exports.withObjectValues = withObjectValues;
|
|
1021
1067
|
/* harmony export */ });
|
1022
1068
|
/** @see <https://docs.tsafe.dev/capitalize> */
|
1023
1069
|
function capitalize(str) {
|
1024
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
1025
1070
|
return (str.charAt(0).toUpperCase() + str.slice(1));
|
1026
1071
|
}
|
1027
1072
|
|
@@ -1029,6 +1074,24 @@ function capitalize(str) {
|
|
1029
1074
|
//# sourceMappingURL=capitalize.mjs.map
|
1030
1075
|
|
1031
1076
|
|
1077
|
+
/***/ }),
|
1078
|
+
|
1079
|
+
/***/ 76030:
|
1080
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
1081
|
+
|
1082
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
1083
|
+
/* harmony export */ "r": () => (/* binding */ symToStr)
|
1084
|
+
/* harmony export */ });
|
1085
|
+
/** @see <https://docs.tsafe.dev/main/symtostr> */
|
1086
|
+
function symToStr(wrap) {
|
1087
|
+
// @ts-expect-error: We know better
|
1088
|
+
return Object.keys(wrap)[0];
|
1089
|
+
}
|
1090
|
+
|
1091
|
+
|
1092
|
+
//# sourceMappingURL=symToStr.mjs.map
|
1093
|
+
|
1094
|
+
|
1032
1095
|
/***/ })
|
1033
1096
|
|
1034
1097
|
};
|
package/bin/573.index.js
CHANGED
@@ -602,6 +602,7 @@ function generateFtlFilesCodeFactory(params) {
|
|
602
602
|
.replace("{{themeVersion}}", buildContext.themeVersion)
|
603
603
|
.replace("{{fieldNames}}", fieldNames.map(name => `"${name}"`).join(", "))
|
604
604
|
.replace("{{RESOURCES_COMMON}}", constants/* WELL_KNOWN_DIRECTORY_BASE_NAME.RESOURCES_COMMON */.Ju.RESOURCES_COMMON)
|
605
|
+
.replace("{{KEYCLOAKIFY_SPA_DEV_SERVER_PORT}}", constants/* KEYCLOAKIFY_SPA_DEV_SERVER_PORT */.Sz)
|
605
606
|
.replace("{{userDefinedExclusions}}", (_a = buildContext.kcContextExclusionsFtlCode) !== null && _a !== void 0 ? _a : "");
|
606
607
|
const ftlObjectToJsCodeDeclaringAnObjectPlaceholder = '{ "x": "vIdLqMeOed9sdLdIdOxdK0d" }';
|
607
608
|
$("head").prepend(`<script>\n${ftlObjectToJsCodeDeclaringAnObjectPlaceholder}\n</script>`);
|
@@ -1022,7 +1023,10 @@ async function generateResources(params) {
|
|
1022
1023
|
? ["deprecatedMode=false"]
|
1023
1024
|
: []),
|
1024
1025
|
...((_a = buildContext.extraThemeProperties) !== null && _a !== void 0 ? _a : []),
|
1025
|
-
...
|
1026
|
+
...[
|
1027
|
+
...buildContext.environmentVariables,
|
1028
|
+
{ name: constants/* KEYCLOAKIFY_SPA_DEV_SERVER_PORT */.Sz, default: "" }
|
1029
|
+
].map(({ name, default: defaultValue }) => `${name}=\${env.${name}:${(0,escapeStringForPropertiesFile/* escapeStringForPropertiesFile */.y)(defaultValue)}}`),
|
1026
1030
|
...(languageTags === undefined
|
1027
1031
|
? []
|
1028
1032
|
: [`locales=${languageTags.join(",")}`])
|
@@ -1529,91 +1533,6 @@ async function command(params) {
|
|
1529
1533
|
|
1530
1534
|
/***/ }),
|
1531
1535
|
|
1532
|
-
/***/ 12171:
|
1533
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
1534
|
-
|
1535
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
1536
|
-
/* harmony export */ "h": () => (/* binding */ SemVer)
|
1537
|
-
/* harmony export */ });
|
1538
|
-
var SemVer;
|
1539
|
-
(function (SemVer) {
|
1540
|
-
const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
|
1541
|
-
function parse(versionStr) {
|
1542
|
-
const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
|
1543
|
-
if (!match) {
|
1544
|
-
throw new Error(`${versionStr} is not a valid semantic version`);
|
1545
|
-
}
|
1546
|
-
const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
|
1547
|
-
const str = match[3];
|
1548
|
-
return str === undefined ? 0 : parseInt(str);
|
1549
|
-
})() }, (() => {
|
1550
|
-
const str = match[4];
|
1551
|
-
return str === undefined ? {} : { rc: parseInt(str) };
|
1552
|
-
})());
|
1553
|
-
const initialStr = stringify(semVer);
|
1554
|
-
Object.defineProperty(semVer, "parsedFrom", {
|
1555
|
-
enumerable: true,
|
1556
|
-
get: function () {
|
1557
|
-
const currentStr = stringify(this);
|
1558
|
-
if (currentStr !== initialStr) {
|
1559
|
-
throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
|
1560
|
-
}
|
1561
|
-
return versionStr;
|
1562
|
-
}
|
1563
|
-
});
|
1564
|
-
return semVer;
|
1565
|
-
}
|
1566
|
-
SemVer.parse = parse;
|
1567
|
-
function stringify(v) {
|
1568
|
-
return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
|
1569
|
-
}
|
1570
|
-
SemVer.stringify = stringify;
|
1571
|
-
/**
|
1572
|
-
*
|
1573
|
-
* v1 < v2 => -1
|
1574
|
-
* v1 === v2 => 0
|
1575
|
-
* v1 > v2 => 1
|
1576
|
-
*
|
1577
|
-
*/
|
1578
|
-
function compare(v1, v2) {
|
1579
|
-
const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
|
1580
|
-
const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
|
1581
|
-
for (const level of ["major", "minor", "patch", "rc"]) {
|
1582
|
-
if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
|
1583
|
-
return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
|
1584
|
-
}
|
1585
|
-
}
|
1586
|
-
return 0;
|
1587
|
-
}
|
1588
|
-
SemVer.compare = compare;
|
1589
|
-
/*
|
1590
|
-
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
|
1591
|
-
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
|
1592
|
-
console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
|
1593
|
-
*/
|
1594
|
-
function bumpType(params) {
|
1595
|
-
const versionAhead = typeof params.versionAhead === "string"
|
1596
|
-
? parse(params.versionAhead)
|
1597
|
-
: params.versionAhead;
|
1598
|
-
const versionBehind = typeof params.versionBehind === "string"
|
1599
|
-
? parse(params.versionBehind)
|
1600
|
-
: params.versionBehind;
|
1601
|
-
if (compare(versionBehind, versionAhead) === 1) {
|
1602
|
-
throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
|
1603
|
-
}
|
1604
|
-
for (const level of ["major", "minor", "patch", "rc"]) {
|
1605
|
-
if (versionBehind[level] !== versionAhead[level]) {
|
1606
|
-
return level;
|
1607
|
-
}
|
1608
|
-
}
|
1609
|
-
return "no bump";
|
1610
|
-
}
|
1611
|
-
SemVer.bumpType = bumpType;
|
1612
|
-
})(SemVer || (SemVer = {}));
|
1613
|
-
//# sourceMappingURL=SemVer.js.map
|
1614
|
-
|
1615
|
-
/***/ }),
|
1616
|
-
|
1617
1536
|
/***/ 27190:
|
1618
1537
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
1619
1538
|
|