Restructure/frontend editor (#6404)

## Move editor under `frontend/editor/`

Pure restructure: `frontend/` becomes the workspace, `frontend/editor/`
holds
  the PDF editor. 1775 file renames + 40 wiring edits. No logic changes.

  ### Why

`frontend/` is currently the editor — its `src/`, `public/`,
`src-tauri/`,
  config files all sit at the root. Promoting `frontend/` to a
workspace and putting the editor in a sibling folder leaves room for
future
apps to drop in alongside it, sharing one `package.json` /
`node_modules` /
  lint config / Storybook.

  ### What moves

  frontend/
  ├── editor/                ← NEW: everything editor-specific
  │   ├── src/               ← was frontend/src/
  │   ├── public/            ← was frontend/public/
  │   ├── src-tauri/         ← was frontend/src-tauri/
│ ├── index.html, vite.config.ts, vitest.config.ts, playwright.config.ts
  │   ├── tsconfig*.json, tailwind.config.js, postcss.config.js
  │   ├── scripts/
  │   ├── .env, .env.desktop, .env.saas
  │   └── DeveloperGuide.md
├── package.json, package-lock.json, node_modules/ ← workspace install
  ├── eslint.config.mjs, .prettierrc, .prettierignore ← shared tooling
  ├── .gitignore
  └── README.md

  ### Wiring edits (40 files)

  - `.taskfiles/frontend.yml`, `desktop.yml`, `e2e.yml`
  - `build.gradle`, `app/core/build.gradle`
- `eslint.config.mjs`, `frontend/package.json`, `.gitignore`,
`.prettierignore`
  - `docker/frontend/Dockerfile`
  - 8 `.github/workflows/*.yml`, plus `.github/dependabot.yml`,
    `.github/config/.files.yaml`, `.github/labeler-config-srvaroa.yml`
  - `scripts/translations/**`
- Docs: `AGENTS.md`, `CLAUDE.md`, `ADDING_TOOLS.md`,
`DeveloperGuide.md`,
`WINDOWS_SIGNING.md`, `devGuide/HowToAddNewLanguage.md`,
`frontend/README.md`,
    `frontend/editor/DeveloperGuide.md`

Plus 3 renamed + edited: `editor/vite.config.ts` (env path +
node_modules
  walk-up), `editor/scripts/setup-env.mts` (renamed from `.ts` for
`import.meta.url`), `editor/scripts/build-provisioner.mjs` (resolve
src-tauri
  relative to script).

  ### Verification

  | Check | Result |
  |---|---|
  | `task frontend:typecheck:all` (6 variants) | exit 0 |
  | `task frontend:lint` (eslint + dpdm) | exit 0 |
  | `task frontend:format:check` | exit 0 |
  | `task frontend:test` | 657 tests pass, 50 files |
| `task frontend:build:{core,proprietary,saas,desktop,prototypes}` | all
green |
| `task desktop:build` | full Tauri pipeline →
`Stirling-PDF_2.11.0_x64_en-US.msi` |
  | `playwright test --list --project=stubbed` | 172 tests discovered |

`task desktop:build` exercises the heaviest path — Rust + WiX + MSI
bundle
against the moved `editor/src-tauri/`. If anything in the restructure
was
  wrong it wouldn't have built.

  ### Test plan

  - [ ] `frontend-validation.yml` green
  - [ ] `e2e-stubbed.yml` green
  - [ ] `tauri-build.yml` green on at least one platform
  - [ ] `check_toml.yml` runs on a translation-touching PR

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
This commit is contained in:
Reece Browne
2026-05-22 13:40:34 +01:00
committed by GitHub
co-authored by Claude Opus 4.7
parent 48027ee9d6
commit 0a50e765b7
1820 changed files with 300 additions and 226 deletions
+55
View File
@@ -0,0 +1,55 @@
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import TomlBackend from "@app/i18n/tomlBackend";
i18n
.use(TomlBackend)
.use(initReactI18next)
.init({
lng: "en",
fallbackLng: "en",
debug: false,
backend: {
loadPath: "/locales/{{lng}}/{{ns}}.toml",
},
interpolation: {
escapeValue: false,
},
// For testing environment, provide fallback resources
resources: {
en: {
translation: {
"convert.selectSourceFormat": "Select source file format",
"convert.selectTargetFormat": "Select target file format",
"convert.selectFirst": "Select a source format first",
"convert.imageOptions": "Image Options:",
"convert.emailOptions": "Email Options:",
"convert.colorType": "Color Type",
"convert.dpi": "DPI",
"convert.singleOrMultiple": "Output",
"convert.emailNote":
"Email attachments and embedded images will be included",
"convert.pdfaOptions": "PDF/A Options",
"convert.outputFormat": "Output Format",
"convert.pdfaNote":
"PDF/A-1b is more compatible, PDF/A-2b supports more features, PDF/A-3b supports embedded files.",
"convert.pdfaDigitalSignatureWarning":
"The PDF contains a digital signature. This will be removed in the next step.",
"common.color": "Color",
"common.grayscale": "Grayscale",
"common.blackWhite": "Black & White",
"common.single": "Single Image",
"common.multiple": "Multiple Images",
"groups.document": "Document",
"groups.spreadsheet": "Spreadsheet",
"groups.presentation": "Presentation",
"groups.image": "Image",
"groups.web": "Web",
"groups.text": "Text",
"groups.email": "Email",
},
},
},
});
export default i18n;
@@ -0,0 +1,54 @@
import { BackendModule, ReadCallback } from "i18next";
import { parse } from "smol-toml";
export interface TomlBackendOptions {
loadPath: string | ((lngs: string[], namespaces: string[]) => string);
}
class TomlBackend implements BackendModule<TomlBackendOptions> {
static type = "backend" as const;
type = "backend" as const;
constructor(services?: unknown, options?: TomlBackendOptions) {
this.init(services, options);
}
init(_services?: unknown, options?: TomlBackendOptions): void {
this.options = options;
}
read(language: string, namespace: string, callback: ReadCallback): void {
const loadPath = this.options?.loadPath;
if (!loadPath) {
callback(new Error("loadPath is not configured"), null);
return;
}
const url =
typeof loadPath === "function"
? loadPath([language], [namespace])
: loadPath.replace("{{lng}}", language).replace("{{ns}}", namespace);
fetch(url)
.then((response) => {
if (!response.ok) {
throw new Error(
`Failed to load translation file: ${url} (${response.status})`,
);
}
return response.text();
})
.then((tomlContent) => {
const parsed = parse(tomlContent);
callback(null, parsed);
})
.catch((error) => {
callback(error, null);
});
}
private options?: TomlBackendOptions;
}
export default TomlBackend;