keycloakify 10.0.0-rc.64 → 10.0.0-rc.66
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/account/KcContext/KcContext.d.ts +1 -0
- package/account/KcContext/KcContext.js.map +1 -1
- package/account/KcContext/kcContextMocks.js +2 -1
- package/account/KcContext/kcContextMocks.js.map +1 -1
- package/account/pages/Totp.js +2 -7
- package/account/pages/Totp.js.map +1 -1
- package/bin/193.index.js +0 -501
- package/bin/246.index.js +371 -75118
- package/bin/363.index.js +36 -665
- package/bin/453.index.js +603 -23
- package/bin/{890.index.js → 456.index.js} +1831 -3
- package/bin/490.index.js +75195 -0
- package/bin/526.index.js +311 -166
- package/bin/538.index.js +1 -509
- package/bin/{240.index.js → 751.index.js} +306 -322
- package/bin/772.index.js +1 -1
- package/bin/837.index.js +787 -0
- package/bin/932.index.js +1 -574
- package/bin/97.index.js +594 -14
- package/bin/main.js +8 -8
- package/bin/shared/buildContext.d.ts +16 -0
- package/bin/shared/constants.d.ts +1 -1
- package/bin/shared/constants.js +1 -1
- package/bin/shared/constants.js.map +1 -1
- package/package.json +5 -9
- package/src/account/KcContext/KcContext.ts +1 -0
- package/src/account/KcContext/kcContextMocks.ts +2 -1
- package/src/account/pages/Totp.tsx +1 -7
- package/src/bin/add-story.ts +1 -6
- package/src/bin/eject-page.ts +7 -8
- package/src/bin/initialize-email-theme.ts +1 -6
- package/src/bin/keycloakify/buildJars/buildJars.ts +23 -49
- package/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl +8 -6
- package/src/bin/keycloakify/generateResources/generateResourcesForMainTheme.ts +15 -20
- package/src/bin/keycloakify/keycloakify.ts +6 -8
- package/src/bin/shared/buildContext.ts +434 -42
- package/src/bin/shared/constants.ts +2 -1
- package/src/bin/shared/downloadKeycloakDefaultTheme.ts +135 -108
- package/src/bin/shared/generateKcGenTs.ts +2 -6
- package/src/bin/start-keycloak/keycloakifyBuild.ts +4 -4
- package/src/bin/start-keycloak/start-keycloak.ts +40 -83
- package/src/vite-plugin/vite-plugin.ts +5 -4
- package/vite-plugin/index.js +410 -187
- package/bin/480.index.js +0 -466
- package/bin/818.index.js +0 -1802
- package/bin/827.index.js +0 -1094
- package/src/bin/shared/getImplementedThemeTypes.ts +0 -23
- package/src/bin/shared/getJarFileBasename.ts +0 -11
- package/src/bin/shared/getThemeSrcDirPath.ts +0 -62
package/bin/526.index.js
CHANGED
@@ -3,119 +3,6 @@ exports.id = 526;
|
|
3
3
|
exports.ids = [526];
|
4
4
|
exports.modules = {
|
5
5
|
|
6
|
-
/***/ 64409:
|
7
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
8
|
-
|
9
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
10
|
-
/* harmony export */ "C": () => (/* binding */ getImplementedThemeTypes)
|
11
|
-
/* harmony export */ });
|
12
|
-
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
|
13
|
-
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
|
14
|
-
/* harmony import */ var tsafe_objectFromEntries__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(68634);
|
15
|
-
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57147);
|
16
|
-
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_2__);
|
17
|
-
/* harmony import */ var _getThemeSrcDirPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39216);
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
function getImplementedThemeTypes(params) {
|
23
|
-
const { projectDirPath } = params;
|
24
|
-
const { themeSrcDirPath } = (0,_getThemeSrcDirPath__WEBPACK_IMPORTED_MODULE_3__/* .getThemeSrcDirPath */ .f)({
|
25
|
-
projectDirPath
|
26
|
-
});
|
27
|
-
const implementedThemeTypes = (0,tsafe_objectFromEntries__WEBPACK_IMPORTED_MODULE_1__.objectFromEntries)(["login", "account", "email"].map(themeType => [
|
28
|
-
themeType,
|
29
|
-
fs__WEBPACK_IMPORTED_MODULE_2__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_0__.join)(themeSrcDirPath, themeType))
|
30
|
-
]));
|
31
|
-
return { implementedThemeTypes };
|
32
|
-
}
|
33
|
-
//# sourceMappingURL=getImplementedThemeTypes.js.map
|
34
|
-
|
35
|
-
/***/ }),
|
36
|
-
|
37
|
-
/***/ 2323:
|
38
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
39
|
-
|
40
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
41
|
-
/* harmony export */ "m": () => (/* binding */ getJarFileBasename)
|
42
|
-
/* harmony export */ });
|
43
|
-
function getJarFileBasename(params) {
|
44
|
-
const { keycloakVersionRange } = params;
|
45
|
-
const jarFileBasename = `keycloak-theme-for-kc-${keycloakVersionRange}.jar`;
|
46
|
-
return { jarFileBasename };
|
47
|
-
}
|
48
|
-
//# sourceMappingURL=getJarFileBasename.js.map
|
49
|
-
|
50
|
-
/***/ }),
|
51
|
-
|
52
|
-
/***/ 39216:
|
53
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
54
|
-
|
55
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
56
|
-
/* harmony export */ "f": () => (/* binding */ getThemeSrcDirPath)
|
57
|
-
/* harmony export */ });
|
58
|
-
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
|
59
|
-
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
60
|
-
/* harmony import */ var tsafe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1666);
|
61
|
-
/* harmony import */ var tsafe__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tsafe__WEBPACK_IMPORTED_MODULE_1__);
|
62
|
-
/* harmony import */ var _tools_crawl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73036);
|
63
|
-
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71017);
|
64
|
-
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__);
|
65
|
-
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(173);
|
66
|
-
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(78818);
|
67
|
-
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_5__);
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
let cache = undefined;
|
75
|
-
/** Can't catch error, if the directory isn't found, this function will just exit the process with an error message. */
|
76
|
-
function getThemeSrcDirPath(params) {
|
77
|
-
const { projectDirPath } = params;
|
78
|
-
if (cache !== undefined && cache.projectDirPath === projectDirPath) {
|
79
|
-
const { themeSrcDirPath } = cache;
|
80
|
-
return { themeSrcDirPath };
|
81
|
-
}
|
82
|
-
cache = undefined;
|
83
|
-
const { themeSrcDirPath } = (() => {
|
84
|
-
const srcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(projectDirPath, "src");
|
85
|
-
const themeSrcDirPath = (0,_tools_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
|
86
|
-
dirPath: srcDirPath,
|
87
|
-
returnedPathsType: "relative to dirPath"
|
88
|
-
})
|
89
|
-
.map(fileRelativePath => {
|
90
|
-
for (const themeSrcDirBasename of themeSrcDirBasenames) {
|
91
|
-
const split = fileRelativePath.split(themeSrcDirBasename);
|
92
|
-
if (split.length === 2) {
|
93
|
-
return (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(srcDirPath, split[0] + themeSrcDirBasename);
|
94
|
-
}
|
95
|
-
}
|
96
|
-
return undefined;
|
97
|
-
})
|
98
|
-
.filter((0,tsafe__WEBPACK_IMPORTED_MODULE_1__.exclude)(undefined))[0];
|
99
|
-
if (themeSrcDirPath !== undefined) {
|
100
|
-
return { themeSrcDirPath };
|
101
|
-
}
|
102
|
-
for (const themeType of [..._constants__WEBPACK_IMPORTED_MODULE_4__/* .themeTypes */ .rO, "email"]) {
|
103
|
-
if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_3__.join)(srcDirPath, themeType))) {
|
104
|
-
continue;
|
105
|
-
}
|
106
|
-
return { themeSrcDirPath: srcDirPath };
|
107
|
-
}
|
108
|
-
console.log(chalk__WEBPACK_IMPORTED_MODULE_5___default().red("Can't locate your theme source directory. It should be either: "));
|
109
|
-
process.exit(-1);
|
110
|
-
})();
|
111
|
-
cache = { projectDirPath, themeSrcDirPath };
|
112
|
-
return { themeSrcDirPath };
|
113
|
-
}
|
114
|
-
const themeSrcDirBasenames = ["keycloak-theme", "keycloak_theme"];
|
115
|
-
//# sourceMappingURL=getThemeSrcDirPath.js.map
|
116
|
-
|
117
|
-
/***/ }),
|
118
|
-
|
119
6
|
/***/ 95781:
|
120
7
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
121
8
|
|
@@ -340,14 +227,10 @@ var shared_buildContext = __webpack_require__(87751);
|
|
340
227
|
var exclude = __webpack_require__(41370);
|
341
228
|
// EXTERNAL MODULE: ./dist/bin/shared/promptKeycloakVersion.js + 2 modules
|
342
229
|
var promptKeycloakVersion = __webpack_require__(95781);
|
343
|
-
// EXTERNAL MODULE: ./dist/bin/shared/getImplementedThemeTypes.js
|
344
|
-
var getImplementedThemeTypes = __webpack_require__(64409);
|
345
230
|
// EXTERNAL MODULE: ./dist/bin/shared/constants.js
|
346
231
|
var constants = __webpack_require__(173);
|
347
232
|
// EXTERNAL MODULE: ./dist/bin/tools/SemVer.js
|
348
233
|
var SemVer = __webpack_require__(12171);
|
349
|
-
// EXTERNAL MODULE: ./dist/bin/shared/getJarFileBasename.js
|
350
|
-
var getJarFileBasename = __webpack_require__(2323);
|
351
234
|
// EXTERNAL MODULE: ./node_modules/tsafe/assert.js
|
352
235
|
var assert = __webpack_require__(88078);
|
353
236
|
// EXTERNAL MODULE: external "fs"
|
@@ -468,11 +351,11 @@ async function appBuild(params) {
|
|
468
351
|
|
469
352
|
(0,assert.assert)();
|
470
353
|
async function keycloakifyBuild(params) {
|
471
|
-
const {
|
354
|
+
const { buildForKeycloakMajorVersionNumber, buildContext } = params;
|
472
355
|
const dResult = new Deferred.Deferred();
|
473
356
|
const child = external_child_process_.spawn("npx", ["keycloakify", "build"], {
|
474
357
|
cwd: buildContext.projectDirPath,
|
475
|
-
env: Object.assign(Object.assign({}, process.env), { [constants/*
|
358
|
+
env: Object.assign(Object.assign({}, process.env), { [constants/* buildForKeycloakMajorVersionEnvName */.um]: `${buildForKeycloakMajorVersionNumber}` }),
|
476
359
|
shell: true
|
477
360
|
});
|
478
361
|
child.stdout.on("data", data => process.stdout.write(data));
|
@@ -508,8 +391,6 @@ var fs_rm = __webpack_require__(8699);
|
|
508
391
|
|
509
392
|
|
510
393
|
|
511
|
-
|
512
|
-
|
513
394
|
|
514
395
|
|
515
396
|
|
@@ -552,12 +433,11 @@ async function command(params) {
|
|
552
433
|
}
|
553
434
|
const { cliCommandOptions } = params;
|
554
435
|
const buildContext = (0,shared_buildContext/* getBuildContext */.s)({ cliCommandOptions });
|
555
|
-
const { keycloakVersion
|
436
|
+
const { keycloakVersion } = await (async () => {
|
556
437
|
if (cliCommandOptions.keycloakVersion !== undefined) {
|
557
438
|
return {
|
558
439
|
keycloakVersion: cliCommandOptions.keycloakVersion,
|
559
|
-
keycloakMajorNumber: SemVer/* SemVer.parse */.h.parse(cliCommandOptions.keycloakVersion)
|
560
|
-
.major
|
440
|
+
keycloakMajorNumber: SemVer/* SemVer.parse */.h.parse(cliCommandOptions.keycloakVersion).major
|
561
441
|
};
|
562
442
|
}
|
563
443
|
console.log(source_default().cyan("On which version of Keycloak do you want to test your theme?"));
|
@@ -567,60 +447,32 @@ async function command(params) {
|
|
567
447
|
cacheDirPath: buildContext.cacheDirPath
|
568
448
|
});
|
569
449
|
console.log(`→ ${keycloakVersion}`);
|
570
|
-
|
571
|
-
return { keycloakVersion, keycloakMajorNumber };
|
450
|
+
return { keycloakVersion };
|
572
451
|
})();
|
573
|
-
const
|
574
|
-
const doesImplementAccountTheme = (0,getImplementedThemeTypes/* getImplementedThemeTypes */.C)({
|
575
|
-
projectDirPath: buildContext.projectDirPath
|
576
|
-
}).implementedThemeTypes.account;
|
577
|
-
if (doesImplementAccountTheme) {
|
578
|
-
const keycloakVersionRange = (() => {
|
579
|
-
if (keycloakMajorVersionNumber <= 21) {
|
580
|
-
return "21-and-below";
|
581
|
-
}
|
582
|
-
(0,assert.assert)(keycloakMajorVersionNumber !== 22);
|
583
|
-
if (keycloakMajorVersionNumber === 23) {
|
584
|
-
return "23";
|
585
|
-
}
|
586
|
-
if (keycloakMajorVersionNumber === 24) {
|
587
|
-
return "24";
|
588
|
-
}
|
589
|
-
return "25-and-above";
|
590
|
-
})();
|
591
|
-
(0,assert.assert)();
|
592
|
-
return keycloakVersionRange;
|
593
|
-
}
|
594
|
-
else {
|
595
|
-
const keycloakVersionRange = (() => {
|
596
|
-
if (keycloakMajorVersionNumber <= 21) {
|
597
|
-
return "21-and-below";
|
598
|
-
}
|
599
|
-
return "22-and-above";
|
600
|
-
})();
|
601
|
-
(0,assert.assert)();
|
602
|
-
return keycloakVersionRange;
|
603
|
-
}
|
604
|
-
})();
|
605
|
-
const { jarFileBasename } = (0,getJarFileBasename/* getJarFileBasename */.m)({ keycloakVersionRange });
|
452
|
+
const keycloakMajorVersionNumber = SemVer/* SemVer.parse */.h.parse(keycloakVersion).major;
|
606
453
|
{
|
607
454
|
const { isAppBuildSuccess } = await appBuild({
|
608
455
|
buildContext
|
609
456
|
});
|
610
457
|
if (!isAppBuildSuccess) {
|
611
|
-
console.log(source_default().red(`App build failed, exiting. Try running 'npm run build
|
458
|
+
console.log(source_default().red(`App build failed, exiting. Try running 'npm run build' and see what's wrong.`));
|
612
459
|
process.exit(1);
|
613
460
|
}
|
614
461
|
const { isKeycloakifyBuildSuccess } = await keycloakifyBuild({
|
615
|
-
|
462
|
+
buildForKeycloakMajorVersionNumber: keycloakMajorVersionNumber,
|
616
463
|
buildContext
|
617
464
|
});
|
618
465
|
if (!isKeycloakifyBuildSuccess) {
|
619
|
-
console.log(source_default().red(`Keycloakify build failed, exiting. Try running '
|
466
|
+
console.log(source_default().red(`Keycloakify build failed, exiting. Try running 'npx keycloakify build' and see what's wrong.`));
|
620
467
|
process.exit(1);
|
621
468
|
}
|
622
469
|
}
|
623
|
-
|
470
|
+
const jarFilePath = external_fs_.readdirSync(buildContext.keycloakifyBuildDirPath)
|
471
|
+
.filter(fileBasename => fileBasename.endsWith(".jar"))
|
472
|
+
.map(fileBasename => (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, fileBasename))
|
473
|
+
.sort((a, b) => external_fs_.statSync(b).mtimeMs - external_fs_.statSync(a).mtimeMs)[0];
|
474
|
+
(0,assert.assert)(jarFilePath !== undefined);
|
475
|
+
console.log(`Using ${source_default().bold((0,external_path_.basename)(jarFilePath))}`);
|
624
476
|
const realmJsonFilePath = await (async () => {
|
625
477
|
if (cliCommandOptions.realmJsonFilePath !== undefined) {
|
626
478
|
if (cliCommandOptions.realmJsonFilePath === "none") {
|
@@ -663,7 +515,6 @@ async function command(params) {
|
|
663
515
|
.replace(/keycloakify\-starter/g, buildContext.themeNames[0])), "utf8");
|
664
516
|
return filePath;
|
665
517
|
})();
|
666
|
-
const jarFilePath = (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, jarFileBasename);
|
667
518
|
async function extractThemeResourcesFromJar() {
|
668
519
|
await (0,extractArchive/* extractArchive */.N)({
|
669
520
|
archiveFilePath: jarFilePath,
|
@@ -683,7 +534,7 @@ async function command(params) {
|
|
683
534
|
}
|
684
535
|
}
|
685
536
|
await extractThemeResourcesFromJar();
|
686
|
-
const jarFilePath_cacheDir = (0,external_path_.join)(buildContext.cacheDirPath,
|
537
|
+
const jarFilePath_cacheDir = (0,external_path_.join)(buildContext.cacheDirPath, (0,external_path_.basename)(jarFilePath));
|
687
538
|
external_fs_.copyFileSync(jarFilePath, jarFilePath_cacheDir);
|
688
539
|
try {
|
689
540
|
external_child_process_.execSync(`docker rm --force ${constants/* containerName */.h6}`, {
|
@@ -761,6 +612,8 @@ async function command(params) {
|
|
761
612
|
child.stdout.off("data", handler);
|
762
613
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
763
614
|
console.log([
|
615
|
+
"",
|
616
|
+
`The ftl files from ${source_default().bold(`.${external_path_.sep}${(0,external_path_.relative)(process.cwd(), (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, "theme"))}`)} are mounted in the Keycloak container.`,
|
764
617
|
"",
|
765
618
|
`Keycloak Admin console: ${source_default().cyan.bold(`http://localhost:${cliCommandOptions.port}`)}`,
|
766
619
|
`- user: ${source_default().cyan.bold("admin")}`,
|
@@ -789,7 +642,7 @@ async function command(params) {
|
|
789
642
|
return;
|
790
643
|
}
|
791
644
|
const { isKeycloakifyBuildSuccess } = await keycloakifyBuild({
|
792
|
-
|
645
|
+
buildForKeycloakMajorVersionNumber: keycloakMajorVersionNumber,
|
793
646
|
buildContext
|
794
647
|
});
|
795
648
|
if (!isKeycloakifyBuildSuccess) {
|
@@ -822,6 +675,298 @@ async function command(params) {
|
|
822
675
|
|
823
676
|
//# sourceMappingURL=index.js.map
|
824
677
|
|
678
|
+
/***/ }),
|
679
|
+
|
680
|
+
/***/ 12171:
|
681
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
682
|
+
|
683
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
684
|
+
/* harmony export */ "h": () => (/* binding */ SemVer)
|
685
|
+
/* harmony export */ });
|
686
|
+
var SemVer;
|
687
|
+
(function (SemVer) {
|
688
|
+
const bumpTypes = ["major", "minor", "patch", "rc", "no bump"];
|
689
|
+
function parse(versionStr) {
|
690
|
+
const match = versionStr.match(/^v?([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(?:-rc.([0-9]+))?$/);
|
691
|
+
if (!match) {
|
692
|
+
throw new Error(`${versionStr} is not a valid semantic version`);
|
693
|
+
}
|
694
|
+
const semVer = Object.assign({ major: parseInt(match[1]), minor: parseInt(match[2]), patch: (() => {
|
695
|
+
const str = match[3];
|
696
|
+
return str === undefined ? 0 : parseInt(str);
|
697
|
+
})() }, (() => {
|
698
|
+
const str = match[4];
|
699
|
+
return str === undefined ? {} : { rc: parseInt(str) };
|
700
|
+
})());
|
701
|
+
const initialStr = stringify(semVer);
|
702
|
+
Object.defineProperty(semVer, "parsedFrom", {
|
703
|
+
enumerable: true,
|
704
|
+
get: function () {
|
705
|
+
const currentStr = stringify(this);
|
706
|
+
if (currentStr !== initialStr) {
|
707
|
+
throw new Error(`SemVer.parsedFrom can't be read anymore, the version have been modified from ${initialStr} to ${currentStr}`);
|
708
|
+
}
|
709
|
+
return versionStr;
|
710
|
+
}
|
711
|
+
});
|
712
|
+
return semVer;
|
713
|
+
}
|
714
|
+
SemVer.parse = parse;
|
715
|
+
function stringify(v) {
|
716
|
+
return `${v.major}.${v.minor}.${v.patch}${v.rc === undefined ? "" : `-rc.${v.rc}`}`;
|
717
|
+
}
|
718
|
+
SemVer.stringify = stringify;
|
719
|
+
/**
|
720
|
+
*
|
721
|
+
* v1 < v2 => -1
|
722
|
+
* v1 === v2 => 0
|
723
|
+
* v1 > v2 => 1
|
724
|
+
*
|
725
|
+
*/
|
726
|
+
function compare(v1, v2) {
|
727
|
+
const sign = (diff) => (diff === 0 ? 0 : diff < 0 ? -1 : 1);
|
728
|
+
const noUndefined = (n) => n !== null && n !== void 0 ? n : Infinity;
|
729
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
730
|
+
if (noUndefined(v1[level]) !== noUndefined(v2[level])) {
|
731
|
+
return sign(noUndefined(v1[level]) - noUndefined(v2[level]));
|
732
|
+
}
|
733
|
+
}
|
734
|
+
return 0;
|
735
|
+
}
|
736
|
+
SemVer.compare = compare;
|
737
|
+
/*
|
738
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0")) === -1 )
|
739
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("3.0.0-rc.4")) === -1 )
|
740
|
+
console.log(compare(parse("3.0.0-rc.3"), parse("4.0.0")) === -1 )
|
741
|
+
*/
|
742
|
+
function bumpType(params) {
|
743
|
+
const versionAhead = typeof params.versionAhead === "string"
|
744
|
+
? parse(params.versionAhead)
|
745
|
+
: params.versionAhead;
|
746
|
+
const versionBehind = typeof params.versionBehind === "string"
|
747
|
+
? parse(params.versionBehind)
|
748
|
+
: params.versionBehind;
|
749
|
+
if (compare(versionBehind, versionAhead) === 1) {
|
750
|
+
throw new Error(`Version regression ${stringify(versionBehind)} -> ${stringify(versionAhead)}`);
|
751
|
+
}
|
752
|
+
for (const level of ["major", "minor", "patch", "rc"]) {
|
753
|
+
if (versionBehind[level] !== versionAhead[level]) {
|
754
|
+
return level;
|
755
|
+
}
|
756
|
+
}
|
757
|
+
return "no bump";
|
758
|
+
}
|
759
|
+
SemVer.bumpType = bumpType;
|
760
|
+
})(SemVer || (SemVer = {}));
|
761
|
+
//# sourceMappingURL=SemVer.js.map
|
762
|
+
|
763
|
+
/***/ }),
|
764
|
+
|
765
|
+
/***/ 29121:
|
766
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
767
|
+
|
768
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
769
|
+
/* harmony export */ "N": () => (/* binding */ extractArchive)
|
770
|
+
/* harmony export */ });
|
771
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73292);
|
772
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__);
|
773
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(57147);
|
774
|
+
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
|
775
|
+
/* harmony import */ var yauzl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(78781);
|
776
|
+
/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12781);
|
777
|
+
/* harmony import */ var stream__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(stream__WEBPACK_IMPORTED_MODULE_3__);
|
778
|
+
/* harmony import */ var evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50689);
|
779
|
+
/* harmony import */ var evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__);
|
780
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71017);
|
781
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_5__);
|
782
|
+
/* harmony import */ var _fs_existsAsync__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(43765);
|
783
|
+
|
784
|
+
|
785
|
+
|
786
|
+
|
787
|
+
|
788
|
+
|
789
|
+
|
790
|
+
async function extractArchive(params) {
|
791
|
+
const { archiveFilePath, onArchiveFile } = params;
|
792
|
+
const zipFile = await new Promise((resolve, reject) => {
|
793
|
+
yauzl__WEBPACK_IMPORTED_MODULE_2__.open(archiveFilePath, { lazyEntries: true }, async (error, zipFile) => {
|
794
|
+
if (error) {
|
795
|
+
reject(error);
|
796
|
+
return;
|
797
|
+
}
|
798
|
+
resolve(zipFile);
|
799
|
+
});
|
800
|
+
});
|
801
|
+
const dDone = new evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__.Deferred();
|
802
|
+
zipFile.once("end", () => {
|
803
|
+
zipFile.close();
|
804
|
+
dDone.resolve();
|
805
|
+
});
|
806
|
+
const writeFile = async (entry, params) => {
|
807
|
+
const { filePath, modifiedData } = params;
|
808
|
+
{
|
809
|
+
const dirPath = (0,path__WEBPACK_IMPORTED_MODULE_5__.dirname)(filePath);
|
810
|
+
if (!(await (0,_fs_existsAsync__WEBPACK_IMPORTED_MODULE_6__/* .existsAsync */ .o)(dirPath))) {
|
811
|
+
await fs_promises__WEBPACK_IMPORTED_MODULE_0___default().mkdir(dirPath, { recursive: true });
|
812
|
+
}
|
813
|
+
}
|
814
|
+
if (modifiedData !== undefined) {
|
815
|
+
await fs_promises__WEBPACK_IMPORTED_MODULE_0___default().writeFile(filePath, modifiedData);
|
816
|
+
return;
|
817
|
+
}
|
818
|
+
const readStream = await new Promise(resolve => zipFile.openReadStream(entry, async (error, readStream) => {
|
819
|
+
if (error) {
|
820
|
+
dDone.reject(error);
|
821
|
+
return;
|
822
|
+
}
|
823
|
+
resolve(readStream);
|
824
|
+
}));
|
825
|
+
const dDoneWithFile = new evt_tools_Deferred__WEBPACK_IMPORTED_MODULE_4__.Deferred();
|
826
|
+
stream__WEBPACK_IMPORTED_MODULE_3___default().pipeline(readStream, fs__WEBPACK_IMPORTED_MODULE_1___default().createWriteStream(filePath), error => {
|
827
|
+
if (error) {
|
828
|
+
dDone.reject(error);
|
829
|
+
return;
|
830
|
+
}
|
831
|
+
dDoneWithFile.resolve();
|
832
|
+
});
|
833
|
+
await dDoneWithFile.pr;
|
834
|
+
};
|
835
|
+
const readFile = (entry) => new Promise(resolve => zipFile.openReadStream(entry, async (error, readStream) => {
|
836
|
+
if (error) {
|
837
|
+
dDone.reject(error);
|
838
|
+
return;
|
839
|
+
}
|
840
|
+
const chunks = [];
|
841
|
+
readStream.on("data", chunk => {
|
842
|
+
chunks.push(chunk);
|
843
|
+
});
|
844
|
+
readStream.on("end", () => {
|
845
|
+
resolve(Buffer.concat(chunks));
|
846
|
+
});
|
847
|
+
readStream.on("error", error => {
|
848
|
+
dDone.reject(error);
|
849
|
+
});
|
850
|
+
}));
|
851
|
+
zipFile.on("entry", async (entry) => {
|
852
|
+
handle_file: {
|
853
|
+
// NOTE: Skip directories
|
854
|
+
if (entry.fileName.endsWith("/")) {
|
855
|
+
break handle_file;
|
856
|
+
}
|
857
|
+
let hasEarlyExitBeenCalled = false;
|
858
|
+
await onArchiveFile({
|
859
|
+
relativeFilePathInArchive: entry.fileName.split("/").join(path__WEBPACK_IMPORTED_MODULE_5__.sep),
|
860
|
+
readFile: () => readFile(entry),
|
861
|
+
writeFile: params => writeFile(entry, params),
|
862
|
+
earlyExit: () => {
|
863
|
+
hasEarlyExitBeenCalled = true;
|
864
|
+
}
|
865
|
+
});
|
866
|
+
if (hasEarlyExitBeenCalled) {
|
867
|
+
zipFile.close();
|
868
|
+
dDone.resolve();
|
869
|
+
return;
|
870
|
+
}
|
871
|
+
}
|
872
|
+
zipFile.readEntry();
|
873
|
+
});
|
874
|
+
zipFile.readEntry();
|
875
|
+
await dDone.pr;
|
876
|
+
}
|
877
|
+
//# sourceMappingURL=extractArchive.js.map
|
878
|
+
|
879
|
+
/***/ }),
|
880
|
+
|
881
|
+
/***/ 43765:
|
882
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
883
|
+
|
884
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
885
|
+
/* harmony export */ "o": () => (/* binding */ existsAsync)
|
886
|
+
/* harmony export */ });
|
887
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73292);
|
888
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__);
|
889
|
+
|
890
|
+
async function existsAsync(path) {
|
891
|
+
try {
|
892
|
+
await fs_promises__WEBPACK_IMPORTED_MODULE_0__.stat(path);
|
893
|
+
return true;
|
894
|
+
}
|
895
|
+
catch (error) {
|
896
|
+
if (error.code === "ENOENT")
|
897
|
+
return false;
|
898
|
+
throw error;
|
899
|
+
}
|
900
|
+
}
|
901
|
+
//# sourceMappingURL=fs.existsAsync.js.map
|
902
|
+
|
903
|
+
/***/ }),
|
904
|
+
|
905
|
+
/***/ 8699:
|
906
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
907
|
+
|
908
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
909
|
+
/* harmony export */ "rm": () => (/* binding */ rm)
|
910
|
+
/* harmony export */ });
|
911
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73292);
|
912
|
+
/* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_promises__WEBPACK_IMPORTED_MODULE_0__);
|
913
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71017);
|
914
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
|
915
|
+
/* harmony import */ var _SemVer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12171);
|
916
|
+
|
917
|
+
|
918
|
+
|
919
|
+
/**
|
920
|
+
* Polyfill of fs.rm(dirPath, { "recursive": true })
|
921
|
+
* For older version of Node
|
922
|
+
*/
|
923
|
+
async function rm(dirPath, options) {
|
924
|
+
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) {
|
925
|
+
return fs_promises__WEBPACK_IMPORTED_MODULE_0__.rm(dirPath, options);
|
926
|
+
}
|
927
|
+
const { force = true } = options;
|
928
|
+
if (force && !(await checkDirExists(dirPath))) {
|
929
|
+
return;
|
930
|
+
}
|
931
|
+
const removeDir_rec = async (dirPath) => Promise.all((await fs_promises__WEBPACK_IMPORTED_MODULE_0__.readdir(dirPath)).map(async (basename) => {
|
932
|
+
const fileOrDirpath = (0,path__WEBPACK_IMPORTED_MODULE_1__.join)(dirPath, basename);
|
933
|
+
if ((await fs_promises__WEBPACK_IMPORTED_MODULE_0__.lstat(fileOrDirpath)).isDirectory()) {
|
934
|
+
await removeDir_rec(fileOrDirpath);
|
935
|
+
}
|
936
|
+
else {
|
937
|
+
await fs_promises__WEBPACK_IMPORTED_MODULE_0__.unlink(fileOrDirpath);
|
938
|
+
}
|
939
|
+
}));
|
940
|
+
await removeDir_rec(dirPath);
|
941
|
+
}
|
942
|
+
async function checkDirExists(dirPath) {
|
943
|
+
try {
|
944
|
+
await fs_promises__WEBPACK_IMPORTED_MODULE_0__.access(dirPath, fs_promises__WEBPACK_IMPORTED_MODULE_0__.constants.F_OK);
|
945
|
+
return true;
|
946
|
+
}
|
947
|
+
catch (_a) {
|
948
|
+
return false;
|
949
|
+
}
|
950
|
+
}
|
951
|
+
//# sourceMappingURL=fs.rm.js.map
|
952
|
+
|
953
|
+
/***/ }),
|
954
|
+
|
955
|
+
/***/ 90665:
|
956
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
957
|
+
|
958
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
959
|
+
/* harmony export */ "V": () => (/* binding */ isInside)
|
960
|
+
/* harmony export */ });
|
961
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(71017);
|
962
|
+
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);
|
963
|
+
|
964
|
+
function isInside(params) {
|
965
|
+
const { dirPath, filePath } = params;
|
966
|
+
return !(0,path__WEBPACK_IMPORTED_MODULE_0__.relative)(dirPath, filePath).startsWith("..");
|
967
|
+
}
|
968
|
+
//# sourceMappingURL=isInside.js.map
|
969
|
+
|
825
970
|
/***/ })
|
826
971
|
|
827
972
|
};
|