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/658.index.js
CHANGED
@@ -30,7 +30,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
30
30
|
|
31
31
|
async function command(params) {
|
32
32
|
const { buildContext } = params;
|
33
|
-
const { hasBeenHandled } = (0,_shared_customHandler_delegate__WEBPACK_IMPORTED_MODULE_0__/* .maybeDelegateCommandToCustomHandler */ .q)({
|
33
|
+
const { hasBeenHandled } = await (0,_shared_customHandler_delegate__WEBPACK_IMPORTED_MODULE_0__/* .maybeDelegateCommandToCustomHandler */ .q)({
|
34
34
|
commandName: "copy-keycloak-resources-to-public",
|
35
35
|
buildContext
|
36
36
|
});
|
package/bin/780.index.js
CHANGED
@@ -101,7 +101,7 @@ var getThisCodebaseRootDirPath = __webpack_require__(58822);
|
|
101
101
|
|
102
102
|
async function command(params) {
|
103
103
|
const { buildContext } = params;
|
104
|
-
const { hasBeenHandled } = (0,customHandler_delegate/* maybeDelegateCommandToCustomHandler */.q)({
|
104
|
+
const { hasBeenHandled } = await (0,customHandler_delegate/* maybeDelegateCommandToCustomHandler */.q)({
|
105
105
|
commandName: "initialize-account-theme",
|
106
106
|
buildContext
|
107
107
|
});
|
@@ -201,9 +201,11 @@ var external_fs_ = __webpack_require__(57147);
|
|
201
201
|
|
202
202
|
|
203
203
|
(0,esm_assert/* assert */.h)();
|
204
|
-
function maybeDelegateCommandToCustomHandler(params) {
|
204
|
+
async function maybeDelegateCommandToCustomHandler(params) {
|
205
205
|
const { commandName, buildContext } = params;
|
206
|
-
const nodeModulesBinDirPath = (0,tools_nodeModulesBinDirPath/* getNodeModulesBinDirPath */.K)(
|
206
|
+
const nodeModulesBinDirPath = await (0,tools_nodeModulesBinDirPath/* getNodeModulesBinDirPath */.K)({
|
207
|
+
packageJsonFilePath: buildContext.packageJsonFilePath
|
208
|
+
});
|
207
209
|
if (!external_fs_.readdirSync(nodeModulesBinDirPath).includes(BIN_NAME)) {
|
208
210
|
return { hasBeenHandled: false };
|
209
211
|
}
|
@@ -291,6 +293,82 @@ async function existsAsync(path) {
|
|
291
293
|
|
292
294
|
/***/ }),
|
293
295
|
|
296
|
+
/***/ 93721:
|
297
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
298
|
+
|
299
|
+
|
300
|
+
// EXPORTS
|
301
|
+
__webpack_require__.d(__webpack_exports__, {
|
302
|
+
"p": () => (/* binding */ getInstalledModuleDirPath)
|
303
|
+
});
|
304
|
+
|
305
|
+
// EXTERNAL MODULE: external "path"
|
306
|
+
var external_path_ = __webpack_require__(71017);
|
307
|
+
// EXTERNAL MODULE: ./dist/bin/tools/fs.existsAsync.js
|
308
|
+
var fs_existsAsync = __webpack_require__(43765);
|
309
|
+
// EXTERNAL MODULE: external "child_process"
|
310
|
+
var external_child_process_ = __webpack_require__(32081);
|
311
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
|
312
|
+
var assert = __webpack_require__(29041);
|
313
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/isRootPath.js
|
314
|
+
|
315
|
+
function getIsRootPath(filePath) {
|
316
|
+
const path_normalized = (0,external_path_.normalize)(filePath);
|
317
|
+
// Unix-like root ("/")
|
318
|
+
if (path_normalized === "/") {
|
319
|
+
return true;
|
320
|
+
}
|
321
|
+
// Check for Windows drive root (e.g., "C:\\")
|
322
|
+
if (/^[a-zA-Z]:\\$/.test(path_normalized)) {
|
323
|
+
return true;
|
324
|
+
}
|
325
|
+
// Check for UNC root (e.g., "\\server\share")
|
326
|
+
if (/^\\\\[^\\]+\\[^\\]+\\?$/.test(path_normalized)) {
|
327
|
+
return true;
|
328
|
+
}
|
329
|
+
return false;
|
330
|
+
}
|
331
|
+
//# sourceMappingURL=isRootPath.js.map
|
332
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/getInstalledModuleDirPath.js
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
async function getInstalledModuleDirPath(params) {
|
339
|
+
const { moduleName, packageJsonDirPath } = params;
|
340
|
+
{
|
341
|
+
let dirPath = packageJsonDirPath;
|
342
|
+
while (true) {
|
343
|
+
const dirPath_candidate = (0,external_path_.join)(dirPath, "node_modules", ...moduleName.split("/"));
|
344
|
+
let doesExist;
|
345
|
+
try {
|
346
|
+
doesExist = await (0,fs_existsAsync/* existsAsync */.o)(dirPath_candidate);
|
347
|
+
}
|
348
|
+
catch (_a) {
|
349
|
+
doesExist = false;
|
350
|
+
}
|
351
|
+
if (doesExist) {
|
352
|
+
return dirPath_candidate;
|
353
|
+
}
|
354
|
+
if (getIsRootPath(dirPath)) {
|
355
|
+
break;
|
356
|
+
}
|
357
|
+
dirPath = (0,external_path_.join)(dirPath, "..");
|
358
|
+
}
|
359
|
+
}
|
360
|
+
const dirPath = external_child_process_.execSync(`npm list ${moduleName}`, {
|
361
|
+
cwd: packageJsonDirPath
|
362
|
+
})
|
363
|
+
.toString("utf8")
|
364
|
+
.trim();
|
365
|
+
(0,assert/* assert */.h)(dirPath !== "");
|
366
|
+
return dirPath;
|
367
|
+
}
|
368
|
+
//# sourceMappingURL=getInstalledModuleDirPath.js.map
|
369
|
+
|
370
|
+
/***/ }),
|
371
|
+
|
294
372
|
/***/ 73776:
|
295
373
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
296
374
|
|
@@ -299,11 +377,38 @@ async function existsAsync(path) {
|
|
299
377
|
/* harmony export */ });
|
300
378
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
|
301
379
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
|
380
|
+
/* harmony import */ var _getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58822);
|
381
|
+
/* harmony import */ var _getInstalledModuleDirPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(93721);
|
382
|
+
/* harmony import */ var _fs_existsAsync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43765);
|
383
|
+
/* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(52300);
|
384
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(73292);
|
385
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_4__);
|
386
|
+
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29041);
|
387
|
+
/* harmony import */ var tsafe_id__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(38469);
|
388
|
+
|
389
|
+
|
302
390
|
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
let cache_bestEffort = undefined;
|
397
|
+
/** NOTE: Careful, this function can fail when the binary
|
398
|
+
* Used is not in the node_modules directory of the project
|
399
|
+
* (for example when running tests with vscode extension we'll get
|
400
|
+
* '/Users/dylan/.vscode/extensions/vitest.explorer-1.16.0/dist/worker.js'
|
401
|
+
*
|
402
|
+
* instead of
|
403
|
+
* '/Users/joseph/.nvm/versions/node/v22.12.0/bin/node'
|
404
|
+
* or
|
405
|
+
* '/Users/joseph/github/keycloakify-starter/node_modules/.bin/vite'
|
406
|
+
*
|
407
|
+
* as the value of process.argv[1]
|
408
|
+
*/
|
409
|
+
function getNodeModulesBinDirPath_bestEffort() {
|
410
|
+
if (cache_bestEffort !== undefined) {
|
411
|
+
return cache_bestEffort;
|
307
412
|
}
|
308
413
|
const binPath = process.argv[1];
|
309
414
|
const segments = [".bin"];
|
@@ -321,10 +426,71 @@ function getNodeModulesBinDirPath() {
|
|
321
426
|
}
|
322
427
|
segments.unshift(segment);
|
323
428
|
}
|
429
|
+
if (!foundNodeModules) {
|
430
|
+
throw new Error(`Could not find node_modules in path ${binPath}`);
|
431
|
+
}
|
324
432
|
const nodeModulesBinDirPath = segments.join(path__WEBPACK_IMPORTED_MODULE_0__.sep);
|
325
|
-
|
433
|
+
cache_bestEffort = nodeModulesBinDirPath;
|
326
434
|
return nodeModulesBinDirPath;
|
327
435
|
}
|
436
|
+
let cache_withPackageJsonFileDirPath = undefined;
|
437
|
+
async function getNodeModulesBinDirPath_withPackageJsonFileDirPath(params) {
|
438
|
+
const { packageJsonFilePath } = params;
|
439
|
+
use_cache: {
|
440
|
+
if (cache_withPackageJsonFileDirPath === undefined) {
|
441
|
+
break use_cache;
|
442
|
+
}
|
443
|
+
if (cache_withPackageJsonFileDirPath.packageJsonFilePath !== packageJsonFilePath) {
|
444
|
+
cache_withPackageJsonFileDirPath = undefined;
|
445
|
+
break use_cache;
|
446
|
+
}
|
447
|
+
return cache_withPackageJsonFileDirPath.nodeModulesBinDirPath;
|
448
|
+
}
|
449
|
+
// [...]node_modules/keycloakify
|
450
|
+
const installedModuleDirPath = await (0,_getInstalledModuleDirPath__WEBPACK_IMPORTED_MODULE_2__/* .getInstalledModuleDirPath */ .p)({
|
451
|
+
// Here it will always be "keycloakify" but since we are in tools/ we make something generic
|
452
|
+
moduleName: await (async () => {
|
453
|
+
const zParsedPackageJson = (() => {
|
454
|
+
const zTargetType = zod__WEBPACK_IMPORTED_MODULE_6__.z.object({
|
455
|
+
name: zod__WEBPACK_IMPORTED_MODULE_6__.z.string()
|
456
|
+
});
|
457
|
+
tsafe_assert__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .h;
|
458
|
+
return (0,tsafe_id__WEBPACK_IMPORTED_MODULE_7__.id)(zTargetType);
|
459
|
+
})();
|
460
|
+
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"));
|
461
|
+
zParsedPackageJson.parse(parsedPackageJson);
|
462
|
+
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .h)((0,tsafe_assert__WEBPACK_IMPORTED_MODULE_5__.is)(parsedPackageJson));
|
463
|
+
return parsedPackageJson.name;
|
464
|
+
})(),
|
465
|
+
packageJsonDirPath: (0,path__WEBPACK_IMPORTED_MODULE_0__.dirname)(packageJsonFilePath)
|
466
|
+
});
|
467
|
+
const segments = installedModuleDirPath.split(path__WEBPACK_IMPORTED_MODULE_0__.sep);
|
468
|
+
while (true) {
|
469
|
+
const segment = segments.pop();
|
470
|
+
if (segment === undefined) {
|
471
|
+
throw new Error(`Could not find .bin directory relative to ${packageJsonFilePath}`);
|
472
|
+
}
|
473
|
+
if (segment !== "node_modules") {
|
474
|
+
continue;
|
475
|
+
}
|
476
|
+
const candidate = (0,path__WEBPACK_IMPORTED_MODULE_0__.join)(segments.join(path__WEBPACK_IMPORTED_MODULE_0__.sep), segment, ".bin");
|
477
|
+
if (!(await (0,_fs_existsAsync__WEBPACK_IMPORTED_MODULE_3__/* .existsAsync */ .o)(candidate))) {
|
478
|
+
continue;
|
479
|
+
}
|
480
|
+
cache_withPackageJsonFileDirPath = {
|
481
|
+
packageJsonFilePath,
|
482
|
+
nodeModulesBinDirPath: candidate
|
483
|
+
};
|
484
|
+
break;
|
485
|
+
}
|
486
|
+
return cache_withPackageJsonFileDirPath.nodeModulesBinDirPath;
|
487
|
+
}
|
488
|
+
function getNodeModulesBinDirPath(params) {
|
489
|
+
const { packageJsonFilePath } = params !== null && params !== void 0 ? params : {};
|
490
|
+
return packageJsonFilePath === undefined
|
491
|
+
? getNodeModulesBinDirPath_bestEffort()
|
492
|
+
: getNodeModulesBinDirPath_withPackageJsonFileDirPath({ packageJsonFilePath });
|
493
|
+
}
|
328
494
|
//# sourceMappingURL=nodeModulesBinDirPath.js.map
|
329
495
|
|
330
496
|
/***/ }),
|
@@ -365,7 +531,9 @@ async function getIsPrettierAvailable() {
|
|
365
531
|
if (getIsPrettierAvailable.cache !== undefined) {
|
366
532
|
return getIsPrettierAvailable.cache;
|
367
533
|
}
|
368
|
-
const nodeModulesBinDirPath = (0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)(
|
534
|
+
const nodeModulesBinDirPath = (0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)({
|
535
|
+
packageJsonFilePath: undefined
|
536
|
+
});
|
369
537
|
const prettierBinPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModulesBinDirPath, "prettier");
|
370
538
|
const stats = await fs_promises__WEBPACK_IMPORTED_MODULE_2__.stat(prettierBinPath).catch(() => undefined);
|
371
539
|
const isPrettierAvailable = (_a = stats === null || stats === void 0 ? void 0 : stats.isFile()) !== null && _a !== void 0 ? _a : false;
|
@@ -385,14 +553,14 @@ async function getPrettier() {
|
|
385
553
|
// So we do a sketchy eval to bypass ncc.
|
386
554
|
// We make sure to only do that when linking, otherwise we import properly.
|
387
555
|
if ((0,_readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_6__/* .readThisNpmPackageVersion */ .K)().startsWith("0.0.0")) {
|
388
|
-
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"))}")`);
|
556
|
+
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"))}")`);
|
389
557
|
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .h)(!(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__.is)(prettier));
|
390
558
|
break import_prettier;
|
391
559
|
}
|
392
560
|
prettier = await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 79421, 23));
|
393
561
|
}
|
394
562
|
const configHash = await (async () => {
|
395
|
-
const configFilePath = await prettier.resolveConfigFile((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)(), ".."));
|
563
|
+
const configFilePath = await prettier.resolveConfigFile((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)({ packageJsonFilePath: undefined }), ".."));
|
396
564
|
if (configFilePath === null) {
|
397
565
|
return "";
|
398
566
|
}
|
@@ -461,7 +629,7 @@ async function command(params) {
|
|
461
629
|
const { command } = await __webpack_require__.e(/* import() */ 658).then(__webpack_require__.bind(__webpack_require__, 18040));
|
462
630
|
await command({ buildContext });
|
463
631
|
}
|
464
|
-
const { hasBeenHandled } = (0,_shared_customHandler_delegate__WEBPACK_IMPORTED_MODULE_3__/* .maybeDelegateCommandToCustomHandler */ .q)({
|
632
|
+
const { hasBeenHandled } = await (0,_shared_customHandler_delegate__WEBPACK_IMPORTED_MODULE_3__/* .maybeDelegateCommandToCustomHandler */ .q)({
|
465
633
|
commandName: "update-kc-gen",
|
466
634
|
buildContext
|
467
635
|
});
|
package/bin/786.index.js
CHANGED
@@ -51,9 +51,11 @@ var external_fs_ = __webpack_require__(57147);
|
|
51
51
|
|
52
52
|
|
53
53
|
(0,esm_assert/* assert */.h)();
|
54
|
-
function maybeDelegateCommandToCustomHandler(params) {
|
54
|
+
async function maybeDelegateCommandToCustomHandler(params) {
|
55
55
|
const { commandName, buildContext } = params;
|
56
|
-
const nodeModulesBinDirPath = (0,tools_nodeModulesBinDirPath/* getNodeModulesBinDirPath */.K)(
|
56
|
+
const nodeModulesBinDirPath = await (0,tools_nodeModulesBinDirPath/* getNodeModulesBinDirPath */.K)({
|
57
|
+
packageJsonFilePath: buildContext.packageJsonFilePath
|
58
|
+
});
|
57
59
|
if (!external_fs_.readdirSync(nodeModulesBinDirPath).includes(BIN_NAME)) {
|
58
60
|
return { hasBeenHandled: false };
|
59
61
|
}
|
@@ -100,6 +102,82 @@ async function existsAsync(path) {
|
|
100
102
|
|
101
103
|
/***/ }),
|
102
104
|
|
105
|
+
/***/ 93721:
|
106
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
107
|
+
|
108
|
+
|
109
|
+
// EXPORTS
|
110
|
+
__webpack_require__.d(__webpack_exports__, {
|
111
|
+
"p": () => (/* binding */ getInstalledModuleDirPath)
|
112
|
+
});
|
113
|
+
|
114
|
+
// EXTERNAL MODULE: external "path"
|
115
|
+
var external_path_ = __webpack_require__(71017);
|
116
|
+
// EXTERNAL MODULE: ./dist/bin/tools/fs.existsAsync.js
|
117
|
+
var fs_existsAsync = __webpack_require__(43765);
|
118
|
+
// EXTERNAL MODULE: external "child_process"
|
119
|
+
var external_child_process_ = __webpack_require__(32081);
|
120
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
|
121
|
+
var assert = __webpack_require__(29041);
|
122
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/isRootPath.js
|
123
|
+
|
124
|
+
function getIsRootPath(filePath) {
|
125
|
+
const path_normalized = (0,external_path_.normalize)(filePath);
|
126
|
+
// Unix-like root ("/")
|
127
|
+
if (path_normalized === "/") {
|
128
|
+
return true;
|
129
|
+
}
|
130
|
+
// Check for Windows drive root (e.g., "C:\\")
|
131
|
+
if (/^[a-zA-Z]:\\$/.test(path_normalized)) {
|
132
|
+
return true;
|
133
|
+
}
|
134
|
+
// Check for UNC root (e.g., "\\server\share")
|
135
|
+
if (/^\\\\[^\\]+\\[^\\]+\\?$/.test(path_normalized)) {
|
136
|
+
return true;
|
137
|
+
}
|
138
|
+
return false;
|
139
|
+
}
|
140
|
+
//# sourceMappingURL=isRootPath.js.map
|
141
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/getInstalledModuleDirPath.js
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
async function getInstalledModuleDirPath(params) {
|
148
|
+
const { moduleName, packageJsonDirPath } = params;
|
149
|
+
{
|
150
|
+
let dirPath = packageJsonDirPath;
|
151
|
+
while (true) {
|
152
|
+
const dirPath_candidate = (0,external_path_.join)(dirPath, "node_modules", ...moduleName.split("/"));
|
153
|
+
let doesExist;
|
154
|
+
try {
|
155
|
+
doesExist = await (0,fs_existsAsync/* existsAsync */.o)(dirPath_candidate);
|
156
|
+
}
|
157
|
+
catch (_a) {
|
158
|
+
doesExist = false;
|
159
|
+
}
|
160
|
+
if (doesExist) {
|
161
|
+
return dirPath_candidate;
|
162
|
+
}
|
163
|
+
if (getIsRootPath(dirPath)) {
|
164
|
+
break;
|
165
|
+
}
|
166
|
+
dirPath = (0,external_path_.join)(dirPath, "..");
|
167
|
+
}
|
168
|
+
}
|
169
|
+
const dirPath = external_child_process_.execSync(`npm list ${moduleName}`, {
|
170
|
+
cwd: packageJsonDirPath
|
171
|
+
})
|
172
|
+
.toString("utf8")
|
173
|
+
.trim();
|
174
|
+
(0,assert/* assert */.h)(dirPath !== "");
|
175
|
+
return dirPath;
|
176
|
+
}
|
177
|
+
//# sourceMappingURL=getInstalledModuleDirPath.js.map
|
178
|
+
|
179
|
+
/***/ }),
|
180
|
+
|
103
181
|
/***/ 73776:
|
104
182
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
105
183
|
|
@@ -108,11 +186,38 @@ async function existsAsync(path) {
|
|
108
186
|
/* harmony export */ });
|
109
187
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
|
110
188
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
|
189
|
+
/* harmony import */ var _getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58822);
|
190
|
+
/* harmony import */ var _getInstalledModuleDirPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(93721);
|
191
|
+
/* harmony import */ var _fs_existsAsync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43765);
|
192
|
+
/* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(52300);
|
193
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(73292);
|
194
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_4__);
|
195
|
+
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29041);
|
196
|
+
/* harmony import */ var tsafe_id__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(38469);
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
111
204
|
|
112
|
-
let
|
113
|
-
function
|
114
|
-
|
115
|
-
|
205
|
+
let cache_bestEffort = undefined;
|
206
|
+
/** NOTE: Careful, this function can fail when the binary
|
207
|
+
* Used is not in the node_modules directory of the project
|
208
|
+
* (for example when running tests with vscode extension we'll get
|
209
|
+
* '/Users/dylan/.vscode/extensions/vitest.explorer-1.16.0/dist/worker.js'
|
210
|
+
*
|
211
|
+
* instead of
|
212
|
+
* '/Users/joseph/.nvm/versions/node/v22.12.0/bin/node'
|
213
|
+
* or
|
214
|
+
* '/Users/joseph/github/keycloakify-starter/node_modules/.bin/vite'
|
215
|
+
*
|
216
|
+
* as the value of process.argv[1]
|
217
|
+
*/
|
218
|
+
function getNodeModulesBinDirPath_bestEffort() {
|
219
|
+
if (cache_bestEffort !== undefined) {
|
220
|
+
return cache_bestEffort;
|
116
221
|
}
|
117
222
|
const binPath = process.argv[1];
|
118
223
|
const segments = [".bin"];
|
@@ -130,10 +235,71 @@ function getNodeModulesBinDirPath() {
|
|
130
235
|
}
|
131
236
|
segments.unshift(segment);
|
132
237
|
}
|
238
|
+
if (!foundNodeModules) {
|
239
|
+
throw new Error(`Could not find node_modules in path ${binPath}`);
|
240
|
+
}
|
133
241
|
const nodeModulesBinDirPath = segments.join(path__WEBPACK_IMPORTED_MODULE_0__.sep);
|
134
|
-
|
242
|
+
cache_bestEffort = nodeModulesBinDirPath;
|
135
243
|
return nodeModulesBinDirPath;
|
136
244
|
}
|
245
|
+
let cache_withPackageJsonFileDirPath = undefined;
|
246
|
+
async function getNodeModulesBinDirPath_withPackageJsonFileDirPath(params) {
|
247
|
+
const { packageJsonFilePath } = params;
|
248
|
+
use_cache: {
|
249
|
+
if (cache_withPackageJsonFileDirPath === undefined) {
|
250
|
+
break use_cache;
|
251
|
+
}
|
252
|
+
if (cache_withPackageJsonFileDirPath.packageJsonFilePath !== packageJsonFilePath) {
|
253
|
+
cache_withPackageJsonFileDirPath = undefined;
|
254
|
+
break use_cache;
|
255
|
+
}
|
256
|
+
return cache_withPackageJsonFileDirPath.nodeModulesBinDirPath;
|
257
|
+
}
|
258
|
+
// [...]node_modules/keycloakify
|
259
|
+
const installedModuleDirPath = await (0,_getInstalledModuleDirPath__WEBPACK_IMPORTED_MODULE_2__/* .getInstalledModuleDirPath */ .p)({
|
260
|
+
// Here it will always be "keycloakify" but since we are in tools/ we make something generic
|
261
|
+
moduleName: await (async () => {
|
262
|
+
const zParsedPackageJson = (() => {
|
263
|
+
const zTargetType = zod__WEBPACK_IMPORTED_MODULE_6__.z.object({
|
264
|
+
name: zod__WEBPACK_IMPORTED_MODULE_6__.z.string()
|
265
|
+
});
|
266
|
+
tsafe_assert__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .h;
|
267
|
+
return (0,tsafe_id__WEBPACK_IMPORTED_MODULE_7__.id)(zTargetType);
|
268
|
+
})();
|
269
|
+
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"));
|
270
|
+
zParsedPackageJson.parse(parsedPackageJson);
|
271
|
+
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .h)((0,tsafe_assert__WEBPACK_IMPORTED_MODULE_5__.is)(parsedPackageJson));
|
272
|
+
return parsedPackageJson.name;
|
273
|
+
})(),
|
274
|
+
packageJsonDirPath: (0,path__WEBPACK_IMPORTED_MODULE_0__.dirname)(packageJsonFilePath)
|
275
|
+
});
|
276
|
+
const segments = installedModuleDirPath.split(path__WEBPACK_IMPORTED_MODULE_0__.sep);
|
277
|
+
while (true) {
|
278
|
+
const segment = segments.pop();
|
279
|
+
if (segment === undefined) {
|
280
|
+
throw new Error(`Could not find .bin directory relative to ${packageJsonFilePath}`);
|
281
|
+
}
|
282
|
+
if (segment !== "node_modules") {
|
283
|
+
continue;
|
284
|
+
}
|
285
|
+
const candidate = (0,path__WEBPACK_IMPORTED_MODULE_0__.join)(segments.join(path__WEBPACK_IMPORTED_MODULE_0__.sep), segment, ".bin");
|
286
|
+
if (!(await (0,_fs_existsAsync__WEBPACK_IMPORTED_MODULE_3__/* .existsAsync */ .o)(candidate))) {
|
287
|
+
continue;
|
288
|
+
}
|
289
|
+
cache_withPackageJsonFileDirPath = {
|
290
|
+
packageJsonFilePath,
|
291
|
+
nodeModulesBinDirPath: candidate
|
292
|
+
};
|
293
|
+
break;
|
294
|
+
}
|
295
|
+
return cache_withPackageJsonFileDirPath.nodeModulesBinDirPath;
|
296
|
+
}
|
297
|
+
function getNodeModulesBinDirPath(params) {
|
298
|
+
const { packageJsonFilePath } = params !== null && params !== void 0 ? params : {};
|
299
|
+
return packageJsonFilePath === undefined
|
300
|
+
? getNodeModulesBinDirPath_bestEffort()
|
301
|
+
: getNodeModulesBinDirPath_withPackageJsonFileDirPath({ packageJsonFilePath });
|
302
|
+
}
|
137
303
|
//# sourceMappingURL=nodeModulesBinDirPath.js.map
|
138
304
|
|
139
305
|
/***/ }),
|
@@ -174,7 +340,9 @@ async function getIsPrettierAvailable() {
|
|
174
340
|
if (getIsPrettierAvailable.cache !== undefined) {
|
175
341
|
return getIsPrettierAvailable.cache;
|
176
342
|
}
|
177
|
-
const nodeModulesBinDirPath = (0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)(
|
343
|
+
const nodeModulesBinDirPath = (0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)({
|
344
|
+
packageJsonFilePath: undefined
|
345
|
+
});
|
178
346
|
const prettierBinPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModulesBinDirPath, "prettier");
|
179
347
|
const stats = await fs_promises__WEBPACK_IMPORTED_MODULE_2__.stat(prettierBinPath).catch(() => undefined);
|
180
348
|
const isPrettierAvailable = (_a = stats === null || stats === void 0 ? void 0 : stats.isFile()) !== null && _a !== void 0 ? _a : false;
|
@@ -194,14 +362,14 @@ async function getPrettier() {
|
|
194
362
|
// So we do a sketchy eval to bypass ncc.
|
195
363
|
// We make sure to only do that when linking, otherwise we import properly.
|
196
364
|
if ((0,_readThisNpmPackageVersion__WEBPACK_IMPORTED_MODULE_6__/* .readThisNpmPackageVersion */ .K)().startsWith("0.0.0")) {
|
197
|
-
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"))}")`);
|
365
|
+
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"))}")`);
|
198
366
|
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .h)(!(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__.is)(prettier));
|
199
367
|
break import_prettier;
|
200
368
|
}
|
201
369
|
prettier = await Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 79421, 23));
|
202
370
|
}
|
203
371
|
const configHash = await (async () => {
|
204
|
-
const configFilePath = await prettier.resolveConfigFile((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)(), ".."));
|
372
|
+
const configFilePath = await prettier.resolveConfigFile((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_nodeModulesBinDirPath__WEBPACK_IMPORTED_MODULE_0__/* .getNodeModulesBinDirPath */ .K)({ packageJsonFilePath: undefined }), ".."));
|
205
373
|
if (configFilePath === null) {
|
206
374
|
return "";
|
207
375
|
}
|
@@ -270,7 +438,7 @@ async function command(params) {
|
|
270
438
|
const { command } = await __webpack_require__.e(/* import() */ 658).then(__webpack_require__.bind(__webpack_require__, 18040));
|
271
439
|
await command({ buildContext });
|
272
440
|
}
|
273
|
-
const { hasBeenHandled } = (0,_shared_customHandler_delegate__WEBPACK_IMPORTED_MODULE_3__/* .maybeDelegateCommandToCustomHandler */ .q)({
|
441
|
+
const { hasBeenHandled } = await (0,_shared_customHandler_delegate__WEBPACK_IMPORTED_MODULE_3__/* .maybeDelegateCommandToCustomHandler */ .q)({
|
274
442
|
commandName: "update-kc-gen",
|
275
443
|
buildContext
|
276
444
|
});
|