keycloakify 10.0.0-rc.65 → 10.0.0-rc.67

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 (53) hide show
  1. package/bin/193.index.js +51 -0
  2. package/bin/246.index.js +371 -75118
  3. package/bin/363.index.js +64 -165
  4. package/bin/453.index.js +603 -23
  5. package/bin/{890.index.js → 456.index.js} +1831 -3
  6. package/bin/490.index.js +75195 -0
  7. package/bin/526.index.js +294 -173
  8. package/bin/538.index.js +1 -509
  9. package/bin/{203.index.js → 751.index.js} +306 -305
  10. package/bin/772.index.js +1 -1
  11. package/bin/{190.index.js → 837.index.js} +259 -35
  12. package/bin/932.index.js +1 -578
  13. package/bin/97.index.js +594 -14
  14. package/bin/main.js +8 -8
  15. package/bin/shared/KeycloakVersionRange.d.ts +5 -0
  16. package/bin/shared/KeycloakVersionRange.js.map +1 -0
  17. package/bin/shared/buildContext.d.ts +16 -0
  18. package/bin/shared/buildContext.js.map +1 -0
  19. package/bin/shared/constants.d.ts +1 -1
  20. package/bin/shared/constants.js.map +1 -1
  21. package/bin/shared/copyKeycloakResourcesToPublic.d.ts +8 -0
  22. package/bin/shared/copyKeycloakResourcesToPublic.js.map +1 -0
  23. package/bin/shared/downloadKeycloakDefaultTheme.d.ts +10 -0
  24. package/bin/shared/downloadKeycloakDefaultTheme.js.map +1 -0
  25. package/bin/shared/downloadKeycloakStaticResources.d.ts +9 -0
  26. package/bin/shared/downloadKeycloakStaticResources.js.map +1 -0
  27. package/bin/shared/generateKcGenTs.d.ts +12 -0
  28. package/bin/shared/generateKcGenTs.js.map +1 -0
  29. package/bin/shared/metaInfKeycloakThemes.d.ts +13 -0
  30. package/bin/shared/metaInfKeycloakThemes.js.map +1 -0
  31. package/bin/shared/promptKeycloakVersion.d.ts +7 -0
  32. package/bin/shared/promptKeycloakVersion.js.map +1 -0
  33. package/package.json +21 -12
  34. package/src/bin/add-story.ts +1 -6
  35. package/src/bin/eject-page.ts +7 -8
  36. package/src/bin/initialize-email-theme.ts +1 -6
  37. package/src/bin/keycloakify/buildJars/buildJars.ts +23 -49
  38. package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +15 -20
  39. package/src/bin/keycloakify/keycloakify.ts +6 -8
  40. package/src/bin/shared/buildContext.ts +434 -42
  41. package/src/bin/shared/constants.ts +2 -1
  42. package/src/bin/shared/generateKcGenTs.ts +2 -6
  43. package/src/bin/start-keycloak/keycloakifyBuild.ts +4 -4
  44. package/src/bin/start-keycloak/start-keycloak.ts +40 -83
  45. package/src/vite-plugin/vite-plugin.ts +5 -4
  46. package/vite-plugin/index.js +341 -117
  47. package/bin/480.index.js +0 -466
  48. package/bin/818.index.js +0 -1802
  49. package/bin/827.index.js +0 -1094
  50. package/bin/shared/constants.js +0 -59
  51. package/src/bin/shared/getImplementedThemeTypes.ts +0 -38
  52. package/src/bin/shared/getJarFileBasename.ts +0 -11
  53. package/src/bin/shared/getThemeSrcDirPath.ts +0 -62
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- exports.id = 203;
3
- exports.ids = [203];
2
+ exports.id = 751;
3
+ exports.ids = [751];
4
4
  exports.modules = {
5
5
 
6
6
  /***/ 87751:
@@ -77,11 +77,43 @@ function getNpmWorkspaceRootDirPath(params) {
77
77
  //# sourceMappingURL=getNpmWorkspaceRootDirPath.js.map
78
78
  // EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
79
79
  var lib = __webpack_require__(52300);
80
- // EXTERNAL MODULE: ./node_modules/tsafe/index.js
81
- var tsafe = __webpack_require__(1666);
82
80
  // EXTERNAL MODULE: ./dist/bin/shared/constants.js
83
81
  var constants = __webpack_require__(173);
82
+ // EXTERNAL MODULE: ./node_modules/tsafe/index.js
83
+ var tsafe = __webpack_require__(1666);
84
+ // EXTERNAL MODULE: ./dist/bin/tools/crawl.js
85
+ var crawl = __webpack_require__(73036);
86
+ // EXTERNAL MODULE: ./node_modules/tsafe/objectFromEntries.js
87
+ var objectFromEntries = __webpack_require__(68634);
88
+ // EXTERNAL MODULE: ./node_modules/tsafe/objectEntries.js
89
+ var objectEntries = __webpack_require__(39612);
90
+ // EXTERNAL MODULE: ./node_modules/tsafe/id.js
91
+ var id = __webpack_require__(43047);
92
+ // EXTERNAL MODULE: ./node_modules/tsafe/symToStr.js
93
+ var symToStr = __webpack_require__(47986);
94
+ // EXTERNAL MODULE: ./node_modules/chalk/source/index.js
95
+ var source = __webpack_require__(78818);
96
+ var source_default = /*#__PURE__*/__webpack_require__.n(source);
84
97
  ;// CONCATENATED MODULE: ./dist/bin/shared/buildContext.js
98
+ var __rest = (undefined && undefined.__rest) || function (s, e) {
99
+ var t = {};
100
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
101
+ t[p] = s[p];
102
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
103
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
104
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
105
+ t[p[i]] = s[p[i]];
106
+ }
107
+ return t;
108
+ };
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
85
117
 
86
118
 
87
119
 
@@ -114,7 +146,7 @@ function getBuildContext(params) {
114
146
  env: Object.assign(Object.assign({}, process.env), { [constants/* vitePluginSubScriptEnvNames.resolveViteConfig */.fe.resolveViteConfig]: "true" })
115
147
  })
116
148
  .toString("utf8");
117
- (0,tsafe.assert)(output.includes(constants/* vitePluginSubScriptEnvNames.resolveViteConfig */.fe.resolveViteConfig), "Seems like the Keycloakify's Vite plugin is not installed.");
149
+ (0,assert.assert)(output.includes(constants/* vitePluginSubScriptEnvNames.resolveViteConfig */.fe.resolveViteConfig), "Seems like the Keycloakify's Vite plugin is not installed.");
118
150
  const resolvedViteConfigStr = output
119
151
  .split(constants/* vitePluginSubScriptEnvNames.resolveViteConfig */.fe.resolveViteConfig)
120
152
  .reverse()[0];
@@ -122,36 +154,99 @@ function getBuildContext(params) {
122
154
  return { resolvedViteConfig };
123
155
  })();
124
156
  const parsedPackageJson = (() => {
125
- {
126
- (0,tsafe.assert)();
127
- }
128
157
  const zParsedPackageJson = lib.z.object({
129
158
  name: lib.z.string(),
130
159
  version: lib.z.string().optional(),
131
160
  homepage: lib.z.string().optional(),
132
- keycloakify: lib.z.object({
133
- extraThemeProperties: lib.z.array(lib.z.string()).optional(),
134
- artifactId: lib.z.string().optional(),
135
- groupId: lib.z.string().optional(),
136
- loginThemeResourcesFromKeycloakVersion: lib.z.string().optional(),
137
- projectBuildDirPath: lib.z.string().optional(),
138
- keycloakifyBuildDirPath: lib.z.string().optional(),
139
- kcContextExclusionsFtl: lib.z.string().optional(),
140
- environmentVariables: lib.z.array(lib.z.object({
141
- name: lib.z.string(),
142
- default: lib.z.string()
143
- }))
144
- .optional(),
145
- themeName: lib.z.union([lib.z.string(), lib.z.array(lib.z.string())]).optional()
146
- })
147
- .optional()
161
+ keycloakify: (0,id.id)((() => {
162
+ const zBuildOptions_packageJson = lib.z.object({
163
+ extraThemeProperties: lib.z.array(lib.z.string()).optional(),
164
+ artifactId: lib.z.string().optional(),
165
+ groupId: lib.z.string().optional(),
166
+ loginThemeResourcesFromKeycloakVersion: lib.z.string().optional(),
167
+ projectBuildDirPath: lib.z.string().optional(),
168
+ keycloakifyBuildDirPath: lib.z.string().optional(),
169
+ kcContextExclusionsFtl: lib.z.string().optional(),
170
+ environmentVariables: lib.z.array(lib.z.object({
171
+ name: lib.z.string(),
172
+ default: lib.z.string()
173
+ }))
174
+ .optional(),
175
+ themeName: lib.z.union([lib.z.string(), lib.z.array(lib.z.string())]).optional(),
176
+ keycloakVersionTargets: (0,id.id)((() => {
177
+ const zKeycloakVersionTargets = lib.z.union([
178
+ lib.z.object({
179
+ hasAccountTheme: lib.z.literal(true),
180
+ "21-and-below": lib.z.union([
181
+ lib.z.boolean(),
182
+ lib.z.string()
183
+ ]),
184
+ "23": lib.z.union([lib.z.boolean(), lib.z.string()]),
185
+ "24": lib.z.union([lib.z.boolean(), lib.z.string()]),
186
+ "25-and-above": lib.z.union([lib.z.boolean(), lib.z.string()])
187
+ }),
188
+ lib.z.object({
189
+ hasAccountTheme: lib.z.literal(false),
190
+ "21-and-below": lib.z.union([
191
+ lib.z.boolean(),
192
+ lib.z.string()
193
+ ]),
194
+ "22-and-above": lib.z.union([lib.z.boolean(), lib.z.string()])
195
+ })
196
+ ]);
197
+ {
198
+ (0,assert.assert)();
199
+ }
200
+ return zKeycloakVersionTargets;
201
+ })()).optional()
202
+ });
203
+ {
204
+ (0,assert.assert)();
205
+ }
206
+ return zBuildOptions_packageJson;
207
+ })()).optional()
148
208
  });
149
209
  {
150
- (0,tsafe.assert)();
210
+ (0,assert.assert)();
151
211
  }
152
212
  return zParsedPackageJson.parse(JSON.parse(external_fs_.readFileSync((0,external_path_.join)(projectDirPath, "package.json")).toString("utf8")));
153
213
  })();
154
214
  const buildOptions = Object.assign(Object.assign({}, parsedPackageJson.keycloakify), resolvedViteConfig === null || resolvedViteConfig === void 0 ? void 0 : resolvedViteConfig.buildOptions);
215
+ const { themeSrcDirPath } = (() => {
216
+ const srcDirPath = (0,external_path_.join)(projectDirPath, "src");
217
+ const themeSrcDirPath = (0,crawl/* crawl */.J)({
218
+ dirPath: srcDirPath,
219
+ returnedPathsType: "relative to dirPath"
220
+ })
221
+ .map(fileRelativePath => {
222
+ for (const themeSrcDirBasename of ["keycloak-theme", "keycloak_theme"]) {
223
+ const split = fileRelativePath.split(themeSrcDirBasename);
224
+ if (split.length === 2) {
225
+ return (0,external_path_.join)(srcDirPath, split[0] + themeSrcDirBasename);
226
+ }
227
+ }
228
+ return undefined;
229
+ })
230
+ .filter((0,tsafe.exclude)(undefined))[0];
231
+ if (themeSrcDirPath !== undefined) {
232
+ return { themeSrcDirPath };
233
+ }
234
+ for (const themeType of [...constants/* themeTypes */.rO, "email"]) {
235
+ if (!external_fs_.existsSync((0,external_path_.join)(srcDirPath, themeType))) {
236
+ continue;
237
+ }
238
+ return { themeSrcDirPath: srcDirPath };
239
+ }
240
+ console.log(source_default().red([
241
+ "Can't locate your keycloak theme source directory.",
242
+ "See: https://docs.keycloakify.dev/v/v10/keycloakify-in-my-app/collocation"
243
+ ].join("\n")));
244
+ process.exit(1);
245
+ })();
246
+ const recordIsImplementedByThemeType = (0,objectFromEntries.objectFromEntries)(["login", "account", "email"].map(themeType => [
247
+ themeType,
248
+ external_fs_.existsSync((0,external_path_.join)(themeSrcDirPath, themeType))
249
+ ]));
155
250
  const themeNames = (() => {
156
251
  if (buildOptions.themeName === undefined) {
157
252
  return [
@@ -165,7 +260,7 @@ function getBuildContext(params) {
165
260
  return [buildOptions.themeName];
166
261
  }
167
262
  const [mainThemeName, ...themeVariantNames] = buildOptions.themeName;
168
- (0,tsafe.assert)(mainThemeName !== undefined);
263
+ (0,assert.assert)(mainThemeName !== undefined);
169
264
  return [mainThemeName, ...themeVariantNames];
170
265
  })();
171
266
  const projectBuildDirPath = (() => {
@@ -188,8 +283,9 @@ function getBuildContext(params) {
188
283
  projectDirPath,
189
284
  dependencyExpected: "keycloakify"
190
285
  });
286
+ const bundler = resolvedViteConfig !== undefined ? "vite" : "webpack";
191
287
  return {
192
- bundler: resolvedViteConfig !== undefined ? "vite" : "webpack",
288
+ bundler,
193
289
  themeVersion: (_b = (_a = process.env.KEYCLOAKIFY_THEME_VERSION) !== null && _a !== void 0 ? _a : parsedPackageJson.version) !== null && _b !== void 0 ? _b : "0.0.0",
194
290
  themeNames,
195
291
  extraThemeProperties: buildOptions.extraThemeProperties,
@@ -284,7 +380,187 @@ function getBuildContext(params) {
284
380
  }
285
381
  return buildOptions.kcContextExclusionsFtl;
286
382
  })(),
287
- environmentVariables: (_f = buildOptions.environmentVariables) !== null && _f !== void 0 ? _f : []
383
+ environmentVariables: (_f = buildOptions.environmentVariables) !== null && _f !== void 0 ? _f : [],
384
+ recordIsImplementedByThemeType,
385
+ themeSrcDirPath,
386
+ jarTargets: (() => {
387
+ const getDefaultJarFileBasename = (range) => `keycloak-theme-for-kc-${range}.jar`;
388
+ build_for_specific_keycloak_major_version: {
389
+ const buildForKeycloakMajorVersionNumber = (() => {
390
+ const envValue = process.env[constants/* buildForKeycloakMajorVersionEnvName */.um];
391
+ if (envValue === undefined) {
392
+ return undefined;
393
+ }
394
+ const major = parseInt(envValue);
395
+ (0,assert.assert)(!isNaN(major));
396
+ return major;
397
+ })();
398
+ if (buildForKeycloakMajorVersionNumber === undefined) {
399
+ break build_for_specific_keycloak_major_version;
400
+ }
401
+ const keycloakVersionRange = (() => {
402
+ const doesImplementAccountTheme = recordIsImplementedByThemeType.account;
403
+ if (doesImplementAccountTheme) {
404
+ const keycloakVersionRange = (() => {
405
+ if (buildForKeycloakMajorVersionNumber <= 21) {
406
+ return "21-and-below";
407
+ }
408
+ (0,assert.assert)(buildForKeycloakMajorVersionNumber !== 22);
409
+ if (buildForKeycloakMajorVersionNumber === 23) {
410
+ return "23";
411
+ }
412
+ if (buildForKeycloakMajorVersionNumber === 24) {
413
+ return "24";
414
+ }
415
+ return "25-and-above";
416
+ })();
417
+ (0,assert.assert)();
418
+ return keycloakVersionRange;
419
+ }
420
+ else {
421
+ const keycloakVersionRange = (() => {
422
+ if (buildForKeycloakMajorVersionNumber <= 21) {
423
+ return "21-and-below";
424
+ }
425
+ return "22-and-above";
426
+ })();
427
+ (0,assert.assert)();
428
+ return keycloakVersionRange;
429
+ }
430
+ })();
431
+ const jarFileBasename = (() => {
432
+ use_custom_jar_basename: {
433
+ const { keycloakVersionTargets } = buildOptions;
434
+ if (keycloakVersionTargets === undefined) {
435
+ break use_custom_jar_basename;
436
+ }
437
+ const entry = (0,objectEntries.objectEntries)(keycloakVersionTargets).find(([keycloakVersionRange_entry]) => keycloakVersionRange_entry === keycloakVersionRange);
438
+ if (entry === undefined) {
439
+ break use_custom_jar_basename;
440
+ }
441
+ const maybeJarFileBasename = entry[1];
442
+ if (typeof maybeJarFileBasename !== "string") {
443
+ break use_custom_jar_basename;
444
+ }
445
+ return maybeJarFileBasename;
446
+ }
447
+ return getDefaultJarFileBasename(keycloakVersionRange);
448
+ })();
449
+ return [
450
+ {
451
+ keycloakVersionRange,
452
+ jarFileBasename
453
+ }
454
+ ];
455
+ }
456
+ const jarTargets_default = (() => {
457
+ const jarTargets = [];
458
+ if (recordIsImplementedByThemeType.account) {
459
+ for (const keycloakVersionRange of [
460
+ "21-and-below",
461
+ "23",
462
+ "24",
463
+ "25-and-above"
464
+ ]) {
465
+ (0,assert.assert)(true);
466
+ jarTargets.push({
467
+ keycloakVersionRange,
468
+ jarFileBasename: getDefaultJarFileBasename(keycloakVersionRange)
469
+ });
470
+ }
471
+ }
472
+ else {
473
+ for (const keycloakVersionRange of [
474
+ "21-and-below",
475
+ "22-and-above"
476
+ ]) {
477
+ (0,assert.assert)(true);
478
+ jarTargets.push({
479
+ keycloakVersionRange,
480
+ jarFileBasename: getDefaultJarFileBasename(keycloakVersionRange)
481
+ });
482
+ }
483
+ }
484
+ return jarTargets;
485
+ })();
486
+ if (buildOptions.keycloakVersionTargets === undefined) {
487
+ return jarTargets_default;
488
+ }
489
+ if (buildOptions.keycloakVersionTargets.hasAccountTheme !==
490
+ recordIsImplementedByThemeType.account) {
491
+ console.log(source_default().red((() => {
492
+ const { keycloakVersionTargets } = buildOptions;
493
+ let message = `Bad ${(0,symToStr/* symToStr */.r)({ keycloakVersionTargets })} configuration.\n`;
494
+ if (keycloakVersionTargets.hasAccountTheme) {
495
+ message +=
496
+ "Your codebase does not seem to implement an account theme ";
497
+ }
498
+ else {
499
+ message += "Your codebase implements an account theme ";
500
+ }
501
+ const { hasAccountTheme } = keycloakVersionTargets;
502
+ message += `but you have set ${(0,symToStr/* symToStr */.r)({ keycloakVersionTargets })}.${(0,symToStr/* symToStr */.r)({ hasAccountTheme })}`;
503
+ message += ` to ${hasAccountTheme} in your `;
504
+ message += (() => {
505
+ switch (bundler) {
506
+ case "vite":
507
+ return "vite.config.ts";
508
+ case "webpack":
509
+ return "package.json";
510
+ }
511
+ (0,assert.assert)(false);
512
+ })();
513
+ message += `. Please set it to ${!hasAccountTheme} `;
514
+ message +=
515
+ "and fill up the relevant keycloak version ranges.\n";
516
+ message += "Example:\n";
517
+ message += JSON.stringify((0,id.id)({
518
+ keycloakVersionTargets: Object.assign({ hasAccountTheme: recordIsImplementedByThemeType.account }, (0,objectFromEntries.objectFromEntries)(jarTargets_default.map(({ keycloakVersionRange, jarFileBasename }) => [
519
+ keycloakVersionRange,
520
+ jarFileBasename
521
+ ])))
522
+ }), null, 2);
523
+ return message;
524
+ })()));
525
+ process.exit(1);
526
+ }
527
+ const jarTargets = [];
528
+ const _a = buildOptions.keycloakVersionTargets, { hasAccountTheme } = _a, rest = __rest(_a, ["hasAccountTheme"]);
529
+ for (const [keycloakVersionRange, jarNameOrBoolean] of (0,objectEntries.objectEntries)(rest)) {
530
+ if (jarNameOrBoolean === false) {
531
+ continue;
532
+ }
533
+ if (jarNameOrBoolean === true) {
534
+ jarTargets.push({
535
+ keycloakVersionRange: keycloakVersionRange,
536
+ jarFileBasename: getDefaultJarFileBasename(keycloakVersionRange)
537
+ });
538
+ continue;
539
+ }
540
+ const jarFileBasename = jarNameOrBoolean;
541
+ if (!jarFileBasename.endsWith(".jar")) {
542
+ console.log(source_default().red(`Bad ${jarFileBasename} should end with '.jar'\n`));
543
+ process.exit(1);
544
+ }
545
+ if (jarFileBasename.includes("/") || jarFileBasename.includes("\\")) {
546
+ console.log(source_default().red([
547
+ `Invalid ${jarFileBasename}. It's not supposed to be a path,`,
548
+ `Only the basename of the jar file is expected.`,
549
+ `Example: keycloak-theme.jar`
550
+ ].join(" ")));
551
+ process.exit(1);
552
+ }
553
+ jarTargets.push({
554
+ keycloakVersionRange: keycloakVersionRange,
555
+ jarFileBasename: jarNameOrBoolean
556
+ });
557
+ }
558
+ if (jarTargets.length === 0) {
559
+ console.log(source_default().red("All jar targets are disabled. Please enable at least one jar target."));
560
+ process.exit(1);
561
+ }
562
+ return jarTargets;
563
+ })()
288
564
  };
289
565
  }
