@dataparade/cli 0.0.30 → 0.0.31

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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataparade/cli",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "dataPARADE CLI — scan codebases for privacy and security data flows",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@clack/prompts": "^1.8.1",
58
- "@sentry/node": "^10.38.0",
58
+ "@sentry/node": "^10.75.2",
59
59
  "commander": "^14.0.3",
60
60
  "dotenv": "^16.4.7",
61
61
  "langsmith": "^0.10.13",
@@ -66,7 +66,7 @@
66
66
  "zod": "^4.3.5"
67
67
  },
68
68
  "devDependencies": {
69
- "@dataparade/scanner": "github:DataParade-io/scanner#6a5a95897fe9ccd60230b0636f3a91b2e21a1ab1",
69
+ "@dataparade/scanner": "github:DataParade-io/scanner#dc6104f9108cbb3647eb595861e73090f3cc257a",
70
70
  "@eslint/js": "^9.18.0",
71
71
  "@types/jest": "^30.0.0",
72
72
  "@types/node": "^22.0.0",
@@ -9,3 +9,5 @@ export declare const MANAGED_NODE_Y_STEP = 200;
9
9
  export declare const TERRAFORM_LANE_X_STEP = 400;
10
10
  /** Horizontal space per section (TF lanes + optional managed column beside provider). */
11
11
  export declare const SECTION_BLOCK_WIDTH: number;
12
+ /** Space between the last column of one section and the first column of the next (one empty lane). */
13
+ export declare const SECTION_GAP_X: number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SECTION_BLOCK_WIDTH = exports.TERRAFORM_LANE_X_STEP = exports.MANAGED_NODE_Y_STEP = exports.MANAGED_NODE_Y_BASE_OFFSET = exports.MANAGED_NODE_X_OFFSET = exports.NODES_PER_ROW = exports.NODE_VERTICAL_SPACING = exports.NODE_HORIZONTAL_SPACING = void 0;
3
+ exports.SECTION_GAP_X = exports.SECTION_BLOCK_WIDTH = exports.TERRAFORM_LANE_X_STEP = exports.MANAGED_NODE_Y_STEP = exports.MANAGED_NODE_Y_BASE_OFFSET = exports.MANAGED_NODE_X_OFFSET = exports.NODES_PER_ROW = exports.NODE_VERTICAL_SPACING = exports.NODE_HORIZONTAL_SPACING = void 0;
4
4
  exports.NODE_HORIZONTAL_SPACING = 350;
5
5
  exports.NODE_VERTICAL_SPACING = 200;
6
6
  exports.NODES_PER_ROW = 4;
@@ -12,3 +12,5 @@ exports.MANAGED_NODE_Y_STEP = exports.NODE_VERTICAL_SPACING;
12
12
  exports.TERRAFORM_LANE_X_STEP = 400;
13
13
  /** Horizontal space per section (TF lanes + optional managed column beside provider). */
14
14
  exports.SECTION_BLOCK_WIDTH = Math.max(exports.NODES_PER_ROW * exports.NODE_HORIZONTAL_SPACING, 5 * exports.TERRAFORM_LANE_X_STEP + exports.MANAGED_NODE_X_OFFSET + 120);
15
+ /** Space between the last column of one section and the first column of the next (one empty lane). */
16
+ exports.SECTION_GAP_X = 2 * exports.TERRAFORM_LANE_X_STEP;
@@ -0,0 +1,9 @@
1
+ import type { DiagramNodeSchema } from "../../schema";
2
+ import type { ComponentByIdMap } from "./types";
3
+ /**
4
+ * Section layouts start each section at a fixed `SECTION_BLOCK_WIDTH` offset,
5
+ * which leaves wide empty bands after sparse sections. Shift every section left
6
+ * so it starts `SECTION_GAP_X` after the previous one actually ends; the shape
7
+ * inside each section is unchanged.
8
+ */
9
+ export declare function packSectionsHorizontally(nodes: DiagramNodeSchema[], componentsById: ComponentByIdMap, sectionIds: string[]): void;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.packSectionsHorizontally = packSectionsHorizontally;
4
+ const constants_1 = require("./constants");
5
+ const section_helpers_1 = require("./section-helpers");
6
+ /**
7
+ * Section layouts start each section at a fixed `SECTION_BLOCK_WIDTH` offset,
8
+ * which leaves wide empty bands after sparse sections. Shift every section left
9
+ * so it starts `SECTION_GAP_X` after the previous one actually ends; the shape
10
+ * inside each section is unchanged.
11
+ */
12
+ function packSectionsHorizontally(nodes, componentsById, sectionIds) {
13
+ const nodesBySection = new Map();
14
+ for (const node of nodes) {
15
+ const component = componentsById.get(node.id);
16
+ if (!component)
17
+ continue;
18
+ const sectionId = (0, section_helpers_1.getSectionIdFromComponent)(component);
19
+ const list = nodesBySection.get(sectionId) ?? [];
20
+ list.push(node);
21
+ nodesBySection.set(sectionId, list);
22
+ }
23
+ let nextX = null;
24
+ for (const sectionId of sectionIds) {
25
+ const sectionNodes = nodesBySection.get(sectionId);
26
+ if (!sectionNodes?.length)
27
+ continue;
28
+ const xs = sectionNodes.map((node) => node.position.x);
29
+ const minX = Math.min(...xs);
30
+ const maxX = Math.max(...xs);
31
+ // Only ever pull sections left, so packing can't push them into each other.
32
+ const shift = nextX === null ? 0 : Math.min(0, nextX - minX);
33
+ if (shift < 0) {
34
+ for (const node of sectionNodes) {
35
+ node.position = { x: node.position.x + shift, y: node.position.y };
36
+ }
37
+ }
38
+ nextX = maxX + shift + constants_1.SECTION_GAP_X;
39
+ }
40
+ }
@@ -10,6 +10,7 @@ const edge_handles_1 = require("./diagram-layout/edge-handles");
10
10
  const managed_provider_layout_1 = require("./diagram-layout/managed-provider-layout");
11
11
  const minimal_terraform_layout_1 = require("./diagram-layout/minimal-terraform-layout");
12
12
  const section_helpers_1 = require("./diagram-layout/section-helpers");
13
+ const section_packing_1 = require("./diagram-layout/section-packing");
13
14
  const terraform_lane_layout_1 = require("./diagram-layout/terraform-lane-layout");
14
15
  const terraform_minimal_services_1 = require("./terraform-minimal-services");
15
16
  const infer_data_flow_protocol_1 = require("./infer-data-flow-protocol");
@@ -341,6 +342,7 @@ function buildDiagramGraphFromScanResult(scanResult) {
341
342
  (0, terraform_lane_layout_1.applyTerraformLaneLayout)(nodes, componentsById, sectionIds);
342
343
  (0, app_section_layout_1.applyAppSectionStackLayout)(nodes, componentsById, sectionIds);
343
344
  (0, managed_provider_layout_1.repositionManagedProviderNodes)(nodes, componentsById);
345
+ (0, section_packing_1.packSectionsHorizontally)(nodes, componentsById, sectionIds);
344
346
  }
345
347
  for (const flow of scanResult.dataFlows) {
346
348
  const edge = mapDataFlowToEdge(flow, componentsById);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataparade/cli",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "dataPARADE CLI — scan codebases for privacy and security data flows",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@clack/prompts": "^1.8.1",
58
- "@sentry/node": "^10.38.0",
58
+ "@sentry/node": "^10.75.2",
59
59
  "commander": "^14.0.3",
60
60
  "dotenv": "^16.4.7",
61
61
  "langsmith": "^0.10.13",
@@ -66,7 +66,7 @@
66
66
  "zod": "^4.3.5"
67
67
  },
68
68
  "devDependencies": {
69
- "@dataparade/scanner": "github:DataParade-io/scanner#6a5a95897fe9ccd60230b0636f3a91b2e21a1ab1",
69
+ "@dataparade/scanner": "github:DataParade-io/scanner#dc6104f9108cbb3647eb595861e73090f3cc257a",
70
70
  "@eslint/js": "^9.18.0",
71
71
  "@types/jest": "^30.0.0",
72
72
  "@types/node": "^22.0.0",