Compare commits

...

23 Commits

Author SHA1 Message Date
7e932b920e Bump version 2023-10-20 15:06:29 +02:00
46fdfbc507 Merge pull request #438 from keycloakify/all-contributors/add-rome-user
docs: add rome-user as a contributor for code
2023-10-20 15:05:48 +02:00
a4ff8607c5 docs: update .all-contributorsrc [skip ci] 2023-10-20 13:05:34 +00:00
7fe4eeda57 docs: update README.md [skip ci] 2023-10-20 13:05:33 +00:00
9f25cddaa4 Allow "keycloak_theme" as a theme source directory
Fixes #429.
2023-10-08 18:12:57 -07:00
eb64fe60d0 Bump version 2023-10-09 00:49:50 +02:00
36f404e17d Preserve css order 2023-10-09 00:49:35 +02:00
5398590939 https://github.com/keycloakify/keycloakify/discussions/371#discussioncomment-7223711 2023-10-09 00:49:18 +02:00
96d5cfea14 Bump version 2023-10-02 22:49:31 +02:00
79007ebd55 #427 2023-10-02 22:49:04 +02:00
fcb519dac3 Bump version 2023-09-27 04:08:13 +02:00
2b487aa959 Merge pull request #423 from zavoloklom/fix/js-code-path-replacer
fix: change JS path transformation for static resources
2023-09-27 04:07:41 +02:00
733feadcb2 Merge pull request #425 from keycloakify/all-contributors/add-zavoloklom
docs: add zavoloklom as a contributor for test, and code
2023-09-27 03:59:00 +02:00
5ae568f19c docs: update .all-contributorsrc [skip ci] 2023-09-27 01:58:05 +00:00
0e51807856 docs: update README.md [skip ci] 2023-09-27 01:58:04 +00:00
b6eb165207 https://github.com/keycloakify/keycloakify/discussions/422 2023-09-25 13:41:51 +02:00
d26dbf4b3d fix: change JS path transformation for static resources
- Handle both arrow functions and traditional function expressions
- Add tests to ensure correctness of transformations
2023-09-24 23:42:10 +02:00
a722582709 Bump version 2023-09-22 15:51:52 +02:00
de64deb5c5 #421 2023-09-22 15:51:18 +02:00
402c6fc64a Fix log message when prompting which version to download 2023-09-03 01:38:38 +02:00
a1f934466c Update resolution with Keycloak 22 and up 2023-09-01 17:45:33 +02:00
15aa114579 Release v8 2023-08-28 20:11:32 +02:00
b9cc82e37d Show how to persist cache between builds 2023-08-28 20:09:48 +02:00
17 changed files with 130 additions and 57 deletions

View File

@ -158,6 +158,25 @@
"contributions": [ "contributions": [
"code" "code"
] ]
},
{
"login": "zavoloklom",
"name": "Sergey Kupletsky",
"avatar_url": "https://avatars.githubusercontent.com/u/4151869?v=4",
"profile": "https://github.com/zavoloklom",
"contributions": [
"test",
"code"
]
},
{
"login": "rome-user",
"name": "rome-user",
"avatar_url": "https://avatars.githubusercontent.com/u/114131048?v=4",
"profile": "https://github.com/rome-user",
"contributions": [
"code"
]
} }
], ],
"contributorsPerLine": 7, "contributorsPerLine": 7,
@ -165,5 +184,6 @@
"repoType": "github", "repoType": "github",
"repoHost": "https://github.com", "repoHost": "https://github.com",
"projectName": "keycloakify", "projectName": "keycloakify",
"projectOwner": "keycloakify" "projectOwner": "keycloakify",
"commitType": "docs"
} }

View File

@ -3,6 +3,7 @@ on:
push: push:
branches: branches:
- main - main
- v*
pull_request: pull_request:
branches: branches:
- main - main

View File

@ -47,7 +47,9 @@
> 📣 🛑 Account themes generated by Keycloakify are not currently compatible with Keycloak 22. > 📣 🛑 Account themes generated by Keycloakify are not currently compatible with Keycloak 22.
> We are working on a solution. [Follow progress](https://github.com/keycloakify/keycloakify/issues/389). > We are working on a solution. [Follow progress](https://github.com/keycloakify/keycloakify/issues/389).
> Login and email themes are not affected. > Login and email themes are not affected.
> UPDATE: [The PR](https://github.com/keycloak/keycloak/pull/22317) that should future proof Keycloakify account themes has been greenlighted
> by the Keycloak team. Resolution is only a matter of time.
Keycloakify is fully compatible with Keycloak, starting from version 11 and is anticipated to maintain compatibility with all future versions. Keycloakify is fully compatible with Keycloak, starting from version 11 and is anticipated to maintain compatibility with all future versions.
You can update your Keycloak, your Keycloakify generated theme won't break. You can update your Keycloak, your Keycloakify generated theme won't break.
@ -114,6 +116,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<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> <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>
<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> <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>
<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> <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>
<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>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rome-user"><img src="https://avatars.githubusercontent.com/u/114131048?v=4?s=100" width="100px;" alt="rome-user"/><br /><sub><b>rome-user</b></sub></a><br /><a href="https://github.com/keycloakify/keycloakify/commits?author=rome-user" title="Code">💻</a></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -125,11 +129,11 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
# Changelog highlights # Changelog highlights
## 8.0 (candidate) ## 8.0
- Much smaller .jar size. 70.2 MB -> 7.8 MB. - Much smaller .jar size. 70.2 MB -> 7.8 MB.
Keycloakify now detects which of the static resources from the default theme are actually used by your theme and only include those in the .jar. Keycloakify now detects which of the static resources from the default theme are actually used by your theme and only include those in the .jar.
- Build time: The first build is slowed but the subsequent build are faster. Update your CI so that nodes_modules/.cache is not deleted between builds. - Build time: The first build is slowed but the subsequent build are faster. [Update your CI so that the cache is persisted across CI build](https://github.com/keycloakify/keycloakify-starter/commit/bc378d5afb67e796f520afbc348185f3e319d9d0).
### Breaking changes ### Breaking changes

View File

@ -1,6 +1,6 @@
{ {
"name": "keycloakify", "name": "keycloakify",
"version": "8.0.0-rc.3", "version": "8.2.0",
"description": "Create Keycloak themes using React", "description": "Create Keycloak themes using React",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -22,7 +22,7 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
`${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly-additions.min.css`, `${url.resourcesCommonPath}/node_modules/patternfly/dist/css/patternfly-additions.min.css`,
`${url.resourcesPath}/css/account.css` `${url.resourcesPath}/css/account.css`
], ],
"htmlClassName": undefined, "htmlClassName": getClassName("kcHtmlClass"),
"bodyClassName": clsx("admin-console", "user", getClassName("kcBodyClass")) "bodyClassName": clsx("admin-console", "user", getClassName("kcBodyClass"))
}); });

View File

@ -11,4 +11,4 @@ export type TemplateProps<KcContext extends KcContext.Common, I18nExtended exten
children: ReactNode; children: ReactNode;
}; };
export type ClassKey = "kcBodyClass" | "kcButtonClass" | "kcButtonPrimaryClass" | "kcButtonLargeClass" | "kcButtonDefaultClass"; export type ClassKey = "kcHtmlClass" | "kcBodyClass" | "kcButtonClass" | "kcButtonPrimaryClass" | "kcButtonLargeClass" | "kcButtonDefaultClass";

View File

