Feat: Initialize account theme (before debug)

This commit is contained in:
Joseph Garrone
2024-07-25 18:16:43 +02:00
parent b9ee0afe7f
commit 77249d8a58
23 changed files with 769 additions and 119 deletions

View File

@ -55,7 +55,7 @@ export type BuildContextLike = BuildContextLike_kcContextExclusionsFtlCode &
environmentVariables: { name: string; default: string }[];
implementedThemeTypes: BuildContext["implementedThemeTypes"];
themeSrcDirPath: string;
bundler: { type: "vite" } | { type: "webpack" };
bundler: "vite" | "webpack";
};
assert<BuildContext extends BuildContextLike ? true : false>();
@ -121,7 +121,7 @@ export async function generateResourcesForMainTheme(params: {
);
if (fs.existsSync(dirPath)) {
assert(buildContext.bundler.type === "webpack");
assert(buildContext.bundler === "webpack");
throw new Error(
[

View File

@ -85,7 +85,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
});
run_post_build_script: {
if (buildContext.bundler.type !== "vite") {
if (buildContext.bundler !== "vite") {
break run_post_build_script;
}

View File

@ -8,7 +8,7 @@ export type BuildContextLike = {
projectBuildDirPath: string;
assetsDirPath: string;
urlPathname: string | undefined;
bundler: { type: "vite" } | { type: "webpack" };
bundler: "vite" | "webpack";
};
assert<BuildContext extends BuildContextLike ? true : false>();
@ -20,7 +20,7 @@ export function replaceImportsInJsCode(params: {
const { jsCode, buildContext } = params;
const { fixedJsCode } = (() => {
switch (buildContext.bundler.type) {
switch (buildContext.bundler) {
case "vite":
return replaceImportsInJsCode_vite({
jsCode,