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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ intermediate representation. Not GitHub Actions YAML. Not GitLab CI YAML.
Your workflow, defined once, lowered everywhere.

```ts
import { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs";
import { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk";

const proj = new Project("verify");
const p = new Pipeline(proj, "ci");
Expand Down Expand Up @@ -57,7 +57,7 @@ All three produce the **same Definition Graph**:
### Construct API

```ts
import { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs";
import { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk";

const proj = new Project("myproj");
const p = new Pipeline(proj, "ci");
Expand All @@ -68,7 +68,7 @@ new Entry(p, "on-push", { trigger: { kind: "push" }, roots: ["build"] });
### SDK API

```ts
import { Project, Pipeline, Entry } from "@sverka/constructs";
import { Project, Pipeline, Entry } from "@sverka/cdk";
import { sh } from "@sverka/sdk";

const proj = new Project("myproj");
Expand All @@ -81,7 +81,7 @@ new Entry(p, "on-push", { trigger: { kind: "push" }, roots: ["build"] });

```ts
import { pipeline, step, entry, decoratePipeline } from "@sverka/decorators";
import { Project } from "@sverka/constructs";
import { Project } from "@sverka/cdk";

@pipeline
class MyPipeline {
Expand Down Expand Up @@ -165,7 +165,7 @@ sverka synth --target gitlab

| Package | Description |
|---------|-------------|
| `@sverka/constructs` | Construct API: Project, Pipeline, ShellStep, Entry |
| `@sverka/cdk` | Construct API: Project, Pipeline, ShellStep, Entry |
| `@sverka/sdk` | SDK API: sh, artifact, when, images, context refs |
| `@sverka/decorators` | Decorator API: @pipeline, @step, @entry, @input |
| `@sverka/core` | Definition Graph synthesis and validation |
Expand Down
59 changes: 35 additions & 24 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions engdocs/adr/ADR-010-construct-core-boundary.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## Context

Wave A of the v0 redesign creates two packages: `@sverka/constructs` (new) and
Wave A of the v0 redesign creates two packages: `@sverka/cdk` (new) and
`@sverka/core` (rebuilt). The architecture spec (§8, §10, §16) requires a
construct tree (ownership, identity, composition) separate from a Definition
Graph (scheduling, dependencies, data transfer). Shared model types — Trigger,
Expand All @@ -16,12 +16,13 @@ Definition Graph + synthesis.

## Decision

- **`@sverka/constructs`** owns: SverkaConstruct, Project, Pipeline, Step,
ShellStep, Entry (construct classes) + shared model types (Trigger,
Reference, Runtime, Input, Output). Depends only on `constructs@10.8.1` (npm).
- **`@sverka/cdk`** owns: Project, Pipeline, Step,
ShellStep, Entry (construct classes extending `Construct` from `constructs@10.8.1`)
+ shared model types (Trigger, Reference, Runtime, Input, Output).
Depends only on `constructs@10.8.1` (npm).
- **`@sverka/core`** owns: Definition Graph types (ProjectDefinition,
StepDefinition, etc.), OperationDefinition, Dependency, `synthesize()`,
validation. Depends on `@sverka/constructs`.
validation. Depends on `@sverka/cdk`.

Dependency direction: `core → constructs`. No circular dependencies. The
foundation layer (`constructs`) has zero `@sverka/*` deps.
Expand All @@ -39,10 +40,10 @@ authored directly. They live in `core`.

## Consequences

- `@sverka/constructs` is the foundation: no `@sverka/*` dependencies.
- `@sverka/core` depends on `@sverka/constructs` for model types and the
- `@sverka/cdk` is the foundation: no `@sverka/*` dependencies.
- `@sverka/core` depends on `@sverka/cdk` for model types and the
Project input to `synthesize()`.
- SDK (Wave C) and Decorators (Wave D) depend on `@sverka/constructs` (they
- SDK (Wave C) and Decorators (Wave D) depend on `@sverka/cdk` (they
build construct trees) and optionally `@sverka/core` (for `synthesize()`).
- IR (Wave B) depends on `@sverka/core` for Definition Graph types to
serialize.
Expand Down
10 changes: 5 additions & 5 deletions engdocs/architecture/v0-wave-A-plan.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Wave A Implementation Plan — Constructs + Definition Graph

**Specs:** 01-constructs, 02-definition-graph, 05-synthesis
**Packages:** `@sverka/constructs` (new), `@sverka/core` (rebuilt)
**Packages:** `@sverka/cdk` (new), `@sverka/core` (rebuilt)
**Date:** 2026-08-13

## Package dependency

```text
@sverka/constructs → constructs@10.8.1 (npm)
@sverka/core → @sverka/constructs
@sverka/cdk → constructs@10.8.1 (npm)
@sverka/core → @sverka/cdk
```

No other `@sverka/*` deps. Foundation layer.
Expand Down Expand Up @@ -56,7 +56,7 @@ Create `packages/constructs/` and rebuild `packages/core/` with:
- `src/index.ts` (empty exports)

Add `constructs@10.8.1` to `packages/constructs/package.json` dependencies.
Add `@sverka/constructs: "workspace:*"` to `packages/core/package.json` dependencies.
Add `@sverka/cdk: "workspace:*"` to `packages/core/package.json` dependencies.

Delete old `packages/core/src/` contents (composables, operation.ts, runtime.ts,
errors.ts, internal/, __tests__/) — full rebuild.
Expand Down Expand Up @@ -233,7 +233,7 @@ and D will assert SDK and Decorator APIs produce the same graph.
- `tsdown.config.ts`: copy findings template. Entry: `src/index.ts`.
- `tsconfig.json`: copy findings template.
- `constructs` package: add `"constructs": "10.8.1"` to dependencies.
- `core` package: add `"@sverka/constructs": "workspace:*"` to dependencies.
- `core` package: add `"@sverka/cdk": "workspace:*"` to dependencies.
Delete all old src/ files first.
- `verbatimModuleSyntax: true` — use `import type` for type-only imports.
- `exactOptionalPropertyTypes: true` — don't set optional props to `undefined`.
Expand Down
2 changes: 1 addition & 1 deletion engdocs/architecture/v0-wave-B-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

```
@sverka/ir → @sverka/core (DefinitionGraph types + validateGraph)
@sverka/core → @sverka/constructs (unchanged from Wave A)
@sverka/core → @sverka/cdk (unchanged from Wave A)
```

No new external dependencies. Uses `node:crypto` (built-in).
Expand Down
6 changes: 3 additions & 3 deletions engdocs/architecture/v0-wave-C-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Package dependency

```text
@sverka/sdk → @sverka/constructs
@sverka/sdk → @sverka/cdk
(Project, Pipeline, ShellStep, Entry, model types)
```

Expand All @@ -21,7 +21,7 @@ runtime/findings/policy. That entire API (`defineWorkflow`, `task`, `run`,
`pipeline`, `createSverka`) is **discarded** — it was the flat Plan model.

The new SDK is much simpler: composables that build construct trees. No
runtime, no IR, no policy. Just factory functions over `@sverka/constructs`.
runtime, no IR, no policy. Just factory functions over `@sverka/cdk`.

## File layout

Expand Down Expand Up @@ -53,7 +53,7 @@ src/

### Step 1: Scaffold

Delete old SDK source. Update `package.json` deps: `@sverka/constructs:
Delete old SDK source. Update `package.json` deps: `@sverka/cdk:
"workspace:*"` only (remove all old deps). Fix `project.json` lint target
(remove `--ext .ts`). Create empty `src/index.ts`.

Expand Down
2 changes: 1 addition & 1 deletion engdocs/user/compilers/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Graph to GitHub Actions YAML. Source: `packages/github/src/target.ts`.
```ts
import { GithubTarget, compileGithub } from "@sverka/github";
import { synthesize } from "@sverka/core";
import { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs";
import { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk";

const proj = new Project("myproj");
const p = new Pipeline(proj, "ci");
Expand Down
2 changes: 1 addition & 1 deletion engdocs/user/compilers/gitlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Graph to GitLab CI YAML. Source: `packages/gitlab/src/target.ts`.
```ts
import { GitlabTarget, compileGitlab } from "@sverka/gitlab";
import { synthesize } from "@sverka/core";
import { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs";
import { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk";

const proj = new Project("myproj");
const p = new Pipeline(proj, "ci");
Expand Down
8 changes: 4 additions & 4 deletions engdocs/user/getting-started/first-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Create `sverka.config.ts` in your project root (or run `sverka init` to
generate one):

```ts
import { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs";
import { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk";

const proj = new Project("verify");
const pipeline = new Pipeline(proj, "ci");
Expand Down Expand Up @@ -76,7 +76,7 @@ Sverka offers three equivalent ways to author pipelines:
### Construct API

```ts
import { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs";
import { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk";

const proj = new Project("myproj");
const p = new Pipeline(proj, "ci");
Expand All @@ -87,7 +87,7 @@ new Entry(p, "on-push", { trigger: { kind: "push" }, roots: ["build"] });
### SDK API

```ts
import { Project, Pipeline, Entry } from "@sverka/constructs";
import { Project, Pipeline, Entry } from "@sverka/cdk";
import { sh } from "@sverka/sdk";

const proj = new Project("myproj");
Expand All @@ -100,7 +100,7 @@ new Entry(p, "on-push", { trigger: { kind: "push" }, roots: ["build"] });

```ts
import { pipeline, step, entry, decoratePipeline } from "@sverka/decorators";
import { Project } from "@sverka/constructs";
import { Project } from "@sverka/cdk";

@pipeline
class MyPipeline {
Expand Down
6 changes: 3 additions & 3 deletions engdocs/user/getting-started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ This installs the `sverka` command globally.

## Add the SDK to your project

The CLI generates a `sverka.config.ts` that imports from `@sverka/constructs`.
`@sverka/constructs` is required in your project so the config can resolve its
The CLI generates a `sverka.config.ts` that imports from `@sverka/cdk`.
`@sverka/cdk` is required in your project so the config can resolve its
imports. Add `@sverka/sdk` and/or `@sverka/decorators` for the authoring
surfaces you use.

```sh
cd your-project
bun add @sverka/constructs
bun add @sverka/cdk
```

Install `@sverka/sdk` and/or `@sverka/decorators` only when you want those
Expand Down
Loading