Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Check code formatting
echo "🔍 Checking code formatting..."
npx nx format:check --verbose

echo "✅ Code formatting check passed"

# Check if postgrest-js test database schema was modified
if git diff --name-only origin/master...HEAD 2>/dev/null | grep -q "packages/core/postgrest-js/test/db/"; then
echo "📝 Detected changes in postgrest-js test database schema..."
Expand Down
17 changes: 0 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions packages/core/auth-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
[![Package](https://img.shields.io/npm/v/@supabase/auth-js)](https://www.npmjs.com/package/@supabase/auth-js)
[![License: MIT](https://img.shields.io/npm/l/@supabase/supabase-js)](#license)
[![pkg.pr.new](https://pkg.pr.new/badge/supabase/auth-js)](https://pkg.pr.new/~/supabase/auth-js)

</div>

## Quick start
Expand Down Expand Up @@ -81,8 +82,6 @@ npx nx build:main auth-js # CommonJS build (dist/main/)
npx nx build:module auth-js # ES Modules build (dist/module/)

# Other useful commands
npx nx clean auth-js # Clean build artifacts
npx nx format auth-js # Format code with Prettier
npx nx lint auth-js # Run ESLint
npx nx typecheck auth-js # TypeScript type checking
npx nx docs auth-js # Generate documentation
Expand Down Expand Up @@ -155,4 +154,4 @@ The Docker setup includes:

We welcome contributions! Please see our [Contributing Guide](../../../CONTRIBUTING.md) for details on how to get started.

For major changes or if you're unsure about something, please open an issue first to discuss your proposed changes.
For major changes or if you're unsure about something, please open an issue first to discuss your proposed changes.
1 change: 0 additions & 1 deletion packages/core/functions-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ npx nx build:module functions-js # ES Modules build (dist/module/)

# Other useful commands
npx nx clean functions-js # Clean build artifacts
npx nx format functions-js # Format code with Prettier
npx nx typecheck functions-js # TypeScript type checking
npx nx docs functions-js # Generate documentation
```
Expand Down
1 change: 0 additions & 1 deletion packages/core/functions-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"types": "dist/module/index.d.ts",
"sideEffects": false,
"scripts": {
"format": "prettier --write \"{src,test}/**/*.ts\"",
"build": "npm run build:main && npm run build:module",
"build:main": "tsc -p tsconfig.json",
"build:module": "tsc -p tsconfig.module.json",
Expand Down
1 change: 0 additions & 1 deletion packages/core/postgrest-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"cpy-cli": "^5.0.0",
"jest": "^28.1.0",
"node-abort-controller": "^3.0.1",
"prettier": "^2.6.2",
"ts-jest": "^28.0.3",
"tstyche": "^4.3.0",
"type-fest": "^4.32.0",
Expand Down
1 change: 0 additions & 1 deletion packages/core/realtime-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ npx nx build:module realtime-js # ES Modules build (dist/module/)

# Other useful commands
npx nx clean realtime-js # Clean build artifacts
npx nx format realtime-js # Format code with Prettier
npx nx lint realtime-js # Run ESLint
npx nx typecheck realtime-js # TypeScript type checking
```
Expand Down
50 changes: 22 additions & 28 deletions packages/core/storage-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ If you're already using `@supabase/supabase-js`, access storage through the clie
```js
import { createClient } from '@supabase/supabase-js'

const supabase = createClient(
'https://<project_ref>.supabase.co',
'<your-anon-key>'
)
const supabase = createClient('https://<project_ref>.supabase.co', '<your-anon-key>')

// Access storage
const storage = supabase.storage
Expand Down Expand Up @@ -94,6 +91,7 @@ const analyticsBucket = storageClient.analytics // Analytics API
```

> **When to use each approach:**
>
> - Use `supabase.storage` when working with other Supabase features (auth, database, etc.)
> - Use `new StorageClient()` for storage-only applications or when you need fine-grained control

Expand All @@ -108,7 +106,7 @@ Standard buckets for storing files, images, videos, and other assets.
```js
// Create regular storage bucket
const { data, error } = await storageClient.createBucket('my-files', {
public: false
public: false,
})

// Upload files
Expand All @@ -130,7 +128,7 @@ const bucket = storageClient.vectors.from('embeddings-prod')
await bucket.createIndex({
indexName: 'documents',
dimension: 1536,
distanceMetric: 'cosine'
distanceMetric: 'cosine',
})
```

Expand Down Expand Up @@ -290,6 +288,7 @@ Supabase Storage provides specialized analytics buckets using Apache Iceberg tab
### What are Analytics Buckets?

Analytics buckets use the Apache Iceberg open table format, providing:

- **ACID transactions** for data consistency
- **Schema evolution** without data rewrites
- **Time travel** to query historical data
Expand All @@ -299,13 +298,15 @@ Analytics buckets use the Apache Iceberg open table format, providing:
### When to Use Analytics Buckets

**Use analytics buckets for:**

- Time-series data (logs, metrics, events)
- Data lake architectures
- Business intelligence and reporting
- Large-scale batch processing
- Analytical workloads requiring ACID guarantees

**Use regular storage buckets for:**

- User file uploads (images, documents, videos)
- Individual file management
- Content delivery
Expand All @@ -320,10 +321,7 @@ You can access analytics functionality through the `analytics` property on your
```typescript
import { createClient } from '@supabase/supabase-js'

const supabase = createClient(
'https://your-project.supabase.co',
'your-anon-key'
)
const supabase = createClient('https://your-project.supabase.co', 'your-anon-key')

// Access analytics operations
const analytics = supabase.storage.analytics
Expand Down Expand Up @@ -371,6 +369,7 @@ if (error) {
```

**Returns:**

```typescript
{
data: {
Expand All @@ -394,25 +393,27 @@ const { data, error } = await analytics.listBuckets({
offset: 0,
sortColumn: 'created_at',
sortOrder: 'desc',
search: 'prod'
search: 'prod',
})

if (data) {
console.log(`Found ${data.length} analytics buckets`)
data.forEach(bucket => {
data.forEach((bucket) => {
console.log(`- ${bucket.id} (created: ${bucket.created_at})`)
})
}
```

**Parameters:**

- `limit?: number` - Maximum number of buckets to return
- `offset?: number` - Number of buckets to skip (for pagination)
- `sortColumn?: 'id' | 'name' | 'created_at' | 'updated_at'` - Column to sort by
- `sortOrder?: 'asc' | 'desc'` - Sort direction
- `search?: string` - Search term to filter bucket names

**Returns:**

```typescript
{
data: AnalyticBucket[] | null
Expand All @@ -428,15 +429,15 @@ const firstPage = await analytics.listBuckets({
limit: 100,
offset: 0,
sortColumn: 'created_at',
sortOrder: 'desc'
sortOrder: 'desc',
})

// Fetch second page
const secondPage = await analytics.listBuckets({
limit: 100,
offset: 100,
sortColumn: 'created_at',
sortOrder: 'desc'
sortOrder: 'desc',
})
```

Expand All @@ -455,6 +456,7 @@ if (error) {
```

**Returns:**

```typescript
{
data: { message: string } | null
Expand Down Expand Up @@ -503,11 +505,7 @@ try {
The library exports TypeScript types for analytics buckets:

```typescript
import type {
AnalyticBucket,
BucketType,
StorageError,
} from '@supabase/storage-js'
import type { AnalyticBucket, BucketType, StorageError } from '@supabase/storage-js'

// AnalyticBucket type
interface AnalyticBucket {
Expand All @@ -526,15 +524,15 @@ interface AnalyticBucket {
```typescript
async function bucketExists(bucketName: string): Promise<boolean> {
const { data, error } = await analytics.listBuckets({
search: bucketName
search: bucketName,
})

if (error) {
console.error('Error checking bucket:', error.message)
return false
}

return data?.some(bucket => bucket.id === bucketName) ?? false
return data?.some((bucket) => bucket.id === bucketName) ?? false
}
```

Expand Down Expand Up @@ -575,7 +573,7 @@ async function getAllAnalyticsBuckets() {
limit,
offset,
sortColumn: 'created_at',
sortOrder: 'desc'
sortOrder: 'desc',
})

if (error) {
Expand Down Expand Up @@ -629,10 +627,7 @@ If you're using the full Supabase client:
```typescript
import { createClient } from '@supabase/supabase-js'

const supabase = createClient(
'https://your-project.supabase.co',
'your-anon-key'
)
const supabase = createClient('https://your-project.supabase.co', 'your-anon-key')

// Access vector operations through storage
const vectors = supabase.storage.vectors
Expand Down Expand Up @@ -1085,7 +1080,6 @@ The storage-js package uses multiple build scripts to generate different module
| `build:module` | **ES Modules build** | `dist/module/` - Modern ES6 modules with TypeScript definitions |
| `build:umd` | **UMD build** | `dist/umd/` - Universal Module Definition for browsers/CDN |
| `clean` | **Clean build artifacts** | Removes `dist/` and `docs/v2/` directories |
| `format` | **Format code** | Runs Prettier on all TypeScript files |

#### Running Builds

Expand Down Expand Up @@ -1316,4 +1310,4 @@ The test infrastructure (`infra/docker-compose.yml`) includes:

We welcome contributions! Please see our [Contributing Guide](../../../CONTRIBUTING.md) for details on how to get started.

For major changes or if you're unsure about something, please open an issue first to discuss your proposed changes.
For major changes or if you're unsure about something, please open an issue first to discuss your proposed changes.
Loading