mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-07-05 00:54:46 +02:00
Compare commits
5 Commits
copilot/su
...
copilot/mi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b697c419a7 | ||
|
|
c87fb96195 | ||
|
|
e5f1af9606 | ||
|
|
d5256a290f | ||
|
|
d1d50d19e0 |
@@ -110,10 +110,10 @@ port: 3000
|
||||
# Changes how the server interpret the origin IP of the request.
|
||||
#
|
||||
# Any format supported by Fastify is accepted.
|
||||
# Default: do not trust any proxies (i.e. trustProxy: false)
|
||||
# Default: trust all proxies (i.e. trustProxy: true)
|
||||
# See: https://fastify.dev/docs/latest/reference/server/#trustproxy
|
||||
#
|
||||
# trustProxy: false
|
||||
# trustProxy: 1
|
||||
|
||||
# ┌──────────────────────────┐
|
||||
#───┘ PostgreSQL configuration └────────────────────────────────
|
||||
|
||||
87
.github/workflows/get-backend-memory.yml
vendored
87
.github/workflows/get-backend-memory.yml
vendored
@@ -1,87 +0,0 @@
|
||||
# this name is used in report-backend-memory.yml so be careful when change name
|
||||
name: Get backend memory usage
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
paths:
|
||||
- packages/backend/**
|
||||
- packages/misskey-js/**
|
||||
- .github/workflows/get-backend-memory.yml
|
||||
|
||||
jobs:
|
||||
get-memory-usage:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
memory-json-name: [memory-base.json, memory-head.json]
|
||||
include:
|
||||
- memory-json-name: memory-base.json
|
||||
ref: ${{ github.base_ref }}
|
||||
- memory-json-name: memory-head.json
|
||||
ref: refs/pull/${{ github.event.number }}/merge
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:18
|
||||
ports:
|
||||
- 54312:5432
|
||||
env:
|
||||
POSTGRES_DB: test-misskey
|
||||
POSTGRES_HOST_AUTH_METHOD: trust
|
||||
redis:
|
||||
image: redis:7
|
||||
ports:
|
||||
- 56312:6379
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4.3.0
|
||||
with:
|
||||
ref: ${{ matrix.ref }}
|
||||
submodules: true
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4.2.0
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v4.4.0
|
||||
with:
|
||||
node-version-file: '.node-version'
|
||||
cache: 'pnpm'
|
||||
- run: pnpm i --frozen-lockfile
|
||||
- name: Check pnpm-lock.yaml
|
||||
run: git diff --exit-code pnpm-lock.yaml
|
||||
- name: Copy Configure
|
||||
run: cp .github/misskey/test.yml .config/default.yml
|
||||
- name: Compile Configure
|
||||
run: pnpm compile-config
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
- name: Run migrations
|
||||
run: pnpm --filter backend migrate
|
||||
- name: Measure memory usage
|
||||
run: |
|
||||
# Start the server and measure memory usage
|
||||
node packages/backend/scripts/measure-memory.mjs > ${{ matrix.memory-json-name }}
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: memory-artifact-${{ matrix.memory-json-name }}
|
||||
path: ${{ matrix.memory-json-name }}
|
||||
|
||||
save-pr-number:
|
||||
runs-on: ubuntu-latest
|
||||
permissions: {}
|
||||
steps:
|
||||
- name: Save PR number
|
||||
env:
|
||||
PR_NUMBER: ${{ github.event.number }}
|
||||
run: |
|
||||
echo "$PR_NUMBER" > ./pr_number
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: memory-artifact-pr-number
|
||||
path: pr_number
|
||||
122
.github/workflows/report-backend-memory.yml
vendored
122
.github/workflows/report-backend-memory.yml
vendored
@@ -1,122 +0,0 @@
|
||||
name: Report backend memory
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
types: [completed]
|
||||
workflows:
|
||||
- Get backend memory usage # get-backend-memory.yml
|
||||
|
||||
jobs:
|
||||
compare-memory:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
permissions:
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Download artifact
|
||||
uses: actions/github-script@v7.1.0
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
run_id: context.payload.workflow_run.id,
|
||||
});
|
||||
let matchArtifacts = allArtifacts.data.artifacts.filter((artifact) => {
|
||||
return artifact.name.startsWith("memory-artifact-") || artifact.name == "memory-artifact"
|
||||
});
|
||||
await Promise.all(matchArtifacts.map(async (artifact) => {
|
||||
let download = await github.rest.actions.downloadArtifact({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
artifact_id: artifact.id,
|
||||
archive_format: 'zip',
|
||||
});
|
||||
await fs.promises.writeFile(`${process.env.GITHUB_WORKSPACE}/${artifact.name}.zip`, Buffer.from(download.data));
|
||||
}));
|
||||
- name: Extract all artifacts
|
||||
run: |
|
||||
find . -mindepth 1 -maxdepth 1 -type f -name '*.zip' -exec unzip {} -d artifacts ';'
|
||||
ls -la artifacts/
|
||||
- name: Load PR Number
|
||||
id: load-pr-num
|
||||
run: echo "pr-number=$(cat artifacts/pr_number)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Output base
|
||||
run: cat ./artifacts/memory-base.json
|
||||
- name: Output head
|
||||
run: cat ./artifacts/memory-head.json
|
||||
- name: Compare memory usage
|
||||
id: compare
|
||||
run: |
|
||||
BASE_MEMORY=$(cat ./artifacts/memory-base.json)
|
||||
HEAD_MEMORY=$(cat ./artifacts/memory-head.json)
|
||||
|
||||
BASE_RSS=$(echo "$BASE_MEMORY" | jq -r '.memory.rss // 0')
|
||||
HEAD_RSS=$(echo "$HEAD_MEMORY" | jq -r '.memory.rss // 0')
|
||||
|
||||
# Calculate difference
|
||||
if [ "$BASE_RSS" -gt 0 ] && [ "$HEAD_RSS" -gt 0 ]; then
|
||||
DIFF=$((HEAD_RSS - BASE_RSS))
|
||||
DIFF_PERCENT=$(echo "scale=2; ($DIFF * 100) / $BASE_RSS" | bc)
|
||||
|
||||
# Convert to MB for readability
|
||||
BASE_MB=$(echo "scale=2; $BASE_RSS / 1048576" | bc)
|
||||
HEAD_MB=$(echo "scale=2; $HEAD_RSS / 1048576" | bc)
|
||||
DIFF_MB=$(echo "scale=2; $DIFF / 1048576" | bc)
|
||||
|
||||
echo "base_mb=$BASE_MB" >> "$GITHUB_OUTPUT"
|
||||
echo "head_mb=$HEAD_MB" >> "$GITHUB_OUTPUT"
|
||||
echo "diff_mb=$DIFF_MB" >> "$GITHUB_OUTPUT"
|
||||
echo "diff_percent=$DIFF_PERCENT" >> "$GITHUB_OUTPUT"
|
||||
echo "has_data=true" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# Determine if this is a significant change (more than 5% increase)
|
||||
if [ "$(echo "$DIFF_PERCENT > 5" | bc)" -eq 1 ]; then
|
||||
echo "significant_increase=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "significant_increase=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
else
|
||||
echo "has_data=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
- id: build-comment
|
||||
name: Build memory comment
|
||||
run: |
|
||||
HEADER="## Backend Memory Usage Comparison"
|
||||
FOOTER="[See workflow logs for details](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})"
|
||||
|
||||
echo "$HEADER" > ./output.md
|
||||
echo >> ./output.md
|
||||
|
||||
if [ "${{ steps.compare.outputs.has_data }}" == "true" ]; then
|
||||
echo "| Metric | base | head | Diff |" >> ./output.md
|
||||
echo "|--------|------|------|------|" >> ./output.md
|
||||
echo "| RSS | ${{ steps.compare.outputs.base_mb }} MB | ${{ steps.compare.outputs.head_mb }} MB | ${{ steps.compare.outputs.diff_mb }} MB (${{ steps.compare.outputs.diff_percent }}%) |" >> ./output.md
|
||||
echo >> ./output.md
|
||||
|
||||
if [ "${{ steps.compare.outputs.significant_increase }}" == "true" ]; then
|
||||
echo "⚠️ **Warning**: Memory usage has increased by more than 5%. Please verify this is not an unintended change." >> ./output.md
|
||||
echo >> ./output.md
|
||||
fi
|
||||
else
|
||||
echo "Could not retrieve memory usage data." >> ./output.md
|
||||
echo >> ./output.md
|
||||
fi
|
||||
|
||||
echo "$FOOTER" >> ./output.md
|
||||
- uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
pr_number: ${{ steps.load-pr-num.outputs.pr-number }}
|
||||
comment_tag: show_memory_diff
|
||||
filePath: ./output.md
|
||||
- name: Tell error to PR
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
if: failure() && steps.load-pr-num.outputs.pr-number
|
||||
with:
|
||||
pr_number: ${{ steps.load-pr-num.outputs.pr-number }}
|
||||
comment_tag: show_memory_diff_error
|
||||
message: |
|
||||
An error occurred while comparing backend memory usage. See [workflow logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.
|
||||
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@@ -3,7 +3,6 @@
|
||||
"**/node_modules": true
|
||||
},
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"typescript.enablePromptUseWorkspaceTsdk": true,
|
||||
"files.associations": {
|
||||
"*.test.ts": "typescript"
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## 2025.12.0
|
||||
## 2025.11.2
|
||||
|
||||
### General
|
||||
-
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
<a href="https://www.patreon.com/syuilo">
|
||||
<img src="https://custom-icon-badges.herokuapp.com/badge/become_a-patron-F96854?logoColor=F96854&style=for-the-badge&logo=patreon&labelColor=363B40" alt="become a patron"/></a>
|
||||
|
||||
[](https://deepwiki.com/misskey-dev/misskey)
|
||||
|
||||
</div>
|
||||
|
||||
## Thanks
|
||||
|
||||
@@ -319,10 +319,10 @@ remoteUserCaution: "Para el usuario remoto, la información está incompleta"
|
||||
activity: "Actividad"
|
||||
images: "Imágenes"
|
||||
image: "Imágenes"
|
||||
birthday: "Cumpleaños"
|
||||
birthday: "Fecha de nacimiento"
|
||||
yearsOld: "{age} años"
|
||||
registeredDate: "Fecha de registro"
|
||||
location: "Ubicación"
|
||||
location: "Lugar"
|
||||
theme: "Tema"
|
||||
themeForLightMode: "Tema para usar en Modo Linterna"
|
||||
themeForDarkMode: "Tema para usar en Modo Oscuro"
|
||||
@@ -579,7 +579,7 @@ objectStorageSetPublicRead: "Seleccionar \"public-read\" al subir "
|
||||
s3ForcePathStyleDesc: "Si s3ForcePathStyle esta habilitado el nombre del bucket debe ser especificado como parte de la URL en lugar del nombre de host en la URL. Puede ser necesario activar esta opción cuando se utilice, por ejemplo, Minio en un servidor propio."
|
||||
serverLogs: "Registros del servidor"
|
||||
deleteAll: "Eliminar todos"
|
||||
showFixedPostForm: "Visualizar la ventana de publicación en la parte superior de la línea de tiempo."
|
||||
showFixedPostForm: "Mostrar el formulario de las entradas encima de la línea de tiempo"
|
||||
showFixedPostFormInChannel: "Mostrar el formulario de publicación por encima de la cronología (Canales)"
|
||||
withRepliesByDefaultForNewlyFollowed: "Incluir por defecto respuestas de usuarios recién seguidos en la línea de tiempo"
|
||||
newNoteRecived: "Tienes una nota nueva"
|
||||
@@ -844,7 +844,7 @@ jumpToSpecifiedDate: "Saltar a una fecha específica"
|
||||
showingPastTimeline: "Mostrar líneas de tiempo antiguas"
|
||||
clear: "Limpiar"
|
||||
markAllAsRead: "Marcar todo como leído"
|
||||
goBack: "Anterior"
|
||||
goBack: "Deseleccionar"
|
||||
unlikeConfirm: "¿Quitar como favorito?"
|
||||
fullView: "Vista completa"
|
||||
quitFullView: "quitar vista completa"
|
||||
@@ -1511,7 +1511,7 @@ _emojiPalette:
|
||||
palettes: "Paleta\n"
|
||||
enableSyncBetweenDevicesForPalettes: "Activar la sincronización de paletas entre dispositivos"
|
||||
paletteForMain: "Paleta principal"
|
||||
paletteForReaction: "Paleta utilizada para las reacciones"
|
||||
paletteForReaction: "Paleta de reacción"
|
||||
_settings:
|
||||
driveBanner: "Puedes gestionar y configurar la unidad, comprobar su uso y configurar los ajustes de carga de archivos."
|
||||
pluginBanner: "Puedes ampliar las funciones del cliente con plugins. Puedes instalar plugins, configurarlos y gestionarlos individualmente."
|
||||
@@ -1523,7 +1523,7 @@ _settings:
|
||||
accountData: "Datos de la cuenta"
|
||||
accountDataBanner: "Exportación e importación para gestionar los datos de la cuenta."
|
||||
muteAndBlockBanner: "Puedes configurar y gestionar ajustes para ocultar contenidos y restringir acciones a usuarios específicos."
|
||||
accessibilityBanner: "Puedes personalizar el aspecto y el comportamiento del cliente y configurar los ajustes para optimizar su uso."
|
||||
accessibilityBanner: "Puedes personalizar los visuales y el comportamiento del cliente, y configurar los ajustes para optimizar el uso."
|
||||
privacyBanner: "Puedes configurar opciones relacionadas con la privacidad de la cuenta, como la visibilidad del contenido, la posibilidad de descubrir la cuenta y la aprobación de seguimiento."
|
||||
securityBanner: "Puedes configurar opciones relacionadas con la seguridad de la cuenta, como la contraseña, los métodos de inicio de sesión, las aplicaciones de autenticación y Passkeys."
|
||||
preferencesBanner: "Puedes configurar el comportamiento general del cliente según tus preferencias."
|
||||
@@ -1540,7 +1540,7 @@ _settings:
|
||||
ifOff: "Si está desactivado"
|
||||
enableSyncThemesBetweenDevices: "Sincronizar los temas instalados entre dispositivos."
|
||||
enablePullToRefresh: "Tirar para actualizar"
|
||||
enablePullToRefresh_description: "Si utilizas un ratón, arrastra mientras pulsas la rueda de desplazamiento."
|
||||
enablePullToRefresh_description: "Si utiliza un ratón, arrastre mientras pulsa la rueda de desplazamiento."
|
||||
realtimeMode_description: "Establece una conexión con el servidor y actualiza el contenido en tiempo real. Esto puede aumentar el tráfico y el consumo de memoria."
|
||||
contentsUpdateFrequency: "Frecuencia de adquisición del contenido."
|
||||
contentsUpdateFrequency_description: "Cuanto mayor sea el valor, más se actualiza el contenido, pero disminuye el rendimiento y aumenta el tráfico y el consumo de memoria."
|
||||
@@ -2156,7 +2156,7 @@ _accountDelete:
|
||||
started: "El proceso de eliminación ha comenzado."
|
||||
inProgress: "La eliminación está en proceso."
|
||||
_ad:
|
||||
back: "Anterior"
|
||||
back: "Deseleccionar"
|
||||
reduceFrequencyOfThisAd: "Mostrar menos este anuncio."
|
||||
hide: "No mostrar"
|
||||
timezoneinfo: "El día de la semana está determidado por la zona horaria del servidor."
|
||||
@@ -2610,10 +2610,10 @@ _profile:
|
||||
name: "Nombre"
|
||||
username: "Nombre de usuario"
|
||||
description: "Descripción"
|
||||
youCanIncludeHashtags: "También puedes incluir hashtags en tu biografía"
|
||||
youCanIncludeHashtags: "Puedes añadir hashtags"
|
||||
metadata: "información adicional"
|
||||
metadataEdit: "Editar información adicional"
|
||||
metadataDescription: "Usando esto puedes mostrar campos de información adicionales en tu perfil."
|
||||
metadataDescription: "Muestra la información adicional en el perfil"
|
||||
metadataLabel: "Etiqueta"
|
||||
metadataContent: "Contenido"
|
||||
changeAvatar: "Cambiar avatar"
|
||||
|
||||
@@ -83,8 +83,6 @@ files: "Allegati"
|
||||
download: "Scarica"
|
||||
driveFileDeleteConfirm: "Vuoi davvero eliminare il file \"{name}\", e le Note a cui è stato allegato?"
|
||||
unfollowConfirm: "Vuoi davvero togliere il Following a {name}?"
|
||||
cancelFollowRequestConfirm: "Vuoi annullare la tua richiesta di follow inviata a {name}?"
|
||||
rejectFollowRequestConfirm: "Vuoi rifiutare la richiesta di follow ricevuta da {name}?"
|
||||
exportRequested: "Hai richiesto un'esportazione, e potrebbe volerci tempo. Quando sarà compiuta, il file verrà aggiunto direttamente al Drive."
|
||||
importRequested: "Hai richiesto un'importazione. Potrebbe richiedere un po' di tempo."
|
||||
lists: "Liste"
|
||||
@@ -2352,13 +2350,13 @@ _ago:
|
||||
yearsAgo: "{n} anni fa"
|
||||
invalid: "Niente da visualizzare"
|
||||
_timeIn:
|
||||
seconds: "Tra {n} secondi"
|
||||
minutes: "Tra {n} minuti"
|
||||
hours: "Tra {n} ore"
|
||||
days: "Tra {n} giorni"
|
||||
weeks: "Tra {n} settimane"
|
||||
months: "Tra {n} mesi"
|
||||
years: "Tra {n} anni"
|
||||
seconds: "Dopo {n} secondi"
|
||||
minutes: "Dopo {n} minuti"
|
||||
hours: "Dopo {n} ore"
|
||||
days: "Dopo {n} giorni"
|
||||
weeks: "Dopo {n} settimane"
|
||||
months: "Dopo {n} mesi"
|
||||
years: "Dopo {n} anni"
|
||||
_time:
|
||||
second: "s"
|
||||
minute: "min"
|
||||
|
||||
19
package.json
19
package.json
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"version": "2025.12.0-alpha.1",
|
||||
"version": "2025.11.2-alpha.1",
|
||||
"codename": "nasubi",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/misskey-dev/misskey.git"
|
||||
},
|
||||
"packageManager": "pnpm@10.23.0",
|
||||
"packageManager": "pnpm@10.22.0",
|
||||
"workspaces": [
|
||||
"packages/misskey-js",
|
||||
"packages/i18n",
|
||||
@@ -22,15 +22,15 @@
|
||||
],
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"compile-config": "cd packages/backend && pnpm compile-config",
|
||||
"build-pre": "node ./scripts/build-pre.js",
|
||||
"build-assets": "node ./scripts/build-assets.mjs",
|
||||
"build": "pnpm build-pre && pnpm -r build && pnpm build-assets",
|
||||
"minify-node-modules": "node ./scripts/minify-node-modules.mjs",
|
||||
"build-storybook": "pnpm --filter frontend build-storybook",
|
||||
"build-misskey-js-with-types": "pnpm build-pre && pnpm --filter backend... --filter=!misskey-js build && pnpm --filter backend generate-api-json --no-build && ncp packages/backend/built/api.json packages/misskey-js/generator/api.json && pnpm --filter misskey-js update-autogen-code && pnpm --filter misskey-js build && pnpm --filter misskey-js api",
|
||||
"start": "pnpm check:connect && cd packages/backend && pnpm compile-config && node ./built/boot/entry.js",
|
||||
"start:inspect": "cd packages/backend && pnpm compile-config && node --inspect ./built/boot/entry.js",
|
||||
"start:test": "ncp ./.github/misskey/test.yml ./.config/test.yml && cd packages/backend && cross-env NODE_ENV=test pnpm compile-config && cross-env NODE_ENV=test node ./built/boot/entry.js",
|
||||
"start": "pnpm check:connect && cd packages/backend && node ./built/boot/entry.js",
|
||||
"start:inspect": "cd packages/backend && node --inspect ./built/boot/entry.js",
|
||||
"start:test": "ncp ./.github/misskey/test.yml ./.config/test.yml && cd packages/backend && cross-env NODE_ENV=test node ./built/boot/entry.js",
|
||||
"cli": "cd packages/backend && pnpm cli",
|
||||
"init": "pnpm migrate",
|
||||
"migrate": "cd packages/backend && pnpm migrate",
|
||||
@@ -71,18 +71,19 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "9.39.1",
|
||||
"i18n": "workspace:*",
|
||||
"@misskey-dev/eslint-plugin": "2.2.0",
|
||||
"@types/js-yaml": "4.0.9",
|
||||
"@types/node": "24.10.1",
|
||||
"@typescript-eslint/eslint-plugin": "8.47.0",
|
||||
"@typescript-eslint/parser": "8.47.0",
|
||||
"cross-env": "10.1.0",
|
||||
"cypress": "15.7.0",
|
||||
"cypress": "15.6.0",
|
||||
"eslint": "9.39.1",
|
||||
"globals": "16.5.0",
|
||||
"ncp": "2.0.0",
|
||||
"pnpm": "10.23.0",
|
||||
"start-server-and-test": "2.1.3"
|
||||
"pnpm": "10.22.0",
|
||||
"start-server-and-test": "2.1.2"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@tensorflow/tfjs-core": "4.22.0"
|
||||
|
||||
@@ -3,17 +3,12 @@
|
||||
"jsc": {
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"jsx": true,
|
||||
"dynamicImport": true,
|
||||
"decorators": true
|
||||
},
|
||||
"transform": {
|
||||
"legacyDecorator": true,
|
||||
"decoratorMetadata": true,
|
||||
"react": {
|
||||
"runtime": "automatic",
|
||||
"importSource": "@kitajs/html"
|
||||
}
|
||||
"decoratorMetadata": true
|
||||
},
|
||||
"experimental": {
|
||||
"keepImportAssertions": true
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
(async () => {
|
||||
const msg = document.getElementById('msg');
|
||||
const successText = `\nSuccess Flush! <a href="/">Back to Misskey</a>\n成功しました。<a href="/">Misskeyを開き直してください。</a>`;
|
||||
|
||||
if (!document.cookie) {
|
||||
message('Your site data is fully cleared by your browser.');
|
||||
message(successText);
|
||||
} else {
|
||||
message('Your browser does not support Clear-Site-Data header. Start opportunistic flushing.');
|
||||
try {
|
||||
localStorage.clear();
|
||||
message('localStorage cleared.');
|
||||
|
||||
const idbPromises = ['MisskeyClient', 'keyval-store'].map((name, i, arr) => new Promise((res, rej) => {
|
||||
const delidb = indexedDB.deleteDatabase(name);
|
||||
delidb.onsuccess = () => res(message(`indexedDB "${name}" cleared. (${i + 1}/${arr.length})`));
|
||||
delidb.onerror = e => rej(e)
|
||||
}));
|
||||
|
||||
await Promise.all(idbPromises);
|
||||
|
||||
if (navigator.serviceWorker.controller) {
|
||||
navigator.serviceWorker.controller.postMessage('clear');
|
||||
await navigator.serviceWorker.getRegistrations()
|
||||
.then(registrations => {
|
||||
return Promise.all(registrations.map(registration => registration.unregister()));
|
||||
})
|
||||
.catch(e => { throw new Error(e) });
|
||||
}
|
||||
|
||||
message(successText);
|
||||
} catch (e) {
|
||||
message(`\n${e}\n\nFlush Failed. <a href="/flush">Please retry.</a>\n失敗しました。<a href="/flush">もう一度試してみてください。</a>`);
|
||||
message(`\nIf you retry more than 3 times, try manually clearing the browser cache or contact to instance admin.\n3回以上試しても失敗する場合、ブラウザのキャッシュを手動で消去し、それでもだめならインスタンス管理者に連絡してみてください。\n`)
|
||||
|
||||
console.error(e);
|
||||
setTimeout(() => {
|
||||
location = '/';
|
||||
}, 10000)
|
||||
}
|
||||
}
|
||||
|
||||
function message(text) {
|
||||
msg.insertAdjacentHTML('beforeend', `<p>[${(new Date()).toString()}] ${text.replace(/\n/g,'<br>')}</p>`)
|
||||
}
|
||||
})();
|
||||
@@ -1,35 +0,0 @@
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-height: 100vh;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
#a {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#banner {
|
||||
background-size: cover;
|
||||
background-position: center center;
|
||||
}
|
||||
|
||||
#title {
|
||||
display: inline-block;
|
||||
margin: 24px;
|
||||
padding: 0.5em 0.8em;
|
||||
color: #fff;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
font-weight: bold;
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
#content {
|
||||
overflow: auto;
|
||||
color: #353c3e;
|
||||
}
|
||||
|
||||
#description {
|
||||
margin: 24px;
|
||||
}
|
||||
@@ -205,7 +205,7 @@ module.exports = {
|
||||
// Whether to use watchman for file crawling
|
||||
// watchman: true,
|
||||
|
||||
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
||||
extensionsToTreatAsEsm: ['.ts'],
|
||||
|
||||
testTimeout: 60000,
|
||||
|
||||
|
||||
13
packages/backend/jsconfig.json
Normal file
13
packages/backend/jsconfig.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"jspm_packages",
|
||||
"tmp",
|
||||
"temp"
|
||||
]
|
||||
}
|
||||
@@ -3,7 +3,8 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { compiledConfigFilePath } from '../../built/config.js';
|
||||
import { path as configYamlPath } from '../../built/config.js';
|
||||
import * as yaml from 'js-yaml';
|
||||
import fs from "node:fs";
|
||||
|
||||
export function isConcurrentIndexMigrationEnabled() {
|
||||
@@ -13,7 +14,7 @@ export function isConcurrentIndexMigrationEnabled() {
|
||||
let loadedConfigCache = undefined;
|
||||
|
||||
function loadConfigInternal() {
|
||||
const config = JSON.parse(fs.readFileSync(compiledConfigFilePath, 'utf-8'));
|
||||
const config = yaml.load(fs.readFileSync(configYamlPath, 'utf-8'));
|
||||
|
||||
return {
|
||||
disallowExternalApRedirect: Boolean(config.disallowExternalApRedirect ?? false),
|
||||
|
||||
@@ -7,37 +7,36 @@
|
||||
"node": "^22.15.0 || ^24.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "pnpm compile-config && node ./built/boot/entry.js",
|
||||
"start:inspect": "pnpm compile-config && node --inspect ./built/boot/entry.js",
|
||||
"start:test": "cross-env NODE_ENV=test pnpm compile-config && cross-env NODE_ENV=test node ./built/boot/entry.js",
|
||||
"migrate": "pnpm compile-config && pnpm typeorm migration:run -d ormconfig.js",
|
||||
"revert": "pnpm compile-config && pnpm typeorm migration:revert -d ormconfig.js",
|
||||
"cli": "pnpm compile-config && node ./built/boot/cli.js",
|
||||
"check:connect": "pnpm compile-config && node ./scripts/check_connect.js",
|
||||
"compile-config": "node ./scripts/compile_config.js",
|
||||
"start": "node ./built/boot/entry.js",
|
||||
"start:inspect": "node --inspect ./built/boot/entry.js",
|
||||
"start:test": "cross-env NODE_ENV=test node ./built/boot/entry.js",
|
||||
"migrate": "pnpm typeorm migration:run -d ormconfig.js",
|
||||
"revert": "pnpm typeorm migration:revert -d ormconfig.js",
|
||||
"cli": "node ./built/boot/cli.js",
|
||||
"check:connect": "node ./scripts/check_connect.js",
|
||||
"build": "swc src -d built -D --strip-leading-paths",
|
||||
"build:test": "swc test-server -d built-test -D --config-file test-server/.swcrc --strip-leading-paths",
|
||||
"watch:swc": "swc src -d built -D -w --strip-leading-paths",
|
||||
"build:tsc": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json",
|
||||
"watch": "pnpm compile-config && node ./scripts/watch.mjs",
|
||||
"watch": "node ./scripts/watch.mjs",
|
||||
"restart": "pnpm build && pnpm start",
|
||||
"dev": "pnpm compile-config && node ./scripts/dev.mjs",
|
||||
"dev": "node ./scripts/dev.mjs",
|
||||
"typecheck": "tsc --noEmit && tsc -p test --noEmit && tsc -p test-federation --noEmit",
|
||||
"eslint": "eslint --quiet \"{src,test-federation}/**/*.ts\"",
|
||||
"lint": "pnpm typecheck && pnpm eslint",
|
||||
"jest": "cross-env NODE_ENV=test pnpm compile-config && cross-env NODE_ENV=test node ./jest.js --forceExit --config jest.config.unit.cjs",
|
||||
"jest:e2e": "cross-env NODE_ENV=test pnpm compile-config && cross-env NODE_ENV=test node ./jest.js --forceExit --config jest.config.e2e.cjs",
|
||||
"jest:fed": "pnpm compile-config && node ./jest.js --forceExit --config jest.config.fed.cjs",
|
||||
"jest-and-coverage": "cross-env NODE_ENV=test pnpm compile-config && cross-env NODE_ENV=test node ./jest.js --coverage --forceExit --config jest.config.unit.cjs",
|
||||
"jest-and-coverage:e2e": "cross-env NODE_ENV=test pnpm compile-config && cross-env NODE_ENV=test node ./jest.js --coverage --forceExit --config jest.config.e2e.cjs",
|
||||
"jest-clear": "cross-env NODE_ENV=test pnpm compile-config && cross-env NODE_ENV=test node ./jest.js --clearCache",
|
||||
"jest": "cross-env NODE_ENV=test node ./jest.js --forceExit --config jest.config.unit.cjs",
|
||||
"jest:e2e": "cross-env NODE_ENV=test node ./jest.js --forceExit --config jest.config.e2e.cjs",
|
||||
"jest:fed": "node ./jest.js --forceExit --config jest.config.fed.cjs",
|
||||
"jest-and-coverage": "cross-env NODE_ENV=test node ./jest.js --coverage --forceExit --config jest.config.unit.cjs",
|
||||
"jest-and-coverage:e2e": "cross-env NODE_ENV=test node ./jest.js --coverage --forceExit --config jest.config.e2e.cjs",
|
||||
"jest-clear": "cross-env NODE_ENV=test node ./jest.js --clearCache",
|
||||
"test": "pnpm jest",
|
||||
"test:e2e": "pnpm build && pnpm build:test && pnpm jest:e2e",
|
||||
"test:fed": "pnpm jest:fed",
|
||||
"test-and-coverage": "pnpm jest-and-coverage",
|
||||
"test-and-coverage:e2e": "pnpm build && pnpm build:test && pnpm jest-and-coverage:e2e",
|
||||
"check-migrations": "node scripts/check_migrations_clean.js",
|
||||
"generate-api-json": "pnpm compile-config && node ./scripts/generate_api_json.js"
|
||||
"generate-api-json": "node ./scripts/generate_api_json.js"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@swc/core-android-arm64": "1.3.11",
|
||||
@@ -81,7 +80,7 @@
|
||||
"@fastify/http-proxy": "11.3.0",
|
||||
"@fastify/multipart": "9.3.0",
|
||||
"@fastify/static": "8.3.0",
|
||||
"@kitajs/html": "4.2.11",
|
||||
"@fastify/view": "11.1.1",
|
||||
"@misskey-dev/sharp-read-bmp": "1.2.0",
|
||||
"@misskey-dev/summaly": "5.2.5",
|
||||
"@napi-rs/canvas": "0.1.82",
|
||||
@@ -124,17 +123,18 @@
|
||||
"got": "14.6.4",
|
||||
"hpagent": "1.2.0",
|
||||
"http-link-header": "1.1.3",
|
||||
"i18n": "workspace:*",
|
||||
"ioredis": "5.8.2",
|
||||
"ip-cidr": "4.0.2",
|
||||
"ipaddr.js": "2.2.0",
|
||||
"is-svg": "6.1.0",
|
||||
"js-yaml": "4.1.1",
|
||||
"json5": "2.2.3",
|
||||
"jsonld": "9.0.0",
|
||||
"jsrsasign": "11.1.0",
|
||||
"juice": "11.0.3",
|
||||
"meilisearch": "0.54.0",
|
||||
"mfm-js": "0.25.0",
|
||||
"microformats-parser": "2.0.4",
|
||||
"mime-types": "3.0.2",
|
||||
"misskey-js": "workspace:*",
|
||||
"misskey-reversi": "workspace:*",
|
||||
@@ -154,6 +154,7 @@
|
||||
"pkce-challenge": "5.0.0",
|
||||
"probe-image-size": "7.2.3",
|
||||
"promise-limit": "2.7.0",
|
||||
"pug": "3.0.3",
|
||||
"qrcode": "1.5.4",
|
||||
"random-seed": "0.3.0",
|
||||
"ratelimiter": "3.4.1",
|
||||
@@ -185,7 +186,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "29.7.0",
|
||||
"@kitajs/ts-html-plugin": "4.1.3",
|
||||
"@nestjs/platform-express": "11.1.9",
|
||||
"@sentry/vue": "10.26.0",
|
||||
"@simplewebauthn/types": "12.0.0",
|
||||
@@ -198,6 +198,7 @@
|
||||
"@types/fluent-ffmpeg": "2.1.28",
|
||||
"@types/http-link-header": "1.0.7",
|
||||
"@types/jest": "29.5.14",
|
||||
"@types/js-yaml": "4.0.9",
|
||||
"@types/jsonld": "1.5.15",
|
||||
"@types/jsrsasign": "10.5.15",
|
||||
"@types/mime-types": "3.0.1",
|
||||
@@ -208,6 +209,7 @@
|
||||
"@types/oauth2orize": "1.11.5",
|
||||
"@types/oauth2orize-pkce": "0.1.2",
|
||||
"@types/pg": "8.15.6",
|
||||
"@types/pug": "2.0.10",
|
||||
"@types/qrcode": "1.5.6",
|
||||
"@types/random-seed": "0.3.5",
|
||||
"@types/ratelimiter": "3.4.6",
|
||||
@@ -232,11 +234,9 @@
|
||||
"jest": "29.7.0",
|
||||
"jest-mock": "29.7.0",
|
||||
"jest-util": "29.7.0",
|
||||
"js-yaml": "4.1.1",
|
||||
"nodemon": "3.1.11",
|
||||
"pid-port": "2.0.0",
|
||||
"simple-oauth2": "5.1.0",
|
||||
"supertest": "7.1.4",
|
||||
"vite": "7.2.4"
|
||||
"supertest": "7.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
/**
|
||||
* YAMLファイルをJSONファイルに変換するスクリプト
|
||||
* ビルド前に実行し、ランタイムにjs-yamlを含まないようにする
|
||||
*/
|
||||
|
||||
import fs from 'node:fs';
|
||||
import { resolve, dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import yaml from 'js-yaml';
|
||||
|
||||
const _filename = fileURLToPath(import.meta.url);
|
||||
const _dirname = dirname(_filename);
|
||||
|
||||
const configDir = resolve(_dirname, '../../../.config');
|
||||
const OUTPUT_PATH = resolve(configDir, '.config.json');
|
||||
|
||||
// TODO: yamlのパースに失敗したときのエラーハンドリング
|
||||
|
||||
/**
|
||||
* YAMLファイルをJSONファイルに変換
|
||||
* @param {string} ymlPath - YAMLファイルのパス
|
||||
*/
|
||||
function yamlToJson(ymlPath) {
|
||||
if (!fs.existsSync(ymlPath)) {
|
||||
console.log(`skipped: ${ymlPath} is not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
const yamlContent = fs.readFileSync(ymlPath, 'utf-8');
|
||||
const jsonContent = yaml.load(yamlContent);
|
||||
fs.writeFileSync(OUTPUT_PATH, JSON.stringify({
|
||||
'_NOTE_': 'This file is auto-generated from YAML file. DO NOT EDIT.',
|
||||
...jsonContent,
|
||||
}), 'utf-8');
|
||||
console.log(`✓ ${ymlPath} → ${OUTPUT_PATH}`);
|
||||
}
|
||||
|
||||
if (process.env.MISSKEY_CONFIG_YML) {
|
||||
const customYmlPath = resolve(configDir, process.env.MISSKEY_CONFIG_YML);
|
||||
yamlToJson(customYmlPath);
|
||||
} else {
|
||||
yamlToJson(resolve(configDir, process.env.NODE_ENV === 'test' ? 'test.yml' : 'default.yml'));
|
||||
}
|
||||
|
||||
console.log('Configuration compiled');
|
||||
@@ -42,7 +42,7 @@ async function killProc() {
|
||||
'./node_modules/nodemon/bin/nodemon.js',
|
||||
[
|
||||
'-w', 'src',
|
||||
'-e', 'ts,js,mjs,cjs,tsx,json,pug',
|
||||
'-e', 'ts,js,mjs,cjs,json,pug',
|
||||
'--exec', 'pnpm', 'run', 'build',
|
||||
],
|
||||
{
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
/**
|
||||
* This script starts the Misskey backend server, waits for it to be ready,
|
||||
* measures memory usage, and outputs the result as JSON.
|
||||
*
|
||||
* Usage: node scripts/measure-memory.mjs
|
||||
*/
|
||||
|
||||
import { fork } from 'node:child_process';
|
||||
import { setTimeout } from 'node:timers/promises';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { dirname, join } from 'node:path';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const STARTUP_TIMEOUT = 120000; // 120 seconds timeout for server startup
|
||||
const MEMORY_SETTLE_TIME = 10000; // Wait 10 seconds after startup for memory to settle
|
||||
|
||||
async function measureMemory() {
|
||||
const startTime = Date.now();
|
||||
|
||||
// Start the Misskey backend server using fork to enable IPC
|
||||
const serverProcess = fork(join(__dirname, '../built/boot/entry.js'), [], {
|
||||
cwd: join(__dirname, '..'),
|
||||
env: {
|
||||
...process.env,
|
||||
NODE_ENV: 'test',
|
||||
},
|
||||
stdio: ['pipe', 'pipe', 'pipe', 'ipc'],
|
||||
});
|
||||
|
||||
let serverReady = false;
|
||||
|
||||
// Listen for the 'ok' message from the server indicating it's ready
|
||||
serverProcess.on('message', (message) => {
|
||||
if (message === 'ok') {
|
||||
serverReady = true;
|
||||
}
|
||||
});
|
||||
|
||||
// Handle server output
|
||||
serverProcess.stdout?.on('data', (data) => {
|
||||
process.stderr.write(`[server stdout] ${data}`);
|
||||
});
|
||||
|
||||
serverProcess.stderr?.on('data', (data) => {
|
||||
process.stderr.write(`[server stderr] ${data}`);
|
||||
});
|
||||
|
||||
// Handle server error
|
||||
serverProcess.on('error', (err) => {
|
||||
process.stderr.write(`[server error] ${err}\n`);
|
||||
});
|
||||
|
||||
// Wait for server to be ready or timeout
|
||||
const startupStartTime = Date.now();
|
||||
while (!serverReady) {
|
||||
if (Date.now() - startupStartTime > STARTUP_TIMEOUT) {
|
||||
serverProcess.kill('SIGTERM');
|
||||
throw new Error('Server startup timeout');
|
||||
}
|
||||
await setTimeout(100);
|
||||
}
|
||||
|
||||
const startupTime = Date.now() - startupStartTime;
|
||||
process.stderr.write(`Server started in ${startupTime}ms\n`);
|
||||
|
||||
// Wait for memory to settle
|
||||
await setTimeout(MEMORY_SETTLE_TIME);
|
||||
|
||||
// Get memory usage from the server process via /proc
|
||||
const pid = serverProcess.pid;
|
||||
let memoryInfo;
|
||||
|
||||
try {
|
||||
const fs = await import('node:fs/promises');
|
||||
|
||||
// Read /proc/[pid]/status for detailed memory info
|
||||
const status = await fs.readFile(`/proc/${pid}/status`, 'utf-8');
|
||||
const vmRssMatch = status.match(/VmRSS:\s+(\d+)\s+kB/);
|
||||
const vmDataMatch = status.match(/VmData:\s+(\d+)\s+kB/);
|
||||
const vmSizeMatch = status.match(/VmSize:\s+(\d+)\s+kB/);
|
||||
|
||||
memoryInfo = {
|
||||
rss: vmRssMatch ? parseInt(vmRssMatch[1], 10) * 1024 : null,
|
||||
heapUsed: vmDataMatch ? parseInt(vmDataMatch[1], 10) * 1024 : null,
|
||||
vmSize: vmSizeMatch ? parseInt(vmSizeMatch[1], 10) * 1024 : null,
|
||||
};
|
||||
} catch (err) {
|
||||
// Fallback: use ps command
|
||||
process.stderr.write(`Warning: Could not read /proc/${pid}/status: ${err}\n`);
|
||||
|
||||
const { execSync } = await import('node:child_process');
|
||||
try {
|
||||
const ps = execSync(`ps -o rss= -p ${pid}`, { encoding: 'utf-8' });
|
||||
const rssKb = parseInt(ps.trim(), 10);
|
||||
memoryInfo = {
|
||||
rss: rssKb * 1024,
|
||||
heapUsed: null,
|
||||
vmSize: null,
|
||||
};
|
||||
} catch {
|
||||
memoryInfo = {
|
||||
rss: null,
|
||||
heapUsed: null,
|
||||
vmSize: null,
|
||||
error: 'Could not measure memory',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Stop the server
|
||||
serverProcess.kill('SIGTERM');
|
||||
|
||||
// Wait for process to exit
|
||||
let exited = false;
|
||||
await new Promise((resolve) => {
|
||||
serverProcess.on('exit', () => {
|
||||
exited = true;
|
||||
resolve(undefined);
|
||||
});
|
||||
// Force kill after 10 seconds if not exited
|
||||
setTimeout(10000).then(() => {
|
||||
if (!exited) {
|
||||
serverProcess.kill('SIGKILL');
|
||||
}
|
||||
resolve(undefined);
|
||||
});
|
||||
});
|
||||
|
||||
const result = {
|
||||
timestamp: new Date().toISOString(),
|
||||
startupTimeMs: startupTime,
|
||||
memory: memoryInfo,
|
||||
};
|
||||
|
||||
// Output as JSON to stdout
|
||||
console.log(JSON.stringify(result, null, 2));
|
||||
}
|
||||
|
||||
measureMemory().catch((err) => {
|
||||
console.error(JSON.stringify({
|
||||
error: err.message,
|
||||
timestamp: new Date().toISOString(),
|
||||
}));
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -6,11 +6,11 @@
|
||||
import * as fs from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { dirname, resolve } from 'node:path';
|
||||
import * as yaml from 'js-yaml';
|
||||
import { type FastifyServerOptions } from 'fastify';
|
||||
import type * as Sentry from '@sentry/node';
|
||||
import type * as SentryVue from '@sentry/vue';
|
||||
import type { RedisOptions } from 'ioredis';
|
||||
import type { ManifestChunk } from 'vite';
|
||||
|
||||
type RedisOptionsSource = Partial<RedisOptions> & {
|
||||
host: string;
|
||||
@@ -187,9 +187,9 @@ export type Config = {
|
||||
authUrl: string;
|
||||
driveUrl: string;
|
||||
userAgent: string;
|
||||
frontendEntry: ManifestChunk;
|
||||
frontendEntry: { file: string | null };
|
||||
frontendManifestExists: boolean;
|
||||
frontendEmbedEntry: ManifestChunk;
|
||||
frontendEmbedEntry: { file: string | null };
|
||||
frontendEmbedManifestExists: boolean;
|
||||
mediaProxy: string;
|
||||
externalMediaProxyEnabled: boolean;
|
||||
@@ -217,15 +217,21 @@ export type FulltextSearchProvider = 'sqlLike' | 'sqlPgroonga' | 'meilisearch';
|
||||
const _filename = fileURLToPath(import.meta.url);
|
||||
const _dirname = dirname(_filename);
|
||||
|
||||
const configDir = `${_dirname}/../../../.config`;
|
||||
/**
|
||||
* Path of configuration directory
|
||||
*/
|
||||
const dir = `${_dirname}/../../../.config`;
|
||||
|
||||
export const compiledConfigFilePath = resolve(configDir, '.config.json');
|
||||
/**
|
||||
* Path of configuration file
|
||||
*/
|
||||
export const path = process.env.MISSKEY_CONFIG_YML
|
||||
? resolve(dir, process.env.MISSKEY_CONFIG_YML)
|
||||
: process.env.NODE_ENV === 'test'
|
||||
? resolve(dir, 'test.yml')
|
||||
: resolve(dir, 'default.yml');
|
||||
|
||||
export function loadConfig(): Config {
|
||||
if (!fs.existsSync(compiledConfigFilePath)) {
|
||||
throw new Error('Compiled configuration file not found. Try running \'pnpm compile-config\'.');
|
||||
}
|
||||
|
||||
const meta = JSON.parse(fs.readFileSync(`${_dirname}/../../../built/meta.json`, 'utf-8'));
|
||||
|
||||
const frontendManifestExists = fs.existsSync(_dirname + '/../../../built/_frontend_vite_/manifest.json');
|
||||
@@ -237,7 +243,7 @@ export function loadConfig(): Config {
|
||||
JSON.parse(fs.readFileSync(`${_dirname}/../../../built/_frontend_embed_vite_/manifest.json`, 'utf-8'))
|
||||
: { 'src/boot.ts': { file: null } };
|
||||
|
||||
const config = JSON.parse(fs.readFileSync(compiledConfigFilePath, 'utf-8')) as Source;
|
||||
const config = yaml.load(fs.readFileSync(path, 'utf-8')) as Source;
|
||||
|
||||
const url = tryCreateUrl(config.url ?? process.env.MISSKEY_URL ?? '');
|
||||
const version = meta.version;
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
const ESCAPE_LOOKUP = {
|
||||
'&': '\\u0026',
|
||||
'>': '\\u003e',
|
||||
'<': '\\u003c',
|
||||
'\u2028': '\\u2028',
|
||||
'\u2029': '\\u2029',
|
||||
} as Record<string, string>;
|
||||
|
||||
const ESCAPE_REGEX = /[&><\u2028\u2029]/g;
|
||||
|
||||
export function htmlSafeJsonStringify(obj: any): string {
|
||||
return JSON.stringify(obj).replace(ESCAPE_REGEX, x => ESCAPE_LOOKUP[x]);
|
||||
}
|
||||
@@ -25,7 +25,6 @@ import { SignupApiService } from './api/SignupApiService.js';
|
||||
import { StreamingApiServerService } from './api/StreamingApiServerService.js';
|
||||
import { OpenApiServerService } from './api/openapi/OpenApiServerService.js';
|
||||
import { ClientServerService } from './web/ClientServerService.js';
|
||||
import { HtmlTemplateService } from './web/HtmlTemplateService.js';
|
||||
import { FeedService } from './web/FeedService.js';
|
||||
import { UrlPreviewService } from './web/UrlPreviewService.js';
|
||||
import { ClientLoggerService } from './web/ClientLoggerService.js';
|
||||
@@ -59,7 +58,6 @@ import { SigninWithPasskeyApiService } from './api/SigninWithPasskeyApiService.j
|
||||
providers: [
|
||||
ClientServerService,
|
||||
ClientLoggerService,
|
||||
HtmlTemplateService,
|
||||
FeedService,
|
||||
HealthServerService,
|
||||
UrlPreviewService,
|
||||
|
||||
@@ -75,7 +75,7 @@ export class ServerService implements OnApplicationShutdown {
|
||||
@bindThis
|
||||
public async launch(): Promise<void> {
|
||||
const fastify = Fastify({
|
||||
trustProxy: this.config.trustProxy ?? false,
|
||||
trustProxy: this.config.trustProxy ?? true,
|
||||
logger: false,
|
||||
});
|
||||
this.#fastify = fastify;
|
||||
|
||||
@@ -12,9 +12,12 @@ import ipaddr from 'ipaddr.js';
|
||||
import oauth2orize, { type OAuth2, AuthorizationError, ValidateFunctionArity2, OAuth2Req, MiddlewareRequest } from 'oauth2orize';
|
||||
import oauth2Pkce from 'oauth2orize-pkce';
|
||||
import fastifyCors from '@fastify/cors';
|
||||
import fastifyView from '@fastify/view';
|
||||
import pug from 'pug';
|
||||
import bodyParser from 'body-parser';
|
||||
import fastifyExpress from '@fastify/express';
|
||||
import { verifyChallenge } from 'pkce-challenge';
|
||||
import { mf2 } from 'microformats-parser';
|
||||
import { permissions as kinds } from 'misskey-js';
|
||||
import { secureRndstr } from '@/misc/secure-rndstr.js';
|
||||
import { HttpRequestService } from '@/core/HttpRequestService.js';
|
||||
@@ -29,8 +32,6 @@ import { MemoryKVCache } from '@/misc/cache.js';
|
||||
import { LoggerService } from '@/core/LoggerService.js';
|
||||
import Logger from '@/logger.js';
|
||||
import { StatusError } from '@/misc/status-error.js';
|
||||
import { HtmlTemplateService } from '@/server/web/HtmlTemplateService.js';
|
||||
import { OAuthPage } from '@/server/web/views/oauth.js';
|
||||
import type { ServerResponse } from 'node:http';
|
||||
import type { FastifyInstance } from 'fastify';
|
||||
|
||||
@@ -97,32 +98,6 @@ interface ClientInformation {
|
||||
logo: string | null;
|
||||
}
|
||||
|
||||
function parseMicroformats(doc: htmlParser.HTMLElement, baseUrl: string, id: string): { name: string | null; logo: string | null; } {
|
||||
let name: string | null = null;
|
||||
let logo: string | null = null;
|
||||
|
||||
const hApp = doc.querySelector('.h-app');
|
||||
if (hApp == null) return { name, logo };
|
||||
|
||||
const nameEl = hApp.querySelector('.p-name');
|
||||
if (nameEl != null) {
|
||||
const href = nameEl.attributes.href || nameEl.attributes.src;
|
||||
if (href != null && new URL(href, baseUrl).toString() === new URL(id).toString()) {
|
||||
name = nameEl.textContent.trim();
|
||||
}
|
||||
}
|
||||
|
||||
const logoEl = hApp.querySelector('.u-logo');
|
||||
if (logoEl != null) {
|
||||
const href = logoEl.attributes.href || logoEl.attributes.src;
|
||||
if (href != null) {
|
||||
logo = new URL(href, baseUrl).toString();
|
||||
}
|
||||
}
|
||||
|
||||
return { name, logo };
|
||||
}
|
||||
|
||||
// https://indieauth.spec.indieweb.org/#client-information-discovery
|
||||
// "Authorization servers SHOULD support parsing the [h-app] Microformat from the client_id,
|
||||
// and if there is an [h-app] with a url property matching the client_id URL,
|
||||
@@ -145,19 +120,24 @@ async function discoverClientInformation(logger: Logger, httpRequestService: Htt
|
||||
}
|
||||
|
||||
const text = await res.text();
|
||||
const doc = htmlParser.parse(`<div>${text}</div>`);
|
||||
const fragment = htmlParser.parse(`<div>${text}</div>`);
|
||||
|
||||
redirectUris.push(...[...doc.querySelectorAll('link[rel=redirect_uri][href]')].map(el => el.attributes.href));
|
||||
redirectUris.push(...[...fragment.querySelectorAll('link[rel=redirect_uri][href]')].map(el => el.attributes.href));
|
||||
|
||||
let name = id;
|
||||
let logo: string | null = null;
|
||||
if (text) {
|
||||
const microformats = parseMicroformats(doc, res.url, id);
|
||||
if (typeof microformats.name === 'string') {
|
||||
name = microformats.name;
|
||||
}
|
||||
if (typeof microformats.logo === 'string') {
|
||||
logo = microformats.logo;
|
||||
const microformats = mf2(text, { baseUrl: res.url });
|
||||
const correspondingProperties = microformats.items.find(item => item.type?.includes('h-app') && item.properties.url.includes(id));
|
||||
if (correspondingProperties) {
|
||||
const nameProperty = correspondingProperties.properties.name?.[0];
|
||||
if (typeof nameProperty === 'string') {
|
||||
name = nameProperty;
|
||||
}
|
||||
const logoProperty = correspondingProperties.properties.logo?.[0];
|
||||
if (typeof logoProperty === 'string') {
|
||||
logo = logoProperty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,7 +253,6 @@ export class OAuth2ProviderService {
|
||||
private usersRepository: UsersRepository,
|
||||
private cacheService: CacheService,
|
||||
loggerService: LoggerService,
|
||||
private htmlTemplateService: HtmlTemplateService,
|
||||
) {
|
||||
this.#logger = loggerService.getLogger('oauth');
|
||||
|
||||
@@ -407,16 +386,24 @@ export class OAuth2ProviderService {
|
||||
this.#logger.info(`Rendering authorization page for "${oauth2.client.name}"`);
|
||||
|
||||
reply.header('Cache-Control', 'no-store');
|
||||
return await HtmlTemplateService.replyHtml(reply, OAuthPage({
|
||||
...await this.htmlTemplateService.getCommonData(),
|
||||
return await reply.view('oauth', {
|
||||
transactionId: oauth2.transactionID,
|
||||
clientName: oauth2.client.name,
|
||||
clientLogo: oauth2.client.logo ?? undefined,
|
||||
scope: oauth2.req.scope,
|
||||
}));
|
||||
clientLogo: oauth2.client.logo,
|
||||
scope: oauth2.req.scope.join(' '),
|
||||
});
|
||||
});
|
||||
fastify.post('/decision', async () => { });
|
||||
|
||||
fastify.register(fastifyView, {
|
||||
root: fileURLToPath(new URL('../web/views', import.meta.url)),
|
||||
engine: { pug },
|
||||
defaultContext: {
|
||||
version: this.config.version,
|
||||
config: this.config,
|
||||
},
|
||||
});
|
||||
|
||||
await fastify.register(fastifyExpress);
|
||||
fastify.use('/authorize', this.#server.authorize(((areq, done) => {
|
||||
(async (): Promise<Parameters<typeof done>> => {
|
||||
|
||||
@@ -9,16 +9,20 @@ import { fileURLToPath } from 'node:url';
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import ms from 'ms';
|
||||
import sharp from 'sharp';
|
||||
import pug from 'pug';
|
||||
import { In, IsNull } from 'typeorm';
|
||||
import fastifyStatic from '@fastify/static';
|
||||
import fastifyView from '@fastify/view';
|
||||
import fastifyProxy from '@fastify/http-proxy';
|
||||
import vary from 'vary';
|
||||
import type { Config } from '@/config.js';
|
||||
import { getNoteSummary } from '@/misc/get-note-summary.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import * as Acct from '@/misc/acct.js';
|
||||
import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
||||
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
|
||||
import { PageEntityService } from '@/core/entities/PageEntityService.js';
|
||||
import { MetaEntityService } from '@/core/entities/MetaEntityService.js';
|
||||
import { GalleryPostEntityService } from '@/core/entities/GalleryPostEntityService.js';
|
||||
import { ClipEntityService } from '@/core/entities/ClipEntityService.js';
|
||||
import { ChannelEntityService } from '@/core/entities/ChannelEntityService.js';
|
||||
@@ -37,33 +41,14 @@ import type {
|
||||
} from '@/models/_.js';
|
||||
import type Logger from '@/logger.js';
|
||||
import { handleRequestRedirectToOmitSearch } from '@/misc/fastify-hook-handlers.js';
|
||||
import { htmlSafeJsonStringify } from '@/misc/json-stringify-html-safe.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { FlashEntityService } from '@/core/entities/FlashEntityService.js';
|
||||
import { RoleService } from '@/core/RoleService.js';
|
||||
import { ReversiGameEntityService } from '@/core/entities/ReversiGameEntityService.js';
|
||||
import { AnnouncementEntityService } from '@/core/entities/AnnouncementEntityService.js';
|
||||
import { FeedService } from './FeedService.js';
|
||||
import { UrlPreviewService } from './UrlPreviewService.js';
|
||||
import { ClientLoggerService } from './ClientLoggerService.js';
|
||||
import { HtmlTemplateService } from './HtmlTemplateService.js';
|
||||
|
||||
import { BasePage } from './views/base.js';
|
||||
import { UserPage } from './views/user.js';
|
||||
import { NotePage } from './views/note.js';
|
||||
import { PagePage } from './views/page.js';
|
||||
import { ClipPage } from './views/clip.js';
|
||||
import { FlashPage } from './views/flash.js';
|
||||
import { GalleryPostPage } from './views/gallery-post.js';
|
||||
import { ChannelPage } from './views/channel.js';
|
||||
import { ReversiGamePage } from './views/reversi-game.js';
|
||||
import { AnnouncementPage } from './views/announcement.js';
|
||||
import { BaseEmbed } from './views/base-embed.js';
|
||||
import { InfoCardPage } from './views/info-card.js';
|
||||
import { BiosPage } from './views/bios.js';
|
||||
import { CliPage } from './views/cli.js';
|
||||
import { FlushPage } from './views/flush.js';
|
||||
import { ErrorPage } from './views/error.js';
|
||||
|
||||
import type { FastifyError, FastifyInstance, FastifyPluginOptions, FastifyReply } from 'fastify';
|
||||
|
||||
const _filename = fileURLToPath(import.meta.url);
|
||||
@@ -77,6 +62,20 @@ const frontendViteOut = `${_dirname}/../../../../../built/_frontend_vite_/`;
|
||||
const frontendEmbedViteOut = `${_dirname}/../../../../../built/_frontend_embed_vite_/`;
|
||||
const tarball = `${_dirname}/../../../../../built/tarball/`;
|
||||
|
||||
const ESCAPE_LOOKUP = {
|
||||
'&': '\\u0026',
|
||||
'>': '\\u003e',
|
||||
'<': '\\u003c',
|
||||
'\u2028': '\\u2028',
|
||||
'\u2029': '\\u2029',
|
||||
} as Record<string, string>;
|
||||
|
||||
const ESCAPE_REGEX = /[&><\u2028\u2029]/g;
|
||||
|
||||
function htmlSafeJsonStringify(obj: any): string {
|
||||
return JSON.stringify(obj).replace(ESCAPE_REGEX, x => ESCAPE_LOOKUP[x]);
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class ClientServerService {
|
||||
private logger: Logger;
|
||||
@@ -122,6 +121,7 @@ export class ClientServerService {
|
||||
private userEntityService: UserEntityService,
|
||||
private noteEntityService: NoteEntityService,
|
||||
private pageEntityService: PageEntityService,
|
||||
private metaEntityService: MetaEntityService,
|
||||
private galleryPostEntityService: GalleryPostEntityService,
|
||||
private clipEntityService: ClipEntityService,
|
||||
private channelEntityService: ChannelEntityService,
|
||||
@@ -129,7 +129,7 @@ export class ClientServerService {
|
||||
private announcementEntityService: AnnouncementEntityService,
|
||||
private urlPreviewService: UrlPreviewService,
|
||||
private feedService: FeedService,
|
||||
private htmlTemplateService: HtmlTemplateService,
|
||||
private roleService: RoleService,
|
||||
private clientLoggerService: ClientLoggerService,
|
||||
) {
|
||||
//this.createServer = this.createServer.bind(this);
|
||||
@@ -195,10 +195,38 @@ export class ClientServerService {
|
||||
return (manifest);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private async generateCommonPugData(meta: MiMeta) {
|
||||
return {
|
||||
instanceName: meta.name ?? 'Misskey',
|
||||
icon: meta.iconUrl,
|
||||
appleTouchIcon: meta.app512IconUrl,
|
||||
themeColor: meta.themeColor,
|
||||
serverErrorImageUrl: meta.serverErrorImageUrl ?? 'https://xn--931a.moe/assets/error.jpg',
|
||||
infoImageUrl: meta.infoImageUrl ?? 'https://xn--931a.moe/assets/info.jpg',
|
||||
notFoundImageUrl: meta.notFoundImageUrl ?? 'https://xn--931a.moe/assets/not-found.jpg',
|
||||
instanceUrl: this.config.url,
|
||||
metaJson: htmlSafeJsonStringify(await this.metaEntityService.packDetailed(meta)),
|
||||
now: Date.now(),
|
||||
federationEnabled: this.meta.federation !== 'none',
|
||||
};
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public createServer(fastify: FastifyInstance, options: FastifyPluginOptions, done: (err?: Error) => void) {
|
||||
const configUrl = new URL(this.config.url);
|
||||
|
||||
fastify.register(fastifyView, {
|
||||
root: _dirname + '/views',
|
||||
engine: {
|
||||
pug: pug,
|
||||
},
|
||||
defaultContext: {
|
||||
version: this.config.version,
|
||||
config: this.config,
|
||||
},
|
||||
});
|
||||
|
||||
fastify.addHook('onRequest', (request, reply, done) => {
|
||||
// クリックジャッキング防止のためiFrameの中に入れられないようにする
|
||||
reply.header('X-Frame-Options', 'DENY');
|
||||
@@ -399,15 +427,16 @@ export class ClientServerService {
|
||||
|
||||
//#endregion
|
||||
|
||||
const renderBase = async (reply: FastifyReply, data: Partial<Parameters<typeof BasePage>[0]> = {}) => {
|
||||
const renderBase = async (reply: FastifyReply, data: { [key: string]: any } = {}) => {
|
||||
reply.header('Cache-Control', 'public, max-age=30');
|
||||
return await HtmlTemplateService.replyHtml(reply, BasePage({
|
||||
img: this.meta.bannerUrl ?? undefined,
|
||||
return await reply.view('base', {
|
||||
img: this.meta.bannerUrl,
|
||||
url: this.config.url,
|
||||
title: this.meta.name ?? 'Misskey',
|
||||
desc: this.meta.description ?? undefined,
|
||||
...await this.htmlTemplateService.getCommonData(),
|
||||
desc: this.meta.description,
|
||||
...await this.generateCommonPugData(this.meta),
|
||||
...data,
|
||||
}));
|
||||
});
|
||||
};
|
||||
|
||||
// URL preview endpoint
|
||||
@@ -489,6 +518,11 @@ export class ClientServerService {
|
||||
)
|
||||
) {
|
||||
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
|
||||
const me = profile.fields
|
||||
? profile.fields
|
||||
.filter(filed => filed.value != null && filed.value.match(/^https?:/))
|
||||
.map(field => field.value)
|
||||
: [];
|
||||
|
||||
reply.header('Cache-Control', 'public, max-age=15');
|
||||
if (profile.preventAiLearning) {
|
||||
@@ -501,15 +535,15 @@ export class ClientServerService {
|
||||
userProfile: profile,
|
||||
});
|
||||
|
||||
return await HtmlTemplateService.replyHtml(reply, UserPage({
|
||||
user: _user,
|
||||
profile,
|
||||
return await reply.view('user', {
|
||||
user, profile, me,
|
||||
avatarUrl: _user.avatarUrl,
|
||||
sub: request.params.sub,
|
||||
...await this.htmlTemplateService.getCommonData(),
|
||||
clientCtxJson: htmlSafeJsonStringify({
|
||||
...await this.generateCommonPugData(this.meta),
|
||||
clientCtx: htmlSafeJsonStringify({
|
||||
user: _user,
|
||||
}),
|
||||
}));
|
||||
});
|
||||
} else {
|
||||
// リモートユーザーなので
|
||||
// モデレータがAPI経由で参照可能にするために404にはしない
|
||||
@@ -560,14 +594,17 @@ export class ClientServerService {
|
||||
reply.header('X-Robots-Tag', 'noimageai');
|
||||
reply.header('X-Robots-Tag', 'noai');
|
||||
}
|
||||
return await HtmlTemplateService.replyHtml(reply, NotePage({
|
||||
return await reply.view('note', {
|
||||
note: _note,
|
||||
profile,
|
||||
...await this.htmlTemplateService.getCommonData(),
|
||||
clientCtxJson: htmlSafeJsonStringify({
|
||||
avatarUrl: _note.user.avatarUrl,
|
||||
// TODO: Let locale changeable by instance setting
|
||||
summary: getNoteSummary(_note),
|
||||
...await this.generateCommonPugData(this.meta),
|
||||
clientCtx: htmlSafeJsonStringify({
|
||||
note: _note,
|
||||
}),
|
||||
}));
|
||||
});
|
||||
} else {
|
||||
return await renderBase(reply);
|
||||
}
|
||||
@@ -600,11 +637,12 @@ export class ClientServerService {
|
||||
reply.header('X-Robots-Tag', 'noimageai');
|
||||
reply.header('X-Robots-Tag', 'noai');
|
||||
}
|
||||
return await HtmlTemplateService.replyHtml(reply, PagePage({
|
||||
return await reply.view('page', {
|
||||
page: _page,
|
||||
profile,
|
||||
...await this.htmlTemplateService.getCommonData(),
|
||||
}));
|
||||
avatarUrl: _page.user.avatarUrl,
|
||||
...await this.generateCommonPugData(this.meta),
|
||||
});
|
||||
} else {
|
||||
return await renderBase(reply);
|
||||
}
|
||||
@@ -624,11 +662,12 @@ export class ClientServerService {
|
||||
reply.header('X-Robots-Tag', 'noimageai');
|
||||
reply.header('X-Robots-Tag', 'noai');
|
||||
}
|
||||
return await HtmlTemplateService.replyHtml(reply, FlashPage({
|
||||
return await reply.view('flash', {
|
||||
flash: _flash,
|
||||
profile,
|
||||
...await this.htmlTemplateService.getCommonData(),
|
||||
}));
|
||||
avatarUrl: _flash.user.avatarUrl,
|
||||
...await this.generateCommonPugData(this.meta),
|
||||
});
|
||||
} else {
|
||||
return await renderBase(reply);
|
||||
}
|
||||
@@ -648,14 +687,15 @@ export class ClientServerService {
|
||||
reply.header('X-Robots-Tag', 'noimageai');
|
||||
reply.header('X-Robots-Tag', 'noai');
|
||||
}
|
||||
return await HtmlTemplateService.replyHtml(reply, ClipPage({
|
||||
return await reply.view('clip', {
|
||||
clip: _clip,
|
||||
profile,
|
||||
...await this.htmlTemplateService.getCommonData(),
|
||||
clientCtxJson: htmlSafeJsonStringify({
|
||||
avatarUrl: _clip.user.avatarUrl,
|
||||
...await this.generateCommonPugData(this.meta),
|
||||
clientCtx: htmlSafeJsonStringify({
|
||||
clip: _clip,
|
||||
}),
|
||||
}));
|
||||
});
|
||||
} else {
|
||||
return await renderBase(reply);
|
||||
}
|
||||
@@ -673,11 +713,12 @@ export class ClientServerService {
|
||||
reply.header('X-Robots-Tag', 'noimageai');
|
||||
reply.header('X-Robots-Tag', 'noai');
|
||||
}
|
||||
return await HtmlTemplateService.replyHtml(reply, GalleryPostPage({
|
||||
galleryPost: _post,
|
||||
return await reply.view('gallery-post', {
|
||||
post: _post,
|
||||
profile,
|
||||
...await this.htmlTemplateService.getCommonData(),
|
||||
}));
|
||||
avatarUrl: _post.user.avatarUrl,
|
||||
...await this.generateCommonPugData(this.meta),
|
||||
});
|
||||
} else {
|
||||
return await renderBase(reply);
|
||||
}
|
||||
@@ -692,10 +733,10 @@ export class ClientServerService {
|
||||
if (channel) {
|
||||
const _channel = await this.channelEntityService.pack(channel);
|
||||
reply.header('Cache-Control', 'public, max-age=15');
|
||||
return await HtmlTemplateService.replyHtml(reply, ChannelPage({
|
||||
return await reply.view('channel', {
|
||||
channel: _channel,
|
||||
...await this.htmlTemplateService.getCommonData(),
|
||||
}));
|
||||
...await this.generateCommonPugData(this.meta),
|
||||
});
|
||||
} else {
|
||||
return await renderBase(reply);
|
||||
}
|
||||
@@ -710,10 +751,10 @@ export class ClientServerService {
|
||||
if (game) {
|
||||
const _game = await this.reversiGameEntityService.packDetail(game);
|
||||
reply.header('Cache-Control', 'public, max-age=3600');
|
||||
return await HtmlTemplateService.replyHtml(reply, ReversiGamePage({
|
||||
reversiGame: _game,
|
||||
...await this.htmlTemplateService.getCommonData(),
|
||||
}));
|
||||
return await reply.view('reversi-game', {
|
||||
game: _game,
|
||||
...await this.generateCommonPugData(this.meta),
|
||||
});
|
||||
} else {
|
||||
return await renderBase(reply);
|
||||
}
|
||||
@@ -729,10 +770,10 @@ export class ClientServerService {
|
||||
if (announcement) {
|
||||
const _announcement = await this.announcementEntityService.pack(announcement);
|
||||
reply.header('Cache-Control', 'public, max-age=3600');
|
||||
return await HtmlTemplateService.replyHtml(reply, AnnouncementPage({
|
||||
return await reply.view('announcement', {
|
||||
announcement: _announcement,
|
||||
...await this.htmlTemplateService.getCommonData(),
|
||||
}));
|
||||
...await this.generateCommonPugData(this.meta),
|
||||
});
|
||||
} else {
|
||||
return await renderBase(reply);
|
||||
}
|
||||
@@ -765,13 +806,13 @@ export class ClientServerService {
|
||||
const _user = await this.userEntityService.pack(user);
|
||||
|
||||
reply.header('Cache-Control', 'public, max-age=3600');
|
||||
return await HtmlTemplateService.replyHtml(reply, BaseEmbed({
|
||||
return await reply.view('base-embed', {
|
||||
title: this.meta.name ?? 'Misskey',
|
||||
...await this.htmlTemplateService.getCommonData(),
|
||||
embedCtxJson: htmlSafeJsonStringify({
|
||||
...await this.generateCommonPugData(this.meta),
|
||||
embedCtx: htmlSafeJsonStringify({
|
||||
user: _user,
|
||||
}),
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
fastify.get<{ Params: { note: string; } }>('/embed/notes/:note', async (request, reply) => {
|
||||
@@ -791,13 +832,13 @@ export class ClientServerService {
|
||||
const _note = await this.noteEntityService.pack(note, null, { detail: true });
|
||||
|
||||
reply.header('Cache-Control', 'public, max-age=3600');
|
||||
return await HtmlTemplateService.replyHtml(reply, BaseEmbed({
|
||||
return await reply.view('base-embed', {
|
||||
title: this.meta.name ?? 'Misskey',
|
||||
...await this.htmlTemplateService.getCommonData(),
|
||||
embedCtxJson: htmlSafeJsonStringify({
|
||||
...await this.generateCommonPugData(this.meta),
|
||||
embedCtx: htmlSafeJsonStringify({
|
||||
note: _note,
|
||||
}),
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
fastify.get<{ Params: { clip: string; } }>('/embed/clips/:clip', async (request, reply) => {
|
||||
@@ -812,46 +853,48 @@ export class ClientServerService {
|
||||
const _clip = await this.clipEntityService.pack(clip);
|
||||
|
||||
reply.header('Cache-Control', 'public, max-age=3600');
|
||||
return await HtmlTemplateService.replyHtml(reply, BaseEmbed({
|
||||
return await reply.view('base-embed', {
|
||||
title: this.meta.name ?? 'Misskey',
|
||||
...await this.htmlTemplateService.getCommonData(),
|
||||
embedCtxJson: htmlSafeJsonStringify({
|
||||
...await this.generateCommonPugData(this.meta),
|
||||
embedCtx: htmlSafeJsonStringify({
|
||||
clip: _clip,
|
||||
}),
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
fastify.get('/embed/*', async (request, reply) => {
|
||||
reply.removeHeader('X-Frame-Options');
|
||||
|
||||
reply.header('Cache-Control', 'public, max-age=3600');
|
||||
return await HtmlTemplateService.replyHtml(reply, BaseEmbed({
|
||||
return await reply.view('base-embed', {
|
||||
title: this.meta.name ?? 'Misskey',
|
||||
...await this.htmlTemplateService.getCommonData(),
|
||||
}));
|
||||
...await this.generateCommonPugData(this.meta),
|
||||
});
|
||||
});
|
||||
|
||||
fastify.get('/_info_card_', async (request, reply) => {
|
||||
reply.removeHeader('X-Frame-Options');
|
||||
|
||||
return await HtmlTemplateService.replyHtml(reply, InfoCardPage({
|
||||
return await reply.view('info-card', {
|
||||
version: this.config.version,
|
||||
config: this.config,
|
||||
host: this.config.host,
|
||||
meta: this.meta,
|
||||
}));
|
||||
originalUsersCount: await this.usersRepository.countBy({ host: IsNull() }),
|
||||
originalNotesCount: await this.notesRepository.countBy({ userHost: IsNull() }),
|
||||
});
|
||||
});
|
||||
//#endregion
|
||||
|
||||
fastify.get('/bios', async (request, reply) => {
|
||||
return await HtmlTemplateService.replyHtml(reply, BiosPage({
|
||||
return await reply.view('bios', {
|
||||
version: this.config.version,
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
fastify.get('/cli', async (request, reply) => {
|
||||
return await HtmlTemplateService.replyHtml(reply, CliPage({
|
||||
return await reply.view('cli', {
|
||||
version: this.config.version,
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
const override = (source: string, target: string, depth = 0) =>
|
||||
@@ -874,7 +917,7 @@ export class ClientServerService {
|
||||
reply.header('Clear-Site-Data', '"*"');
|
||||
}
|
||||
reply.header('Set-Cookie', 'http-flush-failed=1; Path=/flush; Max-Age=60');
|
||||
return await HtmlTemplateService.replyHtml(reply, FlushPage());
|
||||
return await reply.view('flush');
|
||||
});
|
||||
|
||||
// streamingに非WebSocketリクエストが来た場合にbase htmlをキャシュ付きで返すと、Proxy等でそのパスがキャッシュされておかしくなる
|
||||
@@ -900,10 +943,10 @@ export class ClientServerService {
|
||||
});
|
||||
reply.code(500);
|
||||
reply.header('Cache-Control', 'max-age=10, must-revalidate');
|
||||
return await HtmlTemplateService.replyHtml(reply, ErrorPage({
|
||||
return await reply.view('error', {
|
||||
code: error.code,
|
||||
id: errId,
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
done();
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { promises as fsp } from 'node:fs';
|
||||
import { languages } from 'i18n/const';
|
||||
import { Injectable, Inject } from '@nestjs/common';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { htmlSafeJsonStringify } from '@/misc/json-stringify-html-safe.js';
|
||||
import { MetaEntityService } from '@/core/entities/MetaEntityService.js';
|
||||
import type { FastifyReply } from 'fastify';
|
||||
import type { Config } from '@/config.js';
|
||||
import type { MiMeta } from '@/models/Meta.js';
|
||||
import type { CommonData } from './views/_.js';
|
||||
|
||||
const _filename = fileURLToPath(import.meta.url);
|
||||
const _dirname = dirname(_filename);
|
||||
|
||||
const frontendVitePublic = `${_dirname}/../../../../frontend/public/`;
|
||||
const frontendEmbedVitePublic = `${_dirname}/../../../../frontend-embed/public/`;
|
||||
|
||||
@Injectable()
|
||||
export class HtmlTemplateService {
|
||||
private frontendBootloadersFetched = false;
|
||||
public frontendBootloaderJs: string | null = null;
|
||||
public frontendBootloaderCss: string | null = null;
|
||||
public frontendEmbedBootloaderJs: string | null = null;
|
||||
public frontendEmbedBootloaderCss: string | null = null;
|
||||
|
||||
constructor(
|
||||
@Inject(DI.config)
|
||||
private config: Config,
|
||||
|
||||
@Inject(DI.meta)
|
||||
private meta: MiMeta,
|
||||
|
||||
private metaEntityService: MetaEntityService,
|
||||
) {
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private async prepareFrontendBootloaders() {
|
||||
if (this.frontendBootloadersFetched) return;
|
||||
this.frontendBootloadersFetched = true;
|
||||
|
||||
const [bootJs, bootCss, embedBootJs, embedBootCss] = await Promise.all([
|
||||
fsp.readFile(`${frontendVitePublic}loader/boot.js`, 'utf-8').catch(() => null),
|
||||
fsp.readFile(`${frontendVitePublic}loader/style.css`, 'utf-8').catch(() => null),
|
||||
fsp.readFile(`${frontendEmbedVitePublic}loader/boot.js`, 'utf-8').catch(() => null),
|
||||
fsp.readFile(`${frontendEmbedVitePublic}loader/style.css`, 'utf-8').catch(() => null),
|
||||
]);
|
||||
|
||||
if (bootJs != null) {
|
||||
this.frontendBootloaderJs = bootJs;
|
||||
}
|
||||
|
||||
if (bootCss != null) {
|
||||
this.frontendBootloaderCss = bootCss;
|
||||
}
|
||||
|
||||
if (embedBootJs != null) {
|
||||
this.frontendEmbedBootloaderJs = embedBootJs;
|
||||
}
|
||||
|
||||
if (embedBootCss != null) {
|
||||
this.frontendEmbedBootloaderCss = embedBootCss;
|
||||
}
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async getCommonData(): Promise<CommonData> {
|
||||
await this.prepareFrontendBootloaders();
|
||||
|
||||
return {
|
||||
version: this.config.version,
|
||||
config: this.config,
|
||||
langs: [...languages],
|
||||
instanceName: this.meta.name ?? 'Misskey',
|
||||
icon: this.meta.iconUrl,
|
||||
appleTouchIcon: this.meta.app512IconUrl,
|
||||
themeColor: this.meta.themeColor,
|
||||
serverErrorImageUrl: this.meta.serverErrorImageUrl ?? 'https://xn--931a.moe/assets/error.jpg',
|
||||
infoImageUrl: this.meta.infoImageUrl ?? 'https://xn--931a.moe/assets/info.jpg',
|
||||
notFoundImageUrl: this.meta.notFoundImageUrl ?? 'https://xn--931a.moe/assets/not-found.jpg',
|
||||
instanceUrl: this.config.url,
|
||||
metaJson: htmlSafeJsonStringify(await this.metaEntityService.packDetailed(this.meta)),
|
||||
now: Date.now(),
|
||||
federationEnabled: this.meta.federation !== 'none',
|
||||
frontendBootloaderJs: this.frontendBootloaderJs,
|
||||
frontendBootloaderCss: this.frontendBootloaderCss,
|
||||
frontendEmbedBootloaderJs: this.frontendEmbedBootloaderJs,
|
||||
frontendEmbedBootloaderCss: this.frontendEmbedBootloaderCss,
|
||||
};
|
||||
}
|
||||
|
||||
public static async replyHtml(reply: FastifyReply, html: string | Promise<string>) {
|
||||
reply.header('Content-Type', 'text/html; charset=utf-8');
|
||||
const _html = await html;
|
||||
return reply.send(_html);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,8 @@
|
||||
*/
|
||||
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import type { SummalyResult } from '@misskey-dev/summaly/built/summary.js';
|
||||
import { summaly } from '@misskey-dev/summaly';
|
||||
import { SummalyResult } from '@misskey-dev/summaly/built/summary.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import type { Config } from '@/config.js';
|
||||
import { HttpRequestService } from '@/core/HttpRequestService.js';
|
||||
@@ -112,7 +113,7 @@ export class UrlPreviewService {
|
||||
}
|
||||
}
|
||||
|
||||
private async fetchSummary(url: string, meta: MiMeta, lang?: string): Promise<SummalyResult> {
|
||||
private fetchSummary(url: string, meta: MiMeta, lang?: string): Promise<SummalyResult> {
|
||||
const agent = this.config.proxy
|
||||
? {
|
||||
http: this.httpRequestService.httpAgent,
|
||||
@@ -120,8 +121,6 @@ export class UrlPreviewService {
|
||||
}
|
||||
: undefined;
|
||||
|
||||
const { summaly } = await import('@misskey-dev/summaly');
|
||||
|
||||
return summaly(url, {
|
||||
followRedirects: this.meta.urlPreviewAllowRedirect,
|
||||
lang: lang ?? 'ja-JP',
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Config } from '@/config.js';
|
||||
|
||||
export const comment = `<!--
|
||||
_____ _ _
|
||||
| |_|___ ___| |_ ___ _ _
|
||||
| | | | |_ -|_ -| '_| -_| | |
|
||||
|_|_|_|_|___|___|_,_|___|_ |
|
||||
|___|
|
||||
Thank you for using Misskey!
|
||||
If you are reading this message... how about joining the development?
|
||||
https://github.com/misskey-dev/misskey
|
||||
|
||||
-->`;
|
||||
|
||||
export const defaultDescription = '✨🌎✨ A interplanetary communication platform ✨🚀✨';
|
||||
|
||||
export type MinimumCommonData = {
|
||||
version: string;
|
||||
config: Config;
|
||||
};
|
||||
|
||||
export type CommonData = MinimumCommonData & {
|
||||
langs: string[];
|
||||
instanceName: string;
|
||||
icon: string | null;
|
||||
appleTouchIcon: string | null;
|
||||
themeColor: string | null;
|
||||
serverErrorImageUrl: string;
|
||||
infoImageUrl: string;
|
||||
notFoundImageUrl: string;
|
||||
instanceUrl: string;
|
||||
now: number;
|
||||
federationEnabled: boolean;
|
||||
frontendBootloaderJs: string | null;
|
||||
frontendBootloaderCss: string | null;
|
||||
frontendEmbedBootloaderJs: string | null;
|
||||
frontendEmbedBootloaderCss: string | null;
|
||||
metaJson?: string;
|
||||
clientCtxJson?: string;
|
||||
};
|
||||
|
||||
export type CommonPropsMinimum<T = Record<string, any>> = MinimumCommonData & T;
|
||||
|
||||
export type CommonProps<T = Record<string, any>> = CommonData & T;
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export function Splash(props: {
|
||||
icon?: string | null;
|
||||
}) {
|
||||
return (
|
||||
<div id="splash">
|
||||
<img id="splashIcon" src={props.icon || '/static-assets/splash.png'} />
|
||||
<div id="splashSpinner">
|
||||
<svg class="spinner bg" viewBox="0 0 152 152" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="matrix(1,0,0,1,12,12)">
|
||||
<circle cx="64" cy="64" r="64" style="fill:none;stroke:currentColor;stroke-width:24px;"/>
|
||||
</g>
|
||||
</svg>
|
||||
<svg class="spinner fg" viewBox="0 0 152 152" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="matrix(1,0,0,1,12,12)">
|
||||
<path d="M128,64C128,28.654 99.346,0 64,0C99.346,0 128,28.654 128,64Z" style="fill:none;stroke:currentColor;stroke-width:24px;"/>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
21
packages/backend/src/server/web/views/announcement.pug
Normal file
21
packages/backend/src/server/web/views/announcement.pug
Normal file
@@ -0,0 +1,21 @@
|
||||
extends ./base
|
||||
|
||||
block vars
|
||||
- const title = announcement.title;
|
||||
- const description = announcement.text.length > 100 ? announcement.text.slice(0, 100) + '…' : announcement.text;
|
||||
- const url = `${config.url}/announcements/${announcement.id}`;
|
||||
|
||||
block title
|
||||
= `${title} | ${instanceName}`
|
||||
|
||||
block desc
|
||||
meta(name='description' content=description)
|
||||
|
||||
block og
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content= description)
|
||||
meta(property='og:url' content= url)
|
||||
if announcement.imageUrl
|
||||
meta(property='og:image' content=announcement.imageUrl)
|
||||
meta(property='twitter:card' content='summary_large_image')
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Packed } from '@/misc/json-schema.js';
|
||||
import type { CommonProps } from '@/server/web/views/_.js';
|
||||
import { Layout } from '@/server/web/views/base.js';
|
||||
|
||||
export function AnnouncementPage(props: CommonProps<{
|
||||
announcement: Packed<'Announcement'>;
|
||||
}>) {
|
||||
const description = props.announcement.text.length > 100 ? props.announcement.text.slice(0, 100) + '…' : props.announcement.text;
|
||||
|
||||
function ogBlock() {
|
||||
return (
|
||||
<>
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:title" content={props.announcement.title} />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:url" content={`${props.config.url}/announcements/${props.announcement.id}`} />
|
||||
{props.announcement.imageUrl ? (
|
||||
<>
|
||||
<meta property="og:image" content={props.announcement.imageUrl} />
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
</>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout
|
||||
{...props}
|
||||
title={`${props.announcement.title} | ${props.instanceName}`}
|
||||
desc={description}
|
||||
ogSlot={ogBlock()}
|
||||
>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
71
packages/backend/src/server/web/views/base-embed.pug
Normal file
71
packages/backend/src/server/web/views/base-embed.pug
Normal file
@@ -0,0 +1,71 @@
|
||||
block vars
|
||||
|
||||
block loadClientEntry
|
||||
- const entry = config.frontendEmbedEntry;
|
||||
|
||||
doctype html
|
||||
|
||||
html(class='embed')
|
||||
|
||||
head
|
||||
meta(charset='utf-8')
|
||||
meta(name='application-name' content='Misskey')
|
||||
meta(name='referrer' content='origin')
|
||||
meta(name='theme-color' content= themeColor || '#86b300')
|
||||
meta(name='theme-color-orig' content= themeColor || '#86b300')
|
||||
meta(property='og:site_name' content= instanceName || 'Misskey')
|
||||
meta(property='instance_url' content= instanceUrl)
|
||||
meta(name='viewport' content='width=device-width, initial-scale=1')
|
||||
meta(name='format-detection' content='telephone=no,date=no,address=no,email=no,url=no')
|
||||
link(rel='icon' href= icon || '/favicon.ico')
|
||||
link(rel='apple-touch-icon' href= appleTouchIcon || '/apple-touch-icon.png')
|
||||
|
||||
if !config.frontendEmbedManifestExists
|
||||
script(type="module" src="/embed_vite/@vite/client")
|
||||
|
||||
if Array.isArray(entry.css)
|
||||
each href in entry.css
|
||||
link(rel='stylesheet' href=`/embed_vite/${href}`)
|
||||
|
||||
title
|
||||
block title
|
||||
= title || 'Misskey'
|
||||
|
||||
block meta
|
||||
meta(name='robots' content='noindex')
|
||||
|
||||
style
|
||||
include ../style.embed.css
|
||||
|
||||
script.
|
||||
var VERSION = "#{version}";
|
||||
var CLIENT_ENTRY = !{JSON.stringify(entry.file)};
|
||||
|
||||
script(type='application/json' id='misskey_meta' data-generated-at=now)
|
||||
!= metaJson
|
||||
|
||||
script(type='application/json' id='misskey_embedCtx' data-generated-at=now)
|
||||
!= embedCtx
|
||||
|
||||
script
|
||||
include ../boot.embed.js
|
||||
|
||||
body
|
||||
noscript: p
|
||||
| JavaScriptを有効にしてください
|
||||
br
|
||||
| Please turn on your JavaScript
|
||||
div#splash
|
||||
img#splashIcon(src= icon || '/static-assets/splash.png')
|
||||
div#splashSpinner
|
||||
<svg class="spinner bg" viewBox="0 0 152 152" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="matrix(1,0,0,1,12,12)">
|
||||
<circle cx="64" cy="64" r="64" style="fill:none;stroke:currentColor;stroke-width:24px;"/>
|
||||
</g>
|
||||
</svg>
|
||||
<svg class="spinner fg" viewBox="0 0 152 152" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="matrix(1,0,0,1,12,12)">
|
||||
<path d="M128,64C128,28.654 99.346,0 64,0C99.346,0 128,28.654 128,64Z" style="fill:none;stroke:currentColor;stroke-width:24px;"/>
|
||||
</g>
|
||||
</svg>
|
||||
block content
|
||||
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { comment } from '@/server/web/views/_.js';
|
||||
import type { CommonProps } from '@/server/web/views/_.js';
|
||||
import { Splash } from '@/server/web/views/_splash.js';
|
||||
import type { PropsWithChildren, Children } from '@kitajs/html';
|
||||
|
||||
export function BaseEmbed(props: PropsWithChildren<CommonProps<{
|
||||
title?: string;
|
||||
noindex?: boolean;
|
||||
desc?: string;
|
||||
img?: string;
|
||||
serverErrorImageUrl?: string;
|
||||
infoImageUrl?: string;
|
||||
notFoundImageUrl?: string;
|
||||
metaJson?: string;
|
||||
embedCtxJson?: string;
|
||||
|
||||
titleSlot?: Children;
|
||||
metaSlot?: Children;
|
||||
}>>) {
|
||||
const now = Date.now();
|
||||
|
||||
// 変数名をsafeで始めることでエラーをスキップ
|
||||
const safeMetaJson = props.metaJson;
|
||||
const safeEmbedCtxJson = props.embedCtxJson;
|
||||
|
||||
return (
|
||||
<>
|
||||
{'<!DOCTYPE html>'}
|
||||
{comment}
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="application-name" content="Misskey" />
|
||||
<meta name="referer" content="origin" />
|
||||
<meta name="theme-color" content={props.themeColor ?? '#86b300'} />
|
||||
<meta name="theme-color-orig" content={props.themeColor ?? '#86b300'} />
|
||||
<meta property="og:site_name" content={props.instanceName || 'Misskey'} />
|
||||
<meta property="instance_url" content={props.instanceUrl} />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover" />
|
||||
<meta name="format-detection" content="telephone=no,date=no,address=no,email=no,url=no" />
|
||||
<link rel="icon" href={props.icon ?? '/favicon.ico'} />
|
||||
<link rel="apple-touch-icon" href={props.appleTouchIcon ?? '/apple-touch-icon.png'} />
|
||||
|
||||
{!props.config.frontendEmbedManifestExists ? <script type="module" src="/embed_vite/@vite/client"></script> : null}
|
||||
|
||||
{props.config.frontendEmbedEntry.css != null ? props.config.frontendEmbedEntry.css.map((href) => (
|
||||
<link rel="stylesheet" href={`/embed_vite/${href}`} />
|
||||
)) : null}
|
||||
|
||||
{props.titleSlot ?? <title safe>{props.title || 'Misskey'}</title>}
|
||||
|
||||
{props.metaSlot}
|
||||
|
||||
<meta name="robots" content="noindex" />
|
||||
|
||||
{props.frontendEmbedBootloaderCss != null ? <style safe>{props.frontendEmbedBootloaderCss}</style> : <link rel="stylesheet" href="/embed_vite/loader/style.css" />}
|
||||
|
||||
<script>
|
||||
const VERSION = '{props.version}';
|
||||
const CLIENT_ENTRY = {JSON.stringify(props.config.frontendEmbedEntry.file)};
|
||||
const LANGS = {JSON.stringify(props.langs)};
|
||||
</script>
|
||||
|
||||
{safeMetaJson != null ? <script type="application/json" id="misskey_meta" data-generated-at={now}>{safeMetaJson}</script> : null}
|
||||
{safeEmbedCtxJson != null ? <script type="application/json" id="misskey_embedCtx" data-generated-at={now}>{safeEmbedCtxJson}</script> : null}
|
||||
|
||||
{props.frontendEmbedBootloaderJs != null ? <script>{props.frontendEmbedBootloaderJs}</script> : <script src="/embed_vite/loader/boot.js"></script>}
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<p>
|
||||
JavaScriptを有効にしてください<br />
|
||||
Please turn on your JavaScript
|
||||
</p>
|
||||
</noscript>
|
||||
<Splash icon={props.icon} />
|
||||
{props.children}
|
||||
</body>
|
||||
</html>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
100
packages/backend/src/server/web/views/base.pug
Normal file
100
packages/backend/src/server/web/views/base.pug
Normal file
@@ -0,0 +1,100 @@
|
||||
block vars
|
||||
|
||||
block loadClientEntry
|
||||
- const entry = config.frontendEntry;
|
||||
- const baseUrl = config.url;
|
||||
|
||||
doctype html
|
||||
|
||||
//
|
||||
-
|
||||
_____ _ _
|
||||
| |_|___ ___| |_ ___ _ _
|
||||
| | | | |_ -|_ -| '_| -_| | |
|
||||
|_|_|_|_|___|___|_,_|___|_ |
|
||||
|___|
|
||||
Thank you for using Misskey!
|
||||
If you are reading this message... how about joining the development?
|
||||
https://github.com/misskey-dev/misskey
|
||||
|
||||
|
||||
html
|
||||
|
||||
head
|
||||
meta(charset='utf-8')
|
||||
meta(name='application-name' content='Misskey')
|
||||
meta(name='referrer' content='origin')
|
||||
meta(name='theme-color' content= themeColor || '#86b300')
|
||||
meta(name='theme-color-orig' content= themeColor || '#86b300')
|
||||
meta(property='og:site_name' content= instanceName || 'Misskey')
|
||||
meta(property='instance_url' content= instanceUrl)
|
||||
meta(name='viewport' content='width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover')
|
||||
meta(name='format-detection' content='telephone=no,date=no,address=no,email=no,url=no')
|
||||
link(rel='icon' href= icon || '/favicon.ico')
|
||||
link(rel='apple-touch-icon' href= appleTouchIcon || '/apple-touch-icon.png')
|
||||
link(rel='manifest' href='/manifest.json')
|
||||
link(rel='search' type='application/opensearchdescription+xml' title=(title || "Misskey") href=`${baseUrl}/opensearch.xml`)
|
||||
link(rel='prefetch' href=serverErrorImageUrl)
|
||||
link(rel='prefetch' href=infoImageUrl)
|
||||
link(rel='prefetch' href=notFoundImageUrl)
|
||||
|
||||
if !config.frontendManifestExists
|
||||
script(type="module" src="/vite/@vite/client")
|
||||
|
||||
if Array.isArray(entry.css)
|
||||
each href in entry.css
|
||||
link(rel='stylesheet' href=`/vite/${href}`)
|
||||
|
||||
title
|
||||
block title
|
||||
= title || 'Misskey'
|
||||
|
||||
if noindex
|
||||
meta(name='robots' content='noindex')
|
||||
|
||||
block desc
|
||||
meta(name='description' content= desc || '✨🌎✨ A interplanetary communication platform ✨🚀✨')
|
||||
|
||||
block meta
|
||||
|
||||
block og
|
||||
meta(property='og:title' content= title || 'Misskey')
|
||||
meta(property='og:description' content= desc || '✨🌎✨ A interplanetary communication platform ✨🚀✨')
|
||||
meta(property='og:image' content= img)
|
||||
meta(property='twitter:card' content='summary')
|
||||
|
||||
style
|
||||
include ../style.css
|
||||
|
||||
script.
|
||||
var VERSION = "#{version}";
|
||||
var CLIENT_ENTRY = !{JSON.stringify(entry.file)};
|
||||
|
||||
script(type='application/json' id='misskey_meta' data-generated-at=now)
|
||||
!= metaJson
|
||||
|
||||
script(type='application/json' id='misskey_clientCtx' data-generated-at=now)
|
||||
!= clientCtx
|
||||
|
||||
script
|
||||
include ../boot.js
|
||||
|
||||
body
|
||||
noscript: p
|
||||
| JavaScriptを有効にしてください
|
||||
br
|
||||
| Please turn on your JavaScript
|
||||
div#splash
|
||||
img#splashIcon(src= icon || '/static-assets/splash.png')
|
||||
div#splashSpinner
|
||||
<svg class="spinner bg" viewBox="0 0 152 152" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="matrix(1,0,0,1,12,12)">
|
||||
<circle cx="64" cy="64" r="64" style="fill:none;stroke:currentColor;stroke-width:24px;"/>
|
||||
</g>
|
||||
</svg>
|
||||
<svg class="spinner fg" viewBox="0 0 152 152" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="matrix(1,0,0,1,12,12)">
|
||||
<path d="M128,64C128,28.654 99.346,0 64,0C99.346,0 128,28.654 128,64Z" style="fill:none;stroke:currentColor;stroke-width:24px;"/>
|
||||
</g>
|
||||
</svg>
|
||||
block content
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { comment, defaultDescription } from '@/server/web/views/_.js';
|
||||
import { Splash } from '@/server/web/views/_splash.js';
|
||||
import type { CommonProps } from '@/server/web/views/_.js';
|
||||
import type { PropsWithChildren, Children } from '@kitajs/html';
|
||||
|
||||
export function Layout(props: PropsWithChildren<CommonProps<{
|
||||
title?: string;
|
||||
noindex?: boolean;
|
||||
desc?: string;
|
||||
img?: string;
|
||||
serverErrorImageUrl?: string;
|
||||
infoImageUrl?: string;
|
||||
notFoundImageUrl?: string;
|
||||
metaJson?: string;
|
||||
clientCtxJson?: string;
|
||||
|
||||
titleSlot?: Children;
|
||||
descSlot?: Children;
|
||||
metaSlot?: Children;
|
||||
ogSlot?: Children;
|
||||
}>>) {
|
||||
const now = Date.now();
|
||||
|
||||
// 変数名をsafeで始めることでエラーをスキップ
|
||||
const safeMetaJson = props.metaJson;
|
||||
const safeClientCtxJson = props.clientCtxJson;
|
||||
|
||||
return (
|
||||
<>
|
||||
{'<!DOCTYPE html>'}
|
||||
{comment}
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="application-name" content="Misskey" />
|
||||
<meta name="referer" content="origin" />
|
||||
<meta name="theme-color" content={props.themeColor ?? '#86b300'} />
|
||||
<meta name="theme-color-orig" content={props.themeColor ?? '#86b300'} />
|
||||
<meta property="og:site_name" content={props.instanceName || 'Misskey'} />
|
||||
<meta property="instance_url" content={props.instanceUrl} />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover" />
|
||||
<meta name="format-detection" content="telephone=no,date=no,address=no,email=no,url=no" />
|
||||
<link rel="icon" href={props.icon || '/favicon.ico'} />
|
||||
<link rel="apple-touch-icon" href={props.appleTouchIcon || '/apple-touch-icon.png'} />
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<link rel="search" type="application/opensearchdescription+xml" title={props.title || 'Misskey'} href={`${props.config.url}/opensearch.xml`} />
|
||||
{props.serverErrorImageUrl != null ? <link rel="prefetch" as="image" href={props.serverErrorImageUrl} /> : null}
|
||||
{props.infoImageUrl != null ? <link rel="prefetch" as="image" href={props.infoImageUrl} /> : null}
|
||||
{props.notFoundImageUrl != null ? <link rel="prefetch" as="image" href={props.notFoundImageUrl} /> : null}
|
||||
|
||||
{!props.config.frontendManifestExists ? <script type="module" src="/vite/@vite/client"></script> : null}
|
||||
|
||||
{props.config.frontendEntry.css != null ? props.config.frontendEntry.css.map((href) => (
|
||||
<link rel="stylesheet" href={`/vite/${href}`} />
|
||||
)) : null}
|
||||
|
||||
{props.titleSlot ?? <title safe>{props.title || 'Misskey'}</title>}
|
||||
|
||||
{props.noindex ? <meta name="robots" content="noindex" /> : null}
|
||||
|
||||
{props.descSlot ?? (props.desc != null ? <meta name="description" content={props.desc || defaultDescription} /> : null)}
|
||||
|
||||
{props.metaSlot}
|
||||
|
||||
{props.ogSlot ?? (
|
||||
<>
|
||||
<meta property="og:title" content={props.title || 'Misskey'} />
|
||||
<meta property="og:description" content={props.desc || defaultDescription} />
|
||||
{props.img != null ? <meta property="og:image" content={props.img} /> : null}
|
||||
<meta property="twitter:card" content="summary" />
|
||||
</>
|
||||
)}
|
||||
|
||||
{props.frontendBootloaderCss != null ? <style safe>{props.frontendBootloaderCss}</style> : <link rel="stylesheet" href="/vite/loader/style.css" />}
|
||||
|
||||
<script>
|
||||
const VERSION = '{props.version}';
|
||||
const CLIENT_ENTRY = {JSON.stringify(props.config.frontendEntry.file)};
|
||||
const LANGS = {JSON.stringify(props.langs)};
|
||||
</script>
|
||||
|
||||
{safeMetaJson != null ? <script type="application/json" id="misskey_meta" data-generated-at={now}>{safeMetaJson}</script> : null}
|
||||
{safeClientCtxJson != null ? <script type="application/json" id="misskey_clientCtx" data-generated-at={now}>{safeClientCtxJson}</script> : null}
|
||||
|
||||
{props.frontendBootloaderJs != null ? <script>{props.frontendBootloaderJs}</script> : <script src="/vite/loader/boot.js"></script>}
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<p>
|
||||
JavaScriptを有効にしてください<br />
|
||||
Please turn on your JavaScript
|
||||
</p>
|
||||
</noscript>
|
||||
<Splash icon={props.icon} />
|
||||
{props.children}
|
||||
</body>
|
||||
</html>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export { Layout as BasePage };
|
||||
|
||||
20
packages/backend/src/server/web/views/bios.pug
Normal file
20
packages/backend/src/server/web/views/bios.pug
Normal file
@@ -0,0 +1,20 @@
|
||||
doctype html
|
||||
|
||||
html
|
||||
|
||||
head
|
||||
meta(charset='utf-8')
|
||||
meta(name='application-name' content='Misskey')
|
||||
title Misskey Repair Tool
|
||||
style
|
||||
include ../bios.css
|
||||
script
|
||||
include ../bios.js
|
||||
|
||||
body
|
||||
header
|
||||
h1 Misskey Repair Tool #{version}
|
||||
main
|
||||
div.tabs
|
||||
button#ls edit local storage
|
||||
div#content
|
||||
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export function BiosPage(props: {
|
||||
version: string;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
{'<!DOCTYPE html>'}
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="application-name" content="Misskey" />
|
||||
<title>Misskey Repair Tool</title>
|
||||
<link rel="stylesheet" href="/static-assets/misc/bios.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1 safe>Misskey Repair Tool {props.version}</h1>
|
||||
</header>
|
||||
<main>
|
||||
<div class="tabs">
|
||||
<button id="ls">edit local storage</button>
|
||||
</div>
|
||||
<div id="content"></div>
|
||||
</main>
|
||||
<script src="/static-assets/misc/bios.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</>
|
||||
);
|
||||
}
|
||||
19
packages/backend/src/server/web/views/channel.pug
Normal file
19
packages/backend/src/server/web/views/channel.pug
Normal file
@@ -0,0 +1,19 @@
|
||||
extends ./base
|
||||
|
||||
block vars
|
||||
- const title = channel.name;
|
||||
- const url = `${config.url}/channels/${channel.id}`;
|
||||
|
||||
block title
|
||||
= `${title} | ${instanceName}`
|
||||
|
||||
block desc
|
||||
meta(name='description' content= channel.description)
|
||||
|
||||
block og
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content= channel.description)
|
||||
meta(property='og:url' content= url)
|
||||
meta(property='og:image' content= channel.bannerUrl)
|
||||
meta(property='twitter:card' content='summary')
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Packed } from '@/misc/json-schema.js';
|
||||
import type { CommonProps } from '@/server/web/views/_.js';
|
||||
import { Layout } from '@/server/web/views/base.js';
|
||||
|
||||
export function ChannelPage(props: CommonProps<{
|
||||
channel: Packed<'Channel'>;
|
||||
}>) {
|
||||
|
||||
function ogBlock() {
|
||||
return (
|
||||
<>
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content={props.channel.name} />
|
||||
{props.channel.description != null ? <meta property="og:description" content={props.channel.description} /> : null}
|
||||
<meta property="og:url" content={`${props.config.url}/channels/${props.channel.id}`} />
|
||||
{props.channel.bannerUrl ? (
|
||||
<>
|
||||
<meta property="og:image" content={props.channel.bannerUrl} />
|
||||
<meta property="twitter:card" content="summary" />
|
||||
</>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout
|
||||
{...props}
|
||||
title={`${props.channel.name} | ${props.instanceName}`}
|
||||
desc={props.channel.description ?? undefined}
|
||||
ogSlot={ogBlock()}
|
||||
>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
21
packages/backend/src/server/web/views/cli.pug
Normal file
21
packages/backend/src/server/web/views/cli.pug
Normal file
@@ -0,0 +1,21 @@
|
||||
doctype html
|
||||
|
||||
html
|
||||
|
||||
head
|
||||
meta(charset='utf-8')
|
||||
meta(name='application-name' content='Misskey')
|
||||
title Misskey Cli
|
||||
style
|
||||
include ../cli.css
|
||||
script
|
||||
include ../cli.js
|
||||
|
||||
body
|
||||
header
|
||||
h1 Misskey Cli #{version}
|
||||
main
|
||||
div#form
|
||||
textarea#text
|
||||
button#submit submit
|
||||
div#tl
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export function CliPage(props: {
|
||||
version: string;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
{'<!DOCTYPE html>'}
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="application-name" content="Misskey" />
|
||||
<title>Misskey CLI Tool</title>
|
||||
|
||||
<link rel="stylesheet" href="/static-assets/misc/cli.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1 safe>Misskey CLI {props.version}</h1>
|
||||
</header>
|
||||
<main>
|
||||
<div id="form">
|
||||
<textarea id="text"></textarea>
|
||||
<button id="submit">Submit</button>
|
||||
</div>
|
||||
<div id="tl"></div>
|
||||
</main>
|
||||
<script src="/static-assets/misc/cli.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</>
|
||||
);
|
||||
}
|
||||
35
packages/backend/src/server/web/views/clip.pug
Normal file
35
packages/backend/src/server/web/views/clip.pug
Normal file
@@ -0,0 +1,35 @@
|
||||
extends ./base
|
||||
|
||||
block vars
|
||||
- const user = clip.user;
|
||||
- const title = clip.name;
|
||||
- const url = `${config.url}/clips/${clip.id}`;
|
||||
|
||||
block title
|
||||
= `${title} | ${instanceName}`
|
||||
|
||||
block desc
|
||||
meta(name='description' content= clip.description)
|
||||
|
||||
block og
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content= clip.description)
|
||||
meta(property='og:url' content= url)
|
||||
meta(property='og:image' content= avatarUrl)
|
||||
meta(property='twitter:card' content='summary')
|
||||
|
||||
block meta
|
||||
if profile.noCrawle
|
||||
meta(name='robots' content='noindex')
|
||||
if profile.preventAiLearning
|
||||
meta(name='robots' content='noimageai')
|
||||
meta(name='robots' content='noai')
|
||||
|
||||
meta(name='misskey:user-username' content=user.username)
|
||||
meta(name='misskey:user-id' content=user.id)
|
||||
meta(name='misskey:clip-id' content=clip.id)
|
||||
|
||||
// todo
|
||||
if user.twitter
|
||||
meta(name='twitter:creator' content=`@${user.twitter.screenName}`)
|
||||
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Packed } from '@/misc/json-schema.js';
|
||||
import type { MiUserProfile } from '@/models/UserProfile.js';
|
||||
import type { CommonProps } from '@/server/web/views/_.js';
|
||||
import { Layout } from '@/server/web/views/base.js';
|
||||
|
||||
export function ClipPage(props: CommonProps<{
|
||||
clip: Packed<'Clip'>;
|
||||
profile: MiUserProfile;
|
||||
}>) {
|
||||
function ogBlock() {
|
||||
return (
|
||||
<>
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:title" content={props.clip.name} />
|
||||
{props.clip.description != null ? <meta property="og:description" content={props.clip.description} /> : null}
|
||||
<meta property="og:url" content={`${props.config.url}/clips/${props.clip.id}`} />
|
||||
{props.clip.user.avatarUrl ? (
|
||||
<>
|
||||
<meta property="og:image" content={props.clip.user.avatarUrl} />
|
||||
<meta property="twitter:card" content="summary" />
|
||||
</>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function metaBlock() {
|
||||
return (
|
||||
<>
|
||||
{props.profile.noCrawle ? <meta name="robots" content="noindex" /> : null}
|
||||
{props.profile.preventAiLearning ? (
|
||||
<>
|
||||
<meta name="robots" content="noimageai" />
|
||||
<meta name="robots" content="noai" />
|
||||
</>
|
||||
) : null}
|
||||
<meta name="misskey:user-username" content={props.clip.user.username} />
|
||||
<meta name="misskey:user-id" content={props.clip.user.id} />
|
||||
<meta name="misskey:clip-id" content={props.clip.id} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout
|
||||
{...props}
|
||||
title={`${props.clip.name} | ${props.instanceName}`}
|
||||
desc={props.clip.description ?? ''}
|
||||
metaSlot={metaBlock()}
|
||||
ogSlot={ogBlock()}
|
||||
>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
71
packages/backend/src/server/web/views/error.pug
Normal file
71
packages/backend/src/server/web/views/error.pug
Normal file
@@ -0,0 +1,71 @@
|
||||
doctype html
|
||||
|
||||
//
|
||||
-
|
||||
_____ _ _
|
||||
| |_|___ ___| |_ ___ _ _
|
||||
| | | | |_ -|_ -| '_| -_| | |
|
||||
|_|_|_|_|___|___|_,_|___|_ |
|
||||
|___|
|
||||
Thank you for using Misskey!
|
||||
If you are reading this message... how about joining the development?
|
||||
https://github.com/misskey-dev/misskey
|
||||
|
||||
|
||||
html
|
||||
|
||||
head
|
||||
meta(charset='utf-8')
|
||||
meta(name='viewport' content='width=device-width, initial-scale=1')
|
||||
meta(name='application-name' content='Misskey')
|
||||
meta(name='referrer' content='origin')
|
||||
|
||||
title
|
||||
block title
|
||||
= 'An error has occurred... | Misskey'
|
||||
|
||||
style
|
||||
include ../error.css
|
||||
|
||||
script
|
||||
include ../error.js
|
||||
|
||||
body
|
||||
svg.icon-warning(xmlns="http://www.w3.org/2000/svg", viewBox="0 0 24 24", stroke-width="2", stroke="currentColor", fill="none", stroke-linecap="round", stroke-linejoin="round")
|
||||
path(stroke="none", d="M0 0h24v24H0z", fill="none")
|
||||
path(d="M12 9v2m0 4v.01")
|
||||
path(d="M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75")
|
||||
|
||||
h1(data-i18n="title") Failed to initialize Misskey
|
||||
|
||||
button.button-big(onclick="location.reload();")
|
||||
span.button-label-big(data-i18n-reload) Reload
|
||||
|
||||
p(data-i18n="serverError") If reloading after a period of time does not resolve the problem, contact the server administrator with the following ERROR ID.
|
||||
|
||||
div#errors
|
||||
code.
|
||||
ERROR CODE: #{code}
|
||||
ERROR ID: #{id}
|
||||
|
||||
p
|
||||
b(data-i18n="solution") The following actions may solve the problem.
|
||||
|
||||
p(data-i18n="solution1") Update your os and browser
|
||||
p(data-i18n="solution2") Disable an adblocker
|
||||
p(data-i18n="solution3") Clear your browser cache
|
||||
p(data-i18n="solution4") (Tor Browser) Set dom.webaudio.enabled to true
|
||||
|
||||
details(style="color: #86b300;")
|
||||
summary(data-i18n="otherOption") Other options
|
||||
a(href="/flush")
|
||||
button.button-small
|
||||
span.button-label-small(data-i18n="otherOption1") Clear preferences and cache
|
||||
br
|
||||
a(href="/cli")
|
||||
button.button-small
|
||||
span.button-label-small(data-i18n="otherOption2") Start the simple client
|
||||
br
|
||||
a(href="/bios")
|
||||
button.button-small
|
||||
span.button-label-small(data-i18n="otherOption3") Start the repair tool
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { comment } from '@/server/web/views/_.js';
|
||||
import type { CommonPropsMinimum } from '@/server/web/views/_.js';
|
||||
|
||||
export function ErrorPage(props: {
|
||||
title?: string;
|
||||
code: string;
|
||||
id: string;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
{'<!DOCTYPE html>'}
|
||||
{comment}
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="application-name" content="Misskey" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="referrer" content="origin" />
|
||||
<title safe>{props.title ?? 'An error has occurred... | Misskey'}</title>
|
||||
<link rel="stylesheet" href="/static-assets/misc/error.css" />
|
||||
<script src="/static-assets/misc/error.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<svg
|
||||
class="icon-warning"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
stroke-width="2"
|
||||
stroke="currentColor"
|
||||
fill="none"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||
<path d="M12 9v2m0 4v.01" />
|
||||
<path d="M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75" />
|
||||
</svg>
|
||||
<h1 data-i18n="title">Failed to initialize Misskey</h1>
|
||||
|
||||
<button class="button-big" onclick="location.reload();">
|
||||
<span class="button-label-big" data-i18n="reload">Reload</span>
|
||||
</button>
|
||||
|
||||
<p data-i18n="serverError">
|
||||
If reloading after a period of time does not resolve the problem, contact the server administrator with the following ERROR ID.
|
||||
</p>
|
||||
|
||||
<div id="errors">
|
||||
<code safe>
|
||||
ERROR CODE: {props.code}<br />
|
||||
ERROR ID: {props.id}
|
||||
</code>
|
||||
</div>
|
||||
|
||||
<p><b data-i18n="solution">The following actions may solve the problem.</b></p>
|
||||
|
||||
<p data-i18n="solution1">Update your os and browser</p>
|
||||
<p data-i18n="solution2">Disable an adblocker</p>
|
||||
<p data-i18n="solution3">Clear your browser cache</p>
|
||||
<p data-i18n="solution4">(Tor Browser) Set dom.webaudio.enabled to true</p>
|
||||
|
||||
<details style="color: #86b300;">
|
||||
<summary data-i18n="otherOption">Other options</summary>
|
||||
<a href="/flush">
|
||||
<button class="button-small">
|
||||
<span class="button-label-small" data-i18n="otherOption1">Clear preferences and cache</span>
|
||||
</button>
|
||||
</a>
|
||||
<a href="/cli">
|
||||
<button class="button-small">
|
||||
<span class="button-label-small" data-i18n="otherOption2">Start the simple client</span>
|
||||
</button>
|
||||
</a>
|
||||
<a href="/bios">
|
||||
<button class="button-small">
|
||||
<span class="button-label-small" data-i18n="otherOption3">Start the repair tool</span>
|
||||
</button>
|
||||
</a>
|
||||
</details>
|
||||
</body>
|
||||
</html>
|
||||
</>
|
||||
);
|
||||
}
|
||||
35
packages/backend/src/server/web/views/flash.pug
Normal file
35
packages/backend/src/server/web/views/flash.pug
Normal file
@@ -0,0 +1,35 @@
|
||||
extends ./base
|
||||
|
||||
block vars
|
||||
- const user = flash.user;
|
||||
- const title = flash.title;
|
||||
- const url = `${config.url}/play/${flash.id}`;
|
||||
|
||||
block title
|
||||
= `${title} | ${instanceName}`
|
||||
|
||||
block desc
|
||||
meta(name='description' content= flash.summary)
|
||||
|
||||
block og
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content= flash.summary)
|
||||
meta(property='og:url' content= url)
|
||||
meta(property='og:image' content= avatarUrl)
|
||||
meta(property='twitter:card' content='summary')
|
||||
|
||||
block meta
|
||||
if profile.noCrawle
|
||||
meta(name='robots' content='noindex')
|
||||
if profile.preventAiLearning
|
||||
meta(name='robots' content='noimageai')
|
||||
meta(name='robots' content='noai')
|
||||
|
||||
meta(name='misskey:user-username' content=user.username)
|
||||
meta(name='misskey:user-id' content=user.id)
|
||||
meta(name='misskey:flash-id' content=flash.id)
|
||||
|
||||
// todo
|
||||
if user.twitter
|
||||
meta(name='twitter:creator' content=`@${user.twitter.screenName}`)
|
||||
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Packed } from '@/misc/json-schema.js';
|
||||
import type { MiUserProfile } from '@/models/UserProfile.js';
|
||||
import type { CommonProps } from '@/server/web/views/_.js';
|
||||
import { Layout } from '@/server/web/views/base.js';
|
||||
|
||||
export function FlashPage(props: CommonProps<{
|
||||
flash: Packed<'Flash'>;
|
||||
profile: MiUserProfile;
|
||||
}>) {
|
||||
function ogBlock() {
|
||||
return (
|
||||
<>
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:title" content={props.flash.title} />
|
||||
<meta property="og:description" content={props.flash.summary} />
|
||||
<meta property="og:url" content={`${props.config.url}/play/${props.flash.id}`} />
|
||||
{props.flash.user.avatarUrl ? (
|
||||
<>
|
||||
<meta property="og:image" content={props.flash.user.avatarUrl} />
|
||||
<meta property="twitter:card" content="summary" />
|
||||
</>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function metaBlock() {
|
||||
return (
|
||||
<>
|
||||
{props.profile.noCrawle ? <meta name="robots" content="noindex" /> : null}
|
||||
{props.profile.preventAiLearning ? (
|
||||
<>
|
||||
<meta name="robots" content="noimageai" />
|
||||
<meta name="robots" content="noai" />
|
||||
</>
|
||||
) : null}
|
||||
<meta name="misskey:user-username" content={props.flash.user.username} />
|
||||
<meta name="misskey:user-id" content={props.flash.user.id} />
|
||||
<meta name="misskey:flash-id" content={props.flash.id} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout
|
||||
{...props}
|
||||
title={`${props.flash.title} | ${props.instanceName}`}
|
||||
desc={props.flash.summary}
|
||||
metaSlot={metaBlock()}
|
||||
ogSlot={ogBlock()}
|
||||
>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
51
packages/backend/src/server/web/views/flush.pug
Normal file
51
packages/backend/src/server/web/views/flush.pug
Normal file
@@ -0,0 +1,51 @@
|
||||
doctype html
|
||||
|
||||
html
|
||||
#msg
|
||||
script.
|
||||
const msg = document.getElementById('msg');
|
||||
const successText = `\nSuccess Flush! <a href="/">Back to Misskey</a>\n成功しました。<a href="/">Misskeyを開き直してください。</a>`;
|
||||
|
||||
if (!document.cookie) {
|
||||
message('Your site data is fully cleared by your browser.');
|
||||
message(successText);
|
||||
} else {
|
||||
message('Your browser does not support Clear-Site-Data header. Start opportunistic flushing.');
|
||||
(async function() {
|
||||
try {
|
||||
localStorage.clear();
|
||||
message('localStorage cleared.');
|
||||
|
||||
const idbPromises = ['MisskeyClient', 'keyval-store'].map((name, i, arr) => new Promise((res, rej) => {
|
||||
const delidb = indexedDB.deleteDatabase(name);
|
||||
delidb.onsuccess = () => res(message(`indexedDB "${name}" cleared. (${i + 1}/${arr.length})`));
|
||||
delidb.onerror = e => rej(e)
|
||||
}));
|
||||
|
||||
await Promise.all(idbPromises);
|
||||
|
||||
if (navigator.serviceWorker.controller) {
|
||||
navigator.serviceWorker.controller.postMessage('clear');
|
||||
await navigator.serviceWorker.getRegistrations()
|
||||
.then(registrations => {
|
||||
return Promise.all(registrations.map(registration => registration.unregister()));
|
||||
})
|
||||
.catch(e => { throw new Error(e) });
|
||||
}
|
||||
|
||||
message(successText);
|
||||
} catch (e) {
|
||||
message(`\n${e}\n\nFlush Failed. <a href="/flush">Please retry.</a>\n失敗しました。<a href="/flush">もう一度試してみてください。</a>`);
|
||||
message(`\nIf you retry more than 3 times, try manually clearing the browser cache or contact to instance admin.\n3回以上試しても失敗する場合、ブラウザのキャッシュを手動で消去し、それでもだめならインスタンス管理者に連絡してみてください。\n`)
|
||||
|
||||
console.error(e);
|
||||
setTimeout(() => {
|
||||
location = '/';
|
||||
}, 10000)
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
function message(text) {
|
||||
msg.insertAdjacentHTML('beforeend', `<p>[${(new Date()).toString()}] ${text.replace(/\n/g,'<br>')}</p>`)
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export function FlushPage(props?: {}) {
|
||||
return (
|
||||
<>
|
||||
{'<!DOCTYPE html>'}
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="application-name" content="Misskey" />
|
||||
<title>Clear preferences and cache</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="msg"></div>
|
||||
<script src="/static-assets/misc/flush.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</>
|
||||
);
|
||||
}
|
||||
41
packages/backend/src/server/web/views/gallery-post.pug
Normal file
41
packages/backend/src/server/web/views/gallery-post.pug
Normal file
@@ -0,0 +1,41 @@
|
||||
extends ./base
|
||||
|
||||
block vars
|
||||
- const user = post.user;
|
||||
- const title = post.title;
|
||||
- const url = `${config.url}/gallery/${post.id}`;
|
||||
|
||||
block title
|
||||
= `${title} | ${instanceName}`
|
||||
|
||||
block desc
|
||||
meta(name='description' content= post.description)
|
||||
|
||||
block og
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content= post.description)
|
||||
meta(property='og:url' content= url)
|
||||
if post.isSensitive
|
||||
meta(property='og:image' content= avatarUrl)
|
||||
meta(property='twitter:card' content='summary')
|
||||
else
|
||||
meta(property='og:image' content= post.files[0].thumbnailUrl)
|
||||
meta(property='twitter:card' content='summary_large_image')
|
||||
|
||||
block meta
|
||||
if user.host || profile.noCrawle
|
||||
meta(name='robots' content='noindex')
|
||||
if profile.preventAiLearning
|
||||
meta(name='robots' content='noimageai')
|
||||
meta(name='robots' content='noai')
|
||||
|
||||
meta(name='misskey:user-username' content=user.username)
|
||||
meta(name='misskey:user-id' content=user.id)
|
||||
|
||||
// todo
|
||||
if user.twitter
|
||||
meta(name='twitter:creator' content=`@${user.twitter.screenName}`)
|
||||
|
||||
if !user.host
|
||||
link(rel='alternate' href=url type='application/activity+json')
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Packed } from '@/misc/json-schema.js';
|
||||
import type { MiUserProfile } from '@/models/UserProfile.js';
|
||||
import type { CommonProps } from '@/server/web/views/_.js';
|
||||
import { Layout } from '@/server/web/views/base.js';
|
||||
|
||||
export function GalleryPostPage(props: CommonProps<{
|
||||
galleryPost: Packed<'GalleryPost'>;
|
||||
profile: MiUserProfile;
|
||||
}>) {
|
||||
function ogBlock() {
|
||||
return (
|
||||
<>
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:title" content={props.galleryPost.title} />
|
||||
{props.galleryPost.description != null ? <meta property="og:description" content={props.galleryPost.description} /> : null}
|
||||
<meta property="og:url" content={`${props.config.url}/gallery/${props.galleryPost.id}`} />
|
||||
{props.galleryPost.isSensitive && props.galleryPost.user.avatarUrl ? (
|
||||
<>
|
||||
<meta property="og:image" content={props.galleryPost.user.avatarUrl} />
|
||||
<meta property="twitter:card" content="summary" />
|
||||
</>
|
||||
) : null}
|
||||
{!props.galleryPost.isSensitive && props.galleryPost.files != null ? (
|
||||
<>
|
||||
<meta property="og:image" content={props.galleryPost.files[0]!.thumbnailUrl ?? props.galleryPost.files[0]!.url} />
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
</>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function metaBlock() {
|
||||
return (
|
||||
<>
|
||||
{props.profile.noCrawle ? <meta name="robots" content="noindex" /> : null}
|
||||
{props.profile.preventAiLearning ? (
|
||||
<>
|
||||
<meta name="robots" content="noimageai" />
|
||||
<meta name="robots" content="noai" />
|
||||
</>
|
||||
) : null}
|
||||
<meta name="misskey:user-username" content={props.galleryPost.user.username} />
|
||||
<meta name="misskey:user-id" content={props.galleryPost.user.id} />
|
||||
<meta name="misskey:gallery-post-id" content={props.galleryPost.id} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout
|
||||
{...props}
|
||||
title={`${props.galleryPost.title} | ${props.instanceName}`}
|
||||
desc={props.galleryPost.description ?? ''}
|
||||
metaSlot={metaBlock()}
|
||||
ogSlot={ogBlock()}
|
||||
>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
50
packages/backend/src/server/web/views/info-card.pug
Normal file
50
packages/backend/src/server/web/views/info-card.pug
Normal file
@@ -0,0 +1,50 @@
|
||||
doctype html
|
||||
|
||||
html
|
||||
|
||||
head
|
||||
meta(charset='utf-8')
|
||||
meta(name='application-name' content='Misskey')
|
||||
title= meta.name || host
|
||||
style.
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-height: 100vh;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
#a {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#banner {
|
||||
background-size: cover;
|
||||
background-position: center center;
|
||||
}
|
||||
|
||||
#title {
|
||||
display: inline-block;
|
||||
margin: 24px;
|
||||
padding: 0.5em 0.8em;
|
||||
color: #fff;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
font-weight: bold;
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
#content {
|
||||
overflow: auto;
|
||||
color: #353c3e;
|
||||
}
|
||||
|
||||
#description {
|
||||
margin: 24px;
|
||||
}
|
||||
|
||||
body
|
||||
a#a(href=`https://${host}` target="_blank")
|
||||
header#banner(style=`background-image: url(${meta.bannerUrl})`)
|
||||
div#title= meta.name || host
|
||||
div#content
|
||||
div#description!= meta.description
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { comment, CommonPropsMinimum } from '@/server/web/views/_.js';
|
||||
import type { MiMeta } from '@/models/Meta.js';
|
||||
|
||||
export function InfoCardPage(props: CommonPropsMinimum<{
|
||||
meta: MiMeta;
|
||||
}>) {
|
||||
// 変数名をsafeで始めることでエラーをスキップ
|
||||
const safeDescription = props.meta.description;
|
||||
|
||||
return (
|
||||
<>
|
||||
{'<!DOCTYPE html>'}
|
||||
{comment}
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="application-name" content="Misskey" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title safe>{props.meta.name ?? props.config.url}</title>
|
||||
<link rel="stylesheet" href="/static-assets/misc/info-card.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a id="a" href={props.config.url} target="_blank" rel="noopener noreferrer">
|
||||
<header id="banner" style={props.meta.bannerUrl != null ? `background-image: url(${props.meta.bannerUrl});` : ''}>
|
||||
<div id="title" safe>{props.meta.name ?? props.config.url}</div>
|
||||
</header>
|
||||
</a>
|
||||
<div id="content">
|
||||
<div id="description">{safeDescription}</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</>
|
||||
);
|
||||
}
|
||||
62
packages/backend/src/server/web/views/note.pug
Normal file
62
packages/backend/src/server/web/views/note.pug
Normal file
@@ -0,0 +1,62 @@
|
||||
extends ./base
|
||||
|
||||
block vars
|
||||
- const user = note.user;
|
||||
- const title = user.name ? `${user.name} (@${user.username}${user.host ? `@${user.host}` : ''})` : `@${user.username}${user.host ? `@${user.host}` : ''}`;
|
||||
- const url = `${config.url}/notes/${note.id}`;
|
||||
- const isRenote = note.renote && note.text == null && note.fileIds.length == 0 && note.poll == null;
|
||||
- const images = (note.files || []).filter(file => file.type.startsWith('image/') && !file.isSensitive)
|
||||
- const videos = (note.files || []).filter(file => file.type.startsWith('video/') && !file.isSensitive)
|
||||
|
||||
block title
|
||||
= `${title} | ${instanceName}`
|
||||
|
||||
block desc
|
||||
meta(name='description' content= summary)
|
||||
|
||||
block og
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content= summary)
|
||||
meta(property='og:url' content= url)
|
||||
if videos.length
|
||||
each video in videos
|
||||
meta(property='og:video:url' content= video.url)
|
||||
meta(property='og:video:secure_url' content= video.url)
|
||||
meta(property='og:video:type' content= video.type)
|
||||
// FIXME: add width and height
|
||||
// FIXME: add embed player for Twitter
|
||||
if images.length
|
||||
meta(property='twitter:card' content='summary_large_image')
|
||||
each image in images
|
||||
meta(property='og:image' content= image.url)
|
||||
else
|
||||
meta(property='twitter:card' content='summary')
|
||||
meta(property='og:image' content= avatarUrl)
|
||||
|
||||
|
||||
block meta
|
||||
if user.host || isRenote || profile.noCrawle
|
||||
meta(name='robots' content='noindex')
|
||||
if profile.preventAiLearning
|
||||
meta(name='robots' content='noimageai')
|
||||
meta(name='robots' content='noai')
|
||||
|
||||
meta(name='misskey:user-username' content=user.username)
|
||||
meta(name='misskey:user-id' content=user.id)
|
||||
meta(name='misskey:note-id' content=note.id)
|
||||
|
||||
// todo
|
||||
if user.twitter
|
||||
meta(name='twitter:creator' content=`@${user.twitter.screenName}`)
|
||||
|
||||
if note.prev
|
||||
link(rel='prev' href=`${config.url}/notes/${note.prev}`)
|
||||
if note.next
|
||||
link(rel='next' href=`${config.url}/notes/${note.next}`)
|
||||
|
||||
if federationEnabled
|
||||
if !user.host
|
||||
link(rel='alternate' href=url type='application/activity+json')
|
||||
if note.uri
|
||||
link(rel='alternate' href=note.uri type='application/activity+json')
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Packed } from '@/misc/json-schema.js';
|
||||
import type { MiUserProfile } from '@/models/UserProfile.js';
|
||||
import type { CommonProps } from '@/server/web/views/_.js';
|
||||
import { Layout } from '@/server/web/views/base.js';
|
||||
import { isRenotePacked } from '@/misc/is-renote.js';
|
||||
import { getNoteSummary } from '@/misc/get-note-summary.js';
|
||||
|
||||
export function NotePage(props: CommonProps<{
|
||||
note: Packed<'Note'>;
|
||||
profile: MiUserProfile;
|
||||
}>) {
|
||||
const title = props.note.user.name ? `${props.note.user.name} (@${props.note.user.username}${props.note.user.host ? `@${props.note.user.host}` : ''})` : `@${props.note.user.username}${props.note.user.host ? `@${props.note.user.host}` : ''}`
|
||||
const isRenote = isRenotePacked(props.note);
|
||||
const images = (props.note.files ?? []).filter(f => f.type.startsWith('image/'));
|
||||
const videos = (props.note.files ?? []).filter(f => f.type.startsWith('video/'));
|
||||
const summary = getNoteSummary(props.note);
|
||||
|
||||
function ogBlock() {
|
||||
return (
|
||||
<>
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={summary} />
|
||||
<meta property="og:url" content={`${props.config.url}/notes/${props.note.id}`} />
|
||||
{videos.map(video => (
|
||||
<>
|
||||
<meta property="og:video:url" content={video.url} />
|
||||
<meta property="og:video:secure_url" content={video.url} />
|
||||
<meta property="og:video:type" content={video.type} />
|
||||
{video.thumbnailUrl ? <meta property="og:video:image" content={video.thumbnailUrl} /> : null}
|
||||
{video.properties.width != null ? <meta property="og:video:width" content={video.properties.width.toString()} /> : null}
|
||||
{video.properties.height != null ? <meta property="og:video:height" content={video.properties.height.toString()} /> : null}
|
||||
</>
|
||||
))}
|
||||
{images.length > 0 ? (
|
||||
<>
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
{images.map(image => (
|
||||
<>
|
||||
<meta property="og:image" content={image.url} />
|
||||
{image.properties.width != null ? <meta property="og:image:width" content={image.properties.width.toString()} /> : null}
|
||||
{image.properties.height != null ? <meta property="og:image:height" content={image.properties.height.toString()} /> : null}
|
||||
</>
|
||||
))}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<meta property="twitter:card" content="summary" />
|
||||
<meta property="og:image" content={props.note.user.avatarUrl} />
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function metaBlock() {
|
||||
return (
|
||||
<>
|
||||
{props.note.user.host != null || isRenote || props.profile.noCrawle ? <meta name="robots" content="noindex" /> : null}
|
||||
{props.profile.preventAiLearning ? (
|
||||
<>
|
||||
<meta name="robots" content="noimageai" />
|
||||
<meta name="robots" content="noai" />
|
||||
</>
|
||||
) : null}
|
||||
<meta name="misskey:user-username" content={props.note.user.username} />
|
||||
<meta name="misskey:user-id" content={props.note.user.id} />
|
||||
<meta name="misskey:note-id" content={props.note.id} />
|
||||
|
||||
{props.federationEnabled ? (
|
||||
<>
|
||||
{props.note.user.host == null ? <link rel="alternate" type="application/activity+json" href={`${props.config.url}/notes/${props.note.id}`} /> : null}
|
||||
{props.note.uri != null ? <link rel="alternate" type="application/activity+json" href={props.note.uri} /> : null}
|
||||
</>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout
|
||||
{...props}
|
||||
title={`${title} | ${props.instanceName}`}
|
||||
desc={summary}
|
||||
metaSlot={metaBlock()}
|
||||
ogSlot={ogBlock()}
|
||||
></Layout>
|
||||
)
|
||||
}
|
||||
11
packages/backend/src/server/web/views/oauth.pug
Normal file
11
packages/backend/src/server/web/views/oauth.pug
Normal file
@@ -0,0 +1,11 @@
|
||||
extends ./base
|
||||
|
||||
block meta
|
||||
//- Should be removed by the page when it loads, so that it won't needlessly
|
||||
//- stay when user navigates away via the navigation bar
|
||||
//- XXX: Remove navigation bar in auth page?
|
||||
meta(name='misskey:oauth:transaction-id' content=transactionId)
|
||||
meta(name='misskey:oauth:client-name' content=clientName)
|
||||
if clientLogo
|
||||
meta(name='misskey:oauth:client-logo' content=clientLogo)
|
||||
meta(name='misskey:oauth:scope' content=scope)
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { CommonProps } from '@/server/web/views/_.js';
|
||||
import { Layout } from '@/server/web/views/base.js';
|
||||
|
||||
export function OAuthPage(props: CommonProps<{
|
||||
transactionId: string;
|
||||
clientName: string;
|
||||
clientLogo?: string;
|
||||
scope: string[];
|
||||
}>) {
|
||||
|
||||
//- Should be removed by the page when it loads, so that it won't needlessly
|
||||
//- stay when user navigates away via the navigation bar
|
||||
//- XXX: Remove navigation bar in auth page?
|
||||
function metaBlock() {
|
||||
return (
|
||||
<>
|
||||
<meta name="misskey:oauth:transaction-id" content={props.transactionId} />
|
||||
<meta name="misskey:oauth:client-name" content={props.clientName} />
|
||||
{props.clientLogo ? <meta name="misskey:oauth:client-logo" content={props.clientLogo} /> : null}
|
||||
<meta name="misskey:oauth:scope" content={props.scope.join(' ')} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout
|
||||
{...props}
|
||||
metaSlot={metaBlock()}
|
||||
>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
35
packages/backend/src/server/web/views/page.pug
Normal file
35
packages/backend/src/server/web/views/page.pug
Normal file
@@ -0,0 +1,35 @@
|
||||
extends ./base
|
||||
|
||||
block vars
|
||||
- const user = page.user;
|
||||
- const title = page.title;
|
||||
- const url = `${config.url}/@${user.username}/pages/${page.name}`;
|
||||
|
||||
block title
|
||||
= `${title} | ${instanceName}`
|
||||
|
||||
block desc
|
||||
meta(name='description' content= page.summary)
|
||||
|
||||
block og
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content= page.summary)
|
||||
meta(property='og:url' content= url)
|
||||
meta(property='og:image' content= page.eyeCatchingImage ? page.eyeCatchingImage.thumbnailUrl : avatarUrl)
|
||||
meta(property='twitter:card' content= page.eyeCatchingImage ? 'summary_large_image' : 'summary')
|
||||
|
||||
block meta
|
||||
if profile.noCrawle
|
||||
meta(name='robots' content='noindex')
|
||||
if profile.preventAiLearning
|
||||
meta(name='robots' content='noimageai')
|
||||
meta(name='robots' content='noai')
|
||||
|
||||
meta(name='misskey:user-username' content=user.username)
|
||||
meta(name='misskey:user-id' content=user.id)
|
||||
meta(name='misskey:page-id' content=page.id)
|
||||
|
||||
// todo
|
||||
if user.twitter
|
||||
meta(name='twitter:creator' content=`@${user.twitter.screenName}`)
|
||||
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Packed } from '@/misc/json-schema.js';
|
||||
import type { MiUserProfile } from '@/models/UserProfile.js';
|
||||
import type { CommonProps } from '@/server/web/views/_.js';
|
||||
import { Layout } from '@/server/web/views/base.js';
|
||||
|
||||
export function PagePage(props: CommonProps<{
|
||||
page: Packed<'Page'>;
|
||||
profile: MiUserProfile;
|
||||
}>) {
|
||||
function ogBlock() {
|
||||
return (
|
||||
<>
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:title" content={props.page.title} />
|
||||
{props.page.summary != null ? <meta property="og:description" content={props.page.summary} /> : null}
|
||||
<meta property="og:url" content={`${props.config.url}/pages/${props.page.id}`} />
|
||||
{props.page.eyeCatchingImage != null ? (
|
||||
<>
|
||||
<meta property="og:image" content={props.page.eyeCatchingImage.thumbnailUrl ?? props.page.eyeCatchingImage.url} />
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
</>
|
||||
) : props.page.user.avatarUrl ? (
|
||||
<>
|
||||
<meta property="og:image" content={props.page.user.avatarUrl} />
|
||||
<meta property="twitter:card" content="summary" />
|
||||
</>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function metaBlock() {
|
||||
return (
|
||||
<>
|
||||
{props.profile.noCrawle ? <meta name="robots" content="noindex" /> : null}
|
||||
{props.profile.preventAiLearning ? (
|
||||
<>
|
||||
<meta name="robots" content="noimageai" />
|
||||
<meta name="robots" content="noai" />
|
||||
</>
|
||||
) : null}
|
||||
<meta name="misskey:user-username" content={props.page.user.username} />
|
||||
<meta name="misskey:user-id" content={props.page.user.id} />
|
||||
<meta name="misskey:page-id" content={props.page.id} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout
|
||||
{...props}
|
||||
title={`${props.page.title} | ${props.instanceName}`}
|
||||
desc={props.page.summary ?? ''}
|
||||
metaSlot={metaBlock()}
|
||||
ogSlot={ogBlock()}
|
||||
>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
20
packages/backend/src/server/web/views/reversi-game.pug
Normal file
20
packages/backend/src/server/web/views/reversi-game.pug
Normal file
@@ -0,0 +1,20 @@
|
||||
extends ./base
|
||||
|
||||
block vars
|
||||
- const user1 = game.user1;
|
||||
- const user2 = game.user2;
|
||||
- const title = `${user1.username} vs ${user2.username}`;
|
||||
- const url = `${config.url}/reversi/g/${game.id}`;
|
||||
|
||||
block title
|
||||
= `${title} | ${instanceName}`
|
||||
|
||||
block desc
|
||||
meta(name='description' content='⚫⚪Misskey Reversi⚪⚫')
|
||||
|
||||
block og
|
||||
meta(property='og:type' content='article')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content='⚫⚪Misskey Reversi⚪⚫')
|
||||
meta(property='og:url' content= url)
|
||||
meta(property='twitter:card' content='summary')
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Packed } from '@/misc/json-schema.js';
|
||||
import type { CommonProps } from '@/server/web/views/_.js';
|
||||
import { Layout } from '@/server/web/views/base.js';
|
||||
|
||||
export function ReversiGamePage(props: CommonProps<{
|
||||
reversiGame: Packed<'ReversiGameDetailed'>;
|
||||
}>) {
|
||||
const title = `${props.reversiGame.user1.username} vs ${props.reversiGame.user2.username}`;
|
||||
const description = `⚫⚪Misskey Reversi⚪⚫`;
|
||||
|
||||
function ogBlock() {
|
||||
return (
|
||||
<>
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:url" content={`${props.config.url}/reversi/g/${props.reversiGame.id}`} />
|
||||
<meta property="twitter:card" content="summary" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout
|
||||
{...props}
|
||||
title={`${title} | ${props.instanceName}`}
|
||||
desc={description}
|
||||
ogSlot={ogBlock()}
|
||||
>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
44
packages/backend/src/server/web/views/user.pug
Normal file
44
packages/backend/src/server/web/views/user.pug
Normal file
@@ -0,0 +1,44 @@
|
||||
extends ./base
|
||||
|
||||
block vars
|
||||
- const title = user.name ? `${user.name} (@${user.username}${user.host ? `@${user.host}` : ''})` : `@${user.username}${user.host ? `@${user.host}` : ''}`;
|
||||
- const url = `${config.url}/@${(user.host ? `${user.username}@${user.host}` : user.username)}`;
|
||||
|
||||
block title
|
||||
= `${title} | ${instanceName}`
|
||||
|
||||
block desc
|
||||
meta(name='description' content= profile.description)
|
||||
|
||||
block og
|
||||
meta(property='og:type' content='blog')
|
||||
meta(property='og:title' content= title)
|
||||
meta(property='og:description' content= profile.description)
|
||||
meta(property='og:url' content= url)
|
||||
meta(property='og:image' content= avatarUrl)
|
||||
meta(property='twitter:card' content='summary')
|
||||
|
||||
block meta
|
||||
if user.host || profile.noCrawle
|
||||
meta(name='robots' content='noindex')
|
||||
if profile.preventAiLearning
|
||||
meta(name='robots' content='noimageai')
|
||||
meta(name='robots' content='noai')
|
||||
|
||||
meta(name='misskey:user-username' content=user.username)
|
||||
meta(name='misskey:user-id' content=user.id)
|
||||
|
||||
if profile.twitter
|
||||
meta(name='twitter:creator' content=`@${profile.twitter.screenName}`)
|
||||
|
||||
if !sub
|
||||
if federationEnabled
|
||||
if !user.host
|
||||
link(rel='alternate' href=`${config.url}/users/${user.id}` type='application/activity+json')
|
||||
if user.uri
|
||||
link(rel='alternate' href=user.uri type='application/activity+json')
|
||||
if profile.url
|
||||
link(rel='alternate' href=profile.url type='text/html')
|
||||
|
||||
each m in me
|
||||
link(rel='me' href=`${m}`)
|
||||
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { Packed } from '@/misc/json-schema.js';
|
||||
import type { MiUserProfile } from '@/models/UserProfile.js';
|
||||
import type { CommonProps } from '@/server/web/views/_.js';
|
||||
import { Layout } from '@/server/web/views/base.js';
|
||||
|
||||
export function UserPage(props: CommonProps<{
|
||||
user: Packed<'UserDetailed'>;
|
||||
profile: MiUserProfile;
|
||||
sub?: string;
|
||||
}>) {
|
||||
const title = props.user.name ? `${props.user.name} (@${props.user.username}${props.user.host ? `@${props.user.host}` : ''})` : `@${props.user.username}${props.user.host ? `@${props.user.host}` : ''}`;
|
||||
const me = props.profile.fields
|
||||
? props.profile.fields
|
||||
.filter(field => field.value != null && field.value.match(/^https?:/))
|
||||
.map(field => field.value)
|
||||
: [];
|
||||
|
||||
function ogBlock() {
|
||||
return (
|
||||
<>
|
||||
<meta property="og:type" content="blog" />
|
||||
<meta property="og:title" content={title} />
|
||||
{props.user.description != null ? <meta property="og:description" content={props.user.description} /> : null}
|
||||
<meta property="og:url" content={`${props.config.url}/@${props.user.username}`} />
|
||||
<meta property="og:image" content={props.user.avatarUrl} />
|
||||
<meta property="twitter:card" content="summary" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function metaBlock() {
|
||||
return (
|
||||
<>
|
||||
{props.user.host != null || props.profile.noCrawle ? <meta name="robots" content="noindex" /> : null}
|
||||
{props.profile.preventAiLearning ? (
|
||||
<>
|
||||
<meta name="robots" content="noimageai" />
|
||||
<meta name="robots" content="noai" />
|
||||
</>
|
||||
) : null}
|
||||
<meta name="misskey:user-username" content={props.user.username} />
|
||||
<meta name="misskey:user-id" content={props.user.id} />
|
||||
|
||||
{props.sub == null && props.federationEnabled ? (
|
||||
<>
|
||||
{props.user.host == null ? <link rel="alternate" type="application/activity+json" href={`${props.config.url}/users/${props.user.id}`} /> : null}
|
||||
{props.user.uri != null ? <link rel="alternate" type="application/activity+json" href={props.user.uri} /> : null}
|
||||
{props.profile.url != null ? <link rel="alternate" type="text/html" href={props.profile.url} /> : null}
|
||||
</>
|
||||
) : null}
|
||||
|
||||
{me.map((url) => (
|
||||
<link rel="me" href={url} />
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout
|
||||
{...props}
|
||||
title={`${props.user.name || props.user.username} (@${props.user.username}) | ${props.instanceName}`}
|
||||
desc={props.user.description ?? ''}
|
||||
metaSlot={metaBlock()}
|
||||
ogSlot={ogBlock()}
|
||||
>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
@@ -40,10 +40,6 @@ services:
|
||||
source: ./.config/a.test.default.yml
|
||||
target: /misskey/.config/default.yml
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ../scripts/compile_config.js
|
||||
target: /misskey/packages/backend/scripts/compile_config.js
|
||||
read_only: true
|
||||
|
||||
db.a.test:
|
||||
extends:
|
||||
|
||||
@@ -40,10 +40,6 @@ services:
|
||||
source: ./.config/b.test.default.yml
|
||||
target: /misskey/.config/default.yml
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ../scripts/compile_config.js
|
||||
target: /misskey/packages/backend/scripts/compile_config.js
|
||||
read_only: true
|
||||
|
||||
db.b.test:
|
||||
extends:
|
||||
|
||||
@@ -42,10 +42,6 @@ services:
|
||||
source: ../package.json
|
||||
target: /misskey/packages/backend/package.json
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ../scripts/compile_config.js
|
||||
target: /misskey/packages/backend/scripts/compile_config.js
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ../../misskey-js/built
|
||||
target: /misskey/packages/misskey-js/built
|
||||
@@ -54,14 +50,6 @@ services:
|
||||
source: ../../misskey-js/package.json
|
||||
target: /misskey/packages/misskey-js/package.json
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ../../i18n/built
|
||||
target: /misskey/packages/i18n/built
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ../../i18n/package.json
|
||||
target: /misskey/packages/i18n/package.json
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ../../misskey-reversi/built
|
||||
target: /misskey/packages/misskey-reversi/built
|
||||
|
||||
@@ -54,10 +54,6 @@ services:
|
||||
source: ../jest.js
|
||||
target: /misskey/packages/backend/jest.js
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ../scripts/compile_config.js
|
||||
target: /misskey/packages/backend/scripts/compile_config.js
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ../../misskey-js/built
|
||||
target: /misskey/packages/misskey-js/built
|
||||
@@ -66,14 +62,6 @@ services:
|
||||
source: ../../misskey-js/package.json
|
||||
target: /misskey/packages/misskey-js/package.json
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ../../i18n/built
|
||||
target: /misskey/packages/i18n/built
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ../../i18n/package.json
|
||||
target: /misskey/packages/i18n/package.json
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ../../../package.json
|
||||
target: /misskey/package.json
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
/* Language and Environment */
|
||||
"target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
||||
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||
"jsx": "react-jsx", /* Specify what JSX code is generated. */
|
||||
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
||||
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
||||
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
||||
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
||||
"jsxImportSource": "@kitajs/html", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
||||
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
||||
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
||||
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
||||
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
"emitDecoratorMetadata": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "@kitajs/html",
|
||||
"rootDir": "../src",
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
"emitDecoratorMetadata": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "@kitajs/html",
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@/*": ["../src/*"]
|
||||
|
||||
@@ -23,17 +23,12 @@
|
||||
"emitDecoratorMetadata": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "@kitajs/html",
|
||||
"rootDir": "./src",
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
},
|
||||
"outDir": "./built",
|
||||
"plugins": [
|
||||
{"name": "@kitajs/ts-html-plugin"}
|
||||
],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
@@ -48,8 +43,7 @@
|
||||
},
|
||||
"compileOnSave": false,
|
||||
"include": [
|
||||
"./src/**/*.ts",
|
||||
"./src/**/*.tsx"
|
||||
"./src/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"./src/**/*.test.ts"
|
||||
|
||||
@@ -144,9 +144,7 @@ export function applyTheme(theme: Theme, persist = true) {
|
||||
if (theme.id === currentThemeId && miLocalStorage.getItem('themeCachedVersion') === version) return;
|
||||
currentThemeId = theme.id;
|
||||
|
||||
// visibilityStateがhiddenな状態でstartViewTransitionするとブラウザによってはエラーになる
|
||||
// 通常hiddenな時に呼ばれることはないが、iOSのPWAだとアプリ切り替え時に(何故か)hiddenな状態で(何故か)一瞬デバイスのダークモード判定が変わりapplyThemeが呼ばれる場合がある
|
||||
if (window.document.startViewTransition != null && window.document.visibilityState === 'visible') {
|
||||
if (window.document.startViewTransition != null) {
|
||||
window.document.documentElement.classList.add('_themeChanging_');
|
||||
try {
|
||||
window.document.startViewTransition(async () => {
|
||||
|
||||
@@ -8,10 +8,6 @@
|
||||
".": {
|
||||
"types": "./built/index.d.ts",
|
||||
"import": "./built/index.js"
|
||||
},
|
||||
"./const": {
|
||||
"types": "./built/const.d.ts",
|
||||
"import": "./built/const.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export const languages = [
|
||||
'ar-SA',
|
||||
'ca-ES',
|
||||
'cs-CZ',
|
||||
'da-DK',
|
||||
'de-DE',
|
||||
'en-US',
|
||||
'es-ES',
|
||||
'fr-FR',
|
||||
'id-ID',
|
||||
'it-IT',
|
||||
'ja-JP',
|
||||
'ja-KS',
|
||||
'kab-KAB',
|
||||
'kn-IN',
|
||||
'ko-KR',
|
||||
'nl-NL',
|
||||
'no-NO',
|
||||
'pl-PL',
|
||||
'pt-PT',
|
||||
'ru-RU',
|
||||
'sk-SK',
|
||||
'th-TH',
|
||||
'tr-TR',
|
||||
'ug-CN',
|
||||
'uk-UA',
|
||||
'vi-VN',
|
||||
'zh-CN',
|
||||
'zh-TW',
|
||||
] as const;
|
||||
|
||||
export const primaries = {
|
||||
'en': 'US',
|
||||
'ja': 'JP',
|
||||
'zh': 'CN',
|
||||
} as const satisfies Record<string, string>;
|
||||
@@ -9,12 +9,48 @@
|
||||
|
||||
import * as fs from 'node:fs';
|
||||
import * as yaml from 'js-yaml';
|
||||
import { languages, primaries } from './const.js';
|
||||
import type { Locale } from './autogen/locale.js';
|
||||
import type { ILocale, ParameterizedString } from './types.js';
|
||||
|
||||
const languages = [
|
||||
'ar-SA',
|
||||
'ca-ES',
|
||||
'cs-CZ',
|
||||
'da-DK',
|
||||
'de-DE',
|
||||
'en-US',
|
||||
'es-ES',
|
||||
'fr-FR',
|
||||
'id-ID',
|
||||
'it-IT',
|
||||
'ja-JP',
|
||||
'ja-KS',
|
||||
'kab-KAB',
|
||||
'kn-IN',
|
||||
'ko-KR',
|
||||
'nl-NL',
|
||||
'no-NO',
|
||||
'pl-PL',
|
||||
'pt-PT',
|
||||
'ru-RU',
|
||||
'sk-SK',
|
||||
'th-TH',
|
||||
'tr-TR',
|
||||
'ug-CN',
|
||||
'uk-UA',
|
||||
'vi-VN',
|
||||
'zh-CN',
|
||||
'zh-TW',
|
||||
] as const;
|
||||
|
||||
type Language = typeof languages[number];
|
||||
|
||||
const primaries = {
|
||||
'en': 'US',
|
||||
'ja': 'JP',
|
||||
'zh': 'CN',
|
||||
} as const satisfies Record<string, string>;
|
||||
|
||||
type PrimaryLang = keyof typeof primaries;
|
||||
|
||||
type Locales = Record<Language, ILocale>;
|
||||
@@ -125,6 +161,6 @@ async function writeFrontendLocalesJson(destDir: string, version: string): Promi
|
||||
}
|
||||
}
|
||||
|
||||
export { locales, languages, build, writeFrontendLocalesJson };
|
||||
export { locales, build, writeFrontendLocalesJson };
|
||||
export type { Language, Locale, ILocale, ParameterizedString };
|
||||
export default locales;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"type": "module",
|
||||
"name": "misskey-js",
|
||||
"version": "2025.12.0-alpha.1",
|
||||
"version": "2025.11.2-alpha.1",
|
||||
"description": "Misskey SDK for JavaScript",
|
||||
"license": "MIT",
|
||||
"main": "./built/index.js",
|
||||
@@ -37,11 +37,11 @@
|
||||
"directory": "packages/misskey-js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@microsoft/api-extractor": "7.55.1",
|
||||
"@microsoft/api-extractor": "7.55.0",
|
||||
"@types/node": "24.10.1",
|
||||
"@typescript-eslint/eslint-plugin": "8.47.0",
|
||||
"@typescript-eslint/parser": "8.47.0",
|
||||
"@vitest/coverage-v8": "4.0.13",
|
||||
"@vitest/coverage-v8": "4.0.10",
|
||||
"esbuild": "0.27.0",
|
||||
"execa": "9.6.0",
|
||||
"glob": "13.0.0",
|
||||
@@ -49,7 +49,7 @@
|
||||
"nodemon": "3.1.11",
|
||||
"tsd": "0.33.0",
|
||||
"typescript": "5.9.3",
|
||||
"vitest": "4.0.13",
|
||||
"vitest": "4.0.10",
|
||||
"vitest-websocket-mock": "0.5.0"
|
||||
},
|
||||
"files": [
|
||||
|
||||
474
pnpm-lock.yaml
generated
474
pnpm-lock.yaml
generated
@@ -69,23 +69,26 @@ importers:
|
||||
specifier: 10.1.0
|
||||
version: 10.1.0
|
||||
cypress:
|
||||
specifier: 15.7.0
|
||||
version: 15.7.0
|
||||
specifier: 15.6.0
|
||||
version: 15.6.0
|
||||
eslint:
|
||||
specifier: 9.39.1
|
||||
version: 9.39.1
|
||||
globals:
|
||||
specifier: 16.5.0
|
||||
version: 16.5.0
|
||||
i18n:
|
||||
specifier: workspace:*
|
||||
version: link:packages/i18n
|
||||
ncp:
|
||||
specifier: 2.0.0
|
||||
version: 2.0.0
|
||||
pnpm:
|
||||
specifier: 10.23.0
|
||||
version: 10.23.0
|
||||
specifier: 10.22.0
|
||||
version: 10.22.0
|
||||
start-server-and-test:
|
||||
specifier: 2.1.3
|
||||
version: 2.1.3
|
||||
specifier: 2.1.2
|
||||
version: 2.1.2
|
||||
optionalDependencies:
|
||||
'@tensorflow/tfjs-core':
|
||||
specifier: 4.22.0
|
||||
@@ -123,9 +126,9 @@ importers:
|
||||
'@fastify/static':
|
||||
specifier: 8.3.0
|
||||
version: 8.3.0
|
||||
'@kitajs/html':
|
||||
specifier: 4.2.11
|
||||
version: 4.2.11
|
||||
'@fastify/view':
|
||||
specifier: 11.1.1
|
||||
version: 11.1.1
|
||||
'@misskey-dev/sharp-read-bmp':
|
||||
specifier: 1.2.0
|
||||
version: 1.2.0
|
||||
@@ -252,9 +255,6 @@ importers:
|
||||
http-link-header:
|
||||
specifier: 1.1.3
|
||||
version: 1.1.3
|
||||
i18n:
|
||||
specifier: workspace:*
|
||||
version: link:../i18n
|
||||
ioredis:
|
||||
specifier: 5.8.2
|
||||
version: 5.8.2
|
||||
@@ -267,6 +267,9 @@ importers:
|
||||
is-svg:
|
||||
specifier: 6.1.0
|
||||
version: 6.1.0
|
||||
js-yaml:
|
||||
specifier: 4.1.1
|
||||
version: 4.1.1
|
||||
json5:
|
||||
specifier: 2.2.3
|
||||
version: 2.2.3
|
||||
@@ -285,6 +288,9 @@ importers:
|
||||
mfm-js:
|
||||
specifier: 0.25.0
|
||||
version: 0.25.0
|
||||
microformats-parser:
|
||||
specifier: 2.0.4
|
||||
version: 2.0.4
|
||||
mime-types:
|
||||
specifier: 3.0.2
|
||||
version: 3.0.2
|
||||
@@ -342,6 +348,9 @@ importers:
|
||||
promise-limit:
|
||||
specifier: 2.7.0
|
||||
version: 2.7.0
|
||||
pug:
|
||||
specifier: 3.0.3
|
||||
version: 3.0.3
|
||||
qrcode:
|
||||
specifier: 1.5.4
|
||||
version: 1.5.4
|
||||
@@ -430,9 +439,6 @@ importers:
|
||||
'@jest/globals':
|
||||
specifier: 29.7.0
|
||||
version: 29.7.0
|
||||
'@kitajs/ts-html-plugin':
|
||||
specifier: 4.1.3
|
||||
version: 4.1.3(@kitajs/html@4.2.11)(typescript@5.9.3)
|
||||
'@nestjs/platform-express':
|
||||
specifier: 11.1.9
|
||||
version: 11.1.9(@nestjs/common@11.1.9(reflect-metadata@0.2.2)(rxjs@7.8.2))(@nestjs/core@11.1.9)
|
||||
@@ -469,6 +475,9 @@ importers:
|
||||
'@types/jest':
|
||||
specifier: 29.5.14
|
||||
version: 29.5.14
|
||||
'@types/js-yaml':
|
||||
specifier: 4.0.9
|
||||
version: 4.0.9
|
||||
'@types/jsonld':
|
||||
specifier: 1.5.15
|
||||
version: 1.5.15
|
||||
@@ -499,6 +508,9 @@ importers:
|
||||
'@types/pg':
|
||||
specifier: 8.15.6
|
||||
version: 8.15.6
|
||||
'@types/pug':
|
||||
specifier: 2.0.10
|
||||
version: 2.0.10
|
||||
'@types/qrcode':
|
||||
specifier: 1.5.6
|
||||
version: 1.5.6
|
||||
@@ -571,9 +583,6 @@ importers:
|
||||
jest-util:
|
||||
specifier: 29.7.0
|
||||
version: 29.7.0
|
||||
js-yaml:
|
||||
specifier: 4.1.1
|
||||
version: 4.1.1
|
||||
nodemon:
|
||||
specifier: 3.1.11
|
||||
version: 3.1.11
|
||||
@@ -586,9 +595,6 @@ importers:
|
||||
supertest:
|
||||
specifier: 7.1.4
|
||||
version: 7.1.4
|
||||
vite:
|
||||
specifier: 7.2.4
|
||||
version: 7.2.4(@types/node@24.10.1)(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6)
|
||||
optionalDependencies:
|
||||
'@swc/core-android-arm64':
|
||||
specifier: 1.3.11
|
||||
@@ -1457,8 +1463,8 @@ importers:
|
||||
version: 4.4.0
|
||||
devDependencies:
|
||||
'@microsoft/api-extractor':
|
||||
specifier: 7.55.1
|
||||
version: 7.55.1(@types/node@24.10.1)
|
||||
specifier: 7.55.0
|
||||
version: 7.55.0(@types/node@24.10.1)
|
||||
'@types/node':
|
||||
specifier: 24.10.1
|
||||
version: 24.10.1
|
||||
@@ -1469,8 +1475,8 @@ importers:
|
||||
specifier: 8.47.0
|
||||
version: 8.47.0(eslint@9.39.1)(typescript@5.9.3)
|
||||
'@vitest/coverage-v8':
|
||||
specifier: 4.0.13
|
||||
version: 4.0.13(vitest@4.0.13(@opentelemetry/api@1.9.0)(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6))
|
||||
specifier: 4.0.10
|
||||
version: 4.0.10(vitest@4.0.10(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6))
|
||||
esbuild:
|
||||
specifier: 0.27.0
|
||||
version: 0.27.0
|
||||
@@ -1493,11 +1499,11 @@ importers:
|
||||
specifier: 5.9.3
|
||||
version: 5.9.3
|
||||
vitest:
|
||||
specifier: 4.0.13
|
||||
version: 4.0.13(@opentelemetry/api@1.9.0)(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6)
|
||||
specifier: 4.0.10
|
||||
version: 4.0.10(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6)
|
||||
vitest-websocket-mock:
|
||||
specifier: 0.5.0
|
||||
version: 0.5.0(vitest@4.0.13(@opentelemetry/api@1.9.0)(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6))
|
||||
version: 0.5.0(vitest@4.0.10(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6))
|
||||
|
||||
packages/misskey-js/generator:
|
||||
devDependencies:
|
||||
@@ -2500,6 +2506,9 @@ packages:
|
||||
'@fastify/static@8.3.0':
|
||||
resolution: {integrity: sha512-yKxviR5PH1OKNnisIzZKmgZSus0r2OZb8qCSbqmw34aolT4g3UlzYfeBRym+HJ1J471CR8e2ldNub4PubD1coA==}
|
||||
|
||||
'@fastify/view@11.1.1':
|
||||
resolution: {integrity: sha512-GiHqT3R2eKJgWmy0s45eELTC447a4+lTM2o+8fSWeKwBe9VToeePuHJcKtOEXPrKGSddGO0RsNayULiS3aeHeQ==}
|
||||
|
||||
'@file-type/xml@0.4.4':
|
||||
resolution: {integrity: sha512-NhCyXoHlVZ8TqM476hyzwGJ24+D5IPSaZhmrPj7qXnEVb3q6jrFzA3mM9TBpknKSI9EuQeGTKRg2DXGUwvBBoQ==}
|
||||
|
||||
@@ -2858,17 +2867,6 @@ packages:
|
||||
'@keyv/serialize@1.1.1':
|
||||
resolution: {integrity: sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==}
|
||||
|
||||
'@kitajs/html@4.2.11':
|
||||
resolution: {integrity: sha512-gOe+zzCZKN2fPT1FUK32mHsr21ILcAOUUux/yDqQthInW8egN8RuxVp+zP3KhwWETVACkurBiKV9RWuNw+ceiw==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
'@kitajs/ts-html-plugin@4.1.3':
|
||||
resolution: {integrity: sha512-NlYrID5yMxfRKiO1eiiSC4MWveKe0ffoCJOZm4idNOqwimmLXr0g1NmvCcquOU2XLRrgzynxZqw6rhwR5CY5Nw==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
'@kitajs/html': ^4.2.10
|
||||
typescript: ^5.6.2
|
||||
|
||||
'@kurkle/color@0.3.4':
|
||||
resolution: {integrity: sha512-M5UknZPHRu3DEDWoipU6sE8PdkZ6Z/S+v4dD+Ke8IaNlpdSQah50lz1KtcFBa2vsdOnwbbnxJwVM4wty6udA5w==}
|
||||
|
||||
@@ -2899,11 +2897,11 @@ packages:
|
||||
'@types/react': '>=16'
|
||||
react: '>=16'
|
||||
|
||||
'@microsoft/api-extractor-model@7.32.1':
|
||||
resolution: {integrity: sha512-u4yJytMYiUAnhcNQcZDTh/tVtlrzKlyKrQnLOV+4Qr/5gV+cpufWzCYAB1Q23URFqD6z2RoL2UYncM9xJVGNKA==}
|
||||
'@microsoft/api-extractor-model@7.32.0':
|
||||
resolution: {integrity: sha512-QIVJSreb8fGGJy1Qx0yzGVXxvHJN1WXgkFNHFheVv1iBJNqgvp+xeT3ienJmRwXmPPc5Es/cxBrXtKZJR3i7iw==}
|
||||
|
||||
'@microsoft/api-extractor@7.55.1':
|
||||
resolution: {integrity: sha512-l8Z+8qrLkZFM3HM95Dbpqs6G39fpCa7O5p8A7AkA6hSevxkgwsOlLrEuPv0ADOyj5dI1Af5WVDiwpKG/ya5G3w==}
|
||||
'@microsoft/api-extractor@7.55.0':
|
||||
resolution: {integrity: sha512-TYc5OtAK/9E3HGgd2bIfSjQDYIwPc0dysf9rPiwXZGsq916I6W2oww9bhm1OxPOeg6rMfOX3PoroGd7oCryYog==}
|
||||
hasBin: true
|
||||
|
||||
'@microsoft/tsdoc-config@0.18.0':
|
||||
@@ -3764,8 +3762,8 @@ packages:
|
||||
'@rtsao/scc@1.1.0':
|
||||
resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==}
|
||||
|
||||
'@rushstack/node-core-library@5.19.0':
|
||||
resolution: {integrity: sha512-BxAopbeWBvNJ6VGiUL+5lbJXywTdsnMeOS8j57Cn/xY10r6sV/gbsTlfYKjzVCUBZATX2eRzJHSMCchsMTGN6A==}
|
||||
'@rushstack/node-core-library@5.18.0':
|
||||
resolution: {integrity: sha512-XDebtBdw5S3SuZIt+Ra2NieT8kQ3D2Ow1HxhDQ/2soinswnOu9e7S69VSwTOLlQnx5mpWbONu+5JJjDxMAb6Fw==}
|
||||
peerDependencies:
|
||||
'@types/node': '*'
|
||||
peerDependenciesMeta:
|
||||
@@ -3783,16 +3781,16 @@ packages:
|
||||
'@rushstack/rig-package@0.6.0':
|
||||
resolution: {integrity: sha512-ZQmfzsLE2+Y91GF15c65L/slMRVhF6Hycq04D4TwtdGaUAbIXXg9c5pKA5KFU7M4QMaihoobp9JJYpYcaY3zOw==}
|
||||
|
||||
'@rushstack/terminal@0.19.4':
|
||||
resolution: {integrity: sha512-f4XQk02CrKfrMgyOfhYd3qWI944dLC21S4I/LUhrlAP23GTMDNG6EK5effQtFkISwUKCgD9vMBrJZaPSUquxWQ==}
|
||||
'@rushstack/terminal@0.19.3':
|
||||
resolution: {integrity: sha512-0P8G18gK9STyO+CNBvkKPnWGMxESxecTYqOcikHOVIHXa9uAuTK+Fw8TJq2Gng1w7W6wTC9uPX6hGNvrMll2wA==}
|
||||
peerDependencies:
|
||||
'@types/node': '*'
|
||||
peerDependenciesMeta:
|
||||
'@types/node':
|
||||
optional: true
|
||||
|
||||
'@rushstack/ts-command-line@5.1.4':
|
||||
resolution: {integrity: sha512-H0I6VdJ6sOUbktDFpP2VW5N29w8v4hRoNZOQz02vtEi6ZTYL1Ju8u+TcFiFawUDrUsx/5MQTUhd79uwZZVwVlA==}
|
||||
'@rushstack/ts-command-line@5.1.3':
|
||||
resolution: {integrity: sha512-Kdv0k/BnnxIYFlMVC1IxrIS0oGQd4T4b7vKfx52Y2+wk2WZSDFIvedr7JrhenzSlm3ou5KwtoTGTGd5nbODRug==}
|
||||
|
||||
'@sec-ant/readable-stream@0.4.1':
|
||||
resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==}
|
||||
@@ -4817,6 +4815,9 @@ packages:
|
||||
'@types/pg@8.15.6':
|
||||
resolution: {integrity: sha512-NoaMtzhxOrubeL/7UZuNTrejB4MPAJ0RpxZqXQf2qXuVlTPuG6Y8p4u9dKRaue4yjmC7ZhzVO2/Yyyn25znrPQ==}
|
||||
|
||||
'@types/pug@2.0.10':
|
||||
resolution: {integrity: sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==}
|
||||
|
||||
'@types/punycode@2.1.4':
|
||||
resolution: {integrity: sha512-trzh6NzBnq8yw5e35f8xe8VTYjqM3NE7bohBtvDVf/dtUer3zYTLK1Ka3DG3p7bdtoaOHZucma6FfVKlQ134pQ==}
|
||||
|
||||
@@ -5015,6 +5016,15 @@ packages:
|
||||
vite: ^5.0.0 || ^6.0.0 || ^7.0.0
|
||||
vue: ^3.2.25
|
||||
|
||||
'@vitest/coverage-v8@4.0.10':
|
||||
resolution: {integrity: sha512-g+brmtoKa/sAeIohNJnnWhnHtU6GuqqVOSQ4SxDIPcgZWZyhJs5RmF5LpqXs8Kq64lANP+vnbn5JLzhLj/G56g==}
|
||||
peerDependencies:
|
||||
'@vitest/browser': 4.0.10
|
||||
vitest: 4.0.10
|
||||
peerDependenciesMeta:
|
||||
'@vitest/browser':
|
||||
optional: true
|
||||
|
||||
'@vitest/coverage-v8@4.0.13':
|
||||
resolution: {integrity: sha512-w77N6bmtJ3CFnL/YHiYotwW/JI3oDlR3K38WEIqegRfdMSScaYxwYKB/0jSNpOTZzUjQkG8HHEz4sdWQMWpQ5g==}
|
||||
peerDependencies:
|
||||
@@ -5030,6 +5040,9 @@ packages:
|
||||
'@vitest/expect@3.2.4':
|
||||
resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==}
|
||||
|
||||
'@vitest/expect@4.0.10':
|
||||
resolution: {integrity: sha512-3QkTX/lK39FBNwARCQRSQr0TP9+ywSdxSX+LgbJ2M1WmveXP72anTbnp2yl5fH+dU6SUmBzNMrDHs80G8G2DZg==}
|
||||
|
||||
'@vitest/expect@4.0.13':
|
||||
resolution: {integrity: sha512-zYtcnNIBm6yS7Gpr7nFTmq8ncowlMdOJkWLqYvhr/zweY6tFbDkDi8BPPOeHxEtK1rSI69H7Fd4+1sqvEGli6w==}
|
||||
|
||||
@@ -5044,6 +5057,17 @@ packages:
|
||||
vite:
|
||||
optional: true
|
||||
|
||||
'@vitest/mocker@4.0.10':
|
||||
resolution: {integrity: sha512-e2OfdexYkjkg8Hh3L9NVEfbwGXq5IZbDovkf30qW2tOh7Rh9sVtmSr2ztEXOFbymNxS4qjzLXUQIvATvN4B+lg==}
|
||||
peerDependencies:
|
||||
msw: ^2.4.9
|
||||
vite: ^6.0.0 || ^7.0.0-0
|
||||
peerDependenciesMeta:
|
||||
msw:
|
||||
optional: true
|
||||
vite:
|
||||
optional: true
|
||||
|
||||
'@vitest/mocker@4.0.13':
|
||||
resolution: {integrity: sha512-eNCwzrI5djoauklwP1fuslHBjrbR8rqIVbvNlAnkq1OTa6XT+lX68mrtPirNM9TnR69XUPt4puBCx2Wexseylg==}
|
||||
peerDependencies:
|
||||
@@ -5064,12 +5088,21 @@ packages:
|
||||
'@vitest/pretty-format@3.2.4':
|
||||
resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==}
|
||||
|
||||
'@vitest/pretty-format@4.0.10':
|
||||
resolution: {integrity: sha512-99EQbpa/zuDnvVjthwz5bH9o8iPefoQZ63WV8+bsRJZNw3qQSvSltfut8yu1Jc9mqOYi7pEbsKxYTi/rjaq6PA==}
|
||||
|
||||
'@vitest/pretty-format@4.0.13':
|
||||
resolution: {integrity: sha512-ooqfze8URWbI2ozOeLDMh8YZxWDpGXoeY3VOgcDnsUxN0jPyPWSUvjPQWqDGCBks+opWlN1E4oP1UYl3C/2EQA==}
|
||||
|
||||
'@vitest/runner@4.0.10':
|
||||
resolution: {integrity: sha512-EXU2iSkKvNwtlL8L8doCpkyclw0mc/t4t9SeOnfOFPyqLmQwuceMPA4zJBa6jw0MKsZYbw7kAn+gl7HxrlB8UQ==}
|
||||
|
||||
'@vitest/runner@4.0.13':
|
||||
resolution: {integrity: sha512-9IKlAru58wcVaWy7hz6qWPb2QzJTKt+IOVKjAx5vb5rzEFPTL6H4/R9BMvjZ2ppkxKgTrFONEJFtzvnyEpiT+A==}
|
||||
|
||||
'@vitest/snapshot@4.0.10':
|
||||
resolution: {integrity: sha512-2N4X2ZZl7kZw0qeGdQ41H0KND96L3qX1RgwuCfy6oUsF2ISGD/HpSbmms+CkIOsQmg2kulwfhJ4CI0asnZlvkg==}
|
||||
|
||||
'@vitest/snapshot@4.0.13':
|
||||
resolution: {integrity: sha512-hb7Usvyika1huG6G6l191qu1urNPsq1iFc2hmdzQY3F5/rTgqQnwwplyf8zoYHkpt7H6rw5UfIw6i/3qf9oSxQ==}
|
||||
|
||||
@@ -5079,6 +5112,9 @@ packages:
|
||||
'@vitest/spy@3.2.4':
|
||||
resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==}
|
||||
|
||||
'@vitest/spy@4.0.10':
|
||||
resolution: {integrity: sha512-AsY6sVS8OLb96GV5RoG8B6I35GAbNrC49AO+jNRF9YVGb/g9t+hzNm1H6kD0NDp8tt7VJLs6hb7YMkDXqu03iw==}
|
||||
|
||||
'@vitest/spy@4.0.13':
|
||||
resolution: {integrity: sha512-hSu+m4se0lDV5yVIcNWqjuncrmBgwaXa2utFLIrBkQCQkt+pSwyZTPFQAZiiF/63j8jYa8uAeUZ3RSfcdWaYWw==}
|
||||
|
||||
@@ -5091,6 +5127,9 @@ packages:
|
||||
'@vitest/utils@3.2.4':
|
||||
resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==}
|
||||
|
||||
'@vitest/utils@4.0.10':
|
||||
resolution: {integrity: sha512-kOuqWnEwZNtQxMKg3WmPK1vmhZu9WcoX69iwWjVz+jvKTsF1emzsv3eoPcDr6ykA3qP2bsCQE7CwqfNtAVzsmg==}
|
||||
|
||||
'@vitest/utils@4.0.13':
|
||||
resolution: {integrity: sha512-ydozWyQ4LZuu8rLp47xFUWis5VOKMdHjXCWhs1LuJsTNKww+pTHQNK4e0assIB9K80TxFyskENL6vCu3j34EYA==}
|
||||
|
||||
@@ -5917,10 +5956,6 @@ packages:
|
||||
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
cliui@9.0.1:
|
||||
resolution: {integrity: sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==}
|
||||
engines: {node: '>=20'}
|
||||
|
||||
cluster-key-slot@1.1.2:
|
||||
resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@@ -6173,6 +6208,11 @@ packages:
|
||||
csstype@3.2.3:
|
||||
resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}
|
||||
|
||||
cypress@15.6.0:
|
||||
resolution: {integrity: sha512-Vqo66GG1vpxZ7H1oDX9umfmzA3nF7Wy80QAc3VjwPREO5zTY4d1xfQFNPpOWleQl9vpdmR2z1liliOcYlRX6rQ==}
|
||||
engines: {node: ^20.1.0 || ^22.0.0 || >=24.0.0}
|
||||
hasBin: true
|
||||
|
||||
cypress@15.7.0:
|
||||
resolution: {integrity: sha512-1C81zKxnQckYm2XGi37rPV4rN0bzUoWhydhKdOyshJn5gJKszEx5as9VLSZI0jp0ye49QxmnbU4TtMpcD+OmGQ==}
|
||||
engines: {node: ^20.1.0 || ^22.0.0 || >=24.0.0}
|
||||
@@ -6457,9 +6497,6 @@ packages:
|
||||
resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
emoji-regex@10.6.0:
|
||||
resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==}
|
||||
|
||||
emoji-regex@8.0.0:
|
||||
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
|
||||
|
||||
@@ -7069,10 +7106,6 @@ packages:
|
||||
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
|
||||
engines: {node: 6.* || 8.* || >= 10.*}
|
||||
|
||||
get-east-asian-width@1.4.0:
|
||||
resolution: {integrity: sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
get-intrinsic@1.3.0:
|
||||
resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -8262,6 +8295,10 @@ packages:
|
||||
mfm-js@0.25.0:
|
||||
resolution: {integrity: sha512-JoK5TOtswXIvZSZ9hUEL+ZkcNV4onu/DtkaKeXK846+sJBBF8DvxYmPutt7nPaRDsUMmJGr64PNVMFpMGdk3hw==}
|
||||
|
||||
microformats-parser@2.0.4:
|
||||
resolution: {integrity: sha512-DA2yt3uz2JjupBGoNvaG9ngBP5vSTI1ky2yhxBai/RnQrlzo+gEzuCdvwIIjj2nh3uVPDybTP5u7uua7pOa6LA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
micromark-core-commonmark@2.0.3:
|
||||
resolution: {integrity: sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==}
|
||||
|
||||
@@ -9050,8 +9087,8 @@ packages:
|
||||
resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==}
|
||||
engines: {node: '>=10.13.0'}
|
||||
|
||||
pnpm@10.23.0:
|
||||
resolution: {integrity: sha512-IcTlaYACrel+Tv6Li0qJqN48haN5GflX56DzDzj7xbvdBZgP/ikXmy+25uaRJC4JjZRdFgF3LK0P71+2QR4qSw==}
|
||||
pnpm@10.22.0:
|
||||
resolution: {integrity: sha512-vwSe/plbKPUn/StBrgR0zikYb37cs79UUIe9Yfu+uyv3U2LRMH/aCcLSiOHkmXh6wS1Py2F6l0cYpgUfLu50HA==}
|
||||
engines: {node: '>=18.12'}
|
||||
hasBin: true
|
||||
|
||||
@@ -10078,6 +10115,11 @@ packages:
|
||||
standard-as-callback@2.1.0:
|
||||
resolution: {integrity: sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==}
|
||||
|
||||
start-server-and-test@2.1.2:
|
||||
resolution: {integrity: sha512-OIjfo3G6QV9Sh6IlMqj58oZwVhPVuU/l6uVACG7YNE9kAfDvcYoPThtb0NNT3tZMMC3wOYbXnC15yiCSNFkdRg==}
|
||||
engines: {node: '>=16'}
|
||||
hasBin: true
|
||||
|
||||
start-server-and-test@2.1.3:
|
||||
resolution: {integrity: sha512-k4EcbNjeg0odaDkAMlIeDVDByqX9PIgL4tivgP2tES6Zd8o+4pTq/HgbWCyA3VHIoZopB+wGnNPKYGGSByNriQ==}
|
||||
engines: {node: '>=16'}
|
||||
@@ -10164,10 +10206,6 @@ packages:
|
||||
resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
string-width@7.2.0:
|
||||
resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
string.prototype.trim@1.2.10:
|
||||
resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -10884,6 +10922,40 @@ packages:
|
||||
peerDependencies:
|
||||
vitest: '>=3'
|
||||
|
||||
vitest@4.0.10:
|
||||
resolution: {integrity: sha512-2Fqty3MM9CDwOVet/jaQalYlbcjATZwPYGcqpiYQqgQ/dLC7GuHdISKgTYIVF/kaishKxLzleKWWfbSDklyIKg==}
|
||||
engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
'@edge-runtime/vm': '*'
|
||||
'@types/debug': ^4.1.12
|
||||
'@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0
|
||||
'@vitest/browser-playwright': 4.0.10
|
||||
'@vitest/browser-preview': 4.0.10
|
||||
'@vitest/browser-webdriverio': 4.0.10
|
||||
'@vitest/ui': 4.0.10
|
||||
happy-dom: '*'
|
||||
jsdom: '*'
|
||||
peerDependenciesMeta:
|
||||
'@edge-runtime/vm':
|
||||
optional: true
|
||||
'@types/debug':
|
||||
optional: true
|
||||
'@types/node':
|
||||
optional: true
|
||||
'@vitest/browser-playwright':
|
||||
optional: true
|
||||
'@vitest/browser-preview':
|
||||
optional: true
|
||||
'@vitest/browser-webdriverio':
|
||||
optional: true
|
||||
'@vitest/ui':
|
||||
optional: true
|
||||
happy-dom:
|
||||
optional: true
|
||||
jsdom:
|
||||
optional: true
|
||||
|
||||
vitest@4.0.13:
|
||||
resolution: {integrity: sha512-QSD4I0fN6uZQfftryIXuqvqgBxTvJ3ZNkF6RWECd82YGAYAfhcppBLFXzXJHQAAhVFyYEuFTrq6h0hQqjB7jIQ==}
|
||||
engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0}
|
||||
@@ -11006,6 +11078,11 @@ packages:
|
||||
resolution: {integrity: sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
wait-on@8.0.5:
|
||||
resolution: {integrity: sha512-J3WlS0txVHkhLRb2FsmRg3dkMTCV1+M6Xra3Ho7HzZDHpE7DCOnoSoCJsZotrmW3uRMhvIJGSKUKrh/MeF4iag==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
hasBin: true
|
||||
|
||||
wait-on@9.0.3:
|
||||
resolution: {integrity: sha512-13zBnyYvFDW1rBvWiJ6Av3ymAaq8EDQuvxZnPIw3g04UqGi4TyoIJABmfJ6zrvKo9yeFQExNkOk7idQbDJcuKA==}
|
||||
engines: {node: '>=20.0.0'}
|
||||
@@ -11125,10 +11202,6 @@ packages:
|
||||
resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
wrap-ansi@9.0.2:
|
||||
resolution: {integrity: sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
wrappy@1.0.2:
|
||||
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
|
||||
|
||||
@@ -11210,10 +11283,6 @@ packages:
|
||||
resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
yargs-parser@22.0.0:
|
||||
resolution: {integrity: sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==}
|
||||
engines: {node: ^20.19.0 || ^22.12.0 || >=23}
|
||||
|
||||
yargs@15.4.1:
|
||||
resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==}
|
||||
engines: {node: '>=8'}
|
||||
@@ -11226,10 +11295,6 @@ packages:
|
||||
resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
yargs@18.0.0:
|
||||
resolution: {integrity: sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==}
|
||||
engines: {node: ^20.19.0 || ^22.12.0 || >=23}
|
||||
|
||||
yauzl@2.10.0:
|
||||
resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==}
|
||||
|
||||
@@ -12518,6 +12583,11 @@ snapshots:
|
||||
fastq: 1.19.1
|
||||
glob: 11.1.0
|
||||
|
||||
'@fastify/view@11.1.1':
|
||||
dependencies:
|
||||
fastify-plugin: 5.1.0
|
||||
toad-cache: 3.7.0
|
||||
|
||||
'@file-type/xml@0.4.4':
|
||||
dependencies:
|
||||
sax: 1.4.3
|
||||
@@ -12928,18 +12998,6 @@ snapshots:
|
||||
|
||||
'@keyv/serialize@1.1.1': {}
|
||||
|
||||
'@kitajs/html@4.2.11':
|
||||
dependencies:
|
||||
csstype: 3.2.3
|
||||
|
||||
'@kitajs/ts-html-plugin@4.1.3(@kitajs/html@4.2.11)(typescript@5.9.3)':
|
||||
dependencies:
|
||||
'@kitajs/html': 4.2.11
|
||||
chalk: 5.6.2
|
||||
tslib: 2.8.1
|
||||
typescript: 5.9.3
|
||||
yargs: 18.0.0
|
||||
|
||||
'@kurkle/color@0.3.4': {}
|
||||
|
||||
'@levischuck/tiny-cbor@0.2.11': {}
|
||||
@@ -12976,23 +13034,23 @@ snapshots:
|
||||
'@types/react': 19.2.2
|
||||
react: 19.2.0
|
||||
|
||||
'@microsoft/api-extractor-model@7.32.1(@types/node@24.10.1)':
|
||||
'@microsoft/api-extractor-model@7.32.0(@types/node@24.10.1)':
|
||||
dependencies:
|
||||
'@microsoft/tsdoc': 0.16.0
|
||||
'@microsoft/tsdoc-config': 0.18.0
|
||||
'@rushstack/node-core-library': 5.19.0(@types/node@24.10.1)
|
||||
'@rushstack/node-core-library': 5.18.0(@types/node@24.10.1)
|
||||
transitivePeerDependencies:
|
||||
- '@types/node'
|
||||
|
||||
'@microsoft/api-extractor@7.55.1(@types/node@24.10.1)':
|
||||
'@microsoft/api-extractor@7.55.0(@types/node@24.10.1)':
|
||||
dependencies:
|
||||
'@microsoft/api-extractor-model': 7.32.1(@types/node@24.10.1)
|
||||
'@microsoft/api-extractor-model': 7.32.0(@types/node@24.10.1)
|
||||
'@microsoft/tsdoc': 0.16.0
|
||||
'@microsoft/tsdoc-config': 0.18.0
|
||||
'@rushstack/node-core-library': 5.19.0(@types/node@24.10.1)
|
||||
'@rushstack/node-core-library': 5.18.0(@types/node@24.10.1)
|
||||
'@rushstack/rig-package': 0.6.0
|
||||
'@rushstack/terminal': 0.19.4(@types/node@24.10.1)
|
||||
'@rushstack/ts-command-line': 5.1.4(@types/node@24.10.1)
|
||||
'@rushstack/terminal': 0.19.3(@types/node@24.10.1)
|
||||
'@rushstack/ts-command-line': 5.1.3(@types/node@24.10.1)
|
||||
diff: 8.0.2
|
||||
lodash: 4.17.21
|
||||
minimatch: 10.0.3
|
||||
@@ -13844,7 +13902,7 @@ snapshots:
|
||||
|
||||
'@rtsao/scc@1.1.0': {}
|
||||
|
||||
'@rushstack/node-core-library@5.19.0(@types/node@24.10.1)':
|
||||
'@rushstack/node-core-library@5.18.0(@types/node@24.10.1)':
|
||||
dependencies:
|
||||
ajv: 8.13.0
|
||||
ajv-draft-04: 1.0.0(ajv@8.13.0)
|
||||
@@ -13866,17 +13924,17 @@ snapshots:
|
||||
resolve: 1.22.11
|
||||
strip-json-comments: 3.1.1
|
||||
|
||||
'@rushstack/terminal@0.19.4(@types/node@24.10.1)':
|
||||
'@rushstack/terminal@0.19.3(@types/node@24.10.1)':
|
||||
dependencies:
|
||||
'@rushstack/node-core-library': 5.19.0(@types/node@24.10.1)
|
||||
'@rushstack/node-core-library': 5.18.0(@types/node@24.10.1)
|
||||
'@rushstack/problem-matcher': 0.1.1(@types/node@24.10.1)
|
||||
supports-color: 8.1.1
|
||||
optionalDependencies:
|
||||
'@types/node': 24.10.1
|
||||
|
||||
'@rushstack/ts-command-line@5.1.4(@types/node@24.10.1)':
|
||||
'@rushstack/ts-command-line@5.1.3(@types/node@24.10.1)':
|
||||
dependencies:
|
||||
'@rushstack/terminal': 0.19.4(@types/node@24.10.1)
|
||||
'@rushstack/terminal': 0.19.3(@types/node@24.10.1)
|
||||
'@types/argparse': 1.0.38
|
||||
argparse: 1.0.10
|
||||
string-argv: 0.3.2
|
||||
@@ -15213,6 +15271,8 @@ snapshots:
|
||||
pg-protocol: 1.10.3
|
||||
pg-types: 2.2.0
|
||||
|
||||
'@types/pug@2.0.10': {}
|
||||
|
||||
'@types/punycode@2.1.4': {}
|
||||
|
||||
'@types/qrcode@1.5.6':
|
||||
@@ -15442,6 +15502,23 @@ snapshots:
|
||||
vite: 7.2.4(@types/node@24.10.1)(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6)
|
||||
vue: 3.5.24(typescript@5.9.3)
|
||||
|
||||
'@vitest/coverage-v8@4.0.10(vitest@4.0.10(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6))':
|
||||
dependencies:
|
||||
'@bcoe/v8-coverage': 1.0.2
|
||||
'@vitest/utils': 4.0.10
|
||||
ast-v8-to-istanbul: 0.3.8
|
||||
debug: 4.4.3(supports-color@10.2.2)
|
||||
istanbul-lib-coverage: 3.2.2
|
||||
istanbul-lib-report: 3.0.1
|
||||
istanbul-lib-source-maps: 5.0.6
|
||||
istanbul-reports: 3.2.0
|
||||
magicast: 0.5.1
|
||||
std-env: 3.10.0
|
||||
tinyrainbow: 3.0.3
|
||||
vitest: 4.0.10(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@vitest/coverage-v8@4.0.13(vitest@4.0.13(@opentelemetry/api@1.9.0)(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6))':
|
||||
dependencies:
|
||||
'@bcoe/v8-coverage': 1.0.2
|
||||
@@ -15474,6 +15551,15 @@ snapshots:
|
||||
chai: 5.3.3
|
||||
tinyrainbow: 2.0.0
|
||||
|
||||
'@vitest/expect@4.0.10':
|
||||
dependencies:
|
||||
'@standard-schema/spec': 1.0.0
|
||||
'@types/chai': 5.2.3
|
||||
'@vitest/spy': 4.0.10
|
||||
'@vitest/utils': 4.0.10
|
||||
chai: 6.2.1
|
||||
tinyrainbow: 3.0.3
|
||||
|
||||
'@vitest/expect@4.0.13':
|
||||
dependencies:
|
||||
'@standard-schema/spec': 1.0.0
|
||||
@@ -15492,6 +15578,15 @@ snapshots:
|
||||
msw: 2.12.2(@types/node@24.10.1)(typescript@5.9.3)
|
||||
vite: 7.2.4(@types/node@24.10.1)(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6)
|
||||
|
||||
'@vitest/mocker@4.0.10(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(vite@7.2.4(@types/node@24.10.1)(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6))':
|
||||
dependencies:
|
||||
'@vitest/spy': 4.0.10
|
||||
estree-walker: 3.0.3
|
||||
magic-string: 0.30.21
|
||||
optionalDependencies:
|
||||
msw: 2.12.2(@types/node@24.10.1)(typescript@5.9.3)
|
||||
vite: 7.2.4(@types/node@24.10.1)(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6)
|
||||
|
||||
'@vitest/mocker@4.0.13(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(vite@7.2.4(@types/node@24.10.1)(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6))':
|
||||
dependencies:
|
||||
'@vitest/spy': 4.0.13
|
||||
@@ -15513,15 +15608,30 @@ snapshots:
|
||||
dependencies:
|
||||
tinyrainbow: 2.0.0
|
||||
|
||||
'@vitest/pretty-format@4.0.10':
|
||||
dependencies:
|
||||
tinyrainbow: 3.0.3
|
||||
|
||||
'@vitest/pretty-format@4.0.13':
|
||||
dependencies:
|
||||
tinyrainbow: 3.0.3
|
||||
|
||||
'@vitest/runner@4.0.10':
|
||||
dependencies:
|
||||
'@vitest/utils': 4.0.10
|
||||
pathe: 2.0.3
|
||||
|
||||
'@vitest/runner@4.0.13':
|
||||
dependencies:
|
||||
'@vitest/utils': 4.0.13
|
||||
pathe: 2.0.3
|
||||
|
||||
'@vitest/snapshot@4.0.10':
|
||||
dependencies:
|
||||
'@vitest/pretty-format': 4.0.10
|
||||
magic-string: 0.30.21
|
||||
pathe: 2.0.3
|
||||
|
||||
'@vitest/snapshot@4.0.13':
|
||||
dependencies:
|
||||
'@vitest/pretty-format': 4.0.13
|
||||
@@ -15536,6 +15646,8 @@ snapshots:
|
||||
dependencies:
|
||||
tinyspy: 4.0.4
|
||||
|
||||
'@vitest/spy@4.0.10': {}
|
||||
|
||||
'@vitest/spy@4.0.13': {}
|
||||
|
||||
'@vitest/utils@2.0.5':
|
||||
@@ -15557,6 +15669,11 @@ snapshots:
|
||||
loupe: 3.2.1
|
||||
tinyrainbow: 2.0.0
|
||||
|
||||
'@vitest/utils@4.0.10':
|
||||
dependencies:
|
||||
'@vitest/pretty-format': 4.0.10
|
||||
tinyrainbow: 3.0.3
|
||||
|
||||
'@vitest/utils@4.0.13':
|
||||
dependencies:
|
||||
'@vitest/pretty-format': 4.0.13
|
||||
@@ -16589,12 +16706,6 @@ snapshots:
|
||||
strip-ansi: 6.0.1
|
||||
wrap-ansi: 7.0.0
|
||||
|
||||
cliui@9.0.1:
|
||||
dependencies:
|
||||
string-width: 7.2.0
|
||||
strip-ansi: 7.1.2
|
||||
wrap-ansi: 9.0.2
|
||||
|
||||
cluster-key-slot@1.1.2: {}
|
||||
|
||||
co@4.6.0: {}
|
||||
@@ -16851,6 +16962,52 @@ snapshots:
|
||||
|
||||
csstype@3.2.3: {}
|
||||
|
||||
cypress@15.6.0:
|
||||
dependencies:
|
||||
'@cypress/request': 3.0.9
|
||||
'@cypress/xvfb': 1.2.4(supports-color@8.1.1)
|
||||
'@types/sinonjs__fake-timers': 8.1.1
|
||||
'@types/sizzle': 2.3.10
|
||||
'@types/tmp': 0.2.6
|
||||
arch: 2.2.0
|
||||
blob-util: 2.0.2
|
||||
bluebird: 3.7.2
|
||||
buffer: 5.7.1
|
||||
cachedir: 2.4.0
|
||||
chalk: 4.1.2
|
||||
ci-info: 4.3.1
|
||||
cli-cursor: 3.1.0
|
||||
cli-table3: 0.6.1
|
||||
commander: 6.2.1
|
||||
common-tags: 1.8.2
|
||||
dayjs: 1.11.19
|
||||
debug: 4.4.3(supports-color@8.1.1)
|
||||
enquirer: 2.4.1
|
||||
eventemitter2: 6.4.7
|
||||
execa: 4.1.0
|
||||
executable: 4.1.1
|
||||
extract-zip: 2.0.1(supports-color@8.1.1)
|
||||
figures: 3.2.0
|
||||
fs-extra: 9.1.0
|
||||
hasha: 5.2.2
|
||||
is-installed-globally: 0.4.0
|
||||
listr2: 3.14.0(enquirer@2.4.1)
|
||||
lodash: 4.17.21
|
||||
log-symbols: 4.1.0
|
||||
minimist: 1.2.8
|
||||
ospath: 1.2.2
|
||||
pretty-bytes: 5.6.0
|
||||
process: 0.11.10
|
||||
proxy-from-env: 1.0.0
|
||||
request-progress: 3.0.0
|
||||
semver: 7.7.3
|
||||
supports-color: 8.1.1
|
||||
systeminformation: 5.27.7
|
||||
tmp: 0.2.5
|
||||
tree-kill: 1.2.2
|
||||
untildify: 4.0.0
|
||||
yauzl: 2.10.0
|
||||
|
||||
cypress@15.7.0:
|
||||
dependencies:
|
||||
'@cypress/request': 3.0.9
|
||||
@@ -17180,8 +17337,6 @@ snapshots:
|
||||
|
||||
emittery@0.13.1: {}
|
||||
|
||||
emoji-regex@10.6.0: {}
|
||||
|
||||
emoji-regex@8.0.0: {}
|
||||
|
||||
emoji-regex@9.2.2: {}
|
||||
@@ -18067,8 +18222,6 @@ snapshots:
|
||||
|
||||
get-caller-file@2.0.5: {}
|
||||
|
||||
get-east-asian-width@1.4.0: {}
|
||||
|
||||
get-intrinsic@1.3.0:
|
||||
dependencies:
|
||||
call-bind-apply-helpers: 1.0.2
|
||||
@@ -19571,6 +19724,10 @@ snapshots:
|
||||
dependencies:
|
||||
'@twemoji/parser': 16.0.0
|
||||
|
||||
microformats-parser@2.0.4:
|
||||
dependencies:
|
||||
parse5: 7.3.0
|
||||
|
||||
micromark-core-commonmark@2.0.3:
|
||||
dependencies:
|
||||
decode-named-character-reference: 1.2.0
|
||||
@@ -20459,7 +20616,7 @@ snapshots:
|
||||
|
||||
pngjs@5.0.0: {}
|
||||
|
||||
pnpm@10.23.0: {}
|
||||
pnpm@10.22.0: {}
|
||||
|
||||
polished@4.3.1:
|
||||
dependencies:
|
||||
@@ -21618,6 +21775,19 @@ snapshots:
|
||||
|
||||
standard-as-callback@2.1.0: {}
|
||||
|
||||
start-server-and-test@2.1.2:
|
||||
dependencies:
|
||||
arg: 5.0.2
|
||||
bluebird: 3.7.2
|
||||
check-more-types: 2.24.0
|
||||
debug: 4.4.3(supports-color@10.2.2)
|
||||
execa: 5.1.1
|
||||
lazy-ass: 1.6.0
|
||||
ps-tree: 1.2.0
|
||||
wait-on: 8.0.5(debug@4.4.3)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
start-server-and-test@2.1.3:
|
||||
dependencies:
|
||||
arg: 5.0.2
|
||||
@@ -21728,12 +21898,6 @@ snapshots:
|
||||
emoji-regex: 9.2.2
|
||||
strip-ansi: 7.1.2
|
||||
|
||||
string-width@7.2.0:
|
||||
dependencies:
|
||||
emoji-regex: 10.6.0
|
||||
get-east-asian-width: 1.4.0
|
||||
strip-ansi: 7.1.2
|
||||
|
||||
string.prototype.trim@1.2.10:
|
||||
dependencies:
|
||||
call-bind: 1.0.8
|
||||
@@ -22384,11 +22548,52 @@ snapshots:
|
||||
dependencies:
|
||||
vitest: 4.0.13(@opentelemetry/api@1.9.0)(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6)
|
||||
|
||||
vitest-websocket-mock@0.5.0(vitest@4.0.13(@opentelemetry/api@1.9.0)(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6)):
|
||||
vitest-websocket-mock@0.5.0(vitest@4.0.10(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6)):
|
||||
dependencies:
|
||||
'@vitest/utils': 3.2.4
|
||||
mock-socket: 9.3.1
|
||||
vitest: 4.0.13(@opentelemetry/api@1.9.0)(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6)
|
||||
vitest: 4.0.10(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6)
|
||||
|
||||
vitest@4.0.10(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6):
|
||||
dependencies:
|
||||
'@vitest/expect': 4.0.10
|
||||
'@vitest/mocker': 4.0.10(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(vite@7.2.4(@types/node@24.10.1)(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6))
|
||||
'@vitest/pretty-format': 4.0.10
|
||||
'@vitest/runner': 4.0.10
|
||||
'@vitest/snapshot': 4.0.10
|
||||
'@vitest/spy': 4.0.10
|
||||
'@vitest/utils': 4.0.10
|
||||
debug: 4.4.3(supports-color@10.2.2)
|
||||
es-module-lexer: 1.7.0
|
||||
expect-type: 1.2.2
|
||||
magic-string: 0.30.21
|
||||
pathe: 2.0.3
|
||||
picomatch: 4.0.3
|
||||
std-env: 3.10.0
|
||||
tinybench: 2.9.0
|
||||
tinyexec: 0.3.2
|
||||
tinyglobby: 0.2.15
|
||||
tinyrainbow: 3.0.3
|
||||
vite: 7.2.4(@types/node@24.10.1)(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6)
|
||||
why-is-node-running: 2.3.0
|
||||
optionalDependencies:
|
||||
'@types/debug': 4.1.12
|
||||
'@types/node': 24.10.1
|
||||
happy-dom: 20.0.10
|
||||
jsdom: 27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
|
||||
transitivePeerDependencies:
|
||||
- jiti
|
||||
- less
|
||||
- lightningcss
|
||||
- msw
|
||||
- sass
|
||||
- sass-embedded
|
||||
- stylus
|
||||
- sugarss
|
||||
- supports-color
|
||||
- terser
|
||||
- tsx
|
||||
- yaml
|
||||
|
||||
vitest@4.0.13(@opentelemetry/api@1.9.0)(@types/debug@4.1.12)(@types/node@24.10.1)(happy-dom@20.0.10)(jsdom@27.2.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(msw@2.12.2(@types/node@24.10.1)(typescript@5.9.3))(sass@1.94.2)(terser@5.44.1)(tsx@4.20.6):
|
||||
dependencies:
|
||||
@@ -22526,6 +22731,16 @@ snapshots:
|
||||
xml-name-validator: 5.0.0
|
||||
optional: true
|
||||
|
||||
wait-on@8.0.5(debug@4.4.3):
|
||||
dependencies:
|
||||
axios: 1.13.2(debug@4.4.3)
|
||||
joi: 18.0.1
|
||||
lodash: 4.17.21
|
||||
minimist: 1.2.8
|
||||
rxjs: 7.8.2
|
||||
transitivePeerDependencies:
|
||||
- debug
|
||||
|
||||
wait-on@9.0.3(debug@4.4.3):
|
||||
dependencies:
|
||||
axios: 1.13.2(debug@4.4.3)
|
||||
@@ -22684,12 +22899,6 @@ snapshots:
|
||||
string-width: 5.1.2
|
||||
strip-ansi: 7.1.2
|
||||
|
||||
wrap-ansi@9.0.2:
|
||||
dependencies:
|
||||
ansi-styles: 6.2.3
|
||||
string-width: 7.2.0
|
||||
strip-ansi: 7.1.2
|
||||
|
||||
wrappy@1.0.2: {}
|
||||
|
||||
write-file-atomic@4.0.2:
|
||||
@@ -22746,8 +22955,6 @@ snapshots:
|
||||
|
||||
yargs-parser@21.1.1: {}
|
||||
|
||||
yargs-parser@22.0.0: {}
|
||||
|
||||
yargs@15.4.1:
|
||||
dependencies:
|
||||
cliui: 6.0.0
|
||||
@@ -22782,15 +22989,6 @@ snapshots:
|
||||
y18n: 5.0.8
|
||||
yargs-parser: 21.1.1
|
||||
|
||||
yargs@18.0.0:
|
||||
dependencies:
|
||||
cliui: 9.0.1
|
||||
escalade: 3.2.0
|
||||
get-caller-file: 2.0.5
|
||||
string-width: 7.2.0
|
||||
y18n: 5.0.8
|
||||
yargs-parser: 22.0.0
|
||||
|
||||
yauzl@2.10.0:
|
||||
dependencies:
|
||||
buffer-crc32: 0.2.13
|
||||
|
||||
@@ -6,7 +6,12 @@
|
||||
import * as fs from 'node:fs/promises';
|
||||
import * as path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import cssnano from 'cssnano';
|
||||
import * as yaml from 'js-yaml';
|
||||
import postcss from 'postcss';
|
||||
import * as terser from 'terser';
|
||||
|
||||
import { locales } from 'i18n';
|
||||
import buildTarball from './tarball.mjs';
|
||||
|
||||
const configDir = fileURLToPath(new URL('../.config', import.meta.url));
|
||||
@@ -24,9 +29,49 @@ async function copyFrontendFonts() {
|
||||
await fs.cp('./packages/frontend/node_modules/three/examples/fonts', './built/_frontend_dist_/fonts', { dereference: true, recursive: true });
|
||||
}
|
||||
|
||||
async function copyBackendViews() {
|
||||
await fs.cp('./packages/backend/src/server/web/views', './packages/backend/built/server/web/views', { recursive: true });
|
||||
}
|
||||
|
||||
async function buildBackendScript() {
|
||||
await fs.mkdir('./packages/backend/built/server/web', { recursive: true });
|
||||
|
||||
for (const file of [
|
||||
'./packages/backend/src/server/web/boot.js',
|
||||
'./packages/backend/src/server/web/boot.embed.js',
|
||||
'./packages/backend/src/server/web/bios.js',
|
||||
'./packages/backend/src/server/web/cli.js',
|
||||
'./packages/backend/src/server/web/error.js',
|
||||
]) {
|
||||
let source = await fs.readFile(file, { encoding: 'utf-8' });
|
||||
source = source.replaceAll('LANGS', JSON.stringify(Object.keys(locales)));
|
||||
const { code } = await terser.minify(source, { toplevel: true });
|
||||
await fs.writeFile(`./packages/backend/built/server/web/${path.basename(file)}`, code);
|
||||
}
|
||||
}
|
||||
|
||||
async function buildBackendStyle() {
|
||||
await fs.mkdir('./packages/backend/built/server/web', { recursive: true });
|
||||
|
||||
for (const file of [
|
||||
'./packages/backend/src/server/web/style.css',
|
||||
'./packages/backend/src/server/web/style.embed.css',
|
||||
'./packages/backend/src/server/web/bios.css',
|
||||
'./packages/backend/src/server/web/cli.css',
|
||||
'./packages/backend/src/server/web/error.css'
|
||||
]) {
|
||||
const source = await fs.readFile(file, { encoding: 'utf-8' });
|
||||
const { css } = await postcss([cssnano({ zindex: false })]).process(source, { from: undefined });
|
||||
await fs.writeFile(`./packages/backend/built/server/web/${path.basename(file)}`, css);
|
||||
}
|
||||
}
|
||||
|
||||
async function build() {
|
||||
await Promise.all([
|
||||
copyFrontendFonts(),
|
||||
copyBackendViews(),
|
||||
buildBackendScript(),
|
||||
buildBackendStyle(),
|
||||
loadConfig().then(config => config?.publishTarballInsteadOfProvideRepositoryUrl && buildTarball()),
|
||||
]);
|
||||
}
|
||||
|
||||
118
scripts/changelog-checker/package-lock.json
generated
118
scripts/changelog-checker/package-lock.json
generated
@@ -9,16 +9,16 @@
|
||||
"version": "1.0.0",
|
||||
"devDependencies": {
|
||||
"@types/mdast": "4.0.4",
|
||||
"@types/node": "24.10.1",
|
||||
"@vitest/coverage-v8": "4.0.13",
|
||||
"@types/node": "24.9.1",
|
||||
"@vitest/coverage-v8": "4.0.10",
|
||||
"mdast-util-to-string": "4.0.0",
|
||||
"remark": "15.0.1",
|
||||
"remark-parse": "11.0.0",
|
||||
"typescript": "5.9.3",
|
||||
"unified": "11.0.5",
|
||||
"vite": "7.2.4",
|
||||
"vite": "7.2.2",
|
||||
"vite-node": "5.2.0",
|
||||
"vitest": "4.0.13"
|
||||
"vitest": "4.0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-string-parser": {
|
||||
@@ -898,9 +898,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "24.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz",
|
||||
"integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==",
|
||||
"version": "24.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.9.1.tgz",
|
||||
"integrity": "sha512-QoiaXANRkSXK6p0Duvt56W208du4P9Uye9hWLWgGMDTEoKPhuenzNcC4vGUmrNkiOKTlIrBoyNQYNpSwfEZXSg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
@@ -915,14 +915,14 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@vitest/coverage-v8": {
|
||||
"version": "4.0.13",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.0.13.tgz",
|
||||
"integrity": "sha512-w77N6bmtJ3CFnL/YHiYotwW/JI3oDlR3K38WEIqegRfdMSScaYxwYKB/0jSNpOTZzUjQkG8HHEz4sdWQMWpQ5g==",
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-4.0.10.tgz",
|
||||
"integrity": "sha512-g+brmtoKa/sAeIohNJnnWhnHtU6GuqqVOSQ4SxDIPcgZWZyhJs5RmF5LpqXs8Kq64lANP+vnbn5JLzhLj/G56g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@bcoe/v8-coverage": "^1.0.2",
|
||||
"@vitest/utils": "4.0.13",
|
||||
"@vitest/utils": "4.0.10",
|
||||
"ast-v8-to-istanbul": "^0.3.8",
|
||||
"debug": "^4.4.3",
|
||||
"istanbul-lib-coverage": "^3.2.2",
|
||||
@@ -937,8 +937,8 @@
|
||||
"url": "https://opencollective.com/vitest"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@vitest/browser": "4.0.13",
|
||||
"vitest": "4.0.13"
|
||||
"@vitest/browser": "4.0.10",
|
||||
"vitest": "4.0.10"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@vitest/browser": {
|
||||
@@ -947,16 +947,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/expect": {
|
||||
"version": "4.0.13",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.0.13.tgz",
|
||||
"integrity": "sha512-zYtcnNIBm6yS7Gpr7nFTmq8ncowlMdOJkWLqYvhr/zweY6tFbDkDi8BPPOeHxEtK1rSI69H7Fd4+1sqvEGli6w==",
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.0.10.tgz",
|
||||
"integrity": "sha512-3QkTX/lK39FBNwARCQRSQr0TP9+ywSdxSX+LgbJ2M1WmveXP72anTbnp2yl5fH+dU6SUmBzNMrDHs80G8G2DZg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@standard-schema/spec": "^1.0.0",
|
||||
"@types/chai": "^5.2.2",
|
||||
"@vitest/spy": "4.0.13",
|
||||
"@vitest/utils": "4.0.13",
|
||||
"@vitest/spy": "4.0.10",
|
||||
"@vitest/utils": "4.0.10",
|
||||
"chai": "^6.2.1",
|
||||
"tinyrainbow": "^3.0.3"
|
||||
},
|
||||
@@ -965,13 +965,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/mocker": {
|
||||
"version": "4.0.13",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.0.13.tgz",
|
||||
"integrity": "sha512-eNCwzrI5djoauklwP1fuslHBjrbR8rqIVbvNlAnkq1OTa6XT+lX68mrtPirNM9TnR69XUPt4puBCx2Wexseylg==",
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.0.10.tgz",
|
||||
"integrity": "sha512-e2OfdexYkjkg8Hh3L9NVEfbwGXq5IZbDovkf30qW2tOh7Rh9sVtmSr2ztEXOFbymNxS4qjzLXUQIvATvN4B+lg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vitest/spy": "4.0.13",
|
||||
"@vitest/spy": "4.0.10",
|
||||
"estree-walker": "^3.0.3",
|
||||
"magic-string": "^0.30.21"
|
||||
},
|
||||
@@ -992,9 +992,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/pretty-format": {
|
||||
"version": "4.0.13",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.0.13.tgz",
|
||||
"integrity": "sha512-ooqfze8URWbI2ozOeLDMh8YZxWDpGXoeY3VOgcDnsUxN0jPyPWSUvjPQWqDGCBks+opWlN1E4oP1UYl3C/2EQA==",
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.0.10.tgz",
|
||||
"integrity": "sha512-99EQbpa/zuDnvVjthwz5bH9o8iPefoQZ63WV8+bsRJZNw3qQSvSltfut8yu1Jc9mqOYi7pEbsKxYTi/rjaq6PA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -1005,13 +1005,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/runner": {
|
||||
"version": "4.0.13",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.0.13.tgz",
|
||||
"integrity": "sha512-9IKlAru58wcVaWy7hz6qWPb2QzJTKt+IOVKjAx5vb5rzEFPTL6H4/R9BMvjZ2ppkxKgTrFONEJFtzvnyEpiT+A==",
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.0.10.tgz",
|
||||
"integrity": "sha512-EXU2iSkKvNwtlL8L8doCpkyclw0mc/t4t9SeOnfOFPyqLmQwuceMPA4zJBa6jw0MKsZYbw7kAn+gl7HxrlB8UQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vitest/utils": "4.0.13",
|
||||
"@vitest/utils": "4.0.10",
|
||||
"pathe": "^2.0.3"
|
||||
},
|
||||
"funding": {
|
||||
@@ -1019,13 +1019,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/snapshot": {
|
||||
"version": "4.0.13",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.0.13.tgz",
|
||||
"integrity": "sha512-hb7Usvyika1huG6G6l191qu1urNPsq1iFc2hmdzQY3F5/rTgqQnwwplyf8zoYHkpt7H6rw5UfIw6i/3qf9oSxQ==",
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.0.10.tgz",
|
||||
"integrity": "sha512-2N4X2ZZl7kZw0qeGdQ41H0KND96L3qX1RgwuCfy6oUsF2ISGD/HpSbmms+CkIOsQmg2kulwfhJ4CI0asnZlvkg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vitest/pretty-format": "4.0.13",
|
||||
"@vitest/pretty-format": "4.0.10",
|
||||
"magic-string": "^0.30.21",
|
||||
"pathe": "^2.0.3"
|
||||
},
|
||||
@@ -1034,9 +1034,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/spy": {
|
||||
"version": "4.0.13",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.0.13.tgz",
|
||||
"integrity": "sha512-hSu+m4se0lDV5yVIcNWqjuncrmBgwaXa2utFLIrBkQCQkt+pSwyZTPFQAZiiF/63j8jYa8uAeUZ3RSfcdWaYWw==",
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.0.10.tgz",
|
||||
"integrity": "sha512-AsY6sVS8OLb96GV5RoG8B6I35GAbNrC49AO+jNRF9YVGb/g9t+hzNm1H6kD0NDp8tt7VJLs6hb7YMkDXqu03iw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
@@ -1044,13 +1044,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vitest/utils": {
|
||||
"version": "4.0.13",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.0.13.tgz",
|
||||
"integrity": "sha512-ydozWyQ4LZuu8rLp47xFUWis5VOKMdHjXCWhs1LuJsTNKww+pTHQNK4e0assIB9K80TxFyskENL6vCu3j34EYA==",
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.0.10.tgz",
|
||||
"integrity": "sha512-kOuqWnEwZNtQxMKg3WmPK1vmhZu9WcoX69iwWjVz+jvKTsF1emzsv3eoPcDr6ykA3qP2bsCQE7CwqfNtAVzsmg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vitest/pretty-format": "4.0.13",
|
||||
"@vitest/pretty-format": "4.0.10",
|
||||
"tinyrainbow": "^3.0.3"
|
||||
},
|
||||
"funding": {
|
||||
@@ -2341,9 +2341,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "7.2.4",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-7.2.4.tgz",
|
||||
"integrity": "sha512-NL8jTlbo0Tn4dUEXEsUg8KeyG/Lkmc4Fnzb8JXN/Ykm9G4HNImjtABMJgkQoVjOBN/j2WAwDTRytdqJbZsah7w==",
|
||||
"version": "7.2.2",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-7.2.2.tgz",
|
||||
"integrity": "sha512-BxAKBWmIbrDgrokdGZH1IgkIk/5mMHDreLDmCJ0qpyJaAteP8NvMhkwr/ZCQNqNH97bw/dANTE9PDzqwJghfMQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -2439,20 +2439,20 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vitest": {
|
||||
"version": "4.0.13",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-4.0.13.tgz",
|
||||
"integrity": "sha512-QSD4I0fN6uZQfftryIXuqvqgBxTvJ3ZNkF6RWECd82YGAYAfhcppBLFXzXJHQAAhVFyYEuFTrq6h0hQqjB7jIQ==",
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/vitest/-/vitest-4.0.10.tgz",
|
||||
"integrity": "sha512-2Fqty3MM9CDwOVet/jaQalYlbcjATZwPYGcqpiYQqgQ/dLC7GuHdISKgTYIVF/kaishKxLzleKWWfbSDklyIKg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vitest/expect": "4.0.13",
|
||||
"@vitest/mocker": "4.0.13",
|
||||
"@vitest/pretty-format": "4.0.13",
|
||||
"@vitest/runner": "4.0.13",
|
||||
"@vitest/snapshot": "4.0.13",
|
||||
"@vitest/spy": "4.0.13",
|
||||
"@vitest/utils": "4.0.13",
|
||||
"@vitest/expect": "4.0.10",
|
||||
"@vitest/mocker": "4.0.10",
|
||||
"@vitest/pretty-format": "4.0.10",
|
||||
"@vitest/runner": "4.0.10",
|
||||
"@vitest/snapshot": "4.0.10",
|
||||
"@vitest/spy": "4.0.10",
|
||||
"@vitest/utils": "4.0.10",
|
||||
"debug": "^4.4.3",
|
||||
"es-module-lexer": "^1.7.0",
|
||||
"expect-type": "^1.2.2",
|
||||
@@ -2478,13 +2478,12 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@edge-runtime/vm": "*",
|
||||
"@opentelemetry/api": "^1.9.0",
|
||||
"@types/debug": "^4.1.12",
|
||||
"@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",
|
||||
"@vitest/browser-playwright": "4.0.13",
|
||||
"@vitest/browser-preview": "4.0.13",
|
||||
"@vitest/browser-webdriverio": "4.0.13",
|
||||
"@vitest/ui": "4.0.13",
|
||||
"@vitest/browser-playwright": "4.0.10",
|
||||
"@vitest/browser-preview": "4.0.10",
|
||||
"@vitest/browser-webdriverio": "4.0.10",
|
||||
"@vitest/ui": "4.0.10",
|
||||
"happy-dom": "*",
|
||||
"jsdom": "*"
|
||||
},
|
||||
@@ -2492,9 +2491,6 @@
|
||||
"@edge-runtime/vm": {
|
||||
"optional": true
|
||||
},
|
||||
"@opentelemetry/api": {
|
||||
"optional": true
|
||||
},
|
||||
"@types/debug": {
|
||||
"optional": true
|
||||
},
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mdast": "4.0.4",
|
||||
"@types/node": "24.10.1",
|
||||
"@vitest/coverage-v8": "4.0.13",
|
||||
"@types/node": "24.9.1",
|
||||
"@vitest/coverage-v8": "4.0.10",
|
||||
"mdast-util-to-string": "4.0.0",
|
||||
"remark": "15.0.1",
|
||||
"remark-parse": "11.0.0",
|
||||
"typescript": "5.9.3",
|
||||
"unified": "11.0.5",
|
||||
"vite": "7.2.4",
|
||||
"vite": "7.2.2",
|
||||
"vite-node": "5.2.0",
|
||||
"vitest": "4.0.13"
|
||||
"vitest": "4.0.10"
|
||||
}
|
||||
}
|
||||
|
||||
119
scripts/minify-node-modules.mjs
Normal file
119
scripts/minify-node-modules.mjs
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
/**
|
||||
* This script minifies JavaScript files in node_modules to reduce memory usage.
|
||||
* V8 keeps script source code in memory, so minifying reduces memory consumption.
|
||||
*
|
||||
* Usage:
|
||||
* node scripts/minify-node-modules.mjs
|
||||
*
|
||||
* Environment variables:
|
||||
* MISSKEY_MINIFY_NODE_MODULES - Set to 'true' to enable minification (default: true in production)
|
||||
* NODE_ENV - When set to 'development', minification is skipped
|
||||
*/
|
||||
|
||||
import * as fs from 'node:fs/promises';
|
||||
import * as path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import * as esbuild from 'esbuild';
|
||||
import glob from 'fast-glob';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
const rootDir = path.resolve(__dirname, '..');
|
||||
|
||||
// Configuration constants
|
||||
const BATCH_SIZE = 100;
|
||||
const MIN_FILE_SIZE_BYTES = 50;
|
||||
|
||||
/** @type {import('esbuild').TransformOptions} */
|
||||
const esbuildOptions = {
|
||||
loader: 'js',
|
||||
minifyWhitespace: true,
|
||||
minifyIdentifiers: true,
|
||||
minifySyntax: true,
|
||||
};
|
||||
|
||||
console.log('Minifying node_modules JavaScript files...');
|
||||
|
||||
const pnpmDir = path.join(rootDir, 'node_modules', '.pnpm');
|
||||
|
||||
// Check if pnpm directory exists
|
||||
try {
|
||||
await fs.access(pnpmDir);
|
||||
} catch {
|
||||
console.log('No pnpm node_modules found, skipping minification');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
// Find all JavaScript files in node_modules/.pnpm
|
||||
// Use followSymbolicLinks: false to avoid following symlinks to workspace packages
|
||||
const jsFiles = await glob('**/*.js', {
|
||||
cwd: pnpmDir,
|
||||
absolute: true,
|
||||
followSymbolicLinks: false,
|
||||
ignore: [
|
||||
// Ignore already minified files
|
||||
'**/*.min.js',
|
||||
// Ignore source maps
|
||||
'**/*.js.map',
|
||||
// Ignore TypeScript declaration files that might be named .js
|
||||
'**/*.d.js',
|
||||
// Ignore workspace package symlinks
|
||||
'node_modules/i18n/**',
|
||||
'node_modules/backend/**',
|
||||
'node_modules/frontend/**',
|
||||
'node_modules/frontend-embed/**',
|
||||
'node_modules/frontend-shared/**',
|
||||
'node_modules/frontend-builder/**',
|
||||
'node_modules/icons-subsetter/**',
|
||||
'node_modules/sw/**',
|
||||
'node_modules/misskey-js/**',
|
||||
'node_modules/misskey-js-type-generator/**',
|
||||
'node_modules/misskey-reversi/**',
|
||||
'node_modules/misskey-bubble-game/**',
|
||||
],
|
||||
});
|
||||
|
||||
console.log(`Found ${jsFiles.length} JavaScript files to minify`);
|
||||
|
||||
// Process files in parallel batches for efficiency
|
||||
let processed = 0;
|
||||
let errors = 0;
|
||||
|
||||
for (let i = 0; i < jsFiles.length; i += BATCH_SIZE) {
|
||||
const batch = jsFiles.slice(i, i + BATCH_SIZE);
|
||||
|
||||
await Promise.all(batch.map(async (filePath) => {
|
||||
try {
|
||||
const content = await fs.readFile(filePath, 'utf-8');
|
||||
|
||||
// Skip empty files or very small files (likely not worth minifying)
|
||||
if (content.length < MIN_FILE_SIZE_BYTES) {
|
||||
processed++;
|
||||
return;
|
||||
}
|
||||
|
||||
const result = await esbuild.transform(content, esbuildOptions);
|
||||
|
||||
await fs.writeFile(filePath, result.code);
|
||||
processed++;
|
||||
} catch (err) {
|
||||
// Some files may have syntax that esbuild doesn't handle well, skip them
|
||||
errors++;
|
||||
if (process.env.DEBUG) {
|
||||
console.error(`Failed to minify ${filePath}: ${err.message}`);
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
// Progress update every 10 batches
|
||||
if ((i / BATCH_SIZE) % 10 === 0) {
|
||||
console.log(`Progress: ${processed}/${jsFiles.length} files processed...`);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`Minification complete: ${processed} files processed, ${errors} files skipped due to errors`);
|
||||
Reference in New Issue
Block a user