2024-05-15 05:14:01 +02:00
|
|
|
import type { BuildOptions } from "../../shared/buildOptions";
|
2024-05-12 20:47:03 +02:00
|
|
|
import { assert } from "tsafe/assert";
|
2024-05-17 01:21:26 +02:00
|
|
|
import { generateSrcMainResourcesForMainTheme, type BuildOptionsLike as BuildOptionsLike_generateSrcMainResourcesForMainTheme } from "./generateSrcMainResourcesForMainTheme";
|
|
|
|
import { generateSrcMainResourcesForThemeVariant } from "./generateSrcMainResourcesForThemeVariant";
|
2022-08-16 14:41:06 +07:00
|
|
|
|
2024-05-17 01:21:26 +02:00
|
|
|
export type BuildOptionsLike = BuildOptionsLike_generateSrcMainResourcesForMainTheme & {
|
2024-05-12 21:23:20 +02:00
|
|
|
themeNames: string[];
|
2023-08-21 05:54:17 +02:00
|
|
|
};
|
2022-08-16 14:41:06 +07:00
|
|
|
|
2023-04-01 13:31:35 +02:00
|
|
|
assert<BuildOptions extends BuildOptionsLike ? true : false>();
|
2021-03-22 20:54:28 +01:00
|
|
|
|
2024-05-17 01:21:26 +02:00
|
|
|
export async function generateSrcMainResources(params: { buildOptions: BuildOptionsLike }): Promise<void> {
|
2024-05-16 09:29:26 +02:00
|
|
|
const { buildOptions } = params;
|
2023-03-16 22:13:46 +01:00
|
|
|
|
2024-05-12 20:47:03 +02:00
|
|
|
const [themeName, ...themeVariantNames] = buildOptions.themeNames;
|
2021-02-21 18:55:06 +01:00
|
|
|
|
2024-05-17 01:21:26 +02:00
|
|
|
await generateSrcMainResourcesForMainTheme({
|
2024-05-12 20:47:03 +02:00
|
|
|
themeName,
|
|
|
|
buildOptions
|
|
|
|
});
|
2022-08-16 14:41:06 +07:00
|
|
|
|
2024-05-12 20:47:03 +02:00
|
|
|
for (const themeVariantName of themeVariantNames) {
|
2024-05-17 01:21:26 +02:00
|
|
|
generateSrcMainResourcesForThemeVariant({
|
2024-01-31 21:56:46 +01:00
|
|
|
themeName,
|
2024-05-12 20:47:03 +02:00
|
|
|
themeVariantName,
|
2024-05-17 00:39:05 +02:00
|
|
|
buildOptions
|
2023-04-19 05:04:11 +02:00
|
|
|
});
|
2024-02-05 08:52:58 +01:00
|
|
|
}
|
2021-02-21 18:55:06 +01:00
|
|
|
}
|