keycloakify 11.6.1 → 11.7.0

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.
Files changed (96) hide show
  1. package/bin/{653.index.js → 288.index.js} +221 -201
  2. package/bin/313.index.js +377 -0
  3. package/bin/{174.index.js → 33.index.js} +37 -2
  4. package/bin/{615.index.js → 355.index.js} +353 -102
  5. package/bin/363.index.js +1537 -0
  6. package/bin/453.index.js +6 -42
  7. package/bin/{503.index.js → 678.index.js} +577 -53
  8. package/bin/{921.index.js → 780.index.js} +54 -45
  9. package/bin/880.index.js +206 -21
  10. package/bin/9.index.js +850 -0
  11. package/bin/{525.index.js → 911.index.js} +1302 -2
  12. package/bin/930.index.js +164 -0
  13. package/bin/946.index.js +20 -0
  14. package/bin/{153.index.js → 947.index.js} +22 -797
  15. package/bin/main.js +61 -19
  16. package/bin/{eject-file.d.ts → own.d.ts} +2 -1
  17. package/bin/shared/{addPostinstallScriptIfNotPresent.d.ts → initializeSpa/addSyncExtensionsToPostinstallScript.d.ts} +1 -1
  18. package/bin/shared/initializeSpa/index.d.ts +1 -0
  19. package/bin/shared/initializeSpa/initializeSpa.d.ts +9 -0
  20. package/bin/{postinstall/uiModuleMeta.d.ts → sync-extensions/extensionModuleMeta.d.ts} +5 -5
  21. package/bin/sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.d.ts +12 -0
  22. package/bin/sync-extensions/index.d.ts +1 -0
  23. package/bin/{postinstall/installUiModulesPeerDependencies.d.ts → sync-extensions/installExtensionModulesPeerDependencies.d.ts} +3 -3
  24. package/bin/{postinstall → sync-extensions}/managedGitignoreFile.d.ts +4 -4
  25. package/bin/tools/getInstalledModuleDirPath.d.ts +0 -1
  26. package/bin/tools/isKnownByGit.d.ts +3 -0
  27. package/bin/tools/isRootPath.d.ts +1 -0
  28. package/bin/tools/listInstalledModules.d.ts +0 -1
  29. package/package.json +41 -63
  30. package/src/bin/eject-page.ts +8 -84
  31. package/src/bin/initialize-account-theme/initialize-account-theme.ts +15 -14
  32. package/src/bin/initialize-admin-theme.ts +17 -124
  33. package/src/bin/initialize-email-theme.ts +10 -34
  34. package/src/bin/keycloakify/generateResources/generateResources.ts +49 -21
  35. package/src/bin/main.ts +61 -16
  36. package/src/bin/own.ts +208 -0
  37. package/src/bin/shared/{addPostinstallScriptIfNotPresent.ts → initializeSpa/addSyncExtensionsToPostinstallScript.ts} +4 -4
  38. package/src/bin/shared/initializeSpa/index.ts +1 -0
  39. package/src/bin/shared/initializeSpa/initializeSpa.ts +149 -0
  40. package/src/bin/{postinstall/uiModuleMeta.ts → sync-extensions/extensionModuleMeta.ts} +48 -43
  41. package/src/bin/{postinstall/getUiModuleFileSourceCodeReadyToBeCopied.ts → sync-extensions/getExtensionModuleFileSourceCodeReadyToBeCopied.ts} +32 -21
  42. package/src/bin/sync-extensions/index.ts +1 -0
  43. package/src/bin/{postinstall/installUiModulesPeerDependencies.ts → sync-extensions/installExtensionModulesPeerDependencies.ts} +15 -13
  44. package/src/bin/{postinstall → sync-extensions}/managedGitignoreFile.ts +18 -18
  45. package/src/bin/{postinstall/postinstall.ts → sync-extensions/sync-extension.ts} +14 -26
  46. package/src/bin/tools/getInstalledModuleDirPath.ts +24 -22
  47. package/src/bin/tools/isKnownByGit.ts +45 -0
  48. package/src/bin/tools/isRootPath.ts +22 -0
  49. package/src/bin/tools/listInstalledModules.ts +4 -6
  50. package/src/bin/tools/npmInstall.ts +1 -1
  51. package/src/bin/tools/untrackFromGit.ts +19 -3
  52. package/src/bin/tsconfig.json +1 -1
  53. package/bin/300.index.js +0 -770
  54. package/bin/375.index.js +0 -4089
  55. package/bin/490.index.js +0 -1108
  56. package/bin/568.index.js +0 -1867
  57. package/bin/735.index.js +0 -907
  58. package/bin/743.index.js +0 -69
  59. package/bin/854.index.js +0 -68
  60. package/bin/initialize-account-theme/copyBoilerplate.d.ts +0 -4
  61. package/bin/initialize-account-theme/initializeAccountTheme_multiPage.d.ts +0 -3
  62. package/bin/initialize-account-theme/initializeAccountTheme_singlePage.d.ts +0 -11
  63. package/bin/postinstall/getUiModuleFileSourceCodeReadyToBeCopied.d.ts +0 -12
  64. package/bin/postinstall/index.d.ts +0 -1
  65. package/bin/shared/getLatestsSemVersionedTag.d.ts +0 -15
  66. package/bin/shared/promptKeycloakVersion.d.ts +0 -10
  67. package/bin/tools/OptionalIfCanBeUndefined.d.ts +0 -14
  68. package/bin/tools/crc32.d.ts +0 -9
  69. package/bin/tools/deflate.d.ts +0 -24
  70. package/bin/tools/isTrackedByGit.d.ts +0 -3
  71. package/bin/tools/octokit-addons/getLatestsSemVersionedTag.d.ts +0 -15
  72. package/bin/tools/octokit-addons/listTags.d.ts +0 -13
  73. package/bin/tools/tee.d.ts +0 -3
  74. package/bin/tools/trimIndent.d.ts +0 -5
  75. package/src/bin/eject-file.ts +0 -68
  76. package/src/bin/initialize-account-theme/copyBoilerplate.ts +0 -32
  77. package/src/bin/initialize-account-theme/initializeAccountTheme_multiPage.ts +0 -21
  78. package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +0 -142
  79. package/src/bin/initialize-account-theme/src/single-page/KcContext.ts +0 -7
  80. package/src/bin/initialize-account-theme/src/single-page/KcPage.tsx +0 -11
  81. package/src/bin/postinstall/index.ts +0 -1
  82. package/src/bin/shared/getLatestsSemVersionedTag.ts +0 -201
  83. package/src/bin/shared/promptKeycloakVersion.ts +0 -72
  84. package/src/bin/tools/OptionalIfCanBeUndefined.ts +0 -12
  85. package/src/bin/tools/crc32.ts +0 -73
  86. package/src/bin/tools/deflate.ts +0 -61
  87. package/src/bin/tools/isTrackedByGit.ts +0 -29
  88. package/src/bin/tools/octokit-addons/getLatestsSemVersionedTag.ts +0 -47
  89. package/src/bin/tools/octokit-addons/listTags.ts +0 -60
  90. package/src/bin/tools/tee.ts +0 -39
  91. package/src/bin/tools/trimIndent.ts +0 -49
  92. /package/bin/{postinstall/postinstall.d.ts → sync-extensions/sync-extension.d.ts} +0 -0
  93. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/KcContext.ts +0 -0
  94. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/KcPage.tsx +0 -0
  95. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/KcPageStory.tsx +0 -0
  96. /package/src/bin/initialize-account-theme/{src/multi-page → multi-page-boilerplate}/i18n.ts +0 -0
