Skip to content

Commit

Permalink
Merge pull request #1285 from supabase/feat/postgrest-js-1.17.0-rc.1
Browse files Browse the repository at this point in the history
feat: postgrest-js 1.17.0-rc.1
  • Loading branch information
soedirgo authored Oct 18, 2024
2 parents 9ff1b61 + 59d1898 commit 1227923
Show file tree
Hide file tree
Showing 77 changed files with 4,182 additions and 60,021 deletions.
39 changes: 26 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,48 @@
name: CI

on: [push]
on:
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'
- '.prettierrc'
- '**/*ignore'
push:
branches:
- master
- next
- rc
paths-ignore:
- 'docs/**'
- '**/*.md'
- '.prettierrc'
- '**/*ignore'

jobs:
test:
name: Test / OS ${{ matrix.os }} / Node ${{ matrix.node }}
strategy:
matrix:
os: [ubuntu-latest]
node: ['14']
node: ['20']

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Run tests
run: |
npm ci
npm t
npm clean-install
npm run test:coverage
- name: Test & publish code coverage
uses: paambaati/codeclimate-action@v3.0.0
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
- name: Upload coverage results to Coveralls
uses: coverallsapp/github-action@master
with:
coverageCommand: yarn run coverage
coverageLocations: |
${{github.workspace}}/test/coverage/lcov.info:lcov
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./test/coverage/lcov.info
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: ['14']
node: ['20']

runs-on: ${{ matrix.os }}

Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,30 @@ jobs:
name: Release / Node ${{ matrix.node }}
strategy:
matrix:
node: ['14']
node: ['20']

runs-on: ubuntu-latest

permissions:
contents: write
issues: write
id-token: write

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- run: |
npm ci
npm run build
- name: Create a release
run: npx semantic-release@^18.0.0
- uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 19
env:
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ yarn.lock
src
test
examples
example
example-next-js
umd_temp
CHANGELOG.md
Expand Down
3 changes: 2 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"addReleases": false
}
],
"@semantic-release/npm"
"@semantic-release/npm",
"@sebbo2002/semantic-release-jsr"
]
}
32 changes: 22 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# `supabase-js`
# `supabase-js` - Isomorphic JavaScript Client for Supabase.

An isomorphic JavaScript client for Supabase.

- **Documentation:** https://supabase.com/docs/client/supabase-client
- TypeDoc: https://supabase.github.io/supabase-js
- **Documentation:** https://supabase.com/docs/reference/javascript/start
- TypeDoc: https://supabase.github.io/supabase-js/v2/

## Usage

Expand All @@ -24,16 +22,16 @@ const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key

### UMD

You can now use plain `<script>`s to import supabase-js from CDNs, like:
You can use plain `<script>`s to import supabase-js from CDNs, like:

```html
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js"></script>
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
```

or even:

```html
<script src="https://unpkg.com/@supabase/supabase-js"></script>
<script src="https://unpkg.com/@supabase/supabase-js@2"></script>
```

Then you can use it from a global `supabase` variable:
Expand All @@ -50,7 +48,7 @@ Then you can use it from a global `supabase` variable:

### ESM

You can now use type="module" `<script>`s to import supabase-js from CDNs, like:
You can use `<script type="module">` to import supabase-js from CDNs, like:

```html
<script type="module">
Expand All @@ -62,6 +60,14 @@ You can now use type="module" `<script>`s to import supabase-js from CDNs, like:
</script>
```

### Deno

You can use supabase-js in the Deno runtime via [JSR](https://jsr.io/@supabase/supabase-js):

```js
import { createClient } from 'jsr:@supabase/supabase-js@2'
```

### Custom `fetch` implementation

`supabase-js` uses the [`cross-fetch`](https://www.npmjs.com/package/cross-fetch) library to make HTTP requests, but an alternative `fetch` implementation can be provided as an option. This is most useful in environments where `cross-fetch` is not compatible, for instance Cloudflare Workers:
Expand All @@ -71,7 +77,9 @@ import { createClient } from '@supabase/supabase-js'

// Provide a custom `fetch` implementation as an option
const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key', {
fetch: (...args) => fetch(...args),
global: {
fetch: (...args) => fetch(...args),
},
})
```

Expand All @@ -80,3 +88,7 @@ const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key
We are building the features of Firebase using enterprise-grade, open source products. We support existing communities wherever possible, and if the products don’t exist we build them and open source them ourselves. Thanks to these sponsors who are making the OSS ecosystem better for everyone.

[![New Sponsor](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase)

## Badges

[![Coverage Status](https://coveralls.io/repos/github/supabase/supabase-js/badge.svg?branch=master)](https://coveralls.io/github/supabase/supabase-js?branch=master)
Empty file removed docs/v1/.gitkeep
Empty file.
8 changes: 4 additions & 4 deletions docs/v1/modules/lib_types.html
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ <h5>
</h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Automatically refreshes the token for logged in users.</p>
<p>Automatically refreshes the token for logged in users. Defaults to <code>true</code>.</p>
</div>
</div>
</li>
Expand Down Expand Up @@ -359,7 +359,7 @@ <h5>
</h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Detect a session from the URL. Used for OAuth login callbacks.</p>
<p>Detect a session from the URL. Used for OAuth login callbacks. Defaults to <code>true</code>.</p>
</div>
</div>
</li>
Expand Down Expand Up @@ -440,7 +440,7 @@ <h5>
</h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Whether to persist a logged in session to storage.</p>
<p>Whether to persist a logged in session to storage. Defaults to <code>true</code>.</p>
</div>
</div>
</li>
Expand Down Expand Up @@ -473,7 +473,7 @@ <h5>
<div class="lead">
<p>
The Postgres schema which your tables belong to. Must be on the list of
exposed schemas in Supabase. Defaults to &#39;public&#39;.
exposed schemas in Supabase. Defaults to <code>public</code>.
</p>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions docs/v1/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -3118,7 +3118,7 @@
"isOptional": true
},
"comment": {
"shortText": "Automatically refreshes the token for logged in users."
"shortText": "Automatically refreshes the token for logged in users. Defaults to `true`."
},
"sources": [
{
Expand Down Expand Up @@ -3172,7 +3172,7 @@
"isOptional": true
},
"comment": {
"shortText": "Detect a session from the URL. Used for OAuth login callbacks."
"shortText": "Detect a session from the URL. Used for OAuth login callbacks. Defaults to `true`."
},
"sources": [
{
Expand Down Expand Up @@ -3297,7 +3297,7 @@
"isOptional": true
},
"comment": {
"shortText": "Whether to persist a logged in session to storage."
"shortText": "Whether to persist a logged in session to storage. Defaults to `true`."
},
"sources": [
{
Expand Down Expand Up @@ -3345,7 +3345,7 @@
"isOptional": true
},
"comment": {
"shortText": "The Postgres schema which your tables belong to. Must be on the list of exposed schemas in Supabase. Defaults to 'public'."
"shortText": "The Postgres schema which your tables belong to. Must be on the list of exposed schemas in Supabase. Defaults to `public`."
},
"sources": [
{
Expand Down
34 changes: 0 additions & 34 deletions example/next-storage/.gitignore

This file was deleted.

54 changes: 0 additions & 54 deletions example/next-storage/README.md

This file was deleted.

Loading

0 comments on commit 1227923

Please sign in to comment.