Extract only required files

This commit is contained in:
Joseph Garrone
2024-09-08 12:40:28 +02:00
parent 98d3d1967a
commit ee6322aae4
5 changed files with 319 additions and 29 deletions

View File

@ -1,6 +1,5 @@
import * as fs from "fs";
import { join as pathJoin } from "path";
import { KEYCLOAK_VERSION } from "../shared/constants";
import { transformCodebase } from "../../src/bin/tools/transformCodebase";
import { downloadKeycloakDefaultTheme } from "../shared/downloadKeycloakDefaultTheme";
import { WELL_KNOWN_DIRECTORY_BASE_NAME } from "../../src/bin/shared/constants";
@ -10,7 +9,7 @@ import * as fsPr from "fs/promises";
export async function createAccountV1Dir() {
const { extractedDirPath } = await downloadKeycloakDefaultTheme({
keycloakVersion: KEYCLOAK_VERSION.FOR_ACCOUNT_MULTI_PAGE
keycloakVersionId: "FOR_ACCOUNT_MULTI_PAGE"
});
const destDirPath = pathJoin(

View File

@ -1,6 +1,5 @@
import { join as pathJoin } from "path";
import { downloadKeycloakDefaultTheme } from "../shared/downloadKeycloakDefaultTheme";
import { KEYCLOAK_VERSION } from "../shared/constants";
import { transformCodebase } from "../../src/bin/tools/transformCodebase";
import { existsAsync } from "../../src/bin/tools/fs.existsAsync";
import { getThisCodebaseRootDirPath } from "../../src/bin/tools/getThisCodebaseRootDirPath";
@ -11,18 +10,16 @@ import * as fsPr from "fs/promises";
export async function createPublicDotKeycloakifyDir() {
await Promise.all(
(["login", "account"] as const).map(async themeType => {
const keycloakVersion = (() => {
switch (themeType) {
case "login":
return KEYCLOAK_VERSION.FOR_LOGIN_THEME;
case "account":
return KEYCLOAK_VERSION.FOR_ACCOUNT_MULTI_PAGE;
}
assert<Equals<typeof themeType, never>>();
})();
const { extractedDirPath } = await downloadKeycloakDefaultTheme({
keycloakVersion
keycloakVersionId: (() => {
switch (themeType) {
case "login":
return "FOR_LOGIN_THEME";
case "account":
return "FOR_ACCOUNT_MULTI_PAGE";
}
assert<Equals<typeof themeType, never>>();
})()
});
const destDirPath = pathJoin(