-
Notifications
You must be signed in to change notification settings - Fork 1
10 feat add husky lint checking #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
eede387
feat: added husky
nazarli-shabnam a5e4e27
feat: normalize line endings repo-wide
nazarli-shabnam 7de14a4
feat: github workflow - ci/cd
nazarli-shabnam df15d09
docs: readme updated
nazarli-shabnam be48bd7
feat: enforce conventional commits
nazarli-shabnam daf37ca
fix: linting issues, pre-commit check
nazarli-shabnam 139c2ba
docs: updated readme for current version of project
nazarli-shabnam bb22c3a
fix(ui): track lib/utils and scope root lib gitignore
nazarli-shabnam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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,32 @@ | ||
| # Normalize line endings repo-wide to avoid CRLF/LF churn on Windows. | ||
| # Default: treat files as text and store them with LF in git. | ||
| * text=auto eol=lf | ||
|
|
||
| # Windows scripts should remain CRLF | ||
| *.bat text eol=crlf | ||
| *.cmd text eol=crlf | ||
| *.ps1 text eol=crlf | ||
| *.psm1 text eol=crlf | ||
|
|
||
| # Shell scripts should be LF | ||
| *.sh text eol=lf | ||
|
|
||
| # Common binaries | ||
| *.png binary | ||
| *.jpg binary | ||
| *.jpeg binary | ||
| *.gif binary | ||
| *.webp binary | ||
| *.ico binary | ||
| *.pdf binary | ||
| *.zip binary | ||
| *.gz binary | ||
| *.tgz binary | ||
| *.7z binary | ||
| *.woff binary | ||
| *.woff2 binary | ||
| *.ttf binary | ||
| *.eot binary | ||
| *.mp4 binary | ||
| *.webm binary | ||
| *.mov binary |
This file contains hidden or 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,97 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - "**" | ||
|
|
||
| jobs: | ||
| commits: | ||
| name: Commit Messages (Conventional Commits) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout (full history) | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
|
|
||
| - name: Install commitlint | ||
| run: npm ci --ignore-scripts | ||
|
|
||
| - name: Lint commits (PR) | ||
| if: ${{ github.event_name == 'pull_request' }} | ||
| run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.sha }} --verbose | ||
|
|
||
| - name: Lint commits (push) | ||
| if: ${{ github.event_name == 'push' }} | ||
| run: npx commitlint --from ${{ github.event.before }} --to ${{ github.sha }} --verbose | ||
|
|
||
| ui: | ||
| name: UI Typecheck + Build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| cache: npm | ||
| cache-dependency-path: apps/ui/package-lock.json | ||
|
|
||
| - name: Install UI deps | ||
| working-directory: apps/ui | ||
| run: npm ci | ||
|
|
||
| - name: Typecheck | ||
| working-directory: apps/ui | ||
| run: npm run typecheck | ||
|
|
||
| - name: Build UI | ||
| working-directory: apps/ui | ||
| run: npm run build | ||
|
|
||
| python: | ||
| name: Python Compile / Requirements | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install API/Worker requirements | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install -r apps/api/requirements.txt | ||
| python -m pip install -r apps/worker/requirements.txt | ||
|
|
||
| - name: Compile Python sources | ||
| run: python -m compileall apps/api/src apps/worker/src | ||
|
|
||
| docker: | ||
| name: Docker Build Verification | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Build API image | ||
| run: docker build -t clevis-api -f apps/api/Dockerfile . | ||
|
|
||
| - name: Build Worker image | ||
| run: docker build -t clevis-worker -f apps/worker/Dockerfile apps/worker | ||
|
|
||
| - name: Build UI image | ||
| run: docker build -t clevis-ui -f apps/ui/Dockerfile apps/ui | ||
|
|
This file contains hidden or 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,57 @@ | ||
| name: Release (Docker Images) | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| tags: | ||
| - "v*" | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| jobs: | ||
| publish: | ||
| name: Build + Push | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Log in to GHCR | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build + Push API | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: apps/api/Dockerfile | ||
| push: true | ||
| tags: | | ||
| ghcr.io/${{ github.repository }}-api:latest | ||
| ghcr.io/${{ github.repository }}-api:${{ github.ref_name }} | ||
|
|
||
| - name: Build + Push Worker | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: apps/worker | ||
| file: apps/worker/Dockerfile | ||
| push: true | ||
| tags: | | ||
| ghcr.io/${{ github.repository }}-worker:latest | ||
| ghcr.io/${{ github.repository }}-worker:${{ github.ref_name }} | ||
|
|
||
| - name: Build + Push UI | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: apps/ui | ||
| file: apps/ui/Dockerfile | ||
| push: true | ||
| tags: | | ||
| ghcr.io/${{ github.repository }}-ui:latest | ||
| ghcr.io/${{ github.repository }}-ui:${{ github.ref_name }} | ||
|
|
This file contains hidden or 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 hidden or 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,2 @@ | ||
| #!/usr/bin/env sh | ||
| npx --no -- commitlint --edit "$1" |
This file contains hidden or 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,2 @@ | ||
| #!/usr/bin/env sh | ||
| npm --prefix apps/ui run typecheck | ||
This file contains hidden or 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 hidden or 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,6 @@ | ||
| import { clsx, type ClassValue } from "clsx" | ||
| import { twMerge } from "tailwind-merge" | ||
|
|
||
| export function cn(...inputs: ClassValue[]) { | ||
| return twMerge(clsx(inputs)) | ||
| } |
This file contains hidden or 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,5 +1,6 @@ | ||
| /// <reference types="next" /> | ||
| /// <reference types="next/image-types/global" /> | ||
| /// <reference path="./.next/types/routes.d.ts" /> | ||
|
|
||
| // NOTE: This file should not be edited | ||
| // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. |
This file contains hidden or 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,6 +1,9 @@ | ||
| /** @type {import('next').NextConfig} */ | ||
| const nextConfig = { | ||
| output: "standalone", | ||
| // Avoid Next.js workspace-root inference issues when multiple lockfiles exist. | ||
| // This keeps file tracing scoped to the monorepo root. | ||
| outputFileTracingRoot: new URL("..", import.meta.url).pathname, | ||
| }; | ||
|
|
||
| export default nextConfig; |
This file contains hidden or 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 hidden or 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 hidden or 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,4 @@ | ||
| module.exports = { | ||
| extends: ["@commitlint/config-conventional"], | ||
| } | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.