Refactor
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { downloadKeycloakStaticResources } from "./keycloakify/generateTheme/downloadKeycloakStaticResources";
|
import { downloadKeycloakStaticResources } from "./keycloakify/generateTheme/downloadKeycloakStaticResources";
|
||||||
import { join as pathJoin, relative as pathRelative } from "path";
|
import { join as pathJoin, relative as pathRelative } from "path";
|
||||||
import { readBuildOptions } from "./keycloakify/BuildOptions";
|
import { readBuildOptions } from "./keycloakify/buildOptions2";
|
||||||
import { themeTypes, keycloak_resources, lastKeycloakVersionWithAccountV1 } from "./constants";
|
import { themeTypes, keycloak_resources, lastKeycloakVersionWithAccountV1 } from "./constants";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
|
|
||||||
|
@ -3,9 +3,8 @@ import { join as pathJoin } from "path";
|
|||||||
import { downloadAndUnzip } from "./tools/downloadAndUnzip";
|
import { downloadAndUnzip } from "./tools/downloadAndUnzip";
|
||||||
import { promptKeycloakVersion } from "./promptKeycloakVersion";
|
import { promptKeycloakVersion } from "./promptKeycloakVersion";
|
||||||
import { getLogger } from "./tools/logger";
|
import { getLogger } from "./tools/logger";
|
||||||
import { readBuildOptions } from "./keycloakify/BuildOptions";
|
import { readBuildOptions, type BuildOptions } from "./keycloakify/buildOptions2";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
import type { BuildOptions } from "./keycloakify/BuildOptions";
|
|
||||||
import * as child_process from "child_process";
|
import * as child_process from "child_process";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import { existsSync } from "fs";
|
|||||||
import { join as pathJoin, relative as pathRelative } from "path";
|
import { join as pathJoin, relative as pathRelative } from "path";
|
||||||
import { kebabCaseToCamelCase } from "./tools/kebabCaseToSnakeCase";
|
import { kebabCaseToCamelCase } from "./tools/kebabCaseToSnakeCase";
|
||||||
import { assert, Equals } from "tsafe/assert";
|
import { assert, Equals } from "tsafe/assert";
|
||||||
import { getThemeSrcDirPath } from "./getSrcDirPath";
|
import { getThemeSrcDirPath } from "./getThemeSrcDirPath";
|
||||||
import { themeTypes, type ThemeType } from "./constants";
|
import { themeTypes, type ThemeType } from "./constants";
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
|
@ -4,10 +4,10 @@ import { downloadBuiltinKeycloakTheme } from "./download-builtin-keycloak-theme"
|
|||||||
import { join as pathJoin, relative as pathRelative } from "path";
|
import { join as pathJoin, relative as pathRelative } from "path";
|
||||||
import { transformCodebase } from "./tools/transformCodebase";
|
import { transformCodebase } from "./tools/transformCodebase";
|
||||||
import { promptKeycloakVersion } from "./promptKeycloakVersion";
|
import { promptKeycloakVersion } from "./promptKeycloakVersion";
|
||||||
import { readBuildOptions } from "./keycloakify/BuildOptions";
|
import { readBuildOptions } from "./keycloakify/buildOptions2";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { getLogger } from "./tools/logger";
|
import { getLogger } from "./tools/logger";
|
||||||
import { getThemeSrcDirPath } from "./getSrcDirPath";
|
import { getThemeSrcDirPath } from "./getThemeSrcDirPath";
|
||||||
|
|
||||||
export async function main() {
|
export async function main() {
|
||||||
const reactAppRootDirPath = process.cwd();
|
const reactAppRootDirPath = process.cwd();
|
||||||
|
@ -2,7 +2,7 @@ import { parse as urlParse } from "url";
|
|||||||
import { getParsedPackageJson } from "./parsedPackageJson";
|
import { getParsedPackageJson } from "./parsedPackageJson";
|
||||||
import { join as pathJoin } from "path";
|
import { join as pathJoin } from "path";
|
||||||
import parseArgv from "minimist";
|
import parseArgv from "minimist";
|
||||||
import { getAbsoluteAndInOsFormatPath } from "../tools/getAbsoluteAndInOsFormatPath";
|
import { getAbsoluteAndInOsFormatPath } from "../../tools/getAbsoluteAndInOsFormatPath";
|
||||||
import { readResolvedViteConfig, getKeycloakifyBuildDirPath } from "./resolvedViteConfig";
|
import { readResolvedViteConfig, getKeycloakifyBuildDirPath } from "./resolvedViteConfig";
|
||||||
|
|
||||||
/** Consolidated build option gathered form CLI arguments and config in package.json */
|
/** Consolidated build option gathered form CLI arguments and config in package.json */
|
1
src/bin/keycloakify/buildOptions2/index.ts
Normal file
1
src/bin/keycloakify/buildOptions2/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export * from "./buildOptions2";
|
@ -2,7 +2,7 @@ import * as fs from "fs";
|
|||||||
import { assert } from "tsafe";
|
import { assert } from "tsafe";
|
||||||
import type { Equals } from "tsafe";
|
import type { Equals } from "tsafe";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { pathJoin } from "../tools/pathJoin";
|
import { join as pathJoin } from "path";
|
||||||
|
|
||||||
export type ParsedPackageJson = {
|
export type ParsedPackageJson = {
|
||||||
name: string;
|
name: string;
|
@ -2,10 +2,10 @@ import * as fs from "fs";
|
|||||||
import { assert } from "tsafe";
|
import { assert } from "tsafe";
|
||||||
import type { Equals } from "tsafe";
|
import type { Equals } from "tsafe";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { pathJoin } from "../tools/pathJoin";
|
import { join as pathJoin } from "path";
|
||||||
import { resolvedViteConfigJsonBasename } from "../constants";
|
import { resolvedViteConfigJsonBasename } from "../../constants";
|
||||||
import type { OptionalIfCanBeUndefined } from "../tools/OptionalIfCanBeUndefined";
|
import type { OptionalIfCanBeUndefined } from "../../tools/OptionalIfCanBeUndefined";
|
||||||
import { getAbsoluteAndInOsFormatPath } from "../tools/getAbsoluteAndInOsFormatPath";
|
import { getAbsoluteAndInOsFormatPath } from "../../tools/getAbsoluteAndInOsFormatPath";
|
||||||
|
|
||||||
export type ResolvedViteConfig = {
|
export type ResolvedViteConfig = {
|
||||||
buildDir: string;
|
buildDir: string;
|
@ -5,7 +5,7 @@ import { replaceImportsInInlineCssCode } from "../replacers/replaceImportsInInli
|
|||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { join as pathJoin } from "path";
|
import { join as pathJoin } from "path";
|
||||||
import { objectKeys } from "tsafe/objectKeys";
|
import { objectKeys } from "tsafe/objectKeys";
|
||||||
import type { BuildOptions } from "../BuildOptions";
|
import type { BuildOptions } from "../buildOptions2";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
import { type ThemeType, nameOfTheGlobal, basenameOfTheKeycloakifyResourcesDir } from "../../constants";
|
import { type ThemeType, nameOfTheGlobal, basenameOfTheKeycloakifyResourcesDir } from "../../constants";
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import * as fs from "fs";
|
|||||||
import { join as pathJoin, dirname as pathDirname } from "path";
|
import { join as pathJoin, dirname as pathDirname } from "path";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
import { Reflect } from "tsafe/Reflect";
|
import { Reflect } from "tsafe/Reflect";
|
||||||
import type { BuildOptions } from "../BuildOptions";
|
import type { BuildOptions } from "../buildOptions2";
|
||||||
import { resources_common, lastKeycloakVersionWithAccountV1, accountV1ThemeName } from "../../constants";
|
import { resources_common, lastKeycloakVersionWithAccountV1, accountV1ThemeName } from "../../constants";
|
||||||
import { downloadBuiltinKeycloakTheme } from "../../download-builtin-keycloak-theme";
|
import { downloadBuiltinKeycloakTheme } from "../../download-builtin-keycloak-theme";
|
||||||
import { transformCodebase } from "../../tools/transformCodebase";
|
import { transformCodebase } from "../../tools/transformCodebase";
|
||||||
|
@ -2,7 +2,7 @@ import * as fs from "fs";
|
|||||||
import { join as pathJoin, dirname as pathDirname } from "path";
|
import { join as pathJoin, dirname as pathDirname } from "path";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
import { Reflect } from "tsafe/Reflect";
|
import { Reflect } from "tsafe/Reflect";
|
||||||
import type { BuildOptions } from "../BuildOptions";
|
import type { BuildOptions } from "../buildOptions2";
|
||||||
import { type ThemeType, accountV1ThemeName } from "../../constants";
|
import { type ThemeType, accountV1ThemeName } from "../../constants";
|
||||||
import { bringInAccountV1 } from "./bringInAccountV1";
|
import { bringInAccountV1 } from "./bringInAccountV1";
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import * as fs from "fs";
|
|||||||
import { join as pathJoin, relative as pathRelative, basename as pathBasename } from "path";
|
import { join as pathJoin, relative as pathRelative, basename as pathBasename } from "path";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
import { Reflect } from "tsafe/Reflect";
|
import { Reflect } from "tsafe/Reflect";
|
||||||
import type { BuildOptions } from "./BuildOptions";
|
import type { BuildOptions } from "./buildOptions2";
|
||||||
|
|
||||||
export type BuildOptionsLike = {
|
export type BuildOptionsLike = {
|
||||||
keycloakifyBuildDirPath: string;
|
keycloakifyBuildDirPath: string;
|
||||||
|
@ -3,7 +3,7 @@ import * as fs from "fs";
|
|||||||
import { join as pathJoin, dirname as pathDirname } from "path";
|
import { join as pathJoin, dirname as pathDirname } from "path";
|
||||||
import { downloadBuiltinKeycloakTheme } from "../../download-builtin-keycloak-theme";
|
import { downloadBuiltinKeycloakTheme } from "../../download-builtin-keycloak-theme";
|
||||||
import { resources_common, type ThemeType } from "../../constants";
|
import { resources_common, type ThemeType } from "../../constants";
|
||||||
import { BuildOptions } from "../BuildOptions";
|
import { BuildOptions } from "../buildOptions2";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
import * as crypto from "crypto";
|
import * as crypto from "crypto";
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
basenameOfTheKeycloakifyResourcesDir
|
basenameOfTheKeycloakifyResourcesDir
|
||||||
} from "../../constants";
|
} from "../../constants";
|
||||||
import { isInside } from "../../tools/isInside";
|
import { isInside } from "../../tools/isInside";
|
||||||
import type { BuildOptions } from "../BuildOptions";
|
import type { BuildOptions } from "../buildOptions2";
|
||||||
import { assert, type Equals } from "tsafe/assert";
|
import { assert, type Equals } from "tsafe/assert";
|
||||||
import { downloadKeycloakStaticResources } from "./downloadKeycloakStaticResources";
|
import { downloadKeycloakStaticResources } from "./downloadKeycloakStaticResources";
|
||||||
import { readFieldNameUsage } from "./readFieldNameUsage";
|
import { readFieldNameUsage } from "./readFieldNameUsage";
|
||||||
|
@ -4,10 +4,10 @@ import { join as pathJoin, relative as pathRelative, basename as pathBasename, d
|
|||||||
import * as child_process from "child_process";
|
import * as child_process from "child_process";
|
||||||
import { generateStartKeycloakTestingContainer } from "./generateStartKeycloakTestingContainer";
|
import { generateStartKeycloakTestingContainer } from "./generateStartKeycloakTestingContainer";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { readBuildOptions } from "./BuildOptions";
|
import { readBuildOptions } from "./buildOptions2";
|
||||||
import { getLogger } from "../tools/logger";
|
import { getLogger } from "../tools/logger";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
import { getThemeSrcDirPath } from "../getSrcDirPath";
|
import { getThemeSrcDirPath } from "../getThemeSrcDirPath";
|
||||||
import { getProjectRoot } from "../tools/getProjectRoot";
|
import { getProjectRoot } from "../tools/getProjectRoot";
|
||||||
import { objectKeys } from "tsafe/objectKeys";
|
import { objectKeys } from "tsafe/objectKeys";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as crypto from "crypto";
|
import * as crypto from "crypto";
|
||||||
import type { BuildOptions } from "../BuildOptions";
|
import type { BuildOptions } from "../buildOptions2";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
import { basenameOfTheKeycloakifyResourcesDir } from "../../constants";
|
import { basenameOfTheKeycloakifyResourcesDir } from "../../constants";
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { BuildOptions } from "../BuildOptions";
|
import type { BuildOptions } from "../buildOptions2";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
import { basenameOfTheKeycloakifyResourcesDir } from "../../constants";
|
import { basenameOfTheKeycloakifyResourcesDir } from "../../constants";
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
import type { BuildOptions } from "../../BuildOptions";
|
import type { BuildOptions } from "../../buildOptions2";
|
||||||
import { replaceImportsInJsCode_vite } from "./vite";
|
import { replaceImportsInJsCode_vite } from "./vite";
|
||||||
import { replaceImportsInJsCode_webpack } from "./webpack";
|
import { replaceImportsInJsCode_webpack } from "./webpack";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { nameOfTheGlobal, basenameOfTheKeycloakifyResourcesDir } from "../../../constants";
|
import { nameOfTheGlobal, basenameOfTheKeycloakifyResourcesDir } from "../../../constants";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
import type { BuildOptions } from "../../BuildOptions";
|
import type { BuildOptions } from "../../buildOptions2";
|
||||||
import * as nodePath from "path";
|
import * as nodePath from "path";
|
||||||
import { replaceAll } from "../../../tools/String.prototype.replaceAll";
|
import { replaceAll } from "../../../tools/String.prototype.replaceAll";
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { nameOfTheGlobal, basenameOfTheKeycloakifyResourcesDir } from "../../../constants";
|
import { nameOfTheGlobal, basenameOfTheKeycloakifyResourcesDir } from "../../../constants";
|
||||||
import { assert } from "tsafe/assert";
|
import { assert } from "tsafe/assert";
|
||||||
import type { BuildOptions } from "../../BuildOptions";
|
import type { BuildOptions } from "../../buildOptions2";
|
||||||
import * as nodePath from "path";
|
import * as nodePath from "path";
|
||||||
import { replaceAll } from "../../../tools/String.prototype.replaceAll";
|
import { replaceAll } from "../../../tools/String.prototype.replaceAll";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user