@freehour/supabase-core 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,21 +2,33 @@
2
2
 
3
3
  This package provides lightweight services to supabase to make it easier to work with databases, tables and storage buckets.
4
4
 
5
+ ### Features
6
+
7
+ - **Database Service**: Easy access to database tables and views.
8
+ - **Data Service**: Perform CRUD operations, fuzzy search, pagination, filtering and more on a specific table or view.
9
+ - **Storage Service**: Access to storage buckets and files, with support for file uploads, downloads, deletions, and more.
10
+
5
11
  ### Installation
6
12
 
7
- Install the package, e.g. using npm or bun:
13
+ Install the package, e.g. using bun:
8
14
 
9
15
  ```bash
10
- npm install @freehour/supabase-core
16
+ bun install @freehour/supabase-core
11
17
  ```
12
18
 
13
- or
19
+ ### Migrations and Schemas
20
+
21
+ The package includes SQL files for setting up the necessary database schemas and extensions.
22
+ These files are copied post-installation to the `supabase/` directory of your project.
23
+ If you get a warning that the post-install script is blocked, you need to run the follwing command to trust the dependency:
14
24
 
15
25
  ```bash
16
- bun install @freehour/supabase-core
26
+ bun pm trust @freehour/supabase-core
17
27
  ```
18
28
 
19
- Add `schemas/supabase-core/*.sql` to your `schema_paths` in `supabase/config.toml`:
29
+ ### Configuration
30
+
31
+ If you generate migrations from schemas, make sure to include the `supabase_core` schema in your `schema_paths` in `supabase/config.toml`.
20
32
 
21
33
  ```toml
22
34
  schema_paths = ["./schemas/supabase-core/*.sql", /* your app schema paths */]
@@ -24,12 +36,26 @@ schema_paths = ["./schemas/supabase-core/*.sql", /* your app schema paths */]
24
36
 
25
37
  ### Building
26
38
 
27
- To build the package, run the following command:
39
+ Make sure the migrations are up to date:
40
+
41
+ ```bash
42
+ rm -rf supabase/migrations/.*sql
43
+ bunx supabase db diff -f 0000_supabase_core
44
+ ```
45
+
46
+ Then build the package:
28
47
 
29
48
  ```bash
30
49
  bun run build
31
50
  ```
32
51
 
52
+ ### Publishing
53
+
54
+ To publish a new version of the package, update the version in `package.json` and run:
55
+
56
+ ```bash
57
+ bun publish --access public
58
+ ```
33
59
 
34
60
 
35
61
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "displayName": "Supabase-Core",
5
5
  "description": "Core services for Supabase",
6
- "version": "1.0.1",
6
+ "version": "1.0.3",
7
7
  "type": "module",
8
8
  "repository": {
9
9
  "type": "git",
@@ -49,6 +49,9 @@ function copyRecursive(src, dest) {
49
49
  }
50
50
  }
51
51
 
52
+ if (process.env.INIT_CWD === process.cwd())
53
+ process.exit(); // Prevent running in the package root
54
+
52
55
  // Copy migrations and schemas folders
53
56
  for (const folder of ['migrations', 'schemas']) {
54
57
  const src = join(sourceDir, folder);