Skip to content

cowork-bot: automated improvements (cowork/improve-vscode-schemaforge) - #9

Merged
Coding-Dev-Tools merged 3 commits into
masterfrom
cowork/improve-vscode-schemaforge
Jul 8, 2026
Merged

cowork-bot: automated improvements (cowork/improve-vscode-schemaforge)#9
Coding-Dev-Tools merged 3 commits into
masterfrom
cowork/improve-vscode-schemaforge

Conversation

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner

Automated improvement PR from the Cowork repo-improver rotation (one coherent senior-dev improvement per run; see individual commit messages). Subsequent runs push additional commits to this PR rather than opening new ones.

cowork-bot and others added 3 commits June 27, 2026 11:52
Harden the SchemaForge command entry points against the extension's
silent-failure class:

- runCommand() (new src/runCommand.ts): command handlers previously
  rejected into unhandled promise rejections, so a failed conversion
  (e.g. schemaforge CLI not installed) showed the user nothing even
  though cli.ts had already built a helpful message. The wrapper catches
  and surfaces errors via showErrorMessage, and forwards arguments
  verbatim — which also fixes the explorer context-menu commands
  (convert/detect) silently dropping the clicked resource Uri.

- getOutputChannel()/disposeOutputChannels() (new src/output.ts): the
  commands called vscode.window.createOutputChannel on every invocation,
  leaking a fresh channel each run; channels are now cached by name and
  disposed on deactivate.

- Minor: removed an unused defaultTarget in ConvertCommand.run and an
  unused docB binding in DiffCommand.run (eslint warnings 9 -> 7).

Verified: tsc -p ./ clean (strict), eslint 0 errors.
@Coding-Dev-Tools
Coding-Dev-Tools merged commit 05f3bb6 into master Jul 8, 2026
3 of 4 checks passed
Coding-Dev-Tools added a commit that referenced this pull request Jul 20, 2026
* cowork-bot: centralize schema-format list and normalize detected formats

The canonical list of supported schema formats was inlined in three
places (convert.ts, previewPanel.ts, and cli.ts's getAvailableFormats
fallback) — a drift risk that already bit us once (PR #9). Extract it
into a single source of truth, src/formats.ts (SCHEMA_FORMATS +
normalizeFormat).

normalizeFormat() trims/lowercases the label the `detect` CLI emits
before it is forwarded to `convert --from/--to`. Previously a label like
"SQL" or " Prisma " was passed verbatim, producing an opaque CLI error
while the command appeared to do nothing — the classic silent-failure
trap. Unknown formats still pass through unchanged so the CLI errors
clearly instead of silently.

Adds network-free regression tests (tests/formats.test.js) covering
normalizeFormat behavior and the list/enum consistency across call sites.

* cowork-bot: fix test discovery in CI

Remove quotes around the tests/*.test.js argument so the shell expands the test files on Node 18 and 20. This resolves PR #11 CI failures where Node received the literal glob and ran zero tests.

---------

Co-authored-by: cowork-bot <cowork-bot@users.noreply.github.com>
Co-authored-by: cowork-bot <jaixiicrypto@gmail.com>
Coding-Dev-Tools pushed a commit that referenced this pull request Jul 21, 2026
#12)

* cowork-bot: centralize schema-format list and normalize detected formats

The canonical list of supported schema formats was inlined in three
places (convert.ts, previewPanel.ts, and cli.ts's getAvailableFormats
fallback) — a drift risk that already bit us once (PR #9). Extract it
into a single source of truth, src/formats.ts (SCHEMA_FORMATS +
normalizeFormat).

normalizeFormat() trims/lowercases the label the `detect` CLI emits
before it is forwarded to `convert --from/--to`. Previously a label like
"SQL" or " Prisma " was passed verbatim, producing an opaque CLI error
while the command appeared to do nothing — the classic silent-failure
trap. Unknown formats still pass through unchanged so the CLI errors
clearly instead of silently.

Adds network-free regression tests (tests/formats.test.js) covering
normalizeFormat behavior and the list/enum consistency across call sites.

* cowork-bot: fix test discovery in CI

Remove quotes around the tests/*.test.js argument so the shell expands the test files on Node 18 and 20. This resolves PR #11 CI failures where Node received the literal glob and ran zero tests.

* fix(deps): npm audit fix - resolve brace-expansion, js-yaml, minimatch vulnerabilities

---------

Co-authored-by: cowork-bot <cowork-bot@users.noreply.github.com>
Co-authored-by: cowork-bot <jaixiicrypto@gmail.com>
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