@supabase/storage-js 2.101.0 → 2.101.1
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 +19 -52
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/umd/supabase.js +1 -1
- package/package.json +1 -1
- package/src/lib/common/errors.ts +2 -2
- package/src/lib/version.ts +1 -1
- package/src/packages/StorageFileApi.ts +1 -1
package/README.md
CHANGED
|
@@ -1170,27 +1170,21 @@ npx nx docs storage-js
|
|
|
1170
1170
|
|
|
1171
1171
|
### Testing
|
|
1172
1172
|
|
|
1173
|
-
**Important:** The storage-js tests require a local
|
|
1173
|
+
**Important:** The storage-js tests require a local Supabase stack running via the Supabase CLI. Docker must be running since the Supabase CLI uses it internally.
|
|
1174
1174
|
|
|
1175
1175
|
#### Prerequisites
|
|
1176
1176
|
|
|
1177
|
-
1. **Docker** must be installed and running
|
|
1178
|
-
2. **
|
|
1179
|
-
- 5432 (PostgreSQL database)
|
|
1180
|
-
- 5050 (Storage API - sometimes 5000 conflicts macOS AirPlay conflict)
|
|
1181
|
-
- 8000 (Kong API Gateway)
|
|
1182
|
-
- 50020 (imgproxy for image transformations)
|
|
1183
|
-
|
|
1184
|
-
**Note:** If port 5000 conflicts with macOS AirPlay Receiver, the docker-compose.yml has been configured to use port 5050 instead.
|
|
1177
|
+
1. **Docker** must be installed and running (used by Supabase CLI internally)
|
|
1178
|
+
2. **Supabase CLI** — installed automatically via `npx supabase`
|
|
1185
1179
|
|
|
1186
1180
|
#### Test Scripts Overview
|
|
1187
1181
|
|
|
1188
|
-
| Script
|
|
1189
|
-
|
|
|
1190
|
-
| `test:storage`
|
|
1191
|
-
| `test:suite`
|
|
1192
|
-
| `test:infra`
|
|
1193
|
-
| `test:clean`
|
|
1182
|
+
| Script | Description | What it does |
|
|
1183
|
+
| ----------------- | --------------------------------- | ----------------------------------------------------------------- |
|
|
1184
|
+
| `test:storage` | **Complete test workflow** | Runs the full test cycle: clean → start infra → run tests → clean |
|
|
1185
|
+
| `test:suite` | **Jest tests only** | Runs Jest tests with coverage (requires infra to be running) |
|
|
1186
|
+
| `test:infra` | **Start test infrastructure** | Starts Supabase CLI stack (PostgreSQL, Storage API, Kong, etc.) |
|
|
1187
|
+
| `test:clean-post` | **Stop and clean infrastructure** | Stops the Supabase CLI stack |
|
|
1194
1188
|
|
|
1195
1189
|
#### Running Tests
|
|
1196
1190
|
|
|
@@ -1225,7 +1219,7 @@ npx nx test:infra storage-js
|
|
|
1225
1219
|
npx nx test:suite storage-js
|
|
1226
1220
|
|
|
1227
1221
|
# Step 3: When done, clean up the infrastructure
|
|
1228
|
-
npx nx test:clean storage-js
|
|
1222
|
+
npx nx test:clean-post storage-js
|
|
1229
1223
|
```
|
|
1230
1224
|
|
|
1231
1225
|
##### Option 3: Development Mode
|
|
@@ -1240,53 +1234,26 @@ npx nx test:infra storage-js
|
|
|
1240
1234
|
npx nx test:suite storage-js --watch
|
|
1241
1235
|
|
|
1242
1236
|
# Clean up when done
|
|
1243
|
-
npx nx test:clean storage-js
|
|
1237
|
+
npx nx test:clean-post storage-js
|
|
1244
1238
|
```
|
|
1245
1239
|
|
|
1246
1240
|
#### Test Infrastructure Details
|
|
1247
1241
|
|
|
1248
|
-
The test infrastructure (`
|
|
1249
|
-
|
|
1250
|
-
- **PostgreSQL Database** (port 5432)
|
|
1251
|
-
- Initialized with storage schema and test data
|
|
1252
|
-
- Contains bucket configurations and permissions
|
|
1253
|
-
|
|
1254
|
-
- **Storage API** (port 5050, internal 5000)
|
|
1255
|
-
- Supabase Storage service for handling file operations
|
|
1256
|
-
- Configured with test authentication keys
|
|
1257
|
-
|
|
1258
|
-
- **Kong Gateway** (port 8000)
|
|
1259
|
-
- API gateway that routes requests to storage service
|
|
1260
|
-
- Handles authentication and CORS
|
|
1261
|
-
|
|
1262
|
-
- **imgproxy** (port 50020)
|
|
1263
|
-
- Image transformation service for on-the-fly image processing
|
|
1242
|
+
The test infrastructure is managed via the Supabase CLI (`npx supabase start --workdir test`), which starts a local Supabase stack defined by the config in `test/`. This includes PostgreSQL, the Storage API, Kong Gateway, and supporting services.
|
|
1264
1243
|
|
|
1265
1244
|
#### Common Issues and Solutions
|
|
1266
1245
|
|
|
1267
|
-
| Issue | Solution
|
|
1268
|
-
| --------------------------------- |
|
|
1269
|
-
| Port
|
|
1270
|
-
|
|
|
1271
|
-
|
|
|
1272
|
-
|
|
|
1273
|
-
| "Container name already exists" | Run `npx nx test:clean storage-js` to remove existing containers |
|
|
1246
|
+
| Issue | Solution |
|
|
1247
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
1248
|
+
| Port conflicts | Another service is using a required port. Run `npx nx test:clean-post storage-js` then try again |
|
|
1249
|
+
| "request failed, reason:" errors | Infrastructure isn't running. Run `npx nx test:infra storage-js` first |
|
|
1250
|
+
| Tests fail with connection errors | Ensure Docker is running (Supabase CLI requires Docker) |
|
|
1251
|
+
| Stack already running | Run `npx nx test:clean-post storage-js` to stop it before restarting |
|
|
1274
1252
|
|
|
1275
1253
|
#### Understanding Test Failures
|
|
1276
1254
|
|
|
1277
1255
|
- **StorageUnknownError with "request failed"**: Infrastructure not running
|
|
1278
|
-
- **
|
|
1279
|
-
- **Snapshot failures**: Expected test data has changed - review and update snapshots if needed
|
|
1280
|
-
|
|
1281
|
-
#### What About Supabase CLI?
|
|
1282
|
-
|
|
1283
|
-
**No**, you don't need `supabase start` or a regular Supabase instance for these tests. The storage-js tests use their own specialized Docker setup that's lighter and focused specifically on testing the storage SDK. This test infrastructure:
|
|
1284
|
-
|
|
1285
|
-
- Is completely independent from any Supabase CLI projects
|
|
1286
|
-
- Uses fixed test authentication keys
|
|
1287
|
-
- Has predictable test data and bucket configurations
|
|
1288
|
-
- Runs faster than a full Supabase stack
|
|
1289
|
-
- Doesn't interfere with your local Supabase development projects
|
|
1256
|
+
- **Snapshot failures**: Expected test data has changed — review and update snapshots if needed
|
|
1290
1257
|
|
|
1291
1258
|
### Contributing
|
|
1292
1259
|
|
package/dist/index.cjs
CHANGED