Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿

chore: update TypeScript configuration and refactor import paths to use aliases for improved module resolution

yoginth.com e131a9e6 789e8517

verified
+56 -50
+3 -3
apps/api/src/routes/cron/guild/syncFollowersStandingToGuild.ts
··· 1 1 import type { Context } from "hono"; 2 - import handleApiError from "../../../utils/handleApiError"; 3 - import lensPg from "../../../utils/lensPg"; 4 - import syncAddressesToGuild from "../../../utils/syncAddressesToGuild"; 2 + import handleApiError from "@/utils/handleApiError"; 3 + import lensPg from "@/utils/lensPg"; 4 + import syncAddressesToGuild from "@/utils/syncAddressesToGuild"; 5 5 6 6 // Sync followers standing of accounts with 1000+ followers 7 7 const syncFollowersStandingToGuild = async (ctx: Context) => {
+3 -3
apps/api/src/routes/cron/guild/syncSubscribersToGuild.ts
··· 1 1 import { PERMISSIONS } from "@hey/data/constants"; 2 2 import type { Context } from "hono"; 3 - import handleApiError from "../../../utils/handleApiError"; 4 - import lensPg from "../../../utils/lensPg"; 5 - import syncAddressesToGuild from "../../../utils/syncAddressesToGuild"; 3 + import handleApiError from "@/utils/handleApiError"; 4 + import lensPg from "@/utils/lensPg"; 5 + import syncAddressesToGuild from "@/utils/syncAddressesToGuild"; 6 6 7 7 // Sync accounts that has current subscriber status 8 8 const syncSubscribersToGuild = async (ctx: Context) => {
+1 -1
apps/api/src/routes/cron/index.ts
··· 1 1 import { Hono } from "hono"; 2 - import secretMiddleware from "../../middlewares/secretMiddleware"; 2 + import secretMiddleware from "@/middlewares/secretMiddleware"; 3 3 import syncFollowersStandingToGuild from "./guild/syncFollowersStandingToGuild"; 4 4 import syncSubscribersToGuild from "./guild/syncSubscribersToGuild"; 5 5 import removeExpiredSubscribers from "./removeExpiredSubscribers";
+3 -3
apps/api/src/routes/cron/removeExpiredSubscribers/index.ts
··· 1 1 import { PERMISSIONS } from "@hey/data/constants"; 2 2 import { Status } from "@hey/data/enums"; 3 3 import type { Context } from "hono"; 4 - import handleApiError from "../../../utils/handleApiError"; 5 - import lensPg from "../../../utils/lensPg"; 6 - import signer from "../../../utils/signer"; 4 + import handleApiError from "@/utils/handleApiError"; 5 + import lensPg from "@/utils/lensPg"; 6 + import signer from "@/utils/signer"; 7 7 import ABI from "./ABI"; 8 8 9 9 const removeExpiredSubscribers = async (ctx: Context) => {
+3 -3
apps/api/src/routes/jumper/getStats.ts
··· 1 1 import { Status } from "@hey/data/enums"; 2 2 import type { Context } from "hono"; 3 - import getDbPostId from "../../utils/getDbPostId"; 4 - import handleApiError from "../../utils/handleApiError"; 5 - import lensPg from "../../utils/lensPg"; 3 + import getDbPostId from "@/utils/getDbPostId"; 4 + import handleApiError from "@/utils/handleApiError"; 5 + import lensPg from "@/utils/lensPg"; 6 6 7 7 const getStats = async (ctx: Context) => { 8 8 try {
+1 -1
apps/api/src/routes/lens/authorization.ts
··· 1 1 import { Status } from "@hey/data/enums"; 2 2 import type { Context } from "hono"; 3 - import handleApiError from "../../utils/handleApiError"; 3 + import handleApiError from "@/utils/handleApiError"; 4 4 5 5 const authorization = async (ctx: Context) => { 6 6 try {
+1 -1
apps/api/src/routes/live/createLive.ts
··· 3 3 import generateUUID from "@hey/helpers/generateUUID"; 4 4 import type { Context } from "hono"; 5 5 import type { ContentfulStatusCode } from "hono/utils/http-status"; 6 - import handleApiError from "../../utils/handleApiError"; 6 + import handleApiError from "@/utils/handleApiError"; 7 7 8 8 const createLive = async (ctx: Context) => { 9 9 try {
+2 -2
apps/api/src/routes/live/index.ts
··· 1 1 import { zValidator } from "@hono/zod-validator"; 2 2 import { Hono } from "hono"; 3 3 import { z } from "zod"; 4 - import authMiddleware from "../../middlewares/authMiddleware"; 5 - import rateLimiter from "../../middlewares/rateLimiter"; 4 + import authMiddleware from "@/middlewares/authMiddleware"; 5 + import rateLimiter from "@/middlewares/rateLimiter"; 6 6 import createLive from "./createLive"; 7 7 8 8 const app = new Hono();
+2 -2
apps/api/src/routes/metadata/getSTS.ts
··· 2 2 import { EVER_BUCKET } from "@hey/data/constants"; 3 3 import { Status } from "@hey/data/enums"; 4 4 import type { Context } from "hono"; 5 - import handleApiError from "../../utils/handleApiError"; 6 - import stsClient from "../../utils/stsClient"; 5 + import handleApiError from "@/utils/handleApiError"; 6 + import stsClient from "@/utils/stsClient"; 7 7 8 8 const params = { 9 9 DurationSeconds: 900,
+2 -2
apps/api/src/routes/metadata/index.ts
··· 1 1 import { Hono } from "hono"; 2 - import authMiddleware from "../../middlewares/authMiddleware"; 3 - import rateLimiter from "../../middlewares/rateLimiter"; 2 + import authMiddleware from "@/middlewares/authMiddleware"; 3 + import rateLimiter from "@/middlewares/rateLimiter"; 4 4 import getSTS from "./getSTS"; 5 5 6 6 const app = new Hono();
+1 -1
apps/api/src/routes/oembed/getOembed.test.ts
··· 3 3 import getOembed from "./getOembed"; 4 4 5 5 // Mock Redis utilities 6 - vi.mock("../../utils/redis", () => ({ 6 + vi.mock("@/utils/redis", () => ({ 7 7 generateExtraLongExpiry: vi.fn(() => 86400), 8 8 getRedis: vi.fn(), 9 9 setRedis: vi.fn()
+4 -4
apps/api/src/routes/oembed/getOembed.ts
··· 1 1 import { Status } from "@hey/data/enums"; 2 2 import type { Context } from "hono"; 3 - import { CACHE_AGE_1_DAY } from "../../utils/constants"; 4 - import handleApiError from "../../utils/handleApiError"; 5 - import { generateExtraLongExpiry, getRedis, setRedis } from "../../utils/redis"; 6 - import sha256 from "../../utils/sha256"; 3 + import { CACHE_AGE_1_DAY } from "@/utils/constants"; 4 + import handleApiError from "@/utils/handleApiError"; 5 + import { generateExtraLongExpiry, getRedis, setRedis } from "@/utils/redis"; 6 + import sha256 from "@/utils/sha256"; 7 7 import getMetadata from "./helpers/getMetadata"; 8 8 9 9 const getOembed = async (ctx: Context) => {
+1 -1
apps/api/src/routes/oembed/helpers/getMetadata.ts
··· 1 1 import { parseHTML } from "linkedom"; 2 - import { HEY_USER_AGENT } from "../../../utils/constants"; 2 + import { HEY_USER_AGENT } from "@/utils/constants"; 3 3 import getDescription from "./meta/getDescription"; 4 4 import getTitle from "./meta/getTitle"; 5 5
+1 -1
apps/api/src/routes/oembed/index.ts
··· 1 1 import { zValidator } from "@hono/zod-validator"; 2 2 import { Hono } from "hono"; 3 3 import { z } from "zod"; 4 - import rateLimiter from "../../middlewares/rateLimiter"; 4 + import rateLimiter from "@/middlewares/rateLimiter"; 5 5 import getOembed from "./getOembed"; 6 6 7 7 const app = new Hono();
+2 -2
apps/api/src/routes/og/ogUtils.ts
··· 1 1 import apolloClient from "@hey/indexer/apollo/client"; 2 2 import type { Context } from "hono"; 3 3 import type { HtmlEscapedString } from "hono/utils/html"; 4 - import defaultMetadata from "../../utils/defaultMetadata"; 5 - import { getRedis, setRedis } from "../../utils/redis"; 4 + import defaultMetadata from "@/utils/defaultMetadata"; 5 + import { getRedis, setRedis } from "@/utils/redis"; 6 6 7 7 interface OgHelperOptions<T> { 8 8 ctx: Context;
+3 -3
apps/api/src/routes/preferences/getPreferences.ts
··· 1 1 import { Status } from "@hey/data/enums"; 2 2 import type { Context } from "hono"; 3 - import prisma from "../../prisma/client"; 4 - import handleApiError from "../../utils/handleApiError"; 5 - import { getRedis, setRedis } from "../../utils/redis"; 3 + import prisma from "@/prisma/client"; 4 + import handleApiError from "@/utils/handleApiError"; 5 + import { getRedis, setRedis } from "@/utils/redis"; 6 6 7 7 const getPreferences = async (ctx: Context) => { 8 8 try {
+1 -1
apps/api/src/routes/preferences/index.ts
··· 1 1 import { zValidator } from "@hono/zod-validator"; 2 2 import { Hono } from "hono"; 3 3 import { z } from "zod"; 4 - import rateLimiter from "../../middlewares/rateLimiter"; 4 + import rateLimiter from "@/middlewares/rateLimiter"; 5 5 import getPreferences from "./getPreferences"; 6 6 import updatePreferences from "./updatePreferences"; 7 7
+3 -3
apps/api/src/routes/preferences/updatePreferences.ts
··· 1 1 import { Status } from "@hey/data/enums"; 2 2 import type { Context } from "hono"; 3 - import prisma from "../../prisma/client"; 4 - import handleApiError from "../../utils/handleApiError"; 5 - import { delRedis } from "../../utils/redis"; 3 + import prisma from "@/prisma/client"; 4 + import handleApiError from "@/utils/handleApiError"; 5 + import { delRedis } from "@/utils/redis"; 6 6 7 7 const updatePreferences = async (ctx: Context) => { 8 8 try {
+2 -2
apps/api/src/routes/sitemap/accounts/accountSitemap.ts
··· 1 1 import { ERRORS } from "@hey/data/errors"; 2 2 import type { Context } from "hono"; 3 3 import { create } from "xmlbuilder2"; 4 - import { SITEMAP_BATCH_SIZE } from "../../../utils/constants"; 5 - import lensPg from "../../../utils/lensPg"; 4 + import { SITEMAP_BATCH_SIZE } from "@/utils/constants"; 5 + import lensPg from "@/utils/lensPg"; 6 6 import generateSitemap from "../common"; 7 7 8 8 const accountSitemap = async (ctx: Context) => {
+1 -1
apps/api/src/routes/sitemap/accounts/accountsGroupSitemap.ts
··· 1 1 import { ERRORS } from "@hey/data/errors"; 2 2 import type { Context } from "hono"; 3 3 import { create } from "xmlbuilder2"; 4 - import { SITEMAP_BATCH_SIZE } from "../../../utils/constants"; 4 + import { SITEMAP_BATCH_SIZE } from "@/utils/constants"; 5 5 import generateSitemap from "../common"; 6 6 import getTotalAccountBatches from "./getTotalAccountBatches"; 7 7
+1 -1
apps/api/src/routes/sitemap/accounts/accountsSitemapIndex.ts
··· 1 1 import type { Context } from "hono"; 2 2 import { create } from "xmlbuilder2"; 3 - import { SITEMAP_BATCH_SIZE } from "../../../utils/constants"; 3 + import { SITEMAP_BATCH_SIZE } from "@/utils/constants"; 4 4 import generateSitemap from "../common"; 5 5 import getTotalAccountBatches from "./getTotalAccountBatches"; 6 6
+3 -6
apps/api/src/routes/sitemap/accounts/getTotalAccountBatches.ts
··· 1 - import { 2 - SITEMAP_BATCH_SIZE, 3 - SITEMAP_CACHE_DAYS 4 - } from "../../../utils/constants"; 5 - import lensPg from "../../../utils/lensPg"; 6 - import { getRedis, hoursToSeconds, setRedis } from "../../../utils/redis"; 1 + import { SITEMAP_BATCH_SIZE, SITEMAP_CACHE_DAYS } from "@/utils/constants"; 2 + import lensPg from "@/utils/lensPg"; 3 + import { getRedis, hoursToSeconds, setRedis } from "@/utils/redis"; 7 4 8 5 const getTotalAccountBatches = async (): Promise<number> => { 9 6 const cacheKey = "sitemap:accounts:total";
+2 -2
apps/api/src/routes/sitemap/common.ts
··· 1 1 import { ERRORS } from "@hey/data/errors"; 2 2 import type { Context } from "hono"; 3 - import { SITEMAP_CACHE_DAYS } from "../../utils/constants"; 4 - import { getRedis, hoursToSeconds, setRedis } from "../../utils/redis"; 3 + import { SITEMAP_CACHE_DAYS } from "@/utils/constants"; 4 + import { getRedis, hoursToSeconds, setRedis } from "@/utils/redis"; 5 5 6 6 interface SitemapHelperOptions { 7 7 ctx: Context;
+4 -1
apps/api/tsconfig.json
··· 3 3 "baseUrl": ".", 4 4 "module": "CommonJS", 5 5 "noEmit": false, 6 - "outDir": "dist" 6 + "outDir": "dist", 7 + "paths": { 8 + "@/*": ["./src/*"] 9 + } 7 10 }, 8 11 "extends": "@hey/config/base.tsconfig.json", 9 12 "include": ["**/*.ts", "src"]
+6
apps/api/vitest.config.ts
··· 1 + import path from "node:path"; 1 2 import { defineConfig } from "vitest/config"; 2 3 3 4 export default defineConfig({ 5 + resolve: { 6 + alias: { 7 + "@": path.resolve(__dirname, "./src") 8 + } 9 + }, 4 10 test: { 5 11 environment: "node" 6 12 }