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/490.index.js DELETED
@@ -1,1108 +0,0 @@
1
- "use strict";
2
- exports.id = 490;
3
- exports.ids = [490];
4
- exports.modules = {
5
-
6
- /***/ 23490:
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": () => (/* binding */ command)
15
- });
16
-
17
- // EXTERNAL MODULE: external "path"
18
- var external_path_ = __webpack_require__(71017);
19
- // EXTERNAL MODULE: ./dist/bin/tools/transformCodebase.js
20
- var transformCodebase = __webpack_require__(60332);
21
- // EXTERNAL MODULE: ./dist/bin/shared/getLatestsSemVersionedTag.js + 2 modules
22
- var getLatestsSemVersionedTag = __webpack_require__(97189);
23
- // EXTERNAL MODULE: ./node_modules/cli-select/dist/index.js
24
- var dist = __webpack_require__(99398);
25
- var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
26
- // EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
27
- var assert = __webpack_require__(29041);
28
- // EXTERNAL MODULE: ./dist/bin/tools/SemVer.js
29
- var SemVer = __webpack_require__(12171);
30
- ;// CONCATENATED MODULE: ./dist/bin/shared/promptKeycloakVersion.js
31
-
32
-
33
-
34
-
35
- (0,assert/* assert */.h)();
36
- async function promptKeycloakVersion(params) {
37
- const { startingFromMajor, excludeMajorVersions, doOmitPatch, buildContext } = params;
38
- const semVersionedTagByMajor = new Map();
39
- const semVersionedTags = await (0,getLatestsSemVersionedTag/* getLatestsSemVersionedTag */._)({
40
- count: 50,
41
- owner: "keycloak",
42
- repo: "keycloak",
43
- doIgnoreReleaseCandidates: true,
44
- buildContext
45
- });
46
- semVersionedTags.forEach(semVersionedTag => {
47
- if (startingFromMajor !== undefined &&
48
- semVersionedTag.version.major < startingFromMajor) {
49
- return;
50
- }
51
- if (excludeMajorVersions.includes(semVersionedTag.version.major)) {
52
- return;
53
- }
54
- const currentSemVersionedTag = semVersionedTagByMajor.get(semVersionedTag.version.major);
55
- if (currentSemVersionedTag !== undefined &&
56
- SemVer/* SemVer.compare */.h.compare(semVersionedTag.version, currentSemVersionedTag.version) === -1) {
57
- return;
58
- }
59
- semVersionedTagByMajor.set(semVersionedTag.version.major, semVersionedTag);
60
- });
61
- const lastMajorVersions = Array.from(semVersionedTagByMajor.values()).map(({ version }) => `${version.major}.${version.minor}${doOmitPatch ? "" : `.${version.patch}`}`);
62
- const { value } = await dist_default()({
63
- values: lastMajorVersions
64
- }).catch(() => {
65
- process.exit(-1);
66
- });
67
- const keycloakVersion = value.split(" ")[0];
68
- return { keycloakVersion };
69
- }
70
- //# sourceMappingURL=promptKeycloakVersion.js.map
71
- // EXTERNAL MODULE: external "fs"
72
- var external_fs_ = __webpack_require__(57147);
73
- // EXTERNAL MODULE: ./dist/bin/tools/downloadAndExtractArchive.js
74
- var downloadAndExtractArchive = __webpack_require__(38367);
75
- // EXTERNAL MODULE: ./dist/bin/shared/customHandler_delegate.js + 1 modules
76
- var customHandler_delegate = __webpack_require__(72138);
77
- // EXTERNAL MODULE: ./node_modules/make-fetch-happen/lib/index.js
78
- var lib = __webpack_require__(9525);
79
- var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
80
- ;// CONCATENATED MODULE: ./dist/bin/initialize-email-theme.js
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
- async function command(params) {
91
- const { buildContext } = params;
92
- const { hasBeenHandled } = (0,customHandler_delegate/* maybeDelegateCommandToCustomHandler */.q)({
93
- commandName: "initialize-email-theme",
94
- buildContext
95
- });
96
- if (hasBeenHandled) {
97
- return;
98
- }
99
- const emailThemeSrcDirPath = (0,external_path_.join)(buildContext.themeSrcDirPath, "email");
100
- if (external_fs_.existsSync(emailThemeSrcDirPath) &&
101
- external_fs_.readdirSync(emailThemeSrcDirPath).length > 0) {
102
- console.warn(`There is already a non empty ${(0,external_path_.relative)(process.cwd(), emailThemeSrcDirPath)} directory in your project. Aborting.`);
103
- process.exit(-1);
104
- }
105
- console.log("Initialize with the base email theme from which version of Keycloak?");
106
- let { keycloakVersion } = await promptKeycloakVersion({
107
- // NOTE: This is arbitrary
108
- startingFromMajor: 17,
109
- excludeMajorVersions: [],
110
- doOmitPatch: false,
111
- buildContext
112
- });
113
- const getUrl = (keycloakVersion) => {
114
- return `https://repo1.maven.org/maven2/org/keycloak/keycloak-themes/${keycloakVersion}/keycloak-themes-${keycloakVersion}.jar`;
115
- };
116
- keycloakVersion = await (async () => {
117
- const keycloakVersionParsed = SemVer/* SemVer.parse */.h.parse(keycloakVersion);
118
- while (true) {
119
- const url = getUrl(SemVer/* SemVer.stringify */.h.stringify(keycloakVersionParsed));
120
- const response = await lib_default()(url, buildContext.fetchOptions);
121
- if (response.ok) {
122
- break;
123
- }
124
- (0,assert/* assert */.h)(keycloakVersionParsed.patch !== 0);
125
- keycloakVersionParsed.patch--;
126
- }
127
- return SemVer/* SemVer.stringify */.h.stringify(keycloakVersionParsed);
128
- })();
129
- const { extractedDirPath } = await (0,downloadAndExtractArchive/* downloadAndExtractArchive */.I)({
130
- url: getUrl(keycloakVersion),
131
- cacheDirPath: buildContext.cacheDirPath,
132
- fetchOptions: buildContext.fetchOptions,
133
- uniqueIdOfOnArchiveFile: "extractOnlyEmailTheme",
134
- onArchiveFile: async ({ fileRelativePath, writeFile }) => {
135
- const fileRelativePath_target = (0,external_path_.relative)((0,external_path_.join)("theme", "base", "email"), fileRelativePath);
136
- if (fileRelativePath_target.startsWith("..")) {
137
- return;
138
- }
139
- await writeFile({ fileRelativePath: fileRelativePath_target });
140
- }
141
- });
142
- (0,transformCodebase/* transformCodebase */.N)({
143
- srcDirPath: extractedDirPath,
144
- destDirPath: emailThemeSrcDirPath
145
- });
146
- {
147
- const themePropertyFilePath = (0,external_path_.join)(emailThemeSrcDirPath, "theme.properties");
148
- external_fs_.writeFileSync(themePropertyFilePath, Buffer.from([
149
- `parent=base`,
150
- external_fs_.readFileSync(themePropertyFilePath).toString("utf8")
151
- ].join("\n"), "utf8"));
152
- }
153
- console.log(`The \`${(0,external_path_.join)(".", (0,external_path_.relative)(process.cwd(), emailThemeSrcDirPath))}\` directory have been created.`);
154
- console.log("You can delete any file you don't modify.");
155
- }
156
- //# sourceMappingURL=initialize-email-theme.js.map
157
-
158
- /***/ }),
159
-
160
- /***/ 72138:
161
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
162
-
163
-
164
- // EXPORTS
165
- __webpack_require__.d(__webpack_exports__, {
166
- "q": () => (/* binding */ maybeDelegateCommandToCustomHandler)
167
- });
168
-
169
- // EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
170
- var esm_assert = __webpack_require__(29041);
171
- // EXTERNAL MODULE: ./dist/bin/shared/constants.js
172
- var constants = __webpack_require__(173);
173
- ;// CONCATENATED MODULE: ./dist/bin/shared/customHandler.js
174
-
175
-
176
- const BIN_NAME = "_keycloakify-custom-handler";
177
- const NOT_IMPLEMENTED_EXIT_CODE = 78;
178
- function readParams(params) {
179
- const { apiVersion } = params;
180
- assert(apiVersion === "v1");
181
- const commandName = (() => {
182
- const envValue = process.env[CUSTOM_HANDLER_ENV_NAMES.COMMAND_NAME];
183
- assert(envValue !== undefined);
184
- return envValue;
185
- })();
186
- const buildContext = (() => {
187
- const envValue = process.env[CUSTOM_HANDLER_ENV_NAMES.BUILD_CONTEXT];
188
- assert(envValue !== undefined);
189
- return JSON.parse(envValue);
190
- })();
191
- return { commandName, buildContext };
192
- }
193
- //# sourceMappingURL=customHandler.js.map
194
- // EXTERNAL MODULE: external "child_process"
195
- var external_child_process_ = __webpack_require__(32081);
196
- // EXTERNAL MODULE: ./dist/bin/tools/nodeModulesBinDirPath.js
197
- var tools_nodeModulesBinDirPath = __webpack_require__(73776);
198
- // EXTERNAL MODULE: external "fs"
199
- var external_fs_ = __webpack_require__(57147);
200
- ;// CONCATENATED MODULE: ./dist/bin/shared/customHandler_delegate.js
201
-
202
-
203
-
204
-
205
-
206
-
207
- (0,esm_assert/* assert */.h)();
208
- function maybeDelegateCommandToCustomHandler(params) {
209
- const { commandName, buildContext } = params;
210
- const nodeModulesBinDirPath = (0,tools_nodeModulesBinDirPath/* getNodeModulesBinDirPath */.K)();
211
- if (!external_fs_.readdirSync(nodeModulesBinDirPath).includes(BIN_NAME)) {
212
- return { hasBeenHandled: false };
213
- }
214
- try {
215
- external_child_process_.execSync(`npx ${BIN_NAME}`, {
216
- stdio: "inherit",
217
- env: Object.assign(Object.assign({}, process.env), { [constants/* CUSTOM_HANDLER_ENV_NAMES.COMMAND_NAME */._S.COMMAND_NAME]: commandName, [constants/* CUSTOM_HANDLER_ENV_NAMES.BUILD_CONTEXT */._S.BUILD_CONTEXT]: JSON.stringify(buildContext) })
218
- });
219
- }
220
- catch (error) {
221
- const status = error.status;
222
- if (status === NOT_IMPLEMENTED_EXIT_CODE) {
223
- return { hasBeenHandled: false };
224
- }
225
- process.exit(status);
226
- }
227
- return { hasBeenHandled: true };
228
- }
229
- //# sourceMappingURL=customHandler_delegate.js.map
230
-
231
- /***/ }),
232
-
233
- /***/ 97189:
234
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
235
-
236
-
237
- // EXPORTS
238
- __webpack_require__.d(__webpack_exports__, {
239
- "_": () => (/* binding */ getLatestsSemVersionedTag)
240
- });
241
-
242
- ;// CONCATENATED MODULE: ./dist/bin/tools/octokit-addons/listTags.js
243
- var __await = (undefined && undefined.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
244
- var __asyncGenerator = (undefined && undefined.__asyncGenerator) || function (thisArg, _arguments, generator) {
245
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
246
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
247
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
248
- 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); }); }; }
249
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
250
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
251
- function fulfill(value) { resume("next", value); }
252
- function reject(value) { resume("throw", value); }
253
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
254
- };
255
- const per_page = 99;
256
- function listTagsFactory(params) {
257
- const { octokit } = params;
258
- const octokit_repo_listTags = async (params) => {
259
- return octokit.repos.listTags(params);
260
- };
261
- function listTags(params) {
262
- return __asyncGenerator(this, arguments, function* listTags_1() {
263
- const { owner, repo } = params;
264
- let page = 1;
265
- while (true) {
266
- const resp = yield __await(octokit_repo_listTags({
267
- owner,
268
- repo,
269
- per_page,
270
- page: page++
271
- }));
272
- for (const branch of resp.data.map(({ name }) => name)) {
273
- yield yield __await(branch);
274
- }
275
- if (resp.data.length < 99) {
276
- break;
277
- }
278
- }
279
- });
280
- }
281
- /** Returns the same "latest" tag as deno.land/x, not actually the latest though */
282
- async function getLatestTag(params) {
283
- const { owner, repo } = params;
284
- const itRes = await listTags({ owner, repo }).next();
285
- if (itRes.done) {
286
- return undefined;
287
- }
288
- return itRes.value;
289
- }
290
- return { listTags, getLatestTag };
291
- }
292
- //# sourceMappingURL=listTags.js.map
293
- // EXTERNAL MODULE: ./dist/bin/tools/SemVer.js
294
- var SemVer = __webpack_require__(12171);
295
- ;// CONCATENATED MODULE: ./dist/bin/tools/octokit-addons/getLatestsSemVersionedTag.js
296
- var __asyncValues = (undefined && undefined.__asyncValues) || function (o) {
297
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
298
- var m = o[Symbol.asyncIterator], i;
299
- 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);
300
- 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); }); }; }
301
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
302
- };
303
-
304
-
305
- function getLatestsSemVersionedTagFactory(params) {
306
- const { octokit } = params;
307
- async function getLatestsSemVersionedTag(params) {
308
- var _a, e_1, _b, _c;
309
- const { owner, repo, count, doIgnoreReleaseCandidates } = params;
310
- const semVersionedTags = [];
311
- const { listTags } = listTagsFactory({ octokit });
312
- try {
313
- for (var _d = true, _e = __asyncValues(listTags({ owner, repo })), _f; _f = await _e.next(), _a = _f.done, !_a;) {
314
- _c = _f.value;
315
- _d = false;
316
- try {
317
- const tag = _c;
318
- let version;
319
- try {
320
- version = SemVer/* SemVer.parse */.h.parse(tag.replace(/^[vV]?/, ""));
321
- }
322
- catch (_g) {
323
- continue;
324
- }
325
- if (doIgnoreReleaseCandidates && version.rc !== undefined) {
326
- continue;
327
- }
328
- semVersionedTags.push({ tag, version });
329
- }
330
- finally {
331
- _d = true;
332
- }
333
- }
334
- }
335
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
336
- finally {
337
- try {
338
- if (!_d && !_a && (_b = _e.return)) await _b.call(_e);
339
- }
340
- finally { if (e_1) throw e_1.error; }
341
- }
342
- return semVersionedTags
343
- .sort(({ version: vX }, { version: vY }) => SemVer/* SemVer.compare */.h.compare(vY, vX))
344
- .slice(0, count);
345
- }
346
- return { getLatestsSemVersionedTag };
347
- }
348
- //# sourceMappingURL=getLatestsSemVersionedTag.js.map
349
- // EXTERNAL MODULE: ./node_modules/@octokit/rest/dist-node/index.js
350
- var dist_node = __webpack_require__(55375);
351
- // EXTERNAL MODULE: external "path"
352
- var external_path_ = __webpack_require__(71017);
353
- // EXTERNAL MODULE: external "fs"
354
- var external_fs_ = __webpack_require__(57147);
355
- // EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
356
- var lib = __webpack_require__(52300);
357
- // EXTERNAL MODULE: ./node_modules/tsafe/esm/assert.mjs + 1 modules
358
- var assert = __webpack_require__(29041);
359
- // EXTERNAL MODULE: ./node_modules/tsafe/esm/id.mjs
360
- var id = __webpack_require__(38469);
361
- // EXTERNAL MODULE: ./node_modules/evt/tools/inDepth/same.js
362
- var same = __webpack_require__(33805);
363
- // EXTERNAL MODULE: ./node_modules/make-fetch-happen/lib/index.js
364
- var make_fetch_happen_lib = __webpack_require__(9525);
365
- var lib_default = /*#__PURE__*/__webpack_require__.n(make_fetch_happen_lib);
366
- ;// CONCATENATED MODULE: ./dist/bin/shared/getLatestsSemVersionedTag.js
367
- var __rest = (undefined && undefined.__rest) || function (s, e) {
368
- var t = {};
369
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
370
- t[p] = s[p];
371
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
372
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
373
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
374
- t[p[i]] = s[p[i]];
375
- }
376
- return t;
377
- };
378
-
379
-
380
-
381
-
382
-
383
-
384
-
385
-
386
-
387
- let getLatestsSemVersionedTag_stateless = undefined;
388
- const CACHE_VERSION = 1;
389
- (0,assert/* assert */.h)();
390
- async function getLatestsSemVersionedTag(_a) {
391
- var { buildContext } = _a, params = __rest(_a, ["buildContext"]);
392
- const cacheFilePath = (0,external_path_.join)(buildContext.cacheDirPath, "latest-sem-versioned-tags.json");
393
- const cacheLookupResult = (() => {
394
- const getResult_currentCache = (currentCacheEntries) => ({
395
- hasCachedResult: false,
396
- currentCache: {
397
- version: CACHE_VERSION,
398
- entries: currentCacheEntries
399
- }
400
- });
401
- if (!external_fs_.existsSync(cacheFilePath)) {
402
- return getResult_currentCache([]);
403
- }
404
- let cache_json;
405
- try {
406
- cache_json = external_fs_.readFileSync(cacheFilePath).toString("utf8");
407
- }
408
- catch (_a) {
409
- return getResult_currentCache([]);
410
- }
411
- let cache_json_parsed;
412
- try {
413
- cache_json_parsed = JSON.parse(cache_json);
414
- }
415
- catch (_b) {
416
- return getResult_currentCache([]);
417
- }
418
- const zSemVer = (() => {
419
- const zTargetType = lib.z.object({
420
- major: lib.z.number(),
421
- minor: lib.z.number(),
422
- patch: lib.z.number(),
423
- rc: lib.z.number().optional(),
424
- parsedFrom: lib.z.string()
425
- });
426
- (0,assert/* assert */.h)();
427
- return (0,id.id)(zTargetType);
428
- })();
429
- const zCache = (() => {
430
- const zTargetType = lib.z.object({
431
- version: lib.z.literal(CACHE_VERSION),
432
- entries: lib.z.array(lib.z.object({
433
- time: lib.z.number(),
434
- params: lib.z.object({
435
- owner: lib.z.string(),
436
- repo: lib.z.string(),
437
- count: lib.z.number(),
438
- doIgnoreReleaseCandidates: lib.z.boolean()
439
- }),
440
- result: lib.z.array(lib.z.object({
441
- tag: lib.z.string(),
442
- version: zSemVer
443
- }))
444
- }))
445
- });
446
- (0,assert/* assert */.h)();
447
- return (0,id.id)(zTargetType);
448
- })();
449
- let cache;
450
- try {
451
- cache = zCache.parse(cache_json_parsed);
452
- }
453
- catch (_c) {
454
- return getResult_currentCache([]);
455
- }
456
- const cacheEntry = cache.entries.find(e => (0,same.same)(e.params, params));
457
- if (cacheEntry === undefined) {
458
- return getResult_currentCache(cache.entries);
459
- }
460
- if (Date.now() - cacheEntry.time > 3600000) {
461
- return getResult_currentCache(cache.entries.filter(e => e !== cacheEntry));
462
- }
463
- return {
464
- hasCachedResult: true,
465
- cachedResult: cacheEntry.result
466
- };
467
- })();
468
- if (cacheLookupResult.hasCachedResult) {
469
- return cacheLookupResult.cachedResult;
470
- }
471
- const { currentCache } = cacheLookupResult;
472
- getLatestsSemVersionedTag_stateless !== null && getLatestsSemVersionedTag_stateless !== void 0 ? getLatestsSemVersionedTag_stateless : (getLatestsSemVersionedTag_stateless = (() => {
473
- const octokit = (() => {
474
- const githubToken = process.env.GITHUB_TOKEN;
475
- const octokit = new dist_node.Octokit(Object.assign(Object.assign({}, (githubToken === undefined ? {} : { auth: githubToken })), { request: {
476
- fetch: (url, options) => lib_default()(url, Object.assign(Object.assign({}, options), buildContext.fetchOptions))
477
- } }));
478
- return octokit;
479
- })();
480
- const { getLatestsSemVersionedTag } = getLatestsSemVersionedTagFactory({
481
- octokit
482
- });
483
- return getLatestsSemVersionedTag;
484
- })());
485
- const result = await getLatestsSemVersionedTag_stateless(params);
486
- currentCache.entries.push({
487
- time: Date.now(),
488
- params,
489
- result
490
- });
491
- {
492
- const dirPath = (0,external_path_.dirname)(cacheFilePath);
493
- if (!external_fs_.existsSync(dirPath)) {
494
- external_fs_.mkdirSync(dirPath, { recursive: true });
495
- }
496
- }
497
- external_fs_.writeFileSync(cacheFilePath, JSON.stringify(currentCache, null, 2));
498
- return result;
499
- }
500
- //# sourceMappingURL=getLatestsSemVersionedTag.js.map
501
-
502
- /***/ }),
503
-
504
- /***/ 12171:
505
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
506
-
507
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
508
- /* harmony export */ "h": () => (/* binding */ SemVer)
509
- /* harmony export */ });
510
- var SemVer;
511
- (function (SemVer) {
512
- const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
513
- function parse(versionStr) {
514
- const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
515
- if (!match) {
516
- throw new Error(`${versionStr} is not a valid semantic version`);
517
- }
518
- const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
519
- const str = match[3];
520
- return str === undefined ? 0 : parseInt(str);
521
- })() }, (() => {
522
- const str = match[4];
523
- return str === undefined ? {} : { rc: parseInt(str) };
524
- })());
525
- const initialStr = stringify(semVer);
526
- Object.defineProperty(semVer, "parsedFrom", {
527
- enumerable: true,
528
- get: function () {
529
- const currentStr = stringify(this);
530
- if (currentStr !== initialStr) {
531
- throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
532
- }
533
- return versionStr;
534
- }
535
- });
536
- return semVer;
537
- }
538
- SemVer.parse = parse;
539
- function stringify(v) {
540
- return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
541
- }
542
- SemVer.stringify = stringify;
543
- /**
544
- *
545
- * v1 < v2 => -1
546
- * v1 === v2 => 0
547
- * v1 > v2 => 1
548
- *
549
- */
550
- function compare(v1, v2) {
551
- const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
552
- const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
553
- for (const level of ["major", "minor", "patch", "rc"]) {
554
- if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
555
- return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
556
- }
557
- }
558
- return 0;
559
- }
560
- SemVer.compare = compare;
561
- /*
562
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
563
- console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
564
- console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
565
- */
566
- function bumpType(params) {
567
- const versionAhead = typeof params.versionAhead === "string"
568
- ? parse(params.versionAhead)
569
- : params.versionAhead;
570
- const versionBehind = typeof params.versionBehind === "string"
571
- ? parse(params.versionBehind)
572
- : params.versionBehind;
573
- if (compare(versionBehind, versionAhead) === 1) {
574
- throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
575
- }
576
- for (const level of ["major", "minor", "patch", "rc"]) {
577
- if (versionBehind[level] !== versionAhead[level]) {
578
- return level;
579
- }
580
- }
581
- return "no bump";
582
- }
583
- SemVer.bumpType = bumpType;
584
- })(SemVer || (SemVer = {}));
585
- //# sourceMappingURL=SemVer.js.map
586
-
587
- /***/ }),
588
-
589
- /***/ 38367:
590
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
591
-
592
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
593
- /* harmony export */ "I": () => (/* binding */ downloadAndExtractArchive)
594
- /* harmony export */ });
595
- /* harmony import */ var make_fetch_happen__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9525);
596
- /* harmony import */ var make_fetch_happen__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(make_fetch_happen__WEBPACK_IMPORTED_MODULE_0__);
597
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73292);
598
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_1__);
599
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(71017);
600
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
601
- /* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29041);
602
- /* harmony import */ var _extractArchive__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29121);
603
- /* harmony import */ var _fs_existsAsync__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(43765);
604
- /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(6113);
605
- /* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_6__);
606
- /* harmony import */ var _fs_rm__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8699);
607
-
608
-
609
-
610
-
611
-
612
-
613
-
614
-
615
- async function downloadAndExtractArchive(params) {
616
- var _a;
617
- const { url, uniqueIdOfOnArchiveFile, onArchiveFile, cacheDirPath, fetchOptions } = params;
618
- const archiveFileBasename = url.split("?")[0].split("/").reverse()[0];
619
- const archiveFilePath = (0,path__WEBPACK_IMPORTED_MODULE_2__.join)(cacheDirPath, archiveFileBasename);
620
- download: {
621
- await (0,fs_promises__WEBPACK_IMPORTED_MODULE_1__.mkdir)((0,path__WEBPACK_IMPORTED_MODULE_2__.dirname)(archiveFilePath), { recursive: true });
622
- if (await (0,_fs_existsAsync__WEBPACK_IMPORTED_MODULE_5__/* .existsAsync */ .o)(archiveFilePath)) {
623
- const isDownloaded = await SuccessTracker.getIsDownloaded({
624
- cacheDirPath,
625
- archiveFileBasename
626
- });
627
- if (isDownloaded) {
628
- break download;
629
- }
630
- await (0,fs_promises__WEBPACK_IMPORTED_MODULE_1__.unlink)(archiveFilePath);
631
- await SuccessTracker.removeFromDownloaded({
632
- cacheDirPath,
633
- archiveFileBasename
634
- });
635
- }
636
- const response = await make_fetch_happen__WEBPACK_IMPORTED_MODULE_0___default()(url, fetchOptions);
637
- (_a = response.body) === null || _a === void 0 ? void 0 : _a.setMaxListeners(Number.MAX_VALUE);
638
- (0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__/* .assert */ .h)(typeof response.body !== "undefined" && response.body != null);
639
- await (0,fs_promises__WEBPACK_IMPORTED_MODULE_1__.writeFile)(archiveFilePath, response.body);
640
- await SuccessTracker.markAsDownloaded({
641
- cacheDirPath,
642
- archiveFileBasename
643
- });
644
- }
645
- const extractDirBasename = `${archiveFileBasename.replace(/\.([^.]+)$/, (...[, ext]) => `_${ext}`)}_${uniqueIdOfOnArchiveFile}_${crypto__WEBPACK_IMPORTED_MODULE_6__.createHash("sha256")
646
- .update(onArchiveFile.toString())
647
- .digest("hex")
648
- .substring(0, 5)}`;
649
- await Promise.all((await (0,fs_promises__WEBPACK_IMPORTED_MODULE_1__.readdir)(cacheDirPath))
650
- .filter((() => {
651
- const prefix = extractDirBasename
652
- .split("_")
653
- .reverse()
654
- .slice(1)
655
- .reverse()
656
- .join("_");
657
- return basename => basename !== extractDirBasename && basename.startsWith(prefix);
658
- })())
659
- .map(async (extractDirBasename) => {
660
- await (0,_fs_rm__WEBPACK_IMPORTED_MODULE_7__.rm)((0,path__WEBPACK_IMPORTED_MODULE_2__.join)(cacheDirPath, extractDirBasename), {
661
- recursive: true
662
- });
663
- await SuccessTracker.removeFromExtracted({
664
- cacheDirPath,
665
- extractDirBasename
666
- });
667
- }));
668
- const extractedDirPath = (0,path__WEBPACK_IMPORTED_MODULE_2__.join)(cacheDirPath, extractDirBasename);
669
- extract_and_transform: {
670
- if (await (0,_fs_existsAsync__WEBPACK_IMPORTED_MODULE_5__/* .existsAsync */ .o)(extractedDirPath)) {
671
- const isExtracted = await SuccessTracker.getIsExtracted({
672
- cacheDirPath,
673
- extractDirBasename
674
- });
675
- if (isExtracted) {
676
- break extract_and_transform;
677
- }
678
- await (0,_fs_rm__WEBPACK_IMPORTED_MODULE_7__.rm)(extractedDirPath, { recursive: true });
679
- await SuccessTracker.removeFromExtracted({
680
- cacheDirPath,
681
- extractDirBasename
682
- });
683
- }
684
- await (0,_extractArchive__WEBPACK_IMPORTED_MODULE_4__/* .extractArchive */ .N)({
685
- archiveFilePath,
686
- onArchiveFile: async ({ relativeFilePathInArchive, readFile, writeFile }) => onArchiveFile({
687
- fileRelativePath: relativeFilePathInArchive,
688
- readFile,
689
- writeFile: ({ fileRelativePath, modifiedData }) => writeFile({
690
- filePath: (0,path__WEBPACK_IMPORTED_MODULE_2__.join)(extractedDirPath, fileRelativePath),
691
- modifiedData
692
- })
693
- })
694
- });
695
- await SuccessTracker.markAsExtracted({
696
- cacheDirPath,
697
- extractDirBasename
698
- });
699
- }
700
- return { extractedDirPath, archiveFilePath };
701
- }
702
- var SuccessTracker;
703
- (function (SuccessTracker) {
704
- async function read(params) {
705
- const { cacheDirPath } = params;
706
- const filePath = (0,path__WEBPACK_IMPORTED_MODULE_2__.join)(cacheDirPath, "downloadAndExtractArchive.json");
707
- if (!(await (0,_fs_existsAsync__WEBPACK_IMPORTED_MODULE_5__/* .existsAsync */ .o)(filePath))) {
708
- return { archiveFileBasenames: [], extractDirBasenames: [] };
709
- }
710
- return JSON.parse((await (0,fs_promises__WEBPACK_IMPORTED_MODULE_1__.readFile)(filePath)).toString("utf8"));
711
- }
712
- async function write(params) {
713
- const { cacheDirPath, successTracker } = params;
714
- const filePath = (0,path__WEBPACK_IMPORTED_MODULE_2__.join)(cacheDirPath, "downloadAndExtractArchive.json");
715
- {
716
- const dirPath = (0,path__WEBPACK_IMPORTED_MODULE_2__.dirname)(filePath);
717
- if (!(await (0,_fs_existsAsync__WEBPACK_IMPORTED_MODULE_5__/* .existsAsync */ .o)(dirPath))) {
718
- await (0,fs_promises__WEBPACK_IMPORTED_MODULE_1__.mkdir)(dirPath, { recursive: true });
719
- }
720
- }
721
- await (0,fs_promises__WEBPACK_IMPORTED_MODULE_1__.writeFile)(filePath, JSON.stringify(successTracker));
722
- }
723
- async function markAsDownloaded(params) {
724
- const { cacheDirPath, archiveFileBasename } = params;
725
- const successTracker = await read({ cacheDirPath });
726
- successTracker.archiveFileBasenames.push(archiveFileBasename);
727
- await write({ cacheDirPath, successTracker });
728
- }
729
- SuccessTracker.markAsDownloaded = markAsDownloaded;
730
- async function getIsDownloaded(params) {
731
- const { cacheDirPath, archiveFileBasename } = params;
732
- const successTracker = await read({ cacheDirPath });
733
- return successTracker.archiveFileBasenames.includes(archiveFileBasename);
734
- }
735
- SuccessTracker.getIsDownloaded = getIsDownloaded;
736
- async function removeFromDownloaded(params) {
737
- const { cacheDirPath, archiveFileBasename } = params;
738
- const successTracker = await read({ cacheDirPath });
739
- successTracker.archiveFileBasenames = successTracker.archiveFileBasenames.filter(basename => basename !== archiveFileBasename);
740
- await write({ cacheDirPath, successTracker });
741
- }
742
- SuccessTracker.removeFromDownloaded = removeFromDownloaded;
743
- async function markAsExtracted(params) {
744
- const { cacheDirPath, extractDirBasename } = params;
745
- const successTracker = await read({ cacheDirPath });
746
- successTracker.extractDirBasenames.push(extractDirBasename);
747
- await write({ cacheDirPath, successTracker });
748
- }
749
- SuccessTracker.markAsExtracted = markAsExtracted;
750
- async function getIsExtracted(params) {
751
- const { cacheDirPath, extractDirBasename } = params;
752
- const successTracker = await read({ cacheDirPath });
753
- return successTracker.extractDirBasenames.includes(extractDirBasename);
754
- }
755
- SuccessTracker.getIsExtracted = getIsExtracted;
756
- async function removeFromExtracted(params) {
757
- const { cacheDirPath, extractDirBasename } = params;
758
- const successTracker = await read({ cacheDirPath });
759
- successTracker.extractDirBasenames = successTracker.extractDirBasenames.filter(basename => basename !== extractDirBasename);
760
- await write({ cacheDirPath, successTracker });
761
- }
762
- SuccessTracker.removeFromExtracted = removeFromExtracted;
763
- })(SuccessTracker || (SuccessTracker = {}));
764
- //# sourceMappingURL=downloadAndExtractArchive.js.map
765
-
766
- /***/ }),
767
-
768
- /***/ 29121:
769
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
770
-
771
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
772
- /* harmony export */ "N": () => (/* binding */ extractArchive)
773
- /* harmony export */ });
774
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73292);
775
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__);
776
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57147);
777
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
778
- /* harmony import */ var yauzl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(78781);
779
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12781);
780
- /* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);
781
- /* harmony import */ var evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50689);
782
- /* harmony import */ var evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__);
783
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71017);
784
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_5__);
785
- /* harmony import */ var _fs_existsAsync__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(43765);
786
-
787
-
788
-
789
-
790
-
791
-
792
-
793
- async function extractArchive(params) {
794
- const { archiveFilePath, onArchiveFile } = params;
795
- const zipFile = await new Promise((resolve, reject) => {
796
- yauzl__WEBPACK_IMPORTED_MODULE_2__.open(archiveFilePath, { lazyEntries: true }, async (error, zipFile) => {
797
- if (error) {
798
- reject(error);
799
- return;
800
- }
801
- resolve(zipFile);
802
- });
803
- });
804
- const dDone = new evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__.Deferred();
805
- zipFile.once("end", () => {
806
- zipFile.close();
807
- dDone.resolve();
808
- });
809
- const writeFile = async (entry, params) => {
810
- const { filePath, modifiedData } = params;
811
- {
812
- const dirPath = (0,path__WEBPACK_IMPORTED_MODULE_5__.dirname)(filePath);
813
- if (!(await (0,_fs_existsAsync__WEBPACK_IMPORTED_MODULE_6__/* .existsAsync */ .o)(dirPath))) {
814
- await fs_promises__WEBPACK_IMPORTED_MODULE_0___default().mkdir(dirPath, { recursive: true });
815
- }
816
- }
817
- if (modifiedData !== undefined) {
818
- await fs_promises__WEBPACK_IMPORTED_MODULE_0___default().writeFile(filePath, modifiedData);
819
- return;
820
- }
821
- const readStream = await new Promise(resolve => zipFile.openReadStream(entry, async (error, readStream) => {
822
- if (error) {
823
- dDone.reject(error);
824
- return;
825
- }
826
- resolve(readStream);
827
- }));
828
- const dDoneWithFile = new evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__.Deferred();
829
- stream__WEBPACK_IMPORTED_MODULE_3___default().pipeline(readStream, fs__WEBPACK_IMPORTED_MODULE_1___default().createWriteStream(filePath), error => {
830
- if (error) {
831
- dDone.reject(error);
832
- return;
833
- }
834
- dDoneWithFile.resolve();
835
- });
836
- await dDoneWithFile.pr;
837
- };
838
- const readFile = (entry) => new Promise(resolve => zipFile.openReadStream(entry, async (error, readStream) => {
839
- if (error) {
840
- dDone.reject(error);
841
- return;
842
- }
843
- const chunks = [];
844
- readStream.on("data", chunk => {
845
- chunks.push(chunk);
846
- });
847
- readStream.on("end", () => {
848
- resolve(Buffer.concat(chunks));
849
- });
850
- readStream.on("error", error => {
851
- dDone.reject(error);
852
- });
853
- }));
854
- zipFile.on("entry", async (entry) => {
855
- handle_file: {
856
- // NOTE: Skip directories
857
- if (entry.fileName.endsWith("/")) {
858
- break handle_file;
859
- }
860
- let hasEarlyExitBeenCalled = false;
861
- await onArchiveFile({
862
- relativeFilePathInArchive: entry.fileName.split("/").join(path__WEBPACK_IMPORTED_MODULE_5__.sep),
863
- readFile: () => readFile(entry),
864
- writeFile: params => writeFile(entry, params),
865
- earlyExit: () => {
866
- hasEarlyExitBeenCalled = true;
867
- }
868
- });
869
- if (hasEarlyExitBeenCalled) {
870
- zipFile.close();
871
- dDone.resolve();
872
- return;
873
- }
874
- }
875
- zipFile.readEntry();
876
- });
877
- zipFile.readEntry();
878
- await dDone.pr;
879
- }
880
- //# sourceMappingURL=extractArchive.js.map
881
-
882
- /***/ }),
883
-
884
- /***/ 43765:
885
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
886
-
887
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
888
- /* harmony export */ "o": () => (/* binding */ existsAsync)
889
- /* harmony export */ });
890
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73292);
891
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__);
892
-
893
- async function existsAsync(path) {
894
- try {
895
- await fs_promises__WEBPACK_IMPORTED_MODULE_0__.stat(path);
896
- return true;
897
- }
898
- catch (error) {
899
- if (error.code === "ENOENT")
900
- return false;
901
- throw error;
902
- }
903
- }
904
- //# sourceMappingURL=fs.existsAsync.js.map
905
-
906
- /***/ }),
907
-
908
- /***/ 8699:
909
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
910
-
911
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
912
- /* harmony export */ "rm": () => (/* binding */ rm)
913
- /* harmony export */ });
914
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73292);
915
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__);
916
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
917
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
918
- /* harmony import */ var _SemVer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12171);
919
-
920
-
921
-
922
- /**
923
- * Polyfill of fs.rm(dirPath, { "recursive": true })
924
- * For older version of Node
925
- */
926
- async function rm(dirPath, options) {
927
- 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) {
928
- return fs_promises__WEBPACK_IMPORTED_MODULE_0__.rm(dirPath, options);
929
- }
930
- const { force = true } = options;
931
- if (force && !(await checkDirExists(dirPath))) {
932
- return;
933
- }
934
- const removeDir_rec = async (dirPath) => Promise.all((await fs_promises__WEBPACK_IMPORTED_MODULE_0__.readdir(dirPath)).map(async (basename) => {
935
- const fileOrDirpath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
936
- if ((await fs_promises__WEBPACK_IMPORTED_MODULE_0__.lstat(fileOrDirpath)).isDirectory()) {
937
- await removeDir_rec(fileOrDirpath);
938
- }
939
- else {
940
- await fs_promises__WEBPACK_IMPORTED_MODULE_0__.unlink(fileOrDirpath);
941
- }
942
- }));
943
- await removeDir_rec(dirPath);
944
- }
945
- async function checkDirExists(dirPath) {
946
- try {
947
- await fs_promises__WEBPACK_IMPORTED_MODULE_0__.access(dirPath, fs_promises__WEBPACK_IMPORTED_MODULE_0__.constants.F_OK);
948
- return true;
949
- }
950
- catch (_a) {
951
- return false;
952
- }
953
- }
954
- //# sourceMappingURL=fs.rm.js.map
955
-
956
- /***/ }),
957
-
958
- /***/ 89693:
959
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
960
-
961
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
962
- /* harmony export */ "a": () => (/* binding */ rmSync)
963
- /* harmony export */ });
964
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
965
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
966
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
967
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
968
- /* harmony import */ var _SemVer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12171);
969
-
970
-
971
-
972
- /**
973
- * Polyfill of fs.rmSync(dirPath, { "recursive": true })
974
- * For older version of Node
975
- */
976
- function rmSync(dirPath, options) {
977
- 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) {
978
- fs__WEBPACK_IMPORTED_MODULE_0__.rmSync(dirPath, options);
979
- return;
980
- }
981
- const { force = true } = options;
982
- if (force && !fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(dirPath)) {
983
- return;
984
- }
985
- const removeDir_rec = (dirPath) => fs__WEBPACK_IMPORTED_MODULE_0__.readdirSync(dirPath).forEach(basename => {
986
- const fileOrDirPath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
987
- if (fs__WEBPACK_IMPORTED_MODULE_0__.lstatSync(fileOrDirPath).isDirectory()) {
988
- removeDir_rec(fileOrDirPath);
989
- return;
990
- }
991
- else {
992
- fs__WEBPACK_IMPORTED_MODULE_0__.unlinkSync(fileOrDirPath);
993
- }
994
- });
995
- removeDir_rec(dirPath);
996
- }
997
- //# sourceMappingURL=fs.rmSync.js.map
998
-
999
- /***/ }),
1000
-
1001
- /***/ 73776:
1002
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1003
-
1004
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1005
- /* harmony export */ "K": () => (/* binding */ getNodeModulesBinDirPath)
1006
- /* harmony export */ });
1007
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
1008
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
1009
-
1010
- let cache = undefined;
1011
- function getNodeModulesBinDirPath() {
1012
- if (cache !== undefined) {
1013
- return cache;
1014
- }
1015
- const binPath = process.argv[1];
1016
- const segments = [".bin"];
1017
- let foundNodeModules = false;
1018
- for (const segment of binPath.split(path__WEBPACK_IMPORTED_MODULE_0__.sep).reverse()) {
1019
- skip_segment: {
1020
- if (foundNodeModules) {
1021
- break skip_segment;
1022
- }
1023
- if (segment === "node_modules") {
1024
- foundNodeModules = true;
1025
- break skip_segment;
1026
- }
1027
- continue;
1028
- }
1029
- segments.unshift(segment);
1030
- }
1031
- const nodeModulesBinDirPath = segments.join(path__WEBPACK_IMPORTED_MODULE_0__.sep);
1032
- cache = nodeModulesBinDirPath;
1033
- return nodeModulesBinDirPath;
1034
- }
1035
- //# sourceMappingURL=nodeModulesBinDirPath.js.map
1036
-
1037
- /***/ }),
1038
-
1039
- /***/ 60332:
1040
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1041
-
1042
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1043
- /* harmony export */ "N": () => (/* binding */ transformCodebase)
1044
- /* harmony export */ });
1045
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
1046
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
1047
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
1048
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
1049
- /* harmony import */ var _crawl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73036);
1050
- /* harmony import */ var _tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(89693);
1051
-
1052
-
1053
-
1054
-
1055
- /**
1056
- * Apply a transformation function to every file of directory
1057
- * If source and destination are the same this function can be used to apply the transformation in place
1058
- * like filtering out some files or modifying them.
1059
- * */
1060
- function transformCodebase(params) {
1061
- const { srcDirPath, transformSourceCode } = params;
1062
- const isTargetSameAsSource = path__WEBPACK_IMPORTED_MODULE_1__.relative(srcDirPath, params.destDirPath) === "";
1063
- const destDirPath = isTargetSameAsSource
1064
- ? path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, "..", "tmp_xOsPdkPsTdzPs34sOkHs")
1065
- : params.destDirPath;
1066
- fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(destDirPath, {
1067
- recursive: true
1068
- });
1069
- for (const fileRelativePath of (0,_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
1070
- dirPath: srcDirPath,
1071
- returnedPathsType: "relative to dirPath"
1072
- })) {
1073
- const filePath = path__WEBPACK_IMPORTED_MODULE_1__.join(srcDirPath, fileRelativePath);
1074
- const destFilePath = path__WEBPACK_IMPORTED_MODULE_1__.join(destDirPath, fileRelativePath);
1075
- // NOTE: Optimization, if we don't need to transform the file, just copy
1076
- // it using the lower level implementation.
1077
- if (transformSourceCode === undefined) {
1078
- fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
1079
- recursive: true
1080
- });
1081
- fs__WEBPACK_IMPORTED_MODULE_0__.copyFileSync(filePath, destFilePath);
1082
- continue;
1083
- }
1084
- const transformSourceCodeResult = transformSourceCode({
1085
- sourceCode: fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(filePath),
1086
- filePath,
1087
- fileRelativePath
1088
- });
1089
- if (transformSourceCodeResult === undefined) {
1090
- continue;
1091
- }
1092
- fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), {
1093
- recursive: true
1094
- });
1095
- const { newFileName, modifiedSourceCode } = transformSourceCodeResult;
1096
- fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(path__WEBPACK_IMPORTED_MODULE_1__.join(path__WEBPACK_IMPORTED_MODULE_1__.dirname(destFilePath), newFileName !== null && newFileName !== void 0 ? newFileName : path__WEBPACK_IMPORTED_MODULE_1__.basename(destFilePath)), modifiedSourceCode);
1097
- }
1098
- if (isTargetSameAsSource) {
1099
- (0,_tools_fs_rmSync__WEBPACK_IMPORTED_MODULE_3__/* .rmSync */ .a)(srcDirPath, { recursive: true });
1100
- fs__WEBPACK_IMPORTED_MODULE_0__.renameSync(destDirPath, srcDirPath);
1101
- }
1102
- }
1103
- //# sourceMappingURL=transformCodebase.js.map
1104
-
1105
- /***/ })
1106
-
1107
- };
1108
- ;