Skip to content

Allow setting options when creating the Roku-Deploy object#291

Open
Christian-Holbrook wants to merge 4 commits into
v4from
constructor-options
Open

Allow setting options when creating the Roku-Deploy object#291
Christian-Holbrook wants to merge 4 commits into
v4from
constructor-options

Conversation

@Christian-Holbrook

Copy link
Copy Markdown
Contributor

Add constructor to RokuDeploy that accepts default options, so callers don't need to repeat host, password, etc. on every method call. Also adds
support for custom logger instances.

Closes #275, closes #274


Before

const rd = new RokuDeploy();

await rd.sideload({ host: '192.168.1.100', password: 'secret', dir: './dist' });
await rd.deleteDevChannel({ host: '192.168.1.100', password: 'secret' });
await rd.captureScreenshot({ host: '192.168.1.100', password: 'secret', out: './screenshot.png' });

After

const rd = new RokuDeploy({ host: '192.168.1.100', password: 'secret' });

await rd.sideload({ dir: './dist' });
await rd.deleteDevChannel();
await rd.captureScreenshot({ out: './screenshot.png' });

Custom Logger

const rd = new RokuDeploy({ logger: myCustomLogger });
// or just set log level
const rd = new RokuDeploy({ logLevel: 'debug' });

Comment thread src/RokuDeploy.ts Outdated
}

// Set log level if provided
if (this.options.logLevel) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We decided to drop logLevel as an option. We will unify with other tools that just take logger.

See example from brighterscript

/**
 * A runner class that handles
 */
export class ProgramBuilder {

    public constructor(
        options?: {
            logger?: Logger;
        }
    ) {
        this.logger = option

Comment thread src/RokuDeploy.ts Outdated
Comment thread src/RokuDeploy.spec.ts
Comment thread src/RokuDeploy.ts Outdated
Comment thread src/RokuDeploy.ts Outdated
@TwitchBronBron TwitchBronBron linked an issue Jun 10, 2026 that may be closed by this pull request
@TwitchBronBron TwitchBronBron modified the milestones: 4.1.0, v4.0.0 Jul 2, 2026
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.

Remove logLevel as a function-level option

2 participants