From be2582ab3af4a30c5d7e09fa9aa116db7b8257e7 Mon Sep 17 00:00:00 2001 From: Angelo Ashmore Date: Tue, 16 Jun 2026 23:37:19 +0000 Subject: [PATCH] feat: remove feature flag from Type Builder enablement check The Type Builder enablement check no longer depends on the dev-tools-types-builder-cloud Amplitude flag. It now relies solely on the repository's Slice Machine quota, keeping the existing PRISMIC_TYPE_BUILDER_ENABLED env override. Removes the now-unused getVariantData/getProfile calls and their imports. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/project.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/project.ts b/src/project.ts index 86b0ddd..cfbd1b4 100644 --- a/src/project.ts +++ b/src/project.ts @@ -4,9 +4,7 @@ import { readFile, realpath, rm, writeFile } from "node:fs/promises"; import { fileURLToPath, pathToFileURL } from "node:url"; import * as z from "zod/mini"; -import { getVariantData } from "./clients/amplitude"; import { getRepository } from "./clients/repository"; -import { getProfile } from "./clients/user"; import { env } from "./env"; import { exists, findUpward } from "./lib/file"; import { stringify } from "./lib/json"; @@ -253,16 +251,8 @@ export async function checkIsTypeBuilderEnabled( if (env.PRISMIC_TYPE_BUILDER_ENABLED !== undefined) return env.PRISMIC_TYPE_BUILDER_ENABLED; const { token, host } = config; - const profile = await getProfile({ token, host }); - const [variantData, repository] = await Promise.all([ - getVariantData(profile.shortId, { - groups: { Repository: [repo] }, - host, - }), - getRepository({ repo, token, host }), - ]); - const flagEnabled = variantData["dev-tools-types-builder-cloud"]?.value === "on"; - return flagEnabled && repository.quotas?.sliceMachineEnabled === true; + const repository = await getRepository({ repo, token, host }); + return repository.quotas?.sliceMachineEnabled === true; } export class TypeBuilderRequiredError extends Error {