mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-01-12 00:03:44 +00:00
feat: preload fonts
This commit is contained in:
parent
b1ac5422b8
commit
015676648b
11 changed files with 172 additions and 75 deletions
2
.github/workflows/check.yml
vendored
2
.github/workflows/check.yml
vendored
|
|
@ -20,7 +20,7 @@ jobs:
|
|||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22.9
|
||||
node-version: 22.19
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Install dependencies
|
||||
|
|
|
|||
|
|
@ -12,6 +12,16 @@ export default tseslint.config(
|
|||
svelteConfig
|
||||
}
|
||||
},
|
||||
ignores: ['build/', '.svelte-kit/', 'node_modules/']
|
||||
ignores: ['build/', '.svelte-kit/', 'node_modules/'],
|
||||
rules: {
|
||||
'@typescript-eslint/prefer-nullish-coalescing': [
|
||||
'error',
|
||||
{
|
||||
ignoreConditionalTests: true,
|
||||
ignoreMixedLogicalExpressions: false,
|
||||
ignorePrimitives: true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ui",
|
||||
"version": "6.4.145",
|
||||
"version": "6.4.146",
|
||||
"license": "BUSL-1.1",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@9.15.5",
|
||||
|
|
@ -33,6 +33,7 @@
|
|||
"gql.tada": "^1.8.13",
|
||||
"hayase-extensions": "github:hayase-app/extensions",
|
||||
"jassub": "^1.8.6",
|
||||
"jiti": "^2.5.1",
|
||||
"ms": "^2.1.3",
|
||||
"native": "github:hayase-app/native",
|
||||
"rollup-plugin-license": "^3.6.0",
|
||||
|
|
|
|||
127
pnpm-lock.yaml
127
pnpm-lock.yaml
|
|
@ -179,7 +179,7 @@ importers:
|
|||
version: 0.0.19(svelte@4.2.19)
|
||||
eslint-config-standard-universal:
|
||||
specifier: ^1.0.9
|
||||
version: 1.0.9(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(jiti@1.21.6)
|
||||
version: 1.0.9(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(jiti@2.5.1)
|
||||
gql.tada:
|
||||
specifier: ^1.8.13
|
||||
version: 1.8.13(@gql.tada/svelte-support@1.0.1(svelte@4.2.19)(typescript@5.9.2))(graphql@16.10.0)(typescript@5.9.2)
|
||||
|
|
@ -189,6 +189,9 @@ importers:
|
|||
jassub:
|
||||
specifier: ^1.8.6
|
||||
version: 1.8.6
|
||||
jiti:
|
||||
specifier: ^2.5.1
|
||||
version: 2.5.1
|
||||
ms:
|
||||
specifier: ^2.1.3
|
||||
version: 2.1.3
|
||||
|
|
@ -1887,6 +1890,10 @@ packages:
|
|||
resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==}
|
||||
hasBin: true
|
||||
|
||||
jiti@2.5.1:
|
||||
resolution: {integrity: sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==}
|
||||
hasBin: true
|
||||
|
||||
js-levenshtein@1.1.6:
|
||||
resolution: {integrity: sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
|
@ -3023,9 +3030,9 @@ snapshots:
|
|||
'@esbuild/win32-x64@0.21.5':
|
||||
optional: true
|
||||
|
||||
'@eslint-community/eslint-utils@4.7.0(eslint@9.34.0(jiti@1.21.6))':
|
||||
'@eslint-community/eslint-utils@4.7.0(eslint@9.34.0(jiti@2.5.1))':
|
||||
dependencies:
|
||||
eslint: 9.34.0(jiti@1.21.6)
|
||||
eslint: 9.34.0(jiti@2.5.1)
|
||||
eslint-visitor-keys: 3.4.3
|
||||
|
||||
'@eslint-community/regexpp@4.12.1': {}
|
||||
|
|
@ -3142,7 +3149,7 @@ snapshots:
|
|||
dependencies:
|
||||
'@jridgewell/set-array': 1.2.1
|
||||
'@jridgewell/sourcemap-codec': 1.5.0
|
||||
'@jridgewell/trace-mapping': 0.3.25
|
||||
'@jridgewell/trace-mapping': 0.3.30
|
||||
|
||||
'@jridgewell/resolve-uri@3.1.2': {}
|
||||
|
||||
|
|
@ -3264,11 +3271,11 @@ snapshots:
|
|||
|
||||
'@standard-schema/spec@1.0.0': {}
|
||||
|
||||
'@stylistic/eslint-plugin@5.3.1(eslint@9.34.0(jiti@1.21.6))':
|
||||
'@stylistic/eslint-plugin@5.3.1(eslint@9.34.0(jiti@2.5.1))':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@1.21.6))
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1))
|
||||
'@typescript-eslint/types': 8.41.0
|
||||
eslint: 9.34.0(jiti@1.21.6)
|
||||
eslint: 9.34.0(jiti@2.5.1)
|
||||
eslint-visitor-keys: 4.2.1
|
||||
espree: 10.4.0
|
||||
estraverse: 5.3.0
|
||||
|
|
@ -3403,15 +3410,15 @@ snapshots:
|
|||
'@types/trusted-types@2.0.7':
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.41.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)':
|
||||
'@typescript-eslint/eslint-plugin@8.41.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)':
|
||||
dependencies:
|
||||
'@eslint-community/regexpp': 4.12.1
|
||||
'@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)
|
||||
'@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
|
||||
'@typescript-eslint/scope-manager': 8.41.0
|
||||
'@typescript-eslint/type-utils': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)
|
||||
'@typescript-eslint/utils': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)
|
||||
'@typescript-eslint/type-utils': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
|
||||
'@typescript-eslint/utils': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
|
||||
'@typescript-eslint/visitor-keys': 8.41.0
|
||||
eslint: 9.34.0(jiti@1.21.6)
|
||||
eslint: 9.34.0(jiti@2.5.1)
|
||||
graphemer: 1.4.0
|
||||
ignore: 7.0.5
|
||||
natural-compare: 1.4.0
|
||||
|
|
@ -3420,14 +3427,14 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)':
|
||||
'@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/scope-manager': 8.41.0
|
||||
'@typescript-eslint/types': 8.41.0
|
||||
'@typescript-eslint/typescript-estree': 8.41.0(typescript@5.9.2)
|
||||
'@typescript-eslint/visitor-keys': 8.41.0
|
||||
debug: 4.4.1
|
||||
eslint: 9.34.0(jiti@1.21.6)
|
||||
eslint: 9.34.0(jiti@2.5.1)
|
||||
typescript: 5.9.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
|
@ -3450,13 +3457,13 @@ snapshots:
|
|||
dependencies:
|
||||
typescript: 5.9.2
|
||||
|
||||
'@typescript-eslint/type-utils@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)':
|
||||
'@typescript-eslint/type-utils@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.41.0
|
||||
'@typescript-eslint/typescript-estree': 8.41.0(typescript@5.9.2)
|
||||
'@typescript-eslint/utils': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)
|
||||
'@typescript-eslint/utils': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
|
||||
debug: 4.4.1
|
||||
eslint: 9.34.0(jiti@1.21.6)
|
||||
eslint: 9.34.0(jiti@2.5.1)
|
||||
ts-api-utils: 2.1.0(typescript@5.9.2)
|
||||
typescript: 5.9.2
|
||||
transitivePeerDependencies:
|
||||
|
|
@ -3480,13 +3487,13 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/utils@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)':
|
||||
'@typescript-eslint/utils@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@1.21.6))
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1))
|
||||
'@typescript-eslint/scope-manager': 8.41.0
|
||||
'@typescript-eslint/types': 8.41.0
|
||||
'@typescript-eslint/typescript-estree': 8.41.0(typescript@5.9.2)
|
||||
eslint: 9.34.0(jiti@1.21.6)
|
||||
eslint: 9.34.0(jiti@2.5.1)
|
||||
typescript: 5.9.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
|
@ -4156,24 +4163,24 @@ snapshots:
|
|||
|
||||
escape-string-regexp@4.0.0: {}
|
||||
|
||||
eslint-compat-utils@0.5.1(eslint@9.34.0(jiti@1.21.6)):
|
||||
eslint-compat-utils@0.5.1(eslint@9.34.0(jiti@2.5.1)):
|
||||
dependencies:
|
||||
eslint: 9.34.0(jiti@1.21.6)
|
||||
eslint: 9.34.0(jiti@2.5.1)
|
||||
semver: 7.7.2
|
||||
|
||||
eslint-config-standard-universal@1.0.9(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(jiti@1.21.6):
|
||||
eslint-config-standard-universal@1.0.9(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(jiti@2.5.1):
|
||||
dependencies:
|
||||
'@stylistic/eslint-plugin': 5.3.1(eslint@9.34.0(jiti@1.21.6))
|
||||
eslint: 9.34.0(jiti@1.21.6)
|
||||
'@stylistic/eslint-plugin': 5.3.1(eslint@9.34.0(jiti@2.5.1))
|
||||
eslint: 9.34.0(jiti@2.5.1)
|
||||
eslint-import-resolver-node: 0.3.9
|
||||
eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(eslint@9.34.0(jiti@1.21.6))
|
||||
eslint-plugin-n: 17.21.3(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)
|
||||
eslint-plugin-promise: 7.2.1(eslint@9.34.0(jiti@1.21.6))
|
||||
eslint-plugin-svelte: 3.11.0(eslint@9.34.0(jiti@1.21.6))(svelte@4.2.19)
|
||||
eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.34.0(jiti@2.5.1))
|
||||
eslint-plugin-n: 17.21.3(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
|
||||
eslint-plugin-promise: 7.2.1(eslint@9.34.0(jiti@2.5.1))
|
||||
eslint-plugin-svelte: 3.11.0(eslint@9.34.0(jiti@2.5.1))(svelte@4.2.19)
|
||||
globals: 16.3.0
|
||||
svelte: 4.2.19
|
||||
typescript: 5.9.2
|
||||
typescript-eslint: 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)
|
||||
typescript-eslint: 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
|
||||
transitivePeerDependencies:
|
||||
- '@typescript-eslint/parser'
|
||||
- eslint-import-resolver-typescript
|
||||
|
|
@ -4190,24 +4197,24 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
eslint-module-utils@2.12.1(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.34.0(jiti@1.21.6)):
|
||||
eslint-module-utils@2.12.1(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.34.0(jiti@2.5.1)):
|
||||
dependencies:
|
||||
debug: 3.2.7
|
||||
optionalDependencies:
|
||||
'@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)
|
||||
eslint: 9.34.0(jiti@1.21.6)
|
||||
'@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
|
||||
eslint: 9.34.0(jiti@2.5.1)
|
||||
eslint-import-resolver-node: 0.3.9
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
eslint-plugin-es-x@7.8.0(eslint@9.34.0(jiti@1.21.6)):
|
||||
eslint-plugin-es-x@7.8.0(eslint@9.34.0(jiti@2.5.1)):
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@1.21.6))
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1))
|
||||
'@eslint-community/regexpp': 4.12.1
|
||||
eslint: 9.34.0(jiti@1.21.6)
|
||||
eslint-compat-utils: 0.5.1(eslint@9.34.0(jiti@1.21.6))
|
||||
eslint: 9.34.0(jiti@2.5.1)
|
||||
eslint-compat-utils: 0.5.1(eslint@9.34.0(jiti@2.5.1))
|
||||
|
||||
eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(eslint@9.34.0(jiti@1.21.6)):
|
||||
eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.34.0(jiti@2.5.1)):
|
||||
dependencies:
|
||||
'@rtsao/scc': 1.1.0
|
||||
array-includes: 3.1.9
|
||||
|
|
@ -4216,9 +4223,9 @@ snapshots:
|
|||
array.prototype.flatmap: 1.3.3
|
||||
debug: 3.2.7
|
||||
doctrine: 2.1.0
|
||||
eslint: 9.34.0(jiti@1.21.6)
|
||||
eslint: 9.34.0(jiti@2.5.1)
|
||||
eslint-import-resolver-node: 0.3.9
|
||||
eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.34.0(jiti@1.21.6))
|
||||
eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.34.0(jiti@2.5.1))
|
||||
hasown: 2.0.2
|
||||
is-core-module: 2.16.1
|
||||
is-glob: 4.0.3
|
||||
|
|
@ -4230,18 +4237,18 @@ snapshots:
|
|||
string.prototype.trimend: 1.0.9
|
||||
tsconfig-paths: 3.15.0
|
||||
optionalDependencies:
|
||||
'@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)
|
||||
'@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
|
||||
transitivePeerDependencies:
|
||||
- eslint-import-resolver-typescript
|
||||
- eslint-import-resolver-webpack
|
||||
- supports-color
|
||||
|
||||
eslint-plugin-n@17.21.3(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2):
|
||||
eslint-plugin-n@17.21.3(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2):
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@1.21.6))
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1))
|
||||
enhanced-resolve: 5.18.3
|
||||
eslint: 9.34.0(jiti@1.21.6)
|
||||
eslint-plugin-es-x: 7.8.0(eslint@9.34.0(jiti@1.21.6))
|
||||
eslint: 9.34.0(jiti@2.5.1)
|
||||
eslint-plugin-es-x: 7.8.0(eslint@9.34.0(jiti@2.5.1))
|
||||
get-tsconfig: 4.10.1
|
||||
globals: 15.15.0
|
||||
globrex: 0.1.2
|
||||
|
|
@ -4251,16 +4258,16 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- typescript
|
||||
|
||||
eslint-plugin-promise@7.2.1(eslint@9.34.0(jiti@1.21.6)):
|
||||
eslint-plugin-promise@7.2.1(eslint@9.34.0(jiti@2.5.1)):
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@1.21.6))
|
||||
eslint: 9.34.0(jiti@1.21.6)
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1))
|
||||
eslint: 9.34.0(jiti@2.5.1)
|
||||
|
||||
eslint-plugin-svelte@3.11.0(eslint@9.34.0(jiti@1.21.6))(svelte@4.2.19):
|
||||
eslint-plugin-svelte@3.11.0(eslint@9.34.0(jiti@2.5.1))(svelte@4.2.19):
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@1.21.6))
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1))
|
||||
'@jridgewell/sourcemap-codec': 1.5.5
|
||||
eslint: 9.34.0(jiti@1.21.6)
|
||||
eslint: 9.34.0(jiti@2.5.1)
|
||||
esutils: 2.0.3
|
||||
globals: 16.3.0
|
||||
known-css-properties: 0.37.0
|
||||
|
|
@ -4283,9 +4290,9 @@ snapshots:
|
|||
|
||||
eslint-visitor-keys@4.2.1: {}
|
||||
|
||||
eslint@9.34.0(jiti@1.21.6):
|
||||
eslint@9.34.0(jiti@2.5.1):
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@1.21.6))
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1))
|
||||
'@eslint-community/regexpp': 4.12.1
|
||||
'@eslint/config-array': 0.21.0
|
||||
'@eslint/config-helpers': 0.3.1
|
||||
|
|
@ -4321,7 +4328,7 @@ snapshots:
|
|||
natural-compare: 1.4.0
|
||||
optionator: 0.9.4
|
||||
optionalDependencies:
|
||||
jiti: 1.21.6
|
||||
jiti: 2.5.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
|
|
@ -4732,6 +4739,8 @@ snapshots:
|
|||
|
||||
jiti@1.21.6: {}
|
||||
|
||||
jiti@2.5.1: {}
|
||||
|
||||
js-levenshtein@1.1.6: {}
|
||||
|
||||
js-yaml@4.1.0:
|
||||
|
|
@ -5626,13 +5635,13 @@ snapshots:
|
|||
possible-typed-array-names: 1.1.0
|
||||
reflect.getprototypeof: 1.0.10
|
||||
|
||||
typescript-eslint@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2):
|
||||
typescript-eslint@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2):
|
||||
dependencies:
|
||||
'@typescript-eslint/eslint-plugin': 8.41.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)
|
||||
'@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)
|
||||
'@typescript-eslint/eslint-plugin': 8.41.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
|
||||
'@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
|
||||
'@typescript-eslint/typescript-estree': 8.41.0(typescript@5.9.2)
|
||||
'@typescript-eslint/utils': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)
|
||||
eslint: 9.34.0(jiti@1.21.6)
|
||||
'@typescript-eslint/utils': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
|
||||
eslint: 9.34.0(jiti@2.5.1)
|
||||
typescript: 5.9.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
|
|
|||
|
|
@ -138,10 +138,10 @@
|
|||
}
|
||||
}
|
||||
|
||||
@font-face {
|
||||
/* @font-face {
|
||||
font-family: 'molotregular';
|
||||
src: url('/Molot-webfont-subset.woff') format('woff');
|
||||
}
|
||||
} */
|
||||
|
||||
@font-face {
|
||||
font-family: "Twemoji";
|
||||
|
|
@ -475,9 +475,9 @@ body {
|
|||
background-size: 119px;
|
||||
}
|
||||
|
||||
.font-molot {
|
||||
/* .font-molot {
|
||||
font-family: 'molotregular';
|
||||
}
|
||||
} */
|
||||
|
||||
.font-twemoji {
|
||||
font-family: 'Twemoji';
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@
|
|||
}
|
||||
|
||||
$: checkIdleState(active, $settings.idleAnimation)
|
||||
|
||||
// MOLOT font was commented out in app.css since this feature was shelved
|
||||
</script>
|
||||
|
||||
<svelte:document bind:visibilityState />
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ const dummyFiles = [
|
|||
type: 'video/webm',
|
||||
size: 1234567890,
|
||||
path: '/Amebku.webm',
|
||||
url: '/test2.mkv',
|
||||
url: 'video.mkv',
|
||||
id: 0
|
||||
}
|
||||
// {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<script lang='ts'>
|
||||
import { goto, preloadCode } from '$app/navigation'
|
||||
import { goto, preloadData } from '$app/navigation'
|
||||
import Logo from '$lib/components/icons/Logo.svelte'
|
||||
import { storagePromise } from '$lib/modules/anilist/urql-client'
|
||||
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
// this was previously in anilist/client but it was a top level await, which isn't a great solution, this *should* be better?
|
||||
|
||||
// we want to wait for the cache to be ready, for the page preload to finish, and for the animation to finish, in that order, but as fast as possible for each
|
||||
const promise = storagePromise.promise.then(() => preloadCode(data.goto))
|
||||
const promise = storagePromise.promise.then(() => preloadData(data.goto))
|
||||
|
||||
async function navigate () {
|
||||
await promise
|
||||
|
|
@ -61,8 +61,8 @@
|
|||
0 0 0 1 0' />
|
||||
<feOffset in='red_' dy='0' result='red'>
|
||||
<animate attributeName='dx'
|
||||
values='4;2;0'
|
||||
dur='0.2s'
|
||||
values='4;0'
|
||||
dur='0.1s'
|
||||
begin='0s' />
|
||||
</feOffset>
|
||||
<feColorMatrix type='matrix'
|
||||
|
|
@ -74,8 +74,8 @@
|
|||
0 0 0 1 0' />
|
||||
<feOffset in='blue_' dy='0' result='blue'>
|
||||
<animate attributeName='dx'
|
||||
values='-6;-3;0'
|
||||
dur='0.2s'
|
||||
values='-6;0'
|
||||
dur='0.1s'
|
||||
begin='0s' />
|
||||
</feOffset>
|
||||
<feBlend mode='screen' in='red' in2='blue' />
|
||||
|
|
|
|||
6
src/types/fs.d.ts
vendored
6
src/types/fs.d.ts
vendored
|
|
@ -16,3 +16,9 @@ declare module 'node:fs' {
|
|||
import path = require('fs')
|
||||
export = path
|
||||
}
|
||||
|
||||
declare module 'node:fs/promises' {
|
||||
export function readdir(path: string | URL): Promise<string[]>
|
||||
export function readFile(path: string | URL, options?: { encoding?: string, flag?: string } | string): Promise<string | Uint8Array>
|
||||
export function writeFile(path: string | URL, data: string | Uint8Array, options?: { encoding?: string, mode?: number, flag?: string } | string): Promise<void>
|
||||
}
|
||||
|
|
|
|||
1
src/types/path.d.ts
vendored
1
src/types/path.d.ts
vendored
|
|
@ -1,5 +1,6 @@
|
|||
declare module 'path' {
|
||||
export function resolve(...paths: string[]): string
|
||||
export function join(...paths: string[]): string
|
||||
}
|
||||
|
||||
declare module 'node:path' {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,72 @@
|
|||
import { readdir, readFile, writeFile } from 'node:fs/promises'
|
||||
import { join } from 'node:path'
|
||||
import process from 'node:process'
|
||||
|
||||
import adapter from '@sveltejs/adapter-static'
|
||||
import staticAdapter from '@sveltejs/adapter-static'
|
||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
|
||||
|
||||
/**
|
||||
* Custom adapter wrapper that extends @sveltejs/adapter-static
|
||||
* to inject font preload links after the build is complete
|
||||
*
|
||||
* @param {import('@sveltejs/adapter-static').AdapterOptions & {fontNames?: string[], formats?: string[]}} options
|
||||
* @returns {import('@sveltejs/kit').Adapter}
|
||||
*/
|
||||
const adapterWithFontPreload = (options = {}) => {
|
||||
const { fontNames = ['nunito'], formats = ['woff2', 'woff'], ...staticOptions } = options
|
||||
|
||||
const baseAdapter = staticAdapter(staticOptions)
|
||||
|
||||
return {
|
||||
name: 'adapter-static-with-font-preload',
|
||||
|
||||
async adapt (builder) {
|
||||
await baseAdapter.adapt(builder)
|
||||
|
||||
const outDir = './build' // Static adapter always writes to 'build' directory
|
||||
try {
|
||||
const assetsDir = join(outDir, '_app/immutable/assets')
|
||||
|
||||
const assetFiles = await readdir(assetsDir)
|
||||
const fontFiles = assetFiles.filter(file => {
|
||||
const lowerFileName = file.toLowerCase()
|
||||
return formats.some(format => lowerFileName.endsWith(`.${format}`)) &&
|
||||
fontNames.some(name => lowerFileName.includes(name.toLowerCase()))
|
||||
})
|
||||
|
||||
if (fontFiles.length === 0) return
|
||||
|
||||
console.log('Found fonts to preload:', fontFiles)
|
||||
|
||||
const preloadLinks = fontFiles.map(fontFile => {
|
||||
const format = fontFile.split('.').pop()
|
||||
return `\t<link rel="preload" href="/_app/immutable/assets/${fontFile}" as="font" type="font/${format}" crossorigin>`
|
||||
}).join('\n')
|
||||
|
||||
const htmlPath = join(outDir, '/index.html')
|
||||
|
||||
try {
|
||||
const html = /** @type {string} */ (await readFile(htmlPath, 'utf-8'))
|
||||
|
||||
const headPattern = '</head>'
|
||||
const replacement = `${preloadLinks}\n${headPattern}`
|
||||
|
||||
const updated = html.replace(headPattern, replacement)
|
||||
|
||||
if (updated !== html) {
|
||||
await writeFile(htmlPath, updated, 'utf-8')
|
||||
console.log(`Added font preload links to ${htmlPath}`)
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(`Could not process ${htmlPath}:`, error)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error injecting font preloads:', error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** @type {import('@sveltejs/kit').Config} */
|
||||
const config = {
|
||||
onwarn: (warning, handler) => {
|
||||
|
|
@ -12,7 +76,11 @@ const config = {
|
|||
},
|
||||
preprocess: vitePreprocess({}),
|
||||
kit: {
|
||||
adapter: adapter({ fallback: 'index.html' }),
|
||||
adapter: adapterWithFontPreload({
|
||||
fallback: 'index.html',
|
||||
fontNames: ['nunito-latin-wght'],
|
||||
formats: ['woff2', 'woff']
|
||||
}),
|
||||
version: {
|
||||
name: process.env.npm_package_version
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue