Remove the --silent cli option
This commit is contained in:
@ -4,7 +4,6 @@ import { termost } from "termost";
|
|||||||
import * as child_process from "child_process";
|
import * as child_process from "child_process";
|
||||||
|
|
||||||
export type CliCommandOptions = {
|
export type CliCommandOptions = {
|
||||||
isSilent: boolean;
|
|
||||||
reactAppRootDirPath: string | undefined;
|
reactAppRootDirPath: string | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -12,32 +11,19 @@ const program = termost<CliCommandOptions>("Keycloak theme builder");
|
|||||||
|
|
||||||
const optionsKeys: string[] = [];
|
const optionsKeys: string[] = [];
|
||||||
|
|
||||||
program
|
program.option({
|
||||||
.option({
|
"key": "reactAppRootDirPath",
|
||||||
"key": "reactAppRootDirPath",
|
"name": (() => {
|
||||||
"name": (() => {
|
const long = "project";
|
||||||
const long = "project";
|
const short = "p";
|
||||||
const short = "p";
|
|
||||||
|
|
||||||
optionsKeys.push(long, short);
|
optionsKeys.push(long, short);
|
||||||
|
|
||||||
return { long, short };
|
return { long, short };
|
||||||
})(),
|
})(),
|
||||||
"description": "https://docs.keycloakify.dev/build-options#project-or-p-cli-option",
|
"description": "https://docs.keycloakify.dev/build-options#project-or-p-cli-option",
|
||||||
"defaultValue": undefined
|
"defaultValue": undefined
|
||||||
})
|
});
|
||||||
.option({
|
|
||||||
"key": "isSilent",
|
|
||||||
"name": (() => {
|
|
||||||
const name = "silent";
|
|
||||||
|
|
||||||
optionsKeys.push(name);
|
|
||||||
|
|
||||||
return name;
|
|
||||||
})(),
|
|
||||||
"description": "https://docs.keycloakify.dev/build-options#silent",
|
|
||||||
"defaultValue": false
|
|
||||||
});
|
|
||||||
|
|
||||||
function skip(_context: any, argv: { options: Record<string, unknown> }) {
|
function skip(_context: any, argv: { options: Record<string, unknown> }) {
|
||||||
const unrecognizedOptionKey = Object.keys(argv.options).find(key => !optionsKeys.includes(key));
|
const unrecognizedOptionKey = Object.keys(argv.options).find(key => !optionsKeys.includes(key));
|
||||||
|
@ -12,7 +12,6 @@ import { vitePluginSubScriptEnvNames } from "./constants";
|
|||||||
/** Consolidated build option gathered form CLI arguments and config in package.json */
|
/** Consolidated build option gathered form CLI arguments and config in package.json */
|
||||||
export type BuildOptions = {
|
export type BuildOptions = {
|
||||||
bundler: "vite" | "webpack";
|
bundler: "vite" | "webpack";
|
||||||
isSilent: boolean;
|
|
||||||
themeVersion: string;
|
themeVersion: string;
|
||||||
themeNames: string[];
|
themeNames: string[];
|
||||||
extraThemeProperties: string[] | undefined;
|
extraThemeProperties: string[] | undefined;
|
||||||
@ -168,7 +167,6 @@ export function readBuildOptions(params: { cliCommandOptions: CliCommandOptions
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
"bundler": resolvedViteConfig !== undefined ? "vite" : "webpack",
|
"bundler": resolvedViteConfig !== undefined ? "vite" : "webpack",
|
||||||
"isSilent": cliCommandOptions.isSilent,
|
|
||||||
"themeVersion": process.env.KEYCLOAKIFY_THEME_VERSION ?? parsedPackageJson.version ?? "0.0.0",
|
"themeVersion": process.env.KEYCLOAKIFY_THEME_VERSION ?? parsedPackageJson.version ?? "0.0.0",
|
||||||
themeNames,
|
themeNames,
|
||||||
"extraThemeProperties": userProvidedBuildOptions.extraThemeProperties,
|
"extraThemeProperties": userProvidedBuildOptions.extraThemeProperties,
|
||||||
|
@ -99,7 +99,6 @@ export function keycloakify(params?: Params) {
|
|||||||
await copyKeycloakResourcesToPublic({
|
await copyKeycloakResourcesToPublic({
|
||||||
"buildOptions": readBuildOptions({
|
"buildOptions": readBuildOptions({
|
||||||
"cliCommandOptions": {
|
"cliCommandOptions": {
|
||||||
"isSilent": true,
|
|
||||||
reactAppRootDirPath
|
reactAppRootDirPath
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user