keycloakify 8.1.0 → 8.1.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
CHANGED
@@ -116,6 +116,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
116
116
|
<td align="center" valign="top" width="14.28%"><a href="https://www.gravitysoftware.be"><img src="https://avatars.githubusercontent.com/u/1140574?v=4?s=100" width="100px;" alt="Thomas Silvestre"/><br /><sub><b>Thomas Silvestre</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=thosil" title="Code">💻</a></td>
|
117
117
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/satanshiro"><img src="https://avatars.githubusercontent.com/u/38865738?v=4?s=100" width="100px;" alt="satanshiro"/><br /><sub><b>satanshiro</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=satanshiro" title="Code">💻</a></td>
|
118
118
|
<td align="center" valign="top" width="14.28%"><a href="https://poelhekke.dev"><img src="https://avatars.githubusercontent.com/u/1632377?v=4?s=100" width="100px;" alt="Koen Poelhekke"/><br /><sub><b>Koen Poelhekke</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=kpoelhekke" title="Code">💻</a></td>
|
119
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zavoloklom"><img src="https://avatars.githubusercontent.com/u/4151869?v=4?s=100" width="100px;" alt="Sergey Kupletsky"/><br /><sub><b>Sergey Kupletsky</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=zavoloklom" title="Tests">⚠️</a> <a href="https://github.com/keycloakify/keycloakify/commits?author=zavoloklom" title="Code">💻</a></td>
|
119
120
|
</tr>
|
120
121
|
</tbody>
|
121
122
|
</table>
|
@@ -42,14 +42,18 @@ function replaceImportsFromStaticInJsCode(params) {
|
|
42
42
|
var _a;
|
43
43
|
var jsCode = params.jsCode;
|
44
44
|
var getReplaceArgs = function (language) { return [
|
45
|
-
new RegExp("([a-zA-Z_]+)\\.([a-zA-Z]+)=function\\(([a-
|
45
|
+
new RegExp("([a-zA-Z_]+)\\.([a-zA-Z]+)=(function\\(([a-z]+)\\){return|([a-z]+)=>)\"static\\/".concat(language, "\\/\""), "g"),
|
46
46
|
function () {
|
47
47
|
var _a = [];
|
48
48
|
for (var _i = 0; _i < arguments.length; _i++) {
|
49
49
|
_a[_i] = arguments[_i];
|
50
50
|
}
|
51
|
-
var _b = __read(_a,
|
52
|
-
|
51
|
+
var _b = __read(_a, 5), n = _b[1], u = _b[2], matchedFunction = _b[3], eForFunction = _b[4];
|
52
|
+
var isArrowFunction = matchedFunction.includes("=>");
|
53
|
+
var e = isArrowFunction ? matchedFunction.replace("=>", "").trim() : eForFunction;
|
54
|
+
return "\n ".concat(n, "[(function(){\n var pd = Object.getOwnPropertyDescriptor(").concat(n, ", \"p\");\n if( pd === undefined || pd.configurable ){\n Object.defineProperty(").concat(n, ", \"p\", {\n get: function() { return window.").concat(ftlValuesGlobalName_1.ftlValuesGlobalName, ".url.resourcesPath; },\n set: function() {}\n });\n }\n return \"").concat(u, "\";\n })()] = ").concat(isArrowFunction ? "".concat(e, " =>") : "function(".concat(e, ") { return "), " \"/build/static/").concat(language, "/\"")
|
55
|
+
.replace(/\s+/g, " ")
|
56
|
+
.trim();
|
53
57
|
}
|
54
58
|
]; };
|
55
59
|
var fixedJsCode = (_a = jsCode
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"replaceImportsFromStaticInJsCode.js","sourceRoot":"","sources":["../../../src/bin/keycloakify/replacers/replaceImportsFromStaticInJsCode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA6D;AAE7D,SAAgB,gCAAgC,CAAC,MAA0B;IACvE;;;;;;;;;;MAUD;;IAES,IAAA,MAAM,GAAK,MAAM,OAAX,CAAY;IAE1B,IAAM,cAAc,GAAG,UAAC,QAAsB,IAAkD,OAAA;QAC5F,IAAI,MAAM,CAAC,
|
1
|
+
{"version":3,"file":"replaceImportsFromStaticInJsCode.js","sourceRoot":"","sources":["../../../src/bin/keycloakify/replacers/replaceImportsFromStaticInJsCode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAA6D;AAE7D,SAAgB,gCAAgC,CAAC,MAA0B;IACvE;;;;;;;;;;MAUD;;IAES,IAAA,MAAM,GAAK,MAAM,OAAX,CAAY;IAE1B,IAAM,cAAc,GAAG,UAAC,QAAsB,IAAkD,OAAA;QAC5F,IAAI,MAAM,CAAC,0FAAkF,QAAQ,UAAM,EAAE,GAAG,CAAC;QACjH;YAAC,YAA0C;iBAA1C,UAA0C,EAA1C,qBAA0C,EAA1C,IAA0C;gBAA1C,uBAA0C;;YAA1C,IAAA,KAAA,aAA0C,EAApC,CAAC,QAAA,EAAE,CAAC,QAAA,EAAE,eAAe,QAAA,EAAE,YAAY,QAAA,CAAC;YACvC,IAAM,eAAe,GAAG,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACvD,IAAM,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;YAEpF,OAAO,wBACL,CAAC,qFAC4C,CAAC,8HAEhB,CAAC,iFACa,yCAAmB,sJAInD,CAAC,sCACL,eAAe,CAAC,CAAC,CAAC,UAAG,CAAC,QAAK,CAAC,CAAC,CAAC,mBAAY,CAAC,gBAAa,8BAAmB,QAAQ,QAAI;iBAC5F,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;iBACpB,IAAI,EAAE,CAAC;QAChB,CAAC;KACJ,EApB+F,CAoB/F,CAAC;IAEF,IAAM,WAAW,GAAG,CAAA,KAAA,MAAM;SACrB,OAAO,OADQ,MAAM,2BACV,cAAc,CAAC,IAAI,CAAC,UAAC,CAAA;SAChC,OAAO,oCAAI,cAAc,CAAC,KAAK,CAAC,WAChC,OAAO,CAAC,kCAAkC,EAAE,iBAAU,yCAAmB,0CAAsC,CAAC;QACjH,kCAAkC;SACjC,OAAO,CACJ,6DAA6D,EAC7D;QAAC,YAAqB;aAArB,UAAqB,EAArB,qBAAqB,EAArB,IAAqB;YAArB,uBAAqB;;QAArB,IAAA,KAAA,aAAqB,EAAf,MAAM,QAAA,EAAE,MAAM,QAAA,CAAC;QAAK,OAAA,yBAAgB,MAAM,uBAAa,yCAAmB,gDAAoC,MAAM,MAAG;IAAnG,CAAmG,CACjI,CAAC;IAEN,OAAO,EAAE,WAAW,aAAA,EAAE,CAAC;AAC3B,CAAC;AAhDD,4EAgDC"}
|
package/package.json
CHANGED
@@ -16,18 +16,25 @@ export function replaceImportsFromStaticInJsCode(params: { jsCode: string }): {
|
|
16
16
|
const { jsCode } = params;
|
17
17
|
|
18
18
|
const getReplaceArgs = (language: "js" | "css"): Parameters<typeof String.prototype.replace> => [
|
19
|
-
new RegExp(`([a-zA-Z_]+)\\.([a-zA-Z]+)=function\\(([a-
|
20
|
-
(...[, n, u,
|
21
|
-
|
22
|
-
|
19
|
+
new RegExp(`([a-zA-Z_]+)\\.([a-zA-Z]+)=(function\\(([a-z]+)\\){return|([a-z]+)=>)"static\\/${language}\\/"`, "g"),
|
20
|
+
(...[, n, u, matchedFunction, eForFunction]) => {
|
21
|
+
const isArrowFunction = matchedFunction.includes("=>");
|
22
|
+
const e = isArrowFunction ? matchedFunction.replace("=>", "").trim() : eForFunction;
|
23
|
+
|
24
|
+
return `
|
25
|
+
${n}[(function(){
|
26
|
+
var pd = Object.getOwnPropertyDescriptor(${n}, "p");
|
23
27
|
if( pd === undefined || pd.configurable ){
|
24
28
|
Object.defineProperty(${n}, "p", {
|
25
29
|
get: function() { return window.${ftlValuesGlobalName}.url.resourcesPath; },
|
26
|
-
set: function
|
30
|
+
set: function() {}
|
27
31
|
});
|
28
32
|
}
|
29
|
-
|
30
|
-
|
33
|
+
return "${u}";
|
34
|
+
})()] = ${isArrowFunction ? `${e} =>` : `function(${e}) { return `} "/build/static/${language}/"`
|
35
|
+
.replace(/\s+/g, " ")
|
36
|
+
.trim();
|
37
|
+
}
|
31
38
|
];
|
32
39
|
|
33
40
|
const fixedJsCode = jsCode
|