Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cli/commands/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const registerCompletionCommand = (program: Command): void => {
completion
.command(`${COMPLETE_SUBCOMMAND} [words...]`, { hidden: true })
.description('internal: emit completion candidates for the words typed so far')
.action((words: string[]) => {
.action((words: readonly string[]) => {
return runCliProgram(
completionCommandProgram({ operation: 'complete', words, commandTree: program }),
);
Expand Down
4 changes: 2 additions & 2 deletions src/cli/commands/testflight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const registerTestflightCommand = (program: Command): void => {
.option('--csv <path>', 'import testers from a CSV (email,firstName,lastName per line)')
.option('--dry-run', 'report what would change without inviting anyone', false)
.option('-y, --yes', 'skip the confirmation prompt', false)
.action((emails: string[], commandOptions: AddTesterOptions) =>
.action((emails: readonly string[], commandOptions: AddTesterOptions) =>
runCliProgram(
testflightCommandProgram({
operation: 'add',
Expand All @@ -118,7 +118,7 @@ export const registerTestflightCommand = (program: Command): void => {
.option('-g, --group <name>', "beta group to remove from (auto-selected if there's only one)")
.option('--dry-run', 'report what would change without removing anyone', false)
.option('-y, --yes', 'skip the confirmation prompt', false)
.action((emails: string[], commandOptions: TesterMutationOptions) =>
.action((emails: readonly string[], commandOptions: TesterMutationOptions) =>
runCliProgram(
testflightCommandProgram({
operation: 'remove',
Expand Down
2 changes: 1 addition & 1 deletion src/cli/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type EnvFlags = {
printEnv: boolean;
};
/** Commander reducer: collect a repeatable string option into an array. */
const collectEnv = (environmentFlag: string, previousFlags: string[]): string[] => {
const collectEnv = (environmentFlag: string, previousFlags: readonly string[]): string[] => {
return [...previousFlags, environmentFlag];
};
/**
Expand Down
8 changes: 4 additions & 4 deletions src/core/dashboard/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const renderSection = (sectionTitle: string, sectionHtml: string): string =>
const renderProviderChip = (providerLabel: string, providerName: string): string =>
`<span class="chip"><b>${escapeHtml(providerLabel)}</b> ${escapeHtml(providerName)}</span>`;

const renderAppsTable = (apps: DashboardApp[]): string => {
const renderAppsTable = (apps: readonly DashboardApp[]): string => {
const appTableRows = apps.map((app) => [
renderTableCell(app.name),
renderTableCell(app.version),
Expand All @@ -65,7 +65,7 @@ const renderAccountStatus = (account: DashboardAccount): string => {
return renderTableCell(null);
};

const renderAccountsTable = (accounts: DashboardAccount[]): string => {
const renderAccountsTable = (accounts: readonly DashboardAccount[]): string => {
const accountTableRows = accounts.map((account) => [
renderTableCell(account.label),
renderTableCell(account.keyId),
Expand All @@ -90,7 +90,7 @@ const renderArtifactStatus = (buildArtifact: DashboardArtifact): string => {
return '<span class="ok">on disk</span>';
};

const renderArtifactsTable = (buildArtifacts: DashboardArtifact[]): string => {
const renderArtifactsTable = (buildArtifacts: readonly DashboardArtifact[]): string => {
const artifactTableRows = buildArtifacts.map((buildArtifact) => [
renderTableCell(buildArtifact.app),
renderTableCell(buildArtifact.platform),
Expand All @@ -112,7 +112,7 @@ const renderSecretScope = (buildSecret: DashboardSecret): string => {
return renderTableCell(buildSecret.profile);
};

const renderSecretsTable = (buildSecrets: DashboardSecret[]): string => {
const renderSecretsTable = (buildSecrets: readonly DashboardSecret[]): string => {
const secretTableRows = buildSecrets.map((buildSecret) => [
renderTableCell(buildSecret.app),
renderSecretScope(buildSecret),
Expand Down
2 changes: 1 addition & 1 deletion src/core/docs/commandDocs/commandReference.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { escapeCell } from './common.js';
import type { CommandSpec, DocStats, OptionSpec } from '@core/types/commandDocs.js';
/** Render a command's flag table, or `""` when it has no options. */
const renderOptionsTable = (options: OptionSpec[]): string => {
const renderOptionsTable = (options: readonly OptionSpec[]): string => {
if (options.length === 0) return '';
const rows = options.map((o) => `| \`${escapeCell(o.flags)}\` | ${escapeCell(o.description)} |`);
return ['', '| Flag | Description |', '| --- | --- |', ...rows].join('\n');
Expand Down
2 changes: 1 addition & 1 deletion src/core/docs/commandDocs/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const countAsyncMethods = (source: string): number => {
return methodMatches.length;
};
/** Count test cases (`it(` / `test(` calls, including `.each` / `.skip`) across the given test sources. */
export const countTestCases = (sources: string[]): number => {
export const countTestCases = (sources: readonly string[]): number => {
let testCount = 0;
for (const source of sources) {
const testMatches = source.match(/^[ \t]*(?:it|test)(?:\.[a-z]+)?\(/gm);
Expand Down
5 changes: 3 additions & 2 deletions src/core/insights/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type {
StarRating,
} from '../types/insights.js';
import { buildInsightsReport, STARS } from './aggregate.js';
import type { MutableDeep } from '../types/mutable.js';

/** Options accepted by the cross-store insights command. */
export type InsightsCommandOptions = Readonly<{
Expand Down Expand Up @@ -66,7 +67,7 @@ const normalizeAscReviews = (customerReviews: readonly CustomerReviewResource[])
for (const customerReview of customerReviews) {
const starRating = toStarRating(customerReview.rating);
if (starRating === null) continue;
const normalizedReview: ReviewDatum = {
const normalizedReview: MutableDeep<ReviewDatum> = {
store: 'appstore',
rating: starRating,
answered: customerReview.answered,
Expand All @@ -85,7 +86,7 @@ const normalizePlayReviews = (playReviews: readonly PlayReview[]): ReviewDatum[]
for (const playReview of playReviews) {
const starRating = toStarRating(playReview.rating);
if (starRating === null) continue;
const normalizedReview: ReviewDatum = {
const normalizedReview: MutableDeep<ReviewDatum> = {
store: 'play',
rating: starRating,
answered: playReview.answered,
Expand Down
2 changes: 1 addition & 1 deletion src/core/mcp/gate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { McpTool } from '../types/mcp.js';
import type { McpCapability } from '../types/storeSurface.js';
import { enabledCapabilities, gateTools } from './gate.js';
/** A bare config with an optional `mcp` block - only the fields the gate reads matter here. */
const config = (capabilities?: McpCapability[]): LaunchConfig => {
const config = (capabilities?: readonly McpCapability[]): LaunchConfig => {
const launchConfig: LaunchConfig = {
profiles: {},
credentials: 'local',
Expand Down
4 changes: 2 additions & 2 deletions src/core/mcp/tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { makeLaunchPathsTest } from '../services/paths.js';
import { makeLaunchSecretStoreTest } from '../services/secretStore.js';

/** A bare config exposing the given MCP capability tiers - only the fields the gate reads matter here. */
const config = (capabilities: McpCapability[]): LaunchConfig => {
const config = (capabilities: readonly McpCapability[]): LaunchConfig => {
return {
profiles: {},
credentials: 'local',
Expand Down Expand Up @@ -60,7 +60,7 @@ const provideToolServices = <A, E, R>(program: Effect.Effect<A, E, R>) =>

/** Parse the JSON a successful read tool emits as its single text block. */
const parseToolOutput = <DecodedOutput>(
toolOutput: { content: { text: string }[] },
toolOutput: { content: readonly { readonly text: string }[] },
outputSchema: Schema.Schema<DecodedOutput>,
): DecodedOutput =>
Schema.decodeUnknownSync(outputSchema)(
Expand Down
2 changes: 1 addition & 1 deletion src/core/terminal/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const optionFlags = (command: Command): string[] => {
*/
const descendCommandTree = (
program: Command,
words: string[],
words: readonly string[],
): {
command: Command;
commandPath: string[];
Expand Down
2 changes: 1 addition & 1 deletion src/core/terminal/halfblock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const paint = (
return `\x1b[${params.join(';')}m${text}\x1b[0m`;
};
/** Render a row to a string, coalescing runs of same-color cells into one ANSI span (or plain text). */
const renderRow = (cellRow: Cell[], depth: ColorDepth): string => {
const renderRow = (cellRow: readonly Cell[], depth: ColorDepth): string => {
if (depth === 'none') return cellRow.map((cell) => cell.ch).join('');
let out = '';
let i = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/core/terminal/wizardCommand.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
validateCustomBudget,
} from './wizardCommand.js';

const configWith = (profileNames: string[]): LaunchConfig => ({
const configWith = (profileNames: readonly string[]): LaunchConfig => ({
profiles: Object.fromEntries(
profileNames.map((profileName) => [profileName, { name: profileName }]),
),
Expand Down
4 changes: 2 additions & 2 deletions src/core/terminal/wizardCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const teach = (topic: GlossaryTopic, title: string) =>
});

/** Select the app platform while showing whether each store is configured. */
const selectPlatform = (configuredApps: AppDescriptor[]) =>
const selectPlatform = (configuredApps: readonly AppDescriptor[]) =>
Effect.gen(function* () {
const hasIosApp = configuredApps.some((configuredApp) => configuredApp.bundleId !== undefined);
const hasAndroidApp = configuredApps.some(
Expand Down Expand Up @@ -358,7 +358,7 @@ const isPromptSelectionFailure = (cause: unknown): cause is PromptSelectionFailu
export const flowInvalidReason = (
rememberedFlow: LastFlow,
launchConfig: LaunchConfig,
configuredApps: AppDescriptor[],
configuredApps: readonly AppDescriptor[],
accountKeyIds: Set<string>,
): string | null => {
let platformConfigured = configuredApps.some(
Expand Down
Loading