Skip to content

Commit

Permalink
🐛 fix: format error and ci setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ayungavis committed Jan 17, 2024
1 parent a1a8415 commit 3a5bb77
Show file tree
Hide file tree
Showing 32 changed files with 339 additions and 355 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup
uses: ./tooling/github/setup
uses: ./configs/github/setup

- name: Copy env
shell: bash
Expand All @@ -40,7 +40,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup
uses: ./tooling/github/setup
uses: ./configs/github/setup

- name: Format
run: pnpm format
Expand All @@ -51,7 +51,7 @@ jobs:
- uses: actions/checkout@v4

- name: Setup
uses: ./tooling/github/setup
uses: ./configs/github/setup

- name: Typecheck
run: pnpm typecheck
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ packages
| └─ Tailwind CSS
└─ utils
└─ Utility functions
tooling
configs
├─ eslint
├─ github
├─ prettier
Expand Down Expand Up @@ -76,7 +76,6 @@ Let's deploy the Next.js application to [Vercel](https://vercel.com/). If you ha
2. Done! Your app should successfully deploy.


## References

- [Turborepo](https://turbo.build/repo)
Expand All @@ -88,4 +87,4 @@ MIT License

<hr>

© 2023 Wahyu Kurniawan
© 2023 Wahyu Kurniawan
8 changes: 4 additions & 4 deletions apps/auth-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"@auth/core": "^0.20.0"
},
"devDependencies": {
"@acme/eslint-config": "workspace:^0.2.0",
"@acme/prettier-config": "workspace:^0.1.0",
"@acme/tailwind-config": "workspace:^0.1.0",
"@acme/tsconfig": "workspace:^0.1.0",
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/tailwind-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"eslint": "^8.56.0",
"nitropack": "^2.8.1",
"prettier": "^3.1.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/auth-proxy/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "@acme/tsconfig/base.json",
"include": ["routes"]
"include": ["routes"],
}
10 changes: 5 additions & 5 deletions apps/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
"superjson": "2.2.1"
},
"devDependencies": {
"@acme/api": "workspace:^0.1.0",
"@acme/eslint-config": "workspace:^0.2.0",
"@acme/prettier-config": "workspace:^0.1.0",
"@acme/tailwind-config": "workspace:^0.1.0",
"@acme/tsconfig": "workspace:^0.1.0",
"@acme/api": "workspace:*",
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/tailwind-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.7",
"@babel/runtime": "^7.23.7",
Expand Down
8 changes: 4 additions & 4 deletions apps/expo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["./src/*"]
"~/*": ["./src/*"],
},
"jsx": "react-native",
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json",
"types": ["nativewind/types"]
"types": ["nativewind/types"],
},
"include": [
"src",
"*.ts",
"index.tsx",
"*.js",
".expo/types/**/*.ts",
"expo-env.d.ts"
"expo-env.d.ts",
],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
18 changes: 9 additions & 9 deletions apps/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"with-env": "dotenv -e ../../.env --"
},
"dependencies": {
"@acme/api": "workspace:^0.1.0",
"@acme/auth": "workspace:^0.1.0",
"@acme/db": "workspace:^0.1.0",
"@acme/ui": "workspace:^0.1.0",
"@acme/validators": "workspace:^0.1.0",
"@acme/api": "workspace:*",
"@acme/auth": "workspace:*",
"@acme/db": "workspace:*",
"@acme/ui": "workspace:*",
"@acme/validators": "workspace:*",
"@t3-oss/env-nextjs": "^0.7.1",
"@tanstack/react-query": "^5.17.7",
"@tanstack/react-query-devtools": "^5.17.7",
Expand All @@ -34,10 +34,10 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@acme/eslint-config": "workspace:^0.2.0",
"@acme/prettier-config": "workspace:^0.1.0",
"@acme/tailwind-config": "workspace:^0.1.0",
"@acme/tsconfig": "workspace:^0.1.0",
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/tailwind-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"@types/node": "^20.10.6",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
Expand Down
4 changes: 2 additions & 2 deletions apps/nextjs/src/app/_components/posts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function CreatePostForm() {
<Form {...form}>
<form
className="flex w-full max-w-2xl flex-col gap-4"
onSubmit={form.handleSubmit(async (data) => {
onSubmit={form.handleSubmit((data) => {
createPost.mutate(data);
})}
>
Expand Down Expand Up @@ -138,8 +138,8 @@ export function PostCard(props: {
</div>
<div>
<Button
variant="ghost"
className="cursor-pointer text-sm font-bold uppercase text-primary hover:bg-transparent hover:text-white"
variant="ghost"
onClick={() => deletePost.mutate(props.post.id)}
>
Delete
Expand Down
1 change: 1 addition & 0 deletions apps/nextjs/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import baseConfig from "@acme/tailwind-config";
export default {
// We need to append the path to the UI package to the content array so that
// those classes are included correctly.
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
content: [...baseConfig.content, "../../packages/ui/**/*.{ts,tsx}"],
presets: [baseConfig],
theme: {
Expand Down
6 changes: 3 additions & 3 deletions apps/nextjs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~/*": ["./src/*"]
"~/*": ["./src/*"],
},
"plugins": [{ "name": "next" }],
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json",
},
"include": [".", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
4 changes: 2 additions & 2 deletions configs/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"eslint-plugin-unused-imports": "^3.0.0"
},
"devDependencies": {
"@acme/prettier-config": "workspace:^0.1.0",
"@acme/tsconfig": "workspace:^0.1.0",
"@acme/prettier-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"@types/eslint": "^8.56.0",
"eslint": "^8.56.0",
"prettier": "^3.1.1",
Expand Down
4 changes: 2 additions & 2 deletions configs/eslint/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "@acme/tsconfig/base.json",
"compilerOptions": {
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json",
},
"include": ["."],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
2 changes: 1 addition & 1 deletion configs/prettier/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const config = {
"prettier-plugin-tailwindcss",
],
tailwindConfig: fileURLToPath(
new URL("../../tooling/tailwind/index.ts", import.meta.url),
new URL("../../configs/tailwind/tailwind.config.ts", import.meta.url),
),
tailwindFunctions: ["cn", "cva"],
importOrder: [
Expand Down
2 changes: 1 addition & 1 deletion configs/prettier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"prettier-plugin-tailwindcss": "^0.5.10"
},
"devDependencies": {
"@acme/tsconfig": "workspace:^0.1.0",
"@acme/tsconfig": "workspace:*",
"typescript": "^5.3.3"
},
"prettier": "@acme/prettier-config"
Expand Down
4 changes: 2 additions & 2 deletions configs/prettier/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "@acme/tsconfig/base.json",
"compilerOptions": {
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json",
},
"include": ["."],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
7 changes: 4 additions & 3 deletions configs/tailwind/functions/hexToRGB.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { tinycolor } from "@ctrl/tinycolor";
import { TinyColor } from "@ctrl/tinycolor";

/**
* Converts color input into `r g b` format using tinycolor lib
Expand All @@ -8,9 +8,10 @@ import { tinycolor } from "@ctrl/tinycolor";

export const hexToRGB = (value: string): string => {
// check if the color is valid
if (tinycolor(value).isValid) {
const isValid = new TinyColor(value).isValid;
if (isValid) {
// get the rgb values of the color
const { r, g, b } = tinycolor(value).toRgb();
const { r, g, b } = new TinyColor(value).toRgb();
// return the rgb values in a string
return `${r} ${g} ${b}`;
}
Expand Down
10 changes: 7 additions & 3 deletions configs/tailwind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"version": "0.1.0",
"private": true,
"type": "module",
"files": [
"tailwind.config.ts",
"postcss.js"
],
"exports": {
".": "./tailwind.config.ts",
"./postcss": "./postcss.js"
Expand All @@ -23,9 +27,9 @@
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@acme/eslint-config": "workspace:^0.2.0",
"@acme/prettier-config": "workspace:^0.1.0",
"@acme/tsconfig": "workspace:^0.1.0",
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"eslint": "^8.56.0",
"postcss-import": "^16.0.0",
"prettier": "^3.1.1",
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions configs/tailwind/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "@acme/tsconfig/base.json",
"compilerOptions": {
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json",
},
"include": ["."],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"postinstall": "pnpm lint:ws",
"build": "turbo build",
"clean": "git clean -xdf node_modules && pnpm run clean:workspaces && pnpm run clean:all",
"clean": "git clean -xdf node_modules && pnpm run clean:all",
"clean:all": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +",
"clean:workspaces": "turbo clean",
"db:push": "pnpm -F db push",
Expand All @@ -22,7 +22,7 @@
"typecheck": "turbo typecheck"
},
"devDependencies": {
"@acme/prettier-config": "workspace:^0.1.0",
"@acme/prettier-config": "workspace:*",
"@turbo/gen": "^1.10.16",
"prettier": "^3.1.0",
"turbo": "^1.10.16",
Expand Down
12 changes: 6 additions & 6 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@acme/auth": "workspace:^0.1.0",
"@acme/db": "workspace:^0.1.0",
"@acme/validators": "workspace:^0.1.0",
"@acme/auth": "workspace:*",
"@acme/db": "workspace:*",
"@acme/validators": "workspace:*",
"@trpc/server": "next",
"superjson": "2.2.1",
"zod": "^3.22.4"
},
"devDependencies": {
"@acme/eslint-config": "workspace:^0.2.0",
"@acme/prettier-config": "workspace:^0.1.0",
"@acme/tsconfig": "workspace:^0.1.0",
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"eslint": "^8.56.0",
"prettier": "^3.1.1",
"typescript": "^5.3.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "@acme/tsconfig/base.json",
"compilerOptions": {
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json",
},
"include": ["src"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
8 changes: 4 additions & 4 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@acme/db": "workspace:^0.1.0",
"@acme/db": "workspace:*",
"@auth/drizzle-adapter": "^0.3.12",
"@t3-oss/env-nextjs": "^0.7.1",
"next": "^14.0.4",
Expand All @@ -25,9 +25,9 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@acme/eslint-config": "workspace:^0.2.0",
"@acme/prettier-config": "workspace:^0.1.0",
"@acme/tsconfig": "workspace:^0.1.0",
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"eslint": "^8.56.0",
"prettier": "^3.1.1",
"typescript": "^5.3.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/auth/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "@acme/tsconfig/base.json",
"compilerOptions": {
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json"
"tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json",
},
"include": ["src", "env.js"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
6 changes: 3 additions & 3 deletions packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"drizzle-orm": "^0.29.3"
},
"devDependencies": {
"@acme/eslint-config": "workspace:^0.2.0",
"@acme/prettier-config": "workspace:^0.1.0",
"@acme/tsconfig": "workspace:^0.1.0",
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"dotenv-cli": "^7.3.0",
"drizzle-kit": "^0.20.10",
"eslint": "^8.56.0",
Expand Down
Loading

0 comments on commit 3a5bb77

Please sign in to comment.