keycloakify 11.5.4 → 11.6.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 (31) hide show
  1. package/bin/153.index.js +81 -28
  2. package/bin/{805.index.js → 174.index.js} +111 -2
  3. package/bin/{356.index.js → 300.index.js} +67 -29
  4. package/bin/{33.index.js → 568.index.js} +2 -113
  5. package/bin/615.index.js +1009 -0
  6. package/bin/653.index.js +53 -135
  7. package/bin/735.index.js +53 -24
  8. package/bin/854.index.js +1 -1
  9. package/bin/{573.index.js → 880.index.js} +155 -9
  10. package/bin/921.index.js +1 -1
  11. package/bin/initialize-admin-theme.d.ts +4 -0
  12. package/bin/main.js +22 -9
  13. package/bin/shared/addPostinstallScriptIfNotPresent.d.ts +10 -0
  14. package/bin/shared/customHandler.d.ts +1 -1
  15. package/bin/shared/customHandler.js.map +1 -1
  16. package/bin/tools/createObjectThatThrowsIfAccessed.d.ts +21 -0
  17. package/bin/tools/npmInstall.d.ts +1 -1
  18. package/package.json +13 -5
  19. package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +3 -1
  20. package/src/bin/initialize-admin-theme.ts +146 -0
  21. package/src/bin/keycloakify/generateResources/generateResources.ts +162 -6
  22. package/src/bin/main.ts +19 -4
  23. package/src/bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.ts +63 -24
  24. package/src/bin/postinstall/installUiModulesPeerDependencies.ts +1 -1
  25. package/src/bin/postinstall/uiModuleMeta.ts +7 -1
  26. package/src/bin/shared/addPostinstallScriptIfNotPresent.ts +70 -0
  27. package/src/bin/shared/customHandler.ts +1 -0
  28. package/src/bin/start-keycloak/realmConfig/defaultConfig/realm-kc-22.json +2201 -0
  29. package/src/bin/start-keycloak/start-keycloak.ts +131 -36
  30. package/src/bin/tools/createObjectThatThrowsIfAccessed.ts +90 -0
  31. package/src/bin/tools/npmInstall.ts +46 -9
package/bin/153.index.js CHANGED
@@ -1317,13 +1317,57 @@ async function command(params) {
1317
1317
  source_default().cyan("On which version of Keycloak do you want to test your theme?"),
1318
1318
  source_default().gray("You can also explicitly provide the version with `npx keycloakify start-keycloak --keycloak-version 26` (or any other version)")
1319
1319
  ].join("\n"));
1320
- const { value: tag } = await dist_default()({
1321
- values: latestMajorTags
1322
- }).catch(() => {
1323
- process.exit(-1);
1324
- });
1325
- console.log(`→ ${tag}`);
1326
- return { dockerImageTag: tag };
1320
+ const tag_userSelected = await (async () => {
1321
+ let tag;
1322
+ let latestMajorTags_copy = [...latestMajorTags];
1323
+ while (true) {
1324
+ const { value } = await dist_default()({
1325
+ values: latestMajorTags_copy
1326
+ }).catch(() => {
1327
+ process.exit(-1);
1328
+ });
1329
+ tag = value;
1330
+ {
1331
+ const doImplementAccountMpa = buildContext.implementedThemeTypes.account.isImplemented &&
1332
+ buildContext.implementedThemeTypes.account.type === "Multi-Page";
1333
+ if (doImplementAccountMpa && tag.startsWith("22.")) {
1334
+ console.log(source_default().yellow(`You are implementing a Multi-Page Account theme. Keycloak 22 is not supported, select another version`));
1335
+ latestMajorTags_copy = latestMajorTags_copy.filter(tag => !tag.startsWith("22."));
1336
+ continue;
1337
+ }
1338
+ }
1339
+ const readMajor = (tag) => {
1340
+ const major = parseInt(tag.split(".")[0]);
1341
+ (0,assert/* assert */.h)(!isNaN(major));
1342
+ return major;
1343
+ };
1344
+ {
1345
+ const major = readMajor(tag);
1346
+ const doImplementAdminTheme = buildContext.implementedThemeTypes.admin.isImplemented;
1347
+ const getIsSupported = (major) => major >= 23;
1348
+ if (doImplementAdminTheme && !getIsSupported(major)) {
1349
+ console.log(source_default().yellow(`You are implementing an Admin theme. Only Keycloak 23 and later are supported, select another version`));
1350
+ latestMajorTags_copy = latestMajorTags_copy.filter(tag => getIsSupported(readMajor(tag)));
1351
+ continue;
1352
+ }
1353
+ }
1354
+ {
1355
+ const doImplementAccountSpa = buildContext.implementedThemeTypes.account.isImplemented &&
1356
+ buildContext.implementedThemeTypes.account.type === "Single-Page";
1357
+ const major = readMajor(tag);
1358
+ const getIsSupported = (major) => major >= 19;
1359
+ if (doImplementAccountSpa && !getIsSupported(major)) {
1360
+ console.log(source_default().yellow(`You are implementing a Single-Page Account theme. Only Keycloak 19 and later are supported, select another version`));
1361
+ latestMajorTags_copy = latestMajorTags_copy.filter(tag => getIsSupported(readMajor(tag)));
1362
+ continue;
1363
+ }
1364
+ }
1365
+ break;
1366
+ }
1367
+ return tag;
1368
+ })();
1369
+ console.log(`→ ${tag_userSelected}`);
1370
+ return { dockerImageTag: tag_userSelected };
1327
1371
  })();
