Fix build
This commit is contained in:
parent
1671850714
commit
e6661cb898
@ -3,7 +3,7 @@ import * as fs from "fs";
|
|||||||
import { join as pathJoin, relative as pathRelative, dirname as pathDirname, sep as pathSep } from "path";
|
import { join as pathJoin, relative as pathRelative, dirname as pathDirname, sep as pathSep } from "path";
|
||||||
import { crawl } from "../src/bin/tools/crawl";
|
import { crawl } from "../src/bin/tools/crawl";
|
||||||
import { downloadBuiltinKeycloakTheme } from "../src/bin/download-builtin-keycloak-theme";
|
import { downloadBuiltinKeycloakTheme } from "../src/bin/download-builtin-keycloak-theme";
|
||||||
import { getProjectRoot } from "../src/bin/tools/getProjectRoot";
|
import { getThisCodebaseRootDirPath } from "../src/bin/tools/getThisCodebaseRootDirPath";
|
||||||
import { getLogger } from "../src/bin/tools/logger";
|
import { getLogger } from "../src/bin/tools/logger";
|
||||||
|
|
||||||
// NOTE: To run without argument when we want to generate src/i18n/generated_kcMessages files,
|
// NOTE: To run without argument when we want to generate src/i18n/generated_kcMessages files,
|
||||||
@ -19,7 +19,9 @@ const logger = getLogger({ isSilent });
|
|||||||
async function main() {
|
async function main() {
|
||||||
const keycloakVersion = "23.0.4";
|
const keycloakVersion = "23.0.4";
|
||||||
|
|
||||||
const tmpDirPath = pathJoin(getProjectRoot(), "tmp_xImOef9dOd44");
|
const thisCodebaseRootDirPath = getThisCodebaseRootDirPath();
|
||||||
|
|
||||||
|
const tmpDirPath = pathJoin(thisCodebaseRootDirPath, "tmp_xImOef9dOd44");
|
||||||
|
|
||||||
fs.rmSync(tmpDirPath, { "recursive": true, "force": true });
|
fs.rmSync(tmpDirPath, { "recursive": true, "force": true });
|
||||||
|
|
||||||
@ -31,7 +33,8 @@ async function main() {
|
|||||||
keycloakVersion,
|
keycloakVersion,
|
||||||
"destDirPath": tmpDirPath,
|
"destDirPath": tmpDirPath,
|
||||||
"buildOptions": {
|
"buildOptions": {
|
||||||
"cacheDirPath": pathJoin(getProjectRoot(), "node_modules", ".cache", "keycloakify")
|
"cacheDirPath": pathJoin(thisCodebaseRootDirPath, "node_modules", ".cache", "keycloakify"),
|
||||||
|
"npmWorkspaceRootDirPath": thisCodebaseRootDirPath
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -72,12 +75,12 @@ async function main() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const baseMessagesDirPath = pathJoin(getProjectRoot(), "src", themeType, "i18n", "baseMessages");
|
const baseMessagesDirPath = pathJoin(thisCodebaseRootDirPath, "src", themeType, "i18n", "baseMessages");
|
||||||
|
|
||||||
const languages = Object.keys(recordForPageType);
|
const languages = Object.keys(recordForPageType);
|
||||||
|
|
||||||
const generatedFileHeader = [
|
const generatedFileHeader = [
|
||||||
`//This code was automatically generated by running ${pathRelative(getProjectRoot(), __filename)}`,
|
`//This code was automatically generated by running ${pathRelative(thisCodebaseRootDirPath, __filename)}`,
|
||||||
"//PLEASE DO NOT EDIT MANUALLY",
|
"//PLEASE DO NOT EDIT MANUALLY",
|
||||||
""
|
""
|
||||||
].join("\n");
|
].join("\n");
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { execSync } from "child_process";
|
import { execSync } from "child_process";
|
||||||
import { join as pathJoin, relative as pathRelative } from "path";
|
import { join as pathJoin, relative as pathRelative } from "path";
|
||||||
import { getProjectRoot } from "../src/bin/tools/getProjectRoot";
|
import { getThisCodebaseRootDirPath } from "../src/bin/tools/getThisCodebaseRootDirPath";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
|
|
||||||
const singletonDependencies: string[] = ["react", "@types/react"];
|
const singletonDependencies: string[] = ["react", "@types/react"];
|
||||||
|
|
||||||
const rootDirPath = getProjectRoot();
|
const rootDirPath = getThisCodebaseRootDirPath();
|
||||||
|
|
||||||
//NOTE: This is only required because of: https://github.com/garronej/ts-ci/blob/c0e207b9677523d4ec97fe672ddd72ccbb3c1cc4/README.md?plain=1#L54-L58
|
//NOTE: This is only required because of: https://github.com/garronej/ts-ci/blob/c0e207b9677523d4ec97fe672ddd72ccbb3c1cc4/README.md?plain=1#L54-L58
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
import { downloadAndUnzip } from "keycloakify/bin/tools/downloadAndUnzip";
|
import { downloadAndUnzip } from "keycloakify/bin/downloadAndUnzip";
|
||||||
|
import { join as pathJoin } from "path";
|
||||||
|
import { getThisCodebaseRootDirPath } from "keycloakify/bin/tools/getThisCodebaseRootDirPath";
|
||||||
|
|
||||||
export async function setupSampleReactProject(destDirPath: string) {
|
export async function setupSampleReactProject(destDirPath: string) {
|
||||||
|
const thisCodebaseRootDirPath = getThisCodebaseRootDirPath();
|
||||||
|
|
||||||
await downloadAndUnzip({
|
await downloadAndUnzip({
|
||||||
"url": "https://github.com/keycloakify/keycloakify/releases/download/v0.0.1/sample_build_dir_and_package_json.zip",
|
"url": "https://github.com/keycloakify/keycloakify/releases/download/v0.0.1/sample_build_dir_and_package_json.zip",
|
||||||
"destDirPath": destDirPath,
|
"destDirPath": destDirPath,
|
||||||
"doUseCache": false
|
"buildOptions": {
|
||||||
|
"cacheDirPath": pathJoin(thisCodebaseRootDirPath, "node_modules", ".cache", "keycloakify"),
|
||||||
|
"npmWorkspaceRootDirPath": thisCodebaseRootDirPath
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user