2884 Commits

Author SHA1 Message Date
Prospector
2c850a612d
Version bump 2023-10-14 14:45:12 -07:00
Prospector
e555c4d083
Joined buttons 2023-10-14 14:44:27 -07:00
Sasha Sorokin
cb32cca6aa Enable TypeScript support
This commit enables TypeScript support in Omorphia. It reconfigures
Vite, adds two new TSConfig files as a replacement for the old JSConfig,
adds TypeScript linting to ESLint configuration.

Why?
====

TypeScript has became a standard in modern web development. In makes
JavaScript a more type-safe language, makes code more maintaible and
boosts effeciency by empowering development tools.

What's included in this commit?
===============================

TypeScript config files
-----------------------

Old and plain JSConfig has been replaced with two TSConfigs: one
designed for the code, and the other for the Vite configuration file.

JavaScript support is still enabled, therefore TypeScript files can
import JavaScript files as well, and vice versa. However, it is
recommended that all the new files will be written in TypeScript, and
old files are slowly converted over to TypeScript, so this option can be
disabled in the future, making this a safe TypeScript only project.

UMD output is replaced with CJS
-------------------------------

UMD is an old format that tries to stay compatible with both the Node.js
CJS, as well as Require.js. However, nowadays almost everyone is using a
transpiler where this format won't be beneficial.

To avoid it being a breaking change, it has been replaced with CJS. But
in the future it's worth considering removing CJS output as well and
making Omorphia an ESM module only, as it's designed only to be
consumed by the Modrinth project, and all of these projects are already
ESM-first.

Minification is disabled
------------------------

Because this is a library, the responsibility of minifying its code lies
solely on the consumer. Just like with CJS, all of the supported
consumers of this library are already performing minification, so
minifying this library beforehand is rather wasteful and harmful, as it
negatively impacts debugging experience.

More dependencies are now externalised
--------------------------------------

Disabling UMD output allows more easily externalise dependencies based
on the package.json file, making it way more approachable.

Vue is now a peer dependency
----------------------------

Because this is a component library, Vue is not a direct dependency of
this project. Instead, this library relies on consumer having a Vue as
its dependency.

`lib` is no longer included in package
--------------------------------------

`lib` folder contains sources for the imports, but it's outside of
export map and cannot be imported by the consumers. It is now excluded
from the package to reduce the package size and installation time.

Typings
-------

Consumers of this library should also be able to benefit from the type
safety. To achieve this, there's now a Vite plugin that generates type
declarations that represent the project structure.

To lesser the incompatibility with the consumers, some of the files were
changed to import `index.js` from folders rather than folders
themselves.

While both will work for building, not doing this requires consumer to
opt in to bundler module dependency, whereas if `index.js` is imported,
the consumer can use both the normal ESM / Node16 module resolution, as
well as the bundler module resolution.

ESLint configuration changes
----------------------------

ESLint has been reconfigured to support TypeScript, and include rules
recommended by the TypeScript ESLint package. In the future it would be
good to review the rules and override rules for TypeScript files to
disable rules that would conflict with ones from TypeScript ESLint.

Entry file is now a TypeScript file
-----------------------------------

To test the changes and begin the slow conversion, the entry point file
is now a proper TypeScript file.

SVG imports use `?component` parameter
--------------------------------------

All components are now imported with `?component` URL parameter so that
they have a proper file. By default, Vite imports all files like .svg
as strings containing path to the file.

