File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ - master
8+ tags :
9+ - ' v*'
10+ pull_request :
11+ branches :
12+ - main
13+ - master
14+ workflow_dispatch :
15+
16+ permissions :
17+ contents : write
18+ pull-requests : write
19+
20+ jobs :
21+ release :
22+ runs-on : ubuntu-latest
23+ steps :
24+ - uses : actions/checkout@v4
25+ with :
26+ fetch-depth : 0
27+
28+ - uses : jdx/mise-action@v2
29+ with :
30+ experimental : true
31+
32+ - name : Install dependencies
33+ run : mise run install
34+
35+ - name : Codegen
36+ run : mise run codegen
37+
38+ - name : Check for changes and create PR
39+ uses : peter-evans/create-pull-request@v6
40+ with :
41+ token : ${{ secrets.GITHUB_TOKEN }}
42+ commit-message : ' chore: update generated code'
43+ title : ' chore: update generated code'
44+ body : ' This PR updates the generated code.'
45+ branch : ' codegen-update'
46+ base : ' main'
47+ delete-branch : true
48+
49+ - name : CI
50+ run : mise run ci
51+
52+ - name : Release
53+ if : startsWith(github.ref, 'refs/tags/')
54+ env :
55+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56+ run : gh release create ${{ github.ref_name }} --generate-notes
57+
58+ - name : Artifacts
59+ if : startsWith(github.ref, 'refs/tags/')
60+ env :
61+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
62+ run : |
63+ tar -czf build.tar.gz build || echo "No build directory"
64+ gh release upload ${{ github.ref_name }} build.tar.gz || true
Original file line number Diff line number Diff line change @@ -3,11 +3,13 @@ bun = "1.3.8"
33
44[tasks ]
55install = " bun install"
6- codegen = " npm run paraglide:compile"
7- "lint:eslint" = " eslint . "
8- "lint:prettier" = " prettier --check . "
6+ codegen = " bun run paraglide:compile"
7+ "lint:eslint" = " bun run lint:eslint "
8+ "lint:prettier" = " bun run lint:prettier "
99"lint:check" = " bun run check"
10- lint = { depends = [" lint:eslint" , " lint:prettier" , " lint:check" ] }
10+ lint = { depends = [" lint:*" ] }
11+ "fmt:prettier" = " bun run fmt:prettier"
12+ fmt = { depends = [" fmt:*" ] }
1113build = " bun run build"
1214test = " echo 'No tests found'"
13- ci = { depends = [" lint" , " build" ] }
15+ ci = { depends = [" lint" , " test " , " build" ] }
Original file line number Diff line number Diff line change 1010 "build" : " vite build" ,
1111 "preview" : " vite preview" ,
1212 "check" : " svelte-kit sync && svelte-check --tsconfig ./tsconfig.json" ,
13- "check:watch" : " svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
13+ "check:watch" : " svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" ,
14+ "lint:eslint" : " eslint ." ,
15+ "lint:prettier" : " prettier --check ." ,
16+ "fmt:prettier" : " prettier --write ."
1417 },
1518 "devDependencies" : {
1619 "@eslint/js" : " ^9.39.2" ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import type { Theme } from '$lib/Model';
33import { normalizeColor , normalizeColorKeys } from '$lib/utils/theme' ;
44import { sanitize } from '$lib/utils/security' ;
55import { parseSimpleYaml } from '$lib/utils/yaml' ;
6+ import { reportError } from '$lib/utils/error' ;
67
78let themeCounter = 0 ;
89
@@ -104,7 +105,7 @@ async function processFile(file: File) {
104105 const structure = parseSimpleYaml ( content ) ;
105106 handleOneStructure ( structure , filename ) ;
106107 } catch ( yamlError ) {
107- console . error ( `Failed to parse file ${ filename } :` , yamlError ) ;
108+ reportError ( `Failed to parse file ${ filename } :` , yamlError ) ;
108109 }
109110}
110111
Original file line number Diff line number Diff line change 1+ /**
2+ * Reports an error to the centralized error tracking system.
3+ * Currently logs to console, but can be extended to use Sentry or other services.
4+ *
5+ * @param message - A descriptive message for the error.
6+ * @param error - The error object or unknown error value.
7+ * @param context - Optional additional context to include with the error report.
8+ */
9+ export function reportError (
10+ message : string ,
11+ error ?: unknown ,
12+ context ?: Record < string , unknown >
13+ ) : void {
14+ if ( error ) {
15+ console . error ( message , error , context ) ;
16+ } else {
17+ console . error ( message , context ) ;
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments