keycloakify 10.0.0-rc.118 → 10.0.0-rc.119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/{490.index.js → 246.index.js} +20 -2
- package/bin/31.index.js +151 -159
- package/bin/440.index.js +27 -22
- package/bin/526.index.js +168 -56
- package/bin/599.index.js +560 -0
- package/bin/622.index.js +4 -2
- package/bin/{36.index.js → 678.index.js} +577 -71
- package/bin/{180.index.js → 697.index.js} +611 -526
- package/bin/743.index.js +70 -0
- package/bin/780.index.js +729 -0
- package/bin/932.index.js +725 -48
- package/bin/{966.index.js → 941.index.js} +2 -19
- package/bin/main.js +19 -7
- package/bin/shared/buildContext.d.ts +28 -19
- package/bin/shared/buildContext.js.map +1 -1
- package/bin/shared/getLatestsSemVersionedTag.d.ts +10 -0
- package/bin/shared/getLatestsSemVersionedTag.js.map +1 -0
- package/bin/shared/promptKeycloakVersion.js.map +1 -1
- package/package.json +24 -5
- package/src/bin/initialize-account-theme/copyBoilerplate.ts +32 -0
- package/src/bin/initialize-account-theme/index.ts +1 -0
- package/src/bin/initialize-account-theme/initialize-account-theme.ts +95 -0
- package/src/bin/initialize-account-theme/initializeAccountTheme_multiPage.ts +21 -0
- package/src/bin/initialize-account-theme/initializeAccountTheme_singlePage.ts +150 -0
- package/src/bin/initialize-account-theme/src/multi-page/KcContext.ts +12 -0
- package/src/bin/initialize-account-theme/src/multi-page/KcPage.tsx +25 -0
- package/src/bin/initialize-account-theme/src/multi-page/KcPageStory.tsx +38 -0
- package/src/bin/initialize-account-theme/src/multi-page/i18n.ts +5 -0
- package/src/bin/initialize-account-theme/src/single-page/KcContext.ts +7 -0
- package/src/bin/initialize-account-theme/src/single-page/KcPage.tsx +11 -0
- package/src/bin/initialize-account-theme/updateAccountThemeImplementationInConfig.ts +92 -0
- package/src/bin/keycloakify/buildJars/buildJar.ts +2 -2
- package/src/bin/keycloakify/buildJars/buildJars.ts +3 -4
- package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +26 -20
- package/src/bin/keycloakify/keycloakify.ts +1 -1
- package/src/bin/keycloakify/replacers/replaceImportsInJsCode/replaceImportsInJsCode.ts +2 -2
- package/src/bin/main.ts +14 -0
- package/src/bin/shared/buildContext.ts +246 -225
- package/src/bin/shared/getLatestsSemVersionedTag.ts +180 -0
- package/src/bin/shared/promptKeycloakVersion.ts +8 -77
- package/src/bin/start-keycloak/appBuild.ts +13 -9
- package/src/bin/tools/downloadAndExtractArchive.ts +4 -2
- package/src/bin/tools/npmInstall.ts +63 -0
- package/src/bin/tools/octokit-addons/getLatestsSemVersionedTag.ts +3 -2
- package/src/bin/tsconfig.json +3 -1
- package/src/vite-plugin/vite-plugin.ts +7 -5
- package/vite-plugin/index.js +156 -180
- package/vite-plugin/vite-plugin.d.ts +6 -4
package/bin/599.index.js
ADDED
@@ -0,0 +1,560 @@
|
|
1
|
+
"use strict";
|
2
|
+
exports.id = 599;
|
3
|
+
exports.ids = [599];
|
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__(88078);
|
18
|
+
/* harmony import */ var tsafe_assert__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(tsafe_assert__WEBPACK_IMPORTED_MODULE_3__);
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
function copyBoilerplate(params) {
|
24
|
+
const { accountThemeType, accountThemeSrcDirPath } = params;
|
25
|
+
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", (() => {
|
26
|
+
switch (accountThemeType) {
|
27
|
+
case "Single-Page":
|
28
|
+
return "single-page";
|
29
|
+
case "Multi-Page":
|
30
|
+
return "multi-page";
|
31
|
+
}
|
32
|
+
(0,tsafe_assert__WEBPACK_IMPORTED_MODULE_3__.assert)(false);
|
33
|
+
})()), accountThemeSrcDirPath, { recursive: true });
|
34
|
+
}
|
35
|
+
//# sourceMappingURL=copyBoilerplate.js.map
|
36
|
+
|
37
|
+
/***/ }),
|
38
|
+
|
39
|
+
/***/ 97599:
|
40
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
41
|
+
|
42
|
+
// ESM COMPAT FLAG
|
43
|
+
__webpack_require__.r(__webpack_exports__);
|
44
|
+
|
45
|
+
// EXPORTS
|
46
|
+
__webpack_require__.d(__webpack_exports__, {
|
47
|
+
"initializeAccountTheme_singlePage": () => (/* binding */ initializeAccountTheme_singlePage)
|
48
|
+
});
|
49
|
+
|
50
|
+
// EXTERNAL MODULE: external "path"
|
51
|
+
var external_path_ = __webpack_require__(71017);
|
52
|
+
// EXTERNAL MODULE: external "fs"
|
53
|
+
var external_fs_ = __webpack_require__(57147);
|
54
|
+
// EXTERNAL MODULE: ./node_modules/chalk/source/index.js
|
55
|
+
var source = __webpack_require__(78818);
|
56
|
+
var source_default = /*#__PURE__*/__webpack_require__.n(source);
|
57
|
+
// EXTERNAL MODULE: ./dist/bin/shared/getLatestsSemVersionedTag.js + 2 modules
|
58
|
+
var getLatestsSemVersionedTag = __webpack_require__(97189);
|
59
|
+
// EXTERNAL MODULE: ./node_modules/make-fetch-happen/lib/index.js
|
60
|
+
var lib = __webpack_require__(9525);
|
61
|
+
var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
|
62
|
+
// EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
|
63
|
+
var zod_lib = __webpack_require__(52300);
|
64
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/assert.js
|
65
|
+
var assert = __webpack_require__(88078);
|
66
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/is.js
|
67
|
+
var is = __webpack_require__(94655);
|
68
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/id.js
|
69
|
+
var id = __webpack_require__(43047);
|
70
|
+
// EXTERNAL MODULE: external "child_process"
|
71
|
+
var external_child_process_ = __webpack_require__(32081);
|
72
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/npmInstall.js
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
function npmInstall(params) {
|
78
|
+
const { packageJsonDirPath } = params;
|
79
|
+
const packageManagerBinName = (() => {
|
80
|
+
const packageMangers = [
|
81
|
+
{
|
82
|
+
binName: "yarn",
|
83
|
+
lockFileBasename: "yarn.lock"
|
84
|
+
},
|
85
|
+
{
|
86
|
+
binName: "npm",
|
87
|
+
lockFileBasename: "package-lock.json"
|
88
|
+
},
|
89
|
+
{
|
90
|
+
binName: "pnpm",
|
91
|
+
lockFileBasename: "pnpm-lock.yaml"
|
92
|
+
},
|
93
|
+
{
|
94
|
+
binName: "bun",
|
95
|
+
lockFileBasename: "bun.lockdb"
|
96
|
+
}
|
97
|
+
];
|
98
|
+
for (const packageManager of packageMangers) {
|
99
|
+
if (external_fs_.existsSync((0,external_path_.join)(packageJsonDirPath, packageManager.lockFileBasename)) ||
|
100
|
+
external_fs_.existsSync((0,external_path_.join)(process.cwd(), packageManager.lockFileBasename))) {
|
101
|
+
return packageManager.binName;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
return undefined;
|
105
|
+
})();
|
106
|
+
install_dependencies: {
|
107
|
+
if (packageManagerBinName === undefined) {
|
108
|
+
break install_dependencies;
|
109
|
+
}
|
110
|
+
console.log(`Installing the new dependencies...`);
|
111
|
+
try {
|
112
|
+
external_child_process_.execSync(`${packageManagerBinName} install`, {
|
113
|
+
cwd: packageJsonDirPath,
|
114
|
+
stdio: "inherit"
|
115
|
+
});
|
116
|
+
}
|
117
|
+
catch (_a) {
|
118
|
+
console.log(source_default().yellow(`\`${packageManagerBinName} install\` failed, continuing anyway...`));
|
119
|
+
}
|
120
|
+
}
|
121
|
+
}
|
122
|
+
//# sourceMappingURL=npmInstall.js.map
|
123
|
+
// EXTERNAL MODULE: ./dist/bin/initialize-account-theme/copyBoilerplate.js
|
124
|
+
var copyBoilerplate = __webpack_require__(81434);
|
125
|
+
// EXTERNAL MODULE: ./dist/bin/tools/getThisCodebaseRootDirPath.js
|
126
|
+
var getThisCodebaseRootDirPath = __webpack_require__(58822);
|
127
|
+
;// CONCATENATED MODULE: ./dist/bin/initialize-account-theme/initializeAccountTheme_singlePage.js
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
(0,assert.assert)();
|
141
|
+
async function initializeAccountTheme_singlePage(params) {
|
142
|
+
const { accountThemeSrcDirPath, buildContext } = params;
|
143
|
+
const OWNER = "keycloakify";
|
144
|
+
const REPO = "keycloak-account-ui";
|
145
|
+
const [semVersionedTag] = await (0,getLatestsSemVersionedTag/* getLatestsSemVersionedTag */._)({
|
146
|
+
cacheDirPath: buildContext.cacheDirPath,
|
147
|
+
owner: OWNER,
|
148
|
+
repo: REPO,
|
149
|
+
count: 1,
|
150
|
+
doIgnoreReleaseCandidates: false
|
151
|
+
});
|
152
|
+
const dependencies = await lib_default()(`https://raw.githubusercontent.com/${OWNER}/${REPO}/${semVersionedTag.tag}/dependencies.gen.json`, buildContext.fetchOptions)
|
153
|
+
.then(r => r.json())
|
154
|
+
.then((() => {
|
155
|
+
const zDependencies = (() => {
|
156
|
+
const zTargetType = zod_lib.z.object({
|
157
|
+
dependencies: zod_lib.z.record(zod_lib.z.string()),
|
158
|
+
devDependencies: zod_lib.z.record(zod_lib.z.string()).optional()
|
159
|
+
});
|
160
|
+
(0,assert.assert)();
|
161
|
+
return (0,id.id)(zTargetType);
|
162
|
+
})();
|
163
|
+
return o => zDependencies.parse(o);
|
164
|
+
})());
|
165
|
+
dependencies.dependencies["@keycloakify/keycloak-account-ui"] = semVersionedTag.tag;
|
166
|
+
const parsedPackageJson = (() => {
|
167
|
+
const zParsedPackageJson = (() => {
|
168
|
+
const zTargetType = zod_lib.z.object({
|
169
|
+
dependencies: zod_lib.z.record(zod_lib.z.string()).optional(),
|
170
|
+
devDependencies: zod_lib.z.record(zod_lib.z.string()).optional()
|
171
|
+
});
|
172
|
+
(0,assert.assert)();
|
173
|
+
return (0,id.id)(zTargetType);
|
174
|
+
})();
|
175
|
+
const parsedPackageJson = JSON.parse(external_fs_.readFileSync(buildContext.packageJsonFilePath).toString("utf8"));
|
176
|
+
zParsedPackageJson.parse(parsedPackageJson);
|
177
|
+
(0,assert.assert)((0,is.is)(parsedPackageJson));
|
178
|
+
return parsedPackageJson;
|
179
|
+
})();
|
180
|
+
parsedPackageJson.dependencies = Object.assign(Object.assign({}, parsedPackageJson.dependencies), dependencies.dependencies);
|
181
|
+
parsedPackageJson.devDependencies = Object.assign(Object.assign({}, parsedPackageJson.devDependencies), dependencies.devDependencies);
|
182
|
+
if (Object.keys(parsedPackageJson.devDependencies).length === 0) {
|
183
|
+
delete parsedPackageJson.devDependencies;
|
184
|
+
}
|
185
|
+
external_fs_.writeFileSync(buildContext.packageJsonFilePath, JSON.stringify(parsedPackageJson, undefined, 4));
|
186
|
+
run_npm_install: {
|
187
|
+
if (JSON.parse(external_fs_.readFileSync((0,external_path_.join)((0,getThisCodebaseRootDirPath/* getThisCodebaseRootDirPath */.e)(), "package.json"))
|
188
|
+
.toString("utf8"))["version"] === "0.0.0") {
|
189
|
+
//NOTE: Linked version
|
190
|
+
break run_npm_install;
|
191
|
+
}
|
192
|
+
npmInstall({ packageJsonDirPath: (0,external_path_.dirname)(buildContext.packageJsonFilePath) });
|
193
|
+
}
|
194
|
+
(0,copyBoilerplate/* copyBoilerplate */.T)({
|
195
|
+
accountThemeType: "Single-Page",
|
196
|
+
accountThemeSrcDirPath
|
197
|
+
});
|
198
|
+
console.log([
|
199
|
+
source_default().green("The Single-Page account theme has been successfully initialized."),
|
200
|
+
`Using Account UI of Keycloak version: ${source_default().bold(semVersionedTag.tag.split("-")[0])}`,
|
201
|
+
`Directory created: ${source_default().bold((0,external_path_.relative)(process.cwd(), accountThemeSrcDirPath))}`,
|
202
|
+
`Dependencies added to your project's package.json: `,
|
203
|
+
source_default().bold(JSON.stringify(dependencies, null, 2))
|
204
|
+
].join("\n"));
|
205
|
+
}
|
206
|
+
//# sourceMappingURL=initializeAccountTheme_singlePage.js.map
|
207
|
+
|
208
|
+
/***/ }),
|
209
|
+
|
210
|
+
/***/ 97189:
|
211
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
212
|
+
|
213
|
+
|
214
|
+
// EXPORTS
|
215
|
+
__webpack_require__.d(__webpack_exports__, {
|
216
|
+
"_": () => (/* binding */ getLatestsSemVersionedTag)
|
217
|
+
});
|
218
|
+
|
219
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/octokit-addons/listTags.js
|
220
|
+
var __await = (undefined && undefined.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
221
|
+
var __asyncGenerator = (undefined && undefined.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
222
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
223
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
224
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
225
|
+
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); }); }; }
|
226
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
227
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
228
|
+
function fulfill(value) { resume("next", value); }
|
229
|
+
function reject(value) { resume("throw", value); }
|
230
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
231
|
+
};
|
232
|
+
const per_page = 99;
|
233
|
+
function listTagsFactory(params) {
|
234
|
+
const { octokit } = params;
|
235
|
+
const octokit_repo_listTags = async (params) => {
|
236
|
+
return octokit.repos.listTags(params);
|
237
|
+
};
|
238
|
+
function listTags(params) {
|
239
|
+
return __asyncGenerator(this, arguments, function* listTags_1() {
|
240
|
+
const { owner, repo } = params;
|
241
|
+
let page = 1;
|
242
|
+
while (true) {
|
243
|
+
const resp = yield __await(octokit_repo_listTags({
|
244
|
+
owner,
|
245
|
+
repo,
|
246
|
+
per_page,
|
247
|
+
page: page++
|
248
|
+
}));
|
249
|
+
for (const branch of resp.data.map(({ name }) => name)) {
|
250
|
+
yield yield __await(branch);
|
251
|
+
}
|
252
|
+
if (resp.data.length < 99) {
|
253
|
+
break;
|
254
|
+
}
|
255
|
+
}
|
256
|
+
});
|
257
|
+
}
|
258
|
+
/** Returns the same "latest" tag as deno.land/x, not actually the latest though */
|
259
|
+
async function getLatestTag(params) {
|
260
|
+
const { owner, repo } = params;
|
261
|
+
const itRes = await listTags({ owner, repo }).next();
|
262
|
+
if (itRes.done) {
|
263
|
+
return undefined;
|
264
|
+
}
|
265
|
+
return itRes.value;
|
266
|
+
}
|
267
|
+
return { listTags, getLatestTag };
|
268
|
+
}
|
269
|
+
//# sourceMappingURL=listTags.js.map
|
270
|
+
// EXTERNAL MODULE: ./dist/bin/tools/SemVer.js
|
271
|
+
var SemVer = __webpack_require__(12171);
|
272
|
+
;// CONCATENATED MODULE: ./dist/bin/tools/octokit-addons/getLatestsSemVersionedTag.js
|
273
|
+
var __asyncValues = (undefined && undefined.__asyncValues) || function (o) {
|
274
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
275
|
+
var m = o[Symbol.asyncIterator], i;
|
276
|
+
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);
|
277
|
+
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); }); }; }
|
278
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
279
|
+
};
|
280
|
+
|
281
|
+
|
282
|
+
function getLatestsSemVersionedTagFactory(params) {
|
283
|
+
const { octokit } = params;
|
284
|
+
async function getLatestsSemVersionedTag(params) {
|
285
|
+
var _a, e_1, _b, _c;
|
286
|
+
const { owner, repo, count, doIgnoreReleaseCandidates } = params;
|
287
|
+
const semVersionedTags = [];
|
288
|
+
const { listTags } = listTagsFactory({ octokit });
|
289
|
+
try {
|
290
|
+
for (var _d = true, _e = __asyncValues(listTags({ owner, repo })), _f; _f = await _e.next(), _a = _f.done, !_a;) {
|
291
|
+
_c = _f.value;
|
292
|
+
_d = false;
|
293
|
+
try {
|
294
|
+
const tag = _c;
|
295
|
+
let version;
|
296
|
+
try {
|
297
|
+
version = SemVer/* SemVer.parse */.h.parse(tag.replace(/^[vV]?/, ""));
|
298
|
+
}
|
299
|
+
catch (_g) {
|
300
|
+
continue;
|
301
|
+
}
|
302
|
+
if (doIgnoreReleaseCandidates && version.rc !== undefined) {
|
303
|
+
continue;
|
304
|
+
}
|
305
|
+
semVersionedTags.push({ tag, version });
|
306
|
+
}
|
307
|
+
finally {
|
308
|
+
_d = true;
|
309
|
+
}
|
310
|
+
}
|
311
|
+
}
|
312
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
313
|
+
finally {
|
314
|
+
try {
|
315
|
+
if (!_d && !_a && (_b = _e.return)) await _b.call(_e);
|
316
|
+
}
|
317
|
+
finally { if (e_1) throw e_1.error; }
|
318
|
+
}
|
319
|
+
return semVersionedTags
|
320
|
+
.sort(({ version: vX }, { version: vY }) => SemVer/* SemVer.compare */.h.compare(vY, vX))
|
321
|
+
.slice(0, count);
|
322
|
+
}
|
323
|
+
return { getLatestsSemVersionedTag };
|
324
|
+
}
|
325
|
+
//# sourceMappingURL=getLatestsSemVersionedTag.js.map
|
326
|
+
// EXTERNAL MODULE: ./node_modules/@octokit/rest/dist-node/index.js
|
327
|
+
var dist_node = __webpack_require__(55375);
|
328
|
+
// EXTERNAL MODULE: external "path"
|
329
|
+
var external_path_ = __webpack_require__(71017);
|
330
|
+
// EXTERNAL MODULE: external "fs"
|
331
|
+
var external_fs_ = __webpack_require__(57147);
|
332
|
+
// EXTERNAL MODULE: ./node_modules/zod/lib/index.mjs
|
333
|
+
var lib = __webpack_require__(52300);
|
334
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/assert.js
|
335
|
+
var assert = __webpack_require__(88078);
|
336
|
+
// EXTERNAL MODULE: ./node_modules/tsafe/id.js
|
337
|
+
var id = __webpack_require__(43047);
|
338
|
+
// EXTERNAL MODULE: ./node_modules/evt/tools/inDepth/same.js
|
339
|
+
var same = __webpack_require__(33805);
|
340
|
+
;// CONCATENATED MODULE: ./dist/bin/shared/getLatestsSemVersionedTag.js
|
341
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
342
|
+
var t = {};
|
343
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
344
|
+
t[p] = s[p];
|
345
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
346
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
347
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
348
|
+
t[p[i]] = s[p[i]];
|
349
|
+
}
|
350
|
+
return t;
|
351
|
+
};
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
let getLatestsSemVersionedTag_stateless = undefined;
|
361
|
+
const CACHE_VERSION = 1;
|
362
|
+
async function getLatestsSemVersionedTag(_a) {
|
363
|
+
var { cacheDirPath } = _a, params = __rest(_a, ["cacheDirPath"]);
|
364
|
+
const cacheFilePath = (0,external_path_.join)(cacheDirPath, "latest-sem-versioned-tags.json");
|
365
|
+
const cacheLookupResult = (() => {
|
366
|
+
const getResult_currentCache = (currentCacheEntries) => ({
|
367
|
+
hasCachedResult: false,
|
368
|
+
currentCache: {
|
369
|
+
version: CACHE_VERSION,
|
370
|
+
entries: currentCacheEntries
|
371
|
+
}
|
372
|
+
});
|
373
|
+
if (!external_fs_.existsSync(cacheFilePath)) {
|
374
|
+
return getResult_currentCache([]);
|
375
|
+
}
|
376
|
+
let cache_json;
|
377
|
+
try {
|
378
|
+
cache_json = external_fs_.readFileSync(cacheFilePath).toString("utf8");
|
379
|
+
}
|
380
|
+
catch (_a) {
|
381
|
+
return getResult_currentCache([]);
|
382
|
+
}
|
383
|
+
let cache_json_parsed;
|
384
|
+
try {
|
385
|
+
cache_json_parsed = JSON.parse(cache_json);
|
386
|
+
}
|
387
|
+
catch (_b) {
|
388
|
+
return getResult_currentCache([]);
|
389
|
+
}
|
390
|
+
const zSemVer = (() => {
|
391
|
+
const zTargetType = lib.z.object({
|
392
|
+
major: lib.z.number(),
|
393
|
+
minor: lib.z.number(),
|
394
|
+
patch: lib.z.number(),
|
395
|
+
rc: lib.z.number().optional(),
|
396
|
+
parsedFrom: lib.z.string()
|
397
|
+
});
|
398
|
+
(0,assert.assert)();
|
399
|
+
return (0,id.id)(zTargetType);
|
400
|
+
})();
|
401
|
+
const zCache = (() => {
|
402
|
+
const zTargetType = lib.z.object({
|
403
|
+
version: lib.z.literal(CACHE_VERSION),
|
404
|
+
entries: lib.z.array(lib.z.object({
|
405
|
+
time: lib.z.number(),
|
406
|
+
params: lib.z.object({
|
407
|
+
owner: lib.z.string(),
|
408
|
+
repo: lib.z.string(),
|
409
|
+
count: lib.z.number(),
|
410
|
+
doIgnoreReleaseCandidates: lib.z.boolean()
|
411
|
+
}),
|
412
|
+
result: lib.z.array(lib.z.object({
|
413
|
+
tag: lib.z.string(),
|
414
|
+
version: zSemVer
|
415
|
+
}))
|
416
|
+
}))
|
417
|
+
});
|
418
|
+
(0,assert.assert)();
|
419
|
+
return (0,id.id)(zTargetType);
|
420
|
+
})();
|
421
|
+
let cache;
|
422
|
+
try {
|
423
|
+
cache = zCache.parse(cache_json_parsed);
|
424
|
+
}
|
425
|
+
catch (_c) {
|
426
|
+
return getResult_currentCache([]);
|
427
|
+
}
|
428
|
+
const cacheEntry = cache.entries.find(e => (0,same.same)(e.params, params));
|
429
|
+
if (cacheEntry === undefined) {
|
430
|
+
return getResult_currentCache(cache.entries);
|
431
|
+
}
|
432
|
+
if (Date.now() - cacheEntry.time > 3600000) {
|
433
|
+
return getResult_currentCache(cache.entries.filter(e => e !== cacheEntry));
|
434
|
+
}
|
435
|
+
return {
|
436
|
+
hasCachedResult: true,
|
437
|
+
cachedResult: cacheEntry.result
|
438
|
+
};
|
439
|
+
})();
|
440
|
+
if (cacheLookupResult.hasCachedResult) {
|
441
|
+
return cacheLookupResult.cachedResult;
|
442
|
+
}
|
443
|
+
const { currentCache } = cacheLookupResult;
|
444
|
+
getLatestsSemVersionedTag_stateless !== null && getLatestsSemVersionedTag_stateless !== void 0 ? getLatestsSemVersionedTag_stateless : (getLatestsSemVersionedTag_stateless = (() => {
|
445
|
+
const octokit = (() => {
|
446
|
+
const githubToken = process.env.GITHUB_TOKEN;
|
447
|
+
const octokit = new dist_node.Octokit(githubToken === undefined ? undefined : { auth: githubToken });
|
448
|
+
return octokit;
|
449
|
+
})();
|
450
|
+
const { getLatestsSemVersionedTag } = getLatestsSemVersionedTagFactory({
|
451
|
+
octokit
|
452
|
+
});
|
453
|
+
return getLatestsSemVersionedTag;
|
454
|
+
})());
|
455
|
+
const result = await getLatestsSemVersionedTag_stateless(params);
|
456
|
+
currentCache.entries.push({
|
457
|
+
time: Date.now(),
|
458
|
+
params,
|
459
|
+
result
|
460
|
+
});
|
461
|
+
{
|
462
|
+
const dirPath = (0,external_path_.dirname)(cacheFilePath);
|
463
|
+
if (!external_fs_.existsSync(dirPath)) {
|
464
|
+
external_fs_.mkdirSync(dirPath, { recursive: true });
|
465
|
+
}
|
466
|
+
}
|
467
|
+
external_fs_.writeFileSync(cacheFilePath, JSON.stringify(currentCache, null, 2));
|
468
|
+
return result;
|
469
|
+
}
|
470
|
+
//# sourceMappingURL=getLatestsSemVersionedTag.js.map
|
471
|
+
|
472
|
+
/***/ }),
|
473
|
+
|
474
|
+
/***/ 12171:
|
475
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
476
|
+
|
477
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
478
|
+
/* harmony export */ "h": () => (/* binding */ SemVer)
|
479
|
+
/* harmony export */ });
|
480
|
+
var SemVer;
|
481
|
+
(function (SemVer) {
|
482
|
+
const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
|
483
|
+
function parse(versionStr) {
|
484
|
+
const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
|
485
|
+
if (!match) {
|
486
|
+
throw new Error(`${versionStr} is not a valid semantic version`);
|
487
|
+
}
|
488
|
+
const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
|
489
|
+
const str = match[3];
|
490
|
+
return str === undefined ? 0 : parseInt(str);
|
491
|
+
})() }, (() => {
|
492
|
+
const str = match[4];
|
493
|
+
return str === undefined ? {} : { rc: parseInt(str) };
|
494
|
+
})());
|
495
|
+
const initialStr = stringify(semVer);
|
496
|
+
Object.defineProperty(semVer, "parsedFrom", {
|
497
|
+
enumerable: true,
|
498
|
+
get: function () {
|
499
|
+
const currentStr = stringify(this);
|
500
|
+
if (currentStr !== initialStr) {
|
501
|
+
throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
|
502
|
+
}
|
503
|
+
return versionStr;
|
504
|
+
}
|
505
|
+
});
|
506
|
+
return semVer;
|
507
|
+
}
|
508
|
+
SemVer.parse = parse;
|
509
|
+
function stringify(v) {
|
510
|
+
return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
|
511
|
+
}
|
512
|
+
SemVer.stringify = stringify;
|
513
|
+
/**
|
514
|
+
*
|
515
|
+
* v1 < v2 => -1
|
516
|
+
* v1 === v2 => 0
|
517
|
+
* v1 > v2 => 1
|
518
|
+
*
|
519
|
+
*/
|
520
|
+
function compare(v1, v2) {
|
521
|
+
const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
|
522
|
+
const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
|
523
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
524
|
+
if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
|
525
|
+
return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
|
526
|
+
}
|
527
|
+
}
|
528
|
+
return 0;
|
529
|
+
}
|
530
|
+
SemVer.compare = compare;
|
531
|
+
/*
|
532
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
|
533
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
|
534
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
|
535
|
+
*/
|
536
|
+
function bumpType(params) {
|
537
|
+
const versionAhead = typeof params.versionAhead === "string"
|
538
|
+
? parse(params.versionAhead)
|
539
|
+
: params.versionAhead;
|
540
|
+
const versionBehind = typeof params.versionBehind === "string"
|
541
|
+
? parse(params.versionBehind)
|
542
|
+
: params.versionBehind;
|
543
|
+
if (compare(versionBehind, versionAhead) === 1) {
|
544
|
+
throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
|
545
|
+
}
|
546
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
547
|
+
if (versionBehind[level] !== versionAhead[level]) {
|
548
|
+
return level;
|
549
|
+
}
|
550
|
+
}
|
551
|
+
return "no bump";
|
552
|
+
}
|
553
|
+
SemVer.bumpType = bumpType;
|
554
|
+
})(SemVer || (SemVer = {}));
|
555
|
+
//# sourceMappingURL=SemVer.js.map
|
556
|
+
|
557
|
+
/***/ })
|
558
|
+
|
559
|
+
};
|
560
|
+
;
|
package/bin/622.index.js
CHANGED
@@ -292,7 +292,7 @@ async function downloadAndExtractArchive(params) {
|
|
292
292
|
archiveFileBasename
|
293
293
|
});
|
294
294
|
}
|
295
|
-
const extractDirBasename = `${archiveFileBasename.
|
295
|
+
const extractDirBasename = `${archiveFileBasename.replace(/\.([^.]+)$/, (...[, ext]) => `_${ext}`)}_${uniqueIdOfOnArchiveFile}_${crypto__WEBPACK_IMPORTED_MODULE_6__.createHash("sha256")
|
296
296
|
.update(onArchiveFile.toString())
|
297
297
|
.digest("hex")
|
298
298
|
.substring(0, 5)}`;
|
@@ -307,7 +307,9 @@ async function downloadAndExtractArchive(params) {
|
|
307
307
|
return basename => basename !== extractDirBasename && basename.startsWith(prefix);
|
308
308
|
})())
|
309
309
|
.map(async (extractDirBasename) => {
|
310
|
-
await (0,_fs_rm__WEBPACK_IMPORTED_MODULE_7__.rm)((0,path__WEBPACK_IMPORTED_MODULE_2__.join)(cacheDirPath, extractDirBasename), {
|
310
|
+
await (0,_fs_rm__WEBPACK_IMPORTED_MODULE_7__.rm)((0,path__WEBPACK_IMPORTED_MODULE_2__.join)(cacheDirPath, extractDirBasename), {
|
311
|
+
recursive: true
|
312
|
+
});
|
311
313
|
await SuccessTracker.removeFromExtracted({
|
312
314
|
cacheDirPath,
|
313
315
|
extractDirBasename
|