v0.1.2 944de91

vite.config.ts RawHistoryFolder

1import { defineConfig } from 'vitest/config';
2import { loadEnv } from 'vite';
3import { sveltekit } from '@sveltejs/kit/vite';
4
5/**
6 * Logging configuration
7 * This project uses two logging systems:
8 * 1. Console logging (development/client-side) - controlled by console stripping
9 * 2. Pino logging (server-side) - controlled by LOG_LEVEL
10 * 
11 * LOG_LEVEL affects both systems:
12 * - error: only error logs
13 * - warn: warn and error logs
14 * - info: info, warn, and error logs (default in production)
15 * - debug: all logs (default in development)
16 */
17
18// Define which console methods to strip based on LOG_LEVEL
19const getConsoleFuncsToStrip = (logLevel: string) => {
20	switch (logLevel?.toLowerCase()) {
21		case 'error':
22			return ['console.log', 'console.info', 'console.debug', 'console.warn'];
23		case 'warn':
24			return ['console.log', 'console.info', 'console.debug'];
25		case 'info':
26			return ['console.debug'];
27		case 'debug':
28		default:
29			return [];
30	}
31};
32
33export default defineConfig(({ mode }) => {
34	// Load env file based on `mode` value
35	const env = loadEnv(mode, process.cwd(), '');
36	const logLevel = env.LOG_LEVEL || (mode === 'development' ? 'debug' : 'info');
37	
38	console.log(`Building with LOG_LEVEL=${logLevel} in ${mode} mode`);
39
40	return {
41		plugins: [sveltekit()],
42		test: {
43			include: ['src/**/*.{test,spec}.{js,ts}']
44		},
45		build: {
46			minify: 'terser',
47			terserOptions: {
48				compress: {
49					// Strip console methods based on LOG_LEVEL
50					pure_funcs: getConsoleFuncsToStrip(logLevel)
51				}
52			},
53		},
54		// Make LOG_LEVEL available to client-side code
55		define: {
56			'process.env.LOG_LEVEL': JSON.stringify(logLevel)
57		}
58	};
59});

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 3

Tags 8

↑↓ moveenter openesc close