keycloakify 11.7.4 → 11.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/{33.index.js → 226.index.js} +2 -19
- package/bin/{911.index.js → 297.index.js} +18918 -11359
- package/bin/355.index.js +41 -703
- package/bin/363.index.js +115 -93
- package/bin/369.index.js +968 -0
- package/bin/{288.index.js → 502.index.js} +123 -227
- package/bin/656.index.js +111 -0
- package/bin/{880.index.js → 712.index.js} +227 -216
- package/bin/780.index.js +9 -7
- package/bin/932.index.js +965 -0
- package/bin/97.index.js +2099 -769
- package/bin/main.js +66 -49
- package/bin/shared/buildContext.d.ts +11 -3
- package/bin/start-keycloak/realmConfig/prepareRealmConfig.d.ts +5 -6
- package/bin/start-keycloak/realmConfig/realmConfig.d.ts +6 -2
- package/package.json +12 -17
- package/src/bin/initialize-account-theme/initialize-account-theme.ts +29 -27
- package/src/bin/initialize-email-theme.ts +103 -53
- package/src/bin/keycloakify/buildJars/buildJar.ts +45 -20
- package/src/bin/keycloakify/generateResources/generateResources.ts +263 -217
- package/src/bin/shared/{initializeSpa/addSyncExtensionsToPostinstallScript.ts → addSyncExtensionsToPostinstallScript.ts} +1 -1
- package/src/bin/shared/buildContext.ts +69 -24
- package/src/bin/shared/{initializeSpa/initializeSpa.ts → initializeSpa.ts} +3 -3
- package/src/bin/start-keycloak/realmConfig/prepareRealmConfig.ts +12 -23
- package/src/bin/start-keycloak/realmConfig/realmConfig.ts +14 -12
- package/src/bin/start-keycloak/start-keycloak.ts +55 -28
- package/src/bin/sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.ts +6 -0
- package/vite-plugin/index.js +48 -20
- package/bin/313.index.js +0 -377
- package/bin/678.index.js +0 -7565
- package/bin/9.index.js +0 -850
- package/bin/947.index.js +0 -1565
- package/bin/shared/initializeSpa/index.d.ts +0 -1
- package/bin/shared/metaInfKeycloakThemes.d.ts +0 -13
- package/src/bin/shared/initializeSpa/index.ts +0 -1
- package/src/bin/shared/metaInfKeycloakThemes.ts +0 -40
- /package/bin/shared/{initializeSpa/addSyncExtensionsToPostinstallScript.d.ts → addSyncExtensionsToPostinstallScript.d.ts} +0 -0
- /package/bin/shared/{initializeSpa/initializeSpa.d.ts → initializeSpa.d.ts} +0 -0
@@ -1,42 +1,31 @@
|
|
1
1
|
"use strict";
|
2
|
-
exports.id =
|
3
|
-
exports.ids = [
|
2
|
+
exports.id = 502;
|
3
|
+
exports.ids = [502];
|
4
4
|
exports.modules = {
|
5
5
|
|
6
|
-
/***/
|
6
|
+
/***/ 80339:
|
7
7
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
__webpack_require__.
|
14
|
-
|
15
|
-
});
|
16
|
-
|
17
|
-
// EXTERNAL MODULE: external "path"
|
18
|
-
var external_path_ = __webpack_require__(71017);
|
19
|
-
// EXTERNAL MODULE: external "fs"
|
20
|
-
var external_fs_ = __webpack_require__(57147);
|
21
|
-
// EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
|
22
|
-
var assert = __webpack_require__(29041);
|
23
|
-
// EXTERNAL MODULE: ./node_modules/tsafe/esm/id.mjs
|
24
|
-
var id = __webpack_require__(38469);
|
25
|
-
;// CONCATENATED MODULE: ./dist/bin/shared/initializeSpa/addSyncExtensionsToPostinstallScript.js
|
9
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
10
|
+
/* harmony export */ "N": () => (/* binding */ addSyncExtensionsToPostinstallScript)
|
11
|
+
/* harmony export */ });
|
12
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
|
13
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
|
14
|
+
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29041);
|
26
15
|
|
27
16
|
|
28
|
-
(0,
|
17
|
+
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_1__/* .assert */ .h)();
|
29
18
|
function addSyncExtensionsToPostinstallScript(params) {
|
30
19
|
var _a;
|
31
20
|
const { parsedPackageJson, buildContext } = params;
|
32
21
|
const cmd_base = "keycloakify sync-extensions";
|
33
22
|
const projectCliOptionValue = (() => {
|
34
|
-
const packageJsonDirPath = (0,
|
35
|
-
const relativePath = (0,
|
23
|
+
const packageJsonDirPath = (0,path__WEBPACK_IMPORTED_MODULE_0__.dirname)(buildContext.packageJsonFilePath);
|
24
|
+
const relativePath = (0,path__WEBPACK_IMPORTED_MODULE_0__.relative)(packageJsonDirPath, buildContext.projectDirPath);
|
36
25
|
if (relativePath === "") {
|
37
26
|
return undefined;
|
38
27
|
}
|
39
|
-
return relativePath.split(
|
28
|
+
return relativePath.split(path__WEBPACK_IMPORTED_MODULE_0__.sep).join("/");
|
40
29
|
})();
|
41
30
|
const generateCmd = (params) => {
|
42
31
|
const { cmd_preexisting } = params;
|
@@ -63,101 +52,6 @@ function addSyncExtensionsToPostinstallScript(params) {
|
|
63
52
|
parsedPackageJson.scripts = Object.assign({ postinstall: generateCmd({ cmd_preexisting: undefined }) }, parsedPackageJson.scripts);
|
64
53
|
}
|
65
54
|
//# sourceMappingURL=addSyncExtensionsToPostinstallScript.js.map
|
66
|
-
// EXTERNAL MODULE: ./dist/bin/tools/runPrettier.js
|
67
|
-
var runPrettier = __webpack_require__(48433);
|
68
|
-
// EXTERNAL MODULE: ./dist/bin/tools/npmInstall.js
|
69
|
-
var npmInstall = __webpack_require__(50030);
|
70
|
-
// EXTERNAL MODULE: external "child_process"
|
71
|
-
var external_child_process_ = __webpack_require__(32081);
|
72
|
-
// EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
|
73
|
-
var lib = __webpack_require__(52300);
|
74
|
-
// EXTERNAL MODULE: ./node_modules/chalk/source/index.js
|
75
|
-
var source = __webpack_require__(78818);
|
76
|
-
var source_default = /*#__PURE__*/__webpack_require__.n(source);
|
77
|
-
;// CONCATENATED MODULE: ./dist/bin/shared/initializeSpa/initializeSpa.js
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
(0,assert/* assert */.h)();
|
89
|
-
async function initializeSpa(params) {
|
90
|
-
var _a;
|
91
|
-
const { themeType, buildContext } = params;
|
92
|
-
{
|
93
|
-
const themeTypeSrcDirPath = (0,external_path_.join)(buildContext.themeSrcDirPath, themeType);
|
94
|
-
if (external_fs_.existsSync(themeTypeSrcDirPath) &&
|
95
|
-
external_fs_.readdirSync(themeTypeSrcDirPath).length > 0) {
|
96
|
-
console.warn(source_default().red(`There is already a ${(0,external_path_.relative)(process.cwd(), themeTypeSrcDirPath)} directory in your project. Aborting.`));
|
97
|
-
process.exit(-1);
|
98
|
-
}
|
99
|
-
}
|
100
|
-
const parsedPackageJson = (() => {
|
101
|
-
const zParsedPackageJson = (() => {
|
102
|
-
const zTargetType = lib.z.object({
|
103
|
-
scripts: lib.z.record(lib.z.union([lib.z.string(), lib.z.undefined()])).optional(),
|
104
|
-
dependencies: lib.z.record(lib.z.union([lib.z.string(), lib.z.undefined()])).optional(),
|
105
|
-
devDependencies: lib.z.record(lib.z.union([lib.z.string(), lib.z.undefined()])).optional()
|
106
|
-
});
|
107
|
-
assert/* assert */.h;
|
108
|
-
return (0,id.id)(zTargetType);
|
109
|
-
})();
|
110
|
-
const parsedPackageJson = JSON.parse(external_fs_.readFileSync(buildContext.packageJsonFilePath).toString("utf8"));
|
111
|
-
zParsedPackageJson.parse(parsedPackageJson);
|
112
|
-
(0,assert/* assert */.h)((0,assert.is)(parsedPackageJson));
|
113
|
-
return parsedPackageJson;
|
114
|
-
})();
|
115
|
-
addSyncExtensionsToPostinstallScript({
|
116
|
-
parsedPackageJson,
|
117
|
-
buildContext
|
118
|
-
});
|
119
|
-
const uiSharedMajor = (() => {
|
120
|
-
const dependencies = Object.assign(Object.assign({}, parsedPackageJson.devDependencies), parsedPackageJson.dependencies);
|
121
|
-
const version = dependencies["@keycloakify/keycloak-ui-shared"];
|
122
|
-
if (version === undefined) {
|
123
|
-
return undefined;
|
124
|
-
}
|
125
|
-
const match = version.match(/^[^~]?(\d+)\./);
|
126
|
-
if (match === null) {
|
127
|
-
return undefined;
|
128
|
-
}
|
129
|
-
return match[1];
|
130
|
-
})();
|
131
|
-
const moduleName = `@keycloakify/keycloak-${themeType}-ui`;
|
132
|
-
const version = JSON.parse(external_child_process_.execSync(`npm show ${moduleName} versions --json`)
|
133
|
-
.toString("utf8")
|
134
|
-
.trim())
|
135
|
-
.reverse()
|
136
|
-
.filter(version => !version.includes("-"))
|
137
|
-
.find(version => uiSharedMajor === undefined ? true : version.startsWith(`${uiSharedMajor}.`));
|
138
|
-
(0,assert/* assert */.h)(version !== undefined);
|
139
|
-
((_a = parsedPackageJson.dependencies) !== null && _a !== void 0 ? _a : (parsedPackageJson.dependencies = {}))[moduleName] = `~${version}`;
|
140
|
-
if (parsedPackageJson.devDependencies !== undefined) {
|
141
|
-
delete parsedPackageJson.devDependencies[moduleName];
|
142
|
-
}
|
143
|
-
{
|
144
|
-
let sourceCode = JSON.stringify(parsedPackageJson, undefined, 2);
|
145
|
-
if (await (0,runPrettier/* getIsPrettierAvailable */.MT)()) {
|
146
|
-
sourceCode = await (0,runPrettier/* runPrettier */.eY)({
|
147
|
-
sourceCode,
|
148
|
-
filePath: buildContext.packageJsonFilePath
|
149
|
-
});
|
150
|
-
}
|
151
|
-
external_fs_.writeFileSync(buildContext.packageJsonFilePath, Buffer.from(sourceCode, "utf8"));
|
152
|
-
}
|
153
|
-
await (0,npmInstall/* npmInstall */.c)({
|
154
|
-
packageJsonDirPath: (0,external_path_.dirname)(buildContext.packageJsonFilePath)
|
155
|
-
});
|
156
|
-
}
|
157
|
-
//# sourceMappingURL=initializeSpa.js.map
|
158
|
-
;// CONCATENATED MODULE: ./dist/bin/shared/initializeSpa/index.js
|
159
|
-
|
160
|
-
//# sourceMappingURL=index.js.map
|
161
55
|
|
162
56
|
/***/ }),
|
163
57
|
|
@@ -289,29 +183,48 @@ function rmSync(dirPath, options) {
|
|
289
183
|
|
290
184
|
/***/ }),
|
291
185
|
|
292
|
-
/***/
|
186
|
+
/***/ 63046:
|
293
187
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
294
188
|
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
189
|
+
|
190
|
+
// EXPORTS
|
191
|
+
__webpack_require__.d(__webpack_exports__, {
|
192
|
+
"c": () => (/* binding */ npmInstall)
|
193
|
+
});
|
194
|
+
|
195
|
+
// EXTERNAL MODULE: external "fs"
|
196
|
+
var external_fs_ = __webpack_require__(57147);
|
197
|
+
// EXTERNAL MODULE: external "path"
|
198
|
+
var external_path_ = __webpack_require__(71017);
|
199
|
+
// EXTERNAL MODULE: external "child_process"
|
200
|
+
var external_child_process_ = __webpack_require__(32081);
|
201
|
+
// EXTERNAL MODULE: ./node_modules/chalk/source/index.js
|
202
|
+
var source = __webpack_require__(78818);
|
203
|
+
var source_default = /*#__PURE__*/__webpack_require__.n(source);
|
204
|
+
// EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
|
205
|
+
var lib = __webpack_require__(52300);
|
206
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
|
207
|
+
var assert = __webpack_require__(29041);
|
208
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/esm/id.mjs
|
209
|
+
var id = __webpack_require__(38469);
|
210
|
+
;// CONCATENATED MODULE: ./node_modules/tsafe/esm/objectKeys.mjs
|
211
|
+
/** https://docs.tsafe.dev/objectKeys */
|
212
|
+
function objectKeys(o) {
|
213
|
+
return Object.keys(o);
|
214
|
+
}
|
215
|
+
|
216
|
+
|
217
|
+
//# sourceMappingURL=objectKeys.mjs.map
|
218
|
+
|
219
|
+
// EXTERNAL MODULE: ./dist/bin/tools/getAbsoluteAndInOsFormatPath.js
|
220
|
+
var getAbsoluteAndInOsFormatPath = __webpack_require__(84794);
|
221
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/esm/exclude.mjs
|
222
|
+
var exclude = __webpack_require__(83101);
|
223
|
+
// EXTERNAL MODULE: ./dist/bin/tools/fs.rmSync.js
|
224
|
+
var fs_rmSync = __webpack_require__(89693);
|
225
|
+
// EXTERNAL MODULE: ./node_modules/evt/tools/Deferred.js
|
226
|
+
var Deferred = __webpack_require__(50689);
|
227
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/npmInstall.js
|
315
228
|
|
316
229
|
|
317
230
|
|
@@ -350,8 +263,8 @@ async function npmInstall(params) {
|
|
350
263
|
}
|
351
264
|
];
|
352
265
|
for (const packageManager of packageMangers) {
|
353
|
-
if (
|
354
|
-
|
266
|
+
if (external_fs_.existsSync((0,external_path_.join)(packageJsonDirPath, packageManager.lockFileBasename)) ||
|
267
|
+
external_fs_.existsSync((0,external_path_.join)(process.cwd(), packageManager.lockFileBasename))) {
|
355
268
|
return packageManager.binName;
|
356
269
|
}
|
357
270
|
}
|
@@ -366,7 +279,7 @@ async function npmInstall(params) {
|
|
366
279
|
if (garronejLinkInfos === undefined) {
|
367
280
|
break install_without_breaking_links;
|
368
281
|
}
|
369
|
-
console.log(
|
282
|
+
console.log(source_default().green("Installing in a way that won't break the links..."));
|
370
283
|
await installWithoutBreakingLinks({
|
371
284
|
packageJsonDirPath,
|
372
285
|
garronejLinkInfos
|
@@ -380,13 +293,13 @@ async function npmInstall(params) {
|
|
380
293
|
});
|
381
294
|
}
|
382
295
|
catch (_a) {
|
383
|
-
console.log(
|
296
|
+
console.log(source_default().yellow(`\`${packageManagerBinName} install\` failed, continuing anyway...`));
|
384
297
|
}
|
385
298
|
}
|
386
299
|
async function runPackageManagerInstall(params) {
|
387
300
|
const { packageManagerBinName, cwd } = params;
|
388
|
-
const dCompleted = new
|
389
|
-
const child =
|
301
|
+
const dCompleted = new Deferred.Deferred();
|
302
|
+
const child = external_child_process_.spawn(packageManagerBinName, ["install"], {
|
390
303
|
cwd,
|
391
304
|
env: process.env,
|
392
305
|
shell: true
|
@@ -409,8 +322,8 @@ async function runPackageManagerInstall(params) {
|
|
409
322
|
}
|
410
323
|
function getGarronejLinkInfos(params) {
|
411
324
|
const { packageJsonDirPath } = params;
|
412
|
-
const nodeModuleDirPath = (0,
|
413
|
-
if (!
|
325
|
+
const nodeModuleDirPath = (0,external_path_.join)(packageJsonDirPath, "node_modules");
|
326
|
+
if (!external_fs_.existsSync(nodeModuleDirPath)) {
|
414
327
|
return undefined;
|
415
328
|
}
|
416
329
|
const linkedModuleNames = [];
|
@@ -418,7 +331,7 @@ function getGarronejLinkInfos(params) {
|
|
418
331
|
const getIsLinkedByGarronejScript = (path) => {
|
419
332
|
let realPath;
|
420
333
|
try {
|
421
|
-
realPath =
|
334
|
+
realPath = external_fs_.readlinkSync(path);
|
422
335
|
}
|
423
336
|
catch (_a) {
|
424
337
|
return false;
|
@@ -431,17 +344,17 @@ function getGarronejLinkInfos(params) {
|
|
431
344
|
if (yarnHomeDirPath !== undefined) {
|
432
345
|
break set_yarnHomeDirPath;
|
433
346
|
}
|
434
|
-
const [firstElement] = (0,
|
347
|
+
const [firstElement] = (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
|
435
348
|
pathIsh: realPath,
|
436
|
-
cwd: (0,
|
349
|
+
cwd: (0,external_path_.dirname)(path)
|
437
350
|
}).split(".yarn_home");
|
438
|
-
yarnHomeDirPath = (0,
|
351
|
+
yarnHomeDirPath = (0,external_path_.join)(firstElement, ".yarn_home");
|
439
352
|
}
|
440
353
|
return true;
|
441
354
|
};
|
442
|
-
for (const basename of
|
443
|
-
const path = (0,
|
444
|
-
if (
|
355
|
+
for (const basename of external_fs_.readdirSync(nodeModuleDirPath)) {
|
356
|
+
const path = (0,external_path_.join)(nodeModuleDirPath, basename);
|
357
|
+
if (external_fs_.lstatSync(path).isSymbolicLink()) {
|
445
358
|
if (basename.startsWith("@")) {
|
446
359
|
return undefined;
|
447
360
|
}
|
@@ -451,13 +364,13 @@ function getGarronejLinkInfos(params) {
|
|
451
364
|
linkedModuleNames.push(basename);
|
452
365
|
continue;
|
453
366
|
}
|
454
|
-
if (!
|
367
|
+
if (!external_fs_.lstatSync(path).isDirectory()) {
|
455
368
|
continue;
|
456
369
|
}
|
457
370
|
if (basename.startsWith("@")) {
|
458
|
-
for (const subBasename of
|
459
|
-
const subPath = (0,
|
460
|
-
if (!
|
371
|
+
for (const subBasename of external_fs_.readdirSync(path)) {
|
372
|
+
const subPath = (0,external_path_.join)(path, subBasename);
|
373
|
+
if (!external_fs_.lstatSync(subPath).isSymbolicLink()) {
|
461
374
|
continue;
|
462
375
|
}
|
463
376
|
if (!getIsLinkedByGarronejScript(subPath)) {
|
@@ -475,17 +388,17 @@ function getGarronejLinkInfos(params) {
|
|
475
388
|
async function installWithoutBreakingLinks(params) {
|
476
389
|
const { packageJsonDirPath, garronejLinkInfos: { linkedModuleNames, yarnHomeDirPath } } = params;
|
477
390
|
const parsedPackageJson = (() => {
|
478
|
-
const packageJsonFilePath = (0,
|
391
|
+
const packageJsonFilePath = (0,external_path_.join)(packageJsonDirPath, "package.json");
|
479
392
|
const zParsedPackageJson = (() => {
|
480
|
-
const zTargetType =
|
481
|
-
scripts:
|
393
|
+
const zTargetType = lib.z.object({
|
394
|
+
scripts: lib.z.record(lib.z.string()).optional()
|
482
395
|
});
|
483
|
-
|
484
|
-
return (0,
|
396
|
+
assert/* assert */.h;
|
397
|
+
return (0,id.id)(zTargetType);
|
485
398
|
})();
|
486
|
-
const parsedPackageJson = JSON.parse(
|
399
|
+
const parsedPackageJson = JSON.parse(external_fs_.readFileSync(packageJsonFilePath).toString("utf8"));
|
487
400
|
zParsedPackageJson.parse(parsedPackageJson);
|
488
|
-
(0,
|
401
|
+
(0,assert/* assert */.h)((0,assert.is)(parsedPackageJson));
|
489
402
|
return parsedPackageJson;
|
490
403
|
})();
|
491
404
|
const isImplementedScriptByName = {
|
@@ -496,7 +409,7 @@ async function installWithoutBreakingLinks(params) {
|
|
496
409
|
if (parsedPackageJson.scripts === undefined) {
|
497
410
|
break delete_postinstall_script;
|
498
411
|
}
|
499
|
-
for (const scriptName of
|
412
|
+
for (const scriptName of objectKeys(isImplementedScriptByName)) {
|
500
413
|
if (parsedPackageJson.scripts[scriptName] === undefined) {
|
501
414
|
continue;
|
502
415
|
}
|
@@ -504,14 +417,14 @@ async function installWithoutBreakingLinks(params) {
|
|
504
417
|
delete parsedPackageJson.scripts[scriptName];
|
505
418
|
}
|
506
419
|
}
|
507
|
-
const tmpProjectDirPath = (0,
|
508
|
-
if (
|
509
|
-
(0,
|
420
|
+
const tmpProjectDirPath = (0,external_path_.join)(yarnHomeDirPath, "tmpProject");
|
421
|
+
if (external_fs_.existsSync(tmpProjectDirPath)) {
|
422
|
+
(0,fs_rmSync/* rmSync */.a)(tmpProjectDirPath, { recursive: true });
|
510
423
|
}
|
511
|
-
|
512
|
-
|
424
|
+
external_fs_.mkdirSync(tmpProjectDirPath, { recursive: true });
|
425
|
+
external_fs_.writeFileSync((0,external_path_.join)(tmpProjectDirPath, "package.json"), JSON.stringify(parsedPackageJson, undefined, 4));
|
513
426
|
const YARN_LOCK = "yarn.lock";
|
514
|
-
|
427
|
+
external_fs_.copyFileSync((0,external_path_.join)(packageJsonDirPath, YARN_LOCK), (0,external_path_.join)(tmpProjectDirPath, YARN_LOCK));
|
515
428
|
await runPackageManagerInstall({
|
516
429
|
packageManagerBinName: "yarn",
|
517
430
|
cwd: tmpProjectDirPath
|
@@ -521,18 +434,18 @@ async function installWithoutBreakingLinks(params) {
|
|
521
434
|
{
|
522
435
|
const { getAreSameVersions } = (() => {
|
523
436
|
const zParsedPackageJson = (() => {
|
524
|
-
const zTargetType =
|
525
|
-
version:
|
437
|
+
const zTargetType = lib.z.object({
|
438
|
+
version: lib.z.string()
|
526
439
|
});
|
527
|
-
|
528
|
-
return (0,
|
440
|
+
assert/* assert */.h;
|
441
|
+
return (0,id.id)(zTargetType);
|
529
442
|
})();
|
530
443
|
function readVersion(params) {
|
531
444
|
const { moduleDirPath } = params;
|
532
|
-
const packageJsonFilePath = (0,
|
533
|
-
const packageJson = JSON.parse(
|
445
|
+
const packageJsonFilePath = (0,external_path_.join)(moduleDirPath, "package.json");
|
446
|
+
const packageJson = JSON.parse(external_fs_.readFileSync(packageJsonFilePath).toString("utf8"));
|
534
447
|
zParsedPackageJson.parse(packageJson);
|
535
|
-
(0,
|
448
|
+
(0,assert/* assert */.h)((0,assert.is)(packageJson));
|
536
449
|
return packageJson.version;
|
537
450
|
}
|
538
451
|
function getAreSameVersions(params) {
|
@@ -542,44 +455,44 @@ async function installWithoutBreakingLinks(params) {
|
|
542
455
|
}
|
543
456
|
return { getAreSameVersions };
|
544
457
|
})();
|
545
|
-
const nodeModulesDirPath_tmpProject = (0,
|
546
|
-
const nodeModulesDirPath = (0,
|
547
|
-
const modulePaths =
|
458
|
+
const nodeModulesDirPath_tmpProject = (0,external_path_.join)(tmpProjectDirPath, "node_modules");
|
459
|
+
const nodeModulesDirPath = (0,external_path_.join)(packageJsonDirPath, "node_modules");
|
460
|
+
const modulePaths = external_fs_.readdirSync(nodeModulesDirPath_tmpProject)
|
548
461
|
.map(basename => {
|
549
462
|
if (basename.startsWith(".")) {
|
550
463
|
return undefined;
|
551
464
|
}
|
552
|
-
const path = (0,
|
465
|
+
const path = (0,external_path_.join)(nodeModulesDirPath_tmpProject, basename);
|
553
466
|
if (basename.startsWith("@")) {
|
554
|
-
return
|
467
|
+
return external_fs_.readdirSync(path)
|
555
468
|
.map(subBasename => {
|
556
469
|
if (subBasename.startsWith(".")) {
|
557
470
|
return undefined;
|
558
471
|
}
|
559
|
-
const subPath = (0,
|
560
|
-
if (!
|
472
|
+
const subPath = (0,external_path_.join)(path, subBasename);
|
473
|
+
if (!external_fs_.lstatSync(subPath).isDirectory()) {
|
561
474
|
return undefined;
|
562
475
|
}
|
563
476
|
return {
|
564
477
|
moduleName: `${basename}/${subBasename}`,
|
565
478
|
moduleDirPath_tmpProject: subPath,
|
566
|
-
moduleDirPath: (0,
|
479
|
+
moduleDirPath: (0,external_path_.join)(nodeModulesDirPath, basename, subBasename)
|
567
480
|
};
|
568
481
|
})
|
569
|
-
.filter((0,
|
482
|
+
.filter((0,exclude/* exclude */.D)(undefined));
|
570
483
|
}
|
571
|
-
if (!
|
484
|
+
if (!external_fs_.lstatSync(path).isDirectory()) {
|
572
485
|
return undefined;
|
573
486
|
}
|
574
487
|
return [
|
575
488
|
{
|
576
489
|
moduleName: basename,
|
577
490
|
moduleDirPath_tmpProject: path,
|
578
|
-
moduleDirPath: (0,
|
491
|
+
moduleDirPath: (0,external_path_.join)(nodeModulesDirPath, basename)
|
579
492
|
}
|
580
493
|
];
|
581
494
|
})
|
582
|
-
.filter((0,
|
495
|
+
.filter((0,exclude/* exclude */.D)(undefined))
|
583
496
|
.flat();
|
584
497
|
for (const { moduleName, moduleDirPath, moduleDirPath_tmpProject } of modulePaths) {
|
585
498
|
if (linkedModuleNames.includes(moduleName)) {
|
@@ -587,7 +500,7 @@ async function installWithoutBreakingLinks(params) {
|
|
587
500
|
}
|
588
501
|
let doesTargetModuleExist = false;
|
589
502
|
skip_condition: {
|
590
|
-
if (!
|
503
|
+
if (!external_fs_.existsSync(moduleDirPath)) {
|
591
504
|
break skip_condition;
|
592
505
|
}
|
593
506
|
doesTargetModuleExist = true;
|
@@ -601,39 +514,39 @@ async function installWithoutBreakingLinks(params) {
|
|
601
514
|
continue;
|
602
515
|
}
|
603
516
|
if (doesTargetModuleExist) {
|
604
|
-
(0,
|
517
|
+
(0,fs_rmSync/* rmSync */.a)(moduleDirPath, { recursive: true });
|
605
518
|
}
|
606
519
|
{
|
607
|
-
const dirPath = (0,
|
608
|
-
if (!
|
609
|
-
|
520
|
+
const dirPath = (0,external_path_.dirname)(moduleDirPath);
|
521
|
+
if (!external_fs_.existsSync(dirPath)) {
|
522
|
+
external_fs_.mkdirSync(dirPath, { recursive: true });
|
610
523
|
}
|
611
524
|
}
|
612
|
-
|
525
|
+
external_fs_.renameSync(moduleDirPath_tmpProject, moduleDirPath);
|
613
526
|
}
|
614
527
|
move_bin: {
|
615
|
-
const binDirPath_tmpProject = (0,
|
616
|
-
const binDirPath = (0,
|
617
|
-
if (!
|
528
|
+
const binDirPath_tmpProject = (0,external_path_.join)(nodeModulesDirPath_tmpProject, ".bin");
|
529
|
+
const binDirPath = (0,external_path_.join)(nodeModulesDirPath, ".bin");
|
530
|
+
if (!external_fs_.existsSync(binDirPath_tmpProject)) {
|
618
531
|
break move_bin;
|
619
532
|
}
|
620
|
-
for (const basename of
|
621
|
-
const path_tmpProject = (0,
|
622
|
-
const path = (0,
|
623
|
-
if (
|
533
|
+
for (const basename of external_fs_.readdirSync(binDirPath_tmpProject)) {
|
534
|
+
const path_tmpProject = (0,external_path_.join)(binDirPath_tmpProject, basename);
|
535
|
+
const path = (0,external_path_.join)(binDirPath, basename);
|
536
|
+
if (external_fs_.existsSync(path)) {
|
624
537
|
continue;
|
625
538
|
}
|
626
|
-
|
539
|
+
external_fs_.renameSync(path_tmpProject, path);
|
627
540
|
}
|
628
541
|
}
|
629
542
|
}
|
630
|
-
|
631
|
-
(0,
|
632
|
-
for (const scriptName of
|
543
|
+
external_fs_.cpSync((0,external_path_.join)(tmpProjectDirPath, YARN_LOCK), (0,external_path_.join)(packageJsonDirPath, YARN_LOCK));
|
544
|
+
(0,fs_rmSync/* rmSync */.a)(tmpProjectDirPath, { recursive: true });
|
545
|
+
for (const scriptName of objectKeys(isImplementedScriptByName)) {
|
633
546
|
if (!isImplementedScriptByName[scriptName]) {
|
634
547
|
continue;
|
635
548
|
}
|
636
|
-
|
549
|
+
external_child_process_.execSync(`yarn run ${scriptName}`, {
|
637
550
|
cwd: packageJsonDirPath,
|
638
551
|
stdio: "inherit"
|
639
552
|
});
|
@@ -750,23 +663,6 @@ var overwriteReadonlyProp = function (obj, propertyName, value) {
|
|
750
663
|
exports.overwriteReadonlyProp = overwriteReadonlyProp;
|
751
664
|
//# sourceMappingURL=overwriteReadonlyProp.js.map
|
752
665
|
|
753
|
-
/***/ }),
|
754
|
-
|
755
|
-
/***/ 23483:
|
756
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
757
|
-
|
758
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
759
|
-
/* harmony export */ "Y": () => (/* binding */ objectKeys)
|
760
|
-
/* harmony export */ });
|
761
|
-
/** https://docs.tsafe.dev/objectKeys */
|
762
|
-
function objectKeys(o) {
|
763
|
-
return Object.keys(o);
|
764
|
-
}
|
765
|
-
|
766
|
-
|
767
|
-
//# sourceMappingURL=objectKeys.mjs.map
|
768
|
-
|
769
|
-
|
770
666
|
/***/ })
|
771
667
|
|
772
668
|
};
|