Debug commit TO DELETE
This commit is contained in:
parent
9333400322
commit
777d8690c2
@ -12,6 +12,12 @@ import * as os from "os";
|
|||||||
import { rmSync } from "../tools/fs.rmSync";
|
import { rmSync } from "../tools/fs.rmSync";
|
||||||
|
|
||||||
export async function command(params: { cliCommandOptions: CliCommandOptions }) {
|
export async function command(params: { cliCommandOptions: CliCommandOptions }) {
|
||||||
|
console.log("DEBUG:", {
|
||||||
|
__filename,
|
||||||
|
__dirname,
|
||||||
|
"process.cwd()": process.cwd()
|
||||||
|
});
|
||||||
|
|
||||||
exit_if_maven_not_installed: {
|
exit_if_maven_not_installed: {
|
||||||
let commandOutput: Buffer | undefined = undefined;
|
let commandOutput: Buffer | undefined = undefined;
|
||||||
|
|
||||||
|
@ -90,6 +90,8 @@ export function getBuildContext(params: {
|
|||||||
}): BuildContext {
|
}): BuildContext {
|
||||||
const { cliCommandOptions } = params;
|
const { cliCommandOptions } = params;
|
||||||
|
|
||||||
|
console.log("DEBUG:", { cliCommandOptions });
|
||||||
|
|
||||||
const projectDirPath = (() => {
|
const projectDirPath = (() => {
|
||||||
if (cliCommandOptions.projectDirPath === undefined) {
|
if (cliCommandOptions.projectDirPath === undefined) {
|
||||||
return process.cwd();
|
return process.cwd();
|
||||||
@ -101,6 +103,8 @@ export function getBuildContext(params: {
|
|||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
console.log("DEBUG:", { projectDirPath });
|
||||||
|
|
||||||
const { resolvedViteConfig } = (() => {
|
const { resolvedViteConfig } = (() => {
|
||||||
if (
|
if (
|
||||||
fs
|
fs
|
||||||
@ -135,6 +139,8 @@ export function getBuildContext(params: {
|
|||||||
return { resolvedViteConfig };
|
return { resolvedViteConfig };
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
console.log("DEBUG:", { resolvedViteConfig });
|
||||||
|
|
||||||
const parsedPackageJson = (() => {
|
const parsedPackageJson = (() => {
|
||||||
type BuildOptions_packageJson = BuildOptions & {
|
type BuildOptions_packageJson = BuildOptions & {
|
||||||
projectBuildDirPath?: string;
|
projectBuildDirPath?: string;
|
||||||
@ -235,11 +241,15 @@ export function getBuildContext(params: {
|
|||||||
);
|
);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
console.log("DEBUG:", { parsedPackageJson });
|
||||||
|
|
||||||
const buildOptions = {
|
const buildOptions = {
|
||||||
...parsedPackageJson.keycloakify,
|
...parsedPackageJson.keycloakify,
|
||||||
...resolvedViteConfig?.buildOptions
|
...resolvedViteConfig?.buildOptions
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log("DEBUG:", { buildOptions });
|
||||||
|
|
||||||
const { themeSrcDirPath } = (() => {
|
const { themeSrcDirPath } = (() => {
|
||||||
const srcDirPath = pathJoin(projectDirPath, "src");
|
const srcDirPath = pathJoin(projectDirPath, "src");
|
||||||
|
|
||||||
@ -288,6 +298,8 @@ export function getBuildContext(params: {
|
|||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log("DEBUG:", { themeSrcDirPath });
|
||||||
|
|
||||||
const themeNames = ((): [string, ...string[]] => {
|
const themeNames = ((): [string, ...string[]] => {
|
||||||
if (buildOptions.themeName === undefined) {
|
if (buildOptions.themeName === undefined) {
|
||||||
return [
|
return [
|
||||||
@ -309,6 +321,8 @@ export function getBuildContext(params: {
|
|||||||
return [mainThemeName, ...themeVariantNames];
|
return [mainThemeName, ...themeVariantNames];
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
console.log("DEBUG:", { themeNames });
|
||||||
|
|
||||||
const projectBuildDirPath = (() => {
|
const projectBuildDirPath = (() => {
|
||||||
webpack: {
|
webpack: {
|
||||||
if (resolvedViteConfig !== undefined) {
|
if (resolvedViteConfig !== undefined) {
|
||||||
@ -328,14 +342,18 @@ export function getBuildContext(params: {
|
|||||||
return pathJoin(projectDirPath, resolvedViteConfig.buildDir);
|
return pathJoin(projectDirPath, resolvedViteConfig.buildDir);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
console.log("DEBUG:", { projectBuildDirPath });
|
||||||
|
|
||||||
const { npmWorkspaceRootDirPath } = getNpmWorkspaceRootDirPath({
|
const { npmWorkspaceRootDirPath } = getNpmWorkspaceRootDirPath({
|
||||||
projectDirPath,
|
projectDirPath,
|
||||||
dependencyExpected: "keycloakify"
|
dependencyExpected: "keycloakify"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("DEBUG:", { npmWorkspaceRootDirPath });
|
||||||
|
|
||||||
const bundler = resolvedViteConfig !== undefined ? "vite" : "webpack";
|
const bundler = resolvedViteConfig !== undefined ? "vite" : "webpack";
|
||||||
|
|
||||||
return {
|
const buildContext: BuildContext = {
|
||||||
bundler,
|
bundler,
|
||||||
themeVersion: buildOptions.themeVersion ?? parsedPackageJson.version ?? "0.0.0",
|
themeVersion: buildOptions.themeVersion ?? parsedPackageJson.version ?? "0.0.0",
|
||||||
themeNames,
|
themeNames,
|
||||||
@ -765,4 +783,8 @@ export function getBuildContext(params: {
|
|||||||
return jarTargets;
|
return jarTargets;
|
||||||
})()
|
})()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log("DEBUG:", JSON.stringify({ buildContext }, null, 2));
|
||||||
|
|
||||||
|
return buildContext;
|
||||||
}
|
}
|
||||||
|
@ -9,11 +9,18 @@ export function getNpmWorkspaceRootDirPath(params: {
|
|||||||
}) {
|
}) {
|
||||||
const { projectDirPath, dependencyExpected } = params;
|
const { projectDirPath, dependencyExpected } = params;
|
||||||
|
|
||||||
|
console.log("DEBUG getNpmWorkspaceRootDirPath:", {
|
||||||
|
projectDirPath,
|
||||||
|
dependencyExpected
|
||||||
|
});
|
||||||
|
|
||||||
const npmWorkspaceRootDirPath = (function callee(depth: number): string {
|
const npmWorkspaceRootDirPath = (function callee(depth: number): string {
|
||||||
const cwd = pathResolve(
|
const cwd = pathResolve(
|
||||||
pathJoin(...[projectDirPath, ...Array(depth).fill("..")])
|
pathJoin(...[projectDirPath, ...Array(depth).fill("..")])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log("DEBUG getNpmWorkspaceRootDirPath:", { cwd });
|
||||||
|
|
||||||
assert(cwd !== pathSep, "NPM workspace not found");
|
assert(cwd !== pathSep, "NPM workspace not found");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -22,6 +29,8 @@ export function getNpmWorkspaceRootDirPath(params: {
|
|||||||
stdio: "ignore"
|
stdio: "ignore"
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log("DEBUG getNpmWorkspaceRootDirPath: got error npm config get");
|
||||||
|
|
||||||
if (String(error).includes("ENOWORKSPACES")) {
|
if (String(error).includes("ENOWORKSPACES")) {
|
||||||
return callee(depth + 1);
|
return callee(depth + 1);
|
||||||
}
|
}
|
||||||
@ -29,6 +38,8 @@ export function getNpmWorkspaceRootDirPath(params: {
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("DEBUG getNpmWorkspaceRootDirPath: npm workspace found");
|
||||||
|
|
||||||
const packageJsonFilePath = pathJoin(cwd, "package.json");
|
const packageJsonFilePath = pathJoin(cwd, "package.json");
|
||||||
|
|
||||||
if (!fs.existsSync(packageJsonFilePath)) {
|
if (!fs.existsSync(packageJsonFilePath)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user