From 5c6fdbcb16af32154be97ecbaa793b8db23c5a04 Mon Sep 17 00:00:00 2001 From: YosefHayim Date: Fri, 7 Aug 2026 14:05:23 +0300 Subject: [PATCH] refactor(providers): readonly-domain-types consumer fixes --- src/providers/credentials/local.test.ts | 3 ++- src/providers/storage/local.ts | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/providers/credentials/local.test.ts b/src/providers/credentials/local.test.ts index a03b441e..535444cd 100644 --- a/src/providers/credentials/local.test.ts +++ b/src/providers/credentials/local.test.ts @@ -9,6 +9,7 @@ import type { ResolvedBuildContext } from '@core/types/config.js'; import type { AscKey } from '@core/types/credentials.js'; import type { CredentialsProvider } from '@core/types/providers.js'; import { makeLocalCredentialsProvider } from './local.js'; +import type { MutableDeep } from '@core/types/mutable.js'; type LocalCredentialsTestState = { appleKeys: Map; @@ -55,7 +56,7 @@ const runWithLocalCredentials = ( /** Build context containing only the fields the local credentials provider reads. */ const iosContext = (account?: string): ResolvedBuildContext => { - const buildContext: ResolvedBuildContext = { + const buildContext: MutableDeep = { platform: 'ios', app: { name: 'sampleapp', diff --git a/src/providers/storage/local.ts b/src/providers/storage/local.ts index 18aa9e8e..d2157b7f 100644 --- a/src/providers/storage/local.ts +++ b/src/providers/storage/local.ts @@ -23,7 +23,7 @@ export const makeLocalStorageProvider = (directoryOverride?: string) => const objectsDirectory = pathService.join(baseDirectory, 'objects'); const artifactIndexPath = pathService.join(baseDirectory, 'index.json'); const readIndex = () => artifactRetention.readIndex(artifactIndexPath); - const writeIndex = (artifactIndex: BuildArtifact[]) => + const writeIndex = (artifactIndex: readonly BuildArtifact[]) => artifactRetention.writeIndex(artifactIndex, artifactIndexPath); const objectPath = (objectKey: string): string => pathService.join(objectsDirectory, ...objectKey.split('/')); @@ -37,8 +37,7 @@ export const makeLocalStorageProvider = (directoryOverride?: string) => const destination = pathService.join(baseDirectory, artifactId); yield* fileSystem.copy(artifact.path, destination); const artifactIndex = yield* readIndex(); - artifactIndex.unshift({ ...artifact, path: destination }); - yield* writeIndex(artifactIndex); + yield* writeIndex([{ ...artifact, path: destination }, ...artifactIndex]); return { id: artifactId, location: destination }; }), list: readIndex,