chore(ai): remove dead code (unused exports & deps)

This commit is contained in:
google-labs-jules[bot] committed 2026-01-24 20:28:53 +00:00
1 parent 3bfe8d664f
commit 4a0b81ad98
25 files changed
+2 -287

No files matched your search

-4
View File
@@ -406,10 +406,6 @@ export function setUrlFirstEnabled(next) {
return URL_FIRST_ENABLED;
}
export function getWatchHistoryV2Enabled() {
return FEATURE_WATCH_HISTORY_V2 === true;
}
export function setWssTrackers(next) {
runtimeFlags.WSS_TRACKERS = next;
return WSS_TRACKERS;
-5
View File
@@ -96,8 +96,3 @@ export function applyDesignSystemAttributes(root = null) {
return mode;
}
export function subscribeToDesignSystemChanges(listener) {
void listener;
return () => {};
}
-4
View File
@@ -185,10 +185,6 @@ export function getBreakpointLg(options = {}) {
return readDesignToken("--breakpoint-lg", options);
}
export function getBreakpointLgPx(options = {}) {
return readDesignTokenAsPixels("--breakpoint-lg", options);
}
export function getPopoverBackdropBlur(options = {}) {
return readDesignToken("--popover-backdrop-blur", options);
}
-8
View File
@@ -621,11 +621,3 @@ export async function decryptDM(event, context = {}) {
return decryptLegacyDm(event, decryptors, actorPubkey);
}
export const __testUtils = {
cloneEvent,
normalizeHex,
parseEncryptionHints,
collectRecipients,
orderDecryptors,
};
-4
View File
@@ -669,7 +669,3 @@ export function attachHealthBadges(container, options = {}) {
}
gridCardObserver.observe(container);
}
export function refreshHealthBadges(container) {
gridCardObserver.refresh(container);
}
-13
View File
@@ -1312,19 +1312,6 @@ if (document.readyState === "loading") {
HELPER FUNCTIONS FOR QUERY AND HASH
-------------------------------------------- */
/**
* Sets a query param (e.g. ?modal=xxx or ?v=yyy),
* removing any "#view=..." from the hash to avoid collisions.
*/
export function setQueryParam(key, value) {
const url = new URL(window.location.href);
url.hash = "";
url.searchParams.set(key, value);
const newUrl = url.pathname + url.search;
window.history.replaceState({}, "", newUrl);
handleQueryParams();
}
/**
* Check the current URL for ?modal=..., ?v=..., etc.
* Open the correct modals or disclaimers as needed.
+1 -4
View File
@@ -1,10 +1,7 @@
// js/lists.js
// Operators must manage admin lists through the Admin panel UI or remote
// adapters. These legacy constants are intentionally empty so new installs do
// not ship with hard-coded accounts.
export const ADMIN_INITIAL_WHITELIST = [];
export const ADMIN_INITIAL_BLACKLIST = [];
// adapters.
// Block specific events with the nevent
export const ADMIN_INITIAL_EVENT_BLACKLIST = [];
-4
View File
@@ -59,7 +59,3 @@ export function logViewCountFailure(error) {
key: "view-count-failure",
});
}
export function resetCountWarningHistory() {
seenWarningKeys.clear();
}
-6
View File
@@ -93,9 +93,3 @@ function patchProcessEmitWarning() {
}
patchProcessEmitWarning();
export function refreshMaxListenerPreference() {
// The shim dynamically checks the verbose flag on each invocation, so there
// is nothing else to refresh right now. This placeholder remains for API
// parity if runtime toggling ever requires additional work.
}
-5
View File
@@ -261,8 +261,3 @@ export function onActiveSignerChanged(callback) {
export function offActiveSignerChanged(callback) {
activeSignerListeners.delete(callback);
}
export const __nostrClientRegistryTestHooks = {
clearNostrClientRegistration,
clearActiveSigner,
};
-4
View File
@@ -1625,10 +1625,6 @@ export async function sendPayment(
}
}
export function getActiveWalletContext() {
return activeState?.context || null;
}
export function resetWalletClient() {
closeSocket();
}
-4
View File
@@ -753,7 +753,3 @@ class RelayPreferencesManager {
}
export const relayManager = new RelayPreferencesManager();
export function normalizeRelayUrlForDisplay(value) {
return normalizeRelayUrl(value);
}
-8
View File
@@ -69,14 +69,6 @@ export function resetSearchFilters(options = {}) {
}
}
export function subscribeSearchFilterState(listener) {
if (typeof listener !== "function") {
return () => {};
}
listeners.add(listener);
return () => listeners.delete(listener);
}
export function syncSearchFilterStateFromHash(hash = "") {
const hashString =
typeof hash === "string" && hash ? hash : window?.location?.hash || "";
-9
View File
@@ -329,12 +329,3 @@ export function serializeFiltersToQuery(filters = DEFAULT_FILTERS) {
return tokens.join(" ");
}
export function filtersToHashParams(filters = DEFAULT_FILTERS) {
const params = new URLSearchParams();
const serialized = serializeFiltersToQuery(filters);
if (serialized) {
params.set("filters", serialized);
}
return params;
}
-31
View File
@@ -52,37 +52,6 @@ export function buildS3ObjectUrl({
return buildS3PublicUrl({ endpoint, bucket, key, forcePathStyle });
}
export function buildS3MediaUrls({
publicBaseUrl,
endpoint,
bucket,
forcePathStyle,
videoKey,
torrentKey,
thumbnailKey,
} = {}) {
const normalizedBase = normalizeS3PublicBaseUrl(publicBaseUrl);
const resolvedBase =
normalizedBase ||
buildS3PublicUrl({ endpoint, bucket, forcePathStyle });
const buildUrl = (key) =>
buildS3ObjectUrl({
publicBaseUrl: normalizedBase,
endpoint,
bucket,
key,
forcePathStyle,
});
return {
publicBaseUrl: resolvedBase,
videoUrl: buildUrl(videoKey),
torrentUrl: buildUrl(torrentKey),
thumbnailUrl: buildUrl(thumbnailKey),
};
}
export function validateS3Connection({
endpoint,
region,
-8
View File
@@ -1166,10 +1166,6 @@ function normalizeDmPrivacySettings(partial = {}) {
};
}
export function getDefaultDmPrivacySettings() {
return createDefaultDmPrivacySettings();
}
export function getDmPrivacySettingsForPubkey(pubkey) {
const key = getDmPrivacyStoreKeyForPubkey(pubkey);
const settings = ensureDmPrivacySettingsForKey(key);
@@ -1462,10 +1458,6 @@ export function resetModerationSettings({ persist = true } = {}) {
return ensureModerationSettingsForKey(key);
}
export function getModerationOverridesMap() {
return moderationOverrides;
}
export function getModerationOverridesList() {
return Array.from(moderationOverrides.values()).map((entry) => ({ ...entry }));
}
-12
View File
@@ -519,15 +519,6 @@ export async function listConversations() {
}
}
export function describeDmDbSchema() {
return {
name: DB_NAME,
version: DB_VERSION,
stores: STORES,
migrations: MIGRATIONS.map((migration) => migration.version),
};
}
export async function clearDmDb() {
try {
const db = await openDmDb();
@@ -558,6 +549,3 @@ export async function clearDmDb() {
return false;
}
}
export const dmDbStores = STORES;
export const dmDbVersion = DB_VERSION;
-12
View File
@@ -61,18 +61,6 @@ export async function testS3Connection(config) {
}
}
export function ensureR2SdkLoaded() {
return ensureS3SdkLoaded();
}
export function getR2SdkLoadError() {
return getS3SdkLoadError();
}
export function isR2SdkAvailable() {
return isS3SdkAvailable();
}
export function makeR2Client({
accountId,
accessKeyId,
-2
View File
@@ -319,8 +319,6 @@ export const setThemeAccentOverrides = (overrides) => {
applyAccentOverrides(root, theme);
};
export const getThemeAccentOverrides = () => cloneAccentOverrides(accentOverrides);
export const setTheme = (theme) => {
if (!isBrowser()) {
currentTheme = normalizeTheme(theme) || FALLBACK_THEME;
-7
View File
@@ -221,10 +221,3 @@ export async function trackerPing(magnet, trackers) {
});
}
export function getTrackerStateSnapshot() {
const snapshot = {};
trackerState.forEach((value, key) => {
snapshot[key] = { ...value };
});
return snapshot;
}
@@ -140,28 +140,3 @@ export function closeStaticModal(target, { document: providedDocument } = {}) {
return true;
}
export function toggleStaticModal(target, shouldOpen, options = {}) {
if (shouldOpen) {
return openStaticModal(target, options);
}
return closeStaticModal(target, options);
}
export function destroyStaticModal(target, { document: providedDocument } = {}) {
const doc = resolveDocument(providedDocument);
const root = resolveRoot(target, doc);
if (!root) {
return false;
}
const record = accessibilityByModal.get(root);
if (!record) {
return false;
}
try {
record.accessibility.destroy?.();
} finally {
accessibilityByModal.delete(root);
}
synchronizeDocumentModalState(record.document);
return true;
}
-57
View File
@@ -3,7 +3,6 @@ import { userLogger } from "./logger.js";
const URL_HEALTH_STORAGE_PREFIX = "bitvid:urlHealth:";
const TORRENT_PROBE_STORAGE_PREFIX = "bitvid:torrentProbe:";
const TRACKER_HEALTH_STORAGE_PREFIX = "bitvid:trackerHealth:";
export function getUrlHealthStorageKey(eventId) {
return `${URL_HEALTH_STORAGE_PREFIX}${eventId}`;
@@ -13,10 +12,6 @@ export function getTorrentProbeStorageKey(infoHash) {
return `${TORRENT_PROBE_STORAGE_PREFIX}${infoHash}`;
}
export function getTrackerHealthStorageKey(infoHash) {
return `${TRACKER_HEALTH_STORAGE_PREFIX}${infoHash}`;
}
export function readUrlHealthFromStorage(eventId) {
if (!eventId || typeof localStorage === "undefined") {
return null;
@@ -117,55 +112,3 @@ export function removeTorrentProbeFromStorage(infoHash) {
userLogger.warn(`Failed to remove torrent probe for ${infoHash}:`, err);
}
}
export function readTrackerHealthFromStorage(infoHash) {
if (!infoHash || typeof localStorage === "undefined") {
return null;
}
try {
const raw = localStorage.getItem(getTrackerHealthStorageKey(infoHash));
if (!raw) {
return null;
}
const parsed = JSON.parse(raw);
if (parsed && typeof parsed === "object") {
return parsed;
}
} catch (err) {
userLogger.warn(
`Failed to parse stored tracker health for ${infoHash}:`,
err
);
}
removeTrackerHealthFromStorage(infoHash);
return null;
}
export function writeTrackerHealthToStorage(infoHash, entry) {
if (!infoHash || typeof localStorage === "undefined") {
return;
}
try {
localStorage.setItem(
getTrackerHealthStorageKey(infoHash),
JSON.stringify(entry)
);
} catch (err) {
userLogger.warn(`Failed to persist tracker health for ${infoHash}:`, err);
}
}
export function removeTrackerHealthFromStorage(infoHash) {
if (!infoHash || typeof localStorage === "undefined") {
return;
}
try {
localStorage.removeItem(getTrackerHealthStorageKey(infoHash));
} catch (err) {
userLogger.warn(`Failed to remove tracker health for ${infoHash}:`, err);
}
}
-50
View File
@@ -28,7 +28,6 @@
"prettier": "^3.8.1",
"prettier-plugin-tailwindcss": "^0.6.5",
"stylelint": "^16.26.1",
"stylelint-config-standard": "^36.0.1",
"tailwindcss": "^3.4.19"
}
},
@@ -3796,55 +3795,6 @@
"node": ">=18.12.0"
}
},
"node_modules/stylelint-config-recommended": {
"version": "14.0.1",
"resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-14.0.1.tgz",
"integrity": "sha512-bLvc1WOz/14aPImu/cufKAZYfXs/A/owZfSMZ4N+16WGXLoX5lOir53M6odBxvhgmgdxCVnNySJmZKx73T93cg==",
"dev": true,
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/stylelint"
},
{
"type": "github",
"url": "https://github.com/sponsors/stylelint"
}
],
"license": "MIT",
"engines": {
"node": ">=18.12.0"
},
"peerDependencies": {
"stylelint": "^16.1.0"
}
},
"node_modules/stylelint-config-standard": {
"version": "36.0.1",
"resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-36.0.1.tgz",
"integrity": "sha512-8aX8mTzJ6cuO8mmD5yon61CWuIM4UD8Q5aBcWKGSf6kg+EC3uhB+iOywpTK4ca6ZL7B49en8yanOFtUW0qNzyw==",
"dev": true,
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/stylelint"
},
{
"type": "github",
"url": "https://github.com/sponsors/stylelint"
}
],
"license": "MIT",
"dependencies": {
"stylelint-config-recommended": "^14.0.1"
},
"engines": {
"node": ">=18.12.0"
},
"peerDependencies": {
"stylelint": "^16.1.0"
}
},
"node_modules/stylelint/node_modules/@csstools/selector-specificity": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-5.0.0.tgz",
-1
View File
@@ -47,7 +47,6 @@
"prettier": "^3.8.1",
"prettier-plugin-tailwindcss": "^0.6.5",
"stylelint": "^16.26.1",
"stylelint-config-standard": "^36.0.1",
"tailwindcss": "^3.4.19"
},
"license": "GPL-3.0-or-later",
+1
View File
@@ -22,6 +22,7 @@ const IGNORED_GLOBS = [
'!js/utils/qrcode.js',
'!**/dist/**',
'!REMEDIATION_REPORT.md',
'!CHANGELOG.md',
'!scripts/daily-design-system-audit.mjs',
'!config/instance-config.js',
'!config/validate-config.js'