Skip to content

Commit 4778f3f

Browse files
committed
fix: make @loop-engine/dsl private; dedupe SDK DSL exports
- dsl: private, no publishConfig; stop re-exporting core (duplicate SDK surface) - sdk: single explicit exports from @loop-engine/dsl (LoopBuilder, parser, validator types) - runtime: drop unused @loop-engine/dsl dependency - changesets: ignore @loop-engine/dsl - check-boundary: allowlist private @loop-engine/dsl - dsl README: point consumers to @loop-engine/sdk
1 parent d8d8d88 commit 4778f3f

8 files changed

Lines changed: 34 additions & 54 deletions

File tree

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"access": "public",
77
"baseBranch": "main",
88
"updateInternalDependencies": "patch",
9-
"ignore": ["@loop-engine/inspector", "@loop-engine/playground"]
9+
"ignore": ["@loop-engine/inspector", "@loop-engine/playground", "@loop-engine/dsl"]
1010
}

packages/dsl/README.md

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,13 @@
1-
# @loop-engine/dsl
1+
# @loop-engine/dsl (monorepo internal)
22

3-
[![npm](https://img.shields.io/npm/v/@loop-engine/dsl.svg)](https://www.npmjs.com/package/@loop-engine/dsl)
4-
[![Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
5-
[![Loop Engine](https://img.shields.io/badge/loopengine.io-docs-blue)](https://loopengine.io/docs)
6-
7-
Parse, validate, and serialize Loop Engine loop definitions from YAML or TypeScript.
8-
9-
## Install
3+
This package is **private** and **not published** to npm. Loop definition APIs (`LoopBuilder`, `parseLoopYaml`, `validateLoopDefinition`, etc.) ship from **`@loop-engine/sdk`**.
104

115
```bash
12-
npm install @loop-engine/dsl
6+
npm install @loop-engine/sdk
137
```
148

15-
## Quick Start
16-
179
```ts
18-
import { parseLoopYaml, validateLoopDefinition } from "@loop-engine/dsl";
19-
20-
const definition = parseLoopYaml(`
21-
loopId: expense.approval
22-
version: "1.0.0"
23-
name: Expense Approval
24-
description: Demo
25-
states: [{ stateId: submitted, label: Submitted }, { stateId: approved, label: Approved, terminal: true }]
26-
initialState: submitted
27-
transitions: [{ transitionId: approve, from: submitted, to: approved, signal: approve, allowedActors: [human] }]
28-
`);
29-
30-
const result = validateLoopDefinition(definition);
31-
console.log(result.valid, result.errors);
10+
import { parseLoopYaml, validateLoopDefinition, LoopBuilder } from "@loop-engine/sdk";
3211
```
3312

34-
## Documentation link
35-
36-
https://loopengine.io/docs/packages/dsl
37-
38-
## License
39-
40-
Apache-2.0 © Better Data, Inc.
13+
See [SDK docs](https://loopengine.io/docs/packages/sdk).

packages/dsl/package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"url": "git+https://github.com/loopengine/loop-engine.git",
88
"directory": "packages/dsl"
99
},
10-
"description": "YAML and builder APIs for loop definition authoring.",
10+
"description": "Internal: YAML/builder/validator for the monorepo. Published API: @loop-engine/sdk.",
11+
"private": true,
1112
"type": "module",
1213
"main": "./dist/index.cjs",
1314
"module": "./dist/index.js",
@@ -37,7 +38,7 @@
3738
"engines": {
3839
"node": ">=18.0.0"
3940
},
40-
"homepage": "https://loopengine.io/docs/packages/dsl",
41+
"homepage": "https://loopengine.io/docs/packages/sdk",
4142
"sideEffects": false,
4243
"keywords": [
4344
"loop-engine",
@@ -48,8 +49,5 @@
4849
"yaml",
4950
"builder",
5051
"definition"
51-
],
52-
"publishConfig": {
53-
"access": "public"
54-
}
52+
]
5553
}

packages/dsl/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @license Apache-2.0
22
// SPDX-License-Identifier: Apache-2.0
3-
export * from "@loop-engine/core";
3+
/** Internal monorepo package — public surface is `@loop-engine/sdk` (do not re-export `core` here; avoids duplicate exports in SDK). */
44
export { LoopBuilder } from "./builder";
55
export type {
66
LoopBuilderGuardInput,

packages/runtime/package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@loop-engine/runtime",
3-
"version": "0.1.6",
3+
"version": "0.1.5",
44
"description": "Execution engine for loop state transitions and lifecycle.",
55
"license": "Apache-2.0",
66
"repository": {
@@ -27,7 +27,6 @@
2727
"dependencies": {
2828
"@loop-engine/actors": "workspace:*",
2929
"@loop-engine/core": "workspace:*",
30-
"@loop-engine/dsl": "workspace:*",
3130
"@loop-engine/events": "workspace:*",
3231
"@loop-engine/guards": "workspace:*"
3332
},
@@ -52,8 +51,5 @@
5251
"execution",
5352
"lifecycle",
5453
"engine"
55-
],
56-
"publishConfig": {
57-
"access": "public"
58-
}
54+
]
5955
}

packages/sdk/src/index.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class InMemoryLoopRegistry implements LoopDefinitionRegistry {
3232
}
3333

3434
export { createLoopSystem as createLoopSystemRuntime } from "@loop-engine/runtime";
35-
export { validateLoopDefinition } from "@loop-engine/dsl";
3635
export { InMemoryEventBus } from "@loop-engine/events";
3736
export { computeMetrics, buildTimeline } from "@loop-engine/observability";
3837
export { localRegistry, httpRegistry } from "@loop-engine/registry-client";
@@ -57,9 +56,23 @@ export type {
5756

5857
// Consolidated core surface: expose full APIs from internal core-layer packages.
5958
export * from "@loop-engine/core";
60-
/** Primary fluent authoring API for {@link LoopDefinition} (also re-exported via `export *`). */
61-
export { LoopBuilder } from "@loop-engine/dsl";
62-
export * from "@loop-engine/dsl";
59+
/** DSL (LoopBuilder, YAML, validation) — implemented in private workspace package `@loop-engine/dsl`, exported only from SDK. */
60+
export {
61+
LoopBuilder,
62+
validateLoopDefinition,
63+
parseLoopYaml,
64+
parseLoopYamlSafe,
65+
serializeLoopYaml
66+
} from "@loop-engine/dsl";
67+
export type {
68+
LoopBuilderGuardInput,
69+
LoopBuilderGuardLegacy,
70+
LoopBuilderGuardShorthand,
71+
LoopBuilderOutcomeInput,
72+
LoopBuilderTransitionInput,
73+
ValidationError,
74+
ValidationResult
75+
} from "@loop-engine/dsl";
6376
export * from "@loop-engine/guards";
6477
export * from "@loop-engine/actors";
6578
export * from "@loop-engine/events";

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/check-boundary.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ const PACKAGES_DIR = path.join(ROOT, "packages");
2222
const CORE_BANNED_TOKENS = ["procurement", "inventory", "shipment", "lot"];
2323
const ADAPTER_EXTERNALS = ["pg", "kafkajs"];
2424

25+
/** Internal-only workspace packages (not published; API surfaced via another package, e.g. `@loop-engine/sdk`). */
26+
const PRIVATE_PACKAGES_ALLOWED = new Set(["@loop-engine/dsl"]);
27+
2528
async function listDirs(dir: string): Promise<string[]> {
2629
const entries = await readdir(dir, { withFileTypes: true });
2730
return entries.filter((e) => e.isDirectory()).map((e) => path.join(dir, e.name));
@@ -130,7 +133,7 @@ async function run(): Promise<void> {
130133
}
131134
}
132135

133-
if (pkg.private === true) {
136+
if (pkg.private === true && !(pkg.name && PRIVATE_PACKAGES_ALLOWED.has(pkg.name))) {
134137
violations.push({
135138
check: "publishability",
136139
file: path.join(dir, "package.json"),

0 commit comments

Comments
 (0)