290
566
  //# sourceMappingURL=buildContext.js.map
@@ -295,7 +571,6 @@ function getBuildContext(params) {
295
571
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
296
572
 
297
573
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
298
- /* harmony export */ "Dv": () => (/* binding */ onlyBuildJarFileBasenameEnvName),
299
574
  /* harmony export */ "M": () => (/* binding */ basenameOfTheKeycloakifyResourcesDir),
300
575
  /* harmony export */ "N$": () => (/* binding */ keycloak_resources),
301
576
  /* harmony export */ "UX": () => (/* binding */ accountThemePageIds),
@@ -304,6 +579,7 @@ function getBuildContext(params) {
304
579
  /* harmony export */ "lg": () => (/* binding */ nameOfTheLocalizationRealmOverridesUserProfileProperty),
305
580
  /* harmony export */ "rO": () => (/* binding */ themeTypes),
306
581
  /* harmony export */ "sj": () => (/* binding */ loginThemePageIds),
582
+ /* harmony export */ "um": () => (/* binding */ buildForKeycloakMajorVersionEnvName),
307
583
  /* harmony export */ "v$": () => (/* binding */ lastKeycloakVersionWithAccountV1),
308
584
  /* harmony export */ "y_": () => (/* binding */ accountV1ThemeName),
309
585
  /* harmony export */ "z0": () => (/* binding */ resources_common)
@@ -319,7 +595,7 @@ const vitePluginSubScriptEnvNames = {
319
595
  runPostBuildScript: "KEYCLOAKIFY_RUN_POST_BUILD_SCRIPT",
320
596
  resolveViteConfig: "KEYCLOAKIFY_RESOLVE_VITE_CONFIG"
321
597
  };
322
- const onlyBuildJarFileBasenameEnvName = "KEYCLOAKIFY_ONLY_BUILD_JAR_FILE_BASENAME";
598
+ const buildForKeycloakMajorVersionEnvName = "KEYCLOAKIFY_BUILD_FOR_KEYCLOAK_MAJOR_VERSION";
323
599
  const loginThemePageIds = [
324
600
  "login.ftl",
325
601
  "login-username.ftl",
@@ -370,91 +646,6 @@ const containerName = "keycloak-keycloakify";
370
646
 
371
647
  /***/ }),
372
648
 
373
- /***/ 12171:
374
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
375
-
376
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
377
- /* harmony export */ "h": () => (/* binding */ SemVer)
378
- /* harmony export */ });
379
- var SemVer;
380
- (function (SemVer) {
381
- const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
382
- function parse(versionStr) {
383
- const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
384
- if (!match) {
385
- throw new Error(`${versionStr} is not a valid semantic version`);
386
- }
387
- const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
388
- const str = match[3];
389
- return str === undefined ? 0 : parseInt(str);
390
- })() }, (() => {
391
- const str = match[4];
392
- return str === undefined ? {} : { rc: parseInt(str) };
393
- })());
394
- const initialStr = stringify(semVer);
395
- Object.defineProperty(semVer, "parsedFrom", {
396
- enumerable: true,
397
- get: function () {
398
- const currentStr = stringify(this);
399
- if (currentStr !== initialStr) {
400
- throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
401
- }
402
- return versionStr;
403
- }
404
- });
405
- return semVer;
406
- }
407
- SemVer.parse = parse;
408
- function stringify(v) {
409
- return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
410
- }
411
- SemVer.stringify = stringify;
412
- /**
413
- *
414
- * v1 < v2 => -1
415
- * v1 === v2 => 0
416
- * v1 > v2 => 1
417
- *
418
- */
419
- function compare(v1, v2) {
420
- const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
421
- const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
422
- for (const level of ["major", "minor", "patch", "rc"]) {
423
- if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
424
- return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
425
- }
426
- }
427
- return 0;
428
- }
429
- SemVer.compare = compare;
430
- /*
431
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
432
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
433
- console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
434
- */
435
- function bumpType(params) {
436
- const versionAhead = typeof params.versionAhead === "string"
437
- ? parse(params.versionAhead)
438
- : params.versionAhead;
439
- const versionBehind = typeof params.versionBehind === "string"
440
- ? parse(params.versionBehind)
441
- : params.versionBehind;
442
- if (compare(versionBehind, versionAhead) === 1) {
443
- throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
444
- }
445
- for (const level of ["major", "minor", "patch", "rc"]) {
446
- if (versionBehind[level] !== versionAhead[level]) {
447
- return level;
448
- }
449
- }
450
- return "no bump";
451
- }
452
- SemVer.bumpType = bumpType;
453
- })(SemVer || (SemVer = {}));
454
- //# sourceMappingURL=SemVer.js.map
455
-
456
- /***/ }),
457
-
458
649
  /***/ 73036:
