Skip to content

Commit

Permalink
chore: update deps (#4854)
Browse files Browse the repository at this point in the history
  • Loading branch information
bigint committed Apr 21, 2024
2 parents 58271f1 + 17d2d55 commit 4f53f6e
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 94 deletions.
3 changes: 0 additions & 3 deletions apps/api/src/lib/sitemap/buildSitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ const builder = new XMLBuilder({
});

interface Url {
changefreq: string;
lastmod: string;
loc: string;
priority: number;
}

export const buildUrlsetXml = (url: Url[]): string => {
Expand Down
8 changes: 0 additions & 8 deletions apps/api/src/lib/sitemap/getLastModDate.ts

This file was deleted.

7 changes: 1 addition & 6 deletions apps/api/src/routes/sitemap/others.xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ export const get: Handler = (req, res) => {
'https://hey.xyz/rules'
];

const entries = sitemaps.map((sitemap) => ({
changefreq: 'daily',
lastmod: new Date().toISOString(),
loc: sitemap,
priority: 0.5
}));
const entries = sitemaps.map((sitemap) => ({ loc: sitemap }));
const xml = buildUrlsetXml(entries);

logger.info(`Lens: Fetched other sitemaps from user-agent: ${user_agent}`);
Expand Down
12 changes: 3 additions & 9 deletions apps/api/src/routes/sitemap/profiles/[id].xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { SITEMAP_BATCH_SIZE } from 'src/lib/constants';
import lensPrisma from 'src/lib/lensPrisma';
import { noBody } from 'src/lib/responses';
import { buildUrlsetXml } from 'src/lib/sitemap/buildSitemap';
import getLastModDate from 'src/lib/sitemap/getLastModDate';

export const config = {
api: { responseLimit: '8mb' }
Expand All @@ -24,20 +23,15 @@ export const get: Handler = async (req, res) => {
try {
const offset = (Number(batch) - 1) * SITEMAP_BATCH_SIZE;

const response = await lensPrisma.$queryRaw<
{ block_timestamp: Date; local_name: string }[]
>`
SELECT local_name, block_timestamp FROM namespace.handle
const response = await lensPrisma.$queryRaw<{ local_name: string }[]>`
SELECT local_name FROM namespace.handle
ORDER BY block_timestamp ASC
LIMIT ${SITEMAP_BATCH_SIZE}
OFFSET ${offset};
`;

const entries = response.map((handle) => ({
changefreq: 'daily',
lastmod: getLastModDate(handle.block_timestamp),
loc: `https://hey.xyz/u/${handle.local_name}`,
priority: 0.5
loc: `https://hey.xyz/u/${handle.local_name}`
}));

const xml = buildUrlsetXml(entries);
Expand Down
12 changes: 3 additions & 9 deletions apps/api/src/routes/sitemap/publications/[id].xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { SITEMAP_BATCH_SIZE } from 'src/lib/constants';
import lensPrisma from 'src/lib/lensPrisma';
import { noBody } from 'src/lib/responses';
import { buildUrlsetXml } from 'src/lib/sitemap/buildSitemap';
import getLastModDate from 'src/lib/sitemap/getLastModDate';

export const config = {
api: { responseLimit: '8mb' }
Expand All @@ -24,21 +23,16 @@ export const get: Handler = async (req, res) => {
try {
const offset = (Number(batch) - 1) * SITEMAP_BATCH_SIZE;

const response = await lensPrisma.$queryRaw<
{ block_timestamp: Date; publication_id: string }[]
>`
SELECT publication_id, block_timestamp FROM publication.record
const response = await lensPrisma.$queryRaw<{ publication_id: string }[]>`
SELECT publication_id FROM publication.record
WHERE publication_type IN ('POST', 'QUOTE')
ORDER BY block_timestamp ASC
LIMIT ${SITEMAP_BATCH_SIZE}
OFFSET ${offset};
`;

const entries = response.map((publication) => ({
changefreq: 'daily',
lastmod: getLastModDate(publication.block_timestamp),
loc: `https://hey.xyz/posts/${publication.publication_id}`,
priority: 0.5
loc: `https://hey.xyz/posts/${publication.publication_id}`
}));

const xml = buildUrlsetXml(entries);
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"react-hot-toast": "^2.4.1",
"react-markdown": "^9.0.0",
"react-tracked": "^1.7.14",
"react-virtuoso": "^4.7.9",
"react-virtuoso": "^4.7.10",
"remark-breaks": "^4.0.0",
"remark-linkify-regex": "^1.2.1",
"strip-markdown": "^6.0.0",
Expand Down
116 changes: 58 additions & 58 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit 4f53f6e

@vercel
Copy link

@vercel vercel bot commented on 4f53f6e Apr 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

web – ./apps/web

web-heyxyz.vercel.app
heyxyz.vercel.app
web-git-main-heyxyz.vercel.app
hey.xyz

Please sign in to comment.