The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
remove barrel imports
Steven Tey9120e1d098bc
diff --git a/apps/web/lib/api/links/bulk-create-links.ts b/apps/web/lib/api/links/bulk-create-links.tsindex 9ea8659ca7..7722d12352 100644--- a/apps/web/lib/api/links/bulk-create-links.ts+++ b/apps/web/lib/api/links/bulk-create-links.ts@@ -10,11 +10,9 @@ import { includeProgramEnrollment } from "./include-program-enrollment";import { includeTags } from "./include-tags";import { propagateBulkLinkChanges } from "./propagate-bulk-link-changes";import { updateLinksUsage } from "./update-links-usage";-import {- checkIfLinksHaveTags,- checkIfLinksHaveWebhooks,- transformLink,-} from "./utils";+import { checkIfLinksHaveTags } from "./utils/check-if-links-have-tags";+import { checkIfLinksHaveWebhooks } from "./utils/check-if-links-have-webhooks";+import { transformLink } from "./utils/transform-link";export async function bulkCreateLinks({links,diff --git a/apps/web/scripts/sitemap-importer.ts b/apps/web/scripts/sitemap-importer.tsindex 7747fea748..5babd36665 100644--- a/apps/web/scripts/sitemap-importer.ts+++ b/apps/web/scripts/sitemap-importer.ts@@ -2,7 +2,7 @@ import { createId } from "@/lib/api/create-id";import { prisma } from "@dub/prisma";import "dotenv-flow/config";import { XMLParser } from "fast-xml-parser";-import { bulkCreateLinks } from "../lib/api/links";+import { bulkCreateLinks } from "../lib/api/links/bulk-create-links";async function fetchSitemap(url: string) {const response = await fetch(url);@@ -14,19 +14,21 @@ async function fetchSitemap(url: string) {const sitemapUrl = "https://dub.co/sitemap.xml";const domain = "site.dub.co";-const projectId = "xxx";-const userId = "xxx";-const folderId = "xxx";+const projectId = "ws_xxx";+const userId = "user_xxx";+const folderId = "fold_xxx";async function main() {// Fetch and parse sitemapconst sitemapUrls = await fetchSitemap(sitemapUrl);- // Filter out homepage and invalid URLsconst validUrls = sitemapUrls+ // filter out other sitemaps+ .filter((url: string) => !url.endsWith("sitemap.xml")).map((url: string) => {const urlObj = new URL(url);let key = urlObj.pathname.slice(1);+ // convert homepage to _rootif (key === "") {key = "_root";}