Skip to content

Commit

Permalink
ci: workflow, linting, etc (cool stuff)
Browse files Browse the repository at this point in the history
  • Loading branch information
inducingchaos committed Dec 21, 2024
1 parent d95314b commit 9447345
Show file tree
Hide file tree
Showing 42 changed files with 1,714 additions and 2,047 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- uses: actions/cache@v4
with:
path: |
node_modules
.next/cache
key: ${{ runner.os }}-modules-${{ hashFiles('bun.lockb') }}
- run: bun install
- run: bunx commitlint --from HEAD~1 --to HEAD --verbose
- run: bun run format
- run: bun run typecheck
- run: bun run lint
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ coverage

# Build.

.husky/_
.next
.turbo
*.tsbuildinfo
Expand Down
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bunx commitlint --edit $1
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bun run format
bun run typecheck
bun run lint
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

My name is Riley. Engineer of self-state, designer of systems, and architect of precision at scale. I take an interest in actualizing the unknown.

## Development

### Git Hooks

Hooks can be bypassed in emergencies:

- `git commit --no-verify` - Skip all checks
- `SKIP=pre-commit git commit` - Skip specific check

Use sparingly - these bypass important quality checks!

```
//
//
Expand Down
Binary file modified bun.lockb
Binary file not shown.
14 changes: 14 additions & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
*
*/

export default {
extends: ["@commitlint/config-conventional"],
rules: {
"type-enum": [
2,
"always",
["feat", "fix", "perf", "refactor", "style", "docs", "test", "chore", "ci", "revert", "build"]
]
}
}
11 changes: 0 additions & 11 deletions git-commit.config.ts

This file was deleted.

14 changes: 7 additions & 7 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ export default {
hostname: "avatar.vercel.sh"
}
]
}
},

// typescript: {
// ignoreBuildErrors: true
// },
// eslint: {
// ignoreDuringBuilds: true
// }
typescript: {
ignoreBuildErrors: true
},
eslint: {
ignoreDuringBuilds: true
}
} satisfies NextConfig
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
"dev": "next dev --turbo --port 0221",
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint:fix": "next lint --fix",
"lint": "eslint . --ext .ts,.tsx --report-unused-disable-directives --max-warnings 0 --cache",
"lint:fix": "eslint . --ext .ts,.tsx --fix",
"format": "prettier --write --log-level warn .",
"typecheck": "tsc",
"prepare": "husky",
"db:generate": "drizzle-kit generate",
"db:migrate": "npx tsx --env-file ./.env ./src/scripts/build/db/migrate.ts",
"db:push": "drizzle-kit push",
Expand Down Expand Up @@ -121,6 +124,8 @@
"zsa-react": "^0.2.2"
},
"devDependencies": {
"@commitlint/cli": "^19.6.1",
"@commitlint/config-conventional": "^19.6.0",
"@tailwindcss/typography": "^0.5.15",
"@types/d3-scale": "^4.0.8",
"@types/eslint": "^8.56.10",
Expand All @@ -141,6 +146,7 @@
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-drizzle": "^0.2.3",
"eslint-plugin-tailwindcss": "^3.17.5",
"husky": "^9.1.7",
"openai": "^4.52.7",
"postcss": "^8.4.39",
"prettier": "^3.3.2",
Expand Down
42 changes: 21 additions & 21 deletions src/_ignore/experimental/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: Lint
on:
push:
push:

jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run lint
run: pnpm lint
build:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Run lint
run: pnpm lint
1 change: 0 additions & 1 deletion src/_ignore/experimental/stacks-stash-stuff/styles.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/* STACK */

/* The base debug styles for the `Stack` component. */
Expand Down
35 changes: 34 additions & 1 deletion src/_ignore/experimental/templating-constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
const regions = ["US", "CA", "MX", "BR", "DE", "FR", "IT", "ES", "GB", "IN", "AU", "JP", "NL", "SG", "PL", "TR", "RU", "CN", "KR", "ZA", "PH", "MY", "TH", "ID", "VN", "AR", "CO", "EG", "PK", "CL", "ZA", "MX"]
const regions = [
"US",
"CA",
"MX",
"BR",
"DE",
"FR",
"IT",
"ES",
"GB",
"IN",
"AU",
"JP",
"NL",
"SG",
"PL",
"TR",
"RU",
"CN",
"KR",
"ZA",
"PH",
"MY",
"TH",
"ID",
"VN",
"AR",
"CO",
"EG",
"PK",
"CL",
"ZA",
"MX"
]

type Region = (typeof regions)[number]

Expand Down
12 changes: 9 additions & 3 deletions src/app/(site)/ledger/_components/entries.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
*
*
*/

"use client"
Expand Down Expand Up @@ -54,7 +54,13 @@ export function Entries(): JSX.Element {

{/* The message input. */}

<input className="border" type="text" placeholder="Message" value={message} onChange={e => setMessage(e.target.value)} />
<input
className="border"
type="text"
placeholder="Message"
value={message}
onChange={e => setMessage(e.target.value)}
/>

{/* Submit button. */}

Expand Down Expand Up @@ -108,4 +114,4 @@ export function Entries(): JSX.Element {
)}
</>
)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
*
*
*/

export * from "./header"
export * from "./header"
4 changes: 2 additions & 2 deletions src/components/providers/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
*
*/

export * from "./auth"
export * from "./theme"
export * from "./theme"
4 changes: 2 additions & 2 deletions src/components/ui/layout/navigation/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
*
*
*/

export * from "./sidebar"
export * from "./sidebar"
2 changes: 1 addition & 1 deletion src/components/ui/primitives/inputs/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const SelectContent = forwardRef<
<SelectPrimitive.Content
ref={ref}
className={cn(
"relative z-50 max-h-384px min-w-[8rem] overflow-hidden rounded-6px border bg-alternate text-main shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-zero data-[state=open]:fade-in-zero data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-8px data-[side=left]:slide-in-from-right-8px data-[side=right]:slide-in-from-left-8px data-[side=top]:slide-in-from-bottom-8px",
"relative z-50 max-h-384px min-w-128px-r overflow-hidden rounded-6px border bg-alternate text-main shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-zero data-[state=open]:fade-in-zero data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-8px data-[side=left]:slide-in-from-right-8px data-[side=right]:slide-in-from-left-8px data-[side=top]:slide-in-from-bottom-8px",
position === "popper" &&
"data-[side=bottom]:translate-y-4px data-[side=left]:-translate-x-4px data-[side=right]:translate-x-4px data-[side=top]:-translate-y-4px",
className
Expand Down
12 changes: 6 additions & 6 deletions src/config/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* @remarks
* - To set or override the current environment, adjust the `NEXT_PUBLIC_ENVIRONMENT` variable in the '.env' file. This value must be set everywhere the application is running.
* - To access configuration values for a specific environment, use `application.<environment>`.
*
* @todo
* - [P3] Create custom errors for Zod validation.
* - [P4] Extract into an API that's easier to use - see "~/_archived/config.ts".
* - [P4] Fix if still applicable: https://chatgpt.com/c/8456d4d1-34d8-4d23-89c1-054d9c23e23f.
*/
*
* @todo
* - [P3] Create custom errors for Zod validation.
* - [P4] Extract into an API that's easier to use - see "~/_archived/config.ts".
* - [P4] Fix if still applicable: https://chatgpt.com/c/8456d4d1-34d8-4d23-89c1-054d9c23e23f.
*/

/* eslint-disable import/no-named-as-default-member */

Expand Down
1 change: 0 additions & 1 deletion src/constants/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ export const networkStatuses = {
"503": "service-unavailable",
"504": "gateway-timeout"
} as const

Loading

0 comments on commit 9447345

Please sign in to comment.