diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml index 951f9ec38..1954ce931 100644 --- a/.github/workflows/frontend-tests.yml +++ b/.github/workflows/frontend-tests.yml @@ -20,31 +20,24 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Install pnpm - uses: pnpm/action-setup@v4 + - name: Setup Bun + uses: oven-sh/setup-bun@v2 with: - version: 10 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: "23" - cache: "pnpm" - cache-dependency-path: frontend/pnpm-lock.yaml + bun-version: latest - name: Install dependencies working-directory: frontend - run: pnpm install --frozen-lockfile + run: bun install --frozen-lockfile # FIXME: Re-enable TypeScript checks after fixing pending local type errors # - name: Run TypeScript checks # working-directory: frontend - # run: pnpm typecheck + # run: bun run typecheck - name: Run tests working-directory: frontend - run: pnpm test:ci + run: bun run test:ci - name: Build frontend working-directory: frontend - run: pnpm build \ No newline at end of file + run: bun run build \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 658bd92d9..b6aa93934 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,22 +29,13 @@ jobs: with: just-version: "1.13.0" - - name: Install pnpm - uses: pnpm/action-setup@v4 + - name: Setup Bun + uses: oven-sh/setup-bun@v2 with: - version: 10 + bun-version: latest - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: "23" - cache: "pnpm" - # Specify the path to the lock file for caching - cache-dependency-path: frontend/pnpm-lock.yaml - - # Install frontend dependencies - - name: Install dependencies - run: cd frontend && pnpm install + - name: Install frontend dependencies + run: cd frontend && bun install --frozen-lockfile - name: Set up QEMU uses: docker/setup-qemu-action@v3 diff --git a/.golangci.yml b/.golangci.yml index ab6bf20b0..7a5cf9580 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,110 +1,91 @@ +version: "2" +run: + tests: true linters: enable: - - gofmt - - goimports - - gosimple - - govet - - staticcheck - - errcheck - - - unused - bodyclose - contextcheck - - misspell + - gocritic - gocyclo - gosec + - misspell - revive - - ineffassign - unconvert - unparam - - gocritic - disable: - - exhaustruct - depguard - -linters-settings: - goimports: - local-prefixes: github.com/mr-karan/logchef - - govet: - enable-all: true - disable: - - fieldalignment - - shadow - - gocyclo: - min-complexity: 20 - - gosec: - excludes: - - G104 - - revive: + - exhaustruct + settings: + gocritic: + disabled-checks: + - hugeParam + - emptyStringTest + enabled-tags: + - diagnostic + - style + - performance + gocyclo: + min-complexity: 20 + gosec: + excludes: + - G104 + govet: + disable: + - fieldalignment + - shadow + enable-all: true + revive: + rules: + - name: exported + arguments: + - checkPrivateReceivers + - disableStutteringCheck + severity: warning + disabled: false + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling rules: - - name: exported - severity: warning - disabled: false - arguments: - - "checkPrivateReceivers" - - "disableStutteringCheck" - - gocritic: - enabled-tags: - - diagnostic - - style - - performance - disabled-checks: - - hugeParam - - emptyStringTest - -run: - timeout: 5m - - tests: true - - skip-dirs: - - vendor - - frontend - - design - - deploy - - dev/experiment - - skip-files: - - ".*\\.generated\\.go$" - -output: - format: colored-line-number - - print-issued-lines: true - - print-linter-name: true - + - linters: + - errcheck + path: _test\.go + - linters: + - dupl + - gocyclo + - gosec + path: _test\.go + - linters: + - gosec + text: 'G107: Potential HTTP request made with variable url' + - linters: + - gocritic + - revive + text: 'TODO:' + - linters: + - contextcheck + text: Function `GetHealth` should pass the context parameter + paths: + - third_party$ + - builtin$ + - examples$ issues: max-issues-per-linter: 50 - max-same-issues: 3 - - exclude-rules: - - path: _test\.go - linters: - - errcheck - - - path: _test\.go - linters: - - gocyclo - - gosec - - dupl - - - text: "G107: Potential HTTP request made with variable url" - linters: - - gosec - - - text: "TODO:" - linters: - - revive - - gocritic - - - text: "Function `GetHealth` should pass the context parameter" - linters: - - contextcheck +formatters: + enable: + - gofmt + - goimports + settings: + goimports: + local-prefixes: + - github.com/mr-karan/logchef + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/CHANGELOG.md b/CHANGELOG.md index 77968a55d..34c2b0ee3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- **Bookmark Favorite Queries** - Star saved queries for quick access ([#60](https://github.com/mr-karan/logchef/pull/60)) + - Bookmarked queries appear at top of collections dropdown + - Copy shareable URL for any saved query + - Direct link format: `/logs/collection/:teamId/:sourceId/:collectionId` + +### Changed +- **LogChefQL Parser Rewrite** - Replaced hand-written tokenizer with grammar-based parser using [participle](https://github.com/alecthomas/participle) + - Better error messages with position-aware diagnostics + - More maintainable and extensible grammar definitions + - Improved query type detection (LogChefQL vs SQL) +- **Frontend Tooling Migration** - Switched from pnpm + Vite to Bun + rolldown-vite + - Build time: ~2.3s (was >55s) + - Dev server start: ~1s (was ~3s) + - Install time: ~8s (was ~25s) +- **Frontend State Management** - Refactored stores and composables + - Centralized URL state synchronization + - Cleaner explore store with better state transitions + - Improved context and teams store initialization + +### Fixed +- Proper context propagation throughout backend (contextcheck compliance) +- Reduced cyclomatic complexity in high-complexity functions +- **Saved Query Navigation** - Switching between saved queries no longer shows stale content +- **Saved Query Validation** - Backend now accepts relative-only time ranges (was: "absolute start time must be positive") +- **Cross-Page Context** - Team/source selection preserved when navigating between Explorer, Collections, and Alerts +- **Sidebar Navigation** - Links now include full context params (team + source) + +### Contributors +- [@rhnvrm](https://github.com/rhnvrm) - Bookmark favorite queries feature ([#60](https://github.com/mr-karan/logchef/pull/60)) + ## [1.0.0] - 2025-12-22 The 1.0 release marks Logchef as production-ready. Eight months of development brought alerting, a proper backend query language, field exploration, and many UX improvements. diff --git a/Justfile b/Justfile index 88153d443..cdaf5f19c 100644 --- a/Justfile +++ b/Justfile @@ -41,15 +41,15 @@ build-backend: sqlc-generate build-ui: @echo "Building frontend..." cd frontend && \ - [ -d "node_modules" ] || pnpm install --frozen-lockfile --silent && \ - pnpm build + [ -d "node_modules" ] || bun install --frozen-lockfile && \ + bun run build # Build frontend with bundle analysis build-ui-analyze: @echo "Building frontend with bundle analysis..." cd frontend && \ - [ -d "node_modules" ] || pnpm install --frozen-lockfile --silent && \ - pnpm build:analyze + [ -d "node_modules" ] || bun install --frozen-lockfile && \ + bun run build:analyze # Run the server with config run: build @@ -63,7 +63,7 @@ run-backend: build-backend # Run only the frontend server run-frontend: - cd frontend && pnpm dev + cd frontend && bun run dev # Run the documentation server locally run-docs: diff --git a/frontend/.npmrc b/frontend/.npmrc deleted file mode 100644 index 21e4e247e..000000000 --- a/frontend/.npmrc +++ /dev/null @@ -1,4 +0,0 @@ -shamefully-hoist=true -strict-peer-dependencies=false -auto-install-peers=true -node-linker=hoisted \ No newline at end of file diff --git a/frontend/.vite/deps/_metadata.json b/frontend/.vite/deps/_metadata.json deleted file mode 100644 index 182cd67a7..000000000 --- a/frontend/.vite/deps/_metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "hash": "4d830ba3", - "configHash": "bab4fc9a", - "lockfileHash": "c2470bbc", - "browserHash": "f3bc5c97", - "optimized": {}, - "chunks": {} -} \ No newline at end of file diff --git a/frontend/.vite/deps/package.json b/frontend/.vite/deps/package.json deleted file mode 100644 index 3dbc1ca59..000000000 --- a/frontend/.vite/deps/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/frontend/README.md b/frontend/README.md index 33895ab20..f342c9cf7 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,5 +1,69 @@ -# Vue 3 + TypeScript + Vite +# LogChef Frontend -This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `