complete refactor javascript to typescript and reorg frontend files and folders

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2026-05-20 11:40:17 +02:00
parent 4341193b35
commit 4b2f38ab7f
174 changed files with 22603 additions and 3989 deletions
+5 -5
View File
@@ -1,7 +1,7 @@
---
description: "Use when editing hint text or other UI strings in localization JSON files; follow the ordered rules below for consistent formatting."
name: "Hint Typography Guidelines"
applyTo: "html/locale_*.json, html/override_*.json"
applyTo: "ui/locale/*.json"
---
# Hint Typography Guidelines
@@ -40,11 +40,11 @@ Hint strings render as HTML. Use this small set of inline tags to keep hints sca
## Translation propagation
1. `html/locale_en.json` is the source of truth. Other `html/locale_*.json` files are auto-generated by `cli/localize.js`; edit only the English file.
2. Per-locale corrections live in `html/override_{locale}.json`.
1. `ui/locale/locale_en.json` is the source of truth. Other `ui/locale/locale_*.json` files are auto-generated by `cli/localize.js`; edit only the English file.
2. Per-locale corrections live in `ui/locale/override_{locale}.json`.
## Validation
1. Validate JSON syntax with `jq empty html/locale_en.json`.
2. Lint with `pnpm eslint -- html/locale_en.json` (silent success).
1. Validate JSON syntax with `jq empty ui/locale/locale_en.json`.
2. Lint with `pnpm eslint -- ui/locale/locale_en.json` (silent success).
3. See `wiki/Hints.md` for the wiki-facing version of these rules.
+4 -4
View File
@@ -1,7 +1,7 @@
---
description: "Use when editing frontend UI code, JavaScript, HTML, CSS, localization files, or built-in UI extensions including modernui and kanvas."
description: "Use when editing frontend UI code, TypesScript, JavaScript, HTML, CSS, localization files, or built-in UI extensions including modernui and kanvas."
name: "UI And Frontend Guidelines"
applyTo: "javascript/**/*.js, html/**/*.html, html/**/*.css, html/**/*.js, extensions-builtin/sdnext-modernui/**/*, extensions-builtin/sdnext-kanvas/**/*"
applyTo: "ui/**/*, extensions-builtin/sdnext-modernui/**/*, extensions-builtin/sdnext-kanvas/**/*"
---
# UI And Frontend Guidelines
@@ -9,8 +9,8 @@ Apply these rules in priority order:
1. Preserve the current event-handling logic and data flow between Gradio/Python endpoints and frontend handlers; do not change payload shapes without backend alignment.
2. Follow existing project lint and style patterns; prefer consistency with nearby files over introducing new frameworks or architecture.
3. Keep localization-friendly UI text changes synchronized with locale resources in `html/locale_*.json` when user-facing strings are added or changed.
3. Keep localization-friendly UI text changes synchronized with locale resources in `ui/locale/locale_*.json` when user-facing strings are added or changed.
4. Avoid bundling unrelated visual refactors with functional fixes; keep UI PRs scoped and reviewable.
5. For extension UI work, respect each extension's boundaries and avoid cross-extension coupling.
6. Validate JavaScript changes with `pnpm eslint`; for modern UI extension changes also run `pnpm eslint-ui`.
6. Validate TypeScript and JavaScript changes with `pnpm eslint` and `pnpm tsc`.
7. Maintain mobile compatibility when touching layout or interaction behavior.