Skip to content

Consolidate examples to TypeScript, add programmatic usage, Docker base node 24 - #302

Merged
mesaugat merged 2 commits into
chore/bump-examples-typescript-fix-vulnerabilitiesfrom
chore/consolidate-examples
Oct 10, 2026
Merged

mesaugat merged 2 commits into
chore/bump-examples-typescript-fix-vulnerabilitiesfrom
chore/consolidate-examples

Conversation

@mesaugat

Copy link
Copy Markdown
Member

Stacked on #301 (base is that PR's branch); retarget to master once #300 and #301 merge.

Summary

  • Remove the JavaScript samples (node-app-mssql, node-app-pg) and the separate node-mssql-programmatic-use sample. Only node-app-mssql-ts and node-app-pg-ts remain; the root README's examples list is updated.
  • Add programmatic usage to both TypeScript examples: src/sync-db.ts (loads sync-db.yml and the connections, runs synchronize, exits non-zero on failure), run with yarn synchronize:programmatic, plus a README section. This replaces the old sample's sync-db.js, which used ESM import in a plain .js file, had no script to run it, and called resolveConnections() without its required config argument.
  • TypeScript 6 setup for the examples: add @types/node and types: ["node"] to tsconfig.json; fix stale package names (app-pg, node-app-mssql).
  • Update the Dockerfile base image from node:18-slim to node:24-slim in both examples.

Test plan

  • yarn format:check
  • yarn synchronize:programmatic type-checks and runs against real Postgres 13 and SQL Server 2022 containers; a second run is idempotent and each example's start script reads the synced objects
  • node:24-slim image has Node 24.21 and yarn 1.22, and installs and runs sync-db. The yarn step needed strict SSL disabled in a scratch copy because of TLS interception on my machine (the unmodified node:18-slim build fails the same way), so the committed Dockerfile's full docker-compose up flow has not been run
  • Run docker-compose up for both examples on a machine without TLS interception

The examples install the published @leapfrogtechnology/sync-db@^2.0.0 from npm, so they exercise the released CLI and not this branch's code.

🤖 Generated with Claude Code

mesaugat and others added 2 commits October 10, 2026 22:42
…ic usage

Remove the JavaScript samples (node-app-mssql, node-app-pg) and the separate
node-mssql-programmatic-use sample. Both TypeScript examples now include a
type-checked programmatic usage script (src/sync-db.ts,
`yarn synchronize:programmatic`) that fixes the old sample's missing
resolveConnections argument. Add @types/node and types:[node] required by
TypeScript 6, and fix the stale package names.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mesaugat
mesaugat merged commit d07b5e8 into chore/bump-examples-typescript-fix-vulnerabilities Oct 10, 2026
@mesaugat
mesaugat deleted the chore/consolidate-examples branch October 10, 2026 17:01
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.

1 participant