From 0f499508bb791c6d94cb879feb12bf1fe4897bdb Mon Sep 17 00:00:00 2001 From: Katerina Skroumpelou Date: Fri, 21 Nov 2025 15:29:57 +0200 Subject: [PATCH] feat: release for all compatible envs --- .github/workflows/ci.yml | 21 ++++++ .github/workflows/compatibility.yml | 37 +++++++++++ .github/workflows/integration-test.yml | 7 +- .github/workflows/preview-release.yml | 2 +- .github/workflows/test.yml | 7 +- .gitignore | 4 ++ CHANGELOG.md | 5 +- README.md | 39 +++++++++++ eslint.config.ts | 2 +- package.json | 13 +++- test-compatibility/README.md | 38 +++++++++++ test-compatibility/cjs-project/index.js | 19 ++++++ test-compatibility/cjs-project/package.json | 11 ++++ test-compatibility/esm-project/index.js | 19 ++++++ test-compatibility/esm-project/package.json | 12 ++++ test-compatibility/run-all.sh | 64 +++++++++++++++++++ test-compatibility/ts-cjs-project/index.ts | 21 ++++++ .../ts-cjs-project/package.json | 15 +++++ .../ts-cjs-project/tsconfig.json | 11 ++++ test-compatibility/ts-esm-project/index.ts | 21 ++++++ .../ts-esm-project/package.json | 16 +++++ .../ts-esm-project/tsconfig.json | 11 ++++ test/catalog/tables.test.ts | 8 +-- tsup.config.ts | 5 ++ 24 files changed, 386 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/compatibility.yml create mode 100644 test-compatibility/README.md create mode 100644 test-compatibility/cjs-project/index.js create mode 100644 test-compatibility/cjs-project/package.json create mode 100644 test-compatibility/esm-project/index.js create mode 100644 test-compatibility/esm-project/package.json create mode 100755 test-compatibility/run-all.sh create mode 100644 test-compatibility/ts-cjs-project/index.ts create mode 100644 test-compatibility/ts-cjs-project/package.json create mode 100644 test-compatibility/ts-cjs-project/tsconfig.json create mode 100644 test-compatibility/ts-esm-project/index.ts create mode 100644 test-compatibility/ts-esm-project/package.json create mode 100644 test-compatibility/ts-esm-project/tsconfig.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c619e26 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + types: [opened, synchronize, reopened] + +jobs: + test: + name: Run Tests + uses: ./.github/workflows/test.yml + + integration-test: + name: Run Integration Tests + uses: ./.github/workflows/integration-test.yml + + compatibility-test: + name: Run Compatibility Tests + uses: ./.github/workflows/compatibility.yml diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml new file mode 100644 index 0000000..701b1b7 --- /dev/null +++ b/.github/workflows/compatibility.yml @@ -0,0 +1,37 @@ +name: Compatibility Tests + +on: + workflow_call: + workflow_dispatch: + +jobs: + compatibility-test: + name: Compatibility Tests + runs-on: ubuntu-latest + strategy: + matrix: + node-version: ['20', '22'] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm run build + + - name: Run compatibility tests + run: pnpm run test:compatibility diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index f5ede4b..c04fc70 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -1,11 +1,8 @@ name: Integration Tests on: - push: - branches: [main] - pull_request: - branches: [main] - types: [opened, synchronize, reopened] + workflow_call: + workflow_dispatch: jobs: integration-test: diff --git a/.github/workflows/preview-release.yml b/.github/workflows/preview-release.yml index 951c061..2617c88 100644 --- a/.github/workflows/preview-release.yml +++ b/.github/workflows/preview-release.yml @@ -29,7 +29,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 22 + node-version: 20 cache: 'pnpm' - name: Install dependencies diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 011f4e7..23112e3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,11 +1,8 @@ name: Test on: - push: - branches: [main] - pull_request: - branches: [main] - types: [opened, synchronize, reopened] + workflow_call: + workflow_dispatch: jobs: test: diff --git a/.gitignore b/.gitignore index 11c0d87..3c44f97 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,10 @@ coverage/ .env.local tmp/ +# Compatibility test artifacts +test-compatibility/**/package-lock.json +test-compatibility/**/node_modules/ + CLAUDE.md WARP.md .claude/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index bcf5d26..558fac9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,10 @@ ## [0.5.1](https://github.com/supabase/iceberg-js/compare/iceberg-js-v0.5.0...iceberg-js-v0.5.1) (2025-11-21) - ### Bug Fixes -* format all files ([#11](https://github.com/supabase/iceberg-js/issues/11)) ([f95874b](https://github.com/supabase/iceberg-js/commit/f95874b3b94bb7fff32970ebebbbeb7745263e02)) -* update npm to latest for release ([#10](https://github.com/supabase/iceberg-js/issues/10)) ([7943aca](https://github.com/supabase/iceberg-js/commit/7943acab02005ad5e5be249a201fe2dce810b57b)) +- format all files ([#11](https://github.com/supabase/iceberg-js/issues/11)) ([f95874b](https://github.com/supabase/iceberg-js/commit/f95874b3b94bb7fff32970ebebbbeb7745263e02)) +- update npm to latest for release ([#10](https://github.com/supabase/iceberg-js/issues/10)) ([7943aca](https://github.com/supabase/iceberg-js/commit/7943acab02005ad5e5be249a201fe2dce810b57b)) ## [0.5.0](https://github.com/supabase/iceberg-js/compare/iceberg-js-v0.4.0...iceberg-js-v0.5.0) (2025-11-21) diff --git a/README.md b/README.md index 4db6e7f..15292d9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # iceberg-js +[![CI](https://github.com/supabase/iceberg-js/actions/workflows/ci.yml/badge.svg)](https://github.com/supabase/iceberg-js/actions/workflows/ci.yml) +[![npm version](https://badge.fury.io/js/iceberg-js.svg)](https://www.npmjs.com/package/iceberg-js) + A small, framework-agnostic JavaScript/TypeScript client for the **Apache Iceberg REST Catalog**. ## Features @@ -11,6 +14,28 @@ A small, framework-agnostic JavaScript/TypeScript client for the **Apache Iceber - **Universal**: Targets Node 20+ and modern browsers (ES2020) - **Catalog-only**: Focused on catalog operations (no data reading/Parquet support in v0.1.0) +## Compatibility + +This package is built to work in **all** Node.js and JavaScript environments: + +| Environment | Module System | Import Method | Status | +| ------------------- | -------------------- | --------------------------------------- | --------------------- | +| Node.js ESM | `"type": "module"` | `import { ... } from 'iceberg-js'` | ✅ Fully supported | +| Node.js CommonJS | Default | `const { ... } = require('iceberg-js')` | ✅ Fully supported | +| TypeScript ESM | `module: "ESNext"` | `import { ... } from 'iceberg-js'` | ✅ Full type support | +| TypeScript CommonJS | `module: "CommonJS"` | `import { ... } from 'iceberg-js'` | ✅ Full type support | +| Bundlers | Any | Webpack, Vite, esbuild, Rollup, etc. | ✅ Auto-detected | +| Browsers | ESM | `