@keycloakify/angular 21.1.5 → 22.0.0-rc.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 (152) hide show
  1. package/README.md +2 -0
  2. package/bin/index.js +72 -1113
  3. package/fesm2022/keycloakify-angular-account-directives-kc-class.mjs +3 -3
  4. package/fesm2022/keycloakify-angular-account-directives-kc-class.mjs.map +1 -1
  5. package/fesm2022/keycloakify-angular-account-pages-account.mjs +3 -3
  6. package/fesm2022/keycloakify-angular-account-pages-account.mjs.map +1 -1
  7. package/fesm2022/keycloakify-angular-account-pages-applications.mjs +3 -3
  8. package/fesm2022/keycloakify-angular-account-pages-applications.mjs.map +1 -1
  9. package/fesm2022/keycloakify-angular-account-pages-federatedIdentity.mjs +3 -3
  10. package/fesm2022/keycloakify-angular-account-pages-federatedIdentity.mjs.map +1 -1
  11. package/fesm2022/keycloakify-angular-account-pages-log.mjs +3 -3
  12. package/fesm2022/keycloakify-angular-account-pages-log.mjs.map +1 -1
  13. package/fesm2022/keycloakify-angular-account-pages-password.mjs +17 -10
  14. package/fesm2022/keycloakify-angular-account-pages-password.mjs.map +1 -1
  15. package/fesm2022/keycloakify-angular-account-pages-sessions.mjs +3 -3
  16. package/fesm2022/keycloakify-angular-account-pages-sessions.mjs.map +1 -1
  17. package/fesm2022/keycloakify-angular-account-pages-totp.mjs +3 -3
  18. package/fesm2022/keycloakify-angular-account-pages-totp.mjs.map +1 -1
  19. package/fesm2022/keycloakify-angular-account-services-account-resource-injector.mjs +3 -3
  20. package/fesm2022/keycloakify-angular-account-services-account-resource-injector.mjs.map +1 -1
  21. package/fesm2022/keycloakify-angular-account-services-i18n.mjs +3 -3
  22. package/fesm2022/keycloakify-angular-account-services-i18n.mjs.map +1 -1
  23. package/fesm2022/keycloakify-angular-account-template.mjs +5 -4
  24. package/fesm2022/keycloakify-angular-account-template.mjs.map +1 -1
  25. package/fesm2022/keycloakify-angular-lib-directives-attributes.mjs +5 -4
  26. package/fesm2022/keycloakify-angular-lib-directives-attributes.mjs.map +1 -1
  27. package/fesm2022/keycloakify-angular-lib-pipes-input-type.mjs +3 -3
  28. package/fesm2022/keycloakify-angular-lib-pipes-input-type.mjs.map +1 -1
  29. package/fesm2022/keycloakify-angular-lib-pipes-is-array-with-empty-object.mjs +3 -3
  30. package/fesm2022/keycloakify-angular-lib-pipes-is-array-with-empty-object.mjs.map +1 -1
  31. package/fesm2022/keycloakify-angular-lib-pipes-kc-sanitize.mjs +3 -3
  32. package/fesm2022/keycloakify-angular-lib-pipes-kc-sanitize.mjs.map +1 -1
  33. package/fesm2022/keycloakify-angular-lib-pipes-to-array.mjs +3 -3
  34. package/fesm2022/keycloakify-angular-lib-pipes-to-array.mjs.map +1 -1
  35. package/fesm2022/keycloakify-angular-lib-pipes-to-number.mjs +3 -3
  36. package/fesm2022/keycloakify-angular-lib-pipes-to-number.mjs.map +1 -1
  37. package/fesm2022/keycloakify-angular-lib-services-resource-injector.mjs +3 -3
  38. package/fesm2022/keycloakify-angular-lib-services-resource-injector.mjs.map +1 -1
  39. package/fesm2022/keycloakify-angular-login-components-add-remove-buttons-multi-valued-attribute.mjs +13 -8
  40. package/fesm2022/keycloakify-angular-login-components-add-remove-buttons-multi-valued-attribute.mjs.map +1 -1
  41. package/fesm2022/keycloakify-angular-login-components-field-errors.mjs +9 -6
  42. package/fesm2022/keycloakify-angular-login-components-field-errors.mjs.map +1 -1
  43. package/fesm2022/keycloakify-angular-login-components-group-label.mjs +9 -6
  44. package/fesm2022/keycloakify-angular-login-components-group-label.mjs.map +1 -1
  45. package/fesm2022/keycloakify-angular-login-components-input-field-by-type.mjs +11 -7
  46. package/fesm2022/keycloakify-angular-login-components-input-field-by-type.mjs.map +1 -1
  47. package/fesm2022/keycloakify-angular-login-components-input-tag-selects.mjs +13 -8
  48. package/fesm2022/keycloakify-angular-login-components-input-tag-selects.mjs.map +1 -1
  49. package/fesm2022/keycloakify-angular-login-components-input-tag.mjs +15 -9
  50. package/fesm2022/keycloakify-angular-login-components-input-tag.mjs.map +1 -1
  51. package/fesm2022/keycloakify-angular-login-components-logout-other-sessions.mjs +3 -3
  52. package/fesm2022/keycloakify-angular-login-components-logout-other-sessions.mjs.map +1 -1
  53. package/fesm2022/keycloakify-angular-login-components-password-wrapper.mjs +7 -5
  54. package/fesm2022/keycloakify-angular-login-components-password-wrapper.mjs.map +1 -1
  55. package/fesm2022/keycloakify-angular-login-components-select-tag.mjs +13 -8
  56. package/fesm2022/keycloakify-angular-login-components-select-tag.mjs.map +1 -1
  57. package/fesm2022/keycloakify-angular-login-components-textarea-tag.mjs +9 -6
  58. package/fesm2022/keycloakify-angular-login-components-textarea-tag.mjs.map +1 -1
  59. package/fesm2022/keycloakify-angular-login-components-user-profile-form-fields.mjs +3 -3
  60. package/fesm2022/keycloakify-angular-login-components-user-profile-form-fields.mjs.map +1 -1
  61. package/fesm2022/keycloakify-angular-login-directives-kc-class.mjs +3 -3
  62. package/fesm2022/keycloakify-angular-login-directives-kc-class.mjs.map +1 -1
  63. package/fesm2022/keycloakify-angular-login-pages-code.mjs +9 -6
  64. package/fesm2022/keycloakify-angular-login-pages-code.mjs.map +1 -1
  65. package/fesm2022/keycloakify-angular-login-pages-delete-account-confirm.mjs +9 -6
  66. package/fesm2022/keycloakify-angular-login-pages-delete-account-confirm.mjs.map +1 -1
  67. package/fesm2022/keycloakify-angular-login-pages-delete-credential.mjs +9 -6
  68. package/fesm2022/keycloakify-angular-login-pages-delete-credential.mjs.map +1 -1
  69. package/fesm2022/keycloakify-angular-login-pages-error.mjs +9 -6
  70. package/fesm2022/keycloakify-angular-login-pages-error.mjs.map +1 -1
  71. package/fesm2022/keycloakify-angular-login-pages-frontchannel-logout.mjs +11 -7
  72. package/fesm2022/keycloakify-angular-login-pages-frontchannel-logout.mjs.map +1 -1
  73. package/fesm2022/keycloakify-angular-login-pages-idp-review-user-profile.mjs +11 -7
  74. package/fesm2022/keycloakify-angular-login-pages-idp-review-user-profile.mjs.map +1 -1
  75. package/fesm2022/keycloakify-angular-login-pages-info.mjs +9 -6
  76. package/fesm2022/keycloakify-angular-login-pages-info.mjs.map +1 -1
  77. package/fesm2022/keycloakify-angular-login-pages-link-idp-action.mjs +9 -6
  78. package/fesm2022/keycloakify-angular-login-pages-link-idp-action.mjs.map +1 -1
  79. package/fesm2022/keycloakify-angular-login-pages-login-config-totp.mjs +9 -6
  80. package/fesm2022/keycloakify-angular-login-pages-login-config-totp.mjs.map +1 -1
  81. package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm-override.mjs +9 -6
  82. package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm-override.mjs.map +1 -1
  83. package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm.mjs +9 -6
  84. package/fesm2022/keycloakify-angular-login-pages-login-idp-link-confirm.mjs.map +1 -1
  85. package/fesm2022/keycloakify-angular-login-pages-login-idp-link-email.mjs +9 -6
  86. package/fesm2022/keycloakify-angular-login-pages-login-idp-link-email.mjs.map +1 -1
  87. package/fesm2022/keycloakify-angular-login-pages-login-oauth-grant.mjs +9 -6
  88. package/fesm2022/keycloakify-angular-login-pages-login-oauth-grant.mjs.map +1 -1
  89. package/fesm2022/keycloakify-angular-login-pages-login-oauth2-device-verify-user-code.mjs +9 -6
  90. package/fesm2022/keycloakify-angular-login-pages-login-oauth2-device-verify-user-code.mjs.map +1 -1
  91. package/fesm2022/keycloakify-angular-login-pages-login-otp.mjs +9 -6
  92. package/fesm2022/keycloakify-angular-login-pages-login-otp.mjs.map +1 -1
  93. package/fesm2022/keycloakify-angular-login-pages-login-page-expired.mjs +9 -6
  94. package/fesm2022/keycloakify-angular-login-pages-login-page-expired.mjs.map +1 -1
  95. package/fesm2022/keycloakify-angular-login-pages-login-passkeys-conditional-authenticate.mjs +9 -6
  96. package/fesm2022/keycloakify-angular-login-pages-login-passkeys-conditional-authenticate.mjs.map +1 -1
  97. package/fesm2022/keycloakify-angular-login-pages-login-password.mjs +11 -7
  98. package/fesm2022/keycloakify-angular-login-pages-login-password.mjs.map +1 -1
  99. package/fesm2022/keycloakify-angular-login-pages-login-recovery-authn-code-config.mjs +11 -7
  100. package/fesm2022/keycloakify-angular-login-pages-login-recovery-authn-code-config.mjs.map +1 -1
  101. package/fesm2022/keycloakify-angular-login-pages-login-recovery-authn-code-input.mjs +9 -6
  102. package/fesm2022/keycloakify-angular-login-pages-login-recovery-authn-code-input.mjs.map +1 -1
  103. package/fesm2022/keycloakify-angular-login-pages-login-reset-otp.mjs +9 -6
  104. package/fesm2022/keycloakify-angular-login-pages-login-reset-otp.mjs.map +1 -1
  105. package/fesm2022/keycloakify-angular-login-pages-login-reset-password.mjs +9 -6
  106. package/fesm2022/keycloakify-angular-login-pages-login-reset-password.mjs.map +1 -1
  107. package/fesm2022/keycloakify-angular-login-pages-login-update-password.mjs +9 -6
  108. package/fesm2022/keycloakify-angular-login-pages-login-update-password.mjs.map +1 -1
  109. package/fesm2022/keycloakify-angular-login-pages-login-update-profile.mjs +11 -7
  110. package/fesm2022/keycloakify-angular-login-pages-login-update-profile.mjs.map +1 -1
  111. package/fesm2022/keycloakify-angular-login-pages-login-username.mjs +11 -7
  112. package/fesm2022/keycloakify-angular-login-pages-login-username.mjs.map +1 -1
  113. package/fesm2022/keycloakify-angular-login-pages-login-verify-email.mjs +9 -6
  114. package/fesm2022/keycloakify-angular-login-pages-login-verify-email.mjs.map +1 -1
  115. package/fesm2022/keycloakify-angular-login-pages-login-x509-info.mjs +9 -6
  116. package/fesm2022/keycloakify-angular-login-pages-login-x509-info.mjs.map +1 -1
  117. package/fesm2022/keycloakify-angular-login-pages-login.mjs +11 -7
  118. package/fesm2022/keycloakify-angular-login-pages-login.mjs.map +1 -1
  119. package/fesm2022/keycloakify-angular-login-pages-logout-confirm.mjs +9 -6
  120. package/fesm2022/keycloakify-angular-login-pages-logout-confirm.mjs.map +1 -1
  121. package/fesm2022/keycloakify-angular-login-pages-register.mjs +13 -8
  122. package/fesm2022/keycloakify-angular-login-pages-register.mjs.map +1 -1
  123. package/fesm2022/keycloakify-angular-login-pages-saml-post-form.mjs +11 -7
  124. package/fesm2022/keycloakify-angular-login-pages-saml-post-form.mjs.map +1 -1
  125. package/fesm2022/keycloakify-angular-login-pages-select-authenticator.mjs +9 -6
  126. package/fesm2022/keycloakify-angular-login-pages-select-authenticator.mjs.map +1 -1
  127. package/fesm2022/keycloakify-angular-login-pages-terms.mjs +9 -6
  128. package/fesm2022/keycloakify-angular-login-pages-terms.mjs.map +1 -1
  129. package/fesm2022/keycloakify-angular-login-pages-update-email.mjs +11 -7
  130. package/fesm2022/keycloakify-angular-login-pages-update-email.mjs.map +1 -1
  131. package/fesm2022/keycloakify-angular-login-pages-webauthn-authenticate.mjs +9 -6
  132. package/fesm2022/keycloakify-angular-login-pages-webauthn-authenticate.mjs.map +1 -1
  133. package/fesm2022/keycloakify-angular-login-pages-webauthn-error.mjs +9 -6
  134. package/fesm2022/keycloakify-angular-login-pages-webauthn-error.mjs.map +1 -1
  135. package/fesm2022/keycloakify-angular-login-pages-webauthn-register.mjs +9 -6
  136. package/fesm2022/keycloakify-angular-login-pages-webauthn-register.mjs.map +1 -1
  137. package/fesm2022/keycloakify-angular-login-services-i18n.mjs +3 -3
  138. package/fesm2022/keycloakify-angular-login-services-i18n.mjs.map +1 -1
  139. package/fesm2022/keycloakify-angular-login-services-login-resource-injector.mjs +3 -3
  140. package/fesm2022/keycloakify-angular-login-services-login-resource-injector.mjs.map +1 -1
  141. package/fesm2022/keycloakify-angular-login-services-user-profile-form.mjs +3 -3
  142. package/fesm2022/keycloakify-angular-login-services-user-profile-form.mjs.map +1 -1
  143. package/fesm2022/keycloakify-angular-login-template.mjs +13 -8
  144. package/fesm2022/keycloakify-angular-login-template.mjs.map +1 -1
  145. package/package.json +1 -1
  146. package/src/bin/initialize-account-theme/boilerplate/KcPageStory.ts +2 -0
  147. package/src/bin/tsconfig.json +4 -5
  148. package/bin/187.index.js +0 -514
  149. package/bin/202.index.js +0 -7778
  150. package/bin/476.index.js +0 -400
  151. package/bin/671.index.js +0 -1354
  152. package/bin/942.index.js +0 -911
