diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 41726ff..4b19eeb 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -7,6 +7,18 @@ on: branches-ignore: - main jobs: + Code Format: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: 18.12.1 + - name: Format + run: npm run format + Run Tests: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml index 9cb880a..1b04906 100644 --- a/.github/workflows/production.yaml +++ b/.github/workflows/production.yaml @@ -7,6 +7,18 @@ on: branches: - main jobs: + Code Format: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: 18.12.1 + - name: Format + run: npm run format + Run Tests: runs-on: ubuntu-latest steps: diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..190bea8 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,11 @@ +{ + "plugins": [ + "prettier-plugin-organize-imports", + "prettier-plugin-tailwindcss" + ], + "trailingComma": "all", + "semi": false, + "singleQuote": false, + "useTabs": false, + "tabWidth": 2 +} diff --git a/app/api/labs/[id]/route.ts b/app/api/labs/[id]/route.ts index 11e1621..d5085b3 100644 --- a/app/api/labs/[id]/route.ts +++ b/app/api/labs/[id]/route.ts @@ -1,6 +1,6 @@ -import { NextResponse } from "next/server" import Lab from "@/models/Lab" import { LabRequestType } from "@/types/Requests" +import { NextResponse } from "next/server" export async function PUT( req: Request, diff --git a/app/globals.css b/app/globals.css index 3c93daf..753a5fc 100644 --- a/app/globals.css +++ b/app/globals.css @@ -33,9 +33,9 @@ body { } h1 { - @apply text-2xl sm:text-4xl font-bold mt-4 mb-4 dark:text-white text-gray-500; + @apply mb-4 mt-4 text-2xl font-bold text-gray-500 sm:text-4xl dark:text-white; } h2 { - @apply sm:text-xl text-lg mt-2 mb-2; + @apply mb-2 mt-2 text-lg sm:text-xl; } diff --git a/app/home/page.tsx b/app/home/page.tsx index d97d3e5..5ecbd10 100644 --- a/app/home/page.tsx +++ b/app/home/page.tsx @@ -1,10 +1,10 @@ "use client" +import { UserLabs } from "@/components" +import { useUserLabsData } from "@/hooks" +import { ButtonStatusType } from "@/types/Common" import { signOut, useSession } from "next-auth/react" import { useState } from "react" -import { ButtonStatusType } from "@/types/Common" -import { useUserLabsData } from "@/hooks" -import { UserLabs } from "@/components" const HomePage = () => { const { data: userData } = useSession() @@ -32,7 +32,7 @@ const HomePage = () => { } return ( -
+

AWS r/Start Labs

@@ -40,7 +40,7 @@ const HomePage = () => {
@@ -41,7 +53,7 @@ const UserLabs = ({ return (
-
+

Week 1

{weekOne.map((lab) => ( -
+

Week 2

{weekTwo.map((lab) => ( -
+

Week 3

{weekThree.map((lab) => ( -
+

Week 4

{weekFour.map((lab) => ( -
+

Week 5

{weekFive.map((lab) => ( -
+

Week 6

{weekSix.map((lab) => ( -
+

Week 7

{weekSeven.map((lab) => ( -
+

Week 8

{weekEight.map((lab) => ( -
+

Week 9

{weekNine.map((lab) => ( -
+

Week 10

{weekTen.map((lab) => ( -
+

Week 11

{weekEleven.map((lab) => ( ))}
-
) } diff --git a/components/index.ts b/components/index.ts index 97e3e3f..aa3b87e 100644 --- a/components/index.ts +++ b/components/index.ts @@ -1,4 +1,4 @@ -import { GoogleIcon, CheckMark } from "./Icons" +import { CheckMark, GoogleIcon } from "./Icons" import { Divider, UserLabs } from "./UI" -export { GoogleIcon, Divider, CheckMark, UserLabs } +export { CheckMark, Divider, GoogleIcon, UserLabs } diff --git a/cypress/e2e/1-getting-started/todo.cy.js b/cypress/e2e/1-getting-started/todo.cy.js index 4768ff9..d4516b2 100644 --- a/cypress/e2e/1-getting-started/todo.cy.js +++ b/cypress/e2e/1-getting-started/todo.cy.js @@ -11,32 +11,32 @@ // please read our getting started guide: // https://on.cypress.io/introduction-to-cypress -describe('example to-do app', () => { +describe("example to-do app", () => { beforeEach(() => { // Cypress starts out with a blank slate for each test // so we must tell it to visit our website with the `cy.visit()` command. // Since we want to visit the same URL at the start of all our tests, // we include it in our beforeEach function so that it runs before each test - cy.visit('https://example.cypress.io/todo') + cy.visit("https://example.cypress.io/todo") }) - it('displays two todo items by default', () => { + it("displays two todo items by default", () => { // We use the `cy.get()` command to get all elements that match the selector. // Then, we use `should` to assert that there are two matched items, // which are the two default items. - cy.get('.todo-list li').should('have.length', 2) + cy.get(".todo-list li").should("have.length", 2) // We can go even further and check that the default todos each contain // the correct text. We use the `first` and `last` functions // to get just the first and last matched elements individually, // and then perform an assertion with `should`. - cy.get('.todo-list li').first().should('have.text', 'Pay electric bill') - cy.get('.todo-list li').last().should('have.text', 'Walk the dog') + cy.get(".todo-list li").first().should("have.text", "Pay electric bill") + cy.get(".todo-list li").last().should("have.text", "Walk the dog") }) - it('can add new todo items', () => { + it("can add new todo items", () => { // We'll store our item text in a variable so we can reuse it - const newItem = 'Feed the cat' + const newItem = "Feed the cat" // Let's get the input element and use the `type` command to // input our new list item. After typing the content of our item, @@ -44,29 +44,29 @@ describe('example to-do app', () => { // This input has a data-test attribute so we'll use that to select the // element in accordance with best practices: // https://on.cypress.io/selecting-elements - cy.get('[data-test=new-todo]').type(`${newItem}{enter}`) + cy.get("[data-test=new-todo]").type(`${newItem}{enter}`) // Now that we've typed our new item, let's check that it actually was added to the list. // Since it's the newest item, it should exist as the last element in the list. // In addition, with the two default items, we should have a total of 3 elements in the list. // Since assertions yield the element that was asserted on, // we can chain both of these assertions together into a single statement. - cy.get('.todo-list li') - .should('have.length', 3) + cy.get(".todo-list li") + .should("have.length", 3) .last() - .should('have.text', newItem) + .should("have.text", newItem) }) - it('can check off an item as completed', () => { + it("can check off an item as completed", () => { // In addition to using the `get` command to get an element by selector, // we can also use the `contains` command to get an element by its contents. // However, this will yield the