Skip to content

Commit 3440262

Browse files
committed
feat: prepare for refactored minor version
- remove unecessary and confuse option `manege_clients` - users should manage OTP process on their own - client struct should be simpler to use and manage - client initialization should be very explicit - no more infinite ways to "start" a client, just create a raw struct - remove old documentation - update elixir and erlang OTP source versions - remove usage of earthly on top of old github actions - add support for local dev with `asdf` - add local `.env.dev` for usage with supabase cli
1 parent 6947423 commit 3440262

File tree

25 files changed

+221
-554
lines changed

25 files changed

+221
-554
lines changed

.env.dev

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export SUPABASE_URL=http://127.0.0.1:54321
2+
export SUPABASE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU

.github/workflows/ci.yml

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,39 @@ name: ci
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches:
6+
- main
67
pull_request:
7-
branches: [ main ]
8+
branches:
9+
- main
810

911
jobs:
10-
build:
12+
lint:
1113
runs-on: ubuntu-latest
12-
env:
13-
GHCR_USERNAME: ${{ github.actor }}
14-
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
15-
FORCE_COLOR: 1
14+
15+
strategy:
16+
matrix:
17+
elixir: [1.17.0]
18+
otp: [27.0]
19+
1620
steps:
17-
- uses: actions/checkout@v3
18-
- name: Put back the git branch into git (Earthly uses it for tagging)
19-
run: |
20-
branch=""
21-
if [ -n "$GITHUB_HEAD_REF" ]; then
22-
branch="$GITHUB_HEAD_REF"
23-
else
24-
branch="${GITHUB_REF##*/}"
25-
fi
26-
git checkout -b "$branch" || true
27-
- name: Docker Login
28-
run: docker login https://ghcr.io --username "$GHCR_USERNAME" --password "$GHCR_TOKEN"
29-
- name: Download latest earthly
30-
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
31-
32-
- name: Earthly version
33-
run: earthly --version
34-
35-
- name: Run CI
36-
run: earthly -P +ci
37-
38-
- name: Run Tests
39-
run: earthly -P +test
21+
- name: Checkout code
22+
uses: actions/checkout@v3
23+
24+
- name: Set up Elixir
25+
uses: erlef/setup-beam@v1
26+
with:
27+
elixir-version: ${{ matrix.elixir }}
28+
otp-version: ${{ matrix.otp }}
29+
30+
- name: Install dependencies
31+
run: mix deps.get
32+
33+
- name: Clean build
34+
run: mix clean
35+
36+
- name: Check code formatting
37+
run: mix format --check-formatted
38+
39+
- name: Run Credo
40+
run: mix credo --strict

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
elixir: [1.15.7]
17-
otp: [26.1.2]
16+
elixir: [1.17.0]
17+
otp: [27.0]
1818
steps:
1919
- uses: actions/checkout@v3
2020
- name: Set up Elixir

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
erlang 27.0
2+
elixir 1.17.0-otp-27

Earthfile

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ To install the base SDK:
1111
```elixir
1212
def deps do
1313
[
14-
{:supabase_potion, "~> 0.3"}
14+
{:supabase_potion, "~> 0.4"}
1515
]
1616
end
1717
```

config/config.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import Config
22

33
if config_env() == :dev do
44
config :supabase_potion,
5-
manage_clients: true,
65
supabase_base_url: System.get_env("SUPABASE_URL"),
76
supabase_api_key: System.get_env("SUPABASE_KEY")
87
end

flake.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description = "Supabase SDK for Elixir";
33

44
inputs = {
5-
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
66
flake-parts.url = "github:hercules-ci/flake-parts";
77
systems.url = "github:nix-systems/default";
88
};
@@ -19,9 +19,9 @@
1919
system,
2020
...
2121
}: let
22-
inherit (pkgs.beam.interpreters) erlangR26;
22+
inherit (pkgs.beam.interpreters) erlang_27;
2323
inherit (pkgs.beam) packagesWith;
24-
beam = packagesWith erlangR26;
24+
beam = packagesWith erlang_27;
2525
in {
2626
_module.args.pkgs = import inputs.nixpkgs {
2727
inherit system;
@@ -31,7 +31,7 @@
3131
mkShell {
3232
name = "supabase-ex";
3333
packages = with pkgs;
34-
[beam.elixir_1_16]
34+
[beam.elixir_1_17]
3535
++ lib.optional stdenv.isLinux [inotify-tools]
3636
++ lib.optional stdenv.isDarwin [
3737
darwin.apple_sdk.frameworks.CoreServices

guides/fetcher.md

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

0 commit comments

Comments
 (0)