From 34e3f16a224adffc4a4723e1c54c36f393e14d05 Mon Sep 17 00:00:00 2001 From: gonzaloriestra <14979109+gonzaloriestra@users.noreply.github.com> Date: Tue, 16 Jun 2026 00:16:11 +0000 Subject: [PATCH] [Refactor] Use uniq helper in AppManagementClient Replace manual Set deduplication with the uniq helper from @shopify/cli-kit/common/array in allowedTemplates function. Also use .flatMap() instead of .map().flat() for conciseness. --- .../developer-platform-client/app-management-client.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/app/src/cli/utilities/developer-platform-client/app-management-client.ts b/packages/app/src/cli/utilities/developer-platform-client/app-management-client.ts index 94badf04945..91c0a2d6bfc 100644 --- a/packages/app/src/cli/utilities/developer-platform-client/app-management-client.ts +++ b/packages/app/src/cli/utilities/developer-platform-client/app-management-client.ts @@ -158,6 +158,7 @@ import { businessPlatformRequestDoc, BusinessPlatformRequestOptions, } from '@shopify/cli-kit/node/api/business-platform' +import {uniq} from '@shopify/cli-kit/common/array' import {CLI_KIT_VERSION} from '@shopify/cli-kit/common/version' import {encodeGid, numericIdFromEncodedGid, numericIdFromGid} from '@shopify/cli-kit/common/gid' import {versionSatisfies} from '@shopify/cli-kit/node/node-package-manager' @@ -1343,8 +1344,8 @@ export async function allowedTemplates( version: string = CLI_KIT_VERSION, ): Promise { // Extract both types of flags from templates - const allBetaFlags = Array.from(new Set(templates.map((ext) => ext.organizationBetaFlags ?? []).flat())) - const allExpFlags = Array.from(new Set(templates.map((ext) => ext.organizationExpFlags ?? []).flat())) + const allBetaFlags = uniq(templates.flatMap((ext) => ext.organizationBetaFlags ?? [])) + const allExpFlags = uniq(templates.flatMap((ext) => ext.organizationExpFlags ?? [])) // Fetch both flag types in parallel const [enabledBetaFlags, enabledExpFlags] = await Promise.all([