Feature -p or --project option for ease of use in monorepo setups #449

This commit is contained in:
Joseph Garrone
2024-02-08 00:56:33 +01:00
parent 3e336f4937
commit 5bf905723c
5 changed files with 28 additions and 22 deletions

View File

@ -11,10 +11,7 @@ import { getThemeSrcDirPath } from "../getThemeSrcDirPath";
import { getProjectRoot } from "../tools/getProjectRoot";
export async function main() {
const reactAppRootDirPath = process.cwd();
const buildOptions = readBuildOptions({
reactAppRootDirPath,
"processArgv": process.argv.slice(2)
});
@ -23,7 +20,7 @@ export async function main() {
const keycloakifyDirPath = getProjectRoot();
const { themeSrcDirPath } = getThemeSrcDirPath({ reactAppRootDirPath });
const { themeSrcDirPath } = getThemeSrcDirPath({ "reactAppRootDirPath": buildOptions.reactAppRootDirPath });
for (const themeName of buildOptions.themeNames) {
await generateTheme({
@ -83,12 +80,17 @@ export async function main() {
"",
...(!buildOptions.doCreateJar
? []
: [`✅ Your keycloak theme has been generated and bundled into .${pathSep}${pathRelative(reactAppRootDirPath, jarFilePath)} 🚀`]),
: [
`✅ Your keycloak theme has been generated and bundled into .${pathSep}${pathRelative(
buildOptions.reactAppRootDirPath,
jarFilePath
)} 🚀`
]),
"",
`To test your theme locally you can spin up a Keycloak ${containerKeycloakVersion} container image with the theme pre loaded by running:`,
"",
`👉 $ .${pathSep}${pathRelative(
reactAppRootDirPath,
buildOptions.reactAppRootDirPath,
pathJoin(buildOptions.keycloakifyBuildDirPath, generateStartKeycloakTestingContainer.basename)
)} 👈`,
``,