@ -3,6 +3,7 @@ import type { ClassKey } from "keycloakify/account/TemplateProps";
export const { useGetClassName } = createUseClassName<ClassKey>({ export const { useGetClassName } = createUseClassName<ClassKey>({
"defaultClasses": { "defaultClasses": {
"kcHtmlClass": undefined,
"kcBodyClass": undefined, "kcBodyClass": undefined,
"kcButtonClass": "btn", "kcButtonClass": "btn",
"kcButtonPrimaryClass": "btn-primary", "kcButtonPrimaryClass": "btn-primary",

View File

@ -51,7 +51,7 @@ export default function Account(props: PageProps<Extract<KcContext, { pageId: "a
id="username" id="username"
name="username" name="username"
disabled={!realm.editUsernameAllowed} disabled={!realm.editUsernameAllowed}
value={account.username ?? ""} defaultValue={account.username ?? ""}
/> />
</div> </div>
</div> </div>
@ -66,7 +66,7 @@ export default function Account(props: PageProps<Extract<KcContext, { pageId: "a
</div> </div>
<div className="col-sm-10 col-md-10"> <div className="col-sm-10 col-md-10">
<input type="text" className="form-control" id="email" name="email" autoFocus value={account.email ?? ""} /> <input type="text" className="form-control" id="email" name="email" autoFocus defaultValue={account.email ?? ""} />
</div> </div>
</div> </div>
@ -79,7 +79,7 @@ export default function Account(props: PageProps<Extract<KcContext, { pageId: "a
</div> </div>
<div className="col-sm-10 col-md-10"> <div className="col-sm-10 col-md-10">
<input type="text" className="form-control" id="firstName" name="firstName" value={account.firstName ?? ""} /> <input type="text" className="form-control" id="firstName" name="firstName" defaultValue={account.firstName ?? ""} />
</div> </div>
</div> </div>
@ -92,7 +92,7 @@ export default function Account(props: PageProps<Extract<KcContext, { pageId: "a
</div> </div>
<div className="col-sm-10 col-md-10"> <div className="col-sm-10 col-md-10">
<input type="text" className="form-control" id="lastName" name="lastName" value={account.lastName ?? ""} /> <input type="text" className="form-control" id="lastName" name="lastName" defaultValue={account.lastName ?? ""} />
</div> </div>
</div> </div>

View File

@ -4,7 +4,7 @@ import { crawl } from "./tools/crawl";
import { join as pathJoin } from "path"; import { join as pathJoin } from "path";
import { themeTypes } from "./keycloakify/generateFtl"; import { themeTypes } from "./keycloakify/generateFtl";
const themeSrcDirBasename = "keycloak-theme"; const themeSrcDirBasenames = ["keycloak-theme", "keycloak_theme"];
/** Can't catch error, if the directory isn't found, this function will just exit the process with an error message. */ /** Can't catch error, if the directory isn't found, this function will just exit the process with an error message. */
export function getThemeSrcDirPath(params: { projectDirPath: string }) { export function getThemeSrcDirPath(params: { projectDirPath: string }) {
@ -14,13 +14,13 @@ export function getThemeSrcDirPath(params: { projectDirPath: string }) {
const themeSrcDirPath: string | undefined = crawl({ "dirPath": srcDirPath, "returnedPathsType": "relative to dirPath" }) const themeSrcDirPath: string | undefined = crawl({ "dirPath": srcDirPath, "returnedPathsType": "relative to dirPath" })
.map(fileRelativePath => { .map(fileRelativePath => {
const split = fileRelativePath.split(themeSrcDirBasename); for (const themeSrcDirBasename of themeSrcDirBasenames) {
const split = fileRelativePath.split(themeSrcDirBasename);
if (split.length !== 2) { if (split.length === 2) {
return undefined; return pathJoin(srcDirPath, split[0] + themeSrcDirBasename);
}
} }
return undefined;
return pathJoin(srcDirPath, split[0] + themeSrcDirBasename);
}) })
.filter(exclude(undefined))[0]; .filter(exclude(undefined))[0];
@ -38,7 +38,7 @@ export function getThemeSrcDirPath(params: { projectDirPath: string }) {
console.error( console.error(
[ [
"Can't locate your theme source directory. It should be either: ", "Can't locate your theme source directory. It should be either: ",
"src/ or src/keycloak-theme.", "src/ or src/keycloak-theme or src/keycloak_theme.",
"Example in the starter: https://github.com/keycloakify/keycloakify-starter/tree/main/src/keycloak-theme" "Example in the starter: https://github.com/keycloakify/keycloakify-starter/tree/main/src/keycloak-theme"
].join("\n") ].join("\n")
); );

View File

@ -1,6 +1,6 @@
import { transformCodebase } from "../../tools/transformCodebase"; import { transformCodebase } from "../../tools/transformCodebase";
import * as fs from "fs"; import * as fs from "fs";
import { join as pathJoin, relative as pathRelative } from "path"; import { join as pathJoin, relative as pathRelative, dirname as pathDirname } from "path";
import type { ThemeType } from "../generateFtl"; import type { ThemeType } from "../generateFtl";
import { downloadBuiltinKeycloakTheme } from "../../download-builtin-keycloak-theme"; import { downloadBuiltinKeycloakTheme } from "../../download-builtin-keycloak-theme";
import { import {
@ -9,6 +9,7 @@ import {
basenameOfKeycloakDirInPublicDir basenameOfKeycloakDirInPublicDir
} from "../../mockTestingResourcesPath"; } from "../../mockTestingResourcesPath";
import * as crypto from "crypto"; import * as crypto from "crypto";
import { assert } from "tsafe/assert";
export async function downloadKeycloakStaticResources( export async function downloadKeycloakStaticResources(
// prettier-ignore // prettier-ignore
@ -23,7 +24,32 @@ export async function downloadKeycloakStaticResources(
} | undefined } | undefined
} }
) { ) {
const { projectDirPath, themeType, themeDirPath, keycloakVersion, usedResources } = params; const { projectDirPath, themeType, themeDirPath, keycloakVersion } = params;
// NOTE: Hack for 427
const usedResources = (() => {
const { usedResources } = params;
if (usedResources === undefined) {
return undefined;
}
assert(usedResources !== undefined);
return {
"resourcesCommonDirPaths": usedResources.resourcesCommonFilePaths.map(filePath => {
{
const splitArg = "/dist/";
if (filePath.includes(splitArg)) {
return filePath.split(splitArg)[0] + splitArg;
}
}
return pathDirname(filePath);
})
};
})();
const tmpDirPath = pathJoin( const tmpDirPath = pathJoin(
themeDirPath, themeDirPath,
@ -39,17 +65,7 @@ export async function downloadKeycloakStaticResources(
transformCodebase({ transformCodebase({
"srcDirPath": pathJoin(tmpDirPath, "keycloak", themeType, "resources"), "srcDirPath": pathJoin(tmpDirPath, "keycloak", themeType, "resources"),
"destDirPath": pathJoin(themeDirPath, pathRelative(basenameOfKeycloakDirInPublicDir, resourcesDirPathRelativeToPublicDir)), "destDirPath": pathJoin(themeDirPath, pathRelative(basenameOfKeycloakDirInPublicDir, resourcesDirPathRelativeToPublicDir))
"transformSourceCode":
usedResources === undefined
? undefined
: ({ fileRelativePath, sourceCode }) => {
if (!usedResources.resourcesFilePaths.includes(fileRelativePath)) {
return undefined;
}
return { "modifiedSourceCode": sourceCode };
}
}); });
transformCodebase({ transformCodebase({
@ -59,7 +75,7 @@ export async function downloadKeycloakStaticResources(
usedResources === undefined usedResources === undefined
? undefined ? undefined
: ({ fileRelativePath, sourceCode }) => { : ({ fileRelativePath, sourceCode }) => {
if (!usedResources.resourcesCommonFilePaths.includes(fileRelativePath)) { if (usedResources.resourcesCommonDirPaths.find(dirPath => fileRelativePath.startsWith(dirPath)) === undefined) {
return undefined; return undefined;
} }

View File

@ -16,18 +16,25 @@ export function replaceImportsFromStaticInJsCode(params: { jsCode: string }): {
const { jsCode } = params; const { jsCode } = params;
const getReplaceArgs = (language: "js" | "css"): Parameters<typeof String.prototype.replace> => [ const getReplaceArgs = (language: "js" | "css"): Parameters<typeof String.prototype.replace> => [
new RegExp(`([a-zA-Z_]+)\\.([a-zA-Z]+)=function\\(([a-zA-Z]+)\\){return"static\\/${language}\\/"`, "g"), new RegExp(`([a-zA-Z_]+)\\.([a-zA-Z]+)=(function\\(([a-z]+)\\){return|([a-z]+)=>)"static\\/${language}\\/"`, "g"),
(...[, n, u, e]) => ` (...[, n, u, matchedFunction, eForFunction]) => {
${n}[(function(){ const isArrowFunction = matchedFunction.includes("=>");
var pd= Object.getOwnPropertyDescriptor(${n}, "p"); const e = isArrowFunction ? matchedFunction.replace("=>", "").trim() : eForFunction;
return `
${n}[(function(){
var pd = Object.getOwnPropertyDescriptor(${n}, "p");
if( pd === undefined || pd.configurable ){ if( pd === undefined || pd.configurable ){
Object.defineProperty(${n}, "p", { Object.defineProperty(${n}, "p", {
get: function() { return window.${ftlValuesGlobalName}.url.resourcesPath; }, get: function() { return window.${ftlValuesGlobalName}.url.resourcesPath; },
set: function (){} set: function() {}
}); });
} }
return "${u}"; return "${u}";
})()] = function(${e}) { return "${true ? "/build/" : ""}static/${language}/"` })()] = ${isArrowFunction ? `${e} =>` : `function(${e}) { return `} "/build/static/${language}/"`
.replace(/\s+/g, " ")
.trim();
}
]; ];
const fixedJsCode = jsCode const fixedJsCode = jsCode

View File

@ -17,7 +17,7 @@ export async function promptKeycloakVersion() {
return { getLatestsSemVersionedTag }; return { getLatestsSemVersionedTag };
})(); })();
console.log("Initialize the directory with email template from which keycloak version?"); console.log("Select Keycloak version?");
const tags = [ const tags = [
...(await getLatestsSemVersionedTag({ ...(await getLatestsSemVersionedTag({

View File

@ -23,24 +23,21 @@ export function usePrepareTemplate(params: {
const removeArray: (() => void)[] = []; const removeArray: (() => void)[] = [];
(async () => { (async () => {
const prLoadedArray: Promise<void>[] = []; for (const style of [...styles].reverse()) {
styles.reverse().forEach(href => {
const { prLoaded, remove } = headInsert({ const { prLoaded, remove } = headInsert({
"type": "css", "type": "css",
"position": "prepend", "position": "prepend",
href "href": style
}); });
removeArray.push(remove); removeArray.push(remove);
prLoadedArray.push(prLoaded); // TODO: Find a way to do that in parallel (without breaking the order)
}); await prLoaded;
await Promise.all(prLoadedArray); if (isUnmounted) {
return;
if (isUnmounted) { }
return;
} }
setReady(); setReady();

View File

@ -38,7 +38,7 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
`${url.resourcesPath}/css/login.css` `${url.resourcesPath}/css/login.css`
], ],
"htmlClassName": getClassName("kcHtmlClass"), "htmlClassName": getClassName("kcHtmlClass"),
"bodyClassName": undefined "bodyClassName": getClassName("kcBodyClass")
}); });
if (!isReady) { if (!isReady) {

View File

@ -21,6 +21,7 @@ export type TemplateProps<KcContext extends KcContext.Common, I18nExtended exten
}; };
export type ClassKey = export type ClassKey =
| "kcBodyClass"
| "kcHtmlClass" | "kcHtmlClass"
| "kcLoginClass" | "kcLoginClass"
| "kcHeaderClass" | "kcHeaderClass"

View File

@ -3,6 +3,7 @@ import type { ClassKey } from "keycloakify/login/TemplateProps";
export const { useGetClassName } = createUseClassName<ClassKey>({ export const { useGetClassName } = createUseClassName<ClassKey>({
"defaultClasses": { "defaultClasses": {
"kcBodyClass": undefined,
"kcHtmlClass": "login-pf", "kcHtmlClass": "login-pf",
"kcLoginClass": "login-pf-page", "kcLoginClass": "login-pf-page",
"kcContentWrapperClass": "row", "kcContentWrapperClass": "row",

View File

@ -32,6 +32,10 @@ describe("bin/js-transforms", () => {
908:"67c9ed2c" 908:"67c9ed2c"
}[e]+".chunk.css" }[e]+".chunk.css"
} }
n.u=e=>"static/js/"+e+"."+{69:"4f205f87",128:"49264537",453:"b2fed72e",482:"f0106901"}[e]+".chunk.js"
t.miniCssF=e=>"static/css/"+e+"."+{164:"dcfd7749",908:"67c9ed2c"}[e]+".chunk.css"
`; `;
it("transforms standalone code properly", () => { it("transforms standalone code properly", () => {
const { fixedJsCode } = replaceImportsFromStaticInJsCode({ const { fixedJsCode } = replaceImportsFromStaticInJsCode({
@ -52,11 +56,11 @@ describe("bin/js-transforms", () => {
} }
__webpack_require__[(function (){ __webpack_require__[(function (){
var pd= Object.getOwnPropertyDescriptor(__webpack_require__, "p"); var pd = Object.getOwnPropertyDescriptor(__webpack_require__, "p");
if( pd === undefined || pd.configurable ){ if( pd === undefined || pd.configurable ){
Object.defineProperty(__webpack_require__, "p", { Object.defineProperty(__webpack_require__, "p", {
get: function() { return window.kcContext.url.resourcesPath; }, get: function() { return window.kcContext.url.resourcesPath; },
set: function (){} set: function() {}
}); });
} }
return "u"; return "u";
@ -69,11 +73,11 @@ describe("bin/js-transforms", () => {
} }
t[(function (){ t[(function (){
var pd= Object.getOwnPropertyDescriptor(t, "p"); var pd = Object.getOwnPropertyDescriptor(t, "p");
if( pd === undefined || pd.configurable ){ if( pd === undefined || pd.configurable ){
Object.defineProperty(t, "p", { Object.defineProperty(t, "p", {
get: function() { return window.kcContext.url.resourcesPath; }, get: function() { return window.kcContext.url.resourcesPath; },
set: function (){} set: function() {}
}); });
} }
return "miniCssF"; return "miniCssF";
@ -83,7 +87,28 @@ describe("bin/js-transforms", () => {
908:"67c9ed2c" 908:"67c9ed2c"
} [e] + ".chunk.css" } [e] + ".chunk.css"
} }
n[(function(){
var pd = Object.getOwnPropertyDescriptor(n, "p");
if( pd === undefined || pd.configurable ){
Object.defineProperty(n, "p", {
get: function() { return window.kcContext.url.resourcesPath; },
set: function() {}
});
}
return "u";
})()] = e => "/build/static/js/"+e+"."+{69:"4f205f87",128:"49264537",453:"b2fed72e",482:"f0106901"}[e]+".chunk.js"
t[(function(){
var pd = Object.getOwnPropertyDescriptor(t, "p");
if( pd === undefined || pd.configurable ){
Object.defineProperty(t, "p", {
get: function() { return window.kcContext.url.resourcesPath; },
set: function() {}
});
}
return "miniCssF";
})()] = e => "/build/static/css/"+e+"."+{164:"dcfd7749",908:"67c9ed2c"}[e]+".chunk.css"
`; `;
expect(isSameCode(fixedJsCode, fixedJsCodeExpected)).toBe(true); expect(isSameCode(fixedJsCode, fixedJsCodeExpected)).toBe(true);