Skip to content

Carry over changes from cli#233

Open
MilapNaik wants to merge 26 commits intov4from
extend-cli-conventions
Open

Carry over changes from cli#233
MilapNaik wants to merge 26 commits intov4from
extend-cli-conventions

Conversation

@MilapNaik
Copy link
Copy Markdown
Collaborator

@MilapNaik MilapNaik commented Feb 26, 2026

Extend CLI changes from #202 to Rokudeploy.ts. Done mostly by Claude Code.

@MilapNaik MilapNaik changed the title Carry over changes from cli. Done by Claude Code. Carry over changes from cli Feb 26, 2026
@MilapNaik MilapNaik requested a review from Copilot March 9, 2026 19:35
Copy link
Copy Markdown

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 carries forward recent CLI argument/behavior changes (from #202) into the underlying RokuDeploy.ts API and command implementations, aligning option names and expanding sideload() behavior.

Changes:

  • Renames options across the API to match CLI (remotePortecpPort, ZipOptions.stagingDirdir, rekeySignedPackagepkg).
  • Moves/centralizes path resolution logic into command classes and RokuDeploy.sideload().
  • Updates docs/changelog to reflect the new option names and sideload close behavior.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/commands/ZipCommand.ts Adds cwd defaulting and resolves --out/--dir paths before calling zip().
src/commands/StageCommand.ts Maps --out to stagingDir for stage().
src/commands/SideloadCommand.ts Resolves zip/rootDir/outZip paths and forwards options to sideload().
src/commands/RekeyDeviceCommand.ts Adds cwd defaulting and resolves --pkg to an absolute path.
src/commands/CreateSignedPackageCommand.ts Adds cwd defaulting and parses --out into outDir/outFile.
src/commands/CaptureScreenshotCommand.ts Adds cwd defaulting and parses --out into screenshotDir/screenshotFile.
src/cli.ts Removes inline argument post-processing; updates sideload flag to --close/--no-close; switches to ecpPort.
src/RokuDeployOptions.ts Renames remotePortecpPort and rekeySignedPackagepkg.
src/RokuDeploy.ts Implements ZipOptions.dir; switches ECP usage to ecpPort; enhances sideload() (zip/rootDir support + channel close).
src/RokuDeploy.spec.ts Updates tests for renamed options (pkg, dir, ecpPort).
README.md Updates CLI/API docs for renamed options and new sideload behavior.
CHANGELOG.md Adds 4.0.0-alpha.3 breaking-change notes covering the renames and sideload changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread README.md
Comment thread src/commands/CaptureScreenshotCommand.ts
Comment thread src/RokuDeploy.ts
Comment thread README.md
Comment thread README.md
Comment thread src/commands/CreateSignedPackageCommand.ts
Comment thread src/commands/SideloadCommand.ts Outdated
Comment thread src/RokuDeploy.ts Outdated
Comment thread README.md
@MilapNaik
Copy link
Copy Markdown
Collaborator Author

@copilot Can you take a look at these changes and make sure it:

  1. Consolidates CLI and programmatic flows so that they are consistent regardless of how a user chooses to use this package
  2. The uses themselves are bug-free and accomplish what they set out to do as defined from the docstrings and function names

Copilot AI and others added 2 commits April 10, 2026 20:27
…eSignedPackageOptions, add missing tests

Agent-Logs-Url: https://github.com/rokucommunity/roku-deploy/sessions/634b6c5a-0fb7-4407-8625-8c25cf7f84ce

Co-authored-by: MilapNaik <7122945+MilapNaik@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rokucommunity/roku-deploy/sessions/634b6c5a-0fb7-4407-8625-8c25cf7f84ce

Co-authored-by: MilapNaik <7122945+MilapNaik@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 10, 2026

@copilot Can you take a look at these changes and make sure it:

  1. Consolidates CLI and programmatic flows so that they are consistent regardless of how a user chooses to use this package
    ...

I reviewed the CLI and programmatic flows and found the following issues, which I've fixed in commit 10aedc1:

  1. Bug: retainDeploymentArchive default not working for rootDir — When sideload() was called with rootDir, the generated zip was incorrectly retained by default instead of being deleted. The options.retainDeploymentArchive ??= false was placed after getOptions(), which had already set it to true (the global default). Fixed by moving the ??= false assignment into the rootDir branch before getOptions() is called, matching how the zip branch sets ??= true upfront.

  2. Type: outFile missing from CreateSignedPackageOptionsCreateSignedPackageCommand sets outFile when the user provides --out, but the programmatic CreateSignedPackageOptions interface didn't declare outFile. Added it so both flows are type-safe and consistent.

  3. Tests: improved coverage — The existing "does not delete the archive by default" test was ambiguous (used rootDir but expected the file to be retained, which only worked due to the bug above). Split into two clear tests:

    • does not delete a pre-built zip by default (uses zip option → retained)
    • deletes the generated archive by default when using rootDir (uses rootDir → deleted)

    Also added:

    • skips closeChannel when close is false
    • triggers zip when rootDir is provided

@MilapNaik MilapNaik marked this pull request as ready for review April 13, 2026 16:20
Comment thread src/RokuDeploy.ts

if (imageUrlOnDevice) {
saveFilePath = util.standardizePath(path.join(options.screenshotDir, options.screenshotFile + imageExt));
const userExt = ['.jpg', '.png'].includes(path.extname(options.screenshotFile).toLowerCase()) ? path.extname(options.screenshotFile) : undefined;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's have a flag called autoExtension. The default is false. When false, use the filename EXACTLY as provided by the user. no extnesion comparing or swapping, etc.

When true:

  • if the user supplied name ends with the extension from the device, use their name completely
  • if the user supplied name doees not end with the extension from the deviec but is either .png or jpeg, swap the file extension
  • otherwise, append the device extension to the end of the user supplied filename

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.

4 participants