Skip to content

Commit

Permalink
Revert "Fix formatting issues and add missing semicolons"
Browse files Browse the repository at this point in the history
This reverts commit e4a3230.
  • Loading branch information
ruru-m07 authored Feb 18, 2024
1 parent d3f0275 commit 151b5f2
Show file tree
Hide file tree
Showing 109 changed files with 983 additions and 809 deletions.
20 changes: 10 additions & 10 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or advances of
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down
25 changes: 25 additions & 0 deletions .github/REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Thanks for creating this pull request 🤗

Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one.

If this pull request closes an issue, please mention the issue number below.

Closes # <!-- Issue # here -->

## 📑 Description

<!-- Add a brief description of the pr -->

You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax

- [ ] Not Completed
- [ x ] Completed

## ✅ Checks

<!-- Make sure your pr passes the CI checks and do check the following fields as needed - -->

- [ ] My pull request adheres to the code style of this project
- [ ] My code requires changes to the documentation
- [ ] I have updated the documentation as required
- [ ] All the tests have passed
53 changes: 28 additions & 25 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# Thanks for creating this pull request 🤗

Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one.

If this pull request closes an issue, please mention the issue number below.

Closes # <!-- Issue # here -->

## 📑 Description

<!-- Add a brief description of the pr -->

You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax

- [ ] Not Completed
- [ x ] Completed

## ✅ Checks

<!-- Make sure your pr passes the CI checks and do check the following fields as needed - -->

- [ ] My pull request adheres to the code style of this project
- [ ] My code requires changes to the documentation
- [ ] I have updated the documentation as required
- [ ] All the tests have passed
<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->

## How has this been tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, tests ran to see how -->
<!--- your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
18 changes: 9 additions & 9 deletions .github/workflows/lint_chacks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ jobs:
- name: Setup Node.js 🫡
uses: actions/setup-node@v2
with:
node-version: "14" # Use a specific Node.js version, adjust as needed
node-version: "20.9.0"

- name: Install Dependencies ☘️
run: npm ci # Use npm ci for faster and more consistent installs
run: |
npm install
- name: Tests and Linting
- name: lint Chacks
run: |
npm run format # Run Prettier to format code
npm run lint # Run linting checks
# If any of the above steps fail, the workflow will stop
npm run lint
- name: Production build ✨
run: npm run build
- name: production build ✨
run: |
npm run build
env:
GENERATIVE_API_KEY: ${{ secrets.GENERATIVE_API_KEY }}
GENERATIVE_API_KEY: ${{ secrets.GENERATIVE_API_KEY }}
5 changes: 0 additions & 5 deletions .prettierignore

This file was deleted.

1 change: 0 additions & 1 deletion .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion actions/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ export const admin = async () => {
return { success: "Allowed Server Action!" };
}

return { error: "Forbidden Server Action!" };
return { error: "Forbidden Server Action!" }
};
8 changes: 4 additions & 4 deletions actions/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { getTwoFactorConfirmationByUserId } from "@/data/two-factor-confirmation

