@syntax-syllogism/flow-delta 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,32 +1,72 @@
1
1
  # FlowDelta
2
2
 
3
- A semantic, visual diff for Salesforce Flows: parse two versions of a
4
- `.flow-meta.xml`, diff them by stable node name, and render a self-contained
5
- interactive HTML artifact (plus `diff.json`) that shows added / deleted /
6
- modified / unchanged nodes and edges with per-property deltas.
3
+ <img width="1638" height="1392" alt="Screencast Demo" src="https://github.com/user-attachments/assets/b3f5f248-485a-4f62-9955-805a1b57186b" />
4
+
5
+ [![npm](https://img.shields.io/npm/v/@syntax-syllogism/flow-delta.svg)](https://www.npmjs.com/package/@syntax-syllogism/flow-delta)
6
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7
+
8
+ **Stop reviewing Salesforce Flow changes as raw XML.** FlowDelta parses two
9
+ versions of a `.flow-meta.xml`, diffs them by stable node name, and renders a
10
+ self-contained interactive HTML artifact (plus `diff.json`) that shows added /
11
+ deleted / modified / unchanged nodes and edges with per-property deltas.
7
12
 
8
13
  Inspired by Google's [Flow Lens](https://github.com/google/flow-lens), with a
9
14
  focus on CI review workflows for GitLab merge requests and GitHub pull requests.
10
15
  We also opted for our own HTML output over plantuml, graphviz, or mermaid.
11
16
 
17
+ The package also ships [FlexiPageDelta](docs/flexipage.md), a sibling tool for
18
+ semantic diffs of `.flexipage-meta.xml` metadata. It renders an offline
19
+ hierarchical outline and provides `flexipage-delta`,
20
+ `flexipage-delta-gitlab`, and `flexipage-delta-github` binaries.
21
+
12
22
  - [Sample GitLab project with artifacts](https://gitlab.com/j.p.richter/flow-delta-example/-/merge_requests/)
13
23
  - [Sample GitHub project with artifacts](https://github.com/Syntax-Syllogism/flow-delta-example/pulls)
14
24
 
25
+ ## Quick Start
26
+
27
+ No install required:
28
+
29
+ ```bash
30
+ npx @syntax-syllogism/flow-delta --old before.flow-meta.xml --new after.flow-meta.xml --out ./flow-delta-out
31
+ ```
32
+
33
+ Open the generated `.html` file in a browser to see the interactive diff
34
+ shown above.
35
+
36
+ Prefer a permanent install?
37
+
38
+ ```bash
39
+ npm install -g @syntax-syllogism/flow-delta
40
+ flow-delta --old before.flow-meta.xml --new after.flow-meta.xml --out ./flow-delta-out
41
+ ```
42
+
15
43
  ## Usage
16
44
 
17
- Runs as a TypeScript CLI via `tsx` (no build step). See [docs/cli.md](docs/cli.md)
18
- for full file-mode and git-mode options.
45
+ See [docs/cli.md](docs/cli.md) for full file-mode and git-mode options.
46
+
47
+ For FlexiPage metadata, use the sibling CLI documented in
48
+ [docs/flexipage.md](docs/flexipage.md):
19
49
 
20
50
  ```bash
21
- npx tsx src/cli.ts --old before.flow-meta.xml --new after.flow-meta.xml --out ./flow-delta-out --json
51
+ npx flexipage-delta --old before.flexipage-meta.xml --new after.flexipage-meta.xml --out ./flexipage-delta-out --json
52
+ ```
53
+
54
+ ```bash
55
+ # File mode — compare two local files
56
+ npx @syntax-syllogism/flow-delta --old before.flow-meta.xml --new after.flow-meta.xml --out ./flow-delta-out --json
57
+
58
+ # Git mode — compare two refs in a repo
59
+ npx @syntax-syllogism/flow-delta --repo /path/to/sfdx-repo --from main --to feature-branch --path 'force-app/**/*.flow-meta.xml' --out ./flow-delta-out
22
60
  ```
23
61
 
24
62
  CI reporters read the generated `flow-delta-out/*.diff.json` files and post a
25
- sticky review comment:
63
+ sticky review comment. Install the package first (these binaries don't map
64
+ 1:1 to the package name, so plain `npx` won't resolve them):
26
65
 
27
66
  ```bash
28
- flow-delta-gitlab --in flow-delta-out
29
- flow-delta-github --in flow-delta-out
67
+ npm install @syntax-syllogism/flow-delta
68
+ npx flow-delta-gitlab --in flow-delta-out
69
+ npx flow-delta-github --in flow-delta-out
30
70
  ```
31
71
 
32
72
  The GitHub reporter can also consume `--artifact-urls <manifest.json>` for
@@ -36,10 +76,16 @@ recipes, private-repo artifact viewing, and smoke harnesses.
36
76
 
37
77
  ## Development
38
78
 
79
+ Working from a clone of this repo? Runs as a TypeScript CLI via `tsx`, no
80
+ build step:
81
+
39
82
  ```bash
40
83
  npm install
41
84
  npm test # parser + semantic diff / render / CLI suites
42
- npm run render:fixtures # render every diff fixture to flow-delta-out/fixtures/
85
+ npm run render:fixtures # render all Flow + FlexiPage fixtures
86
+ npm run render:fixtures -- flow # Flow only
87
+ npm run render:fixtures -- flexipage # FlexiPage only
88
+ npx tsx src/cli.ts --old before.flow-meta.xml --new after.flow-meta.xml --out ./flow-delta-out --json
43
89
  ```
44
90
 
45
91
  Architecture, testing, and the vendored-parser policy are documented in
package/dist/cli.js CHANGED
@@ -560,7 +560,8 @@ function collectNodes(parsed) {
560
560
  continue;
561
561
  }
562
562
  for (const node of nodes) {
563
- result.push(toNode(node, type));
563
+ const graphNode = toNode(node, type);
564
+ if (graphNode) result.push(graphNode);
564
565
  }
565
566
  }
566
567
  return result;
@@ -835,7 +836,7 @@ async function layoutDiff(diff) {
835
836
  }
836
837
  };
837
838
  }
838
- var elk = new ELK();
839
+ var elk = new ELK.default();
839
840
  async function layoutView(diff, nodeVisible, edgeVisible) {
840
841
  const nodes = diff.nodes.filter(nodeVisible);
841
842
  const nodeIds = new Set(nodes.map((node) => node.id));
@@ -848,8 +849,8 @@ async function layoutView(diff, nodeVisible, edgeVisible) {
848
849
  layoutOptions: {
849
850
  "elk.algorithm": "layered",
850
851
  "elk.direction": "DOWN",
851
- "elk.layered.spacing.nodeNodeBetweenLayers": 60,
852
- "elk.spacing.nodeNode": 40
852
+ "elk.layered.spacing.nodeNodeBetweenLayers": "60",
853
+ "elk.spacing.nodeNode": "40"
853
854
  },
854
855
  children: nodes.map((node) => ({
855
856
  id: node.id,
@@ -1558,8 +1559,10 @@ function snapshotPanelClientScript() {
1558
1559
  return "const LONG_TEXT_THRESHOLD = " + LONG_TEXT_THRESHOLD + ";\nconst COLLECTION_KEYS = new Set(" + JSON.stringify(COLLECTION_KEY_NAMES) + ");\n\n" + functions;
1559
1560
  }
1560
1561
 
1561
- // src/render/render-html.ts
1562
+ // src/render/shell.ts
1562
1563
  var THEME_STORAGE_KEY = "flow-delta-theme";
1564
+
1565
+ // src/render/render-html.ts
1563
1566
  function renderHtml(layout) {
1564
1567
  const data = {
1565
1568
  diff: layout.diff,