keycloakify 11.8.18 → 11.8.20
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/355.index.js +180 -12
- package/bin/363.index.js +98 -8
- package/bin/369.index.js +1 -833
- package/bin/40.index.js +198 -8
- package/bin/453.index.js +1 -833
- package/bin/658.index.js +1 -1
- package/bin/780.index.js +180 -12
- package/bin/786.index.js +179 -11
- package/bin/932.index.js +204 -12
- package/bin/949.index.js +1031 -0
- package/bin/97.index.js +174 -8
- package/bin/main.js +2 -2
- package/bin/shared/customHandler_delegate.d.ts +2 -2
- package/bin/tools/nodeModulesBinDirPath.d.ts +6 -1
- package/package.json +2 -1
- package/src/bin/add-story.ts +1 -1
- package/src/bin/copy-keycloak-resources-to-public.ts +1 -1
- package/src/bin/eject-page.ts +1 -1
- package/src/bin/initialize-account-theme/initialize-account-theme.ts +1 -1
- package/src/bin/initialize-admin-theme.ts +1 -1
- package/src/bin/initialize-email-theme.ts +2 -2
- package/src/bin/shared/customHandler_delegate.ts +5 -3
- package/src/bin/tools/nodeModulesBinDirPath.ts +138 -6
- package/src/bin/tools/runPrettier.ts +5 -3
- package/src/bin/update-kc-gen.ts +1 -1
- package/vite-plugin/index.js +8979 -8804
package/bin/355.index.js
CHANGED
@@ -20,7 +20,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
20
20
|
|
21
21
|
async function command(params) {
|
22
22
|
const { buildContext } = params;
|
23
|
-
const { hasBeenHandled } = (0,_shared_customHandler_delegate__WEBPACK_IMPORTED_MODULE_0__/* .maybeDelegateCommandToCustomHandler */ .q)({
|
23
|
+
const { hasBeenHandled } = await (0,_shared_customHandler_delegate__WEBPACK_IMPORTED_MODULE_0__/* .maybeDelegateCommandToCustomHandler */ .q)({
|
24
24
|
commandName: "initialize-admin-theme",
|
25
25
|
buildContext
|
26
26
|
});
|
@@ -92,9 +92,11 @@ var external_fs_ = __webpack_require__(57147);
|
|
92
92
|
|
93
93
|
|
94
94
|
(0,esm_assert/* assert */.h)();
|
95
|
-
function maybeDelegateCommandToCustomHandler(params) {
|
95
|
+
async function maybeDelegateCommandToCustomHandler(params) {
|
96
96
|
const { commandName, buildContext } = params;
|
97
|
-
const nodeModulesBinDirPath = (0,tools_nodeModulesBinDirPath/* getNodeModulesBinDirPath */.K)(
|
97
|
+
const nodeModulesBinDirPath = await (0,tools_nodeModulesBinDirPath/* getNodeModulesBinDirPath */.K)({
|
98
|
+
packageJsonFilePath: buildContext.packageJsonFilePath
|
99
|
+
});
|
98
100
|
if (!external_fs_.readdirSync(nodeModulesBinDirPath).includes(BIN_NAME)) {
|
99
101
|
return { hasBeenHandled: false };
|
100
102
|
}
|
@@ -294,6 +296,82 @@ async function existsAsync(path) {
|
|
294
296
|
|
295
297
|
/***/ }),
|
296
298
|
|
299
|
+
/***/ 93721:
|
300
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
301
|
+
|
302
|
+
|
303
|
+
// EXPORTS
|
304
|
+
__webpack_require__.d(__webpack_exports__, {
|
305
|
+
"p": () => (/* binding */ getInstalledModuleDirPath)
|
306
|
+
});
|
307
|
+
|
308
|
+
// EXTERNAL MODULE: external "path"
|
309
|
+
var external_path_ = __webpack_require__(71017);
|
310
|
+
// EXTERNAL MODULE: ./dist/bin/tools/fs.existsAsync.js
|
311
|
+
var fs_existsAsync = __webpack_require__(43765);
|
312
|
+
// EXTERNAL MODULE: external "child_process"
|
313
|
+
var external_child_process_ = __webpack_require__(32081);
|
314
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
|
315
|
+
var assert = __webpack_require__(29041);
|
316
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/isRootPath.js
|
317
|
+
|
318
|
+
function getIsRootPath(filePath) {
|
319
|
+
const path_normalized = (0,external_path_.normalize)(filePath);
|
320
|
+
// Unix-like root ("/")
|
321
|
+
if (path_normalized === "/") {
|
322
|
+
return true;
|
323
|
+
}
|
324
|
+
// Check for Windows drive root (e.g., "C:\\")
|
325
|
+
if (/^[a-zA-Z]:\\$/.test(path_normalized)) {
|
326
|
+
return true;
|
327
|
+
}
|
328
|
+
// Check for UNC root (e.g., "\\server\share")
|
329
|
+
if (/^\\\\[^\\]+\\[^\\]+\\?$/.test(path_normalized)) {
|
330
|
+
return true;
|
331
|
+
}
|
332
|
+
return false;
|
333
|
+
}
|
334
|
+
//# sourceMappingURL=isRootPath.js.map
|
335
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/getInstalledModuleDirPath.js
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
async function getInstalledModuleDirPath(params) {
|
342
|
+
const { moduleName, packageJsonDirPath } = params;
|
343
|
+
{
|
344
|
+
let dirPath = packageJsonDirPath;
|
345
|
+
while (true) {
|
346
|
+
const dirPath_candidate = (0,external_path_.join)(dirPath, "node_modules", ...moduleName.split("/"));
|
347
|
+
let doesExist;
|
348
|
+
try {
|
349
|
+
doesExist = await (0,fs_existsAsync/* existsAsync */.o)(dirPath_candidate);
|
350
|
+
}
|
351
|
+
catch (_a) {
|
352
|
+
doesExist = false;
|
353
|
+
}
|
354
|
+
if (doesExist) {
|
355
|
+
return dirPath_candidate;
|
356
|
+
}
|
357
|
+
if (getIsRootPath(dirPath)) {
|
358
|
+
break;
|
359
|
+
}
|
360
|
+
dirPath = (0,external_path_.join)(dirPath, "..");
|
361
|
+
}
|
362
|
+
}
|
363
|
+
const dirPath = external_child_process_.execSync(`npm list ${moduleName}`, {
|
364
|
+
cwd: packageJsonDirPath
|
365
|
+
})
|
366
|
+
.toString("utf8")
|
367
|
+
.trim();
|
368
|
+
(0,assert/* assert */.h)(dirPath !== "");
|
369
|
+
return dirPath;
|
370
|
+
}
|
371
|
+
//# sourceMappingURL=getInstalledModuleDirPath.js.map
|
372
|
+
|
373
|
+
/***/ }),
|
374
|
+
|
297
375
|
/***/ 73776:
|
298
376
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
299
377
|
|
@@ -302,11 +380,38 @@ async function existsAsync(path) {
|
|
302
380
|
/* harmony export */ });
|
303
381
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
|
304
382
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
|
383
|
+
/* harmony import */ var _getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58822);
|
384
|
+
/* harmony import */ var _getInstalledModuleDirPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(93721);
|
385
|
+
/* harmony import */ var _fs_existsAsync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43765);
|
386
|
+
/* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(52300);
|
387
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(73292);
|
388
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_4__);
|
389
|
+
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29041);
|
390
|
+
/* harmony import */ var tsafe_id__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(38469);
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
|
305
398
|
|
306
|
-
let
|
307
|
-
function
|
308
|
-
|
309
|
-
|
399
|
+
let cache_bestEffort = undefined;
|
400
|
+
/** NOTE: Careful, this function can fail when the binary
|
401
|
+
* Used is not in the node_modules directory of the project
|
402
|
+
* (for example when running tests with vscode extension we'll get
|
403
|
+
* '/Users/dylan/.vscode/extensions/vitest.explorer-1.16.0/dist/worker.js'
|
404
|
+
*
|
405
|
+
* instead of
|
406
|
+
* '/Users/joseph/.nvm/versions/node/v22.12.0/bin/node'
|
407
|
+
* or
|
408
|
+
* '/Users/joseph/github/keycloakify-starter/node_modules/.bin/vite'
|
409
|
+
*
|
410
|
+
* as the value of process.argv[1]
|
411
|
+
*/
|
412
|
+
function getNodeModulesBinDirPath_bestEffort() {
|
413
|
+
if (cache_bestEffort !== undefined) {
|
414
|
+
return cache_bestEffort;
|
310
415
|
}
|
311
416
|
const binPath = process.argv[1];
|
312
417
|
const segments = [".bin"];
|
@@ -324,10 +429,71 @@ function getNodeModulesBinDirPath() {
|
|
324
429
|
}
|
325
430
|
segments.unshift(segment);
|
326
431
|
}
|
432
|
+
if (!foundNodeModules) {
|
433
|
+
throw new Error(`Could not find node_modules in path ${binPath}`);
|
434
|
+
}
|
327
435
|
const nodeModulesBinDirPath = segments.join(path__WEBPACK_IMPORTED_MODULE_0__.sep);
|
328
|
-
|
436
|
+
cache_bestEffort = nodeModulesBinDirPath;
|
329
437
|
return nodeModulesBinDirPath;
|
330
438
|
}
|
439
|
+
let cache_withPackageJsonFileDirPath = undefined;
|
440
|
+
async function getNodeModulesBinDirPath_withPackageJsonFileDirPath(params) {
|
441
|
+
const { packageJsonFilePath } = params;
|
442
|
+
use_cache: {
|
443
|
+
if (cache_withPackageJsonFileDirPath === undefined) {
|
444
|
+
break use_cache;
|
445
|
+
}
|
446
|
+
if (cache_withPackageJsonFileDirPath.packageJsonFilePath !== packageJsonFilePath) {
|
447
|
+
cache_withPackageJsonFileDirPath = undefined;
|
448
|
+
break use_cache;
|
449
|
+
}
|
450
|
+
return cache_withPackageJsonFileDirPath.nodeModulesBinDirPath;
|
451
|
+
}
|
452
|
+
// [...]node_modules/keycloakify
|
453
|
+
const installedModuleDirPath = await (0,_getInstalledModuleDirPath__WEBPACK_IMPORTED_MODULE_2__/* .getInstalledModuleDirPath */ .p)({
|
454
|
+
// Here it will always be "keycloakify" but since we are in tools/ we make something generic
|
455
|
+
moduleName: await (async () => {
|
456
|
+
const zParsedPackageJson = (() => {
|
457
|
+
const zTargetType = zod__WEBPACK_IMPORTED_MODULE_6__.z.object({
|
458
|
+
name: zod__WEBPACK_IMPORTED_MODULE_6__.z.string()
|
459
|
+
});
|
460
|
+
tsafe_assert__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .h;
|
461
|
+
return (0,tsafe_id__WEBPACK_IMPORTED_MODULE_7__.id)(zTargetType);
|
462
|
+
})();
|
463
|
+
const parsedPackageJson = JSON.parse((await fs_promises__WEBPACK_IMPORTED_MODULE_4__.readFile((0,path__WEBPACK_IMPORTED_MODULE_0__.join)((0,_getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_1__/* .getThisCodebaseRootDirPath */ .e)(), "package.json"))).toString("utf8"));
|
464
|
+
zParsedPackageJson.parse(parsedPackageJson);
|
465
|
+
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .h)((0,tsafe_assert__WEBPACK_IMPORTED_MODULE_5__.is)(parsedPackageJson));
|
466
|
+
return parsedPackageJson.name;
|
467
|
+
})(),
|
468
|
+
packageJsonDirPath: (0,path__WEBPACK_IMPORTED_MODULE_0__.dirname)(packageJsonFilePath)
|
469
|
+
});
|
470
|
+
const segments = installedModuleDirPath.split(path__WEBPACK_IMPORTED_MODULE_0__.sep);
|
471
|
+
while (true) {
|
472
|
+
const segment = segments.pop();
|
473
|
+
if (segment === undefined) {
|
474
|
+
throw new Error(`Could not find .bin directory relative to ${packageJsonFilePath}`);
|
475
|
+
}
|
476
|
+
if (segment !== "node_modules") {
|
477
|
+
continue;
|
478
|
+
}
|
479
|
+
const candidate = (0,path__WEBPACK_IMPORTED_MODULE_0__.join)(segments.join(path__WEBPACK_IMPORTED_MODULE_0__.sep), segment, ".bin");
|
480
|
+
if (!(await (0,_fs_existsAsync__WEBPACK_IMPORTED_MODULE_3__/* .existsAsync */ .o)(candidate))) {
|
481
|
+
continue;
|
482
|
+
}
|
483
|
+
cache_withPackageJsonFileDirPath = {
|
484
|
+
packageJsonFilePath,
|
485
|
+
nodeModulesBinDirPath: candidate
|
486
|
+
};
|
487
|
+
break;
|
488
|
+
}
|
489
|
+
return cache_withPackageJsonFileDirPath.nodeModulesBinDirPath;
|
490
|
+
}
|
491
|
+
function getNodeModulesBinDirPath(params) {
|
492
|
+
const { packageJsonFilePath } = params !== null && params !== void 0 ? params : {};
|
493
|
+
return packageJsonFilePath === undefined
|
494
|
+
? getNodeModulesBinDirPath_bestEffort()
|
495
|
+
: getNodeModulesBinDirPath_withPackageJsonFileDirPath({ packageJsonFilePath });
|
496
|
+
}
|
331
497
|
//# sourceMappingURL=nodeModulesBinDirPath.js.map
|
332
498
|
|
333
499
|
/***/ }),
|
@@ -368,7 +534,9 @@ async function getIsPrettierAvailable() {
|
|
368
534
|
if (getIsPrettierAvailable.cache !== undefined) {
|
369
535
|
return getIsPrettierAvailable.cache;
|
370
536
|
}
|
371
|
-
const nodeModulesBinDirPath = (0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)(
|
537
|
+
const nodeModulesBinDirPath = (0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)({
|
538
|
+
packageJsonFilePath: undefined
|
539
|
+
});
|
372
540
|
const prettierBinPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModulesBinDirPath, "prettier");
|
373
541
|
const stats = await fs_promises__WEBPACK_IMPORTED_MODULE_2__.stat(prettierBinPath).catch(() => undefined);
|
374
542
|
const isPrettierAvailable = (_a = stats === null || stats === void 0 ? void 0 : stats.isFile()) !== null && _a !== void 0 ? _a : false;
|
@@ -388,14 +556,14 @@ async function getPrettier() {
|
|
388
556
|
// So we do a sketchy eval to bypass ncc.
|
389
557
|
// We make sure to only do that when linking, otherwise we import properly.
|
390
558
|
if ((0,_readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_6__/* .readThisNpmPackageVersion */ .K)().startsWith("0.0.0")) {
|
391
|
-
eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_8__/* .symToStr */ .r)({ prettier })} = require("${(0,path__WEBPACK_IMPORTED_MODULE_1__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)(), "..", "prettier"))}")`);
|
559
|
+
eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_8__/* .symToStr */ .r)({ prettier })} = require("${(0,path__WEBPACK_IMPORTED_MODULE_1__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)({ packageJsonFilePath: undefined }), "..", "prettier"))}")`);
|
392
560
|
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .h)(!(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__.is)(prettier));
|
393
561
|
break import_prettier;
|
394
562
|
}
|
395
563
|
prettier = await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 79421, 23));
|
396
564
|
}
|
397
565
|
const configHash = await (async () => {
|
398
|
-
const configFilePath = await prettier.resolveConfigFile((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)(), ".."));
|
566
|
+
const configFilePath = await prettier.resolveConfigFile((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)({ packageJsonFilePath: undefined }), ".."));
|
399
567
|
if (configFilePath === null) {
|
400
568
|
return "";
|
401
569
|
}
|
@@ -464,7 +632,7 @@ async function command(params) {
|
|
464
632
|
const { command } = await __webpack_require__.e(/* import() */ 658).then(__webpack_require__.bind(__webpack_require__, 18040));
|
465
633
|
await command({ buildContext });
|
466
634
|
}
|
467
|
-
const { hasBeenHandled } = (0,_shared_customHandler_delegate__WEBPACK_IMPORTED_MODULE_3__/* .maybeDelegateCommandToCustomHandler */ .q)({
|
635
|
+
const { hasBeenHandled } = await (0,_shared_customHandler_delegate__WEBPACK_IMPORTED_MODULE_3__/* .maybeDelegateCommandToCustomHandler */ .q)({
|
468
636
|
commandName: "update-kc-gen",
|
469
637
|
buildContext
|
470
638
|
});
|
package/bin/363.index.js
CHANGED
@@ -1060,11 +1060,38 @@ const { readPackageJsonVersionAndPeerDependencies } = (() => {
|
|
1060
1060
|
/* harmony export */ });
|
1061
1061
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
|
1062
1062
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
|
1063
|
+
/* harmony import */ var _getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58822);
|
1064
|
+
/* harmony import */ var _getInstalledModuleDirPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(93721);
|
1065
|
+
/* harmony import */ var _fs_existsAsync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43765);
|
1066
|
+
/* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(52300);
|
1067
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(73292);
|
1068
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_4__);
|
1069
|
+
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29041);
|
1070
|
+
/* harmony import */ var tsafe_id__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(38469);
|
1071
|
+
|
1072
|
+
|
1073
|
+
|
1074
|
+
|
1075
|
+
|
1076
|
+
|
1063
1077
|
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1078
|
+
|
1079
|
+
let cache_bestEffort = undefined;
|
1080
|
+
/** NOTE: Careful, this function can fail when the binary
|
1081
|
+
* Used is not in the node_modules directory of the project
|
1082
|
+
* (for example when running tests with vscode extension we'll get
|
1083
|
+
* '/Users/dylan/.vscode/extensions/vitest.explorer-1.16.0/dist/worker.js'
|
1084
|
+
*
|
1085
|
+
* instead of
|
1086
|
+
* '/Users/joseph/.nvm/versions/node/v22.12.0/bin/node'
|
1087
|
+
* or
|
1088
|
+
* '/Users/joseph/github/keycloakify-starter/node_modules/.bin/vite'
|
1089
|
+
*
|
1090
|
+
* as the value of process.argv[1]
|
1091
|
+
*/
|
1092
|
+
function getNodeModulesBinDirPath_bestEffort() {
|
1093
|
+
if (cache_bestEffort !== undefined) {
|
1094
|
+
return cache_bestEffort;
|
1068
1095
|
}
|
1069
1096
|
const binPath = process.argv[1];
|
1070
1097
|
const segments = [".bin"];
|
@@ -1082,10 +1109,71 @@ function getNodeModulesBinDirPath() {
|
|
1082
1109
|
}
|
1083
1110
|
segments.unshift(segment);
|
1084
1111
|
}
|
1112
|
+
if (!foundNodeModules) {
|
1113
|
+
throw new Error(`Could not find node_modules in path ${binPath}`);
|
1114
|
+
}
|
1085
1115
|
const nodeModulesBinDirPath = segments.join(path__WEBPACK_IMPORTED_MODULE_0__.sep);
|
1086
|
-
|
1116
|
+
cache_bestEffort = nodeModulesBinDirPath;
|
1087
1117
|
return nodeModulesBinDirPath;
|
1088
1118
|
}
|
1119
|
+
let cache_withPackageJsonFileDirPath = undefined;
|
1120
|
+
async function getNodeModulesBinDirPath_withPackageJsonFileDirPath(params) {
|
1121
|
+
const { packageJsonFilePath } = params;
|
1122
|
+
use_cache: {
|
1123
|
+
if (cache_withPackageJsonFileDirPath === undefined) {
|
1124
|
+
break use_cache;
|
1125
|
+
}
|
1126
|
+
if (cache_withPackageJsonFileDirPath.packageJsonFilePath !== packageJsonFilePath) {
|
1127
|
+
cache_withPackageJsonFileDirPath = undefined;
|
1128
|
+
break use_cache;
|
1129
|
+
}
|
1130
|
+
return cache_withPackageJsonFileDirPath.nodeModulesBinDirPath;
|
1131
|
+
}
|
1132
|
+
// [...]node_modules/keycloakify
|
1133
|
+
const installedModuleDirPath = await (0,_getInstalledModuleDirPath__WEBPACK_IMPORTED_MODULE_2__/* .getInstalledModuleDirPath */ .p)({
|
1134
|
+
// Here it will always be "keycloakify" but since we are in tools/ we make something generic
|
1135
|
+
moduleName: await (async () => {
|
1136
|
+
const zParsedPackageJson = (() => {
|
1137
|
+
const zTargetType = zod__WEBPACK_IMPORTED_MODULE_6__.z.object({
|
1138
|
+
name: zod__WEBPACK_IMPORTED_MODULE_6__.z.string()
|
1139
|
+
});
|
1140
|
+
tsafe_assert__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .h;
|
1141
|
+
return (0,tsafe_id__WEBPACK_IMPORTED_MODULE_7__.id)(zTargetType);
|
1142
|
+
})();
|
1143
|
+
const parsedPackageJson = JSON.parse((await fs_promises__WEBPACK_IMPORTED_MODULE_4__.readFile((0,path__WEBPACK_IMPORTED_MODULE_0__.join)((0,_getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_1__/* .getThisCodebaseRootDirPath */ .e)(), "package.json"))).toString("utf8"));
|
1144
|
+
zParsedPackageJson.parse(parsedPackageJson);
|
1145
|
+
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .h)((0,tsafe_assert__WEBPACK_IMPORTED_MODULE_5__.is)(parsedPackageJson));
|
1146
|
+
return parsedPackageJson.name;
|
1147
|
+
})(),
|
1148
|
+
packageJsonDirPath: (0,path__WEBPACK_IMPORTED_MODULE_0__.dirname)(packageJsonFilePath)
|
1149
|
+
});
|
1150
|
+
const segments = installedModuleDirPath.split(path__WEBPACK_IMPORTED_MODULE_0__.sep);
|
1151
|
+
while (true) {
|
1152
|
+
const segment = segments.pop();
|
1153
|
+
if (segment === undefined) {
|
1154
|
+
throw new Error(`Could not find .bin directory relative to ${packageJsonFilePath}`);
|
1155
|
+
}
|
1156
|
+
if (segment !== "node_modules") {
|
1157
|
+
continue;
|
1158
|
+
}
|
1159
|
+
const candidate = (0,path__WEBPACK_IMPORTED_MODULE_0__.join)(segments.join(path__WEBPACK_IMPORTED_MODULE_0__.sep), segment, ".bin");
|
1160
|
+
if (!(await (0,_fs_existsAsync__WEBPACK_IMPORTED_MODULE_3__/* .existsAsync */ .o)(candidate))) {
|
1161
|
+
continue;
|
1162
|
+
}
|
1163
|
+
cache_withPackageJsonFileDirPath = {
|
1164
|
+
packageJsonFilePath,
|
1165
|
+
nodeModulesBinDirPath: candidate
|
1166
|
+
};
|
1167
|
+
break;
|
1168
|
+
}
|
1169
|
+
return cache_withPackageJsonFileDirPath.nodeModulesBinDirPath;
|
1170
|
+
}
|
1171
|
+
function getNodeModulesBinDirPath(params) {
|
1172
|
+
const { packageJsonFilePath } = params !== null && params !== void 0 ? params : {};
|
1173
|
+
return packageJsonFilePath === undefined
|
1174
|
+
? getNodeModulesBinDirPath_bestEffort()
|
1175
|
+
: getNodeModulesBinDirPath_withPackageJsonFileDirPath({ packageJsonFilePath });
|
1176
|
+
}
|
1089
1177
|
//# sourceMappingURL=nodeModulesBinDirPath.js.map
|
1090
1178
|
|
1091
1179
|
/***/ }),
|
@@ -1499,7 +1587,9 @@ async function getIsPrettierAvailable() {
|
|
1499
1587
|
if (getIsPrettierAvailable.cache !== undefined) {
|
1500
1588
|
return getIsPrettierAvailable.cache;
|
1501
1589
|
}
|
1502
|
-
const nodeModulesBinDirPath = (0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)(
|
1590
|
+
const nodeModulesBinDirPath = (0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)({
|
1591
|
+
packageJsonFilePath: undefined
|
1592
|
+
});
|
1503
1593
|
const prettierBinPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModulesBinDirPath, "prettier");
|
1504
1594
|
const stats = await fs_promises__WEBPACK_IMPORTED_MODULE_2__.stat(prettierBinPath).catch(() => undefined);
|
1505
1595
|
const isPrettierAvailable = (_a = stats === null || stats === void 0 ? void 0 : stats.isFile()) !== null && _a !== void 0 ? _a : false;
|
@@ -1519,14 +1609,14 @@ async function getPrettier() {
|
|
1519
1609
|
// So we do a sketchy eval to bypass ncc.
|
1520
1610
|
// We make sure to only do that when linking, otherwise we import properly.
|
1521
1611
|
if ((0,_readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_6__/* .readThisNpmPackageVersion */ .K)().startsWith("0.0.0")) {
|
1522
|
-
eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_8__/* .symToStr */ .r)({ prettier })} = require("${(0,path__WEBPACK_IMPORTED_MODULE_1__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)(), "..", "prettier"))}")`);
|
1612
|
+
eval(`${(0,tsafe_symToStr__WEBPACK_IMPORTED_MODULE_8__/* .symToStr */ .r)({ prettier })} = require("${(0,path__WEBPACK_IMPORTED_MODULE_1__.resolve)((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)({ packageJsonFilePath: undefined }), "..", "prettier"))}")`);
|
1523
1613
|
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .h)(!(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__.is)(prettier));
|
1524
1614
|
break import_prettier;
|
1525
1615
|
}
|
1526
1616
|
prettier = await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 79421, 23));
|
1527
1617
|
}
|
1528
1618
|
const configHash = await (async () => {
|
1529
|
-
const configFilePath = await prettier.resolveConfigFile((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)(), ".."));
|
1619
|
+
const configFilePath = await prettier.resolveConfigFile((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)({ packageJsonFilePath: undefined }), ".."));
|
1530
1620
|
if (configFilePath === null) {
|
1531
1621
|
return "";
|
1532
1622
|
}
|