scouting: Migrate to using npm-style packages for deps
Using the npm style for tracking dependencies makes it easier to write
common modules that our existing modules can import.
I was trying to set up a shared `Pipe` class for some modules and
couldn't work around this issue:
scouting/www/entry/entry.module.ts:10:13 - error NG3004: Unable to import class PipeModule.
The file /dev/shm/bazel-sandbox.62240ff599163761312fdbd652f7452abc23edc253dee6214f406f29dde5568b/linux-sandbox/192/execroot/org_frc971/bazel-out/k8-fastbuild/bin/scouting/www/pipes/pipes.module.d.ts is outside of the configured 'rootDir'.
10 exports: [PipeModule, EntryComponent],
The simplest way to work around it is by using npm modules everywhere.
This meant that I had to convert the existing fbs messages into an npm
module too.
There should be no functional changes.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I4813fd304302a8bd664443023ef21aa147b80d2e
diff --git a/scouting/www/entry/BUILD b/scouting/www/entry/BUILD
index 48732f9..6bffbf8 100644
--- a/scouting/www/entry/BUILD
+++ b/scouting/www/entry/BUILD
@@ -9,15 +9,7 @@
"//scouting/www:app_common_css",
],
deps = [
- ":node_modules/@angular/forms",
- "//:node_modules/@angular/platform-browser",
- "//:node_modules/@types/pako",
- "//:node_modules/angularx-qrcode",
- "//:node_modules/pako",
- "//scouting/webserver/requests/messages:error_response_ts_fbs",
- "//scouting/webserver/requests/messages:request_all_matches_response_ts_fbs",
- "//scouting/webserver/requests/messages:submit_2024_actions_ts_fbs",
- "//scouting/www/rpc",
- "@com_github_google_flatbuffers//ts:flatbuffers_ts",
+ ":node_modules",
+ "//:node_modules/flatbuffers",
],
)
diff --git a/scouting/www/entry/entry.component.ts b/scouting/www/entry/entry.component.ts
index 21fd474..b1d84b7 100644
--- a/scouting/www/entry/entry.component.ts
+++ b/scouting/www/entry/entry.component.ts
@@ -9,7 +9,7 @@
} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {Builder, ByteBuffer} from 'flatbuffers';
-import {ErrorResponse} from '../../webserver/requests/messages/error_response_generated';
+import {ErrorResponse} from '@org_frc971/scouting/webserver/requests/messages/error_response_generated';
import {
StartMatchAction,
ScoreType,
@@ -23,9 +23,9 @@
EndMatchAction,
ActionType,
Action,
-} from '../../webserver/requests/messages/submit_2024_actions_generated';
-import {Match} from '../../webserver/requests/messages/request_all_matches_response_generated';
-import {MatchListRequestor} from '../rpc';
+} from '@org_frc971/scouting/webserver/requests/messages/submit_2024_actions_generated';
+import {Match} from '@org_frc971/scouting/webserver/requests/messages/request_all_matches_response_generated';
+import {MatchListRequestor} from '@org_frc971/scouting/www/rpc';
import * as pako from 'pako';
type Section =
diff --git a/scouting/www/entry/entry.module.ts b/scouting/www/entry/entry.module.ts
index bcba4ee..df92042 100644
--- a/scouting/www/entry/entry.module.ts
+++ b/scouting/www/entry/entry.module.ts
@@ -1,4 +1,4 @@
-import {NgModule, Pipe, PipeTransform} from '@angular/core';
+import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {EntryComponent} from './entry.component';
diff --git a/scouting/www/entry/package.json b/scouting/www/entry/package.json
index 4d30551..39479f4 100644
--- a/scouting/www/entry/package.json
+++ b/scouting/www/entry/package.json
@@ -2,8 +2,12 @@
"name": "@org_frc971/scouting/www/entry",
"private": true,
"dependencies": {
+ "angularx-qrcode": "^16.0.2",
"pako": "2.1.0",
+ "@angular/forms": "v16-lts",
+ "@angular/platform-browser": "v16-lts",
"@types/pako": "2.0.3",
- "@angular/forms": "v16-lts"
+ "@org_frc971/scouting/webserver/requests/messages": "workspace:*",
+ "@org_frc971/scouting/www/rpc": "workspace:*"
}
}