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
|
|
@ -1551,7 +1551,7 @@ export abstract class BaseStorage extends BaseStorageAdapter {
|
|||
* - Early termination when offset + limit entities collected
|
||||
* - Memory efficient: Never loads full dataset
|
||||
*/
|
||||
public async getNounsWithPagination(options: {
|
||||
public override async getNounsWithPagination(options: {
|
||||
limit: number
|
||||
offset: number
|
||||
cursor?: string // Opaque resume token from a prior page's nextCursor; when set it supersedes offset (O(N) walk, no re-scan)
|
||||
|
|
@ -1717,7 +1717,7 @@ export abstract class BaseStorage extends BaseStorageAdapter {
|
|||
* - Memory efficient: Never loads full dataset
|
||||
* - Inline filtering for sourceId, targetId, verbType
|
||||
*/
|
||||
public async getVerbsWithPagination(options: {
|
||||
public override async getVerbsWithPagination(options: {
|
||||
limit: number
|
||||
offset: number
|
||||
cursor?: string // Opaque resume token from a prior page's nextCursor; when set it supersedes offset (O(N) walk, no re-scan)
|
||||
|
|
@ -2442,13 +2442,13 @@ export abstract class BaseStorage extends BaseStorageAdapter {
|
|||
* Clear all data from storage
|
||||
* This method should be implemented by each specific adapter
|
||||
*/
|
||||
public abstract clear(): Promise<void>
|
||||
public abstract override clear(): Promise<void>
|
||||
|
||||
/**
|
||||
* Get information about storage usage and capacity
|
||||
* This method should be implemented by each specific adapter
|
||||
*/
|
||||
public abstract getStorageStatus(): Promise<{
|
||||
public abstract override getStorageStatus(): Promise<{
|
||||
type: string
|
||||
used: number
|
||||
quota: number | null
|
||||
|
|
@ -2957,7 +2957,7 @@ export abstract class BaseStorage extends BaseStorageAdapter {
|
|||
*
|
||||
* @public - Inherited from BaseStorageAdapter
|
||||
*/
|
||||
public getBatchConfig(): StorageBatchConfig {
|
||||
public override getBatchConfig(): StorageBatchConfig {
|
||||
// Conservative defaults - adapters should override with their actual limits
|
||||
return {
|
||||
maxBatchSize: 100,
|
||||
|
|
@ -3513,7 +3513,7 @@ export abstract class BaseStorage extends BaseStorageAdapter {
|
|||
* writer flush — the same silent-stale failure mode that once produced
|
||||
* zero counts from `brain.stats()`.
|
||||
*/
|
||||
public async flushCounts(): Promise<void> {
|
||||
public override async flushCounts(): Promise<void> {
|
||||
await super.flushCounts()
|
||||
await this.saveTypeStatistics()
|
||||
await this.saveSubtypeStatistics()
|
||||
|
|
@ -4297,7 +4297,7 @@ export abstract class BaseStorage extends BaseStorageAdapter {
|
|||
* Save statistics data to storage (public interface)
|
||||
* @param statistics The statistics data to save
|
||||
*/
|
||||
public async saveStatistics(statistics: StatisticsData): Promise<void> {
|
||||
public override async saveStatistics(statistics: StatisticsData): Promise<void> {
|
||||
return this.saveStatisticsData(statistics)
|
||||
}
|
||||
|
||||
|
|
@ -4305,7 +4305,7 @@ export abstract class BaseStorage extends BaseStorageAdapter {
|
|||
* Get statistics data from storage (public interface)
|
||||
* @returns Promise that resolves to the statistics data or null if not found
|
||||
*/
|
||||
public async getStatistics(): Promise<StatisticsData | null> {
|
||||
public override async getStatistics(): Promise<StatisticsData | null> {
|
||||
return this.getStatisticsData()
|
||||
}
|
||||
|
||||
|
|
@ -4314,7 +4314,7 @@ export abstract class BaseStorage extends BaseStorageAdapter {
|
|||
* This method should be implemented by each specific adapter
|
||||
* @param statistics The statistics data to save
|
||||
*/
|
||||
protected abstract saveStatisticsData(
|
||||
protected abstract override saveStatisticsData(
|
||||
statistics: StatisticsData
|
||||
): Promise<void>
|
||||
|
||||
|
|
@ -4323,5 +4323,5 @@ export abstract class BaseStorage extends BaseStorageAdapter {
|
|||
* This method should be implemented by each specific adapter
|
||||
* @returns Promise that resolves to the statistics data or null if not found
|
||||
*/
|
||||
protected abstract getStatisticsData(): Promise<StatisticsData | null>
|
||||
protected abstract override getStatisticsData(): Promise<StatisticsData | null>
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue