tema 5f7fb483d7 Refactor error handling and type safety across services
- Simplified error handling in TokenBlacklistService by removing unnecessary error variable.
- Enhanced type safety in SimUsageStoreService with improved type assertions and error handling.
- Updated FreebititService to provide clearer error messages and consistent error handling across multiple methods.
- Standardized import statements in WhmcsInvoiceService for better organization and clarity.
- Added missing imports in dev-prep script to ensure proper functionality.
2025-09-09 16:07:48 +09:00

32 lines
1018 B
JavaScript

#!/usr/bin/env node
/* eslint-env node */
/* eslint-disable no-console */
// Ensure dev-time Next.js manifests exist to avoid noisy ENOENT errors
import { mkdirSync, existsSync, writeFileSync } from "fs";
import { join } from "path";
import { URL } from "node:url";
/* global console */
const root = new URL("..", import.meta.url).pathname; // apps/portal
const nextDir = join(root, ".next");
const routesManifestPath = join(nextDir, "routes-manifest.json");
try {
mkdirSync(nextDir, { recursive: true });
if (!existsSync(routesManifestPath)) {
const minimalManifest = {
version: 5,
pages404: true,
basePath: "",
redirects: [],
rewrites: { beforeFiles: [], afterFiles: [], fallback: [] },
headers: [],
};
writeFileSync(routesManifestPath, JSON.stringify(minimalManifest, null, 2));
console.log("[dev-prep] Created minimal .next/routes-manifest.json");
}
} catch (err) {
console.warn("[dev-prep] Failed to prepare Next dev files:", err?.message || err);
}