459
650
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
460
651
 
@@ -493,196 +684,6 @@ function crawl(params) {
493
684
 
494
685
  /***/ }),
495
686
 
496
- /***/ 29121:
497
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
498
-
499
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
500
- /* harmony export */ "N": () => (/* binding */ extractArchive)
501
- /* harmony export */ });
502
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73292);
503
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__);
504
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57147);
505
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
506
- /* harmony import */ var yauzl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(78781);
507
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12781);
508
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);
509
- /* harmony import */ var evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50689);
510
- /* harmony import */ var evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__);
511
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71017);
512
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_5__);
513
- /* harmony import */ var _fs_existsAsync__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(43765);
514
-
515
-
516
-
517
-
518
-
519
-
520
-
521
- async function extractArchive(params) {
522
- const { archiveFilePath, onArchiveFile } = params;
523
- const zipFile = await new Promise((resolve, reject) => {
524
- yauzl__WEBPACK_IMPORTED_MODULE_2__.open(archiveFilePath, { lazyEntries: true }, async (error, zipFile) => {
525
- if (error) {
526
- reject(error);
527
- return;
528
- }
529
- resolve(zipFile);
530
- });
531
- });
532
- const dDone = new evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__.Deferred();
533
- zipFile.once("end", () => {
534
- zipFile.close();
535
- dDone.resolve();
536
- });
537
- const writeFile = async (entry, params) => {
538
- const { filePath, modifiedData } = params;
539
- {
540
- const dirPath = (0,path__WEBPACK_IMPORTED_MODULE_5__.dirname)(filePath);
541
- if (!(await (0,_fs_existsAsync__WEBPACK_IMPORTED_MODULE_6__/* .existsAsync */ .o)(dirPath))) {
542
- await fs_promises__WEBPACK_IMPORTED_MODULE_0___default().mkdir(dirPath, { recursive: true });
543
- }
544
- }
545
- if (modifiedData !== undefined) {
546
- await fs_promises__WEBPACK_IMPORTED_MODULE_0___default().writeFile(filePath, modifiedData);
547
- return;
548
- }
549
- const readStream = await new Promise(resolve => zipFile.openReadStream(entry, async (error, readStream) => {
550
- if (error) {
551
- dDone.reject(error);
552
- return;
553
- }
554
- resolve(readStream);
555
- }));
556
- const dDoneWithFile = new evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__.Deferred();
557
- stream__WEBPACK_IMPORTED_MODULE_3___default().pipeline(readStream, fs__WEBPACK_IMPORTED_MODULE_1___default().createWriteStream(filePath), error => {
558
- if (error) {
559
- dDone.reject(error);
560
- return;
561
- }
562
- dDoneWithFile.resolve();
563
- });
564
- await dDoneWithFile.pr;
565
- };
566
- const readFile = (entry) => new Promise(resolve => zipFile.openReadStream(entry, async (error, readStream) => {
567
- if (error) {
568
- dDone.reject(error);
569
- return;
570
- }
571
- const chunks = [];
572
- readStream.on("data", chunk => {
573
- chunks.push(chunk);
574
- });
575
- readStream.on("end", () => {
576
- resolve(Buffer.concat(chunks));
577
- });
578
- readStream.on("error", error => {
579
- dDone.reject(error);
580
- });
581
- }));
582
- zipFile.on("entry", async (entry) => {
583
- handle_file: {
584
- // NOTE: Skip directories
585
- if (entry.fileName.endsWith("/")) {
586
- break handle_file;
587
- }
588
- let hasEarlyExitBeenCalled = false;
589
- await onArchiveFile({
590
- relativeFilePathInArchive: entry.fileName.split("/").join(path__WEBPACK_IMPORTED_MODULE_5__.sep),
591
- readFile: () => readFile(entry),
592
- writeFile: params => writeFile(entry, params),
593
- earlyExit: () => {
594
- hasEarlyExitBeenCalled = true;
595
- }
596
- });
597
- if (hasEarlyExitBeenCalled) {
598
- zipFile.close();
599
- dDone.resolve();
600
- return;
601
- }
602
- }
603
- zipFile.readEntry();
604
- });
605
- zipFile.readEntry();
606
- await dDone.pr;
607
- }
608
- //# sourceMappingURL=extractArchive.js.map
609
-
610
- /***/ }),
611
-
612
- /***/ 43765:
613
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
614
-
615
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
616
- /* harmony export */ "o": () => (/* binding */ existsAsync)
617
- /* harmony export */ });
618
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73292);
619
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__);
620
-
621
- async function existsAsync(path) {
622
- try {
623
- await fs_promises__WEBPACK_IMPORTED_MODULE_0__.stat(path);
624
- return true;
625
- }
626
- catch (error) {
627
- if (error.code === "ENOENT")
628
- return false;
629
- throw error;
630
- }
631
- }
632
- //# sourceMappingURL=fs.existsAsync.js.map
633
-
634
- /***/ }),
635
-
636
- /***/ 8699:
637
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
638
-
639
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
640
- /* harmony export */ "rm": () => (/* binding */ rm)
641
- /* harmony export */ });
642
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73292);
643
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__);
644
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
645
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
646
- /* harmony import */ var _SemVer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12171);
647
-
648
-
649
-
650
- /**
651
- * Polyfill of fs.rm(dirPath, { "recursive": true })
652
- * For older version of Node
653
- */
654
- async function rm(dirPath, options) {
655
- 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) {
656
- return fs_promises__WEBPACK_IMPORTED_MODULE_0__.rm(dirPath, options);
657
- }
658
- const { force = true } = options;
659
- if (force && !(await checkDirExists(dirPath))) {
660
- return;
661
- }
662
- const removeDir_rec = async (dirPath) => Promise.all((await fs_promises__WEBPACK_IMPORTED_MODULE_0__.readdir(dirPath)).map(async (basename) => {
663
- const fileOrDirpath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
664
- if ((await fs_promises__WEBPACK_IMPORTED_MODULE_0__.lstat(fileOrDirpath)).isDirectory()) {
665
- await removeDir_rec(fileOrDirpath);
666
- }
667
- else {
668
- await fs_promises__WEBPACK_IMPORTED_MODULE_0__.unlink(fileOrDirpath);
669
- }
670
- }));
671
- await removeDir_rec(dirPath);
672
- }
673
- async function checkDirExists(dirPath) {
674
- try {
675
- await fs_promises__WEBPACK_IMPORTED_MODULE_0__.access(dirPath, fs_promises__WEBPACK_IMPORTED_MODULE_0__.constants.F_OK);
676
- return true;
677
- }
678
- catch (_a) {
679
- return false;
680
- }
681
- }
682
- //# sourceMappingURL=fs.rm.js.map
683
-
684
- /***/ }),
685
-
686
687
  /***/ 86644:
687
688
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
688
689