@zerotal/core 1.1.0 → 1.3.0

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 CHANGED
@@ -13,7 +13,7 @@ follows the Zerotal monorepo's unified versioning.
13
13
  ### Fixed
14
14
 
15
15
  - **`bun zt test` no longer fails a cold suite on Bun's 5-second hook timeout.** A `beforeAll` that calls `createTestApp()` boots providers and runs migrations, which exceeds 5s on a cold start; `bunfig.toml`'s `[test] timeout` does not cover hooks, only the CLI flag does. The failure appeared on the first run and not the second, which reads as flakiness and sends you looking for a race that is not there. The default is now 30s, still overridable with `--timeout`.
16
- - **`serve --dev` no longer loses its server to a restart race.** The debounce timer spaced out the *scheduling* of a restart, but its callback cleared the timer and then awaited a rebuild that can take seconds — so a change arriving in that window scheduled a second callback which ran concurrently. Both reached the spawn, two servers raced for the port, and the loser died with "Failed to start server. Is port 3000 in use?". Dev mode was then left owning no server while the winner kept serving stale code, so every later save appeared to do nothing. Restarts are now serialized: a request arriving mid-restart queues exactly one follow-up instead of running in parallel. A failed bind also retries briefly, since the OS releases a listening socket asynchronously after the previous owner exits, and the initial spawn uses the same path — an orphan from a previous run is the commonest reason the first bind fails. An unexpected exit is reported against the child that actually exited rather than whichever child the field happened to hold.
16
+ - **`serve --dev` no longer loses its server to a restart race.** The debounce timer spaced out the _scheduling_ of a restart, but its callback cleared the timer and then awaited a rebuild that can take seconds — so a change arriving in that window scheduled a second callback which ran concurrently. Both reached the spawn, two servers raced for the port, and the loser died with "Failed to start server. Is port 3000 in use?". Dev mode was then left owning no server while the winner kept serving stale code, so every later save appeared to do nothing. Restarts are now serialized: a request arriving mid-restart queues exactly one follow-up instead of running in parallel. A failed bind also retries briefly, since the OS releases a listening socket asynchronously after the previous owner exits, and the initial spawn uses the same path — an orphan from a previous run is the commonest reason the first bind fails. An unexpected exit is reported against the child that actually exited rather than whichever child the field happened to hold.
17
17
 
18
18
  ### Added
19
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerotal/core",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "license": "MIT",
5
5
  "maturity": "stable",
6
6
  "private": false,
package/src/http/index.ts CHANGED
@@ -30,6 +30,11 @@ export type { UrlGenerator } from "./url.ts";
30
30
  export { Http } from "./Http.ts";
31
31
  export { UploadedFile } from "./UploadedFile.ts";
32
32
  export type { StorageDisk, FileValidationOptions } from "./UploadedFile.ts";
33
+ // Exported for code that must identify bytes it did not receive as an upload —
34
+ // a file fetched from a URL or read back off a disk still needs its type read
35
+ // from its own contents rather than from whatever claimed to describe it.
36
+ export { sniffContentType } from "./sniffContentType.ts";
37
+ export type { SniffedType } from "./sniffContentType.ts";
33
38
  export { HttpClientResponse, HttpClientError, PendingRequest } from "./HttpClient.ts";
34
39
  export type { FakeStub } from "./HttpClient.ts";
35
40
  export { Resource, ResourceCollection } from "./Resource.ts";