diff --git a/README.md b/README.md index 73bb7b3be..de7525852 100644 --- a/README.md +++ b/README.md @@ -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"); @@ -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"); @@ -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"); @@ -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 { @@ -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 | diff --git a/bun.lock b/bun.lock index cb1c10a3f..4389b734a 100644 --- a/bun.lock +++ b/bun.lock @@ -15,6 +15,18 @@ "vitest": "3.2.7", }, }, + "packages/cdk": { + "name": "@sverka/cdk", + "version": "0.0.0", + "dependencies": { + "constructs": "10.8.1", + }, + "devDependencies": { + "tsdown": "^0.22.0", + "typescript": "^5.8.0", + "vitest": "^3.0.0", + }, + }, "packages/checks": { "name": "@sverka/checks", "version": "0.0.0", @@ -36,9 +48,16 @@ "sverka": "./dist/bin.mjs", }, "dependencies": { - "@sverka/compiler-github": "workspace:*", - "@sverka/compiler-gitlab": "workspace:*", - "@sverka/sdk": "workspace:*", + "@sverka/cdk": "workspace:*", + "@sverka/checks": "workspace:*", + "@sverka/core": "workspace:*", + "@sverka/engine-native": "workspace:*", + "@sverka/findings": "workspace:*", + "@sverka/ir": "workspace:*", + "@sverka/planner": "workspace:*", + "@sverka/policy": "workspace:*", + "@sverka/runtime-docker": "workspace:*", + "@sverka/runtime-host": "workspace:*", "yargs": "^17.7.3", }, "devDependencies": { @@ -87,7 +106,7 @@ "name": "@sverka/conformance", "version": "0.0.0", "dependencies": { - "@sverka/constructs": "workspace:*", + "@sverka/cdk": "workspace:*", "@sverka/core": "workspace:*", "@sverka/decorators": "workspace:*", "@sverka/engine-native": "workspace:*", @@ -106,23 +125,11 @@ "yaml": "^2.9.0", }, }, - "packages/constructs": { - "name": "@sverka/constructs", - "version": "0.0.0", - "dependencies": { - "constructs": "10.8.1", - }, - "devDependencies": { - "tsdown": "^0.22.0", - "typescript": "^5.8.0", - "vitest": "^3.0.0", - }, - }, "packages/core": { "name": "@sverka/core", "version": "0.0.0", "dependencies": { - "@sverka/constructs": "workspace:*", + "@sverka/cdk": "workspace:*", }, "devDependencies": { "tsdown": "^0.22.0", @@ -134,7 +141,7 @@ "name": "@sverka/decorators", "version": "0.0.0", "dependencies": { - "@sverka/constructs": "workspace:*", + "@sverka/cdk": "workspace:*", "@sverka/sdk": "workspace:*", }, "devDependencies": { @@ -175,7 +182,7 @@ "yaml": "^2.9.0", }, "devDependencies": { - "@sverka/constructs": "workspace:*", + "@sverka/cdk": "workspace:*", "tsdown": "^0.22.0", "typescript": "^5.8.0", "vitest": "^3.0.0", @@ -190,7 +197,7 @@ "yaml": "^2.9.0", }, "devDependencies": { - "@sverka/constructs": "workspace:*", + "@sverka/cdk": "workspace:*", "tsdown": "^0.22.0", "typescript": "^5.8.0", "vitest": "^3.0.0", @@ -200,7 +207,7 @@ "name": "@sverka/ir", "version": "0.0.0", "dependencies": { - "@sverka/constructs": "workspace:*", + "@sverka/cdk": "workspace:*", "@sverka/core": "workspace:*", }, "devDependencies": { @@ -263,6 +270,8 @@ "name": "@sverka/runtime-docker", "version": "0.0.0", "dependencies": { + "@sverka/core": "workspace:*", + "@sverka/engine-native": "workspace:*", "@sverka/ir": "workspace:*", "@sverka/runtime": "workspace:*", }, @@ -276,6 +285,8 @@ "name": "@sverka/runtime-host", "version": "0.0.0", "dependencies": { + "@sverka/core": "workspace:*", + "@sverka/engine-native": "workspace:*", "@sverka/ir": "workspace:*", "@sverka/runtime": "workspace:*", }, @@ -307,8 +318,8 @@ "name": "@sverka/sdk", "version": "0.0.0", "dependencies": { + "@sverka/cdk": "workspace:*", "@sverka/checks": "workspace:*", - "@sverka/constructs": "workspace:*", "@sverka/core": "workspace:*", "@sverka/findings": "workspace:*", "@sverka/ir": "workspace:*", @@ -522,6 +533,8 @@ "@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.62.4", "", { "os": "win32", "cpu": "x64" }, "sha512-zD6NdeWEByGE9QF9vCrlJ5YQB4oq9q91kPZS37Jwj5hOkvR1lTBSpsKhKDw4IJtbQ35LsTS1HD9DZYGKIshU1Q=="], + "@sverka/cdk": ["@sverka/cdk@workspace:packages/cdk"], + "@sverka/checks": ["@sverka/checks@workspace:packages/checks"], "@sverka/cli": ["@sverka/cli@workspace:packages/cli"], @@ -534,8 +547,6 @@ "@sverka/conformance": ["@sverka/conformance@workspace:packages/conformance"], - "@sverka/constructs": ["@sverka/constructs@workspace:packages/constructs"], - "@sverka/core": ["@sverka/core@workspace:packages/core"], "@sverka/decorators": ["@sverka/decorators@workspace:packages/decorators"], diff --git a/engdocs/adr/ADR-010-construct-core-boundary.md b/engdocs/adr/ADR-010-construct-core-boundary.md index 44bc548fb..cb7100132 100644 --- a/engdocs/adr/ADR-010-construct-core-boundary.md +++ b/engdocs/adr/ADR-010-construct-core-boundary.md @@ -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, @@ -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. @@ -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. diff --git a/engdocs/architecture/v0-wave-A-plan.md b/engdocs/architecture/v0-wave-A-plan.md index c08384986..18bf8a16c 100644 --- a/engdocs/architecture/v0-wave-A-plan.md +++ b/engdocs/architecture/v0-wave-A-plan.md @@ -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. @@ -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. @@ -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`. diff --git a/engdocs/architecture/v0-wave-B-plan.md b/engdocs/architecture/v0-wave-B-plan.md index 9b39e228c..f680b8d16 100644 --- a/engdocs/architecture/v0-wave-B-plan.md +++ b/engdocs/architecture/v0-wave-B-plan.md @@ -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). diff --git a/engdocs/architecture/v0-wave-C-plan.md b/engdocs/architecture/v0-wave-C-plan.md index 4b3e1e9ee..4ca925402 100644 --- a/engdocs/architecture/v0-wave-C-plan.md +++ b/engdocs/architecture/v0-wave-C-plan.md @@ -7,7 +7,7 @@ ## Package dependency ```text -@sverka/sdk → @sverka/constructs +@sverka/sdk → @sverka/cdk (Project, Pipeline, ShellStep, Entry, model types) ``` @@ -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 @@ -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`. diff --git a/engdocs/user/compilers/github.md b/engdocs/user/compilers/github.md index 664634b8d..d1027ead3 100644 --- a/engdocs/user/compilers/github.md +++ b/engdocs/user/compilers/github.md @@ -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"); diff --git a/engdocs/user/compilers/gitlab.md b/engdocs/user/compilers/gitlab.md index cad61456d..24bfe1568 100644 --- a/engdocs/user/compilers/gitlab.md +++ b/engdocs/user/compilers/gitlab.md @@ -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"); diff --git a/engdocs/user/getting-started/first-plan.md b/engdocs/user/getting-started/first-plan.md index bc7250692..005c4fac2 100644 --- a/engdocs/user/getting-started/first-plan.md +++ b/engdocs/user/getting-started/first-plan.md @@ -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"); @@ -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"); @@ -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"); @@ -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 { diff --git a/engdocs/user/getting-started/install.md b/engdocs/user/getting-started/install.md index e1c5d0634..ee81fd700 100644 --- a/engdocs/user/getting-started/install.md +++ b/engdocs/user/getting-started/install.md @@ -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 diff --git a/engdocs/user/workflow-api/overview.md b/engdocs/user/workflow-api/overview.md index aa5637163..8f8981c9d 100644 --- a/engdocs/user/workflow-api/overview.md +++ b/engdocs/user/workflow-api/overview.md @@ -5,12 +5,12 @@ authoring surfaces that all produce the same Definition Graph. ## Authoring surfaces -### Construct API (`@sverka/constructs`) +### Construct API (`@sverka/cdk`) Low-level construct tree: `Project`, `Pipeline`, `ShellStep`, `Entry`. ```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", { @@ -32,7 +32,7 @@ new Entry(p, "on-push", { trigger: { kind: "push" }, roots: ["build"] }); Composable builders with typed references: `sh`, `artifact`, `when`, `images`. ```ts -import { Project, Pipeline, Entry } from "@sverka/constructs"; +import { Project, Pipeline, Entry } from "@sverka/cdk"; import { sh, artifact, images } from "@sverka/sdk"; const proj = new Project("myproj"); @@ -53,7 +53,7 @@ TC39 standard decorators for class-based pipeline definitions. ```ts import { pipeline, step, stepWithOptions, entry, input, decoratePipeline } from "@sverka/decorators"; -import { Project } from "@sverka/constructs"; +import { Project } from "@sverka/cdk"; @pipeline class MyPipeline { @@ -117,7 +117,7 @@ Steps can reference outputs from other steps or context namespaces: ```ts import { sh } from "@sverka/sdk"; import { env, secrets, git } from "@sverka/sdk"; -import type { Reference } from "@sverka/constructs"; +import type { Reference } from "@sverka/cdk"; // Step output reference const buildDist: Reference = { diff --git a/packages/constructs/package.json b/packages/cdk/package.json similarity index 94% rename from packages/constructs/package.json rename to packages/cdk/package.json index f0d07d003..d4435b652 100644 --- a/packages/constructs/package.json +++ b/packages/cdk/package.json @@ -1,5 +1,5 @@ { - "name": "@sverka/constructs", + "name": "@sverka/cdk", "version": "0.0.0", "type": "module", "main": "./dist/index.mjs", diff --git a/packages/cdk/project.json b/packages/cdk/project.json new file mode 100644 index 000000000..69097b54e --- /dev/null +++ b/packages/cdk/project.json @@ -0,0 +1,9 @@ +{ + "name": "cdk", + "targets": { + "build": { "executor": "nx:run-commands", "options": { "command": "bun run tsdown", "cwd": "packages/cdk" } }, + "test": { "executor": "nx:run-commands", "options": { "command": "bun run vitest run --passWithNoTests", "cwd": "packages/cdk" } }, + "lint": { "executor": "nx:run-commands", "options": { "command": "bun run eslint src", "cwd": "packages/cdk" } }, + "typecheck": { "executor": "nx:run-commands", "options": { "command": "bun run tsc --noEmit", "cwd": "packages/cdk" } } + } +} diff --git a/packages/constructs/src/__tests__/constructs.test.ts b/packages/cdk/src/__tests__/constructs.test.ts similarity index 100% rename from packages/constructs/src/__tests__/constructs.test.ts rename to packages/cdk/src/__tests__/constructs.test.ts diff --git a/packages/constructs/src/__tests__/model.test.ts b/packages/cdk/src/__tests__/model.test.ts similarity index 100% rename from packages/constructs/src/__tests__/model.test.ts rename to packages/cdk/src/__tests__/model.test.ts diff --git a/packages/constructs/src/constructs.ts b/packages/cdk/src/constructs.ts similarity index 94% rename from packages/constructs/src/constructs.ts rename to packages/cdk/src/constructs.ts index 615adaa2d..7067a9063 100644 --- a/packages/constructs/src/constructs.ts +++ b/packages/cdk/src/constructs.ts @@ -1,7 +1,7 @@ // Construct classes: Project, Pipeline, Step, ShellStep, Entry. // Spec 01 — §9.1, §10. -import { SverkaConstruct } from "./base.js"; +import { Construct } from "constructs"; import { ConstructError } from "./errors.js"; import type { Input, @@ -34,10 +34,10 @@ function validateArtifactOutputs( // Project — root of the construct tree (scope = undefined). // --------------------------------------------------------------------------- -export class Project extends SverkaConstruct { +export class Project extends Construct { constructor(id: string) { // constructs.Construct accepts undefined scope at runtime for root. - super(undefined as unknown as SverkaConstruct, id); + super(undefined as unknown as Construct, id); } } @@ -49,7 +49,7 @@ export interface PipelineProps { readonly inputs?: Readonly>; } -export class Pipeline extends SverkaConstruct { +export class Pipeline extends Construct { readonly inputs: ReadonlyMap; constructor(scope: Project, id: string, props?: PipelineProps) { @@ -86,7 +86,7 @@ export interface StepProps { readonly condition?: Reference; } -export abstract class Step extends SverkaConstruct { +export abstract class Step extends Construct { readonly runtime: Runtime; readonly outputs: ReadonlyMap; readonly inputs: ReadonlyArray; @@ -151,7 +151,7 @@ export interface EntryProps { readonly roots: readonly string[]; } -export class Entry extends SverkaConstruct { +export class Entry extends Construct { readonly trigger: Trigger; readonly roots: ReadonlyArray; diff --git a/packages/constructs/src/errors.ts b/packages/cdk/src/errors.ts similarity index 100% rename from packages/constructs/src/errors.ts rename to packages/cdk/src/errors.ts diff --git a/packages/constructs/src/index.ts b/packages/cdk/src/index.ts similarity index 86% rename from packages/constructs/src/index.ts rename to packages/cdk/src/index.ts index 1b9bd7274..0cd0e1616 100644 --- a/packages/constructs/src/index.ts +++ b/packages/cdk/src/index.ts @@ -1,6 +1,5 @@ -// Public exports for @sverka/constructs. Spec 01. +// Public exports for @sverka/cdk. Spec 01. -export { SverkaConstruct } from "./base.js"; export { Project, Pipeline, Step, ShellStep, Entry } from "./constructs.js"; export type { PipelineProps, StepProps, ShellStepProps, EntryProps } from "./constructs.js"; diff --git a/packages/constructs/src/model.ts b/packages/cdk/src/model.ts similarity index 100% rename from packages/constructs/src/model.ts rename to packages/cdk/src/model.ts diff --git a/packages/constructs/tsconfig.json b/packages/cdk/tsconfig.json similarity index 100% rename from packages/constructs/tsconfig.json rename to packages/cdk/tsconfig.json diff --git a/packages/constructs/tsdown.config.ts b/packages/cdk/tsdown.config.ts similarity index 100% rename from packages/constructs/tsdown.config.ts rename to packages/cdk/tsdown.config.ts diff --git a/packages/cli/package.json b/packages/cli/package.json index 862298499..92f96b244 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -22,7 +22,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@sverka/constructs": "workspace:*", + "@sverka/cdk": "workspace:*", "@sverka/core": "workspace:*", "@sverka/ir": "workspace:*", "@sverka/planner": "workspace:*", diff --git a/packages/cli/src/__tests__/commands.test.ts b/packages/cli/src/__tests__/commands.test.ts index a772873a8..f212699bc 100644 --- a/packages/cli/src/__tests__/commands.test.ts +++ b/packages/cli/src/__tests__/commands.test.ts @@ -17,7 +17,7 @@ const EMPTY_SARIF = JSON.stringify({ ], }); -const VALID_CONFIG = `import { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs"; +const VALID_CONFIG = `import { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk"; const proj = new Project("myproj"); const pipeline = new Pipeline(proj, "ci"); new ShellStep(pipeline, "build", { command: "echo build" }); diff --git a/packages/cli/src/__tests__/main.test.ts b/packages/cli/src/__tests__/main.test.ts index 7b0e749d2..890fec6cd 100644 --- a/packages/cli/src/__tests__/main.test.ts +++ b/packages/cli/src/__tests__/main.test.ts @@ -124,7 +124,7 @@ describe("main — global flags", () => { await writefile( dir, "custom.config.ts", - `import { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs"; + `import { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk"; const proj = new Project("myproj"); const pipeline = new Pipeline(proj, "ci"); new ShellStep(pipeline, "build", { command: "echo build" }); diff --git a/packages/cli/src/__tests__/plan.test.ts b/packages/cli/src/__tests__/plan.test.ts index d3588f321..551023535 100644 --- a/packages/cli/src/__tests__/plan.test.ts +++ b/packages/cli/src/__tests__/plan.test.ts @@ -7,7 +7,7 @@ import { writefile, } from "./helpers/fixtures.js"; -const VALID_CONFIG = `import { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs"; +const VALID_CONFIG = `import { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk"; const proj = new Project("myproj"); const pipeline = new Pipeline(proj, "ci"); new ShellStep(pipeline, "build", { command: "echo build" }); diff --git a/packages/cli/src/__tests__/validate.test.ts b/packages/cli/src/__tests__/validate.test.ts index 6998adf20..d630f3c9a 100644 --- a/packages/cli/src/__tests__/validate.test.ts +++ b/packages/cli/src/__tests__/validate.test.ts @@ -7,7 +7,7 @@ import { writefile, } from "./helpers/fixtures.js"; -const VALID_CONFIG = `import { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs"; +const VALID_CONFIG = `import { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk"; const proj = new Project("myproj"); const pipeline = new Pipeline(proj, "ci"); new ShellStep(pipeline, "build", { command: "echo build" }); diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index 3d491e588..4d1461e0f 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -15,7 +15,7 @@ export interface InitArgs { function buildMinimalTemplate(pm: PmName): string { return [ - 'import { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs";', + 'import { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk";', "", 'const proj = new Project("verify");', 'const ci = new Pipeline(proj, "ci");', @@ -31,7 +31,7 @@ function buildMinimalTemplate(pm: PmName): string { function buildFullTemplate(pm: PmName): string { return [ - 'import { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs";', + 'import { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk";', "", 'const proj = new Project("verify");', 'const ci = new Pipeline(proj, "ci");', diff --git a/packages/cli/src/internal/config.ts b/packages/cli/src/internal/config.ts index 89833b3f5..1e5e36ff8 100644 --- a/packages/cli/src/internal/config.ts +++ b/packages/cli/src/internal/config.ts @@ -5,8 +5,8 @@ import { readFile, writeFile } from "node:fs/promises"; import { readFileSync, existsSync } from "node:fs"; import { createRequire } from "node:module"; import { pathToFileURL } from "node:url"; -import { join, resolve, isAbsolute } from "node:path"; -import type { Project } from "@sverka/constructs"; +import { join, resolve, isAbsolute, dirname } from "node:path"; +import type { Project } from "@sverka/cdk"; import { synthesize } from "@sverka/core"; import type { DefinitionGraph } from "@sverka/core"; import { resolveUnderRoot } from "./paths.js"; @@ -194,7 +194,7 @@ function pmFromPackageManagerField(packageManager: string): PmName | undefined { } /** - * Ensure `@sverka/constructs` is declared as a devDependency of the target + * Ensure `@sverka/cdk` is declared as a devDependency of the target * project. Creates a minimal package.json when one does not exist. */ export async function ensureConstructsDependency(root: string): Promise { @@ -234,15 +234,25 @@ function ensureConstructsDeclared(pkg: Record, root: string): v const devDeps = (pkg.devDependencies as Record | undefined) ?? {}; - if (!("@sverka/constructs" in deps) && !("@sverka/constructs" in devDeps)) { + // Migration: remove the old @sverka/constructs package if present. + if ("@sverka/constructs" in deps) { + delete (deps as Record)["@sverka/constructs"]; + pkg.dependencies = deps; + } + if ("@sverka/constructs" in devDeps) { + delete (devDeps as Record)["@sverka/constructs"]; + pkg.devDependencies = devDeps; + } + + if (!("@sverka/cdk" in deps) && !("@sverka/cdk" in devDeps)) { const version = isLocalWorkspace(root) ? "workspace:*" : getDefaultConstructsVersion(); - pkg.devDependencies = { ...devDeps, "@sverka/constructs": version }; + pkg.devDependencies = { ...devDeps, "@sverka/cdk": version }; } } function isLocalWorkspace(root: string): boolean { const rootPkg = join(root, "package.json"); - const constructsPkg = join(root, "packages", "constructs", "package.json"); + const constructsPkg = join(root, "packages", "cdk", "package.json"); try { const rootData = JSON.parse(readFileSync(rootPkg, "utf8")) as { @@ -251,7 +261,7 @@ function isLocalWorkspace(root: string): boolean { const constructs = JSON.parse(readFileSync(constructsPkg, "utf8")) as { name?: string; }; - if (constructs.name !== "@sverka/constructs") return false; + if (constructs.name !== "@sverka/cdk") return false; const patterns = Array.isArray(rootData.workspaces) ? rootData.workspaces : rootData.workspaces?.packages ?? []; @@ -263,8 +273,11 @@ function isLocalWorkspace(root: string): boolean { function getDefaultConstructsVersion(): string { try { - const path = require.resolve("@sverka/constructs/package.json"); - const pkg = JSON.parse(readFileSync(path, "utf8")) as { version?: string }; + // @sverka/cdk only exports "." in its exports map, so resolve the + // package entry point and read the sibling package.json. + const entryPath = require.resolve("@sverka/cdk"); + const pkgPath = join(dirname(entryPath), "package.json"); + const pkg = JSON.parse(readFileSync(pkgPath, "utf8")) as { version?: string }; return pkg.version ? `^${pkg.version}` : "*"; } catch { return "*"; diff --git a/packages/conformance/package.json b/packages/conformance/package.json index 99e718cf3..4081aa8fa 100644 --- a/packages/conformance/package.json +++ b/packages/conformance/package.json @@ -19,7 +19,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@sverka/constructs": "workspace:*", + "@sverka/cdk": "workspace:*", "@sverka/sdk": "workspace:*", "@sverka/decorators": "workspace:*", "@sverka/core": "workspace:*", diff --git a/packages/conformance/src/runner.ts b/packages/conformance/src/runner.ts index 1c6d71070..8ea9fbf7e 100644 --- a/packages/conformance/src/runner.ts +++ b/packages/conformance/src/runner.ts @@ -4,7 +4,7 @@ import { mkdtemp, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { Project, Pipeline, ShellStep } from "@sverka/constructs"; +import { Project, Pipeline, ShellStep } from "@sverka/cdk"; import { synthesize, SynthesisError, diff --git a/packages/conformance/src/seed.ts b/packages/conformance/src/seed.ts index 5f15cbeec..6d473674b 100644 --- a/packages/conformance/src/seed.ts +++ b/packages/conformance/src/seed.ts @@ -7,7 +7,7 @@ import { ShellStep, Entry, type Reference, -} from "@sverka/constructs"; +} from "@sverka/cdk"; import { sh, pipelineV0 as sdkPipeline } from "@sverka/sdk"; import { pipeline as pipelineDecorator, diff --git a/packages/constructs/project.json b/packages/constructs/project.json deleted file mode 100644 index a2ee1bf15..000000000 --- a/packages/constructs/project.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "constructs", - "targets": { - "build": { - "executor": "nx:run-commands", - "options": { - "command": "bun run tsdown", - "cwd": "packages/constructs" - } - }, - "test": { - "executor": "nx:run-commands", - "options": { - "command": "bun run vitest run --passWithNoTests", - "cwd": "packages/constructs" - } - }, - "lint": { - "executor": "nx:run-commands", - "options": { - "command": "bun run eslint src", - "cwd": "packages/constructs" - } - }, - "typecheck": { - "executor": "nx:run-commands", - "options": { - "command": "bun run tsc --noEmit", - "cwd": "packages/constructs" - } - } - } -} diff --git a/packages/constructs/src/base.ts b/packages/constructs/src/base.ts deleted file mode 100644 index 8df886267..000000000 --- a/packages/constructs/src/base.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Insulation layer — Sverka-specific behavior added here as needed. -// Spec 01 — §8.1. - -import { Construct } from "constructs"; - -export class SverkaConstruct extends Construct {} diff --git a/packages/core/package.json b/packages/core/package.json index f8420b205..c2b5f6982 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -19,7 +19,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@sverka/constructs": "workspace:*" + "@sverka/cdk": "workspace:*" }, "devDependencies": { "tsdown": "^0.22.0", diff --git a/packages/core/src/__tests__/graph.test.ts b/packages/core/src/__tests__/graph.test.ts index 0cfa022c2..3d89c1b52 100644 --- a/packages/core/src/__tests__/graph.test.ts +++ b/packages/core/src/__tests__/graph.test.ts @@ -9,7 +9,7 @@ import type { OperationDefinition, Dependency, } from "../index.js"; -import type { Trigger, Runtime, Reference } from "@sverka/constructs"; +import type { Trigger, Runtime, Reference } from "@sverka/cdk"; describe("DefinitionGraph structure", () => { it("Project → Pipelines → Steps/Entries", () => { diff --git a/packages/core/src/__tests__/synthesize.test.ts b/packages/core/src/__tests__/synthesize.test.ts index 0936da77b..99e40e757 100644 --- a/packages/core/src/__tests__/synthesize.test.ts +++ b/packages/core/src/__tests__/synthesize.test.ts @@ -6,7 +6,7 @@ import { Entry, push, type Reference, -} from "@sverka/constructs"; +} from "@sverka/cdk"; import { synthesize, SynthesisError, type StepDefinition } from "../index.js"; describe("synthesize — basic", () => { diff --git a/packages/core/src/__tests__/validate.test.ts b/packages/core/src/__tests__/validate.test.ts index 062b85035..5a8c3a80f 100644 --- a/packages/core/src/__tests__/validate.test.ts +++ b/packages/core/src/__tests__/validate.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from "vitest"; -import { Project, Pipeline, ShellStep } from "@sverka/constructs"; +import { Project, Pipeline, ShellStep } from "@sverka/cdk"; import { synthesize, validateGraph, SynthesisError } from "../index.js"; import { validateOutputCollisions } from "../validate.js"; import type { StepDefinition, DefinitionGraph } from "../graph.js"; diff --git a/packages/core/src/graph.ts b/packages/core/src/graph.ts index 5b564e0bf..f4a6256ef 100644 --- a/packages/core/src/graph.ts +++ b/packages/core/src/graph.ts @@ -8,11 +8,11 @@ import type { Input, OutputDeclaration, OutputType, -} from "@sverka/constructs"; +} from "@sverka/cdk"; // Re-export types used in the graph schema so consumers can access them -// from @sverka/core without depending on @sverka/constructs directly. -export type { Input, OutputDeclaration, OutputType, Reference, Runtime, Trigger } from "@sverka/constructs"; +// from @sverka/core without depending on @sverka/cdk directly. +export type { Input, OutputDeclaration, OutputType, Reference, Runtime, Trigger } from "@sverka/cdk"; export interface DefinitionGraph { readonly project: ProjectDefinition; diff --git a/packages/core/src/synthesize.ts b/packages/core/src/synthesize.ts index 7d312afa8..6b1248e55 100644 --- a/packages/core/src/synthesize.ts +++ b/packages/core/src/synthesize.ts @@ -8,7 +8,7 @@ import { type Project, Step, type StepRef, -} from "@sverka/constructs"; +} from "@sverka/cdk"; import type { DefinitionGraph, PipelineDefinition, diff --git a/packages/core/src/validate.ts b/packages/core/src/validate.ts index 52b8ccd7c..d9e86e48e 100644 --- a/packages/core/src/validate.ts +++ b/packages/core/src/validate.ts @@ -3,7 +3,7 @@ import type { StepDefinition, DefinitionGraph } from "./graph.js"; import { SynthesisError } from "./errors.js"; -import type { StepRef, OutputType } from "@sverka/constructs"; +import type { StepRef, OutputType } from "@sverka/cdk"; /** * Detect cycles in the dependency graph using DFS. diff --git a/packages/decorators/package.json b/packages/decorators/package.json index b38545dc7..5c146c678 100644 --- a/packages/decorators/package.json +++ b/packages/decorators/package.json @@ -19,7 +19,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@sverka/constructs": "workspace:*", + "@sverka/cdk": "workspace:*", "@sverka/sdk": "workspace:*" }, "devDependencies": { diff --git a/packages/decorators/src/__tests__/decorators.test.ts b/packages/decorators/src/__tests__/decorators.test.ts index 63caa0646..a16264f2d 100644 --- a/packages/decorators/src/__tests__/decorators.test.ts +++ b/packages/decorators/src/__tests__/decorators.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from "vitest"; -import { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs"; +import { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk"; import { sh } from "@sverka/sdk"; import { synthesize } from "@sverka/core"; import { diff --git a/packages/decorators/src/decorators.ts b/packages/decorators/src/decorators.ts index 2afa43974..da45e0e61 100644 --- a/packages/decorators/src/decorators.ts +++ b/packages/decorators/src/decorators.ts @@ -1,7 +1,7 @@ // TC39 standard decorators. Spec 04 — §9.3–9.8. // Uses standard ECMAScript decorators (TypeScript 5.0+, no experimentalDecorators). -import type { Trigger } from "@sverka/constructs"; +import type { Trigger } from "@sverka/cdk"; import type { StepOptions, FieldMetadata, FieldKind } from "./types.js"; import { DecoratorError } from "./errors.js"; diff --git a/packages/decorators/src/synthesize.ts b/packages/decorators/src/synthesize.ts index 21020dc36..e5885d7b2 100644 --- a/packages/decorators/src/synthesize.ts +++ b/packages/decorators/src/synthesize.ts @@ -1,8 +1,8 @@ // decoratePipeline — creates a Pipeline construct from a decorated class. // Spec 04 — §9.3–9.8. -import { Pipeline, ShellStep, Entry } from "@sverka/constructs"; -import type { Project, Input, Trigger, Reference, ShellStepProps } from "@sverka/constructs"; +import { Pipeline, ShellStep, Entry } from "@sverka/cdk"; +import type { Project, Input, Trigger, Reference, ShellStepProps } from "@sverka/cdk"; import type { StepBuilder } from "@sverka/sdk"; import { getPipelineMetadata } from "./decorators.js"; import { DecoratorError } from "./errors.js"; diff --git a/packages/decorators/src/types.ts b/packages/decorators/src/types.ts index 193219707..21b71b4d8 100644 --- a/packages/decorators/src/types.ts +++ b/packages/decorators/src/types.ts @@ -1,6 +1,6 @@ // Decorator types. Spec 04 — §9.3–9.8. -import type { Runtime, OutputDeclaration, Trigger } from "@sverka/constructs"; +import type { Runtime, OutputDeclaration, Trigger } from "@sverka/cdk"; export interface StepOptions { readonly runtime?: Runtime; diff --git a/packages/github/package.json b/packages/github/package.json index 38f4772fa..e9934faa2 100644 --- a/packages/github/package.json +++ b/packages/github/package.json @@ -24,7 +24,7 @@ "yaml": "^2.9.0" }, "devDependencies": { - "@sverka/constructs": "workspace:*", + "@sverka/cdk": "workspace:*", "tsdown": "^0.22.0", "typescript": "^5.8.0", "vitest": "^3.0.0" diff --git a/packages/github/src/__tests__/target.test.ts b/packages/github/src/__tests__/target.test.ts index 1c156bb25..bc7148366 100644 --- a/packages/github/src/__tests__/target.test.ts +++ b/packages/github/src/__tests__/target.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from "vitest"; import { parse } from "yaml"; -import { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs"; +import { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk"; import { synthesize, type DefinitionGraph } from "@sverka/core"; import { GithubTarget, diff --git a/packages/github/src/lower.ts b/packages/github/src/lower.ts index 493d3cd2c..98502a733 100644 --- a/packages/github/src/lower.ts +++ b/packages/github/src/lower.ts @@ -9,7 +9,7 @@ import type { OperationDefinition, Dependency, } from "@sverka/core"; -import type { Trigger } from "@sverka/constructs"; +import type { Trigger } from "@sverka/cdk"; import type { GithubTargetGraph, GithubTriggers, diff --git a/packages/gitlab/package.json b/packages/gitlab/package.json index 76b7de827..4308b9a89 100644 --- a/packages/gitlab/package.json +++ b/packages/gitlab/package.json @@ -24,7 +24,7 @@ "yaml": "^2.9.0" }, "devDependencies": { - "@sverka/constructs": "workspace:*", + "@sverka/cdk": "workspace:*", "tsdown": "^0.22.0", "typescript": "^5.8.0", "vitest": "^3.0.0" diff --git a/packages/gitlab/src/__tests__/target.test.ts b/packages/gitlab/src/__tests__/target.test.ts index 7b8b4e78b..37f2ff707 100644 --- a/packages/gitlab/src/__tests__/target.test.ts +++ b/packages/gitlab/src/__tests__/target.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from "vitest"; import { parse } from "yaml"; -import { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs"; +import { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk"; import { synthesize, type DefinitionGraph } from "@sverka/core"; import { GitlabTarget, compileGitlab, GitlabTargetError, type GitlabJob } from "../index.js"; diff --git a/packages/ir/package.json b/packages/ir/package.json index e2030a05b..b815d1553 100644 --- a/packages/ir/package.json +++ b/packages/ir/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "@sverka/core": "workspace:*", - "@sverka/constructs": "workspace:*" + "@sverka/cdk": "workspace:*" }, "devDependencies": { "tsdown": "^0.22.0", diff --git a/packages/ir/src/__tests__/helpers/fixtures.ts b/packages/ir/src/__tests__/helpers/fixtures.ts index 4aa10b433..01fd0a3c6 100644 --- a/packages/ir/src/__tests__/helpers/fixtures.ts +++ b/packages/ir/src/__tests__/helpers/fixtures.ts @@ -1,5 +1,5 @@ // Shared test fixtures for @sverka/ir tests. -import { Project, Pipeline, ShellStep, Entry, push } from "@sverka/constructs"; +import { Project, Pipeline, ShellStep, Entry, push } from "@sverka/cdk"; import { synthesize, type DefinitionGraph } from "@sverka/core"; import { computeGraphId, computeRunPlanId } from "../../ids.js"; import type { RunPlan, BoundEntry, InputValue } from "../../run-plan.js"; diff --git a/packages/ir/src/__tests__/ids.test.ts b/packages/ir/src/__tests__/ids.test.ts index 811a5a15a..98d0d11fb 100644 --- a/packages/ir/src/__tests__/ids.test.ts +++ b/packages/ir/src/__tests__/ids.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from "vitest"; -import { Project, Pipeline, ShellStep } from "@sverka/constructs"; +import { Project, Pipeline, ShellStep } from "@sverka/cdk"; import { synthesize } from "@sverka/core"; import { computeGraphId, computeRunPlanId } from "../ids.js"; import { makeSampleGraph, makeSampleRunPlan } from "./helpers/fixtures.js"; diff --git a/packages/ir/src/run-plan.ts b/packages/ir/src/run-plan.ts index 61d734ce3..83934d04e 100644 --- a/packages/ir/src/run-plan.ts +++ b/packages/ir/src/run-plan.ts @@ -2,7 +2,7 @@ // Spec 06 — §22.1, §16. Architecture spec §22. import type { StepDefinition } from "@sverka/core"; -import type { Trigger } from "@sverka/constructs"; +import type { Trigger } from "@sverka/cdk"; export type InputValue = string | number | boolean; diff --git a/packages/sdk/package.json b/packages/sdk/package.json index e6cdc68bb..fb078288c 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -19,7 +19,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@sverka/constructs": "workspace:*", + "@sverka/cdk": "workspace:*", "@sverka/core": "workspace:*", "@sverka/ir": "workspace:*", "@sverka/runtime": "workspace:*", diff --git a/packages/sdk/src/__tests__/conformance.test.ts b/packages/sdk/src/__tests__/conformance.test.ts index 4d6a6433b..3548d3deb 100644 --- a/packages/sdk/src/__tests__/conformance.test.ts +++ b/packages/sdk/src/__tests__/conformance.test.ts @@ -3,7 +3,7 @@ // Spec 03 — Conformance. Architecture spec §33.1. import { describe, it, expect } from "vitest"; -import { Project, Pipeline, ShellStep, Entry, push } from "@sverka/constructs"; +import { Project, Pipeline, ShellStep, Entry, push } from "@sverka/cdk"; import { synthesize, type DefinitionGraph } from "@sverka/core"; import { sh, artifact, pipelineV0 as pipeline } from "../index.js"; diff --git a/packages/sdk/src/__tests__/pipeline.test.ts b/packages/sdk/src/__tests__/pipeline.test.ts index 37cc539bf..b09c45803 100644 --- a/packages/sdk/src/__tests__/pipeline.test.ts +++ b/packages/sdk/src/__tests__/pipeline.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from "vitest"; -import { Project, Entry, push } from "@sverka/constructs"; +import { Project, Entry, push } from "@sverka/cdk"; import { pipelineV0 as pipeline, sh, artifact } from "../index.js"; describe("pipeline factory", () => { diff --git a/packages/sdk/src/__tests__/sh.test.ts b/packages/sdk/src/__tests__/sh.test.ts index 11add82e0..820f8cb89 100644 --- a/packages/sdk/src/__tests__/sh.test.ts +++ b/packages/sdk/src/__tests__/sh.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect } from "vitest"; -import { Project, Pipeline } from "@sverka/constructs"; +import { Project, Pipeline } from "@sverka/cdk"; import { sh, artifact } from "../index.js"; import { env } from "../context.js"; diff --git a/packages/sdk/src/artifact.ts b/packages/sdk/src/artifact.ts index 76da288ab..420af2fdd 100644 --- a/packages/sdk/src/artifact.ts +++ b/packages/sdk/src/artifact.ts @@ -1,7 +1,7 @@ // artifact() — output declaration factory for artifact outputs. // Spec 03 — §12.2. -import type { OutputDeclaration } from "@sverka/constructs"; +import type { OutputDeclaration } from "@sverka/cdk"; /** Create an artifact output declaration with the given path. */ export function artifact(path: string): OutputDeclaration { diff --git a/packages/sdk/src/context.ts b/packages/sdk/src/context.ts index 9d6244ea6..0e013b86a 100644 --- a/packages/sdk/src/context.ts +++ b/packages/sdk/src/context.ts @@ -1,7 +1,7 @@ // Context namespaces — typed references to context values. // Spec 03 — §12.3. Architecture spec §12.3. -import type { ContextRef, ContextNamespace } from "@sverka/constructs"; +import type { ContextRef, ContextNamespace } from "@sverka/cdk"; import { createDynamicProxy } from "./internal/proxy-props.js"; /** Create a ContextRef for a namespace + field. */ diff --git a/packages/sdk/src/pipeline.ts b/packages/sdk/src/pipeline.ts index 056917e30..37b3381a9 100644 --- a/packages/sdk/src/pipeline.ts +++ b/packages/sdk/src/pipeline.ts @@ -1,8 +1,8 @@ // pipeline() factory — creates a Pipeline and runs step/entry functions. // Spec 03 — §9.2. -import { Project, Pipeline, Entry } from "@sverka/constructs"; -import type { Input } from "@sverka/constructs"; +import { Project, Pipeline, Entry } from "@sverka/cdk"; +import type { Input } from "@sverka/cdk"; export interface PipelineConfig { inputs?: Readonly>; diff --git a/packages/sdk/src/sh.ts b/packages/sdk/src/sh.ts index 37c804ef8..74f79d313 100644 --- a/packages/sdk/src/sh.ts +++ b/packages/sdk/src/sh.ts @@ -9,7 +9,7 @@ import { type OutputDeclaration, type StepRef, type ContextRef, -} from "@sverka/constructs"; +} from "@sverka/cdk"; import { SdkError } from "./errors.js"; export interface StepBuilder { diff --git a/packages/sdk/src/when.ts b/packages/sdk/src/when.ts index f4978a2d4..33141e1f8 100644 --- a/packages/sdk/src/when.ts +++ b/packages/sdk/src/when.ts @@ -3,7 +3,7 @@ // boolean-producing References. `when` is an identity function that marks // a reference as a condition for readability. -import type { Reference } from "@sverka/constructs"; +import type { Reference } from "@sverka/cdk"; /** Mark a reference as a step condition. Returns the reference unchanged. */ export function when(ref: Reference): Reference { diff --git a/specs/01-constructs/spec.md b/specs/01-cdk/spec.md similarity index 98% rename from specs/01-constructs/spec.md rename to specs/01-cdk/spec.md index ce4a1cd85..3eb3d38f8 100644 --- a/specs/01-constructs/spec.md +++ b/specs/01-cdk/spec.md @@ -1,12 +1,12 @@ -# Spec 01 — Constructs +# Spec 01 — CDK **Status:** Active **Source:** specs/architecture-spec.md §8, §9.1, §12, §13, §14, §15 -**Package:** `@sverka/constructs` +**Package:** `@sverka/cdk` ## Overview -The `constructs` package wraps the npm `constructs` library with Sverka-specific +The `cdk` package wraps the npm `constructs` library with Sverka-specific construct types. It provides the construct tree for ownership, identity, composition, and metadata (§8.2). It also defines the shared model types (Trigger, Reference, Runtime, Input, Output) used by both the construct tree diff --git a/specs/02-definition-graph/spec.md b/specs/02-definition-graph/spec.md index 92728fcea..837a79b98 100644 --- a/specs/02-definition-graph/spec.md +++ b/specs/02-definition-graph/spec.md @@ -22,7 +22,7 @@ scheduling, dependencies, and data transfer. - Dependency type: control, value, artifact (§11.2) - Operation types: shell, exportOutput, exportArtifact, importArtifact, diagnostic (§15) -- Reuse model types from `@sverka/constructs` (Reference, Trigger, Runtime, +- Reuse model types from `@sverka/cdk` (Reference, Trigger, Runtime, Input, OutputDeclaration) ## Non-goals @@ -39,7 +39,7 @@ scheduling, dependencies, and data transfer. ```ts import type { Reference, Trigger, Runtime, Input, OutputDeclaration, OutputType, -} from "@sverka/constructs"; +} from "@sverka/cdk"; interface DefinitionGraph { project: ProjectDefinition; diff --git a/specs/03-authoring-sdk/spec.md b/specs/03-authoring-sdk/spec.md index d76dc8682..5264a50b2 100644 --- a/specs/03-authoring-sdk/spec.md +++ b/specs/03-authoring-sdk/spec.md @@ -37,8 +37,8 @@ identical regardless of which authoring surface is used. ```ts import type { Runtime, Input, OutputDeclaration, Reference, Trigger, -} from "@sverka/constructs"; -import type { Project, Pipeline, ShellStep, Entry } from "@sverka/constructs"; +} from "@sverka/cdk"; +import type { Project, Pipeline, ShellStep, Entry } from "@sverka/cdk"; // --- sh: shell command step builder --- diff --git a/specs/05-synthesis/spec.md b/specs/05-synthesis/spec.md index 48591f9fe..0ce5b4840 100644 --- a/specs/05-synthesis/spec.md +++ b/specs/05-synthesis/spec.md @@ -6,7 +6,7 @@ ## Overview -Synthesis transforms a construct tree (`@sverka/constructs`) into a Definition +Synthesis transforms a construct tree (`@sverka/cdk`) into a Definition Graph (§16). The lifecycle phases in scope for v0 Wave A: ```text @@ -44,7 +44,7 @@ Capability analysis, target lowering, and Run Plan building are later waves. ## Interfaces ```ts -import type { Project } from "@sverka/constructs"; +import type { Project } from "@sverka/cdk"; import type { DefinitionGraph } from "./graph.js"; function synthesize(project: Project): DefinitionGraph; diff --git a/specs/06-ir/spec.md b/specs/06-ir/spec.md index d8588c344..2ca7d82a7 100644 --- a/specs/06-ir/spec.md +++ b/specs/06-ir/spec.md @@ -40,7 +40,7 @@ native engine (§22). ```ts import type { DefinitionGraph, StepDefinition } from "@sverka/core"; -import type { Trigger } from "@sverka/constructs"; +import type { Trigger } from "@sverka/cdk"; // --- Serializable Definition Graph --- diff --git a/specs/17-cli/spec.md b/specs/17-cli/spec.md index 50ad2a87f..7ccae66d5 100644 --- a/specs/17-cli/spec.md +++ b/specs/17-cli/spec.md @@ -73,7 +73,7 @@ export { ConsoleOutputWriter, createOutputWriter, wrapOutputWriter, type WriteSi ## Data models **Config loading**: The CLI loads a sverka.config.ts file from the root -directory. This file uses `@sverka/constructs` directly to define a +directory. This file uses `@sverka/cdk` directly to define a Project with Pipelines, Entries, and Steps. The CLI synthesizes it into a Definition Graph via `@sverka/core.synthesize`. If no config is found, commands that require a graph report a usage error.