Skip to content

Commit 1964793

Browse files
authored
Merge branch 'master' into refactor/create-new-type
2 parents d9ed7bb + b7f693f commit 1964793

26 files changed

+11596
-4897
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,28 @@ jobs:
88
strategy:
99
matrix:
1010
os: [ubuntu-latest]
11-
node: ['12']
11+
node: ['14']
1212

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

1515
steps:
1616
- uses: actions/checkout@v2
1717

1818
- name: Set up Node
19-
uses: actions/setup-node@v1
19+
uses: actions/setup-node@v2
2020
with:
2121
node-version: ${{ matrix.node }}
2222

2323
- name: Run tests
2424
run: |
2525
npm ci
2626
npm t
27+
28+
- name: Test & publish code coverage
29+
uses: paambaati/[email protected]
30+
env:
31+
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
32+
with:
33+
coverageCommand: yarn run coverage
34+
coverageLocations: |
35+
${{github.workspace}}/test/coverage/lcov.info:lcov

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: [ubuntu-latest]
15-
node: ['12']
15+
node: ['14']
1616

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

1919
steps:
2020
- uses: actions/checkout@v2
2121

2222
- name: Set up Node
23-
uses: actions/setup-node@v1
23+
uses: actions/setup-node@v2
2424
with:
2525
node-version: ${{ matrix.node }}
2626

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
name: Release / Node ${{ matrix.node }}
1212
strategy:
1313
matrix:
14-
node: ['12']
14+
node: ['14']
1515

1616
runs-on: ubuntu-latest
1717

1818
steps:
1919
- uses: actions/checkout@v2
2020

2121
- name: Set up Node
22-
uses: actions/setup-node@v1
22+
uses: actions/setup-node@v2
2323
with:
2424
node-version: ${{ matrix.node }}
2525

@@ -28,7 +28,7 @@ jobs:
2828
npm run build
2929
3030
- name: Create a release
31-
run: npx semantic-release
31+
run: npx semantic-release@^18.0.0
3232
env:
3333
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
3434
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.releaserc.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@
1515
],
1616
"@semantic-release/commit-analyzer",
1717
"@semantic-release/release-notes-generator",
18-
"@semantic-release/github",
18+
[
19+
"@semantic-release/github",
20+
{
21+
"successComment": false,
22+
"releasedLabels": false,
23+
"failTitle": false,
24+
"addReleases": false
25+
}
26+
],
1927
"@semantic-release/npm"
2028
]
2129
}

README.md

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
# `supabase-js`
22

3-
An isomorphic Javascript client for Supabase.
3+
An isomorphic JavaScript client for Supabase.
44

5-
- Documentation: https://supabase.io/docs/client/supabase-client
5+
**Documentation:** https://supabase.io/docs/client/supabase-client
66

77
## Usage
88

9+
First of all, you need to install the library:
10+
911
```sh
1012
npm install @supabase/supabase-js
1113
```
1214

15+
Then you're able to import the library and establish the connection with the database:
16+
1317
```js
1418
import { createClient } from '@supabase/supabase-js'
1519

@@ -19,22 +23,43 @@ const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key
1923

2024
### UMD
2125

22-
You can now use plain `<script>`s to import supabase-js from CDNs, like
26+
You can now use plain `<script>`s to import supabase-js from CDNs, like:
27+
28+
```html
29+
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js"></script>
30+
```
31+
32+
or even:
2333

24-
`<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js"></script>`
25-
or
26-
`<script src="https://unpkg.com/@supabase/supabase-js"></script>`.
34+
```html
35+
<script src="https://unpkg.com/@supabase/supabase-js"></script>
36+
```
2737

2838
Then you can use it from a global `supabase` variable:
2939

3040
```html
3141
<script>
32-
const { createClient } = supabase
33-
supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')
34-
...
42+
const { createClient } = supabase
43+
const _supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')
44+
45+
console.log('Supabase Instance: ', _supabase)
46+
// ...
3547
</script>
3648
```
3749

50+
### Custom `fetch` implementation
51+
52+
`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:
53+
54+
```js
55+
import { createClient } from '@supabase/supabase-js'
56+
57+
// Provide a custom `fetch` implementation as an option
58+
const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key', {
59+
fetch: (...args) => fetch(...args),
60+
})
61+
```
62+
3863
## Sponsors
3964

4065
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.

0 commit comments

Comments
 (0)