@beignet/provider-storage-local 0.0.21 → 0.0.23
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/CHANGELOG.md +8 -0
- package/README.md +25 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -37,6 +37,9 @@ Environment variables:
|
|
|
37
37
|
| `STORAGE_ROOT` | Directory where objects are written. Defaults to `storage/app`. |
|
|
38
38
|
| `STORAGE_PUBLIC_BASE_URL` | Optional base URL returned by `publicUrl(...)` for public objects. |
|
|
39
39
|
|
|
40
|
+
`beignet doctor --strict` checks that installed local storage providers are
|
|
41
|
+
registered in `server/providers.ts`.
|
|
42
|
+
|
|
40
43
|
`STORAGE_PUBLIC_BASE_URL` may be an absolute URL such as
|
|
41
44
|
`https://assets.example.com` or an app-relative path such as `/storage`.
|
|
42
45
|
The provider only returns URLs. If you use an app-relative path in a Next.js
|
|
@@ -63,6 +66,10 @@ const storage = createLocalStorage({
|
|
|
63
66
|
});
|
|
64
67
|
```
|
|
65
68
|
|
|
69
|
+
The provider contributes `ctx.ports.storage`, the standard Beignet
|
|
70
|
+
`StoragePort`. It has no provider-specific escape hatch; use the port for
|
|
71
|
+
reads, writes, public URLs, and metadata.
|
|
72
|
+
|
|
66
73
|
The same `StoragePort` works with local files, memory tests, and cloud object
|
|
67
74
|
stores:
|
|
68
75
|
|
|
@@ -93,6 +100,24 @@ operations under the `storage` watcher. Events include operation name, key,
|
|
|
93
100
|
duration, object size, visibility, and whether a lookup hit. Object bodies are
|
|
94
101
|
never recorded.
|
|
95
102
|
|
|
103
|
+
## Failure behavior
|
|
104
|
+
|
|
105
|
+
The provider creates directories as needed and throws for invalid object keys,
|
|
106
|
+
metadata errors, filesystem permission failures, and failed reads or writes.
|
|
107
|
+
Path traversal is rejected before touching the filesystem.
|
|
108
|
+
|
|
109
|
+
## Local and tests
|
|
110
|
+
|
|
111
|
+
Use this provider for local development or integration tests that need durable
|
|
112
|
+
files. Use an app-owned fake or memory `StoragePort` for use-case tests that
|
|
113
|
+
only assert storage intent.
|
|
114
|
+
|
|
115
|
+
## Deployment notes
|
|
116
|
+
|
|
117
|
+
Only use local storage in deployments where the filesystem is durable and shared
|
|
118
|
+
with every process that needs the objects. Serverless and horizontally scaled
|
|
119
|
+
apps should usually use `@beignet/provider-storage-s3` or another object store.
|
|
120
|
+
|
|
96
121
|
## License
|
|
97
122
|
|
|
98
123
|
MIT
|