chore(8.0): modernize toolchain + position Bun as a runtime
Consumer-invisible modernization pass — no public API or runtime-behavior
change; dist for the override-only files is byte-identical.
Toolchain:
- CI: GitHub Actions matrix — Node 22/24 (test:unit) + Bun latest (test:bun).
- engines: node ">=22" (was "22.x"), bun ">=1.1.0".
- tsconfig: isolatedModules + noImplicitOverride; add the 33 `override`
modifiers the flag requires across storage/integrations/vfs/transaction.
- deps: @types/node ^22; add prettier; drop dead standard-version,
@rollup/plugin-* and the redundant embedded eslintConfig (flat
eslint.config.js is the active config — verified identical lint output).
paramValidation: replace the top-level `await import('node:os'/'node:fs')`
with static ESM imports. The top-level-await form poisoned the module graph;
static imports also drop the browser/edge fallback branches no supported
runtime reaches (8.0 is Node/Bun/Deno-only).
Bun positioning: recommend Bun as a runtime (`bun add` / `bun run`), which is
green (test:bun 8/8). Drop single-binary `bun build --compile` as a target —
native addons cannot embed into it, and Bun 1.3.10 has a `--compile` codegen
regression around top-level await. Rename the Bun test to bun-runtime-test.ts
and correct docs that overclaimed single-binary support.
Gates: typecheck 0, build 0, test:unit 1743/1743, test:bun 8/8.
This commit is contained in:
parent
ae55d54cb5
commit
ca9129a924
20 changed files with 159 additions and 2330 deletions
|
|
@ -164,7 +164,7 @@ export class FileSystemStorage extends BaseStorage {
|
|||
*
|
||||
* @returns FileSystem-optimized batch configuration
|
||||
*/
|
||||
public getBatchConfig(): StorageBatchConfig {
|
||||
public override getBatchConfig(): StorageBatchConfig {
|
||||
return {
|
||||
maxBatchSize: 500,
|
||||
batchDelayMs: 0,
|
||||
|
|
@ -180,7 +180,7 @@ export class FileSystemStorage extends BaseStorage {
|
|||
/**
|
||||
* Initialize the storage adapter
|
||||
*/
|
||||
public async init(): Promise<void> {
|
||||
public override async init(): Promise<void> {
|
||||
if (this.isInitialized) {
|
||||
return
|
||||
}
|
||||
|
|
@ -952,7 +952,7 @@ export class FileSystemStorage extends BaseStorage {
|
|||
*
|
||||
* @param prefix - Storage-root-relative directory prefix to remove.
|
||||
*/
|
||||
public async removeRawPrefix(prefix: string): Promise<void> {
|
||||
public override async removeRawPrefix(prefix: string): Promise<void> {
|
||||
await this.ensureInitialized()
|
||||
await fs.promises.rm(path.join(this.rootDir, prefix), { recursive: true, force: true })
|
||||
}
|
||||
|
|
@ -966,7 +966,7 @@ export class FileSystemStorage extends BaseStorage {
|
|||
*
|
||||
* @param paths - Storage-root-relative object paths previously written.
|
||||
*/
|
||||
public async syncRawObjects(paths: string[]): Promise<void> {
|
||||
public override async syncRawObjects(paths: string[]): Promise<void> {
|
||||
await this.ensureInitialized()
|
||||
const parentDirs = new Set<string>()
|
||||
|
||||
|
|
@ -1539,7 +1539,7 @@ export class FileSystemStorage extends BaseStorage {
|
|||
// Removed 10 *_internal method overrides - now inherit from BaseStorage's type-first implementation
|
||||
// Removed 2 pagination methods (getNounsWithPagination, getVerbsWithPagination) - use BaseStorage's implementation
|
||||
|
||||
public supportsMultiProcessLocking(): boolean {
|
||||
public override supportsMultiProcessLocking(): boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
@ -1557,7 +1557,7 @@ export class FileSystemStorage extends BaseStorage {
|
|||
* `lastHeartbeat` is older than `WRITER_STALE_THRESHOLD_MS` (60s).
|
||||
* Stale locks are overwritten with a warning. `force: true` overrides even live locks.
|
||||
*/
|
||||
public async acquireWriterLock(options?: { force?: boolean }): Promise<WriterLockInfo | null> {
|
||||
public override async acquireWriterLock(options?: { force?: boolean }): Promise<WriterLockInfo | null> {
|
||||
await this.ensureInitialized()
|
||||
await this.ensureDirectoryExists(this.lockDir)
|
||||
|
||||
|
|
@ -1639,7 +1639,7 @@ export class FileSystemStorage extends BaseStorage {
|
|||
return info
|
||||
}
|
||||
|
||||
public async releaseWriterLock(): Promise<void> {
|
||||
public override async releaseWriterLock(): Promise<void> {
|
||||
if (this.writerLockHeartbeat) {
|
||||
clearInterval(this.writerLockHeartbeat)
|
||||
this.writerLockHeartbeat = undefined
|
||||
|
|
@ -1664,7 +1664,7 @@ export class FileSystemStorage extends BaseStorage {
|
|||
}
|
||||
}
|
||||
|
||||
public async readWriterLock(): Promise<WriterLockInfo | null> {
|
||||
public override async readWriterLock(): Promise<WriterLockInfo | null> {
|
||||
await this.ensureInitialized()
|
||||
const lockFile = path.join(this.lockDir, FileSystemStorage.WRITER_LOCK_FILE)
|
||||
try {
|
||||
|
|
@ -1749,7 +1749,7 @@ export class FileSystemStorage extends BaseStorage {
|
|||
* `locks/_flush_responses/` with the same request ID. Stale `.req` files
|
||||
* (>FLUSH_REQUEST_TTL_MS) are garbage-collected on every tick.
|
||||
*/
|
||||
public startFlushRequestWatcher(onRequest: () => Promise<void>): void {
|
||||
public override startFlushRequestWatcher(onRequest: () => Promise<void>): void {
|
||||
if (this.flushWatcherInterval) return // already watching
|
||||
this.flushWatcherOnRequest = onRequest
|
||||
|
||||
|
|
@ -1772,7 +1772,7 @@ export class FileSystemStorage extends BaseStorage {
|
|||
}
|
||||
}
|
||||
|
||||
public stopFlushRequestWatcher(): void {
|
||||
public override stopFlushRequestWatcher(): void {
|
||||
if (this.flushWatcherInterval) {
|
||||
clearInterval(this.flushWatcherInterval)
|
||||
this.flushWatcherInterval = undefined
|
||||
|
|
@ -1851,7 +1851,7 @@ export class FileSystemStorage extends BaseStorage {
|
|||
* Inspector side: drop a `.req` file and poll for the corresponding `.ack`.
|
||||
* Returns true if the writer acknowledged in time, false on timeout.
|
||||
*/
|
||||
public async requestFlushOverFilesystem(timeoutMs: number): Promise<boolean> {
|
||||
public override async requestFlushOverFilesystem(timeoutMs: number): Promise<boolean> {
|
||||
await this.ensureInitialized()
|
||||
const reqDir = path.join(this.lockDir, FileSystemStorage.FLUSH_REQUEST_DIR)
|
||||
const ackDir = path.join(this.lockDir, FileSystemStorage.FLUSH_RESPONSE_DIR)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue