@zerotal/core 1.0.1 → 1.0.3
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/package.json +1 -1
- package/src/application/Application.ts +25 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,14 @@ follows the Zerotal monorepo's unified versioning.
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [1.0.3] — 2026-08-07
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Re-released from a rebuilt repository so the build provenance resolves. The
|
|
16
|
+
1.0.2 attestation names a repository that was renamed away, which leaves the
|
|
17
|
+
signature valid but the trace back to source dangling. No code changed.
|
|
18
|
+
|
|
11
19
|
### Added
|
|
12
20
|
|
|
13
21
|
- `@zerotal/core/storage` — file storage (local and S3-compatible disks) now
|
package/package.json
CHANGED
|
@@ -42,6 +42,7 @@ import { isProdLike } from "../support/env.ts";
|
|
|
42
42
|
import { appKeyStrengthWarning } from "../support/appKey.ts";
|
|
43
43
|
import { runBootDoctor } from "./BootDoctor.ts";
|
|
44
44
|
import { runConfigValidators } from "../config/validation.ts";
|
|
45
|
+
import { pathToFileURL } from "node:url";
|
|
45
46
|
import { currentApp, defaultApp, setDefaultApp } from "./currentApp.ts";
|
|
46
47
|
import type { ConfigValidator, RegisteredConfigValidator } from "../config/validation.ts";
|
|
47
48
|
|
|
@@ -1040,7 +1041,7 @@ export class Application {
|
|
|
1040
1041
|
|
|
1041
1042
|
private async _loadRoutes(): Promise<void> {
|
|
1042
1043
|
for (const { file, prefix, middleware } of this._routeGroups) {
|
|
1043
|
-
await Router.groupAsync({ prefix, middleware }, () => import(file));
|
|
1044
|
+
await Router.groupAsync({ prefix, middleware }, () => import(_toImportable(file)));
|
|
1044
1045
|
}
|
|
1045
1046
|
}
|
|
1046
1047
|
|
|
@@ -1669,3 +1670,26 @@ export class Application {
|
|
|
1669
1670
|
};
|
|
1670
1671
|
}
|
|
1671
1672
|
}
|
|
1673
|
+
|
|
1674
|
+
/**
|
|
1675
|
+
* Make a route-file path safe to hand to `import()`.
|
|
1676
|
+
*
|
|
1677
|
+
* `routing({ web: `${import.meta.dir}/../routes/index.ts` })` is the documented
|
|
1678
|
+
* way to point at a routes file, and on Windows that produces `C:\…\routes\…`.
|
|
1679
|
+
* Passed straight to `import()` the drive letter reads as a URL protocol, so the
|
|
1680
|
+
* module never loads and every route 404s with nothing logged. A `file://` URL
|
|
1681
|
+
* removes the ambiguity.
|
|
1682
|
+
*
|
|
1683
|
+
* Bare specifiers are left alone — someone may legitimately point at a package.
|
|
1684
|
+
*/
|
|
1685
|
+
function _toImportable(file: string): string {
|
|
1686
|
+
// Character checks rather than a regex: the separator can be either slash on
|
|
1687
|
+
// Windows, and an escaped one inside a character class is the kind of detail
|
|
1688
|
+
// that silently matches half of what it should.
|
|
1689
|
+
const sep = file[2];
|
|
1690
|
+
const isWindowsPath = file.length > 2 && file[1] === ":" && (sep === "\\" || sep === "/");
|
|
1691
|
+
const isPosixPath = file.startsWith("/");
|
|
1692
|
+
|
|
1693
|
+
if (!isWindowsPath && !isPosixPath) return file;
|
|
1694
|
+
return pathToFileURL(file).href;
|
|
1695
|
+
}
|