Unfortunately, `vite-svg-loader` overrides this behaviour without
overriding the Vite import type declaration, leading to incorrect types.
However, it does expose a new parameter `?component`, which is properly
typed and does the same thing you'd expect - export a Vue component, so
most of the SVG imports have been converted to use this parameter.
2023-10-14 15:43:57 +02:00
Jackson Kruger
abf4cd71ba
Add redis caching to getting user notifications and projects [MOD-540] (#723)
* Add redis caching to getting a user's project ids

* Run `cargo sqlx prepare` to update the sqlx-data.json

* Add redis caching for getting user notifications

* Fix new clippy warnings

* Remove log that shouldn't have been committed

* Batch insert of notifications (untested)

* sqlx prepare...

* Fix merge conflict things and use new redis struct

* Fix bug with calling delete_many without any elements (caught by tests)

* cargo sqlx prepare

* Add tests around cache invalidation (and fix bug they caught!)

* Some test reorg based on code review suggestions
2023-10-12 15:52:24 -07:00
Geometrically
d66270eef0
Remove scheduling webhook check (#728) 2023-10-12 11:21:26 -07:00
Carter
8ccc7dfcd2
Fix launcher duplicate profile function (#804) 2023-10-12 10:41:44 -07:00
Prospector
ffb491a61f
Merge pull request #98 from modrinth/feature/popout-menus
Small button refactor, overflow and popout menus
2023-10-12 08:42:44 -07:00
Prospector
4ecba93a25
Fix lint 2023-10-12 08:40:05 -07:00
Prospector
52ec1d09b8
Merge pull request #99 from modrinth/bump-master
Bump version to 0.4.41
2023-10-12 08:35:59 -07:00
Prospector
3d2e2e2278
Bump version to 0.5.0 2023-10-12 08:34:02 -07:00
Prospector
f9a9ece320
More button options and dividers in overflow menus 2023-10-12 08:33:50 -07:00
Prospector
ffc46d6a48
Fix button docs 2023-10-12 08:33:50 -07:00
Prospector
ce458642af
indent on popout menu docs 2023-10-12 08:33:50 -07:00
Prospector
820d3ef426
Add example docs for overflow menu 2023-10-12 08:33:50 -07:00
Prospector
145386b6a7
Change page title of overflow menu 2023-10-12 08:33:50 -07:00
Prospector
a708cf7f69
Small button refactor, overflow and popout menus 2023-10-12 08:33:50 -07:00
Prospector
c70ebb6cce
Bump version 2023-10-12 08:32:50 -07:00
Geometrically
07ecd13554
Switch to Trolley for Modrinth Payments (#727)
* most of trolley

* Switch to trolley for payments

* run prepare

* fix clippy

* fix more

* Fix most tests + bitflags

* Update src/auth/flows.rs

Co-authored-by: Jackson Kruger <jak.kruger@gmail.com>

* Finish trolley

* run prep for merge

* Update src/queue/payouts.rs

Co-authored-by: Jackson Kruger <jak.kruger@gmail.com>

---------

Co-authored-by: Jackson Kruger <jak.kruger@gmail.com>
2023-10-11 15:55:01 -07:00
Prospector
a260b6eac4
Merge pull request #96 from ToBinio/snapping-slider
add snappingPoints to slider
2023-10-11 14:04:22 -07:00
Prospector
0ab17e1ec8
Merge pull request #87 from Banzobotic/fix-clickable-edges
Fix clicking edges of clickable elements
2023-10-11 14:04:10 -07:00
Prospector
d1a0cd1173
Merge pull request #94 from ToBinio/better-dropdown-transition
improve dropdown transitions
2023-10-11 14:03:59 -07:00
BasiqueEvangelist
f1ff88f452
fix maven filters for versions with dashes (#725)
Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
2023-10-11 14:01:32 -07:00
Jackson Kruger
d92272ffa0
Batch inserts [MOD-555] (#726)
* Batch a bunch of inserts, but still more to do

* Insert many for clickhouse (+ tests)

* Batch the remaining ones except those requiring deduplication

* Risky dedups

* Bit o cleanup and formatting

* cargo sqlx prepare

* Add test around batch editing project categories

* Add struct to satisfy clippy

* Fix silly mistake that was caught by the tests!

* Leave room for growth in dummy_data
2023-10-11 11:32:58 -07:00
ToBinio
da07d7328d
fix google.svg (#795) 2023-10-09 10:34:56 -07:00
Jackson Kruger
772597ce2a
Make export selection consistent between platforms and allow selecting which projects to export (#789)
* Experimenting with tests

* Overhaul handling of paths for pack files to always use standardized style

Also allows disabling export of all items

* Minor improvements

* Revert test things

* Minor tweaks

* Fix clippy warning
2023-10-09 10:34:19 -07:00
tobinio
3955b973ef add snappingPoints to slider 2023-10-08 10:49:51 +02:00
ToBinio
e76a7d57c0
fix categories duplicating (#773) 2023-10-06 19:59:18 -07:00
Jackson Kruger
dfa43f3c5a
Add /metrics endpoint for Prometheus (#724) 2023-10-06 15:58:02 -07:00
Wyatt Verchere
259c5ef3d0
Tests (#719)
* computer switch

* some fixes; github action

* added pr to master

* sqlx database setup

* switched intial GHA test db

* removed sqlx database setup

* unfinished patch route

* bug fixes + tests

* more tests, more fixes, cargo fmt

* merge fixes

* more tests, full reorganization

* fmt, clippy

* sqlx-data

* revs

* removed comments

* delete revs
2023-10-06 09:57:33 -07:00
Jackson Kruger
ebc4da6c29
Use 'neoforge' instead of 'neo-forge' in mrpacks (#787) 2023-10-04 15:42:09 -07:00
Wyatt Verchere
a1b59d4545
Organizations (#712)
* untested, unformatted, un-refactored

* minor simplification

* simplification fix

* refactoring, changes

* some fixes

* fixes, refactoring

* missed cache

* revs

* revs - more!

* removed donation links; added all org members to route

* renamed slug to title

---------

Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
2023-10-02 10:56:57 -07:00
Miraculixx
f73c112e07
Fixing bug report template - Wrong nesting (#756)
* Wrap string in quotes to support brackets

* Moving string to label
2023-10-02 10:28:45 -07:00
chaos
7fbc9fa357
Allow mods to be added to unlocked instances. (#760)
* Allow mods to be added to unlocked instances.

* Learn about optional chaining?.
2023-10-02 10:27:04 -07:00
chaos
6f8ffcaf35
Overflow and mrpack fixes, comfortable memory slider and more. (#762)
* Add overflow rules for certain elements.

* Round scrollbar corners to be more attractive.

* Avoid corners in avatar & fix white corner in logs

* Increase step to 64 for memory related inputs.

* Fix overflow on title in mod browse. Fixes #740

* Fix overflow in instance mod browsing.

* Add checks for instances without versions.
2023-10-02 10:26:22 -07:00
Mysterious_Dev
fcfa508cbc
Fix convertion to Composition API for Avatar component (#1391)
* Fix Convertion for Avatar component

* Use ref for img
2023-10-02 07:08:56 -04:00
Emma Alexia Triphora
58a61051b9
Don't show processing projects in thread message inbox (#722)
They already show up in the Review tab, so, no reason to also have them in the Messages tab
2023-10-01 13:22:29 -07:00
Emma Alexia Triphora
a6766ef1c0
Fix theme color not showing up properly in OpenGraph/Discord embeds (#1384) 2023-10-01 13:22:05 -07:00
chaos
606b5ac5ab
Disable save & remove password button when no input password. (#1387) 2023-10-01 16:21:44 -04:00
chaos
9acc463c7f
Fix dependencies list not updating on dependency remove. (#1388) 2023-10-01 16:19:23 -04:00
chaos
c4ddd08b0a
Fix license element deleting itself when pressing backspace. (#1389) 2023-10-01 15:57:37 -04:00
Sasha Sorokin
5c7dd10769
Preserve whitespace in extracted translatable strings (#1390) 2023-10-01 15:45:21 -04:00
Mysterious_Dev
3fa86cb441
Convert Avatar & Badge components to Composition API (#1386) 2023-10-01 11:47:47 -04:00
Emma Alexia Triphora
4a74ee0d72
Update legal pages, especially rules (#1373)
* WIP rules update

* Update

* Run fix

* Entirely unnecessary

* Address comments
2023-09-30 15:45:53 -07:00
Mysterious_Dev
8a8759b0d4
Add sessions translation to settings navstack (#1383) 2023-09-30 14:47:34 -04:00
Sasha Sorokin
f259072136
Post translation Sessions settings page fixes (#1382) 2023-09-30 14:47:26 -04:00
Sasha Sorokin
3fd74292ef
Remove unnecessary space in description on Sessions settings page (#1381) 2023-09-28 23:53:44 -04:00
Mysterious_Dev
f37c4293df
Token Modal confirm for removal (#1375) 2023-09-28 22:44:36 -04:00
Mysterious_Dev
b9248553be
Add translation keys for Sessions page (#1377)
Co-authored-by: Sasha Sorokin <10401817+brawaru@users.noreply.github.com>
2023-09-28 22:43:53 -04:00
Geometrically
475d434e98
Hide app promotion (#1376) 2023-09-25 20:28:48 -07:00
Mysterious_Dev
05d568d1c1
Fix "Incorrect wording for expired pats" (#1378) 2023-09-24 15:35:34 -04:00