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.
Files changed (94) hide show
  1. package/README.md +2 -0
  2. package/account/i18n/noJsx/getI18n.js +5 -7
  3. package/account/i18n/noJsx/getI18n.js.map +1 -1
  4. package/account/i18n/withJsx/useI18n.js +15 -4
  5. package/account/i18n/withJsx/useI18n.js.map +1 -1
  6. package/bin/20.index.js +0 -85
  7. package/bin/33.index.js +55 -212
  8. package/bin/356.index.js +106 -45
  9. package/bin/36.index.js +1 -2922
  10. package/bin/{526.index.js → 392.index.js} +107 -3
  11. package/bin/40.index.js +1 -86
  12. package/bin/453.index.js +85 -22
  13. package/bin/573.index.js +5 -86
  14. package/bin/653.index.js +752 -0
  15. package/bin/658.index.js +197 -0
  16. package/bin/735.index.js +343 -116
  17. package/bin/786.index.js +78 -14
  18. package/bin/805.index.js +15 -18
  19. package/bin/921.index.js +79 -18
  20. package/bin/97.index.js +64 -13
  21. package/bin/main.js +165 -86
  22. package/bin/shared/constants.d.ts +2 -0
  23. package/bin/shared/constants.js +3 -1
  24. package/bin/shared/constants.js.map +1 -1
  25. package/bin/start-keycloak/startViteDevServer.d.ts +8 -0
  26. package/bin/tools/crawlAsync.d.ts +1 -1
  27. package/bin/tools/isTrackedByGit.d.ts +3 -0
  28. package/bin/tools/runPrettier.d.ts +5 -5
  29. package/bin/tools/untrackFromGit.d.ts +3 -0
  30. package/lib/getKcClsx.js +1 -2
  31. package/lib/getKcClsx.js.map +1 -1
  32. package/login/KcContext/KcContext.d.ts +2 -2
  33. package/login/KcContext/kcContextMocks.d.ts +1 -1
  34. package/login/TemplateProps.d.ts +0 -1
  35. package/login/i18n/noJsx/getI18n.js +5 -7
  36. package/login/i18n/noJsx/getI18n.js.map +1 -1
  37. package/login/i18n/withJsx/useI18n.js +15 -4
  38. package/login/i18n/withJsx/useI18n.js.map +1 -1
  39. package/login/pages/LoginConfigTotp.js +1 -1
  40. package/login/pages/LoginConfigTotp.js.map +1 -1
  41. package/login/pages/LoginPasskeysConditionalAuthenticate.js +16 -18
  42. package/login/pages/LoginPasskeysConditionalAuthenticate.js.map +1 -1
  43. package/package.json +17 -7
  44. package/src/account/i18n/noJsx/getI18n.tsx +5 -7
  45. package/src/account/i18n/withJsx/useI18n.tsx +18 -4
  46. package/src/bin/eject-page.ts +28 -10
  47. package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +3 -18
  48. package/src/bin/initialize-account-theme/updateAccountThemeImplementationInConfig.ts +1 -2
  49. package/src/bin/keycloakify/generateFtl/generateFtl.ts +6 -1
  50. package/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl +39 -0
  51. package/src/bin/keycloakify/generateResources/generateResources.ts +6 -2
  52. package/src/bin/main.ts +51 -4
  53. package/src/bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.ts +30 -19
  54. package/src/bin/postinstall/installUiModulesPeerDependencies.ts +3 -3
  55. package/src/bin/postinstall/managedGitignoreFile.ts +4 -3
  56. package/src/bin/postinstall/postinstall.ts +24 -2
  57. package/src/bin/postinstall/uiModuleMeta.ts +14 -9
  58. package/src/bin/shared/buildContext.ts +1 -2
  59. package/src/bin/shared/constants.ts +4 -1
  60. package/src/bin/start-keycloak/myrealm-realm-25.json +21 -34
  61. package/src/bin/start-keycloak/myrealm-realm-26.json +32 -35
  62. package/src/bin/start-keycloak/start-keycloak.ts +94 -1
  63. package/src/bin/start-keycloak/startViteDevServer.ts +66 -0
  64. package/src/bin/tools/crawlAsync.ts +6 -6
  65. package/src/bin/tools/isTrackedByGit.ts +29 -0
  66. package/src/bin/tools/listInstalledModules.ts +1 -2
  67. package/src/bin/tools/npmInstall.ts +396 -1
  68. package/src/bin/tools/runPrettier.ts +63 -14
  69. package/src/bin/tools/untrackFromGit.ts +24 -0
  70. package/src/bin/tsconfig.json +1 -1
  71. package/src/bin/update-kc-gen.ts +17 -2
  72. package/src/lib/getKcClsx.ts +1 -2
  73. package/src/login/KcContext/KcContext.ts +2 -2
  74. package/src/login/KcContext/kcContextMocks.ts +1 -1
  75. package/src/login/TemplateProps.ts +0 -1
  76. package/src/login/i18n/noJsx/getI18n.tsx +5 -7
  77. package/src/login/i18n/withJsx/useI18n.tsx +18 -4
  78. package/src/login/pages/LoginConfigTotp.tsx +18 -20
  79. package/src/login/pages/LoginPasskeysConditionalAuthenticate.tsx +51 -52
  80. package/src/tools/StatefulObservable/StatefulObservable.ts +1 -2
  81. package/src/tools/deepAssign.ts +1 -2
  82. package/src/tools/extractLastParenthesisContent.ts +43 -0
  83. package/src/vite-plugin/vite-plugin.ts +67 -0
  84. package/stories/login/pages/Info.stories.tsx +3 -39
  85. package/tools/StatefulObservable/StatefulObservable.js +1 -2
  86. package/tools/StatefulObservable/StatefulObservable.js.map +1 -1
  87. package/tools/deepAssign.js +1 -2
  88. package/tools/deepAssign.js.map +1 -1
  89. package/tools/extractLastParenthesisContent.d.ts +6 -0
  90. package/tools/extractLastParenthesisContent.js +36 -0
  91. package/tools/extractLastParenthesisContent.js.map +1 -0
  92. package/vite-plugin/index.js +326 -186
  93. package/bin/124.index.js +0 -348
  94. package/stories/login/pages/LoginDeviceVerifyUserCode.stories.tsx +0 -18
package/bin/124.index.js DELETED
@@ -1,348 +0,0 @@
1
- "use strict";
2
- exports.id = 124;
3
- exports.ids = [124];
4
- exports.modules = {
5
-
6
- /***/ 67124:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
- // ESM COMPAT FLAG
10
- __webpack_require__.r(__webpack_exports__);
11
-
12
- // EXPORTS
13
- __webpack_require__.d(__webpack_exports__, {
14
- "command": () => (/* reexport */ command)
15
- });
16
-
17
- // EXTERNAL MODULE: ./dist/bin/postinstall/uiModuleMeta.js + 2 modules
18
- var postinstall_uiModuleMeta = __webpack_require__(5038);
19
- // EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
20
- var assert = __webpack_require__(29041);
21
- // EXTERNAL MODULE: ./node_modules/tsafe/esm/is.mjs
22
- var is = __webpack_require__(16453);
23
- // EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
24
- var lib = __webpack_require__(52300);
25
- // EXTERNAL MODULE: ./node_modules/tsafe/esm/id.mjs
26
- var id = __webpack_require__(38469);
27
- // EXTERNAL MODULE: external "fs/promises"
28
- var promises_ = __webpack_require__(73292);
29
- // EXTERNAL MODULE: ./dist/bin/tools/SemVer.js
30
- var SemVer = __webpack_require__(12171);
31
- // EXTERNAL MODULE: ./node_modules/evt/tools/inDepth/same.js
32
- var same = __webpack_require__(33805);
33
- // EXTERNAL MODULE: ./dist/bin/tools/runPrettier.js
34
- var runPrettier = __webpack_require__(48433);
35
- // EXTERNAL MODULE: ./dist/bin/tools/npmInstall.js
36
- var npmInstall = __webpack_require__(50030);
37
- ;// CONCATENATED MODULE: ./dist/bin/postinstall/installUiModulesPeerDependencies.js
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
- (0,assert/* assert */.h)();
48
- (0,assert/* assert */.h)();
49
- async function installUiModulesPeerDependencies(params) {
50
- var _a, _b;
51
- const { buildContext, uiModuleMetas } = params;
52
- const { uiModulesPerDependencies } = (() => {
53
- const uiModulesPerDependencies = {};
54
- for (const { peerDependencies } of uiModuleMetas) {
55
- for (const [peerDependencyName, versionRange_candidate] of Object.entries(peerDependencies)) {
56
- const versionRange = (() => {
57
- const versionRange_current = uiModulesPerDependencies[peerDependencyName];
58
- if (versionRange_current === undefined) {
59
- return versionRange_candidate;
60
- }
61
- if (versionRange_current === "*") {
62
- return versionRange_candidate;
63
- }
64
- if (versionRange_candidate === "*") {
65
- return versionRange_current;
66
- }
67
- const { versionRange } = [
68
- versionRange_current,
69
- versionRange_candidate
70
- ]
71
- .map(versionRange => ({
72
- versionRange,
73
- semVer: SemVer/* SemVer.parse */.h.parse((() => {
74
- if (versionRange.startsWith("^") ||
75
- versionRange.startsWith("~")) {
76
- return versionRange.slice(1);
77
- }
78
- return versionRange;
79
- })())
80
- }))
81
- .sort((a, b) => SemVer/* SemVer.compare */.h.compare(b.semVer, a.semVer))[0];
82
- return versionRange;
83
- })();
84
- uiModulesPerDependencies[peerDependencyName] = versionRange;
85
- }
86
- }
87
- return { uiModulesPerDependencies };
88
- })();
89
- const parsedPackageJson = await (async () => {
90
- const zParsedPackageJson = (() => {
91
- const zParsedPackageJson = lib.z.object({
92
- dependencies: lib.z.record(lib.z.string()).optional(),
93
- devDependencies: lib.z.record(lib.z.string()).optional()
94
- });
95
- (0,assert/* assert */.h)();
96
- return (0,id.id)(zParsedPackageJson);
97
- })();
98
- const parsedPackageJson = JSON.parse((await promises_.readFile(buildContext.packageJsonFilePath)).toString("utf8"));
99
- zParsedPackageJson.parse(parsedPackageJson);
100
- (0,assert/* assert */.h)((0,is.is)(parsedPackageJson));
101
- return parsedPackageJson;
102
- })();
103
- const parsedPackageJson_before = JSON.parse(JSON.stringify(parsedPackageJson));
104
- for (const [moduleName, versionRange] of Object.entries(uiModulesPerDependencies)) {
105
- if (moduleName.startsWith("@types/")) {
106
- ((_a = parsedPackageJson.devDependencies) !== null && _a !== void 0 ? _a : (parsedPackageJson.devDependencies = {}))[moduleName] = versionRange;
107
- continue;
108
- }
109
- if (parsedPackageJson.devDependencies !== undefined) {
110
- delete parsedPackageJson.devDependencies[moduleName];
111
- }
112
- ((_b = parsedPackageJson.dependencies) !== null && _b !== void 0 ? _b : (parsedPackageJson.dependencies = {}))[moduleName] = versionRange;
113
- }
114
- if ((0,same.same)(parsedPackageJson, parsedPackageJson_before)) {
115
- return;
116
- }
117
- let packageJsonContentStr = JSON.stringify(parsedPackageJson, null, 2);
118
- format: {
119
- if (!(await (0,runPrettier/* getIsPrettierAvailable */.MT)())) {
120
- break format;
121
- }
122
- packageJsonContentStr = await (0,runPrettier/* runPrettier */.eY)({
123
- sourceCode: packageJsonContentStr,
124
- filePath: buildContext.packageJsonFilePath
125
- });
126
- }
127
- await promises_.writeFile(buildContext.packageJsonFilePath, packageJsonContentStr);
128
- (0,npmInstall/* npmInstall */.c)({
129
- packageJsonDirPath: buildContext.packageJsonFilePath
130
- });
131
- process.exit(0);
132
- }
133
- //# sourceMappingURL=installUiModulesPeerDependencies.js.map
134
- // EXTERNAL MODULE: ./dist/bin/postinstall/managedGitignoreFile.js
135
- var managedGitignoreFile = __webpack_require__(36843);
136
- // EXTERNAL MODULE: external "path"
137
- var external_path_ = __webpack_require__(71017);
138
- // EXTERNAL MODULE: ./dist/bin/tools/fs.existsAsync.js
139
- var fs_existsAsync = __webpack_require__(43765);
140
- ;// CONCATENATED MODULE: ./dist/bin/postinstall/postinstall.js
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
- async function command(params) {
149
- const { buildContext } = params;
150
- const uiModuleMetas = await (0,postinstall_uiModuleMeta/* getUiModuleMetas */.j)({ buildContext });
151
- await installUiModulesPeerDependencies({
152
- buildContext,
153
- uiModuleMetas
154
- });
155
- const { ejectedFilesRelativePaths } = await (0,managedGitignoreFile/* readManagedGitignoreFile */.w)({
156
- buildContext
157
- });
158
- await (0,managedGitignoreFile/* writeManagedGitignoreFile */.Y)({
159
- buildContext,
160
- ejectedFilesRelativePaths,
161
- uiModuleMetas
162
- });
163
- await Promise.all(uiModuleMetas
164
- .map(uiModuleMeta => Promise.all(uiModuleMeta.files.map(async ({ fileRelativePath, copyableFilePath, hash }) => {
165
- if (ejectedFilesRelativePaths.includes(fileRelativePath)) {
166
- return;
167
- }
168
- const destFilePath = (0,external_path_.join)(buildContext.themeSrcDirPath, fileRelativePath);
169
- skip_condition: {
170
- if (!(await (0,fs_existsAsync/* existsAsync */.o)(destFilePath))) {
171
- break skip_condition;
172
- }
173
- const destFileHash = (0,postinstall_uiModuleMeta/* computeHash */.x)(await promises_.readFile(destFilePath));
174
- if (destFileHash !== hash) {
175
- break skip_condition;
176
- }
177
- return;
178
- }
179
- {
180
- const dirName = (0,external_path_.dirname)(copyableFilePath);
181
- if (!(await (0,fs_existsAsync/* existsAsync */.o)(dirName))) {
182
- await promises_.mkdir(dirName, { recursive: true });
183
- }
184
- }
185
- await promises_.copyFile(copyableFilePath, destFilePath);
186
- })))
187
- .flat());
188
- }
189
- //# sourceMappingURL=postinstall.js.map
190
- ;// CONCATENATED MODULE: ./dist/bin/postinstall/index.js
191
-
192
- //# sourceMappingURL=index.js.map
193
-
194
- /***/ }),
195
-
196
- /***/ 12171:
197
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
198
-
199
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
200
- /* harmony export */ "h": () => (/* binding */ SemVer)
201
- /* harmony export */ });
202
- var SemVer;
203
- (function (SemVer) {
204
- const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
205
- function parse(versionStr) {
206
- const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
207
- if (!match) {
208
- throw new Error(`${versionStr} is not a valid semantic version`);
209
- }
210
- const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
211
- const str = match[3];
212
- return str === undefined ? 0 : parseInt(str);
213
- })() }, (() => {
214
- const str = match[4];
215
- return str === undefined ? {} : { rc: parseInt(str) };
216
- })());
217
- const initialStr = stringify(semVer);
218
- Object.defineProperty(semVer, "parsedFrom", {
219
- enumerable: true,
220
- get: function () {
221
- const currentStr = stringify(this);
222
- if (currentStr !== initialStr) {
223
- throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
224
- }
225
- return versionStr;
226
- }
227
- });
228
- return semVer;
229
- }
230
- SemVer.parse = parse;
231
- function stringify(v) {
232
- return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
233
- }
234
- SemVer.stringify = stringify;
235
- /**
236
- *
237
- * v1 < v2 => -1
238
- * v1 === v2 => 0
239
- * v1 > v2 => 1
240
- *
241
- */
242
- function compare(v1, v2) {
243
- const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
244
- const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
245
- for (const level of ["major", "minor", "patch", "rc"]) {
246
- if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
247
- return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
248
- }
249
- }
250
- return 0;
251
- }
252
- SemVer.compare = compare;
253
- /*
254
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
255
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
256
- console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
257
- */
258
- function bumpType(params) {
259
- const versionAhead = typeof params.versionAhead === "string"
260
- ? parse(params.versionAhead)
261
- : params.versionAhead;
262
- const versionBehind = typeof params.versionBehind === "string"
263
- ? parse(params.versionBehind)
264
- : params.versionBehind;
265
- if (compare(versionBehind, versionAhead) === 1) {
266
- throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
267
- }
268
- for (const level of ["major", "minor", "patch", "rc"]) {
269
- if (versionBehind[level] !== versionAhead[level]) {
270
- return level;
271
- }
272
- }
273
- return "no bump";
274
- }
275
- SemVer.bumpType = bumpType;
276
- })(SemVer || (SemVer = {}));
277
- //# sourceMappingURL=SemVer.js.map
278
-
279
- /***/ }),
280
-
281
- /***/ 50030:
282
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
283
-
284
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
285
- /* harmony export */ "c": () => (/* binding */ npmInstall)
286
- /* harmony export */ });
287
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
288
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
289
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
290
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
291
- /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32081);
292
- /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(child_process__WEBPACK_IMPORTED_MODULE_2__);
293
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78818);
294
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_3__);
295
-
296
-
297
-
298
-
299
- function npmInstall(params) {
300
- const { packageJsonDirPath } = params;
301
- const packageManagerBinName = (() => {
302
- const packageMangers = [
303
- {
304
- binName: "yarn",
305
- lockFileBasename: "yarn.lock"
306
- },
307
- {
308
- binName: "npm",
309
- lockFileBasename: "package-lock.json"
310
- },
311
- {
312
- binName: "pnpm",
313
- lockFileBasename: "pnpm-lock.yaml"
314
- },
315
- {
316
- binName: "bun",
317
- lockFileBasename: "bun.lockdb"
318
- },
319
- {
320
- binName: "deno",
321
- lockFileBasename: "deno.lock"
322
- }
323
- ];
324
- for (const packageManager of packageMangers) {
325
- if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(packageJsonDirPath, packageManager.lockFileBasename)) ||
326
- fs__WEBPACK_IMPORTED_MODULE_0__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(process.cwd(), packageManager.lockFileBasename))) {
327
- return packageManager.binName;
328
- }
329
- }
330
- throw new Error("No lock file found, cannot tell which package manager to use for installing dependencies.");
331
- })();
332
- console.log(`Installing the new dependencies...`);
333
- try {
334
- child_process__WEBPACK_IMPORTED_MODULE_2__.execSync(`${packageManagerBinName} install`, {
335
- cwd: packageJsonDirPath,
336
- stdio: "inherit"
337
- });
338
- }
339
- catch (_a) {
340
- console.log(chalk__WEBPACK_IMPORTED_MODULE_3___default().yellow(`\`${packageManagerBinName} install\` failed, continuing anyway...`));
341
- }
342
- }
343
- //# sourceMappingURL=npmInstall.js.map
344
-
345
- /***/ })
346
-
347
- };
348
- ;
@@ -1,18 +0,0 @@
1
- import React from "react";
2
- import type { Meta, StoryObj } from "@storybook/react";
3
- import { createKcPageStory } from "../KcPageStory";
4
-
5
- const { KcPageStory } = createKcPageStory({ pageId: "login-oauth2-device-verify-user-code.ftl" });
6
-
7
- const meta = {
8
- title: "login/login-oauth2-device-verify-user-code.ftl",
9
- component: KcPageStory
10
- } satisfies Meta<typeof KcPageStory>;
11
-
12
- export default meta;
13
-
14
- type Story = StoryObj<typeof meta>;
15
-
16
- export const Default: Story = {
17
- render: () => <KcPageStory />
18
- };