2024-12-22 17:09:15 +01:00
|
|
|
import type { BuildContext } from "./shared/buildContext";
|
|
|
|
import { maybeDelegateCommandToCustomHandler } from "./shared/customHandler_delegate";
|
2024-12-26 15:55:59 +01:00
|
|
|
import { initializeSpa } from "./shared/initializeSpa";
|
|
|
|
import { exitIfUncommittedChanges } from "./shared/exitIfUncommittedChanges";
|
|
|
|
import { command as updateKcGenCommand } from "./update-kc-gen";
|
2024-12-22 17:09:15 +01:00
|
|
|
|
|
|
|
export async function command(params: { buildContext: BuildContext }) {
|
|
|
|
const { buildContext } = params;
|
|
|
|
|
|
|
|
const { hasBeenHandled } = maybeDelegateCommandToCustomHandler({
|
|
|
|
commandName: "initialize-admin-theme",
|
|
|
|
buildContext
|
|
|
|
});
|
|
|
|
|
|
|
|
if (hasBeenHandled) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-12-26 15:55:59 +01:00
|
|
|
exitIfUncommittedChanges({
|
|
|
|
projectDirPath: buildContext.projectDirPath
|
|
|
|
});
|
2024-12-22 17:09:15 +01:00
|
|
|
|
2024-12-26 15:55:59 +01:00
|
|
|
await initializeSpa({
|
|
|
|
themeType: "admin",
|
2024-12-22 17:09:15 +01:00
|
|
|
buildContext
|
|
|
|
});
|
|
|
|
|
2024-12-26 15:55:59 +01:00
|
|
|
await updateKcGenCommand({
|
|
|
|
buildContext: {
|
|
|
|
...buildContext,
|
|
|
|
implementedThemeTypes: {
|
|
|
|
...buildContext.implementedThemeTypes,
|
|
|
|
admin: {
|
|
|
|
isImplemented: true
|
|
|
|
}
|
|
|
|
}
|
2024-12-22 17:09:15 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|