Skip to content

feat: Export function run in main.ts for future usage. - #106

Merged
hzhangxyz merged 1 commit into
mainfrom
dev/export-run-func-in-ts
Mar 12, 2026
Merged

feat: Export function run in main.ts for future usage.#106
hzhangxyz merged 1 commit into
mainfrom
dev/export-run-func-in-ts

Conversation

@hzhangxyz

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings March 12, 2026 11:19
@hzhangxyz
hzhangxyz merged commit adb8f23 into main Mar 12, 2026
23 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 exposes the TypeScript entrypoint run() function from ddss/main.ts so it can be imported and reused externally (beyond the CLI invocation).

Changes:

  • Export run(addr, components) from ddss/main.ts for future usage.
Comments suppressed due to low confidence (1)

ddss/main.ts:34

  • run() initializes the Sequelize connection before validating components, and on an unsupported component it returns early without closing the connection. This can leak DB connections and (for the CLI temporary sqlite DB) may leave an open handle while the temp directory is removed. Consider validating components before calling initializeDatabase(), or wrap the body in try/finally to always await sequelize.close() (including error/early-return paths).
    const sequelize = await initializeDatabase(addr);

    for (const name of components) {
        if (!(name in componentMap)) {
            console.error(`error: unsupported component: ${name}`);
            return;
        }

💡 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.

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