keycloakify 10.0.0-rc.38 → 10.0.0-rc.39

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 (81) hide show
  1. package/bin/193.index.js +13 -13
  2. package/bin/3.index.js +86 -86
  3. package/bin/322.index.js +595 -0
  4. package/bin/453.index.js +3 -3
  5. package/bin/526.index.js +42 -633
  6. package/bin/538.index.js +68 -57
  7. package/bin/932.index.js +7 -7
  8. package/bin/944.index.js +621 -0
  9. package/bin/961.index.js +5 -5
  10. package/bin/97.index.js +3 -3
  11. package/bin/{21.index.js → 98.index.js} +59 -48
  12. package/bin/main.js +8 -8
  13. package/lib/getKcClsx.js +12 -1
  14. package/lib/getKcClsx.js.map +1 -1
  15. package/login/Fallback.d.ts +1 -0
  16. package/login/Fallback.js.map +1 -1
  17. package/login/UserProfileFormFields.d.ts +1 -0
  18. package/login/UserProfileFormFields.js +1 -3
  19. package/login/UserProfileFormFields.js.map +1 -1
  20. package/login/i18n/i18n.js +1 -1
  21. package/login/pages/IdpReviewUserProfile.d.ts +1 -0
  22. package/login/pages/IdpReviewUserProfile.js +2 -2
  23. package/login/pages/IdpReviewUserProfile.js.map +1 -1
  24. package/login/pages/LoginUpdateProfile.d.ts +1 -0
  25. package/login/pages/LoginUpdateProfile.js +2 -2
  26. package/login/pages/LoginUpdateProfile.js.map +1 -1
  27. package/login/pages/Register.d.ts +1 -0
  28. package/login/pages/Register.js +2 -2
  29. package/login/pages/Register.js.map +1 -1
  30. package/login/pages/UpdateEmail.d.ts +1 -0
  31. package/login/pages/UpdateEmail.js +2 -2
  32. package/login/pages/UpdateEmail.js.map +1 -1
  33. package/package.json +5 -8
  34. package/src/bin/add-story.ts +3 -3
  35. package/src/bin/copy-keycloak-resources-to-public.ts +3 -3
  36. package/src/bin/download-keycloak-default-theme.ts +5 -5
  37. package/src/bin/eject-page.ts +3 -3
  38. package/src/bin/initialize-email-theme.ts +5 -5
  39. package/src/bin/keycloakify/buildJars/buildJar.ts +14 -14
  40. package/src/bin/keycloakify/buildJars/buildJars.ts +8 -8
  41. package/src/bin/keycloakify/buildJars/generatePom.ts +9 -9
  42. package/src/bin/keycloakify/generateFtl/generateFtl.ts +12 -12
  43. package/src/bin/keycloakify/generateSrcMainResources/bringInAccountV1.ts +7 -7
  44. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResources.ts +9 -9
  45. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForMainTheme.ts +25 -25
  46. package/src/bin/keycloakify/generateSrcMainResources/generateSrcMainResourcesForThemeVariant.ts +8 -8
  47. package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +9 -9
  48. package/src/bin/keycloakify/keycloakify.ts +11 -11
  49. package/src/bin/keycloakify/replacers/replaceImportsInCssCode.ts +6 -6
  50. package/src/bin/keycloakify/replacers/replaceImportsInInlineCssCode.ts +7 -7
  51. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.ts +10 -10
  52. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/vite.ts +13 -13
  53. package/src/bin/keycloakify/replacers/replaceImportsInJsCode/webpack.ts +11 -11
  54. package/src/bin/main.ts +2 -2
  55. package/src/bin/shared/{buildOptions.ts → buildContext.ts} +62 -51
  56. package/src/bin/shared/copyKeycloakResourcesToPublic.ts +12 -12
  57. package/src/bin/shared/downloadKeycloakDefaultTheme.ts +7 -7
  58. package/src/bin/shared/downloadKeycloakStaticResources.ts +7 -7
  59. package/src/bin/shared/generateKcGenTs.ts +12 -12
  60. package/src/bin/shared/getThemeSrcDirPath.ts +3 -3
  61. package/src/bin/start-keycloak/appBuild.ts +11 -11
  62. package/src/bin/start-keycloak/keycloakifyBuild.ts +7 -7
  63. package/src/bin/start-keycloak/start-keycloak.ts +34 -22
  64. package/src/bin/tools/getNpmWorkspaceRootDirPath.ts +3 -3
  65. package/src/bin/update-kc-gen.ts +3 -3
  66. package/src/lib/getKcClsx.ts +15 -1
  67. package/src/login/Fallback.tsx +1 -0
  68. package/src/login/UserProfileFormFields.tsx +2 -4
  69. package/src/login/i18n/i18n.tsx +1 -1
  70. package/src/login/pages/IdpReviewUserProfile.tsx +8 -2
  71. package/src/login/pages/LoginUpdateProfile.tsx +8 -2
  72. package/src/login/pages/Register.tsx +8 -2
  73. package/src/login/pages/UpdateEmail.tsx +8 -2
  74. package/src/vite-plugin/vite-plugin.ts +19 -19
  75. package/vite-plugin/index.js +91 -80
  76. package/vite-plugin/vite-plugin.d.ts +3 -3
  77. package/bin/795.index.js +0 -1198
  78. package/lib/isStorybook.d.ts +0 -1
  79. package/lib/isStorybook.js +0 -3
  80. package/lib/isStorybook.js.map +0 -1
  81. package/src/lib/isStorybook.ts +0 -3
