Skip to content

Commit

Permalink
Code formating and standardization (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
AjayiMike authored Aug 21, 2024
1 parent c1e6b85 commit f6d267d
Show file tree
Hide file tree
Showing 257 changed files with 8,969 additions and 12,321 deletions.
12 changes: 2 additions & 10 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"react"
],
"plugins": ["@typescript-eslint", "react"],
"rules": {
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off",
Expand All @@ -28,10 +25,5 @@
"version": "detect"
}
},
"ignorePatterns": [
"node_modules/",
"dist/",
"src/assets",
"supabase/functions/**/*.ts"
]
"ignorePatterns": ["node_modules/", "dist/", "src/assets", "supabase/functions/**/*.ts"]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ typings/
.env
.env.test
.env.development.*
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
Expand Down
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarn lint:fix
yarn format
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn build
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.next
.github
.yarn
node_modules
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"deno.unstable": true,
"deno.importMap": "./supabase/functions/import_map.json",
"deno.enablePaths": ["supabase/functions"],
"prettier.tabWidth": 2
"editor.formatOnSave": true
}
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ git clone https://github.com/hellno/herocast.git
yarn
```

4. Create a file `.env.development.local`:
4. Create a file `.env.local`:

- For macOS or Linux:
```bash
cp .env.example .env.development.local
cp .env.example .env.local
```
- For Windows:
```bash
xcopy .env.example .env.development.local
xcopy .env.example .env.local
```

5. Set up your environment variables:
Expand All @@ -67,7 +67,7 @@ git clone https://github.com/hellno/herocast.git
- Create a new account and select the "Free" option.
- Select the "Optimism" chain and fill out the necessary information.
- In the "Apps" section, find your Optimism App and click the "API Key" button.
- Copy the API Key to your `.env.development.local`.
- Copy the API Key to your `.env.local`.
```bash
NEXT_PUBLIC_ALCHEMY_API_KEY = 'alchemy-api-key-here'
```
Expand Down Expand Up @@ -134,7 +134,7 @@ This will output:
```bash
$ next dev
- Local: http://localhost:3000
- Environments: .env.development.local, .env.development
- Environments: .env.local, .env.development
...
✓ Ready in 2.4s
```
Expand Down
23 changes: 11 additions & 12 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@

## Thank you to everyone who helped build herocast


| Contributor | Farcaster |
| ------------- | ------------- |
| [hiporox](https://github.com/hiporox) | |
| [scottrepreneur](https://github.com/scottrepreneur) | |
| [3robi1](https://github.com/3robi1) | |
| [itsbirdo](https://github.com/itsbirdo) | |
| [0xSemicolon](https://github.com/0xSemicolon) | |
| [tusharsoni](https://github.com/tusharsoni) | |
| [tjsturos](https://github.com/tjsturos) | |
| [gershido](https://github.com/gershido) | |
| [hellno](https://github.com/hellno) | [hellno](https://warpcast.com/hellno) |
| Contributor | Farcaster |
| --------------------------------------------------- | ------------------------------------- |
| [hiporox](https://github.com/hiporox) | |
| [scottrepreneur](https://github.com/scottrepreneur) | |
| [3robi1](https://github.com/3robi1) | |
| [itsbirdo](https://github.com/itsbirdo) | |
| [0xSemicolon](https://github.com/0xSemicolon) | |
| [tusharsoni](https://github.com/tusharsoni) | |
| [tjsturos](https://github.com/tjsturos) | |
| [gershido](https://github.com/gershido) | |
| [hellno](https://github.com/hellno) | [hellno](https://warpcast.com/hellno) |

## I would like to join this list. How can I help the project?

Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

![herocast_logo_wide](https://github.com/hero-org/.github/blob/main/assets/herocast-logo.png?raw=true)
<br />
[![build](https://github.com/hellno/herocast/actions/workflows/build.yaml/badge.svg)](https://github.com/hellno/herocast/actions/workflows/build.yaml)
Expand Down Expand Up @@ -58,12 +57,10 @@ GRANT

Distributed under the AGPLv3 License. See LICENSE for more information.


## Contact

hellno [Warpcast](https://warpcast.com/hellno.eth)

Website: https://herocast.xyz

GitHub: https://github.com/hellno/herocast

2 changes: 1 addition & 1 deletion api/frames/route.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { GET, POST } from "@frames.js/render/next";
export { GET, POST } from '@frames.js/render/next';
2 changes: 1 addition & 1 deletion components.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"components": "@/components",
"utils": "@/lib/utils"
}
}
}
42 changes: 20 additions & 22 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">

<head>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="index.html NAME" content="index.html CONTENT" />
<meta name="description" content="herocast">
<meta property="og:site_name" content="herocast">
<meta property="og:title" content="herocast">
<meta property="og:type" content="website">
<meta property="og:description" content="herocast">
<meta property="og:image" content="/images/herocast_og.png">
<meta property="og:image:type" content="image/jpeg">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="737">
<meta property="og:url" content="https://app.herocast.xyz">
<meta property="twitter:card" content="summary_large_image">
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png">
<link rel="icon" type="image/x-icon" href="/images/favicon.ico">
<meta name="description" content="herocast" />
<meta property="og:site_name" content="herocast" />
<meta property="og:title" content="herocast" />
<meta property="og:type" content="website" />
<meta property="og:description" content="herocast" />
<meta property="og:image" content="/images/herocast_og.png" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="737" />
<meta property="og:url" content="https://app.herocast.xyz" />
<meta property="twitter:card" content="summary_large_image" />
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png" />
<link rel="icon" type="image/x-icon" href="/images/favicon.ico" />
<title>herocast</title>
</head>
</head>

<body>
<body>
<!-- <noscript>You need to enable JavaScript to run this app.</noscript> -->
<div id="root"></div>
<script type="module" src="/src/App.tsx"></script>
</body>

</body>
</html>
8 changes: 4 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/** @type {import('ts-jest').JestConfigWithTsJest} **/
module.exports = {
testEnvironment: "node",
testEnvironment: 'node',
transform: {
"^.+.tsx?$": ["ts-jest",{}],
'^.+.tsx?$': ['ts-jest', {}],
},
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
'^@/(.*)$': '<rootDir>/src/$1',
},
};
};
77 changes: 37 additions & 40 deletions middleware.ts
Original file line number Diff line number Diff line change
@@ -1,48 +1,45 @@
import { GET, POST } from "@frames.js/render/next";
import { NextRequest, NextResponse } from "next/server";
import { GET, POST } from '@frames.js/render/next';
import { NextRequest, NextResponse } from 'next/server';

export async function middleware(req: NextRequest) {
const { pathname } = req.nextUrl;
const { method } = req;

if (pathname === "/api/frames") {
try {
let response: Response;

if (method === "GET") {
response = await GET(req);
} else if (method === "POST") {
response = await POST(req);
} else {
return new NextResponse(JSON.stringify({ error: "Method Not Allowed" }), {
status: 405,
headers: { "Content-Type": "application/json" },
});
}

if (response.status === 200) {
const clonedResponse = response.clone();
const data = await clonedResponse.json();
} else {
const clonedResponse = response.clone();
const errorMessage = await clonedResponse.text();
}

return response;
} catch (error) {
return new NextResponse(JSON.stringify({ error: "Internal Server Error" }), {
status: 500,
headers: { "Content-Type": "application/json" },
});
}
const { pathname } = req.nextUrl;
const { method } = req;

if (pathname === '/api/frames') {
try {
let response: Response;

if (method === 'GET') {
response = await GET(req);
} else if (method === 'POST') {
response = await POST(req);
} else {
return new NextResponse(JSON.stringify({ error: 'Method Not Allowed' }), {
status: 405,
headers: { 'Content-Type': 'application/json' },
});
}

if (response.status === 200) {
const clonedResponse = response.clone();
const data = await clonedResponse.json();
} else {
const clonedResponse = response.clone();
const errorMessage = await clonedResponse.text();
}

return response;
} catch (error) {
return new NextResponse(JSON.stringify({ error: 'Internal Server Error' }), {
status: 500,
headers: { 'Content-Type': 'application/json' },
});
}
}

return NextResponse.next();
return NextResponse.next();
}


export const config = {
unstable_allowDynamic: [
"/node_modules/@protobufjs/inquire/index.js",
],
unstable_allowDynamic: ['/node_modules/@protobufjs/inquire/index.js'],
};
Loading

0 comments on commit f6d267d

Please sign in to comment.