Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.10.1] - 2026-07-16

### Added

- `bagdock init` scaffolds an `OPERATOR_CONFIG` KV namespace for edge projects (the per-installation lifecycle/config state store edge adapters use).
- `bagdock dev` now emits `[[kv_namespaces]]` bindings in the generated `wrangler.toml` for any `kv` declared in `bagdock.json`, so local Miniflare persists KV between runs. No effect on projects without KV.

## [0.10.0] - 2026-07-16

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bagdock/cli",
"version": "0.10.0",
"version": "0.10.1",
"description": "Bagdock developer CLI — build, test, and deploy apps and edges on the Bagdock platform",
"keywords": [
"bagdock",
Expand Down
12 changes: 12 additions & 0 deletions src/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ function generateWranglerToml(config: ReturnType<typeof loadBagdockJson> & {}, p
lines.push('')
}

// KV namespace bindings (local dev uses preview_id for Miniflare persistence)
if (config.kv && Object.keys(config.kv).length > 0) {
for (const [binding, meta] of Object.entries(config.kv)) {
lines.push(`# ${meta.description ?? binding}`)
lines.push(`[[kv_namespaces]]`)
lines.push(`binding = "${binding}"`)
lines.push(`id = "local-dev-${binding.toLowerCase()}"`)
lines.push(`preview_id = "local-dev-${binding.toLowerCase()}"`)
lines.push('')
}
}

// Environment variable bindings (declared in [vars] for dev, actual values from .dev.vars)
if (config.env && Object.keys(config.env).length > 0) {
lines.push(`[vars]`)
Expand Down
5 changes: 5 additions & 0 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ export async function init(dir: string, opts: InitOptions) {
env: {
API_KEY: { description: 'Provider API key', required: true },
},
...(type === 'edge' ? {
kv: {
OPERATOR_CONFIG: { description: 'Per-installation state store for lifecycle and config' },
},
} : {}),
}

await promptPublisherOverrides(config, opts)
Expand Down