Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"ignorePatterns": [
"package-lock.json",
"pnpm-lock.yaml",
"yarn.lock",
"bun.lock",
"bun.lockb",
"**/.svelte-kit",
"**/dist",
"**/.turbo",
"**/node_modules",
"**/src/vendor/**",
"**/vendor/**",
"**/public/**",
"**/gleamstd/**",
"**/*.gen.*"
]
}
26 changes: 26 additions & 0 deletions apps/ppp/.oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"svelte": {},
"sortTailwindcss": {
"stylesheet": "./src/app.css"
},
"ignorePatterns": [
"package-lock.json",
"pnpm-lock.yaml",
"yarn.lock",
"bun.lock",
"bun.lockb",
"**/.svelte-kit",
"**/dist",
"**/.turbo",
"**/node_modules",
"messages/",
"project.inlang/",
"src/lib/paraglide/",
"src/lib/assets/"
]
}
9 changes: 0 additions & 9 deletions apps/ppp/.prettierignore

This file was deleted.

16 changes: 0 additions & 16 deletions apps/ppp/.prettierrc

This file was deleted.

33 changes: 30 additions & 3 deletions apps/ppp/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,24 @@ import svelte from 'eslint-plugin-svelte';
import { defineConfig } from 'eslint/config';
import globals from 'globals';
import ts from 'typescript-eslint';
import svelteConfig from './svelte.config.js';

const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));

