diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 7579d5115..c7a0f9a61 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -19,6 +19,7 @@ jobs:
- run: npm ci
- run: npm run build
- run: npm run lint
+ - run: npm run check-webviews
- run: npm run test
- run: npm run create-package
- name: Upload coverage to Coveralls
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 275e9b585..9b49f5619 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -21,30 +21,5 @@
"editor.tabSize": 4,
"js/ts.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
"html.format.unformatted": "wbr,%",
- "js/ts.tsdk.path": "node_modules\\typescript\\lib",
- "svelte.plugin.svelte.compilerWarnings": {
- "a11y-aria-attributes": "ignore",
- "a11y-incorrect-aria-attribute-type": "ignore",
- "a11y-unknown-aria-attribute": "ignore",
- "a11y-hidden": "ignore",
- "a11y-misplaced-role": "ignore",
- "a11y-unknown-role": "ignore",
- "a11y-no-abstract-role": "ignore",
- "a11y-no-redundant-roles": "ignore",
- "a11y-role-has-required-aria-props": "ignore",
- "a11y-accesskey": "ignore",
- "a11y-autofocus": "ignore",
- "a11y-misplaced-scope": "ignore",
- "a11y-positive-tabindex": "ignore",
- "a11y-invalid-attribute": "ignore",
- "a11y-missing-attribute": "ignore",
- "a11y-img-redundant-alt": "ignore",
- "a11y-label-has-associated-control": "ignore",
- "a11y-media-has-caption": "ignore",
- "a11y-distracting-elements": "ignore",
- "a11y-structure": "ignore",
- "a11y-mouse-events-have-key-events": "ignore",
- "a11y-missing-content": "ignore",
- "a11y-click-events-have-key-events": "ignore"
- },
+ "js/ts.tsdk.path": "node_modules\\typescript\\lib"
}
diff --git a/package.json b/package.json
index 5f8dd230f..e1beb37db 100644
--- a/package.json
+++ b/package.json
@@ -26,12 +26,13 @@
},
"scripts": {
"postinstall": "cd webviews && npm install",
- "preversion": "npm run build && npm run lint && npm run test && npm run check-extraneous && npm run audit",
+ "preversion": "npm run build && npm run lint && npm run check-webviews && npm run test && npm run check-extraneous && npm run audit",
"vscode:prepublish": "npm run build",
"copy-schema": "cpx ./node_modules/brighterscript/bsconfig.schema.json ./dist -L",
"build": "npm run copy-schema && tsc -p ./ && npm run build-webviews",
"build-webviews": "cd ./webviews && npm run build && cd ..",
"lint": "eslint \"./src/**/*.ts\"",
+ "check-webviews": "cd webviews && npm run check",
"audit": "npm audit --audit-level=high || audit-ci --config ./audit-ci.jsonc && cd webviews && npm run audit",
"watch": "npm run copy-schema && tsc -w -p ./",
"watch-webviews": "cd ./webviews && npm run watch",
diff --git a/src/viewProviders/RceManagementViewContract.ts b/src/viewProviders/RceManagementViewContract.ts
new file mode 100644
index 000000000..80f8bead4
--- /dev/null
+++ b/src/viewProviders/RceManagementViewContract.ts
@@ -0,0 +1,30 @@
+import type { DeviceStatus, DeviceType } from 'roku-deploy';
+
+/**
+ * Lives in its own file (rather than inside RceManagementViewProvider.ts) so the webview can import
+ * RceStateDevice without pulling the provider's extension-side import graph into its typecheck program.
+ */
+
+/* eslint-disable camelcase -- the RCE management api uses snake_case fields */
+/**
+ * The device fields the management webview renders - a projection of roku-deploy's RceDevice that
+ * leaves the instance's stream credentials behind (see projectDeviceForWebview).
+ */
+export interface RceStateDevice {
+ id: number;
+ name: string;
+ note?: string | null;
+ device_type: DeviceType;
+ status?: DeviceStatus;
+ serial_number?: string | null;
+ created_at: string;
+ last_snapshot_id?: number | null;
+ last_snapshot_name?: string | null;
+ snapshots?: number[];
+ firmware_version_id?: string | null;
+ running_device?: {
+ started_at?: string | null;
+ max_runtime: number;
+ } | null;
+}
+/* eslint-enable camelcase */
diff --git a/src/viewProviders/RceManagementViewProvider.ts b/src/viewProviders/RceManagementViewProvider.ts
index 5a203f9de..8035aa973 100644
--- a/src/viewProviders/RceManagementViewProvider.ts
+++ b/src/viewProviders/RceManagementViewProvider.ts
@@ -1,5 +1,5 @@
import * as vscode from 'vscode';
-import type { RceDevice, DeviceRun, DeviceStatus, DeviceType, FirmwareVersion, RceDeviceConfig, RceManagementClient, Snapshot } from 'roku-deploy';
+import type { RceDevice, DeviceRun, FirmwareVersion, RceDeviceConfig, RceManagementClient, Snapshot } from 'roku-deploy';
import { rokuDeploy } from 'roku-deploy';
import { BaseWebviewViewProvider } from './BaseWebviewViewProvider';
import { ViewProviderId } from './ViewProviderId';
@@ -9,6 +9,9 @@ import { WorkspaceStateKey } from './WorkspaceStateKey';
import { VscodeCommand } from '../commands/VscodeCommand';
import type { RceManager } from '../managers/RceManager';
import type { RceFinder } from '../deviceDiscovery/RceFinder';
+import type { RceStateDevice } from './RceManagementViewContract';
+
+export type { RceStateDevice } from './RceManagementViewContract';
export class RceManagementViewProvider extends BaseWebviewViewProvider {
public readonly id = ViewProviderId.rceManagementView;
@@ -561,30 +564,6 @@ interface RceManagementViewState {
error?: string;
}
-/* eslint-disable camelcase -- the RCE management api uses snake_case fields */
-/**
- * The device fields the management webview renders - a projection of roku-deploy's RceDevice that
- * leaves the instance's stream credentials behind (see projectDeviceForWebview).
- */
-export interface RceStateDevice {
- id: number;
- name: string;
- note?: string | null;
- device_type: DeviceType;
- status?: DeviceStatus;
- serial_number?: string | null;
- created_at: string;
- last_snapshot_id?: number | null;
- last_snapshot_name?: string | null;
- snapshots?: number[];
- firmware_version_id?: string | null;
- running_device?: {
- started_at?: string | null;
- max_runtime: number;
- } | null;
-}
-/* eslint-enable camelcase */
-
interface RceDeviceDetailsPayload {
snapshots: Snapshot[] | undefined;
runs: DeviceRun[] | undefined;
diff --git a/webviews/src/shared/Loader.svelte b/webviews/src/shared/Loader.svelte
index 2ded18084..6612507e7 100644
--- a/webviews/src/shared/Loader.svelte
+++ b/webviews/src/shared/Loader.svelte
@@ -14,5 +14,5 @@
-
+
diff --git a/webviews/src/shared/NumberField.svelte b/webviews/src/shared/NumberField.svelte
index 57d9cc4e2..e4650f83b 100644
--- a/webviews/src/shared/NumberField.svelte
+++ b/webviews/src/shared/NumberField.svelte
@@ -43,4 +43,4 @@
}
-
+
diff --git a/webviews/src/shared/RceStreamView.svelte b/webviews/src/shared/RceStreamView.svelte
index f2d4f0c12..87da657fd 100644
--- a/webviews/src/shared/RceStreamView.svelte
+++ b/webviews/src/shared/RceStreamView.svelte
@@ -311,7 +311,7 @@
{:else}
-
+
{/if}
{/if}
diff --git a/webviews/src/shared/vscode-ui-toolkit/VscodeCheckbox.svelte b/webviews/src/shared/vscode-ui-toolkit/VscodeCheckbox.svelte
index 02caf01c1..057233f5b 100644
--- a/webviews/src/shared/vscode-ui-toolkit/VscodeCheckbox.svelte
+++ b/webviews/src/shared/vscode-ui-toolkit/VscodeCheckbox.svelte
@@ -19,6 +19,6 @@
diff --git a/webviews/src/views/RceManagementView/RceManagementView.svelte b/webviews/src/views/RceManagementView/RceManagementView.svelte
index e4f6f4725..a6427a9e4 100644
--- a/webviews/src/views/RceManagementView/RceManagementView.svelte
+++ b/webviews/src/views/RceManagementView/RceManagementView.svelte
@@ -2,8 +2,8 @@
window.vscode = acquireVsCodeApi();
import { onDestroy } from 'svelte';
- import type { DeviceRun, FirmwareVersionOut, SnapshotOut } from 'roku-deploy';
- import type { RceStateDevice } from '../../../../src/viewProviders/RceManagementViewProvider';
+ import type { DeviceRun, FirmwareVersion, Snapshot } from 'roku-deploy';
+ import type { RceStateDevice } from '../../../../src/viewProviders/RceManagementViewContract';
import { ChevronRight, ChevronDown } from 'svelte-codicons';
import { intermediary } from '../../ExtensionIntermediary';
import Loader from '../../shared/Loader.svelte';
@@ -64,7 +64,7 @@
//firmware choices offered when starting a device, filtered per device type at render time.
//Like the runtime picks, firmware picks live outside DeviceDetailsState so a details refetch
//does not reset them
- let firmwareVersions: FirmwareVersionOut[] | undefined = undefined;
+ let firmwareVersions: FirmwareVersion[] | undefined = undefined;
let selectedFirmwareIdByDeviceId: Record = {};
let expandedDeviceId: number | undefined = undefined;
@@ -346,7 +346,7 @@
* snapshot once the list settles.
*/
function resolveSelectedSnapshotId(
- snapshots: SnapshotOut[] | undefined,
+ snapshots: Snapshot[] | undefined,
preferredSnapshotId: number | undefined,
latestRunSnapshotId: number | undefined,
rememberedSnapshotId: number | undefined
@@ -447,7 +447,7 @@
pickedFirmwareVersionId: string | undefined,
detailsState: DeviceDetailsState | undefined,
device: RceStateDevice,
- firmwareOptions: FirmwareVersionOut[]
+ firmwareOptions: FirmwareVersion[]
): string | undefined {
const availableFirmwareIds = firmwareOptions.map((firmwareVersion) => firmwareVersion.firmware_version_id);
const selectedSnapshot = (detailsState?.snapshots ?? []).find((snapshot) => snapshot.id === detailsState?.selectedSnapshotId);
@@ -501,7 +501,7 @@
}
}
- async function deleteSnapshot(device: RceStateDevice, snapshot: SnapshotOut) {
+ async function deleteSnapshot(device: RceStateDevice, snapshot: Snapshot) {
deletingSnapshotId = snapshot.id;
try {
await intermediary.sendCommand(ViewProviderCommand.deleteRceSnapshot, {
@@ -591,7 +591,7 @@
interface DeviceDetailsState {
loading: boolean;
- snapshots: SnapshotOut[] | undefined;
+ snapshots: Snapshot[] | undefined;
runs: DeviceRun[] | undefined;
lastUsedSnapshotId: number | undefined;
error: string | undefined;
@@ -921,7 +921,7 @@
runAccountCommand('removeAccount')}>
-
+
{#if stateError}
{stateError}
@@ -941,12 +941,12 @@
{#if showCreateDeviceForm}
@@ -1048,8 +1048,8 @@
{#if snapshotFormDeviceId === device.id && device.status === 'running'}
-
+
-

+
-
+
@@ -339,7 +339,7 @@
-
+
{/each}
{:else}
diff --git a/webviews/src/views/RokuAutomationView/AutoRunsEditor.svelte b/webviews/src/views/RokuAutomationView/AutoRunsEditor.svelte
index d6f207af2..f6ba2ce1d 100644
--- a/webviews/src/views/RokuAutomationView/AutoRunsEditor.svelte
+++ b/webviews/src/views/RokuAutomationView/AutoRunsEditor.svelte
@@ -354,7 +354,7 @@
{#each runs as run, index}
|
-
+
|
{:else if step.type === stepTypes.sendText.type}
-
+
{/if}
|
{#if currentRunningStep === -1}
{:else if currentRunningStep === index}
-
+
{/if}
|
|
-
+
|
{/each}
diff --git a/webviews/src/views/RokuDeviceView/RokuDeviceView.svelte b/webviews/src/views/RokuDeviceView/RokuDeviceView.svelte
index a5dd7ace4..a6bd0bc5b 100644
--- a/webviews/src/views/RokuDeviceView/RokuDeviceView.svelte
+++ b/webviews/src/views/RokuDeviceView/RokuDeviceView.svelte
@@ -414,8 +414,8 @@
on:mousedown={onMouseDown}
data-vscode-context={'{"preventDefaultContextMenuItems": true}'}>
-
-
+
+
{#if screenshotUrl}
diff --git a/webviews/src/views/RokuFileSystemView/FileSystemEntry.svelte b/webviews/src/views/RokuFileSystemView/FileSystemEntry.svelte
index 36c0efc63..73a0cd3ee 100644
--- a/webviews/src/views/RokuFileSystemView/FileSystemEntry.svelte
+++ b/webviews/src/views/RokuFileSystemView/FileSystemEntry.svelte
@@ -61,7 +61,7 @@
{:else if entry.type === 'fileSystem'}
{:else}
-
+
{/if}
{#if columnsToShow.name}
diff --git a/webviews/src/views/RokuReplView/RokuReplView.svelte b/webviews/src/views/RokuReplView/RokuReplView.svelte
index fbe0abf1d..53c1401d8 100644
--- a/webviews/src/views/RokuReplView/RokuReplView.svelte
+++ b/webviews/src/views/RokuReplView/RokuReplView.svelte
@@ -108,7 +108,7 @@
{#if odcAvailable}
+return 1 + 1" rows="10" resize="both" on:input={onReplCodeChange} value={replCode}>
@@ -119,7 +119,7 @@ return 1 + 1" rows="10" resize="both" on:input={onReplCodeChange} value={replCod
| |
{#if loading}
-
+
{:else}
{replTimeTaken >= 0 ? `Last run took ${replTimeTaken}ms` : ''}
{/if}
@@ -129,7 +129,7 @@ return 1 + 1" rows="10" resize="both" on:input={onReplCodeChange} value={replCod
|
{#if !loading && (replResponse !== undefined || replError !== '')}
-
+
{#if replResponse !== undefined}
{replResponse}
diff --git a/webviews/src/views/SceneGraphInspectorView/ColorField.svelte b/webviews/src/views/SceneGraphInspectorView/ColorField.svelte
index c69a6dd88..fac32fc98 100644
--- a/webviews/src/views/SceneGraphInspectorView/ColorField.svelte
+++ b/webviews/src/views/SceneGraphInspectorView/ColorField.svelte
@@ -50,4 +50,4 @@
+ bind:innerHTML={hexColor}>
diff --git a/webviews/src/views/SceneGraphInspectorView/NodeCountByTypePage.svelte b/webviews/src/views/SceneGraphInspectorView/NodeCountByTypePage.svelte
index c07857c0b..96847526b 100644
--- a/webviews/src/views/SceneGraphInspectorView/NodeCountByTypePage.svelte
+++ b/webviews/src/views/SceneGraphInspectorView/NodeCountByTypePage.svelte
@@ -114,7 +114,7 @@
diff --git a/webviews/src/views/SceneGraphInspectorView/NodeDetailPage.svelte b/webviews/src/views/SceneGraphInspectorView/NodeDetailPage.svelte
index e9c087510..78838e706 100644
--- a/webviews/src/views/SceneGraphInspectorView/NodeDetailPage.svelte
+++ b/webviews/src/views/SceneGraphInspectorView/NodeDetailPage.svelte
@@ -449,7 +449,7 @@
appearance="icon"
class="inline"
title="Auto Refresh"
- on:change={onAutoRefreshClick} />
+ on:change={onAutoRefreshClick}>
children ({children.length})
-
+
{#each children as child, i}
@@ -555,7 +555,7 @@
id={id}
class="fieldValue"
checked={field.value}
- on:change={onBooleanFieldClick} />
+ on:change={onBooleanFieldClick}>
{:else if field.type === 'roFloat' || field.type === 'roInt'}
+ on:input={onStringFieldChange}>
{:else}
-
+
{/if}
@@ -619,7 +619,7 @@
{item.subtype}
{:else if typeof item === 'object'}
-
+
{:else if typeof item === 'number'}
+ on:change={onBooleanFieldClick}>
{:else}
+ on:input={onStringFieldChange}>
{/if}
@@ -675,9 +675,9 @@
+ on:change={onBooleanFieldClick}>
{:else if typeof item === 'object'}
-
+
{:else if typeof item === 'number'}
+ on:input={onStringFieldChange}>
{/if}
diff --git a/webviews/src/views/SceneGraphInspectorView/SceneGraphInspectorView.svelte b/webviews/src/views/SceneGraphInspectorView/SceneGraphInspectorView.svelte
index 294ce77f3..0c5826487 100644
--- a/webviews/src/views/SceneGraphInspectorView/SceneGraphInspectorView.svelte
+++ b/webviews/src/views/SceneGraphInspectorView/SceneGraphInspectorView.svelte
@@ -406,7 +406,7 @@
{:else}