From 29eb07c159046019ee5c69ceb67e110b3ada08c6 Mon Sep 17 00:00:00 2001 From: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com> Date: Thu, 23 May 2024 15:19:12 -0700 Subject: [PATCH] Fix calling tools JS --- .eslintignore | 1 + .gitignore | 3 -- .prettierignore | 1 + app/main.ts | 2 +- calling_tools.html | 2 +- .../calling-tools}/assert.js | 0 .../calling-tools}/candidate_grid.js | 0 .../calling-tools}/data_series.js | 0 .../calling-tools}/dump_creator.js | 0 .../peer_connection_update_table.js | 0 .../calling-tools}/stats_graph_helper.js | 0 .../calling-tools}/stats_helper.js | 0 .../calling-tools}/stats_rates_calculator.js | 0 .../calling-tools}/stats_table.js | 0 .../calling-tools}/tab_view.js | 0 .../calling-tools}/timeline_graph_view.js | 0 .../calling-tools}/user_media_table.js | 0 .../callingtools => js/calling-tools}/util.js | 0 .../calling-tools}/webrtc_internals.js | 2 +- scripts/esbuild.js | 6 ++-- ts/util/lint/license_comments.ts | 28 +++++++++---------- .../preload.ts | 0 ts/windows/calling-tools/webrtc_internals.ts | 5 ++++ 23 files changed, 27 insertions(+), 23 deletions(-) rename {ts/windows/callingtools => js/calling-tools}/assert.js (100%) rename {ts/windows/callingtools => js/calling-tools}/candidate_grid.js (100%) rename {ts/windows/callingtools => js/calling-tools}/data_series.js (100%) rename {ts/windows/callingtools => js/calling-tools}/dump_creator.js (100%) rename {ts/windows/callingtools => js/calling-tools}/peer_connection_update_table.js (100%) rename {ts/windows/callingtools => js/calling-tools}/stats_graph_helper.js (100%) rename {ts/windows/callingtools => js/calling-tools}/stats_helper.js (100%) rename {ts/windows/callingtools => js/calling-tools}/stats_rates_calculator.js (100%) rename {ts/windows/callingtools => js/calling-tools}/stats_table.js (100%) rename {ts/windows/callingtools => js/calling-tools}/tab_view.js (100%) rename {ts/windows/callingtools => js/calling-tools}/timeline_graph_view.js (100%) rename {ts/windows/callingtools => js/calling-tools}/user_media_table.js (100%) rename {ts/windows/callingtools => js/calling-tools}/util.js (100%) rename {ts/windows/callingtools => js/calling-tools}/webrtc_internals.js (99%) rename ts/windows/{callingtools => calling-tools}/preload.ts (100%) create mode 100644 ts/windows/calling-tools/webrtc_internals.ts diff --git a/.eslintignore b/.eslintignore index 78947d7252..f5f3cc1921 100644 --- a/.eslintignore +++ b/.eslintignore @@ -20,6 +20,7 @@ build/ICUMessageParams.d.ts # Third-party files js/Mp3LameEncoder.min.js js/WebAudioRecorderMp3.js +js/calling-tools/** # TypeScript generated files app/**/*.js diff --git a/.gitignore b/.gitignore index b114e03513..32250a00c6 100644 --- a/.gitignore +++ b/.gitignore @@ -38,9 +38,6 @@ build/ICUMessageParams.d.ts app/*.js ts/**/*.js ts/protobuf/*.d.ts -# allow js from callingtools -!ts/windows/callingtools/**/*.js -ts/windows/callingtools/preload.js # CSS Modules **/*.scss.d.ts diff --git a/.prettierignore b/.prettierignore index 460b718077..05daf15807 100644 --- a/.prettierignore +++ b/.prettierignore @@ -29,6 +29,7 @@ components/** js/curve/** js/Mp3LameEncoder.min.js js/WebAudioRecorderMp3.js +js/calling-tools/** # Assets /images/ diff --git a/app/main.ts b/app/main.ts index 6957dfef75..e70940e36c 100644 --- a/app/main.ts +++ b/app/main.ts @@ -1266,7 +1266,7 @@ async function showCallingDevToolsWindow() { sandbox: true, contextIsolation: true, nativeWindowOpen: true, - preload: join(__dirname, '../bundles/callingtools/preload.js'), + preload: join(__dirname, '../bundles/calling-tools/preload.js'), }, }; diff --git a/calling_tools.html b/calling_tools.html index 250ab268bd..b725596fb3 100644 --- a/calling_tools.html +++ b/calling_tools.html @@ -31,7 +31,7 @@ /> diff --git a/ts/windows/callingtools/assert.js b/js/calling-tools/assert.js similarity index 100% rename from ts/windows/callingtools/assert.js rename to js/calling-tools/assert.js diff --git a/ts/windows/callingtools/candidate_grid.js b/js/calling-tools/candidate_grid.js similarity index 100% rename from ts/windows/callingtools/candidate_grid.js rename to js/calling-tools/candidate_grid.js diff --git a/ts/windows/callingtools/data_series.js b/js/calling-tools/data_series.js similarity index 100% rename from ts/windows/callingtools/data_series.js rename to js/calling-tools/data_series.js diff --git a/ts/windows/callingtools/dump_creator.js b/js/calling-tools/dump_creator.js similarity index 100% rename from ts/windows/callingtools/dump_creator.js rename to js/calling-tools/dump_creator.js diff --git a/ts/windows/callingtools/peer_connection_update_table.js b/js/calling-tools/peer_connection_update_table.js similarity index 100% rename from ts/windows/callingtools/peer_connection_update_table.js rename to js/calling-tools/peer_connection_update_table.js diff --git a/ts/windows/callingtools/stats_graph_helper.js b/js/calling-tools/stats_graph_helper.js similarity index 100% rename from ts/windows/callingtools/stats_graph_helper.js rename to js/calling-tools/stats_graph_helper.js diff --git a/ts/windows/callingtools/stats_helper.js b/js/calling-tools/stats_helper.js similarity index 100% rename from ts/windows/callingtools/stats_helper.js rename to js/calling-tools/stats_helper.js diff --git a/ts/windows/callingtools/stats_rates_calculator.js b/js/calling-tools/stats_rates_calculator.js similarity index 100% rename from ts/windows/callingtools/stats_rates_calculator.js rename to js/calling-tools/stats_rates_calculator.js diff --git a/ts/windows/callingtools/stats_table.js b/js/calling-tools/stats_table.js similarity index 100% rename from ts/windows/callingtools/stats_table.js rename to js/calling-tools/stats_table.js diff --git a/ts/windows/callingtools/tab_view.js b/js/calling-tools/tab_view.js similarity index 100% rename from ts/windows/callingtools/tab_view.js rename to js/calling-tools/tab_view.js diff --git a/ts/windows/callingtools/timeline_graph_view.js b/js/calling-tools/timeline_graph_view.js similarity index 100% rename from ts/windows/callingtools/timeline_graph_view.js rename to js/calling-tools/timeline_graph_view.js diff --git a/ts/windows/callingtools/user_media_table.js b/js/calling-tools/user_media_table.js similarity index 100% rename from ts/windows/callingtools/user_media_table.js rename to js/calling-tools/user_media_table.js diff --git a/ts/windows/callingtools/util.js b/js/calling-tools/util.js similarity index 100% rename from ts/windows/callingtools/util.js rename to js/calling-tools/util.js diff --git a/ts/windows/callingtools/webrtc_internals.js b/js/calling-tools/webrtc_internals.js similarity index 99% rename from ts/windows/callingtools/webrtc_internals.js rename to js/calling-tools/webrtc_internals.js index 24c685d828..152b401d8d 100644 --- a/ts/windows/callingtools/webrtc_internals.js +++ b/js/calling-tools/webrtc_internals.js @@ -11,7 +11,7 @@ import {StatsRatesCalculator, StatsReport} from './stats_rates_calculator.js'; import {StatsTable} from './stats_table.js'; import {TabView} from './tab_view.js'; import {UserMediaTable} from './user_media_table.js'; -import { i18n } from '../sandboxedInit.js'; +import { i18n } from '../../ts/windows/sandboxedInit.js'; let tabView = null; let peerConnectionUpdateTable = null; diff --git a/scripts/esbuild.js b/scripts/esbuild.js index eb5c871527..5cd771718b 100644 --- a/scripts/esbuild.js +++ b/scripts/esbuild.js @@ -136,8 +136,8 @@ async function sandboxedEnv() { ROOT_DIR, 'ts', 'windows', - 'callingtools', - 'webrtc_internals.js' + 'calling-tools', + 'webrtc_internals.ts' ), ], }, @@ -149,7 +149,7 @@ async function sandboxedEnv() { path.join(ROOT_DIR, 'ts', 'windows', 'debuglog', 'preload.ts'), path.join(ROOT_DIR, 'ts', 'windows', 'loading', 'preload.ts'), path.join(ROOT_DIR, 'ts', 'windows', 'permissions', 'preload.ts'), - path.join(ROOT_DIR, 'ts', 'windows', 'callingtools', 'preload.ts'), + path.join(ROOT_DIR, 'ts', 'windows', 'calling-tools', 'preload.ts'), path.join(ROOT_DIR, 'ts', 'windows', 'screenShare', 'preload.ts'), path.join(ROOT_DIR, 'ts', 'windows', 'settings', 'preload.ts'), ], diff --git a/ts/util/lint/license_comments.ts b/ts/util/lint/license_comments.ts index 50b3170cca..74c2ba78ec 100644 --- a/ts/util/lint/license_comments.ts +++ b/ts/util/lint/license_comments.ts @@ -52,20 +52,20 @@ const FILES_TO_IGNORE = new Set( 'sticker-creator/src/util/protos.js', // ignore calling developer tools licensing which use Chromium license 'calling_tools.html', - 'ts/windows/callingtools/assert.js', - 'ts/windows/callingtools/candidate_grid.js', - 'ts/windows/callingtools/data_series.js', - 'ts/windows/callingtools/dump_creator.js', - 'ts/windows/callingtools/peer_connection_update_table.js', - 'ts/windows/callingtools/stats_graph_helper.js', - 'ts/windows/callingtools/stats_helper.js', - 'ts/windows/callingtools/stats_rates_calculator.js', - 'ts/windows/callingtools/stats_table.js', - 'ts/windows/callingtools/tab_view.js', - 'ts/windows/callingtools/timeline_graph_view.js', - 'ts/windows/callingtools/user_media_table.js', - 'ts/windows/callingtools/util.js', - 'ts/windows/callingtools/webrtc_internals.js', + 'js/calling-tools/assert.js', + 'js/calling-tools/candidate_grid.js', + 'js/calling-tools/data_series.js', + 'js/calling-tools/dump_creator.js', + 'js/calling-tools/peer_connection_update_table.js', + 'js/calling-tools/stats_graph_helper.js', + 'js/calling-tools/stats_helper.js', + 'js/calling-tools/stats_rates_calculator.js', + 'js/calling-tools/stats_table.js', + 'js/calling-tools/tab_view.js', + 'js/calling-tools/timeline_graph_view.js', + 'js/calling-tools/user_media_table.js', + 'js/calling-tools/util.js', + 'js/calling-tools/webrtc_internals.js', ].map( // This makes sure the files are correct on Windows. path.normalize diff --git a/ts/windows/callingtools/preload.ts b/ts/windows/calling-tools/preload.ts similarity index 100% rename from ts/windows/callingtools/preload.ts rename to ts/windows/calling-tools/preload.ts diff --git a/ts/windows/calling-tools/webrtc_internals.ts b/ts/windows/calling-tools/webrtc_internals.ts new file mode 100644 index 0000000000..4ec88d5347 --- /dev/null +++ b/ts/windows/calling-tools/webrtc_internals.ts @@ -0,0 +1,5 @@ +// Copyright 2024 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +// eslint-disable-next-line import/extensions +import '../../../js/calling-tools/webrtc_internals.js';