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/aos/network/www/aos_plotter.ts b/aos/network/www/aos_plotter.ts
index cd2e131..13bf343 100644
--- a/aos/network/www/aos_plotter.ts
+++ b/aos/network/www/aos_plotter.ts
@@ -23,11 +23,11 @@
// The demo_plot.ts script has a basic example of using this library, with all
// the required boilerplate, as well as some extra examples about how to
// add axis labels and the such.
-import {Channel, Configuration} from 'org_frc971/aos/configuration_generated';
-import {Line, Plot, Point} from 'org_frc971/aos/network/www/plotter';
-import {Connection} from 'org_frc971/aos/network/www/proxy';
-import {SubscriberRequest, ChannelRequest, TransferMethod} from 'org_frc971/aos/network/web_proxy_generated';
-import {Parser, Table} from 'org_frc971/aos/network/www/reflection'
+import {Channel, Configuration} from '../../configuration_generated';
+import {Line, Plot, Point} from './plotter';
+import {Connection} from './proxy';
+import {SubscriberRequest, ChannelRequest, TransferMethod} from '../web_proxy_generated';
+import {Parser, Table} from './reflection'
import {Schema} from 'flatbuffers_reflection/reflection_generated';
import {ByteBuffer} from 'flatbuffers';
diff --git a/aos/network/www/config_handler.ts b/aos/network/www/config_handler.ts
index a7c2149..fba7be3 100644
--- a/aos/network/www/config_handler.ts
+++ b/aos/network/www/config_handler.ts
@@ -1,6 +1,6 @@
import {ByteBuffer} from 'flatbuffers';
-import {Configuration} from 'org_frc971/aos/configuration_generated';
-import {Connection} from 'org_frc971/aos/network/www/proxy';
+import {Configuration} from '../../configuration_generated';
+import {Connection} from './proxy';
import {Parser, Table} from './reflection'
diff --git a/aos/network/www/demo_plot.ts b/aos/network/www/demo_plot.ts
index ecd4da6..b586411 100644
--- a/aos/network/www/demo_plot.ts
+++ b/aos/network/www/demo_plot.ts
@@ -12,9 +12,9 @@
// This example shows how to:
// (a) Make use of the AosPlotter to plot a shmem message as a time-series.
// (b) Define your own custom plot with whatever data you want.
-import {AosPlotter} from 'org_frc971/aos/network/www/aos_plotter';
-import {Plot, Point} from 'org_frc971/aos/network/www/plotter';
-import * as proxy from 'org_frc971/aos/network/www/proxy';
+import {AosPlotter} from './aos_plotter';
+import {Plot, Point} from './plotter';
+import * as proxy from './proxy';
import Connection = proxy.Connection;
diff --git a/aos/network/www/ping_handler.ts b/aos/network/www/ping_handler.ts
index 60e7c4a..224e432 100644
--- a/aos/network/www/ping_handler.ts
+++ b/aos/network/www/ping_handler.ts
@@ -1,4 +1,4 @@
-import {Ping} from 'org_frc971/aos/events/ping_generated';
+import {Ping} from '../../events/ping_generated';
import {ByteBuffer} from 'flatbuffers';
export function HandlePing(data: Uint8Array) {
diff --git a/aos/network/www/plotter.ts b/aos/network/www/plotter.ts
index 17bffa3..536322f 100644
--- a/aos/network/www/plotter.ts
+++ b/aos/network/www/plotter.ts
@@ -1,4 +1,5 @@
-import * as Colors from 'org_frc971/aos/network/www/colors';
+import * as Colors from './colors';
+
// Multiplies all the values in the provided array by scale.
function scaleVec(vec: number[], scale: number): number[] {
const scaled: number[] = [];
diff --git a/aos/network/www/proxy.ts b/aos/network/www/proxy.ts
index 0bda8b9..99a9a18 100644
--- a/aos/network/www/proxy.ts
+++ b/aos/network/www/proxy.ts
@@ -1,6 +1,6 @@
import {Builder, ByteBuffer, Offset} from 'flatbuffers';
-import {Channel as ChannelFb, Configuration} from 'org_frc971/aos/configuration_generated';
-import {ChannelRequest as ChannelRequestFb, ChannelState, MessageHeader, Payload, SdpType, SubscriberRequest, TransferMethod, WebSocketIce, WebSocketMessage, WebSocketSdp} from 'org_frc971/aos/network/web_proxy_generated';
+import {Channel as ChannelFb, Configuration} from '../../configuration_generated';
+import {ChannelRequest as ChannelRequestFb, ChannelState, MessageHeader, Payload, SdpType, SubscriberRequest, TransferMethod, WebSocketIce, WebSocketMessage, WebSocketSdp} from '../web_proxy_generated';
import {Schema} from 'flatbuffers_reflection/reflection_generated';
// There is one handler for each DataChannel, it maintains the state of
diff --git a/aos/network/www/reflection_test_main.ts b/aos/network/www/reflection_test_main.ts
index 8fb041e..092c9c2 100644
--- a/aos/network/www/reflection_test_main.ts
+++ b/aos/network/www/reflection_test_main.ts
@@ -1,6 +1,6 @@
import {Builder, ByteBuffer} from 'flatbuffers';
-import {Configuration} from 'org_frc971/aos/configuration_generated'
-import {BaseType, Configuration as TestTable, FooStruct, Location, Map, VectorOfStrings, VectorOfVectorOfString} from 'org_frc971/aos/json_to_flatbuffer_generated'
+import {Configuration} from '../../configuration_generated'
+import {BaseType, Configuration as TestTable, FooStruct, Location, Map, VectorOfStrings, VectorOfVectorOfString} from '../../json_to_flatbuffer_generated'
import {Connection} from './proxy';
import {Parser, Table} from './reflection'