Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff4b13c860 | ||
|
|
bf9b588f13 | ||
|
|
1bc5eac3a4 |
No files matched your search
+14
-20
@@ -22,31 +22,25 @@ export default [
|
||||
...nextTypeScript,
|
||||
{
|
||||
rules: {
|
||||
// ─── Demoted on first introduction ─────────────────────────────
|
||||
// The existing codebase has hundreds of violations across these
|
||||
// rules. To make the lint job runnable in CI without blocking on
|
||||
// pre-existing debt, every rule that currently fires errors is
|
||||
// demoted to `warn`. Promote back to `error` once the backlog
|
||||
// is addressed (recommended in this order: prefer-const,
|
||||
// no-unescaped-entities, ban-ts-comment, then the react-hooks
|
||||
// family once the team agrees on the React 19 hook-purity rules).
|
||||
// ─── Re-enabled Strict Rules ─────────────────────────────
|
||||
// The codebase has been baselined with suppress-eslint-errors.
|
||||
// All new code must adhere to these strict rules.
|
||||
|
||||
// Pre-existing — flagged in the original code review (#96):
|
||||
"@typescript-eslint/no-explicit-any": "warn",
|
||||
"no-console": "warn",
|
||||
"@typescript-eslint/no-explicit-any": "error",
|
||||
"no-console": "error",
|
||||
|
||||
// React 19 hook-purity rules from eslint-plugin-react-hooks 7+:
|
||||
"react-hooks/purity": "warn",
|
||||
"react-hooks/refs": "warn",
|
||||
"react-hooks/set-state-in-effect": "warn",
|
||||
"react-hooks/immutability": "warn",
|
||||
"react-hooks/static-components": "warn",
|
||||
"react-hooks/purity": "error",
|
||||
"react-hooks/refs": "error",
|
||||
"react-hooks/set-state-in-effect": "error",
|
||||
"react-hooks/immutability": "error",
|
||||
"react-hooks/static-components": "error",
|
||||
|
||||
// Misc one-offs across the codebase:
|
||||
"react/no-unescaped-entities": "warn",
|
||||
"@typescript-eslint/ban-ts-comment": "warn",
|
||||
"@next/next/no-assign-module-variable": "warn",
|
||||
"prefer-const": "warn",
|
||||
"react/no-unescaped-entities": "error",
|
||||
"@typescript-eslint/ban-ts-comment": "error",
|
||||
"@next/next/no-assign-module-variable": "error",
|
||||
"prefer-const": "error",
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -21,6 +21,7 @@
|
||||
"test:e2e": "playwright test",
|
||||
"test:mutate": "stryker run",
|
||||
"lint": "eslint .",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"db:reset": "npx prisma migrate reset --force",
|
||||
"db:prune": "node scripts/db-prune.mjs",
|
||||
"generate": "prisma generate"
|
||||
|
||||
@@ -8,14 +8,20 @@ export const configCommand = new Command('config')
|
||||
.argument('<value>', 'Config value (e.g., your-username)')
|
||||
.action((action, key, value) => {
|
||||
if (action !== 'set') {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`[wwv-cli] Unknown config action: ${action}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (key === 'org') {
|
||||
saveConfig({ org: value });
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[wwv-cli] Successfully set default organization to @${value}`);
|
||||
} else {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`[wwv-cli] Unknown config key: ${key}. Valid keys: org`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
@@ -68,6 +68,8 @@ export const createCommand = new Command('create')
|
||||
]);
|
||||
|
||||
if (!response.pluginId) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Plugin creation cancelled.');
|
||||
return;
|
||||
}
|
||||
@@ -78,6 +80,8 @@ export const createCommand = new Command('create')
|
||||
const pluginDir = path.join(process.cwd(), targetBaseDir, `wwv-plugin-${pluginId}`);
|
||||
|
||||
if (fs.existsSync(pluginDir)) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Error: Directory ${pluginDir} already exists.`);
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -192,6 +196,8 @@ ${fetchBoilerplate}
|
||||
fs.mkdirSync(path.join(pluginDir, 'src'), { recursive: true });
|
||||
fs.writeFileSync(path.join(pluginDir, 'src', 'index.ts'), indexTsContent);
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`\n✅ Successfully created plugin frontend at ${pluginDir}`);
|
||||
|
||||
// Generate seeder backend if requested
|
||||
@@ -222,10 +228,14 @@ export default async function run(context) {
|
||||
}
|
||||
`;
|
||||
fs.writeFileSync(path.join(seederDir, 'seeder.mjs'), seederContent);
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`✅ Successfully created plugin seeder at ${seederDir}`);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`\nNext steps:
|
||||
1. Run \`pnpm install\` from the project root.
|
||||
2. Edit \`index.ts\` in your plugin directory.
|
||||
|
||||
@@ -10,6 +10,8 @@ export const publishCommand = new Command('publish')
|
||||
.argument('[pluginName]', 'Name of the plugin to publish (if running from root)')
|
||||
.option('--org <orgName>', 'NPM organization to publish to (e.g., your-username)')
|
||||
.action(async (pluginName, options) => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('[wwv-cli] Preparing to publish plugin...');
|
||||
let cwd = process.cwd();
|
||||
|
||||
@@ -29,15 +31,21 @@ export const publishCommand = new Command('publish')
|
||||
} else if (fs.existsSync(packagesPath)) {
|
||||
cwd = packagesPath;
|
||||
} else {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`[wwv-cli] Error: Could not find plugin '${pluginName}' in local-plugins or packages.`);
|
||||
process.exit(1);
|
||||
}
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[wwv-cli] Found plugin at: ${cwd}`);
|
||||
}
|
||||
|
||||
const pkgPath = path.join(cwd, 'package.json');
|
||||
|
||||
if (!fs.existsSync(pkgPath)) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('[wwv-cli] Error: No package.json found in directory: ' + cwd);
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -46,10 +54,14 @@ export const publishCommand = new Command('publish')
|
||||
const pkgContent = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
||||
|
||||
if (!pkgContent.worldwideview) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('[wwv-cli] Error: package.json is missing the "worldwideview" manifest block. Is this a WWV plugin?');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line prefer-const
|
||||
let originalName = pkgContent.name;
|
||||
let publishedName = originalName;
|
||||
|
||||
@@ -60,6 +72,8 @@ export const publishCommand = new Command('publish')
|
||||
if (!targetOrg) {
|
||||
if (config.org) {
|
||||
targetOrg = config.org;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[wwv-cli] Using default organization from config: @${targetOrg}`);
|
||||
} else {
|
||||
// Fallback to NPM whoami if possible
|
||||
@@ -79,12 +93,16 @@ export const publishCommand = new Command('publish')
|
||||
});
|
||||
|
||||
if (!response.org) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Publish cancelled.');
|
||||
return;
|
||||
}
|
||||
|
||||
targetOrg = response.org;
|
||||
saveConfig({ org: targetOrg });
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[wwv-cli] Saved @${targetOrg} as your default organization.`);
|
||||
}
|
||||
} else {
|
||||
@@ -100,20 +118,34 @@ export const publishCommand = new Command('publish')
|
||||
if (originalName !== publishedName) {
|
||||
pkgContent.name = publishedName;
|
||||
fs.writeFileSync(pkgPath, JSON.stringify(pkgContent, null, 2) + '\n');
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[wwv-cli] Updated package name to ${publishedName}`);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[wwv-cli] Publishing ${publishedName}@${pkgContent.version} to NPM...`);
|
||||
|
||||
// Execute npm publish
|
||||
execSync('npm publish --access public', { stdio: 'inherit', cwd });
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('[wwv-cli] Successfully published to NPM!');
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('[wwv-cli] To submit this plugin to the WorldWideView Marketplace, please visit: https://marketplace.worldwideview.dev/submit');
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[wwv-cli] Package Name: ${publishedName}`);
|
||||
|
||||
} catch (err: any) {
|
||||
} // TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
catch (err: any) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('[wwv-cli] Error during publish:', err.message);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ export abstract class BaseAviationPlugin implements WorldPlugin {
|
||||
abstract id: string;
|
||||
abstract name: string;
|
||||
abstract description: string;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
abstract icon: any;
|
||||
category = "aviation" as const;
|
||||
abstract version: string;
|
||||
@@ -35,6 +37,8 @@ export abstract class BaseAviationPlugin implements WorldPlugin {
|
||||
|
||||
// Implementations must define how payload comes via fetch and websocket
|
||||
abstract fetch(timeRange: TimeRange): Promise<GeoEntity[]>;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
abstract mapWebsocketPayload(payload: any): GeoEntity[];
|
||||
|
||||
// Server backend configurations
|
||||
|
||||
@@ -15,6 +15,8 @@ export abstract class BaseIncidentPlugin implements WorldPlugin {
|
||||
abstract id: string;
|
||||
abstract name: string;
|
||||
abstract description: string;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
abstract icon: any;
|
||||
abstract category: PluginCategory;
|
||||
abstract version: string;
|
||||
@@ -37,6 +39,8 @@ export abstract class BaseIncidentPlugin implements WorldPlugin {
|
||||
protected abstract getSeverityColor(value: number): string;
|
||||
protected abstract getSeveritySize(value: number): number;
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
protected getEntityIcon(entity: GeoEntity): any {
|
||||
return this.icon;
|
||||
}
|
||||
|
||||
@@ -32,10 +32,9 @@ export interface IconUrlOptions extends Record<string, unknown> {
|
||||
* By default wraps the icon in a filled circle for visibility on any terrain.
|
||||
* Pass `{ background: false }` to opt out.
|
||||
*/
|
||||
export function createSvgIconUrl(
|
||||
Icon: ComponentType<any>,
|
||||
opts: IconUrlOptions = {},
|
||||
): string {
|
||||
export // TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function createSvgIconUrl(Icon: ComponentType<any>, opts: IconUrlOptions = {}): string {
|
||||
const {
|
||||
background = true,
|
||||
backgroundColor = DEFAULT_BG_COLOR,
|
||||
@@ -272,11 +271,15 @@ export interface WorldPlugin {
|
||||
getServerConfig?(): ServerPluginConfig;
|
||||
getFilterDefinitions?(): FilterDefinition[];
|
||||
getLegend?(): { label: string; color: string; filterId?: string; filterValue?: string }[];
|
||||
getSidebarComponent?(): ComponentType<{ plugin?: any } | any>;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
getSidebarComponent?(): ComponentType<{ plugin?: any } | any>
|
||||
getDetailComponent?(): ComponentType<{ entity: GeoEntity }>;
|
||||
getSettingsComponent?(): ComponentType<{ pluginId: string }>;
|
||||
getSettingsComponent?(): ComponentType<{ pluginId: string }>
|
||||
/** Custom React component injected into the Globe view for rendering primitives/data sources (e.g. GeoJSON). */
|
||||
getGlobeComponent?(): ComponentType<{ viewer: any; enabled: boolean }>;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
getGlobeComponent?(): ComponentType<{ viewer: any; enabled: boolean }>
|
||||
/**
|
||||
* Returns a React component to be rendered inside the Bottom Panel when this plugin's
|
||||
* dock button is selected. The panel is resizable and can be expanded to fullscreen.
|
||||
@@ -285,7 +288,9 @@ export interface WorldPlugin {
|
||||
getBottomPanelComponent?(): ComponentType<{ pluginId: string; enabled: boolean }>;
|
||||
requiresConfiguration?(settings: unknown): boolean;
|
||||
/** Map raw websocket payload into GeoEntity array. Optional existingEntities is provided so plugins can merge state (e.g. historical trails). */
|
||||
mapWebsocketPayload?(payload: any, existingEntities?: GeoEntity[]): GeoEntity[];
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
mapWebsocketPayload?(payload: any, existingEntities?: GeoEntity[]): GeoEntity[]
|
||||
}
|
||||
|
||||
// ─── Aliases for backwards compatibility ─────────────────────
|
||||
|
||||
@@ -12,8 +12,12 @@ import path from "path";
|
||||
* - Converts features into GeoEntity objects
|
||||
* - Renders with the manifest's rendering config
|
||||
*/
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function wwvStaticCompiler(): any {
|
||||
let pluginRoot = "";
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let manifest: any = null;
|
||||
let generatedEntry = "";
|
||||
|
||||
@@ -21,6 +25,8 @@ export function wwvStaticCompiler(): any {
|
||||
name: "wwv-static-compiler",
|
||||
enforce: "pre" as const,
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
config(userConfig: any) {
|
||||
pluginRoot = userConfig.root || process.cwd();
|
||||
const pkgPath = path.join(pluginRoot, "package.json");
|
||||
@@ -71,6 +77,8 @@ export function wwvStaticCompiler(): any {
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function generateStaticPluginSource(manifest: any): string {
|
||||
const pluginId = manifest.id;
|
||||
const pluginName = manifest.name || pluginId;
|
||||
|
||||
@@ -22,6 +22,8 @@ interface GlobalsMap {
|
||||
*
|
||||
* @returns {any} A Vite plugin object.
|
||||
*/
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function wwvPluginGlobals(): any {
|
||||
const HOST_MAPPINGS: GlobalsMap = {
|
||||
"react": "React",
|
||||
|
||||
@@ -11,9 +11,11 @@ export default {
|
||||
|
||||
// Lifecycle
|
||||
initialize: async (ctx) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("[e2e-mock-bottom-panel] Initialized");
|
||||
},
|
||||
destroy: () => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("[e2e-mock-bottom-panel] Destroyed");
|
||||
},
|
||||
|
||||
@@ -47,6 +49,7 @@ export default {
|
||||
const React = globalThis.__WWV_HOST__.React;
|
||||
|
||||
if (!React) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[e2e-mock-bottom-panel] Failed to resolve React from __WWV_HOST__");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -12,9 +12,11 @@ export default {
|
||||
|
||||
// Lifecycle
|
||||
initialize: async (ctx) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("[e2e-mock-plugin] Initialized");
|
||||
},
|
||||
destroy: () => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("[e2e-mock-plugin] Destroyed");
|
||||
},
|
||||
|
||||
@@ -48,6 +50,7 @@ export default {
|
||||
const React = globalThis.__WWV_HOST__.React;
|
||||
|
||||
if (!React) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[e2e-mock-plugin] Failed to resolve React from __WWV_HOST__");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ loadEnv('.env');
|
||||
const skipLocalDb = process.env.WWV_SKIP_LOCAL_DB === 'true' || process.env.WWV_SKIP_LOCAL_DB === '1';
|
||||
|
||||
if (skipLocalDb) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('⏭️ Skipping local PostgreSQL startup (WWV_SKIP_LOCAL_DB is set).');
|
||||
process.exit(0);
|
||||
}
|
||||
@@ -59,6 +60,7 @@ if (folderName !== 'worldwideview') {
|
||||
}
|
||||
|
||||
process.env.WWV_DB_PORT = port.toString();
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`🔌 Assigned deterministic database port: ${port}`);
|
||||
|
||||
// Robust rewrite of DATABASE_URL in .env
|
||||
@@ -78,6 +80,7 @@ if (fs.existsSync(envPath)) {
|
||||
foundTargetActive = true;
|
||||
return line;
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`⚠️ [Telemetry] Commenting out conflicting DATABASE_URL: ${line.trim()}`);
|
||||
linesModified = true;
|
||||
return `# ${line}`;
|
||||
@@ -87,6 +90,7 @@ if (fs.existsSync(envPath)) {
|
||||
});
|
||||
|
||||
if (!foundTargetActive) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`🔌 [Telemetry] Injecting correct local DATABASE_URL for port ${port}.`);
|
||||
newLines.push(``);
|
||||
newLines.push(`# Dynamically injected by boot-db.mjs for worktree`);
|
||||
@@ -107,8 +111,10 @@ if (fs.existsSync(envPath)) {
|
||||
} catch (err) {
|
||||
attempt++;
|
||||
if (err.code === 'EBUSY' || err.code === 'EPERM' || err.message.includes('os error 32')) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`⚠️ [Telemetry] File lock encountered on .env (attempt ${attempt}/${maxRetries}). Retrying in 100ms...`);
|
||||
if (attempt >= maxRetries) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('❌ Failed to write .env after multiple attempts due to file locks.');
|
||||
throw err;
|
||||
}
|
||||
@@ -124,6 +130,7 @@ if (fs.existsSync(envPath)) {
|
||||
}
|
||||
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('🚀 Checking local PostgreSQL database...');
|
||||
|
||||
try {
|
||||
@@ -131,19 +138,26 @@ try {
|
||||
try {
|
||||
execSync('docker --version', { stdio: 'ignore' });
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('⚠️ Docker is not installed or not in PATH. Skipping local database startup.');
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('💡 If you want to run a local database automatically, please install Docker Desktop.');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
// Start the db service and wait for it to be healthy
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('📦 Starting PostgreSQL via Docker Compose...');
|
||||
execSync('docker compose up -d --wait db', { stdio: 'inherit' });
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('✅ Local PostgreSQL database is ready!');
|
||||
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('❌ Failed to start local database:', error.message);
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('💡 Ensure that docker is running and try again');
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('💡 You may need to start it manually or set WWV_SKIP_LOCAL_DB=true to use an external database.');
|
||||
}
|
||||
@@ -21,10 +21,15 @@ const missing = checks.filter(c => !process.env[c.name]);
|
||||
if (missing.length === 0) process.exit(0);
|
||||
|
||||
const yellow = (s) => `\x1b[33m${s}\x1b[0m`;
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(yellow("\n⚠ Build-time env vars not set:"));
|
||||
for (const c of missing) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(yellow(`\n ${c.name}`));
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(` ${c.why}`);
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(` Fix: ${c.how}`);
|
||||
}
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(yellow("\nContinuing build — these are warnings, not errors.\n"));
|
||||
@@ -2,22 +2,29 @@ import { prisma } from "../src/lib/db";
|
||||
|
||||
async function main() {
|
||||
const plugins = await prisma.installedPlugin.findMany();
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("Installed plugins:");
|
||||
// eslint-disable-next-line no-console
|
||||
plugins.forEach((p) => console.log(` ${p.pluginId} | config: ${p.config.substring(0, 60)}`));
|
||||
|
||||
const geojson = plugins.find((p) => p.pluginId === "geojson");
|
||||
if (geojson) {
|
||||
await prisma.installedPlugin.delete({ where: { id: geojson.id } });
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("\nDeleted orphaned 'geojson' record.");
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("\nNo orphaned 'geojson' record found.");
|
||||
}
|
||||
|
||||
const remaining = await prisma.installedPlugin.findMany();
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("\nRemaining plugins:");
|
||||
// eslint-disable-next-line no-console
|
||||
remaining.forEach((p) => console.log(` ${p.pluginId}`));
|
||||
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
main().catch(console.error);
|
||||
@@ -12,5 +12,7 @@ const geoJson = convertToGeoJson(raw);
|
||||
|
||||
writeFileSync(outputPath, JSON.stringify(geoJson, null, 2), "utf-8");
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`✅ Converted ${geoJson.features.length} features`);
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(` Output: ${outputPath}`);
|
||||
@@ -15,6 +15,7 @@ function copyDir(src, dest) {
|
||||
}
|
||||
const entries = fs.readdirSync(src, { withFileTypes: true });
|
||||
|
||||
// eslint-disable-next-line prefer-const
|
||||
for (let entry of entries) {
|
||||
const srcPath = path.join(src, entry.name);
|
||||
const destPath = path.join(dest, entry.name);
|
||||
@@ -27,15 +28,19 @@ function copyDir(src, dest) {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Copying Cesium assets...');
|
||||
folders.forEach(folder => {
|
||||
const src = path.join(cesiumSource, folder);
|
||||
const dest = path.join(targetBase, folder);
|
||||
if (fs.existsSync(src)) {
|
||||
copyDir(src, dest);
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Copied ${folder}`);
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Source folder not found: ${src}`);
|
||||
}
|
||||
});
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Cesium assets copied successfully.');
|
||||
@@ -9,6 +9,7 @@ import { execSync } from 'child_process';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('🧹 Starting Garbage Collection for orphaned WorldWideView Docker volumes...');
|
||||
|
||||
try {
|
||||
@@ -23,6 +24,7 @@ try {
|
||||
);
|
||||
|
||||
if (wwvVolumes.length === 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('✅ No WorldWideView volumes found.');
|
||||
process.exit(0);
|
||||
}
|
||||
@@ -50,23 +52,28 @@ try {
|
||||
}
|
||||
|
||||
if (!activeProjectNames.has(projectName)) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`🗑️ Deleting orphaned volume: ${volume}`);
|
||||
try {
|
||||
execSync(`docker volume rm ${volume}`, { stdio: 'inherit' });
|
||||
orphanedCount++;
|
||||
} catch (rmError) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`⚠️ Could not remove volume ${volume}. It may still be in use.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (orphanedCount === 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('✅ All existing volumes belong to active worktrees. Nothing to prune.');
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`✅ Successfully pruned ${orphanedCount} orphaned volume(s).`);
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('❌ Failed to prune volumes:', error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -19,6 +19,7 @@ for (const dir of dirs) {
|
||||
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
||||
|
||||
if (!pkg.worldwideview) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Skipped ${dir} - No worldwideview metadata in package.json`);
|
||||
continue;
|
||||
}
|
||||
@@ -45,8 +46,10 @@ for (const dir of dirs) {
|
||||
|
||||
fs.copyFileSync(distPath, path.join(targetDir, "frontend.mjs"));
|
||||
fs.writeFileSync(path.join(targetDir, "plugin.json"), JSON.stringify(manifest, null, 2));
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Deployed ${publicName} to public/plugins`);
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Skipped ${dir} - dist or package.json not found.`);
|
||||
}
|
||||
}
|
||||
@@ -54,6 +54,7 @@ const shutdown = () => {
|
||||
if (isShuttingDown) return;
|
||||
isShuttingDown = true;
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('\n🛑 Shutting down dev servers...');
|
||||
|
||||
// Forcefully kill the process tree of each command cross-platform
|
||||
@@ -64,11 +65,14 @@ const shutdown = () => {
|
||||
});
|
||||
|
||||
if (teardownDbOnExit) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('📦 Tearing down local PostgreSQL database...');
|
||||
try {
|
||||
execSync('docker compose stop db', { stdio: 'inherit' });
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('✅ Local database stopped.');
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('⚠️ Failed to stop database container.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ export default defineConfig({
|
||||
|
||||
// Add vite.config.ts
|
||||
fs.writeFileSync(path.join(packagesDir, dir, "vite.config.ts"), viteConfigContent);
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Added vite.config.ts to ${dir} (entry: ${entryFile})`);
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ const certPath = path.join(process.cwd(), 'data', 'localhost.crt');
|
||||
const keyPath = path.join(process.cwd(), 'data', 'localhost.key');
|
||||
|
||||
if (!fs.existsSync(certPath) || !fs.existsSync(keyPath)) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('[HTTPS Proxy] Certificates not found. Proxy will not start.');
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -38,6 +39,7 @@ const server = https.createServer(options, (req, res) => {
|
||||
});
|
||||
|
||||
proxyReq.on('error', (e) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`[HTTPS Proxy] Error proxying request to ${req.url}:`, e.message);
|
||||
res.writeHead(502);
|
||||
res.end('Bad Gateway');
|
||||
@@ -47,5 +49,6 @@ const server = https.createServer(options, (req, res) => {
|
||||
});
|
||||
|
||||
server.listen(listenPort, '0.0.0.0', () => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[HTTPS Proxy] Secure bridge listening on https://0.0.0.0:${listenPort} (forwarding to http://127.0.0.1:${targetPort})`);
|
||||
});
|
||||
@@ -7,9 +7,11 @@ async function main() {
|
||||
if (action === "list") {
|
||||
const users = await prisma.user.findMany();
|
||||
if (users.length === 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("No users found — visit /setup to create one.");
|
||||
} else {
|
||||
users.forEach((u) =>
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(` ${u.email} | ${u.name} | ${u.role} | ${u.createdAt}`)
|
||||
);
|
||||
}
|
||||
@@ -17,6 +19,7 @@ async function main() {
|
||||
const email = process.argv[3];
|
||||
const newPass = process.argv[4];
|
||||
if (!email || !newPass) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("Usage: tsx scripts/manage-users.ts reset <email> <password>");
|
||||
return;
|
||||
}
|
||||
@@ -25,15 +28,19 @@ async function main() {
|
||||
where: { email },
|
||||
data: { hashedPassword: hashed },
|
||||
});
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Password reset for ${email}`);
|
||||
} else if (action === "delete-all") {
|
||||
await prisma.user.deleteMany();
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("All users deleted — visit /setup to create a new admin.");
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("Usage: tsx scripts/manage-users.ts <list|reset|delete-all>");
|
||||
}
|
||||
|
||||
await prisma.$disconnect();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
main().catch(console.error);
|
||||
@@ -22,6 +22,7 @@ const SUPABASE_URL = process.env.NEXT_PUBLIC_SUPABASE_URL!;
|
||||
const SUPABASE_KEY = process.env.SUPABASE_SERVICE_ROLE_KEY || process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!;
|
||||
|
||||
if (!SUPABASE_URL || !SUPABASE_KEY) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Missing Supabase credentials in .env.local");
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -31,6 +32,7 @@ const supabase = createClient(SUPABASE_URL, SUPABASE_KEY);
|
||||
// Connect to SQLite DB (respects DB_PATH, fallback to data engine location)
|
||||
const defaultDbPath = path.resolve(process.cwd(), "packages/wwv-data-engine/data/engine.db");
|
||||
const dbPath = process.env.DB_PATH || defaultDbPath;
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Connecting to SQLite at ${dbPath}...`);
|
||||
|
||||
// Ensure DB directory exists
|
||||
@@ -63,6 +65,7 @@ const insertHistory = db.prepare(`
|
||||
`);
|
||||
|
||||
async function migrate() {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("Fetching existing aviation_history records from Supabase...");
|
||||
let offset = 0;
|
||||
const limit = 10000; // Chunk size
|
||||
@@ -75,15 +78,18 @@ async function migrate() {
|
||||
.range(offset, offset + limit - 1);
|
||||
|
||||
if (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Fetch error:", error);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (!data || data.length === 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("No more records to fetch.");
|
||||
break;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Processing ${data.length} records (Offset: ${offset})...`);
|
||||
|
||||
// Batch insert to SQLite
|
||||
@@ -109,6 +115,7 @@ async function migrate() {
|
||||
insertMany(data);
|
||||
totalInserted += data.length;
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("SQLite Insert Error:", err);
|
||||
}
|
||||
|
||||
@@ -119,6 +126,7 @@ async function migrate() {
|
||||
offset += limit;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Migration complete! Successfully injected ~${totalInserted} records into SQLite.`);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,9 @@ import { execSync } from 'child_process';
|
||||
const dbUrl = process.env.DATABASE_URL || '';
|
||||
|
||||
if (!dbUrl) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("❌ ERROR: DATABASE_URL is missing.");
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(" Did you forget to run 'pnpm run setup' to generate your .env file?");
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -11,11 +13,15 @@ if (!dbUrl) {
|
||||
const isLocal = dbUrl.includes('localhost') || dbUrl.includes('127.0.0.1') || dbUrl.includes('host.docker.internal') || dbUrl.includes('postgres:postgres@db:5432');
|
||||
|
||||
if (!isLocal) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("❌ ERROR: DATABASE_URL points to a remote database.");
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(" Running 'prisma db push --accept-data-loss' on production/staging data is forbidden.");
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(" If you truly need to migrate a remote db, run prisma db push manually.");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("🔒 Local database detected. Safely running prisma db push...");
|
||||
execSync('npx prisma db push --accept-data-loss', { stdio: 'inherit' });
|
||||
@@ -16,12 +16,15 @@ const EXAMPLE = resolve(ROOT, ".env.example");
|
||||
const TARGET = resolve(ROOT, ".env");
|
||||
|
||||
if (existsSync(TARGET)) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("✅ .env already exists — skipping setup.");
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(" Delete it and re-run if you want to regenerate.");
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (!existsSync(EXAMPLE)) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("❌ .env.example not found. Are you in the right directory?");
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -48,6 +51,9 @@ content = content
|
||||
|
||||
writeFileSync(TARGET, content, "utf8");
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("✅ .env created with a generated AUTH_SECRET.");
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(" Fill in any optional API keys (Cesium, Bing, OpenSky, etc.)");
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(" then run: npm run dev");
|
||||
@@ -68,6 +68,7 @@ export async function buildPlugin({ dir, manifest, pluginDir }) {
|
||||
const tsxEntry = devEntry.replace(".ts", ".tsx");
|
||||
entryFile = path.join(pluginDir, tsxEntry);
|
||||
if (!fs.existsSync(entryFile)) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`[sync] ⚠ No entry file found for ${dir}, skipping`);
|
||||
return false;
|
||||
}
|
||||
@@ -109,6 +110,7 @@ export async function buildPlugin({ dir, manifest, pluginDir }) {
|
||||
});
|
||||
return true;
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`[sync] ❌ Build failed for ${dir}:`, err.message);
|
||||
return false;
|
||||
}
|
||||
@@ -121,6 +123,7 @@ export function syncToPublic({ dir, manifest, pluginDir }) {
|
||||
const distMap = path.join(pluginDir, "dist", "frontend.mjs.map");
|
||||
|
||||
if (!fs.existsSync(distFile)) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`[sync] ⚠ No dist for ${dir}, skipping sync`);
|
||||
return;
|
||||
}
|
||||
@@ -151,6 +154,7 @@ export function syncToPublic({ dir, manifest, pluginDir }) {
|
||||
JSON.stringify(pluginJson, null, 2)
|
||||
);
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[sync] ✅ ${publicName} → public/plugins-local/${publicName}/`);
|
||||
}
|
||||
|
||||
@@ -161,6 +165,7 @@ function cleanStale(activeIds) {
|
||||
for (const dir of fs.readdirSync(OUTPUT_DIR)) {
|
||||
if (!activeSet.has(dir)) {
|
||||
fs.rmSync(path.join(OUTPUT_DIR, dir), { recursive: true, force: true });
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[sync] 🗑 Removed stale plugin: ${dir}`);
|
||||
}
|
||||
}
|
||||
@@ -170,11 +175,13 @@ export async function syncAll() {
|
||||
const plugins = discoverLocalPlugins();
|
||||
|
||||
if (plugins.length === 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("[sync] No local plugins found.");
|
||||
cleanStale([]);
|
||||
return;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[sync] Found ${plugins.length} local plugin(s): ${plugins.map(p => p.dir).join(", ")}`);
|
||||
|
||||
for (const plugin of plugins) {
|
||||
@@ -190,6 +197,7 @@ export async function syncAll() {
|
||||
const isDirectRun = process.argv[1] && path.resolve(process.argv[1]) === path.resolve(fileURLToPath(import.meta.url));
|
||||
if (isDirectRun) {
|
||||
syncAll().catch(err => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[sync] Fatal:", err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@@ -6,7 +6,9 @@ import net from 'node:net';
|
||||
// 1. Get branch argument
|
||||
const branchName = process.argv[2];
|
||||
if (!branchName) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('\x1b[31mError: Please provide a worktree branch name.\x1b[0m');
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Usage: pnpm run test-worktree <branch-name>');
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -33,6 +35,7 @@ try {
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('\x1b[33mWarning: Failed to parse git worktree list.\x1b[0m');
|
||||
}
|
||||
|
||||
@@ -44,41 +47,52 @@ if (!worktreePath) {
|
||||
|
||||
// 3. Validate worktree exists
|
||||
if (!fs.existsSync(worktreePath)) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`\x1b[31mError: Worktree directory not found for branch '${branchName}'\x1b[0m`);
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Searched path: ${worktreePath}`);
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Ensure you have created it using 'git worktree add <path> -b ${branchName}'`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// 3. Setup Environment
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`\x1b[34m[1/5] Checking environment in ${worktreePath}...\x1b[0m`);
|
||||
const rootEnvPath = path.join(rootDir, '.env.local');
|
||||
const worktreeEnvPath = path.join(worktreePath, '.env.local');
|
||||
|
||||
if (!fs.existsSync(worktreeEnvPath) && fs.existsSync(rootEnvPath)) {
|
||||
fs.copyFileSync(rootEnvPath, worktreeEnvPath);
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Copied .env.local from root.');
|
||||
}
|
||||
|
||||
// 4. Install Dependencies
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`\x1b[34m[2/5] Symlinking modules and generating local clients...\x1b[0m`);
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Running pnpm install in worktree...');
|
||||
execSync('pnpm install', { cwd: worktreePath, stdio: 'inherit' });
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Generating Prisma Clients (Root)...');
|
||||
execSync('npx prisma generate', { cwd: worktreePath, stdio: 'inherit' });
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Generating Prisma Clients (Data Engine)...');
|
||||
const enginePath = path.join(worktreePath, 'packages', 'wwv-data-engine');
|
||||
if (fs.existsSync(enginePath)) {
|
||||
try {
|
||||
execSync('npx prisma generate', { cwd: enginePath, stdio: 'inherit' });
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('\x1b[33m[Warning] Could not generate Data Engine Prisma client. This happens on Windows when another workspace is running and locking the shared pnpm DLL. It is safe to ignore as the client already exists in the cache.\x1b[0m');
|
||||
}
|
||||
}
|
||||
|
||||
// 5. Setup databases
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`\x1b[34m[3/5] Setting up local databases...\x1b[0m`);
|
||||
const rootDataDir = path.join(worktreePath, 'data');
|
||||
const engineDataDir = path.join(enginePath, 'data');
|
||||
@@ -108,14 +122,18 @@ function findFreePort(startPort) {
|
||||
|
||||
// 7. Start the Servers
|
||||
async function start() {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`\x1b[34m[4/5] Assigning isolated ports...\x1b[0m`);
|
||||
// Start scanning *after* the default main dev ports to absolutely ensure we don't accidentally grab them
|
||||
const frontendPort = await findFreePort(3002);
|
||||
const backendPort = await findFreePort(5002);
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Next.js Frontend Port: \x1b[32m${frontendPort}\x1b[0m`);
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Data Engine Backend Port: \x1b[32m${backendPort}\x1b[0m`);
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`\x1b[34m[4/5] Booting isolated servers...\x1b[0m`);
|
||||
|
||||
// Start Backend First
|
||||
@@ -149,9 +167,11 @@ async function start() {
|
||||
frontendProcess.stderr.on('data', (data) => process.stderr.write(`[\x1b[31mNext.js Error\x1b[0m] ${data}`));
|
||||
|
||||
// 7. Open Browser
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`\x1b[34m[5/5] Launching browser...\x1b[0m`);
|
||||
setTimeout(() => {
|
||||
const url = `http://localhost:${frontendPort}`;
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Opening \x1b[32m${url}\x1b[0m...`);
|
||||
const startCmd = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open';
|
||||
execSync(`${startCmd} ${url}`);
|
||||
@@ -164,4 +184,5 @@ async function start() {
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
start().catch(console.error);
|
||||
@@ -39,10 +39,12 @@ function handleFileChange(eventType, filename) {
|
||||
|
||||
async function runSync(filename) {
|
||||
isSyncing = true;
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`\n[watch] Change detected in local plugins (file: ${filename}). Syncing...`);
|
||||
try {
|
||||
await syncAll();
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`[watch] Sync failed:`, err);
|
||||
} finally {
|
||||
isSyncing = false;
|
||||
@@ -54,17 +56,21 @@ async function runSync(filename) {
|
||||
}
|
||||
|
||||
// Initial sync
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[watch] Starting initial sync...`);
|
||||
isSyncing = true;
|
||||
syncAll().then(() => {
|
||||
isSyncing = false;
|
||||
if (pendingSync) {
|
||||
pendingSync = false;
|
||||
// eslint-disable-next-line no-console
|
||||
runSync("pending changes").catch(console.error);
|
||||
}
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[watch] Watching ${LOCAL_PLUGINS_DIR} for changes...`);
|
||||
fs.watch(LOCAL_PLUGINS_DIR, { recursive: true }, handleFileChange);
|
||||
}).catch(err => {
|
||||
isSyncing = false;
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`[watch] Initial sync failed:`, err);
|
||||
});
|
||||
@@ -48,6 +48,8 @@ export async function GET() {
|
||||
}
|
||||
}, 25_000);
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(controller as any)._cleanup = () => {
|
||||
clearInterval(heartbeat);
|
||||
unsubscribe();
|
||||
|
||||
@@ -21,6 +21,8 @@ export async function GET(request: Request) {
|
||||
for (const [k, v] of Object.entries(headers)) res.headers.set(k, v);
|
||||
return res;
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[setup-status] Database error:", err);
|
||||
const res = NextResponse.json(
|
||||
{ error: "database_unavailable", edition },
|
||||
|
||||
@@ -13,11 +13,15 @@ export async function POST(req: Request) {
|
||||
sig!,
|
||||
process.env.STRIPE_WEBHOOK_SECRET!
|
||||
);
|
||||
} catch (err: any) {
|
||||
} // TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
catch (err: any) {
|
||||
return new NextResponse(`Webhook Error: ${err.message}`, { status: 400 });
|
||||
}
|
||||
|
||||
if (event.type === "checkout.session.completed") {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("Subscription completed!");
|
||||
// Update user tier in DB, send license key via email
|
||||
}
|
||||
|
||||
@@ -124,7 +124,9 @@ export async function fetchAdapter(adapter: CameraAdapter): Promise<CameraFeatur
|
||||
fetchedAt: new Date(now).toISOString(),
|
||||
});
|
||||
return data;
|
||||
} catch (e: any) {
|
||||
} // TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
catch (e: any) {
|
||||
const errMsg = e?.message ?? String(e);
|
||||
if (c) {
|
||||
cache.set(adapter.id, { ...c, error: errMsg });
|
||||
|
||||
@@ -15,6 +15,8 @@ function districtUrl(d: number): string {
|
||||
return `https://cwwp2.dot.ca.gov/data/d${d}/cctv/cctvStatusD${padded}.json`;
|
||||
}
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function toGeoJsonFeature(raw: any): GdotCameraFeature | null {
|
||||
const cam = raw.cctv;
|
||||
if (!cam?.location) return null;
|
||||
|
||||
@@ -42,7 +42,11 @@ export async function GET(req: NextRequest) {
|
||||
}
|
||||
|
||||
return NextResponse.json({ error: "Unsupported extractor platform" }, { status: 400 });
|
||||
} catch (error: any) {
|
||||
} // TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
catch (error: any) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[CameraExtractor] Error:", error.message);
|
||||
return NextResponse.json({ error: "Failed to extract stream" }, { status: 500 });
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ export interface GdotCameraFeature {
|
||||
}
|
||||
|
||||
/** Convert a raw ArcGIS feature into our GeoJSON format. */
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function toGeoJsonFeature(raw: any): GdotCameraFeature | null {
|
||||
const { attributes: a, geometry: g } = raw;
|
||||
if (!g?.x || !g?.y) return null;
|
||||
|
||||
@@ -82,6 +82,8 @@ export async function GET(req: NextRequest) {
|
||||
});
|
||||
} catch (error: unknown) {
|
||||
const message = error instanceof Error ? error.message : "Unknown error";
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[IframeProxy] Error:", message);
|
||||
return NextResponse.json(
|
||||
{ error: "Failed to proxy iframe" },
|
||||
|
||||
@@ -51,7 +51,11 @@ export async function GET(req: NextRequest) {
|
||||
{ status: 502 },
|
||||
);
|
||||
}
|
||||
} catch (error: any) {
|
||||
} // TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
catch (error: any) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[CameraProxy] Error fetching target URL:", error);
|
||||
const status = error.message.includes("SSRF Error") ? 403 : 500;
|
||||
return NextResponse.json(
|
||||
|
||||
@@ -62,6 +62,8 @@ export async function GET(req: NextRequest) {
|
||||
});
|
||||
} catch (error: unknown) {
|
||||
const message = error instanceof Error ? error.message : "Unknown error";
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[StreamProxy] Error:", message);
|
||||
const status = message.includes("SSRF Error") ? 403 : 502;
|
||||
return NextResponse.json(
|
||||
|
||||
@@ -81,7 +81,9 @@ export async function GET(req: NextRequest) {
|
||||
contentType: response.headers.get("content-type"),
|
||||
latencyMs: Date.now() - startTime
|
||||
});
|
||||
} catch (error: any) {
|
||||
} // TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
catch (error: any) {
|
||||
const realError = error.cause || error;
|
||||
const code = realError?.code || error?.code || realError?.name || error?.name;
|
||||
|
||||
|
||||
@@ -11,12 +11,18 @@ import type { GdotCameraFeature } from "../gdot/gdotFetcher";
|
||||
const TFL_URL = "https://api.tfl.gov.uk/Place/Type/JamCam";
|
||||
|
||||
/** Extract a named property from TfL additionalProperties array. */
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function getProp(props: any[], key: string): string {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const found = props?.find((p: any) => p.key === key);
|
||||
return found?.value || "";
|
||||
}
|
||||
|
||||
/** Convert a raw TfL JamCam place into our GeoJSON format. */
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function toGeoJsonFeature(raw: any): GdotCameraFeature | null {
|
||||
if (!raw.lat || !raw.lon) return null;
|
||||
|
||||
|
||||
@@ -31,7 +31,11 @@ export async function GET(req: NextRequest) {
|
||||
total: cameras.length,
|
||||
sources,
|
||||
});
|
||||
} catch (error: any) {
|
||||
} // TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
catch (error: any) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[TrafficCameras] Error:", error);
|
||||
return NextResponse.json(
|
||||
{ error: "Failed to fetch traffic cameras" },
|
||||
|
||||
@@ -76,6 +76,8 @@ export async function fetchWsdotCameras(): Promise<GdotCameraFeature[]> {
|
||||
const key = process.env.WSDOT_API_KEY;
|
||||
if (!key) {
|
||||
if (!warnedMissingKey) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
"[WSDOT] WSDOT_API_KEY not set — skipping. "
|
||||
+ "Get a free key at https://wsdot.wa.gov/traffic/api/",
|
||||
|
||||
@@ -50,6 +50,8 @@ export async function POST(request: Request) {
|
||||
{ status: 200, headers: { "Access-Control-Allow-Origin": "*" } }
|
||||
);
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[Load Unpacked] Error:", err);
|
||||
return NextResponse.json(
|
||||
{ error: "Failed to parse or load unpacked manifest" },
|
||||
|
||||
@@ -4,6 +4,8 @@ export const revalidate = 120;
|
||||
|
||||
const FEED_URL = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.geojson";
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function isValidFeature(feature: any): boolean {
|
||||
const coordinates = feature?.geometry?.coordinates;
|
||||
const time = feature?.properties?.time;
|
||||
@@ -44,6 +46,8 @@ export async function GET() {
|
||||
features,
|
||||
});
|
||||
} catch (error) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[EarthquakeRoute] Error:", error);
|
||||
return NextResponse.json(
|
||||
{ error: "Failed to fetch earthquake feed" },
|
||||
|
||||
@@ -24,12 +24,18 @@ export async function POST(req: NextRequest) {
|
||||
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text();
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("GlitchTip tunnel rejected payload:", response.status, errorText);
|
||||
return NextResponse.json({ status: "error", message: "GlitchTip rejected payload" }, { status: response.status });
|
||||
}
|
||||
|
||||
return NextResponse.json({ status: "ok" });
|
||||
} catch (error: any) {
|
||||
} // TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
catch (error: any) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("GlitchTip tunnel internal error:", error);
|
||||
return NextResponse.json({ status: "error", message: "Tunnel relay failed" }, { status: 500 });
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ export async function GET(
|
||||
|
||||
return NextResponse.json(workspace);
|
||||
} catch (e) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Failed to lookup workspace", e);
|
||||
return NextResponse.json({ error: "Internal server error" }, { status: 500 });
|
||||
}
|
||||
|
||||
@@ -62,6 +62,8 @@ export async function POST(request: Request) {
|
||||
return NextResponse.json({ error: `Unknown service: ${service}` }, { status: 400 });
|
||||
}
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[KeyVerify] Unexpected error:", err);
|
||||
return NextResponse.json({ error: "Verification request failed" }, { status: 500 });
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ export async function GET(req: NextRequest) {
|
||||
|
||||
try {
|
||||
const tokens = await client.authorizationCodeGrant(
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
config as any,
|
||||
new URL(req.url),
|
||||
{ expectedState: stateCookie, pkceCodeVerifier: verifierCookie }
|
||||
@@ -54,7 +56,11 @@ export async function GET(req: NextRequest) {
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (err: any) {
|
||||
} // TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
catch (err: any) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[PKCE] Exchange failed:", err.message);
|
||||
return NextResponse.json({ error: "Failed to exchange authorization code" }, { status: 500 });
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ export async function GET(request: Request) {
|
||||
const installedPlugins = await getInstalledPlugins();
|
||||
|
||||
// Exclude built-in versions, only check genuine semver strings or unverified records.
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const updatablePlugins = installedPlugins.filter((p: any) => p.version !== "built-in");
|
||||
|
||||
if (updatablePlugins.length === 0) {
|
||||
@@ -51,6 +53,8 @@ export async function GET(request: Request) {
|
||||
|
||||
return NextResponse.json({ updates });
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[marketplace/check-updates] Error:", err);
|
||||
return NextResponse.json(
|
||||
{ error: "Failed to check for updates" },
|
||||
|
||||
@@ -38,6 +38,8 @@ export async function POST(request: Request) {
|
||||
await disablePlugin(pluginId);
|
||||
return withCors(NextResponse.json({ status: "disabled", pluginId }), request);
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[marketplace/disable] Error:", err);
|
||||
return withCors(
|
||||
NextResponse.json({ error: "Disable failed" }, { status: 500 }),
|
||||
|
||||
@@ -24,6 +24,8 @@ export async function GET(request: Request) {
|
||||
request,
|
||||
);
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[marketplace/disabled-builtins] Error:", err);
|
||||
return withCors(
|
||||
NextResponse.json({ disabledIds: [] }),
|
||||
|
||||
@@ -38,6 +38,8 @@ export async function POST(request: Request) {
|
||||
await enablePlugin(pluginId);
|
||||
return withCors(NextResponse.json({ status: "enabled", pluginId }), request);
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[marketplace/enable] Error:", err);
|
||||
return withCors(
|
||||
NextResponse.json({ error: "Enable failed" }, { status: 500 }),
|
||||
|
||||
@@ -73,6 +73,8 @@ export async function GET(request: NextRequest) {
|
||||
// Token in fragment — never sent to server in logs/referer
|
||||
return NextResponse.redirect(`${dest.toString()}#token=${token}`);
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[grant-token] Unexpected error:", err);
|
||||
return NextResponse.json({ error: "Internal server error" }, { status: 500 });
|
||||
}
|
||||
|
||||
@@ -104,6 +104,8 @@ export async function GET(request: NextRequest) {
|
||||
try {
|
||||
await upsertPlugin(pluginId, version, JSON.stringify(manifest));
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[install-redirect] upsertPlugin failed:", err);
|
||||
if (isSafeRedirect(redirectTo)) {
|
||||
const errorUrl = new URL(redirectTo);
|
||||
@@ -128,6 +130,8 @@ export async function GET(request: NextRequest) {
|
||||
return NextResponse.redirect(`${successUrl.toString()}#token=${token}`);
|
||||
} catch (err) {
|
||||
// Top-level catch: log and redirect to marketplace with error, don't expose raw 500
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[install-redirect] Unexpected error:", err);
|
||||
if (isSafeRedirect(redirectTo)) {
|
||||
const errorUrl = new URL(redirectTo);
|
||||
|
||||
@@ -30,6 +30,8 @@ export async function POST(request: Request) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const { pluginId, version, manifest } = body;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[Marketplace Install Route] Installing plugin: ${pluginId} v${version || "1.0.0"}`);
|
||||
|
||||
if (!pluginId || typeof pluginId !== "string") {
|
||||
@@ -62,6 +64,8 @@ export async function POST(request: Request) {
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`[Marketplace Install Route] Failed to fetch manifest for ${pluginId}`, e);
|
||||
}
|
||||
}
|
||||
@@ -70,6 +74,8 @@ export async function POST(request: Request) {
|
||||
if (finalManifest) {
|
||||
const validation = validateManifest(finalManifest);
|
||||
if (!validation.valid) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(
|
||||
`[Marketplace Install Route] ❌ MANIFEST VALIDATION FAILED for ${pluginId}\n`
|
||||
+ `Errors: ${validation.errors.join(", ")}\n`
|
||||
@@ -86,6 +92,8 @@ export async function POST(request: Request) {
|
||||
} else {
|
||||
// We cannot proceed safely if we don't have a manifest and it's missing from DB.
|
||||
// If we do have an existing db record, we could technically merge, but we'll enforce manifest req here.
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`[Marketplace Install] No manifest provided or found for ${pluginId}`);
|
||||
}
|
||||
|
||||
@@ -109,6 +117,8 @@ export async function POST(request: Request) {
|
||||
request,
|
||||
);
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[Bridge/install] Error:", err);
|
||||
return withCors(
|
||||
NextResponse.json(
|
||||
|
||||
@@ -42,6 +42,8 @@ export async function GET(request: Request) {
|
||||
]);
|
||||
|
||||
// Support local sandbox workflows by checking /public/plugins-local
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const localPlugins: any[] = [];
|
||||
try {
|
||||
if (process.env.NODE_ENV === "development" || process.env.WWV_PLUGIN_DEV === "true") {
|
||||
@@ -54,6 +56,8 @@ export async function GET(request: Request) {
|
||||
const config = fs.readFileSync(manifestPath, "utf-8");
|
||||
localPlugins.push({ pluginId: folder, config });
|
||||
} catch (e) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Error reading local plugin ${folder}:`, e);
|
||||
}
|
||||
}
|
||||
@@ -61,13 +65,17 @@ export async function GET(request: Request) {
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Error scanning local plugins directory:", e);
|
||||
}
|
||||
|
||||
const allRecords = [...records, ...localPlugins];
|
||||
|
||||
const manifests = allRecords
|
||||
.map((r: any): PluginManifest | null => {
|
||||
.// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
map((r: any): PluginManifest | null => {
|
||||
try {
|
||||
const manifest = JSON.parse(r.config);
|
||||
if (!manifest.id) manifest.id = r.pluginId;
|
||||
@@ -77,7 +85,9 @@ export async function GET(request: Request) {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter((m: any): m is PluginManifest => {
|
||||
.// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
filter((m: any): m is PluginManifest => {
|
||||
if (!m) return false;
|
||||
// Skip built-in plugins — already registered by AppShell
|
||||
if (m.trust === "built-in") return false;
|
||||
@@ -100,6 +110,8 @@ export async function GET(request: Request) {
|
||||
const validation = validateManifest(m);
|
||||
if (!validation.valid) {
|
||||
const errorMessage = `Manifest validation failed for ${m.id}`;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`[Marketplace API] ${errorMessage}:`, validation.errors);
|
||||
|
||||
// Capture in Sentry so we have visibility into malformed third-party plugins
|
||||
@@ -114,7 +126,9 @@ export async function GET(request: Request) {
|
||||
}
|
||||
return validation.valid;
|
||||
})
|
||||
.map((m: any) => {
|
||||
.// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
map((m: any) => {
|
||||
// Re-stamp trust against the live registry so revoked plugins
|
||||
// are correctly gated by the unverified dialog on the client.
|
||||
if (m.trust !== "built-in") {
|
||||
@@ -140,6 +154,8 @@ export async function GET(request: Request) {
|
||||
|
||||
return withCors(NextResponse.json({ manifests }), request);
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[Marketplace/load] Error:", err);
|
||||
return withCors(NextResponse.json({ manifests: [] }), request);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ export async function POST(request: Request) {
|
||||
|
||||
return NextResponse.json({ status: "sideloaded", manifest });
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[Sideload] Error:", err);
|
||||
return NextResponse.json(
|
||||
{ error: "Sideload failed" },
|
||||
|
||||
@@ -25,6 +25,8 @@ export async function GET(request: Request) {
|
||||
|
||||
try {
|
||||
const dbPlugins = await getInstalledPlugins();
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const dbMap = new Map(dbPlugins.map((p: any) => [p.pluginId, p]));
|
||||
|
||||
// Collect all DB plugins (enabled and disabled)
|
||||
@@ -38,6 +40,8 @@ export async function GET(request: Request) {
|
||||
|
||||
return withCors(NextResponse.json({ plugins, canManagePlugins }), request);
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[marketplace/status] Error:", err);
|
||||
let canManagePlugins = !isDemo;
|
||||
if (isDemo) {
|
||||
|
||||
@@ -50,6 +50,8 @@ export async function POST(request: Request) {
|
||||
|
||||
return withCors(NextResponse.json({ status: "uninstalled", pluginId }), request);
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[marketplace/uninstall] Error:", err);
|
||||
return withCors(
|
||||
NextResponse.json({ error: "Uninstall failed" }, { status: 500 }),
|
||||
|
||||
@@ -17,6 +17,8 @@ export async function GET(request: Request) {
|
||||
const isValidUserKey = userKey && userKey.length >= 20;
|
||||
const apiKey = isValidUserKey ? userKey : process.env.GOOGLE_MAPS_API_KEY;
|
||||
if (!apiKey) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("GOOGLE_MAPS_API_KEY is not defined and no user key provided");
|
||||
return NextResponse.json({ error: "Server configuration error" }, { status: 500 });
|
||||
}
|
||||
@@ -38,6 +40,8 @@ export async function GET(request: Request) {
|
||||
const data = await response.json();
|
||||
|
||||
if (data.status !== "OK") {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Google Places Details API Error:", data);
|
||||
return NextResponse.json({ error: "Failed to fetch place details" }, { status: 500 });
|
||||
}
|
||||
@@ -57,6 +61,8 @@ export async function GET(request: Request) {
|
||||
cache.set(cacheId, { data: result, expiresAt: Date.now() + TTL_MS });
|
||||
return NextResponse.json(result);
|
||||
} catch (error) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Error in Places Details route:", error);
|
||||
return NextResponse.json({ error: "Internal server error" }, { status: 500 });
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ export async function GET(request: Request) {
|
||||
const isValidUserKey = userKey && userKey.length >= 20;
|
||||
const apiKey = isValidUserKey ? userKey : process.env.GOOGLE_MAPS_API_KEY;
|
||||
if (!apiKey) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("GOOGLE_MAPS_API_KEY is not defined and no user key provided");
|
||||
return NextResponse.json({ error: "Server configuration error" }, { status: 500 });
|
||||
}
|
||||
@@ -39,10 +41,14 @@ export async function GET(request: Request) {
|
||||
const data = await response.json();
|
||||
|
||||
if (data.status !== "OK" && data.status !== "ZERO_RESULTS") {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Google Places API Error:", data);
|
||||
return NextResponse.json({ error: "Failed to fetch predictions" }, { status: 500 });
|
||||
}
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const predictions = data.predictions.map((p: any) => ({
|
||||
description: p.description,
|
||||
placeId: p.place_id,
|
||||
@@ -55,6 +61,8 @@ export async function GET(request: Request) {
|
||||
cache.set(cacheKey, { data: result, expiresAt: Date.now() + TTL_MS });
|
||||
return NextResponse.json(result);
|
||||
} catch (error) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Error in Places Autocomplete route:", error);
|
||||
return NextResponse.json({ error: "Internal server error" }, { status: 500 });
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ const OVERPASS_MIRRORS = [
|
||||
];
|
||||
|
||||
async function tryMirror(urlStr: string, query: string, timeoutMs: number) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return new Promise<any>((resolve, reject) => {
|
||||
const url = new URL(urlStr);
|
||||
const bodyStr = `data=${encodeURIComponent(query)}`;
|
||||
@@ -56,11 +58,15 @@ export async function POST(req: Request) {
|
||||
return NextResponse.json({ error: "Missing query" }, { status: 400 });
|
||||
}
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[OSMSearchProxy] Querying Overpass API mirrors... (length: ${query.length})`);
|
||||
|
||||
let lastError = null;
|
||||
for (const mirror of OVERPASS_MIRRORS) {
|
||||
try {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[OSMSearchProxy] Trying mirror: ${mirror}`);
|
||||
const res = await tryMirror(mirror, query, 25000); // 25s per mirror
|
||||
|
||||
@@ -70,12 +76,16 @@ export async function POST(req: Request) {
|
||||
return NextResponse.json({ data: data.elements });
|
||||
}
|
||||
if (data.remark) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`[OSMSearchProxy] ${mirror} returned remark: ${data.remark}`);
|
||||
// If it's a specific query error (remark), don't bother retrying mirrors
|
||||
return NextResponse.json({ error: data.remark }, { status: 400 });
|
||||
}
|
||||
} else {
|
||||
const text = await res.text();
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`[OSMSearchProxy] Mirror ${mirror} failed: ${res.status} ${res.statusText}`);
|
||||
lastError = { status: res.status, statusText: res.statusText, details: text };
|
||||
// If it's a 4xx error (except 429), it's probably a bad query, so don't retry
|
||||
@@ -83,10 +93,20 @@ export async function POST(req: Request) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (err: any) {
|
||||
} // TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
catch (err: any) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`[OSMSearchProxy] Mirror ${mirror} threw error:`);
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(err);
|
||||
if (err instanceof Error) console.warn(err.stack);
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
if (err instanceof Error)
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(err.stack);
|
||||
lastError = { status: 500, statusText: "Internal Error", details: String(err && err.message ? err.message : err) };
|
||||
}
|
||||
}
|
||||
@@ -95,7 +115,11 @@ export async function POST(req: Request) {
|
||||
{ error: "All Overpass mirrors failed or timed out. The OSM servers are likely under heavy load." },
|
||||
{ status: 504 }
|
||||
);
|
||||
} catch (e: any) {
|
||||
} // TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
catch (e: any) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`[OSMSearchProxy] Internal error:`, e);
|
||||
return NextResponse.json({ error: "Internal server error" }, { status: 500 });
|
||||
}
|
||||
|
||||
@@ -20,7 +20,11 @@ export async function GET() {
|
||||
|
||||
const data = await response.json();
|
||||
return NextResponse.json(data);
|
||||
} catch (error: any) {
|
||||
} // TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
catch (error: any) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[UnderseaCablesProxy] Error:", error);
|
||||
return NextResponse.json(
|
||||
{ error: "Failed to proxy request" },
|
||||
|
||||
@@ -16,6 +16,8 @@ export async function GET(request: Request) {
|
||||
|
||||
return NextResponse.json(favorites);
|
||||
} catch (e) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("GET Favorites Error:", e);
|
||||
return NextResponse.json({ error: "Failed to fetch favorites" }, { status: 500 });
|
||||
}
|
||||
@@ -58,6 +60,8 @@ export async function POST(request: Request) {
|
||||
|
||||
return NextResponse.json(fav);
|
||||
} catch (e) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("POST Favorites Error:", e);
|
||||
return NextResponse.json({ error: "Failed to create favorite" }, { status: 500 });
|
||||
}
|
||||
@@ -88,6 +92,8 @@ export async function DELETE(request: Request) {
|
||||
|
||||
return NextResponse.json({ success: true });
|
||||
} catch (e) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("DELETE Favorites Error:", e);
|
||||
return NextResponse.json({ error: "Failed to delete favorite" }, { status: 500 });
|
||||
}
|
||||
|
||||
@@ -15,12 +15,16 @@ export function useCameraTestRunner(testSources: string[], testStatuses: string[
|
||||
const res = await fetch("/api/camera/traffic");
|
||||
const data = await res.json();
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let staticFeatures: any[] = [];
|
||||
try {
|
||||
const staticRes = await fetch("/public-cameras.json");
|
||||
if (staticRes.ok) {
|
||||
const staticData = await staticRes.json();
|
||||
if (staticData.features) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
staticFeatures = staticData.features.map((f: any) => ({
|
||||
...f,
|
||||
properties: {
|
||||
@@ -32,20 +36,28 @@ export function useCameraTestRunner(testSources: string[], testStatuses: string[
|
||||
}
|
||||
}
|
||||
} catch (staticErr) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Failed to fetch static cameras:", staticErr);
|
||||
}
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let combinedFeatures: any[] = [];
|
||||
if (data.cameras) {
|
||||
combinedFeatures = [...data.cameras];
|
||||
}
|
||||
combinedFeatures = [...combinedFeatures, ...staticFeatures];
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
setCameras(combinedFeatures.map((c: any) => ({
|
||||
feature: c,
|
||||
status: "pending"
|
||||
})));
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(err);
|
||||
}
|
||||
setLoading(false);
|
||||
|
||||
@@ -47,6 +47,8 @@ export function AdUnit({
|
||||
(window.adsbygoogle = window.adsbygoogle || []).push({});
|
||||
pushed.current = true;
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[AdUnit] AdSense push error:", err);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,6 +102,8 @@ export function FeedbackDialog() {
|
||||
|
||||
stream.getTracks().forEach((t) => t.stop());
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Screen capture failed or was cancelled:", err);
|
||||
} finally {
|
||||
setTakingScreenshot(false);
|
||||
@@ -153,6 +155,8 @@ export function FeedbackDialog() {
|
||||
setScreenshots([]);
|
||||
setFeedbackDialogOpen(false);
|
||||
} catch (error) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Failed to submit feedback:", error);
|
||||
showErrorToast("Failed to submit feedback. Please try again later.");
|
||||
} finally {
|
||||
|
||||
@@ -43,6 +43,8 @@ export class PluginErrorBoundary extends Component<Props, State> {
|
||||
}
|
||||
|
||||
public componentDidCatch(error: Error, errorInfo: ErrorInfo) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`[PluginErrorBoundary] Plugin component '${this.props.pluginId}' crashed during render and was isolated:`, error);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,12 +115,16 @@ export function AgentBusSubscriber() {
|
||||
const msg = JSON.parse(event.data) as AgentMessage;
|
||||
applyAction(msg);
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn("[AgentBus] malformed message", err);
|
||||
}
|
||||
};
|
||||
es.onerror = (err) => {
|
||||
// EventSource auto-reconnects on its own with the `retry:` value
|
||||
// we send from the server. Just log; don't tear down.
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.debug("[AgentBus] stream error (auto-reconnecting)", err);
|
||||
};
|
||||
|
||||
|
||||
@@ -62,6 +62,8 @@ export function AppShell() {
|
||||
const initLayer = useStore((s) => s.initLayer);
|
||||
const boot = useBootSequence();
|
||||
const isMobile = useIsMobile();
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line react-hooks/purity
|
||||
const bootStartRef = useRef(Date.now());
|
||||
const [hostReady, setHostReady] = useState(false);
|
||||
const {
|
||||
@@ -82,6 +84,8 @@ export function AppShell() {
|
||||
useEffect(() => {
|
||||
const startPlatform = async () => {
|
||||
initLogCatcher();
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("[AppShell] Initializing Platform...");
|
||||
|
||||
// Inject host libraries for dynamic plugin loading
|
||||
@@ -126,11 +130,15 @@ export function AppShell() {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("[AppShell] Platform Ready. Waiting for globe tiles...");
|
||||
};
|
||||
|
||||
// Start boot sequence when globe tiles are loaded
|
||||
const unsubGlobe = dataBus.on("globeReady", () => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("[AppShell] Globe ready — starting boot sequence.");
|
||||
boot.startBoot();
|
||||
});
|
||||
|
||||
@@ -28,6 +28,7 @@ export function BottomPanelManager() {
|
||||
|
||||
useEffect(() => {
|
||||
if (activeBottomPanel) {
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
setMountedPanel(activeBottomPanel);
|
||||
} else {
|
||||
// Keep the panel mounted for the duration of the CSS exit transition (400ms)
|
||||
|
||||
@@ -57,13 +57,21 @@ export function DataBusSubscriber() {
|
||||
|
||||
const unsubToggle = dataBus.on("layerToggled", ({ pluginId, enabled }) => {
|
||||
const t0 = performance.now();
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.debug(`[DataBusSubscriber] layerToggled event received for ${pluginId}, enabled: ${enabled}`);
|
||||
const engineUrl = resolveEngineUrl(pluginId);
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.debug(`[DataBusSubscriber] Resolved engine URL for ${pluginId} to ${engineUrl}. Took ${(performance.now() - t0).toFixed(2)}ms`);
|
||||
if (enabled) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.debug(`[DataBusSubscriber] Calling wsClient.subscribe(${pluginId}, ${engineUrl})`);
|
||||
wsClient.subscribe(pluginId, engineUrl);
|
||||
} else {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.debug(`[DataBusSubscriber] Calling wsClient.unsubscribe(${pluginId}, ${engineUrl})`);
|
||||
wsClient.unsubscribe(pluginId, engineUrl);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ export function DevModeSubscriber() {
|
||||
ws = new WebSocket("ws://localhost:24601/__wwv_dev__");
|
||||
|
||||
ws.onopen = () => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("[DevMode] Connected to WWV Dev Server 🔧");
|
||||
setConnected(true);
|
||||
};
|
||||
@@ -42,11 +44,15 @@ export function DevModeSubscriber() {
|
||||
const data = JSON.parse(event.data);
|
||||
|
||||
if (data.type === "plugin:added") {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[DevMode] Plugin added from CLI: ${data.manifest.id}`);
|
||||
await pluginManager.loadFromManifest(data.manifest);
|
||||
initLayer(data.manifest.id, true);
|
||||
await pluginManager.enablePlugin(data.manifest.id);
|
||||
} else if (data.type === "plugin:updated") {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[DevMode] Reloading plugin: ${data.pluginId}`);
|
||||
// Destroy and re-load from manifest for dev hot-reload
|
||||
pluginManager.disablePlugin(data.pluginId);
|
||||
@@ -56,16 +62,22 @@ export function DevModeSubscriber() {
|
||||
await pluginManager.enablePlugin(data.manifest.id);
|
||||
}
|
||||
} else if (data.type === "plugin:error") {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`[DevMode] Dev Server Build Error: ${data.error}`);
|
||||
useStore.getState().showErrorToast?.(`Build Error in ${data.pluginId}: ${data.error}`);
|
||||
}
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[DevMode] Error handling message:", err);
|
||||
}
|
||||
};
|
||||
|
||||
ws.onclose = () => {
|
||||
if (connected) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("[DevMode] Disconnected from WWV Dev Server.");
|
||||
setConnected(false);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@ export async function searchLocations(query: string): Promise<SearchSection | nu
|
||||
maxScore: results[0].score,
|
||||
};
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Error fetching places:", err);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,8 @@ export function useSearch() {
|
||||
|
||||
useEffect(() => {
|
||||
if (!query.trim()) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
setLiveSections((prev) => (prev.length === 0 ? prev : []));
|
||||
setSelectedIndex((prev) => (prev === 0 ? prev : 0));
|
||||
return;
|
||||
@@ -103,6 +105,8 @@ export function useSearch() {
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("Error fetching place details:", err);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,6 +160,8 @@ export function PluginsTab() {
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
loadPlugins();
|
||||
}, [loadPlugins]);
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ export function Timeline() {
|
||||
const [isDemoAdmin, setIsDemoAdmin] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
setMounted(true);
|
||||
if (!isDemo) return;
|
||||
fetch("/api/auth/session")
|
||||
|
||||
@@ -29,6 +29,8 @@ export default function ReloadToast({ message }: ReloadToastProps) {
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
setMounted(true);
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -85,6 +85,8 @@ export const CameraStream: React.FC<CameraStreamProps> = ({
|
||||
const handlePopOut = (e: React.MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
addFloatingStream({
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line react-hooks/purity
|
||||
id: id || `stream-${Math.random().toString(36).substr(2, 9)}`,
|
||||
streamUrl: activeStreamUrl,
|
||||
isIframe,
|
||||
|
||||
@@ -27,6 +27,8 @@ interface HlsPlayerProps {
|
||||
*/
|
||||
export const HlsPlayer: React.FC<HlsPlayerProps> = ({ src, onReady, onError }) => {
|
||||
const videoRef = useRef<HTMLVideoElement>(null);
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const hlsRef = useRef<any>(null);
|
||||
|
||||
const cleanup = useCallback(() => {
|
||||
@@ -79,6 +81,8 @@ export const HlsPlayer: React.FC<HlsPlayerProps> = ({ src, onReady, onError }) =
|
||||
});
|
||||
});
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
hls.on(Hls.Events.ERROR, (_: any, data: any) => {
|
||||
if (data.fatal) {
|
||||
const detail = data.details || "unknown error";
|
||||
|
||||
@@ -31,6 +31,8 @@ class CacheLayer {
|
||||
resolve();
|
||||
};
|
||||
request.onerror = () => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn("[CacheLayer] IndexedDB unavailable, using memory only");
|
||||
resolve();
|
||||
};
|
||||
|
||||
@@ -29,6 +29,8 @@ class DataBus {
|
||||
try {
|
||||
handler(data);
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`[DataBus] Error in handler for "${event}":`, err);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -17,10 +17,14 @@ describe("EngineManifest", () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
resetManifestCache();
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
global.fetch = vi.fn() as any;
|
||||
});
|
||||
|
||||
it("should fetch manifest from local engine and cache it", async () => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(global.fetch as any).mockResolvedValue({
|
||||
ok: true,
|
||||
json: async () => ({ plugins: ["plugin-a", "plugin-b"] }),
|
||||
@@ -37,6 +41,8 @@ describe("EngineManifest", () => {
|
||||
});
|
||||
|
||||
it("should return null and cache failure if local engine is missing", async () => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(global.fetch as any).mockRejectedValue(new Error("Connection refused"));
|
||||
|
||||
const plugins = await fetchLocalEngineManifest();
|
||||
@@ -56,6 +62,8 @@ describe("resolveEngineUrl", () => {
|
||||
|
||||
it("should prioritize local engine if plugin is found there", async () => {
|
||||
// Setup local manifest
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(global.fetch as any).mockResolvedValue({
|
||||
ok: true,
|
||||
json: async () => ({ plugins: ["plugin-local"] }),
|
||||
@@ -67,6 +75,8 @@ describe("resolveEngineUrl", () => {
|
||||
});
|
||||
|
||||
it("should fall back to plugin's custom streamUrl if not local", () => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(pluginManager.getPlugin as any).mockReturnValue({
|
||||
plugin: {
|
||||
getServerConfig: () => ({ streamUrl: "ws://custom-engine/stream" })
|
||||
@@ -78,7 +88,11 @@ describe("resolveEngineUrl", () => {
|
||||
});
|
||||
|
||||
it("should fall back to manifest streamUrl if provided", () => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(pluginManager.getPlugin as any).mockReturnValue(undefined);
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(pluginManager.getManifest as any).mockReturnValue({
|
||||
dataSource: { streamUrl: "ws://manifest-engine/stream" }
|
||||
});
|
||||
@@ -88,7 +102,11 @@ describe("resolveEngineUrl", () => {
|
||||
});
|
||||
|
||||
it("should use default cloud engine as last resort", () => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(pluginManager.getPlugin as any).mockReturnValue(undefined);
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(pluginManager.getManifest as any).mockReturnValue(undefined);
|
||||
|
||||
const url = resolveEngineUrl("unknown-plugin");
|
||||
|
||||
@@ -29,6 +29,8 @@ class PollingManager {
|
||||
this.tasks.forEach((task, pluginId) => {
|
||||
const newInterval = state.dataConfig.pollingIntervals[pluginId];
|
||||
if (newInterval && newInterval !== task.intervalMs) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[PollingManager] Updating interval for ${pluginId} to ${newInterval}ms`);
|
||||
task.intervalMs = newInterval;
|
||||
// If already running, restart with new interval
|
||||
@@ -69,6 +71,8 @@ class PollingManager {
|
||||
task.errorCount = 0;
|
||||
} catch (err) {
|
||||
task.errorCount++;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
`[PollingManager] Error in ${pluginId} (attempt ${task.errorCount}):`,
|
||||
err
|
||||
@@ -83,6 +87,8 @@ class PollingManager {
|
||||
task.timerId = setInterval(run, effectiveInterval);
|
||||
} else {
|
||||
// For WebSocket-driven push plugins, mark as started
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
task.timerId = "ws-push-only" as any;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ export class SmartFetcher {
|
||||
* 1. Direct fetch (Browser GET)
|
||||
* 2. Local Server Proxy (Last resort, handles CORS or large payloads)
|
||||
*/
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
static async fetchJson(url: string): Promise<any> {
|
||||
// Step 1: Try Direct Fetch (Fastest)
|
||||
try {
|
||||
@@ -37,6 +39,8 @@ export class SmartFetcher {
|
||||
return await localRes.json();
|
||||
}
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private static async parseResponse(res: Response): Promise<any> {
|
||||
// Read as text to support both direct JSON HTTP responses and file download streams
|
||||
const text = await res.text();
|
||||
|
||||
@@ -30,6 +30,8 @@ vi.mock("../state/store", () => ({
|
||||
}));
|
||||
|
||||
describe("WsClient", () => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let mockWs: any;
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -52,6 +54,8 @@ describe("WsClient", () => {
|
||||
});
|
||||
|
||||
// Clear singleton state
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(wsClient as any).engines.clear();
|
||||
});
|
||||
|
||||
@@ -131,8 +135,12 @@ describe("WsClient", () => {
|
||||
|
||||
it("should use plugin's custom mapWebsocketPayload if available", () => {
|
||||
const mockPlugin = {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
mapWebsocketPayload: vi.fn((payload) => payload.map((e: any) => ({ ...e, custom: true })))
|
||||
};
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(pluginManager.getPlugin as any).mockReturnValue({ plugin: mockPlugin });
|
||||
|
||||
wsClient.subscribe("plugin-custom", "ws://engine-1/stream");
|
||||
|
||||
@@ -42,6 +42,8 @@ class WebSocketClient {
|
||||
engine.ws = new WebSocket(engineUrl);
|
||||
|
||||
engine.ws.onopen = () => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.debug(`[WSClient] 🟢 Connected to ${engineUrl}. WS Handshake took ${(performance.now() - wsStart).toFixed(2)}ms`);
|
||||
// Resubscribe to all active plugins on this engine
|
||||
for (const pluginId of engine.subscriptions) {
|
||||
@@ -52,11 +54,15 @@ class WebSocketClient {
|
||||
engine.ws.onmessage = (event) => {
|
||||
try {
|
||||
const msgTime = performance.now();
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.debug(`[WSClient] 📥 Received raw message at +${(msgTime - wsStart).toFixed(2)}ms from start:`, event.data.substring(0, 150) + (event.data.length > 150 ? '...' : ''));
|
||||
const data = JSON.parse(event.data);
|
||||
|
||||
// Handle welcome message (informational, no action needed)
|
||||
if (data.type === "welcome") {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.debug(`[WSClient] 👋 Engine ${engineUrl} serves: ${data.plugins?.join(", ")}`);
|
||||
return;
|
||||
}
|
||||
@@ -65,15 +71,21 @@ class WebSocketClient {
|
||||
this.handleDataMessage(data as WsStreamPayload);
|
||||
}
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("[WSClient] Error parsing message:", err);
|
||||
}
|
||||
};
|
||||
|
||||
engine.ws.onerror = () => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`[WSClient] Connection to ${engineUrl} failed. Retrying in background...`);
|
||||
};
|
||||
|
||||
engine.ws.onclose = () => {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`[WSClient] Disconnected from ${engineUrl}. Reconnecting in 5s...`);
|
||||
engine.ws = null;
|
||||
if (engine.reconnectTimer) clearTimeout(engine.reconnectTimer);
|
||||
@@ -89,9 +101,15 @@ class WebSocketClient {
|
||||
let finalEntities = data.payload as GeoEntity[];
|
||||
const existingEntities = useStore.getState().entitiesByPlugin[data.pluginId!] || [];
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
if (plugin && typeof (plugin as any).mapWebsocketPayload === "function") {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
finalEntities = (plugin as any).mapWebsocketPayload(data.payload, existingEntities);
|
||||
} else if (!Array.isArray(data.payload)) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`[WsClient] Payload for ${data.pluginId} is an object but no mapWebsocketPayload exists. Ignoring.`);
|
||||
return;
|
||||
} else {
|
||||
@@ -101,6 +119,8 @@ class WebSocketClient {
|
||||
}));
|
||||
}
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.debug(`[WSClient] 🔄 Dispatching ${finalEntities.length} entities for ${data.pluginId} to DataBus`);
|
||||
|
||||
dataBus.emit("dataUpdated", {
|
||||
@@ -109,6 +129,8 @@ class WebSocketClient {
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private send(engine: EngineConnection, msg: any) {
|
||||
if (engine.ws && engine.ws.readyState === WebSocket.OPEN) {
|
||||
engine.ws.send(JSON.stringify(msg));
|
||||
@@ -116,6 +138,8 @@ class WebSocketClient {
|
||||
}
|
||||
|
||||
public subscribe(pluginId: string, engineUrl: string) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.debug(`[WSClient] 📡 Subscribing to ${pluginId} at ${engineUrl}`);
|
||||
const engine = this.getOrCreateEngine(engineUrl);
|
||||
|
||||
@@ -141,6 +165,8 @@ class WebSocketClient {
|
||||
if (engine.subscriptions.size === 0) {
|
||||
engine.cleanupTimer = setTimeout(() => {
|
||||
if (engine.subscriptions.size === 0) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`[WSClient] No subscriptions remain for ${engineUrl}. Closing connection.`);
|
||||
if (engine.reconnectTimer) clearTimeout(engine.reconnectTimer);
|
||||
engine.ws?.close();
|
||||
@@ -151,6 +177,8 @@ class WebSocketClient {
|
||||
}
|
||||
|
||||
public printConnections() {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const table: any[] = [];
|
||||
this.engines.forEach((engine, url) => {
|
||||
table.push({
|
||||
@@ -159,8 +187,14 @@ class WebSocketClient {
|
||||
'Plugins Subscribed': Array.from(engine.subscriptions).join(", ") || "(None)",
|
||||
});
|
||||
});
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.groupCollapsed("[WSClient] Active Engine Connections Matrix");
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.table(table);
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.groupEnd();
|
||||
}
|
||||
}
|
||||
@@ -168,5 +202,7 @@ class WebSocketClient {
|
||||
export const wsClient = new WebSocketClient();
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(window as any).wwvDebugConnections = () => wsClient.printConnections();
|
||||
}
|
||||
@@ -58,12 +58,16 @@ export async function fetchLocalEngineManifest(): Promise<string[] | null> {
|
||||
|
||||
const data = await res.json();
|
||||
localManifest = data.plugins || [];
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(
|
||||
`[EngineManifest] Local engine detected: ${localManifest!.length} seeders`,
|
||||
localManifest
|
||||
);
|
||||
return localManifest;
|
||||
} catch {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("[EngineManifest] No local engine detected, using cloud.");
|
||||
// We intentionally leave manifestFetched = true here.
|
||||
// This caches the failure so we don't incur this timeout penalty
|
||||
|
||||
@@ -273,6 +273,8 @@ isFaded: boolean
|
||||
}
|
||||
|
||||
/** Hide label to save render time, but do NOT remove it. Creating/Removing labels triggers massive WebGL buffer rewrites. */
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function hideLabel(item: AnimatableItem, labelsCollection: any): void {
|
||||
if (!item.labelPrimitive || item.labelPrimitive.isDestroyed?.()) return;
|
||||
if (item.labelPrimitive.show !== false) item.labelPrimitive.show = false;
|
||||
|
||||
@@ -21,8 +21,12 @@ export {
|
||||
} from "./renderCaches";
|
||||
|
||||
export interface AnimatableItem {
|
||||
primitive: any;
|
||||
labelPrimitive?: any;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
primitive: any
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
labelPrimitive?: any
|
||||
entity: GeoEntity;
|
||||
posRef: Cartesian3;
|
||||
options: CesiumEntityOptions;
|
||||
@@ -56,6 +60,8 @@ const collectionsByViewer = new WeakMap<CesiumViewer, PrimitiveCollections>();
|
||||
/** Initialize primitive collections on the viewer. */
|
||||
export function initPrimitiveCollections(viewer: CesiumViewer): void {
|
||||
if (!viewer?.scene?.primitives) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn("[EntityRenderer] initPrimitiveCollections called before viewer.scene was ready — skipping.");
|
||||
return;
|
||||
}
|
||||
@@ -147,6 +153,8 @@ currentIds: Set<string>
|
||||
iconUrl: getDefaultDotIcon(baseColor, baseOutlineColor, outWidth, pSize),
|
||||
iconScale: 1.0,
|
||||
};
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(effectiveOptions as any)._isAutoSVG = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -109,6 +109,8 @@ export class FrustumRenderer {
|
||||
const corners = [edges.topLeft, edges.topRight, edges.bottomLeft, edges.bottomRight];
|
||||
const existing = this.entityMap.get(id)!;
|
||||
for (let i = 0; i < 4; i++) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
existing[i].polyline!.positions = toPositions(edges.apex, corners[i]) as any;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ const VIEWER_STYLE = {
|
||||
} as const;
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(window as any).CESIUM_BASE_URL = '/cesium/';
|
||||
if (process.env.NEXT_PUBLIC_CESIUM_ION_TOKEN) {
|
||||
Ion.defaultAccessToken = process.env.NEXT_PUBLIC_CESIUM_ION_TOKEN;
|
||||
@@ -114,15 +116,33 @@ enableLighting,
|
||||
return result;
|
||||
}, [layers, entitiesByPlugin, filters, pluginSettings]);
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line react-hooks/refs
|
||||
const { isGoogle3D } = useImageryManager(viewerRef.current, viewerReady);
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line react-hooks/refs
|
||||
useBorders(viewerRef.current, showLabels, isGoogle3D);
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line react-hooks/refs
|
||||
useSelectionAnchor(viewerRef.current, viewerReady, selectedEntity, lockedEntityId, selectionEntityRef, animatablesMapRef);
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line react-hooks/refs
|
||||
useCameraSync(viewerRef.current, viewerReady, setCameraPosition, setFps);
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line react-hooks/refs
|
||||
useCameraActions(viewerRef.current, viewerReady);
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line react-hooks/refs
|
||||
useEntityRendering(viewerRef.current, viewerReady, visibleEntities, animatablesMapRef, hoveredEntityIdRef, sceneSettings);
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line react-hooks/refs
|
||||
useModelRendering(viewerRef.current, viewerReady, animatablesMapRef);
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line react-hooks/refs
|
||||
useTrailRendering(viewerRef.current, viewerReady, animatablesMapRef);
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line react-hooks/refs
|
||||
useSatelliteFrustum(viewerRef.current, viewerReady, selectedEntity, animatablesMapRef);
|
||||
|
||||
const cameraLayerEnabled = layers.camera?.enabled ?? false;
|
||||
@@ -245,6 +265,8 @@ enableLighting,
|
||||
</PluginErrorBoundary>
|
||||
);
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`[GlobeView] Synchronous error initializing plugin component ${managed.plugin.id}:`, err);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -11,6 +11,8 @@ vi.mock("cesium", () => {
|
||||
_type = "UrlTemplate";
|
||||
url: string;
|
||||
subdomains?: string[];
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
constructor(opts: any) { this.url = opts.url; this.subdomains = opts.subdomains; }
|
||||
}
|
||||
|
||||
@@ -44,6 +46,8 @@ describe("createOsmProvider", () => {
|
||||
it("returns a UrlTemplateImageryProvider for OSM tiles", () => {
|
||||
const provider = createOsmProvider();
|
||||
expect(provider).toBeDefined();
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
expect((provider as any).url).toContain("openstreetmap.org");
|
||||
});
|
||||
});
|
||||
@@ -51,25 +55,39 @@ describe("createOsmProvider", () => {
|
||||
describe("createImageryProvider", () => {
|
||||
it("returns Google tiles for bing-aerial when no Bing key (first tier)", async () => {
|
||||
const provider = await createImageryProvider("bing-aerial");
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
expect((provider as any).url).toContain("google.com");
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
expect((provider as any).url).toContain("lyrs=s");
|
||||
expect(IonImageryProvider.fromAssetId).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("returns Google tiles for bing-labels when no Bing key (hybrid)", async () => {
|
||||
const provider = await createImageryProvider("bing-labels");
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
expect((provider as any).url).toContain("google.com");
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
expect((provider as any).url).toContain("lyrs=y");
|
||||
});
|
||||
|
||||
it("returns Google tiles for bing-road when no Bing key (roads)", async () => {
|
||||
const provider = await createImageryProvider("bing-road");
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
expect((provider as any).url).toContain("google.com");
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
expect((provider as any).url).toContain("lyrs=m");
|
||||
});
|
||||
|
||||
it("returns Google tiles for blue-marble when no keys", async () => {
|
||||
const provider = await createImageryProvider("blue-marble");
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
expect((provider as any).url).toContain("google.com");
|
||||
});
|
||||
|
||||
@@ -80,6 +98,8 @@ describe("createImageryProvider", () => {
|
||||
// Make UrlTemplateImageryProvider throw only for google URLs
|
||||
// We need to test the fallback path - simulate by making IonImageryProvider
|
||||
// the expected path when Google fails
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
vi.mocked(IonImageryProvider.fromAssetId).mockResolvedValue({ _type: "Ion" } as any);
|
||||
|
||||
// Since UrlTemplateImageryProvider is a constructor and won't normally throw,
|
||||
@@ -88,6 +108,8 @@ describe("createImageryProvider", () => {
|
||||
const provider = await createImageryProvider("bing-aerial");
|
||||
// Google succeeds first, so Ion should NOT be called
|
||||
expect(IonImageryProvider.fromAssetId).not.toHaveBeenCalled();
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
expect((provider as any).url).toContain("google.com");
|
||||
});
|
||||
|
||||
@@ -96,16 +118,22 @@ describe("createImageryProvider", () => {
|
||||
const { BingMapsImageryProvider } = await import("cesium");
|
||||
const provider = await createImageryProvider("bing-aerial");
|
||||
expect(BingMapsImageryProvider.fromUrl).toHaveBeenCalled();
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
expect((provider as any)._type).toBe("Bing");
|
||||
});
|
||||
|
||||
it("returns OSM for 'osm' layer directly", async () => {
|
||||
const provider = await createImageryProvider("osm");
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
expect((provider as any).url).toContain("openstreetmap.org");
|
||||
});
|
||||
|
||||
it("returns OSM for unknown layer ids", async () => {
|
||||
const provider = await createImageryProvider("nonexistent-layer");
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
expect((provider as any).url).toContain("openstreetmap.org");
|
||||
});
|
||||
});
|
||||
@@ -78,6 +78,8 @@ async function tieredFallback(ionAssetId: number, googleLyrs: string) {
|
||||
try {
|
||||
return createGoogleProvider(googleLyrs);
|
||||
} catch (googleErr) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn("[ImageryProvider] Google tiles failed, trying Bing via Ion:", googleErr);
|
||||
}
|
||||
|
||||
@@ -85,6 +87,8 @@ async function tieredFallback(ionAssetId: number, googleLyrs: string) {
|
||||
try {
|
||||
return await IonImageryProvider.fromAssetId(ionAssetId);
|
||||
} catch (ionErr) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn("[ImageryProvider] Ion/Bing failed, falling back to OSM:", ionErr);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,8 @@ export async function createModelPrimitive(
|
||||
scene.primitives.add(model);
|
||||
item.primitive = model;
|
||||
} catch (err) {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`[ModelManager] Failed to load model for ${entity.id}:`, err);
|
||||
} finally {
|
||||
pendingLoads.delete(entity.id);
|
||||
@@ -76,6 +78,8 @@ export function updateModelTransform(
|
||||
position: Cartesian3,
|
||||
heading?: number
|
||||
): void {
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const modelsToUpdate: any[] = [];
|
||||
if (item.primitive && item.primitive.modelMatrix) {
|
||||
modelsToUpdate.push(item.primitive);
|
||||
|
||||
@@ -77,7 +77,9 @@ export function handleEntitySelection(
|
||||
color: Color.fromCssColorString(trailColor).withAlpha(0.2),
|
||||
dashLength: 16,
|
||||
}),
|
||||
} as any,
|
||||
} as // TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
any,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,8 +88,12 @@ export function applyHighlight(item: AnimatableItem, isSelected: boolean, isHove
|
||||
else if (isFaded) targetState = 'faded';
|
||||
|
||||
if (item.lastHighlightState === targetState) return;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
item.lastHighlightState = targetState as any;
|
||||
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const isBillboard = !!options.iconUrl || (options as any)._isAutoSVG;
|
||||
const baseScale = options.iconScale ?? 0.7;
|
||||
|
||||
|
||||
@@ -58,18 +58,26 @@ export function showSearchPin(viewer: CesiumViewer, lat: number, lon: number) {
|
||||
const t = elapsed / DROP_DURATION_MS;
|
||||
const y = easeOutBounce(t) * DROP_START_PX * -1 + DROP_START_PX;
|
||||
scratchOffset.x = 0; scratchOffset.y = y;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
entity.billboard.pixelOffset = scratchOffset as any;
|
||||
}
|
||||
// Phase 2: Hold visible (DROP_DURATION_MS → TOTAL_DURATION_MS - 600)
|
||||
else if (elapsed < TOTAL_DURATION_MS - 600) {
|
||||
scratchOffset.x = 0; scratchOffset.y = 0;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
entity.billboard.pixelOffset = scratchOffset as any;
|
||||
}
|
||||
// Phase 3: Fade out (last 600ms)
|
||||
else if (elapsed < TOTAL_DURATION_MS) {
|
||||
const fadeT = (elapsed - (TOTAL_DURATION_MS - 600)) / 600;
|
||||
scratchOffset.x = 0; scratchOffset.y = 0;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
entity.billboard.pixelOffset = scratchOffset as any;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
entity.billboard.color = Color.fromAlpha(Color.WHITE, 1 - fadeT) as any;
|
||||
}
|
||||
// Done
|
||||
|
||||
@@ -12,6 +12,8 @@ export function useCameraActions(viewer: CesiumViewer | null, isReady: boolean)
|
||||
|
||||
const unsubFace = dataBus.on("cameraFaceTowards", ({ lat, lon, alt }) => {
|
||||
if (!viewer || viewer.isDestroyed()) return;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("[GlobeView] Native faceTowards", lat, lon, alt);
|
||||
const target = Cartesian3.fromDegrees(lon, lat, alt);
|
||||
const offset = Cartesian3.subtract(
|
||||
@@ -65,6 +67,8 @@ export function useCameraActions(viewer: CesiumViewer | null, isReady: boolean)
|
||||
const viewDistance = distance !== undefined ? distance : Math.max(10000, (alt || 0) * 2 + 20000);
|
||||
|
||||
let destination: Cartesian3;
|
||||
// TODO: Legacy Airbnb linting violation
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let orientation: any;
|
||||
|
||||
if (heading !== undefined) {
|
||||
|
||||
Loaded 100 of 149 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user