export const login = async (
values: z.infer<typeof LoginSchema>,
callbackUrl?: string | null,
callbackUrl?: string | null
) => {
const validatedFields = LoginSchema.safeParse(values);

Expand All @@ -36,12 +36,12 @@ export const login = async (

if (!existingUser.emailVerified) {
const verificationToken = await generateVerificationToken(
existingUser.email,
existingUser.email
);

await sendVerificationEmail(
verificationToken.email,
verificationToken.token,
verificationToken.token
);

return { success: "Confirmation email sent!" };
Expand Down Expand Up @@ -70,7 +70,7 @@ export const login = async (
});

const existingConfirmation = await getTwoFactorConfirmationByUserId(
existingUser.id,
existingUser.id
);

if (existingConfirmation) {
Expand Down
6 changes: 3 additions & 3 deletions actions/new-password.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getUserByEmail } from "@/data/user";
import { db } from "@/lib/db";

export const newPassword = async (
values: z.infer<typeof NewPasswordSchema>,
values: z.infer<typeof NewPasswordSchema> ,
token?: string | null,
) => {
if (!token) {
Expand Down Expand Up @@ -39,7 +39,7 @@ export const newPassword = async (
const existingUser = await getUserByEmail(existingToken.email);

if (!existingUser) {
return { error: "Email does not exist!" };
return { error: "Email does not exist!" }
}

const hashedPassword = await bcrypt.hash(password, 10);
Expand All @@ -50,7 +50,7 @@ export const newPassword = async (
});

await db.passwordResetToken.delete({
where: { id: existingToken.id },
where: { id: existingToken.id }
});

return { success: "Password updated!" };
Expand Down
2 changes: 1 addition & 1 deletion actions/repo/branchCount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export const fetchrepo = async (username: string, repository: string) => {
author: username,
},
});
console.log(repo);
console.log(repo)
return { repo: repo };
};
2 changes: 1 addition & 1 deletion actions/repo/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { User } from "@prisma/client";

export const create = async (
values: z.infer<typeof RepoSchema>,
user: User,
user: User
) => {
const validatedFields = RepoSchema.safeParse(values);

Expand Down
2 changes: 1 addition & 1 deletion actions/repo/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { User } from "@prisma/client";
export const fetchRepo = async (
username: string,
repository: string,
user?: User | null,
user?: User | null
) => {
if (!username || !repository) {
return { error: "Invalid user or repository!" };
Expand Down
2 changes: 1 addition & 1 deletion actions/reset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ export const reset = async (values: z.infer<typeof ResetSchema>) => {
);

return { success: "Reset email sent!" };
};
}
27 changes: 17 additions & 10 deletions actions/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@ import { currentUser } from "@/lib/auth";
import { generateVerificationToken } from "@/lib/tokens";
import { sendVerificationEmail } from "@/lib/mail";

export const settings = async (values: z.infer<typeof SettingsSchema>) => {
export const settings = async (
values: z.infer<typeof SettingsSchema>
) => {
const user = await currentUser();

if (!user || !user.id) {
return { error: "Unauthorized" };
return { error: "Unauthorized" }
}

const dbUser = await getUserById(user.id);

if (!dbUser) {
return { error: "Unauthorized" };
return { error: "Unauthorized" }
}

if (user.isOAuth) {
Expand All @@ -35,10 +37,12 @@ export const settings = async (values: z.infer<typeof SettingsSchema>) => {
const existingUser = await getUserByEmail(values.email);

if (existingUser && existingUser.id !== user.id) {
return { error: "Email already in use!" };
return { error: "Email already in use!" }
}

const verificationToken = await generateVerificationToken(values.email);
const verificationToken = await generateVerificationToken(
values.email
);
await sendVerificationEmail(
verificationToken.email,
verificationToken.token,
Expand All @@ -57,7 +61,10 @@ export const settings = async (values: z.infer<typeof SettingsSchema>) => {
return { error: "Incorrect password!" };
}

const hashedPassword = await bcrypt.hash(values.newPassword, 10);
const hashedPassword = await bcrypt.hash(
values.newPassword,
10,
);
values.password = hashedPassword;
values.newPassword = undefined;
}
Expand All @@ -66,7 +73,7 @@ export const settings = async (values: z.infer<typeof SettingsSchema>) => {
where: { id: dbUser.id },
data: {
...values,
},
}
});

update({
Expand All @@ -75,8 +82,8 @@ export const settings = async (values: z.infer<typeof SettingsSchema>) => {
email: updatedUser.email,
isTwoFactorEnabled: updatedUser.isTwoFactorEnabled,
role: updatedUser.role,
},
}
});

return { success: "Settings Updated!" };
};
return { success: "Settings Updated!" }
}
6 changes: 4 additions & 2 deletions app/(auth)/error/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { ErrorCard } from "@/components/auth/error-card";

const AuthErrorPage = () => {
return <ErrorCard />;
return (
<ErrorCard />
);
};

export default AuthErrorPage;
20 changes: 13 additions & 7 deletions app/(auth)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
const AuthLayout = ({ children }: { children: React.ReactNode }) => {
return (
<div className="h-full flex items-center justify-center ">{children}</div>
);
};

export default AuthLayout;
const AuthLayout = ({
children
}: {
children: React.ReactNode
}) => {
return (
<div className="h-full flex items-center justify-center ">
{children}
</div>
);
}

export default AuthLayout;
10 changes: 6 additions & 4 deletions app/(auth)/new-password/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { NewPasswordForm } from "@/components/auth/new-password-form";

const NewPasswordPage = () => {
return <NewPasswordForm />;
};

export default NewPasswordPage;
return (
<NewPasswordForm />
);
}

export default NewPasswordPage;
10 changes: 6 additions & 4 deletions app/(auth)/new-verification/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { NewVerificationForm } from "@/components/auth/new-verification-form";

const NewVerificationPage = () => {
return <NewVerificationForm />;
};

export default NewVerificationPage;
return (
<NewVerificationForm />
);
}

export default NewVerificationPage;
Loading

0 comments on commit 151b5f2

Please sign in to comment.