keycloakify 8.4.1 → 9.0.0-rc.1
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/README.md +11 -53
- package/account/kcContext/KcContext.js.map +1 -1
- package/account/kcContext/createGetKcContext.js +2 -6
- package/account/kcContext/createGetKcContext.js.map +1 -1
- package/account/kcContext/kcContextMocks.js +4 -3
- package/account/kcContext/kcContextMocks.js.map +1 -1
- package/bin/constants.d.ts +7 -0
- package/bin/constants.js +10 -0
- package/bin/constants.js.map +1 -0
- package/bin/copy-keycloak-resources-to-public.js +34 -22
- package/bin/copy-keycloak-resources-to-public.js.map +1 -1
- package/bin/download-builtin-keycloak-theme.d.ts +4 -1
- package/bin/download-builtin-keycloak-theme.js +8 -6
- package/bin/download-builtin-keycloak-theme.js.map +1 -1
- package/bin/eject-keycloak-page.js +5 -3
- package/bin/eject-keycloak-page.js.map +1 -1
- package/bin/getSrcDirPath.d.ts +1 -1
- package/bin/getSrcDirPath.js +4 -4
- package/bin/getSrcDirPath.js.map +1 -1
- package/bin/initialize-email-theme.js +9 -9
- package/bin/initialize-email-theme.js.map +1 -1
- package/bin/keycloakify/BuildOptions.d.ts +8 -6
- package/bin/keycloakify/BuildOptions.js +63 -71
- package/bin/keycloakify/BuildOptions.js.map +1 -1
- package/bin/keycloakify/generateFtl/generateFtl.d.ts +2 -3
- package/bin/keycloakify/generateFtl/generateFtl.js +3 -4
- package/bin/keycloakify/generateFtl/generateFtl.js.map +1 -1
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountPages.java +33 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountProvider.java +76 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountProviderFactory.java +25 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountSpi.java +50 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/FreeMarkerAccountProvider.java +424 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/FreeMarkerAccountProviderFactory.java +51 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/Templates.java +51 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/AccountBean.java +91 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/AccountFederatedIdentityBean.java +157 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/ApplicationsBean.java +258 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/AuthorizationBean.java +515 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/FeaturesBean.java +56 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/LogBean.java +95 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/PasswordBean.java +34 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/RealmBean.java +75 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/ReferrerBean.java +38 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/SessionsBean.java +93 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/TotpBean.java +125 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/UrlBean.java +121 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/services/AccountUrls.java +115 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/services/resources/account/AccountFormService.java +1310 -0
- package/bin/keycloakify/generateJavaStackFiles/account-v1-java/services/resources/account/AccountFormServiceFactory.java +64 -0
- package/bin/keycloakify/generateJavaStackFiles/bringInAccountV1.d.ts +7 -0
- package/bin/keycloakify/generateJavaStackFiles/bringInAccountV1.js +194 -0
- package/bin/keycloakify/generateJavaStackFiles/bringInAccountV1.js.map +1 -0
- package/bin/keycloakify/{generateJavaStackFiles.d.ts → generateJavaStackFiles/generateJavaStackFiles.d.ts} +6 -6
- package/bin/keycloakify/generateJavaStackFiles/generateJavaStackFiles.js +276 -0
- package/bin/keycloakify/generateJavaStackFiles/generateJavaStackFiles.js.map +1 -0
- package/bin/keycloakify/generateJavaStackFiles/index.d.ts +1 -0
- package/bin/keycloakify/generateJavaStackFiles/index.js +18 -0
- package/bin/keycloakify/generateJavaStackFiles/index.js.map +1 -0
- package/bin/keycloakify/generateStartKeycloakTestingContainer.d.ts +1 -3
- package/bin/keycloakify/generateStartKeycloakTestingContainer.js +15 -6
- package/bin/keycloakify/generateStartKeycloakTestingContainer.js.map +1 -1
- package/bin/keycloakify/generateTheme/downloadKeycloakStaticResources.d.ts +5 -2
- package/bin/keycloakify/generateTheme/downloadKeycloakStaticResources.js +11 -9
- package/bin/keycloakify/generateTheme/downloadKeycloakStaticResources.js.map +1 -1
- package/bin/keycloakify/generateTheme/generateMessageProperties.d.ts +1 -1
- package/bin/keycloakify/generateTheme/generateTheme.d.ts +6 -5
- package/bin/keycloakify/generateTheme/generateTheme.js +59 -49
- package/bin/keycloakify/generateTheme/generateTheme.js.map +1 -1
- package/bin/keycloakify/generateTheme/readExtraPageNames.d.ts +1 -1
- package/bin/keycloakify/generateTheme/readExtraPageNames.js.map +1 -1
- package/bin/keycloakify/generateTheme/readFieldNameUsage.d.ts +1 -1
- package/bin/keycloakify/generateTheme/readStaticResourcesUsage.d.ts +1 -1
- package/bin/keycloakify/keycloakify.js +50 -91
- package/bin/keycloakify/keycloakify.js.map +1 -1
- package/bin/keycloakify/parsedPackageJson.d.ts +29 -31
- package/bin/keycloakify/parsedPackageJson.js +7 -8
- package/bin/keycloakify/parsedPackageJson.js.map +1 -1
- package/bin/tools/downloadAndUnzip.d.ts +1 -1
- package/bin/tools/downloadAndUnzip.js +24 -26
- package/bin/tools/downloadAndUnzip.js.map +1 -1
- package/bin/tools/getAbsoluteAndInOsFormatPath.d.ts +4 -0
- package/bin/tools/getAbsoluteAndInOsFormatPath.js +15 -0
- package/bin/tools/getAbsoluteAndInOsFormatPath.js.map +1 -0
- package/bin/tools/pathJoin.js +1 -1
- package/bin/tools/pathJoin.js.map +1 -1
- package/login/kcContext/KcContext.js.map +1 -1
- package/login/kcContext/createGetKcContext.js +2 -6
- package/login/kcContext/createGetKcContext.js.map +1 -1
- package/login/kcContext/kcContextMocks.js +5 -4
- package/login/kcContext/kcContextMocks.js.map +1 -1
- package/package.json +92 -21
- package/src/account/kcContext/KcContext.ts +2 -1
- package/src/account/kcContext/createGetKcContext.ts +2 -7
- package/src/account/kcContext/kcContextMocks.ts +5 -3
- package/src/bin/constants.ts +9 -0
- package/src/bin/copy-keycloak-resources-to-public.ts +20 -19
- package/src/bin/download-builtin-keycloak-theme.ts +14 -6
- package/src/bin/eject-keycloak-page.ts +5 -9
- package/src/bin/getSrcDirPath.ts +4 -4
- package/src/bin/initialize-email-theme.ts +7 -7
- package/src/bin/keycloakify/BuildOptions.ts +78 -59
- package/src/bin/keycloakify/generateFtl/generateFtl.ts +4 -7
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountPages.java +33 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountProvider.java +76 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountProviderFactory.java +25 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/AccountSpi.java +50 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/FreeMarkerAccountProvider.java +424 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/FreeMarkerAccountProviderFactory.java +51 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/Templates.java +51 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/AccountBean.java +91 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/AccountFederatedIdentityBean.java +157 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/ApplicationsBean.java +258 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/AuthorizationBean.java +515 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/FeaturesBean.java +56 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/LogBean.java +95 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/PasswordBean.java +34 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/RealmBean.java +75 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/ReferrerBean.java +38 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/SessionsBean.java +93 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/TotpBean.java +125 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/forms/account/freemarker/model/UrlBean.java +121 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/services/AccountUrls.java +115 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/services/resources/account/AccountFormService.java +1310 -0
- package/src/bin/keycloakify/generateJavaStackFiles/account-v1-java/services/resources/account/AccountFormServiceFactory.java +64 -0
- package/src/bin/keycloakify/generateJavaStackFiles/bringInAccountV1.ts +92 -0
- package/src/bin/keycloakify/generateJavaStackFiles/generateJavaStackFiles.ts +211 -0
- package/src/bin/keycloakify/generateJavaStackFiles/index.ts +1 -0
- package/src/bin/keycloakify/generateStartKeycloakTestingContainer.ts +21 -22
- package/src/bin/keycloakify/generateTheme/downloadKeycloakStaticResources.ts +19 -16
- package/src/bin/keycloakify/generateTheme/generateMessageProperties.ts +1 -1
- package/src/bin/keycloakify/generateTheme/generateTheme.ts +78 -72
- package/src/bin/keycloakify/generateTheme/readExtraPageNames.ts +2 -1
- package/src/bin/keycloakify/generateTheme/readFieldNameUsage.ts +1 -1
- package/src/bin/keycloakify/generateTheme/readStaticResourcesUsage.ts +1 -1
- package/src/bin/keycloakify/keycloakify.ts +22 -46
- package/src/bin/keycloakify/parsedPackageJson.ts +11 -13
- package/src/bin/tools/downloadAndUnzip.ts +6 -7
- package/src/bin/tools/getAbsoluteAndInOsFormatPath.ts +15 -0
- package/src/bin/tools/pathJoin.ts +1 -1
- package/src/login/kcContext/KcContext.ts +2 -1
- package/src/login/kcContext/createGetKcContext.ts +2 -7
- package/src/login/kcContext/kcContextMocks.ts +7 -5
- package/bin/keycloakify/generateJavaStackFiles.js +0 -103
- package/bin/keycloakify/generateJavaStackFiles.js.map +0 -1
- package/bin/mockTestingResourcesPath.d.ts +0 -3
- package/bin/mockTestingResourcesPath.js +0 -8
- package/bin/mockTestingResourcesPath.js.map +0 -1
- package/bin/tools/jar.d.ts +0 -33
- package/bin/tools/jar.js +0 -241
- package/bin/tools/jar.js.map +0 -1
- package/bin/tools/walk.d.ts +0 -8
- package/bin/tools/walk.js +0 -125
- package/bin/tools/walk.js.map +0 -1
- package/src/bin/keycloakify/generateJavaStackFiles.ts +0 -84
- package/src/bin/mockTestingResourcesPath.ts +0 -5
- package/src/bin/tools/jar.ts +0 -99
- package/src/bin/tools/walk.ts +0 -19
@@ -1,103 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
var __read = (this && this.__read) || function (o, n) {
|
26
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
27
|
-
if (!m) return o;
|
28
|
-
var i = m.call(o), r, ar = [], e;
|
29
|
-
try {
|
30
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
31
|
-
}
|
32
|
-
catch (error) { e = { error: error }; }
|
33
|
-
finally {
|
34
|
-
try {
|
35
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
36
|
-
}
|
37
|
-
finally { if (e) throw e.error; }
|
38
|
-
}
|
39
|
-
return ar;
|
40
|
-
};
|
41
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
42
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
43
|
-
if (ar || !(i in from)) {
|
44
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
45
|
-
ar[i] = from[i];
|
46
|
-
}
|
47
|
-
}
|
48
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
49
|
-
};
|
50
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
51
|
-
exports.generateJavaStackFiles = void 0;
|
52
|
-
var fs = __importStar(require("fs"));
|
53
|
-
var path_1 = require("path");
|
54
|
-
var assert_1 = require("tsafe/assert");
|
55
|
-
(0, assert_1.assert)();
|
56
|
-
function generateJavaStackFiles(params) {
|
57
|
-
var _a = params.buildOptions, groupId = _a.groupId, themeName = _a.themeName, extraThemeNames = _a.extraThemeNames, themeVersion = _a.themeVersion, artifactId = _a.artifactId, keycloakThemeBuildingDirPath = params.keycloakThemeBuildingDirPath, implementedThemeTypes = params.implementedThemeTypes;
|
58
|
-
{
|
59
|
-
var pomFileCode = (function generatePomFileCode() {
|
60
|
-
var pomFileCode = [
|
61
|
-
"<?xml version=\"1.0\"?>",
|
62
|
-
"<project xmlns=\"http://maven.apache.org/POM/4.0.0\"",
|
63
|
-
"\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"",
|
64
|
-
"\txsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">",
|
65
|
-
"\t<modelVersion>4.0.0</modelVersion>",
|
66
|
-
"\t<groupId>".concat(groupId, "</groupId>"),
|
67
|
-
"\t<artifactId>".concat(artifactId, "</artifactId>"),
|
68
|
-
"\t<version>".concat(themeVersion, "</version>"),
|
69
|
-
"\t<name>".concat(artifactId, "</name>"),
|
70
|
-
"\t<description />",
|
71
|
-
"</project>"
|
72
|
-
].join("\n");
|
73
|
-
return { pomFileCode: pomFileCode };
|
74
|
-
})().pomFileCode;
|
75
|
-
fs.writeFileSync((0, path_1.join)(keycloakThemeBuildingDirPath, "pom.xml"), Buffer.from(pomFileCode, "utf8"));
|
76
|
-
}
|
77
|
-
{
|
78
|
-
var themeManifestFilePath = (0, path_1.join)(keycloakThemeBuildingDirPath, "src", "main", "resources", "META-INF", "keycloak-themes.json");
|
79
|
-
try {
|
80
|
-
fs.mkdirSync((0, path_1.dirname)(themeManifestFilePath));
|
81
|
-
}
|
82
|
-
catch (_b) { }
|
83
|
-
fs.writeFileSync(themeManifestFilePath, Buffer.from(JSON.stringify({
|
84
|
-
"themes": __spreadArray([themeName], __read(extraThemeNames), false).map(function (themeName) { return ({
|
85
|
-
"name": themeName,
|
86
|
-
"types": Object.entries(implementedThemeTypes)
|
87
|
-
.filter(function (_a) {
|
88
|
-
var _b = __read(_a, 2), isImplemented = _b[1];
|
89
|
-
return isImplemented;
|
90
|
-
})
|
91
|
-
.map(function (_a) {
|
92
|
-
var _b = __read(_a, 1), themeType = _b[0];
|
93
|
-
return themeType;
|
94
|
-
})
|
95
|
-
}); })
|
96
|
-
}, null, 2), "utf8"));
|
97
|
-
}
|
98
|
-
return {
|
99
|
-
"jarFilePath": (0, path_1.join)(keycloakThemeBuildingDirPath, "target", "".concat(artifactId, "-").concat(themeVersion, ".jar"))
|
100
|
-
};
|
101
|
-
}
|
102
|
-
exports.generateJavaStackFiles = generateJavaStackFiles;
|
103
|
-
//# sourceMappingURL=generateJavaStackFiles.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"generateJavaStackFiles.js","sourceRoot":"","sources":["../../src/bin/keycloakify/generateJavaStackFiles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAyB;AACzB,6BAAgE;AAChE,uCAAsC;AAYtC,IAAA,eAAM,GAAwD,CAAC;AAE/D,SAAgB,sBAAsB,CAAC,MAItC;IAIO,IAAA,KAGA,MAAM,aAHyE,EAA/D,OAAO,aAAA,EAAE,SAAS,eAAA,EAAE,eAAe,qBAAA,EAAE,YAAY,kBAAA,EAAE,UAAU,gBAAA,EAC7E,4BAA4B,GAE5B,MAAM,6BAFsB,EAC5B,qBAAqB,GACrB,MAAM,sBADe,CACd;IAEX;QACY,IAAA,WAAW,GAAK,CAAC,SAAS,mBAAmB;YAGjD,IAAM,WAAW,GAAG;gBAChB,yBAAuB;gBACvB,sDAAoD;gBACpD,2DAAwD;gBACxD,sGAAmG;gBACnG,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C;KACL;IAED,OAAO;QACH,aAAa,EAAE,IAAA,WAAQ,EAAC,4BAA4B,EAAE,QAAQ,EAAE,UAAG,UAAU,cAAI,YAAY,SAAM,CAAC;KACvG,CAAC;AACN,CAAC;AAnED,wDAmEC"}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.resourcesCommonDirPathRelativeToPublicDir = exports.resourcesDirPathRelativeToPublicDir = exports.basenameOfKeycloakDirInPublicDir = void 0;
|
4
|
-
var pathJoin_1 = require("./tools/pathJoin");
|
5
|
-
exports.basenameOfKeycloakDirInPublicDir = "keycloak-resources";
|
6
|
-
exports.resourcesDirPathRelativeToPublicDir = (0, pathJoin_1.pathJoin)(exports.basenameOfKeycloakDirInPublicDir, "resources");
|
7
|
-
exports.resourcesCommonDirPathRelativeToPublicDir = (0, pathJoin_1.pathJoin)(exports.resourcesDirPathRelativeToPublicDir, "resources_common");
|
8
|
-
//# sourceMappingURL=mockTestingResourcesPath.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"mockTestingResourcesPath.js","sourceRoot":"","sources":["../src/bin/mockTestingResourcesPath.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAE/B,QAAA,gCAAgC,GAAG,oBAAoB,CAAC;AACxD,QAAA,mCAAmC,GAAG,IAAA,mBAAQ,EAAC,wCAAgC,EAAE,WAAW,CAAC,CAAC;AAC9F,QAAA,yCAAyC,GAAG,IAAA,mBAAQ,EAAC,2CAAmC,EAAE,kBAAkB,CAAC,CAAC"}
|
package/bin/tools/jar.d.ts
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
import { ZipFile } from "yazl";
|
3
|
-
export type ZipEntry = {
|
4
|
-
zipPath: string;
|
5
|
-
} & ({
|
6
|
-
fsPath: string;
|
7
|
-
} | {
|
8
|
-
buffer: Buffer;
|
9
|
-
});
|
10
|
-
export type ZipEntryGenerator = AsyncGenerator<ZipEntry, void, unknown>;
|
11
|
-
type CommonJarArgs = {
|
12
|
-
groupId: string;
|
13
|
-
artifactId: string;
|
14
|
-
version: string;
|
15
|
-
};
|
16
|
-
export type JarStreamArgs = CommonJarArgs & {
|
17
|
-
asyncPathGeneratorFn(): ZipEntryGenerator;
|
18
|
-
};
|
19
|
-
export type JarArgs = CommonJarArgs & {
|
20
|
-
targetPath: string;
|
21
|
-
rootPath: string;
|
22
|
-
};
|
23
|
-
export declare function jarStream({ groupId, artifactId, version, asyncPathGeneratorFn }: JarStreamArgs): Promise<ZipFile>;
|
24
|
-
/**
|
25
|
-
* Create a jar archive, using the resources found at `rootPath` (a directory) and write the
|
26
|
-
* archive to `targetPath` (a file). Use `groupId`, `artifactId` and `version` to define
|
27
|
-
* the contents of the pom.properties file which is going to be added to the archive.
|
28
|
-
* The root directory is expectedto have a conventional maven/gradle folder structure with a
|
29
|
-
* single `pom.xml` file at the root and a `src/main/resources` directory containing all
|
30
|
-
* application resources.
|
31
|
-
*/
|
32
|
-
export default function jar({ groupId, artifactId, version, rootPath, targetPath }: JarArgs): Promise<void>;
|
33
|
-
export {};
|
package/bin/tools/jar.js
DELETED
@@ -1,241 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
4
|
-
return cooked;
|
5
|
-
};
|
6
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
7
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
8
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
9
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
10
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
11
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
12
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
13
|
-
});
|
14
|
-
};
|
15
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
16
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
17
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
18
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
19
|
-
function step(op) {
|
20
|
-
if (f) throw new TypeError("Generator is already executing.");
|
21
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
22
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
23
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
24
|
-
switch (op[0]) {
|
25
|
-
case 0: case 1: t = op; break;
|
26
|
-
case 4: _.label++; return { value: op[1], done: false };
|
27
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
28
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
29
|
-
default:
|
30
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
31
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
32
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
33
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
34
|
-
if (t[2]) _.ops.pop();
|
35
|
-
_.trys.pop(); continue;
|
36
|
-
}
|
37
|
-
op = body.call(thisArg, _);
|
38
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
39
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
40
|
-
}
|
41
|
-
};
|
42
|
-
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
43
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
44
|
-
var m = o[Symbol.asyncIterator], i;
|
45
|
-
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);
|
46
|
-
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); }); }; }
|
47
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
48
|
-
};
|
49
|
-
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
50
|
-
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
51
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
52
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
53
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
54
|
-
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); }); }; }
|
55
|
-
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
56
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
57
|
-
function fulfill(value) { resume("next", value); }
|
58
|
-
function reject(value) { resume("throw", value); }
|
59
|
-
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
60
|
-
};
|
61
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
62
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
63
|
-
};
|
64
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
65
|
-
exports.jarStream = void 0;
|
66
|
-
var path_1 = require("path");
|
67
|
-
var fs_1 = require("fs");
|
68
|
-
var walk_1 = __importDefault(require("./walk"));
|
69
|
-
var yazl_1 = require("yazl");
|
70
|
-
var promises_1 = require("fs/promises");
|
71
|
-
var trimIndent_1 = __importDefault(require("./trimIndent"));
|
72
|
-
function jarStream(_a) {
|
73
|
-
var _b, e_1, _c, _d;
|
74
|
-
var groupId = _a.groupId, artifactId = _a.artifactId, version = _a.version, asyncPathGeneratorFn = _a.asyncPathGeneratorFn;
|
75
|
-
return __awaiter(this, void 0, void 0, function () {
|
76
|
-
var manifestPath, manifestData, pomPropsPath, pomPropsData, zipFile, _e, _f, _g, entry, e_1_1;
|
77
|
-
return __generator(this, function (_h) {
|
78
|
-
switch (_h.label) {
|
79
|
-
case 0:
|
80
|
-
manifestPath = "META-INF/MANIFEST.MF";
|
81
|
-
manifestData = Buffer.from((0, trimIndent_1.default)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n Manifest-Version: 1.0\n Archiver-Version: Plexus Archiver\n Created-By: Keycloakify\n Built-By: unknown\n Build-Jdk: 19.0.0\n "], ["\n Manifest-Version: 1.0\n Archiver-Version: Plexus Archiver\n Created-By: Keycloakify\n Built-By: unknown\n Build-Jdk: 19.0.0\n "]))));
|
82
|
-
pomPropsPath = "META-INF/maven/".concat(groupId, "/").concat(artifactId, "/pom.properties");
|
83
|
-
pomPropsData = Buffer.from((0, trimIndent_1.default)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n # Generated by keycloakify\n # ", "\n artifactId=", "\n groupId=", "\n version=", "\n "], ["\n # Generated by keycloakify\n # ", "\n artifactId=", "\n groupId=", "\n version=", "\n "])), new Date(), artifactId, groupId, version));
|
84
|
-
zipFile = new yazl_1.ZipFile();
|
85
|
-
_h.label = 1;
|
86
|
-
case 1:
|
87
|
-
_h.trys.push([1, 6, 7, 12]);
|
88
|
-
_e = true, _f = __asyncValues(asyncPathGeneratorFn());
|
89
|
-
_h.label = 2;
|
90
|
-
case 2: return [4 /*yield*/, _f.next()];
|
91
|
-
case 3:
|
92
|
-
if (!(_g = _h.sent(), _b = _g.done, !_b)) return [3 /*break*/, 5];
|
93
|
-
_d = _g.value;
|
94
|
-
_e = false;
|
95
|
-
try {
|
96
|
-
entry = _d;
|
97
|
-
if ("buffer" in entry) {
|
98
|
-
zipFile.addBuffer(entry.buffer, entry.zipPath);
|
99
|
-
}
|
100
|
-
else if ("fsPath" in entry) {
|
101
|
-
if (entry.fsPath.endsWith(path_1.sep)) {
|
102
|
-
zipFile.addEmptyDirectory(entry.zipPath);
|
103
|
-
}
|
104
|
-
else {
|
105
|
-
zipFile.addFile(entry.fsPath, entry.zipPath);
|
106
|
-
}
|
107
|
-
}
|
108
|
-
}
|
109
|
-
finally {
|
110
|
-
_e = true;
|
111
|
-
}
|
112
|
-
_h.label = 4;
|
113
|
-
case 4: return [3 /*break*/, 2];
|
114
|
-
case 5: return [3 /*break*/, 12];
|
115
|
-
case 6:
|
116
|
-
e_1_1 = _h.sent();
|
117
|
-
e_1 = { error: e_1_1 };
|
118
|
-
return [3 /*break*/, 12];
|
119
|
-
case 7:
|
120
|
-
_h.trys.push([7, , 10, 11]);
|
121
|
-
if (!(!_e && !_b && (_c = _f.return))) return [3 /*break*/, 9];
|
122
|
-
return [4 /*yield*/, _c.call(_f)];
|
123
|
-
case 8:
|
124
|
-
_h.sent();
|
125
|
-
_h.label = 9;
|
126
|
-
case 9: return [3 /*break*/, 11];
|
127
|
-
case 10:
|
128
|
-
if (e_1) throw e_1.error;
|
129
|
-
return [7 /*endfinally*/];
|
130
|
-
case 11: return [7 /*endfinally*/];
|
131
|
-
case 12:
|
132
|
-
zipFile.addBuffer(manifestData, manifestPath);
|
133
|
-
zipFile.addBuffer(pomPropsData, pomPropsPath);
|
134
|
-
zipFile.end();
|
135
|
-
return [2 /*return*/, zipFile];
|
136
|
-
}
|
137
|
-
});
|
138
|
-
});
|
139
|
-
}
|
140
|
-
exports.jarStream = jarStream;
|
141
|
-
/**
|
142
|
-
* Create a jar archive, using the resources found at `rootPath` (a directory) and write the
|
143
|
-
* archive to `targetPath` (a file). Use `groupId`, `artifactId` and `version` to define
|
144
|
-
* the contents of the pom.properties file which is going to be added to the archive.
|
145
|
-
* The root directory is expectedto have a conventional maven/gradle folder structure with a
|
146
|
-
* single `pom.xml` file at the root and a `src/main/resources` directory containing all
|
147
|
-
* application resources.
|
148
|
-
*/
|
149
|
-
function jar(_a) {
|
150
|
-
var groupId = _a.groupId, artifactId = _a.artifactId, version = _a.version, rootPath = _a.rootPath, targetPath = _a.targetPath;
|
151
|
-
return __awaiter(this, void 0, void 0, function () {
|
152
|
-
var asyncPathGeneratorFn, zipFile;
|
153
|
-
var _this = this;
|
154
|
-
return __generator(this, function (_b) {
|
155
|
-
switch (_b.label) {
|
156
|
-
case 0: return [4 /*yield*/, (0, promises_1.mkdir)((0, path_1.dirname)(targetPath), { recursive: true })];
|
157
|
-
case 1:
|
158
|
-
_b.sent();
|
159
|
-
asyncPathGeneratorFn = function () {
|
160
|
-
return __asyncGenerator(this, arguments, function () {
|
161
|
-
var resourcesPath, _a, _b, _c, fsPath, zipPath, e_2_1;
|
162
|
-
var _d, e_2, _e, _f;
|
163
|
-
return __generator(this, function (_g) {
|
164
|
-
switch (_g.label) {
|
165
|
-
case 0:
|
166
|
-
resourcesPath = (0, path_1.join)(rootPath, "src", "main", "resources");
|
167
|
-
_g.label = 1;
|
168
|
-
case 1:
|
169
|
-
_g.trys.push([1, 10, 11, 16]);
|
170
|
-
_a = true, _b = __asyncValues((0, walk_1.default)(resourcesPath));
|
171
|
-
_g.label = 2;
|
172
|
-
case 2: return [4 /*yield*/, __await(_b.next())];
|
173
|
-
case 3:
|
174
|
-
if (!(_c = _g.sent(), _d = _c.done, !_d)) return [3 /*break*/, 9];
|
175
|
-
_f = _c.value;
|
176
|
-
_a = false;
|
177
|
-
_g.label = 4;
|
178
|
-
case 4:
|
179
|
-
_g.trys.push([4, , 7, 8]);
|
180
|
-
fsPath = _f;
|
181
|
-
zipPath = (0, path_1.relative)(resourcesPath, fsPath).split(path_1.sep).join("/");
|
182
|
-
return [4 /*yield*/, __await({ fsPath: fsPath, zipPath: zipPath })];
|
183
|
-
case 5: return [4 /*yield*/, _g.sent()];
|
184
|
-
case 6:
|
185
|
-
_g.sent();
|
186
|
-
return [3 /*break*/, 8];
|
187
|
-
case 7:
|
188
|
-
_a = true;
|
189
|
-
return [7 /*endfinally*/];
|
190
|
-
case 8: return [3 /*break*/, 2];
|
191
|
-
case 9: return [3 /*break*/, 16];
|
192
|
-
case 10:
|
193
|
-
e_2_1 = _g.sent();
|
194
|
-
e_2 = { error: e_2_1 };
|
195
|
-
return [3 /*break*/, 16];
|
196
|
-
case 11:
|
197
|
-
_g.trys.push([11, , 14, 15]);
|
198
|
-
if (!(!_a && !_d && (_e = _b.return))) return [3 /*break*/, 13];
|
199
|
-
return [4 /*yield*/, __await(_e.call(_b))];
|
200
|
-
case 12:
|
201
|
-
_g.sent();
|
202
|
-
_g.label = 13;
|
203
|
-
case 13: return [3 /*break*/, 15];
|
204
|
-
case 14:
|
205
|
-
if (e_2) throw e_2.error;
|
206
|
-
return [7 /*endfinally*/];
|
207
|
-
case 15: return [7 /*endfinally*/];
|
208
|
-
case 16: return [4 /*yield*/, __await({
|
209
|
-
fsPath: (0, path_1.join)(rootPath, "pom.xml"),
|
210
|
-
zipPath: "META-INF/maven/".concat(groupId, "/").concat(artifactId, "/pom.xml")
|
211
|
-
})];
|
212
|
-
case 17: return [4 /*yield*/, _g.sent()];
|
213
|
-
case 18:
|
214
|
-
_g.sent();
|
215
|
-
return [2 /*return*/];
|
216
|
-
}
|
217
|
-
});
|
218
|
-
});
|
219
|
-
};
|
220
|
-
return [4 /*yield*/, jarStream({ groupId: groupId, artifactId: artifactId, version: version, asyncPathGeneratorFn: asyncPathGeneratorFn })];
|
221
|
-
case 2:
|
222
|
-
zipFile = _b.sent();
|
223
|
-
return [4 /*yield*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
224
|
-
return __generator(this, function (_a) {
|
225
|
-
zipFile.outputStream
|
226
|
-
.pipe((0, fs_1.createWriteStream)(targetPath, { encoding: "binary" }))
|
227
|
-
.on("close", function () { return resolve(); })
|
228
|
-
.on("error", function (e) { return reject(e); });
|
229
|
-
return [2 /*return*/];
|
230
|
-
});
|
231
|
-
}); })];
|
232
|
-
case 3:
|
233
|
-
_b.sent();
|
234
|
-
return [2 /*return*/];
|
235
|
-
}
|
236
|
-
});
|
237
|
-
});
|
238
|
-
}
|
239
|
-
exports.default = jar;
|
240
|
-
var templateObject_1, templateObject_2;
|
241
|
-
//# sourceMappingURL=jar.js.map
|
package/bin/tools/jar.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"jar.js","sourceRoot":"","sources":["../../src/bin/tools/jar.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAAoD;AACpD,yBAAuC;AAEvC,gDAA0B;AAC1B,6BAA+B;AAC/B,wCAAoC;AACpC,4DAAsC;AAoBtC,SAAsB,SAAS,CAAC,EAAqE;;QAAnE,OAAO,aAAA,EAAE,UAAU,gBAAA,EAAE,OAAO,aAAA,EAAE,oBAAoB,0BAAA;;;;;;oBAC1E,YAAY,GAAG,sBAAsB,CAAC;oBACtC,YAAY,GAAG,MAAM,CAAC,IAAI,KAAC,oBAAU,yQAAA,qMAMlC,KAAC,CAAC;oBAEL,YAAY,GAAG,yBAAkB,OAAO,cAAI,UAAU,oBAAiB,CAAC;oBACxE,YAAY,GAAG,MAAM,CAAC,IAAI,KAAC,oBAAU,iOAAA,0DAE/B,EAAU,2BACD,EAAU,wBACb,EAAO,wBACP,EAAO,gBAChB,KAJG,IAAI,IAAI,EAAE,EACD,UAAU,EACb,OAAO,EACP,OAAO,E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
3
|
-
* found. Directory paths will _always_ end with a path separator.
|
4
|
-
*
|
5
|
-
* @param root the starting directory
|
6
|
-
* @returns AsyncGenerator
|
7
|
-
*/
|
8
|
-
export default function walk(root: string): AsyncGenerator<string, void, unknown>;
|
package/bin/tools/walk.js
DELETED
@@ -1,125 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
3
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
4
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
5
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
6
|
-
function step(op) {
|
7
|
-
if (f) throw new TypeError("Generator is already executing.");
|
8
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
9
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
10
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
11
|
-
switch (op[0]) {
|
12
|
-
case 0: case 1: t = op; break;
|
13
|
-
case 4: _.label++; return { value: op[1], done: false };
|
14
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
15
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
16
|
-
default:
|
17
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
18
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
19
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
20
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
21
|
-
if (t[2]) _.ops.pop();
|
22
|
-
_.trys.pop(); continue;
|
23
|
-
}
|
24
|
-
op = body.call(thisArg, _);
|
25
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
26
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
27
|
-
}
|
28
|
-
};
|
29
|
-
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
30
|
-
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
31
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
32
|
-
var m = o[Symbol.asyncIterator], i;
|
33
|
-
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);
|
34
|
-
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); }); }; }
|
35
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
36
|
-
};
|
37
|
-
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
38
|
-
var i, p;
|
39
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
40
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
41
|
-
};
|
42
|
-
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
43
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
44
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
45
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
46
|
-
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); }); }; }
|
47
|
-
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
48
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
49
|
-
function fulfill(value) { resume("next", value); }
|
50
|
-
function reject(value) { resume("throw", value); }
|
51
|
-
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
52
|
-
};
|
53
|
-
var __values = (this && this.__values) || function(o) {
|
54
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
55
|
-
if (m) return m.call(o);
|
56
|
-
if (o && typeof o.length === "number") return {
|
57
|
-
next: function () {
|
58
|
-
if (o && i >= o.length) o = void 0;
|
59
|
-
return { value: o && o[i++], done: !o };
|
60
|
-
}
|
61
|
-
};
|
62
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
63
|
-
};
|
64
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
65
|
-
var promises_1 = require("fs/promises");
|
66
|
-
var path_1 = require("path");
|
67
|
-
/**
|
68
|
-
* Asynchronously and recursively walk a directory tree, yielding every file and directory
|
69
|
-
* found. Directory paths will _always_ end with a path separator.
|
70
|
-
*
|
71
|
-
* @param root the starting directory
|
72
|
-
* @returns AsyncGenerator
|
73
|
-
*/
|
74
|
-
function walk(root) {
|
75
|
-
return __asyncGenerator(this, arguments, function walk_1() {
|
76
|
-
var _a, _b, entry, absolutePath, e_1_1;
|
77
|
-
var e_1, _c;
|
78
|
-
return __generator(this, function (_d) {
|
79
|
-
switch (_d.label) {
|
80
|
-
case 0:
|
81
|
-
_d.trys.push([0, 12, 13, 14]);
|
82
|
-
return [4 /*yield*/, __await((0, promises_1.readdir)(root, { withFileTypes: true }))];
|
83
|
-
case 1:
|
84
|
-
_a = __values.apply(void 0, [_d.sent()]), _b = _a.next();
|
85
|
-
_d.label = 2;
|
86
|
-
case 2:
|
87
|
-
if (!!_b.done) return [3 /*break*/, 11];
|
88
|
-
entry = _b.value;
|
89
|
-
absolutePath = (0, path_1.resolve)(root, entry.name);
|
90
|
-
if (!entry.isDirectory()) return [3 /*break*/, 7];
|
91
|
-
return [4 /*yield*/, __await(absolutePath.endsWith(path_1.sep) ? absolutePath : absolutePath + path_1.sep)];
|
92
|
-
case 3: return [4 /*yield*/, _d.sent()];
|
93
|
-
case 4:
|
94
|
-
_d.sent();
|
95
|
-
return [5 /*yield**/, __values(__asyncDelegator(__asyncValues(walk(absolutePath))))];
|
96
|
-
case 5: return [4 /*yield*/, __await.apply(void 0, [_d.sent()])];
|
97
|
-
case 6:
|
98
|
-
_d.sent();
|
99
|
-
return [3 /*break*/, 10];
|
100
|
-
case 7: return [4 /*yield*/, __await(absolutePath.endsWith(path_1.sep) ? absolutePath.substring(0, absolutePath.length - 1) : absolutePath)];
|
101
|
-
case 8: return [4 /*yield*/, _d.sent()];
|
102
|
-
case 9:
|
103
|
-
_d.sent();
|
104
|
-
_d.label = 10;
|
105
|
-
case 10:
|
106
|
-
_b = _a.next();
|
107
|
-
return [3 /*break*/, 2];
|
108
|
-
case 11: return [3 /*break*/, 14];
|
109
|
-
case 12:
|
110
|
-
e_1_1 = _d.sent();
|
111
|
-
e_1 = { error: e_1_1 };
|
112
|
-
return [3 /*break*/, 14];
|
113
|
-
case 13:
|
114
|
-
try {
|
115
|
-
if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
|
116
|
-
}
|
117
|
-
finally { if (e_1) throw e_1.error; }
|
118
|
-
return [7 /*endfinally*/];
|
119
|
-
case 14: return [2 /*return*/];
|
120
|
-
}
|
121
|
-
});
|
122
|
-
});
|
123
|
-
}
|
124
|
-
exports.default = walk;
|
125
|
-
//# sourceMappingURL=walk.js.map
|
package/bin/tools/walk.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"walk.js","sourceRoot":"","sources":["../../src/bin/tools/walk.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAsC;AACtC,6BAAoC;AAEpC;;;;;;GAMG;AACH,SAA+B,IAAI,CAAC,IAAY;;;;;;;;oBACxB,6BAAM,IAAA,kBAAO,EAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,GAAA;;oBAA5C,KAAA,wBAAA,SAA4C,EAAA;;;;oBAArD,KAAK;oBACN,YAAY,GAAG,IAAA,cAAO,EAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;yBAC3C,KAAK,CAAC,WAAW,EAAE,EAAnB,wBAAmB;iDACb,YAAY,CAAC,QAAQ,CAAC,UAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,GAAG,UAAG;wBAApE,gCAAoE;;oBAApE,SAAoE,CAAC;oBACrE,sBAAA,SAAO,iBAAA,cAAA,IAAI,CAAC,YAAY,CAAC,CAAA,CAAA,CAAA,EAAA;wBAAzB,4CAAA,SAAyB,IAAA;;oBAAzB,SAAyB,CAAC;;qDACjB,YAAY,CAAC,QAAQ,CAAC,UAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY;wBAApG,gCAAoG;;oBAApG,SAAoG,CAAC;;;;;;;;;;;;;;;;;;;;CAEnH;AARD,uBAQC"}
|
@@ -1,84 +0,0 @@
|
|
1
|
-
import * as fs from "fs";
|
2
|
-
import { join as pathJoin, dirname as pathDirname } from "path";
|
3
|
-
import { assert } from "tsafe/assert";
|
4
|
-
import type { BuildOptions } from "./BuildOptions";
|
5
|
-
import type { ThemeType } from "./generateFtl";
|
6
|
-
|
7
|
-
export type BuildOptionsLike = {
|
8
|
-
themeName: string;
|
9
|
-
extraThemeNames: string[];
|
10
|
-
groupId: string;
|
11
|
-
artifactId: string;
|
12
|
-
themeVersion: string;
|
13
|
-
};
|
14
|
-
|
15
|
-
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
16
|
-
|
17
|
-
export function generateJavaStackFiles(params: {
|
18
|
-
keycloakThemeBuildingDirPath: string;
|
19
|
-
implementedThemeTypes: Record<ThemeType | "email", boolean>;
|
20
|
-
buildOptions: BuildOptionsLike;
|
21
|
-
}): {
|
22
|
-
jarFilePath: string;
|
23
|
-
} {
|
24
|
-
const {
|
25
|
-
buildOptions: { groupId, themeName, extraThemeNames, themeVersion, artifactId },
|
26
|
-
keycloakThemeBuildingDirPath,
|
27
|
-
implementedThemeTypes
|
28
|
-
} = params;
|
29
|
-
|
30
|
-
{
|
31
|
-
const { pomFileCode } = (function generatePomFileCode(): {
|
32
|
-
pomFileCode: string;
|
33
|
-
} {
|
34
|
-
const pomFileCode = [
|
35
|
-
`<?xml version="1.0"?>`,
|
36
|
-
`<project xmlns="http://maven.apache.org/POM/4.0.0"`,
|
37
|
-
` xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"`,
|
38
|
-
` xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">`,
|
39
|
-
` <modelVersion>4.0.0</modelVersion>`,
|
40
|
-
` <groupId>${groupId}</groupId>`,
|
41
|
-
` <artifactId>${artifactId}</artifactId>`,
|
42
|
-
` <version>${themeVersion}</version>`,
|
43
|
-
` <name>${artifactId}</name>`,
|
44
|
-
` <description />`,
|
45
|
-
`</project>`
|
46
|
-
].join("\n");
|
47
|
-
|
48
|
-
return { pomFileCode };
|
49
|
-
})();
|
50
|
-
|
51
|
-
fs.writeFileSync(pathJoin(keycloakThemeBuildingDirPath, "pom.xml"), Buffer.from(pomFileCode, "utf8"));
|
52
|
-
}
|
53
|
-
|
54
|
-
{
|
55
|
-
const themeManifestFilePath = pathJoin(keycloakThemeBuildingDirPath, "src", "main", "resources", "META-INF", "keycloak-themes.json");
|
56
|
-
|
57
|
-
try {
|
58
|
-
fs.mkdirSync(pathDirname(themeManifestFilePath));
|
59
|
-
} catch {}
|
60
|
-
|
61
|
-
fs.writeFileSync(
|
62
|
-
themeManifestFilePath,
|
63
|
-
Buffer.from(
|
64
|
-
JSON.stringify(
|
65
|
-
{
|
66
|
-
"themes": [themeName, ...extraThemeNames].map(themeName => ({
|
67
|
-
"name": themeName,
|
68
|
-
"types": Object.entries(implementedThemeTypes)
|
69
|
-
.filter(([, isImplemented]) => isImplemented)
|
70
|
-
.map(([themeType]) => themeType)
|
71
|
-
}))
|
72
|
-
},
|
73
|
-
null,
|
74
|
-
2
|
75
|
-
),
|
76
|
-
"utf8"
|
77
|
-
)
|
78
|
-
);
|
79
|
-
}
|
80
|
-
|
81
|
-
return {
|
82
|
-
"jarFilePath": pathJoin(keycloakThemeBuildingDirPath, "target", `${artifactId}-${themeVersion}.jar`)
|
83
|
-
};
|
84
|
-
}
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import { pathJoin } from "./tools/pathJoin";
|
2
|
-
|
3
|
-
export const basenameOfKeycloakDirInPublicDir = "keycloak-resources";
|
4
|
-
export const resourcesDirPathRelativeToPublicDir = pathJoin(basenameOfKeycloakDirInPublicDir, "resources");
|
5
|
-
export const resourcesCommonDirPathRelativeToPublicDir = pathJoin(resourcesDirPathRelativeToPublicDir, "resources_common");
|