1328
1372
  const keycloakMajorVersionNumber = (() => {
1329
1373
  const [wrap] = getSupportedKeycloakMajorVersions()
@@ -1634,31 +1678,40 @@ async function command(params) {
1634
1678
  ignoreInitial: true
1635
1679
  })
1636
1680
  .on("all", async (...[, filePath]) => {
1637
- ignore_account_spa: {
1638
- const doImplementAccountSpa = buildContext.implementedThemeTypes.account.isImplemented &&
1639
- buildContext.implementedThemeTypes.account.type === "Single-Page";
1640
- if (!doImplementAccountSpa) {
1641
- break ignore_account_spa;
1681
+ ignore_path_covered_by_hmr: {
1682
+ if (filePath.endsWith(".properties")) {
1683
+ break ignore_path_covered_by_hmr;
1642
1684
  }
1643
- if (!(0,isInside/* isInside */.V)({
1644
- dirPath: (0,external_path_.join)(buildContext.themeSrcDirPath, "account"),
1645
- filePath
1646
- })) {
1647
- break ignore_account_spa;
1685
+ if (!doStartDevServer) {
1686
+ break ignore_path_covered_by_hmr;
1648
1687
  }
1649
- return;
1650
- }
1651
- ignore_admin: {
1652
- if (!buildContext.implementedThemeTypes.admin.isImplemented) {
1653
- break ignore_admin;
1688
+ ignore_account_spa: {
1689
+ const doImplementAccountSpa = buildContext.implementedThemeTypes.account.isImplemented &&
1690
+ buildContext.implementedThemeTypes.account.type ===
1691
+ "Single-Page";
1692
+ if (!doImplementAccountSpa) {
1693
+ break ignore_account_spa;
1694
+ }
1695
+ if (!(0,isInside/* isInside */.V)({
1696
+ dirPath: (0,external_path_.join)(buildContext.themeSrcDirPath, "account"),
1697
+ filePath
1698
+ })) {
1699
+ break ignore_account_spa;
1700
+ }
1701
+ return;
1654
1702
  }
1655
- if (!(0,isInside/* isInside */.V)({
1656
- dirPath: (0,external_path_.join)(buildContext.themeSrcDirPath, "admin"),
1657
- filePath
1658
- })) {
1659
- break ignore_admin;
1703
+ ignore_admin: {
1704
+ if (!buildContext.implementedThemeTypes.admin.isImplemented) {
1705
+ break ignore_admin;
1706
+ }
1707
+ if (!(0,isInside/* isInside */.V)({
1708
+ dirPath: (0,external_path_.join)(buildContext.themeSrcDirPath, "admin"),
1709
+ filePath
1710
+ })) {
1711
+ break ignore_admin;
1712
+ }
1713
+ return;
1660
1714
  }
1661
- return;
1662
1715
  }
1663
1716
  console.log(`Detected changes in ${filePath}`);
1664
1717
  await waitForDebounce();
@@ -1,8 +1,64 @@
1
1
  "use strict";
2
- exports.id = 805;
3
- exports.ids = [805];
2
+ exports.id = 174;
3
+ exports.ids = [174];
4
4
  exports.modules = {
5
5
 
6
+ /***/ 50689:
7
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
8
+
9
+
10
+ var __extends = (this && this.__extends) || (function () {
11
+ var extendStatics = function (d, b) {
12
+ extendStatics = Object.setPrototypeOf ||
13
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
14
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
15
+ return extendStatics(d, b);
16
+ };
17
+ return function (d, b) {
18
+ if (typeof b !== "function" && b !== null)
19
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
20
+ extendStatics(d, b);
21
+ function __() { this.constructor = d; }
22
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
23
+ };
24
+ })();
25
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
26
+ exports.VoidDeferred = exports.Deferred = void 0;
27
+ var overwriteReadonlyProp_1 = __webpack_require__(47803);
28
+ var Deferred = /** @class */ (function () {
29
+ function Deferred() {
30
+ var _this_1 = this;
31
+ this.isPending = true;
32
+ var resolve;
33
+ var reject;
34
+ this.pr = new Promise(function (resolve_, reject_) {
35
+ resolve = function (value) {
36
+ (0, overwriteReadonlyProp_1.overwriteReadonlyProp)(_this_1, "isPending", false);
37
+ resolve_(value);
38
+ };
39
+ reject = function (error) {
40
+ (0, overwriteReadonlyProp_1.overwriteReadonlyProp)(_this_1, "isPending", false);
41
+ reject_(error);
42
+ };
43
+ });
44
+ this.resolve = resolve;
45
+ this.reject = reject;
46
+ }
47
+ return Deferred;
48
+ }());
49
+ exports.Deferred = Deferred;
50
+ var VoidDeferred = /** @class */ (function (_super) {
51
+ __extends(VoidDeferred, _super);
52
+ function VoidDeferred() {
53
+ return _super !== null && _super.apply(this, arguments) || this;
54
+ }
55
+ return VoidDeferred;
56
+ }(Deferred));
57
+ exports.VoidDeferred = VoidDeferred;
58
+ //# sourceMappingURL=Deferred.js.map
59
+
60
+ /***/ }),
61
+
6
62
  /***/ 53501:
7
63
  /***/ (function(__unused_webpack_module, exports) {
8
64
 
@@ -653,6 +709,59 @@ exports.Polyfill = typeof Set !== "undefined" ? Set : LightSetImpl;
653
709
 
654
710
  /***/ }),
655
711
 
712
+ /***/ 47803:
713
+ /***/ (function(__unused_webpack_module, exports) {
714
+
715
+
716
+ var __assign = (this && this.__assign) || function () {
717
+ __assign = Object.assign || function(t) {
718
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
719
+ s = arguments[i];
720
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
721
+ t[p] = s[p];
722
+ }
723
+ return t;
724
+ };
725
+ return __assign.apply(this, arguments);
726
+ };
727
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
728
+ exports.overwriteReadonlyProp = void 0;
729
+ /**
730
+ * Assign a value to a property even if the object is freezed or if the property is not writable
731
+ * Throw if the assignation fail ( for example if the property is non configurable write: false )
732
+ * */
733
+ var overwriteReadonlyProp = function (obj, propertyName, value) {
734
+ try {
735
+ obj[propertyName] = value;
736
+ }
737
+ catch (_a) { }
738
+ if (obj[propertyName] === value) {
739
+ return value;
740
+ }
741
+ var errorDefineProperty = undefined;
742
+ var propertyDescriptor = Object.getOwnPropertyDescriptor(obj, propertyName) || {
743
+ "enumerable": true,
744
+ "configurable": true,
745
+ };
746
+ if (!!propertyDescriptor.get) {
747
+ throw new Error("Probably a wrong ides to overwrite ".concat(String(propertyName), " getter"));
748
+ }
749
+ try {
750
+ Object.defineProperty(obj, propertyName, __assign(__assign({}, propertyDescriptor), { value: value }));
751
+ }
752
+ catch (error) {
753
+ errorDefineProperty = error;
754
+ }
755
+ if (obj[propertyName] !== value) {
756
+ throw errorDefineProperty || new Error("Can't assign");
757
+ }
758
+ return value;
759
+ };
760
+ exports.overwriteReadonlyProp = overwriteReadonlyProp;
761
+ //# sourceMappingURL=overwriteReadonlyProp.js.map
762
+
763
+ /***/ }),
764
+
656
765
  /***/ 47393:
657
766
  /***/ ((__unused_webpack_module, exports) => {
658
767
 
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- exports.id = 356;
3
- exports.ids = [356];
2
+ exports.id = 300;
3
+ exports.ids = [300];
4
4
  exports.modules = {
5
5
 
6
6
  /***/ 6385:
@@ -25,31 +25,20 @@ exports.modules = {
25
25
  async function getUiModuleFileSourceCodeReadyToBeCopied(params) {
26
26
  const { buildContext, uiModuleDirPath, fileRelativePath, isForEjection, uiModuleName, uiModuleVersion } = params;
27
27
  let sourceCode = (await fs_promises__WEBPACK_IMPORTED_MODULE_1__.readFile((0,path__WEBPACK_IMPORTED_MODULE_2__.join)(uiModuleDirPath, _shared_constants__WEBPACK_IMPORTED_MODULE_4__/* .KEYCLOAK_THEME */ .PC, fileRelativePath))).toString("utf8");
28
- const toComment = (lines) => {
29
- for (const ext of [".ts", ".tsx", ".css", ".less", ".sass", ".js", ".jsx"]) {
30
- if (!fileRelativePath.endsWith(ext)) {
31
- continue;
32
- }
33
- return [`/**`, ...lines.map(line => ` * ${line}`), ` */`].join("\n");
34
- }
35
- if (fileRelativePath.endsWith(".html")) {
36
- return [`<!--`, ...lines.map(line => ` ${line}`), `-->`].join("\n");
37
- }
38
- return undefined;
39
- };
40
- const comment = toComment(isForEjection
41
- ? [`This file was ejected from ${uiModuleName} version ${uiModuleVersion}.`]
42
- : [
43
- `WARNING: Before modifying this file run the following command:`,
44
- ``,
45
- `$ npx keycloakify eject-file --file ${fileRelativePath.split(path__WEBPACK_IMPORTED_MODULE_2__.sep).join("/")}`,
46
- ``,
47
- `This file comes from ${uiModuleName} version ${uiModuleVersion}.`,
48
- `This file has been copied over to your repo by your postinstall script: \`npx keycloakify postinstall\``
49
- ]);
50
- if (comment !== undefined) {
51
- sourceCode = [comment, ``, sourceCode].join("\n");
52
- }
28
+ sourceCode = addCommentToSourceCode({
29
+ sourceCode,
30
+ fileRelativePath,
31
+ commentLines: isForEjection
32
+ ? [`This file was ejected from ${uiModuleName} version ${uiModuleVersion}.`]
33
+ : [
34
+ `WARNING: Before modifying this file run the following command:`,
35
+ ``,
36
+ `$ npx keycloakify eject-file --file '${fileRelativePath.split(path__WEBPACK_IMPORTED_MODULE_2__.sep).join("/")}'`,
37
+ ``,
38
+ `This file comes from ${uiModuleName} version ${uiModuleVersion}.`,
39
+ `This file has been copied over to your repo by your postinstall script: \`npx keycloakify postinstall\``
40
+ ]
41
+ });
53
42
  const destFilePath = (0,path__WEBPACK_IMPORTED_MODULE_2__.join)(buildContext.themeSrcDirPath, fileRelativePath);
54
43
  format: {
55
44
  if (!(await (0,_tools_runPrettier__WEBPACK_IMPORTED_MODULE_0__/* .getIsPrettierAvailable */ .MT)())) {
@@ -62,6 +51,40 @@ async function getUiModuleFileSourceCodeReadyToBeCopied(params) {
62
51
  }
63
52
  return Buffer.from(sourceCode, "utf8");
64
53
  }
54
+ function addCommentToSourceCode(params) {
55
+ const { sourceCode, fileRelativePath, commentLines } = params;
56
+ const toResult = (comment) => {
57
+ return [comment, ``, sourceCode].join("\n");
58
+ };
59
+ for (const ext of [".ts", ".tsx", ".css", ".less", ".sass", ".js", ".jsx"]) {
60
+ if (!fileRelativePath.endsWith(ext)) {
61
+ continue;
62
+ }
63
+ return toResult([`/**`, ...commentLines.map(line => ` * ${line}`), ` */`].join("\n"));
64
+ }
65
+ if (fileRelativePath.endsWith(".properties")) {
66
+ return toResult(commentLines.map(line => `# ${line}`).join("\n"));
67
+ }
68
+ if (fileRelativePath.endsWith(".html") || fileRelativePath.endsWith(".svg")) {
69
+ const comment = [
70
+ `<!--`,
71
+ ...commentLines.map(line => ` ${line.replace("--file", "-f").replace("Before modifying", "Before modifying or replacing")}`),
72
+ `-->`
73
+ ].join("\n");
74
+ if (fileRelativePath.endsWith(".html") && sourceCode.trim().startsWith("<!")) {
75
+ const [first, ...rest] = sourceCode.split(">");
76
+ const last = rest.join(">");
77
+ return [`${first}>`, comment, last].join("\n");
78
+ }
79
+ if (fileRelativePath.endsWith(".svg") && sourceCode.trim().startsWith("<?")) {
80
+ const [first, ...rest] = sourceCode.split("?>");
81
+ const last = rest.join("?>");
82
+ return [`${first}?>`, comment, last].join("\n");
83
+ }
84
+ return toResult(comment);
85
+ }
86
+ return sourceCode;
87
+ }
65
88
  //# sourceMappingURL=getUiModuleFileSourceCodeReadyToBeCopied.js.map
66
89
 
67
90
  /***/ }),
@@ -166,7 +189,7 @@ async function readManagedGitignoreFile(params) {
166
189
 
167
190
  /***/ }),
168
191
 
169
- /***/ 5038:
192
+ /***/ 58644:
170
193
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
171
194
 
172
195
 
@@ -310,6 +333,20 @@ var getUiModuleFileSourceCodeReadyToBeCopied = __webpack_require__(6385);
310
333
  var external_crypto_ = __webpack_require__(6113);
311
334
  // EXTERNAL MODULE: ./dist/bin/shared/constants.js
312
335
  var constants = __webpack_require__(173);
336
+ ;// CONCATENATED MODULE: ./node_modules/tsafe/esm/isAmong.mjs
337
+ /** https://docs.tsafe.dev/isamong */
338
+ function isAmong(names, value) {
339
+ for (const name of names) {
340
+ if (name === value) {
341
+ return true;
342
+ }
343
+ }
344
+ return false;
345
+ }
346
+
347
+
348
+ //# sourceMappingURL=isAmong.mjs.map
349
+
313
350
  ;// CONCATENATED MODULE: ./dist/bin/postinstall/uiModuleMeta.js
314
351
 
315
352
 
@@ -325,6 +362,7 @@ var constants = __webpack_require__(173);
325
362
 
326
363
 
327
364
 
365
+
328
366
  const zUiModuleMeta = (() => {
329
367
  const zTargetType = lib.z.object({
330
368
  moduleName: lib.z.string(),
@@ -468,7 +506,7 @@ async function getUiModuleMetas(params) {
468
506
  moduleName,
469
507
  version,
470
508
  files,
471
- peerDependencies
509
+ peerDependencies: Object.fromEntries(Object.entries(peerDependencies).filter(([moduleName]) => !isAmong(["react", "@types/react"], moduleName)))
472
510
  });
473
511
  }));
474
512
  update_cache: {
@@ -1,5 +1,5 @@
1
- exports.id = 33;
2
- exports.ids = [33];
1
+ exports.id = 568;
2
+ exports.ids = [568];
3
3
  exports.modules = {
4
4
 
5
5
  /***/ 18512:
@@ -695,63 +695,6 @@ exports.withObjectValues = withObjectValues;
695
695
 
696
696
  /***/ }),
697
697
 
698
- /***/ 50689:
699
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
700
-
701
- "use strict";
702
-
703
- var __extends = (this && this.__extends) || (function () {
704
- var extendStatics = function (d, b) {
705
- extendStatics = Object.setPrototypeOf ||
706
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
707
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
708
- return extendStatics(d, b);
709
- };
710
- return function (d, b) {
711
- if (typeof b !== "function" && b !== null)
712
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
713
- extendStatics(d, b);
714
- function __() { this.constructor = d; }
715
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
716
- };
717
- })();
718
- Object.defineProperty(exports, "__esModule", ({ value: true }));
719
- exports.VoidDeferred = exports.Deferred = void 0;
720
- var overwriteReadonlyProp_1 = __webpack_require__(47803);
721
- var Deferred = /** @class */ (function () {
722
- function Deferred() {
723
- var _this_1 = this;
724
- this.isPending = true;
725
- var resolve;
726
- var reject;
727
- this.pr = new Promise(function (resolve_, reject_) {
728
- resolve = function (value) {
729
- (0, overwriteReadonlyProp_1.overwriteReadonlyProp)(_this_1, "isPending", false);
730
- resolve_(value);
731
- };
732
- reject = function (error) {
733
- (0, overwriteReadonlyProp_1.overwriteReadonlyProp)(_this_1, "isPending", false);
734
- reject_(error);
735
- };
736
- });
737
- this.resolve = resolve;
738
- this.reject = reject;
739
- }
740
- return Deferred;
741
- }());
742
- exports.Deferred = Deferred;
743
- var VoidDeferred = /** @class */ (function (_super) {
744
- __extends(VoidDeferred, _super);
745
- function VoidDeferred() {
746
- return _super !== null && _super.apply(this, arguments) || this;
747
- }
748
- return VoidDeferred;
749
- }(Deferred));
750
- exports.VoidDeferred = VoidDeferred;
751
- //# sourceMappingURL=Deferred.js.map
752
-
753
- /***/ }),
754
-
755
698
  /***/ 65010:
756
699
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
757
700
 
@@ -1115,60 +1058,6 @@ function pendGo(self, fn) {
1115
1058
  }
1116
1059
 
1117
1060
 
1118
- /***/ }),
1119
-
1120
- /***/ 47803:
1121
- /***/ (function(__unused_webpack_module, exports) {
1122
-
1123
- "use strict";
1124
-
1125
- var __assign = (this && this.__assign) || function () {
1126
- __assign = Object.assign || function(t) {
1127
- for (var s, i = 1, n = arguments.length; i < n; i++) {
1128
- s = arguments[i];
1129
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
1130
- t[p] = s[p];
1131
- }
1132
- return t;
1133
- };
1134
- return __assign.apply(this, arguments);
1135
- };
1136
- Object.defineProperty(exports, "__esModule", ({ value: true }));
1137
- exports.overwriteReadonlyProp = void 0;
1138
- /**
1139
- * Assign a value to a property even if the object is freezed or if the property is not writable
1140
- * Throw if the assignation fail ( for example if the property is non configurable write: false )
1141
- * */
1142
- var overwriteReadonlyProp = function (obj, propertyName, value) {
1143
- try {
1144
- obj[propertyName] = value;
1145
- }
1146
- catch (_a) { }
1147
- if (obj[propertyName] === value) {
1148
- return value;
1149
- }
1150
- var errorDefineProperty = undefined;
1151
- var propertyDescriptor = Object.getOwnPropertyDescriptor(obj, propertyName) || {
1152
- "enumerable": true,
1153
- "configurable": true,
1154
- };
1155
- if (!!propertyDescriptor.get) {
1156
- throw new Error("Probably a wrong ides to overwrite ".concat(String(propertyName), " getter"));
1157
- }
1158
- try {
1159
- Object.defineProperty(obj, propertyName, __assign(__assign({}, propertyDescriptor), { value: value }));
1160
- }
1161
- catch (error) {
1162
- errorDefineProperty = error;
1163
- }
1164
- if (obj[propertyName] !== value) {
1165
- throw errorDefineProperty || new Error("Can't assign");
1166
- }
1167
- return value;
1168
- };
1169
- exports.overwriteReadonlyProp = overwriteReadonlyProp;
1170
- //# sourceMappingURL=overwriteReadonlyProp.js.map
1171
-
1172
1061
  /***/ }),
1173
1062
 
1174
1063
  /***/ 78781: