Skip to content

Conversation

@digitarald
Copy link

@digitarald digitarald commented Jun 11, 2025

First stab at #63 for build tools

@cameroncooke
Copy link
Collaborator

@digitarald This looks great, I'll give this a test later and update this PR with any feedback I have.

@cameroncooke cameroncooke requested a review from Copilot June 11, 2025 08:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces progress notifications for build tools, allowing asynchronous progress updates throughout the build and simulator run workflows.

  • Adds an optional context parameter with notification support in build commands.
  • Introduces a new type and helper (registerToolWithProgress) to register tools with progress notifications.
  • Updates the iOS simulator build and run logic to emit progress updates at key steps.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/utils/build-utils.ts Integrates context-based progress notifications into the xcodebuild command.
src/tools/common.ts Adds a new type and helper function to support registration of tools with progress notifications.
src/tools/build_ios_simulator.ts Updates simulator build and run logic to emit progress notifications and switches tool registration to use the new helper.

Comment on lines +208 to +209
// eslint-disable-next-line @typescript-eslint/no-explicit-any
extra: any, // Using any to work around the type mismatch - the actual runtime has sendNotification
Copy link

Copilot AI Jun 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider refining the type for the 'extra' parameter in the wrappedHandler to improve type safety, instead of using 'any'.

Suggested change
// eslint-disable-next-line @typescript-eslint/no-explicit-any
extra: any, // Using any to work around the type mismatch - the actual runtime has sendNotification
extra: ExtraContext, // Replacing 'any' with a specific type to improve type safety

Copilot uses AI. Check for mistakes.
log('info', `Starting ${platformOptions.logPrefix} ${buildAction} for scheme ${params.scheme}`);

// Send initial setup progress
if (context?.sendNotification && context._meta?.progressToken) {
Copy link

Copilot AI Jun 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The repeated conditional check for progress notification existence across multiple sections suggests extracting a helper function to reduce duplication and improve readability.

Suggested change
if (context?.sendNotification && context._meta?.progressToken) {
if (canSendProgressNotification(context)) {

Copilot uses AI. Check for mistakes.
@digitarald
Copy link
Author

Finally got around to testing and need to fix the access to sendNotification.

@cameroncooke
Copy link
Collaborator

@digitarald I'm going to close this for now, it's still an area I want to fix but it's still unclear the best way to handle this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants