keycloakify 10.0.0-rc.65 → 10.0.0-rc.67
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/193.index.js +51 -0
- package/bin/246.index.js +371 -75118
- package/bin/363.index.js +64 -165
- 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 +294 -173
- package/bin/538.index.js +1 -509
- package/bin/{203.index.js → 751.index.js} +306 -305
- package/bin/772.index.js +1 -1
- package/bin/{190.index.js → 837.index.js} +259 -35
- package/bin/932.index.js +1 -578
- package/bin/97.index.js +594 -14
- package/bin/main.js +8 -8
- package/bin/shared/KeycloakVersionRange.d.ts +5 -0
- package/bin/shared/KeycloakVersionRange.js.map +1 -0
- package/bin/shared/buildContext.d.ts +16 -0
- package/bin/shared/buildContext.js.map +1 -0
- package/bin/shared/constants.d.ts +1 -1
- package/bin/shared/constants.js.map +1 -1
- package/bin/shared/copyKeycloakResourcesToPublic.d.ts +8 -0
- package/bin/shared/copyKeycloakResourcesToPublic.js.map +1 -0
- package/bin/shared/downloadKeycloakDefaultTheme.d.ts +10 -0
- package/bin/shared/downloadKeycloakDefaultTheme.js.map +1 -0
- package/bin/shared/downloadKeycloakStaticResources.d.ts +9 -0
- package/bin/shared/downloadKeycloakStaticResources.js.map +1 -0
- package/bin/shared/generateKcGenTs.d.ts +12 -0
- package/bin/shared/generateKcGenTs.js.map +1 -0
- package/bin/shared/metaInfKeycloakThemes.d.ts +13 -0
- package/bin/shared/metaInfKeycloakThemes.js.map +1 -0
- package/bin/shared/promptKeycloakVersion.d.ts +7 -0
- package/bin/shared/promptKeycloakVersion.js.map +1 -0
- package/package.json +21 -12
- 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/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/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 +341 -117
- package/bin/480.index.js +0 -466
- package/bin/818.index.js +0 -1802
- package/bin/827.index.js +0 -1094
- package/bin/shared/constants.js +0 -59
- package/src/bin/shared/getImplementedThemeTypes.ts +0 -38
- package/src/bin/shared/getJarFileBasename.ts +0 -11
- package/src/bin/shared/getThemeSrcDirPath.ts +0 -62
package/bin/526.index.js
CHANGED
@@ -3,126 +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
|
-
let cache;
|
23
|
-
function getImplementedThemeTypes(params) {
|
24
|
-
const { projectDirPath } = params;
|
25
|
-
if (cache !== undefined && cache.projectDirPath === projectDirPath) {
|
26
|
-
const { implementedThemeTypes } = cache;
|
27
|
-
return { implementedThemeTypes };
|
28
|
-
}
|
29
|
-
cache = undefined;
|
30
|
-
const { themeSrcDirPath } = (0,_getThemeSrcDirPath__WEBPACK_IMPORTED_MODULE_3__/* .getThemeSrcDirPath */ .f)({
|
31
|
-
projectDirPath
|
32
|
-
});
|
33
|
-
const implementedThemeTypes = (0,tsafe_objectFromEntries__WEBPACK_IMPORTED_MODULE_1__.objectFromEntries)(["login", "account", "email"].map(themeType => [
|
34
|
-
themeType,
|
35
|
-
fs__WEBPACK_IMPORTED_MODULE_2__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_0__.join)(themeSrcDirPath, themeType))
|
36
|
-
]));
|
37
|
-
cache = { projectDirPath, implementedThemeTypes };
|
38
|
-
return { implementedThemeTypes };
|
39
|
-
}
|
40
|
-
//# sourceMappingURL=getImplementedThemeTypes.js.map
|
41
|
-
|
42
|
-
/***/ }),
|
43
|
-
|
44
|
-
/***/ 2323:
|
45
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
46
|
-
|
47
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
48
|
-
/* harmony export */ "m": () => (/* binding */ getJarFileBasename)
|
49
|
-
/* harmony export */ });
|
50
|
-
function getJarFileBasename(params) {
|
51
|
-
const { keycloakVersionRange } = params;
|
52
|
-
const jarFileBasename = `keycloak-theme-for-kc-${keycloakVersionRange}.jar`;
|
53
|
-
return { jarFileBasename };
|
54
|
-
}
|
55
|
-
//# sourceMappingURL=getJarFileBasename.js.map
|
56
|
-
|
57
|
-
/***/ }),
|
58
|
-
|
59
|
-
/***/ 39216:
|
60
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
61
|
-
|
62
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
63
|
-
/* harmony export */ "f": () => (/* binding */ getThemeSrcDirPath)
|
64
|
-
/* harmony export */ });
|
65
|
-
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57147);
|
66
|
-
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
|
67
|
-
/* harmony import */ var tsafe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1666);
|
68
|
-
/* harmony import */ var tsafe__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(tsafe__WEBPACK_IMPORTED_MODULE_1__);
|
69
|
-
/* harmony import */ var _tools_crawl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73036);
|
70
|
-
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(71017);
|
71
|
-
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__);
|
72
|
-
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(173);
|
73
|
-
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(78818);
|
74
|
-
/* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_5__);
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
let cache = undefined;
|
82
|
-
/** Can't catch error, if the directory isn't found, this function will just exit the process with an error message. */
|
83
|
-
function getThemeSrcDirPath(params) {
|
84
|
-
const { projectDirPath } = params;
|
85
|
-
if (cache !== undefined && cache.projectDirPath === projectDirPath) {
|
86
|
-
const { themeSrcDirPath } = cache;
|
87
|
-
return { themeSrcDirPath };
|
88
|
-
}
|
89
|
-
cache = undefined;
|
90
|
-
const { themeSrcDirPath } = (() => {
|
91
|
-
const srcDirPath = (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(projectDirPath, "src");
|
92
|
-
const themeSrcDirPath = (0,_tools_crawl__WEBPACK_IMPORTED_MODULE_2__/* .crawl */ .J)({
|
93
|
-
dirPath: srcDirPath,
|
94
|
-
returnedPathsType: "relative to dirPath"
|
95
|
-
})
|
96
|
-
.map(fileRelativePath => {
|
97
|
-
for (const themeSrcDirBasename of themeSrcDirBasenames) {
|
98
|
-
const split = fileRelativePath.split(themeSrcDirBasename);
|
99
|
-
if (split.length === 2) {
|
100
|
-
return (0,path__WEBPACK_IMPORTED_MODULE_3__.join)(srcDirPath, split[0] + themeSrcDirBasename);
|
101
|
-
}
|
102
|
-
}
|
103
|
-
return undefined;
|
104
|
-
})
|
105
|
-
.filter((0,tsafe__WEBPACK_IMPORTED_MODULE_1__.exclude)(undefined))[0];
|
106
|
-
if (themeSrcDirPath !== undefined) {
|
107
|
-
return { themeSrcDirPath };
|
108
|
-
}
|
109
|
-
for (const themeType of [..._constants__WEBPACK_IMPORTED_MODULE_4__/* .themeTypes */ .rO, "email"]) {
|
110
|
-
if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync((0,path__WEBPACK_IMPORTED_MODULE_3__.join)(srcDirPath, themeType))) {
|
111
|
-
continue;
|
112
|
-
}
|
113
|
-
return { themeSrcDirPath: srcDirPath };
|
114
|
-
}
|
115
|
-
console.log(chalk__WEBPACK_IMPORTED_MODULE_5___default().red("Can't locate your theme source directory. It should be either: "));
|
116
|
-
process.exit(-1);
|
117
|
-
})();
|
118
|
-
cache = { projectDirPath, themeSrcDirPath };
|
119
|
-
return { themeSrcDirPath };
|
120
|
-
}
|
121
|
-
const themeSrcDirBasenames = ["keycloak-theme", "keycloak_theme"];
|
122
|
-
//# sourceMappingURL=getThemeSrcDirPath.js.map
|
123
|
-
|
124
|
-
/***/ }),
|
125
|
-
|
126
6
|
/***/ 95781:
|
127
7
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
128
8
|
|
@@ -347,14 +227,10 @@ var shared_buildContext = __webpack_require__(87751);
|
|
347
227
|
var exclude = __webpack_require__(41370);
|
348
228
|
// EXTERNAL MODULE: ./dist/bin/shared/promptKeycloakVersion.js + 2 modules
|
349
229
|
var promptKeycloakVersion = __webpack_require__(95781);
|
350
|
-
// EXTERNAL MODULE: ./dist/bin/shared/getImplementedThemeTypes.js
|
351
|
-
var getImplementedThemeTypes = __webpack_require__(64409);
|
352
230
|
// EXTERNAL MODULE: ./dist/bin/shared/constants.js
|
353
231
|
var constants = __webpack_require__(173);
|
354
232
|
// EXTERNAL MODULE: ./dist/bin/tools/SemVer.js
|
355
233
|
var SemVer = __webpack_require__(12171);
|
356
|
-
// EXTERNAL MODULE: ./dist/bin/shared/getJarFileBasename.js
|
357
|
-
var getJarFileBasename = __webpack_require__(2323);
|
358
234
|
// EXTERNAL MODULE: ./node_modules/tsafe/assert.js
|
359
235
|
var assert = __webpack_require__(88078);
|
360
236
|
// EXTERNAL MODULE: external "fs"
|
@@ -475,11 +351,11 @@ async function appBuild(params) {
|
|
475
351
|
|
476
352
|
(0,assert.assert)();
|
477
353
|
async function keycloakifyBuild(params) {
|
478
|
-
const {
|
354
|
+
const { buildForKeycloakMajorVersionNumber, buildContext } = params;
|
479
355
|
const dResult = new Deferred.Deferred();
|
480
356
|
const child = external_child_process_.spawn("npx", ["keycloakify", "build"], {
|
481
357
|
cwd: buildContext.projectDirPath,
|
482
|
-
env: Object.assign(Object.assign({}, process.env), { [constants/*
|
358
|
+
env: Object.assign(Object.assign({}, process.env), { [constants/* buildForKeycloakMajorVersionEnvName */.um]: `${buildForKeycloakMajorVersionNumber}` }),
|
483
359
|
shell: true
|
484
360
|
});
|
485
361
|
child.stdout.on("data", data => process.stdout.write(data));
|
@@ -515,8 +391,6 @@ var fs_rm = __webpack_require__(8699);
|
|
515
391
|
|
516
392
|
|
517
393
|
|
518
|
-
|
519
|
-
|
520
394
|
|
521
395
|
|
522
396
|
|
@@ -559,12 +433,11 @@ async function command(params) {
|
|
559
433
|
}
|
560
434
|
const { cliCommandOptions } = params;
|
561
435
|
const buildContext = (0,shared_buildContext/* getBuildContext */.s)({ cliCommandOptions });
|
562
|
-
const { keycloakVersion
|
436
|
+
const { keycloakVersion } = await (async () => {
|
563
437
|
if (cliCommandOptions.keycloakVersion !== undefined) {
|
564
438
|
return {
|
565
439
|
keycloakVersion: cliCommandOptions.keycloakVersion,
|
566
|
-
keycloakMajorNumber: SemVer/* SemVer.parse */.h.parse(cliCommandOptions.keycloakVersion)
|
567
|
-
.major
|
440
|
+
keycloakMajorNumber: SemVer/* SemVer.parse */.h.parse(cliCommandOptions.keycloakVersion).major
|
568
441
|
};
|
569
442
|
}
|
570
443
|
console.log(source_default().cyan("On which version of Keycloak do you want to test your theme?"));
|
@@ -574,60 +447,32 @@ async function command(params) {
|
|
574
447
|
cacheDirPath: buildContext.cacheDirPath
|
575
448
|
});
|
576
449
|
console.log(`→ ${keycloakVersion}`);
|
577
|
-
|
578
|
-
return { keycloakVersion, keycloakMajorNumber };
|
579
|
-
})();
|
580
|
-
const keycloakVersionRange = (() => {
|
581
|
-
const doesImplementAccountTheme = (0,getImplementedThemeTypes/* getImplementedThemeTypes */.C)({
|
582
|
-
projectDirPath: buildContext.projectDirPath
|
583
|
-
}).implementedThemeTypes.account;
|
584
|
-
if (doesImplementAccountTheme) {
|
585
|
-
const keycloakVersionRange = (() => {
|
586
|
-
if (keycloakMajorVersionNumber <= 21) {
|
587
|
-
return "21-and-below";
|
588
|
-
}
|
589
|
-
(0,assert.assert)(keycloakMajorVersionNumber !== 22);
|
590
|
-
if (keycloakMajorVersionNumber === 23) {
|
591
|
-
return "23";
|
592
|
-
}
|
593
|
-
if (keycloakMajorVersionNumber === 24) {
|
594
|
-
return "24";
|
595
|
-
}
|
596
|
-
return "25-and-above";
|
597
|
-
})();
|
598
|
-
(0,assert.assert)();
|
599
|
-
return keycloakVersionRange;
|
600
|
-
}
|
601
|
-
else {
|
602
|
-
const keycloakVersionRange = (() => {
|
603
|
-
if (keycloakMajorVersionNumber <= 21) {
|
604
|
-
return "21-and-below";
|
605
|
-
}
|
606
|
-
return "22-and-above";
|
607
|
-
})();
|
608
|
-
(0,assert.assert)();
|
609
|
-
return keycloakVersionRange;
|
610
|
-
}
|
450
|
+
return { keycloakVersion };
|
611
451
|
})();
|
612
|
-
const
|
452
|
+
const keycloakMajorVersionNumber = SemVer/* SemVer.parse */.h.parse(keycloakVersion).major;
|
613
453
|
{
|
614
454
|
const { isAppBuildSuccess } = await appBuild({
|
615
455
|
buildContext
|
616
456
|
});
|
617
457
|
if (!isAppBuildSuccess) {
|
618
|
-
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.`));
|
619
459
|
process.exit(1);
|
620
460
|
}
|
621
461
|
const { isKeycloakifyBuildSuccess } = await keycloakifyBuild({
|
622
|
-
|
462
|
+
buildForKeycloakMajorVersionNumber: keycloakMajorVersionNumber,
|
623
463
|
buildContext
|
624
464
|
});
|
625
465
|
if (!isKeycloakifyBuildSuccess) {
|
626
|
-
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.`));
|
627
467
|
process.exit(1);
|
628
468
|
}
|
629
469
|
}
|
630
|
-
|
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))}`);
|
631
476
|
const realmJsonFilePath = await (async () => {
|
632
477
|
if (cliCommandOptions.realmJsonFilePath !== undefined) {
|
633
478
|
if (cliCommandOptions.realmJsonFilePath === "none") {
|
@@ -670,7 +515,6 @@ async function command(params) {
|
|
670
515
|
.replace(/keycloakify\-starter/g, buildContext.themeNames[0])), "utf8");
|
671
516
|
return filePath;
|
672
517
|
})();
|
673
|
-
const jarFilePath = (0,external_path_.join)(buildContext.keycloakifyBuildDirPath, jarFileBasename);
|
674
518
|
async function extractThemeResourcesFromJar() {
|
675
519
|
await (0,extractArchive/* extractArchive */.N)({
|
676
520
|
archiveFilePath: jarFilePath,
|
@@ -690,7 +534,7 @@ async function command(params) {
|
|
690
534
|
}
|
691
535
|
}
|
692
536
|
await extractThemeResourcesFromJar();
|
693
|
-
const jarFilePath_cacheDir = (0,external_path_.join)(buildContext.cacheDirPath,
|
537
|
+
const jarFilePath_cacheDir = (0,external_path_.join)(buildContext.cacheDirPath, (0,external_path_.basename)(jarFilePath));
|
694
538
|
external_fs_.copyFileSync(jarFilePath, jarFilePath_cacheDir);
|
695
539
|
try {
|
696
540
|
external_child_process_.execSync(`docker rm --force ${constants/* containerName */.h6}`, {
|
@@ -768,6 +612,8 @@ async function command(params) {
|
|
768
612
|
child.stdout.off("data", handler);
|
769
613
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
770
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.`,
|
771
617
|
"",
|
772
618
|
`Keycloak Admin console: ${source_default().cyan.bold(`http://localhost:${cliCommandOptions.port}`)}`,
|
773
619
|
`- user: ${source_default().cyan.bold("admin")}`,
|
@@ -796,7 +642,7 @@ async function command(params) {
|
|
796
642
|
return;
|
797
643
|
}
|
798
644
|
const { isKeycloakifyBuildSuccess } = await keycloakifyBuild({
|
799
|
-
|
645
|
+
buildForKeycloakMajorVersionNumber: keycloakMajorVersionNumber,
|
800
646
|
buildContext
|
801
647
|
});
|
802
648
|
if (!isKeycloakifyBuildSuccess) {
|
@@ -831,6 +677,281 @@ async function command(params) {
|
|
831
677
|
|
832
678
|
/***/ }),
|
833
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
|
+
|
834
955
|
/***/ 90665:
|
835
956
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
836
957
|
|