chore: enforce lint across codebase and ban "maybe" in identifiers
Remove member-ordering and complexity eslint-disable comments by reordering class members and applying targeted fixes. Add metoyou/no-maybe-in-naming, type-safe WebRTC e2e harness helpers, and resolve remaining lint errors so npm run lint exits cleanly. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
<!-- eslint-disable @angular-eslint/template/cyclomatic-complexity -->
|
||||
<section
|
||||
class="flex min-h-full flex-col bg-background text-foreground md:h-full md:min-h-0"
|
||||
data-testid="plugin-manager"
|
||||
|
||||
@@ -63,46 +63,64 @@ type PluginManagerTab = 'docs' | 'extensions' | 'installed' | 'logs' | 'requirem
|
||||
})
|
||||
export class PluginManagerComponent {
|
||||
@Output() readonly closed = new EventEmitter<void>();
|
||||
|
||||
@Output() readonly storeOpened = new EventEmitter<void>();
|
||||
|
||||
readonly scope = input<TojuPluginInstallScope>('client');
|
||||
|
||||
readonly capabilities = inject(PluginCapabilityService);
|
||||
|
||||
readonly host = inject(PluginHostService);
|
||||
|
||||
readonly logger = inject(PluginLoggerService);
|
||||
|
||||
readonly registry = inject(PluginRegistryService);
|
||||
|
||||
readonly requirementState = inject(PluginRequirementStateService);
|
||||
|
||||
readonly router = inject(Router);
|
||||
|
||||
readonly uiRegistry = inject(PluginUiRegistryService);
|
||||
private readonly appI18n = inject(AppI18nService);
|
||||
|
||||
readonly activeTab = signal<PluginManagerTab>('installed');
|
||||
|
||||
readonly busyPluginId = signal<string | null>(null);
|
||||
|
||||
readonly busyAll = signal(false);
|
||||
|
||||
readonly selectedPluginId = signal<string | null>(null);
|
||||
|
||||
readonly allEntries = this.registry.entries;
|
||||
|
||||
readonly entries = computed(() => this.allEntries().filter((entry) => this.entryBelongsToScope(entry)));
|
||||
|
||||
readonly managerTitle = computed(() => this.scope() === 'server'
|
||||
? this.appI18n.instant('plugins.manager.serverTitle')
|
||||
: this.appI18n.instant('plugins.manager.clientTitle'));
|
||||
|
||||
readonly managerDescription = computed(() => this.scope() === 'server'
|
||||
? this.appI18n.instant('plugins.manager.serverDescription')
|
||||
: this.appI18n.instant('plugins.manager.clientDescription'));
|
||||
|
||||
readonly selectedPlugin = computed(() => {
|
||||
const selectedPluginId = this.selectedPluginId();
|
||||
|
||||
return this.entries().find((entry) => entry.manifest.id === selectedPluginId) ?? this.entries()[0] ?? null;
|
||||
});
|
||||
|
||||
readonly missingCapabilities = computed(() => {
|
||||
const selectedPlugin = this.selectedPlugin();
|
||||
|
||||
return selectedPlugin ? this.capabilities.missing(selectedPlugin.manifest) : [];
|
||||
});
|
||||
|
||||
readonly selectedLogs = computed(() => {
|
||||
const selectedPlugin = this.selectedPlugin();
|
||||
|
||||
return selectedPlugin ? this.logger.entries().filter((entry) => entry.pluginId === selectedPlugin.manifest.id)
|
||||
.slice(-20) : [];
|
||||
});
|
||||
|
||||
readonly extensionCounts = computed(() => ({
|
||||
appPages: this.uiRegistry.appPageRecords().filter((record) => this.hasVisiblePlugin(record.pluginId)).length,
|
||||
channelSections: this.uiRegistry.channelSectionRecords().filter((record) => this.hasVisiblePlugin(record.pluginId)).length,
|
||||
@@ -114,6 +132,7 @@ export class PluginManagerComponent {
|
||||
slashCommands: this.uiRegistry.slashCommandRecords().filter((record) => this.hasVisiblePlugin(record.pluginId)).length,
|
||||
toolbarActions: this.uiRegistry.toolbarActionRecords().filter((record) => this.hasVisiblePlugin(record.pluginId)).length
|
||||
}));
|
||||
|
||||
readonly extensionCountItems = computed(() => {
|
||||
const counts = this.extensionCounts();
|
||||
|
||||
@@ -129,15 +148,20 @@ export class PluginManagerComponent {
|
||||
{ label: this.appI18n.instant('plugins.manager.extensionCounts.embedRenderers'), value: counts.embeds }
|
||||
];
|
||||
});
|
||||
|
||||
readonly requirementComparisons = computed(() => this.scope() === 'server' ? this.requirementState.comparisons() : []);
|
||||
|
||||
readonly uiConflicts = computed(() => this.uiRegistry.conflicts()
|
||||
.filter((conflict) => conflict.pluginIds.some((pluginId) => this.hasVisiblePlugin(pluginId))));
|
||||
|
||||
readonly selectedRequirement = computed(() => {
|
||||
const selectedPlugin = this.selectedPlugin();
|
||||
|
||||
return selectedPlugin ? this.requirementState.comparisonFor(selectedPlugin.manifest.id) : null;
|
||||
});
|
||||
|
||||
readonly selectedSettingsSchema = computed(() => this.selectedPlugin()?.manifest.settings ?? null);
|
||||
|
||||
readonly selectedSettingsPages = computed(() => {
|
||||
const selectedPlugin = this.selectedPlugin();
|
||||
|
||||
@@ -145,12 +169,15 @@ export class PluginManagerComponent {
|
||||
? this.uiRegistry.settingsPageRecords().filter((record) => record.pluginId === selectedPlugin.manifest.id)
|
||||
: [];
|
||||
});
|
||||
|
||||
readonly emptyTitle = computed(() => this.scope() === 'server'
|
||||
? this.appI18n.instant('plugins.manager.empty.serverTitle')
|
||||
: this.appI18n.instant('plugins.manager.empty.clientTitle'));
|
||||
|
||||
readonly emptyBody = computed(() => this.scope() === 'server'
|
||||
? this.appI18n.instant('plugins.manager.empty.serverBody')
|
||||
: this.appI18n.instant('plugins.manager.empty.clientBody'));
|
||||
|
||||
readonly selectedDocs = computed(() => {
|
||||
const manifest = this.selectedPlugin()?.manifest;
|
||||
|
||||
@@ -166,6 +193,8 @@ export class PluginManagerComponent {
|
||||
].filter((item): item is { label: string; url: string } => typeof item.url === 'string' && item.url.length > 0);
|
||||
});
|
||||
|
||||
private readonly appI18n = inject(AppI18nService);
|
||||
|
||||
setTab(tab: PluginManagerTab): void {
|
||||
this.activeTab.set(tab);
|
||||
}
|
||||
@@ -265,4 +294,5 @@ export class PluginManagerComponent {
|
||||
private hasVisiblePlugin(pluginId: string): boolean {
|
||||
return this.entries().some((entry) => entry.manifest.id === pluginId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user