Rename reactAppRootDirPath -> projectDirPath and reactAppBuildDirPath -> projectBuildDirPath
This commit is contained in:
parent
6e95dacd3a
commit
3453a17c15
@ -54,7 +54,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
||||
console.log(`→ ${pageId}`);
|
||||
|
||||
const { themeSrcDirPath } = getThemeSrcDirPath({
|
||||
reactAppRootDirPath: buildOptions.reactAppRootDirPath
|
||||
projectDirPath: buildOptions.projectDirPath
|
||||
});
|
||||
|
||||
const componentBasename = capitalize(kebabCaseToCamelCase(pageId)).replace(
|
||||
|
@ -69,7 +69,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
||||
console.log(`→ ${pageIdOrComponent}`);
|
||||
|
||||
const { themeSrcDirPath } = getThemeSrcDirPath({
|
||||
reactAppRootDirPath: buildOptions.reactAppRootDirPath
|
||||
projectDirPath: buildOptions.projectDirPath
|
||||
});
|
||||
|
||||
const componentBasename = (() => {
|
||||
|
@ -13,7 +13,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
||||
const buildOptions = readBuildOptions({ cliCommandOptions });
|
||||
|
||||
const { themeSrcDirPath } = getThemeSrcDirPath({
|
||||
reactAppRootDirPath: buildOptions.reactAppRootDirPath
|
||||
projectDirPath: buildOptions.projectDirPath
|
||||
});
|
||||
|
||||
const emailThemeSrcDirPath = pathJoin(themeSrcDirPath, "email");
|
||||
|
@ -19,7 +19,7 @@ export type BuildOptionsLike = {
|
||||
bundler: "vite" | "webpack";
|
||||
themeVersion: string;
|
||||
urlPathname: string | undefined;
|
||||
reactAppBuildDirPath: string;
|
||||
projectBuildDirPath: string;
|
||||
assetsDirPath: string;
|
||||
kcContextExclusionsFtlCode: string | undefined;
|
||||
};
|
||||
|
@ -46,10 +46,10 @@ export type BuildOptionsLike = BuildOptionsLike_kcContextExclusionsFtlCode &
|
||||
bundler: "vite" | "webpack";
|
||||
extraThemeProperties: string[] | undefined;
|
||||
loginThemeResourcesFromKeycloakVersion: string;
|
||||
reactAppBuildDirPath: string;
|
||||
projectBuildDirPath: string;
|
||||
assetsDirPath: string;
|
||||
urlPathname: string | undefined;
|
||||
reactAppRootDirPath: string;
|
||||
projectDirPath: string;
|
||||
keycloakifyBuildDirPath: string;
|
||||
environmentVariables: { name: string; default: string }[];
|
||||
};
|
||||
@ -63,7 +63,7 @@ export async function generateSrcMainResourcesForMainTheme(params: {
|
||||
const { themeName, buildOptions } = params;
|
||||
|
||||
const { themeSrcDirPath } = getThemeSrcDirPath({
|
||||
reactAppRootDirPath: buildOptions.reactAppRootDirPath
|
||||
projectDirPath: buildOptions.projectDirPath
|
||||
});
|
||||
|
||||
const getThemeTypeDirPath = (params: { themeType: ThemeType | "email" }) => {
|
||||
@ -124,7 +124,7 @@ export async function generateSrcMainResourcesForMainTheme(params: {
|
||||
}
|
||||
|
||||
transformCodebase({
|
||||
srcDirPath: buildOptions.reactAppBuildDirPath,
|
||||
srcDirPath: buildOptions.projectBuildDirPath,
|
||||
destDirPath,
|
||||
transformSourceCode: ({ filePath, sourceCode }) => {
|
||||
//NOTE: Prevent cycles, excludes the folder we generated for debug in public/
|
||||
@ -132,7 +132,7 @@ export async function generateSrcMainResourcesForMainTheme(params: {
|
||||
if (
|
||||
isInside({
|
||||
dirPath: pathJoin(
|
||||
buildOptions.reactAppBuildDirPath,
|
||||
buildOptions.projectBuildDirPath,
|
||||
keycloak_resources
|
||||
),
|
||||
filePath
|
||||
@ -179,7 +179,7 @@ export async function generateSrcMainResourcesForMainTheme(params: {
|
||||
const { generateFtlFilesCode } = generateFtlFilesCodeFactory({
|
||||
themeName,
|
||||
indexHtmlCode: fs
|
||||
.readFileSync(pathJoin(buildOptions.reactAppBuildDirPath, "index.html"))
|
||||
.readFileSync(pathJoin(buildOptions.projectBuildDirPath, "index.html"))
|
||||
.toString("utf8"),
|
||||
cssGlobalsToDefine,
|
||||
buildOptions,
|
||||
|
@ -84,7 +84,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
||||
}
|
||||
|
||||
child_process.execSync("npx vite", {
|
||||
cwd: buildOptions.reactAppRootDirPath,
|
||||
cwd: buildOptions.projectDirPath,
|
||||
env: {
|
||||
...process.env,
|
||||
[vitePluginSubScriptEnvNames.runPostBuildScript]:
|
||||
|
@ -5,7 +5,7 @@ import { replaceImportsInJsCode_webpack } from "./webpack";
|
||||
import * as fs from "fs";
|
||||
|
||||
export type BuildOptionsLike = {
|
||||
reactAppBuildDirPath: string;
|
||||
projectBuildDirPath: string;
|
||||
assetsDirPath: string;
|
||||
urlPathname: string | undefined;
|
||||
bundler: "vite" | "webpack";
|
||||
|
@ -8,7 +8,7 @@ import * as nodePath from "path";
|
||||
import { replaceAll } from "../../../tools/String.prototype.replaceAll";
|
||||
|
||||
export type BuildOptionsLike = {
|
||||
reactAppBuildDirPath: string;
|
||||
projectBuildDirPath: string;
|
||||
assetsDirPath: string;
|
||||
urlPathname: string | undefined;
|
||||
};
|
||||
@ -62,7 +62,7 @@ export function replaceImportsInJsCode_vite(params: {
|
||||
// Example: "assets/ or "foo/bar/"
|
||||
const staticDir = (() => {
|
||||
let out = pathRelative(
|
||||
buildOptions.reactAppBuildDirPath,
|
||||
buildOptions.projectBuildDirPath,
|
||||
buildOptions.assetsDirPath
|
||||
);
|
||||
|
||||
@ -70,7 +70,7 @@ export function replaceImportsInJsCode_vite(params: {
|
||||
|
||||
if (out === "/") {
|
||||
throw new Error(
|
||||
`The assetsDirPath must be a subdirectory of reactAppBuildDirPath`
|
||||
`The assetsDirPath must be a subdirectory of projectBuildDirPath`
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ import * as nodePath from "path";
|
||||
import { replaceAll } from "../../../tools/String.prototype.replaceAll";
|
||||
|
||||
export type BuildOptionsLike = {
|
||||
reactAppBuildDirPath: string;
|
||||
projectBuildDirPath: string;
|
||||
assetsDirPath: string;
|
||||
urlPathname: string | undefined;
|
||||
};
|
||||
@ -50,7 +50,7 @@ export function replaceImportsInJsCode_webpack(params: {
|
||||
// Example: "static/ or "foo/bar/"
|
||||
const staticDir = (() => {
|
||||
let out = pathRelative(
|
||||
buildOptions.reactAppBuildDirPath,
|
||||
buildOptions.projectBuildDirPath,
|
||||
buildOptions.assetsDirPath
|
||||
);
|
||||
|
||||
@ -58,7 +58,7 @@ export function replaceImportsInJsCode_webpack(params: {
|
||||
|
||||
if (out === "/") {
|
||||
throw new Error(
|
||||
`The assetsDirPath must be a subdirectory of reactAppBuildDirPath`
|
||||
`The assetsDirPath must be a subdirectory of projectBuildDirPath`
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@ import { readThisNpmPackageVersion } from "./tools/readThisNpmPackageVersion";
|
||||
import * as child_process from "child_process";
|
||||
|
||||
export type CliCommandOptions = {
|
||||
reactAppRootDirPath: string | undefined;
|
||||
projectDirPath: string | undefined;
|
||||
};
|
||||
|
||||
const program = termost<CliCommandOptions>(
|
||||
@ -25,7 +25,7 @@ const program = termost<CliCommandOptions>(
|
||||
const optionsKeys: string[] = [];
|
||||
|
||||
program.option({
|
||||
key: "reactAppRootDirPath",
|
||||
key: "projectDirPath",
|
||||
name: (() => {
|
||||
const long = "project";
|
||||
const short = "p";
|
||||
|
@ -18,8 +18,8 @@ export type BuildOptions = {
|
||||
groupId: string;
|
||||
artifactId: string;
|
||||
loginThemeResourcesFromKeycloakVersion: string;
|
||||
reactAppRootDirPath: string;
|
||||
reactAppBuildDirPath: string;
|
||||
projectDirPath: string;
|
||||
projectBuildDirPath: string;
|
||||
/** Directory that keycloakify outputs to. Defaults to {cwd}/build_keycloak */
|
||||
keycloakifyBuildDirPath: string;
|
||||
publicDirPath: string;
|
||||
@ -57,13 +57,13 @@ export function readBuildOptions(params: {
|
||||
}): BuildOptions {
|
||||
const { cliCommandOptions } = params;
|
||||
|
||||
const reactAppRootDirPath = (() => {
|
||||
if (cliCommandOptions.reactAppRootDirPath === undefined) {
|
||||
const projectDirPath = (() => {
|
||||
if (cliCommandOptions.projectDirPath === undefined) {
|
||||
return process.cwd();
|
||||
}
|
||||
|
||||
return getAbsoluteAndInOsFormatPath({
|
||||
pathIsh: cliCommandOptions.reactAppRootDirPath,
|
||||
pathIsh: cliCommandOptions.projectDirPath,
|
||||
cwd: process.cwd()
|
||||
});
|
||||
})();
|
||||
@ -71,7 +71,7 @@ export function readBuildOptions(params: {
|
||||
const { resolvedViteConfig } = (() => {
|
||||
if (
|
||||
fs
|
||||
.readdirSync(reactAppRootDirPath)
|
||||
.readdirSync(projectDirPath)
|
||||
.find(fileBasename => fileBasename.startsWith("vite.config")) ===
|
||||
undefined
|
||||
) {
|
||||
@ -80,7 +80,7 @@ export function readBuildOptions(params: {
|
||||
|
||||
const output = child_process
|
||||
.execSync("npx vite", {
|
||||
cwd: reactAppRootDirPath,
|
||||
cwd: projectDirPath,
|
||||
env: {
|
||||
...process.env,
|
||||
[vitePluginSubScriptEnvNames.resolveViteConfig]: "true"
|
||||
@ -108,7 +108,7 @@ export function readBuildOptions(params: {
|
||||
version?: string;
|
||||
homepage?: string;
|
||||
keycloakify?: UserProvidedBuildOptions & {
|
||||
reactAppBuildDirPath?: string;
|
||||
projectBuildDirPath?: string;
|
||||
};
|
||||
};
|
||||
|
||||
@ -122,7 +122,7 @@ export function readBuildOptions(params: {
|
||||
artifactId: z.string().optional(),
|
||||
groupId: z.string().optional(),
|
||||
loginThemeResourcesFromKeycloakVersion: z.string().optional(),
|
||||
reactAppBuildDirPath: z.string().optional(),
|
||||
projectBuildDirPath: z.string().optional(),
|
||||
keycloakifyBuildDirPath: z.string().optional(),
|
||||
themeName: z.union([z.string(), z.array(z.string())]).optional()
|
||||
})
|
||||
@ -138,9 +138,7 @@ export function readBuildOptions(params: {
|
||||
|
||||
return zParsedPackageJson.parse(
|
||||
JSON.parse(
|
||||
fs
|
||||
.readFileSync(pathJoin(reactAppRootDirPath, "package.json"))
|
||||
.toString("utf8")
|
||||
fs.readFileSync(pathJoin(projectDirPath, "package.json")).toString("utf8")
|
||||
)
|
||||
);
|
||||
})();
|
||||
@ -167,27 +165,27 @@ export function readBuildOptions(params: {
|
||||
return userProvidedBuildOptions.themeName;
|
||||
})();
|
||||
|
||||
const reactAppBuildDirPath = (() => {
|
||||
const projectBuildDirPath = (() => {
|
||||
webpack: {
|
||||
if (resolvedViteConfig !== undefined) {
|
||||
break webpack;
|
||||
}
|
||||
|
||||
if (parsedPackageJson.keycloakify?.reactAppBuildDirPath !== undefined) {
|
||||
if (parsedPackageJson.keycloakify?.projectBuildDirPath !== undefined) {
|
||||
return getAbsoluteAndInOsFormatPath({
|
||||
pathIsh: parsedPackageJson.keycloakify.reactAppBuildDirPath,
|
||||
cwd: reactAppRootDirPath
|
||||
pathIsh: parsedPackageJson.keycloakify.projectBuildDirPath,
|
||||
cwd: projectDirPath
|
||||
});
|
||||
}
|
||||
|
||||
return pathJoin(reactAppRootDirPath, "build");
|
||||
return pathJoin(projectDirPath, "build");
|
||||
}
|
||||
|
||||
return pathJoin(reactAppRootDirPath, resolvedViteConfig.buildDir);
|
||||
return pathJoin(projectDirPath, resolvedViteConfig.buildDir);
|
||||
})();
|
||||
|
||||
const { npmWorkspaceRootDirPath } = getNpmWorkspaceRootDirPath({
|
||||
reactAppRootDirPath,
|
||||
projectDirPath,
|
||||
dependencyExpected: "keycloakify"
|
||||
});
|
||||
|
||||
@ -218,18 +216,18 @@ export function readBuildOptions(params: {
|
||||
`${themeNames[0]}-keycloak-theme`,
|
||||
loginThemeResourcesFromKeycloakVersion:
|
||||
userProvidedBuildOptions.loginThemeResourcesFromKeycloakVersion ?? "24.0.4",
|
||||
reactAppRootDirPath,
|
||||
reactAppBuildDirPath,
|
||||
projectDirPath,
|
||||
projectBuildDirPath,
|
||||
keycloakifyBuildDirPath: (() => {
|
||||
if (userProvidedBuildOptions.keycloakifyBuildDirPath !== undefined) {
|
||||
return getAbsoluteAndInOsFormatPath({
|
||||
pathIsh: userProvidedBuildOptions.keycloakifyBuildDirPath,
|
||||
cwd: reactAppRootDirPath
|
||||
cwd: projectDirPath
|
||||
});
|
||||
}
|
||||
|
||||
return pathJoin(
|
||||
reactAppRootDirPath,
|
||||
projectDirPath,
|
||||
resolvedViteConfig?.buildDir === undefined
|
||||
? "build_keycloak"
|
||||
: `${resolvedViteConfig.buildDir}_keycloak`
|
||||
@ -244,14 +242,14 @@ export function readBuildOptions(params: {
|
||||
if (process.env.PUBLIC_DIR_PATH !== undefined) {
|
||||
return getAbsoluteAndInOsFormatPath({
|
||||
pathIsh: process.env.PUBLIC_DIR_PATH,
|
||||
cwd: reactAppRootDirPath
|
||||
cwd: projectDirPath
|
||||
});
|
||||
}
|
||||
|
||||
return pathJoin(reactAppRootDirPath, "public");
|
||||
return pathJoin(projectDirPath, "public");
|
||||
}
|
||||
|
||||
return pathJoin(reactAppRootDirPath, resolvedViteConfig.publicDir);
|
||||
return pathJoin(projectDirPath, resolvedViteConfig.publicDir);
|
||||
})(),
|
||||
cacheDirPath: (() => {
|
||||
const cacheDirPath = pathJoin(
|
||||
@ -300,10 +298,10 @@ export function readBuildOptions(params: {
|
||||
break webpack;
|
||||
}
|
||||
|
||||
return pathJoin(reactAppBuildDirPath, "static");
|
||||
return pathJoin(projectBuildDirPath, "static");
|
||||
}
|
||||
|
||||
return pathJoin(reactAppBuildDirPath, resolvedViteConfig.assetsDir);
|
||||
return pathJoin(projectBuildDirPath, resolvedViteConfig.assetsDir);
|
||||
})(),
|
||||
npmWorkspaceRootDirPath,
|
||||
kcContextExclusionsFtlCode: userProvidedBuildOptions.kcContextExclusionsFtlCode,
|
||||
|
@ -5,7 +5,7 @@ import * as fs from "fs/promises";
|
||||
import { join as pathJoin } from "path";
|
||||
|
||||
export type BuildOptionsLike = {
|
||||
reactAppRootDirPath: string;
|
||||
projectDirPath: string;
|
||||
themeNames: string[];
|
||||
environmentVariables: { name: string; default: string }[];
|
||||
};
|
||||
@ -18,7 +18,7 @@ export async function generateKcGenTs(params: {
|
||||
const { buildOptions } = params;
|
||||
|
||||
const { themeSrcDirPath } = getThemeSrcDirPath({
|
||||
reactAppRootDirPath: buildOptions.reactAppRootDirPath
|
||||
projectDirPath: buildOptions.projectDirPath
|
||||
});
|
||||
|
||||
await fs.writeFile(
|
||||
|
@ -7,10 +7,10 @@ import { themeTypes } from "./constants";
|
||||
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. */
|
||||
export function getThemeSrcDirPath(params: { reactAppRootDirPath: string }) {
|
||||
const { reactAppRootDirPath } = params;
|
||||
export function getThemeSrcDirPath(params: { projectDirPath: string }) {
|
||||
const { projectDirPath } = params;
|
||||
|
||||
const srcDirPath = pathJoin(reactAppRootDirPath, "src");
|
||||
const srcDirPath = pathJoin(projectDirPath, "src");
|
||||
|
||||
const themeSrcDirPath: string | undefined = crawl({
|
||||
dirPath: srcDirPath,
|
||||
|
@ -7,11 +7,11 @@ import * as fs from "fs";
|
||||
import { join as pathJoin } from "path";
|
||||
|
||||
export type BuildOptionsLike = {
|
||||
reactAppRootDirPath: string;
|
||||
projectDirPath: string;
|
||||
keycloakifyBuildDirPath: string;
|
||||
bundler: "vite" | "webpack";
|
||||
npmWorkspaceRootDirPath: string;
|
||||
reactAppBuildDirPath: string;
|
||||
projectBuildDirPath: string;
|
||||
};
|
||||
|
||||
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
||||
@ -29,11 +29,11 @@ export async function appBuild(params: {
|
||||
return {
|
||||
command: "npx",
|
||||
args: ["vite", "build"],
|
||||
cwd: buildOptions.reactAppRootDirPath
|
||||
cwd: buildOptions.projectDirPath
|
||||
};
|
||||
case "webpack": {
|
||||
for (const dirPath of [
|
||||
buildOptions.reactAppRootDirPath,
|
||||
buildOptions.projectDirPath,
|
||||
buildOptions.npmWorkspaceRootDirPath
|
||||
]) {
|
||||
try {
|
||||
|
@ -5,7 +5,7 @@ import { assert } from "tsafe/assert";
|
||||
import type { BuildOptions } from "../shared/buildOptions";
|
||||
|
||||
export type BuildOptionsLike = {
|
||||
reactAppRootDirPath: string;
|
||||
projectDirPath: string;
|
||||
keycloakifyBuildDirPath: string;
|
||||
bundler: "vite" | "webpack";
|
||||
npmWorkspaceRootDirPath: string;
|
||||
@ -22,7 +22,7 @@ export async function keycloakifyBuild(params: {
|
||||
const dResult = new Deferred<{ isSuccess: boolean }>();
|
||||
|
||||
const child = child_process.spawn("npx", ["keycloakify", "build"], {
|
||||
cwd: buildOptions.reactAppRootDirPath,
|
||||
cwd: buildOptions.projectDirPath,
|
||||
env: {
|
||||
...process.env,
|
||||
...(doSkipBuildJars ? { [skipBuildJarsEnvName]: "true" } : {})
|
||||
|
@ -26,7 +26,6 @@ export type CliCommandOptions = CliCommandOptions_common & {
|
||||
port: number;
|
||||
keycloakVersion: string | undefined;
|
||||
realmJsonFilePath: string | undefined;
|
||||
environmentVariables: { name: string; default: string }[];
|
||||
};
|
||||
|
||||
export async function command(params: { cliCommandOptions: CliCommandOptions }) {
|
||||
@ -398,7 +397,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
||||
|
||||
child.on("exit", process.exit);
|
||||
|
||||
const srcDirPath = pathJoin(buildOptions.reactAppRootDirPath, "src");
|
||||
const srcDirPath = pathJoin(buildOptions.projectDirPath, "src");
|
||||
|
||||
{
|
||||
const handler = async (data: Buffer) => {
|
||||
@ -430,7 +429,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
||||
`- password: ${chalk.cyan.bold("password123")}`,
|
||||
"",
|
||||
`Watching for changes in ${chalk.bold(
|
||||
`.${pathSep}${pathRelative(process.cwd(), buildOptions.reactAppRootDirPath)}`
|
||||
`.${pathSep}${pathRelative(process.cwd(), buildOptions.projectDirPath)}`
|
||||
)}`
|
||||
].join("\n")
|
||||
);
|
||||
@ -472,10 +471,10 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
||||
[
|
||||
srcDirPath,
|
||||
buildOptions.publicDirPath,
|
||||
pathJoin(buildOptions.reactAppRootDirPath, "package.json"),
|
||||
pathJoin(buildOptions.reactAppRootDirPath, "vite.config.ts"),
|
||||
pathJoin(buildOptions.reactAppRootDirPath, "vite.config.js"),
|
||||
pathJoin(buildOptions.reactAppRootDirPath, "index.html"),
|
||||
pathJoin(buildOptions.projectDirPath, "package.json"),
|
||||
pathJoin(buildOptions.projectDirPath, "vite.config.ts"),
|
||||
pathJoin(buildOptions.projectDirPath, "vite.config.js"),
|
||||
pathJoin(buildOptions.projectDirPath, "index.html"),
|
||||
pathJoin(getThisCodebaseRootDirPath(), "src")
|
||||
],
|
||||
{
|
||||
|
@ -4,14 +4,14 @@ import { assert } from "tsafe/assert";
|
||||
import * as fs from "fs";
|
||||
|
||||
export function getNpmWorkspaceRootDirPath(params: {
|
||||
reactAppRootDirPath: string;
|
||||
projectDirPath: string;
|
||||
dependencyExpected: string;
|
||||
}) {
|
||||
const { reactAppRootDirPath, dependencyExpected } = params;
|
||||
const { projectDirPath, dependencyExpected } = params;
|
||||
|
||||
const npmWorkspaceRootDirPath = (function callee(depth: number): string {
|
||||
const cwd = pathResolve(
|
||||
pathJoin(...[reactAppRootDirPath, ...Array(depth).fill("..")])
|
||||
pathJoin(...[projectDirPath, ...Array(depth).fill("..")])
|
||||
);
|
||||
|
||||
assert(cwd !== pathSep, "NPM workspace not found");
|
||||
|
@ -26,7 +26,7 @@ export type Params = UserProvidedBuildOptions & {
|
||||
export function keycloakify(params?: Params) {
|
||||
const { postBuild, ...userProvidedBuildOptions } = params ?? {};
|
||||
|
||||
let reactAppRootDirPath: string | undefined = undefined;
|
||||
let projectDirPath: string | undefined = undefined;
|
||||
let urlPathname: string | undefined = undefined;
|
||||
let buildDirPath: string | undefined = undefined;
|
||||
let command: "build" | "serve" | undefined = undefined;
|
||||
@ -54,7 +54,7 @@ export function keycloakify(params?: Params) {
|
||||
|
||||
command = resolvedConfig.command;
|
||||
|
||||
reactAppRootDirPath = resolvedConfig.root;
|
||||
projectDirPath = resolvedConfig.root;
|
||||
urlPathname = (() => {
|
||||
let out = resolvedConfig.env.BASE_URL;
|
||||
|
||||
@ -86,7 +86,7 @@ export function keycloakify(params?: Params) {
|
||||
return out;
|
||||
})();
|
||||
|
||||
buildDirPath = pathJoin(reactAppRootDirPath, resolvedConfig.build.outDir);
|
||||
buildDirPath = pathJoin(projectDirPath, resolvedConfig.build.outDir);
|
||||
|
||||
resolve_vite_config_case: {
|
||||
const envValue =
|
||||
@ -102,7 +102,7 @@ export function keycloakify(params?: Params) {
|
||||
JSON.stringify(
|
||||
id<ResolvedViteConfig>({
|
||||
publicDir: pathRelative(
|
||||
reactAppRootDirPath,
|
||||
projectDirPath,
|
||||
resolvedConfig.publicDir
|
||||
),
|
||||
assetsDir: resolvedConfig.build.assetsDir,
|
||||
@ -118,7 +118,7 @@ export function keycloakify(params?: Params) {
|
||||
|
||||
const buildOptions = readBuildOptions({
|
||||
cliCommandOptions: {
|
||||
reactAppRootDirPath
|
||||
projectDirPath
|
||||
}
|
||||
});
|
||||
|
||||
@ -139,11 +139,11 @@ export function keycloakify(params?: Params) {
|
||||
return;
|
||||
}
|
||||
|
||||
assert(reactAppRootDirPath !== undefined);
|
||||
assert(projectDirPath !== undefined);
|
||||
|
||||
{
|
||||
const isWithinSourceDirectory = id.startsWith(
|
||||
pathJoin(reactAppRootDirPath, "src") + pathSep
|
||||
pathJoin(projectDirPath, "src") + pathSep
|
||||
);
|
||||
|
||||
if (!isWithinSourceDirectory) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user