{"_id":"@avicennateknoloji/next-centralized-link","name":"@avicennateknoloji/next-centralized-link","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@avicennateknoloji/next-centralized-link","version":"0.0.1","description":"Next.js için merkezileştirilmiş link yönetimi - route tanımlarını tek yerden yönetmek için kullanılır","main":"dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup","prepublishOnly":"npm run build"},"keywords":["nextjs","next.js","links","routing","centralized","typescript","react"],"author":"","license":"MIT","repository":{"type":"git","url":""},"homepage":"","peerDependencies":{"next":">=12.0.0","react":">=17.0.0"},"devDependencies":{"next":"^14.0.0","react":"^18.0.0","tsup":"^8.5.0","typescript":"^5.8.3"},"_id":"@avicennateknoloji/next-centralized-link@0.0.1","_nodeVersion":"22.15.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-+/iWVx0WXD18cZKQPpUmGzwf8ZsvE4wqrrGhQVXwXiUfRVOru41Ks/CPE1WaIgrBHb8UQ23jfW3eKrIB53jYIw==","shasum":"337f34efdb21cdb296326c15ddcc89fdec5c56b7","tarball":"https://registry.npmjs.org/@avicennateknoloji/next-centralized-link/-/next-centralized-link-0.0.1.tgz","fileCount":8,"unpackedSize":16259,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEglH//7YrMNf+UNQXtf1j/Etd2dBtUtAPaYTk8fzZSeAiEAqbBf2Y6enGdHhgKw73JqR4wS3j36Xjp2bDkk7SiaSdA="}]},"_npmUser":{"name":"avicennateknoloji","email":"yldrmw96@gmail.com","actor":{"name":"avicennateknoloji","email":"yldrmw96@gmail.com","type":"user"}},"directories":{},"maintainers":[{"name":"avicennateknoloji","email":"yldrmw96@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/next-centralized-link_0.0.1_1751705669845_0.45960489605795485"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-05T08:54:29.748Z","0.0.1":"2025-07-05T08:54:30.043Z","modified":"2025-07-05T08:54:30.278Z"},"maintainers":[{"name":"avicennateknoloji","email":"yldrmw96@gmail.com"}],"description":"Next.js için merkezileştirilmiş link yönetimi - route tanımlarını tek yerden yönetmek için kullanılır","keywords":["nextjs","next.js","links","routing","centralized","typescript","react"],"repository":{"type":"git","url":""},"license":"MIT","readme":"# Next.js Centralized Link\n\nNext.js projelerinde route tanımlarını merkezileştirilmiş bir şekilde yönetmek için kullanılan TypeScript paketi.\n\n## 🚀 Kurulum\n\n```bash\nnpm install @avicennateknoloji/next-centralized-link\n```\n\n```bash\nyarn add @avicennateknoloji/next-centralized-link\n```\n\n```bash\npnpm add @avicennateknoloji/next-centralized-link\n```\n\n## 📖 Kullanım\n\n### Temel Kullanım\n\n```typescript\nimport { centralizedLink, getLink } from '@avicennateknoloji/next-centralized-link';\n\n// Route tanımları\ncentralizedLink('home', () => '/');\ncentralizedLink('about', () => '/about');\ncentralizedLink('contact', () => '/contact');\n\n// Link kullanımı\nconst homeUrl = getLink('home'); // '/'\nconst aboutUrl = getLink('about'); // '/about'\n```\n\n### Parametreli Route'lar\n\n```typescript\nimport { centralizedLink, getLink } from '@avicennateknoloji/next-centralized-link';\n\n// Parametreli route tanımları\ncentralizedLink('user', ({ id }) => `/user/${id}`);\ncentralizedLink('post', ({ slug }) => `/blog/${slug}`);\ncentralizedLink('category', ({ category, page = 1 }) => `/category/${category}?page=${page}`);\n\n// Kullanım\nconst userUrl = getLink('user', { id: 123 }); // '/user/123'\nconst postUrl = getLink('post', { slug: 'my-post' }); // '/blog/my-post'\nconst categoryUrl = getLink('category', { category: 'tech', page: 2 }); // '/category/tech?page=2'\n```\n\n### Next.js Link Component'i ile Kullanım\n\n```tsx\nimport Link from 'next/link';\nimport { getLink } from '@avicennateknoloji/next-centralized-link';\n\nfunction Navigation() {\n  return (\n    <nav>\n      <Link href={getLink('home')}>Ana Sayfa</Link>\n      <Link href={getLink('about')}>Hakkında</Link>\n      <Link href={getLink('user', { id: 123 })}>Kullanıcı Profili</Link>\n    </nav>\n  );\n}\n```\n\n### Router ile Kullanım\n\n```tsx\nimport { useRouter } from 'next/router';\nimport { getLink } from '@avicennateknoloji/next-centralized-link';\n\nfunction MyComponent() {\n  const router = useRouter();\n  \n  const handleNavigation = () => {\n    router.push(getLink('user', { id: 456 }));\n  };\n  \n  return (\n    <button onClick={handleNavigation}>\n      Kullanıcı Profiline Git\n    </button>\n  );\n}\n```\n\n## 🔧 API Referansı\n\n### `centralizedLink(key, linkFunction)`\n\nYeni bir route tanımı ekler.\n\n**Parametreler:**\n- `key` (string): Route'un benzersiz anahtarı\n- `linkFunction` (function): Route'u oluşturan fonksiyon\n\n**Örnek:**\n```typescript\ncentralizedLink('user', ({ id }) => `/user/${id}`);\n```\n\n### `getLink(key, params?)`\n\nTanımlanan route'u alır.\n\n**Parametreler:**\n- `key` (string): Route anahtarı\n- `params` (object, opsiyonel): Route parametreleri\n\n**Döndürür:** string - Route URL'si\n\n**Örnek:**\n```typescript\nconst url = getLink('user', { id: 123 }); // '/user/123'\n```\n\n### `hasLink(key)`\n\nBelirli bir route'un tanımlı olup olmadığını kontrol eder.\n\n**Parametreler:**\n- `key` (string): Route anahtarı\n\n**Döndürür:** boolean\n\n**Örnek:**\n```typescript\nconst exists = hasLink('user'); // true veya false\n```\n\n### `getDefinedLinks()`\n\nTüm tanımlanan route'ları listeler.\n\n**Döndürür:** string[] - Tanımlanan route anahtarları\n\n**Örnek:**\n```typescript\nconst allLinks = getDefinedLinks(); // ['home', 'about', 'user', ...]\n```\n\n## 💡 Örnekler\n\n### E-ticaret Sitesi Route'ları\n\n```typescript\nimport { centralizedLink, getLink } from '@avicennateknoloji/next-centralized-link';\n\n// Route tanımları\ncentralizedLink('home', () => '/');\ncentralizedLink('products', () => '/products');\ncentralizedLink('product', ({ id }) => `/product/${id}`);\ncentralizedLink('category', ({ slug }) => `/category/${slug}`);\ncentralizedLink('cart', () => '/cart');\ncentralizedLink('checkout', () => '/checkout');\ncentralizedLink('user', ({ id }) => `/user/${id}`);\ncentralizedLink('orders', ({ userId }) => `/user/${userId}/orders`);\n\n// Kullanım örnekleri\nconst productUrl = getLink('product', { id: 'abc123' }); // '/product/abc123'\nconst categoryUrl = getLink('category', { slug: 'electronics' }); // '/category/electronics'\nconst ordersUrl = getLink('orders', { userId: 456 }); // '/user/456/orders'\n```\n\n### Blog Route'ları\n\n```typescript\ncentralizedLink('blog', () => '/blog');\ncentralizedLink('post', ({ slug }) => `/blog/${slug}`);\ncentralizedLink('author', ({ username }) => `/author/${username}`);\ncentralizedLink('tag', ({ tag }) => `/tag/${tag}`);\ncentralizedLink('archive', ({ year, month }) => `/archive/${year}/${month}`);\n\n// Kullanım\nconst postUrl = getLink('post', { slug: 'nextjs-tips' }); // '/blog/nextjs-tips'\nconst authorUrl = getLink('author', { username: 'johndoe' }); // '/author/johndoe'\nconst archiveUrl = getLink('archive', { year: 2023, month: 12 }); // '/archive/2023/12'\n```\n\n## 🛡️ TypeScript Desteği\n\nBu paket tam TypeScript desteği ile gelir:\n\n```typescript\nimport type { RouteParams, CentralizedLinkFunction } from '@avicennateknoloji/next-centralized-link';\n\n// Tip güvenli route tanımları\nconst userRoute: CentralizedLinkFunction = ({ id }: RouteParams) => `/user/${id}`;\ncentralizedLink('user', userRoute);\n```\n\n## 🎯 Avantajlar\n\n- **Merkezileştirilmiş Yönetim**: Tüm route'lar tek yerden yönetilir\n- **Tip Güvenliği**: Full TypeScript desteği\n- **Kolay Refaktoring**: Route değişiklikleri tek yerden yapılır\n- **Hata Azaltma**: Yanlış URL yazma riskini minimuma indirir\n- **Next.js Uyumluluğu**: Hem App Router hem Pages Router ile uyumlu\n\n## 📄 Lisans\n\nMIT\n\n## 🤝 Katkıda Bulunma\n\nKatkılarınızı bekliyoruz! Lütfen pull request göndermeden önce issue açın.\n\n---\n\nBu paket Next.js projelerinde route yönetimini kolaylaştırmak için tasarlanmıştır. Herhangi bir sorunuz varsa issue açmaktan çekinmeyin! ","readmeFilename":"README.md","_rev":"1-f623cf56ea2323bd38002bb7de3ce0e9"}