Rename reactAppRootDirPath -> projectDirPath and reactAppBuildDirPath -> projectBuildDirPath

This commit is contained in:
Joseph Garrone
2024-06-09 09:03:43 +02:00
parent 6e95dacd3a
commit 3453a17c15
18 changed files with 73 additions and 76 deletions

View File

@ -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 {

View File

@ -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" } : {})

View File

@ -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")
],
{