export default defineConfig(
{
ignores: [
'dist/**',
'node_modules/**',
'.svelte-kit/**',
'messages/**',
'project.inlang/**',
'src/lib/paraglide/**',
// vendored third-party code
'src/lib/assets/**',
// problem statement example code, intentionally non-idiomatic
'src/routes/(app)/problems/**/runtimes/*/code.*'
]
},
includeIgnoreFile(gitignorePath),
js.configs.recommended,
...ts.configs.recommended,
Expand Down Expand Up @@ -39,14 +52,28 @@ export default defineConfig(
]
}
},
{
files: ['**/*.svelte'],
rules: {
// bare reads of reactive variables inside $effect are the idiomatic
// Svelte 5 way of declaring dependencies
'@typescript-eslint/no-unused-expressions': 'off'
}
},
{
// renders trusted problem-statement markdown
files: ['**/problem/content.svelte'],
rules: {
'svelte/no-at-html-tags': 'off'
}
},
{
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
languageOptions: {
parserOptions: {
projectService: true,
extraFileExtensions: ['.svelte'],
parser: ts.parser,
svelteConfig
parser: ts.parser
}
}
}
Expand Down
34 changes: 17 additions & 17 deletions apps/ppp/messages/en.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"$schema": "https://inlang.com/schema/inlang-message-format",
"problems": "problems",
"editor": "editor",
"design_patterns": "design patterns",
"tests": "tests",
"output": "output",
"settings": "settings",
"vim_mode": "Vim mode",
"run": "run",
"stop": "stop",
"force_stop": "force stop",
"execution_timeout": "execution timeout (ms)",
"execution_timeout_description": "use zero to disable",
"untranslated_content": "this content has not yet been translated into your language.",
"input_mode": "input mode",
"problem_name_not_found": "Problem \"{name}\" not found",
"back_to_problems": "Back to problems"
"$schema": "https://inlang.com/schema/inlang-message-format",
"problems": "problems",
"editor": "editor",
"design_patterns": "design patterns",
"tests": "tests",
"output": "output",
"settings": "settings",
"vim_mode": "Vim mode",
"run": "run",
"stop": "stop",
"force_stop": "force stop",
"execution_timeout": "execution timeout (ms)",
"execution_timeout_description": "use zero to disable",
"untranslated_content": "this content has not yet been translated into your language.",
"input_mode": "input mode",
"problem_name_not_found": "Problem \"{name}\" not found",
"back_to_problems": "Back to problems"
}
54 changes: 27 additions & 27 deletions apps/ppp/messages/ru.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"$schema": "https://inlang.com/schema/inlang-message-format",
"problems": "проблемы",
"editor": "редактор",
"design_patterns": "паттерны проектирования",
"tests": "Тесты",
"output": "Вывод",
"settings": "Настройки",
"vim_mode": "режим Vim",
"run": "Запустить",
"stop": "Остановить",
"force_stop": "остановить принудительно",
"execution_timeout": "таймаут выполнения (мс)",
"execution_timeout_description": "используйте ноль для отключения",
"untranslated_content": "этот контент пока не переведен на ваш язык",
"hello_world": "Hello, {name} from ru!",
"problemsPageTitle": "Проблемы",
"editorPageTitle": "Редактор",
"designPatterns": "Паттерны проектирования",
"vimMode": "Режим Vim",
"forceStop": "Остановить принудительно",
"executionTimeout": "Таймаут выполнения (мс)",
"executionTimeoutDescription": "Используйте ноль для отключения",
"currently_untranslated_problem": "Данная проблема пока не переведена для вашего языка",
"input_mode": "режим ввода",
"problem_name_not_found": "Проблема \"{name}\" не найдена",
"back_to_problems": "Назад к проблемам"
}
"$schema": "https://inlang.com/schema/inlang-message-format",
"problems": "проблемы",
"editor": "редактор",
"design_patterns": "паттерны проектирования",
"tests": "Тесты",
"output": "Вывод",
"settings": "Настройки",
"vim_mode": "режим Vim",
"run": "Запустить",
"stop": "Остановить",
"force_stop": "остановить принудительно",
"execution_timeout": "таймаут выполнения (мс)",
"execution_timeout_description": "используйте ноль для отключения",
"untranslated_content": "этот контент пока не переведен на ваш язык",
"hello_world": "Hello, {name} from ru!",
"problemsPageTitle": "Проблемы",
"editorPageTitle": "Редактор",
"designPatterns": "Паттерны проектирования",
"vimMode": "Режим Vim",
"forceStop": "Остановить принудительно",
"executionTimeout": "Таймаут выполнения (мс)",
"executionTimeoutDescription": "Используйте ноль для отключения",
"currently_untranslated_problem": "Данная проблема пока не переведена для вашего языка",
"input_mode": "режим ввода",
"problem_name_not_found": "Проблема \"{name}\" не найдена",
"back_to_problems": "Назад к проблемам"
}
69 changes: 34 additions & 35 deletions apps/ppp/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ppp",
"private": true,
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"paraglide-compile": "paraglide-js compile --strategy url --project ./project.inlang --outdir ./src/lib/paraglide",
Expand All @@ -12,13 +12,14 @@
"prepare": "svelte-kit sync || echo ''",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"format": "prettier --write .",
"lint": "prettier --check . && eslint .",
"format": "oxfmt",
"lint": "eslint .",
"test:unit": "vitest",
"test": "npm run test:unit -- --run"
"test": "npm run test:unit -- --run",
"format:check": "oxfmt --check ."
},
"dependencies": {
"@andrewbranch/untar.js": "^1.0.3",
"@andrewbranch/untar.js": "^1.0.4",
"@xterm/addon-fit": "^0.11.0",
"@xterm/xterm": "^6.0.0",
"dotnet-runtime": "workspace:*",
Expand All @@ -28,8 +29,8 @@
"java-runtime": "workspace:*",
"javascript-runtime": "workspace:*",
"libs": "workspace:*",
"marked": "^18.0.2",
"monaco-editor": "^0.55.1",
"marked": "^18.0.10",
"monaco-editor": "^0.56.0",
"monaco-editor-textmate": "^4.0.0",
"monaco-textmate": "^3.0.1",
"monaco-vim": "^0.4.4",
Expand All @@ -42,38 +43,36 @@
"zig-runtime": "workspace:*"
},
"devDependencies": {
"@eslint/compat": "^2.0.5",
"@eslint/compat": "^2.1.0",
"@eslint/js": "^10.0.1",
"@iconify-json/lucide": "^1.2.103",
"@iconify-json/vscode-icons": "^1.2.46",
"@inlang/paraglide-js": "^2.16.1",
"@sveltejs/adapter-static": "^3.0.10",
"@sveltejs/kit": "^2.58.0",
"@sveltejs/vite-plugin-svelte": "^7.0.0",
"@tailwindcss/typography": "^0.5.19",
"@tailwindcss/vite": "^4.2.4",
"@iconify-json/lucide": "^1.2.124",
"@iconify-json/vscode-icons": "^1.2.74",
"@inlang/paraglide-js": "^2.24.1",
"@sveltejs/adapter-static": "4.0.0-next.4",
"@sveltejs/kit": "3.0.0-next.25",
"@sveltejs/vite-plugin-svelte": "^7.3.0",
"@tailwindcss/typography": "^0.5.20",
"@tailwindcss/vite": "^4.3.3",
"@types/color": "^4.2.1",
"@types/node": "^24.12.2",
"@vitest/browser-playwright": "^4.1.5",
"daisyui": "^5.5.19",
"eslint": "^10.2.1",
"@types/node": "^26.2.0",
"@vitest/browser-playwright": "^4.1.11",
"daisyui": "^5.7.20",
"eslint": "^10.9.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-svelte": "^3.17.1",
"globals": "^17.5.0",
"playwright": "^1.59.1",
"prettier": "^3.8.3",
"prettier-plugin-svelte": "^3.5.1",
"prettier-plugin-tailwindcss": "^0.7.3",
"svelte": "^5.55.5",
"svelte-check": "^4.4.6",
"tailwindcss": "^4.2.4",
"typescript": "^5.9.3",
"typescript-eslint": "^8.59.0",
"eslint-plugin-svelte": "^3.23.0",
"globals": "^17.11.0",
"oxfmt": "^0.64.0",
"playwright": "^1.62.1",
"svelte": "^5.56.10",
"svelte-check": "^4.7.6",
"tailwindcss": "^4.3.3",
"typescript": "^6.0.3",
"typescript-eslint": "^8.67.0",
"unplugin-icons": "^23.0.1",
"vite": "catalog:",
"vite-plugin-devtools-json": "^1.0.0",
"vite-plugin-static-copy": "catalog:",
"vite-plugin-devtools-json": "^1.1.0",
"vite-plugin-static-copy": "4.1.1",
"vitest": "catalog:",
"vitest-browser-svelte": "^2.1.1"
"vitest-browser-svelte": "^3.0.0"
}
}
}
2 changes: 1 addition & 1 deletion apps/ppp/src/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See https://svelte.dev/docs/kit/types#app.d.ts
// for information about these interfaces
import 'unplugin-icons/types/svelte'
import 'unplugin-icons/types/svelte';

declare global {
namespace App {
Expand Down
6 changes: 4 additions & 2 deletions apps/ppp/src/hooks.server.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import type { Handle } from '@sveltejs/kit';
import type { Handle } from '@sveltejs/kit/hooks';
import { paraglideMiddleware } from '$lib/paraglide/server';
import { getTextDirection } from '$lib/paraglide/runtime';
import { sequence } from '@sveltejs/kit/hooks';

const paraglideHandle: Handle = ({ event, resolve }) =>
paraglideMiddleware(event.request, ({ request: localizedRequest, locale }) => {
event.request = localizedRequest;
// Kit 3 made RequestEvent.request read-only, but paraglide's middleware
// is built around replacing it.
(event as { request: Request }).request = localizedRequest;
return resolve(event, {
transformPageChunk: ({ html }) => {
return html.replace('%lang%', locale).replace('%dir%', getTextDirection(locale));
Expand Down
3 changes: 2 additions & 1 deletion apps/ppp/src/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Reroute } from '@sveltejs/kit/hooks';
import { deLocalizeUrl } from '$lib/paraglide/runtime';

export const reroute = (request) => deLocalizeUrl(request.url).pathname;
export const reroute: Reroute = (request): string => deLocalizeUrl(request.url).pathname;
Loading
Loading