From fa3c6b2f9e58121f2a920d1c632530c66c9aaa59 Mon Sep 17 00:00:00 2001 From: Marc Dumais Date: Wed, 9 Jul 2025 15:11:16 -0400 Subject: [PATCH 1/5] WIP - adapt after adding local traceviewer-* libs as subtrees Small adaptations to root package.json, various tsconfig.json. Signed-off-by: Marc Dumais --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 98d7413..94043fe 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,7 +27,7 @@ ], "references": [ { - "path": "../base" + "path": "../traceviewer-base" } ] } From 16ef0cd09f5474ebeeade3f6accd663e7e2beb03 Mon Sep 17 00:00:00 2001 From: Marc Dumais Date: Wed, 9 Jul 2025 15:23:38 -0400 Subject: [PATCH 2/5] prevent traceviewer-* libraries' versions being updated by lerna It would be preferable to manage the version of traceviewer base and react libraries elsewhere. Lerna is stepping the various packages versions, when we do releases, using the package.json scripts entries, e.g. "yarn version:patch". The trick used is to have lerna only step the version of public packages (vscode-trace-extension only) and leave the others alone, including the traceviewer-* libraries. For this to work, it was necessary to mark the libraries as private - this change will have to be undone wherever they might get published to npm. Signed-off-by: Marc Dumais --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 2a6405c..f0245d7 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "traceviewer-react-components", + "private": true, "version": "0.9.1", "description": "Trace Compass react components", "license": "MIT", From 183774abc870b52ca94313ca90d5e1d03ffde427 Mon Sep 17 00:00:00 2001 From: Marc Dumais Date: Wed, 9 Jul 2025 15:43:12 -0400 Subject: [PATCH 3/5] [traceviewer-react] add missing @types/lodash.debounce dev dependency Signed-off-by: Marc Dumais --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index f0245d7..fd2517e 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "@types/d3": "^7.1.0", "@types/jest": "^28.0.0", "@types/lodash": "^4.14.142", + "@types/lodash.debounce": "4.0.3", "@types/react-grid-layout": "^1.1.1", "@types/react-modal": "^3.8.2", "@types/react-test-renderer": "^18.3.0", From fdf7eb1c3cd7f806f566da6c48ea8911d997dea8 Mon Sep 17 00:00:00 2001 From: Marc Dumais Date: Thu, 10 Jul 2025 09:43:24 -0400 Subject: [PATCH 4/5] [traceviewer-*] align code to respect linter and formatter Signed-off-by: Marc Dumais --- .eslintrc.js | 3 ++- package.json | 1 + src/components/abstract-xy-output-component.tsx | 12 ++++++------ src/components/data-providers/tsp-data-provider.ts | 2 +- src/components/timegraph-output-component.tsx | 4 ++-- src/components/utils/xy-output-component-utils.tsx | 4 ++-- src/components/xy-output-component.tsx | 4 ++-- 7 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 9605d88..6c2a103 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -19,7 +19,8 @@ module.exports = { 'plugin:@typescript-eslint/recommended', '../../configs/base.eslintrc.json', '../../configs/warnings.eslintrc.json', - '../../configs/errors.eslintrc.json' + '../../configs/errors.eslintrc.json', + "prettier" ], ignorePatterns: [ 'node_modules', diff --git a/package.json b/package.json index fd2517e..d4ff629 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "jest": "^28.1.3", "jest-canvas-mock": "^2.4.0", "jest-environment-jsdom": "^28.1.3", + "prettier": "^3.6.2", "react-test-renderer": "^18.2.0", "rimraf": "^5.0.0", "ts-jest": "^28.0.8", diff --git a/src/components/abstract-xy-output-component.tsx b/src/components/abstract-xy-output-component.tsx index 36d5d06..5d0895a 100644 --- a/src/components/abstract-xy-output-component.tsx +++ b/src/components/abstract-xy-output-component.tsx @@ -383,12 +383,12 @@ export abstract class AbstractXYOutputComponent< d >= 1000000000000 ? Math.round(d / 100000000000) / 10 + 'G' : d >= 1000000000 - ? Math.round(d / 100000000) / 10 + 'B' - : d >= 1000000 - ? Math.round(d / 100000) / 10 + 'M' - : d >= 1000 - ? Math.round(d / 100) / 10 + 'K' - : Math.round(d * 10) / 10; + ? Math.round(d / 100000000) / 10 + 'B' + : d >= 1000000 + ? Math.round(d / 100000) / 10 + 'M' + : d >= 1000 + ? Math.round(d / 100) / 10 + 'K' + : Math.round(d * 10) / 10; if (this.state.allMax > 0) { select(this.yAxisRef.current) diff --git a/src/components/data-providers/tsp-data-provider.ts b/src/components/data-providers/tsp-data-provider.ts index 95fc993..3ddcf30 100644 --- a/src/components/data-providers/tsp-data-provider.ts +++ b/src/components/data-providers/tsp-data-provider.ts @@ -197,7 +197,7 @@ export class TspDataProvider { start: arrow.start - offset, end: arrow.end - offset } as TimelineChart.TimeGraphRange - } as TimelineChart.TimeGraphArrow) + }) as TimelineChart.TimeGraphArrow ); return arrows; } diff --git a/src/components/timegraph-output-component.tsx b/src/components/timegraph-output-component.tsx index 70df1e1..794286c 100644 --- a/src/components/timegraph-output-component.tsx +++ b/src/components/timegraph-output-component.tsx @@ -546,8 +546,8 @@ export class TimegraphOutputComponent extends AbstractTreeOutputComponent Date: Thu, 10 Jul 2025 15:27:21 -0400 Subject: [PATCH 5/5] Improved watch mode With a correct tsconfig.json setup, it's possible to watch all the typescript workspaces' code using a single "tsc -b -w", executed at the repo root. It's also necessary to cover webpack where it is used. https://webpack.js.org/configuration/watch Signed-off-by: Marc Dumais --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index d4ff629..0409170 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,6 @@ "lint": "eslint .", "lint:fix": "eslint . --fix", "test": "jest --config jest.config.json", - "watch": "tsc -b -w", "format:write": "prettier --write ./src", "format:check": "prettier --check ./src" }