Remove files that are no longer nessesary
This commit is contained in:
@ -3,8 +3,6 @@ import { readParsedPackageJson } from "./parsedPackageJson";
|
|||||||
import { join as pathJoin } from "path";
|
import { join as pathJoin } from "path";
|
||||||
import { getAbsoluteAndInOsFormatPath } from "../../tools/getAbsoluteAndInOsFormatPath";
|
import { getAbsoluteAndInOsFormatPath } from "../../tools/getAbsoluteAndInOsFormatPath";
|
||||||
import { getResolvedViteConfig } from "./resolvedViteConfig";
|
import { getResolvedViteConfig } from "./resolvedViteConfig";
|
||||||
import { getCacheDirPath } from "./getCacheDirPath";
|
|
||||||
import { getReactAppRootDirPath } from "./getReactAppRootDirPath";
|
|
||||||
import { getNpmWorkspaceRootDirPath } from "./getNpmWorkspaceRootDirPath";
|
import { getNpmWorkspaceRootDirPath } from "./getNpmWorkspaceRootDirPath";
|
||||||
import type { CliCommandOptions } from "../../main";
|
import type { CliCommandOptions } from "../../main";
|
||||||
|
|
||||||
@ -35,12 +33,18 @@ export type BuildOptions = {
|
|||||||
export function readBuildOptions(params: { cliCommandOptions: CliCommandOptions }): BuildOptions {
|
export function readBuildOptions(params: { cliCommandOptions: CliCommandOptions }): BuildOptions {
|
||||||
const { cliCommandOptions } = params;
|
const { cliCommandOptions } = params;
|
||||||
|
|
||||||
const { reactAppRootDirPath } = getReactAppRootDirPath({ cliCommandOptions });
|
const reactAppRootDirPath = (() => {
|
||||||
|
if (cliCommandOptions.reactAppRootDirPath === undefined) {
|
||||||
|
return process.cwd();
|
||||||
|
}
|
||||||
|
|
||||||
const { cacheDirPath } = getCacheDirPath({ reactAppRootDirPath });
|
return getAbsoluteAndInOsFormatPath({
|
||||||
|
"pathIsh": cliCommandOptions.reactAppRootDirPath,
|
||||||
|
"cwd": process.cwd()
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
const { resolvedViteConfig } = getResolvedViteConfig({
|
const { resolvedViteConfig } = getResolvedViteConfig({
|
||||||
cacheDirPath,
|
|
||||||
reactAppRootDirPath
|
reactAppRootDirPath
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -145,7 +149,25 @@ export function readBuildOptions(params: { cliCommandOptions: CliCommandOptions
|
|||||||
|
|
||||||
return pathJoin(reactAppRootDirPath, resolvedViteConfig.publicDir);
|
return pathJoin(reactAppRootDirPath, resolvedViteConfig.publicDir);
|
||||||
})(),
|
})(),
|
||||||
cacheDirPath,
|
"cacheDirPath": (() => {
|
||||||
|
const { npmWorkspaceRootDirPath } = getNpmWorkspaceRootDirPath({ reactAppRootDirPath });
|
||||||
|
|
||||||
|
const cacheDirPath = pathJoin(
|
||||||
|
(() => {
|
||||||
|
if (process.env.XDG_CACHE_HOME !== undefined) {
|
||||||
|
return getAbsoluteAndInOsFormatPath({
|
||||||
|
"pathIsh": process.env.XDG_CACHE_HOME,
|
||||||
|
"cwd": reactAppRootDirPath
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return pathJoin(npmWorkspaceRootDirPath, "node_modules", ".cache");
|
||||||
|
})(),
|
||||||
|
"keycloakify"
|
||||||
|
);
|
||||||
|
|
||||||
|
return cacheDirPath;
|
||||||
|
})(),
|
||||||
"urlPathname": (() => {
|
"urlPathname": (() => {
|
||||||
webpack: {
|
webpack: {
|
||||||
if (resolvedViteConfig !== undefined) {
|
if (resolvedViteConfig !== undefined) {
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
import { join as pathJoin } from "path";
|
|
||||||
import { getAbsoluteAndInOsFormatPath } from "../../tools/getAbsoluteAndInOsFormatPath";
|
|
||||||
import { getNpmWorkspaceRootDirPath } from "./getNpmWorkspaceRootDirPath";
|
|
||||||
|
|
||||||
export function getCacheDirPath(params: { reactAppRootDirPath: string }) {
|
|
||||||
const { reactAppRootDirPath } = params;
|
|
||||||
|
|
||||||
const { npmWorkspaceRootDirPath } = getNpmWorkspaceRootDirPath({ reactAppRootDirPath });
|
|
||||||
|
|
||||||
const cacheDirPath = pathJoin(
|
|
||||||
(() => {
|
|
||||||
if (process.env.XDG_CACHE_HOME !== undefined) {
|
|
||||||
return getAbsoluteAndInOsFormatPath({
|
|
||||||
"pathIsh": process.env.XDG_CACHE_HOME,
|
|
||||||
"cwd": reactAppRootDirPath
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return pathJoin(npmWorkspaceRootDirPath, "node_modules", ".cache");
|
|
||||||
})(),
|
|
||||||
"keycloakify"
|
|
||||||
);
|
|
||||||
|
|
||||||
return { cacheDirPath };
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
import { getAbsoluteAndInOsFormatPath } from "../../tools/getAbsoluteAndInOsFormatPath";
|
|
||||||
import { assert } from "tsafe/assert";
|
|
||||||
import type { CliCommandOptions } from "../../main";
|
|
||||||
|
|
||||||
type CliCommandOptionsLike = {
|
|
||||||
reactAppRootDirPath: string | undefined;
|
|
||||||
};
|
|
||||||
|
|
||||||
assert<CliCommandOptions extends CliCommandOptionsLike ? true : false>();
|
|
||||||
|
|
||||||
export function getReactAppRootDirPath(params: { cliCommandOptions: CliCommandOptionsLike }) {
|
|
||||||
const { cliCommandOptions } = params;
|
|
||||||
|
|
||||||
const reactAppRootDirPath = (() => {
|
|
||||||
if (cliCommandOptions.reactAppRootDirPath === undefined) {
|
|
||||||
return process.cwd();
|
|
||||||
}
|
|
||||||
|
|
||||||
return getAbsoluteAndInOsFormatPath({
|
|
||||||
"pathIsh": cliCommandOptions.reactAppRootDirPath,
|
|
||||||
"cwd": process.cwd()
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
|
|
||||||
return { reactAppRootDirPath };
|
|
||||||
}
|
|
Reference in New Issue
Block a user