diff --git a/backend/_example/memory_store/go.mod b/backend/_example/memory_store/go.mod index 9b305cec..08522df9 100644 --- a/backend/_example/memory_store/go.mod +++ b/backend/_example/memory_store/go.mod @@ -13,11 +13,11 @@ require ( require ( github.com/Depado/bfchroma/v2 v2.0.0 // indirect github.com/PuerkitoBio/goquery v1.12.0 // indirect - github.com/alecthomas/chroma/v2 v2.24.1 // indirect - github.com/andybalholm/cascadia v1.3.3 // indirect + github.com/alecthomas/chroma/v2 v2.27.0 // indirect + github.com/andybalholm/cascadia v1.3.4 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dlclark/regexp2 v1.12.0 // indirect + github.com/dlclark/regexp2/v2 v2.2.2 // indirect github.com/go-pkgz/rest v1.21.0 // indirect github.com/go-pkgz/routegroup v1.6.0 // indirect github.com/gorilla/css v1.0.1 // indirect @@ -29,11 +29,11 @@ require ( github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/rs/xid v1.6.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - go.etcd.io/bbolt v1.4.3 // indirect - golang.org/x/crypto v0.51.0 // indirect - golang.org/x/image v0.40.0 // indirect - golang.org/x/net v0.54.0 // indirect - golang.org/x/sys v0.44.0 // indirect + go.etcd.io/bbolt v1.5.0 // indirect + golang.org/x/crypto v0.53.0 // indirect + golang.org/x/image v0.43.0 // indirect + golang.org/x/net v0.56.0 // indirect + golang.org/x/sys v0.46.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/backend/_example/memory_store/go.sum b/backend/_example/memory_store/go.sum index c2c21146..9fabb51c 100644 --- a/backend/_example/memory_store/go.sum +++ b/backend/_example/memory_store/go.sum @@ -4,19 +4,19 @@ github.com/PuerkitoBio/goquery v1.12.0 h1:pAcL4g3WRXekcB9AU/y1mbKez2dbY2AajVhtkO github.com/PuerkitoBio/goquery v1.12.0/go.mod h1:802ej+gV2y7bbIhOIoPY5sT183ZW0YFofScC4q/hIpQ= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/chroma/v2 v2.24.1 h1:m5ffpfZbIb++k8AqFEKy9uVgY12xIQtBsQlc6DfZJQM= -github.com/alecthomas/chroma/v2 v2.24.1/go.mod h1:l+ohZ9xRXIbGe7cIW+YZgOGbvuVLjMps/FYN/CwuabI= +github.com/alecthomas/chroma/v2 v2.27.0 h1:FodwmyOBgJULFYmDqibcp9pvfDLWdtPRh9v/r5BXYZs= +github.com/alecthomas/chroma/v2 v2.27.0/go.mod h1:NjJ3ciIgrqBNeIkWZ4e46nseoLDslxU1LmfCoL+wcY8= github.com/alecthomas/repr v0.5.2 h1:SU73FTI9D1P5UNtvseffFSGmdNci/O6RsqzeXJtP0Qs= github.com/alecthomas/repr v0.5.2/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= -github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM= -github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA= +github.com/andybalholm/cascadia v1.3.4 h1:vM2lgh0Vru9Vwyfm4cQqWP2HHMW0u0+2PAW7Q38Qufg= +github.com/andybalholm/cascadia v1.3.4/go.mod h1:BLRmbRjpEtNKieZOCCvYj4RqN+KRA41GBe/5O+G93kM= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dlclark/regexp2 v1.12.0 h1:0j4c5qQmnC6XOWNjP3PIXURXN2gWx76rd3KvgdPkCz8= -github.com/dlclark/regexp2 v1.12.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dlclark/regexp2/v2 v2.2.2 h1:MYWvNYw8okuqNhwTYO587EZMiDruVa2vhV6fsGpfya0= +github.com/dlclark/regexp2/v2 v2.2.2/go.mod h1:avUrQvPaLz2DrFNHJF0taWAFFX2C1GMSSoeiqFjcBmU= github.com/go-pkgz/jrpc v0.4.0 h1:oD7xiGrzDkndkuCjeHGugQXxbggLSV7O1QmHhoc5pYY= github.com/go-pkgz/jrpc v0.4.0/go.mod h1:JFoY3bRjRyx4M3CbEVDFQStMB1m2gmQ7OjqFK7q3kOo= github.com/go-pkgz/lgr v0.12.3 h1:QDug7kRkEsuQtruT9fNF5PVT2kZUqCDPc4GmsgS3fP8= @@ -25,7 +25,6 @@ github.com/go-pkgz/rest v1.21.0 h1:Y/C4d/TpclJJDxqnH1RAcS6Hmox0RIReAlkwMcUWXK4= github.com/go-pkgz/rest v1.21.0/go.mod h1:+AHzjHazq7Z3Tk/kRWOhbbAz/YZlUV40feC1Hf4NtbE= github.com/go-pkgz/routegroup v1.6.0 h1:44XHZgF6JIIldRlv+zjg6SygULASmjifnfIQjwCT0e4= github.com/go-pkgz/routegroup v1.6.0/go.mod h1:Pmu04fhgWhRtBMIJ8HXppnnzOPjnL/IEPBIdO2zmeqg= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8= github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -53,82 +52,18 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.etcd.io/bbolt v1.4.3 h1:dEadXpI6G79deX5prL3QRNP6JB8UxVkqo4UPnHaNXJo= -go.etcd.io/bbolt v1.4.3/go.mod h1:tKQlpPaYCVFctUIgFKFnAlvbmB3tpy1vkTnDWohtc0E= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= -golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI= -golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8= -golang.org/x/image v0.40.0 h1:Tw4GyDXMo+daZN1znreBRC3VayR1aLFUyUEOLUdW1a8= -golang.org/x/image v0.40.0/go.mod h1:uIc348UZMSvS5Z65CVZ7iDPaNobNFEPeJ4kbqTOszmA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= -golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= -golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +go.etcd.io/bbolt v1.5.0 h1:S7GAl7Fxv12yohbwFfIbQCGDWbQbtDGPET4P/bD4lxU= +go.etcd.io/bbolt v1.5.0/go.mod h1:mkltfYE5aUHQxUct9N9V+Kp7aSjFqjgrhcXIS70Lrdk= +golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto= +golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio= +golang.org/x/image v0.43.0 h1:FLxcP4ec2350nTfOC8ysKtqYSIFbk/QGjw1ZHNP4tsY= +golang.org/x/image v0.43.0/go.mod h1:rrpelvGFt+kLPAjPM4HeWPgrl0FtafueU//e5N0qk/Q= +golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= +golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= +golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= +golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= +golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/backend/go.mod b/backend/go.mod index f17f0e6e..e9f6b73a 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -5,7 +5,7 @@ go 1.25.0 require ( github.com/Depado/bfchroma/v2 v2.0.0 github.com/PuerkitoBio/goquery v1.12.0 - github.com/alecthomas/chroma/v2 v2.24.1 + github.com/alecthomas/chroma/v2 v2.27.0 github.com/didip/tollbooth/v8 v8.0.1 github.com/go-chi/chi/v5 v5.2.5 github.com/go-chi/cors v1.2.2 @@ -28,22 +28,22 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e github.com/stretchr/testify v1.11.1 - go.etcd.io/bbolt v1.4.3 + go.etcd.io/bbolt v1.5.0 go.uber.org/goleak v1.3.0 - golang.org/x/crypto v0.51.0 - golang.org/x/image v0.40.0 - golang.org/x/net v0.54.0 + golang.org/x/crypto v0.53.0 + golang.org/x/image v0.43.0 + golang.org/x/net v0.56.0 golang.org/x/oauth2 v0.36.0 ) require ( cloud.google.com/go/compute/metadata v0.9.0 // indirect - github.com/andybalholm/cascadia v1.3.3 // indirect + github.com/andybalholm/cascadia v1.3.4 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dghubble/oauth1 v0.7.3 // indirect - github.com/dlclark/regexp2 v1.12.0 // indirect + github.com/dlclark/regexp2/v2 v2.2.2 // indirect github.com/go-oauth2/oauth2/v4 v4.5.4 // indirect github.com/go-pkgz/email v0.6.0 // indirect github.com/go-pkgz/expirable-cache/v3 v3.1.0 // indirect @@ -54,20 +54,20 @@ require ( github.com/gorilla/websocket v1.5.3 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect - github.com/klauspost/compress v1.18.6 // indirect + github.com/klauspost/compress v1.18.7 // indirect github.com/montanaflynn/stats v0.9.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/redis/go-redis/v9 v9.19.0 // indirect + github.com/redis/go-redis/v9 v9.21.0 // indirect github.com/rrivera/identicon v0.0.0-20240116195454-d5ba35832c0d // indirect - github.com/slack-go/slack v0.23.1 // indirect + github.com/slack-go/slack v0.27.0 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.2.0 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect go.mongodb.org/mongo-driver v1.17.9 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.44.0 // indirect - golang.org/x/text v0.37.0 // indirect + golang.org/x/sync v0.21.0 // indirect + golang.org/x/sys v0.46.0 // indirect + golang.org/x/text v0.38.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/backend/go.sum b/backend/go.sum index 32a1d87b..55a26990 100644 --- a/backend/go.sum +++ b/backend/go.sum @@ -8,8 +8,8 @@ github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/chroma/v2 v2.24.1 h1:m5ffpfZbIb++k8AqFEKy9uVgY12xIQtBsQlc6DfZJQM= -github.com/alecthomas/chroma/v2 v2.24.1/go.mod h1:l+ohZ9xRXIbGe7cIW+YZgOGbvuVLjMps/FYN/CwuabI= +github.com/alecthomas/chroma/v2 v2.27.0 h1:FodwmyOBgJULFYmDqibcp9pvfDLWdtPRh9v/r5BXYZs= +github.com/alecthomas/chroma/v2 v2.27.0/go.mod h1:NjJ3ciIgrqBNeIkWZ4e46nseoLDslxU1LmfCoL+wcY8= github.com/alecthomas/repr v0.5.2 h1:SU73FTI9D1P5UNtvseffFSGmdNci/O6RsqzeXJtP0Qs= github.com/alecthomas/repr v0.5.2/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 h1:uvdUDbHQHO85qeSydJtItA4T55Pw6BtAejd0APRJOCE= @@ -18,8 +18,8 @@ github.com/alicebob/miniredis/v2 v2.31.1 h1:7XAt0uUg3DtwEKW5ZAGa+K7FZV2DdKQo5K/6 github.com/alicebob/miniredis/v2 v2.31.1/go.mod h1:UB/T2Uztp7MlFSDakaX1sTXUv5CASoprx0wulRT6HBg= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM= -github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA= +github.com/andybalholm/cascadia v1.3.4 h1:vM2lgh0Vru9Vwyfm4cQqWP2HHMW0u0+2PAW7Q38Qufg= +github.com/andybalholm/cascadia v1.3.4/go.mod h1:BLRmbRjpEtNKieZOCCvYj4RqN+KRA41GBe/5O+G93kM= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= @@ -34,8 +34,8 @@ github.com/dghubble/oauth1 v0.7.3 h1:EkEM/zMDMp3zOsX2DC/ZQ2vnEX3ELK0/l9kb+vs4ptE github.com/dghubble/oauth1 v0.7.3/go.mod h1:oxTe+az9NSMIucDPDCCtzJGsPhciJV33xocHfcR2sVY= github.com/didip/tollbooth/v8 v8.0.1 h1:VAAapTo1t4Bn6bbpcHjuovwoa9u3JH++wgjbpWv+rB8= github.com/didip/tollbooth/v8 v8.0.1/go.mod h1:oEd9l+ep373d7DmvKLc0a5gasPOev2mTewi6KPQBGJ4= -github.com/dlclark/regexp2 v1.12.0 h1:0j4c5qQmnC6XOWNjP3PIXURXN2gWx76rd3KvgdPkCz8= -github.com/dlclark/regexp2 v1.12.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dlclark/regexp2/v2 v2.2.2 h1:MYWvNYw8okuqNhwTYO587EZMiDruVa2vhV6fsGpfya0= +github.com/dlclark/regexp2/v2 v2.2.2/go.mod h1:avUrQvPaLz2DrFNHJF0taWAFFX2C1GMSSoeiqFjcBmU= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/gavv/httpexpect v2.0.0+incompatible h1:1X9kcRshkSKEjNJJxX9Y9mQ5BRfbxU5kORdjhlA1yX8= @@ -76,7 +76,6 @@ github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63Y github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs= github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= @@ -106,8 +105,8 @@ github.com/jessevdk/go-flags v1.6.1 h1:Cvu5U8UGrLay1rZfv/zP7iLpSHGUZ/Ou68T0iX1bB github.com/jessevdk/go-flags v1.6.1/go.mod h1:Mk8T1hIAWpOiJiHa9rJASDK2UGWji0EuPGBnNLMooyc= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao= -github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= +github.com/klauspost/compress v1.18.7 h1:aUyZsS4kH3QTKurYhAOwAHxllVPnOthb3vPfnF1Ehjw= +github.com/klauspost/compress v1.18.7/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -124,8 +123,8 @@ github.com/moul/http2curl v1.0.0 h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/redis/go-redis/v9 v9.19.0 h1:XPVaaPSnG6RhYf7p+rmSa9zZfeVAnWsH5h3lxthOm/k= -github.com/redis/go-redis/v9 v9.19.0/go.mod h1:v/M13XI1PVCDcm01VtPFOADfZtHf8YW3baQf57KlIkA= +github.com/redis/go-redis/v9 v9.21.0 h1:FPBE4hhbAke+TLmcY3WkpbDffJEomdqPn3HYiqAtL9E= +github.com/redis/go-redis/v9 v9.21.0/go.mod h1:v/M13XI1PVCDcm01VtPFOADfZtHf8YW3baQf57KlIkA= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rrivera/identicon v0.0.0-20240116195454-d5ba35832c0d h1:l3+2LWCbVxn5itfvXAfH9n4YL9jh8l1g5zcncbIc1cs= @@ -138,8 +137,8 @@ github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0= github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M= -github.com/slack-go/slack v0.23.1 h1:ZS5B96wxxYQRwvJ3/vJFtqtUZi3tXhsZCyT44Nv7M80= -github.com/slack-go/slack v0.23.1/go.mod h1:H0yR/YBuRJ39RkE+JpV/d/oEsbanzTRowR82bCN0cEs= +github.com/slack-go/slack v0.27.0 h1:VWOpUzOK6UAPCCQlFxl79jhv8a/b+GOSJMnWziDJ8B8= +github.com/slack-go/slack v0.27.0/go.mod h1:UEe+jmo9WLlwHB04qsOrTDvqM7Aa4rQL3O5wF3n0hx4= github.com/smartystreets/assertions v1.1.0 h1:MkTeG1DMwsrdH7QtLXy5W+fUxWq+vmb6cLmyJ7aRtF0= github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= @@ -191,8 +190,8 @@ github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs= github.com/zeebo/xxh3 v1.1.0/go.mod h1:IisAie1LELR4xhVinxWS5+zf1lA4p0MW4T+w+W07F5s= -go.etcd.io/bbolt v1.4.3 h1:dEadXpI6G79deX5prL3QRNP6JB8UxVkqo4UPnHaNXJo= -go.etcd.io/bbolt v1.4.3/go.mod h1:tKQlpPaYCVFctUIgFKFnAlvbmB3tpy1vkTnDWohtc0E= +go.etcd.io/bbolt v1.5.0 h1:S7GAl7Fxv12yohbwFfIbQCGDWbQbtDGPET4P/bD4lxU= +go.etcd.io/bbolt v1.5.0/go.mod h1:mkltfYE5aUHQxUct9N9V+Kp7aSjFqjgrhcXIS70Lrdk= go.mongodb.org/mongo-driver v1.17.9 h1:IexDdCuuNJ3BHrELgBlyaH9p60JXAvdzWR128q+U5tU= go.mongodb.org/mongo-driver v1.17.9/go.mod h1:LlOhpH5NUEfhxcAwG0UEkMqwYcc4JU18gtCdGudk/tQ= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= @@ -201,81 +200,40 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= -golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI= -golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8= -golang.org/x/image v0.40.0 h1:Tw4GyDXMo+daZN1znreBRC3VayR1aLFUyUEOLUdW1a8= -golang.org/x/image v0.40.0/go.mod h1:uIc348UZMSvS5Z65CVZ7iDPaNobNFEPeJ4kbqTOszmA= +golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto= +golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio= +golang.org/x/image v0.43.0 h1:FLxcP4ec2350nTfOC8ysKtqYSIFbk/QGjw1ZHNP4tsY= +golang.org/x/image v0.43.0/go.mod h1:rrpelvGFt+kLPAjPM4HeWPgrl0FtafueU//e5N0qk/Q= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= -golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= +golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= +golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= +golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= -golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= +golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= +golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/text v0.38.0 h1:sXmwo9DwP3OK9EZ7PqAdaooSGozfl/3a6/xJcbzPRhE= +golang.org/x/text v0.38.0/go.mod h1:YXZt3QhHUKYT53r2lLKFIVi6Ao1jdzrTR/KQ09qyxF4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/.golangci.yml b/backend/vendor/github.com/alecthomas/chroma/v2/.golangci.yml index 91f313b1..a345ac65 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/.golangci.yml +++ b/backend/vendor/github.com/alecthomas/chroma/v2/.golangci.yml @@ -1,89 +1,122 @@ +version: "2" run: tests: true - output: - print-issued-lines: false - + show-stats: false + formats: + text: + print-issued-lines: false + colors: true linters: - enable-all: true + default: all disable: - - lll - - gocyclo - - dupl - - gochecknoglobals - - funlen - - godox - - wsl - - gocognit - - nolintlint - - testpackage - - godot - - nestif - - paralleltest - - nlreturn - - cyclop - - gci - - gofumpt - - errorlint - exhaustive - - wrapcheck - - stylecheck - - thelper - - nonamedreturns - - revive - - dupword - - exhaustruct - - varnamelen - - forcetypeassert - - ireturn - - maintidx - - govet - - testableexamples - - musttag + - prealloc + - dupl + - godoclint + - cyclop - depguard - - goconst - - perfsprint + - dupword + - err113 + - errname + - errorlint + - exhaustruct + - forbidigo + - forcetypeassert + - funlen + - gochecknoglobals + - gocognit + - gocritic + - gocyclo + - godot + - godox + - gomoddirectives + - ireturn + - lll + - maintidx - mnd + - nakedret + - nestif + - nilnil + - nlreturn + - nolintlint + - nonamedreturns + - paralleltest + - perfsprint - predeclared - recvcheck - - tenv - - err113 - -linters-settings: - gocyclo: - min-complexity: 10 - dupl: - threshold: 100 - goconst: - min-len: 8 - min-occurrences: 3 - forbidigo: - #forbid: - # - (Must)?NewLexer$ - exclude_godoc_examples: false - - + - revive + - testpackage + - varnamelen + - wastedassign + - whitespace + - wsl + - wsl_v5 + - funcorder + - noinlineerr + - tagalign + - goconst + - gochecknoinits + - durationcheck + - embeddedstructfieldcheck + - wrapcheck + - gomodguard + settings: + dupl: + threshold: 100 + exhaustive: + default-signifies-exhaustive: true + goconst: + min-len: 8 + min-occurrences: 3 + gocyclo: + min-complexity: 10 + wrapcheck: + report-internal-errors: false + ignore-package-globs: + - github.com/alecthomas/errors + exclusions: + generated: lax + rules: + - path: (.+)\.go$ + text: "^(G104|G204|G307|G304):" + - path: (.+)\.go$ + text: Error return value of .(.*\.Help|.*\.MarkFlagRequired|(os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked + - path: (.+)\.go$ + text: exported method `(.*\.MarshalJSON|.*\.UnmarshalJSON|.*\.EntityURN|.*\.GoString|.*\.Pos)` should have comment or be unexported + - path: (.+)\.go$ + text: uses unkeyed fields + - path: (.+)\.go$ + text: declaration of "err" shadows declaration + - path: (.+)\.go$ + text: bad syntax for struct tag key + - path: (.+)\.go$ + text: bad syntax for struct tag pair + - path: (.+)\.go$ + text: ^ST1012 + - path: (.+)\.go$ + text: log/slog.Logger.*must not be called + - path: (.+)_test\.go$ + text: error returned from external package is unwrapped + - linters: [staticcheck] + text: QF1008 + - text: "Error return value of `.*.Write` is not checked" + linters: [errcheck] + path: (.+)_test\.go$ + paths: + - third_party$ + - builtin$ + - examples$ issues: - exclude-dirs: - - _examples - max-per-linter: 0 - max-same: 0 - exclude-use-default: false - exclude: - # Captured by errcheck. - - '^(G104|G204):' - # Very commonly not checked. - - 'Error return value of .(.*\.Help|.*\.MarkFlagRequired|(os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked' - - 'exported method (.*\.MarshalJSON|.*\.UnmarshalJSON|.*\.EntityURN|.*\.GoString|.*\.Pos) should have comment or be unexported' - - 'composite literal uses unkeyed fields' - - 'declaration of "err" shadows declaration' - - 'should not use dot imports' - - 'Potential file inclusion via variable' - - 'should have comment or be unexported' - - 'comment on exported var .* should be of the form' - - 'at least one file in a package should have a package comment' - - 'string literal contains the Unicode' - - 'methods on the same type should have the same receiver name' - - '_TokenType_name should be _TokenTypeName' - - '`_TokenType_map` should be `_TokenTypeMap`' - - 'rewrite if-else to switch statement' + max-issues-per-linter: 0 + max-same-issues: 0 +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/AGENTS.md b/backend/vendor/github.com/alecthomas/chroma/v2/AGENTS.md index 0d3b6ee4..d15d770a 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/AGENTS.md +++ b/backend/vendor/github.com/alecthomas/chroma/v2/AGENTS.md @@ -1,6 +1,6 @@ Chroma is a syntax highlighting library, tool and web playground for Go. It is based on Pygments and includes importers for it, so most of the same concepts from Pygments apply to Chroma. -This project is written in Go, uses Hermit to manage tooling, and Just for helper commands. Helper scripts are in ./scripts. +This project is written in Go, uses Hermit to manage tooling, and Just for helper commands. Helper tooling is primarily in ./_tools. Language definitions are XML files defined in ./lexers/embedded/*.xml. diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/BUILD.bit b/backend/vendor/github.com/alecthomas/chroma/v2/BUILD.bit new file mode 100644 index 00000000..f8ee1aee --- /dev/null +++ b/backend/vendor/github.com/alecthomas/chroma/v2/BUILD.bit @@ -0,0 +1,93 @@ +let version = exec("git describe --tags --dirty --always") | trim +# TinyGo's installation root; used to source `wasm_exec.js`. +let tinygoroot = exec("tinygo env TINYGOROOT") | trim + + +# Generate tokentype_enumer.go from types.go via `//go:generate`. +tokentype = go.generate { + package = "." + inputs = ["types.go"] + outputs = ["tokentype_enumer.go"] +} + +# Regenerate the lexer table in README.md by invoking the host `chroma` binary. +# GOOS/GOARCH are cleared so cross-compile env vars don't break the local run. +protected readme = exec { + command = "./table.py" + inputs = ["table.py", "lexers/**/*.go", "lexers/**/*.xml"] + output = "README.md" +} + +# Format frontend JS sources in place. Runs as a sub-step of `index-min-js`, +# so bundling always sees formatted sources. +format-js = exec { + command = "biome format --write cmd/chromad/static/index.js cmd/chromad/static/chroma.js" + inputs = ["biome.js", "cmd/chromad/static/index.js", "cmd/chromad/static/chroma.js"] +} + +# Copy TinyGo's wasm_exec.js into the chromad static assets. +wasm-exec = exec { + command = "install -m644 '#{tinygoroot}/targets/wasm_exec.js' cmd/chromad/static/wasm_exec.js" + resolve = "sha256 '#{tinygoroot}/targets/wasm_exec.js'" + output = "cmd/chromad/static/wasm_exec.js" +} + +# Build the chroma WASM module via tinygo (installed via hermit) for the +# smaller output binary. +chroma-wasm = exec { + command = "tinygo build -no-debug -target wasm -o cmd/chromad/static/chroma.wasm cmd/libchromawasm/main.go" + inputs = ["cmd/libchromawasm/**/*.go", "*.go", "lexers/**/*.go", "lexers/**/*.xml", "formatters/**/*.go", "styles/**/*.go"] + output = "cmd/chromad/static/chroma.wasm" +} + +# Bundle and minify the frontend JS. Depends on `format-js` so the bundle +# always reflects formatted sources. +index-min-js = exec { + command = "esbuild --platform=browser --format=esm --bundle cmd/chromad/static/index.js --minify --external:./wasm_exec.js --outfile=cmd/chromad/static/index.min.js" + inputs = ["cmd/chromad/static/index.js", "cmd/chromad/static/chroma.js"] + output = "cmd/chromad/static/index.min.js" + depends_on = [format-js] +} + +# Bundle and minify the frontend CSS. +index-min-css = exec { + command = "esbuild --bundle cmd/chromad/static/index.css --minify --outfile=cmd/chromad/static/index.min.css" + inputs = ["cmd/chromad/static/index.css", "cmd/chromad/static/bulma.css"] + output = "cmd/chromad/static/index.min.css" +} + +# Build the chromad server binary. cmd/chromad is a separate Go module, so +# `dir` puts the build in there and `package = "."` resolves against that +# module. `output` stays project-root-relative; bit absolutises it before +# passing to `go build -o`. Defaults to linux/amd64 to match the deploy +# target; override with GOOS/GOARCH env vars for local builds. +chromad = go.exe { + dir = "cmd/chromad" + package = "." + output = "build/chromad" + flags = ["-ldflags", "-X 'main.version=#{version}'"] + goos = env("GOOS", "linux") + goarch = env("GOARCH", "amd64") + cgo = false + depends_on = [wasm-exec, chroma-wasm, index-min-js, index-min-css, test] +} + +pre format-go = go.fmt { + package = "./..." +} + +# Run Go tests. +test = go.test { + package = "./..." +} + +# Deploy chromad to swapoff.org. Must be explicitly selected. +explicit upload = exec { + command = <<-EOF + scp #{chromad.path} root@swapoff.org: + ssh root@swapoff.org 'install -m755 ./chromad /srv/http/swapoff.org/bin && service chromad restart' + EOF + depends_on = [chromad] +} + +target default = [test, chromad, readme, tokentype] diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/Bitfile b/backend/vendor/github.com/alecthomas/chroma/v2/Bitfile deleted file mode 100644 index bf158633..00000000 --- a/backend/vendor/github.com/alecthomas/chroma/v2/Bitfile +++ /dev/null @@ -1,24 +0,0 @@ -VERSION = %(git describe --tags --dirty --always)% -export CGOENABLED = 0 - -tokentype_enumer.go: types.go - build: go generate - -# Regenerate the list of lexers in the README -README.md: lexers/*.go lexers/*/*.xml table.py - build: ./table.py - -clean - -implicit %{1}%{2}.min.%{3}: **/*.{css,js} - build: esbuild --bundle %{IN} --minify --outfile=%{OUT} - -implicit build/%{1}: cmd/* - cd cmd/%{1} - inputs: cmd/%{1}/**/* **/*.go - build: go build -ldflags="-X 'main.version=%{VERSION}'" -o ../../build/%{1} . - -#upload: chromad -# build: -# scp chromad root@swapoff.org: -# ssh root@swapoff.org 'install -m755 ./chromad /srv/http/swapoff.org/bin && service chromad restart' -# touch upload diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/Dockerfile b/backend/vendor/github.com/alecthomas/chroma/v2/Dockerfile index 8a706766..dc10ec75 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/Dockerfile +++ b/backend/vendor/github.com/alecthomas/chroma/v2/Dockerfile @@ -28,7 +28,7 @@ ENV GOARCH=amd64 RUN just chromad # Runtime stage -FROM alpine:3.23 AS runtime +FROM alpine:3.24 AS runtime # Install ca-certificates for HTTPS requests RUN apk --no-cache add ca-certificates curl diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/Justfile b/backend/vendor/github.com/alecthomas/chroma/v2/Justfile index 24e3816f..4db3dc31 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/Justfile +++ b/backend/vendor/github.com/alecthomas/chroma/v2/Justfile @@ -1,4 +1,4 @@ -set positional-arguments := true +set positional-arguments set shell := ["bash", "-c"] version := `git describe --tags --dirty --always` @@ -21,6 +21,10 @@ tokentype-string: format-js: biome format --write cmd/chromad/static/index.js cmd/chromad/static/chroma.js +# Tidy Go modules +tidy: + find . -name 'go.mod' -execdir go mod tidy \; + # Build chromad binary chromad: wasm-exec chroma-wasm #!/usr/bin/env bash diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/README.md b/backend/vendor/github.com/alecthomas/chroma/v2/README.md index d6747695..df962da7 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/README.md +++ b/backend/vendor/github.com/alecthomas/chroma/v2/README.md @@ -36,25 +36,25 @@ translators for Pygments lexers and styles. | Prefix | Language | :----: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -| A | ABAP, ABNF, ActionScript, ActionScript 3, Ada, Agda, AL, Alloy, AMPL, Angular2, ANTLR, ApacheConf, APL, AppleScript, ArangoDB AQL, Arduino, ArmAsm, ATL, AutoHotkey, AutoIt, Awk +| A | ABAP, ABNF, ActionScript, ActionScript 3, Ada, Agda, AL, Alloy, AMPL, Angular2, ANTLR, ApacheConf, APL, AppleScript, ArangoDB AQL, Arduino, ArmAsm, Arturo, ATL, AutoHotkey, AutoIt, Awk | B | Ballerina, Bash, Bash Session, Batchfile, Beef, BibTeX, Bicep, BlitzBasic, BNF, BQN, Brainfuck | C | C, C#, C++, C3, Caddyfile, Caddyfile Directives, Cap'n Proto, Cassandra CQL, Ceylon, CFEngine3, cfstatement, ChaiScript, Chapel, Cheetah, Clojure, CMake, COBOL, CoffeeScript, Common Lisp, Coq, Core, Crystal, CSS, CSV, CUE, Cython -| D | D, Dart, Dax, Desktop file, Diff, Django/Jinja, dns, Docker, DTD, Dylan -| E | EBNF, Elixir, Elm, EmacsLisp, Erlang +| D | D, Dart, Dax, Desktop file, Devicetree, Diff, Django/Jinja, dns, Docker, DTD, Dylan +| E | EBNF, Elixir, Elm, EmacsLisp, ERB, Erlang | F | Factor, Fennel, Fish, Forth, Fortran, FortranFixed, FSharp | G | GAS, GDScript, GDScript3, Gemtext, Genshi, Genshi HTML, Genshi Text, Gettext, Gherkin, Gleam, GLSL, Gnuplot, Go, Go HTML Template, Go Template, Go Text Template, GraphQL, Groff, Groovy | H | Handlebars, Hare, Haskell, Haxe, HCL, Hexdump, HLB, HLSL, HolyC, HTML, HTTP, Hy | I | Idris, Igor, INI, Io, ISCdhcpd | J | J, Janet, Java, JavaScript, JSON, JSONata, Jsonnet, Julia, Jungle -| K | Kakoune, Kotlin -| L | Lean4, Lighttpd configuration file, LLVM, lox, Lua, Luau -| M | Makefile, Mako, markdown, Markless, Mason, Materialize SQL dialect, Mathematica, Matlab, MCFunction, Meson, Metal, MiniZinc, MLIR, Modelica, Modula-2, Mojo, MonkeyC, MoonScript, MorrowindScript, Myghty, MySQL +| K | Kakoune, KDL, Kotlin +| L | Lateralus, Lean4, Lighttpd configuration file, LilyPond, LLVM, lox, Lua, Luau +| M | Makefile, Mako, markdown, Markless, Mason, Materialize SQL dialect, Mathematica, Matlab, MCFunction, Meson, Metal, microcad, MiniZinc, MLIR, Modelica, Modula-2, Mojo, MonkeyC, MoonBit, MoonScript, MorrowindScript, Myghty, MySQL | N | NASM, Natural, NDISASM, Newspeak, Nginx configuration file, Nim, Nix, NSIS, Nu | O | Objective-C, ObjectPascal, OCaml, Octave, Odin, OnesEnterprise, OpenEdge ABL, OpenSCAD, Org Mode | P | PacmanConf, Perl, PHP, PHTML, Pig, PkgConfig, PL/pgSQL, plaintext, Plutus Core, Pony, PostgreSQL SQL dialect, PostScript, POVRay, PowerQuery, PowerShell, Prolog, Promela, PromQL, properties, Protocol Buffer, Protocol Buffer Text Format, PRQL, PSL, Puppet, Python, Python 2 | Q | QBasic, QML | R | R, Racket, Ragel, Raku, react, ReasonML, reg, Rego, reStructuredText, Rexx, RGBDS Assembly, Ring, RPGLE, RPMSpec, Ruby, Rust -| S | SAS, Sass, Scala, Scheme, Scilab, SCSS, Sed, Sieve, Smali, Smalltalk, Smarty, SNBT, Snobol, Solidity, SourcePawn, Spade, SPARQL, SQL, SquidConf, Standard ML, stas, Stylus, Svelte, Swift, SYSTEMD, systemverilog +| S | SAS, Sass, Scala, scdoc, Scheme, Scilab, SCSS, Sed, Sieve, Smali, Smalltalk, Smarty, SNBT, Snobol, Solidity, SourcePawn, Spade, SPARQL, SQL, SquidConf, Standard ML, stas, Stylus, Svelte, Swift, SYSTEMD, systemverilog | T | TableGen, Tal, TASM, Tcl, Tcsh, Termcap, Terminfo, Terraform, TeX, Thrift, TOML, TradingView, Transact-SQL, Turing, Turtle, Twig, TypeScript, TypoScript, TypoScriptCssData, TypoScriptHtmlData, Typst | U | ucode | V | V, V shell, Vala, VB.net, verilog, VHDL, VHS, VimL, vue @@ -276,6 +276,8 @@ for that setup the `chroma` executable can be just symlinked to `~/.lessfilter`. its input using Chroma * [Hugo](https://gohugo.io/) is a static site generator that [uses Chroma for syntax highlighting code examples](https://gohugo.io/content-management/syntax-highlighting/) +* [f4](https://github.com/unxed/f4) is asynchronious cross platform Far Manager clone in Go + that uses Chroma for syntax highlighting in built-in editor ## Testing lexers diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/colour.go b/backend/vendor/github.com/alecthomas/chroma/v2/colour.go index e33d0106..8add068d 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/colour.go +++ b/backend/vendor/github.com/alecthomas/chroma/v2/colour.go @@ -52,7 +52,7 @@ type Colour int32 // NewColour creates a Colour directly from RGB values. func NewColour(r, g, b uint8) Colour { - return ParseColour(fmt.Sprintf("%02x%02x%02x", r, g, b)) + return Colour(int32(r)<<16|int32(g)<<8|int32(b)) + 1 } // Distance between this colour and another. diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/formatters/html/html.go b/backend/vendor/github.com/alecthomas/chroma/v2/formatters/html/html.go index 1aaafd0f..e876aab7 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/formatters/html/html.go +++ b/backend/vendor/github.com/alecthomas/chroma/v2/formatters/html/html.go @@ -4,6 +4,7 @@ import ( "fmt" "html" "io" + "slices" "sort" "strconv" "strings" @@ -83,6 +84,11 @@ func WithPreWrapper(wrapper PreWrapper) Option { } } +// WithModeClasses adds the style's mode (eg. "light" or "dark") as a CSS +// class on wrapper elements and scopes WriteCSS rules by mode. This enables +// combining light and dark stylesheets and switching themes at runtime. +func WithModeClasses(b bool) Option { return func(f *Formatter) { f.modeClasses = b } } + // WrapLongLines wraps long lines. func WrapLongLines(b bool) Option { return func(f *Formatter) { @@ -206,6 +212,7 @@ type Formatter struct { inlineCode bool preventSurroundingPre bool tabWidth int + modeClasses bool wrapLongLines bool lineNumbers bool lineNumbersInTable bool @@ -241,7 +248,7 @@ func (f *Formatter) writeHTML(w io.Writer, style *chroma.Style, tokens []chroma. fmt.Fprintf(w, "body { %s; }\n", css[chroma.Background]) fmt.Fprint(w, "") } - fmt.Fprintf(w, "\n", f.styleAttr(css, chroma.Background)) + fmt.Fprintf(w, "\n", f.styleAttrWithMode(css, chroma.Background, style)) } wrapInTable := f.lineNumbers && f.lineNumbersInTable @@ -252,10 +259,10 @@ func (f *Formatter) writeHTML(w io.Writer, style *chroma.Style, tokens []chroma. if wrapInTable { // List line numbers in its own - fmt.Fprintf(w, "\n", f.styleAttr(css, chroma.PreWrapper)) + fmt.Fprintf(w, "\n", f.styleAttrWithMode(css, chroma.PreWrapper, style)) fmt.Fprintf(w, "", f.styleAttr(css, chroma.LineTable)) fmt.Fprintf(w, "\n", f.styleAttr(css, chroma.LineTableTD)) - fmt.Fprintf(w, "%s", f.preWrapper.Start(false, f.styleAttr(css, chroma.PreWrapper))) + fmt.Fprintf(w, "%s", f.preWrapper.Start(false, f.styleAttrWithMode(css, chroma.PreWrapper, style))) for index := range lines { line := f.baseLineNumber + index highlight, next := f.shouldHighlight(highlightIndex, line) @@ -277,7 +284,7 @@ func (f *Formatter) writeHTML(w io.Writer, style *chroma.Style, tokens []chroma. fmt.Fprintf(w, "\n", f.styleAttr(css, chroma.LineTableTD, "width:100%")) } - fmt.Fprintf(w, "%s", f.preWrapper.Start(true, f.styleAttr(css, chroma.PreWrapper))) + fmt.Fprintf(w, "%s", f.preWrapper.Start(true, f.styleAttrWithMode(css, chroma.PreWrapper, style))) highlightIndex = 0 for index, tokens := range lines { @@ -288,7 +295,7 @@ func (f *Formatter) writeHTML(w io.Writer, style *chroma.Style, tokens []chroma. highlightIndex++ } - if !(f.preventSurroundingPre || f.inlineCode) { + if !f.preventSurroundingPre && !f.inlineCode { // Start of Line fmt.Fprint(w, ``) // End of CodeLine fmt.Fprint(w, ``) // End of Line @@ -414,6 +421,26 @@ func (f *Formatter) styleAttr(styles map[chroma.TokenType]string, tt chroma.Toke return fmt.Sprintf(` style="%s"`, strings.Join(css, ";")) } +// modeClass returns the CSS class corresponding to the style's mode (eg. +// "light" or "dark"), with the formatter's class prefix applied. +func (f *Formatter) modeClass(style *chroma.Style) string { + return f.prefix + style.Mode().String() +} + +// styleAttrWithMode is like styleAttr but, in classes mode, appends the +// style's mode class alongside the existing class. Used for the outer +// wrapper and standalone so external CSS can target the mode. +func (f *Formatter) styleAttrWithMode(styles map[chroma.TokenType]string, tt chroma.TokenType, style *chroma.Style) string { + if !f.Classes || !f.modeClasses { + return f.styleAttr(styles, tt) + } + cls := f.class(tt) + if cls == "" { + return "" + } + return fmt.Sprintf(` class="%s %s"`, cls, f.modeClass(style)) +} + func (f *Formatter) tabWidthStyle() string { if f.tabWidth != 0 && f.tabWidth != 8 { return fmt.Sprintf("-moz-tab-size: %[1]d; -o-tab-size: %[1]d; tab-size: %[1]d;", f.tabWidth) @@ -437,20 +464,38 @@ func (f *Formatter) writeCSSRule(w io.Writer, comment string, selector string, s } // WriteCSS writes CSS style definitions (without any surrounding HTML). +// +// Rules are scoped by the style's mode (eg. ".chroma.dark") so that CSS +// generated from a light and dark style can be combined without conflict. +// To support dynamic theme switching, call WriteCSS with both styles, +// concatenate the output, and toggle the wrapper's mode class (added +// automatically by Format) at runtime. Tokens that one theme leaves +// unstyled fall back to that theme's ".chroma." text/background +// via the CSS cascade; pass WithAllClasses(true) if you need every +// token's rule materialised explicitly for both themes. func (f *Formatter) WriteCSS(w io.Writer, style *chroma.Style) error { css := f.styleCache.get(style, false) + var chromaSel, bgSel string + if f.modeClasses { + modeCls := f.modeClass(style) + chromaSel = fmt.Sprintf(".%schroma.%s", f.prefix, modeCls) + bgSel = fmt.Sprintf(".%sbg.%s", f.prefix, modeCls) + } else { + chromaSel = fmt.Sprintf(".%schroma", f.prefix) + bgSel = fmt.Sprintf(".%sbg", f.prefix) + } // Special-case background as it is mapped to the outer ".chroma" class. - if err := f.writeCSSRule(w, chroma.Background.String(), fmt.Sprintf(".%sbg", f.prefix), css[chroma.Background]); err != nil { + if err := f.writeCSSRule(w, chroma.Background.String(), bgSel, css[chroma.Background]); err != nil { return err } // Special-case PreWrapper as it is the ".chroma" class. - if err := f.writeCSSRule(w, chroma.PreWrapper.String(), fmt.Sprintf(".%schroma", f.prefix), css[chroma.PreWrapper]); err != nil { + if err := f.writeCSSRule(w, chroma.PreWrapper.String(), chromaSel, css[chroma.PreWrapper]); err != nil { return err } // Special-case code column of table to expand width. if f.lineNumbers && f.lineNumbersInTable { - selector := fmt.Sprintf(".%schroma .%s:last-child", f.prefix, f.class(chroma.LineTableTD)) + selector := fmt.Sprintf("%s .%s:last-child", chromaSel, f.class(chroma.LineTableTD)) if err := f.writeCSSRule(w, chroma.LineTableTD.String(), selector, "width: 100%;"); err != nil { return err } @@ -460,7 +505,7 @@ func (f *Formatter) WriteCSS(w io.Writer, style *chroma.Style) error { targetedLineCSS := StyleEntryToCSS(style.Get(chroma.LineHighlight)) for _, tt := range []chroma.TokenType{chroma.LineNumbers, chroma.LineNumbersTable} { comment := fmt.Sprintf("%s targeted by URL anchor", tt) - selector := fmt.Sprintf(".%schroma .%s:target", f.prefix, f.class(tt)) + selector := fmt.Sprintf("%s .%s:target", chromaSel, f.class(tt)) if err := f.writeCSSRule(w, comment, selector, targetedLineCSS); err != nil { return err } @@ -481,7 +526,7 @@ func (f *Formatter) WriteCSS(w io.Writer, style *chroma.Style) error { if class == "" { continue } - if err := f.writeCSSRule(w, tt.String(), fmt.Sprintf(".%schroma .%s", f.prefix, class), css[tt]); err != nil { + if err := f.writeCSSRule(w, tt.String(), fmt.Sprintf("%s .%s", chromaSel, class), css[tt]); err != nil { return err } } @@ -613,8 +658,7 @@ func (l *styleCache) get(style *chroma.Style, compress bool) map[chroma.TokenTyp defer l.mu.Unlock() // Look for an existing entry. - for i := len(l.cache) - 1; i >= 0; i-- { - entry := l.cache[i] + for i, entry := range slices.Backward(l.cache) { if entry.style == style && entry.compressed == compress { // Top of the cache, no need to adjust the order. if i == len(l.cache)-1 { diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/arturo.xml b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/arturo.xml new file mode 100644 index 00000000..541dc46e --- /dev/null +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/arturo.xml @@ -0,0 +1,119 @@ + + + + Arturo + arturo + art + *.art + + + + + + + + + + + + + + + + + + + + + + + + + 3 + 5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/dart.xml b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/dart.xml index f1b454fa..4044f491 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/dart.xml +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/dart.xml @@ -81,7 +81,7 @@ - + diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/gemfile_lock.xml b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/gemfile_lock.xml new file mode 100644 index 00000000..83fc47b7 --- /dev/null +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/gemfile_lock.xml @@ -0,0 +1,81 @@ + + + Gemfile.lock + gemfile-lock + gemfilelock + Gemfile.lock + *.gemfile.lock + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/java.xml b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/java.xml index 3ce33ff6..4ef5fd26 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/java.xml +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/java.xml @@ -32,7 +32,7 @@ pattern="(assert|break|case|catch|continue|default|do|else|finally|for|if|goto|instanceof|new|return|switch|this|throw|try|while)\b"> - + @@ -44,7 +44,7 @@ + pattern="(abstract|const|enum|exports|extends|final|implements|native|non-sealed|open|opens|permits|private|protected|provides|public|requires|sealed|static|strictfp|super|synchronized|throws|to|transient|transitive|uses|volatile|with|yield)\b"> @@ -64,6 +64,10 @@ + + + + @@ -71,7 +75,7 @@ - + @@ -147,6 +151,15 @@ + + + + + + + + + diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/json.xml b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/json.xml index 0057aa1b..f65d7103 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/json.xml +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/json.xml @@ -2,12 +2,15 @@ JSON json + jsonl *.json + *.jsonl *.jsonc *.json5 *.avsc .luaurc application/json + application/jsonl true true diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/lilypond.xml b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/lilypond.xml new file mode 100644 index 00000000..fe4ac8ed --- /dev/null +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/lilypond.xml @@ -0,0 +1,133 @@ + + + + LilyPond + lilypond + *.ly + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/nu.xml b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/nu.xml index 32655808..82d4b375 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/nu.xml +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/nu.xml @@ -3,7 +3,12 @@ Nu nu *.nu + application/x-shellscript text/plain + text/x-shellscript + + + @@ -118,4 +123,4 @@ - + \ No newline at end of file diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/postscript.xml b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/postscript.xml index 15a3422d..32d1bb08 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/postscript.xml +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/postscript.xml @@ -5,6 +5,10 @@ postscr *.ps *.eps + *.epsf + *.epsi + *.pfa + *.t42 application/postscript @@ -86,4 +90,4 @@ - \ No newline at end of file + diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/protocol_buffer.xml b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/protocol_buffer.xml index 157d321f..f8f0c8d7 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/protocol_buffer.xml +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/protocol_buffer.xml @@ -7,7 +7,7 @@ - + @@ -16,7 +16,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -46,9 +46,12 @@ - + + + + @@ -62,6 +65,9 @@ + + + @@ -69,7 +75,7 @@ - + @@ -115,4 +121,4 @@ - \ No newline at end of file + diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ruby.xml b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ruby.xml index baa7e435..15e96ba8 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ruby.xml +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/ruby.xml @@ -12,7 +12,11 @@ *.rbx *.duby Gemfile + *.gemfile Vagrantfile + Appraisals + .pryrc + *.json.jbuilder text/x-ruby application/x-ruby true diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/templ.xml b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/templ.xml new file mode 100644 index 00000000..14c26d6b --- /dev/null +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/templ.xml @@ -0,0 +1,315 @@ + + + Templ + templ + *.templ + text/x-templ + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/yaml.xml b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/yaml.xml index 07075541..ede15d33 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/yaml.xml +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/yaml.xml @@ -23,6 +23,9 @@ + + + @@ -78,15 +81,22 @@ + + + + + + + - + - + @@ -95,14 +105,14 @@ - + - + diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/go.go b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/go.go index c6123b90..e6e04cca 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/go.go +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/go.go @@ -30,8 +30,8 @@ func goRules() Rules { "root": { {`\n`, TextWhitespace, nil}, {`\s+`, TextWhitespace, nil}, - {`//[^\s][^\n\r]*`, CommentPreproc, nil}, - {`//\s+[^\n\r]*`, CommentSingle, nil}, + {`//[^\s\n\r][^\n\r]*`, CommentPreproc, nil}, + {`//[^\n\r]*`, CommentSingle, nil}, {`/(\\\n)?[*](.|\n)*?[*](\\\n)?/`, CommentMultiline, nil}, {`(import|package)\b`, KeywordNamespace, nil}, {`(var|func|struct|map|chan|type|interface|const)\b`, KeywordDeclaration, nil}, diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/http.go b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/http.go index b57cb1b8..fee74d3b 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/http.go +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/http.go @@ -122,7 +122,7 @@ func (d *httpBodyContentTyper) Tokenise(options *TokeniseOptions, text string) ( if err != nil { panic(err) } - return EOF + return subIterator() } } } diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/markdown.go b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/markdown.go index bcd5b178..eed2cb7e 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/markdown.go +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/markdown.go @@ -1,11 +1,13 @@ package lexers import ( + "strings" + . "github.com/alecthomas/chroma/v2" // nolint ) -// Markdown lexer. -var Markdown = Register(MustNewLexer( +// Markdown lexer with YAML frontmatter and HTML comment support. +var Markdown = Register(&markdownLexer{Lexer: MustNewLexer( &Config{ Name: "markdown", Aliases: []string{"md", "mkd"}, @@ -13,11 +15,69 @@ var Markdown = Register(MustNewLexer( MimeTypes: []string{"text/x-markdown"}, }, markdownRules, -)) +)}) + +// markdownLexer wraps the base Markdown lexer to highlight top-of-file YAML frontmatter. +type markdownLexer struct { + Lexer +} + +// Lexes Markdown, highlighting a leading YAML frontmatter block before delegating to Markdown rules. +func (m *markdownLexer) Tokenise(options *TokeniseOptions, text string) (Iterator, error) { + frontmatter, rest, ok := splitFrontmatter(text) + if !ok { + return m.Lexer.Tokenise(options, text) + } + + yamlLexer := Get("YAML") + if yamlLexer == nil { + return m.Lexer.Tokenise(options, text) + } + + yamlTokens, err := yamlLexer.Tokenise(options, frontmatter) + if err != nil { + return nil, err + } + markdownTokens, err := m.Lexer.Tokenise(options, rest) + if err != nil { + return nil, err + } + return Concaterator(yamlTokens, markdownTokens), nil +} + +// Extracts a leading YAML frontmatter block if the document starts with one. +func splitFrontmatter(text string) (frontmatter string, rest string, ok bool) { + if !strings.HasPrefix(text, "---\n") && !strings.HasPrefix(text, "---\r\n") { + return "", text, false + } + + lineEnd := strings.IndexByte(text, '\n') + if lineEnd < 0 { + return "", text, false + } + if strings.TrimSuffix(text[:lineEnd], "\r") != "---" { + return "", text, false + } + + for pos := lineEnd + 1; pos < len(text); { + next := strings.IndexByte(text[pos:], '\n') + if next < 0 { + break + } + lineEnd = pos + next + line := strings.TrimSuffix(text[pos:lineEnd], "\r") + if line == "---" { + return text[:lineEnd+1], text[lineEnd+1:], true + } + pos = lineEnd + 1 + } + return "", text, false +} func markdownRules() Rules { return Rules{ "root": { + {``, CommentMultiline, nil}, {`^(#[^#].+\n)`, ByGroups(GenericHeading), nil}, {`^(#{2,6}.+\n)`, ByGroups(GenericSubheading), nil}, {`^(\s*)([*-] )(\[[ xX]\])( .+\n)`, ByGroups(Text, Keyword, Keyword, UsingSelf("inline")), nil}, @@ -33,6 +93,7 @@ func markdownRules() Rules { Include("inline"), }, "inline": { + {``, CommentMultiline, nil}, {`\\.`, Text, nil}, {`(\s)(\*|_)((?:(?!\2).)*)(\2)((?=\W|\n))`, ByGroups(Text, GenericEmph, GenericEmph, GenericEmph, Text), nil}, {`(\s)((\*\*|__).*?)\3((?=\W|\n))`, ByGroups(Text, GenericStrong, GenericStrong, Text), nil}, diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/markless.go b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/markless.go index 508513d7..437590e9 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/markless.go +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/markless.go @@ -70,14 +70,14 @@ func marklessRules() Rules { {`(! )([^ ]+)(.+?)$`, ByGroups(Keyword, NameFunction, NameVariable), nil}, }, "embed": { - {`(\[ )([^ ]+)( )([^,]+)`, ByGroups(Keyword, NameFunction, TextWhitespace, String), Push("embed-options")}, + {`(\[ )([^ ]+)( )([^,\]\n]+)`, ByGroups(Keyword, NameFunction, TextWhitespace, String), Push("embed-options")}, }, "embed-options": { {`\\.`, Text, nil}, {`,`, Punctuation, nil}, {`\]?$`, Keyword, Pop(1)}, // Generic key or key/value pair - {`( *)([^, \]]+)([^,\]]+)?`, ByGroups(TextWhitespace, NameFunction, String), nil}, + {`( *)([^, \]\n]+)([^,\]\n]+)?`, ByGroups(TextWhitespace, NameFunction, String), nil}, {`.`, Text, nil}, }, "footnote": { diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/raku.go b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/raku.go index da354dce..38d8fe8a 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/raku.go +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/raku.go @@ -6,7 +6,7 @@ import ( "strings" "unicode/utf8" - "github.com/dlclark/regexp2" + "github.com/dlclark/regexp2/v2" . "github.com/alecthomas/chroma/v2" // nolint ) @@ -458,8 +458,7 @@ func rakuRules() Rules { var podRegex *regexp2.Regexp if tokenClass == rakuPod { podRegex = regexp2.MustCompile( - state.NamedGroups[`ws`]+`=end`+`\s+`+regexp2.Escape(state.NamedGroups[`name`]), - 0, + state.NamedGroups[`ws`] + `=end` + `\s+` + regexp2.Escape(state.NamedGroups[`name`]), ) } else { closingChars = []rune(strings.Repeat(string(closingChar), nChars)) @@ -478,7 +477,7 @@ func rakuRules() Rules { match, err := podRegex.FindRunesMatchStartingAt(text, searchPos+nChars) if err == nil { closingChars = match.Runes() - nextClosePos = match.Index + nextClosePos = match.RuneIndex } else { nextClosePos = -1 } @@ -1599,8 +1598,7 @@ func quote(groups []string, state *LexerState) Iterator { var tokenStates []string // Set tokenStates based on adverbs - adverbs := strings.Split(adverbsStr, ":") - for _, adverb := range adverbs { + for adverb := range strings.SplitSeq(adverbsStr, ":") { switch adverb { case "c", "closure": tokenStates = append(tokenStates, "Q-closure") diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/lexers/yaml_jinja.go b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/yaml_jinja.go new file mode 100644 index 00000000..6df1911e --- /dev/null +++ b/backend/vendor/github.com/alecthomas/chroma/v2/lexers/yaml_jinja.go @@ -0,0 +1,20 @@ +package lexers + +import ( + . "github.com/alecthomas/chroma/v2" // nolint +) + +// YAML+Jinja is YAML with Jinja templating embedded. Used by Ansible playbooks +// and Salt SLS files. +var YAMLJinja = Register(DelegatingLexer( + MustNewXMLLexer(embedded, "embedded/yaml.xml"), + MustNewXMLLexer(embedded, "embedded/django_jinja.xml").SetConfig( + &Config{ + Name: "YAML+Jinja", + Aliases: []string{"yaml+jinja", "salt", "sls", "ansible"}, + Filenames: []string{"*.sls"}, + MimeTypes: []string{"text/x-yaml+jinja", "text/x-sls"}, + DotAll: true, + }, + ), +)) diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/regexp.go b/backend/vendor/github.com/alecthomas/chroma/v2/regexp.go index d183fa5d..2c494061 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/regexp.go +++ b/backend/vendor/github.com/alecthomas/chroma/v2/regexp.go @@ -3,6 +3,7 @@ package chroma import ( "encoding/json" "fmt" + "maps" "os" "path/filepath" "regexp" @@ -12,7 +13,7 @@ import ( "time" "unicode/utf8" - "github.com/dlclark/regexp2" + "github.com/dlclark/regexp2/v2" ) // A Rule is the fundamental matching unit of the Regex lexer state machine. @@ -70,9 +71,7 @@ func (r Rules) Clone() Rules { // Merge creates a clone of "r" then merges "rules" into the clone. func (r Rules) Merge(rules Rules) Rules { out := r.Clone() - for k, v := range rules.Clone() { - out[k] = v - } + maps.Copy(out, rules.Clone()) return out } @@ -177,19 +176,19 @@ type LexerState struct { // Named Group matches. NamedGroups map[string]string // Custum context for mutators. - MutatorContext map[interface{}]interface{} + MutatorContext map[any]any iteratorStack []Iterator options *TokeniseOptions newlineAdded bool } // Set mutator context. -func (l *LexerState) Set(key interface{}, value interface{}) { +func (l *LexerState) Set(key any, value any) { l.MutatorContext[key] = value } // Get mutator context. -func (l *LexerState) Get(key interface{}) interface{} { +func (l *LexerState) Get(key any) any { return l.MutatorContext[key] } @@ -369,7 +368,7 @@ func (r *RegexLexer) maybeCompile() (err error) { pattern = "(?" + rule.flags + ")" + pattern } pattern = `\G` + pattern - rule.Regexp, err = regexp2.Compile(pattern, 0) + rule.Regexp, err = regexp2.Compile(pattern) if err != nil { return fmt.Errorf("failed to compile rule %s.%d: %s", state, i, err) } @@ -484,7 +483,7 @@ func (r *RegexLexer) Tokenise(options *TokeniseOptions, text string) (Iterator, Text: []rune(text), Stack: []string{options.State}, Rules: r.rules, - MutatorContext: map[interface{}]interface{}{}, + MutatorContext: map[any]any{}, } return state.Iterator, nil } @@ -501,7 +500,7 @@ func (r *RegexLexer) MustRules() Rules { func matchRules(text []rune, pos int, rules []*CompiledRule) (int, *CompiledRule, []string, map[string]string) { for i, rule := range rules { match, err := rule.Regexp.FindRunesMatchStartingAt(text, pos) - if match != nil && err == nil && match.Index == pos { + if match != nil && err == nil && match.RuneIndex == pos { groups := []string{} namedGroups := make(map[string]string) for _, g := range match.Groups() { diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/renovate.json5 b/backend/vendor/github.com/alecthomas/chroma/v2/renovate.json5 index 9ade4812..050483e8 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/renovate.json5 +++ b/backend/vendor/github.com/alecthomas/chroma/v2/renovate.json5 @@ -9,6 +9,7 @@ "schedule:earlyMondays", // Run once a week. 'helpers:pinGitHubActionDigests', ], + "postUpdateOptions": ["gomodTidy"], "packageRules": [ { "matchPackageNames": ["golangci-lint"], diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/serialise.go b/backend/vendor/github.com/alecthomas/chroma/v2/serialise.go index 3d7f6c5d..dacf69c5 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/serialise.go +++ b/backend/vendor/github.com/alecthomas/chroma/v2/serialise.go @@ -13,7 +13,7 @@ import ( "regexp" "strings" - "github.com/dlclark/regexp2" + "github.com/dlclark/regexp2/v2" ) // Serialisation of Chroma rules to XML. The format is: @@ -440,14 +440,14 @@ func (t TokenType) MarshalXML(e *xml.Encoder, start xml.StartElement) error { } // This hijinks is a bit unfortunate but without it we can't deserialise into TokenType. -func newFromTemplate(template interface{}) (value func() interface{}, target interface{}) { +func newFromTemplate(template any) (value func() any, target any) { t := reflect.TypeOf(template) - if t.Kind() == reflect.Ptr { + if t.Kind() == reflect.Pointer { v := reflect.New(t.Elem()) return v.Interface, v.Interface() } v := reflect.New(t) - return func() interface{} { return v.Elem().Interface() }, v.Interface() + return func() any { return v.Elem().Interface() }, v.Interface() } func (b *Emitters) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/style.go b/backend/vendor/github.com/alecthomas/chroma/v2/style.go index cc8d9a60..36989ad3 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/style.go +++ b/backend/vendor/github.com/alecthomas/chroma/v2/style.go @@ -4,7 +4,8 @@ import ( "encoding/xml" "fmt" "io" - "sort" + "maps" + "slices" "strings" ) @@ -18,6 +19,24 @@ const ( No ) +// Mode indicates whether a style is intended for a light or dark background. +type Mode uint8 + +// Mode values. +const ( + Light Mode = iota + Dark +) + +func (m Mode) String() string { + switch m { + case Dark: + return "dark" + default: + return "light" + } +} + func (t Trilean) String() string { switch t { case Yes: @@ -31,12 +50,14 @@ func (t Trilean) String() string { // Prefix returns s with "no" as a prefix if Trilean is no. func (t Trilean) Prefix(s string) string { - if t == Yes { + switch t { + case Yes: return s - } else if t == No { + case No: return "no" + s + default: + return "" } - return "" } // A StyleEntry in the Style map. @@ -111,11 +132,10 @@ func (s StyleEntry) Sub(e StyleEntry) StyleEntry { // Ancestors should be provided from oldest to newest. func (s StyleEntry) Inherit(ancestors ...StyleEntry) StyleEntry { out := s - for i := len(ancestors) - 1; i >= 0; i-- { + for _, ancestor := range slices.Backward(ancestors) { if out.NoInherit { return out } - ancestor := ancestors[i] if !out.Colour.IsSet() { out.Colour = ancestor.Colour } @@ -147,19 +167,24 @@ func (s StyleEntry) IsZero() bool { // // Once built, a Style is immutable. type StyleBuilder struct { - entries map[TokenType]string - name string - parent *Style + entries map[TokenType]string + name string + counterpart string + parent *Style } func NewStyleBuilder(name string) *StyleBuilder { return &StyleBuilder{name: name, entries: map[TokenType]string{}} } +// Counterpart sets the lowercase name of the opposite-mode style. +func (s *StyleBuilder) Counterpart(name string) *StyleBuilder { + s.counterpart = strings.ToLower(name) + return s +} + func (s *StyleBuilder) AddAll(entries StyleEntries) *StyleBuilder { - for ttype, entry := range entries { - s.entries[ttype] = entry - } + maps.Copy(s.entries, entries) return s } @@ -205,10 +230,15 @@ func (s *StyleBuilder) Transform(transform func(StyleEntry) StyleEntry) *StyleBu } func (s *StyleBuilder) Build() (*Style, error) { + counterpart := s.counterpart + if counterpart == "" && s.parent != nil { + counterpart = s.parent.Counterpart + } style := &Style{ - Name: s.name, - entries: map[TokenType]StyleEntry{}, - parent: s.parent, + Name: s.name, + Counterpart: counterpart, + entries: map[TokenType]StyleEntry{}, + parent: s.parent, } for ttype, descriptor := range s.entries { entry, err := ParseStyleEntry(descriptor) @@ -257,9 +287,23 @@ func MustNewStyle(name string, entries StyleEntries) *Style { // // See http://pygments.org/docs/styles/ for details. Semantics are intended to be identical. type Style struct { - Name string - entries map[TokenType]StyleEntry - parent *Style + Name string + // Counterpart is the lowercase name of the style intended as this style's + // opposite-mode pair (eg. "github-dark" for "github"). Resolved via + // styles.GetForMode. May be empty. + Counterpart string + entries map[TokenType]StyleEntry + parent *Style +} + +// Mode returns Light or Dark based on the brightness of the Background entry's +// background colour. Styles with an unset Background default to Light. +func (s *Style) Mode() Mode { + bg := s.get(Background).Background + if bg.IsSet() && bg.Brightness() < 0.5 { + return Dark + } + return Light } func (s *Style) MarshalXML(e *xml.Encoder, start xml.StartElement) error { @@ -268,6 +312,9 @@ func (s *Style) MarshalXML(e *xml.Encoder, start xml.StartElement) error { } start.Name = xml.Name{Local: "style"} start.Attr = []xml.Attr{{Name: xml.Name{Local: "name"}, Value: s.Name}} + if s.Counterpart != "" { + start.Attr = append(start.Attr, xml.Attr{Name: xml.Name{Local: "counterpart"}, Value: s.Counterpart}) + } if err := e.EncodeToken(start); err != nil { return err } @@ -275,7 +322,7 @@ func (s *Style) MarshalXML(e *xml.Encoder, start xml.StartElement) error { for ttype := range s.entries { sorted = append(sorted, ttype) } - sort.Slice(sorted, func(i, j int) bool { return sorted[i] < sorted[j] }) + slices.Sort(sorted) for _, ttype := range sorted { entry := s.entries[ttype] el := xml.StartElement{Name: xml.Name{Local: "entry"}} @@ -295,9 +342,12 @@ func (s *Style) MarshalXML(e *xml.Encoder, start xml.StartElement) error { func (s *Style) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { for _, attr := range start.Attr { - if attr.Name.Local == "name" { + switch attr.Name.Local { + case "name": s.Name = attr.Value - } else { + case "counterpart": + s.Counterpart = strings.ToLower(attr.Value) + default: return fmt.Errorf("unexpected attribute %s", attr.Name.Local) } } @@ -437,8 +487,7 @@ func MustParseStyleEntry(entry string) StyleEntry { // ParseStyleEntry parses a Pygments style entry. func ParseStyleEntry(entry string) (StyleEntry, error) { // nolint: gocyclo out := StyleEntry{} - parts := strings.Fields(entry) - for _, part := range parts { + for part := range strings.FieldsSeq(entry) { switch { case part == "italic": out.Italic = Yes diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/styles/api.go b/backend/vendor/github.com/alecthomas/chroma/v2/styles/api.go index 9e21c884..43fa26dd 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/styles/api.go +++ b/backend/vendor/github.com/alecthomas/chroma/v2/styles/api.go @@ -64,3 +64,32 @@ func Get(name string) *chroma.Style { } return Fallback } + +// GetForMode returns the named style if it already matches mode, otherwise its +// registered counterpart if one exists and matches mode. If neither matches, +// the originally-requested style is returned (or Fallback if the name is +// unknown), so callers always get something usable. +func GetForMode(name string, mode chroma.Mode) *chroma.Style { + style := Get(name) + if style.Mode() == mode { + return style + } + if style.Counterpart == "" { + return style + } + counterpart, ok := Registry[style.Counterpart] + if !ok || counterpart.Mode() != mode { + return style + } + return counterpart +} + +// RegisterPair links two styles as light/dark counterparts of each other. +// +// Both styles are also registered if they are not already present. +func RegisterPair(a, b *chroma.Style) { + Register(a) + Register(b) + a.Counterpart = strings.ToLower(b.Name) + b.Counterpart = strings.ToLower(a.Name) +} diff --git a/backend/vendor/github.com/alecthomas/chroma/v2/styles/catppuccin-latte.xml b/backend/vendor/github.com/alecthomas/chroma/v2/styles/catppuccin-latte.xml index c87c8765..a6e41ab8 100644 --- a/backend/vendor/github.com/alecthomas/chroma/v2/styles/catppuccin-latte.xml +++ b/backend/vendor/github.com/alecthomas/chroma/v2/styles/catppuccin-latte.xml @@ -1,4 +1,4 @@ -