From 4b352bb8e6856e0969fe132b2cd4fd73c70092d8 Mon Sep 17 00:00:00 2001 From: Nazar Kornienko Date: Sun, 11 Aug 2024 19:48:57 +0200 Subject: [PATCH] v1.3.0-canary.3 --- .github/CHANGELOG.md | 4 +- .github/TRANSLATIONS.md | 2 +- README.md | 10 +- addons/scripts/reliverse/quotes/lines.ts | 2 +- .../setup/configs/knip.recommended.json | 4 +- .../setup/configs/next.config.clean.ts | 21 --- .../setup/configs/next.config.minimal.ts | 125 +++++------- .../setup/configs/next.config.recommended.ts | 178 +++++++++--------- knip.json | 4 +- next.config.js | 178 +++++++++--------- package.json | 2 +- pnpm-lock.yaml | 24 +-- reliverse.info.ts | 2 +- src/components/Common/stars.tsx | 10 +- 14 files changed, 271 insertions(+), 295 deletions(-) delete mode 100644 addons/scripts/reliverse/relicon/setup/configs/next.config.clean.ts diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index a53d356a..c25f4d95 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -14,7 +14,7 @@ For those who are viewing the current markdown file using: ### 1.2.6 - August 4, 2024 – The Resurrection Update -Below you can see a copy of [the article from Bleverse Docs](https://docs.bleverse.com/en/blog/relivator/v126), which may be a bit outdated below. Please refer to [this blog post](https://docs.bleverse.com/en/blog/relivator/v126) to read the most recent version. Bleverse Docs also has translations of the article into other languages; and will contain even more information about Relivator than this README.md, including notes from all past and future releases. +Below you can see a copy of [the article from Reliverse Docs](https://docs.reliverse.com/en/relivator/v126), which may be a bit outdated below. Please refer to [this blog post](https://docs.reliverse.com/en/relivator/v126) to read the most recent version. Reliverse Docs also has translations of the article into other languages; and will contain even more information about Relivator than this README.md, including notes from all past and future releases. **Relivator is Back with Version 1.2.6!** πŸ₯³ @@ -167,7 +167,7 @@ How to Install and Get Started? Please visit [the project's README](../README.md -Please visit the CHANGELOG.md or [Bleverse Docs](https://docs.bleverse.com/en/blog/relivator/changelog) to read the older versions release notes. +Please visit the CHANGELOG.md or [Reliverse Docs](https://docs.reliverse.com/en/relivator) to read the older versions release notes. ### Everyone! Thank You πŸ™ diff --git a/.github/TRANSLATIONS.md b/.github/TRANSLATIONS.md index 529a996d..4f72c293 100644 --- a/.github/TRANSLATIONS.md +++ b/.github/TRANSLATIONS.md @@ -6,7 +6,7 @@ For those who are viewing the current markdown file using: – GitHub: Does this .md file appear different from what you are used to seeing on GitHub? Ensure the URL does not end with "?plain=1". --> -[πŸ“– Docs](https://docs.bleverse.com) +[πŸ“– Docs](https://docs.reliverse.com/en) Are you fluent in a language other than English? the expertise is invaluable to us! diff --git a/README.md b/README.md index d066644e..09a78a7b 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ Our goal is to create the world's most feature-rich and globally accessible Next ## The Huge Relivator 1.2.6 is Finally Available -[**πŸ‘‰ Read the Detailed Blog Post About This Update πŸ‘ˆ**](https://docs.bleverse.com/en/blog/relivator/v126) +[**πŸ‘‰ Read the Detailed Blog Post About This Update πŸ‘ˆ**](https://docs.reliverse.com/en/relivator/v126) Relivator 1.2.6 was released on August 4, 2024! We are now actively working on the next major update, Relivator 1.3.0, with the goal of making the project production-ready, clean, and high-quality. Please join us in actively searching for issues, contributing freely, and earning cool rewards. A canary branch will be launched soon, and the dev branch is already available for a limited time to all sponsors at any paid pledge level. @@ -252,7 +252,7 @@ Below are some scripts configured in the `scripts` section of the `package.json` ```bash # pnpm tsx reliverse.config.ts --details β„Ή β–² Framework: Relivator v1.2.6 β–² Engine: Reliverse v0.4.0 β–² Hotline: https://discord.gg/Pb8uKbwpsJ -β„Ή Relivator v1.2.6 Release Blog Post πŸ‘‰ https://docs.bleverse.com/en/blog/relivator/v126 +β„Ή Relivator v1.2.6 Release Blog Post πŸ‘‰ https://docs.reliverse.com/en/relivator/v126 β„Ή Help Relivator become even better! Please star the repo – https://github.com/blefnk/relivator β„Ή For experienced users: run 'pnpm reli:prepare' to update all dependencies to the latest versions and check if the code requires any adjustments. β„Ή Meet quality standards: run 'pnpm appts' and 'pnpm fix:putout-unstable' to get linting, formatting, and more. @@ -854,7 +854,7 @@ Alternatively, check the GitHub docs on [how to create a pull request](https://h - [ ] 49. Implement Relivator's/Reliverse's own version of [Saas UI](https://saas-ui.dev) to be fully compatible with our project with only needed functionality, with using Tailwind and Shadcn instead of Chakra. - [ ] 50. Implement our own fork of [Radix Themes](https://radix-ui.com) library with set up `
` as wrapper instead of its current `
`; OR implement our very own solution which generates Tailwind instead of Radix's classes. - [ ] 51. Implement full [Million.js](https://million.dev) support (read [Million 3.0 Announcement](https://million.dev/blog/million-3) to learn more). -- [ ] 52. Implement file uploads using [UploadThing](https://uploadthing.com) and [Cloudinary](https://cloudinary.com). +- [ ] 52. Implement file uploads using [UploadThing](https://uploadthing.com) and [Cloudinary](https://cloudinary.com) (NOTE: "res.cloudinary.com" and "utfs.io" should be added to `nextConfig.images.remotePatterns`). - [ ] 53. Implement dynamic switching between app features, like database provider, by making corresponding checks for environment variables. - [ ] 54. Implement docs to the project and move each explanation from the code into that docs. - [ ] 55. Implement deep feature-parity and easy-migration compatibility with Reliverse. @@ -924,7 +924,7 @@ This project is licensed under [the MIT License](https://choosealicense.com/lice ### 1.2.6 - August 4, 2024 – The Resurrection Update -Below you can see a small copy of [the article from Bleverse Docs](https://docs.bleverse.com/en/blog/relivator/v126), which is possibly outdated. Please refer to [1.2.6 Release Notes Page on GitHub](https://github.com/blefnk/relivator-nextjs-template/releases/tag/1.2.6) or to [this blog post](https://docs.bleverse.com/en/blog/relivator/v126) to read the most recent version. Bleverse Docs also has translations of the article into other languages; and will contain even more information about Relivator than this README.md, including notes from all past and future releases. +Below you can see a small copy of [the article from Reliverse Docs](https://docs.reliverse.com/en/relivator/v126), which is possibly outdated. Please refer to [1.2.6 Release Notes Page on GitHub](https://github.com/blefnk/relivator-nextjs-template/releases/tag/1.2.6) or to [this blog post](https://docs.reliverse.com/en/relivator/v126) to read the most recent version. Reliverse Docs also has translations of the article into other languages; and will contain even more information about Relivator than this README.md, including notes from all past and future releases. **Relivator is Back with Version 1.2.6!** πŸ₯³ @@ -1083,7 +1083,7 @@ How to Install and Get Started? Please refer to the [πŸ—οΈ Installation](#inst -Please visit the [CHANGELOG.md](.github/CHANGELOG.md) or [Bleverse Docs](https://docs.bleverse.com/en/blog/relivator/changelog) to read the release notes for older versions. +Please visit the [CHANGELOG.md](.github/CHANGELOG.md) or [Reliverse Docs](https://docs.reliverse.com/en/relivator) to read the release notes for older versions. ## The Final Words diff --git a/addons/scripts/reliverse/quotes/lines.ts b/addons/scripts/reliverse/quotes/lines.ts index 87aa76eb..d51870b0 100644 --- a/addons/scripts/reliverse/quotes/lines.ts +++ b/addons/scripts/reliverse/quotes/lines.ts @@ -70,7 +70,7 @@ export function getWebDevelopmentAdvice(level: TLevel): string { // Personalized quotes and reviews export const personalQuotes = [ - "[Relivator v1.2.6 Release Blog Post] πŸ‘‰ https://docs.bleverse.com/en/blog/relivator/v126", + "[Relivator v1.2.6 Release Blog Post] πŸ‘‰ https://docs.reliverse.com/en/relivator/v126", "Isn't coding so much better with some good music? Try working with Relivator while you listen to the beautiful songs on the MF Piano YouTube channel (https://youtube.com/@mfpiano). My brother runs the channel and would really appreciate your support. Subscribing, watching, liking, and commenting would help his channel grow. Thanks a bunch! Β© blefnk", "For experienced users: run 'pnpm reli:prepare' to update all dependencies to the latest versions and check if the code requires any adjustments.", "I learned a lot from using the Relivator project! I see the hard work that was put into it. It's truly an amazing open-source starter; I have built my startup using it. @blefnk, your hard work is impressive; it's astonishing how you manage it all alone. Β© demiroo (Γ–zkan Demir)", diff --git a/addons/scripts/reliverse/relicon/setup/configs/knip.recommended.json b/addons/scripts/reliverse/relicon/setup/configs/knip.recommended.json index c287959c..10bc4a86 100644 --- a/addons/scripts/reliverse/relicon/setup/configs/knip.recommended.json +++ b/addons/scripts/reliverse/relicon/setup/configs/knip.recommended.json @@ -194,7 +194,6 @@ "addons/scripts/reliverse/relicon/setup/configs/eslint.config.minimal.ts", "addons/scripts/reliverse/relicon/setup/configs/eslint.config.rules-disabled.ts", "addons/scripts/reliverse/relicon/setup/configs/eslint.config.ultimate.ts", - "addons/scripts/reliverse/relicon/setup/configs/next.config.clean.ts", "addons/scripts/reliverse/relicon/setup/configs/next.config.minimal.ts", "addons/scripts/reliverse/relicon/setup/configs/next.config.recommended.ts", "addons/scripts/reliverse/relicon/setup/prompt/env.ts", @@ -248,6 +247,8 @@ ], "ignoreBinaries": ["codemod", "eslint_d", "py", "ruff", "stripe", "vercel"], "ignoreDependencies": [ + "@million/lint", + "@next/bundle-analyzer", "@putout/.+", "@radix-ui/react-alert-dialog", "@radix-ui/react-hover-card", @@ -268,6 +269,7 @@ "eslint-plugin-putout", "input-otp", "jsonc-eslint-parser", + "million", "montag", "next-superjson-plugin", "node-fetch-native", diff --git a/addons/scripts/reliverse/relicon/setup/configs/next.config.clean.ts b/addons/scripts/reliverse/relicon/setup/configs/next.config.clean.ts deleted file mode 100644 index 47afe345..00000000 --- a/addons/scripts/reliverse/relicon/setup/configs/next.config.clean.ts +++ /dev/null @@ -1,21 +0,0 @@ -import createNextIntlPlugin from "next-intl/plugin"; - -await import("~/env.js"); - -const withNextIntl = createNextIntlPlugin(); - -/** @type {import('next').NextConfig} */ -const nextConfig = { - images: { - remotePatterns: [ - { - hostname: "img.clerk.com", - port: "", - protocol: "https", - }, - ], - }, -}; - -// @ts-expect-error TODO: fix -export default withNextIntl(nextConfig); diff --git a/addons/scripts/reliverse/relicon/setup/configs/next.config.minimal.ts b/addons/scripts/reliverse/relicon/setup/configs/next.config.minimal.ts index 6a0a3c64..fe97f21e 100644 --- a/addons/scripts/reliverse/relicon/setup/configs/next.config.minimal.ts +++ b/addons/scripts/reliverse/relicon/setup/configs/next.config.minimal.ts @@ -1,98 +1,73 @@ -// Everything starts here. This is the main Next.js configuration file. -// The Reliverse Next Config comes with minimal and recommended configurations. -// Run `pnpm reli:setup` to easily switch between them and set up other -// tools. If you want to try all new Next.js features and -// Million.js, choose the recommended configuration. -// P.S. The *.mjs extension is not needed anymore -// because the package.json type module is used. - import createMDX from "@next/mdx"; import createNextIntlPlugin from "next-intl/plugin"; import remarkGfm from "remark-gfm"; +// The Reliverse Next Config comes with minimal and recommended configurations. +// Run `pnpm reli:setup` to easily switch between them and set up other tools. +// If you want to try all new Next.js features and Million.js, choose the recommended configuration. +// P.S. The *.mjs extension is no longer necessary because the package.json type module is used. await import("~/env.js"); -// Uncomment the following lines to enable the Vercel Toolbar (and component in RootLocaleLayout) -// import withVercelToolbar from "@vercel/toolbar/plugins/next"; -// -// The whitelist list of domains that are allowed to show media content - -const hostnames = [ - "*.githubusercontent.com", - "*.googleusercontent.com", - "api.dicebear.com", - "cdn.discordapp.com", - "discordapp.com", - "githubusercontent.com", - "googleusercontent.com", - "i.imgur.com", - "images.unsplash.com", - "img.youtube.com", - "pbs.twimg.com", - "res.cloudinary.com", - "utfs.io", - "www.gravatar.com", - "img.clerk.com", - "images.clerk.com", -]; - -// @see https://nextjs.org/docs/app/building-the-application/configuring /** @type {import('next').NextConfig} */ const nextConfig = { - experimental: { - // React Compiler currently uses Webpack/Babel only, so it may slightly slow down the build - // reactCompiler: false, - mdxRs: true, - optimizePackageImports: ["lucide-react", "@radix-ui/react-icons"], - ppr: false, // true - supported by next@canary only - // uncomment if you use superjson in 'browser' context - // swcPlugins: [ - // [ - // "next-superjson-plugin", - // { - // excluded: [], - // }, - // ], - // ], - }, images: { formats: ["image/avif", "image/webp"], - remotePatterns: hostnames.map((hostname) => ({ - hostname, - protocol: "https", - })), + remotePatterns: [ + { + port: "", + protocol: "https", + hostname: "utfs.io", + }, + { + port: "", + protocol: "https", + hostname: "img.clerk.com", + }, + { + port: "", + protocol: "https", + hostname: "api.dicebear.com", + }, + { + port: "", + protocol: "https", + hostname: "cdn.discordapp.com", + }, + { + port: "", + protocol: "https", + hostname: "lh3.googleusercontent.com", + }, + { + port: "", + protocol: "https", + hostname: "avatars.githubusercontent.com", + }, + ], }, - pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"], - // Adobe React Spectrum (next dev --turbo is not supported) - // transpilePackages: [ - // "@adobe/react-spectrum", - // "@react-spectrum/*", - // "@spectrum-icons/*", - // ].flatMap((spec) => glob.sync(spec, { cwd: "node_modules/" })), + experimental: { + mdxRs: true, + optimizePackageImports: [ + "recharts", + "lucide-react", + "@radix-ui/react-icons", + "@radix-ui/react-avatar", + "@radix-ui/react-select", + ], + }, + pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"], }; -// Create a config wrapper required to integrate a modern Next.js MDX support -// @see https://nextjs.org/docs/app/building-the-application/configuring/mdx const withMDX = createMDX({ - // extension: /\.mdx?$/, options: { - rehypePlugins: [], remarkPlugins: [remarkGfm], }, }); -// Create a configuration wrapper required to change the default next-intl config location -// @see https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing const withIntl = createNextIntlPlugin("./src/i18n.ts"); -// Uncomment the following lines to enable the Vercel Toolbar (and component in RootLocaleLayout) -// -// const reliverseConfig = withIntl(withMDX(nextConfig)); -// const reliverseConfigWithVercelToolbar = withVercelToolbar()(reliverseConfig); -// Export the chained config -// export default process.env.ENABLE_VERCEL_TOOLBAR -// ? reliverseConfigWithVercelToolbar -// : reliverseConfig; // @ts-expect-error TODO: fix -export default withIntl(withMDX(nextConfig)); +const chainedNextConfig = withIntl(withMDX(nextConfig)); + +export default chainedNextConfig; diff --git a/addons/scripts/reliverse/relicon/setup/configs/next.config.recommended.ts b/addons/scripts/reliverse/relicon/setup/configs/next.config.recommended.ts index 10ade09e..edc77ad0 100644 --- a/addons/scripts/reliverse/relicon/setup/configs/next.config.recommended.ts +++ b/addons/scripts/reliverse/relicon/setup/configs/next.config.recommended.ts @@ -1,68 +1,87 @@ -import MillionLint from "@million/lint"; -import bundleAnalyzer from "@next/bundle-analyzer"; import createMDX from "@next/mdx"; -import million from "million/compiler"; import createNextIntlPlugin from "next-intl/plugin"; import remarkGfm from "remark-gfm"; -await import("~/env.js"); - -// Everything starts here. This is the main Next.js configuration file. // The Reliverse Next Config comes with minimal and recommended configurations. -// Run `pnpm reli:setup` to easily switch between them and set up other -// tools. If you want to try all new Next.js features and -// Million.js, choose the recommended configuration. -// P.S. The *.mjs extension is not needed anymore -// because the package.json type module is used. - -const millionEnabled = false; // unstable - -// Uncomment the following lines to enable the Vercel Toolbar (and component in RootLocaleLayout) -// import withVercelToolbar from "@vercel/toolbar/plugins/next"; +// Run `pnpm reli:setup` to easily switch between them and set up other tools. +// If you want to try all new Next.js features and Million.js, choose the recommended configuration. +// P.S. The *.mjs extension is no longer necessary because the package.json type module is used. +await import("~/env.js"); -// The whitelist list of domains that are allowed to show media content -const hostnames = [ - "*.githubusercontent.com", - "*.googleusercontent.com", - "api.dicebear.com", - "cdn.discordapp.com", - "discordapp.com", - "githubusercontent.com", - "googleusercontent.com", - "i.imgur.com", - "images.unsplash.com", - "img.youtube.com", - "pbs.twimg.com", - "res.cloudinary.com", - "utfs.io", - "www.gravatar.com", - "img.clerk.com", - "images.clerk.com", -]; - -// Everything starts here, this is the main Next.js configuration file +// Everything starts here; this is the main Next.js configuration file. // @see https://nextjs.org/docs/app/building-the-application/configuring /** @type {import('next').NextConfig} */ const nextConfig = { - compress: true, + images: { + formats: ["image/avif", "image/webp"], + + // The whitelist of domains allowed to display media content. + // @see https://nextjs.org/docs/app/api-reference/components/image + remotePatterns: [ + { + port: "", + protocol: "https", + hostname: "utfs.io", + }, + { + port: "", + protocol: "https", + hostname: "img.clerk.com", + }, + { + port: "", + protocol: "https", + hostname: "api.dicebear.com", + }, + { + port: "", + protocol: "https", + hostname: "cdn.discordapp.com", + }, + { + port: "", + protocol: "https", + hostname: "lh3.googleusercontent.com", + }, + { + port: "", + protocol: "https", + hostname: "avatars.githubusercontent.com", + }, + ], + + // ?| The following shorthand is most equivalent to + // the above, but performance is not tested too much. + // Remember to add: const hostnames = ["example.com"]; + // remotePatterns: hostnames.map((hostname) => ({ + // hostname, + // protocol: "https", + // })), + }, + experimental: { - // React Compiler currently uses Webpack/Babel - // only, so it may slightly slow down the build - // reactCompiler: false, - // after: true, mdxRs: true, - optimisticClientCache: true, + + // The React Compiler currently uses Webpack/Babel only, + // so it may slightly slow down the build. + // reactCompiler: false, // next@canary only + optimizePackageImports: [ "recharts", "lucide-react", "@radix-ui/react-icons", "@radix-ui/react-avatar", "@radix-ui/react-select", - "date-fns", ], - optimizeServerReact: true, - ppr: false, // true - supported by next@canary only - // uncomment if you use superjson in 'browser' context + + // ?| The following options are untested too much, performance may vary. + // after: true, // next@canary only + // ppr: false, // next@canary only + // optimisticClientCache: true, + // optimizeServerReact: true, + // serverMinification: true, + + // ?| Uncomment if you use superjson in the 'browser' context. // swcPlugins: [ // [ // "next-superjson-plugin", @@ -71,18 +90,11 @@ const nextConfig = { // }, // ], // ], - serverMinification: true, - }, - images: { - formats: ["image/avif", "image/webp"], - remotePatterns: hostnames.map((hostname) => ({ - hostname, - protocol: "https", - })), }, pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"], - // Adobe React Spectrum (next dev --turbo is not supported) + // ?| Uncomment the following to enable Adobe React Spectrum. + // Note: `next dev --turbo` is not supported yet by this library. // transpilePackages: [ // "@adobe/react-spectrum", // "@react-spectrum/*", @@ -90,51 +102,45 @@ const nextConfig = { // ].flatMap((spec) => glob.sync(spec, { cwd: "node_modules/" })), }; -// Create a config wrapper required to integrate a modern Next.js MDX support +// Create a configuration wrapper required to integrate modern Next.js MDX support. // @see https://nextjs.org/docs/app/building-the-application/configuring/mdx const withMDX = createMDX({ // extension: /\.mdx?$/, options: { // providerImportSource: "@mdx-js/react", - rehypePlugins: [], remarkPlugins: [remarkGfm], }, }); -// Create a configuration wrapper required to change the default next-intl config location +// Create a configuration wrapper required to change the default next-intl config location. // @see https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing const withIntl = createNextIntlPlugin("./src/i18n.ts"); -// Next.js Bundle Analyzer helps you manage the size of the JavaScript modules +// ======================================================================= +// !| ADVANCED CONFIGURATION +// ======================================================================= + +// ?| Uncomment the following to enable the Next.js Bundle Analyzer. +// Also, make sure to wrap nextConfig with the withAnalyzer function. +// import bundleAnalyzer from "@next/bundle-analyzer"; +// Next.js Bundle Analyzer helps you manage the size of the JavaScript modules. // @see https://nextjs.org/docs/app/building-the-application/optimizing/bundle-analyzer -const withAnalyzer = bundleAnalyzer({ - // eslint-disable-next-line no-restricted-properties - enabled: process.env.ANALYZE === "true", - openAnalyzer: false, -}); +// const withAnalyzer = bundleAnalyzer({ enabled: process.env.ANALYZE === "true", openAnalyzer: false }); +// !| Next.js Configuration Chaining: // @ts-expect-error TODO: fix -const chainedNextConfig = withAnalyzer(withIntl(withMDX(nextConfig))); - -const reliverseConfig = million.next( - MillionLint.next({ - // Million Lint Configuration - // @see https://million.dev - rsc: true, - })(chainedNextConfig), - { - // Million.js Compiler Configuration - auto: { - rsc: true, - }, - rsc: true, - }, -); +const chainedNextConfig = withIntl(withMDX(nextConfig)); -// const reliverseConfigWithVercelToolbar = withVercelToolbar()(reliverseConfig); +// ?| Uncomment the following to enable the Million Lint & Million Compiler. +// import MillionLint from "@million/lint"; +// import million from "million/compiler"; +// [@see https://million.dev] Million Lint & Million Compiler Configuration +// const chainedNextConfig = million.next(MillionLint.next({ rsc: true })(chainedNextConfig), +// { auto: { rsc: true }, rsc: true } ); -// export default process.env.ENABLE_VERCEL_TOOLBAR -// ? reliverseConfigWithVercelToolbar -// : reliverseConfig; +// ?| Uncomment the following to enable the Vercel Toolbar (and component in RootLocaleLayout). +// import withVercelToolbar from "@vercel/toolbar/plugins/next"; +// const chainedNextConfigWithVercelToolbar = withVercelToolbar()(chainedNextConfig); +// export default process.env.ENABLE_VERCEL_TOOLBAR ? chainedNextConfigWithVercelToolbar : chainedNextConfig; -export default millionEnabled ? reliverseConfig : chainedNextConfig; +export default chainedNextConfig; diff --git a/knip.json b/knip.json index c287959c..10bc4a86 100644 --- a/knip.json +++ b/knip.json @@ -194,7 +194,6 @@ "addons/scripts/reliverse/relicon/setup/configs/eslint.config.minimal.ts", "addons/scripts/reliverse/relicon/setup/configs/eslint.config.rules-disabled.ts", "addons/scripts/reliverse/relicon/setup/configs/eslint.config.ultimate.ts", - "addons/scripts/reliverse/relicon/setup/configs/next.config.clean.ts", "addons/scripts/reliverse/relicon/setup/configs/next.config.minimal.ts", "addons/scripts/reliverse/relicon/setup/configs/next.config.recommended.ts", "addons/scripts/reliverse/relicon/setup/prompt/env.ts", @@ -248,6 +247,8 @@ ], "ignoreBinaries": ["codemod", "eslint_d", "py", "ruff", "stripe", "vercel"], "ignoreDependencies": [ + "@million/lint", + "@next/bundle-analyzer", "@putout/.+", "@radix-ui/react-alert-dialog", "@radix-ui/react-hover-card", @@ -268,6 +269,7 @@ "eslint-plugin-putout", "input-otp", "jsonc-eslint-parser", + "million", "montag", "next-superjson-plugin", "node-fetch-native", diff --git a/next.config.js b/next.config.js index f1a42290..af3f0e85 100644 --- a/next.config.js +++ b/next.config.js @@ -1,68 +1,87 @@ -import MillionLint from "@million/lint"; -import bundleAnalyzer from "@next/bundle-analyzer"; import createMDX from "@next/mdx"; -import million from "million/compiler"; import createNextIntlPlugin from "next-intl/plugin"; import remarkGfm from "remark-gfm"; -await import("./src/env.js"); - -// Everything starts here. This is the main Next.js configuration file. // The Reliverse Next Config comes with minimal and recommended configurations. -// Run `pnpm reli:setup` to easily switch between them and set up other -// tools. If you want to try all new Next.js features and -// Million.js, choose the recommended configuration. -// P.S. The *.mjs extension is not needed anymore -// because the package.json type module is used. - -const millionEnabled = false; // unstable - -// Uncomment the following lines to enable the Vercel Toolbar (and component in RootLocaleLayout) -// import withVercelToolbar from "@vercel/toolbar/plugins/next"; +// Run `pnpm reli:setup` to easily switch between them and set up other tools. +// If you want to try all new Next.js features and Million.js, choose the recommended configuration. +// P.S. The *.mjs extension is no longer necessary because the package.json type module is used. +await import("./src/env.js"); -// The whitelist list of domains that are allowed to show media content -const hostnames = [ - "*.githubusercontent.com", - "*.googleusercontent.com", - "api.dicebear.com", - "cdn.discordapp.com", - "discordapp.com", - "githubusercontent.com", - "googleusercontent.com", - "i.imgur.com", - "images.unsplash.com", - "img.youtube.com", - "pbs.twimg.com", - "res.cloudinary.com", - "utfs.io", - "www.gravatar.com", - "img.clerk.com", - "images.clerk.com", -]; - -// Everything starts here, this is the main Next.js configuration file +// Everything starts here; this is the main Next.js configuration file. // @see https://nextjs.org/docs/app/building-the-application/configuring /** @type {import('next').NextConfig} */ const nextConfig = { - compress: true, + images: { + formats: ["image/avif", "image/webp"], + + // The whitelist of domains allowed to display media content. + // @see https://nextjs.org/docs/app/api-reference/components/image + remotePatterns: [ + { + port: "", + protocol: "https", + hostname: "utfs.io", + }, + { + port: "", + protocol: "https", + hostname: "img.clerk.com", + }, + { + port: "", + protocol: "https", + hostname: "api.dicebear.com", + }, + { + port: "", + protocol: "https", + hostname: "cdn.discordapp.com", + }, + { + port: "", + protocol: "https", + hostname: "lh3.googleusercontent.com", + }, + { + port: "", + protocol: "https", + hostname: "avatars.githubusercontent.com", + }, + ], + + // ?| The following shorthand is most equivalent to + // the above, but performance is not tested too much. + // Remember to add: const hostnames = ["example.com"]; + // remotePatterns: hostnames.map((hostname) => ({ + // hostname, + // protocol: "https", + // })), + }, + experimental: { - // React Compiler currently uses Webpack/Babel - // only, so it may slightly slow down the build - // reactCompiler: false, - // after: true, mdxRs: true, - optimisticClientCache: true, + + // The React Compiler currently uses Webpack/Babel only, + // so it may slightly slow down the build. + // reactCompiler: false, // next@canary only + optimizePackageImports: [ "recharts", "lucide-react", "@radix-ui/react-icons", "@radix-ui/react-avatar", "@radix-ui/react-select", - "date-fns", ], - optimizeServerReact: true, - ppr: false, // true - supported by next@canary only - // uncomment if you use superjson in 'browser' context + + // ?| The following options are untested too much, performance may vary. + // after: true, // next@canary only + // ppr: false, // next@canary only + // optimisticClientCache: true, + // optimizeServerReact: true, + // serverMinification: true, + + // ?| Uncomment if you use superjson in the 'browser' context. // swcPlugins: [ // [ // "next-superjson-plugin", @@ -71,18 +90,11 @@ const nextConfig = { // }, // ], // ], - serverMinification: true, - }, - images: { - formats: ["image/avif", "image/webp"], - remotePatterns: hostnames.map((hostname) => ({ - hostname, - protocol: "https", - })), }, pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"], - // Adobe React Spectrum (next dev --turbo is not supported) + // ?| Uncomment the following to enable Adobe React Spectrum. + // Note: `next dev --turbo` is not supported yet by this library. // transpilePackages: [ // "@adobe/react-spectrum", // "@react-spectrum/*", @@ -90,50 +102,44 @@ const nextConfig = { // ].flatMap((spec) => glob.sync(spec, { cwd: "node_modules/" })), }; -// Create a config wrapper required to integrate a modern Next.js MDX support +// Create a configuration wrapper required to integrate modern Next.js MDX support. // @see https://nextjs.org/docs/app/building-the-application/configuring/mdx const withMDX = createMDX({ // extension: /\.mdx?$/, options: { // providerImportSource: "@mdx-js/react", - rehypePlugins: [], remarkPlugins: [remarkGfm], }, }); -// Create a configuration wrapper required to change the default next-intl config location +// Create a configuration wrapper required to change the default next-intl config location. // @see https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing const withIntl = createNextIntlPlugin("./src/i18n.ts"); -// Next.js Bundle Analyzer helps you manage the size of the JavaScript modules +// ======================================================================= +// !| ADVANCED CONFIGURATION +// ======================================================================= + +// ?| Uncomment the following to enable the Next.js Bundle Analyzer. +// Also, make sure to wrap nextConfig with the withAnalyzer function. +// import bundleAnalyzer from "@next/bundle-analyzer"; +// Next.js Bundle Analyzer helps you manage the size of the JavaScript modules. // @see https://nextjs.org/docs/app/building-the-application/optimizing/bundle-analyzer -const withAnalyzer = bundleAnalyzer({ - // eslint-disable-next-line no-restricted-properties - enabled: process.env.ANALYZE === "true", - openAnalyzer: false, -}); +// const withAnalyzer = bundleAnalyzer({ enabled: process.env.ANALYZE === "true", openAnalyzer: false }); -const chainedNextConfig = withAnalyzer(withIntl(withMDX(nextConfig))); - -const reliverseConfig = million.next( - MillionLint.next({ - // Million Lint Configuration - // @see https://million.dev - rsc: true, - })(chainedNextConfig), - { - // Million.js Compiler Configuration - auto: { - rsc: true, - }, - rsc: true, - }, -); +// !| Next.js Configuration Chaining: +const chainedNextConfig = withIntl(withMDX(nextConfig)); -// const reliverseConfigWithVercelToolbar = withVercelToolbar()(reliverseConfig); +// ?| Uncomment the following to enable the Million Lint & Million Compiler. +// import MillionLint from "@million/lint"; +// import million from "million/compiler"; +// [@see https://million.dev] Million Lint & Million Compiler Configuration +// const chainedNextConfig = million.next(MillionLint.next({ rsc: true })(chainedNextConfig), +// { auto: { rsc: true }, rsc: true } ); -// export default process.env.ENABLE_VERCEL_TOOLBAR -// ? reliverseConfigWithVercelToolbar -// : reliverseConfig; +// ?| Uncomment the following to enable the Vercel Toolbar (and component in RootLocaleLayout). +// import withVercelToolbar from "@vercel/toolbar/plugins/next"; +// const chainedNextConfigWithVercelToolbar = withVercelToolbar()(chainedNextConfig); +// export default process.env.ENABLE_VERCEL_TOOLBAR ? chainedNextConfigWithVercelToolbar : chainedNextConfig; -export default millionEnabled ? reliverseConfig : chainedNextConfig; +export default chainedNextConfig; diff --git a/package.json b/package.json index 07cb4e27..8b0d3ea4 100644 --- a/package.json +++ b/package.json @@ -298,7 +298,7 @@ "string-ts": "^2.2.0", "stripe": "^16.7.0", "superjson": "^2.2.1", - "tailwind-merge": "^2.4.0", + "tailwind-merge": "^2.5.0", "tailwind-variants": "^0.2.1", "tailwindcss-animate": "^1.0.7", "tasuku": "^2.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d4f81b1f..71c28bdd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -558,8 +558,8 @@ importers: specifier: ^2.2.1 version: 2.2.1 tailwind-merge: - specifier: ^2.4.0 - version: 2.4.0 + specifier: ^2.5.0 + version: 2.5.0 tailwind-variants: specifier: ^0.2.1 version: 0.2.1(tailwindcss@3.4.9) @@ -6773,8 +6773,8 @@ packages: resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} engines: {node: '>= 12'} - comment-json@4.2.4: - resolution: {integrity: sha512-E5AjpSW+O+N5T2GsOQMHLLsJvrYw6G/AFt9GvU6NguEAfzKShh7hRiLtVo6S9KbRpFMGqE5ojo0/hE+sdteWvQ==} + comment-json@4.2.5: + resolution: {integrity: sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==} engines: {node: '>= 6'} comment-parser@1.4.1: @@ -11779,8 +11779,8 @@ packages: tailwind-merge@2.3.0: resolution: {integrity: sha512-vkYrLpIP+lgR0tQCG6AP7zZXCTLc1Lnv/CCRT3BqJ9CZ3ui2++GPaGb1x/ILsINIMSYqqvrpqjUFsMNLlW99EA==} - tailwind-merge@2.4.0: - resolution: {integrity: sha512-49AwoOQNKdqKPd9CViyH5wJoSKsCDjUlzL8DxuGp3P1FsGY36NJDAa18jLZcaHAUUuTj+JB8IAo8zWgBNvBF7A==} + tailwind-merge@2.5.0: + resolution: {integrity: sha512-a6Q/isR5XAo9IR7Hjh80BQDkn8PG9ONJpSO/U3vGzdKyKG125lPHNXdiPfeQ5X0EOG0qKlS/0qnxdBYkLlD6tA==} tailwind-variants@0.2.1: resolution: {integrity: sha512-2xmhAf4UIc3PijOUcJPA1LP4AbxhpcHuHM2C26xM0k81r0maAO6uoUSHl3APmvHZcY5cZCY/bYuJdfFa4eGoaw==} @@ -17940,7 +17940,7 @@ snapshots: '@uploadthing/shared': 6.7.8 file-selector: 0.6.0 react: 18.3.1 - tailwind-merge: 2.4.0 + tailwind-merge: 2.5.0 uploadthing: 6.13.2(express@4.19.2)(next@14.2.5(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(tailwindcss@3.4.9) optionalDependencies: next: 14.2.5(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -18742,7 +18742,7 @@ snapshots: commander@8.3.0: {} - comment-json@4.2.4: + comment-json@4.2.5: dependencies: array-timsort: 1.0.3 core-util-is: 1.0.3 @@ -18860,7 +18860,7 @@ snapshots: cspell-config-lib@8.13.2: dependencies: '@cspell/cspell-types': 8.13.2 - comment-json: 4.2.4 + comment-json: 4.2.5 yaml: 2.5.0 cspell-dictionary@8.13.2: @@ -18902,7 +18902,7 @@ snapshots: '@cspell/strong-weak-map': 8.13.2 '@cspell/url': 8.13.2 clear-module: 4.1.2 - comment-json: 4.2.4 + comment-json: 4.2.5 cspell-config-lib: 8.13.2 cspell-dictionary: 8.13.2 cspell-glob: 8.13.2 @@ -25095,11 +25095,11 @@ snapshots: dependencies: '@babel/runtime': 7.25.0 - tailwind-merge@2.4.0: {} + tailwind-merge@2.5.0: {} tailwind-variants@0.2.1(tailwindcss@3.4.9): dependencies: - tailwind-merge: 2.4.0 + tailwind-merge: 2.5.0 tailwindcss: 3.4.9 tailwindcss-animate@1.0.7(tailwindcss@3.4.9): diff --git a/reliverse.info.ts b/reliverse.info.ts index f29970a8..6cfd0a2d 100644 --- a/reliverse.info.ts +++ b/reliverse.info.ts @@ -40,7 +40,7 @@ const logSupportMessage = () => { const logUpdateInstructions = () => { consola.info( - `[${reliverse.framework.name} v1.2.6 & v1.3.0@canary Release Post] https://docs.bleverse.com/en/blog/relivator/v126`, + `[${reliverse.framework.name} v1.2.6 & v1.3.0@canary Release Post] https://docs.reliverse.com/en/relivator/v126`, ); consola.info( `Help ${reliverse.framework.name} become even better! Please, star the repo – https://github.com/blefnk/relivator`, diff --git a/src/components/Common/stars.tsx b/src/components/Common/stars.tsx index bb825086..0479cea3 100644 --- a/src/components/Common/stars.tsx +++ b/src/components/Common/stars.tsx @@ -35,9 +35,15 @@ export async function GithubStarsBadge() { md:flex `} > - -canary.1 + -canary.3 - + on GitHub ⭐{" "} {repoGithubStarsNumber && `${repoGithubStarsNumber}/1,000`}