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
5 changes: 5 additions & 0 deletions .changeset/update-sdk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openworkflowspec/diagram-editor": minor
---

Update sdk package to new openworkflowspec package
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ This project uses the following technology stack:
- **Language**: [TypeScript](https://www.typescriptlang.org/) with strict mode enabled
- **UI Library**: [React](https://react.dev/)
- **Diagram Rendering**: [@xyflow/react](https://reactflow.dev/) (isolated in `src/react-flow/`)
- **Workflow SDK**: [@serverlessworkflow/sdk](https://github.com/serverlessworkflow/sdk-typescript) (isolated in `src/core/`)
- **Workflow SDK**: [@openworkflowspec/sdk](https://github.com/open-workflow-specification/sdk-typescript) (isolated in `src/core/`)
- **Testing**: [Vitest](https://vitest.dev/) for unit tests, [Playwright](https://playwright.dev/) for E2E
- **Linting**: [oxlint](https://oxc.rs/) with TypeScript, React, import, and jsx-a11y plugins
- **Formatting**: [oxfmt](https://oxc.rs/)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ The main visual diagram editor component built with:
- **TypeScript** (strict mode)
- **React**
- **[@xyflow/react](https://reactflow.dev/)** for diagram rendering (isolated in `src/react-flow/`)
- **[@serverlessworkflow/sdk](https://github.com/serverlessworkflow/sdk-typescript)** (isolated in `src/core/`)
- **[@openworkflowspec/sdk](https://github.com/open-workflow-specification/sdk-typescript)** (isolated in `src/core/`)
- **[shadcn/ui](https://ui.shadcn.com/)** for UI primitives (with `dec:` Tailwind prefix)
- **[Storybook](https://storybook.js.org/)** for component development
- **[Vitest](https://vitest.dev/)** and **[Playwright](https://playwright.dev/)** for testing
Expand All @@ -154,7 +154,7 @@ Internationalization utilities used by the diagram editor.
- **UI Framework**: [React](https://react.dev/)
- **Diagram Library**: [@xyflow/react](https://reactflow.dev/) (React Flow)
- **Auto Layout**: [ELK.js](https://eclipse.dev/elk/)
- **Workflow SDK**: [@serverlessworkflow/sdk](https://github.com/serverlessworkflow/sdk-typescript)
- **Workflow SDK**: [@openworkflowspec/sdk](https://github.com/open-workflow-specification/sdk-typescript)
- **UI Components**: [shadcn/ui](https://ui.shadcn.com/) + [Radix UI](https://www.radix-ui.com/)
- **Styling**: [Tailwind CSS](https://tailwindcss.com/)
- **Testing**: [Vitest](https://vitest.dev/), [Playwright](https://playwright.dev/)
Expand Down Expand Up @@ -232,4 +232,4 @@ This project is licensed under the [Apache License 2.0](LICENSE).
## Related Projects

- [Open Workflow Specification](https://github.com/open-workflow-specification/specification)
- [Open Workflow SDK (TypeScript)](https://github.com/serverlessworkflow/sdk-typescript)
- [Open Workflow SDK (TypeScript)](https://github.com/open-workflow-specification/sdk-typescript)
2 changes: 1 addition & 1 deletion packages/open-workflow-diagram-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"dependencies": {
"@openworkflowspec/i18n": "workspace:*",
"@serverlessworkflow/sdk": "catalog:",
"@openworkflowspec/sdk": "catalog:",
"@xyflow/react": "catalog:",
"class-variance-authority": "catalog:",
"clsx": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion packages/open-workflow-diagram-editor/src/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The core layer serves as the abstraction boundary between the Open Workflow SDK

### SDK Abstraction

**Critical constraint**: This is the only layer allowed to directly import from `@serverlessworkflow/sdk`. All SDK interactions must go through this abstraction to keep the rest of the editor decoupled from SDK implementation details. Despite of that, type-only imports may still be used elsewhere when needed.
**Critical constraint**: This is the only layer allowed to directly import from `@openworkflowspec/sdk`. All SDK interactions must go through this abstraction to keep the rest of the editor decoupled from SDK implementation details. Despite of that, type-only imports may still be used elsewhere when needed.

Responsibilities:

Expand Down
2 changes: 1 addition & 1 deletion packages/open-workflow-diagram-editor/src/core/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { FlatGraph, FlatGraphNode, GraphNodeType } from "@serverlessworkflow/sdk";
import { FlatGraph, FlatGraphNode, GraphNodeType } from "@openworkflowspec/sdk";

export function getNodesByType(graph: FlatGraph, type: GraphNodeType): FlatGraphNode[] {
return graph.nodes.filter((node) => node.type === type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

import { convertToMermaidCode } from "@serverlessworkflow/sdk";
import type { Specification } from "@serverlessworkflow/sdk";
import { convertToMermaidCode } from "@openworkflowspec/sdk";
import type { Specification } from "@openworkflowspec/sdk";

/**
* Converts a workflow model to Mermaid diagram code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import type { Specification } from "@serverlessworkflow/sdk";
import type { Specification } from "@openworkflowspec/sdk";

/* TaskBase: Common fields every task inherits (none required) (metadata is dropped for now) */
const TASK_BASE_KEYS = new Set(["if", "input", "output", "export", "timeout", "then", "metadata"]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import type { Specification } from "@serverlessworkflow/sdk";
import type { Specification } from "@openworkflowspec/sdk";

function getFirstKey(obj: unknown): string | undefined {
return obj && typeof obj === "object" && !Array.isArray(obj) ? Object.keys(obj)[0] : undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { load } from "js-yaml";
import * as sdk from "@serverlessworkflow/sdk";
import * as sdk from "@openworkflowspec/sdk";
import { fixNodesConnections } from "./graph";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import * as RF from "@xyflow/react";
import { buildFlatGraph, getErrorNodeIds, type SdkError } from "../../core";
import { BaseNodeData, ReactFlowNodeTypes } from "../nodes/Nodes";
import { BaseEdgeData, EdgeTypes } from "../edges/Edges";
import * as sdk from "@serverlessworkflow/sdk";
import * as sdk from "@openworkflowspec/sdk";
import { getNodeSize } from "./autoLayout";
import { CATCH_CONTAINER_NODE_TYPE, isTerminalNodeType } from "../nodes/taskNodeConfig";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import type React from "react";
import { GraphNodeType, type Specification } from "@serverlessworkflow/sdk";
import { GraphNodeType, type Specification } from "@openworkflowspec/sdk";
import * as RF from "@xyflow/react";
import { useI18n } from "@openworkflowspec/i18n";
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { GraphNodeType } from "@serverlessworkflow/sdk";
import { GraphNodeType } from "@openworkflowspec/sdk";
import {
AlertTriangle,
ArrowRightLeft,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { Button } from "@/components/ui/button";
import { exportToMermaid } from "@/core";
import { copyToClipboard } from "@/lib/clipboard";
import { downloadFile } from "@/lib/download";
import type { Specification } from "@serverlessworkflow/sdk";
import type { Specification } from "@openworkflowspec/sdk";
import { toast } from "sonner";

export function MermaidActions({ model }: { model: Specification.Workflow }): React.JSX.Element {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import type { Specification } from "@serverlessworkflow/sdk";
import type { Specification } from "@openworkflowspec/sdk";
import { useI18n } from "@openworkflowspec/i18n";
import { InlineField, SectionHeader, StackedField } from "./Fields";
import { useDiagramEditorContext } from "@/store/DiagramEditorContext";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import type { Specification } from "@serverlessworkflow/sdk";
import type { Specification } from "@openworkflowspec/sdk";
import * as React from "react";
import type * as RF from "@xyflow/react";
import type { SdkError } from "../core";
Expand Down
2 changes: 1 addition & 1 deletion packages/open-workflow-diagram-editor/stories/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ The following features have been identified as potential additions for future it

- [Storybook Documentation](https://storybook.js.org/docs/)
- [Open Workflow Specification](https://github.com/open-workflow-specification/specification)
- [TypeScript SDK](https://github.com/serverlessworkflow/sdk-typescript)
- [TypeScript SDK](https://github.com/open-workflow-specification/sdk-typescript)
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Explore the **Examples** section in the sidebar to see the editor in action with

- [Cloud Native Computing Foundation (CNCF)](https://www.cncf.io)
- [CNCF Open Workflow Specification](https://serverlessworkflow.io)
- [Open Workflow TypeScript SDK](https://github.com/serverlessworkflow/sdk-typescript)
- [Open Workflow TypeScript SDK](https://github.com/open-workflow-specification/sdk-typescript)
- [GitHub Repository](https://github.com/open-workflow-specification/editor)

## Contributing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ exports[`parseWorkflow > returns model and errors for invalid but parseable 'JSO
{
"errors": [
{
"errorType": "'Workflow' is invalid",
"errorType": "Validation failed at '<root>' (Workflow): 'Workflow' is invalid",
"message": "The DSL version of the workflow 'undefined' does not satisfy the DSL version range supported by this SDK '>=1.0.0 <=1.0.3'.",
},
],
Expand All @@ -712,7 +712,7 @@ exports[`parseWorkflow > returns model and errors for invalid but parseable 'YAM
{
"errors": [
{
"errorType": "'Workflow' is invalid",
"errorType": "Validation failed at '<root>' (Workflow): 'Workflow' is invalid",
"message": "The DSL version of the workflow 'undefined' does not satisfy the DSL version range supported by this SDK '>=1.0.0 <=1.0.3'.",
},
],
Expand All @@ -733,7 +733,7 @@ exports[`parseWorkflow > returns model and errors for invalid but parseable 'YAM
exports[`validateWorkflow > returns parsed validation errors for an invalid workflow 1`] = `
[
{
"errorType": "'Workflow' is invalid",
"errorType": "Validation failed at '<root>' (Workflow): 'Workflow' is invalid",
"message": "The DSL version of the workflow 'undefined' does not satisfy the DSL version range supported by this SDK '>=1.0.0 <=1.0.3'.",
},
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { describe, it, expect } from "vitest";
import { FlatGraphNode, GraphNodeType } from "@serverlessworkflow/sdk";
import { FlatGraphNode, GraphNodeType } from "@openworkflowspec/sdk";
import {
getNodesByType,
fixNodesConnections,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import type { Specification } from "@serverlessworkflow/sdk";
import type { Specification } from "@openworkflowspec/sdk";
import { describe, expect, it } from "vitest";
import { getTaskDetails } from "../../src/core";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import type { Specification } from "@serverlessworkflow/sdk";
import type { Specification } from "@openworkflowspec/sdk";
import { describe, expect, it } from "vitest";
import { getCallSubType, getListenSubType, getRunSubType } from "../../src/core";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
EMPTY_WORKFLOW_JSON,
PARSEABLE_INVALID_WORKFLOW_YAML,
} from "../fixtures/workflows";
import { Classes, Specification } from "@serverlessworkflow/sdk";
import { Classes, Specification } from "@openworkflowspec/sdk";

describe("parseWorkflow", () => {
it.each([
Expand Down Expand Up @@ -60,7 +60,7 @@ describe("parseWorkflow", () => {
])("returns null model with error for $description", ({ input }) => {
const result = parseWorkflow(input);
expect(result.model).toBeNull();
expect(result.errors[0].message).toBe("Not a valid workflow");
expect(result.errors[0].message).toContain("Not a valid workflow");
});

it("returns null model with errors for unparseable text", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { describe, it, expect, beforeAll } from "vitest";
import * as RF from "@xyflow/react";
import { FlatGraphNode, GraphNodeType, Specification } from "@serverlessworkflow/sdk";
import { FlatGraphNode, GraphNodeType, Specification } from "@openworkflowspec/sdk";
import {
getEdgeType,
edgeSourceAndTargetExist,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { render, screen } from "@testing-library/react";
import { vi, it, expect, afterEach, describe } from "vitest";
import * as RF from "@xyflow/react";
import { GraphNodeType } from "@serverlessworkflow/sdk";
import { GraphNodeType } from "@openworkflowspec/sdk";
import { ReactFlowNodeTypes } from "../../../src/react-flow/nodes/Nodes";
import {
containerNodeConfigMap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { it, expect, describe } from "vitest";
import { GraphNodeType } from "@serverlessworkflow/sdk";
import { GraphNodeType } from "@openworkflowspec/sdk";
import {
CATCH_CONTAINER_NODE_TYPE,
type ContainerNodeType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { describe, it, expect } from "vitest";
import { screen } from "@testing-library/react";
import { WorkflowInfoView } from "../../src/side-panel/WorkflowInfoView";
import { renderWithProviders } from "../test-utils/render-helpers";
import type { Specification } from "@serverlessworkflow/sdk";
import type { Specification } from "@openworkflowspec/sdk";

const baseDocument: Specification.Document = {
dsl: "1.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { FlatGraph, FlatGraphNode, GraphNodeType } from "@serverlessworkflow/sdk";
import { FlatGraph, FlatGraphNode, GraphNodeType } from "@openworkflowspec/sdk";

export function createFlatGraph(
nodes: FlatGraphNode[],
Expand Down
32 changes: 16 additions & 16 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ catalog:
"@changesets/changelog-github": ^0.7.0
"@changesets/cli": ^2.31.0
"@chromatic-com/storybook": ^5.2.0
"@openworkflowspec/sdk": "^1.0.3-alpha4"
"@playwright/test": ^1.61.1
"@serverlessworkflow/sdk": ^1.0.3-alpha3
"@storybook/addon-a11y": ^10.4.6
"@storybook/addon-docs": ^10.4.6
"@storybook/addon-vitest": ^10.4.6
Expand Down