mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 04:22:12 +00:00
[cli][build-utils] Rename variants to flags (#11121)
- Removes all the legacy `flags` - Renames the new `variants` to `flags` Neither the legacy flags, nor the new variants were exposed to anyone, except for the type in build-utils, so there shouldn't be any issues removing/renaming them.
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
EdgeFunction,
|
||||
Images,
|
||||
File,
|
||||
FlagDefinitions,
|
||||
} from '@vercel/build-utils';
|
||||
import { NodeFileTraceReasons } from '@vercel/nft';
|
||||
import type {
|
||||
@@ -3307,19 +3308,14 @@ export function isApiPage(page: string | undefined) {
|
||||
.match(/(serverless|server)\/pages\/api(\/|\.js$)/);
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export type VariantsManifestLegacy = Record<
|
||||
string,
|
||||
{
|
||||
defaultValue?: unknown;
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
>;
|
||||
export type VariantsManifest = {
|
||||
definitions: FlagDefinitions;
|
||||
};
|
||||
|
||||
export async function getVariantsManifest(
|
||||
entryPath: string,
|
||||
outputDirectory: string
|
||||
): Promise<null | VariantsManifestLegacy> {
|
||||
): Promise<null | VariantsManifest> {
|
||||
const pathVariantsManifest = path.join(
|
||||
entryPath,
|
||||
outputDirectory,
|
||||
@@ -3333,7 +3329,7 @@ export async function getVariantsManifest(
|
||||
|
||||
if (!hasVariantsManifest) return null;
|
||||
|
||||
const variantsManifest: VariantsManifestLegacy = await fs.readJSON(
|
||||
const variantsManifest: VariantsManifest = await fs.readJSON(
|
||||
pathVariantsManifest
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user