From 7764ad4ce65934c7e0341150a3f81e2be351f453 Mon Sep 17 00:00:00 2001 From: gonzaloriestra <14979109+gonzaloriestra@users.noreply.github.com> Date: Wed, 10 Jun 2026 00:37:19 +0000 Subject: [PATCH 1/3] [Refactor] Use uniq helper in scopes This PR refactors `packages/cli-kit/src/private/node/session/scopes.ts` to use the standardized `uniq` utility function from `@shopify/cli-kit/common/array` instead of manual `Array.from(new Set(array))` pattern for deduplicating scope arrays. This improves code consistency and readability by utilizing existing project utilities. Verified with lint, type-check, and unit tests. --- packages/cli-kit/src/private/node/session/scopes.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/cli-kit/src/private/node/session/scopes.ts b/packages/cli-kit/src/private/node/session/scopes.ts index 109f65f9726..19d0f35a5c2 100644 --- a/packages/cli-kit/src/private/node/session/scopes.ts +++ b/packages/cli-kit/src/private/node/session/scopes.ts @@ -1,5 +1,6 @@ import {allAPIs, API} from '../api.js' import {BugError} from '../../../public/node/error.js' +import {uniq} from '../../../public/common/array.js' /** * Generate a flat array with all the default scopes for all the APIs plus @@ -10,7 +11,7 @@ import {BugError} from '../../../public/node/error.js' export function allDefaultScopes(extraScopes: string[] = []): string[] { let scopes = allAPIs.map((api) => defaultApiScopes(api)).flat() scopes = ['openid', ...scopes, ...extraScopes].map(scopeTransform) - return Array.from(new Set(scopes)) + return uniq(scopes) } /** @@ -22,7 +23,7 @@ export function allDefaultScopes(extraScopes: string[] = []): string[] { */ export function apiScopes(api: API, extraScopes: string[] = []): string[] { const scopes = [...defaultApiScopes(api), ...extraScopes.map(scopeTransform)].map(scopeTransform) - return Array.from(new Set(scopes)) + return uniq(scopes) } /** From cb01a1529073ad137dae4fb43cc7aa91ba7f6edf Mon Sep 17 00:00:00 2001 From: gonzaloriestra <14979109+gonzaloriestra@users.noreply.github.com> Date: Wed, 10 Jun 2026 01:02:03 +0000 Subject: [PATCH 2/3] [Refactor] Use uniq helper in scopes This PR refactors `packages/cli-kit/src/private/node/session/scopes.ts` to use the standardized `uniq` utility function from `@shopify/cli-kit/common/array` instead of manual `Array.from(new Set(array))` pattern for deduplicating scope arrays. This improves code consistency and readability by utilizing existing project utilities. Verified with lint, type-check, and unit tests. Note that some pre-existing CI failures were observed but confirmed to be unrelated to these changes. From b94dac67432993d64f0d7adc38c37d22490a6c8f Mon Sep 17 00:00:00 2001 From: gonzaloriestra <14979109+gonzaloriestra@users.noreply.github.com> Date: Wed, 10 Jun 2026 01:29:34 +0000 Subject: [PATCH 3/3] [Refactor] Use uniq helper in scopes This PR refactors \`packages/cli-kit/src/private/node/session/scopes.ts\` to use the standardized \`uniq\` utility function from \`@shopify/cli-kit/common/array\` instead of manual \`Array.from(new Set(array))\` pattern for deduplicating scope arrays. This improves code consistency and readability by utilizing existing project utilities. Verified with lint, type-check, and unit tests. Note that some pre-existing CI failures (organization app limit reached) were observed but are unrelated to these changes.