Switch to relative imports in .ts files
With the upcoming rules_js switch, I could only get relative imports
to work reliably. The absolute imports didn't work in some
circumstances. This patch gets all non-scouting directories moved to
relative imports. The motivation here is to keep the final switchover
patch as small as possible.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I6df3e2d8b539e52bb8d1ee83f18284b6c00b6e46
diff --git a/frc971/analysis/cpp_plot/cpp_plot.ts b/frc971/analysis/cpp_plot/cpp_plot.ts
index a704e89..08e2b1c 100644
--- a/frc971/analysis/cpp_plot/cpp_plot.ts
+++ b/frc971/analysis/cpp_plot/cpp_plot.ts
@@ -1,7 +1,7 @@
// Plotter for the C++ in-process plotter.
-import {Configuration} from 'org_frc971/aos/configuration_generated';
-import {Connection} from 'org_frc971/aos/network/www/proxy';
-import {plotData} from 'org_frc971/frc971/analysis/plot_data_utils';
+import {Configuration} from '../../../aos/configuration_generated';
+import {Connection} from '../../../aos/network/www/proxy';
+import {plotData} from '../plot_data_utils';
const rootDiv = document.createElement('div');
rootDiv.classList.add('aos_cpp_plot');
diff --git a/frc971/analysis/plot_data_utils.ts b/frc971/analysis/plot_data_utils.ts
index 1362a09..25131fb 100644
--- a/frc971/analysis/plot_data_utils.ts
+++ b/frc971/analysis/plot_data_utils.ts
@@ -1,10 +1,10 @@
// Provides a plot which handles plotting the plot defined by a
// frc971.analysis.Plot message.
-import {Plot as PlotFb} from 'org_frc971/frc971/analysis/plot_data_generated';
-import {MessageHandler, TimestampedMessage} from 'org_frc971/aos/network/www/aos_plotter';
+import {Plot as PlotFb} from './plot_data_generated';
+import {MessageHandler, TimestampedMessage} from '../../aos/network/www/aos_plotter';
import {ByteBuffer} from 'flatbuffers';
-import {Plot, Point} from 'org_frc971/aos/network/www/plotter';
-import {Connection} from 'org_frc971/aos/network/www/proxy';
+import {Plot, Point} from '../../aos/network/www/plotter';
+import {Connection} from '../../aos/network/www/proxy';
import {Schema} from 'flatbuffers_reflection/reflection_generated';
export function plotData(conn: Connection, parentDiv: Element) {
diff --git a/frc971/analysis/plot_index.ts b/frc971/analysis/plot_index.ts
index af9bd73..ab00b99 100644
--- a/frc971/analysis/plot_index.ts
+++ b/frc971/analysis/plot_index.ts
@@ -20,41 +20,41 @@
// each robot year, and may even end up allowing plots to be specified solely
// using JSON rather than requiring people to write a script just to create
// a plot.
-import {Configuration} from 'org_frc971/aos/configuration_generated';
-import {Connection} from 'org_frc971/aos/network/www/proxy';
-import {plotImu} from 'org_frc971/frc971/wpilib/imu_plotter';
-import {plotDrivetrain} from 'org_frc971/frc971/control_loops/drivetrain/drivetrain_plotter';
-import {plotSpline} from 'org_frc971/frc971/control_loops/drivetrain/spline_plotter';
-import {plotDownEstimator} from 'org_frc971/frc971/control_loops/drivetrain/down_estimator_plotter';
+import {Configuration} from '../../aos/configuration_generated';
+import {Connection} from '../../aos/network/www/proxy';
+import {plotImu} from '../wpilib/imu_plotter';
+import {plotDrivetrain} from '../control_loops/drivetrain/drivetrain_plotter';
+import {plotSpline} from '../control_loops/drivetrain/spline_plotter';
+import {plotDownEstimator} from '../control_loops/drivetrain/down_estimator_plotter';
import {plotRobotState} from
- 'org_frc971/frc971/control_loops/drivetrain/robot_state_plotter'
+ '../control_loops/drivetrain/robot_state_plotter'
import {plotFinisher as plot2020Finisher} from
- 'org_frc971/y2020/control_loops/superstructure/finisher_plotter'
+ '../../y2020/control_loops/superstructure/finisher_plotter'
import {plotTurret as plot2020Turret} from
- 'org_frc971/y2020/control_loops/superstructure/turret_plotter'
+ '../../y2020/control_loops/superstructure/turret_plotter'
import {plotLocalizer as plot2020Localizer} from
- 'org_frc971/y2020/control_loops/drivetrain/localizer_plotter'
+ '../../y2020/control_loops/drivetrain/localizer_plotter'
import {plotAccelerator as plot2020Accelerator} from
- 'org_frc971/y2020/control_loops/superstructure/accelerator_plotter'
+ '../../y2020/control_loops/superstructure/accelerator_plotter'
import {plotHood as plot2020Hood} from
- 'org_frc971/y2020/control_loops/superstructure/hood_plotter'
+ '../../y2020/control_loops/superstructure/hood_plotter'
import {plotSuperstructure as plot2021Superstructure} from
- 'org_frc971/y2021_bot3/control_loops/superstructure/superstructure_plotter';
+ '../../y2021_bot3/control_loops/superstructure/superstructure_plotter';
import {plotTurret as plot2022Turret} from
- 'org_frc971/y2022/control_loops/superstructure/turret_plotter'
+ '../../y2022/control_loops/superstructure/turret_plotter'
import {plotSuperstructure as plot2022Superstructure} from
- 'org_frc971/y2022/control_loops/superstructure/superstructure_plotter'
+ '../../y2022/control_loops/superstructure/superstructure_plotter'
import {plotCatapult as plot2022Catapult} from
- 'org_frc971/y2022/control_loops/superstructure/catapult_plotter'
+ '../../y2022/control_loops/superstructure/catapult_plotter'
import {plotIntakeFront as plot2022IntakeFront, plotIntakeBack as plot2022IntakeBack} from
- 'org_frc971/y2022/control_loops/superstructure/intake_plotter'
+ '../../y2022/control_loops/superstructure/intake_plotter'
import {plotClimber as plot2022Climber} from
- 'org_frc971/y2022/control_loops/superstructure/climber_plotter'
+ '../../y2022/control_loops/superstructure/climber_plotter'
import {plotLocalizer as plot2022Localizer} from
- 'org_frc971/y2022/localizer/localizer_plotter'
+ '../../y2022/localizer/localizer_plotter'
import {plotVision as plot2022Vision} from
- 'org_frc971/y2022/vision/vision_plotter'
-import {plotDemo} from 'org_frc971/aos/network/www/demo_plot';
+ '../../y2022/vision/vision_plotter'
+import {plotDemo} from '../../aos/network/www/demo_plot';
const rootDiv = document.createElement('div');
rootDiv.style.width = '100%';
diff --git a/frc971/control_loops/drivetrain/down_estimator_plotter.ts b/frc971/control_loops/drivetrain/down_estimator_plotter.ts
index 178ab0b..126336d 100644
--- a/frc971/control_loops/drivetrain/down_estimator_plotter.ts
+++ b/frc971/control_loops/drivetrain/down_estimator_plotter.ts
@@ -1,8 +1,8 @@
// Provides a basic plot for debugging IMU-related issues on a robot.
-import {AosPlotter} from 'org_frc971/aos/network/www/aos_plotter';
-import {ImuMessageHandler} from 'org_frc971/frc971/wpilib/imu_plot_utils';
-import * as proxy from 'org_frc971/aos/network/www/proxy';
-import {BLUE, BROWN, CYAN, GREEN, PINK, RED, WHITE} from 'org_frc971/aos/network/www/colors';
+import {AosPlotter} from '../../../aos/network/www/aos_plotter';
+import {ImuMessageHandler} from '../../../frc971/wpilib/imu_plot_utils';
+import * as proxy from '../../../aos/network/www/proxy';
+import {BLUE, BROWN, CYAN, GREEN, PINK, RED, WHITE} from '../../../aos/network/www/colors';
import Connection = proxy.Connection;
diff --git a/frc971/control_loops/drivetrain/drivetrain_plotter.ts b/frc971/control_loops/drivetrain/drivetrain_plotter.ts
index 4b59dc0..5610e97 100644
--- a/frc971/control_loops/drivetrain/drivetrain_plotter.ts
+++ b/frc971/control_loops/drivetrain/drivetrain_plotter.ts
@@ -1,8 +1,8 @@
// Provides a plot for debugging drivetrain-related issues.
-import {AosPlotter} from 'org_frc971/aos/network/www/aos_plotter';
-import {ImuMessageHandler} from 'org_frc971/frc971/wpilib/imu_plot_utils';
-import * as proxy from 'org_frc971/aos/network/www/proxy';
-import {BLUE, BROWN, CYAN, GREEN, PINK, RED, WHITE} from 'org_frc971/aos/network/www/colors';
+import {AosPlotter} from '../../../aos/network/www/aos_plotter';
+import {ImuMessageHandler} from '../../../frc971/wpilib/imu_plot_utils';
+import * as proxy from '../../../aos/network/www/proxy';
+import {BLUE, BROWN, CYAN, GREEN, PINK, RED, WHITE} from '../../../aos/network/www/colors';
import Connection = proxy.Connection;
diff --git a/frc971/control_loops/drivetrain/robot_state_plotter.ts b/frc971/control_loops/drivetrain/robot_state_plotter.ts
index 2ce8001..8cffd76 100644
--- a/frc971/control_loops/drivetrain/robot_state_plotter.ts
+++ b/frc971/control_loops/drivetrain/robot_state_plotter.ts
@@ -1,7 +1,7 @@
// Provides a plot for debugging robot state-related issues.
-import {AosPlotter} from 'org_frc971/aos/network/www/aos_plotter';
-import * as proxy from 'org_frc971/aos/network/www/proxy';
-import {BLUE, BROWN, CYAN, GREEN, PINK, RED, WHITE} from 'org_frc971/aos/network/www/colors';
+import {AosPlotter} from '../../../aos/network/www/aos_plotter';
+import * as proxy from '../../../aos/network/www/proxy';
+import {BLUE, BROWN, CYAN, GREEN, PINK, RED, WHITE} from '../../../aos/network/www/colors';
import Connection = proxy.Connection;
diff --git a/frc971/control_loops/drivetrain/spline_plotter.ts b/frc971/control_loops/drivetrain/spline_plotter.ts
index c39afd5..67e9fc7 100644
--- a/frc971/control_loops/drivetrain/spline_plotter.ts
+++ b/frc971/control_loops/drivetrain/spline_plotter.ts
@@ -1,7 +1,7 @@
// Provides a plot for debugging drivetrain-related issues.
-import {AosPlotter} from 'org_frc971/aos/network/www/aos_plotter';
-import {BLUE, BROWN, CYAN, GREEN, PINK, RED, WHITE} from 'org_frc971/aos/network/www/colors';
-import * as proxy from 'org_frc971/aos/network/www/proxy';
+import {AosPlotter} from '../../../aos/network/www/aos_plotter';
+import {BLUE, BROWN, CYAN, GREEN, PINK, RED, WHITE} from '../../../aos/network/www/colors';
+import * as proxy from '../../../aos/network/www/proxy';
import Connection = proxy.Connection;
diff --git a/frc971/image_streamer/www/proxy.ts b/frc971/image_streamer/www/proxy.ts
index bfe8135..517d203 100644
--- a/frc971/image_streamer/www/proxy.ts
+++ b/frc971/image_streamer/www/proxy.ts
@@ -1,5 +1,5 @@
import {Builder, ByteBuffer} from 'flatbuffers';
-import {Payload, SdpType, WebSocketIce, WebSocketMessage, WebSocketSdp} from 'org_frc971/aos/network/web_proxy_generated';
+import {Payload, SdpType, WebSocketIce, WebSocketMessage, WebSocketSdp} from '../../../aos/network/web_proxy_generated';
// Port 9 is used to indicate an active (outgoing) TCP connection. The server
// would send a corresponding candidate with the actual TCP port it is
diff --git a/frc971/wpilib/imu_plot_utils.ts b/frc971/wpilib/imu_plot_utils.ts
index c4b516b..a56fd9b 100644
--- a/frc971/wpilib/imu_plot_utils.ts
+++ b/frc971/wpilib/imu_plot_utils.ts
@@ -1,9 +1,9 @@
// This script provides a basic utility for de-batching the IMUValues
// message. See imu_plotter.ts for usage.
-import {IMUValuesBatch} from 'org_frc971/frc971/wpilib/imu_batch_generated';
-import {MessageHandler, TimestampedMessage} from 'org_frc971/aos/network/www/aos_plotter';
-import {Point} from 'org_frc971/aos/network/www/plotter';
-import {Table} from 'org_frc971/aos/network/www/reflection';
+import {IMUValuesBatch} from './imu_batch_generated';
+import {MessageHandler, TimestampedMessage} from '../../aos/network/www/aos_plotter';
+import {Point} from '../../aos/network/www/plotter';
+import {Table} from '../../aos/network/www/reflection';
import {ByteBuffer} from 'flatbuffers';
import {Schema} from 'flatbuffers_reflection/reflection_generated';
diff --git a/frc971/wpilib/imu_plotter.ts b/frc971/wpilib/imu_plotter.ts
index 6768e1c..91edd7c 100644
--- a/frc971/wpilib/imu_plotter.ts
+++ b/frc971/wpilib/imu_plotter.ts
@@ -1,7 +1,7 @@
// Provides a basic plot for debugging IMU-related issues on a robot.
-import {AosPlotter} from 'org_frc971/aos/network/www/aos_plotter';
-import {ImuMessageHandler} from 'org_frc971/frc971/wpilib/imu_plot_utils';
-import * as proxy from 'org_frc971/aos/network/www/proxy';
+import {AosPlotter} from '../../aos/network/www/aos_plotter';
+import {ImuMessageHandler} from '../../frc971/wpilib/imu_plot_utils';
+import * as proxy from '../../aos/network/www/proxy';
import Connection = proxy.Connection;