Skip to content

fix(cli): avoid node:sqlite ExperimentalWarning on non-SQLite storage imports #1257

Description

@xuruiray

Summary

Importing the top-level @maka/storage package eagerly evaluates the SQLite runtime store and writes Node's ExperimentalWarning to stderr, even when the caller only uses a non-SQLite store.

Reproduction

Environment: Node v22.22.0, current main at 6274189092ca7771427671cc48aafb63edcb9057.

node --input-type=module -e "await import('@maka/storage')"
node --input-type=module -e "await import('./packages/storage/dist/session-store.js')"

Actual behavior

The top-level package import prints:

Image
ExperimentalWarning: SQLite is an experimental feature and might change at any time

The direct non-SQLite module import remains clean.

Evidence

The screenshot below captures both commands in the same VS Code integrated terminal:

Impact

  • CLI subprocess tests that require clean stderr fail.
  • Commands such as maka inspect / maka run can expose unrelated SQLite warnings to users.
  • Non-SQLite consumers pay a runtime side effect for a feature they did not request.

Root cause evidence

  • packages/storage/src/index.ts re-exports ./sqlite-runtime-store.js.
  • packages/storage/src/sqlite-runtime-store.ts statically imports DatabaseSync from node:sqlite.
  • Importing the barrel therefore evaluates node:sqlite eagerly.

Acceptance criteria

  • Importing @maka/storage without constructing a SQLite store writes nothing to stderr.
  • Constructing and using the SQLite runtime store still works.
  • Existing CLI, storage, build, typecheck, lint, and regression tests pass.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions