-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from ToastedDev/dev
feat: move to nextjs and turborepo
- Loading branch information
Showing
59 changed files
with
13,702 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
.env | ||
.env | ||
.turbo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "@chatr/api", | ||
"type": "module", | ||
"version": "0.1.0", | ||
"scripts": { | ||
"dev": "bun with-env bun --watch src/index.ts --dev", | ||
"with-env": "dotenv -e ../.env --" | ||
}, | ||
"dependencies": { | ||
"cors": "^2.8.5", | ||
"ejs": "^3.1.10", | ||
"express": "^4.19.2", | ||
"mysql2": "^3.10.3" | ||
}, | ||
"devDependencies": { | ||
"@types/bun": "latest", | ||
"@types/cors": "^2.8.17", | ||
"@types/express": "^4.17.21", | ||
"dotenv-cli": "^7.4.2" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "@chatr/bot", | ||
"type": "module", | ||
"version": "0.1.0", | ||
"scripts": { | ||
"dev": "bun with-env bun --watch src/index.ts --dev", | ||
"with-env": "dotenv -e ../.env --" | ||
}, | ||
"dependencies": { | ||
"canvacord": "^6.0.2", | ||
"colorthief": "^2.4.0", | ||
"discord.js": "^14.15.3" | ||
}, | ||
"devDependencies": { | ||
"@types/bun": "latest" | ||
}, | ||
"peerDependencies": { | ||
"typescript": "^5.0.0" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Check if DISCORD_TOKEN has been provided as an environment variable, and is a valid regex pattern | ||
const discordToken: string | undefined = process.argv.includes("--dev") | ||
? process.env?.DISCORD_TOKEN_DEV | ||
: process.env?.DISCORD_TOKEN; | ||
|
||
if (!discordToken || discordToken === "YOUR_TOKEN_HERE") | ||
throw "You MUST provide a discord token in .env!"; | ||
|
||
// If it has, run the bot | ||
import { | ||
Client, | ||
GatewayIntentBits, | ||
REST, | ||
Routes, | ||
type APIApplicationCommand, | ||
} from "discord.js"; | ||
import commandsMap from "./commands"; | ||
import fs from "fs/promises"; | ||
import path from "path"; | ||
|
||
const client = new Client({ | ||
intents: [ | ||
GatewayIntentBits.Guilds, | ||
GatewayIntentBits.GuildMessages, | ||
GatewayIntentBits.MessageContent, | ||
], | ||
}); | ||
|
||
// Update the commands | ||
console.log(`Refreshing ${commandsMap.size} commands`); | ||
const rest = new REST().setToken(discordToken); | ||
const getAppId: { id?: string | null } = (await rest.get( | ||
Routes.currentApplication(), | ||
)) || { id: null }; | ||
if (!getAppId?.id) | ||
throw "No application ID was able to be found with this token"; | ||
|
||
const data = (await rest.put(Routes.applicationCommands(getAppId.id), { | ||
body: [...commandsMap.values()].map((a) => { | ||
return a.data; | ||
}), | ||
})) as APIApplicationCommand[]; | ||
|
||
console.log(`Successfully reloaded ${data.length} application (/) commands.`); | ||
|
||
client.login(discordToken); | ||
|
||
export default client; | ||
|
||
// Import events | ||
const getEvents = await fs.readdir(path.join(process.cwd(), "src/events")); | ||
for await (const file of getEvents) { | ||
await import("./events/" + file); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,27 @@ | ||
{ | ||
"name": "xpbot", | ||
"type": "module", | ||
"version": "0.1.0", | ||
"scripts": { | ||
"dev:api": "bun --watch api/index.ts --dev", | ||
"dev:bot": "bun --watch bot/index.ts --dev", | ||
"api": "bun api/index.ts", | ||
"bot": "bun bot/index.ts", | ||
"lint": "eslint . --config eslint.config.mjs" | ||
}, | ||
"devDependencies": { | ||
"@eslint/js": "^9.7.0", | ||
"@types/bun": "latest", | ||
"@types/cors": "^2.8.17", | ||
"@types/eslint__js": "^8.42.3", | ||
"@types/express": "^4.17.21", | ||
"typescript-eslint": "^7.16.1" | ||
}, | ||
"peerDependencies": { | ||
"typescript": "^5.0.0" | ||
}, | ||
"dependencies": { | ||
"canvacord": "^6.0.2", | ||
"colorthief": "^2.4.0", | ||
"cors": "^2.8.5", | ||
"discord.js": "^14.15.3", | ||
"ejs": "^3.1.10", | ||
"express": "^4.19.2", | ||
"mysql2": "^3.10.3" | ||
} | ||
"name": "@chatr/root", | ||
"type": "module", | ||
"version": "0.1.0", | ||
"packageManager": "bun@1.1.20", | ||
"workspaces": [ | ||
"api", | ||
"bot", | ||
"web" | ||
], | ||
"scripts": { | ||
"dev": "turbo run dev", | ||
"lint": "eslint . --config eslint.config.mjs" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@eslint/js": "^9.7.0", | ||
"@types/bun": "latest", | ||
"@types/eslint__js": "^8.42.3", | ||
"dotenv-cli": "^7.4.2", | ||
"turbo": "^2.0.9", | ||
"typescript-eslint": "^7.16.1" | ||
}, | ||
"peerDependencies": { | ||
"typescript": "^5.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"tasks": { | ||
"dev": { | ||
"persistent": true, | ||
"cache": false | ||
}, | ||
"build": { | ||
"dependsOn": ["^build"], | ||
"outputs": [".next/**", "!.next/cache/**"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ZoneTransfer] | ||
ZoneId=3 | ||
ReferrerUrl=C:\Users\ToastedToast\Downloads\next-pages-template-d32cd8f85a606260bd82868a585e6fb24f44c343.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Next UI | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Next.js & NextUI Template | ||
|
||
This is a template for creating applications using Next.js 13 (pages directory) and NextUI (v2). | ||
|
||
## Technologies Used | ||
|
||
- [Next.js 13](https://nextjs.org/docs/getting-started) | ||
- [NextUI](https://nextui.org) | ||
- [Tailwind CSS](https://tailwindcss.com) | ||
- [Tailwind Variants](https://tailwind-variants.org) | ||
- [TypeScript](https://www.typescriptlang.org) | ||
- [Framer Motion](https://www.framer.com/motion) | ||
- [next-themes](https://github.com/pacocoursey/next-themes) | ||
|
||
## How to Use | ||
|
||
To create a new project based on this template using `create-next-app`, run the following command: | ||
|
||
```bash | ||
npx create-next-app -e https://github.com/nextui-org/next-pages-template | ||
``` | ||
## License | ||
|
||
Licensed under the [MIT license](https://github.com/nextui-org/next-pages-template/blob/main/LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { useState } from "react"; | ||
import { Button } from "@nextui-org/react"; | ||
|
||
export const Counter = () => { | ||
const [count, setCount] = useState(0); | ||
|
||
return ( | ||
<Button radius="full" onPress={() => setCount(count + 1)}> | ||
Count is {count} | ||
</Button> | ||
); | ||
}; |
Oops, something went wrong.