Skip to content

Commit

Permalink
v1.3.0-canary.2
Browse files Browse the repository at this point in the history
  • Loading branch information
blefnk committed Aug 11, 2024
1 parent 2241925 commit ba326f2
Show file tree
Hide file tree
Showing 28 changed files with 830 additions and 805 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
"typescript.preferences.includePackageJsonAutoImports": "on",
"typescript.referencesCodeLens.enabled": true,
"typescript.reportStyleChecksAsWarnings": true,
"typescript.tsdk": "node_modules\\typescript\\lib",
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.updateImportsOnFileMove.enabled": "always",
"typescript.validate.enable": true,
"window.autoDetectColorScheme": true,
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Our goal is to create the world's most feature-rich and globally accessible Next

**🎉 The upcoming Relivator 1.3.0 will have as few dependencies as possible.** Everything will work thanks to @reliverse/addons. Everything will be separated into its own libraries and will be published on npmjs and/or jsr. You will be able to install exactly what you need, including functionality and UI. You will have two options. One is to install the addons the classic way using 'package.json'. The other option is that all these addons can also be installed in a style inspired by shadcn/ui, where you keep all the content directly in your project (as it is currently in test mode in Relivator 1.2.6 (please check `addons` folder or run `pnpm addons`)), although the first option will be recommended for the most use cases. 'addons' folder already contains many cool things, especially related to codemods. It also includes the @reliverse/academy game, where you can check how good you know JavaScript/TypeScript, React/Next.js, Relivator/Reliverse, and even ESLint, ecosystems (you will even find there table of records and will can contest with other players if you share data/players.json and data/progress.json save files to them; the game has also achievement system).

**🙏 Please help us reach 1500 stars on GitHub**: Once this project reaches this goal, I, @blefnk, the author of this project, will start my video course on the basics of web development (HTML, CSS, JS), React, Next.js, TypeScript, related libraries, and many other topics. This milestone will also affirm that Relivator and [Reliverse](https://github.com/blefnk/reliverse-website-builder) truly make sense to exist, leading to more frequent updates and further dedication to these projects.
**🙏 Please help us reach 1,000 stars on GitHub**: Once this project reaches this goal, I, @blefnk, the author of this project, will start my video course on the basics of web development (HTML, CSS, JS), React, Next.js, TypeScript, related libraries, and many other topics. This milestone will also affirm that Relivator and [Reliverse](https://github.com/blefnk/reliverse-website-builder) truly make sense to exist, leading to more frequent updates and further dedication to these projects.

**⭐ Bookmark this page in your browser**: This project will only get better in the future. You can also click the star at the top of the page and add the repo to your collection to keep it easily accessible.

Expand Down Expand Up @@ -176,7 +176,7 @@ Currently, I’m in a challenging financial situation, so I would greatly apprec

**How to Install and Get Started:** You have two options for installation. You can either immediately deploy to Vercel using the button below and start working on the generated repository right away (but still read the information below), or you can follow the short or detailed manual installation instructions provided.

**By The Way:** *Sometimes, we gift [`Reliverse Pro: Backers` pledge](https://patreon.com/blefnk), which gives you early access to the Reliverse projects ecosystem, including Relivator, as well as upcoming plugins, to randomly selected individuals. We also give away other interesting things. Simply `star this repository` and [let us know how to reach you](https://forms.gle/NXZ6QHpwrxh52VA36). To join the discussion, hop into [the project's Discord](https://discord.gg/Pb8uKbwpsJ).*
**By The Way:** *Sometimes, we gift `Reliverse Pro`, which gives you early access to the Reliverse projects ecosystem, including Relivator, as well as upcoming plugins, to randomly selected individuals. We also give away other interesting things. Simply `star this repository` and [let us know how to reach you](https://forms.gle/NXZ6QHpwrxh52VA36). To join the discussion, hop into [the project's Discord](https://discord.gg/Pb8uKbwpsJ).*

### One-click Installation Method (**find recommended method below**)

Expand Down Expand Up @@ -602,7 +602,7 @@ To edit product categories, please refer to the `MySQL`, `PostgreSQL`, or `LibSQ
After editing these files, don't forget to run `pnpm db:push` to apply the changes. Or run `pnpm generate` to create a sharable SQL, which another developers may apply with `pnpm migrate` to edit theirs database tables easily.
Then, simply update the category names and subcategories in the [products file](src/config/products.ts) accordingly.
Then, simply update the category names and subcategories in the [products file](src/constants/products.ts) accordingly.
## Additional Notes About Stripe
Expand Down
2 changes: 1 addition & 1 deletion addons/cluster/temp/app.await.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const loadSiteConfig = async () => {

if (!configData) {
consola.error(
"Something went wrong! Configuration file `src/config/json/appts.json` was not found!",
"Something went wrong! Configuration file `src/constants/json/appts.json` was not found!",
);

return;
Expand Down
4 changes: 2 additions & 2 deletions addons/cluster/temp/json.ts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function configureApptsJson({ apptsConfig }: ApptsConfig) {

if (!currentConfig) {
consola.error(
"Something went wrong! Configuration file `src/config/json/appts.json` was not found!",
"Something went wrong! Configuration file `src/constants/json/appts.json` was not found!",
);

return;
Expand Down Expand Up @@ -122,7 +122,7 @@ async function askForHandle(currentHandle: string): Promise<string> {
return (await text({
message:
// eslint-disable-next-line @stylistic/max-len
"Let's customize the Relivator Next.js template according to your needs. The `src/config/json/appts.json` file contains the main configuration for your product. Let's get acquainted! What's your handle (without the @ symbol)? Example:",
"Let's customize the Relivator Next.js template according to your needs. The `src/constants/json/appts.json` file contains the main configuration for your product. Let's get acquainted! What's your handle (without the @ symbol)? Example:",
placeholder: currentHandle || "blefnk",
validate: (value) => {
if (value && !/^[\da-z]+$/i.test(value)) {
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion addons/cluster/temp/tests/pw/index.ts.txt

This file was deleted.

47 changes: 47 additions & 0 deletions addons/components/ui/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,50 @@ export function Link({
</NextLink>
);
}

// =======================================================================

/* import type { AnchorHTMLAttributes, FC } from "react";
import Link from "next/link";
import type { VariantProps } from "class-variance-authority";
import { buttonVariants } from "@/components/ui/button";
import { cn } from "@/utils";
// Extending the types of the Link component to include variant
type ExtendedLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> &
VariantProps<typeof buttonVariants>;
const ExtendedLink: FC<ExtendedLinkProps> = ({
className,
href,
size,
variant,
...props
}) => {
// Get the classes for the variant
const variantClasses = buttonVariants({
size,
variant,
});
// Provide a default href if undefined
const linkHref = href || "/";
// Return the customized Link component
// with the additional classes applied
return (
<Link
{...props}
className={cn(variantClasses, className)}
href={linkHref}
/>
);
};
export { ExtendedLink as Link };
*/
// TODO: If it possible, implement a feature to parse the user's current
// TODO: URL. Then, we can redirect them to this URL after they log in.
2 changes: 1 addition & 1 deletion addons/scripts/reliverse/quotes/lines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const personalQuotes = [
"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)",
`🙏 Please help ${config.framework.name} reach 1500 stars on GitHub! Once this project reaches this goal, I will start my blog and video course on the basics of web development (HTML, CSS, JS), React, Next.js, TypeScript, related libraries, and many other topics. I will also be motivated to dedicate even more time to these projects, leading to more frequent updates. © blefnk (${config.engine.author})`,
`🙏 Please help ${config.framework.name} reach 1,000 stars on GitHub! Once this project reaches this goal, I will start my blog and video course on the basics of web development (HTML, CSS, JS), React, Next.js, TypeScript, related libraries, and many other topics. I will also be motivated to dedicate even more time to these projects, leading to more frequent updates. © blefnk (${config.engine.author})`,
`Consider contributing code to the ${config.framework.repo} repository and receive many cool gifts. Any contributions are welcome! Thank you so much!`,
`Enjoy using ${config.framework.name} and ${config.engine.name}! © blefnk (${config.engine.author})`,
`Please help Relivator become even better! Star the repo – ${config.framework.repo}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@
"logical-expressions/remove-duplicates": "off",
"logical-expressions/simplify": "off",
"madrun": "off",
"math/apply-numeric-separators": "off",
"math/apply-exponentiation": "off",
"montag/apply": "off",
"new/add-missing": "off",
Expand Down Expand Up @@ -428,7 +429,6 @@
"madrun/set-lint-dot": "off",
"madrun/set-report-lcov": "off",
"math/apply-multiplication": "off",
"math/apply-numeric-separators": "off",
"math/convert-sqrt-to-hypot": "off",
"math/declare": "off",
"nodejs/add-node-prefix": "off",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export default tseslint.config(
applyDefaultIgnorePatterns: true,
beforeBlockComment: true,
beforeLineComment: true,
ignorePattern: "@type\\s.+|@ts-expect-error|biome-ignore",
ignorePattern: "@type\\s.+|@ts-expect-error|biome-ignore|TODO:",
},
],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export default tseslint.config(
applyDefaultIgnorePatterns: true,
beforeBlockComment: true,
beforeLineComment: true,
ignorePattern: "@type\\s.+|@ts-expect-error|biome-ignore",
ignorePattern: "@type\\s.+|@ts-expect-error|biome-ignore|TODO:",
},
],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export default tseslint.config(
applyDefaultIgnorePatterns: true,
beforeBlockComment: true,
beforeLineComment: true,
ignorePattern: "@type\\s.+|@ts-expect-error|biome-ignore",
ignorePattern: "@type\\s.+|@ts-expect-error|biome-ignore|TODO:",
},
],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"addons/trpc/react.tsx",
"addons/trpc/server.ts",
"reliverse.addons.ts",
"reliverse.themes.ts",
"remotion.config.ts",
"src/{auth,i18n}.ts",
"src/{config,db,hooks,server,types,core,data,utils}/index.ts",
Expand Down Expand Up @@ -75,6 +76,7 @@
"src/components/Navigation/{Pagination/{index,MdxPager,StorePager,Breadcrumbs,PaginationButton,ProductPager,StoreSwitcher,StoreTabs}.tsx,Combobox/ProductList.tsx,CarouselCards.tsx,CustomLink.tsx,LocaleSwitcher.tsx,Menubar.tsx,NavMenuClient.tsx,PageNavMenu.tsx,SidebarNav.tsx}",
"src/components/Navigation/MainMenu.tsx",
"src/components/Navigation/MobileMenu.tsx",
"src/components/Navigation/ProductsCombobox.tsx",
"src/components/Navigation/UserMenu.tsx",
"src/components/Playground/{Boards/{CreateBoard,EditableText,index,SignIn}.tsx,Pokemon.tsx,Privileges.tsx,ReactActionState.tsx}",
"src/components/Products/Catalogue.tsx",
Expand All @@ -83,7 +85,6 @@
"src/components/Skeletons/{Forms/UpdateNotificationFormSkeleton}.tsx",
"src/components/Switchers/index.tsx",
"src/components/Wrappers/{DialogShell,index,OrdersTableShell,GeneralShell,ProductsTableShell,Toaster}.tsx",
"src/config/{theme,stores}.ts",
"src/core/{link/index.tsx,mail/resend.ts,stripe/{handlers,helpers,loading,stripe}.ts,trpc/{infer,server,trpc2,index,react}.tsx,wn/{config,index,winston}.ts,auth/authjs/{index-old,shared/index}.ts,auth/authjs/components/sign-out-button.tsx,auth/clerkjs/other/checks.tsx,auth/clerkjs/components/user-profile-clerk.tsx,auth/shared/components/auth-pages-content-client.tsx,mail/templates/onboard.tsx,stripe/actions.ts,trpc/routers/{todo2,todo3,trpc-auth,trpc-user,type,webhook}.ts,trpc/tanstack/{blog-comments-server,blog-posts-client,products-admin}.tsx,trpc/trpc.ts}",
"src/core/novu/emails/novu-onboarding-email.tsx",
"src/core/trpc-old/index.ts",
Expand Down Expand Up @@ -256,6 +257,7 @@
"@types/eslint",
"@types/try-catch",
"@vercel/flags",
"@vercel/toolbar",
"@xyflow/react",
"autoprefixer",
"commander",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
// 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 MillionLint from "@million/lint";
import bundleAnalyzer from "@next/bundle-analyzer";
import createMDX from "@next/mdx";
import withVercelToolbar from "@vercel/toolbar/plugins/next";
import million from "million/compiler";
import createNextIntlPlugin from "next-intl/plugin";
import remarkGfm from "remark-gfm";

await import("~/env.js");

// The whitelist list of domains that are allowed to show media content
// 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 <Reliverse /> 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",
Expand All @@ -32,6 +36,7 @@ const hostnames = [
"res.cloudinary.com",
"utfs.io",
"www.gravatar.com",
"img.clerk.com",
"images.clerk.com",
];

Expand All @@ -43,7 +48,7 @@ const nextConfig = {
experimental: {
// React Compiler currently uses Webpack/Babel
// only, so it may slightly slow down the build
// reactCompiler: true,
// reactCompiler: false,
// after: true,
mdxRs: true,
optimisticClientCache: true,
Expand Down Expand Up @@ -76,7 +81,6 @@ const nextConfig = {
})),
},
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
serverExternalPackages: ["mysql2"],

// Adobe React Spectrum (next dev --turbo is not supported)
// transpilePackages: [
Expand Down Expand Up @@ -110,45 +114,14 @@ const withAnalyzer = bundleAnalyzer({
});

// @ts-expect-error TODO: fix
const withMillion = withAnalyzer(withIntl(withMDX(nextConfig)));
const chainedNextConfig = withAnalyzer(withIntl(withMDX(nextConfig)));

const reliverseConfig = million.next(
MillionLint.next({
// Million Lint Configuration
// @see https://million.dev
filter: {
exclude: [
"**/node_modules/**/*",
"./src/app/[locale]/**",
"./src/components/**",

// @see https://github.com/blefnk/relivator-nextjs-template#faq
// TODO: Eliminate things above, then repeat the
// TODO: builds, adding specific files as below.
"./src/app/[locale]/(adm)/dashboard/admin/_components/privileges.tsx",
"./src/app/[locale]/(blog)/blog/new/_components/editor-plate.tsx",
"./src/app/[locale]/(main)/404/[[...404]]/client.tsx",
"./src/app/[locale]/(main)/error/[[...error]]/client.tsx",
"./src/app/global-error.tsx",
"./src/app/not-found.tsx",
"./src/components/misc/loading-button.tsx",
"./src/components/misc/localization.tsx",
"./src/components/misc/product-building.tsx",
"./src/components/misc/stores.tsx",
"./src/core/auth/authjs/components/check-user-button.tsx",
"./src/core/auth/clerkjs/components/user-profile-clerk.tsx",
"./src/core/trpc/react.tsx",
"./src/core/trpc/tanstack/products-admin.tsx",
"./src/components/forms/ManageSubscriptionForm.tsx",
"./src/components/forms/UpdateEmailPreferencesForm.tsx",
"./src/components/account/avatar.tsx",
"./src/components/Primitives/ui/toaster.tsx",
"./src/components/providers/theme-provider.tsx",
"./src/components/providers/tooltip.tsx",
],
},
rsc: true,
})(withMillion),
})(chainedNextConfig),
{
// Million.js Compiler Configuration
auto: {
Expand All @@ -158,10 +131,10 @@ const reliverseConfig = million.next(
},
);

const reliverseConfigWithVercelToolbar = withVercelToolbar()(reliverseConfig);
// const reliverseConfigWithVercelToolbar = withVercelToolbar()(reliverseConfig);

// export default process.env.ENABLE_VERCEL_TOOLBAR
// ? reliverseConfigWithVercelToolbar
// : reliverseConfig;

// Export the chained config
// eslint-disable-next-line no-restricted-properties
export default process.env.ENABLE_VERCEL_TOOLBAR
? reliverseConfigWithVercelToolbar
: reliverseConfig;
export default millionEnabled ? reliverseConfig : chainedNextConfig;
2 changes: 1 addition & 1 deletion addons/scripts/reliverse/relicon/setup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { siteConfig } from "~/app";
export async function runReliverseSetup() {
const currentDirname = getCurrentDirname(import.meta.url);
const rootDirectory = getRootDirname(import.meta.url, 5);
const srcDirectory = join(currentDirname, `${currentDirname}/src`);
const srcDirectory = join(rootDirectory, "src");
const configsFolder = join(currentDirname, "configs");

// Next.js configurations
Expand Down
4 changes: 2 additions & 2 deletions addons/scripts/reliverse/relicon/setup/prompt/appts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import metadata from "~/constants/metadata";

export async function configureAppts({ apptsConfig }: ApptsConfig) {
const apptsConfigPath = join(apptsConfig, "app.ts");
const metadataConfigPath = join(apptsConfig, "config/metadata.ts");
const metadataConfigPath = join(apptsConfig, "constants/metadata.ts");

if (!(await fileExists(apptsConfigPath))) {
consola.error(
Expand All @@ -29,7 +29,7 @@ export async function configureAppts({ apptsConfig }: ApptsConfig) {

if (!(await fileExists(metadataConfigPath))) {
consola.error(
"Uh-oh! We couldn't find the configuration file `src/config/metadata.ts`! ⛔",
`Uh-oh! We couldn't find the configuration file! (${metadataConfigPath}) ⛔`,
);

return;
Expand Down
2 changes: 1 addition & 1 deletion addons/scripts/reliverse/relicon/setup/prompt/biome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export async function configureBiome({
value: "RulesDisabled",
},
{
hint: "[⛔ Unstable] Recommended configuration (🐞 You'll encounter many issues on Relivator 1.2.6)",
hint: "[⛔ Unstable] Recommended configuration (🐞 You'll encounter many issues on Relivator 1.3.0@canary)",
label: "biome.recommended.json",
value: "Recommended",
},
Expand Down
Loading

0 comments on commit ba326f2

Please sign in to comment.