@@ -0,0 +1,621 @@
1
+ "use strict";
2
+ exports.id = 944;
3
+ exports.ids = [944];
4
+ exports.modules = {
5
+
6
+ /***/ 87751:
7
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
+
9
+
10
+ // EXPORTS
11
+ __webpack_require__.d(__webpack_exports__, {
12
+ "s": () => (/* binding */ getBuildContext)
13
+ });
14
+
15
+ // EXTERNAL MODULE: external "url"
16
+ var external_url_ = __webpack_require__(57310);
17
+ // EXTERNAL MODULE: external "path"
18
+ var external_path_ = __webpack_require__(71017);
19
+ // EXTERNAL MODULE: ./dist/bin/tools/getAbsoluteAndInOsFormatPath.js
20
+ var getAbsoluteAndInOsFormatPath = __webpack_require__(86644);
21
+ // EXTERNAL MODULE: external "child_process"
22
+ var external_child_process_ = __webpack_require__(32081);
23
+ // EXTERNAL MODULE: ./node_modules/tsafe/assert.js
24
+ var assert = __webpack_require__(88078);
25
+ // EXTERNAL MODULE: external "fs"
26
+ var external_fs_ = __webpack_require__(57147);
27
+ ;// CONCATENATED MODULE: ./dist/bin/tools/getNpmWorkspaceRootDirPath.js
28
+
29
+
30
+
31
+
32
+ function getNpmWorkspaceRootDirPath(params) {
33
+ const { projectDirPath, dependencyExpected } = params;
34
+ const npmWorkspaceRootDirPath = (function callee(depth) {
35
+ const cwd = (0,external_path_.resolve)((0,external_path_.join)(...[projectDirPath, ...Array(depth).fill("..")]));
36
+ (0,assert.assert)(cwd !== external_path_.sep, "NPM workspace not found");
37
+ try {
38
+ external_child_process_.execSync("npm config get", {
39
+ cwd,
40
+ stdio: "ignore"
41
+ });
42
+ }
43
+ catch (error) {
44
+ if (String(error).includes("ENOWORKSPACES")) {
45
+ return callee(depth + 1);
46
+ }
47
+ throw error;
48
+ }
49
+ const packageJsonFilePath = (0,external_path_.join)(cwd, "package.json");
50
+ if (!external_fs_.existsSync(packageJsonFilePath)) {
51
+ return callee(depth + 1);
52
+ }
53
+ (0,assert.assert)(external_fs_.existsSync(packageJsonFilePath));
54
+ const parsedPackageJson = JSON.parse(external_fs_.readFileSync(packageJsonFilePath).toString("utf8"));
55
+ let isExpectedDependencyFound = false;
56
+ for (const dependenciesOrDevDependencies of [
57
+ "dependencies",
58
+ "devDependencies"
59
+ ]) {
60
+ const dependencies = parsedPackageJson[dependenciesOrDevDependencies];
61
+ if (dependencies === undefined) {
62
+ continue;
63
+ }
64
+ (0,assert.assert)(dependencies instanceof Object);
65
+ if (dependencies[dependencyExpected] === undefined) {
66
+ continue;
67
+ }
68
+ isExpectedDependencyFound = true;
69
+ }
70
+ if (!isExpectedDependencyFound && parsedPackageJson.name !== dependencyExpected) {
71
+ return callee(depth + 1);
72
+ }
73
+ return cwd;
74
+ })(0);
75
+ return { npmWorkspaceRootDirPath };
76
+ }
77
+ //# sourceMappingURL=getNpmWorkspaceRootDirPath.js.map
78
+ // EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
79
+ var lib = __webpack_require__(52300);
80
+ // EXTERNAL MODULE: ./node_modules/tsafe/index.js
81
+ var tsafe = __webpack_require__(1666);
82
+ // EXTERNAL MODULE: ./dist/bin/shared/constants.js
83
+ var constants = __webpack_require__(173);
84
+ ;// CONCATENATED MODULE: ./dist/bin/shared/buildContext.js
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+ function getBuildContext(params) {
95
+ var _a, _b, _c, _d, _e, _f;
96
+ const { cliCommandOptions } = params;
97
+ const projectDirPath = (() => {
98
+ if (cliCommandOptions.projectDirPath === undefined) {
99
+ return process.cwd();
100
+ }
101
+ return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
102
+ pathIsh: cliCommandOptions.projectDirPath,
103
+ cwd: process.cwd()
104
+ });
105
+ })();
106
+ const { resolvedViteConfig } = (() => {
107
+ if (external_fs_.readdirSync(projectDirPath)
108
+ .find(fileBasename => fileBasename.startsWith("vite.config")) ===
109
+ undefined) {
110
+ return { resolvedViteConfig: undefined };
111
+ }
112
+ const output = external_child_process_.execSync("npx vite", {
113
+ cwd: projectDirPath,
114
+ env: Object.assign(Object.assign({}, process.env), { [constants/* vitePluginSubScriptEnvNames.resolveViteConfig */.fe.resolveViteConfig]: "true" })
115
+ })
116
+ .toString("utf8");
117
+ (0,tsafe.assert)(output.includes(constants/* vitePluginSubScriptEnvNames.resolveViteConfig */.fe.resolveViteConfig), "Seems like the Keycloakify's Vite plugin is not installed.");
118
+ const resolvedViteConfigStr = output
119
+ .split(constants/* vitePluginSubScriptEnvNames.resolveViteConfig */.fe.resolveViteConfig)
120
+ .reverse()[0];
121
+ const resolvedViteConfig = JSON.parse(resolvedViteConfigStr);
122
+ return { resolvedViteConfig };
123
+ })();
124
+ const parsedPackageJson = (() => {
125
+ const zParsedPackageJson = lib.z.object({
126
+ name: lib.z.string(),
127
+ version: lib.z.string().optional(),
128
+ homepage: lib.z.string().optional(),
129
+ keycloakify: lib.z.object({
130
+ extraThemeProperties: lib.z.array(lib.z.string()).optional(),
131
+ artifactId: lib.z.string().optional(),
132
+ groupId: lib.z.string().optional(),
133
+ loginThemeResourcesFromKeycloakVersion: lib.z.string().optional(),
134
+ projectBuildDirPath: lib.z.string().optional(),
135
+ keycloakifyBuildDirPath: lib.z.string().optional(),
136
+ themeName: lib.z.union([lib.z.string(), lib.z.array(lib.z.string())]).optional()
137
+ })
138
+ .optional()
139
+ });
140
+ {
141
+ (0,tsafe.assert)();
142
+ (0,tsafe.assert)();
143
+ }
144
+ return zParsedPackageJson.parse(JSON.parse(external_fs_.readFileSync((0,external_path_.join)(projectDirPath, "package.json")).toString("utf8")));
145
+ })();
146
+ const buildOptions = Object.assign(Object.assign({}, parsedPackageJson.keycloakify), resolvedViteConfig === null || resolvedViteConfig === void 0 ? void 0 : resolvedViteConfig.buildOptions);
147
+ const themeNames = (() => {
148
+ if (buildOptions.themeName === undefined) {
149
+ return [
150
+ parsedPackageJson.name
151
+ .replace(/^@(.*)/, "$1")
152
+ .split("/")
153
+ .join("-")
154
+ ];
155
+ }
156
+ if (typeof buildOptions.themeName === "string") {
157
+ return [buildOptions.themeName];
158
+ }
159
+ return buildOptions.themeName;
160
+ })();
161
+ const projectBuildDirPath = (() => {
162
+ var _a;
163
+ webpack: {
164
+ if (resolvedViteConfig !== undefined) {
165
+ break webpack;
166
+ }
167
+ if (((_a = parsedPackageJson.keycloakify) === null || _a === void 0 ? void 0 : _a.projectBuildDirPath) !== undefined) {
168
+ return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
169
+ pathIsh: parsedPackageJson.keycloakify.projectBuildDirPath,
170
+ cwd: projectDirPath
171
+ });
172
+ }
173
+ return (0,external_path_.join)(projectDirPath, "build");
174
+ }
175
+ return (0,external_path_.join)(projectDirPath, resolvedViteConfig.buildDir);
176
+ })();
177
+ const { npmWorkspaceRootDirPath } = getNpmWorkspaceRootDirPath({
178
+ projectDirPath,
179
+ dependencyExpected: "keycloakify"
180
+ });
181
+ return {
182
+ bundler: resolvedViteConfig !== undefined ? "vite" : "webpack",
183
+ themeVersion: (_b = (_a = process.env.KEYCLOAKIFY_THEME_VERSION) !== null && _a !== void 0 ? _a : parsedPackageJson.version) !== null && _b !== void 0 ? _b : "0.0.0",
184
+ themeNames,
185
+ extraThemeProperties: buildOptions.extraThemeProperties,
186
+ groupId: (() => {
187
+ var _a, _b, _c, _d, _e;
188
+ const fallbackGroupId = `${themeNames[0]}.keycloak`;
189
+ return ((_b = (_a = process.env.KEYCLOAKIFY_GROUP_ID) !== null && _a !== void 0 ? _a : buildOptions.groupId) !== null && _b !== void 0 ? _b : (parsedPackageJson.homepage === undefined
190
+ ? fallbackGroupId
191
+ : (_e = (_d = (_c = (0,external_url_.parse)(parsedPackageJson.homepage)
192
+ .host) === null || _c === void 0 ? void 0 : _c.replace(/:[0-9]+$/, "")) === null || _d === void 0 ? void 0 : _d.split(".").reverse().join(".")) !== null && _e !== void 0 ? _e : fallbackGroupId) + ".keycloak");
193
+ })(),
194
+ artifactId: (_d = (_c = process.env.KEYCLOAKIFY_ARTIFACT_ID) !== null && _c !== void 0 ? _c : buildOptions.artifactId) !== null && _d !== void 0 ? _d : `${themeNames[0]}-keycloak-theme`,
195
+ loginThemeResourcesFromKeycloakVersion: (_e = buildOptions.loginThemeResourcesFromKeycloakVersion) !== null && _e !== void 0 ? _e : "24.0.4",
196
+ projectDirPath,
197
+ projectBuildDirPath,
198
+ keycloakifyBuildDirPath: (() => {
199
+ if (buildOptions.keycloakifyBuildDirPath !== undefined) {
200
+ return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
201
+ pathIsh: buildOptions.keycloakifyBuildDirPath,
202
+ cwd: projectDirPath
203
+ });
204
+ }
205
+ return (0,external_path_.join)(projectDirPath, (resolvedViteConfig === null || resolvedViteConfig === void 0 ? void 0 : resolvedViteConfig.buildDir) === undefined
206
+ ? "build_keycloak"
207
+ : `${resolvedViteConfig.buildDir}_keycloak`);
208
+ })(),
209
+ publicDirPath: (() => {
210
+ webpack: {
211
+ if (resolvedViteConfig !== undefined) {
212
+ break webpack;
213
+ }
214
+ if (process.env.PUBLIC_DIR_PATH !== undefined) {
215
+ return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
216
+ pathIsh: process.env.PUBLIC_DIR_PATH,
217
+ cwd: projectDirPath
218
+ });
219
+ }
220
+ return (0,external_path_.join)(projectDirPath, "public");
221
+ }
222
+ return (0,external_path_.join)(projectDirPath, resolvedViteConfig.publicDir);
223
+ })(),
224
+ cacheDirPath: (() => {
225
+ const cacheDirPath = (0,external_path_.join)((() => {
226
+ if (process.env.XDG_CACHE_HOME !== undefined) {
227
+ return (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
228
+ pathIsh: process.env.XDG_CACHE_HOME,
229
+ cwd: process.cwd()
230
+ });
231
+ }
232
+ return (0,external_path_.join)(npmWorkspaceRootDirPath, "node_modules", ".cache");
233
+ })(), "keycloakify");
234
+ return cacheDirPath;
235
+ })(),
236
+ urlPathname: (() => {
237
+ webpack: {
238
+ if (resolvedViteConfig !== undefined) {
239
+ break webpack;
240
+ }
241
+ const { homepage } = parsedPackageJson;
242
+ let url = undefined;
243
+ if (homepage !== undefined) {
244
+ url = new URL(homepage);
245
+ }
246
+ if (url === undefined) {
247
+ return undefined;
248
+ }
249
+ const out = url.pathname.replace(/([^/])$/, "$1/");
250
+ return out === "/" ? undefined : out;
251
+ }
252
+ return resolvedViteConfig.urlPathname;
253
+ })(),
254
+ assetsDirPath: (() => {
255
+ webpack: {
256
+ if (resolvedViteConfig !== undefined) {
257
+ break webpack;
258
+ }
259
+ return (0,external_path_.join)(projectBuildDirPath, "static");
260
+ }
261
+ return (0,external_path_.join)(projectBuildDirPath, resolvedViteConfig.assetsDir);
262
+ })(),
263
+ npmWorkspaceRootDirPath,
264
+ kcContextExclusionsFtlCode: (() => {
265
+ if (buildOptions.kcContextExclusionsFtl === undefined) {
266
+ return undefined;
267
+ }
268
+ if (buildOptions.kcContextExclusionsFtl.endsWith(".ftl")) {
269
+ const kcContextExclusionsFtlPath = (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
270
+ pathIsh: buildOptions.kcContextExclusionsFtl,
271
+ cwd: projectDirPath
272
+ });
273
+ return external_fs_.readFileSync(kcContextExclusionsFtlPath).toString("utf8");
274
+ }
275
+ return buildOptions.kcContextExclusionsFtl;
276
+ })(),
277
+ environmentVariables: (_f = buildOptions.environmentVariables) !== null && _f !== void 0 ? _f : []
278
+ };
279
+ }
280
+ //# sourceMappingURL=buildContext.js.map
281
+
282
+ /***/ }),
283
+
284
+ /***/ 173:
285
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
286
+
287
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
288
+ /* harmony export */ "M": () => (/* binding */ basenameOfTheKeycloakifyResourcesDir),
289
+ /* harmony export */ "N$": () => (/* binding */ keycloak_resources),
290
+ /* harmony export */ "UX": () => (/* binding */ accountThemePageIds),
291
+ /* harmony export */ "X4": () => (/* binding */ nameOfTheGlobal),
292
+ /* harmony export */ "fe": () => (/* binding */ vitePluginSubScriptEnvNames),
293
+ /* harmony export */ "h6": () => (/* binding */ containerName),
294
+ /* harmony export */ "lg": () => (/* binding */ nameOfTheLocalizationRealmOverridesUserProfileProperty),
295
+ /* harmony export */ "rO": () => (/* binding */ themeTypes),
296
+ /* harmony export */ "sj": () => (/* binding */ loginThemePageIds),
297
+ /* harmony export */ "uo": () => (/* binding */ skipBuildJarsEnvName),
298
+ /* harmony export */ "v$": () => (/* binding */ lastKeycloakVersionWithAccountV1),
299
+ /* harmony export */ "y_": () => (/* binding */ accountV1ThemeName),
300
+ /* harmony export */ "z0": () => (/* binding */ resources_common)
301
+ /* harmony export */ });
302
+ const nameOfTheGlobal = "kcContext";
303
+ const nameOfTheLocalizationRealmOverridesUserProfileProperty = "__localizationRealmOverridesUserProfile";
304
+ const keycloak_resources = "keycloak-resources";
305
+ const resources_common = "resources-common";
306
+ const lastKeycloakVersionWithAccountV1 = "21.1.2";
307
+ const basenameOfTheKeycloakifyResourcesDir = "build";
308
+ const themeTypes = ["login", "account"];
309
+ const accountV1ThemeName = "account-v1";
310
+ const vitePluginSubScriptEnvNames = {
311
+ runPostBuildScript: "KEYCLOAKIFY_RUN_POST_BUILD_SCRIPT",
312
+ resolveViteConfig: "KEYCLOAKIFY_RESOLVE_VITE_CONFIG"
313
+ };
314
+ const skipBuildJarsEnvName = "KEYCLOAKIFY_SKIP_BUILD_JAR";
315
+ const loginThemePageIds = [
316
+ "login.ftl",
317
+ "login-username.ftl",
318
+ "login-password.ftl",
319
+ "webauthn-authenticate.ftl",
320
+ "webauthn-register.ftl",
321
+ "register.ftl",
322
+ "info.ftl",
323
+ "error.ftl",
324
+ "login-reset-password.ftl",
325
+ "login-verify-email.ftl",
326
+ "terms.ftl",
327
+ "login-oauth2-device-verify-user-code.ftl",
328
+ "login-oauth-grant.ftl",
329
+ "login-otp.ftl",
330
+ "login-update-profile.ftl",
331
+ "login-update-password.ftl",
332
+ "login-idp-link-confirm.ftl",
333
+ "login-idp-link-email.ftl",
334
+ "login-page-expired.ftl",
335
+ "login-config-totp.ftl",
336
+ "logout-confirm.ftl",
337
+ "idp-review-user-profile.ftl",
338
+ "update-email.ftl",
339
+ "select-authenticator.ftl",
340
+ "saml-post-form.ftl",
341
+ "delete-credential.ftl",
342
+ "code.ftl",
343
+ "delete-account-confirm.ftl",
344
+ "frontchannel-logout.ftl",
345
+ "login-recovery-authn-code-config.ftl",
346
+ "login-recovery-authn-code-input.ftl",
347
+ "login-reset-otp.ftl",
348
+ "login-x509-info.ftl",
349
+ "webauthn-error.ftl"
350
+ ];
351
+ const accountThemePageIds = [
352
+ "password.ftl",
353
+ "account.ftl",
354
+ "sessions.ftl",
355
+ "totp.ftl",
356
+ "applications.ftl",
357
+ "log.ftl",
358
+ "federatedIdentity.ftl"
359
+ ];
360
+ const containerName = "keycloak-keycloakify";
361
+ //# sourceMappingURL=constants.js.map
362
+
363
+ /***/ }),
364
+
365
+ /***/ 12171:
366
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
367
+
368
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
369
+ /* harmony export */ "h": () => (/* binding */ SemVer)
370
+ /* harmony export */ });
371
+ var SemVer;
372
+ (function (SemVer) {
373
+ const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
374
+ function parse(versionStr) {
375
+ const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
376
+ if (!match) {
377
+ throw new Error(`${versionStr} is not a valid semantic version`);
378
+ }
379
+ const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
380
+ const str = match[3];
381
+ return str === undefined ? 0 : parseInt(str);
382
+ })() }, (() => {
383
+ const str = match[4];
384
+ return str === undefined ? {} : { rc: parseInt(str) };
385
+ })());
386
+ const initialStr = stringify(semVer);
387
+ Object.defineProperty(semVer, "parsedFrom", {
388
+ enumerable: true,
389
+ get: function () {
390
+ const currentStr = stringify(this);
391
+ if (currentStr !== initialStr) {
392
+ throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
393
+ }
394
+ return versionStr;
395
+ }
396
+ });
397
+ return semVer;
398
+ }
399
+ SemVer.parse = parse;
400
+ function stringify(v) {
401
+ return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
402
+ }
403
+ SemVer.stringify = stringify;
404
+ /**
405
+ *
406
+ * v1 < v2 => -1
407
+ * v1 === v2 => 0
408
+ * v1 > v2 => 1
409
+ *
410
+ */
411
+ function compare(v1, v2) {
412
+ const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
413
+ const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
414
+ for (const level of ["major", "minor", "patch", "rc"]) {
415
+ if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
416
+ return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
417
+ }
418
+ }
419
+ return 0;
420
+ }
421
+ SemVer.compare = compare;
422
+ /*
423
+ console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
424
+ console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
425
+ console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
426
+ */
427
+ function bumpType(params) {
428
+ const versionAhead = typeof params.versionAhead === "string"
429
+ ? parse(params.versionAhead)
430
+ : params.versionAhead;
431
+ const versionBehind = typeof params.versionBehind === "string"
432
+ ? parse(params.versionBehind)
433
+ : params.versionBehind;
434
+ if (compare(versionBehind, versionAhead) === 1) {
435
+ throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
436
+ }
437
+ for (const level of ["major", "minor", "patch", "rc"]) {
438
+ if (versionBehind[level] !== versionAhead[level]) {
439
+ return level;
440
+ }
441
+ }
442
+ return "no bump";
443
+ }
444
+ SemVer.bumpType = bumpType;
445
+ })(SemVer || (SemVer = {}));
446
+ //# sourceMappingURL=SemVer.js.map
447
+
448
+ /***/ }),
449
+
450
+ /***/ 29121:
451
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
452
+
453
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
454
+ /* harmony export */ "N": () => (/* binding */ extractArchive)
455
+ /* harmony export */ });
456
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73292);
457
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__);
458
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57147);
459
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
460
+ /* harmony import */ var yauzl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(78781);
461
+ /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12781);
462
+ /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);
463
+ /* harmony import */ var evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50689);
464
+ /* harmony import */ var evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__);
465
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71017);
466
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_5__);
467
+ /* harmony import */ var _fs_existsAsync__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(43765);
468
+
469
+
470
+
471
+
472
+
473
+
474
+
475
+ async function extractArchive(params) {
476
+ const { archiveFilePath, onArchiveFile } = params;
477
+ const zipFile = await new Promise((resolve, reject) => {
478
+ yauzl__WEBPACK_IMPORTED_MODULE_2__.open(archiveFilePath, { lazyEntries: true }, async (error, zipFile) => {
479
+ if (error) {
480
+ reject(error);
481
+ return;
482
+ }
483
+ resolve(zipFile);
484
+ });
485
+ });
486
+ const dDone = new evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__.Deferred();
487
+ zipFile.once("end", () => {
488
+ zipFile.close();
489
+ dDone.resolve();
490
+ });
491
+ const writeFile = async (entry, params) => {
492
+ const { filePath, modifiedData } = params;
493
+ {
494
+ const dirPath = (0,path__WEBPACK_IMPORTED_MODULE_5__.dirname)(filePath);
495
+ if (!(await (0,_fs_existsAsync__WEBPACK_IMPORTED_MODULE_6__/* .existsAsync */ .o)(dirPath))) {
496
+ await fs_promises__WEBPACK_IMPORTED_MODULE_0___default().mkdir(dirPath, { recursive: true });
497
+ }
498
+ }
499
+ if (modifiedData !== undefined) {
500
+ await fs_promises__WEBPACK_IMPORTED_MODULE_0___default().writeFile(filePath, modifiedData);
501
+ return;
502
+ }
503
+ const readStream = await new Promise(resolve => zipFile.openReadStream(entry, async (error, readStream) => {
504
+ if (error) {
505
+ dDone.reject(error);
506
+ return;
507
+ }
508
+ resolve(readStream);
509
+ }));
510
+ const dDoneWithFile = new evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__.Deferred();
511
+ stream__WEBPACK_IMPORTED_MODULE_3___default().pipeline(readStream, fs__WEBPACK_IMPORTED_MODULE_1___default().createWriteStream(filePath), error => {
512
+ if (error) {
513
+ dDone.reject(error);
514
+ return;
515
+ }
516
+ dDoneWithFile.resolve();
517
+ });
518
+ await dDoneWithFile.pr;
519
+ };
520
+ const readFile = (entry) => new Promise(resolve => zipFile.openReadStream(entry, async (error, readStream) => {
521
+ if (error) {
522
+ dDone.reject(error);
523
+ return;
524
+ }
525
+ const chunks = [];
526
+ readStream.on("data", chunk => {
527
+ chunks.push(chunk);
528
+ });
529
+ readStream.on("end", () => {
530
+ resolve(Buffer.concat(chunks));
531
+ });
532
+ readStream.on("error", error => {
533
+ dDone.reject(error);
534
+ });
535
+ }));
536
+ zipFile.on("entry", async (entry) => {
537
+ handle_file: {
538
+ // NOTE: Skip directories
539
+ if (entry.fileName.endsWith(path__WEBPACK_IMPORTED_MODULE_5__.sep)) {
540
+ break handle_file;
541
+ }
542
+ let hasEarlyExitBeenCalled = false;
543
+ await onArchiveFile({
544
+ relativeFilePathInArchive: entry.fileName.split("/").join(path__WEBPACK_IMPORTED_MODULE_5__.sep),
545
+ readFile: () => readFile(entry),
546
+ writeFile: params => writeFile(entry, params),
547
+ earlyExit: () => {
548
+ hasEarlyExitBeenCalled = true;
549
+ }
550
+ });
551
+ if (hasEarlyExitBeenCalled) {
552
+ zipFile.close();
553
+ dDone.resolve();
554
+ return;
555
+ }
556
+ }
557
+ zipFile.readEntry();
558
+ });
559
+ zipFile.readEntry();
560
+ await dDone.pr;
561
+ }
562
+ //# sourceMappingURL=extractArchive.js.map
563
+
564
+ /***/ }),
565
+
566
+ /***/ 43765:
567
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
568
+
569
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
570
+ /* harmony export */ "o": () => (/* binding */ existsAsync)
571
+ /* harmony export */ });
572
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73292);
573
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__);
574
+
575
+ async function existsAsync(path) {
576
+ try {
577
+ await fs_promises__WEBPACK_IMPORTED_MODULE_0__.stat(path);
578
+ return true;
579
+ }
580
+ catch (error) {
581
+ if (error.code === "ENOENT")
582
+ return false;
583
+ throw error;
584
+ }
585
+ }
586
+ //# sourceMappingURL=fs.existsAsync.js.map
587
+
588
+ /***/ }),
589
+
590
+ /***/ 86644:
591
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
592
+
593
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
594
+ /* harmony export */ "c": () => (/* binding */ getAbsoluteAndInOsFormatPath)
595
+ /* harmony export */ });
596
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
597
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
598
+ /* harmony import */ var os__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22037);
599
+ /* harmony import */ var os__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(os__WEBPACK_IMPORTED_MODULE_1__);
600
+
601
+
602
+ function getAbsoluteAndInOsFormatPath(params) {
603
+ const { pathIsh, cwd } = params;
604
+ let pathOut = pathIsh;
605
+ pathOut = pathOut.replace(/\//g, path__WEBPACK_IMPORTED_MODULE_0__.sep);
606
+ if (pathOut.startsWith("~")) {
607
+ pathOut = pathOut.replace("~", os__WEBPACK_IMPORTED_MODULE_1__.homedir());
608
+ }
609
+ pathOut = pathOut.endsWith(path__WEBPACK_IMPORTED_MODULE_0__.sep) ? pathOut.slice(0, -1) : pathOut;
610
+ if (!(0,path__WEBPACK_IMPORTED_MODULE_0__.isAbsolute)(pathOut)) {
611
+ pathOut = (0,path__WEBPACK_IMPORTED_MODULE_0__.join)(cwd, pathOut);
612
+ }
613
+ pathOut = (0,path__WEBPACK_IMPORTED_MODULE_0__.resolve)(pathOut);
614
+ return pathOut;
615
+ }
616
+ //# sourceMappingURL=getAbsoluteAndInOsFormatPath.js.map
617
+
618
+ /***/ })
619
+
620
+ };
621
+ ;
package/bin/961.index.js CHANGED
@@ -13,7 +13,7 @@ __webpack_require__.r(__webpack_exports__);
13
13
  /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
14
14
  /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
15
15
  /* harmony import */ var _shared_promptKeycloakVersion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95781);
16
- /* harmony import */ var _shared_buildOptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(54659);
16
+ /* harmony import */ var _shared_buildContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(87751);
17
17
  /* harmony import */ var _shared_downloadKeycloakDefaultTheme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(61804);
18
18
  /* harmony import */ var _tools_transformCodebase__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(60332);
19
19
  /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(78818);
@@ -26,16 +26,16 @@ __webpack_require__.r(__webpack_exports__);
26
26
 
27
27
  async function command(params) {
28
28
  const { cliCommandOptions } = params;
29
- const buildOptions = (0,_shared_buildOptions__WEBPACK_IMPORTED_MODULE_2__/* .readBuildOptions */ .d)({
29
+ const buildContext = (0,_shared_buildContext__WEBPACK_IMPORTED_MODULE_2__/* .getBuildContext */ .s)({
30
30
  cliCommandOptions
31
31
  });
32
32
  console.log(chalk__WEBPACK_IMPORTED_MODULE_5___default().cyan("Select the Keycloak version from which you want to download the builtins theme:"));
33
33
  const { keycloakVersion } = await (0,_shared_promptKeycloakVersion__WEBPACK_IMPORTED_MODULE_1__/* .promptKeycloakVersion */ .s)({
34
34
  startingFromMajor: undefined,
35
- cacheDirPath: buildOptions.cacheDirPath
35
+ cacheDirPath: buildContext.cacheDirPath
36
36
  });
37
37
  console.log(`→ ${keycloakVersion}`);
38
- const destDirPath = (0,path__WEBPACK_IMPORTED_MODULE_0__.join)(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources", "theme");
38
+ const destDirPath = (0,path__WEBPACK_IMPORTED_MODULE_0__.join)(buildContext.keycloakifyBuildDirPath, "src", "main", "resources", "theme");
39
39
  console.log([
40
40
  `Downloading builtins theme of Keycloak ${keycloakVersion} here:`,
41
41
  `- ${chalk__WEBPACK_IMPORTED_MODULE_5___default().bold(`.${path__WEBPACK_IMPORTED_MODULE_0__.sep}${(0,path__WEBPACK_IMPORTED_MODULE_0__.join)((0,path__WEBPACK_IMPORTED_MODULE_0__.relative)(process.cwd(), destDirPath), "base")}`)}`,
@@ -43,7 +43,7 @@ async function command(params) {
43
43
  ].join("\n"));
44
44
  const { defaultThemeDirPath } = await (0,_shared_downloadKeycloakDefaultTheme__WEBPACK_IMPORTED_MODULE_3__/* .downloadKeycloakDefaultTheme */ .x)({
45
45
  keycloakVersion,
46
- buildOptions
46
+ buildContext
47
47
  });
48
48
  (0,_tools_transformCodebase__WEBPACK_IMPORTED_MODULE_4__/* .transformCodebase */ .N)({
49
49
  srcDirPath: defaultThemeDirPath,
package/bin/97.index.js CHANGED
@@ -23,7 +23,7 @@ __webpack_require__.r(__webpack_exports__);
23
23
  /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(88078);
24
24
  /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(tsafe_assert__WEBPACK_IMPORTED_MODULE_7__);
25
25
  /* harmony import */ var _shared_getThemeSrcDirPath__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(39216);
26
- /* harmony import */ var _shared_buildOptions__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(54659);
26
+ /* harmony import */ var _shared_buildContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(87751);
27
27
  /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78818);
28
28
  /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_10__);
29
29
 
@@ -39,7 +39,7 @@ __webpack_require__.r(__webpack_exports__);
39
39
 
40
40
  async function command(params) {
41
41
  const { cliCommandOptions } = params;
42
- const buildOptions = (0,_shared_buildOptions__WEBPACK_IMPORTED_MODULE_9__/* .readBuildOptions */ .d)({
42
+ const buildContext = (0,_shared_buildContext__WEBPACK_IMPORTED_MODULE_9__/* .getBuildContext */ .s)({
43
43
  cliCommandOptions
44
44
  });
45
45
  console.log(chalk__WEBPACK_IMPORTED_MODULE_10___default().cyan("Theme type:"));
@@ -65,7 +65,7 @@ async function command(params) {
65
65
  });
66
66
  console.log(`→ ${pageId}`);
67
67
  const { themeSrcDirPath } = (0,_shared_getThemeSrcDirPath__WEBPACK_IMPORTED_MODULE_8__/* .getThemeSrcDirPath */ .f)({
68
- reactAppRootDirPath: buildOptions.reactAppRootDirPath
68
+ projectDirPath: buildContext.projectDirPath
69
69
  });
70
70
  const componentBasename = (0,tsafe_capitalize__WEBPACK_IMPORTED_MODULE_3__.capitalize)((0,_tools_kebabCaseToSnakeCase__WEBPACK_IMPORTED_MODULE_6__/* .kebabCaseToCamelCase */ .A)(pageId)).replace(/ftl$/, "stories.tsx");
71
71
  const targetFilePath = (0,path__WEBPACK_IMPORTED_MODULE_5__.join)(themeSrcDirPath, themeType, "pages", componentBasename);