Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update deps #4854

Merged
merged 1 commit into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading