From 0f80035bfea6532bfedd3a9fe4c8303fb83701e9 Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 11:22:07 +0300 Subject: [PATCH 01/17] chore(ci): integrate Verdaccio for integration tests --- .github/workflows/ci-supabase-js.yml | 132 ++++++++++++------ .../core/supabase-js/test/deno/package.json | 2 +- .../test/integration/bun/package.json | 2 +- .../test/integration/expo/package.json | 2 +- .../test/integration/next/package.json | 2 +- 5 files changed, 90 insertions(+), 50 deletions(-) diff --git a/.github/workflows/ci-supabase-js.yml b/.github/workflows/ci-supabase-js.yml index e35fe394e..d8bed0c1f 100644 --- a/.github/workflows/ci-supabase-js.yml +++ b/.github/workflows/ci-supabase-js.yml @@ -20,10 +20,8 @@ env: jobs: build-package: - name: Build supabase-js package + name: Build and publish to Verdaccio runs-on: ubuntu-latest - outputs: - tgz-name: ${{ steps.pack.outputs.filename }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -41,22 +39,26 @@ jobs: - uses: nrwl/nx-set-shas@v4 - - name: Build - run: npx nx build supabase-js + - name: Build all packages + run: npx nx run-many --target=build --all - - name: Pack npm module - id: pack + - name: Start Verdaccio run: | - cd packages/core/supabase-js - PKG=$(npm pack) - echo "filename=$PKG" >> "$GITHUB_OUTPUT" - cd ../../.. + npx verdaccio --config .verdaccio/config.yml & + sleep 5 + echo "Verdaccio started on http://localhost:4873" - - name: Upload .tgz package - uses: actions/upload-artifact@v4 - with: - name: supabase-tgz - path: packages/core/supabase-js/${{ steps.pack.outputs.filename }} + - name: Configure npm to use Verdaccio + run: npm set registry http://localhost:4873/ + + - name: Publish packages to Verdaccio + run: | + for pkg in auth-js functions-js postgrest-js realtime-js storage-js supabase-js; do + echo "Publishing @supabase/$pkg to Verdaccio..." + cd packages/core/$pkg + npm publish --registry http://localhost:4873 || echo "Failed to publish $pkg" + cd ../../.. + done - name: Upload UMD build uses: actions/upload-artifact@v4 @@ -147,11 +149,6 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} cache: 'npm' - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: supabase-tgz - path: ./packages/core/supabase-js/supabase-pkg - name: Start Supabase and apply migrations run: | @@ -174,14 +171,24 @@ jobs: npm ci --legacy-peer-deps npx nx build supabase-js + - name: Start Verdaccio and publish packages + run: | + npx verdaccio --config .verdaccio/config.yml & + sleep 5 + npm set registry http://localhost:4873/ + for pkg in auth-js functions-js postgrest-js realtime-js storage-js supabase-js; do + cd packages/core/$pkg + npm publish --registry http://localhost:4873 || echo "Failed to publish $pkg" + cd ../../.. + done + - name: Run Deno Tests if: ${{ matrix.deno == '1.x' }} env: STORAGE_JS_ENTRY: main run: | cd packages/core/supabase-js/test/deno - cp ../../supabase-pkg/supabase-supabase-js-0.0.0-automated.tgz . - npm install + npm install --registry http://localhost:4873 npm test || npm test cd ../../.. @@ -189,8 +196,7 @@ jobs: if: ${{ matrix.deno == '2.x' }} run: | cd packages/core/supabase-js/test/deno - cp ../../supabase-pkg/supabase-supabase-js-0.0.0-automated.tgz . - npm install + npm install --registry http://localhost:4873 npm test || npm test cd ../../.. @@ -286,17 +292,27 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: 'npm' - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: supabase-tgz - path: ./packages/core/supabase-js/supabase-pkg - - name: Setup Supabase CLI uses: supabase/setup-cli@v1 with: version: latest + - name: Install dependencies and build + run: | + npm ci --legacy-peer-deps + npx nx build supabase-js + + - name: Start Verdaccio and publish packages + run: | + npx verdaccio --config .verdaccio/config.yml & + sleep 5 + npm set registry http://localhost:4873/ + for pkg in auth-js functions-js postgrest-js realtime-js storage-js supabase-js; do + cd packages/core/$pkg + npm publish --registry http://localhost:4873 || echo "Failed to publish $pkg" + cd ../../.. + done + - name: Start Supabase and apply migrations run: | cd packages/core/supabase-js @@ -319,8 +335,7 @@ jobs: - name: Run integration tests run: | cd packages/core/supabase-js/test/integration/next - cp ../../../supabase-pkg/supabase-supabase-js-0.0.0-automated.tgz . - npm install --legacy-peer-deps + npm install --registry http://localhost:4873 --legacy-peer-deps npx playwright install npm run test @@ -352,11 +367,21 @@ jobs: with: version: latest - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: supabase-tgz - path: ./packages/core/supabase-js/supabase-pkg + - name: Install dependencies and build + run: | + npm ci --legacy-peer-deps + npx nx build supabase-js + + - name: Start Verdaccio and publish packages + run: | + npx verdaccio --config .verdaccio/config.yml & + sleep 5 + npm set registry http://localhost:4873/ + for pkg in auth-js functions-js postgrest-js realtime-js storage-js supabase-js; do + cd packages/core/$pkg + npm publish --registry http://localhost:4873 || echo "Failed to publish $pkg" + cd ../../.. + done - name: Start Supabase and apply migrations run: | @@ -377,8 +402,7 @@ jobs: - name: Install dependencies and run tests run: | cd packages/core/supabase-js/test/integration/expo - cp ../../../supabase-pkg/supabase-supabase-js-0.0.0-automated.tgz . - npm install + npm install --registry http://localhost:4873 npm test || npm test - name: Stop Supabase @@ -403,16 +427,32 @@ jobs: with: bun-version: latest + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + - name: Setup Supabase CLI uses: supabase/setup-cli@v1 with: version: latest - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: supabase-tgz - path: ./packages/core/supabase-js/supabase-pkg + - name: Install dependencies and build + run: | + npm ci --legacy-peer-deps + npx nx build supabase-js + + - name: Start Verdaccio and publish packages + run: | + npx verdaccio --config .verdaccio/config.yml & + sleep 5 + npm set registry http://localhost:4873/ + for pkg in auth-js functions-js postgrest-js realtime-js storage-js supabase-js; do + cd packages/core/$pkg + npm publish --registry http://localhost:4873 || echo "Failed to publish $pkg" + cd ../../.. + done - name: Start Supabase and apply migrations run: | @@ -433,7 +473,7 @@ jobs: - name: Install dependencies and run tests run: | cd packages/core/supabase-js/test/integration/bun - cp ../../../supabase-pkg/supabase-supabase-js-0.0.0-automated.tgz . + npm set registry http://localhost:4873/ bun install bun test diff --git a/packages/core/supabase-js/test/deno/package.json b/packages/core/supabase-js/test/deno/package.json index 0ed684bed..102cb44dd 100644 --- a/packages/core/supabase-js/test/deno/package.json +++ b/packages/core/supabase-js/test/deno/package.json @@ -7,6 +7,6 @@ "setup-deps": "node setup-deps.js" }, "dependencies": { - "@supabase/supabase-js": "file:supabase-supabase-js-0.0.0-automated.tgz" + "@supabase/supabase-js": "*" } } diff --git a/packages/core/supabase-js/test/integration/bun/package.json b/packages/core/supabase-js/test/integration/bun/package.json index 03a2714a4..4789c82fd 100644 --- a/packages/core/supabase-js/test/integration/bun/package.json +++ b/packages/core/supabase-js/test/integration/bun/package.json @@ -6,7 +6,7 @@ "test:watch": "bun test --watch integration.test.ts" }, "dependencies": { - "@supabase/supabase-js": "file:supabase-supabase-js-0.0.0-automated.tgz" + "@supabase/supabase-js": "*" }, "devDependencies": { "bun-types": "latest" diff --git a/packages/core/supabase-js/test/integration/expo/package.json b/packages/core/supabase-js/test/integration/expo/package.json index 43da41494..ce8da7291 100644 --- a/packages/core/supabase-js/test/integration/expo/package.json +++ b/packages/core/supabase-js/test/integration/expo/package.json @@ -16,7 +16,7 @@ "@react-navigation/bottom-tabs": "^7.3.10", "@react-navigation/elements": "^2.3.8", "@react-navigation/native": "^7.1.6", - "@supabase/supabase-js": "file:supabase-supabase-js-0.0.0-automated.tgz", + "@supabase/supabase-js": "*", "expo": "~53.0.9", "expo-blur": "~14.1.4", "expo-constants": "~17.1.6", diff --git a/packages/core/supabase-js/test/integration/next/package.json b/packages/core/supabase-js/test/integration/next/package.json index c041c5f60..02f46f779 100644 --- a/packages/core/supabase-js/test/integration/next/package.json +++ b/packages/core/supabase-js/test/integration/next/package.json @@ -17,7 +17,7 @@ "@radix-ui/react-label": "^2.1.6", "@radix-ui/react-slot": "^1.2.2", "@supabase/ssr": "latest", - "@supabase/supabase-js": "file:supabase-supabase-js-0.0.0-automated.tgz", + "@supabase/supabase-js": "*", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-react": "^0.511.0", From 05d9572e1c03e1a9e35a60540112c0cbc41ec093 Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 12:01:11 +0300 Subject: [PATCH 02/17] chore(ci): update some config --- .github/workflows/ci-supabase-js.yml | 50 ++++++++++++++++++++++------ project.json | 16 +++++++++ 2 files changed, 55 insertions(+), 11 deletions(-) create mode 100644 project.json diff --git a/.github/workflows/ci-supabase-js.yml b/.github/workflows/ci-supabase-js.yml index d8bed0c1f..ff8f8e9c7 100644 --- a/.github/workflows/ci-supabase-js.yml +++ b/.github/workflows/ci-supabase-js.yml @@ -45,18 +45,26 @@ jobs: - name: Start Verdaccio run: | npx verdaccio --config .verdaccio/config.yml & - sleep 5 - echo "Verdaccio started on http://localhost:4873" + VERDACCIO_PID=$! + echo "Verdaccio started with PID: $VERDACCIO_PID" + + - name: Wait for Verdaccio to be ready + run: | + echo "Waiting for Verdaccio to be ready..." + timeout 30 bash -c 'until curl -f http://localhost:4873 > /dev/null 2>&1; do sleep 1; done' + echo "✓ Verdaccio is ready!" - name: Configure npm to use Verdaccio run: npm set registry http://localhost:4873/ - name: Publish packages to Verdaccio run: | + set -e for pkg in auth-js functions-js postgrest-js realtime-js storage-js supabase-js; do echo "Publishing @supabase/$pkg to Verdaccio..." cd packages/core/$pkg - npm publish --registry http://localhost:4873 || echo "Failed to publish $pkg" + npm publish --registry http://localhost:4873 + echo "✓ Published @supabase/$pkg" cd ../../.. done @@ -173,12 +181,17 @@ jobs: - name: Start Verdaccio and publish packages run: | + set -e npx verdaccio --config .verdaccio/config.yml & - sleep 5 + echo "Waiting for Verdaccio to be ready..." + timeout 30 bash -c 'until curl -f http://localhost:4873 > /dev/null 2>&1; do sleep 1; done' + echo "✓ Verdaccio is ready!" npm set registry http://localhost:4873/ for pkg in auth-js functions-js postgrest-js realtime-js storage-js supabase-js; do + echo "Publishing @supabase/$pkg..." cd packages/core/$pkg - npm publish --registry http://localhost:4873 || echo "Failed to publish $pkg" + npm publish --registry http://localhost:4873 + echo "✓ Published @supabase/$pkg" cd ../../.. done @@ -304,12 +317,17 @@ jobs: - name: Start Verdaccio and publish packages run: | + set -e npx verdaccio --config .verdaccio/config.yml & - sleep 5 + echo "Waiting for Verdaccio to be ready..." + timeout 30 bash -c 'until curl -f http://localhost:4873 > /dev/null 2>&1; do sleep 1; done' + echo "✓ Verdaccio is ready!" npm set registry http://localhost:4873/ for pkg in auth-js functions-js postgrest-js realtime-js storage-js supabase-js; do + echo "Publishing @supabase/$pkg..." cd packages/core/$pkg - npm publish --registry http://localhost:4873 || echo "Failed to publish $pkg" + npm publish --registry http://localhost:4873 + echo "✓ Published @supabase/$pkg" cd ../../.. done @@ -374,12 +392,17 @@ jobs: - name: Start Verdaccio and publish packages run: | + set -e npx verdaccio --config .verdaccio/config.yml & - sleep 5 + echo "Waiting for Verdaccio to be ready..." + timeout 30 bash -c 'until curl -f http://localhost:4873 > /dev/null 2>&1; do sleep 1; done' + echo "✓ Verdaccio is ready!" npm set registry http://localhost:4873/ for pkg in auth-js functions-js postgrest-js realtime-js storage-js supabase-js; do + echo "Publishing @supabase/$pkg..." cd packages/core/$pkg - npm publish --registry http://localhost:4873 || echo "Failed to publish $pkg" + npm publish --registry http://localhost:4873 + echo "✓ Published @supabase/$pkg" cd ../../.. done @@ -445,12 +468,17 @@ jobs: - name: Start Verdaccio and publish packages run: | + set -e npx verdaccio --config .verdaccio/config.yml & - sleep 5 + echo "Waiting for Verdaccio to be ready..." + timeout 30 bash -c 'until curl -f http://localhost:4873 > /dev/null 2>&1; do sleep 1; done' + echo "✓ Verdaccio is ready!" npm set registry http://localhost:4873/ for pkg in auth-js functions-js postgrest-js realtime-js storage-js supabase-js; do + echo "Publishing @supabase/$pkg..." cd packages/core/$pkg - npm publish --registry http://localhost:4873 || echo "Failed to publish $pkg" + npm publish --registry http://localhost:4873 + echo "✓ Published @supabase/$pkg" cd ../../.. done diff --git a/project.json b/project.json new file mode 100644 index 000000000..fb34b00b3 --- /dev/null +++ b/project.json @@ -0,0 +1,16 @@ +{ + "name": "supabase-js-workspace", + "$schema": "node_modules/nx/schemas/project-schema.json", + "projectType": "library", + "targets": { + "local-registry": { + "executor": "@nx/js:verdaccio", + "options": { + "port": 4873, + "config": ".verdaccio/config.yml", + "storage": "tmp/local-registry/storage", + "clear": true + } + } + } +} From aa83dd3623beb5b6ae7a31bcc8fb33c564390d12 Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 12:51:21 +0300 Subject: [PATCH 03/17] chore(ci): more configurations to populate verdaccio once --- .github/workflows/ci-supabase-js.yml | 173 ++++++++++----------------- project.json | 9 +- scripts/populate-verdaccio.mjs | 116 ++++++++++++++++++ 3 files changed, 189 insertions(+), 109 deletions(-) create mode 100644 scripts/populate-verdaccio.mjs diff --git a/.github/workflows/ci-supabase-js.yml b/.github/workflows/ci-supabase-js.yml index ff8f8e9c7..1b7c564c7 100644 --- a/.github/workflows/ci-supabase-js.yml +++ b/.github/workflows/ci-supabase-js.yml @@ -20,7 +20,7 @@ env: jobs: build-package: - name: Build and publish to Verdaccio + name: Build all packages runs-on: ubuntu-latest steps: - name: Checkout code @@ -42,31 +42,17 @@ jobs: - name: Build all packages run: npx nx run-many --target=build --all - - name: Start Verdaccio - run: | - npx verdaccio --config .verdaccio/config.yml & - VERDACCIO_PID=$! - echo "Verdaccio started with PID: $VERDACCIO_PID" - - - name: Wait for Verdaccio to be ready - run: | - echo "Waiting for Verdaccio to be ready..." - timeout 30 bash -c 'until curl -f http://localhost:4873 > /dev/null 2>&1; do sleep 1; done' - echo "✓ Verdaccio is ready!" - - - name: Configure npm to use Verdaccio - run: npm set registry http://localhost:4873/ - - - name: Publish packages to Verdaccio - run: | - set -e - for pkg in auth-js functions-js postgrest-js realtime-js storage-js supabase-js; do - echo "Publishing @supabase/$pkg to Verdaccio..." - cd packages/core/$pkg - npm publish --registry http://localhost:4873 - echo "✓ Published @supabase/$pkg" - cd ../../.. - done + - name: Upload built packages + uses: actions/upload-artifact@v4 + with: + name: packages-dist + path: | + packages/core/auth-js/dist + packages/core/functions-js/dist + packages/core/postgrest-js/dist + packages/core/realtime-js/dist + packages/core/storage-js/dist + packages/core/supabase-js/dist - name: Upload UMD build uses: actions/upload-artifact@v4 @@ -131,6 +117,8 @@ jobs: name: Deno Tests / ${{ matrix.deno }} runs-on: ubuntu-latest needs: build-package + env: + npm_config_registry: http://localhost:4873 strategy: matrix: deno: ['1.x', '2.x'] @@ -158,6 +146,18 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: 'npm' + - name: Download built packages + uses: actions/download-artifact@v4 + with: + name: packages-dist + path: packages/core + + - name: Install dependencies + run: npm ci --legacy-peer-deps + + - name: Start Verdaccio and publish packages + run: npx nx populate-local-registry + - name: Start Supabase and apply migrations run: | cd packages/core/supabase-js @@ -174,34 +174,13 @@ jobs: echo "Verifying storage bucket exists" supabase db query "select id, name from storage.buckets where id = 'test-bucket';" - - name: Install dependencies and build - run: | - npm ci --legacy-peer-deps - npx nx build supabase-js - - - name: Start Verdaccio and publish packages - run: | - set -e - npx verdaccio --config .verdaccio/config.yml & - echo "Waiting for Verdaccio to be ready..." - timeout 30 bash -c 'until curl -f http://localhost:4873 > /dev/null 2>&1; do sleep 1; done' - echo "✓ Verdaccio is ready!" - npm set registry http://localhost:4873/ - for pkg in auth-js functions-js postgrest-js realtime-js storage-js supabase-js; do - echo "Publishing @supabase/$pkg..." - cd packages/core/$pkg - npm publish --registry http://localhost:4873 - echo "✓ Published @supabase/$pkg" - cd ../../.. - done - - name: Run Deno Tests if: ${{ matrix.deno == '1.x' }} env: STORAGE_JS_ENTRY: main run: | cd packages/core/supabase-js/test/deno - npm install --registry http://localhost:4873 + npm install npm test || npm test cd ../../.. @@ -209,7 +188,7 @@ jobs: if: ${{ matrix.deno == '2.x' }} run: | cd packages/core/supabase-js/test/deno - npm install --registry http://localhost:4873 + npm install npm test || npm test cd ../../.. @@ -292,6 +271,8 @@ jobs: name: Next.js Integration runs-on: ubuntu-latest needs: build-package + env: + npm_config_registry: http://localhost:4873 steps: - name: Checkout code uses: actions/checkout@v4 @@ -310,26 +291,17 @@ jobs: with: version: latest - - name: Install dependencies and build - run: | - npm ci --legacy-peer-deps - npx nx build supabase-js + - name: Download built packages + uses: actions/download-artifact@v4 + with: + name: packages-dist + path: packages/core + + - name: Install dependencies + run: npm ci --legacy-peer-deps - name: Start Verdaccio and publish packages - run: | - set -e - npx verdaccio --config .verdaccio/config.yml & - echo "Waiting for Verdaccio to be ready..." - timeout 30 bash -c 'until curl -f http://localhost:4873 > /dev/null 2>&1; do sleep 1; done' - echo "✓ Verdaccio is ready!" - npm set registry http://localhost:4873/ - for pkg in auth-js functions-js postgrest-js realtime-js storage-js supabase-js; do - echo "Publishing @supabase/$pkg..." - cd packages/core/$pkg - npm publish --registry http://localhost:4873 - echo "✓ Published @supabase/$pkg" - cd ../../.. - done + run: npx nx populate-local-registry - name: Start Supabase and apply migrations run: | @@ -353,7 +325,7 @@ jobs: - name: Run integration tests run: | cd packages/core/supabase-js/test/integration/next - npm install --registry http://localhost:4873 --legacy-peer-deps + npm install --legacy-peer-deps npx playwright install npm run test @@ -367,6 +339,8 @@ jobs: name: Expo Tests runs-on: ubuntu-latest needs: build-package + env: + npm_config_registry: http://localhost:4873 steps: - name: Checkout code uses: actions/checkout@v4 @@ -385,26 +359,17 @@ jobs: with: version: latest - - name: Install dependencies and build - run: | - npm ci --legacy-peer-deps - npx nx build supabase-js + - name: Download built packages + uses: actions/download-artifact@v4 + with: + name: packages-dist + path: packages/core + + - name: Install dependencies + run: npm ci --legacy-peer-deps - name: Start Verdaccio and publish packages - run: | - set -e - npx verdaccio --config .verdaccio/config.yml & - echo "Waiting for Verdaccio to be ready..." - timeout 30 bash -c 'until curl -f http://localhost:4873 > /dev/null 2>&1; do sleep 1; done' - echo "✓ Verdaccio is ready!" - npm set registry http://localhost:4873/ - for pkg in auth-js functions-js postgrest-js realtime-js storage-js supabase-js; do - echo "Publishing @supabase/$pkg..." - cd packages/core/$pkg - npm publish --registry http://localhost:4873 - echo "✓ Published @supabase/$pkg" - cd ../../.. - done + run: npx nx populate-local-registry - name: Start Supabase and apply migrations run: | @@ -422,11 +387,11 @@ jobs: echo "Verifying storage bucket exists" supabase db query "select id, name from storage.buckets where id = 'test-bucket';" - - name: Install dependencies and run tests + - name: Install test dependencies and run tests run: | cd packages/core/supabase-js/test/integration/expo - npm install --registry http://localhost:4873 - npm test || npm test + npm install + npm test - name: Stop Supabase if: always() @@ -438,6 +403,8 @@ jobs: name: Bun Integration runs-on: ubuntu-latest needs: build-package + env: + npm_config_registry: http://localhost:4873 steps: - name: Checkout code uses: actions/checkout@v4 @@ -461,26 +428,17 @@ jobs: with: version: latest - - name: Install dependencies and build - run: | - npm ci --legacy-peer-deps - npx nx build supabase-js + - name: Download built packages + uses: actions/download-artifact@v4 + with: + name: packages-dist + path: packages/core + + - name: Install dependencies + run: npm ci --legacy-peer-deps - name: Start Verdaccio and publish packages - run: | - set -e - npx verdaccio --config .verdaccio/config.yml & - echo "Waiting for Verdaccio to be ready..." - timeout 30 bash -c 'until curl -f http://localhost:4873 > /dev/null 2>&1; do sleep 1; done' - echo "✓ Verdaccio is ready!" - npm set registry http://localhost:4873/ - for pkg in auth-js functions-js postgrest-js realtime-js storage-js supabase-js; do - echo "Publishing @supabase/$pkg..." - cd packages/core/$pkg - npm publish --registry http://localhost:4873 - echo "✓ Published @supabase/$pkg" - cd ../../.. - done + run: npx nx populate-local-registry - name: Start Supabase and apply migrations run: | @@ -501,7 +459,6 @@ jobs: - name: Install dependencies and run tests run: | cd packages/core/supabase-js/test/integration/bun - npm set registry http://localhost:4873/ bun install bun test diff --git a/project.json b/project.json index fb34b00b3..6937e63a8 100644 --- a/project.json +++ b/project.json @@ -9,8 +9,15 @@ "port": 4873, "config": ".verdaccio/config.yml", "storage": "tmp/local-registry/storage", - "clear": true + "clear": false } + }, + "populate-local-registry": { + "executor": "nx:run-commands", + "options": { + "command": "node scripts/populate-verdaccio.mjs" + }, + "dependsOn": ["local-registry"] } } } diff --git a/scripts/populate-verdaccio.mjs b/scripts/populate-verdaccio.mjs new file mode 100644 index 000000000..3a620cda3 --- /dev/null +++ b/scripts/populate-verdaccio.mjs @@ -0,0 +1,116 @@ +#!/usr/bin/env node +/** + * Publishes pre-built packages to local Verdaccio registry for integration testing. + * + * This script: + * 1. Waits for Verdaccio to be ready + * 2. Publishes each pre-built package to the local registry + * 3. Fails fast on any error + * + * Note: Packages must be built before running this script. + */ + +import { exec } from 'node:child_process'; +import { promisify } from 'node:util'; + +const execAsync = promisify(exec); + +const VERDACCIO_PORT = process.env.VERDACCIO_PORT || '4873'; +const REGISTRY_URL = `http://localhost:${VERDACCIO_PORT}`; +const MAX_WAIT_TIME = 60000; // 60 seconds +const POLL_INTERVAL = 500; // 500ms + +// Packages to publish in dependency order +const PACKAGES = [ + 'auth-js', + 'postgrest-js', + 'realtime-js', + 'storage-js', + 'functions-js', + 'supabase-js', +]; + +/** + * Waits for Verdaccio to be ready by polling the health endpoint + */ +async function waitForVerdaccio() { + const startTime = Date.now(); + + while (Date.now() - startTime < MAX_WAIT_TIME) { + try { + const response = await fetch(REGISTRY_URL); + if (response.ok) { + console.log(`✓ Verdaccio is ready at ${REGISTRY_URL}`); + return; + } + } catch (error) { + // Verdaccio not ready yet, continue polling + } + + await new Promise(resolve => setTimeout(resolve, POLL_INTERVAL)); + } + + throw new Error(`Verdaccio failed to start within ${MAX_WAIT_TIME}ms at ${REGISTRY_URL}`); +} + +/** + * Publishes a single package to Verdaccio + */ +async function publishPackage(packageName) { + const packagePath = `packages/core/${packageName}`; + + console.log(` Publishing @supabase/${packageName}...`); + + try { + const { stdout } = await execAsync( + `npm publish --registry ${REGISTRY_URL} --access public`, + { + cwd: packagePath, + maxBuffer: 10 * 1024 * 1024, + env: { + ...process.env, + npm_config_registry: REGISTRY_URL, + }, + } + ); + + console.log(` ✓ @supabase/${packageName} published`); + } catch (error) { + console.error(` ✗ Failed to publish @supabase/${packageName}:`, error.message); + if (error.stdout) console.log(error.stdout); + if (error.stderr) console.error(error.stderr); + throw error; + } +} + +/** + * Publishes all packages to Verdaccio + */ +async function publishPackages() { + console.log(`\n📤 Publishing packages to ${REGISTRY_URL}...`); + + for (const pkg of PACKAGES) { + await publishPackage(pkg); + } + + console.log('\n✓ All packages published successfully'); +} + +/** + * Main execution + */ +async function main() { + try { + console.log('🚀 Publishing packages to Verdaccio...\n'); + + await waitForVerdaccio(); + await publishPackages(); + + console.log('\n✅ All packages published to Verdaccio successfully'); + } catch (error) { + console.error('\n❌ Failed to publish to Verdaccio:', error.message); + process.exit(1); + } +} + +main(); From c620f6aa219e9fc9cf9058de5e93cb5af3132ef8 Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 13:02:47 +0300 Subject: [PATCH 04/17] chore(ci): verdaccio registry at job level --- .github/workflows/ci-supabase-js.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-supabase-js.yml b/.github/workflows/ci-supabase-js.yml index 1b7c564c7..a4b8286a1 100644 --- a/.github/workflows/ci-supabase-js.yml +++ b/.github/workflows/ci-supabase-js.yml @@ -117,8 +117,6 @@ jobs: name: Deno Tests / ${{ matrix.deno }} runs-on: ubuntu-latest needs: build-package - env: - npm_config_registry: http://localhost:4873 strategy: matrix: deno: ['1.x', '2.x'] @@ -178,6 +176,7 @@ jobs: if: ${{ matrix.deno == '1.x' }} env: STORAGE_JS_ENTRY: main + npm_config_registry: http://localhost:4873 run: | cd packages/core/supabase-js/test/deno npm install @@ -186,6 +185,8 @@ jobs: - name: Run Deno Tests if: ${{ matrix.deno == '2.x' }} + env: + npm_config_registry: http://localhost:4873 run: | cd packages/core/supabase-js/test/deno npm install @@ -271,8 +272,6 @@ jobs: name: Next.js Integration runs-on: ubuntu-latest needs: build-package - env: - npm_config_registry: http://localhost:4873 steps: - name: Checkout code uses: actions/checkout@v4 @@ -323,6 +322,8 @@ jobs: run: npx playwright install --with-deps - name: Run integration tests + env: + npm_config_registry: http://localhost:4873 run: | cd packages/core/supabase-js/test/integration/next npm install --legacy-peer-deps @@ -339,8 +340,6 @@ jobs: name: Expo Tests runs-on: ubuntu-latest needs: build-package - env: - npm_config_registry: http://localhost:4873 steps: - name: Checkout code uses: actions/checkout@v4 @@ -388,6 +387,8 @@ jobs: supabase db query "select id, name from storage.buckets where id = 'test-bucket';" - name: Install test dependencies and run tests + env: + npm_config_registry: http://localhost:4873 run: | cd packages/core/supabase-js/test/integration/expo npm install @@ -403,8 +404,6 @@ jobs: name: Bun Integration runs-on: ubuntu-latest needs: build-package - env: - npm_config_registry: http://localhost:4873 steps: - name: Checkout code uses: actions/checkout@v4 @@ -457,6 +456,8 @@ jobs: supabase db query "select id, name from storage.buckets where id = 'test-bucket';" - name: Install dependencies and run tests + env: + npm_config_registry: http://localhost:4873 run: | cd packages/core/supabase-js/test/integration/bun bun install From 2046fa521101a5061bbe8003fec316687505303f Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 13:21:03 +0300 Subject: [PATCH 05/17] chore(ci): keep verdaccio available --- .github/workflows/ci-supabase-js.yml | 36 +++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-supabase-js.yml b/.github/workflows/ci-supabase-js.yml index a4b8286a1..9b68289d3 100644 --- a/.github/workflows/ci-supabase-js.yml +++ b/.github/workflows/ci-supabase-js.yml @@ -153,8 +153,13 @@ jobs: - name: Install dependencies run: npm ci --legacy-peer-deps - - name: Start Verdaccio and publish packages - run: npx nx populate-local-registry + - name: Start Verdaccio + run: | + npx verdaccio --config .verdaccio/config.yml & + sleep 3 + + - name: Publish packages to Verdaccio + run: node scripts/populate-verdaccio.mjs - name: Start Supabase and apply migrations run: | @@ -299,8 +304,13 @@ jobs: - name: Install dependencies run: npm ci --legacy-peer-deps - - name: Start Verdaccio and publish packages - run: npx nx populate-local-registry + - name: Start Verdaccio + run: | + npx verdaccio --config .verdaccio/config.yml & + sleep 3 + + - name: Publish packages to Verdaccio + run: node scripts/populate-verdaccio.mjs - name: Start Supabase and apply migrations run: | @@ -367,8 +377,13 @@ jobs: - name: Install dependencies run: npm ci --legacy-peer-deps - - name: Start Verdaccio and publish packages - run: npx nx populate-local-registry + - name: Start Verdaccio + run: | + npx verdaccio --config .verdaccio/config.yml & + sleep 3 + + - name: Publish packages to Verdaccio + run: node scripts/populate-verdaccio.mjs - name: Start Supabase and apply migrations run: | @@ -436,8 +451,13 @@ jobs: - name: Install dependencies run: npm ci --legacy-peer-deps - - name: Start Verdaccio and publish packages - run: npx nx populate-local-registry + - name: Start Verdaccio + run: | + npx verdaccio --config .verdaccio/config.yml & + sleep 3 + + - name: Publish packages to Verdaccio + run: node scripts/populate-verdaccio.mjs - name: Start Supabase and apply migrations run: | From 7835e9c3e6b9d8e68e7b89aeb21597bb1a10fa09 Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 14:16:21 +0300 Subject: [PATCH 06/17] chore(ci): fake authentication for verdaccio --- .github/workflows/ci-supabase-js.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci-supabase-js.yml b/.github/workflows/ci-supabase-js.yml index 9b68289d3..322fdac95 100644 --- a/.github/workflows/ci-supabase-js.yml +++ b/.github/workflows/ci-supabase-js.yml @@ -158,6 +158,9 @@ jobs: npx verdaccio --config .verdaccio/config.yml & sleep 3 + - name: Configure npm auth for Verdaccio + run: npm config set //localhost:4873/:_authToken "secretVerdaccioToken" + - name: Publish packages to Verdaccio run: node scripts/populate-verdaccio.mjs @@ -309,6 +312,9 @@ jobs: npx verdaccio --config .verdaccio/config.yml & sleep 3 + - name: Configure npm auth for Verdaccio + run: npm config set //localhost:4873/:_authToken "secretVerdaccioToken" + - name: Publish packages to Verdaccio run: node scripts/populate-verdaccio.mjs @@ -382,6 +388,9 @@ jobs: npx verdaccio --config .verdaccio/config.yml & sleep 3 + - name: Configure npm auth for Verdaccio + run: npm config set //localhost:4873/:_authToken "secretVerdaccioToken" + - name: Publish packages to Verdaccio run: node scripts/populate-verdaccio.mjs @@ -456,6 +465,9 @@ jobs: npx verdaccio --config .verdaccio/config.yml & sleep 3 + - name: Configure npm auth for Verdaccio + run: npm config set //localhost:4873/:_authToken "secretVerdaccioToken" + - name: Publish packages to Verdaccio run: node scripts/populate-verdaccio.mjs From c3a0d09312021cc5a92eb799a872e15170d81b4a Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 14:34:45 +0300 Subject: [PATCH 07/17] chore(ci): debug installation --- .github/workflows/ci-supabase-js.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/ci-supabase-js.yml b/.github/workflows/ci-supabase-js.yml index 322fdac95..bc918791e 100644 --- a/.github/workflows/ci-supabase-js.yml +++ b/.github/workflows/ci-supabase-js.yml @@ -180,11 +180,18 @@ jobs: echo "Verifying storage bucket exists" supabase db query "select id, name from storage.buckets where id = 'test-bucket';" + - name: Verify packages in Verdaccio + run: | + echo "Verifying @supabase/supabase-js is available in Verdaccio..." + npm view @supabase/supabase-js version --registry http://localhost:4873 + npm view @supabase/supabase-js --registry http://localhost:4873 | head -20 + - name: Run Deno Tests if: ${{ matrix.deno == '1.x' }} env: STORAGE_JS_ENTRY: main npm_config_registry: http://localhost:4873 + DENO_NPM_REGISTRY: http://localhost:4873 run: | cd packages/core/supabase-js/test/deno npm install @@ -195,6 +202,7 @@ jobs: if: ${{ matrix.deno == '2.x' }} env: npm_config_registry: http://localhost:4873 + DENO_NPM_REGISTRY: http://localhost:4873 run: | cd packages/core/supabase-js/test/deno npm install @@ -337,6 +345,12 @@ jobs: - name: Install Playwright browsers and dependencies run: npx playwright install --with-deps + - name: Verify packages in Verdaccio + run: | + echo "Verifying @supabase/supabase-js is available in Verdaccio..." + npm view @supabase/supabase-js version --registry http://localhost:4873 + npm view @supabase/supabase-js --registry http://localhost:4873 | head -20 + - name: Run integration tests env: npm_config_registry: http://localhost:4873 @@ -410,6 +424,12 @@ jobs: echo "Verifying storage bucket exists" supabase db query "select id, name from storage.buckets where id = 'test-bucket';" + - name: Verify packages in Verdaccio + run: | + echo "Verifying @supabase/supabase-js is available in Verdaccio..." + npm view @supabase/supabase-js version --registry http://localhost:4873 + npm view @supabase/supabase-js --registry http://localhost:4873 | head -20 + - name: Install test dependencies and run tests env: npm_config_registry: http://localhost:4873 @@ -487,6 +507,12 @@ jobs: echo "Verifying storage bucket exists" supabase db query "select id, name from storage.buckets where id = 'test-bucket';" + - name: Verify packages in Verdaccio + run: | + echo "Verifying @supabase/supabase-js is available in Verdaccio..." + npm view @supabase/supabase-js version --registry http://localhost:4873 + npm view @supabase/supabase-js --registry http://localhost:4873 | head -20 + - name: Install dependencies and run tests env: npm_config_registry: http://localhost:4873 From c9a52abc4a4a183845b050c42aac6695c1de7873 Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 14:53:52 +0300 Subject: [PATCH 08/17] chore(ci): bun registry --- .github/workflows/ci-supabase-js.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-supabase-js.yml b/.github/workflows/ci-supabase-js.yml index bc918791e..1fd54b3f7 100644 --- a/.github/workflows/ci-supabase-js.yml +++ b/.github/workflows/ci-supabase-js.yml @@ -516,6 +516,7 @@ jobs: - name: Install dependencies and run tests env: npm_config_registry: http://localhost:4873 + BUN_CONFIG_REGISTRY: http://localhost:4873 run: | cd packages/core/supabase-js/test/integration/bun bun install From 974a025ff8ecc94a5678eabf01aa74ec8dbd18ef Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 15:18:26 +0300 Subject: [PATCH 09/17] chore(ci): remove tslib again to verify tests break --- package-lock.json | 14 +++++--------- packages/core/auth-js/package.json | 3 +-- packages/core/functions-js/package.json | 3 +-- packages/core/postgrest-js/package.json | 3 +-- packages/core/realtime-js/package.json | 1 - packages/core/storage-js/package.json | 3 +-- 6 files changed, 9 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index ecf72da96..42027f8bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31783,6 +31783,7 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, "license": "0BSD" }, "node_modules/tsscmp": { @@ -34046,8 +34047,7 @@ "version": "0.0.0", "license": "MIT", "dependencies": { - "@supabase/node-fetch": "2.6.15", - "tslib": "2.8.1" + "@supabase/node-fetch": "2.6.15" }, "devDependencies": { "jest": "^28.1.3", @@ -35209,8 +35209,7 @@ "version": "0.0.0-automated", "license": "MIT", "dependencies": { - "@supabase/node-fetch": "2.6.15", - "tslib": "2.8.1" + "@supabase/node-fetch": "2.6.15" }, "devDependencies": { "@sebbo2002/semantic-release-jsr": "^1.0.0", @@ -35227,8 +35226,7 @@ "version": "0.0.0-automated", "license": "MIT", "dependencies": { - "@supabase/node-fetch": "2.6.15", - "tslib": "2.8.1" + "@supabase/node-fetch": "2.6.15" }, "devDependencies": { "chokidar-cli": "^3.0.0", @@ -36522,7 +36520,6 @@ "@supabase/node-fetch": "2.6.15", "@types/phoenix": "^1.6.6", "@types/ws": "^8.18.1", - "tslib": "2.8.1", "ws": "^8.18.2" }, "devDependencies": { @@ -36541,8 +36538,7 @@ "version": "0.0.0", "license": "MIT", "dependencies": { - "@supabase/node-fetch": "2.6.15", - "tslib": "2.8.1" + "@supabase/node-fetch": "2.6.15" }, "devDependencies": { "form-data": "^4.0.0", diff --git a/packages/core/auth-js/package.json b/packages/core/auth-js/package.json index 03c00b1f2..befffd426 100644 --- a/packages/core/auth-js/package.json +++ b/packages/core/auth-js/package.json @@ -40,8 +40,7 @@ "docs:json": "typedoc --json docs/v2/spec.json --excludeExternals --excludePrivate --excludeProtected src/index.ts" }, "dependencies": { - "@supabase/node-fetch": "2.6.15", - "tslib": "2.8.1" + "@supabase/node-fetch": "2.6.15" }, "devDependencies": { "jest": "^28.1.3", diff --git a/packages/core/functions-js/package.json b/packages/core/functions-js/package.json index fc4c0dc5b..1d2cb0cc2 100644 --- a/packages/core/functions-js/package.json +++ b/packages/core/functions-js/package.json @@ -37,8 +37,7 @@ }, "homepage": "https://github.com/supabase/supabase-js/tree/master/packages/core/functions-js", "dependencies": { - "@supabase/node-fetch": "2.6.15", - "tslib": "2.8.1" + "@supabase/node-fetch": "2.6.15" }, "devDependencies": { "@sebbo2002/semantic-release-jsr": "^1.0.0", diff --git a/packages/core/postgrest-js/package.json b/packages/core/postgrest-js/package.json index 40f70d899..64296ba3b 100644 --- a/packages/core/postgrest-js/package.json +++ b/packages/core/postgrest-js/package.json @@ -53,8 +53,7 @@ "db:generate-test-types": "cd test/db && docker compose up --detach && wait-for-localhost 8080 && wait-for-localhost 3000 && curl --location 'http://0.0.0.0:8080/generators/typescript?included_schemas=public,personal&detect_one_to_one_relationships=true' > ../types.generated.ts && node ../../scripts/update-json-type.js && cd ../../" }, "dependencies": { - "@supabase/node-fetch": "2.6.15", - "tslib": "2.8.1" + "@supabase/node-fetch": "2.6.15" }, "devDependencies": { "chokidar-cli": "^3.0.0", diff --git a/packages/core/realtime-js/package.json b/packages/core/realtime-js/package.json index ea320730c..c33f71e2e 100644 --- a/packages/core/realtime-js/package.json +++ b/packages/core/realtime-js/package.json @@ -45,7 +45,6 @@ "@supabase/node-fetch": "2.6.15", "@types/phoenix": "^1.6.6", "@types/ws": "^8.18.1", - "tslib": "2.8.1", "ws": "^8.18.2" }, "devDependencies": { diff --git a/packages/core/storage-js/package.json b/packages/core/storage-js/package.json index 2ea89da30..8ce3ee6a4 100644 --- a/packages/core/storage-js/package.json +++ b/packages/core/storage-js/package.json @@ -38,8 +38,7 @@ "docs:json": "typedoc --json docs/v2/spec.json --entryPoints src/index.ts --entryPoints src/packages/* --excludePrivate --excludeExternals --excludeProtected" }, "dependencies": { - "@supabase/node-fetch": "2.6.15", - "tslib": "2.8.1" + "@supabase/node-fetch": "2.6.15" }, "devDependencies": { "form-data": "^4.0.0", From c96d60ea6df346130c2d9b5e52dbe1f6b7d2e70a Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 15:34:48 +0300 Subject: [PATCH 10/17] chore(ci): verify registry --- .github/workflows/ci-supabase-js.yml | 19 ++++++++++--------- .../core/supabase-js/src/SupabaseClient.ts | 1 + 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-supabase-js.yml b/.github/workflows/ci-supabase-js.yml index 1fd54b3f7..619bf76a9 100644 --- a/.github/workflows/ci-supabase-js.yml +++ b/.github/workflows/ci-supabase-js.yml @@ -190,23 +190,25 @@ jobs: if: ${{ matrix.deno == '1.x' }} env: STORAGE_JS_ENTRY: main - npm_config_registry: http://localhost:4873 DENO_NPM_REGISTRY: http://localhost:4873 run: | cd packages/core/supabase-js/test/deno + echo "registry=http://localhost:4873/" > .npmrc npm install npm test || npm test + rm -f .npmrc cd ../../.. - name: Run Deno Tests if: ${{ matrix.deno == '2.x' }} env: - npm_config_registry: http://localhost:4873 DENO_NPM_REGISTRY: http://localhost:4873 run: | cd packages/core/supabase-js/test/deno + echo "registry=http://localhost:4873/" > .npmrc npm install npm test || npm test + rm -f .npmrc cd ../../.. - name: Run integration and browser tests on Deno 2.x only @@ -352,13 +354,13 @@ jobs: npm view @supabase/supabase-js --registry http://localhost:4873 | head -20 - name: Run integration tests - env: - npm_config_registry: http://localhost:4873 run: | cd packages/core/supabase-js/test/integration/next + echo "registry=http://localhost:4873/" > .npmrc npm install --legacy-peer-deps npx playwright install npm run test + rm -f .npmrc - name: Stop Supabase if: always() @@ -431,12 +433,12 @@ jobs: npm view @supabase/supabase-js --registry http://localhost:4873 | head -20 - name: Install test dependencies and run tests - env: - npm_config_registry: http://localhost:4873 run: | cd packages/core/supabase-js/test/integration/expo + echo "registry=http://localhost:4873/" > .npmrc npm install npm test + rm -f .npmrc - name: Stop Supabase if: always() @@ -514,13 +516,12 @@ jobs: npm view @supabase/supabase-js --registry http://localhost:4873 | head -20 - name: Install dependencies and run tests - env: - npm_config_registry: http://localhost:4873 - BUN_CONFIG_REGISTRY: http://localhost:4873 run: | cd packages/core/supabase-js/test/integration/bun + echo "registry=http://localhost:4873/" > .npmrc bun install bun test + rm -f .npmrc - name: Stop Supabase if: always() diff --git a/packages/core/supabase-js/src/SupabaseClient.ts b/packages/core/supabase-js/src/SupabaseClient.ts index 511d999c7..2a7c09f72 100644 --- a/packages/core/supabase-js/src/SupabaseClient.ts +++ b/packages/core/supabase-js/src/SupabaseClient.ts @@ -107,6 +107,7 @@ export default class SupabaseClient< protected supabaseKey: string, options?: SupabaseClientOptions ) { + console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio - if you see this, local packages are being used') const baseUrl = validateSupabaseUrl(supabaseUrl) if (!supabaseKey) throw new Error('supabaseKey is required.') From a45333a9aaa58a5ed69954bac49015eca2a7c447 Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 15:51:19 +0300 Subject: [PATCH 11/17] chore(ci): extra warns --- packages/core/functions-js/src/FunctionsClient.ts | 1 + packages/core/realtime-js/src/RealtimeClient.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/packages/core/functions-js/src/FunctionsClient.ts b/packages/core/functions-js/src/FunctionsClient.ts index 5781e8a19..f88bdd7ca 100644 --- a/packages/core/functions-js/src/FunctionsClient.ts +++ b/packages/core/functions-js/src/FunctionsClient.ts @@ -27,6 +27,7 @@ export class FunctionsClient { region?: FunctionRegion } = {} ) { + console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio (functions-js) - if you see this, local packages are being used') this.url = url this.headers = headers this.region = region diff --git a/packages/core/realtime-js/src/RealtimeClient.ts b/packages/core/realtime-js/src/RealtimeClient.ts index 86a70392f..7d0559936 100755 --- a/packages/core/realtime-js/src/RealtimeClient.ts +++ b/packages/core/realtime-js/src/RealtimeClient.ts @@ -236,6 +236,9 @@ export default class RealtimeClient { * @param reason A custom reason for the disconnect. */ disconnect(code?: number, reason?: string): void { + console.warn( + '🔴 VERDACCIO TEST REALTIME: This is the LOCAL BUILD from Verdaccio - if you see this, local packages are being used' + ) if (this.isDisconnecting()) { return } From 933509157abf35800735277b3a36b57e158aa976 Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 16:26:34 +0300 Subject: [PATCH 12/17] chore(ci): run tests in isolation --- .github/workflows/ci-supabase-js.yml | 37 +++++++++++++------ packages/core/auth-js/src/GoTrueClient.ts | 1 + .../core/postgrest-js/src/PostgrestClient.ts | 1 + .../core/realtime-js/src/RealtimeClient.ts | 1 + packages/core/storage-js/src/StorageClient.ts | 1 + 5 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-supabase-js.yml b/.github/workflows/ci-supabase-js.yml index 619bf76a9..52deac87b 100644 --- a/.github/workflows/ci-supabase-js.yml +++ b/.github/workflows/ci-supabase-js.yml @@ -186,30 +186,34 @@ jobs: npm view @supabase/supabase-js version --registry http://localhost:4873 npm view @supabase/supabase-js --registry http://localhost:4873 | head -20 - - name: Run Deno Tests + - name: Run Deno Tests in isolation (1.x) if: ${{ matrix.deno == '1.x' }} env: STORAGE_JS_ENTRY: main DENO_NPM_REGISTRY: http://localhost:4873 run: | - cd packages/core/supabase-js/test/deno + TEST_DIR="/tmp/test-deno-1x-${{ github.run_id }}" + mkdir -p "$TEST_DIR" + cp -r packages/core/supabase-js/test/deno/* "$TEST_DIR/" + cd "$TEST_DIR" echo "registry=http://localhost:4873/" > .npmrc npm install npm test || npm test rm -f .npmrc - cd ../../.. - - name: Run Deno Tests + - name: Run Deno Tests in isolation (2.x) if: ${{ matrix.deno == '2.x' }} env: DENO_NPM_REGISTRY: http://localhost:4873 run: | - cd packages/core/supabase-js/test/deno + TEST_DIR="/tmp/test-deno-2x-${{ github.run_id }}" + mkdir -p "$TEST_DIR" + cp -r packages/core/supabase-js/test/deno/* "$TEST_DIR/" + cd "$TEST_DIR" echo "registry=http://localhost:4873/" > .npmrc npm install npm test || npm test rm -f .npmrc - cd ../../.. - name: Run integration and browser tests on Deno 2.x only if: ${{ matrix.deno == '2.x' }} @@ -353,9 +357,12 @@ jobs: npm view @supabase/supabase-js version --registry http://localhost:4873 npm view @supabase/supabase-js --registry http://localhost:4873 | head -20 - - name: Run integration tests + - name: Run integration tests in isolation run: | - cd packages/core/supabase-js/test/integration/next + TEST_DIR="/tmp/test-next-${{ github.run_id }}" + mkdir -p "$TEST_DIR" + cp -r packages/core/supabase-js/test/integration/next/* "$TEST_DIR/" + cd "$TEST_DIR" echo "registry=http://localhost:4873/" > .npmrc npm install --legacy-peer-deps npx playwright install @@ -432,9 +439,12 @@ jobs: npm view @supabase/supabase-js version --registry http://localhost:4873 npm view @supabase/supabase-js --registry http://localhost:4873 | head -20 - - name: Install test dependencies and run tests + - name: Install test dependencies and run tests in isolation run: | - cd packages/core/supabase-js/test/integration/expo + TEST_DIR="/tmp/test-expo-${{ github.run_id }}" + mkdir -p "$TEST_DIR" + cp -r packages/core/supabase-js/test/integration/expo/* "$TEST_DIR/" + cd "$TEST_DIR" echo "registry=http://localhost:4873/" > .npmrc npm install npm test @@ -515,9 +525,12 @@ jobs: npm view @supabase/supabase-js version --registry http://localhost:4873 npm view @supabase/supabase-js --registry http://localhost:4873 | head -20 - - name: Install dependencies and run tests + - name: Install dependencies and run tests in isolation run: | - cd packages/core/supabase-js/test/integration/bun + TEST_DIR="/tmp/test-bun-${{ github.run_id }}" + mkdir -p "$TEST_DIR" + cp -r packages/core/supabase-js/test/integration/bun/* "$TEST_DIR/" + cd "$TEST_DIR" echo "registry=http://localhost:4873/" > .npmrc bun install bun test diff --git a/packages/core/auth-js/src/GoTrueClient.ts b/packages/core/auth-js/src/GoTrueClient.ts index 341d35ce0..3ebdacac0 100644 --- a/packages/core/auth-js/src/GoTrueClient.ts +++ b/packages/core/auth-js/src/GoTrueClient.ts @@ -265,6 +265,7 @@ export default class GoTrueClient { * Create a new client for use in the browser. */ constructor(options: GoTrueClientOptions) { + console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio (auth-js) - if you see this, local packages are being used') this.instanceID = GoTrueClient.nextInstanceID GoTrueClient.nextInstanceID += 1 diff --git a/packages/core/postgrest-js/src/PostgrestClient.ts b/packages/core/postgrest-js/src/PostgrestClient.ts index a743c65e8..3d0a3770d 100644 --- a/packages/core/postgrest-js/src/PostgrestClient.ts +++ b/packages/core/postgrest-js/src/PostgrestClient.ts @@ -61,6 +61,7 @@ export default class PostgrestClient< fetch?: Fetch } = {} ) { + console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio (postgrest-js) - if you see this, local packages are being used') this.url = url this.headers = new Headers(headers) this.schemaName = schema diff --git a/packages/core/realtime-js/src/RealtimeClient.ts b/packages/core/realtime-js/src/RealtimeClient.ts index 7d0559936..67c5f4ff9 100755 --- a/packages/core/realtime-js/src/RealtimeClient.ts +++ b/packages/core/realtime-js/src/RealtimeClient.ts @@ -157,6 +157,7 @@ export default class RealtimeClient { * @param options.workerUrl The URL of the worker script. Defaults to https://realtime.supabase.com/worker.js that includes a heartbeat event call to keep the connection alive. */ constructor(endPoint: string, options?: RealtimeClientOptions) { + console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio (realtime-js) - if you see this, local packages are being used') // Validate required parameters if (!options?.params?.apikey) { throw new Error('API key is required to connect to Realtime') diff --git a/packages/core/storage-js/src/StorageClient.ts b/packages/core/storage-js/src/StorageClient.ts index 25da7fc07..a67aea50e 100644 --- a/packages/core/storage-js/src/StorageClient.ts +++ b/packages/core/storage-js/src/StorageClient.ts @@ -16,6 +16,7 @@ export class StorageClient extends StorageBucketApi { opts?: StorageClientOptions ) { super(url, headers, fetch, opts) + console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio (storage-js) - if you see this, local packages are being used') } /** From f120996aab69840b48a6477786ae0e660240d362 Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 16:39:03 +0300 Subject: [PATCH 13/17] Revert "chore(ci): remove tslib again to verify tests break" This reverts commit 974a025ff8ecc94a5678eabf01aa74ec8dbd18ef. --- package-lock.json | 14 +++++++++----- packages/core/auth-js/package.json | 3 ++- packages/core/functions-js/package.json | 3 ++- packages/core/postgrest-js/package.json | 3 ++- packages/core/realtime-js/package.json | 1 + packages/core/storage-js/package.json | 3 ++- 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 42027f8bb..ecf72da96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31783,7 +31783,6 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "dev": true, "license": "0BSD" }, "node_modules/tsscmp": { @@ -34047,7 +34046,8 @@ "version": "0.0.0", "license": "MIT", "dependencies": { - "@supabase/node-fetch": "2.6.15" + "@supabase/node-fetch": "2.6.15", + "tslib": "2.8.1" }, "devDependencies": { "jest": "^28.1.3", @@ -35209,7 +35209,8 @@ "version": "0.0.0-automated", "license": "MIT", "dependencies": { - "@supabase/node-fetch": "2.6.15" + "@supabase/node-fetch": "2.6.15", + "tslib": "2.8.1" }, "devDependencies": { "@sebbo2002/semantic-release-jsr": "^1.0.0", @@ -35226,7 +35227,8 @@ "version": "0.0.0-automated", "license": "MIT", "dependencies": { - "@supabase/node-fetch": "2.6.15" + "@supabase/node-fetch": "2.6.15", + "tslib": "2.8.1" }, "devDependencies": { "chokidar-cli": "^3.0.0", @@ -36520,6 +36522,7 @@ "@supabase/node-fetch": "2.6.15", "@types/phoenix": "^1.6.6", "@types/ws": "^8.18.1", + "tslib": "2.8.1", "ws": "^8.18.2" }, "devDependencies": { @@ -36538,7 +36541,8 @@ "version": "0.0.0", "license": "MIT", "dependencies": { - "@supabase/node-fetch": "2.6.15" + "@supabase/node-fetch": "2.6.15", + "tslib": "2.8.1" }, "devDependencies": { "form-data": "^4.0.0", diff --git a/packages/core/auth-js/package.json b/packages/core/auth-js/package.json index befffd426..03c00b1f2 100644 --- a/packages/core/auth-js/package.json +++ b/packages/core/auth-js/package.json @@ -40,7 +40,8 @@ "docs:json": "typedoc --json docs/v2/spec.json --excludeExternals --excludePrivate --excludeProtected src/index.ts" }, "dependencies": { - "@supabase/node-fetch": "2.6.15" + "@supabase/node-fetch": "2.6.15", + "tslib": "2.8.1" }, "devDependencies": { "jest": "^28.1.3", diff --git a/packages/core/functions-js/package.json b/packages/core/functions-js/package.json index 1d2cb0cc2..fc4c0dc5b 100644 --- a/packages/core/functions-js/package.json +++ b/packages/core/functions-js/package.json @@ -37,7 +37,8 @@ }, "homepage": "https://github.com/supabase/supabase-js/tree/master/packages/core/functions-js", "dependencies": { - "@supabase/node-fetch": "2.6.15" + "@supabase/node-fetch": "2.6.15", + "tslib": "2.8.1" }, "devDependencies": { "@sebbo2002/semantic-release-jsr": "^1.0.0", diff --git a/packages/core/postgrest-js/package.json b/packages/core/postgrest-js/package.json index 64296ba3b..40f70d899 100644 --- a/packages/core/postgrest-js/package.json +++ b/packages/core/postgrest-js/package.json @@ -53,7 +53,8 @@ "db:generate-test-types": "cd test/db && docker compose up --detach && wait-for-localhost 8080 && wait-for-localhost 3000 && curl --location 'http://0.0.0.0:8080/generators/typescript?included_schemas=public,personal&detect_one_to_one_relationships=true' > ../types.generated.ts && node ../../scripts/update-json-type.js && cd ../../" }, "dependencies": { - "@supabase/node-fetch": "2.6.15" + "@supabase/node-fetch": "2.6.15", + "tslib": "2.8.1" }, "devDependencies": { "chokidar-cli": "^3.0.0", diff --git a/packages/core/realtime-js/package.json b/packages/core/realtime-js/package.json index c33f71e2e..ea320730c 100644 --- a/packages/core/realtime-js/package.json +++ b/packages/core/realtime-js/package.json @@ -45,6 +45,7 @@ "@supabase/node-fetch": "2.6.15", "@types/phoenix": "^1.6.6", "@types/ws": "^8.18.1", + "tslib": "2.8.1", "ws": "^8.18.2" }, "devDependencies": { diff --git a/packages/core/storage-js/package.json b/packages/core/storage-js/package.json index 8ce3ee6a4..2ea89da30 100644 --- a/packages/core/storage-js/package.json +++ b/packages/core/storage-js/package.json @@ -38,7 +38,8 @@ "docs:json": "typedoc --json docs/v2/spec.json --entryPoints src/index.ts --entryPoints src/packages/* --excludePrivate --excludeExternals --excludeProtected" }, "dependencies": { - "@supabase/node-fetch": "2.6.15" + "@supabase/node-fetch": "2.6.15", + "tslib": "2.8.1" }, "devDependencies": { "form-data": "^4.0.0", From c129ebb17a45a7fdca0aded1bf38fb8e0a1f8deb Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 16:40:39 +0300 Subject: [PATCH 14/17] chore(ci): remove logs --- packages/core/auth-js/src/GoTrueClient.ts | 1 - packages/core/functions-js/src/FunctionsClient.ts | 1 - packages/core/postgrest-js/src/PostgrestClient.ts | 1 - packages/core/realtime-js/src/RealtimeClient.ts | 4 ---- packages/core/storage-js/src/StorageClient.ts | 1 - packages/core/supabase-js/src/SupabaseClient.ts | 1 - 6 files changed, 9 deletions(-) diff --git a/packages/core/auth-js/src/GoTrueClient.ts b/packages/core/auth-js/src/GoTrueClient.ts index 3ebdacac0..341d35ce0 100644 --- a/packages/core/auth-js/src/GoTrueClient.ts +++ b/packages/core/auth-js/src/GoTrueClient.ts @@ -265,7 +265,6 @@ export default class GoTrueClient { * Create a new client for use in the browser. */ constructor(options: GoTrueClientOptions) { - console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio (auth-js) - if you see this, local packages are being used') this.instanceID = GoTrueClient.nextInstanceID GoTrueClient.nextInstanceID += 1 diff --git a/packages/core/functions-js/src/FunctionsClient.ts b/packages/core/functions-js/src/FunctionsClient.ts index f88bdd7ca..5781e8a19 100644 --- a/packages/core/functions-js/src/FunctionsClient.ts +++ b/packages/core/functions-js/src/FunctionsClient.ts @@ -27,7 +27,6 @@ export class FunctionsClient { region?: FunctionRegion } = {} ) { - console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio (functions-js) - if you see this, local packages are being used') this.url = url this.headers = headers this.region = region diff --git a/packages/core/postgrest-js/src/PostgrestClient.ts b/packages/core/postgrest-js/src/PostgrestClient.ts index 3d0a3770d..a743c65e8 100644 --- a/packages/core/postgrest-js/src/PostgrestClient.ts +++ b/packages/core/postgrest-js/src/PostgrestClient.ts @@ -61,7 +61,6 @@ export default class PostgrestClient< fetch?: Fetch } = {} ) { - console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio (postgrest-js) - if you see this, local packages are being used') this.url = url this.headers = new Headers(headers) this.schemaName = schema diff --git a/packages/core/realtime-js/src/RealtimeClient.ts b/packages/core/realtime-js/src/RealtimeClient.ts index 67c5f4ff9..86a70392f 100755 --- a/packages/core/realtime-js/src/RealtimeClient.ts +++ b/packages/core/realtime-js/src/RealtimeClient.ts @@ -157,7 +157,6 @@ export default class RealtimeClient { * @param options.workerUrl The URL of the worker script. Defaults to https://realtime.supabase.com/worker.js that includes a heartbeat event call to keep the connection alive. */ constructor(endPoint: string, options?: RealtimeClientOptions) { - console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio (realtime-js) - if you see this, local packages are being used') // Validate required parameters if (!options?.params?.apikey) { throw new Error('API key is required to connect to Realtime') @@ -237,9 +236,6 @@ export default class RealtimeClient { * @param reason A custom reason for the disconnect. */ disconnect(code?: number, reason?: string): void { - console.warn( - '🔴 VERDACCIO TEST REALTIME: This is the LOCAL BUILD from Verdaccio - if you see this, local packages are being used' - ) if (this.isDisconnecting()) { return } diff --git a/packages/core/storage-js/src/StorageClient.ts b/packages/core/storage-js/src/StorageClient.ts index a67aea50e..25da7fc07 100644 --- a/packages/core/storage-js/src/StorageClient.ts +++ b/packages/core/storage-js/src/StorageClient.ts @@ -16,7 +16,6 @@ export class StorageClient extends StorageBucketApi { opts?: StorageClientOptions ) { super(url, headers, fetch, opts) - console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio (storage-js) - if you see this, local packages are being used') } /** diff --git a/packages/core/supabase-js/src/SupabaseClient.ts b/packages/core/supabase-js/src/SupabaseClient.ts index 2a7c09f72..511d999c7 100644 --- a/packages/core/supabase-js/src/SupabaseClient.ts +++ b/packages/core/supabase-js/src/SupabaseClient.ts @@ -107,7 +107,6 @@ export default class SupabaseClient< protected supabaseKey: string, options?: SupabaseClientOptions ) { - console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio - if you see this, local packages are being used') const baseUrl = validateSupabaseUrl(supabaseUrl) if (!supabaseKey) throw new Error('supabaseKey is required.') From 6bb676f241e099fec7017cbaa7acd945370f5aa6 Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 17:23:49 +0300 Subject: [PATCH 15/17] chore(ci): update deno setup deps --- .github/workflows/ci-supabase-js.yml | 14 ++++++++++++-- .../core/supabase-js/test/deno/setup-deps.js | 16 +++++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-supabase-js.yml b/.github/workflows/ci-supabase-js.yml index 52deac87b..ff93b96e1 100644 --- a/.github/workflows/ci-supabase-js.yml +++ b/.github/workflows/ci-supabase-js.yml @@ -192,9 +192,14 @@ jobs: STORAGE_JS_ENTRY: main DENO_NPM_REGISTRY: http://localhost:4873 run: | + # Pre-generate deno.json in workspace first + cd packages/core/supabase-js/test/deno + node setup-deps.js + + # Then copy to isolated directory TEST_DIR="/tmp/test-deno-1x-${{ github.run_id }}" mkdir -p "$TEST_DIR" - cp -r packages/core/supabase-js/test/deno/* "$TEST_DIR/" + cp -r * "$TEST_DIR/" cd "$TEST_DIR" echo "registry=http://localhost:4873/" > .npmrc npm install @@ -206,9 +211,14 @@ jobs: env: DENO_NPM_REGISTRY: http://localhost:4873 run: | + # Pre-generate deno.json in workspace first + cd packages/core/supabase-js/test/deno + node setup-deps.js + + # Then copy to isolated directory TEST_DIR="/tmp/test-deno-2x-${{ github.run_id }}" mkdir -p "$TEST_DIR" - cp -r packages/core/supabase-js/test/deno/* "$TEST_DIR/" + cp -r * "$TEST_DIR/" cd "$TEST_DIR" echo "registry=http://localhost:4873/" > .npmrc npm install diff --git a/packages/core/supabase-js/test/deno/setup-deps.js b/packages/core/supabase-js/test/deno/setup-deps.js index d8f1a436b..80d652d71 100755 --- a/packages/core/supabase-js/test/deno/setup-deps.js +++ b/packages/core/supabase-js/test/deno/setup-deps.js @@ -5,6 +5,21 @@ const path = require('node:path') // Get the directory of the script const scriptDir = __dirname + +// Check if deno.json already exists with valid imports (early exit for pre-generated case) +const denoJsonPath = path.join(scriptDir, 'deno.json') +if (fs.existsSync(denoJsonPath)) { + try { + const existing = JSON.parse(fs.readFileSync(denoJsonPath, 'utf8')) + if (existing.imports && Object.keys(existing.imports).length > 0) { + console.log('deno.json already exists with imports, skipping setup') + process.exit(0) + } + } catch (error) { + console.warn('Warning: Could not read existing deno.json, will regenerate') + } +} + const projectRoot = path.dirname(path.dirname(scriptDir)) // Read package.json from main project @@ -30,7 +45,6 @@ const versions = { } // Read or create deno.json -const denoJsonPath = path.join(scriptDir, 'deno.json') let denoJson = { lock: false, imports: {}, From c896e408fdf8d442882190f12ebc9ed3ee21fcd0 Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 17:33:25 +0300 Subject: [PATCH 16/17] Revert "chore(ci): update deno setup deps" This reverts commit 6bb676f241e099fec7017cbaa7acd945370f5aa6. --- .github/workflows/ci-supabase-js.yml | 14 ++------------ .../core/supabase-js/test/deno/setup-deps.js | 16 +--------------- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci-supabase-js.yml b/.github/workflows/ci-supabase-js.yml index ff93b96e1..52deac87b 100644 --- a/.github/workflows/ci-supabase-js.yml +++ b/.github/workflows/ci-supabase-js.yml @@ -192,14 +192,9 @@ jobs: STORAGE_JS_ENTRY: main DENO_NPM_REGISTRY: http://localhost:4873 run: | - # Pre-generate deno.json in workspace first - cd packages/core/supabase-js/test/deno - node setup-deps.js - - # Then copy to isolated directory TEST_DIR="/tmp/test-deno-1x-${{ github.run_id }}" mkdir -p "$TEST_DIR" - cp -r * "$TEST_DIR/" + cp -r packages/core/supabase-js/test/deno/* "$TEST_DIR/" cd "$TEST_DIR" echo "registry=http://localhost:4873/" > .npmrc npm install @@ -211,14 +206,9 @@ jobs: env: DENO_NPM_REGISTRY: http://localhost:4873 run: | - # Pre-generate deno.json in workspace first - cd packages/core/supabase-js/test/deno - node setup-deps.js - - # Then copy to isolated directory TEST_DIR="/tmp/test-deno-2x-${{ github.run_id }}" mkdir -p "$TEST_DIR" - cp -r * "$TEST_DIR/" + cp -r packages/core/supabase-js/test/deno/* "$TEST_DIR/" cd "$TEST_DIR" echo "registry=http://localhost:4873/" > .npmrc npm install diff --git a/packages/core/supabase-js/test/deno/setup-deps.js b/packages/core/supabase-js/test/deno/setup-deps.js index 80d652d71..d8f1a436b 100755 --- a/packages/core/supabase-js/test/deno/setup-deps.js +++ b/packages/core/supabase-js/test/deno/setup-deps.js @@ -5,21 +5,6 @@ const path = require('node:path') // Get the directory of the script const scriptDir = __dirname - -// Check if deno.json already exists with valid imports (early exit for pre-generated case) -const denoJsonPath = path.join(scriptDir, 'deno.json') -if (fs.existsSync(denoJsonPath)) { - try { - const existing = JSON.parse(fs.readFileSync(denoJsonPath, 'utf8')) - if (existing.imports && Object.keys(existing.imports).length > 0) { - console.log('deno.json already exists with imports, skipping setup') - process.exit(0) - } - } catch (error) { - console.warn('Warning: Could not read existing deno.json, will regenerate') - } -} - const projectRoot = path.dirname(path.dirname(scriptDir)) // Read package.json from main project @@ -45,6 +30,7 @@ const versions = { } // Read or create deno.json +const denoJsonPath = path.join(scriptDir, 'deno.json') let denoJson = { lock: false, imports: {}, From 2afd73f8137f10e2dbd5a3f4db0344df1f627060 Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Tue, 21 Oct 2025 17:35:45 +0300 Subject: [PATCH 17/17] chore(ci): do not run deno in isolation --- .github/workflows/ci-supabase-js.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-supabase-js.yml b/.github/workflows/ci-supabase-js.yml index 52deac87b..309a59f32 100644 --- a/.github/workflows/ci-supabase-js.yml +++ b/.github/workflows/ci-supabase-js.yml @@ -186,34 +186,30 @@ jobs: npm view @supabase/supabase-js version --registry http://localhost:4873 npm view @supabase/supabase-js --registry http://localhost:4873 | head -20 - - name: Run Deno Tests in isolation (1.x) + - name: Run Deno Tests (1.x) if: ${{ matrix.deno == '1.x' }} env: STORAGE_JS_ENTRY: main DENO_NPM_REGISTRY: http://localhost:4873 run: | - TEST_DIR="/tmp/test-deno-1x-${{ github.run_id }}" - mkdir -p "$TEST_DIR" - cp -r packages/core/supabase-js/test/deno/* "$TEST_DIR/" - cd "$TEST_DIR" + cd packages/core/supabase-js/test/deno echo "registry=http://localhost:4873/" > .npmrc npm install npm test || npm test rm -f .npmrc + cd ../../.. - - name: Run Deno Tests in isolation (2.x) + - name: Run Deno Tests (2.x) if: ${{ matrix.deno == '2.x' }} env: DENO_NPM_REGISTRY: http://localhost:4873 run: | - TEST_DIR="/tmp/test-deno-2x-${{ github.run_id }}" - mkdir -p "$TEST_DIR" - cp -r packages/core/supabase-js/test/deno/* "$TEST_DIR/" - cd "$TEST_DIR" + cd packages/core/supabase-js/test/deno echo "registry=http://localhost:4873/" > .npmrc npm install npm test || npm test rm -f .npmrc + cd ../../.. - name: Run integration and browser tests on Deno 2.x only if: ${{ matrix.deno == '2.x' }}