package/bin/942.index.js DELETED
@@ -1,911 +0,0 @@
1
- export const id = 942;
2
- export const ids = [942];
3
- export const modules = {
4
-
5
- /***/ 814:
6
- /***/ ((module) => {
7
-
8
-
9
- const x = module.exports;
10
- const ESC = '\u001B[';
11
- const OSC = '\u001B]';
12
- const BEL = '\u0007';
13
- const SEP = ';';
14
- const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal';
15
-
16
- x.cursorTo = (x, y) => {
17
- if (typeof x !== 'number') {
18
- throw new TypeError('The `x` argument is required');
19
- }
20
-
21
- if (typeof y !== 'number') {
22
- return ESC + (x + 1) + 'G';
23
- }
24
-
25
- return ESC + (y + 1) + ';' + (x + 1) + 'H';
26
- };
27
-
28
- x.cursorMove = (x, y) => {
29
- if (typeof x !== 'number') {
30
- throw new TypeError('The `x` argument is required');
31
- }
32
-
33
- let ret = '';
34
-
35
- if (x < 0) {
36
- ret += ESC + (-x) + 'D';
37
- } else if (x > 0) {
38
- ret += ESC + x + 'C';
39
- }
40
-
41
- if (y < 0) {
42
- ret += ESC + (-y) + 'A';
43
- } else if (y > 0) {
44
- ret += ESC + y + 'B';
45
- }
46
-
47
- return ret;
48
- };
49
-
50
- x.cursorUp = count => ESC + (typeof count === 'number' ? count : 1) + 'A';
51
- x.cursorDown = count => ESC + (typeof count === 'number' ? count : 1) + 'B';
52
- x.cursorForward = count => ESC + (typeof count === 'number' ? count : 1) + 'C';
53
- x.cursorBackward = count => ESC + (typeof count === 'number' ? count : 1) + 'D';
54
-
55
- x.cursorLeft = ESC + 'G';
56
- x.cursorSavePosition = ESC + (isTerminalApp ? '7' : 's');
57
- x.cursorRestorePosition = ESC + (isTerminalApp ? '8' : 'u');
58
- x.cursorGetPosition = ESC + '6n';
59
- x.cursorNextLine = ESC + 'E';
60
- x.cursorPrevLine = ESC + 'F';
61
- x.cursorHide = ESC + '?25l';
62
- x.cursorShow = ESC + '?25h';
63
-
64
- x.eraseLines = count => {
65
- let clear = '';
66
-
67
- for (let i = 0; i < count; i++) {
68
- clear += x.eraseLine + (i < count - 1 ? x.cursorUp() : '');
69
- }
70
-
71
- if (count) {
72
- clear += x.cursorLeft;
73
- }
74
-
75
- return clear;
76
- };
77
-
78
- x.eraseEndLine = ESC + 'K';
79
- x.eraseStartLine = ESC + '1K';
80
- x.eraseLine = ESC + '2K';
81
- x.eraseDown = ESC + 'J';
82
- x.eraseUp = ESC + '1J';
83
- x.eraseScreen = ESC + '2J';
84
- x.scrollUp = ESC + 'S';
85
- x.scrollDown = ESC + 'T';
86
-
87
- x.clearScreen = '\u001Bc';
88
-
89
- x.clearTerminal = process.platform === 'win32' ?
90
- `${x.eraseScreen}${ESC}0f` :
91
- // 1. Erases the screen (Only done in case `2` is not supported)
92
- // 2. Erases the whole screen including scrollback buffer
93
- // 3. Moves cursor to the top-left position
94
- // More info: https://www.real-world-systems.com/docs/ANSIcode.html
95
- `${x.eraseScreen}${ESC}3J${ESC}H`;
96
-
97
- x.beep = BEL;
98
-
99
- x.link = (text, url) => {
100
- return [
101
- OSC,
102
- '8',
103
- SEP,
104
- SEP,
105
- url,
106
- BEL,
107
- text,
108
- OSC,
109
- '8',
110
- SEP,
111
- SEP,
112
- BEL
113
- ].join('');
114
- };
115
-
116
- x.image = (buf, opts) => {
117
- opts = opts || {};
118
-
119
- let ret = OSC + '1337;File=inline=1';
120
-
121
- if (opts.width) {
122
- ret += `;width=${opts.width}`;
123
- }
124
-
125
- if (opts.height) {
126
- ret += `;height=${opts.height}`;
127
- }
128
-
129
- if (opts.preserveAspectRatio === false) {
130
- ret += ';preserveAspectRatio=0';
131
- }
132
-
133
- return ret + ':' + buf.toString('base64') + BEL;
134
- };
135
-
136
- x.iTerm = {};
137
-
138
- x.iTerm.setCwd = cwd => OSC + '50;CurrentDir=' + (cwd || process.cwd()) + BEL;
139
-
140
-
141
- /***/ }),
142
-
143
- /***/ 672:
144
- /***/ ((__unused_webpack_module, exports) => {
145
-
146
-
147
-
148
- Object.defineProperty(exports, "__esModule", ({
149
- value: true
150
- }));
151
- exports.withPromise = exports.withCallback = void 0;
152
-
153
- /**
154
- * Open the input with a normal callback function
155
- *
156
- * @param {Input} input - input object
157
- * @param {function} valueMapper - function which maps the resulting id and value back to the expected format
158
- * @param {function} callback - callback function
159
- */
160
- const withCallback = (input, valueMapper, callback) => {
161
- input.open();
162
- input.onSelect((id, value) => callback(valueMapper(id, value)));
163
- };
164
- /**
165
- * Open the input with a promise
166
- *
167
- * @param {Input} input - input object
168
- * @param {function} valueMapper - function which maps the resulting id and value back to the expected format
169
- */
170
-
171
-
172
- exports.withCallback = withCallback;
173
-
174
- const withPromise = (input, valueMapper) => {
175
- return new Promise((resolve, reject) => {
176
- input.open();
177
- input.onSelect((id, value) => {
178
- if (id === null) {
179
- reject();
180
- } else {
181
- resolve(valueMapper(id, value));
182
- }
183
- });
184
- });
185
- };
186
-
187
- exports.withPromise = withPromise;
188
-
189
- /***/ }),
190
-
191
- /***/ 546:
192
- /***/ ((module, exports, __webpack_require__) => {
193
-
194
-
195
-
196
- Object.defineProperty(exports, "__esModule", ({
197
- value: true
198
- }));
199
- exports["default"] = void 0;
200
-
201
- var _input = _interopRequireDefault(__webpack_require__(938));
202
-
203
- var _renderer = _interopRequireDefault(__webpack_require__(547));
204
-
205
- var _callbackMappers = __webpack_require__(672);
206
-
207
- var _valueMappers = __webpack_require__(348);
208
-
209
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
210
-
211
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
212
-
213
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
214
-
215
- /**
216
- * Default options
217
- */
218
- const defaultOptions = {
219
- outputStream: process.stdout,
220
- inputStream: process.stdin,
221
- values: [],
222
- defaultValue: 0,
223
- selected: '(x)',
224
- unselected: '( )',
225
- indentation: 0,
226
- cleanup: true,
227
- valueRenderer: value => value
228
- };
229
- /**
230
- * Create an instance of cli-select with the given options
231
- *
232
- * @param {object} options - options for cli-select
233
- * @param {function} callback - if specified, a callback will be used, otherwise a promise gets returned (optional)
234
- */
235
-
236
- const creator = (options, callback) => {
237
- // merge options with default options
238
- options = _objectSpread({}, defaultOptions, options); // create renderer and input instances
239
-
240
- const renderer = new _renderer.default(options, options.outputStream);
241
- const input = new _input.default(options.inputStream);
242
- input.setDefaultValue(options.defaultValue);
243
- input.attachRenderer(renderer); // handle array and object values
244
-
245
- let valueMapper;
246
-
247
- if (Array.isArray(options.values)) {
248
- valueMapper = (0, _valueMappers.withArrayValues)(options);
249
- } else {
250
- valueMapper = (0, _valueMappers.withObjectValues)(options);
251
- } // map values
252
-
253
-
254
- options.values = valueMapper.input;
255
- input.setValues(options.values); // handle different callback methods
256
-
257
- if (typeof callback === 'function') {
258
- return (0, _callbackMappers.withCallback)(input, valueMapper.output, callback);
259
- } else {
260
- return (0, _callbackMappers.withPromise)(input, valueMapper.output);
261
- }
262
- };
263
-
264
- exports = module.exports = creator;
265
- Object.defineProperty(exports, "__esModule", ({
266
- value: true
267
- }));
268
- var _default = creator;
269
- exports["default"] = _default;
270
-
271
- /***/ }),
272
-
273
- /***/ 938:
274
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
275
-
276
-
277
-
278
- Object.defineProperty(exports, "__esModule", ({
279
- value: true
280
- }));
281
- exports["default"] = void 0;
282
-
283
- var _readline = _interopRequireDefault(__webpack_require__(785));
284
-
285
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
286
-
287
- /**
288
- * Handle cli input
289
- */
290
- class Input {
291
- /**
292
- * Input constructor
293
- *
294
- * @param {any} stream - stream to catch (optional)
295
- */
296
- constructor(stream = process.stdin) {
297
- // set default values
298
- this.stream = stream;
299
- this.values = [];
300
- this.selectedValue = 0;
301
-
302
- this.onSelectListener = () => {};
303
-
304
- this.onKeyPress = this.onKeyPress.bind(this);
305
- }
306
- /**
307
- * Set the available values
308
- *
309
- * @param {array} values - all available values
310
- */
311
-
312
-
313
- setValues(values) {
314
- this.values = values;
315
-
316
- if (this.renderer) {
317
- this.renderer.setValues(values);
318
- }
319
- }
320
- /**
321
- * Set the default value
322
- *
323
- * @param {number} defaultValue - default value id
324
- */
325
-
326
-
327
- setDefaultValue(defaultValue) {
328
- this.selectedValue = defaultValue;
329
- }
330
- /**
331
- * Attach a renderer to the input catcher
332
- *
333
- * @param {Renderer} renderer - renderer to use for rendering responses
334
- */
335
-
336
-
337
- attachRenderer(renderer) {
338
- this.renderer = renderer;
339
- this.renderer.setValues(this.values);
340
- }
341
- /**
342
- * Register an on select listener
343
- *
344
- * @param {function} listener - listener function which receives two parameters: valueId and value
345
- */
346
-
347
-
348
- onSelect(listener) {
349
- this.onSelectListener = listener;
350
- }
351
- /**
352
- * Open the stream and listen for input
353
- */
354
-
355
-
356
- open() {
357
- // register keypress event
358
- _readline.default.emitKeypressEvents(this.stream); // handle keypress
359
-
360
-
361
- this.stream.on('keypress', this.onKeyPress); // initially render the response
362
-
363
- if (this.renderer) {
364
- this.renderer.render(this.selectedValue);
365
- } // hide pressed keys and start listening on input
366
-
367
-
368
- this.stream.setRawMode(true);
369
- this.stream.resume();
370
- }
371
- /**
372
- * Close the stream
373
- *
374
- * @param {boolean} cancelled - true if no value was selected (optional)
375
- */
376
-
377
-
378
- close(cancelled = false) {
379
- // reset stream properties
380
- this.stream.setRawMode(false);
381
- this.stream.pause(); // cleanup the output
382
-
383
- if (this.renderer) {
384
- this.renderer.cleanup();
385
- } // call the on select listener
386
-
387
-
388
- if (cancelled) {
389
- this.onSelectListener(null);
390
- } else {
391
- this.onSelectListener(this.selectedValue, this.values[this.selectedValue]);
392
- }
393
-
394
- this.stream.removeListener('keypress', this.onKeyPress);
395
- }
396
- /**
397
- * Render the response
398
- */
399
-
400
-
401
- render() {
402
- if (!this.renderer) {
403
- return;
404
- }
405
-
406
- this.renderer.render(this.selectedValue);
407
- }
408
- /**
409
- * Handle key press event
410
- *
411
- * @param {string} string - input string
412
- * @param {object} key - object containing information about the pressed key
413
- */
414
-
415
-
416
- onKeyPress(string, key) {
417
- if (key) {
418
- if (key.name === 'up' && this.selectedValue > 0) {
419
- this.selectedValue--;
420
- this.render();
421
- } else if (key.name === 'down' && this.selectedValue + 1 < this.values.length) {
422
- this.selectedValue++;
423
- this.render();
424
- } else if (key.name === 'return') {
425
- this.close();
426
- } else if (key.name === 'escape' || key.name === 'c' && key.ctrl) {
427
- this.close(true);
428
- }
429
- }
430
- }
431
-
432
- }
433
-
434
- exports["default"] = Input;
435
-
436
- /***/ }),
437
-
438
- /***/ 547:
439
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
440
-
441
-
442
-
443
- Object.defineProperty(exports, "__esModule", ({
444
- value: true
445
- }));
446
- exports["default"] = void 0;
447
-
448
- var _readline = _interopRequireDefault(__webpack_require__(785));
449
-
450
- var _ansiEscapes = __webpack_require__(814);
451
-
452
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
453
-
454
- /**
455
- * Response renderer
456
- */
457
- class Renderer {
458
- /**
459
- * Renderer constructor
460
- *
461
- * @param {object} options - renderer options
462
- * @param {any} stream - stream to write to (optional)
463
- */
464
- constructor(options, stream = process.stdout) {
465
- this.options = options;
466
- this.stream = stream;
467
- this.values = [];
468
- this.initialRender = true;
469
- }
470
- /**
471
- * Set the available values
472
- *
473
- * @param {array} values - all available values
474
- */
475
-
476
-
477
- setValues(values) {
478
- this.values = values;
479
- }
480
- /**
481
- * Render the values
482
- *
483
- * @param {number} selectedValue - selected value (optional)
484
- */
485
-
486
-
487
- render(selectedValue = 0) {
488
- if (this.initialRender) {
489
- // hide the cursor initially
490
- this.initialRender = false;
491
- this.stream.write(_ansiEscapes.cursorHide);
492
- } else {
493
- // remove previous lines and values
494
- this.stream.write((0, _ansiEscapes.eraseLines)(this.values.length));
495
- } // output the current values
496
-
497
-
498
- this.values.forEach((value, index) => {
499
- const symbol = selectedValue === index ? this.options.selected : this.options.unselected;
500
- const indentation = ' '.repeat(this.options.indentation);
501
- const renderedValue = this.options.valueRenderer(value, selectedValue === index);
502
- const end = index !== this.values.length - 1 ? '\n' : '';
503
- this.stream.write(indentation + symbol + ' ' + renderedValue + end);
504
- });
505
- }
506
- /**
507
- * Cleanup the console at the end
508
- */
509
-
510
-
511
- cleanup() {
512
- this.stream.write((0, _ansiEscapes.eraseLines)(this.values.length));
513
- this.stream.write(_ansiEscapes.cursorShow);
514
- }
515
-
516
- }
517
-
518
- exports["default"] = Renderer;
519
-
520
- /***/ }),
521
-
522
- /***/ 348:
523
- /***/ ((__unused_webpack_module, exports) => {
524
-
525
-
526
-
527
- Object.defineProperty(exports, "__esModule", ({
528
- value: true
529
- }));
530
- exports.withObjectValues = exports.withArrayValues = void 0;
531
-
532
- /**
533
- * Map incoming and outgoing values if the initial values are an array
534
- *
535
- * @param {object} options - cli-select options
536
- */
537
- const withArrayValues = options => {
538
- return {
539
- input: options.values,
540
- output: (id, value) => {
541
- return {
542
- id,
543
- value
544
- };
545
- }
546
- };
547
- };
548
- /**
549
- * Map incoming and outgoing values if the initial values are an object
550
- *
551
- * @param {object} options - cli-select options
552
- */
553
-
554
-
555
- exports.withArrayValues = withArrayValues;
556
-
557
- const withObjectValues = options => {
558
- const originalValues = options.values;
559
- return {
560
- input: Object.values(originalValues),
561
- output: (id, value) => {
562
- return {
563
- id: Object.keys(originalValues)[id],
564
- value
565
- };
566
- }
567
- };
568
- };
569
-
570
- exports.withObjectValues = withObjectValues;
571
-
572
- /***/ }),
573
-
574
- /***/ 942:
575
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
576
-
577
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
578
- /* harmony export */ command: () => (/* binding */ command)
579
- /* harmony export */ });
580
- /* harmony import */ var _tools_getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(221);
581
- /* harmony import */ var cli_select__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(546);
582
- /* harmony import */ var cli_select__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cli_select__WEBPACK_IMPORTED_MODULE_0__);
583
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(896);
584
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
585
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(928);
586
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
587
- /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(559);
588
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(276);
589
- /* harmony import */ var _tools_runPrettier__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(915);
590
- /* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(316);
591
-
592
-
593
-
594
-
595
-
596
-
597
-
598
-
599
- async function command(params) {
600
- const { buildContext } = params;
601
- console.log(chalk__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Ay.cyan('Theme type:'));
602
- const themeType = await (async () => {
603
- const values = _core__WEBPACK_IMPORTED_MODULE_4__/* .THEME_TYPES */ .qA.filter(themeType => {
604
- switch (themeType) {
605
- case 'account':
606
- return buildContext.implementedThemeTypes.account.isImplemented;
607
- case 'login':
608
- return buildContext.implementedThemeTypes.login.isImplemented;
609
- case 'admin':
610
- return false;
611
- }
612
- (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .v)(false);
613
- });
614
- (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .v)(values.length > 0, 'No theme is implemented in this project');
615
- if (values.length === 1) {
616
- return values[0];
617
- }
618
- const { value } = await cli_select__WEBPACK_IMPORTED_MODULE_0___default()({
619
- values
620
- }).catch(() => {
621
- process.exit(-1);
622
- });
623
- return value;
624
- })();
625
- console.log(`→ ${themeType}`);
626
- console.log(chalk__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Ay.cyan('Select the page you want to create a Storybook for:'));
627
- const { value: pageId } = await cli_select__WEBPACK_IMPORTED_MODULE_0___default()({
628
- values: (() => {
629
- switch (themeType) {
630
- case 'login':
631
- return [..._core__WEBPACK_IMPORTED_MODULE_4__/* .LOGIN_THEME_PAGE_IDS */ .hz];
632
- case 'account':
633
- return [..._core__WEBPACK_IMPORTED_MODULE_4__/* .ACCOUNT_THEME_PAGE_IDS */ .Hp];
634
- case 'admin':
635
- return [];
636
- }
637
- (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .v)(false);
638
- })()
639
- }).catch(() => {
640
- process.exit(-1);
641
- });
642
- console.log(`→ ${pageId}`);
643
- const componentBasename = pageId.replace(/ftl$/, 'stories.ts');
644
- const targetFilePath = (0,path__WEBPACK_IMPORTED_MODULE_2__.join)(buildContext.themeSrcDirPath, themeType, 'pages', pageId.replace(/\.ftl$/, ''), componentBasename);
645
- if (fs__WEBPACK_IMPORTED_MODULE_1__.existsSync(targetFilePath)) {
646
- console.log(`${(0,path__WEBPACK_IMPORTED_MODULE_2__.relative)(process.cwd(), targetFilePath)} already exists`);
647
- process.exit(-1);
648
- }
649
- let sourceCode = fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync((0,path__WEBPACK_IMPORTED_MODULE_2__.join)((0,_tools_getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_6__/* .getThisCodebaseRootDirPath */ .J)(), 'stories', themeType, 'pages', componentBasename))
650
- .toString('utf8')
651
- .replace(/["']\.\.\/KcPageStory["']/, "'../../KcPageStory'");
652
- run_prettier: {
653
- if (!(await (0,_tools_runPrettier__WEBPACK_IMPORTED_MODULE_7__/* .getIsPrettierAvailable */ .L)())) {
654
- break run_prettier;
655
- }
656
- sourceCode = await (0,_tools_runPrettier__WEBPACK_IMPORTED_MODULE_7__/* .runPrettier */ .JS)({
657
- filePath: targetFilePath,
658
- sourceCode: sourceCode
659
- });
660
- }
661
- {
662
- const targetDirPath = (0,path__WEBPACK_IMPORTED_MODULE_2__.dirname)(targetFilePath);
663
- if (!fs__WEBPACK_IMPORTED_MODULE_1__.existsSync(targetDirPath)) {
664
- fs__WEBPACK_IMPORTED_MODULE_1__.mkdirSync(targetDirPath, { recursive: true });
665
- }
666
- }
667
- fs__WEBPACK_IMPORTED_MODULE_1__.writeFileSync(targetFilePath, Buffer.from(sourceCode, 'utf8'));
668
- console.log([
669
- `${chalk__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Ay.green('✓')} ${chalk__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Ay.bold((0,path__WEBPACK_IMPORTED_MODULE_2__.join)('.', (0,path__WEBPACK_IMPORTED_MODULE_2__.relative)(process.cwd(), targetFilePath)))} copy pasted from the Keycloakify source code into your project`,
670
- `You can start storybook with ${chalk__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Ay.bold('npm run storybook')}`
671
- ].join('\n'));
672
- }
673
-
674
-
675
- /***/ }),
676
-
677
- /***/ 221:
678
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
679
-
680
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
681
- /* harmony export */ J: () => (/* binding */ getThisCodebaseRootDirPath),
682
- /* harmony export */ x: () => (/* binding */ getNearestPackageJsonDirPath)
683
- /* harmony export */ });
684
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(896);
685
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
686
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(928);
687
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
688
- /* harmony import */ var url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
689
- /* harmony import */ var url__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(url__WEBPACK_IMPORTED_MODULE_2__);
690
-
691
-
692
-
693
- const __dirname = path__WEBPACK_IMPORTED_MODULE_1__.dirname(url__WEBPACK_IMPORTED_MODULE_2__.fileURLToPath(import.meta.url));
694
- function getThisCodebaseRootDirPath_rec(dirPath) {
695
- if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(path__WEBPACK_IMPORTED_MODULE_1__.join(dirPath, 'LICENSE'))) {
696
- return dirPath;
697
- }
698
- return getThisCodebaseRootDirPath_rec(path__WEBPACK_IMPORTED_MODULE_1__.join(dirPath, '..'));
699
- }
700
- let result = undefined;
701
- function getThisCodebaseRootDirPath() {
702
- if (result !== undefined) {
703
- return result;
704
- }
705
- return (result = getThisCodebaseRootDirPath_rec(__dirname));
706
- }
707
- function getNearestPackageJsonDirPath(dirPath) {
708
- if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(path__WEBPACK_IMPORTED_MODULE_1__.join(dirPath, 'package.json'))) {
709
- return dirPath;
710
- }
711
- return getNearestPackageJsonDirPath(path__WEBPACK_IMPORTED_MODULE_1__.join(dirPath, '..'));
712
- }
713
-
714
-
715
- /***/ }),
716
-
717
- /***/ 395:
718
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
719
-
720
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
721
- /* harmony export */ p: () => (/* binding */ getNodeModulesBinDirPath)
722
- /* harmony export */ });
723
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(928);
724
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
725
- /* harmony import */ var _getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(221);
726
-
727
-
728
- let cache = undefined;
729
- /** NOTE: Careful, this function can fail when the binary
730
- * Used is not in the node_modules directory of the project
731
- * (for example when running tests with vscode extension we'll get
732
- * '/Users/dylan/.vscode/extensions/vitest.explorer-1.16.0/dist/worker.js'
733
- *
734
- * instead of
735
- * '/Users/joseph/.nvm/versions/node/v22.12.0/bin/node'
736
- * or
737
- * '/Users/joseph/github/keycloakify-starter/node_modules/.bin/vite'
738
- *
739
- * as the value of process.argv[1]
740
- */
741
- function getNodeModulesBinDirPath() {
742
- if (cache !== undefined) {
743
- return cache;
744
- }
745
- const binPath = process.argv[1];
746
- special_case_running_not_from_distribution: {
747
- if (!binPath.endsWith('.ts')) {
748
- break special_case_running_not_from_distribution;
749
- }
750
- const packageJsonDirPath = (0,_getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_1__/* .getNearestPackageJsonDirPath */ .x)((0,path__WEBPACK_IMPORTED_MODULE_0__.dirname)(binPath));
751
- const nodeModulesBinDirPath = (0,path__WEBPACK_IMPORTED_MODULE_0__.join)(packageJsonDirPath, 'node_modules', '.bin');
752
- return nodeModulesBinDirPath;
753
- }
754
- const segments = ['.bin'];
755
- let foundNodeModules = false;
756
- for (const segment of binPath.split(path__WEBPACK_IMPORTED_MODULE_0__.sep).reverse()) {
757
- skip_segment: {
758
- if (foundNodeModules) {
759
- break skip_segment;
760
- }
761
- if (segment === 'node_modules') {
762
- foundNodeModules = true;
763
- break skip_segment;
764
- }
765
- continue;
766
- }
767
- segments.unshift(segment);
768
- }
769
- if (!foundNodeModules) {
770
- throw new Error(`Could not find node_modules in path ${binPath}`);
771
- }
772
- const nodeModulesBinDirPath = segments.join(path__WEBPACK_IMPORTED_MODULE_0__.sep);
773
- cache = nodeModulesBinDirPath;
774
- return nodeModulesBinDirPath;
775
- }
776
-
777
-
778
- /***/ }),
779
-
780
- /***/ 915:
781
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
782
-
783
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
784
- /* harmony export */ JS: () => (/* binding */ runPrettier),
785
- /* harmony export */ L: () => (/* binding */ getIsPrettierAvailable)
786
- /* harmony export */ });
787
- /* unused harmony export getPrettier */
788
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(276);
789
- /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(982);
790
- /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_0__);
791
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(943);
792
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_1__);
793
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(928);
794
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
795
- /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(559);
796
- /* harmony import */ var tsafe_id__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94);
797
- /* harmony import */ var tsafe_symToStr__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(886);
798
- /* harmony import */ var _nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(395);
799
- /* module decorator */ module = __webpack_require__.hmd(module);
800
- /* eslint-disable @typescript-eslint/consistent-type-imports */
801
-
802
-
803
-
804
-
805
-
806
-
807
-
808
-
809
- getIsPrettierAvailable.cache = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_3__.id)(undefined);
810
- async function getIsPrettierAvailable() {
811
- var _a;
812
- if (getIsPrettierAvailable.cache !== undefined) {
813
- return getIsPrettierAvailable.cache;
814
- }
815
- const nodeModulesBinDirPath = (0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_4__/* .getNodeModulesBinDirPath */ .p)();
816
- const prettierBinPath = (0,path__WEBPACK_IMPORTED_MODULE_2__.join)(nodeModulesBinDirPath, 'prettier');
817
- const stats = await fs_promises__WEBPACK_IMPORTED_MODULE_1__.stat(prettierBinPath).catch(() => undefined);
818
- const isPrettierAvailable = (_a = stats === null || stats === void 0 ? void 0 : stats.isFile()) !== null && _a !== void 0 ? _a : false;
819
- getIsPrettierAvailable.cache = isPrettierAvailable;
820
- return isPrettierAvailable;
821
- }
822
- getPrettier.cache = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_3__.id)(undefined);
823
- async function getPrettier() {
824
- (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .v)(getIsPrettierAvailable());
825
- if (getPrettier.cache !== undefined) {
826
- return getPrettier.cache;
827
- }
828
- let prettier = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_3__.id)(undefined);
829
- import_prettier: {
830
- const prettierDirPath = (0,path__WEBPACK_IMPORTED_MODULE_2__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_2__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_4__/* .getNodeModulesBinDirPath */ .p)(), '..', 'prettier'));
831
- const isCJS = true && module.exports;
832
- if (isCJS) {
833
- eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_6__/* .symToStr */ .I)({ prettier })} = require("${prettierDirPath}")`);
834
- }
835
- else {
836
- prettier = await new Promise(_resolve => {
837
- eval(`import("file:///${(0,path__WEBPACK_IMPORTED_MODULE_2__.join)(prettierDirPath, 'index.mjs').replace(/\\/g, '/')}").then(prettier => _resolve(prettier))`);
838
- });
839
- }
840
- (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .v)(!(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_5__.is)(prettier));
841
- break import_prettier;
842
- }
843
- const configHash = await (async () => {
844
- const configFilePath = await prettier.resolveConfigFile((0,path__WEBPACK_IMPORTED_MODULE_2__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_4__/* .getNodeModulesBinDirPath */ .p)(), '..', '..'));
845
- if (configFilePath === null) {
846
- return '';
847
- }
848
- const data = await fs_promises__WEBPACK_IMPORTED_MODULE_1__.readFile(configFilePath);
849
- return crypto__WEBPACK_IMPORTED_MODULE_0__.createHash('sha256').update(data).digest('hex');
850
- })();
851
- const prettierAndConfig = {
852
- prettier,
853
- configHash
854
- };
855
- getPrettier.cache = prettierAndConfig;
856
- return prettierAndConfig;
857
- }
858
- async function runPrettier(params) {
859
- const { sourceCode, filePath } = params;
860
- let formattedSourceCode;
861
- try {
862
- const { prettier } = await getPrettier();
863
- const { ignored, inferredParser } = await prettier.getFileInfo(filePath, {
864
- resolveConfig: true
865
- });
866
- if (ignored || inferredParser === null) {
867
- return sourceCode;
868
- }
869
- const config = await prettier.resolveConfig(filePath);
870
- formattedSourceCode = await prettier.format(typeof sourceCode === 'string' ? sourceCode : sourceCode.toString('utf8'), Object.assign(Object.assign({}, config), { filePath, parser: inferredParser }));
871
- }
872
- catch (error) {
873
- console.log(chalk__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Ay.red(`You probably need to upgrade the version of prettier in your project`));
874
- throw error;
875
- }
876
- return typeof sourceCode === 'string'
877
- ? formattedSourceCode
878
- : Buffer.from(formattedSourceCode, 'utf8');
879
- }
880
-
881
-
882
- /***/ }),
883
-
884
- /***/ 94:
885
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
886
-
887
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
888
- /* harmony export */ id: () => (/* binding */ id)
889
- /* harmony export */ });
890
- /** https://docs.tsafe.dev/id */
891
- const id = (x) => x;
892
- //# sourceMappingURL=id.mjs.map
893
-
894
- /***/ }),
895
-
896
- /***/ 886:
897
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
898
-
899
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
900
- /* harmony export */ I: () => (/* binding */ symToStr)
901
- /* harmony export */ });
902
- /** @see <https://docs.tsafe.dev/main/symtostr> */
903
- function symToStr(wrap) {
904
- // @ts-expect-error: We know better
905
- return Object.keys(wrap)[0];
906
- }
907
- //# sourceMappingURL=symToStr.mjs.map
908
-
909
- /***/ })
910
-
911
- };