Commit Graph

41 Commits

Author SHA1 Message Date
Adrian O.V
c056c4e79e Improved graphs (#120)
* Complete chart overhaul

* Update package.json

* Update pnpm-lock.yaml

* run lint

* whoops

* Update pnpm-lock.yaml

* Update analytics.md

* Try again?

* Update Chart.vue

* Added Compact/Spark charts

* Added number formatting and cleanup

* Touch ups

* improve default colors

* removed unnecessary tooltip
2023-10-26 11:39:26 -07:00
Prospector
c296597427 Markdown editor (#92)
* Markdown editor

* use nocookie YT iframes

Co-authored-by: Emma Alexia Triphora <emma@modrinth.com>

* Fix line prefix-related Markdown editor bugs and add auto-lists

* Fix a couple codeblock issues

* address SearchFilter composition

* standardize code and patternize editor

* make editor typesafe

* adjust imports

* simplify key press handler

* Codemirror markdown implementation (#106)

* demo

* custom newline logic

* basic editor styling and buttons

* propogate styles

* validate and command structure for modals

* mobile safari event fix

* remove url field causing remount

* browser & mobile fix for link insertion

* override event passthrough to fix mobile

* fix modal state & disallow invalid url submission

* override paste behavior

* remove block flag in favor of newline insert

* cleanup before pr

* emit value from editor

* remove "a"

---------

Co-authored-by: Emma Alexia Triphora <emma@modrinth.com>
Co-authored-by: Carter <safe@fea.st>
2023-10-20 16:55:38 -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
Adrian O.V
e1f4d791ae Charts (#88)
* Charts

* Version bump

* Update pnpm-lock.yaml
2023-08-21 15:29:24 -04:00
Adrian O.V
42f97f63d5 Share modal (#74)
* Creation of the share modal

* Update package.json

* Addressed comments

* Fixed dependency

* Update ShareModal.vue

* Fixed url

* Update ShareModal.vue

* Adressed changes
2023-06-28 08:44:47 -07:00
Geometrically
1db59fc052 Knossos Catch-up (#58)
* Knossos Catch-up

* bump version

* fix build

* fix build again

* Fix lint

* downgrade pnpm

* fix modals

* fix btn style

* add missing styles
2023-05-28 16:36:49 -04:00
Prospector
0faa24d5d3 Start omorphia 2 (#8) 2023-02-16 15:02:39 -07:00
venashial
533f0213e3 Self-host fonts + Move Vite plugins export 2022-07-28 22:45:53 -07:00
Wuzado
800540ce7f Add svelte2tsx to fix package builds 2022-07-17 01:49:13 +02:00
venashial
fe415cbd77 Upgrade to Vite 3 2022-07-16 16:15:06 -07:00
venashial
f62723c274 Add .file class + Generator user agent 2022-07-02 22:14:20 -07:00
venashial
1423db35eb Fix NavRow on mobile 2022-06-30 12:17:55 -07:00
venashial
fb3a9f1f29 Fix send function headers error 2022-06-25 13:08:20 -07:00
venashial
123de56f38 Refactor setup documentation 2022-06-25 12:32:03 -07:00
venashial
aec03294d6 Create send function for API requests 2022-06-25 00:17:42 -07:00
venashial
1b17049e94 Cut down highlight.js size 2022-06-24 22:26:49 -07:00
venashial
81c039d645 Fix packaging to correctly handle utils/ 2022-06-24 20:36:16 -07:00
venashial
f70f670ed3 Skip Typescript compilation on packaging 2022-06-20 23:50:33 -07:00
venashial
f2cb6ce972 Add Modal 2022-06-13 11:34:46 -07:00
venashial
eb171ecb21 Update CSS guidelines + Prefer rem 2022-06-07 14:00:53 -07:00
venashial
c9ec9f14de Run prettier 2022-06-04 00:46:23 -07:00
venashial
347366e8d7 Fix server-side rendering 2022-05-29 11:29:53 -07:00
venashial
8d4da009af Update prettier config + Run pnpm format 2022-05-26 19:17:15 -07:00
venashial
8bf90714da Update utilities and documentation 2022-05-20 19:53:13 -07:00
venashial
0f6263d82e Add generator plugin 2022-05-20 00:10:15 -07:00
venashial
fd936e5bf3 Update illustrations & icons docs + Fixes 2022-05-07 17:22:33 -07:00
venashial
2b6fee0455 docs: Fix pnpm-lock.yaml 2022-04-16 00:32:57 -07:00
venashial
a48e6f82d1 docs: Improve example component + Fix sidebar on mobile 2022-04-16 00:29:35 -07:00
venashial
3646c0d0a3 Remove lodash.uniqueId 2022-04-03 11:45:04 -07:00
venashial
ea1ff65db7 Move svelte config + postcss config to package/config 2022-04-02 23:18:57 -07:00
venashial
85b7147927 Add classes: Actions + Divider + Illustration + InfoTable + Stat, Add utilities (needs docs) 2022-04-02 16:17:58 -07:00
venashial
1d7949ded6 Add component API to built docs + Add Checkbox, CheckboxList, & CheckboxVirtualList 2022-03-29 22:06:43 -07:00
venashial
98baab4d03 Update docs examples + Add Select component + Add Card, Base, Title classes 2022-03-29 00:44:23 -07:00
venashial
15b7c241ff Update style vars + Add examples to docs + Add Avatar, NavRow, Pagination, & Link 2022-03-20 00:19:51 -07:00
venashial
a0e05115a3 Add component API to docs (ex: props, events, slots) 2022-03-16 23:34:56 -07:00
venashial
630a1d42b8 Prepare for NPM + Cloudflare pages 2022-03-13 23:10:58 -07:00
venashial
b69ff6ca8a docs: Improve header + sidebar
docs: Create workflows
lib: Start pagination
2022-03-12 01:34:09 -08:00
venashial
6dcd33bbc5 Add CSS & Icons docs 2022-03-09 23:17:28 -08:00
venashial
c6df78eb81 Improve docs 2022-03-09 22:18:22 -08:00
venashial
d1babe27ec Start work 2022-03-09 21:27:53 -08:00
venashial
139e57f1eb Initial commit 2022-03-07 21:55:31 -08:00