Skip to content

Commit 076b4b9

Browse files
Feature: migrate to typescript (#50)
- Fixes #32 Major DX change: response and error handling - Fixes #49 When no `supabaseKey` is passed in it throws an error - Fixes #31 chore: set up semantic releases - Fixes #15 `supabase.auth.logout()` throws "Invalid user" error. - Fixes #20 Auth: Change DX of user management - Fixes #30 Supabase auth interface missing informiation - Fixes supabase/supabase#147 supabase/supabase#147 - Partial fix for supabase/realtime-js#53 - if there is no token provided. The error needs to be caught at a socket level. - Adds magic links ## BREAKING CHANGES - See all breaking changes in RELEASE.md v1.0.0 - Errors are now returned and not thrown - Auth now uses `@supabase/gotrue-js` interface - `supabase.getSubscriptions()` only returns open subscriptions * Updates the config * chore: Migrates the basic outline to TS * Adds a simple example showing how it can be used. * chore: Moves tests to jest * chore: Adds semantic releases * Moves the subscription into it's own class * Updates the todo readme with simple instructions * Updates installs * Revverts commented code - sorry for the spam * docs: adds JSDoc to some functions * chore: Adds a function for backwards compat * chore: migrates the client to SupabaseClient * This change attempts to make the naming conventions the same as Thor's previously * Updates GoTrue to latest version * Adds generic type to the from, and updates the name of the query builder * Updates to latest versions of all packages * Updates the example to make sure it's working * Refactor SupabaseQueryBuilder * Adds prettier hook * Add TypeScript next.js example. * Declutter SupabaseClient and make work with gotrue-js changes. * Bumps the GoTrue version * Bumps postgrest to include the types * Temporarily adds the spec so that I can use it in our docs * Update examples and add resetPassword. * Bump gotrue-js version. * Update lockfile. * Add auth magic link capabilities. * Gotrue-js user and session method updates. * chore: Adds release notes Co-authored-by: Thorsten Schaeff <[email protected]> Co-authored-by: Thor 雷神 Schaeff <[email protected]>
1 parent db24fda commit 076b4b9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+24995
-11440
lines changed

.babelrc

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/FUNDING.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
name: Test / OS ${{ matrix.os }} / Node ${{ matrix.node }}
8+
strategy:
9+
matrix:
10+
os: [ubuntu-latest]
11+
node: ['12']
12+
13+
runs-on: ${{ matrix.os }}
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Set up Node
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: ${{ matrix.node }}
22+
23+
- name: Run tests
24+
run: |
25+
npm ci
26+
npm t

.github/workflows/docs.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
jobs:
10+
docs:
11+
name: Publish docs / OS ${{ matrix.os }} / Node ${{ matrix.node }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
node: ['12']
16+
17+
runs-on: ${{ matrix.os }}
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Set up Node
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: ${{ matrix.node }}
26+
27+
- run: |
28+
npm ci
29+
npm run docs
30+
npm run docs:json
31+
32+
- name: Publish
33+
uses: peaceiris/actions-gh-pages@v3
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
publish_dir: docs
37+
force_orphan: true
38+
commit_message: 'docs: update'

.github/workflows/nodejs.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
jobs:
10+
release:
11+
name: Release / Node ${{ matrix.node }}
12+
strategy:
13+
matrix:
14+
node: ['12']
15+
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- name: Set up Node
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: ${{ matrix.node }}
25+
26+
- run: |
27+
npm ci
28+
npm run build
29+
30+
- name: Create a release
31+
run: npx semantic-release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
34+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 74 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,104 @@
22
logs
33
*.log
44
npm-debug.log*
5-
.env
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
.DS_Store
9+
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
612

713
# Runtime data
814
pids
915
*.pid
1016
*.seed
17+
*.pid.lock
1118

1219
# Directory for instrumented libs generated by jscoverage/JSCover
1320
lib-cov
1421

1522
# Coverage directory used by tools like istanbul
1623
coverage
24+
*.lcov
1725

1826
# nyc test coverage
1927
.nyc_output
2028

21-
# Compiled binary addons (http://nodejs.org/api/addons.html)
29+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30+
.grunt
31+
32+
# Bower dependency directory (https://bower.io/)
33+
bower_components
34+
35+
# node-waf configuration
36+
.lock-wscript
37+
38+
# Compiled binary addons (https://nodejs.org/api/addons.html)
2239
build/Release
2340

2441
# Dependency directories
25-
node_modules
26-
jspm_packages
42+
node_modules/
43+
jspm_packages/
44+
45+
# TypeScript v1 declaration files
46+
typings/
47+
48+
# TypeScript cache
49+
*.tsbuildinfo
2750

2851
# Optional npm cache directory
2952
.npm
3053

54+
# Optional eslint cache
55+
.eslintcache
56+
57+
# Microbundle cache
58+
.rpt2_cache/
59+
.rts2_cache_cjs/
60+
.rts2_cache_es/
61+
.rts2_cache_umd/
62+
3163
# Optional REPL history
3264
.node_repl_history
3365

34-
# Editors
35-
.idea
66+
# Output of 'npm pack'
67+
*.tgz
68+
69+
# Yarn Integrity file
70+
.yarn-integrity
71+
72+
# dotenv environment variables file
73+
.env
74+
.env.test
75+
76+
# parcel-bundler cache (https://parceljs.org/)
77+
.cache
78+
79+
# Next.js build output
80+
.next
81+
82+
# Nuxt.js build / generate output
83+
.nuxt
84+
dist
85+
86+
# Gatsby files
87+
.cache/
88+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
89+
# https://nextjs.org/blog/next-9-1#public-directory-support
90+
# public
91+
92+
# vuepress build output
93+
.vuepress/dist
94+
95+
# Serverless directories
96+
.serverless/
97+
98+
# FuseBox cache
99+
.fusebox/
36100

37-
# Lib
38-
lib
39-
umd
40-
umd_temp
101+
# DynamoDB Local files
102+
.dynamodb/
41103

42-
others
43-
.DS_Store
104+
# TernJS port file
105+
.tern-port

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ yarn.lock
1616
src
1717
test
1818
examples
19+
example
20+
example-next-js
1921
umd_temp
2022
CHANGELOG.md
2123
.travis.yml

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Supabase
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

LICENSE.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

Makefile

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)