[cli] Add Variants to Build Output API (#11098)

Makes adjustments to replace `flags` with `variants`.

Also marks the current `flags` implementation as deprecated, as it
should get removed soon. Which I'll do in a follow up PR.
This commit is contained in:
Andy
2024-02-01 10:28:12 +01:00
committed by GitHub
parent 4027a18337
commit 8ba0ce9324
5 changed files with 94 additions and 6 deletions

View File

@@ -3257,7 +3257,8 @@ export function isApiPage(page: string | undefined) {
.match(/(serverless|server)\/pages\/api(\/|\.js$)/);
}
export type VariantsManifest = Record<
/** @deprecated */
export type VariantsManifestLegacy = Record<
string,
{
defaultValue?: unknown;
@@ -3268,7 +3269,7 @@ export type VariantsManifest = Record<
export async function getVariantsManifest(
entryPath: string,
outputDirectory: string
): Promise<null | VariantsManifest> {
): Promise<null | VariantsManifestLegacy> {
const pathVariantsManifest = path.join(
entryPath,
outputDirectory,
@@ -3282,7 +3283,7 @@ export async function getVariantsManifest(
if (!hasVariantsManifest) return null;
const variantsManifest: VariantsManifest = await fs.readJSON(
const variantsManifest: VariantsManifestLegacy = await fs.readJSON(
pathVariantsManifest
);