@syntax-syllogism/flow-delta 0.5.1 → 0.6.1
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 +28 -1
- package/dist/cli.js +8 -5
- package/dist/flexipage-cli.js +704 -0
- package/dist/flexipage-github-report.js +196 -0
- package/dist/flexipage-gitlab-report.js +159 -0
- package/dist/github-report.js +18 -17
- package/dist/gitlab-report.js +18 -17
- package/examples/cloudflare-worker/src/index.ts +9 -0
- package/examples/github-actions.yml +21 -3
- package/examples/gitlab-ci.yml +10 -1
- package/package.json +13 -6
package/README.md
CHANGED
|
@@ -14,6 +14,14 @@ Inspired by Google's [Flow Lens](https://github.com/google/flow-lens), with a
|
|
|
14
14
|
focus on CI review workflows for GitLab merge requests and GitHub pull requests.
|
|
15
15
|
We also opted for our own HTML output over plantuml, graphviz, or mermaid.
|
|
16
16
|
|
|
17
|
+
Raw XML isn't just a Flow problem. The package also ships
|
|
18
|
+
[FlexiPageDelta](docs/flexipage.md), a sibling tool that does the same for
|
|
19
|
+
`.flexipage-meta.xml` — semantic diffs of regions, components, and facets,
|
|
20
|
+
rendered as an interactive outline with an optional template-aware wireframe
|
|
21
|
+
canvas so you can see *where* on the page layout changed, not just what.
|
|
22
|
+
`flexipage-delta`, `flexipage-delta-gitlab`, and `flexipage-delta-github`
|
|
23
|
+
ship alongside the Flow binaries.
|
|
24
|
+
|
|
17
25
|
- [Sample GitLab project with artifacts](https://gitlab.com/j.p.richter/flow-delta-example/-/merge_requests/)
|
|
18
26
|
- [Sample GitHub project with artifacts](https://github.com/Syntax-Syllogism/flow-delta-example/pulls)
|
|
19
27
|
|
|
@@ -35,10 +43,24 @@ npm install -g @syntax-syllogism/flow-delta
|
|
|
35
43
|
flow-delta --old before.flow-meta.xml --new after.flow-meta.xml --out ./flow-delta-out
|
|
36
44
|
```
|
|
37
45
|
|
|
46
|
+
Working with Lightning pages instead? [FlexiPageDelta](docs/flexipage.md)
|
|
47
|
+
is available too:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx flexipage-delta --old before.flexipage-meta.xml --new after.flexipage-meta.xml --out ./flexipage-delta-out
|
|
51
|
+
```
|
|
52
|
+
|
|
38
53
|
## Usage
|
|
39
54
|
|
|
40
55
|
See [docs/cli.md](docs/cli.md) for full file-mode and git-mode options.
|
|
41
56
|
|
|
57
|
+
For FlexiPage metadata, see [docs/flexipage.md](docs/flexipage.md) for the
|
|
58
|
+
full CLI, outline/wireframe artifact, and CI reporting details:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx flexipage-delta --old before.flexipage-meta.xml --new after.flexipage-meta.xml --out ./flexipage-delta-out --json
|
|
62
|
+
```
|
|
63
|
+
|
|
42
64
|
```bash
|
|
43
65
|
# File mode — compare two local files
|
|
44
66
|
npx @syntax-syllogism/flow-delta --old before.flow-meta.xml --new after.flow-meta.xml --out ./flow-delta-out --json
|
|
@@ -57,6 +79,9 @@ npx flow-delta-gitlab --in flow-delta-out
|
|
|
57
79
|
npx flow-delta-github --in flow-delta-out
|
|
58
80
|
```
|
|
59
81
|
|
|
82
|
+
FlexiPageDelta has the same reporters — swap in `flexipage-delta-gitlab` /
|
|
83
|
+
`flexipage-delta-github` and point `--in` at `flexipage-delta-out`.
|
|
84
|
+
|
|
60
85
|
The GitHub reporter can also consume `--artifact-urls <manifest.json>` for
|
|
61
86
|
user-owned live-render links, such as R2 presigned URLs or Cloudflare
|
|
62
87
|
Worker-backed URLs. See [docs/ci.md](docs/ci.md) for GitLab/GitHub workflow
|
|
@@ -70,7 +95,9 @@ build step:
|
|
|
70
95
|
```bash
|
|
71
96
|
npm install
|
|
72
97
|
npm test # parser + semantic diff / render / CLI suites
|
|
73
|
-
npm run render:fixtures # render
|
|
98
|
+
npm run render:fixtures # render all Flow + FlexiPage fixtures
|
|
99
|
+
npm run render:fixtures -- flow # Flow only
|
|
100
|
+
npm run render:fixtures -- flexipage # FlexiPage only
|
|
74
101
|
npx tsx src/cli.ts --old before.flow-meta.xml --new after.flow-meta.xml --out ./flow-delta-out --json
|
|
75
102
|
```
|
|
76
103
|
|
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
|
-
|
|
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/
|
|
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,
|