Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(better-moodle): complete rewrite with advanced tools #214

Draft
wants to merge 491 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
491 commits
Select commit Hold shift + click to select a range
09423ad
chore(deps): update dependency darkreader to v4.9.96 (#455)
renovate[bot] Nov 6, 2024
e4e173e
chore(deps): update dependency vite to v5.4.10 (#457)
renovate[bot] Nov 6, 2024
a23fe17
chore(deps): update sass to v1.80.6 (#459)
renovate[bot] Nov 8, 2024
5053dfb
chore: add basic dashboard featureGroup
jxn-30 Nov 12, 2024
cbcdb7d
chore(config): allow specifying a github branch
jxn-30 Nov 13, 2024
5fc09a3
chore(support): move FAQ and support information to an extra file
jxn-30 Nov 13, 2024
a0bff32
feat(settings): add support modal and current version
jxn-30 Nov 13, 2024
1976547
chore(deps): lock file maintenance (#461)
renovate[bot] Nov 13, 2024
b36078e
chore(deps): update dependency @types/node to v22.9.0 (#462)
renovate[bot] Nov 13, 2024
7556e5a
chore(deps): update dependency globals to v15.12.0 (#463)
renovate[bot] Nov 13, 2024
7cae0ce
feat(lib): add reference link support to `mdToHtml`
jxn-30 Nov 13, 2024
65cccbb
ci: move CI setup into extra file and workflow to become reusable
jxn-30 Nov 13, 2024
776c376
ci: fix build running before setup has finished
jxn-30 Nov 13, 2024
6c0db75
ci: fix CI setup
jxn-30 Nov 13, 2024
f6bec8e
ci: fix invalid job dependencies
jxn-30 Nov 13, 2024
923df14
ci: fix setup action not being found
jxn-30 Nov 13, 2024
e71f9d4
ci: fix setup action?
jxn-30 Nov 13, 2024
7b763ae
ci: fix setup runs
jxn-30 Nov 13, 2024
c72eefb
ci: fix wrong indentation of setup action
jxn-30 Nov 13, 2024
3996654
feat(ci): add a workflow to check for changes by prettier
jxn-30 Nov 14, 2024
2fad8be
ci: improve SHA-Output of prettier check
jxn-30 Nov 14, 2024
dca7bbb
Merge branch 'main' into v2
jxn-30 Nov 14, 2024
4549d91
style(ci): run prettier on check.yml
jxn-30 Nov 14, 2024
44809bf
chore(deps): update all dependencies and lockfile maintenance
jxn-30 Nov 14, 2024
88056ea
chore(deps): lock file maintenance (#466)
renovate[bot] Nov 16, 2024
2ea343d
feat(settings): implement update notification, update note & update m…
jxn-30 Nov 17, 2024
edda7a5
feat(general): live-respect changes to updateNotification setting
jxn-30 Nov 18, 2024
1fcfaf6
chore(lib): add an extra file for semver comparisons
jxn-30 Nov 19, 2024
6b31a94
feat(linkIcons): new featureGroup
jxn-30 Nov 19, 2024
07550b3
chore(deps): update eslint to v9.15.0 (#468)
renovate[bot] Nov 20, 2024
2c2ce2f
chore(deps): update dependency @types/node to v22.9.1 (#469)
renovate[bot] Nov 20, 2024
982748f
chore(deps): update dependency typescript-eslint to v8.15.0 (#470)
renovate[bot] Nov 20, 2024
14789b6
refactor(linkIcons): do not import style dynamically
jxn-30 Nov 20, 2024
457651d
chore: fix eslint issues
jxn-30 Nov 20, 2024
19acef2
feat(drawer): allow setting a drawer heading
jxn-30 Nov 20, 2024
20bf737
chore(deps): update yarn to v4.5.2 (#472)
renovate[bot] Nov 24, 2024
1e2d83d
feat(dashboard): add first version of course sidebar
jxn-30 Nov 24, 2024
d815568
chore(deps): update dependency typescript to v5.7.2 (#476)
renovate[bot] Nov 25, 2024
22aa18d
chore(deps): update dependency @types/node to v22.9.3 (#475)
renovate[bot] Nov 25, 2024
b50cfe3
chore(deps): lock file maintenance (#474)
renovate[bot] Nov 25, 2024
410ae32
feat(dashboard): keep course filter in sync
jxn-30 Nov 25, 2024
149c79c
refactor(config): generate JSON schema from typescript types
jxn-30 Nov 26, 2024
441d5ad
feat(dashboard): fully implement course filters
jxn-30 Nov 26, 2024
7ebe1b3
chore(deps): update dependency prettier to v3.4.1
jxn-30 Nov 26, 2024
468e2b4
feat(dashboard): add right sidebar to layout
jxn-30 Nov 26, 2024
1f58fef
chore(darkmode): remove unused translation
jxn-30 Nov 27, 2024
bcd0cd9
feat(i18n): show setting name in requireReload toast
jxn-30 Nov 27, 2024
e0f134c
chore(vite): expose global constants to sass and TS
jxn-30 Nov 27, 2024
6a9f79d
fix(dashboard): do not always reload courses on aborting settings
jxn-30 Nov 27, 2024
27887d1
chore(setting): add JSDoc to title getter
jxn-30 Nov 27, 2024
58e2d57
chore(deps): update yarn to v4.5.3 (#483)
renovate[bot] Nov 29, 2024
bdd615d
chore(settings): add missing aliases
jxn-30 Nov 29, 2024
1335741
feat(settings): implement badges for new settings (settings not marke…
jxn-30 Nov 30, 2024
287eb9a
chore(eslint): fix eslint warnings
jxn-30 Nov 30, 2024
ffba2ea
chore(build): add browserslist config and use it as build target
jxn-30 Nov 30, 2024
3fce30b
chore(deps): add esbuild as explicit dev dependency
jxn-30 Nov 30, 2024
804cb5e
fix(settings): fix groups being marked as new wrongly
jxn-30 Nov 30, 2024
fabf5cc
feat(settings): mark seen settings as seen
jxn-30 Nov 30, 2024
506c31d
chore(deps): remove accidental dependencies `add` and `@types/add`
jxn-30 Nov 30, 2024
8c506e4
chore(deps): update dependency @types/node to v22.10.1 (#484)
renovate[bot] Nov 30, 2024
2bd1a1f
chore(deps): lock file maintenance (#485)
renovate[bot] Nov 30, 2024
a4603f6
feat(settings): migrate and cleanup storage of seen settings
jxn-30 Dec 1, 2024
1977a51
perf(settings): load settings more asynchronly
jxn-30 Dec 2, 2024
ce6501f
chore(deps): upgrade `typescript-eslint` to 8.17.0
jxn-30 Dec 3, 2024
9e1dc50
chore(deps): upgrade all non-major dependencies
jxn-30 Dec 3, 2024
630cfb7
feat(settings): add a "New!"-tooltip to the settings button
jxn-30 Dec 3, 2024
7f99719
feat(settings): allow toggling of "New!"-Badges
jxn-30 Dec 4, 2024
110a8be
feat(myCourses): add first basic implementation of navbarDropdown
jxn-30 Dec 4, 2024
1479fc3
chore(deps): update dependency @types/tampermonkey to v5.0.4 (#490)
renovate[bot] Dec 4, 2024
0696332
refactor(features): remove unnecessary init method
jxn-30 Dec 5, 2024
e68e091
fix(settings): fix value of SelectSetting being wrong while loading o…
jxn-30 Dec 5, 2024
620e938
chore(deps): update dependency prettier to v3.4.2 (#493)
renovate[bot] Dec 6, 2024
1c1d60e
feat(myCourses): fully implement desktop navbarDropdown
jxn-30 Dec 6, 2024
c52b60a
feat(myCourses): implement mobile navbarDropdown
jxn-30 Dec 6, 2024
3cb223c
chore(deps): lock file maintenance (#495)
renovate[bot] Dec 7, 2024
ff93604
fix(css): fix generating invalid css identifiers in deeper nested files
jxn-30 Dec 7, 2024
d47e093
docs: update contribution guide to respect v2 changes
jxn-30 Dec 7, 2024
3ca3975
chore(deps): update sass to v1.82.0 (#496)
renovate[bot] Dec 8, 2024
2f2ecf7
feat(settings): add a settings search
jxn-30 Dec 8, 2024
17505d3
feat(setting): focus settings search with ctrl+k
jxn-30 Dec 9, 2024
1fbe2ec
chore(i18n): add missing translations to myCourses
jxn-30 Dec 9, 2024
4789f20
refactor(style): split up global style in multiple files
jxn-30 Dec 9, 2024
6bd5cbf
chore(deps): update dependency @types/node to v22.10.2 (#497)
renovate[bot] Dec 13, 2024
5e7160e
chore(deps): update dependency eslint-plugin-jsdoc to v50.6.1 (#498)
renovate[bot] Dec 13, 2024
03254f9
chore(deps): lock file maintenance (#499)
renovate[bot] Dec 14, 2024
f876e05
ci: upload built userscript as an artifact
jxn-30 Dec 15, 2024
fb1dfce
ci: use a matrix for running multiple builds
jxn-30 Dec 15, 2024
b7cd0eb
ci: add basic build stats on built file
jxn-30 Dec 15, 2024
af7803f
ci: add more build stats
jxn-30 Dec 15, 2024
6759d81
ci: fix minimum node version not being specified
jxn-30 Dec 15, 2024
c1b56eb
ci: fix invalid path for perf stats files
jxn-30 Dec 15, 2024
30301ae
style: run prettier on `.yarnrc.yml`
jxn-30 Dec 15, 2024
a22e56e
chore(deps): update dependency browserslist to v4.24.3 (#503)
renovate[bot] Dec 19, 2024
745a8b8
chore(deps): update dependency typescript-eslint to v8.18.1 (#504)
renovate[bot] Dec 19, 2024
181ea58
chore(deps): update eslint to v9.17.0 (#505)
renovate[bot] Dec 19, 2024
331771d
chore(deps): update sass to v1.83.0 (#506)
renovate[bot] Dec 19, 2024
ec39d4d
chore(deps): pin node.js to 22.12.0 (#501)
renovate[bot] Dec 19, 2024
8653636
chore(deps): lock file maintenance (#507)
renovate[bot] Dec 21, 2024
f98d08a
perf: improve loading speed of featureGroups
jxn-30 Dec 21, 2024
29393d1
fix(settings): disabled style was not applied to select settings
jxn-30 Dec 21, 2024
c3b260c
fix(settings): fix checking disabled state of settings
jxn-30 Dec 21, 2024
9640512
refactor: fix typescript-eslint error on importing files
jxn-30 Dec 22, 2024
d6addd8
ci: add eslint job to check workflow
jxn-30 Dec 22, 2024
57480ee
ci(build): attest build provenance
jxn-30 Dec 22, 2024
2d96797
feat(settings): show newSettingsBadge in navbar on new installation
jxn-30 Dec 22, 2024
c4024f7
fix(dashboard): fix migrating course filter
jxn-30 Dec 22, 2024
ff8026c
fix(dashboard): fix marking active filter on load
jxn-30 Dec 22, 2024
05dbdcb
chore(deps): update all non-major dependencies (v2) (#511)
renovate[bot] Dec 23, 2024
1db8674
refactor: fix ESLint warnings
jxn-30 Dec 23, 2024
88afb86
refactor(Drawer): use getHtml DOM function
jxn-30 Dec 23, 2024
abbe711
ci: build during release
jxn-30 Dec 23, 2024
f1fcfff
ci: fix local action not being found
jxn-30 Dec 23, 2024
24a5177
ci: fix invalid action syntax
jxn-30 Dec 23, 2024
339a2e3
ci: fix invalid action syntax
jxn-30 Dec 23, 2024
8f6a352
ci: fix invalid action syntax
jxn-30 Dec 23, 2024
2fc8498
ci: fix invalid action syntax
jxn-30 Dec 23, 2024
16a0ecc
ci: fix file name and dir being wrongly used
jxn-30 Dec 23, 2024
9eab83a
ci: fix outputs of build action
jxn-30 Dec 23, 2024
fbb81cf
ci: fix typo
jxn-30 Dec 23, 2024
e409c2b
ci: build all available config files
jxn-30 Dec 23, 2024
ef7b733
ci: fix finding configs
jxn-30 Dec 23, 2024
908ce63
ci: fix build not needing finding configs
jxn-30 Dec 23, 2024
5c62417
ci: fix finding configs
jxn-30 Dec 23, 2024
b970663
ci: fix finding configs
jxn-30 Dec 23, 2024
1761252
ci(release): build and add all configs
jxn-30 Dec 23, 2024
600f5cd
feat(fullWidth): reset default max width on CAU
jxn-30 Dec 23, 2024
78d0aff
chore(deps): update dependency typescript-eslint to v8.18.2 (#513)
renovate[bot] Dec 25, 2024
ed08bf7
refactor(style): allow inline svg files for background images
jxn-30 Dec 25, 2024
0048987
refactor(style): make sparkles their own svg file
jxn-30 Dec 25, 2024
3ef602b
fix(settings): search icon only showing up in firefox 135
jxn-30 Dec 25, 2024
1bd666a
chore(css): auto-add css polyfills if needed for browserslist env
jxn-30 Dec 25, 2024
fd7096b
chore(deps): update dependency vite-plugin-monkey to v5 (#515)
renovate[bot] Dec 27, 2024
b9285fa
chore(browserslist): exclude chrome 109
jxn-30 Dec 26, 2024
406d2ab
feat: check useragent against supported browser versions in console
jxn-30 Dec 27, 2024
d1d1abc
chore: fix lockfile being changed
jxn-30 Dec 27, 2024
06ae50b
Merge branch 'main' into v2
jxn-30 Dec 27, 2024
789a6c6
chore: fix invalid empty line in yarn.lock
jxn-30 Dec 27, 2024
81d7d9d
chore(deps): lock file maintenance (#516)
renovate[bot] Dec 28, 2024
68a0abd
chore: expose minimum supported browser versions to userscript
jxn-30 Dec 28, 2024
130d1b7
ci: only checkout configs dir for finding configs
jxn-30 Dec 28, 2024
18f6a9e
ci: create Better-Moodle icons by CI
jxn-30 Dec 28, 2024
2c5c5d8
ci: improve generated icons
jxn-30 Dec 28, 2024
3557779
chore(deps): update all non-major dependencies (#518)
renovate[bot] Dec 30, 2024
d53afa5
chore(icons): do not generate icons in vite step
jxn-30 Dec 30, 2024
d31ec8a
ci(release): no need to manually create meta file
jxn-30 Dec 30, 2024
fac8092
chore: add polyfills based on browserslist config
jxn-30 Dec 30, 2024
1eecbb3
ci(icons): upload icons to cloudflare pages
jxn-30 Dec 30, 2024
47b8d5e
ci(icons): fix wrangler not being installable
jxn-30 Dec 30, 2024
a581017
ci(icons): fix wrangler not being installable
jxn-30 Dec 30, 2024
678c0ca
ci(icons): fix wrangler not being installable
jxn-30 Dec 30, 2024
057ad45
ci(icons): make a production deploy
jxn-30 Dec 30, 2024
b958621
feat: get userscript icon from icons.better-moodle.dev
jxn-30 Dec 30, 2024
52e8e71
chore(deps): update yarn to v4.6.0 (#520)
renovate[bot] Jan 1, 2025
d2c1136
feat: add popup if browser version is unsupported
jxn-30 Jan 2, 2025
a1a8528
docs: Add note about chromium based browsers to README
jxn-30 Jan 2, 2025
915d986
chore: add a config for 405 sandbox
jxn-30 Jan 2, 2025
88380f5
chore(deps): update all non-major dependencies (#521)
renovate[bot] Jan 3, 2025
05678e3
chore(deps): lock file maintenance (#522)
renovate[bot] Jan 4, 2025
024299f
fix(drawer): fix 405 compatibility issues
jxn-30 Jan 4, 2025
4d8d227
fix(dashboard): trigger recalculation of recently accessed courses on…
jxn-30 Jan 5, 2025
bcbad44
fix(linkIcons): fix incompatibility with Moodle >= 402
jxn-30 Jan 5, 2025
000940b
feat(browserCheck): add buttons to hide unsupportedBrowser-warning fo…
jxn-30 Jan 5, 2025
0fae6f0
chore: we recommend firefox in unsupportedBrowser window
jxn-30 Jan 5, 2025
566847d
chore(deps): update all non-major dependencies (#523)
renovate[bot] Jan 6, 2025
5e11d6d
chore(build): remove comments from output
jxn-30 Jan 6, 2025
d4356f4
chore(build): add license comment to build
jxn-30 Jan 6, 2025
4c85d2d
refactor(scss): all comments should be silent
jxn-30 Jan 6, 2025
283d109
chore(build): output copyright banner only once in bundle
jxn-30 Jan 6, 2025
af275a7
fix(drawers): drawers should not dispatch a window resize event on to…
jxn-30 Jan 6, 2025
e6c36fd
docs: add How-To section and How-To add a new FeatureGroup
jxn-30 Jan 6, 2025
1c584e2
refactor(bookmarks): make bookmarks their own FeatureGroup for more o…
jxn-30 Jan 6, 2025
e66106a
fix(myCourses): fix navbardropdown not waiting for document to be ready
jxn-30 Jan 7, 2025
c1277cf
feat(speiseplan): add settings and modal without parsing
jxn-30 Jan 7, 2025
72fc51b
chore(deps): update dependency typescript-eslint to v8.19.1 (#525)
renovate[bot] Jan 8, 2025
283dab8
chore(settings): remove debugging console.log
jxn-30 Jan 8, 2025
f11e87d
feat(speiseplan): SH: parse dish names
jxn-30 Jan 8, 2025
c118fa8
refactor: simplify i18n imports
jxn-30 Jan 8, 2025
3a0aebf
feat(speiseplan): fully parse SH Speiseplan
jxn-30 Jan 8, 2025
0ec12e2
feat(speiseplan): add info buttons to prices and co2-score
jxn-30 Jan 8, 2025
bc1da45
chore(eslint): remove eslint warnings
jxn-30 Jan 8, 2025
2c48123
feat(speiseplan): add link to source menu to footer
jxn-30 Jan 9, 2025
1716d16
fix(speiseplan): SH: Fix streetfood icon glowing weirdly
jxn-30 Jan 9, 2025
27b5e88
feat(speiseplan): add canteen and language selection to modal
jxn-30 Jan 9, 2025
7ff8e78
feat(courses): implement courses and courses new tab
jxn-30 Jan 9, 2025
7f3199d
chore(deps): update all non-major dependencies (#526)
renovate[bot] Jan 10, 2025
7d11f04
chore(deps): update node.js to v22.13.0 (#527)
renovate[bot] Jan 10, 2025
1f7bc97
chore(deps): lock file maintenance (#529)
renovate[bot] Jan 11, 2025
71bc3b6
feat(courses): implement collapseAll
jxn-30 Jan 11, 2025
139f15f
refactor: rename myCourses feat to courses
jxn-30 Jan 11, 2025
ea19919
feat(courses): implement imageMaxWidth and imageZoom
jxn-30 Jan 11, 2025
42a15ad
chore(deps): remove unnecessary typed-scss-modules
jxn-30 Jan 12, 2025
30c7549
chore(deps): update all non-major dependencies (#531)
renovate[bot] Jan 13, 2025
45355b3
fix(courses): fix imageZoom resize listener throwing errors
jxn-30 Jan 12, 2025
bed1fe3
feat(general): implement prideLogo
jxn-30 Jan 13, 2025
2340f5c
fix(fullWidth): fix not waiting for document to be ready
jxn-30 Jan 13, 2025
4253b81
fix(speiseplan): fix header inputs not mobile friendly
jxn-30 Jan 13, 2025
8275e25
chore(deps): update dependency eslint-config-prettier to v10 (#532)
renovate[bot] Jan 14, 2025
fb4ebe5
fix(courses): add missing images translations
jxn-30 Jan 15, 2025
40192ce
chore(deps): update all non-major dependencies (#534)
renovate[bot] Jan 16, 2025
5c68f52
chore(build): decrease tabWidth and increase printWidth in dist prettier
jxn-30 Jan 17, 2025
fe69a9b
chore(deps): lock file maintenance (#535)
renovate[bot] Jan 18, 2025
621471c
feat(clock): implement clock without fuzzyClock
jxn-30 Jan 18, 2025
41df61d
chore(deps): lock file maintenance (#536)
renovate[bot] Jan 18, 2025
9653a88
chore(deps): update all non-major dependencies (#537)
renovate[bot] Jan 20, 2025
af48ac5
refactor(style): use non-preserved sass comments of slider style
jxn-30 Jan 19, 2025
8784883
refactor(i18n): provide a utility for BETTER_MOODLE_LANG-independent …
jxn-30 Jan 20, 2025
9a5d6f8
feat(clock): implement fuzzyClock
jxn-30 Jan 20, 2025
5c6df48
chore(clock): change initial text of fuzzy span
jxn-30 Jan 21, 2025
cd19115
fix(settings): fix saving would reset setting
jxn-30 Jan 21, 2025
c87d691
fix(clock): fix 12 and 1 pm not working properly
jxn-30 Jan 22, 2025
edf1d83
feat(navbarMarquee): implement christmasCountdown
jxn-30 Jan 22, 2025
e4ac201
fix(christmasCountdown): fix marquee not being recalculated on update
jxn-30 Jan 22, 2025
7e277fb
chore(deps): update all non-major dependencies (#538)
renovate[bot] Jan 22, 2025
9b7343c
chore(deps): update dependency @types/node to v22.10.10 (#539)
renovate[bot] Jan 23, 2025
e7653a5
chore(deps): lock file maintenance (#540)
renovate[bot] Jan 24, 2025
2495c3e
chore(deps): lock file maintenance (#541)
renovate[bot] Jan 25, 2025
220f658
docs(readme): add note on supported browsers
jxn-30 Jan 24, 2025
001f965
fix(clock): fix infinite recursion on 10 past string
jxn-30 Jan 25, 2025
5cc192d
feat(courses): implement quickRoleChange
jxn-30 Jan 25, 2025
db0e164
chore(refactor): add a import shortcut for src/style
jxn-30 Jan 25, 2025
ccad0bd
chore(deps): update all non-major dependencies (#543)
renovate[bot] Jan 27, 2025
4cd3540
chore(deps): update all non-major dependencies (#544)
renovate[bot] Jan 29, 2025
79ab364
fix: fix a batch of typescript errors
jxn-30 Jan 28, 2025
7050caf
fix(types): fix formatter types
jxn-30 Jan 29, 2025
fb27121
fix(marquee): do not crash the whole system when no parent found
jxn-30 Jan 29, 2025
0a42b9e
fix(types): fix wild i18n ts errors
jxn-30 Jan 29, 2025
e2a5e12
fix(ci): reenable typescript checks as prebuild step
jxn-30 Jan 29, 2025
48e4781
fix(templates): fix custom templates sometimes not working
jxn-30 Jan 30, 2025
3014993
fix(christmasCountdown): fix english version being rendered as empty …
jxn-30 Jan 30, 2025
a7cf4b7
chore(deps): update node.js to v22.13.1 (#545)
renovate[bot] Jan 31, 2025
b7526d6
refactor(eslint): fix eslint warning
jxn-30 Jan 31, 2025
1d24560
chore(settings): add alliases for darkmode, general and navbarMarquee
jxn-30 Jan 31, 2025
f9fdc90
chore(deps): lock file maintenance (#547)
renovate[bot] Jan 31, 2025
128a79a
chore(settings): add remaining missing aliases
jxn-30 Feb 1, 2025
63698f7
fix(prideLogo): first design should be default one
jxn-30 Feb 1, 2025
8da7c97
chore(marquee): update cau separator logo URL
jxn-30 Feb 1, 2025
28bc70c
fix(prideLogo): use a different mask for cau
jxn-30 Feb 1, 2025
63d12dc
fix(prideLogo): fix typo in english rotation translation
jxn-30 Feb 1, 2025
201f5f3
fix(speiseplan): add darkmode filter for kuechen-klassiker
jxn-30 Feb 1, 2025
d09516d
chore(speispelan): make header selects look a little more pleasant
jxn-30 Feb 1, 2025
90a2aaa
refactor(style): add media mixins for bootstrap breakpoints
jxn-30 Feb 1, 2025
8014a6b
fix(prideLogo): fix selection for off
jxn-30 Feb 1, 2025
62ba0f3
feat(navbarMarquee): show below navbar on < md screens
jxn-30 Feb 2, 2025
0fc862d
chore(deps): update all non-major dependencies (#551)
renovate[bot] Feb 3, 2025
5a4efd6
refactor(style): improve darkmode mixin
jxn-30 Feb 3, 2025
2b1b3dd
chore: mention contributors in copyright
jxn-30 Feb 4, 2025
db4ad81
chore(deps): update all non-major dependencies (#552)
renovate[bot] Feb 7, 2025
fbb8e07
chore(deps): lock file maintenance (#554)
renovate[bot] Feb 7, 2025
4e2e2c9
chore(deps): update all non-major dependencies (#557)
renovate[bot] Feb 10, 2025
00eb6bf
chore(deps): update all non-major dependencies (#558)
renovate[bot] Feb 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 🏗 Build

inputs:
config:
description: The config to build with
required: true

runs:
using: composite
steps:
- name: 🎛️ setup
uses: ./.github/actions/setup

- name: 🏗️ build Better-Moodle for ${{ inputs.config }}
run: yarn build ${{ inputs.config }}
shell: bash

- name: 📤️ upload build
id: upload
uses: actions/upload-artifact@v4
with:
# hardcoded since closed envs are not allowed in composite actions
name: better-moodle-${{ inputs.config }}.user.js
path: dist/better-moodle-${{ inputs.config }}.user.js

outputs:
digest:
description: The digest of the uploaded artifact
value: ${{ steps.upload.outputs.artifact-digest }}
file:
description: The filename of the built userscript
# using an env is not allowed => hardcoded
value: better-moodle-${{ inputs.config }}.user.js
dir:
description: The directory, output files live in
# using an env is not allowed => hardcoded
value: dist
38 changes: 38 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 🎛️ Setup CI
runs:
using: composite
steps:
- name: 🔎 get Node and yarn versions
run: |
echo "NODE_VERSION=$(grep '"node":' ./package.json | awk -F: '{ print $2 }' | sed 's/[",]//g' | sed 's/\^v//g' | tr -d '[:space:]')" >> $GITHUB_ENV
echo "YARN_VERSION=$(grep '"packageManager":' ./package.json | awk -F: '{ print $2 }' | sed 's/[",]//g' | sed 's/yarn@//g' | tr -d '[:space:]')" >> $GITHUB_ENV
shell: bash

- name: 🛠️ setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: 🛠️ setup yarn
run: |
corepack enable
yarn set version "${{ env.YARN_VERSION }}"
shell: bash

- name: 🔎 get yarn cache directory
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
shell: bash

- name: 💿️ restore cache
uses: actions/cache@v4
with:
path: |
${{ steps.yarn_cache_dir.outputs.dir }}
**/node_modules
**/.eslintcache
key: ${{ runner.os }}-cache-${{ hashFiles('**/yarn.lock', '.yarnrc.yml', '.eslintcache') }}
restore-keys: ${{ runner.os }}-cache-

- name: 🍱 install dependencies
run: yarn install --immutable
shell: bash
67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: build.yml
on:
push:
branches:
- v2
pull_request:
branches:
- v2

jobs:
find-configs:
name: 📇 Find configs
uses: ./.github/workflows/find-configs.yml

build:
runs-on: ubuntu-latest
name: 🏗️ Build
needs:
- find-configs
strategy:
matrix:
config: ${{ fromJson(needs.find-configs.outputs.configs) }}
permissions:
id-token: write
attestations: write
steps:
- name: 📥️ checkout
uses: actions/checkout@v4

- name: 🏗 build Better-Moodle for ${{ matrix.config }}
id: build
uses: ./.github/actions/build
with:
config: ${{ matrix.config }}

- name: 🦭 attest build provenance
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ steps.build.outputs.file }}
subject-digest: sha256:${{ steps.build.outputs.digest }}
show-summary: true

- name: 📊 aggregate build statistics
run: |
echo "STATS_SIZE=$(ls -sh --si '${{ steps.build.outputs.dir }}/${{ steps.build.outputs.file }}' | awk '{print $1}')B" >> $GITHUB_ENV
echo "STATS_LINES=$(wc -l '${{ steps.build.outputs.dir }}/${{ steps.build.outputs.file }}' | awk '{print $1}')" >> $GITHUB_ENV

# TODO: Output build stats
- name: ✍️ print build stats in summary
run: |
echo "# 🏗️ ${{ matrix.config }}" >> $GITHUB_STEP_SUMMARY
echo "## Built file: \`${{ steps.build.outputs.file }}\`" >> $GITHUB_STEP_SUMMARY
echo "| Metric | Value |" >> $GITHUB_STEP_SUMMARY
echo "|-------:|:------|" >> $GITHUB_STEP_SUMMARY
echo "| **File size** | ${{ env.STATS_SIZE }} |" >> $GITHUB_STEP_SUMMARY
echo "| **Line count** | ${{ env.STATS_LINES }} |" >> $GITHUB_STEP_SUMMARY

echo "## Build stats" >> $GITHUB_STEP_SUMMARY
echo "| Metric | Value |" >> $GITHUB_STEP_SUMMARY
echo "|-------:|:------|" >> $GITHUB_STEP_SUMMARY
echo "| **Creating config duration** | $(cat ${{ steps.build.outputs.dir }}/.stats_perf_conf) |" >> $GITHUB_STEP_SUMMARY
echo "| **Building duration** | $(cat ${{ steps.build.outputs.dir }}/.stats_perf_build) |" >> $GITHUB_STEP_SUMMARY
echo "| **Total duration** | $(cat ${{ steps.build.outputs.dir }}/.stats_perf_total) |" >> $GITHUB_STEP_SUMMARY
echo "*Durations are mm:ss,s*"

echo "## Included features" >> $GITHUB_STEP_SUMMARY
cat ${{ steps.build.outputs.dir }}/.stats_features.md >> $GITHUB_STEP_SUMMARY
70 changes: 70 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: check.yml
on:
push:
branches:
- v2
pull_request:
branches:
- v2

jobs:
prettier:
runs-on: ubuntu-latest
name: 🍱 Prettier
steps:
- name: 📥️ checkout
uses: actions/checkout@v4

- name: 🎛️ setup
uses: ./.github/actions/setup

- name: 🍱 run prettier
run: yarn prettier:write

- name: 🔢 count changes
run: echo "CHANGES_COUNT=$(git status -s | wc -l)" >> $GITHUB_ENV

- name: ✅ approve prettier result
if: ${{ env.CHANGES_COUNT == 0 }}
run: |
echo "# ✅ Prettier approves code" >> $GITHUB_STEP_SUMMARY
echo "Running prettier on $(echo ${{ github.sha }} | head -c 7) did not result in any changes. 🎉" >> $GITHUB_STEP_SUMMARY

- name: 🖨️ print diff introduced by prettier
if: ${{ env.CHANGES_COUNT > 0 }}
run: git diff

- name: ⚠️ warn over prettier result
if: ${{ env.CHANGES_COUNT > 0 }}
run: |
echo "# ⚠️ Prettier changed some code" >> $GITHUB_STEP_SUMMARY
echo "There were a total of **${{ env.CHANGES_COUNT }}** files affected by running prettier on $(echo ${{ github.sha }} | head -c 7):" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
git diff --compact-summary >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "For a complete diff introduced by prettier, please see the workflow logs." >> $GITHUB_STEP_SUMMARY

eslint:
runs-on: ubuntu-latest
name: 🚨 ESLint
steps:
- name: 📥️ checkout
uses: actions/checkout@v4

- name: 🎛️ setup
uses: ./.github/actions/setup

- name: 🚨 run eslint
run: yarn lint:fix -o .eslint-report.json --format json
continue-on-error: true

- name: 🖨 create annotations
uses: ataylorme/eslint-annotate-action@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
report-json: .eslint-report.json
only-pr-files: true
fail-on-warning: false
fail-on-error: true
check-name: ESLint Report Analysis
markdown-report-on-step-summary: true
23 changes: 23 additions & 0 deletions .github/workflows/find-configs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 📇 Find configs

on:
workflow_call:
outputs:
configs:
description: A JSON string of all available configs
value: ${{ jobs.find-configs.outputs.configs }}

jobs:
find-configs:
name: 📇 Find configs
runs-on: ubuntu-latest
outputs:
configs: ${{ steps.configs.outputs.configs }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
configs

- id: configs
run: echo "configs=$(basename -s .json -a ./configs/*.json | jq -R | jq -s | jq -c '. - ["_schema"]')" >> $GITHUB_OUTPUT
78 changes: 78 additions & 0 deletions .github/workflows/icons.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: icons.yml
on:
workflow_dispatch:
push:
branches:
- v2
paths:
- configs/*.json
- .github/workflows/icons.yml

jobs:
icons:
runs-on: ubuntu-latest
name: 🖼️ Create icons
steps:
- name: 📥️ checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
configs
.yarn
package.json

- name: 🔎 get Node and version
run: |
echo "NODE_VERSION=$(grep '"node":' ./package.json | awk -F: '{ print $2 }' | sed 's/[",]//g' | sed 's/\^v//g' | tr -d '[:space:]')" >> $GITHUB_ENV

- name: 🛠 setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: 🍱 install converter
run: npm install -gy svgexport

- name: 🖼️ create icons
run: |
# create output directories
mkdir svg
mkdir png

# set sizes
size=1000

# find configs and print them in a line each
jq -nMr '[inputs | select(.icon) | [(input_filename | gsub("^configs/|.json$"; "")), .icon, .github.user, .github.repo, (.github.branch | if . == "" then "main" else . end)] | join("\n")] | join("\n")' configs/*.json | \
# for each config
while read -r config; read -r icon; read -r user; read -r repo; read -r branch; do
svgname="svg/$config.svg"
pngname="png/$config.png"
branch=${branch:="main"}
moothel="https://raw.githubusercontent.com/$user/$repo/$branch/img/moothel.png"

# write svg to a file
echo "$config"
echo "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 $size $size'>" > "$svgname"
echo " <image x='0' y='0' width='100%' height='100%' preserveAspectRatio='meet' href='$moothel'/>" >> "$svgname"
echo " <rect x='66%' y='66%' width='33%' height='33%' fill='white' opacity='0.5'/>" >> "$svgname"
echo " <image x='66%' y='66%' width='33%' preserveAspectRatio='xMidYMid meet' href='$icon'/>" >> "$svgname"
echo "</svg>" >> "$svgname"

# convert to png
svgexport "$svgname" "$pngname"
done

- name: 📤 upload icons
uses: actions/upload-artifact@v4
with:
name: icons
path: png/

- name: 🚀 deploy icons
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.ICONS_UPLOAD_CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.ICONS_UPLOAD_CLOUDFLARE_ACCOUNT_ID }}
command: |
pages deploy png --project-name=better-moodle-icons --commit-dirty=true --branch=main
43 changes: 32 additions & 11 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,50 @@ name: release-please

jobs:
release:
name: 🚀 release-please
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: .release-please-config.json
manifest-file: .release-please-manifest.json
outputs:
released: ${{ steps.release.outputs.release_created }}
tag: ${{ steps.release.outputs.tag_name }}

- name: Checkout
if: ${{ steps.release.outputs.release_created }}
find-configs:
name: 📇 find configs
uses: ./.github/workflows/find-configs.yml
if: ${{ needs.release.outputs.released }}

assets:
name: 📤️ build and upload release assets
runs-on: ubuntu-latest
needs:
- find-configs
strategy:
matrix:
config: ${{ fromJson(needs.find-configs.outputs.configs) }}
steps:
- name: 📥️ checkout
uses: actions/checkout@v4

- name: Upload release artifacts
if: ${{ steps.release.outputs.release_created }}
- name: 🏗 build
id: build
uses: ./.github/actions/build
with:
config: ${{ matrix.config }}

- name: 📤 upload release artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# make Better-Moodle available via a nicer link than redesign.user.js
cp redesign.user.js better-moodle.user.js
# extract metadata/userscript-header from the user script
awk '/\/\/ ==UserScript==/,/\/\/ ==\/UserScript==/' better-moodle.user.js > better-moodle.meta.js
# get meta filename
file="${{ steps.build.output.file }}"
meta=$(sed 's/\.user\.js/\.meta\.user\.js/' <<< "$file")

# upload the release artifacts with special nice names
gh release upload ${{ steps.release.outputs.tag_name }} \
"better-moodle.user.js#Better-Moodle userscript version ${{ steps.release.outputs.tag_name }} (better-moodle.user.js)" \
"better-moodle.meta.js#Better-Moodle meta file for userscript managers (better-moodle.meta.js)"
gh release upload ${{ needs.release.outputs.tag }} \
"${{ steps.build.output.dir }}/$file#[${{ matrix.config }}] Better-Moodle userscript version ${{ steps.release.outputs.tag_name }} ($file)" \
"${{ steps.build.output.dir }}/$meta#[${{ matrix.config }}] Better-Moodle meta file for userscript managers ($meta)"
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
node_modules
dist

src/style/**/*.d.ts
src/features/**/*.scss.d.ts

# Editor directories and files
.idea
Expand All @@ -20,4 +24,6 @@ node_modules
!.yarn/versions

# temp files
.eslintcache
.eslintcache
svg
png
Loading