Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"type-enum": [
2,
"always",
[
"feat",
"fix",
"chore",
"docs",
"style",
"refactor",
"perf",
"test",
"ci",
"build",
"revert",
],
],
"scope-enum": [
1,
"always",
[
"backend",
"frontend",
"infra",
"api",
"worker",
"ai",
"scanner",
"graph",
"ci",
"deps",
],
],
"subject-case": [2, "always", "lower-case"],
"subject-empty": [2, "never"],
"type-empty": [2, "never"],
},
};
53 changes: 0 additions & 53 deletions .commitlintrc.json

This file was deleted.

27 changes: 15 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ jobs:
with:
node-version: 20

- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install commitlint
run: |
npm install -g @commitlint/cli @commitlint/config-conventional
bun install

- name: Validate PR commits
run: |
npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
bunx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

go-checks:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -147,29 +152,27 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
node-version: 20
cache: "npm"
cache-dependency-path: frontend/package-lock.json
bun-version: latest

- name: Frontend lint and format
run: |
cd frontend
npm ci
npm run lint
npm run format:check
bun install
bun run lint
bun run format:check

- name: Frontend tests
run: |
cd frontend
npm run test
bun run test

- name: Security scan (Frontend)
run: |
cd frontend
npm audit --omit=dev || true
bun audit --omit=dev || true

docker-build:
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ repos:
# Frontend checks
- id: eslint-check
name: eslint (frontend)
entry: bash -c 'cd frontend && npm run lint'
entry: bash -c 'cd frontend && bun run lint'
language: system
files: ^frontend/.*\.(ts|tsx|js|jsx)$
pass_filenames: false

- id: prettier-check
name: prettier check (frontend)
entry: bash -c 'cd frontend && npm run format:check'
entry: bash -c 'cd frontend && bun run format:check'
language: system
files: ^frontend/.*\.(ts|tsx|js|jsx|json|css|md)$
pass_filenames: false
Expand All @@ -124,7 +124,7 @@ repos:
# Commitlint
- id: commitlint
name: commitlint
entry: bash -c 'npx --yes @commitlint/cli --edit $1'
entry: bunx commitlint --edit
language: system
stages: [commit-msg]
always_run: true
Expand Down
220 changes: 220 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions frontend/.eslintrc.json

This file was deleted.

8 changes: 0 additions & 8 deletions frontend/.prettierignore

This file was deleted.

4 changes: 0 additions & 4 deletions frontend/.prettierrc

This file was deleted.

12 changes: 6 additions & 6 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
FROM node:20-alpine AS base
FROM oven/bun:alpine AS base

FROM base AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile

FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build
RUN bun run build

FROM base AS development
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
EXPOSE 3000
CMD ["npm", "run", "dev"]
CMD ["bun", "run", "dev"]

FROM base AS production
WORKDIR /app
Expand All @@ -26,4 +26,4 @@ COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
EXPOSE 3000
ENV PORT 3000
CMD ["node", "server.js"]
CMD ["bun", "server.js"]
42 changes: 25 additions & 17 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
Frontend application built with Next.js, providing the user interface for CloudCop.
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).

## Development
## Getting Started

Install dependencies:
First, run the development server:

```bash
npm install
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Lint and format:
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

```bash
npm run lint
npm run format
```
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

Run tests:
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.

```bash
npm run test
```
## Learn More

Run locally:
To learn more about Next.js, take a look at the following resources:

```bash
npm run dev
```
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
Loading