Skip to content

feat: add db-sqlite module - #155

Merged
lloydrichards merged 5 commits into
mainfrom
feat/db-module
Jul 4, 2026
Merged

feat: add db-sqlite module#155
lloydrichards merged 5 commits into
mainfrom
feat/db-module

Conversation

@lloydrichards

@lloydrichards lloydrichards commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Goals/Scope

Add a new SQLite database module.

Description

  • Add catalog support for module capabilities.
  • Introduce a new SQLite database module.
  • Fix scaffold logic for conditional package entries.
  • Update capacity handling (adjust maxtric to include capacities).
  • Refactor the add command to validate capacity inputs.

@changeset-bot

changeset-bot Bot commented Jun 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: accc7ed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stack-effect Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lloydrichards lloydrichards changed the title feat/db-module feat: add db-sqlite module Jun 28, 2026
@lloydrichards
lloydrichards requested a review from Copilot July 3, 2026 07:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a reusable SQLite database foundation module to the catalog and introduces “module capabilities” so modules can depend on abstract capabilities (e.g., db-sql) that the add command can resolve to concrete provider modules.

Changes:

  • Introduces catalog-level capability modeling (provides + required-capability) and capability provider lookup.
  • Adds a new db-sqlite package module with generated SQLite configuration, migrations, and health-check scripts.
  • Updates scaffolding + CLI logic to support conditional package.json entries and capability-driven dependency resolution.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/scaffold/src/service/plan/ContributionResolver.ts Enables conditional pkg-json-entry contributions by resolving templates and dropping empty names.
packages/scaffold/src/service/blueprint/BlueprintService.ts Fails Blueprint resolution on unresolved capability deps to enforce pre-resolution.
packages/domain/src/Catalog.ts Adds ModuleCapability, required-capability dependency type, and provides on module definitions/tree output.
packages/catalog/src/registry/modules/packages.ts Registers new db-sqlite module and its file + package.json contributions.
packages/catalog/src/registry/moduleRegistry.test.ts Adds validation that required capabilities always have compatible provider modules.
packages/catalog/src/registry/content/db.ts New generated source templates for SQLite database layer, migrations, and scripts.
packages/catalog/src/CatalogService.ts Builds capability→providers index and exposes getCapabilityProviders; enriches catalog tree with capability metadata.
apps/cli/src/commands/add.ts Adds capability resolution into add dependency resolution (interactive selection vs non-interactive failure).
apps/cli/e2e/matrix.test.ts Adds e2e coverage harness for required-capability resolution paths (currently gated on catalog usage).
.changeset/curly-parks-learn.md Publishes db-sqlite as a minor feature.
.changeset/clear-colts-roll.md Publishes module capabilities as a minor feature.

Comment on lines +526 to +565
if (capabilityMatrix.length > 0) {
layer(CLI.layer)("modules with required capabilities", (it) => {
for (const entry of capabilityMatrix) {
it.effect(
entry.label,
() =>
Effect.gen(function* () {
const cli = yield* CLI;
const name = `matrix-capability-${entry.capability}-${entry.requiringModule}-${entry.providerModule}`;
const root = `${cli.workdir}/${name}`;

yield* cli.run("init", name, "--yes", "--root", cli.workdir);
yield* cli.expectExitCode(0);

yield* cli.run(
"add",
"--yes",
"--root",
root,
"--target",
entry.requiringTarget,
"--modules",
entry.requiringModule,
);

if (entry.providerCount === 1) {
yield* cli.expectExitCode(0);

yield* cli.withinProject(name, function* (project) {
yield* project.expectTypeCheckPasses();
});
} else {
yield* cli.expectExitCode(1);
}
}).pipe(Effect.provide(CLI.layer)),
{ timeout: 180_000 },
);
}
});
}
@lloydrichards
lloydrichards force-pushed the feat/db-module branch 2 times, most recently from cb5e6bc to 8ced7df Compare July 3, 2026 09:21
@lloydrichards
lloydrichards merged commit f2fa578 into main Jul 4, 2026
6 checks passed
@lloydrichards
lloydrichards deleted the feat/db-module branch July 4, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add reusable db-sqlite foundation module

2 participants