Skip to content

Commit

Permalink
Feature: migrate to typescript (#50)
Browse files Browse the repository at this point in the history

- 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 <thorsten.schaeff@gmail.com>
Co-authored-by: Thor 雷神 Schaeff <5748289+thorwebdev@users.noreply.github.com>
  • Loading branch information
3 people committed Nov 2, 2020
1 parent db24fda commit 076b4b9
Show file tree
Hide file tree
Showing 70 changed files with 24,995 additions and 11,440 deletions.
14 changes: 0 additions & 14 deletions .babelrc

This file was deleted.

12 changes: 0 additions & 12 deletions .github/FUNDING.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,26 @@
name: CI

on: [push]

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

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

steps:
- uses: actions/checkout@v2

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

- name: Run tests
run: |
npm ci
npm t
38 changes: 38 additions & 0 deletions .github/workflows/docs.yml
@@ -0,0 +1,38 @@
name: Docs

on:
push:
branches:
- master
workflow_dispatch:

jobs:
docs:
name: Publish docs / OS ${{ matrix.os }} / Node ${{ matrix.node }}
strategy:
matrix:
os: [ubuntu-latest]
node: ['12']

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

steps:
- uses: actions/checkout@v2

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

- run: |
npm ci
npm run docs
npm run docs:json
- name: Publish
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs
force_orphan: true
commit_message: 'docs: update'
23 changes: 0 additions & 23 deletions .github/workflows/nodejs.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,34 @@
name: Release

on:
push:
branches:
- master
workflow_dispatch:

jobs:
release:
name: Release / Node ${{ matrix.node }}
strategy:
matrix:
node: ['12']

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

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

- run: |
npm ci
npm run build
- name: Create a release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
86 changes: 74 additions & 12 deletions .gitignore
Expand Up @@ -2,42 +2,104 @@
logs
*.log
npm-debug.log*
.env
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.DS_Store

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

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

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Compiled binary addons (http://nodejs.org/api/addons.html)
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Editors
.idea
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# Lib
lib
umd
umd_temp
# DynamoDB Local files
.dynamodb/

others
.DS_Store
# TernJS port file
.tern-port
2 changes: 2 additions & 0 deletions .npmignore
Expand Up @@ -16,6 +16,8 @@ yarn.lock
src
test
examples
example
example-next-js
umd_temp
CHANGELOG.md
.travis.yml
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Supabase

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
22 changes: 0 additions & 22 deletions LICENSE.md

This file was deleted.

27 changes: 0 additions & 27 deletions Makefile

This file was deleted.

0 comments on commit 076b4b9

Please sign in to comment.