From 115b1798e0f92ce18621a052fb4679b2ea50885d Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Mon, 30 Dec 2024 09:53:40 -0500 Subject: [PATCH] [Shore] fix project imports --- .../BootstrapScene/BootstrapScene.bs | 3 ++ .../src/components/Dialog/DialogUtils.bs | 1 + .../src/components/Navigation/LongPress.bs | 3 ++ .../components/Services/Dash/DashManifest.bs | 1 + .../Services/Innertube/BrowseEndpoint.bs | 4 ++ .../components/Services/Innertube/Context.bs | 1 + .../Services/Innertube/NodesParser.bs | 3 ++ .../components/Services/Innertube/Parser.bs | 1 + .../Services/Innertube/PlayerEndpoint.bs | 6 +++ .../Services/Innertube/ResolveUrlEndpoint.bs | 3 ++ .../Services/Innertube/SearchEndpoint.bs | 3 ++ .../DeviceConnectedNotificationUtils.bs | 1 + .../components/VideoPlayer/SponsorBlock.bs | 1 + .../VideoPlayerDev/PictureInPicture.bs | 3 ++ .../src/components/VideoPlayerDev/PlayerUi.bs | 4 ++ .../components/VideoQueue/VideoQueueUtils.bs | 1 + .../Middleware/BookmarksRouter.bs | 1 + .../Middleware/CacheRouter.bs | 1 + .../PlayletWebServer/Middleware/DashRouter.bs | 2 + .../PlayletWebServer/Middleware/DialRouter.bs | 3 ++ .../PlayletWebServer/Middleware/HlsRouter.bs | 1 + .../Middleware/HomeLayoutRouter.bs | 1 + .../PlayletWebServer/Middleware/HomeRouter.bs | 2 + .../Middleware/InvidiousRouter.bs | 1 + .../PlayletInvidiousBackendRouter.bs | 1 + .../Middleware/PlayletLibUrlsRouter.bs | 3 ++ .../Middleware/PreferencesRouter.bs | 2 + .../Middleware/ProfilesRouter.bs | 3 ++ .../Middleware/RegistryRouter.bs | 3 ++ .../Middleware/SearchHistoryRouter.bs | 1 + .../Middleware/StateApiRouter.bs | 1 + .../Middleware/VideoQueueRouter.bs | 2 + .../PlayletWebServer/Middleware/ViewRouter.bs | 1 + .../Web/WebServer/Http/HttpConnection.bs | 1 + .../Web/WebServer/Http/HttpRequest.bs | 2 + .../Web/WebServer/Http/HttpResponse.bs | 4 ++ .../Web/WebServer/Http/HttpRouter.bs | 6 +++ .../Web/WebServer/Http/HttpUtils.bs | 1 + .../WebServer/Middleware/CorsMiddleware.bs | 2 + .../WebServer/Middleware/EtagMiddleware.bs | 1 + .../Web/WebServer/Middleware/EtagUtils.bs | 4 ++ .../Middleware/HttpStaticFilesRouter.bs | 5 +++ .../WebSockets/WebSocketConnection.bs | 1 + .../WebSockets/WebSocketMiddleware.bs | 3 ++ tools/bs-plugins/import-validation.plugin.ts | 43 +++++++++++++++++++ 45 files changed, 141 insertions(+) create mode 100644 tools/bs-plugins/import-validation.plugin.ts diff --git a/playlet-app/src/components/BootstrapScene/BootstrapScene.bs b/playlet-app/src/components/BootstrapScene/BootstrapScene.bs index 1ee2e0ab..deb8f919 100644 --- a/playlet-app/src/components/BootstrapScene/BootstrapScene.bs +++ b/playlet-app/src/components/BootstrapScene/BootstrapScene.bs @@ -1,5 +1,8 @@ import "LoadingMessages.bs" +import "pkg:/source/Dialog.bs" import "pkg:/source/Logger.bs" +import "pkg:/source/Manifest.bs" +import "pkg:/source/Registry.bs" function Init() as void m.scene = m.top.getScene() diff --git a/playlet-lib/src/components/Dialog/DialogUtils.bs b/playlet-lib/src/components/Dialog/DialogUtils.bs index 7a46df47..840547bf 100644 --- a/playlet-lib/src/components/Dialog/DialogUtils.bs +++ b/playlet-lib/src/components/Dialog/DialogUtils.bs @@ -1,4 +1,5 @@ import "pkg:/source/utils/Locale.bs" +import "pkg:/source/utils/Types.bs" namespace DialogUtils diff --git a/playlet-lib/src/components/Navigation/LongPress.bs b/playlet-lib/src/components/Navigation/LongPress.bs index 26b47798..5bd8ed92 100644 --- a/playlet-lib/src/components/Navigation/LongPress.bs +++ b/playlet-lib/src/components/Navigation/LongPress.bs @@ -1,4 +1,7 @@ +import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/RemoteKeys.bs" +import "pkg:/source/utils/StringUtils.bs" +import "pkg:/source/utils/Types.bs" function InitializeLongPress(keys as object, duration = 1.0 as float) longPressKeyMap = {} diff --git a/playlet-lib/src/components/Services/Dash/DashManifest.bs b/playlet-lib/src/components/Services/Dash/DashManifest.bs index 62d79543..f1bbe984 100644 --- a/playlet-lib/src/components/Services/Dash/DashManifest.bs +++ b/playlet-lib/src/components/Services/Dash/DashManifest.bs @@ -1,5 +1,6 @@ import "pkg:/components/Web/WebServer/Http/HttpUtils.bs" import "pkg:/source/services/XmlObject.bs" +import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/UrlUtils.bs" diff --git a/playlet-lib/src/components/Services/Innertube/BrowseEndpoint.bs b/playlet-lib/src/components/Services/Innertube/BrowseEndpoint.bs index b37c8544..4435ca4d 100644 --- a/playlet-lib/src/components/Services/Innertube/BrowseEndpoint.bs +++ b/playlet-lib/src/components/Services/Innertube/BrowseEndpoint.bs @@ -1,3 +1,7 @@ +import "pkg:/components/Services/Innertube/Context.bs" +import "pkg:/source/services/HttpClient.bs" +import "pkg:/source/utils/StringUtils.bs" + namespace Innertube function CreateBrowseRequest(browseId as string, clienType as Innertube.ClientType, params = "" as string, continuation = "" as string) as object diff --git a/playlet-lib/src/components/Services/Innertube/Context.bs b/playlet-lib/src/components/Services/Innertube/Context.bs index ef32bf0f..a9faa0d3 100644 --- a/playlet-lib/src/components/Services/Innertube/Context.bs +++ b/playlet-lib/src/components/Services/Innertube/Context.bs @@ -1,4 +1,5 @@ import "pkg:/components/Services/Innertube/Constants.bs" +import "pkg:/source/utils/StringUtils.bs" namespace Innertube diff --git a/playlet-lib/src/components/Services/Innertube/NodesParser.bs b/playlet-lib/src/components/Services/Innertube/NodesParser.bs index f862f54a..e7273f0a 100644 --- a/playlet-lib/src/components/Services/Innertube/NodesParser.bs +++ b/playlet-lib/src/components/Services/Innertube/NodesParser.bs @@ -1,4 +1,7 @@ +import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/ObjectUtils.bs" +import "pkg:/source/utils/StringUtils.bs" +import "pkg:/source/utils/Types.bs" namespace Innertube diff --git a/playlet-lib/src/components/Services/Innertube/Parser.bs b/playlet-lib/src/components/Services/Innertube/Parser.bs index 33473a45..7fcdbbc5 100644 --- a/playlet-lib/src/components/Services/Innertube/Parser.bs +++ b/playlet-lib/src/components/Services/Innertube/Parser.bs @@ -1,6 +1,7 @@ import "pkg:/components/Services/Innertube/NodesParser.bs" import "pkg:/source/utils/ObjectUtils.bs" import "pkg:/source/utils/StringUtils.bs" +import "pkg:/source/utils/Types.bs" namespace Innertube diff --git a/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs b/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs index 61796893..ae376eb6 100644 --- a/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs +++ b/playlet-lib/src/components/Services/Innertube/PlayerEndpoint.bs @@ -1,3 +1,9 @@ +import "pkg:/components/Services/Innertube/Context.bs" +import "pkg:/components/Services/Innertube/NodesParser.bs" +import "pkg:/source/services/HttpClient.bs" +import "pkg:/source/utils/ObjectUtils.bs" +import "pkg:/source/utils/Types.bs" + namespace Innertube function CreatePlayerRequest(videoId as string, ctt as string) as object diff --git a/playlet-lib/src/components/Services/Innertube/ResolveUrlEndpoint.bs b/playlet-lib/src/components/Services/Innertube/ResolveUrlEndpoint.bs index a93652a0..d23b3427 100644 --- a/playlet-lib/src/components/Services/Innertube/ResolveUrlEndpoint.bs +++ b/playlet-lib/src/components/Services/Innertube/ResolveUrlEndpoint.bs @@ -1,3 +1,6 @@ +import "pkg:/components/Services/Innertube/Context.bs" +import "pkg:/source/services/HttpClient.bs" + namespace Innertube function CreateResolveUrlRequest(url as string) as object deviceInfo = CreateObject("roDeviceInfo") diff --git a/playlet-lib/src/components/Services/Innertube/SearchEndpoint.bs b/playlet-lib/src/components/Services/Innertube/SearchEndpoint.bs index 9e72a604..33bdeffa 100644 --- a/playlet-lib/src/components/Services/Innertube/SearchEndpoint.bs +++ b/playlet-lib/src/components/Services/Innertube/SearchEndpoint.bs @@ -1,5 +1,8 @@ import "pkg:/components/Services/Innertube/Context.bs" import "pkg:/components/Services/Innertube/Parser.bs" +import "pkg:/components/Services/Innertube/SearchFilters.bs" +import "pkg:/source/services/HttpClient.bs" +import "pkg:/source/utils/Types.bs" namespace Innertube diff --git a/playlet-lib/src/components/Services/LoungeService/Notifications/DeviceConnectedNotificationUtils.bs b/playlet-lib/src/components/Services/LoungeService/Notifications/DeviceConnectedNotificationUtils.bs index 85c15f5c..fb67130c 100644 --- a/playlet-lib/src/components/Services/LoungeService/Notifications/DeviceConnectedNotificationUtils.bs +++ b/playlet-lib/src/components/Services/LoungeService/Notifications/DeviceConnectedNotificationUtils.bs @@ -1,4 +1,5 @@ import "pkg:/source/utils/Locale.bs" +import "pkg:/source/utils/StringUtils.bs" namespace LoungeDeviceConnected const NOTIFICATION_NODE_ID = "DeviceConnectedNotification" diff --git a/playlet-lib/src/components/VideoPlayer/SponsorBlock.bs b/playlet-lib/src/components/VideoPlayer/SponsorBlock.bs index d760b3da..6bb8e089 100644 --- a/playlet-lib/src/components/VideoPlayer/SponsorBlock.bs +++ b/playlet-lib/src/components/VideoPlayer/SponsorBlock.bs @@ -2,6 +2,7 @@ import "pkg:/components/Services/SponsorBlock/Notifications/SponsorBlockNotifica import "pkg:/components/Services/SponsorBlock/SponsorBlockService.bs" import "pkg:/source/AsyncTask/AsyncTask.bs" import "pkg:/source/AsyncTask/Tasks.bs" +import "VideoPlayer.bs" namespace SponsorBlock diff --git a/playlet-lib/src/components/VideoPlayerDev/PictureInPicture.bs b/playlet-lib/src/components/VideoPlayerDev/PictureInPicture.bs index 4ba22ad2..dc4f3561 100644 --- a/playlet-lib/src/components/VideoPlayerDev/PictureInPicture.bs +++ b/playlet-lib/src/components/VideoPlayerDev/PictureInPicture.bs @@ -1,3 +1,6 @@ +import "pkg:/source/utils/DisposableObserve.bs" +import "pkg:/source/utils/Types.bs" + enum MinimizeState None ' None is not a valid state, but it is the default value pre-initialization Minimizing diff --git a/playlet-lib/src/components/VideoPlayerDev/PlayerUi.bs b/playlet-lib/src/components/VideoPlayerDev/PlayerUi.bs index 6ced1e3b..232222f5 100644 --- a/playlet-lib/src/components/VideoPlayerDev/PlayerUi.bs +++ b/playlet-lib/src/components/VideoPlayerDev/PlayerUi.bs @@ -1,3 +1,7 @@ +import "pkg:/source/utils/DisposableObserve.bs" +import "pkg:/source/utils/FocusManagement.bs" +import "pkg:/source/utils/Types.bs" + enum PlayerUiState None ' None is not a valid state, but it is the default value pre-initialization FadingIn diff --git a/playlet-lib/src/components/VideoQueue/VideoQueueUtils.bs b/playlet-lib/src/components/VideoQueue/VideoQueueUtils.bs index 53305602..f710eb41 100644 --- a/playlet-lib/src/components/VideoQueue/VideoQueueUtils.bs +++ b/playlet-lib/src/components/VideoQueue/VideoQueueUtils.bs @@ -1,5 +1,6 @@ import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs" import "pkg:/source/utils/FocusManagement.bs" +import "pkg:/source/utils/Logging.bs" namespace VideoQueueUtils diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/BookmarksRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/BookmarksRouter.bs index ebfb2fec..19b3c465 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/BookmarksRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/BookmarksRouter.bs @@ -1,4 +1,5 @@ import "pkg:/components/Services/BookmarksService/BookmarksServiceUtils.bs" +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" import "pkg:/source/utils/RegistryUtils.bs" namespace Http diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/CacheRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/CacheRouter.bs index 9eee2716..bd0996a5 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/CacheRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/CacheRouter.bs @@ -1,3 +1,4 @@ +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" import "pkg:/source/utils/CacheUtils.bs" namespace Http diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DashRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DashRouter.bs index ca688adc..0113150e 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DashRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DashRouter.bs @@ -1,5 +1,7 @@ import "pkg:/components/Services/Dash/DashManifest.bs" import "pkg:/components/Services/Invidious/InvidiousService.bs" +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" +import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/Types.bs" namespace Http diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DialRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DialRouter.bs index 37da58fe..bf0703b2 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DialRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DialRouter.bs @@ -1,5 +1,8 @@ +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" +import "pkg:/source/services/HttpClient.bs" import "pkg:/source/services/XmlObject.bs" import "pkg:/source/utils/MessagePortUtils.bs" +import "pkg:/source/utils/StringUtils.bs" namespace Http diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HlsRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HlsRouter.bs index 2d3d82dc..a7b9c5a9 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HlsRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HlsRouter.bs @@ -1,3 +1,4 @@ +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" import "pkg:/source/services/HttpClient.bs" namespace Http diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HomeLayoutRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HomeLayoutRouter.bs index 9caff68b..79cc2b28 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HomeLayoutRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HomeLayoutRouter.bs @@ -1,4 +1,5 @@ import "pkg:/components/Screens/HomeScreen/HomeScreenUtils.bs" +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" namespace Http diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HomeRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HomeRouter.bs index 2ccca83b..4523599e 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HomeRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/HomeRouter.bs @@ -1,3 +1,5 @@ +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" + namespace Http class HomeRouter extends HttpRouter diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/InvidiousRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/InvidiousRouter.bs index 2ce58ad9..b924a515 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/InvidiousRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/InvidiousRouter.bs @@ -1,4 +1,5 @@ import "pkg:/components/Services/Invidious/InvidiousService.bs" +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" import "pkg:/source/utils/CryptoUtils.bs" namespace Http diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayletInvidiousBackendRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayletInvidiousBackendRouter.bs index fe54e30e..f29722b0 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayletInvidiousBackendRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayletInvidiousBackendRouter.bs @@ -1,4 +1,5 @@ import "pkg:/components/Services/Innertube/InnertubeService.bs" +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" namespace Http diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayletLibUrlsRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayletLibUrlsRouter.bs index abdc0579..a8958aa0 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayletLibUrlsRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PlayletLibUrlsRouter.bs @@ -1,4 +1,7 @@ +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" import "pkg:/source/utils/RegistryUtils.bs" +import "pkg:/source/utils/StringUtils.bs" +import "pkg:/source/utils/Types.bs" namespace Http diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PreferencesRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PreferencesRouter.bs index 284c7e52..8682e63b 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PreferencesRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/PreferencesRouter.bs @@ -1,3 +1,5 @@ +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" + namespace Http class PreferencesRouter extends HttpRouter diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/ProfilesRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/ProfilesRouter.bs index 8c0bb07d..2282aabc 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/ProfilesRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/ProfilesRouter.bs @@ -1,3 +1,6 @@ +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" +import "pkg:/source/utils/StringUtils.bs" + namespace Http class ProfilesRouter extends HttpRouter diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/RegistryRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/RegistryRouter.bs index 158b1280..b05eb739 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/RegistryRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/RegistryRouter.bs @@ -3,7 +3,10 @@ #const LOG_EXPORT_CODE = false import "pkg:/components/Dialog/DialogUtils.bs" +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" import "pkg:/source/utils/RegistryUtils.bs" +import "pkg:/source/utils/StringUtils.bs" +import "pkg:/source/utils/TimeUtils.bs" const REGISTRY_EXPORT_VERSION = 1 diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/SearchHistoryRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/SearchHistoryRouter.bs index 62946ac0..330167fa 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/SearchHistoryRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/SearchHistoryRouter.bs @@ -1,4 +1,5 @@ import "pkg:/components/Services/SearchHistory/SearchHistoryUtils.bs" +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" namespace Http diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/StateApiRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/StateApiRouter.bs index 4bf658a1..0a386752 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/StateApiRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/StateApiRouter.bs @@ -1,3 +1,4 @@ +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" import "pkg:/source/utils/MessagePortUtils.bs" import "pkg:/source/utils/Types.bs" diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/VideoQueueRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/VideoQueueRouter.bs index 6617f9da..5b10ccef 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/VideoQueueRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/VideoQueueRouter.bs @@ -1,5 +1,7 @@ +import "pkg:/components/Services/Invidious/InvidiousService.bs" import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs" import "pkg:/components/VideoQueue/VideoQueueUtils.bs" +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" import "pkg:/source/utils/MathUtils.bs" namespace Http diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/ViewRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/ViewRouter.bs index 12a38a27..24eefb45 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/ViewRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/ViewRouter.bs @@ -2,6 +2,7 @@ import "pkg:/components/ChannelView/ChannelUtils.bs" import "pkg:/components/PlaylistView/PlaylistUtils.bs" import "pkg:/components/Services/Invidious/InvidiousToContentNode.bs" import "pkg:/components/VideoQueue/VideoQueueUtils.bs" +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" namespace Http diff --git a/playlet-lib/src/components/Web/WebServer/Http/HttpConnection.bs b/playlet-lib/src/components/Web/WebServer/Http/HttpConnection.bs index ee6eb855..a731b22f 100644 --- a/playlet-lib/src/components/Web/WebServer/Http/HttpConnection.bs +++ b/playlet-lib/src/components/Web/WebServer/Http/HttpConnection.bs @@ -1,6 +1,7 @@ import "HttpRequest.bs" import "HttpResponse.bs" import "HttpSettings.bs" +import "pkg:/components/Web/WebServer/Http/HttpConnectionState.bs" import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/Types.bs" diff --git a/playlet-lib/src/components/Web/WebServer/Http/HttpRequest.bs b/playlet-lib/src/components/Web/WebServer/Http/HttpRequest.bs index 8a4c750a..8a648970 100644 --- a/playlet-lib/src/components/Web/WebServer/Http/HttpRequest.bs +++ b/playlet-lib/src/components/Web/WebServer/Http/HttpRequest.bs @@ -1,5 +1,7 @@ import "HttpRequestState.bs" +import "pkg:/components/Web/WebServer/Http/HttpConnection.bs" import "pkg:/components/Web/WebServer/Http/HttpUtils.bs" +import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/Types.bs" import "pkg:/source/utils/UrlUtils.bs" diff --git a/playlet-lib/src/components/Web/WebServer/Http/HttpResponse.bs b/playlet-lib/src/components/Web/WebServer/Http/HttpResponse.bs index 46f6090b..a2e78d93 100644 --- a/playlet-lib/src/components/Web/WebServer/Http/HttpResponse.bs +++ b/playlet-lib/src/components/Web/WebServer/Http/HttpResponse.bs @@ -1,3 +1,7 @@ +import "pkg:/components/Web/WebServer/Http/HttpConnection.bs" +import "pkg:/components/Web/WebServer/Http/HttpServer.bs" +import "pkg:/components/Web/WebServer/Http/HttpSettings.bs" +import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/TimeUtils.bs" diff --git a/playlet-lib/src/components/Web/WebServer/Http/HttpRouter.bs b/playlet-lib/src/components/Web/WebServer/Http/HttpRouter.bs index 2197545d..c1db83df 100644 --- a/playlet-lib/src/components/Web/WebServer/Http/HttpRouter.bs +++ b/playlet-lib/src/components/Web/WebServer/Http/HttpRouter.bs @@ -1,3 +1,9 @@ +import "pkg:/components/Web/WebServer/Http/HttpConnection.bs" +import "pkg:/components/Web/WebServer/Http/HttpRequest.bs" +import "pkg:/components/Web/WebServer/Http/HttpResponse.bs" +import "pkg:/source/utils/ErrorUtils.bs" +import "pkg:/source/utils/Logging.bs" + namespace Http class HttpRouter diff --git a/playlet-lib/src/components/Web/WebServer/Http/HttpUtils.bs b/playlet-lib/src/components/Web/WebServer/Http/HttpUtils.bs index f0bc2642..b6bdc7ac 100644 --- a/playlet-lib/src/components/Web/WebServer/Http/HttpUtils.bs +++ b/playlet-lib/src/components/Web/WebServer/Http/HttpUtils.bs @@ -1,3 +1,4 @@ +import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/Types.bs" namespace Http diff --git a/playlet-lib/src/components/Web/WebServer/Middleware/CorsMiddleware.bs b/playlet-lib/src/components/Web/WebServer/Middleware/CorsMiddleware.bs index b4b5ae59..769be517 100644 --- a/playlet-lib/src/components/Web/WebServer/Middleware/CorsMiddleware.bs +++ b/playlet-lib/src/components/Web/WebServer/Middleware/CorsMiddleware.bs @@ -1,3 +1,5 @@ +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" + namespace Http class CorsMiddleware extends HttpRouter diff --git a/playlet-lib/src/components/Web/WebServer/Middleware/EtagMiddleware.bs b/playlet-lib/src/components/Web/WebServer/Middleware/EtagMiddleware.bs index edc4d563..21b20b7e 100644 --- a/playlet-lib/src/components/Web/WebServer/Middleware/EtagMiddleware.bs +++ b/playlet-lib/src/components/Web/WebServer/Middleware/EtagMiddleware.bs @@ -1,4 +1,5 @@ import "EtagUtils.bs" +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" import "pkg:/source/utils/CryptoUtils.bs" import "pkg:/source/utils/StringUtils.bs" import "pkg:/source/utils/Types.bs" diff --git a/playlet-lib/src/components/Web/WebServer/Middleware/EtagUtils.bs b/playlet-lib/src/components/Web/WebServer/Middleware/EtagUtils.bs index 28a743ae..922c4aa9 100644 --- a/playlet-lib/src/components/Web/WebServer/Middleware/EtagUtils.bs +++ b/playlet-lib/src/components/Web/WebServer/Middleware/EtagUtils.bs @@ -1,3 +1,7 @@ +import "pkg:/source/utils/Logging.bs" +import "pkg:/source/utils/StringUtils.bs" +import "pkg:/source/utils/Types.bs" + namespace Http class EtagUtils diff --git a/playlet-lib/src/components/Web/WebServer/Middleware/HttpStaticFilesRouter.bs b/playlet-lib/src/components/Web/WebServer/Middleware/HttpStaticFilesRouter.bs index a1c7d6ff..fbf18726 100644 --- a/playlet-lib/src/components/Web/WebServer/Middleware/HttpStaticFilesRouter.bs +++ b/playlet-lib/src/components/Web/WebServer/Middleware/HttpStaticFilesRouter.bs @@ -1,4 +1,9 @@ +import "pkg:/components/Web/WebServer/Http/HttpRequest.bs" +import "pkg:/components/Web/WebServer/Http/HttpResponse.bs" +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" +import "pkg:/source/utils/Logging.bs" import "pkg:/source/utils/StringUtils.bs" +import "pkg:/source/utils/Types.bs" namespace Http diff --git a/playlet-lib/src/components/Web/WebServer/WebSockets/WebSocketConnection.bs b/playlet-lib/src/components/Web/WebServer/WebSockets/WebSocketConnection.bs index c360b046..31dc357c 100644 --- a/playlet-lib/src/components/Web/WebServer/WebSockets/WebSocketConnection.bs +++ b/playlet-lib/src/components/Web/WebServer/WebSockets/WebSocketConnection.bs @@ -1,6 +1,7 @@ import "pkg:/source/utils/Logging.bs" import "WebSocketConnectionState.bs" import "WebSocketFrame.bs" +import "WebSocketServer.bs" namespace Web diff --git a/playlet-lib/src/components/Web/WebServer/WebSockets/WebSocketMiddleware.bs b/playlet-lib/src/components/Web/WebServer/WebSockets/WebSocketMiddleware.bs index 067ed76a..a5b0b412 100644 --- a/playlet-lib/src/components/Web/WebServer/WebSockets/WebSocketMiddleware.bs +++ b/playlet-lib/src/components/Web/WebServer/WebSockets/WebSocketMiddleware.bs @@ -1,4 +1,7 @@ +import "pkg:/components/Web/WebServer/Http/HttpRouter.bs" import "pkg:/source/utils/CryptoUtils.bs" +import "pkg:/source/utils/StringUtils.bs" +import "pkg:/source/utils/Types.bs" namespace Http diff --git a/tools/bs-plugins/import-validation.plugin.ts b/tools/bs-plugins/import-validation.plugin.ts new file mode 100644 index 00000000..abcb0c1f --- /dev/null +++ b/tools/bs-plugins/import-validation.plugin.ts @@ -0,0 +1,43 @@ +// This plugin validates missing imports in bs files +// The idea is for each script, create a dummy component that only imports the script +// Then the linter will detect if there are undefined symbols not imported in the component. +// There are some false positives, and the approach is "weird", but it works for now. +// Plugin not used by default. + +import { + BscFile, + CompilerPlugin, + isBrsFile, +} from 'brighterscript'; +import { existsSync } from 'fs-extra'; + +export class ImportValidationPlugin implements CompilerPlugin { + public name = 'ImportValidationPlugin'; + + afterFileParse(file: BscFile) { + if (!isBrsFile(file)) { + return + } + + // Skip generated files + if (!existsSync(file.srcPath)) { + return; + } + + this.generateXmlComponent(file); + } + + generateXmlComponent(file: BscFile) { + const path = file.pkgPath; + const name = path.split('/').pop().replace('.bs', '') + `TestComponent${path.length}`; + const content = ` +