From 6edd66b67be47a0b9fc76c6194b849c9a43d2c69 Mon Sep 17 00:00:00 2001 From: Saugat Acharya Date: Mon, 12 Oct 2026 12:55:56 +0545 Subject: [PATCH 1/6] chore(examples): upgrade tedious to 20.3.7 and pg to 8.23.1 Co-Authored-By: Claude Sonnet 5.5 --- examples/node-app-mssql-ts/package.json | 2 +- examples/node-app-mssql-ts/yarn.lock | 56 +++++++++++-------------- examples/node-app-pg-ts/package.json | 2 +- examples/node-app-pg-ts/yarn.lock | 2 +- 4 files changed, 28 insertions(+), 34 deletions(-) diff --git a/examples/node-app-mssql-ts/package.json b/examples/node-app-mssql-ts/package.json index 23985ef3..24d5ce47 100644 --- a/examples/node-app-mssql-ts/package.json +++ b/examples/node-app-mssql-ts/package.json @@ -13,7 +13,7 @@ "dependencies": { "@leapfrogtechnology/sync-db": "^2.0.0", "knex": "^3.3.0", - "tedious": "^18.2.1", + "tedious": "^20.3.7", "ts-node": "^10.9.2", "typescript": "^6.0.3" }, diff --git a/examples/node-app-mssql-ts/yarn.lock b/examples/node-app-mssql-ts/yarn.lock index ddc80394..1931d08e 100644 --- a/examples/node-app-mssql-ts/yarn.lock +++ b/examples/node-app-mssql-ts/yarn.lock @@ -21,7 +21,7 @@ dependencies: tslib "^2.6.2" -"@azure/core-auth@^1.10.0", "@azure/core-auth@^1.3.0", "@azure/core-auth@^1.7.2", "@azure/core-auth@^1.9.0": +"@azure/core-auth@^1.10.0", "@azure/core-auth@^1.10.1", "@azure/core-auth@^1.3.0", "@azure/core-auth@^1.9.0": version "1.11.0" resolved "https://registry.yarnpkg.com/@azure/core-auth/-/core-auth-1.11.0.tgz#1daeffdf62d1a871d22b865f9f3164a63ea1f575" integrity sha512-IUZydyTUkDnYdstOW9pFOOUQlBjAepK5teihDE3x6yxsPJs/hsAaaYpeGxdxrgtOiJbBKSjKW7MDk7AEhb4LRg== @@ -94,7 +94,7 @@ "@typespec/ts-http-runtime" "^0.3.0" tslib "^2.6.2" -"@azure/identity@^4.2.1": +"@azure/identity@^4.13.1": version "4.13.3" resolved "https://registry.yarnpkg.com/@azure/identity/-/identity-4.13.3.tgz#f7781be089dc6231e17ae1454b9a1e91bc797b81" integrity sha512-zGQPtqvXPgSA8yfV2CkIQ1qirqk0p9AIVpC5uEkdXQYcKl07QHvyaGYRnZOk0AsQUmxNb4wfkcwY5di8Z5xa9A== @@ -126,7 +126,7 @@ "@azure/logger" "^1.1.4" tslib "^2.2.0" -"@azure/keyvault-keys@^4.4.0": +"@azure/keyvault-keys@^4.10.2": version "4.10.2" resolved "https://registry.yarnpkg.com/@azure/keyvault-keys/-/keyvault-keys-4.10.2.tgz#4689ee3d7eb8e6e681bed0ed1f0549d6ec32ab61" integrity sha512-VmUSLbXRAbSzDD8grXHGPaknYs0SKr3yuf6U+d4XMpX4XuVYskNqbTTwXce0zR1LyxfTZm9rWEBcvs3vdYwCmQ== @@ -201,10 +201,10 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@js-joda/core@^5.6.1": - version "5.7.0" - resolved "https://registry.yarnpkg.com/@js-joda/core/-/core-5.7.0.tgz#526d437b07cbb41e28df34d487cbfccbe730185b" - integrity sha512-WBu4ULVVxySLLzK1Ppq+OdfP+adRS4ntmDQT915rzDJ++i95gc2jZkM5B6LWEAwN3lGXpfie3yPABozdD3K3Vg== +"@js-joda/core@^6.0.1": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@js-joda/core/-/core-6.3.0.tgz#9bc47b9b3cbdcc953c444f730e764c8d7a8f5b87" + integrity sha512-mdmjc6lJkTCORsHlMxBT9XM1yLqgtsNZmv/Hwme2v/HIb15D2XcmklZKTnynqBgsSizA9SkFvzpuksfIXhDV/w== "@leapfrogtechnology/sync-db@^2.0.0": version "2.3.1" @@ -396,7 +396,7 @@ dependencies: minimatch "*" -"@types/node@*", "@types/node@>=18": +"@types/node@*", "@types/node@>=22": version "26.6.5" resolved "https://registry.yarnpkg.com/@types/node/-/node-26.6.5.tgz#cb35209e7767c503551b5fa42a48231c7441d979" integrity sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg== @@ -494,7 +494,7 @@ base64-js@^1.3.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== -bl@^6.0.11: +bl@^6.1.4: version "6.1.6" resolved "https://registry.yarnpkg.com/bl/-/bl-6.1.6.tgz#b40f3aea6963c6742616a957efb742c4fb87ecbb" integrity sha512-jLsPgN/YSvPUg9UX0Kd73CXpm2Psg9FxMeCSXnk3WBO3CMT10JMwijubhGfHCnFu6TPn1ei3b975dxv7K2pWVg== @@ -816,10 +816,10 @@ https-proxy-agent@^7.0.0: agent-base "^7.1.2" debug "4" -iconv-lite@^0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" - integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== +iconv-lite@^0.7.0: + version "0.7.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.7.3.tgz#84ee12f963e7de50bc01a13e160a078b3b0f415f" + integrity sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ== dependencies: safer-buffer ">= 2.1.2 < 3.0.0" @@ -1233,11 +1233,6 @@ source-map@^0.6.0: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -sprintf-js@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.3.tgz#4914b903a2f8b685d17fdf78a70e917e872e444a" - integrity sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA== - sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -1283,21 +1278,20 @@ tarn@^3.0.2, tarn@^3.1.0: resolved "https://registry.yarnpkg.com/tarn/-/tarn-3.1.2.tgz#d2922d34a232c8b027605f3873a9c55318ce4f34" integrity sha512-3RTvqKZcK/17jnJ8rMKFXbyNogywTs1z0gVPPwFsJGX46rkmUHOdIaSQ/aVO1rS7nH+soiXiWk7rvUXxndm8Dg== -tedious@^18.2.1: - version "18.6.2" - resolved "https://registry.yarnpkg.com/tedious/-/tedious-18.6.2.tgz#c7da62ae11b0961177559b1c4f1c4d8dfa75ec2c" - integrity sha512-g7jC56o3MzLkE3lHkaFe2ZdOVFBahq5bsB60/M4NYUbocw/MCrS89IOEQUFr+ba6pb8ZHczZ/VqCyYeYq0xBAg== - dependencies: - "@azure/core-auth" "^1.7.2" - "@azure/identity" "^4.2.1" - "@azure/keyvault-keys" "^4.4.0" - "@js-joda/core" "^5.6.1" - "@types/node" ">=18" - bl "^6.0.11" - iconv-lite "^0.6.3" +tedious@^20.3.7: + version "20.3.7" + resolved "https://registry.yarnpkg.com/tedious/-/tedious-20.3.7.tgz#1b970d9c2e3fcd107e0ee9a78ce69f28878ec3a2" + integrity sha512-s+43djAcQGFiFHZPWtZPaDSZE/ukJnultjeJHXvKbM//OcZSSusSzXuqAIyOKpraNTWgtobhuWOvxrZK+a1yvA== + dependencies: + "@azure/core-auth" "^1.10.1" + "@azure/identity" "^4.13.1" + "@azure/keyvault-keys" "^4.10.2" + "@js-joda/core" "^6.0.1" + "@types/node" ">=22" + bl "^6.1.4" + iconv-lite "^0.7.0" js-md4 "^0.3.2" native-duplexpair "^1.0.0" - sprintf-js "^1.1.3" tildify@2.0.0: version "2.0.0" diff --git a/examples/node-app-pg-ts/package.json b/examples/node-app-pg-ts/package.json index 7634581a..37d092c0 100644 --- a/examples/node-app-pg-ts/package.json +++ b/examples/node-app-pg-ts/package.json @@ -15,7 +15,7 @@ "dependencies": { "@leapfrogtechnology/sync-db": "^2.0.0", "knex": "^3.3.0", - "pg": "^8.5.1", + "pg": "^8.23.1", "ts-node": "^10.9.2", "typescript": "^6.0.3" }, diff --git a/examples/node-app-pg-ts/yarn.lock b/examples/node-app-pg-ts/yarn.lock index d35398a5..56950002 100644 --- a/examples/node-app-pg-ts/yarn.lock +++ b/examples/node-app-pg-ts/yarn.lock @@ -754,7 +754,7 @@ pg-types@2.2.0: postgres-date "~1.0.4" postgres-interval "^1.1.0" -pg@^8.5.1: +pg@^8.23.1: version "8.23.1" resolved "https://registry.yarnpkg.com/pg/-/pg-8.23.1.tgz#e4848051a04aa2f968fd5671d075f89e5e7918b9" integrity sha512-aL96AHANtWjPLDOLqnhx+ngp9+UK7ETEU8VJrDCGvsSSi/mGLcWYsS6Herg7lmaBJe4uwrfqsa7gTEFaSizDoQ== From dc3a7e900c169e3485acd0288e258f2f8f81a41c Mon Sep 17 00:00:00 2001 From: Saugat Acharya Date: Mon, 12 Oct 2026 13:49:40 +0545 Subject: [PATCH 2/6] chore(examples): use postgres 18 and mssql 2022 in docker-compose Co-Authored-By: Claude Sonnet 5.5 --- examples/node-app-mssql-ts/docker-compose.yml | 4 ++-- examples/node-app-pg-ts/docker-compose.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/node-app-mssql-ts/docker-compose.yml b/examples/node-app-mssql-ts/docker-compose.yml index 3d05a708..101b0e0f 100644 --- a/examples/node-app-mssql-ts/docker-compose.yml +++ b/examples/node-app-mssql-ts/docker-compose.yml @@ -3,12 +3,12 @@ version: '3.3' services: mssql: container_name: 'example-mssql' - image: 'mcr.microsoft.com/mssql/server:2017-GA-ubuntu' + image: 'mcr.microsoft.com/mssql/server:2022-latest' ports: - '1433:1433' environment: ACCEPT_EULA: 'Y' - SA_PASSWORD: 'Secret@123' + MSSQL_SA_PASSWORD: 'Secret@123' app: container_name: 'example-app' diff --git a/examples/node-app-pg-ts/docker-compose.yml b/examples/node-app-pg-ts/docker-compose.yml index 5967e93d..db853373 100644 --- a/examples/node-app-pg-ts/docker-compose.yml +++ b/examples/node-app-pg-ts/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.3' services: db: - image: 'postgres:13-alpine' + image: 'postgres:18-alpine' container_name: 'example-pg' ports: - '5432:5432' From 0ef608a467528a7997dbd38a26f6f8bf69223514 Mon Sep 17 00:00:00 2001 From: Saugat Acharya Date: Mon, 12 Oct 2026 13:59:24 +0545 Subject: [PATCH 3/6] fix(examples): wait for the database to be healthy before starting the app Without a healthcheck, `docker compose up` started the app before the database accepted connections and failed with ECONNREFUSED. Co-Authored-By: Claude Sonnet 5.5 --- examples/node-app-mssql-ts/docker-compose.yml | 9 +++++++++ examples/node-app-pg-ts/docker-compose.yml | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/examples/node-app-mssql-ts/docker-compose.yml b/examples/node-app-mssql-ts/docker-compose.yml index 101b0e0f..f0b60ed2 100644 --- a/examples/node-app-mssql-ts/docker-compose.yml +++ b/examples/node-app-mssql-ts/docker-compose.yml @@ -9,9 +9,18 @@ services: environment: ACCEPT_EULA: 'Y' MSSQL_SA_PASSWORD: 'Secret@123' + healthcheck: + test: ['CMD', 'bash', '-c', 'exec 3<>/dev/tcp/localhost/1433'] + interval: 3s + timeout: 3s + retries: 40 + start_period: 10s app: container_name: 'example-app' environment: DEBUG: 'sync-db*' build: . + depends_on: + mssql: + condition: service_healthy diff --git a/examples/node-app-pg-ts/docker-compose.yml b/examples/node-app-pg-ts/docker-compose.yml index db853373..2f70f072 100644 --- a/examples/node-app-pg-ts/docker-compose.yml +++ b/examples/node-app-pg-ts/docker-compose.yml @@ -9,8 +9,16 @@ services: POSTGRES_DB: 'testdb' POSTGRES_USER: 'test' POSTGRES_PASSWORD: 'secret' + healthcheck: + test: ['CMD-SHELL', 'pg_isready -U test -d testdb'] + interval: 2s + timeout: 3s + retries: 30 app: container_name: 'example-app' build: . + depends_on: + db: + condition: service_healthy environment: DEBUG: 'sync-db*' From 79679e9ee3adaf8e853a6c3d915869861bb3df2e Mon Sep 17 00:00:00 2001 From: Saugat Acharya Date: Mon, 12 Oct 2026 20:47:56 +0545 Subject: [PATCH 4/6] ci: run the examples against sync-db built from source Pack the checked-out sync-db and install the tarball into each example, then run the CLI, programmatic and app steps against a real Postgres / SQL Server, so changes are verified without publishing. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/build-publish.yml | 64 +++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index ad30bbad..5404b4a9 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -54,3 +54,67 @@ jobs: files: ./lcov.info token: ${{ secrets.CODECOV_TOKEN }} verbose: true + + examples: + name: Example ${{ matrix.example }} (Node ${{ matrix.node-version }}) + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + node-version: [22, 24, 26] + example: + - node-app-pg-ts + - node-app-mssql-ts + include: + - example: node-app-pg-ts + service: db + - example: node-app-mssql-ts + service: mssql + + defaults: + run: + working-directory: examples/${{ matrix.example }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'yarn' + + # Build and pack sync-db from this checkout so the example runs against + # the unreleased code instead of the version published on npm. + - name: Pack sync-db from source + working-directory: . + run: | + yarn --frozen-lockfile + yarn pack --filename "$RUNNER_TEMP/sync-db.tgz" + + - name: Install example dependencies + run: | + yarn --frozen-lockfile + yarn add "$RUNNER_TEMP/sync-db.tgz" --no-lockfile + + - name: Start database + run: docker compose up -d --wait ${{ matrix.service }} + + - name: Configure connection + run: | + sed 's/"host": "${{ matrix.service }}"/"host": "localhost"/' connections.sync-db.json.example > connections.sync-db.json + + - name: Synchronize (CLI) + run: yarn sync-db synchronize + + - name: Synchronize (programmatic) + run: yarn synchronize:programmatic + + - name: Run app + run: yarn start + + - name: Stop database + if: always() + run: docker compose down From 8abc9cfd4367805bca4f39f86ef0ac88d63dbfba Mon Sep 17 00:00:00 2001 From: Saugat Acharya Date: Mon, 12 Oct 2026 20:50:05 +0545 Subject: [PATCH 5/6] ci: rename build-publish workflow to build-test There is no publish job anymore; releases are done manually. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/{build-publish.yml => build-test.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{build-publish.yml => build-test.yml} (99%) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-test.yml similarity index 99% rename from .github/workflows/build-publish.yml rename to .github/workflows/build-test.yml index 5404b4a9..78dad1ac 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-test.yml @@ -1,4 +1,4 @@ -name: Build and Publish +name: Build and Test on: push: From beb52f4d1c7b41ff1fff215e35a7054b5baa59ff Mon Sep 17 00:00:00 2001 From: Saugat Acharya Date: Mon, 12 Oct 2026 20:53:01 +0545 Subject: [PATCH 6/6] ci: update GitHub Actions to their latest major versions Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/build-test.yml | 10 +++++----- .github/workflows/codeql.yml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 78dad1ac..244d51c6 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -18,10 +18,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Set up Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 + uses: actions/setup-node@v7 with: node-version: ${{ matrix.node-version }} cache: 'yarn' @@ -47,7 +47,7 @@ jobs: run: yarn test:coverage - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v7 with: fail_ci_if_error: true directory: ./coverage @@ -78,10 +78,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Set up Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 + uses: actions/setup-node@v7 with: node-version: ${{ matrix.node-version }} cache: 'yarn' diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 52cb8fe3..f54cefef 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -25,15 +25,15 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v7 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v4 with: category: "/language:${{matrix.language}}"