@keycloakify/angular 0.2.2 → 0.2.3
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.
- package/bin/187.index.js +508 -0
- package/bin/476.index.js +1085 -0
- package/bin/671.index.js +719 -0
- package/bin/811.index.js +4972 -0
- package/bin/942.index.js +306 -0
- package/bin/986.index.js +1294 -0
- package/bin/index.js +479 -0
- package/package.json +2 -2
- package/src/bin/core.ts +8 -4
- package/src/bin/tsconfig.json +4 -1
- package/bin/197.index.js +0 -13
- package/bin/381.index.js +0 -13
- package/bin/504.index.js +0 -13
- package/bin/87.index.js +0 -13
- package/bin/main.js +0 -230
package/bin/476.index.js
ADDED
|
@@ -0,0 +1,1085 @@
|
|
|
1
|
+
export const id = 476;
|
|
2
|
+
export const ids = [476];
|
|
3
|
+
export const modules = {
|
|
4
|
+
|
|
5
|
+
/***/ 221:
|
|
6
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
7
|
+
|
|
8
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9
|
+
/* harmony export */ J: () => (/* binding */ getThisCodebaseRootDirPath)
|
|
10
|
+
/* harmony export */ });
|
|
11
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(896);
|
|
12
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
|
13
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(928);
|
|
14
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
function getThisCodebaseRootDirPath_rec(dirPath) {
|
|
18
|
+
if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(path__WEBPACK_IMPORTED_MODULE_1__.join(dirPath, 'package.json'))) {
|
|
19
|
+
return dirPath;
|
|
20
|
+
}
|
|
21
|
+
return getThisCodebaseRootDirPath_rec(path__WEBPACK_IMPORTED_MODULE_1__.join(dirPath, '..'));
|
|
22
|
+
}
|
|
23
|
+
let result = undefined;
|
|
24
|
+
function getThisCodebaseRootDirPath() {
|
|
25
|
+
if (result !== undefined) {
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
return (result = getThisCodebaseRootDirPath_rec(__dirname));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
/***/ }),
|
|
33
|
+
|
|
34
|
+
/***/ 395:
|
|
35
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
36
|
+
|
|
37
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
38
|
+
/* harmony export */ p: () => (/* binding */ getNodeModulesBinDirPath)
|
|
39
|
+
/* harmony export */ });
|
|
40
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(928);
|
|
41
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
|
|
42
|
+
|
|
43
|
+
let cache = undefined;
|
|
44
|
+
function getNodeModulesBinDirPath() {
|
|
45
|
+
if (cache !== undefined) {
|
|
46
|
+
return cache;
|
|
47
|
+
}
|
|
48
|
+
const binPath = process.argv[1];
|
|
49
|
+
const segments = ['.bin'];
|
|
50
|
+
let foundNodeModules = false;
|
|
51
|
+
for (const segment of binPath.split(path__WEBPACK_IMPORTED_MODULE_0__.sep).reverse()) {
|
|
52
|
+
skip_segment: {
|
|
53
|
+
if (foundNodeModules) {
|
|
54
|
+
break skip_segment;
|
|
55
|
+
}
|
|
56
|
+
if (segment === 'node_modules') {
|
|
57
|
+
foundNodeModules = true;
|
|
58
|
+
break skip_segment;
|
|
59
|
+
}
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
segments.unshift(segment);
|
|
63
|
+
}
|
|
64
|
+
const nodeModulesBinDirPath = segments.join(path__WEBPACK_IMPORTED_MODULE_0__.sep);
|
|
65
|
+
cache = nodeModulesBinDirPath;
|
|
66
|
+
return nodeModulesBinDirPath;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
/***/ }),
|
|
71
|
+
|
|
72
|
+
/***/ 972:
|
|
73
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
74
|
+
|
|
75
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
76
|
+
/* harmony export */ M: () => (/* binding */ readThisNpmPackageVersion)
|
|
77
|
+
/* harmony export */ });
|
|
78
|
+
/* harmony import */ var _getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(221);
|
|
79
|
+
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(966);
|
|
80
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(896);
|
|
81
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
|
|
82
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(928);
|
|
83
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
let cache = undefined;
|
|
89
|
+
function readThisNpmPackageVersion() {
|
|
90
|
+
if (cache !== undefined) {
|
|
91
|
+
return cache;
|
|
92
|
+
}
|
|
93
|
+
const version = JSON.parse(fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync((0,path__WEBPACK_IMPORTED_MODULE_2__.join)((0,_getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_3__/* .getThisCodebaseRootDirPath */ .J)(), 'package.json'))
|
|
94
|
+
.toString('utf8'))['version'];
|
|
95
|
+
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_0__/* .assert */ .v)(typeof version === 'string');
|
|
96
|
+
cache = version;
|
|
97
|
+
return version;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
/***/ }),
|
|
102
|
+
|
|
103
|
+
/***/ 915:
|
|
104
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
105
|
+
|
|
106
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
107
|
+
/* harmony export */ JS: () => (/* binding */ runPrettier),
|
|
108
|
+
/* harmony export */ L: () => (/* binding */ getIsPrettierAvailable)
|
|
109
|
+
/* harmony export */ });
|
|
110
|
+
/* unused harmony export getPrettier */
|
|
111
|
+
/* harmony import */ var _nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(395);
|
|
112
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(928);
|
|
113
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
|
|
114
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(943);
|
|
115
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_1__);
|
|
116
|
+
/* harmony import */ var tsafe_id__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(94);
|
|
117
|
+
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(966);
|
|
118
|
+
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(797);
|
|
119
|
+
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(982);
|
|
120
|
+
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_3__);
|
|
121
|
+
/* harmony import */ var tsafe_is__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(289);
|
|
122
|
+
/* harmony import */ var tsafe_symToStr__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(886);
|
|
123
|
+
/* harmony import */ var _readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(972);
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
getIsPrettierAvailable.cache = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_5__.id)(undefined);
|
|
135
|
+
async function getIsPrettierAvailable() {
|
|
136
|
+
var _a;
|
|
137
|
+
if (getIsPrettierAvailable.cache !== undefined) {
|
|
138
|
+
return getIsPrettierAvailable.cache;
|
|
139
|
+
}
|
|
140
|
+
const nodeModulesBinDirPath = (0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_6__/* .getNodeModulesBinDirPath */ .p)();
|
|
141
|
+
const prettierBinPath = (0,path__WEBPACK_IMPORTED_MODULE_0__.join)(nodeModulesBinDirPath, 'prettier');
|
|
142
|
+
const stats = await fs_promises__WEBPACK_IMPORTED_MODULE_1__.stat(prettierBinPath).catch(() => undefined);
|
|
143
|
+
const isPrettierAvailable = (_a = stats === null || stats === void 0 ? void 0 : stats.isFile()) !== null && _a !== void 0 ? _a : false;
|
|
144
|
+
getIsPrettierAvailable.cache = isPrettierAvailable;
|
|
145
|
+
return isPrettierAvailable;
|
|
146
|
+
}
|
|
147
|
+
getPrettier.cache = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_5__.id)(undefined);
|
|
148
|
+
async function getPrettier() {
|
|
149
|
+
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_2__/* .assert */ .v)(getIsPrettierAvailable());
|
|
150
|
+
if (getPrettier.cache !== undefined) {
|
|
151
|
+
return getPrettier.cache;
|
|
152
|
+
}
|
|
153
|
+
let prettier = (0,tsafe_id__WEBPACK_IMPORTED_MODULE_5__.id)(undefined);
|
|
154
|
+
import_prettier: {
|
|
155
|
+
// NOTE: When module is linked we want to make sure we import the correct version
|
|
156
|
+
// of prettier, that is the one of the project, not the one of this repo.
|
|
157
|
+
// So we do a sketchy eval to bypass ncc.
|
|
158
|
+
// We make sure to only do that when linking, otherwise we import properly.
|
|
159
|
+
if ((0,_readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_7__/* .readThisNpmPackageVersion */ .M)().startsWith('0.0.0')) {
|
|
160
|
+
eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_8__/* .symToStr */ .I)({ prettier })} = require("${(0,path__WEBPACK_IMPORTED_MODULE_0__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_0__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_6__/* .getNodeModulesBinDirPath */ .p)(), '..', 'prettier'))}")`);
|
|
161
|
+
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_2__/* .assert */ .v)(!(0,tsafe_is__WEBPACK_IMPORTED_MODULE_4__.is)(prettier));
|
|
162
|
+
break import_prettier;
|
|
163
|
+
}
|
|
164
|
+
prettier = await Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 166));
|
|
165
|
+
}
|
|
166
|
+
const configHash = await (async () => {
|
|
167
|
+
const configFilePath = await prettier.resolveConfigFile((0,path__WEBPACK_IMPORTED_MODULE_0__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_6__/* .getNodeModulesBinDirPath */ .p)(), '..'));
|
|
168
|
+
if (configFilePath === null) {
|
|
169
|
+
return '';
|
|
170
|
+
}
|
|
171
|
+
const data = await fs_promises__WEBPACK_IMPORTED_MODULE_1__.readFile(configFilePath);
|
|
172
|
+
return crypto__WEBPACK_IMPORTED_MODULE_3__.createHash('sha256').update(data).digest('hex');
|
|
173
|
+
})();
|
|
174
|
+
const prettierAndConfig = {
|
|
175
|
+
prettier,
|
|
176
|
+
configHash
|
|
177
|
+
};
|
|
178
|
+
getPrettier.cache = prettierAndConfig;
|
|
179
|
+
return prettierAndConfig;
|
|
180
|
+
}
|
|
181
|
+
async function runPrettier(params) {
|
|
182
|
+
const { sourceCode, filePath } = params;
|
|
183
|
+
let formattedSourceCode;
|
|
184
|
+
try {
|
|
185
|
+
const { prettier } = await getPrettier();
|
|
186
|
+
const { ignored, inferredParser } = await prettier.getFileInfo(filePath, {
|
|
187
|
+
resolveConfig: true
|
|
188
|
+
});
|
|
189
|
+
if (ignored) {
|
|
190
|
+
return sourceCode;
|
|
191
|
+
}
|
|
192
|
+
const config = await prettier.resolveConfig(filePath);
|
|
193
|
+
formattedSourceCode = await prettier.format(sourceCode, Object.assign(Object.assign({}, config), { filePath, parser: inferredParser !== null && inferredParser !== void 0 ? inferredParser : undefined }));
|
|
194
|
+
}
|
|
195
|
+
catch (error) {
|
|
196
|
+
console.log(chalk__WEBPACK_IMPORTED_MODULE_9__/* ["default"] */ .Ay.red(`You probably need to upgrade the version of prettier in your project`));
|
|
197
|
+
throw error;
|
|
198
|
+
}
|
|
199
|
+
return formattedSourceCode;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
/***/ }),
|
|
204
|
+
|
|
205
|
+
/***/ 476:
|
|
206
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
207
|
+
|
|
208
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
209
|
+
/* harmony export */ command: () => (/* binding */ command)
|
|
210
|
+
/* harmony export */ });
|
|
211
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(896);
|
|
212
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
|
213
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(928);
|
|
214
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
|
215
|
+
/* harmony import */ var _tools_runPrettier__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(915);
|
|
216
|
+
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(982);
|
|
217
|
+
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_2__);
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
async function command(params) {
|
|
223
|
+
const { buildContext } = params;
|
|
224
|
+
const filePath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(buildContext.themeSrcDirPath, 'kc.gen.ts');
|
|
225
|
+
const implementedThemeTypes = ['login', 'account'].filter(themeType => buildContext.implementedThemeTypes[themeType].isImplemented);
|
|
226
|
+
const newContent = [
|
|
227
|
+
``,
|
|
228
|
+
`/* eslint-disable */`,
|
|
229
|
+
``,
|
|
230
|
+
`// @ts-nocheck`,
|
|
231
|
+
``,
|
|
232
|
+
`// noinspection JSUnusedGlobalSymbols`,
|
|
233
|
+
``,
|
|
234
|
+
`import type { ComponentRef, EnvironmentProviders, Type } from "@angular/core";`,
|
|
235
|
+
``,
|
|
236
|
+
`export type ThemeName = ${buildContext.themeNames.map(themeName => `"${themeName}"`).join(' | ')};`,
|
|
237
|
+
``,
|
|
238
|
+
`export const themeNames: ThemeName[] = [${buildContext.themeNames.map(themeName => `"${themeName}"`).join(', ')}];`,
|
|
239
|
+
``,
|
|
240
|
+
`export type KcEnvName = ${buildContext.environmentVariables.length === 0 ? 'never' : buildContext.environmentVariables.map(({ name }) => `"${name}"`).join(' | ')};`,
|
|
241
|
+
``,
|
|
242
|
+
`export const kcEnvNames: KcEnvName[] = [${buildContext.environmentVariables.map(({ name }) => `"${name}"`).join(', ')}];`,
|
|
243
|
+
``,
|
|
244
|
+
`export const kcEnvDefaults: Record<KcEnvName, string> = ${JSON.stringify(Object.fromEntries(buildContext.environmentVariables.map(({ name, default: defaultValue }) => [name, defaultValue])), null, 2)};`,
|
|
245
|
+
``,
|
|
246
|
+
`export type KcContext =`,
|
|
247
|
+
...implementedThemeTypes.map(themeType => ` | import("./${themeType}/KcContext").KcContext`),
|
|
248
|
+
` ;`,
|
|
249
|
+
``,
|
|
250
|
+
`declare global {`,
|
|
251
|
+
` interface Window {`,
|
|
252
|
+
` kcContext?: KcContext;`,
|
|
253
|
+
` }`,
|
|
254
|
+
`}`,
|
|
255
|
+
``,
|
|
256
|
+
`type ApplicationRefLike = {`,
|
|
257
|
+
` components: ComponentRef<any>[];`,
|
|
258
|
+
`};`,
|
|
259
|
+
``,
|
|
260
|
+
`export async function bootstrapKcApplication(params: {`,
|
|
261
|
+
` kcContext: KcContext;`,
|
|
262
|
+
` bootstrapApplication: (params: {`,
|
|
263
|
+
` KcRootComponent: Type<unknown>;`,
|
|
264
|
+
` kcProvider: EnvironmentProviders;`,
|
|
265
|
+
` }) => Promise<ApplicationRefLike>;`,
|
|
266
|
+
`}) {`,
|
|
267
|
+
` const { kcContext, bootstrapApplication } = params;`,
|
|
268
|
+
``,
|
|
269
|
+
` switch (kcContext.themeType) {`,
|
|
270
|
+
...['login', 'account']
|
|
271
|
+
.filter(themeType => buildContext.implementedThemeTypes[themeType].isImplemented)
|
|
272
|
+
.map(themeType => [
|
|
273
|
+
` case "${themeType}":`,
|
|
274
|
+
` {`,
|
|
275
|
+
` const [`,
|
|
276
|
+
` { provideKeycloakifyAngular },`,
|
|
277
|
+
` { getI18n },`,
|
|
278
|
+
` {`,
|
|
279
|
+
` PageComponent,`,
|
|
280
|
+
` TemplateComponent,`,
|
|
281
|
+
` doUseDefaultCss,`,
|
|
282
|
+
` classes,`,
|
|
283
|
+
...(themeType === 'login'
|
|
284
|
+
? [
|
|
285
|
+
` UserProfileFormFieldsComponent,`,
|
|
286
|
+
` doMakeUserConfirmPassword,`
|
|
287
|
+
]
|
|
288
|
+
: []),
|
|
289
|
+
` },`,
|
|
290
|
+
` ] = await Promise.all([`,
|
|
291
|
+
` import('@keycloakify/angular/login/providers/keycloakify-angular'),`,
|
|
292
|
+
` import('./${themeType}/i18n'),`,
|
|
293
|
+
` import('./${themeType}/KcPage').then(({ getKcPage }) => getKcPage(kcContext.pageId)),`,
|
|
294
|
+
` ] as const);`,
|
|
295
|
+
``,
|
|
296
|
+
` const appRef = await bootstrapApplication({`,
|
|
297
|
+
` KcRootComponent: TemplateComponent,`,
|
|
298
|
+
` kcProvider: provideKeycloakifyAngular({`,
|
|
299
|
+
` kcContext,`,
|
|
300
|
+
` classes,`,
|
|
301
|
+
` getI18n,`,
|
|
302
|
+
` doUseDefaultCss,`,
|
|
303
|
+
...(themeType === 'login'
|
|
304
|
+
? [` doMakeUserConfirmPassword,`]
|
|
305
|
+
: []),
|
|
306
|
+
` })`,
|
|
307
|
+
` });`,
|
|
308
|
+
``,
|
|
309
|
+
` appRef.components.forEach(componentRef => {`,
|
|
310
|
+
` // page must be defined first `,
|
|
311
|
+
` if ("page" in componentRef.instance) {`,
|
|
312
|
+
` componentRef.setInput("page", PageComponent);`,
|
|
313
|
+
` }`,
|
|
314
|
+
...(themeType === 'login'
|
|
315
|
+
? [
|
|
316
|
+
` if ("userProfileFormFields" in componentRef.instance) {`,
|
|
317
|
+
` componentRef.setInput(`,
|
|
318
|
+
` "userProfileFormFields",`,
|
|
319
|
+
` UserProfileFormFieldsComponent`,
|
|
320
|
+
` );`,
|
|
321
|
+
` }`
|
|
322
|
+
]
|
|
323
|
+
: []),
|
|
324
|
+
` });`,
|
|
325
|
+
` }`,
|
|
326
|
+
` break;`
|
|
327
|
+
])
|
|
328
|
+
.flat(),
|
|
329
|
+
` }`,
|
|
330
|
+
`}`,
|
|
331
|
+
``
|
|
332
|
+
].join('\n');
|
|
333
|
+
const hash = crypto__WEBPACK_IMPORTED_MODULE_2__.createHash('sha256').update(newContent).digest('hex');
|
|
334
|
+
skip_if_no_changes: {
|
|
335
|
+
if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(filePath)) {
|
|
336
|
+
break skip_if_no_changes;
|
|
337
|
+
}
|
|
338
|
+
const currentContent = fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(filePath).toString('utf8');
|
|
339
|
+
if (!currentContent.includes(hash)) {
|
|
340
|
+
break skip_if_no_changes;
|
|
341
|
+
}
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
let sourceCode = [
|
|
345
|
+
`// This file is auto-generated by keycloakify. Do not edit it manually.`,
|
|
346
|
+
`// Hash: ${hash}`,
|
|
347
|
+
``,
|
|
348
|
+
newContent
|
|
349
|
+
].join('\n');
|
|
350
|
+
run_prettier: {
|
|
351
|
+
if (!(await (0,_tools_runPrettier__WEBPACK_IMPORTED_MODULE_3__/* .getIsPrettierAvailable */ .L)())) {
|
|
352
|
+
break run_prettier;
|
|
353
|
+
}
|
|
354
|
+
sourceCode = await (0,_tools_runPrettier__WEBPACK_IMPORTED_MODULE_3__/* .runPrettier */ .JS)({
|
|
355
|
+
filePath,
|
|
356
|
+
sourceCode
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(filePath, Buffer.from(sourceCode, 'utf8'));
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
/***/ }),
|
|
364
|
+
|
|
365
|
+
/***/ 797:
|
|
366
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
// EXPORTS
|
|
370
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
371
|
+
Ay: () => (/* binding */ source)
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
// UNUSED EXPORTS: Chalk, backgroundColorNames, backgroundColors, chalkStderr, colorNames, colors, foregroundColorNames, foregroundColors, modifierNames, modifiers, supportsColor, supportsColorStderr
|
|
375
|
+
|
|
376
|
+
;// CONCATENATED MODULE: ./node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
377
|
+
const ANSI_BACKGROUND_OFFSET = 10;
|
|
378
|
+
|
|
379
|
+
const wrapAnsi16 = (offset = 0) => code => `\u001B[${code + offset}m`;
|
|
380
|
+
|
|
381
|
+
const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`;
|
|
382
|
+
|
|
383
|
+
const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
|
|
384
|
+
|
|
385
|
+
const styles = {
|
|
386
|
+
modifier: {
|
|
387
|
+
reset: [0, 0],
|
|
388
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
389
|
+
bold: [1, 22],
|
|
390
|
+
dim: [2, 22],
|
|
391
|
+
italic: [3, 23],
|
|
392
|
+
underline: [4, 24],
|
|
393
|
+
overline: [53, 55],
|
|
394
|
+
inverse: [7, 27],
|
|
395
|
+
hidden: [8, 28],
|
|
396
|
+
strikethrough: [9, 29],
|
|
397
|
+
},
|
|
398
|
+
color: {
|
|
399
|
+
black: [30, 39],
|
|
400
|
+
red: [31, 39],
|
|
401
|
+
green: [32, 39],
|
|
402
|
+
yellow: [33, 39],
|
|
403
|
+
blue: [34, 39],
|
|
404
|
+
magenta: [35, 39],
|
|
405
|
+
cyan: [36, 39],
|
|
406
|
+
white: [37, 39],
|
|
407
|
+
|
|
408
|
+
// Bright color
|
|
409
|
+
blackBright: [90, 39],
|
|
410
|
+
gray: [90, 39], // Alias of `blackBright`
|
|
411
|
+
grey: [90, 39], // Alias of `blackBright`
|
|
412
|
+
redBright: [91, 39],
|
|
413
|
+
greenBright: [92, 39],
|
|
414
|
+
yellowBright: [93, 39],
|
|
415
|
+
blueBright: [94, 39],
|
|
416
|
+
magentaBright: [95, 39],
|
|
417
|
+
cyanBright: [96, 39],
|
|
418
|
+
whiteBright: [97, 39],
|
|
419
|
+
},
|
|
420
|
+
bgColor: {
|
|
421
|
+
bgBlack: [40, 49],
|
|
422
|
+
bgRed: [41, 49],
|
|
423
|
+
bgGreen: [42, 49],
|
|
424
|
+
bgYellow: [43, 49],
|
|
425
|
+
bgBlue: [44, 49],
|
|
426
|
+
bgMagenta: [45, 49],
|
|
427
|
+
bgCyan: [46, 49],
|
|
428
|
+
bgWhite: [47, 49],
|
|
429
|
+
|
|
430
|
+
// Bright color
|
|
431
|
+
bgBlackBright: [100, 49],
|
|
432
|
+
bgGray: [100, 49], // Alias of `bgBlackBright`
|
|
433
|
+
bgGrey: [100, 49], // Alias of `bgBlackBright`
|
|
434
|
+
bgRedBright: [101, 49],
|
|
435
|
+
bgGreenBright: [102, 49],
|
|
436
|
+
bgYellowBright: [103, 49],
|
|
437
|
+
bgBlueBright: [104, 49],
|
|
438
|
+
bgMagentaBright: [105, 49],
|
|
439
|
+
bgCyanBright: [106, 49],
|
|
440
|
+
bgWhiteBright: [107, 49],
|
|
441
|
+
},
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
const modifierNames = Object.keys(styles.modifier);
|
|
445
|
+
const foregroundColorNames = Object.keys(styles.color);
|
|
446
|
+
const backgroundColorNames = Object.keys(styles.bgColor);
|
|
447
|
+
const colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
448
|
+
|
|
449
|
+
function assembleStyles() {
|
|
450
|
+
const codes = new Map();
|
|
451
|
+
|
|
452
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
453
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
454
|
+
styles[styleName] = {
|
|
455
|
+
open: `\u001B[${style[0]}m`,
|
|
456
|
+
close: `\u001B[${style[1]}m`,
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
group[styleName] = styles[styleName];
|
|
460
|
+
|
|
461
|
+
codes.set(style[0], style[1]);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
Object.defineProperty(styles, groupName, {
|
|
465
|
+
value: group,
|
|
466
|
+
enumerable: false,
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
Object.defineProperty(styles, 'codes', {
|
|
471
|
+
value: codes,
|
|
472
|
+
enumerable: false,
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
styles.color.close = '\u001B[39m';
|
|
476
|
+
styles.bgColor.close = '\u001B[49m';
|
|
477
|
+
|
|
478
|
+
styles.color.ansi = wrapAnsi16();
|
|
479
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
480
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
481
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
482
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
483
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
484
|
+
|
|
485
|
+
// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
|
|
486
|
+
Object.defineProperties(styles, {
|
|
487
|
+
rgbToAnsi256: {
|
|
488
|
+
value(red, green, blue) {
|
|
489
|
+
// We use the extended greyscale palette here, with the exception of
|
|
490
|
+
// black and white. normal palette only has 4 greyscale shades.
|
|
491
|
+
if (red === green && green === blue) {
|
|
492
|
+
if (red < 8) {
|
|
493
|
+
return 16;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
if (red > 248) {
|
|
497
|
+
return 231;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
return Math.round(((red - 8) / 247) * 24) + 232;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
return 16
|
|
504
|
+
+ (36 * Math.round(red / 255 * 5))
|
|
505
|
+
+ (6 * Math.round(green / 255 * 5))
|
|
506
|
+
+ Math.round(blue / 255 * 5);
|
|
507
|
+
},
|
|
508
|
+
enumerable: false,
|
|
509
|
+
},
|
|
510
|
+
hexToRgb: {
|
|
511
|
+
value(hex) {
|
|
512
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
513
|
+
if (!matches) {
|
|
514
|
+
return [0, 0, 0];
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
let [colorString] = matches;
|
|
518
|
+
|
|
519
|
+
if (colorString.length === 3) {
|
|
520
|
+
colorString = [...colorString].map(character => character + character).join('');
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
const integer = Number.parseInt(colorString, 16);
|
|
524
|
+
|
|
525
|
+
return [
|
|
526
|
+
/* eslint-disable no-bitwise */
|
|
527
|
+
(integer >> 16) & 0xFF,
|
|
528
|
+
(integer >> 8) & 0xFF,
|
|
529
|
+
integer & 0xFF,
|
|
530
|
+
/* eslint-enable no-bitwise */
|
|
531
|
+
];
|
|
532
|
+
},
|
|
533
|
+
enumerable: false,
|
|
534
|
+
},
|
|
535
|
+
hexToAnsi256: {
|
|
536
|
+
value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
537
|
+
enumerable: false,
|
|
538
|
+
},
|
|
539
|
+
ansi256ToAnsi: {
|
|
540
|
+
value(code) {
|
|
541
|
+
if (code < 8) {
|
|
542
|
+
return 30 + code;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
if (code < 16) {
|
|
546
|
+
return 90 + (code - 8);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
let red;
|
|
550
|
+
let green;
|
|
551
|
+
let blue;
|
|
552
|
+
|
|
553
|
+
if (code >= 232) {
|
|
554
|
+
red = (((code - 232) * 10) + 8) / 255;
|
|
555
|
+
green = red;
|
|
556
|
+
blue = red;
|
|
557
|
+
} else {
|
|
558
|
+
code -= 16;
|
|
559
|
+
|
|
560
|
+
const remainder = code % 36;
|
|
561
|
+
|
|
562
|
+
red = Math.floor(code / 36) / 5;
|
|
563
|
+
green = Math.floor(remainder / 6) / 5;
|
|
564
|
+
blue = (remainder % 6) / 5;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
const value = Math.max(red, green, blue) * 2;
|
|
568
|
+
|
|
569
|
+
if (value === 0) {
|
|
570
|
+
return 30;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
// eslint-disable-next-line no-bitwise
|
|
574
|
+
let result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));
|
|
575
|
+
|
|
576
|
+
if (value === 2) {
|
|
577
|
+
result += 60;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
return result;
|
|
581
|
+
},
|
|
582
|
+
enumerable: false,
|
|
583
|
+
},
|
|
584
|
+
rgbToAnsi: {
|
|
585
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
586
|
+
enumerable: false,
|
|
587
|
+
},
|
|
588
|
+
hexToAnsi: {
|
|
589
|
+
value: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
590
|
+
enumerable: false,
|
|
591
|
+
},
|
|
592
|
+
});
|
|
593
|
+
|
|
594
|
+
return styles;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
const ansiStyles = assembleStyles();
|
|
598
|
+
|
|
599
|
+
/* harmony default export */ const ansi_styles = (ansiStyles);
|
|
600
|
+
|
|
601
|
+
// EXTERNAL MODULE: external "node:process"
|
|
602
|
+
var external_node_process_ = __webpack_require__(708);
|
|
603
|
+
// EXTERNAL MODULE: external "node:os"
|
|
604
|
+
var external_node_os_ = __webpack_require__(161);
|
|
605
|
+
// EXTERNAL MODULE: external "node:tty"
|
|
606
|
+
var external_node_tty_ = __webpack_require__(66);
|
|
607
|
+
;// CONCATENATED MODULE: ./node_modules/chalk/source/vendor/supports-color/index.js
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
// From: https://github.com/sindresorhus/has-flag/blob/main/index.js
|
|
613
|
+
/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {
|
|
614
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : external_node_process_.argv) {
|
|
615
|
+
const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
|
|
616
|
+
const position = argv.indexOf(prefix + flag);
|
|
617
|
+
const terminatorPosition = argv.indexOf('--');
|
|
618
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
const {env} = external_node_process_;
|
|
622
|
+
|
|
623
|
+
let flagForceColor;
|
|
624
|
+
if (
|
|
625
|
+
hasFlag('no-color')
|
|
626
|
+
|| hasFlag('no-colors')
|
|
627
|
+
|| hasFlag('color=false')
|
|
628
|
+
|| hasFlag('color=never')
|
|
629
|
+
) {
|
|
630
|
+
flagForceColor = 0;
|
|
631
|
+
} else if (
|
|
632
|
+
hasFlag('color')
|
|
633
|
+
|| hasFlag('colors')
|
|
634
|
+
|| hasFlag('color=true')
|
|
635
|
+
|| hasFlag('color=always')
|
|
636
|
+
) {
|
|
637
|
+
flagForceColor = 1;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
function envForceColor() {
|
|
641
|
+
if ('FORCE_COLOR' in env) {
|
|
642
|
+
if (env.FORCE_COLOR === 'true') {
|
|
643
|
+
return 1;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
if (env.FORCE_COLOR === 'false') {
|
|
647
|
+
return 0;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
function translateLevel(level) {
|
|
655
|
+
if (level === 0) {
|
|
656
|
+
return false;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
return {
|
|
660
|
+
level,
|
|
661
|
+
hasBasic: true,
|
|
662
|
+
has256: level >= 2,
|
|
663
|
+
has16m: level >= 3,
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
|
|
668
|
+
const noFlagForceColor = envForceColor();
|
|
669
|
+
if (noFlagForceColor !== undefined) {
|
|
670
|
+
flagForceColor = noFlagForceColor;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
674
|
+
|
|
675
|
+
if (forceColor === 0) {
|
|
676
|
+
return 0;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
if (sniffFlags) {
|
|
680
|
+
if (hasFlag('color=16m')
|
|
681
|
+
|| hasFlag('color=full')
|
|
682
|
+
|| hasFlag('color=truecolor')) {
|
|
683
|
+
return 3;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
if (hasFlag('color=256')) {
|
|
687
|
+
return 2;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
// Check for Azure DevOps pipelines.
|
|
692
|
+
// Has to be above the `!streamIsTTY` check.
|
|
693
|
+
if ('TF_BUILD' in env && 'AGENT_NAME' in env) {
|
|
694
|
+
return 1;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
698
|
+
return 0;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
const min = forceColor || 0;
|
|
702
|
+
|
|
703
|
+
if (env.TERM === 'dumb') {
|
|
704
|
+
return min;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
if (external_node_process_.platform === 'win32') {
|
|
708
|
+
// Windows 10 build 10586 is the first Windows release that supports 256 colors.
|
|
709
|
+
// Windows 10 build 14931 is the first release that supports 16m/TrueColor.
|
|
710
|
+
const osRelease = external_node_os_.release().split('.');
|
|
711
|
+
if (
|
|
712
|
+
Number(osRelease[0]) >= 10
|
|
713
|
+
&& Number(osRelease[2]) >= 10_586
|
|
714
|
+
) {
|
|
715
|
+
return Number(osRelease[2]) >= 14_931 ? 3 : 2;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
return 1;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
if ('CI' in env) {
|
|
722
|
+
if ('GITHUB_ACTIONS' in env || 'GITEA_ACTIONS' in env) {
|
|
723
|
+
return 3;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
|
|
727
|
+
return 1;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
return min;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
if ('TEAMCITY_VERSION' in env) {
|
|
734
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
if (env.COLORTERM === 'truecolor') {
|
|
738
|
+
return 3;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
if (env.TERM === 'xterm-kitty') {
|
|
742
|
+
return 3;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
if ('TERM_PROGRAM' in env) {
|
|
746
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
747
|
+
|
|
748
|
+
switch (env.TERM_PROGRAM) {
|
|
749
|
+
case 'iTerm.app': {
|
|
750
|
+
return version >= 3 ? 3 : 2;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
case 'Apple_Terminal': {
|
|
754
|
+
return 2;
|
|
755
|
+
}
|
|
756
|
+
// No default
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
761
|
+
return 2;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
765
|
+
return 1;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
if ('COLORTERM' in env) {
|
|
769
|
+
return 1;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
return min;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
function createSupportsColor(stream, options = {}) {
|
|
776
|
+
const level = _supportsColor(stream, {
|
|
777
|
+
streamIsTTY: stream && stream.isTTY,
|
|
778
|
+
...options,
|
|
779
|
+
});
|
|
780
|
+
|
|
781
|
+
return translateLevel(level);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
const supportsColor = {
|
|
785
|
+
stdout: createSupportsColor({isTTY: external_node_tty_.isatty(1)}),
|
|
786
|
+
stderr: createSupportsColor({isTTY: external_node_tty_.isatty(2)}),
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
/* harmony default export */ const supports_color = (supportsColor);
|
|
790
|
+
|
|
791
|
+
;// CONCATENATED MODULE: ./node_modules/chalk/source/utilities.js
|
|
792
|
+
// TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.
|
|
793
|
+
function stringReplaceAll(string, substring, replacer) {
|
|
794
|
+
let index = string.indexOf(substring);
|
|
795
|
+
if (index === -1) {
|
|
796
|
+
return string;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
const substringLength = substring.length;
|
|
800
|
+
let endIndex = 0;
|
|
801
|
+
let returnValue = '';
|
|
802
|
+
do {
|
|
803
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
804
|
+
endIndex = index + substringLength;
|
|
805
|
+
index = string.indexOf(substring, endIndex);
|
|
806
|
+
} while (index !== -1);
|
|
807
|
+
|
|
808
|
+
returnValue += string.slice(endIndex);
|
|
809
|
+
return returnValue;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
813
|
+
let endIndex = 0;
|
|
814
|
+
let returnValue = '';
|
|
815
|
+
do {
|
|
816
|
+
const gotCR = string[index - 1] === '\r';
|
|
817
|
+
returnValue += string.slice(endIndex, (gotCR ? index - 1 : index)) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
|
|
818
|
+
endIndex = index + 1;
|
|
819
|
+
index = string.indexOf('\n', endIndex);
|
|
820
|
+
} while (index !== -1);
|
|
821
|
+
|
|
822
|
+
returnValue += string.slice(endIndex);
|
|
823
|
+
return returnValue;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
;// CONCATENATED MODULE: ./node_modules/chalk/source/index.js
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
const {stdout: stdoutColor, stderr: stderrColor} = supports_color;
|
|
832
|
+
|
|
833
|
+
const GENERATOR = Symbol('GENERATOR');
|
|
834
|
+
const STYLER = Symbol('STYLER');
|
|
835
|
+
const IS_EMPTY = Symbol('IS_EMPTY');
|
|
836
|
+
|
|
837
|
+
// `supportsColor.level` → `ansiStyles.color[name]` mapping
|
|
838
|
+
const levelMapping = [
|
|
839
|
+
'ansi',
|
|
840
|
+
'ansi',
|
|
841
|
+
'ansi256',
|
|
842
|
+
'ansi16m',
|
|
843
|
+
];
|
|
844
|
+
|
|
845
|
+
const source_styles = Object.create(null);
|
|
846
|
+
|
|
847
|
+
const applyOptions = (object, options = {}) => {
|
|
848
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
849
|
+
throw new Error('The `level` option should be an integer from 0 to 3');
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
// Detect level if not set manually
|
|
853
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
854
|
+
object.level = options.level === undefined ? colorLevel : options.level;
|
|
855
|
+
};
|
|
856
|
+
|
|
857
|
+
class Chalk {
|
|
858
|
+
constructor(options) {
|
|
859
|
+
// eslint-disable-next-line no-constructor-return
|
|
860
|
+
return chalkFactory(options);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
const chalkFactory = options => {
|
|
865
|
+
const chalk = (...strings) => strings.join(' ');
|
|
866
|
+
applyOptions(chalk, options);
|
|
867
|
+
|
|
868
|
+
Object.setPrototypeOf(chalk, createChalk.prototype);
|
|
869
|
+
|
|
870
|
+
return chalk;
|
|
871
|
+
};
|
|
872
|
+
|
|
873
|
+
function createChalk(options) {
|
|
874
|
+
return chalkFactory(options);
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
878
|
+
|
|
879
|
+
for (const [styleName, style] of Object.entries(ansi_styles)) {
|
|
880
|
+
source_styles[styleName] = {
|
|
881
|
+
get() {
|
|
882
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
883
|
+
Object.defineProperty(this, styleName, {value: builder});
|
|
884
|
+
return builder;
|
|
885
|
+
},
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
source_styles.visible = {
|
|
890
|
+
get() {
|
|
891
|
+
const builder = createBuilder(this, this[STYLER], true);
|
|
892
|
+
Object.defineProperty(this, 'visible', {value: builder});
|
|
893
|
+
return builder;
|
|
894
|
+
},
|
|
895
|
+
};
|
|
896
|
+
|
|
897
|
+
const getModelAnsi = (model, level, type, ...arguments_) => {
|
|
898
|
+
if (model === 'rgb') {
|
|
899
|
+
if (level === 'ansi16m') {
|
|
900
|
+
return ansi_styles[type].ansi16m(...arguments_);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
if (level === 'ansi256') {
|
|
904
|
+
return ansi_styles[type].ansi256(ansi_styles.rgbToAnsi256(...arguments_));
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
return ansi_styles[type].ansi(ansi_styles.rgbToAnsi(...arguments_));
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
if (model === 'hex') {
|
|
911
|
+
return getModelAnsi('rgb', level, type, ...ansi_styles.hexToRgb(...arguments_));
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
return ansi_styles[type][model](...arguments_);
|
|
915
|
+
};
|
|
916
|
+
|
|
917
|
+
const usedModels = ['rgb', 'hex', 'ansi256'];
|
|
918
|
+
|
|
919
|
+
for (const model of usedModels) {
|
|
920
|
+
source_styles[model] = {
|
|
921
|
+
get() {
|
|
922
|
+
const {level} = this;
|
|
923
|
+
return function (...arguments_) {
|
|
924
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansi_styles.color.close, this[STYLER]);
|
|
925
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
926
|
+
};
|
|
927
|
+
},
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
|
|
931
|
+
source_styles[bgModel] = {
|
|
932
|
+
get() {
|
|
933
|
+
const {level} = this;
|
|
934
|
+
return function (...arguments_) {
|
|
935
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansi_styles.bgColor.close, this[STYLER]);
|
|
936
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
937
|
+
};
|
|
938
|
+
},
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
const proto = Object.defineProperties(() => {}, {
|
|
943
|
+
...source_styles,
|
|
944
|
+
level: {
|
|
945
|
+
enumerable: true,
|
|
946
|
+
get() {
|
|
947
|
+
return this[GENERATOR].level;
|
|
948
|
+
},
|
|
949
|
+
set(level) {
|
|
950
|
+
this[GENERATOR].level = level;
|
|
951
|
+
},
|
|
952
|
+
},
|
|
953
|
+
});
|
|
954
|
+
|
|
955
|
+
const createStyler = (open, close, parent) => {
|
|
956
|
+
let openAll;
|
|
957
|
+
let closeAll;
|
|
958
|
+
if (parent === undefined) {
|
|
959
|
+
openAll = open;
|
|
960
|
+
closeAll = close;
|
|
961
|
+
} else {
|
|
962
|
+
openAll = parent.openAll + open;
|
|
963
|
+
closeAll = close + parent.closeAll;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
return {
|
|
967
|
+
open,
|
|
968
|
+
close,
|
|
969
|
+
openAll,
|
|
970
|
+
closeAll,
|
|
971
|
+
parent,
|
|
972
|
+
};
|
|
973
|
+
};
|
|
974
|
+
|
|
975
|
+
const createBuilder = (self, _styler, _isEmpty) => {
|
|
976
|
+
// Single argument is hot path, implicit coercion is faster than anything
|
|
977
|
+
// eslint-disable-next-line no-implicit-coercion
|
|
978
|
+
const builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));
|
|
979
|
+
|
|
980
|
+
// We alter the prototype because we must return a function, but there is
|
|
981
|
+
// no way to create a function with a different prototype
|
|
982
|
+
Object.setPrototypeOf(builder, proto);
|
|
983
|
+
|
|
984
|
+
builder[GENERATOR] = self;
|
|
985
|
+
builder[STYLER] = _styler;
|
|
986
|
+
builder[IS_EMPTY] = _isEmpty;
|
|
987
|
+
|
|
988
|
+
return builder;
|
|
989
|
+
};
|
|
990
|
+
|
|
991
|
+
const applyStyle = (self, string) => {
|
|
992
|
+
if (self.level <= 0 || !string) {
|
|
993
|
+
return self[IS_EMPTY] ? '' : string;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
let styler = self[STYLER];
|
|
997
|
+
|
|
998
|
+
if (styler === undefined) {
|
|
999
|
+
return string;
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
const {openAll, closeAll} = styler;
|
|
1003
|
+
if (string.includes('\u001B')) {
|
|
1004
|
+
while (styler !== undefined) {
|
|
1005
|
+
// Replace any instances already present with a re-opening code
|
|
1006
|
+
// otherwise only the part of the string until said closing code
|
|
1007
|
+
// will be colored, and the rest will simply be 'plain'.
|
|
1008
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
1009
|
+
|
|
1010
|
+
styler = styler.parent;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
// We can move both next actions out of loop, because remaining actions in loop won't have
|
|
1015
|
+
// any/visible effect on parts we add here. Close the styling before a linebreak and reopen
|
|
1016
|
+
// after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92
|
|
1017
|
+
const lfIndex = string.indexOf('\n');
|
|
1018
|
+
if (lfIndex !== -1) {
|
|
1019
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
return openAll + string + closeAll;
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1025
|
+
Object.defineProperties(createChalk.prototype, source_styles);
|
|
1026
|
+
|
|
1027
|
+
const chalk = createChalk();
|
|
1028
|
+
const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});
|
|
1029
|
+
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
/* harmony default export */ const source = (chalk);
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
/***/ }),
|
|
1038
|
+
|
|
1039
|
+
/***/ 94:
|
|
1040
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
1041
|
+
|
|
1042
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1043
|
+
/* harmony export */ id: () => (/* binding */ id)
|
|
1044
|
+
/* harmony export */ });
|
|
1045
|
+
/** https://docs.tsafe.dev/id */
|
|
1046
|
+
const id = (x) => x;
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
//# sourceMappingURL=id.mjs.map
|
|
1050
|
+
|
|
1051
|
+
|
|
1052
|
+
/***/ }),
|
|
1053
|
+
|
|
1054
|
+
/***/ 289:
|
|
1055
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
1056
|
+
|
|
1057
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1058
|
+
/* harmony export */ is: () => (/* reexport safe */ _assert_mjs__WEBPACK_IMPORTED_MODULE_0__.is)
|
|
1059
|
+
/* harmony export */ });
|
|
1060
|
+
/* harmony import */ var _assert_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(966);
|
|
1061
|
+
|
|
1062
|
+
//# sourceMappingURL=is.mjs.map
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
/***/ }),
|
|
1066
|
+
|
|
1067
|
+
/***/ 886:
|
|
1068
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
1069
|
+
|
|
1070
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1071
|
+
/* harmony export */ I: () => (/* binding */ symToStr)
|
|
1072
|
+
/* harmony export */ });
|
|
1073
|
+
/** @see <https://docs.tsafe.dev/main/symtostr> */
|
|
1074
|
+
function symToStr(wrap) {
|
|
1075
|
+
// @ts-expect-error: We know better
|
|
1076
|
+
return Object.keys(wrap)[0];
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
//# sourceMappingURL=symToStr.mjs.map
|
|
1081
|
+
|
|
1082
|
+
|
|
1083
|
+
/***/ })
|
|
1084
|
+
|
|
1085
|
+
};
|