keycloakify 11.3.18 → 11.3.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/124.index.js +675 -0
- package/bin/356.index.js +689 -0
- package/bin/40.index.js +41 -21
- package/bin/{903.index.js → 450.index.js} +2 -680
- package/bin/453.index.js +143 -83
- package/bin/573.index.js +51 -24
- package/bin/{599.index.js → 735.index.js} +438 -121
- package/bin/786.index.js +129 -76
- package/bin/805.index.js +674 -0
- package/bin/854.index.js +68 -0
- package/bin/{780.index.js → 921.index.js} +168 -107
- package/bin/932.index.js +41 -21
- package/bin/97.index.js +125 -73
- package/bin/eject-file.d.ts +7 -0
- package/bin/keycloakify/generateResources/generateMessageProperties.d.ts +1 -1
- package/bin/keycloakify/generateResources/readFieldNameUsage.d.ts +1 -1
- package/bin/main.js +70 -7
- package/bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.d.ts +12 -0
- package/bin/postinstall/index.d.ts +1 -0
- package/bin/postinstall/installUiModulesPeerDependencies.d.ts +11 -0
- package/bin/postinstall/managedGitignoreFile.d.ts +14 -0
- package/bin/postinstall/postinstall.d.ts +4 -0
- package/bin/postinstall/uiModuleMeta.d.ts +21 -0
- package/bin/shared/buildContext.d.ts +3 -0
- package/bin/shared/constants.d.ts +2 -1
- package/bin/shared/constants.js +2 -1
- package/bin/shared/constants.js.map +1 -1
- package/bin/shared/customHandler.d.ts +1 -1
- package/bin/shared/customHandler.js.map +1 -1
- package/bin/shared/exitIfUncommittedChanges.d.ts +3 -0
- package/bin/tools/crawlAsync.d.ts +6 -0
- package/bin/tools/getInstalledModuleDirPath.d.ts +5 -0
- package/bin/tools/listInstalledModules.d.ts +12 -0
- package/bin/tools/nodeModulesBinDirPath.d.ts +1 -0
- package/bin/tools/runPrettier.d.ts +17 -0
- package/package.json +34 -6
- package/src/bin/add-story.ts +28 -10
- package/src/bin/eject-file.ts +68 -0
- package/src/bin/eject-page.ts +51 -31
- package/src/bin/initialize-account-theme/initialize-account-theme.ts +4 -32
- package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +2 -16
- package/src/bin/keycloakify/generateResources/generateMessageProperties.ts +1 -1
- package/src/bin/keycloakify/generateResources/generateResources.ts +58 -26
- package/src/bin/keycloakify/generateResources/readFieldNameUsage.ts +1 -1
- package/src/bin/main.ts +50 -0
- package/src/bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.ts +71 -0
- package/src/bin/postinstall/index.ts +1 -0
- package/src/bin/postinstall/installUiModulesPeerDependencies.ts +157 -0
- package/src/bin/postinstall/managedGitignoreFile.ts +135 -0
- package/src/bin/postinstall/postinstall.ts +79 -0
- package/src/bin/postinstall/uiModuleMeta.ts +303 -0
- package/src/bin/shared/buildContext.ts +11 -5
- package/src/bin/shared/constants.ts +3 -1
- package/src/bin/shared/customHandler.ts +1 -0
- package/src/bin/shared/customHandler_delegate.ts +2 -27
- package/src/bin/shared/exitIfUncommittedChanges.ts +36 -0
- package/src/bin/tools/crawlAsync.ts +51 -0
- package/src/bin/tools/getInstalledModuleDirPath.ts +51 -0
- package/src/bin/tools/listInstalledModules.ts +131 -0
- package/src/bin/tools/nodeModulesBinDirPath.ts +38 -0
- package/src/bin/tools/npmInstall.ts +411 -15
- package/src/bin/tools/readThisNpmPackageVersion.ts +8 -0
- package/src/bin/tools/runPrettier.ts +106 -0
- package/src/bin/update-kc-gen.ts +28 -17
- package/vite-plugin/index.js +9237 -9161
- package/bin/tools/runFormat.d.ts +0 -3
- package/src/bin/tools/runFormat.ts +0 -71
package/bin/124.index.js
ADDED
@@ -0,0 +1,675 @@
|
|
1
|
+
"use strict";
|
2
|
+
exports.id = 124;
|
3
|
+
exports.ids = [124];
|
4
|
+
exports.modules = {
|
5
|
+
|
6
|
+
/***/ 67124:
|
7
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
8
|
+
|
9
|
+
// ESM COMPAT FLAG
|
10
|
+
__webpack_require__.r(__webpack_exports__);
|
11
|
+
|
12
|
+
// EXPORTS
|
13
|
+
__webpack_require__.d(__webpack_exports__, {
|
14
|
+
"command": () => (/* reexport */ command)
|
15
|
+
});
|
16
|
+
|
17
|
+
// EXTERNAL MODULE: ./dist/bin/postinstall/uiModuleMeta.js + 2 modules
|
18
|
+
var postinstall_uiModuleMeta = __webpack_require__(5038);
|
19
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
|
20
|
+
var assert = __webpack_require__(29041);
|
21
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/esm/is.mjs
|
22
|
+
var is = __webpack_require__(16453);
|
23
|
+
// EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
|
24
|
+
var lib = __webpack_require__(52300);
|
25
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/esm/id.mjs
|
26
|
+
var id = __webpack_require__(38469);
|
27
|
+
// EXTERNAL MODULE: external "fs/promises"
|
28
|
+
var promises_ = __webpack_require__(73292);
|
29
|
+
// EXTERNAL MODULE: ./dist/bin/tools/SemVer.js
|
30
|
+
var SemVer = __webpack_require__(12171);
|
31
|
+
// EXTERNAL MODULE: ./node_modules/evt/tools/inDepth/same.js
|
32
|
+
var same = __webpack_require__(33805);
|
33
|
+
// EXTERNAL MODULE: ./dist/bin/tools/runPrettier.js
|
34
|
+
var runPrettier = __webpack_require__(48433);
|
35
|
+
// EXTERNAL MODULE: ./dist/bin/tools/npmInstall.js + 1 modules
|
36
|
+
var npmInstall = __webpack_require__(63046);
|
37
|
+
;// CONCATENATED MODULE: ./dist/bin/postinstall/installUiModulesPeerDependencies.js
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
(0,assert/* assert */.h)();
|
48
|
+
(0,assert/* assert */.h)();
|
49
|
+
async function installUiModulesPeerDependencies(params) {
|
50
|
+
var _a, _b;
|
51
|
+
const { buildContext, uiModuleMetas } = params;
|
52
|
+
const { uiModulesPerDependencies } = (() => {
|
53
|
+
const uiModulesPerDependencies = {};
|
54
|
+
for (const { peerDependencies } of uiModuleMetas) {
|
55
|
+
for (const [peerDependencyName, versionRange_candidate] of Object.entries(peerDependencies)) {
|
56
|
+
const versionRange = (() => {
|
57
|
+
const versionRange_current = uiModulesPerDependencies[peerDependencyName];
|
58
|
+
if (versionRange_current === undefined) {
|
59
|
+
return versionRange_candidate;
|
60
|
+
}
|
61
|
+
if (versionRange_current === "*") {
|
62
|
+
return versionRange_candidate;
|
63
|
+
}
|
64
|
+
if (versionRange_candidate === "*") {
|
65
|
+
return versionRange_current;
|
66
|
+
}
|
67
|
+
const { versionRange } = [
|
68
|
+
versionRange_current,
|
69
|
+
versionRange_candidate
|
70
|
+
]
|
71
|
+
.map(versionRange => ({
|
72
|
+
versionRange,
|
73
|
+
semVer: SemVer/* SemVer.parse */.h.parse((() => {
|
74
|
+
if (versionRange.startsWith("^") ||
|
75
|
+
versionRange.startsWith("~")) {
|
76
|
+
return versionRange.slice(1);
|
77
|
+
}
|
78
|
+
return versionRange;
|
79
|
+
})())
|
80
|
+
}))
|
81
|
+
.sort((a, b) => SemVer/* SemVer.compare */.h.compare(b.semVer, a.semVer))[0];
|
82
|
+
return versionRange;
|
83
|
+
})();
|
84
|
+
uiModulesPerDependencies[peerDependencyName] = versionRange;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
return { uiModulesPerDependencies };
|
88
|
+
})();
|
89
|
+
const parsedPackageJson = await (async () => {
|
90
|
+
const zParsedPackageJson = (() => {
|
91
|
+
const zParsedPackageJson = lib.z.object({
|
92
|
+
dependencies: lib.z.record(lib.z.string()).optional(),
|
93
|
+
devDependencies: lib.z.record(lib.z.string()).optional()
|
94
|
+
});
|
95
|
+
(0,assert/* assert */.h)();
|
96
|
+
return (0,id.id)(zParsedPackageJson);
|
97
|
+
})();
|
98
|
+
const parsedPackageJson = JSON.parse((await promises_.readFile(buildContext.packageJsonFilePath)).toString("utf8"));
|
99
|
+
zParsedPackageJson.parse(parsedPackageJson);
|
100
|
+
(0,assert/* assert */.h)((0,is.is)(parsedPackageJson));
|
101
|
+
return parsedPackageJson;
|
102
|
+
})();
|
103
|
+
const parsedPackageJson_before = JSON.parse(JSON.stringify(parsedPackageJson));
|
104
|
+
for (const [moduleName, versionRange] of Object.entries(uiModulesPerDependencies)) {
|
105
|
+
if (moduleName.startsWith("@types/")) {
|
106
|
+
((_a = parsedPackageJson.devDependencies) !== null && _a !== void 0 ? _a : (parsedPackageJson.devDependencies = {}))[moduleName] = versionRange;
|
107
|
+
continue;
|
108
|
+
}
|
109
|
+
if (parsedPackageJson.devDependencies !== undefined) {
|
110
|
+
delete parsedPackageJson.devDependencies[moduleName];
|
111
|
+
}
|
112
|
+
((_b = parsedPackageJson.dependencies) !== null && _b !== void 0 ? _b : (parsedPackageJson.dependencies = {}))[moduleName] = versionRange;
|
113
|
+
}
|
114
|
+
if ((0,same.same)(parsedPackageJson, parsedPackageJson_before)) {
|
115
|
+
return;
|
116
|
+
}
|
117
|
+
let packageJsonContentStr = JSON.stringify(parsedPackageJson, null, 2);
|
118
|
+
format: {
|
119
|
+
if (!(await (0,runPrettier/* getIsPrettierAvailable */.MT)())) {
|
120
|
+
break format;
|
121
|
+
}
|
122
|
+
packageJsonContentStr = await (0,runPrettier/* runPrettier */.eY)({
|
123
|
+
sourceCode: packageJsonContentStr,
|
124
|
+
filePath: buildContext.packageJsonFilePath
|
125
|
+
});
|
126
|
+
}
|
127
|
+
await promises_.writeFile(buildContext.packageJsonFilePath, packageJsonContentStr);
|
128
|
+
(0,npmInstall/* npmInstall */.c)({
|
129
|
+
packageJsonDirPath: buildContext.packageJsonFilePath
|
130
|
+
});
|
131
|
+
process.exit(0);
|
132
|
+
}
|
133
|
+
//# sourceMappingURL=installUiModulesPeerDependencies.js.map
|
134
|
+
// EXTERNAL MODULE: ./dist/bin/postinstall/managedGitignoreFile.js
|
135
|
+
var managedGitignoreFile = __webpack_require__(36843);
|
136
|
+
// EXTERNAL MODULE: external "path"
|
137
|
+
var external_path_ = __webpack_require__(71017);
|
138
|
+
// EXTERNAL MODULE: ./dist/bin/tools/fs.existsAsync.js
|
139
|
+
var fs_existsAsync = __webpack_require__(43765);
|
140
|
+
;// CONCATENATED MODULE: ./dist/bin/postinstall/postinstall.js
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
async function command(params) {
|
149
|
+
const { buildContext } = params;
|
150
|
+
const uiModuleMetas = await (0,postinstall_uiModuleMeta/* getUiModuleMetas */.j)({ buildContext });
|
151
|
+
await installUiModulesPeerDependencies({
|
152
|
+
buildContext,
|
153
|
+
uiModuleMetas
|
154
|
+
});
|
155
|
+
const { ejectedFilesRelativePaths } = await (0,managedGitignoreFile/* readManagedGitignoreFile */.w)({
|
156
|
+
buildContext
|
157
|
+
});
|
158
|
+
await (0,managedGitignoreFile/* writeManagedGitignoreFile */.Y)({
|
159
|
+
buildContext,
|
160
|
+
ejectedFilesRelativePaths,
|
161
|
+
uiModuleMetas
|
162
|
+
});
|
163
|
+
await Promise.all(uiModuleMetas
|
164
|
+
.map(uiModuleMeta => Promise.all(uiModuleMeta.files.map(async ({ fileRelativePath, copyableFilePath, hash }) => {
|
165
|
+
if (ejectedFilesRelativePaths.includes(fileRelativePath)) {
|
166
|
+
return;
|
167
|
+
}
|
168
|
+
const destFilePath = (0,external_path_.join)(buildContext.themeSrcDirPath, fileRelativePath);
|
169
|
+
skip_condition: {
|
170
|
+
if (!(await (0,fs_existsAsync/* existsAsync */.o)(destFilePath))) {
|
171
|
+
break skip_condition;
|
172
|
+
}
|
173
|
+
const destFileHash = (0,postinstall_uiModuleMeta/* computeHash */.x)(await promises_.readFile(destFilePath));
|
174
|
+
if (destFileHash !== hash) {
|
175
|
+
break skip_condition;
|
176
|
+
}
|
177
|
+
return;
|
178
|
+
}
|
179
|
+
{
|
180
|
+
const dirName = (0,external_path_.dirname)(copyableFilePath);
|
181
|
+
if (!(await (0,fs_existsAsync/* existsAsync */.o)(dirName))) {
|
182
|
+
await promises_.mkdir(dirName, { recursive: true });
|
183
|
+
}
|
184
|
+
}
|
185
|
+
await promises_.copyFile(copyableFilePath, destFilePath);
|
186
|
+
})))
|
187
|
+
.flat());
|
188
|
+
}
|
189
|
+
//# sourceMappingURL=postinstall.js.map
|
190
|
+
;// CONCATENATED MODULE: ./dist/bin/postinstall/index.js
|
191
|
+
|
192
|
+
//# sourceMappingURL=index.js.map
|
193
|
+
|
194
|
+
/***/ }),
|
195
|
+
|
196
|
+
/***/ 12171:
|
197
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
198
|
+
|
199
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
200
|
+
/* harmony export */ "h": () => (/* binding */ SemVer)
|
201
|
+
/* harmony export */ });
|
202
|
+
var SemVer;
|
203
|
+
(function (SemVer) {
|
204
|
+
const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
|
205
|
+
function parse(versionStr) {
|
206
|
+
const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
|
207
|
+
if (!match) {
|
208
|
+
throw new Error(`${versionStr} is not a valid semantic version`);
|
209
|
+
}
|
210
|
+
const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
|
211
|
+
const str = match[3];
|
212
|
+
return str === undefined ? 0 : parseInt(str);
|
213
|
+
})() }, (() => {
|
214
|
+
const str = match[4];
|
215
|
+
return str === undefined ? {} : { rc: parseInt(str) };
|
216
|
+
})());
|
217
|
+
const initialStr = stringify(semVer);
|
218
|
+
Object.defineProperty(semVer, "parsedFrom", {
|
219
|
+
enumerable: true,
|
220
|
+
get: function () {
|
221
|
+
const currentStr = stringify(this);
|
222
|
+
if (currentStr !== initialStr) {
|
223
|
+
throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
|
224
|
+
}
|
225
|
+
return versionStr;
|
226
|
+
}
|
227
|
+
});
|
228
|
+
return semVer;
|
229
|
+
}
|
230
|
+
SemVer.parse = parse;
|
231
|
+
function stringify(v) {
|
232
|
+
return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
|
233
|
+
}
|
234
|
+
SemVer.stringify = stringify;
|
235
|
+
/**
|
236
|
+
*
|
237
|
+
* v1 < v2 => -1
|
238
|
+
* v1 === v2 => 0
|
239
|
+
* v1 > v2 => 1
|
240
|
+
*
|
241
|
+
*/
|
242
|
+
function compare(v1, v2) {
|
243
|
+
const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
|
244
|
+
const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
|
245
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
246
|
+
if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
|
247
|
+
return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
|
248
|
+
}
|
249
|
+
}
|
250
|
+
return 0;
|
251
|
+
}
|
252
|
+
SemVer.compare = compare;
|
253
|
+
/*
|
254
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
|
255
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
|
256
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
|
257
|
+
*/
|
258
|
+
function bumpType(params) {
|
259
|
+
const versionAhead = typeof params.versionAhead === "string"
|
260
|
+
? parse(params.versionAhead)
|
261
|
+
: params.versionAhead;
|
262
|
+
const versionBehind = typeof params.versionBehind === "string"
|
263
|
+
? parse(params.versionBehind)
|
264
|
+
: params.versionBehind;
|
265
|
+
if (compare(versionBehind, versionAhead) === 1) {
|
266
|
+
throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
|
267
|
+
}
|
268
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
269
|
+
if (versionBehind[level] !== versionAhead[level]) {
|
270
|
+
return level;
|
271
|
+
}
|
272
|
+
}
|
273
|
+
return "no bump";
|
274
|
+
}
|
275
|
+
SemVer.bumpType = bumpType;
|
276
|
+
})(SemVer || (SemVer = {}));
|
277
|
+
//# sourceMappingURL=SemVer.js.map
|
278
|
+
|
279
|
+
/***/ }),
|
280
|
+
|
281
|
+
/***/ 89693:
|
282
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
283
|
+
|
284
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
285
|
+
/* harmony export */ "a": () => (/* binding */ rmSync)
|
286
|
+
/* harmony export */ });
|
287
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
|
288
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
289
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
|
290
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
291
|
+
/* harmony import */ var _SemVer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12171);
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
/**
|
296
|
+
* Polyfill of fs.rmSync(dirPath, { "recursive": true })
|
297
|
+
* For older version of Node
|
298
|
+
*/
|
299
|
+
function rmSync(dirPath, options) {
|
300
|
+
if (_SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.compare */ .h.compare(_SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.parse */ .h.parse(process.version), _SemVer__WEBPACK_IMPORTED_MODULE_2__/* .SemVer.parse */ .h.parse("14.14.0")) > 0) {
|
301
|
+
fs__WEBPACK_IMPORTED_MODULE_0__.rmSync(dirPath, options);
|
302
|
+
return;
|
303
|
+
}
|
304
|
+
const { force = true } = options;
|
305
|
+
if (force && !fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(dirPath)) {
|
306
|
+
return;
|
307
|
+
}
|
308
|
+
const removeDir_rec = (dirPath) => fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(dirPath).forEach(basename => {
|
309
|
+
const fileOrDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
|
310
|
+
if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(fileOrDirPath).isDirectory()) {
|
311
|
+
removeDir_rec(fileOrDirPath);
|
312
|
+
return;
|
313
|
+
}
|
314
|
+
else {
|
315
|
+
fs__WEBPACK_IMPORTED_MODULE_0__.unlinkSync(fileOrDirPath);
|
316
|
+
}
|
317
|
+
});
|
318
|
+
removeDir_rec(dirPath);
|
319
|
+
}
|
320
|
+
//# sourceMappingURL=fs.rmSync.js.map
|
321
|
+
|
322
|
+
/***/ }),
|
323
|
+
|
324
|
+
/***/ 63046:
|
325
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
326
|
+
|
327
|
+
|
328
|
+
// EXPORTS
|
329
|
+
__webpack_require__.d(__webpack_exports__, {
|
330
|
+
"c": () => (/* binding */ npmInstall)
|
331
|
+
});
|
332
|
+
|
333
|
+
// EXTERNAL MODULE: external "fs"
|
334
|
+
var external_fs_ = __webpack_require__(57147);
|
335
|
+
// EXTERNAL MODULE: external "path"
|
336
|
+
var external_path_ = __webpack_require__(71017);
|
337
|
+
// EXTERNAL MODULE: external "child_process"
|
338
|
+
var external_child_process_ = __webpack_require__(32081);
|
339
|
+
// EXTERNAL MODULE: ./node_modules/chalk/source/index.js
|
340
|
+
var source = __webpack_require__(78818);
|
341
|
+
var source_default = /*#__PURE__*/__webpack_require__.n(source);
|
342
|
+
// EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
|
343
|
+
var lib = __webpack_require__(52300);
|
344
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
|
345
|
+
var assert = __webpack_require__(29041);
|
346
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/esm/id.mjs
|
347
|
+
var id = __webpack_require__(38469);
|
348
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/esm/is.mjs
|
349
|
+
var is = __webpack_require__(16453);
|
350
|
+
;// CONCATENATED MODULE: ./node_modules/tsafe/esm/objectKeys.mjs
|
351
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
352
|
+
/** https://docs.tsafe.dev/objectKeys */
|
353
|
+
function objectKeys(o) {
|
354
|
+
return Object.keys(o);
|
355
|
+
}
|
356
|
+
|
357
|
+
|
358
|
+
//# sourceMappingURL=objectKeys.mjs.map
|
359
|
+
|
360
|
+
// EXTERNAL MODULE: ./dist/bin/tools/getAbsoluteAndInOsFormatPath.js
|
361
|
+
var getAbsoluteAndInOsFormatPath = __webpack_require__(84794);
|
362
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/esm/exclude.mjs
|
363
|
+
var exclude = __webpack_require__(83101);
|
364
|
+
// EXTERNAL MODULE: ./dist/bin/tools/fs.rmSync.js
|
365
|
+
var fs_rmSync = __webpack_require__(89693);
|
366
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/npmInstall.js
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
function npmInstall(params) {
|
380
|
+
const { packageJsonDirPath } = params;
|
381
|
+
const packageManagerBinName = (() => {
|
382
|
+
const packageMangers = [
|
383
|
+
{
|
384
|
+
binName: "yarn",
|
385
|
+
lockFileBasename: "yarn.lock"
|
386
|
+
},
|
387
|
+
{
|
388
|
+
binName: "npm",
|
389
|
+
lockFileBasename: "package-lock.json"
|
390
|
+
},
|
391
|
+
{
|
392
|
+
binName: "pnpm",
|
393
|
+
lockFileBasename: "pnpm-lock.yaml"
|
394
|
+
},
|
395
|
+
{
|
396
|
+
binName: "bun",
|
397
|
+
lockFileBasename: "bun.lockdb"
|
398
|
+
},
|
399
|
+
{
|
400
|
+
binName: "deno",
|
401
|
+
lockFileBasename: "deno.lock"
|
402
|
+
}
|
403
|
+
];
|
404
|
+
for (const packageManager of packageMangers) {
|
405
|
+
if (external_fs_.existsSync((0,external_path_.join)(packageJsonDirPath, packageManager.lockFileBasename)) ||
|
406
|
+
external_fs_.existsSync((0,external_path_.join)(process.cwd(), packageManager.lockFileBasename))) {
|
407
|
+
return packageManager.binName;
|
408
|
+
}
|
409
|
+
}
|
410
|
+
throw new Error("No lock file found, cannot tell which package manager to use for installing dependencies.");
|
411
|
+
})();
|
412
|
+
console.log(`Installing the new dependencies...`);
|
413
|
+
install_without_breaking_links: {
|
414
|
+
if (packageManagerBinName !== "yarn") {
|
415
|
+
break install_without_breaking_links;
|
416
|
+
}
|
417
|
+
const garronejLinkInfos = getGarronejLinkInfos({ packageJsonDirPath });
|
418
|
+
if (garronejLinkInfos === undefined) {
|
419
|
+
break install_without_breaking_links;
|
420
|
+
}
|
421
|
+
console.log(source_default().green("Installing in a way that won't break the links..."));
|
422
|
+
installWithoutBreakingLinks({
|
423
|
+
packageJsonDirPath,
|
424
|
+
garronejLinkInfos
|
425
|
+
});
|
426
|
+
return;
|
427
|
+
}
|
428
|
+
try {
|
429
|
+
external_child_process_.execSync(`${packageManagerBinName} install`, {
|
430
|
+
cwd: packageJsonDirPath,
|
431
|
+
stdio: "inherit"
|
432
|
+
});
|
433
|
+
}
|
434
|
+
catch (_a) {
|
435
|
+
console.log(source_default().yellow(`\`${packageManagerBinName} install\` failed, continuing anyway...`));
|
436
|
+
}
|
437
|
+
}
|
438
|
+
function getGarronejLinkInfos(params) {
|
439
|
+
const { packageJsonDirPath } = params;
|
440
|
+
const nodeModuleDirPath = (0,external_path_.join)(packageJsonDirPath, "node_modules");
|
441
|
+
if (!external_fs_.existsSync(nodeModuleDirPath)) {
|
442
|
+
return undefined;
|
443
|
+
}
|
444
|
+
const linkedModuleNames = [];
|
445
|
+
let yarnHomeDirPath = undefined;
|
446
|
+
const getIsLinkedByGarronejScript = (path) => {
|
447
|
+
let realPath;
|
448
|
+
try {
|
449
|
+
realPath = external_fs_.readlinkSync(path);
|
450
|
+
}
|
451
|
+
catch (_a) {
|
452
|
+
return false;
|
453
|
+
}
|
454
|
+
const doesIncludeYarnHome = realPath.includes(".yarn_home");
|
455
|
+
if (!doesIncludeYarnHome) {
|
456
|
+
return false;
|
457
|
+
}
|
458
|
+
set_yarnHomeDirPath: {
|
459
|
+
if (yarnHomeDirPath !== undefined) {
|
460
|
+
break set_yarnHomeDirPath;
|
461
|
+
}
|
462
|
+
const [firstElement] = (0,getAbsoluteAndInOsFormatPath/* getAbsoluteAndInOsFormatPath */.c)({
|
463
|
+
pathIsh: realPath,
|
464
|
+
cwd: (0,external_path_.dirname)(path)
|
465
|
+
}).split(".yarn_home");
|
466
|
+
yarnHomeDirPath = (0,external_path_.join)(firstElement, ".yarn_home");
|
467
|
+
}
|
468
|
+
return true;
|
469
|
+
};
|
470
|
+
for (const basename of external_fs_.readdirSync(nodeModuleDirPath)) {
|
471
|
+
const path = (0,external_path_.join)(nodeModuleDirPath, basename);
|
472
|
+
if (external_fs_.lstatSync(path).isSymbolicLink()) {
|
473
|
+
if (basename.startsWith("@")) {
|
474
|
+
return undefined;
|
475
|
+
}
|
476
|
+
if (!getIsLinkedByGarronejScript(path)) {
|
477
|
+
return undefined;
|
478
|
+
}
|
479
|
+
linkedModuleNames.push(basename);
|
480
|
+
continue;
|
481
|
+
}
|
482
|
+
if (!external_fs_.lstatSync(path).isDirectory()) {
|
483
|
+
continue;
|
484
|
+
}
|
485
|
+
if (basename.startsWith("@")) {
|
486
|
+
for (const subBasename of external_fs_.readdirSync(path)) {
|
487
|
+
const subPath = (0,external_path_.join)(path, subBasename);
|
488
|
+
if (!external_fs_.lstatSync(subPath).isSymbolicLink()) {
|
489
|
+
continue;
|
490
|
+
}
|
491
|
+
if (!getIsLinkedByGarronejScript(subPath)) {
|
492
|
+
return undefined;
|
493
|
+
}
|
494
|
+
linkedModuleNames.push(`${basename}/${subBasename}`);
|
495
|
+
}
|
496
|
+
}
|
497
|
+
}
|
498
|
+
if (yarnHomeDirPath === undefined) {
|
499
|
+
return undefined;
|
500
|
+
}
|
501
|
+
return { linkedModuleNames, yarnHomeDirPath };
|
502
|
+
}
|
503
|
+
function installWithoutBreakingLinks(params) {
|
504
|
+
const { packageJsonDirPath, garronejLinkInfos: { linkedModuleNames, yarnHomeDirPath } } = params;
|
505
|
+
const parsedPackageJson = (() => {
|
506
|
+
const packageJsonFilePath = (0,external_path_.join)(packageJsonDirPath, "package.json");
|
507
|
+
const zParsedPackageJson = (() => {
|
508
|
+
const zTargetType = lib.z.object({
|
509
|
+
scripts: lib.z.record(lib.z.string()).optional()
|
510
|
+
});
|
511
|
+
assert/* assert */.h;
|
512
|
+
return (0,id.id)(zTargetType);
|
513
|
+
})();
|
514
|
+
const parsedPackageJson = JSON.parse(external_fs_.readFileSync(packageJsonFilePath).toString("utf8"));
|
515
|
+
zParsedPackageJson.parse(parsedPackageJson);
|
516
|
+
(0,assert/* assert */.h)((0,is.is)(parsedPackageJson));
|
517
|
+
return parsedPackageJson;
|
518
|
+
})();
|
519
|
+
const isImplementedScriptByName = {
|
520
|
+
postinstall: false,
|
521
|
+
prepare: false
|
522
|
+
};
|
523
|
+
delete_postinstall_script: {
|
524
|
+
if (parsedPackageJson.scripts === undefined) {
|
525
|
+
break delete_postinstall_script;
|
526
|
+
}
|
527
|
+
for (const scriptName of objectKeys(isImplementedScriptByName)) {
|
528
|
+
if (parsedPackageJson.scripts[scriptName] === undefined) {
|
529
|
+
continue;
|
530
|
+
}
|
531
|
+
isImplementedScriptByName[scriptName] = true;
|
532
|
+
delete parsedPackageJson.scripts[scriptName];
|
533
|
+
}
|
534
|
+
}
|
535
|
+
const tmpProjectDirPath = (0,external_path_.join)(yarnHomeDirPath, "tmpProject");
|
536
|
+
if (external_fs_.existsSync(tmpProjectDirPath)) {
|
537
|
+
(0,fs_rmSync/* rmSync */.a)(tmpProjectDirPath, { recursive: true });
|
538
|
+
}
|
539
|
+
external_fs_.mkdirSync(tmpProjectDirPath, { recursive: true });
|
540
|
+
external_fs_.writeFileSync((0,external_path_.join)(tmpProjectDirPath, "package.json"), JSON.stringify(parsedPackageJson, undefined, 4));
|
541
|
+
const YARN_LOCK = "yarn.lock";
|
542
|
+
external_fs_.copyFileSync((0,external_path_.join)(packageJsonDirPath, YARN_LOCK), (0,external_path_.join)(tmpProjectDirPath, YARN_LOCK));
|
543
|
+
external_child_process_.execSync(`yarn install`, {
|
544
|
+
cwd: tmpProjectDirPath,
|
545
|
+
stdio: "inherit"
|
546
|
+
});
|
547
|
+
// NOTE: Moving the modules from the tmp project to the actual project
|
548
|
+
// without messing up the links.
|
549
|
+
{
|
550
|
+
const { getAreSameVersions } = (() => {
|
551
|
+
const zParsedPackageJson = (() => {
|
552
|
+
const zTargetType = lib.z.object({
|
553
|
+
version: lib.z.string()
|
554
|
+
});
|
555
|
+
assert/* assert */.h;
|
556
|
+
return (0,id.id)(zTargetType);
|
557
|
+
})();
|
558
|
+
function readVersion(params) {
|
559
|
+
const { moduleDirPath } = params;
|
560
|
+
const packageJsonFilePath = (0,external_path_.join)(moduleDirPath, "package.json");
|
561
|
+
const packageJson = JSON.parse(external_fs_.readFileSync(packageJsonFilePath).toString("utf8"));
|
562
|
+
zParsedPackageJson.parse(packageJson);
|
563
|
+
(0,assert/* assert */.h)((0,is.is)(packageJson));
|
564
|
+
return packageJson.version;
|
565
|
+
}
|
566
|
+
function getAreSameVersions(params) {
|
567
|
+
const { moduleDirPath_a, moduleDirPath_b } = params;
|
568
|
+
return (readVersion({ moduleDirPath: moduleDirPath_a }) ===
|
569
|
+
readVersion({ moduleDirPath: moduleDirPath_b }));
|
570
|
+
}
|
571
|
+
return { getAreSameVersions };
|
572
|
+
})();
|
573
|
+
const nodeModulesDirPath_tmpProject = (0,external_path_.join)(tmpProjectDirPath, "node_modules");
|
574
|
+
const nodeModulesDirPath = (0,external_path_.join)(packageJsonDirPath, "node_modules");
|
575
|
+
const modulePaths = external_fs_.readdirSync(nodeModulesDirPath_tmpProject)
|
576
|
+
.map(basename => {
|
577
|
+
if (basename.startsWith(".")) {
|
578
|
+
return undefined;
|
579
|
+
}
|
580
|
+
const path = (0,external_path_.join)(nodeModulesDirPath_tmpProject, basename);
|
581
|
+
if (basename.startsWith("@")) {
|
582
|
+
return external_fs_.readdirSync(path)
|
583
|
+
.map(subBasename => {
|
584
|
+
if (subBasename.startsWith(".")) {
|
585
|
+
return undefined;
|
586
|
+
}
|
587
|
+
const subPath = (0,external_path_.join)(path, subBasename);
|
588
|
+
if (!external_fs_.lstatSync(subPath).isDirectory()) {
|
589
|
+
return undefined;
|
590
|
+
}
|
591
|
+
return {
|
592
|
+
moduleName: `${basename}/${subBasename}`,
|
593
|
+
moduleDirPath_tmpProject: subPath,
|
594
|
+
moduleDirPath: (0,external_path_.join)(nodeModulesDirPath, basename, subBasename)
|
595
|
+
};
|
596
|
+
})
|
597
|
+
.filter((0,exclude/* exclude */.D)(undefined));
|
598
|
+
}
|
599
|
+
if (!external_fs_.lstatSync(path).isDirectory()) {
|
600
|
+
return undefined;
|
601
|
+
}
|
602
|
+
return [
|
603
|
+
{
|
604
|
+
moduleName: basename,
|
605
|
+
moduleDirPath_tmpProject: path,
|
606
|
+
moduleDirPath: (0,external_path_.join)(nodeModulesDirPath, basename)
|
607
|
+
}
|
608
|
+
];
|
609
|
+
})
|
610
|
+
.filter((0,exclude/* exclude */.D)(undefined))
|
611
|
+
.flat();
|
612
|
+
for (const { moduleName, moduleDirPath, moduleDirPath_tmpProject } of modulePaths) {
|
613
|
+
if (linkedModuleNames.includes(moduleName)) {
|
614
|
+
continue;
|
615
|
+
}
|
616
|
+
let doesTargetModuleExist = false;
|
617
|
+
skip_condition: {
|
618
|
+
if (!external_fs_.existsSync(moduleDirPath)) {
|
619
|
+
break skip_condition;
|
620
|
+
}
|
621
|
+
doesTargetModuleExist = true;
|
622
|
+
const areSameVersions = getAreSameVersions({
|
623
|
+
moduleDirPath_a: moduleDirPath,
|
624
|
+
moduleDirPath_b: moduleDirPath_tmpProject
|
625
|
+
});
|
626
|
+
if (!areSameVersions) {
|
627
|
+
break skip_condition;
|
628
|
+
}
|
629
|
+
continue;
|
630
|
+
}
|
631
|
+
if (doesTargetModuleExist) {
|
632
|
+
(0,fs_rmSync/* rmSync */.a)(moduleDirPath, { recursive: true });
|
633
|
+
}
|
634
|
+
{
|
635
|
+
const dirPath = (0,external_path_.dirname)(moduleDirPath);
|
636
|
+
if (!external_fs_.existsSync(dirPath)) {
|
637
|
+
external_fs_.mkdirSync(dirPath, { recursive: true });
|
638
|
+
}
|
639
|
+
}
|
640
|
+
external_fs_.renameSync(moduleDirPath_tmpProject, moduleDirPath);
|
641
|
+
}
|
642
|
+
move_bin: {
|
643
|
+
const binDirPath_tmpProject = (0,external_path_.join)(nodeModulesDirPath_tmpProject, ".bin");
|
644
|
+
const binDirPath = (0,external_path_.join)(nodeModulesDirPath, ".bin");
|
645
|
+
if (!external_fs_.existsSync(binDirPath_tmpProject)) {
|
646
|
+
break move_bin;
|
647
|
+
}
|
648
|
+
for (const basename of external_fs_.readdirSync(binDirPath_tmpProject)) {
|
649
|
+
const path_tmpProject = (0,external_path_.join)(binDirPath_tmpProject, basename);
|
650
|
+
const path = (0,external_path_.join)(binDirPath, basename);
|
651
|
+
if (external_fs_.existsSync(path)) {
|
652
|
+
continue;
|
653
|
+
}
|
654
|
+
external_fs_.renameSync(path_tmpProject, path);
|
655
|
+
}
|
656
|
+
}
|
657
|
+
}
|
658
|
+
external_fs_.cpSync((0,external_path_.join)(tmpProjectDirPath, YARN_LOCK), (0,external_path_.join)(packageJsonDirPath, YARN_LOCK));
|
659
|
+
(0,fs_rmSync/* rmSync */.a)(tmpProjectDirPath, { recursive: true });
|
660
|
+
for (const scriptName of objectKeys(isImplementedScriptByName)) {
|
661
|
+
if (!isImplementedScriptByName[scriptName]) {
|
662
|
+
continue;
|
663
|
+
}
|
664
|
+
external_child_process_.execSync(`yarn run ${scriptName}`, {
|
665
|
+
cwd: packageJsonDirPath,
|
666
|
+
stdio: "inherit"
|
667
|
+
});
|
668
|
+
}
|
669
|
+
}
|
670
|
+
//# sourceMappingURL=npmInstall.js.map
|
671
|
+
|
672
|
+
/***/ })
|
673
|
+
|
674
|
+
};
|
675
|
+
;
|