Skip to content

Commit

Permalink
πŸš€ publish BETA
Browse files Browse the repository at this point in the history
Merge pull request #34 from cocola-dev/pre_commits
  • Loading branch information
ruru-m07 authored Feb 21, 2024
2 parents 90b6fc1 + 4e7310c commit 8807df3
Show file tree
Hide file tree
Showing 122 changed files with 1,409 additions and 1,083 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: 0 additions & 25 deletions .github/REQUEST_TEMPLATE.md

This file was deleted.

53 changes: 25 additions & 28 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
<!--- 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.
# 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
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: "20.9.0"
node-version: "20.9.0" # Use a specific Node.js version, adjust as needed

- name: Install Dependencies ☘️
run: |
npm install
run: npm i # Use npm i for faster and more consistent installs

- name: lint Chacks βœ…
- name: Tests and Linting βœ…
run: |
npm run lint
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

- 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: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore artifacts:

.next
.vercel
node_modules
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@
"glassit.step": 500,
// "bitoAI.codeCompletion.enableCommentToCode": true,
// "bitoAI.codeCompletion.enableAutoCompletion": true,
"cmake.options.statusBarVisibility": "hidden"
"cmake.options.statusBarVisibility": "hidden",
"editor.cursorBlinking": "smooth"
}
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 };
};
4 changes: 2 additions & 2 deletions 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 All @@ -28,7 +28,7 @@ export const create = async (
},
});

console.log(existingRepo);
// console.log(existingRepo);

if (existingRepo) {
return { error: "Repository already exist with this name!" };
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: 10 additions & 17 deletions actions/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@ 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 @@ -37,12 +35,10 @@ export const settings = async (
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 @@ -61,10 +57,7 @@ export const settings = async (
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 @@ -73,7 +66,7 @@ export const settings = async (
where: { id: dbUser.id },
data: {
...values,
}
},
});

update({
Expand All @@ -82,8 +75,8 @@ export const settings = async (
email: updatedUser.email,
isTwoFactorEnabled: updatedUser.isTwoFactorEnabled,
role: updatedUser.role,
}
},
});

return { success: "Settings Updated!" }
}
return { success: "Settings Updated!" };
};
17 changes: 17 additions & 0 deletions actions/user/update-bio.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"use server";

import { db } from "@/lib/db";

export const updateBio = async (username: string, bio: string) => {
if (!username) {
return { error: "Invalid user!" };
}
await db.user.update({
where: { username: username },
data: {
bio: bio,
},
});

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

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

export default AuthErrorPage;
20 changes: 7 additions & 13 deletions app/(auth)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
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;
Loading

1 comment on commit 8807df3

@vercel
Copy link

@vercel vercel bot commented on 8807df3 Feb 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.