@stacksjs/defaults 0.75.669 → 0.75.672
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.
|
@@ -19,7 +19,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
|
|
|
19
19
|
| `@stacksjs/arrays` | [`stacks-arrays`](../stacks-arrays/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/arrays/src/index.ts) | 12 |
|
|
20
20
|
| `@stacksjs/audio` | [`stacks-audio`](../stacks-audio/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/audio/src/index.ts) | 3 |
|
|
21
21
|
| `@stacksjs/auth` | [`stacks-auth`](../stacks-auth/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/auth/src/index.ts) | 136 |
|
|
22
|
-
| `@stacksjs/browser` | [`stacks-browser`](../stacks-browser/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/index.ts) |
|
|
22
|
+
| `@stacksjs/browser` | [`stacks-browser`](../stacks-browser/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/index.ts) | 11 |
|
|
23
23
|
| `@stacksjs/browser-extension` | [`stacks-browser-extension`](../stacks-browser-extension/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser-extension/src/index.ts) | 9 |
|
|
24
24
|
| `@stacksjs/buddy` | [`stacks-buddy`](../stacks-buddy/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/buddy/src/index.ts) | 220 |
|
|
25
25
|
| `@stacksjs/build` | [`stacks-build`](../stacks-build/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/build/src/index.ts) | 7 |
|
|
@@ -87,7 +87,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
|
|
|
87
87
|
| `@stacksjs/slug` | [`stacks-slug`](../stacks-slug/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/slug/src/index.ts) | 5 |
|
|
88
88
|
| `@stacksjs/sms` | [`stacks-sms`](../stacks-sms/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/sms/src/index.ts) | 7 |
|
|
89
89
|
| `@stacksjs/socials` | [`stacks-socials`](../stacks-socials/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/socials/src/index.ts) | 21 |
|
|
90
|
-
| `@stacksjs/storage` | [`stacks-storage`](../stacks-storage/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/index.ts) |
|
|
90
|
+
| `@stacksjs/storage` | [`stacks-storage`](../stacks-storage/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/index.ts) | 53 |
|
|
91
91
|
| `@stacksjs/strings` | [`stacks-strings`](../stacks-strings/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/strings/src/index.ts) | 12 |
|
|
92
92
|
| `@stacksjs/support` | [`stacks-support`](../stacks-support/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/support/src/index.ts) | 6 |
|
|
93
93
|
| `@stacksjs/telephony` | [`stacks-telephony`](../stacks-telephony/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/telephony/src/index.ts) | 5 |
|
|
@@ -98,7 +98,7 @@ Browser runtime bindings are documented separately in `stacks-auto-imports`.
|
|
|
98
98
|
| `@stacksjs/ui` | [`stacks-ui`](../stacks-ui/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/ui/src/index.ts) | 6 |
|
|
99
99
|
| `@stacksjs/utils` | [`stacks-utils`](../stacks-utils/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/utils/src/index.ts) | 28 |
|
|
100
100
|
| `@stacksjs/validation` | [`stacks-validation`](../stacks-validation/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/validation/src/index.ts) | 26 |
|
|
101
|
-
| `@stacksjs/video` | [`stacks-video`](../stacks-video/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/video/src/index.ts) |
|
|
101
|
+
| `@stacksjs/video` | [`stacks-video`](../stacks-video/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/video/src/index.ts) | 4 |
|
|
102
102
|
| `@stacksjs/waf` | [`stacks-security`](../stacks-security/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/waf/src/index.ts) | 2 |
|
|
103
103
|
| `@stacksjs/whois` | [`stacks-whois`](../stacks-whois/SKILL.md) | [entrypoint](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/whois/src/index.ts) | 5 |
|
|
104
104
|
|
|
@@ -203,7 +203,7 @@ Declared runtime exports: `BrowserQueryBuilder`, `BrowserQueryError`, `browserAu
|
|
|
203
203
|
|
|
204
204
|
Local source modules: [src/auto-init.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/auto-init.ts), [src/composables/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/composables/index.ts), [src/model-loader.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/model-loader.ts), [src/types/globals.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/types/globals.ts), [src/utils/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/src/utils/index.ts).
|
|
205
205
|
|
|
206
|
-
Evidence directory: [
|
|
206
|
+
Evidence directory: [11 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/browser/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
|
|
207
207
|
|
|
208
208
|
### @stacksjs/browser-extension
|
|
209
209
|
|
|
@@ -855,11 +855,11 @@ Evidence directory: [21 retained tests](https://github.com/stacksjs/stacks/blob/
|
|
|
855
855
|
|
|
856
856
|
Guidance: [`stacks-storage`](../stacks-storage/SKILL.md). Source: [storage/framework/core/storage/src/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/index.ts).
|
|
857
857
|
|
|
858
|
-
Declared runtime exports: `DirectoryListingChangedError`, `PathSanitizeError`, `Storage`, `StorageManager`, `UploadedFile`, `azureDisk`, `backblazeDisk`, `clearRevokedSignedStorageTokens`, `configFromEnv`, `createSignedStorageToken`, `detectMimeFromMagicBytes`, `ensureBucket`, `ensureConfiguredBuckets`, `fileInfo`, `fileInfoFromBytes`, `fileKind`, `filebaseDisk`, `gcsDisk`, `hetznerDisk`, `isPreviewable`, `isSignedStorageTokenRevoked`, `localDisk`, `parseDiskPath`, `r2Disk`, `resolveMime`, `revokeSignedStorageToken`, `s3Disk`, `sanitizePresignedDir`, `sanitizePresignedFilename`, `serveFile`, `signS3PresignedPost`, `storage`, `uploadedFile`, `uploadedFiles`, `verifySignedStorageToken`, `verifyUploadedMime`.
|
|
858
|
+
Declared runtime exports: `DirectoryListingChangedError`, `PathSanitizeError`, `Storage`, `StorageManager`, `UploadSessionError`, `UploadedFile`, `azureDisk`, `backblazeDisk`, `clearRevokedSignedStorageTokens`, `configFromEnv`, `createSignedStorageToken`, `createUploadSessions`, `detectMimeFromMagicBytes`, `ensureBucket`, `ensureConfiguredBuckets`, `fileInfo`, `fileInfoFromBytes`, `fileKind`, `filebaseDisk`, `gcsDisk`, `hetznerDisk`, `isPreviewable`, `isSignedStorageTokenRevoked`, `localDisk`, `parseDiskPath`, `r2Disk`, `resolveMime`, `revokeSignedStorageToken`, `s3Disk`, `sanitizePresignedDir`, `sanitizePresignedFilename`, `serveFile`, `signS3PresignedPost`, `storage`, `uploadedFile`, `uploadedFiles`, `verifySignedStorageToken`, `verifyUploadedMime`.
|
|
859
859
|
|
|
860
|
-
Local source modules: [src/adapters/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/adapters/index.ts), [src/bounded-text-file.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/bounded-text-file.ts), [src/completed-artifact-directory.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/completed-artifact-directory.ts), [src/copy.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/copy.ts), [src/delete.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/delete.ts), [src/directory-page.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/directory-page.ts), [src/drivers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/drivers/index.ts), [src/facade.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/facade.ts), [src/file-info.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/file-info.ts), [src/files.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/files.ts), [src/folders.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/folders.ts), [src/fs.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/fs.ts), [src/glob.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/glob.ts), [src/hash.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/hash.ts), [src/helpers.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/helpers.ts), [src/mime-verify.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/mime-verify.ts), [src/path-sanitize.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/path-sanitize.ts), [src/provision.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/provision.ts), [src/s3-presigned-post.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/s3-presigned-post.ts), [src/signed-url.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/signed-url.ts), [src/static-serve.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/static-serve.ts), [src/storage.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/storage.ts), [src/temporary-workspaces.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/temporary-workspaces.ts), [src/types.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/types.ts), [src/types/filesystem.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/types/filesystem.ts), [src/uploaded-file.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/uploaded-file.ts), [src/zip.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/zip.ts).
|
|
860
|
+
Local source modules: [src/adapters/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/adapters/index.ts), [src/bounded-text-file.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/bounded-text-file.ts), [src/completed-artifact-directory.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/completed-artifact-directory.ts), [src/copy.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/copy.ts), [src/delete.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/delete.ts), [src/directory-page.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/directory-page.ts), [src/drivers/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/drivers/index.ts), [src/facade.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/facade.ts), [src/file-info.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/file-info.ts), [src/files.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/files.ts), [src/folders.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/folders.ts), [src/fs.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/fs.ts), [src/glob.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/glob.ts), [src/hash.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/hash.ts), [src/helpers.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/helpers.ts), [src/mime-verify.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/mime-verify.ts), [src/path-sanitize.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/path-sanitize.ts), [src/provision.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/provision.ts), [src/s3-presigned-post.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/s3-presigned-post.ts), [src/signed-url.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/signed-url.ts), [src/static-serve.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/static-serve.ts), [src/storage.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/storage.ts), [src/temporary-workspaces.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/temporary-workspaces.ts), [src/types.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/types.ts), [src/types/filesystem.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/types/filesystem.ts), [src/upload-sessions.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/upload-sessions.ts), [src/uploaded-file.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/uploaded-file.ts), [src/zip.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/src/zip.ts).
|
|
861
861
|
|
|
862
|
-
Evidence directory: [
|
|
862
|
+
Evidence directory: [53 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/storage/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
|
|
863
863
|
|
|
864
864
|
### @stacksjs/strings
|
|
865
865
|
|
|
@@ -965,11 +965,11 @@ Evidence directory: [26 retained tests](https://github.com/stacksjs/stacks/blob/
|
|
|
965
965
|
|
|
966
966
|
Guidance: [`stacks-video`](../stacks-video/SKILL.md). Source: [storage/framework/core/video/src/index.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/video/src/index.ts).
|
|
967
967
|
|
|
968
|
-
Declared runtime exports: `VideoBuilder`, `assertVideoPlanExecutable`, `createHlsMaster`, `createPreviewVtt`, `createProtectedVideoPlaylist`, `deriveVideoLadder`, `inspectVideo`, `parseByteRange`, `processVideoPlan`, `signVideoAsset`, `verifyVideoAsset`, `video`, `videoAssetHeaders`, `videoContentType`, `videoFileResponse`, `videoResponseHeaders`.
|
|
968
|
+
Declared runtime exports: `VideoBuilder`, `assertVideoPlanExecutable`, `createHlsMaster`, `createPreviewVtt`, `createProtectedVideoPlaylist`, `deriveVideoLadder`, `inspectVideo`, `inspectVideoFile`, `isFaststart`, `parseByteRange`, `processVideoPlan`, `signVideoAsset`, `verifyVideoAsset`, `video`, `videoAssetHeaders`, `videoContentType`, `videoFileResponse`, `videoResponseHeaders`, `webReadyProblems`.
|
|
969
969
|
|
|
970
|
-
Local source modules: [src/files.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/video/src/files.ts), [src/inspect.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/video/src/inspect.ts).
|
|
970
|
+
Local source modules: [src/files.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/video/src/files.ts), [src/inspect.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/video/src/inspect.ts), [src/upload.ts](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/video/src/upload.ts).
|
|
971
971
|
|
|
972
|
-
Evidence directory: [
|
|
972
|
+
Evidence directory: [4 retained tests](https://github.com/stacksjs/stacks/blob/main/storage/framework/core/video/tests). These files are evidence pointers, not a claim that all tests were run for this catalog.
|
|
973
973
|
|
|
974
974
|
### @stacksjs/waf
|
|
975
975
|
|
|
@@ -412,6 +412,57 @@ const path = await file.move('new/path/file.jpg', 'local')
|
|
|
412
412
|
|
|
413
413
|
`store()` generates a hash-based filename using `crypto.randomUUID()`. `storeAs()` validates the filename: rejects path traversal (`..`), forward slashes, and backslashes.
|
|
414
414
|
|
|
415
|
+
## Uploads in parts (upload sessions)
|
|
416
|
+
|
|
417
|
+
For files too large or too precious for one request: a phone clip on a gym's
|
|
418
|
+
wifi, anything behind a gateway with a body limit. The client announces the
|
|
419
|
+
file, sends parts of 8 MiB that are each retried alone, and a part that
|
|
420
|
+
arrived is never sent again, even after the page reloads.
|
|
421
|
+
|
|
422
|
+
```ts
|
|
423
|
+
import { createUploadSessions, UploadSessionError } from '@stacksjs/storage'
|
|
424
|
+
|
|
425
|
+
const uploads = createUploadSessions({
|
|
426
|
+
directory: storagePath('app/upload-sessions'), // local, private to this process
|
|
427
|
+
maxBytes: 2 * 1024 ** 3,
|
|
428
|
+
})
|
|
429
|
+
|
|
430
|
+
// POST /uploads -> begin
|
|
431
|
+
const upload = await uploads.begin({ owner: String(user.id), name, size, type, meta })
|
|
432
|
+
// GET /uploads/{id} -> which parts are in
|
|
433
|
+
await uploads.status(id, owner)
|
|
434
|
+
// PUT /uploads/{id}/parts/{n} -> the part's raw bytes (application/octet-stream)
|
|
435
|
+
await uploads.receive(id, owner, index, new Uint8Array(await request.arrayBuffer()))
|
|
436
|
+
// DELETE /uploads/{id}
|
|
437
|
+
await uploads.abort(id, owner)
|
|
438
|
+
|
|
439
|
+
// In the action that uses the file:
|
|
440
|
+
const done = await uploads.complete(id, owner) // { path, name, size, type, meta, discard }
|
|
441
|
+
await Storage.disk().putStream(key, Bun.file(done.path).stream(), { contentType })
|
|
442
|
+
await done.discard()
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
- Every call names the `owner` given at `begin`; anyone else gets `not-found`,
|
|
446
|
+
the same as an id that never existed. `UploadSessionError` carries the HTTP
|
|
447
|
+
`status` to answer with (404, 409 incomplete, 413, 422, 429).
|
|
448
|
+
- A part must be exactly `partBytes` (the last one, the remainder). Sending one
|
|
449
|
+
again replaces it, so a retry after a timeout is safe. `complete` is safe to
|
|
450
|
+
repeat too.
|
|
451
|
+
- Parts live on this machine's filesystem, not on a disk: an object store
|
|
452
|
+
cannot append, and consumers need a path. With several servers, share the
|
|
453
|
+
directory or pin a session to one of them.
|
|
454
|
+
- Run `uploads.prune()` from the scheduler; unfinished sessions go after
|
|
455
|
+
`ttlSeconds` (a day by default). `maxOpenPerOwner` caps what one account can
|
|
456
|
+
leave lying around.
|
|
457
|
+
- Browser side: `uploadInParts(file, { endpoint, transport, onProgress, signal,
|
|
458
|
+
resumeKey })` from `@stacksjs/browser` speaks exactly these routes, retries
|
|
459
|
+
each part with a growing pause, honours `Retry-After`, and with
|
|
460
|
+
`resumeKey: uploadResumeKey(file, purpose)` continues a file picked again.
|
|
461
|
+
Route bodies are `{ upload: <session view> }`.
|
|
462
|
+
|
|
463
|
+
Source: core/storage/src/upload-sessions.ts, core/browser/src/utils/uploads.ts.
|
|
464
|
+
Tests: core/storage/tests/upload-sessions.test.ts, core/browser/tests/uploads.test.ts.
|
|
465
|
+
|
|
415
466
|
## Low-Level File Operations
|
|
416
467
|
|
|
417
468
|
### Read/Write Files
|
|
@@ -31,3 +31,32 @@ pipeline; they do not certify live encoding support on an arbitrary machine.
|
|
|
31
31
|
Test invalid ranges, signatures/expiry, capabilities and file metadata.
|
|
32
32
|
Source: core/video/src/index.ts, files.ts and inspect.ts. Retained tests:
|
|
33
33
|
video.test.ts, process.test.ts and files.test.ts.
|
|
34
|
+
|
|
35
|
+
## Uploads: convert on the device, check on the server
|
|
36
|
+
|
|
37
|
+
A picked clip is converted in the browser before it is sent, and the server
|
|
38
|
+
reads what arrived instead of believing the client.
|
|
39
|
+
|
|
40
|
+
- Browser: `prepareVideoUpload(file, { onProgress, signal })` from
|
|
41
|
+
`@stacksjs/video/browser` (its own path; nothing server-side comes with it).
|
|
42
|
+
It answers `{ video, poster?, converter }`: an upright H.264 and AAC MP4
|
|
43
|
+
inside 1280 by 720 at 30 frames a second with its index first, and a JPEG
|
|
44
|
+
poster, encoded with the browser's own codecs (WebCodecs through ts-videos).
|
|
45
|
+
It never fails an upload: without WebCodecs, or for a clip the browser cannot
|
|
46
|
+
read, `video` is the original and `converter` is null (`reason` says why).
|
|
47
|
+
Only a cancellation throws. `canPrepareVideoUpload()` is the cheap check.
|
|
48
|
+
- Server: `inspectVideo(bytes)` or `inspectVideoFile(path)` (reads the first
|
|
49
|
+
8 MB, the rest only when the index is at the end) answer the container,
|
|
50
|
+
codecs, the frame as shown and its `rotation`; `isFaststart(bytes)` reads the
|
|
51
|
+
box order; `webReadyProblems(inspection, faststart)` lists why a file is not
|
|
52
|
+
what `prepareVideoUpload` makes, and is empty when it is. A client's
|
|
53
|
+
"converted" flag is worth exactly that check.
|
|
54
|
+
- Send large files with upload sessions (`createUploadSessions` in
|
|
55
|
+
`@stacksjs/storage`, `uploadInParts` in `@stacksjs/browser`), then inspect
|
|
56
|
+
the finished file by path.
|
|
57
|
+
|
|
58
|
+
There is no server-side encoder in this package: a Bun process has no
|
|
59
|
+
WebCodecs. Do not promise a transcode on upload; convert on the device, or
|
|
60
|
+
run an ffmpeg job of your own.
|
|
61
|
+
Source: core/video/src/browser.ts and upload.ts. Tests: upload.test.ts, with a
|
|
62
|
+
real phone clip and the clip a browser made of it as fixtures.
|
package/ide/vscode/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"publisher": "Stacks",
|
|
3
3
|
"name": "vscode-stacks",
|
|
4
4
|
"displayName": "Stacks",
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.672",
|
|
6
6
|
"description": "Stacks, built into VS Code: stx templates, pickier linting and formatting, encrypted env files, the dev server preview and every buddy command. No other extensions required.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"funding": "https://github.com/sponsors/chrisbbreuer",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/defaults",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.672",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@iconify-json/f7": "^1.2.2",
|
|
47
47
|
"@iconify-json/hugeicons": "^1.2.35",
|
|
48
|
-
"@stacksjs/mobile": "0.75.
|
|
48
|
+
"@stacksjs/mobile": "0.75.672",
|
|
49
49
|
"@stacksjs/sanitizer": "^0.2.930",
|
|
50
50
|
"@stacksjs/stx": "^0.2.930",
|
|
51
|
-
"@stacksjs/strings": "0.75.
|
|
51
|
+
"@stacksjs/strings": "0.75.672",
|
|
52
52
|
"@xterm/addon-fit": "^0.11.0",
|
|
53
53
|
"@xterm/xterm": "^6.0.0",
|
|
54
54
|
"ts-qr-codes": "^0.1.8",
|
|
55
|
-
"@stacksjs/support": "0.75.
|
|
56
|
-
"@stacksjs/browser": "0.75.
|
|
55
|
+
"@stacksjs/support": "0.75.672",
|
|
56
|
+
"@stacksjs/browser": "0.75.672"
|
|
57
57
|
}
|
|
58
58
|
}
|