package/bin/735.index.js DELETED
@@ -1,907 +0,0 @@
1
- "use strict";
2
- exports.id = 735;
3
- exports.ids = [735];
4
- exports.modules = {
5
-
6
- /***/ 81434:
7
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
8
-
9
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10
- /* harmony export */ "T": () => (/* binding */ copyBoilerplate)
11
- /* harmony export */ });
12
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
13
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
14
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
15
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
16
- /* harmony import */ var _tools_getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(58822);
17
- /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29041);
18
-
19
-
20
-
21
-
22
- function copyBoilerplate(params) {
23
- const { accountThemeType, accountThemeSrcDirPath } = params;
24
- fs__WEBPACK_IMPORTED_MODULE_0__.cpSync((0,path__WEBPACK_IMPORTED_MODULE_1__.join)((0,_tools_getThisCodebaseRootDirPath__WEBPACK_IMPORTED_MODULE_2__/* .getThisCodebaseRootDirPath */ .e)(), "src", "bin", "initialize-account-theme", "src", (() => {
25
- switch (accountThemeType) {
26
- case "Single-Page":
27
- return "single-page";
28
- case "Multi-Page":
29
- return "multi-page";
30
- }
31
- (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .h)(false);
32
- })()), accountThemeSrcDirPath, { recursive: true });
33
- }
34
- //# sourceMappingURL=copyBoilerplate.js.map
35
-
36
- /***/ }),
37
-
38
- /***/ 84735:
39
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
40
-
41
- __webpack_require__.r(__webpack_exports__);
42
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
43
- /* harmony export */ "initializeAccountTheme_singlePage": () => (/* binding */ initializeAccountTheme_singlePage)
44
- /* harmony export */ });
45
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
46
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
47
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57147);
48
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
49
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(78818);
50
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_2__);
51
- /* harmony import */ var _shared_getLatestsSemVersionedTag__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(97189);
52
- /* harmony import */ var _tools_SemVer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(12171);
53
- /* harmony import */ var make_fetch_happen__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9525);
54
- /* harmony import */ var make_fetch_happen__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(make_fetch_happen__WEBPACK_IMPORTED_MODULE_5__);
55
- /* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(52300);
56
- /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(29041);
57
- /* harmony import */ var tsafe_id__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(38469);
58
- /* harmony import */ var _tools_npmInstall__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(50030);
59
- /* harmony import */ var _copyBoilerplate__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(81434);
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
- (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_6__/* .assert */ .h)();
72
- async function initializeAccountTheme_singlePage(params) {
73
- const { accountThemeSrcDirPath, buildContext } = params;
74
- const OWNER = "keycloakify";
75
- const REPO = "keycloak-account-ui";
76
- const [semVersionedTag] = await (0,_shared_getLatestsSemVersionedTag__WEBPACK_IMPORTED_MODULE_3__/* .getLatestsSemVersionedTag */ ._)({
77
- owner: OWNER,
78
- repo: REPO,
79
- count: 1,
80
- doIgnoreReleaseCandidates: false,
81
- buildContext
82
- });
83
- const dependencies = await make_fetch_happen__WEBPACK_IMPORTED_MODULE_5___default()(`https://raw.githubusercontent.com/${OWNER}/${REPO}/${semVersionedTag.tag}/dependencies.gen.json`, buildContext.fetchOptions)
84
- .then(r => r.json())
85
- .then((() => {
86
- const zDependencies = (() => {
87
- const zTargetType = zod__WEBPACK_IMPORTED_MODULE_9__.z.object({
88
- dependencies: zod__WEBPACK_IMPORTED_MODULE_9__.z.record(zod__WEBPACK_IMPORTED_MODULE_9__.z.string()),
89
- devDependencies: zod__WEBPACK_IMPORTED_MODULE_9__.z.record(zod__WEBPACK_IMPORTED_MODULE_9__.z.string()).optional()
90
- });
91
- (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_6__/* .assert */ .h)();
92
- return (0,tsafe_id__WEBPACK_IMPORTED_MODULE_10__.id)(zTargetType);
93
- })();
94
- return o => zDependencies.parse(o);
95
- })());
96
- dependencies.dependencies["@keycloakify/keycloak-account-ui"] = _tools_SemVer__WEBPACK_IMPORTED_MODULE_4__/* .SemVer.stringify */ .h.stringify(semVersionedTag.version);
97
- const parsedPackageJson = (() => {
98
- const zParsedPackageJson = (() => {
99
- const zTargetType = zod__WEBPACK_IMPORTED_MODULE_9__.z.object({
100
- dependencies: zod__WEBPACK_IMPORTED_MODULE_9__.z.record(zod__WEBPACK_IMPORTED_MODULE_9__.z.string()).optional(),
101
- devDependencies: zod__WEBPACK_IMPORTED_MODULE_9__.z.record(zod__WEBPACK_IMPORTED_MODULE_9__.z.string()).optional()
102
- });
103
- (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_6__/* .assert */ .h)();
104
- return (0,tsafe_id__WEBPACK_IMPORTED_MODULE_10__.id)(zTargetType);
105
- })();
106
- const parsedPackageJson = JSON.parse(fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync(buildContext.packageJsonFilePath).toString("utf8"));
107
- zParsedPackageJson.parse(parsedPackageJson);
108
- (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_6__/* .assert */ .h)((0,tsafe_assert__WEBPACK_IMPORTED_MODULE_6__.is)(parsedPackageJson));
109
- return parsedPackageJson;
110
- })();
111
- parsedPackageJson.dependencies = Object.assign(Object.assign({}, parsedPackageJson.dependencies), dependencies.dependencies);
112
- parsedPackageJson.devDependencies = Object.assign(Object.assign({}, parsedPackageJson.devDependencies), dependencies.devDependencies);
113
- if (Object.keys(parsedPackageJson.devDependencies).length === 0) {
114
- delete parsedPackageJson.devDependencies;
115
- }
116
- fs__WEBPACK_IMPORTED_MODULE_1__.writeFileSync(buildContext.packageJsonFilePath, JSON.stringify(parsedPackageJson, undefined, 4));
117
- await (0,_tools_npmInstall__WEBPACK_IMPORTED_MODULE_7__/* .npmInstall */ .c)({
118
- packageJsonDirPath: (0,path__WEBPACK_IMPORTED_MODULE_0__.dirname)(buildContext.packageJsonFilePath)
119
- });
120
- (0,_copyBoilerplate__WEBPACK_IMPORTED_MODULE_8__/* .copyBoilerplate */ .T)({
121
- accountThemeType: "Single-Page",
122
- accountThemeSrcDirPath
123
- });
124
- console.log([
125
- chalk__WEBPACK_IMPORTED_MODULE_2___default().green("The Single-Page account theme has been successfully initialized."),
126
- `Using Account UI of Keycloak version: ${chalk__WEBPACK_IMPORTED_MODULE_2___default().bold(semVersionedTag.tag.split("-")[0])}`,
127
- `Directory created: ${chalk__WEBPACK_IMPORTED_MODULE_2___default().bold((0,path__WEBPACK_IMPORTED_MODULE_0__.relative)(process.cwd(), accountThemeSrcDirPath))}`,
128
- `Dependencies added to your project's package.json: `,
129
- chalk__WEBPACK_IMPORTED_MODULE_2___default().bold(JSON.stringify(dependencies, null, 2))
130
- ].join("\n"));
131
- }
132
- //# sourceMappingURL=initializeAccountTheme_singlePage.js.map
133
-
134
- /***/ }),
135
-
136
- /***/ 97189:
137
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
138
-
139
-
140
- // EXPORTS
141
- __webpack_require__.d(__webpack_exports__, {
142
- "_": () => (/* binding */ getLatestsSemVersionedTag)
143
- });
144
-
145
- ;// CONCATENATED MODULE: ./dist/bin/tools/octokit-addons/listTags.js
146
- var __await = (undefined && undefined.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
147
- var __asyncGenerator = (undefined && undefined.__asyncGenerator) || function (thisArg, _arguments, generator) {
148
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
149
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
150
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
151
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
152
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
153
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
154
- function fulfill(value) { resume("next", value); }
155
- function reject(value) { resume("throw", value); }
156
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
157
- };
158
- const per_page = 99;
159
- function listTagsFactory(params) {
160
- const { octokit } = params;
161
- const octokit_repo_listTags = async (params) => {
162
- return octokit.repos.listTags(params);
163
- };
164
- function listTags(params) {
165
- return __asyncGenerator(this, arguments, function* listTags_1() {
166
- const { owner, repo } = params;
167
- let page = 1;
168
- while (true) {
169
- const resp = yield __await(octokit_repo_listTags({
170
- owner,
171
- repo,
172
- per_page,
173
- page: page++
174
- }));
175
- for (const branch of resp.data.map(({ name }) => name)) {
176
- yield yield __await(branch);
177
- }
178
- if (resp.data.length < 99) {
179
- break;
180
- }
181
- }
182
- });
183
- }
184
- /** Returns the same "latest" tag as deno.land/x, not actually the latest though */
185
- async function getLatestTag(params) {
186
- const { owner, repo } = params;
187
- const itRes = await listTags({ owner, repo }).next();
188
- if (itRes.done) {
189
- return undefined;
190
- }
191
- return itRes.value;
192
- }
193
- return { listTags, getLatestTag };
194
- }
195
- //# sourceMappingURL=listTags.js.map
196
- // EXTERNAL MODULE: ./dist/bin/tools/SemVer.js
197
- var SemVer = __webpack_require__(12171);
198
- ;// CONCATENATED MODULE: ./dist/bin/tools/octokit-addons/getLatestsSemVersionedTag.js
199
- var __asyncValues = (undefined && undefined.__asyncValues) || function (o) {
200
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
201
- var m = o[Symbol.asyncIterator], i;
202
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
203
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
204
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
205
- };
206
-
207
-
208
- function getLatestsSemVersionedTagFactory(params) {
209
- const { octokit } = params;
210
- async function getLatestsSemVersionedTag(params) {
211
- var _a, e_1, _b, _c;
212
- const { owner, repo, count, doIgnoreReleaseCandidates } = params;
213
- const semVersionedTags = [];
214
- const { listTags } = listTagsFactory({ octokit });
215
- try {
216
- for (var _d = true, _e = __asyncValues(listTags({ owner, repo })), _f; _f = await _e.next(), _a = _f.done, !_a;) {
217
- _c = _f.value;
218
- _d = false;
219
- try {
220
- const tag = _c;
221
- let version;
222
- try {
223
- version = SemVer/* SemVer.parse */.h.parse(tag.replace(/^[vV]?/, ""));
224
- }
225
- catch (_g) {
226
- continue;
227
- }
228
- if (doIgnoreReleaseCandidates && version.rc !== undefined) {
229
- continue;
230
- }
231
- semVersionedTags.push({ tag, version });
232
- }
233
- finally {
234
- _d = true;
235
- }
236
- }
237
- }
238
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
239
- finally {
240
- try {
241
- if (!_d && !_a && (_b = _e.return)) await _b.call(_e);
242
- }
243
- finally { if (e_1) throw e_1.error; }
244
- }
245
- return semVersionedTags
246
- .sort(({ version: vX }, { version: vY }) => SemVer/* SemVer.compare */.h.compare(vY, vX))
247
- .slice(0, count);
248
- }
249
- return { getLatestsSemVersionedTag };
250
- }
251
- //# sourceMappingURL=getLatestsSemVersionedTag.js.map
252
- // EXTERNAL MODULE: ./node_modules/@octokit/rest/dist-node/index.js
253
- var dist_node = __webpack_require__(55375);
254
- // EXTERNAL MODULE: external "path"
255
- var external_path_ = __webpack_require__(71017);
256
- // EXTERNAL MODULE: external "fs"
257
- var external_fs_ = __webpack_require__(57147);
258
- // EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
259
- var lib = __webpack_require__(52300);
260
- // EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
261
- var assert = __webpack_require__(29041);
262
- // EXTERNAL MODULE: ./node_modules/tsafe/esm/id.mjs
263
- var id = __webpack_require__(38469);
264
- // EXTERNAL MODULE: ./node_modules/evt/tools/inDepth/same.js
265
- var same = __webpack_require__(33805);
266
- // EXTERNAL MODULE: ./node_modules/make-fetch-happen/lib/index.js
267
- var make_fetch_happen_lib = __webpack_require__(9525);
268
- var lib_default = /*#__PURE__*/__webpack_require__.n(make_fetch_happen_lib);
269
- ;// CONCATENATED MODULE: ./dist/bin/shared/getLatestsSemVersionedTag.js
270
- var __rest = (undefined && undefined.__rest) || function (s, e) {
271
- var t = {};
272
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
273
- t[p] = s[p];
274
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
275
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
276
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
277
- t[p[i]] = s[p[i]];
278
- }
279
- return t;
280
- };
281
-
282
-
283
-
284
-
285
-
286
-
287
-
288
-
289
-
290
- let getLatestsSemVersionedTag_stateless = undefined;
291
- const CACHE_VERSION = 1;
292
- (0,assert/* assert */.h)();
293
- async function getLatestsSemVersionedTag(_a) {
294
- var { buildContext } = _a, params = __rest(_a, ["buildContext"]);
295
- const cacheFilePath = (0,external_path_.join)(buildContext.cacheDirPath, "latest-sem-versioned-tags.json");
296
- const cacheLookupResult = (() => {
297
- const getResult_currentCache = (currentCacheEntries) => ({
298
- hasCachedResult: false,
299
- currentCache: {
300
- version: CACHE_VERSION,
301
- entries: currentCacheEntries
302
- }
303
- });
304
- if (!external_fs_.existsSync(cacheFilePath)) {
305
- return getResult_currentCache([]);
306
- }
307
- let cache_json;
308
- try {
309
- cache_json = external_fs_.readFileSync(cacheFilePath).toString("utf8");
310
- }
311
- catch (_a) {
312
- return getResult_currentCache([]);
313
- }
314
- let cache_json_parsed;
315
- try {
316
- cache_json_parsed = JSON.parse(cache_json);
317
- }
318
- catch (_b) {
319
- return getResult_currentCache([]);
320
- }
321
- const zSemVer = (() => {
322
- const zTargetType = lib.z.object({
323
- major: lib.z.number(),
324
- minor: lib.z.number(),
325
- patch: lib.z.number(),
326
- rc: lib.z.number().optional(),
327
- parsedFrom: lib.z.string()
328
- });
329
- (0,assert/* assert */.h)();
330
- return (0,id.id)(zTargetType);
331
- })();
332
- const zCache = (() => {
333
- const zTargetType = lib.z.object({
334
- version: lib.z.literal(CACHE_VERSION),
335
- entries: lib.z.array(lib.z.object({
336
- time: lib.z.number(),
337
- params: lib.z.object({
338
- owner: lib.z.string(),
339
- repo: lib.z.string(),
340
- count: lib.z.number(),
341
- doIgnoreReleaseCandidates: lib.z.boolean()
342
- }),
343
- result: lib.z.array(lib.z.object({
344
- tag: lib.z.string(),
345
- version: zSemVer
346
- }))
347
- }))
348
- });
349
- (0,assert/* assert */.h)();
350
- return (0,id.id)(zTargetType);
351
- })();
352
- let cache;
353
- try {
354
- cache = zCache.parse(cache_json_parsed);
355
- }
356
- catch (_c) {
357
- return getResult_currentCache([]);
358
- }
359
- const cacheEntry = cache.entries.find(e => (0,same.same)(e.params, params));
360
- if (cacheEntry === undefined) {
361
- return getResult_currentCache(cache.entries);
362
- }
363
- if (Date.now() - cacheEntry.time > 3600000) {
364
- return getResult_currentCache(cache.entries.filter(e => e !== cacheEntry));
365
- }
366
- return {
367
- hasCachedResult: true,
368
- cachedResult: cacheEntry.result
369
- };
370
- })();
371
- if (cacheLookupResult.hasCachedResult) {
372
- return cacheLookupResult.cachedResult;
373
- }
374
- const { currentCache } = cacheLookupResult;
375
- getLatestsSemVersionedTag_stateless !== null && getLatestsSemVersionedTag_stateless !== void 0 ? getLatestsSemVersionedTag_stateless : (getLatestsSemVersionedTag_stateless = (() => {
376
- const octokit = (() => {
377
- const githubToken = process.env.GITHUB_TOKEN;
378
- const octokit = new dist_node.Octokit(Object.assign(Object.assign({}, (githubToken === undefined ? {} : { auth: githubToken })), { request: {
379
- fetch: (url, options) => lib_default()(url, Object.assign(Object.assign({}, options), buildContext.fetchOptions))
380
- } }));
381
- return octokit;
382
- })();
383
- const { getLatestsSemVersionedTag } = getLatestsSemVersionedTagFactory({
384
- octokit
385
- });
386
- return getLatestsSemVersionedTag;
387
- })());
388
- const result = await getLatestsSemVersionedTag_stateless(params);
389
- currentCache.entries.push({
390
- time: Date.now(),
391
- params,
392
- result
393
- });
394
- {
395
- const dirPath = (0,external_path_.dirname)(cacheFilePath);
396
- if (!external_fs_.existsSync(dirPath)) {
397
- external_fs_.mkdirSync(dirPath, { recursive: true });
398
- }
399
- }
400
- external_fs_.writeFileSync(cacheFilePath, JSON.stringify(currentCache, null, 2));
401
- return result;
402
- }
403
- //# sourceMappingURL=getLatestsSemVersionedTag.js.map
404
-
405
- /***/ }),
406
-
407
- /***/ 12171:
408
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
409
-
410
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
411
- /* harmony export */ "h": () => (/* binding */ SemVer)
412
- /* harmony export */ });
413
- var SemVer;
414
- (function (SemVer) {
415
- const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
416
- function parse(versionStr) {
417
- const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
418
- if (!match) {
419
- throw new Error(`${versionStr} is not a valid semantic version`);
420
- }
421
- const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
422
- const str = match[3];
423
- return str === undefined ? 0 : parseInt(str);
424
- })() }, (() => {
425
- const str = match[4];
426
- return str === undefined ? {} : { rc: parseInt(str) };
427
- })());
428
- const initialStr = stringify(semVer);
429
- Object.defineProperty(semVer, "parsedFrom", {
430
- enumerable: true,
431
- get: function () {
432
- const currentStr = stringify(this);
433
- if (currentStr !== initialStr) {
434
- throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
435
- }
436
- return versionStr;
437
- }
438
- });
439
- return semVer;
440
- }
441
- SemVer.parse = parse;
442
- function stringify(v) {
443
- return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
444
- }
445
- SemVer.stringify = stringify;
446
- /**
447
- *
448
- * v1 < v2 => -1
449
- * v1 === v2 => 0
450
- * v1 > v2 => 1
451
- *
452
- */
453
- function compare(v1, v2) {
454
- const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
455
- const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
456
- for (const level of ["major", "minor", "patch", "rc"]) {
457
- if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
458
- return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
459
- }
460
- }
461
- return 0;
462
- }
463
- SemVer.compare = compare;
464
- /*
465
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
466
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
467
- console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
468
- */
469
- function bumpType(params) {
470
- const versionAhead = typeof params.versionAhead === "string"
471
- ? parse(params.versionAhead)
472
- : params.versionAhead;
473
- const versionBehind = typeof params.versionBehind === "string"
474
- ? parse(params.versionBehind)
475
- : params.versionBehind;
476
- if (compare(versionBehind, versionAhead) === 1) {
477
- throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
478
- }
479
- for (const level of ["major", "minor", "patch", "rc"]) {
480
- if (versionBehind[level] !== versionAhead[level]) {
481
- return level;
482
- }
483
- }
484
- return "no bump";
485
- }
486
- SemVer.bumpType = bumpType;
487
- })(SemVer || (SemVer = {}));
488
- //# sourceMappingURL=SemVer.js.map
489
-
490
- /***/ }),
491
-
492
- /***/ 89693:
493
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
494
-
495
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
496
- /* harmony export */ "a": () => (/* binding */ rmSync)
497
- /* harmony export */ });
498
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
499
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
500
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
501
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
502
- /* harmony import */ var _SemVer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12171);
503
-
504
-
505
-
506
- /**
507
- * Polyfill of fs.rmSync(dirPath, { "recursive": true })
508
- * For older version of Node
509
- */
510
- function rmSync(dirPath, options) {
511
- 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) {
512
- fs__WEBPACK_IMPORTED_MODULE_0__.rmSync(dirPath, options);
513
- return;
514
- }
515
- const { force = true } = options;
516
- if (force && !fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(dirPath)) {
517
- return;
518
- }
519
- const removeDir_rec = (dirPath) => fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(dirPath).forEach(basename => {
520
- const fileOrDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
521
- if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(fileOrDirPath).isDirectory()) {
522
- removeDir_rec(fileOrDirPath);
523
- return;
524
- }
525
- else {
526
- fs__WEBPACK_IMPORTED_MODULE_0__.unlinkSync(fileOrDirPath);
527
- }
528
- });
529
- removeDir_rec(dirPath);
530
- }
531
- //# sourceMappingURL=fs.rmSync.js.map
532
-
533
- /***/ }),
534
-
535
- /***/ 50030:
536
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
537
-
538
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
539
- /* harmony export */ "c": () => (/* binding */ npmInstall)
540
- /* harmony export */ });
541
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
542
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
543
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
544
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
545
- /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(32081);
546
- /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(child_process__WEBPACK_IMPORTED_MODULE_2__);
547
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78818);
548
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_3__);
549
- /* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(52300);
550
- /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29041);
551
- /* harmony import */ var tsafe_id__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(38469);
552
- /* harmony import */ var tsafe_objectKeys__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(23483);
553
- /* harmony import */ var _getAbsoluteAndInOsFormatPath__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(84794);
554
- /* harmony import */ var tsafe_exclude__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(83101);
555
- /* harmony import */ var _fs_rmSync__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(89693);
556
- /* harmony import */ var evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(50689);
557
- /* harmony import */ var evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_7__);
558
-
559
-
560
-
561
-
562
-
563
-
564
-
565
-
566
-
567
-
568
-
569
-
570
- async function npmInstall(params) {
571
- const { packageJsonDirPath } = params;
572
- const packageManagerBinName = (() => {
573
- const packageMangers = [
574
- {
575
- binName: "yarn",
576
- lockFileBasename: "yarn.lock"
577
- },
578
- {
579
- binName: "npm",
580
- lockFileBasename: "package-lock.json"
581
- },
582
- {
583
- binName: "pnpm",
584
- lockFileBasename: "pnpm-lock.yaml"
585
- },
586
- {
587
- binName: "bun",
588
- lockFileBasename: "bun.lockdb"
589
- },
590
- {
591
- binName: "deno",
592
- lockFileBasename: "deno.lock"
593
- }
594
- ];
595
- for (const packageManager of packageMangers) {
596
- if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(packageJsonDirPath, packageManager.lockFileBasename)) ||
597
- fs__WEBPACK_IMPORTED_MODULE_0__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(process.cwd(), packageManager.lockFileBasename))) {
598
- return packageManager.binName;
599
- }
600
- }
601
- throw new Error("No lock file found, cannot tell which package manager to use for installing dependencies.");
602
- })();
603
- console.log(`Installing the new dependencies...`);
604
- install_without_breaking_links: {
605
- if (packageManagerBinName !== "yarn") {
606
- break install_without_breaking_links;
607
- }
608
- const garronejLinkInfos = getGarronejLinkInfos({ packageJsonDirPath });
609
- if (garronejLinkInfos === undefined) {
610
- break install_without_breaking_links;
611
- }
612
- console.log(chalk__WEBPACK_IMPORTED_MODULE_3___default().green("Installing in a way that won't break the links..."));
613
- await installWithoutBreakingLinks({
614
- packageJsonDirPath,
615
- garronejLinkInfos
616
- });
617
- return;
618
- }
619
- try {
620
- await runPackageManagerInstall({
621
- packageManagerBinName,
622
- cwd: packageJsonDirPath
623
- });
624
- }
625
- catch (_a) {
626
- console.log(chalk__WEBPACK_IMPORTED_MODULE_3___default().yellow(`\`${packageManagerBinName} install\` failed, continuing anyway...`));
627
- }
628
- }
629
- async function runPackageManagerInstall(params) {
630
- const { packageManagerBinName, cwd } = params;
631
- const dCompleted = new evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_7__.Deferred();
632
- const child = child_process__WEBPACK_IMPORTED_MODULE_2__.spawn(packageManagerBinName, ["install"], {
633
- cwd,
634
- env: process.env,
635
- shell: true
636
- });
637
- child.stdout.on("data", data => process.stdout.write(data));
638
- child.stderr.on("data", data => {
639
- if (data.toString("utf8").includes("has unmet peer dependency")) {
640
- return;
641
- }
642
- process.stderr.write(data);
643
- });
644
- child.on("exit", code => {
645
- if (code !== 0) {
646
- dCompleted.reject(new Error(`Failed with code ${code}`));
647
- return;
648
- }
649
- dCompleted.resolve();
650
- });
651
- await dCompleted.pr;
652
- }
653
- function getGarronejLinkInfos(params) {
654
- const { packageJsonDirPath } = params;
655
- const nodeModuleDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(packageJsonDirPath, "node_modules");
656
- if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(nodeModuleDirPath)) {
657
- return undefined;
658
- }
659
- const linkedModuleNames = [];
660
- let yarnHomeDirPath = undefined;
661
- const getIsLinkedByGarronejScript = (path) => {
662
- let realPath;
663
- try {
664
- realPath = fs__WEBPACK_IMPORTED_MODULE_0__.readlinkSync(path);
665
- }
666
- catch (_a) {
667
- return false;
668
- }
669
- const doesIncludeYarnHome = realPath.includes(".yarn_home");
670
- if (!doesIncludeYarnHome) {
671
- return false;
672
- }
673
- set_yarnHomeDirPath: {
674
- if (yarnHomeDirPath !== undefined) {
675
- break set_yarnHomeDirPath;
676
- }
677
- const [firstElement] = (0,_getAbsoluteAndInOsFormatPath__WEBPACK_IMPORTED_MODULE_5__/* .getAbsoluteAndInOsFormatPath */ .c)({
678
- pathIsh: realPath,
679
- cwd: (0,path__WEBPACK_IMPORTED_MODULE_1__.dirname)(path)
680
- }).split(".yarn_home");
681
- yarnHomeDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(firstElement, ".yarn_home");
682
- }
683
- return true;
684
- };
685
- for (const basename of fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(nodeModuleDirPath)) {
686
- const path = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModuleDirPath, basename);
687
- if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(path).isSymbolicLink()) {
688
- if (basename.startsWith("@")) {
689
- return undefined;
690
- }
691
- if (!getIsLinkedByGarronejScript(path)) {
692
- return undefined;
693
- }
694
- linkedModuleNames.push(basename);
695
- continue;
696
- }
697
- if (!fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(path).isDirectory()) {
698
- continue;
699
- }
700
- if (basename.startsWith("@")) {
701
- for (const subBasename of fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(path)) {
702
- const subPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(path, subBasename);
703
- if (!fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(subPath).isSymbolicLink()) {
704
- continue;
705
- }
706
- if (!getIsLinkedByGarronejScript(subPath)) {
707
- return undefined;
708
- }
709
- linkedModuleNames.push(`${basename}/${subBasename}`);
710
- }
711
- }
712
- }
713
- if (yarnHomeDirPath === undefined) {
714
- return undefined;
715
- }
716
- return { linkedModuleNames, yarnHomeDirPath };
717
- }
718
- async function installWithoutBreakingLinks(params) {
719
- const { packageJsonDirPath, garronejLinkInfos: { linkedModuleNames, yarnHomeDirPath } } = params;
720
- const parsedPackageJson = (() => {
721
- const packageJsonFilePath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(packageJsonDirPath, "package.json");
722
- const zParsedPackageJson = (() => {
723
- const zTargetType = zod__WEBPACK_IMPORTED_MODULE_8__.z.object({
724
- scripts: zod__WEBPACK_IMPORTED_MODULE_8__.z.record(zod__WEBPACK_IMPORTED_MODULE_8__.z.string()).optional()
725
- });
726
- tsafe_assert__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .h;
727
- return (0,tsafe_id__WEBPACK_IMPORTED_MODULE_9__.id)(zTargetType);
728
- })();
729
- const parsedPackageJson = JSON.parse(fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(packageJsonFilePath).toString("utf8"));
730
- zParsedPackageJson.parse(parsedPackageJson);
731
- (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .h)((0,tsafe_assert__WEBPACK_IMPORTED_MODULE_4__.is)(parsedPackageJson));
732
- return parsedPackageJson;
733
- })();
734
- const isImplementedScriptByName = {
735
- postinstall: false,
736
- prepare: false
737
- };
738
- delete_postinstall_script: {
739
- if (parsedPackageJson.scripts === undefined) {
740
- break delete_postinstall_script;
741
- }
742
- for (const scriptName of (0,tsafe_objectKeys__WEBPACK_IMPORTED_MODULE_10__/* .objectKeys */ .Y)(isImplementedScriptByName)) {
743
- if (parsedPackageJson.scripts[scriptName] === undefined) {
744
- continue;
745
- }
746
- isImplementedScriptByName[scriptName] = true;
747
- delete parsedPackageJson.scripts[scriptName];
748
- }
749
- }
750
- const tmpProjectDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(yarnHomeDirPath, "tmpProject");
751
- if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(tmpProjectDirPath)) {
752
- (0,_fs_rmSync__WEBPACK_IMPORTED_MODULE_6__/* .rmSync */ .a)(tmpProjectDirPath, { recursive: true });
753
- }
754
- fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(tmpProjectDirPath, { recursive: true });
755
- fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(tmpProjectDirPath, "package.json"), JSON.stringify(parsedPackageJson, undefined, 4));
756
- const YARN_LOCK = "yarn.lock";
757
- fs__WEBPACK_IMPORTED_MODULE_0__.copyFileSync((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(packageJsonDirPath, YARN_LOCK), (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(tmpProjectDirPath, YARN_LOCK));
758
- await runPackageManagerInstall({
759
- packageManagerBinName: "yarn",
760
- cwd: tmpProjectDirPath
761
- });
762
- // NOTE: Moving the modules from the tmp project to the actual project
763
- // without messing up the links.
764
- {
765
- const { getAreSameVersions } = (() => {
766
- const zParsedPackageJson = (() => {
767
- const zTargetType = zod__WEBPACK_IMPORTED_MODULE_8__.z.object({
768
- version: zod__WEBPACK_IMPORTED_MODULE_8__.z.string()
769
- });
770
- tsafe_assert__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .h;
771
- return (0,tsafe_id__WEBPACK_IMPORTED_MODULE_9__.id)(zTargetType);
772
- })();
773
- function readVersion(params) {
774
- const { moduleDirPath } = params;
775
- const packageJsonFilePath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(moduleDirPath, "package.json");
776
- const packageJson = JSON.parse(fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(packageJsonFilePath).toString("utf8"));
777
- zParsedPackageJson.parse(packageJson);
778
- (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_4__/* .assert */ .h)((0,tsafe_assert__WEBPACK_IMPORTED_MODULE_4__.is)(packageJson));
779
- return packageJson.version;
780
- }
781
- function getAreSameVersions(params) {
782
- const { moduleDirPath_a, moduleDirPath_b } = params;
783
- return (readVersion({ moduleDirPath: moduleDirPath_a }) ===
784
- readVersion({ moduleDirPath: moduleDirPath_b }));
785
- }
786
- return { getAreSameVersions };
787
- })();
788
- const nodeModulesDirPath_tmpProject = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(tmpProjectDirPath, "node_modules");
789
- const nodeModulesDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(packageJsonDirPath, "node_modules");
790
- const modulePaths = fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(nodeModulesDirPath_tmpProject)
791
- .map(basename => {
792
- if (basename.startsWith(".")) {
793
- return undefined;
794
- }
795
- const path = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModulesDirPath_tmpProject, basename);
796
- if (basename.startsWith("@")) {
797
- return fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(path)
798
- .map(subBasename => {
799
- if (subBasename.startsWith(".")) {
800
- return undefined;
801
- }
802
- const subPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(path, subBasename);
803
- if (!fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(subPath).isDirectory()) {
804
- return undefined;
805
- }
806
- return {
807
- moduleName: `${basename}/${subBasename}`,
808
- moduleDirPath_tmpProject: subPath,
809
- moduleDirPath: (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModulesDirPath, basename, subBasename)
810
- };
811
- })
812
- .filter((0,tsafe_exclude__WEBPACK_IMPORTED_MODULE_11__/* .exclude */ .D)(undefined));
813
- }
814
- if (!fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(path).isDirectory()) {
815
- return undefined;
816
- }
817
- return [
818
- {
819
- moduleName: basename,
820
- moduleDirPath_tmpProject: path,
821
- moduleDirPath: (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModulesDirPath, basename)
822
- }
823
- ];
824
- })
825
- .filter((0,tsafe_exclude__WEBPACK_IMPORTED_MODULE_11__/* .exclude */ .D)(undefined))
826
- .flat();
827
- for (const { moduleName, moduleDirPath, moduleDirPath_tmpProject } of modulePaths) {
828
- if (linkedModuleNames.includes(moduleName)) {
829
- continue;
830
- }
831
- let doesTargetModuleExist = false;
832
- skip_condition: {
833
- if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(moduleDirPath)) {
834
- break skip_condition;
835
- }
836
- doesTargetModuleExist = true;
837
- const areSameVersions = getAreSameVersions({
838
- moduleDirPath_a: moduleDirPath,
839
- moduleDirPath_b: moduleDirPath_tmpProject
840
- });
841
- if (!areSameVersions) {
842
- break skip_condition;
843
- }
844
- continue;
845
- }
846
- if (doesTargetModuleExist) {
847
- (0,_fs_rmSync__WEBPACK_IMPORTED_MODULE_6__/* .rmSync */ .a)(moduleDirPath, { recursive: true });
848
- }
849
- {
850
- const dirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.dirname)(moduleDirPath);
851
- if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(dirPath)) {
852
- fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(dirPath, { recursive: true });
853
- }
854
- }
855
- fs__WEBPACK_IMPORTED_MODULE_0__.renameSync(moduleDirPath_tmpProject, moduleDirPath);
856
- }
857
- move_bin: {
858
- const binDirPath_tmpProject = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModulesDirPath_tmpProject, ".bin");
859
- const binDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(nodeModulesDirPath, ".bin");
860
- if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(binDirPath_tmpProject)) {
861
- break move_bin;
862
- }
863
- for (const basename of fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(binDirPath_tmpProject)) {
864
- const path_tmpProject = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(binDirPath_tmpProject, basename);
865
- const path = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(binDirPath, basename);
866
- if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(path)) {
867
- continue;
868
- }
869
- fs__WEBPACK_IMPORTED_MODULE_0__.renameSync(path_tmpProject, path);
870
- }
871
- }
872
- }
873
- fs__WEBPACK_IMPORTED_MODULE_0__.cpSync((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(tmpProjectDirPath, YARN_LOCK), (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(packageJsonDirPath, YARN_LOCK));
874
- (0,_fs_rmSync__WEBPACK_IMPORTED_MODULE_6__/* .rmSync */ .a)(tmpProjectDirPath, { recursive: true });
875
- for (const scriptName of (0,tsafe_objectKeys__WEBPACK_IMPORTED_MODULE_10__/* .objectKeys */ .Y)(isImplementedScriptByName)) {
876
- if (!isImplementedScriptByName[scriptName]) {
877
- continue;
878
- }
879
- child_process__WEBPACK_IMPORTED_MODULE_2__.execSync(`yarn run ${scriptName}`, {
880
- cwd: packageJsonDirPath,
881
- stdio: "inherit"
882
- });
883
- }
884
- }
885
- //# sourceMappingURL=npmInstall.js.map
886
-
887
- /***/ }),
888
-
889
- /***/ 23483:
890
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
891
-
892
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
893
- /* harmony export */ "Y": () => (/* binding */ objectKeys)
894
- /* harmony export */ });
895
- /** https://docs.tsafe.dev/objectKeys */
896
- function objectKeys(o) {
897
- return Object.keys(o);
898
- }
899
-
900
-
901
- //# sourceMappingURL=objectKeys.mjs.map
902
-
903
-
904
- /***/ })
905
-
906
- };
907
- ;