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]>
@@ -57,12 +57,12 @@ frontend: &frontend
|
|||||||
# Files that affect the Tauri desktop bundle. Gate the multi-OS Tauri build
|
# Files that affect the Tauri desktop bundle. Gate the multi-OS Tauri build
|
||||||
# job on changes to any of these.
|
# job on changes to any of these.
|
||||||
tauri: &tauri
|
tauri: &tauri
|
||||||
- frontend/src-tauri/**
|
- frontend/editor/src-tauri/**
|
||||||
- frontend/src/desktop/**
|
- frontend/editor/src/desktop/**
|
||||||
- frontend/tsconfig.desktop.json
|
- frontend/editor/tsconfig.desktop.vite.json
|
||||||
- frontend/package.json
|
- frontend/package.json
|
||||||
- frontend/package-lock.json
|
- frontend/package-lock.json
|
||||||
- frontend/vite.config.ts
|
- frontend/editor/vite.config.ts
|
||||||
- .github/workflows/tauri-build.yml
|
- .github/workflows/tauri-build.yml
|
||||||
|
|
||||||
# Files that affect the AI engine (Python tool models, fixers, tests). Gate
|
# Files that affect the AI engine (Python tool models, fixers, tests). Gate
|
||||||
@@ -77,7 +77,7 @@ licenses-frontend: &licenses-frontend
|
|||||||
- ".github/workflows/frontend-backend-licenses-update.yml"
|
- ".github/workflows/frontend-backend-licenses-update.yml"
|
||||||
- "frontend/package.json"
|
- "frontend/package.json"
|
||||||
- "frontend/package-lock.json"
|
- "frontend/package-lock.json"
|
||||||
- "frontend/scripts/generate-licenses.js"
|
- "frontend/editor/scripts/generate-licenses.js"
|
||||||
|
|
||||||
licenses-backend: &licenses-backend
|
licenses-backend: &licenses-backend
|
||||||
- ".github/workflows/frontend-backend-licenses-update.yml"
|
- ".github/workflows/frontend-backend-licenses-update.yml"
|
||||||
@@ -87,8 +87,8 @@ licenses-backend: &licenses-backend
|
|||||||
# Playwright job on changes to any of these on PRs.
|
# Playwright job on changes to any of these on PRs.
|
||||||
proprietary: &proprietary
|
proprietary: &proprietary
|
||||||
- app/proprietary/**
|
- app/proprietary/**
|
||||||
- frontend/src/proprietary/**
|
- frontend/editor/src/proprietary/**
|
||||||
- frontend/src/core/tests/enterprise/**
|
- frontend/editor/src/core/tests/enterprise/**
|
||||||
- testing/compose/docker-compose-keycloak-oauth.yml
|
- testing/compose/docker-compose-keycloak-oauth.yml
|
||||||
- testing/compose/docker-compose-keycloak-saml.yml
|
- testing/compose/docker-compose-keycloak-saml.yml
|
||||||
- testing/compose/keycloak-realm-oauth.json
|
- testing/compose/keycloak-realm-oauth.json
|
||||||
|
|||||||
@@ -126,9 +126,9 @@ updates:
|
|||||||
|
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directories:
|
directories:
|
||||||
- /frontend/src-tauri
|
- /frontend/editor/src-tauri
|
||||||
- /frontend/src-tauri/thumbnail-handler
|
- /frontend/editor/src-tauri/thumbnail-handler
|
||||||
- /frontend/src-tauri/provisioner
|
- /frontend/editor/src-tauri/provisioner
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "weekly"
|
||||||
cooldown:
|
cooldown:
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ labels:
|
|||||||
|
|
||||||
- label: 'Translation'
|
- label: 'Translation'
|
||||||
files:
|
files:
|
||||||
- 'frontend/public/locales/[a-zA-Z]{2}-[a-zA-Z\-]{2,7}/translation.toml'
|
- 'frontend/editor/public/locales/[a-zA-Z]{2}-[a-zA-Z\-]{2,7}/translation.toml'
|
||||||
- 'scripts/ignore_translation.toml'
|
- 'scripts/ignore_translation.toml'
|
||||||
- 'scripts/remove_translation_keys.sh'
|
- 'scripts/remove_translation_keys.sh'
|
||||||
- 'scripts/replace_translation_line.sh'
|
- 'scripts/replace_translation_line.sh'
|
||||||
|
|||||||
@@ -285,5 +285,5 @@ jobs:
|
|||||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
with:
|
with:
|
||||||
name: playwright-report-enterprise-${{ github.run_id }}
|
name: playwright-report-enterprise-${{ github.run_id }}
|
||||||
path: frontend/playwright-report/
|
path: frontend/editor/playwright-report/
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ on:
|
|||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [opened, synchronize, reopened]
|
types: [opened, synchronize, reopened]
|
||||||
paths:
|
paths:
|
||||||
- "frontend/public/locales/*/translation.toml"
|
- "frontend/editor/public/locales/*/translation.toml"
|
||||||
- ".github/scripts/check_language_toml.py"
|
- ".github/scripts/check_language_toml.py"
|
||||||
- ".github/workflows/check_toml.yml"
|
- ".github/workflows/check_toml.yml"
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Get changed files and filter for TOML translation files
|
# Get changed files and filter for TOML translation files
|
||||||
gh pr view ${{ steps.get-pr-data.outputs.pr_number }} --json files -q ".files[].path" | grep -E '^frontend/public/locales/[a-zA-Z-]+/translation\.toml$' > changed_files.txt || echo "No matching TOML files found in PR"
|
gh pr view ${{ steps.get-pr-data.outputs.pr_number }} --json files -q ".files[].path" | grep -E '^frontend/editor/public/locales/[a-zA-Z-]+/translation\.toml$' > changed_files.txt || echo "No matching TOML files found in PR"
|
||||||
# Check if any files were found
|
# Check if any files were found
|
||||||
if [ ! -s changed_files.txt ]; then
|
if [ ! -s changed_files.txt ]; then
|
||||||
echo "No TOML translation files changed in this PR"
|
echo "No TOML translation files changed in this PR"
|
||||||
@@ -166,12 +166,12 @@ jobs:
|
|||||||
|
|
||||||
// Determine reference file
|
// Determine reference file
|
||||||
let referenceFilePath;
|
let referenceFilePath;
|
||||||
if (changedFiles.includes("frontend/public/locales/en-GB/translation.toml")) {
|
if (changedFiles.includes("frontend/editor/public/locales/en-GB/translation.toml")) {
|
||||||
console.log("Using PR branch reference file.");
|
console.log("Using PR branch reference file.");
|
||||||
const { data: fileContent } = await github.rest.repos.getContent({
|
const { data: fileContent } = await github.rest.repos.getContent({
|
||||||
owner: prRepoOwner,
|
owner: prRepoOwner,
|
||||||
repo: prRepoName,
|
repo: prRepoName,
|
||||||
path: "frontend/public/locales/en-GB/translation.toml",
|
path: "frontend/editor/public/locales/en-GB/translation.toml",
|
||||||
ref: branch,
|
ref: branch,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ jobs:
|
|||||||
const { data: fileContent } = await github.rest.repos.getContent({
|
const { data: fileContent } = await github.rest.repos.getContent({
|
||||||
owner: repoOwner,
|
owner: repoOwner,
|
||||||
repo: repoName,
|
repo: repoName,
|
||||||
path: "frontend/public/locales/en-GB/translation.toml",
|
path: "frontend/editor/public/locales/en-GB/translation.toml",
|
||||||
ref: "main",
|
ref: "main",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -70,5 +70,5 @@ jobs:
|
|||||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
with:
|
with:
|
||||||
name: playwright-report-live-${{ github.run_id }}
|
name: playwright-report-live-${{ github.run_id }}
|
||||||
path: frontend/playwright-report/
|
path: frontend/editor/playwright-report/
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|||||||
@@ -50,5 +50,5 @@ jobs:
|
|||||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
with:
|
with:
|
||||||
name: playwright-report-stubbed-${{ github.run_id }}
|
name: playwright-report-stubbed-${{ github.run_id }}
|
||||||
path: frontend/playwright-report/
|
path: frontend/editor/playwright-report/
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|||||||
@@ -118,23 +118,23 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
PR_IS_FORK: "true"
|
PR_IS_FORK: "true"
|
||||||
run: |
|
run: |
|
||||||
node base/frontend/scripts/generate-licenses.js \
|
node base/frontend/editor/scripts/generate-licenses.js \
|
||||||
--input frontend/src/assets/3rdPartyLicenses.json
|
--input frontend/editor/src/assets/3rdPartyLicenses.json
|
||||||
|
|
||||||
- name: Copy postprocessed artifacts back (fork PRs)
|
- name: Copy postprocessed artifacts back (fork PRs)
|
||||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true
|
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true
|
||||||
run: |
|
run: |
|
||||||
mkdir -p frontend/src/assets
|
mkdir -p frontend/editor/src/assets
|
||||||
if [ -f "base/frontend/src/assets/3rdPartyLicenses.json" ]; then
|
if [ -f "base/frontend/editor/src/assets/3rdPartyLicenses.json" ]; then
|
||||||
cp base/frontend/src/assets/3rdPartyLicenses.json frontend/src/assets/3rdPartyLicenses.json
|
cp base/frontend/editor/src/assets/3rdPartyLicenses.json frontend/editor/src/assets/3rdPartyLicenses.json
|
||||||
fi
|
fi
|
||||||
if [ -f "base/frontend/src/assets/license-warnings.json" ]; then
|
if [ -f "base/frontend/editor/src/assets/license-warnings.json" ]; then
|
||||||
cp base/frontend/src/assets/license-warnings.json frontend/src/assets/license-warnings.json
|
cp base/frontend/editor/src/assets/license-warnings.json frontend/editor/src/assets/license-warnings.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Check for license warnings
|
- name: Check for license warnings
|
||||||
run: |
|
run: |
|
||||||
if [ -f "frontend/src/assets/license-warnings.json" ]; then
|
if [ -f "frontend/editor/src/assets/license-warnings.json" ]; then
|
||||||
echo "LICENSE_WARNINGS_EXIST=true" >> $GITHUB_ENV
|
echo "LICENSE_WARNINGS_EXIST=true" >> $GITHUB_ENV
|
||||||
else
|
else
|
||||||
echo "LICENSE_WARNINGS_EXIST=false" >> $GITHUB_ENV
|
echo "LICENSE_WARNINGS_EXIST=false" >> $GITHUB_ENV
|
||||||
@@ -182,10 +182,10 @@ jobs:
|
|||||||
echo ""
|
echo ""
|
||||||
if [ "${LICENSE_WARNINGS_EXIST}" = "true" ]; then
|
if [ "${LICENSE_WARNINGS_EXIST}" = "true" ]; then
|
||||||
echo "❌ **Failed** – incompatible or unknown licenses found."
|
echo "❌ **Failed** – incompatible or unknown licenses found."
|
||||||
if [ -f "frontend/src/assets/license-warnings.json" ]; then
|
if [ -f "frontend/editor/src/assets/license-warnings.json" ]; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "### Warnings"
|
echo "### Warnings"
|
||||||
jq -r '.warnings[] | "- \(.message)"' frontend/src/assets/license-warnings.json || true
|
jq -r '.warnings[] | "- \(.message)"' frontend/editor/src/assets/license-warnings.json || true
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "✅ **Passed** – no license warnings detected."
|
echo "✅ **Passed** – no license warnings detected."
|
||||||
@@ -211,7 +211,7 @@ jobs:
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
let warningDetails = '';
|
let warningDetails = '';
|
||||||
try {
|
try {
|
||||||
const warnings = JSON.parse(fs.readFileSync('frontend/src/assets/license-warnings.json', 'utf8'));
|
const warnings = JSON.parse(fs.readFileSync('frontend/editor/src/assets/license-warnings.json', 'utf8'));
|
||||||
warningDetails = warnings.warnings.map(w => `- ${w.message}`).join('\n');
|
warningDetails = warnings.warnings.map(w => `- ${w.message}`).join('\n');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
warningDetails = 'Unable to read warning details';
|
warningDetails = 'Unable to read warning details';
|
||||||
@@ -251,7 +251,7 @@ jobs:
|
|||||||
- name: Commit changes (Push only)
|
- name: Commit changes (Push only)
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
run: |
|
run: |
|
||||||
git add frontend/src/assets/3rdPartyLicenses.json
|
git add frontend/editor/src/assets/3rdPartyLicenses.json
|
||||||
# Note: Do NOT commit license-warnings.json - it's only for PR review
|
# Note: Do NOT commit license-warnings.json - it's only for PR review
|
||||||
git diff --staged --quiet || echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
|
git diff --staged --quiet || echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
|
||||||
|
|
||||||
@@ -269,7 +269,7 @@ jobs:
|
|||||||
|
|
||||||
The following licenses may require review for corporate compatibility:
|
The following licenses may require review for corporate compatibility:
|
||||||
|
|
||||||
$(cat frontend/src/assets/license-warnings.json | jq -r '.warnings[].message')
|
$(cat frontend/editor/src/assets/license-warnings.json | jq -r '.warnings[].message')
|
||||||
|
|
||||||
Please review these licenses to ensure they are acceptable for your use case."
|
Please review these licenses to ensure they are acceptable for your use case."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -113,5 +113,5 @@ jobs:
|
|||||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
with:
|
with:
|
||||||
name: frontend-build
|
name: frontend-build
|
||||||
path: frontend/dist/
|
path: frontend/editor/dist/
|
||||||
retention-days: 3
|
retention-days: 3
|
||||||
|
|||||||
@@ -427,7 +427,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
KEYPAIR_ALIAS: ${{ secrets.SM_KEYPAIR_ALIAS }}
|
KEYPAIR_ALIAS: ${{ secrets.SM_KEYPAIR_ALIAS }}
|
||||||
run: |
|
run: |
|
||||||
cat > ./frontend/src-tauri/tauri.windows.conf.json <<EOF
|
cat > ./frontend/editor/src-tauri/tauri.windows.conf.json <<EOF
|
||||||
{
|
{
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"windows": {
|
"windows": {
|
||||||
@@ -440,7 +440,7 @@ jobs:
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
echo "Generated tauri.windows.conf.json (alias masked):"
|
echo "Generated tauri.windows.conf.json (alias masked):"
|
||||||
sed "s/${KEYPAIR_ALIAS}/***/g" ./frontend/src-tauri/tauri.windows.conf.json
|
sed "s/${KEYPAIR_ALIAS}/***/g" ./frontend/editor/src-tauri/tauri.windows.conf.json
|
||||||
|
|
||||||
- name: Sign JPDFium dylibs inside bootJar (macOS only)
|
- name: Sign JPDFium dylibs inside bootJar (macOS only)
|
||||||
if: matrix.platform == 'macos-15' && env.APPLE_CERTIFICATE != ''
|
if: matrix.platform == 'macos-15' && env.APPLE_CERTIFICATE != ''
|
||||||
@@ -492,7 +492,7 @@ jobs:
|
|||||||
SM_CODE_SIGNING_CERT_SHA1_HASH: ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}
|
SM_CODE_SIGNING_CERT_SHA1_HASH: ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}
|
||||||
CI: true
|
CI: true
|
||||||
with:
|
with:
|
||||||
projectPath: ./frontend
|
projectPath: ./frontend/editor
|
||||||
tauriScript: npx tauri
|
tauriScript: npx tauri
|
||||||
args: ${{ matrix.args }}
|
args: ${{ matrix.args }}
|
||||||
|
|
||||||
@@ -518,7 +518,7 @@ jobs:
|
|||||||
$allSigned = $true
|
$allSigned = $true
|
||||||
|
|
||||||
# Check MSI installer (outer wrapper - what users download)
|
# Check MSI installer (outer wrapper - what users download)
|
||||||
$msiFiles = Get-ChildItem -Path "./frontend/src-tauri/target" -Filter "*.msi" -Recurse -File
|
$msiFiles = Get-ChildItem -Path "./frontend/editor/src-tauri/target" -Filter "*.msi" -Recurse -File
|
||||||
if ($msiFiles.Count -eq 0) {
|
if ($msiFiles.Count -eq 0) {
|
||||||
Write-Host "[ERROR] No MSI found under target/"
|
Write-Host "[ERROR] No MSI found under target/"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -587,7 +587,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ./dist
|
mkdir -p ./dist
|
||||||
cd ./frontend/src-tauri/target
|
cd ./frontend/editor/src-tauri/target
|
||||||
|
|
||||||
# Find and rename artifacts based on platform
|
# Find and rename artifacts based on platform
|
||||||
if [ "${{ matrix.platform }}" = "windows-latest" ]; then
|
if [ "${{ matrix.platform }}" = "windows-latest" ]; then
|
||||||
|
|||||||
@@ -49,5 +49,5 @@ jobs:
|
|||||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
with:
|
with:
|
||||||
name: playwright-nightly-${{ github.run_id }}
|
name: playwright-nightly-${{ github.run_id }}
|
||||||
path: frontend/playwright-report/
|
path: frontend/editor/playwright-report/
|
||||||
retention-days: 14
|
retention-days: 14
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ on:
|
|||||||
- "app/core/build.gradle"
|
- "app/core/build.gradle"
|
||||||
- "app/proprietary/build.gradle"
|
- "app/proprietary/build.gradle"
|
||||||
- "README.md"
|
- "README.md"
|
||||||
- "frontend/public/locales/*/translation.toml"
|
- "frontend/editor/public/locales/*/translation.toml"
|
||||||
- "app/core/src/main/resources/static/3rdPartyLicenses.json"
|
- "app/core/src/main/resources/static/3rdPartyLicenses.json"
|
||||||
- "scripts/ignore_translation.toml"
|
- "scripts/ignore_translation.toml"
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Sync translation TOML files
|
- name: Sync translation TOML files
|
||||||
run: |
|
run: |
|
||||||
python .github/scripts/check_language_toml.py --reference-file "frontend/public/locales/en-GB/translation.toml" --branch main
|
python .github/scripts/check_language_toml.py --reference-file "frontend/editor/public/locales/en-GB/translation.toml" --branch main
|
||||||
|
|
||||||
- name: pre-commit run
|
- name: pre-commit run
|
||||||
run: |
|
run: |
|
||||||
@@ -70,7 +70,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Commit translation files
|
- name: Commit translation files
|
||||||
run: |
|
run: |
|
||||||
git add frontend/public/locales/*/translation.toml
|
git add frontend/editor/public/locales/*/translation.toml
|
||||||
git diff --staged --quiet || git commit -m ":memo: Sync translation files (TOML)" || echo "No changes detected"
|
git diff --staged --quiet || git commit -m ":memo: Sync translation files (TOML)" || echo "No changes detected"
|
||||||
|
|
||||||
- name: Sync README.md
|
- name: Sync README.md
|
||||||
@@ -100,7 +100,7 @@ jobs:
|
|||||||
This Pull Request was automatically generated to synchronize updates to translation files and documentation. Below are the details of the changes made:
|
This Pull Request was automatically generated to synchronize updates to translation files and documentation. Below are the details of the changes made:
|
||||||
|
|
||||||
#### **1. Synchronization of Translation Files**
|
#### **1. Synchronization of Translation Files**
|
||||||
- Updated translation files (`frontend/public/locales/*/translation.toml`) to reflect changes in the reference file `en-GB/translation.toml`.
|
- Updated translation files (`frontend/editor/public/locales/*/translation.toml`) to reflect changes in the reference file `en-GB/translation.toml`.
|
||||||
- Ensured consistency and synchronization across all supported language files.
|
- Ensured consistency and synchronization across all supported language files.
|
||||||
- Highlighted any missing or incomplete translations.
|
- Highlighted any missing or incomplete translations.
|
||||||
- **Format**: TOML
|
- **Format**: TOML
|
||||||
@@ -125,5 +125,5 @@ jobs:
|
|||||||
sign-commits: true
|
sign-commits: true
|
||||||
add-paths: |
|
add-paths: |
|
||||||
README.md
|
README.md
|
||||||
frontend/public/locales/*/translation.toml
|
frontend/editor/public/locales/*/translation.toml
|
||||||
scripts/ignore_translation.toml
|
scripts/ignore_translation.toml
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
KEYPAIR_ALIAS: ${{ secrets.SM_KEYPAIR_ALIAS }}
|
KEYPAIR_ALIAS: ${{ secrets.SM_KEYPAIR_ALIAS }}
|
||||||
run: |
|
run: |
|
||||||
cat > ./frontend/src-tauri/tauri.windows.conf.json <<EOF
|
cat > ./frontend/editor/src-tauri/tauri.windows.conf.json <<EOF
|
||||||
{
|
{
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"windows": {
|
"windows": {
|
||||||
@@ -356,7 +356,7 @@ jobs:
|
|||||||
SM_CODE_SIGNING_CERT_SHA1_HASH: ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}
|
SM_CODE_SIGNING_CERT_SHA1_HASH: ${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}
|
||||||
CI: true
|
CI: true
|
||||||
with:
|
with:
|
||||||
projectPath: ./frontend
|
projectPath: ./frontend/editor
|
||||||
tauriScript: npx tauri
|
tauriScript: npx tauri
|
||||||
# Linux: build deb+rpm only here. AppImage runs in its own
|
# Linux: build deb+rpm only here. AppImage runs in its own
|
||||||
# continue-on-error step below so its persistent linuxdeploy
|
# continue-on-error step below so its persistent linuxdeploy
|
||||||
@@ -381,7 +381,7 @@ jobs:
|
|||||||
VITE_SAAS_BACKEND_API_URL: ${{ secrets.VITE_SAAS_BACKEND_API_URL || 'https://api.stirlingpdf.com' }}
|
VITE_SAAS_BACKEND_API_URL: ${{ secrets.VITE_SAAS_BACKEND_API_URL || 'https://api.stirlingpdf.com' }}
|
||||||
CI: true
|
CI: true
|
||||||
with:
|
with:
|
||||||
projectPath: ./frontend
|
projectPath: ./frontend/editor
|
||||||
tauriScript: npx tauri
|
tauriScript: npx tauri
|
||||||
args: --bundles appimage
|
args: --bundles appimage
|
||||||
|
|
||||||
@@ -399,7 +399,7 @@ jobs:
|
|||||||
if: matrix.platform == 'macos-15'
|
if: matrix.platform == 'macos-15'
|
||||||
run: |
|
run: |
|
||||||
echo "🔍 Verifying notarization status..."
|
echo "🔍 Verifying notarization status..."
|
||||||
cd ./frontend/src-tauri/target
|
cd ./frontend/editor/src-tauri/target
|
||||||
DMG_FILE=$(find . -name "*.dmg" | head -1)
|
DMG_FILE=$(find . -name "*.dmg" | head -1)
|
||||||
if [ -n "$DMG_FILE" ]; then
|
if [ -n "$DMG_FILE" ]; then
|
||||||
echo "Found DMG: $DMG_FILE"
|
echo "Found DMG: $DMG_FILE"
|
||||||
@@ -414,7 +414,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ./dist
|
mkdir -p ./dist
|
||||||
cd ./frontend/src-tauri/target
|
cd ./frontend/editor/src-tauri/target
|
||||||
|
|
||||||
# Find and rename artifacts based on platform
|
# Find and rename artifacts based on platform
|
||||||
if [ "${{ matrix.platform }}" = "windows-latest" ]; then
|
if [ "${{ matrix.platform }}" = "windows-latest" ]; then
|
||||||
@@ -504,7 +504,7 @@ jobs:
|
|||||||
- name: Verify build artifacts
|
- name: Verify build artifacts
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd ./frontend/src-tauri/target
|
cd ./frontend/editor/src-tauri/target
|
||||||
|
|
||||||
# Check for expected artifacts based on platform
|
# Check for expected artifacts based on platform
|
||||||
if [ "${{ matrix.platform }}" = "windows-latest" ]; then
|
if [ "${{ matrix.platform }}" = "windows-latest" ]; then
|
||||||
@@ -535,7 +535,7 @@ jobs:
|
|||||||
- name: Test artifact sizes
|
- name: Test artifact sizes
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd ./frontend/src-tauri/target
|
cd ./frontend/editor/src-tauri/target
|
||||||
echo "Artifact sizes for ${{ matrix.name }}:"
|
echo "Artifact sizes for ${{ matrix.name }}:"
|
||||||
find . -name "*.exe" -o -name "*.dmg" -o -name "*.deb" -o -name "*.rpm" -o -name "*.AppImage" -o -name "*.msi" | while read file; do
|
find . -name "*.exe" -o -name "*.dmg" -o -name "*.deb" -o -name "*.rpm" -o -name "*.AppImage" -o -name "*.msi" | while read file; do
|
||||||
if [ -f "$file" ]; then
|
if [ -f "$file" ]; then
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ repos:
|
|||||||
- --skip="./.*,*.csv,*.json,*.ambr"
|
- --skip="./.*,*.csv,*.json,*.ambr"
|
||||||
- --quiet-level=2
|
- --quiet-level=2
|
||||||
files: \.(html|css|js|py|md)$
|
files: \.(html|css|js|py|md)$
|
||||||
exclude: (.vscode|.devcontainer|app/core/src/main/resources|app/proprietary/src/main/resources|frontend/public/vendor|Dockerfile|.*/pdfjs.*|.*/thirdParty.*|bootstrap.*|.*\.min\..*|.*diff\.js)
|
exclude: (.vscode|.devcontainer|app/core/src/main/resources|app/proprietary/src/main/resources|frontend/editor/public/vendor|Dockerfile|.*/pdfjs.*|.*/thirdParty.*|bootstrap.*|.*\.min\..*|.*diff\.js)
|
||||||
- repo: https://github.com/gitleaks/gitleaks
|
- repo: https://github.com/gitleaks/gitleaks
|
||||||
rev: v8.30.0
|
rev: v8.30.0
|
||||||
hooks:
|
hooks:
|
||||||
@@ -38,7 +38,7 @@ repos:
|
|||||||
rev: v0.24.4
|
rev: v0.24.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: toml-sort-fix
|
- id: toml-sort-fix
|
||||||
files: frontend/public/locales/.*\.toml$
|
files: frontend/editor/public/locales/.*\.toml$
|
||||||
args: ['--in-place', '--all', '--ignore-case']
|
args: ['--in-place', '--all', '--ignore-case']
|
||||||
# - repo: https://github.com/thibaudcolas/pre-commit-stylelint
|
# - repo: https://github.com/thibaudcolas/pre-commit-stylelint
|
||||||
# rev: v16.21.1
|
# rev: v16.21.1
|
||||||
|
|||||||
@@ -32,51 +32,51 @@ tasks:
|
|||||||
desc: "Build installer provisioner"
|
desc: "Build installer provisioner"
|
||||||
platforms: [windows]
|
platforms: [windows]
|
||||||
cmds:
|
cmds:
|
||||||
- node scripts/build-provisioner.mjs
|
- node editor/scripts/build-provisioner.mjs
|
||||||
|
|
||||||
dev:
|
dev:
|
||||||
desc: "Start Tauri desktop dev mode"
|
desc: "Start Tauri desktop dev mode"
|
||||||
deps: [prepare]
|
deps: [prepare]
|
||||||
ignore_error: true
|
ignore_error: true
|
||||||
cmds:
|
cmds:
|
||||||
- npx tauri dev --no-watch
|
- cd editor && npx tauri dev --no-watch
|
||||||
|
|
||||||
build:
|
build:
|
||||||
desc: "Build Tauri desktop app (production)"
|
desc: "Build Tauri desktop app (production)"
|
||||||
deps: [prepare]
|
deps: [prepare]
|
||||||
cmds:
|
cmds:
|
||||||
- npx tauri build
|
- cd editor && npx tauri build
|
||||||
|
|
||||||
build:dev:
|
build:dev:
|
||||||
desc: "Build Tauri desktop app (dev, no bundling)"
|
desc: "Build Tauri desktop app (dev, no bundling)"
|
||||||
deps: [prepare]
|
deps: [prepare]
|
||||||
cmds:
|
cmds:
|
||||||
- npx tauri build --no-bundle
|
- cd editor && npx tauri build --no-bundle
|
||||||
|
|
||||||
build:dev:mac:
|
build:dev:mac:
|
||||||
desc: "Build Tauri desktop .app bundle (macOS)"
|
desc: "Build Tauri desktop .app bundle (macOS)"
|
||||||
deps: [prepare]
|
deps: [prepare]
|
||||||
cmds:
|
cmds:
|
||||||
- npx tauri build --bundles app
|
- cd editor && npx tauri build --bundles app
|
||||||
|
|
||||||
build:dev:windows:
|
build:dev:windows:
|
||||||
desc: "Build Tauri desktop NSIS installer (Windows)"
|
desc: "Build Tauri desktop NSIS installer (Windows)"
|
||||||
deps: [prepare]
|
deps: [prepare]
|
||||||
cmds:
|
cmds:
|
||||||
- npx tauri build --bundles nsis
|
- cd editor && npx tauri build --bundles nsis
|
||||||
|
|
||||||
build:dev:linux:
|
build:dev:linux:
|
||||||
desc: "Build Tauri desktop AppImage (Linux)"
|
desc: "Build Tauri desktop AppImage (Linux)"
|
||||||
deps: [prepare]
|
deps: [prepare]
|
||||||
cmds:
|
cmds:
|
||||||
- npx tauri build --bundles appimage
|
- cd editor && npx tauri build --bundles appimage
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
desc: "Clean Tauri/Cargo build artifacts"
|
desc: "Clean Tauri/Cargo build artifacts"
|
||||||
cmds:
|
cmds:
|
||||||
- task: jlink:clean
|
- task: jlink:clean
|
||||||
- cd src-tauri && cargo clean
|
- cd editor/src-tauri && cargo clean
|
||||||
- rm -rf dist build
|
- rm -rf editor/dist editor/build
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# JLink — Build bundled Java runtime for Tauri
|
# JLink — Build bundled Java runtime for Tauri
|
||||||
@@ -98,17 +98,17 @@ tasks:
|
|||||||
platforms: [windows]
|
platforms: [windows]
|
||||||
- cmd: ./gradlew bootJar --no-daemon -PjpdfiumPlatforms={{.JPDFIUM_PLATFORMS}}
|
- cmd: ./gradlew bootJar --no-daemon -PjpdfiumPlatforms={{.JPDFIUM_PLATFORMS}}
|
||||||
platforms: [linux, darwin]
|
platforms: [linux, darwin]
|
||||||
- mkdir -p frontend/src-tauri/libs
|
- mkdir -p frontend/editor/src-tauri/libs
|
||||||
- cp app/core/build/libs/stirling-pdf-*.jar frontend/src-tauri/libs/
|
- cp app/core/build/libs/stirling-pdf-*.jar frontend/editor/src-tauri/libs/
|
||||||
status:
|
status:
|
||||||
- test -f frontend/src-tauri/libs/stirling-pdf-*.jar
|
- test -f frontend/editor/src-tauri/libs/stirling-pdf-*.jar
|
||||||
|
|
||||||
jlink:runtime:
|
jlink:runtime:
|
||||||
desc: "Create custom JRE with jlink"
|
desc: "Create custom JRE with jlink"
|
||||||
deps: [jlink:jar]
|
deps: [jlink:jar]
|
||||||
cmds:
|
cmds:
|
||||||
- rm -rf src-tauri/runtime/jre
|
- rm -rf editor/src-tauri/runtime/jre
|
||||||
- mkdir -p src-tauri/runtime
|
- mkdir -p editor/src-tauri/runtime
|
||||||
- >-
|
- >-
|
||||||
jlink
|
jlink
|
||||||
--add-modules {{.JLINK_MODULES}}
|
--add-modules {{.JLINK_MODULES}}
|
||||||
@@ -116,14 +116,14 @@ tasks:
|
|||||||
--compress=zip-6
|
--compress=zip-6
|
||||||
--no-header-files
|
--no-header-files
|
||||||
--no-man-pages
|
--no-man-pages
|
||||||
--output src-tauri/runtime/jre
|
--output editor/src-tauri/runtime/jre
|
||||||
status:
|
status:
|
||||||
- test -d src-tauri/runtime/jre
|
- test -d editor/src-tauri/runtime/jre
|
||||||
|
|
||||||
jlink:clean:
|
jlink:clean:
|
||||||
desc: "Remove JLink runtime and bundled JARs"
|
desc: "Remove JLink runtime and bundled JARs"
|
||||||
cmds:
|
cmds:
|
||||||
- rm -rf src-tauri/libs src-tauri/runtime
|
- rm -rf editor/src-tauri/libs editor/src-tauri/runtime
|
||||||
|
|
||||||
# macOS-only. Replaces jlink:runtime's single-arch JRE with a universal
|
# macOS-only. Replaces jlink:runtime's single-arch JRE with a universal
|
||||||
# (arm64 + x86_64) one for the universal Tauri shell. Runs the x86_64
|
# (arm64 + x86_64) one for the universal Tauri shell. Runs the x86_64
|
||||||
@@ -136,6 +136,6 @@ tasks:
|
|||||||
platforms: [darwin]
|
platforms: [darwin]
|
||||||
env:
|
env:
|
||||||
JLINK_MODULES: "{{.JLINK_MODULES}}"
|
JLINK_MODULES: "{{.JLINK_MODULES}}"
|
||||||
OUTPUT_DIR: src-tauri/runtime/jre
|
OUTPUT_DIR: editor/src-tauri/runtime/jre
|
||||||
cmds:
|
cmds:
|
||||||
- scripts/build-universal-mac-jre.sh
|
- editor/scripts/build-universal-mac-jre.sh
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ version: '3'
|
|||||||
tasks:
|
tasks:
|
||||||
install:
|
install:
|
||||||
desc: "Install Playwright browsers"
|
desc: "Install Playwright browsers"
|
||||||
dir: frontend
|
dir: frontend/editor
|
||||||
deps: [ ':frontend:install' ]
|
deps: [ ':frontend:install' ]
|
||||||
cmds:
|
cmds:
|
||||||
- npx playwright install {{.CLI_ARGS}} --with-deps
|
- npx playwright install {{.CLI_ARGS}} --with-deps
|
||||||
|
|
||||||
stubbed:
|
stubbed:
|
||||||
desc: "Run stubbed E2E tests"
|
desc: "Run stubbed E2E tests"
|
||||||
dir: frontend
|
dir: frontend/editor
|
||||||
deps: [ ':frontend:prepare' ]
|
deps: [ ':frontend:prepare' ]
|
||||||
cmds:
|
cmds:
|
||||||
- npx playwright test --project=stubbed {{.CLI_ARGS}}
|
- npx playwright test --project=stubbed {{.CLI_ARGS}}
|
||||||
@@ -72,7 +72,7 @@ tasks:
|
|||||||
live:runner:
|
live:runner:
|
||||||
internal: true
|
internal: true
|
||||||
deps: [ ':frontend:prepare' ]
|
deps: [ ':frontend:prepare' ]
|
||||||
dir: frontend
|
dir: frontend/editor
|
||||||
vars:
|
vars:
|
||||||
BASE_DIR: '{{.ROOT_DIR}}/.test-state/playwright'
|
BASE_DIR: '{{.ROOT_DIR}}/.test-state/playwright'
|
||||||
cmds:
|
cmds:
|
||||||
@@ -141,14 +141,14 @@ tasks:
|
|||||||
up first with:
|
up first with:
|
||||||
task e2e:oauth:up
|
task e2e:oauth:up
|
||||||
task e2e:saml:up
|
task e2e:saml:up
|
||||||
dir: frontend
|
dir: frontend/editor
|
||||||
deps: [ ':frontend:prepare' ]
|
deps: [ ':frontend:prepare' ]
|
||||||
cmds:
|
cmds:
|
||||||
- npx playwright test --project=enterprise {{.CLI_ARGS}}
|
- npx playwright test --project=enterprise {{.CLI_ARGS}}
|
||||||
|
|
||||||
cross-browser:
|
cross-browser:
|
||||||
desc: "Run stubbed E2E tests on Chromium, Firefox, and WebKit"
|
desc: "Run stubbed E2E tests on Chromium, Firefox, and WebKit"
|
||||||
dir: frontend
|
dir: frontend/editor
|
||||||
deps: [ ':frontend:prepare' ]
|
deps: [ ':frontend:prepare' ]
|
||||||
cmds:
|
cmds:
|
||||||
- npx playwright test --project=stubbed --project=stubbed-firefox --project=stubbed-webkit {{.CLI_ARGS}}
|
- npx playwright test --project=stubbed --project=stubbed-firefox --project=stubbed-webkit {{.CLI_ARGS}}
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
|
# Tasks operate from the workspace root (frontend/). Editor commands pass
|
||||||
|
# `editor` as the vite project root (positional after `build` / before the
|
||||||
|
# mode flag) or use `--project editor/...` for tsc — so the editor lives
|
||||||
|
# under frontend/editor/ without each task needing a cd.
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
install:
|
install:
|
||||||
desc: "Install dependencies"
|
desc: "Install dependencies"
|
||||||
@@ -21,19 +26,19 @@ tasks:
|
|||||||
vars:
|
vars:
|
||||||
MODE: '{{.MODE | default ""}}'
|
MODE: '{{.MODE | default ""}}'
|
||||||
cmds:
|
cmds:
|
||||||
- npx tsx scripts/setup-env.ts{{if .MODE}} --{{.MODE}}{{end}}
|
- npx tsx editor/scripts/setup-env.mts{{if .MODE}} --{{.MODE}}{{end}}
|
||||||
sources:
|
sources:
|
||||||
- scripts/setup-env.ts
|
- editor/scripts/setup-env.mts
|
||||||
generates:
|
generates:
|
||||||
- .env.local
|
- editor/.env.local
|
||||||
- .env{{if .MODE}}.{{.MODE}}{{end}}.local
|
- editor/.env{{if .MODE}}.{{.MODE}}{{end}}.local
|
||||||
|
|
||||||
prepare:icons:
|
prepare:icons:
|
||||||
internal: true
|
internal: true
|
||||||
run: once
|
run: once
|
||||||
deps: [install]
|
deps: [install]
|
||||||
cmds:
|
cmds:
|
||||||
- node scripts/generate-icons.js
|
- node editor/scripts/generate-icons.js
|
||||||
|
|
||||||
prepare:
|
prepare:
|
||||||
desc: "Set up dev environment"
|
desc: "Set up dev environment"
|
||||||
@@ -60,7 +65,7 @@ tasks:
|
|||||||
env:
|
env:
|
||||||
BACKEND_URL: '{{.BACKEND_URL}}'
|
BACKEND_URL: '{{.BACKEND_URL}}'
|
||||||
cmds:
|
cmds:
|
||||||
- npx vite --mode {{.MODE}} --port {{.PORT}}{{if .OPEN}} --open{{end}}
|
- npx vite editor --mode {{.MODE}} --port {{.PORT}}{{if .OPEN}} --open{{end}}
|
||||||
|
|
||||||
dev:
|
dev:
|
||||||
desc: "Start frontend dev server"
|
desc: "Start frontend dev server"
|
||||||
@@ -115,19 +120,19 @@ tasks:
|
|||||||
desc: "Production build (default mode)"
|
desc: "Production build (default mode)"
|
||||||
deps: [prepare]
|
deps: [prepare]
|
||||||
cmds:
|
cmds:
|
||||||
- npx vite build
|
- npx vite build editor
|
||||||
|
|
||||||
build:core:
|
build:core:
|
||||||
desc: "Build for core mode"
|
desc: "Build for core mode"
|
||||||
deps: [prepare]
|
deps: [prepare]
|
||||||
cmds:
|
cmds:
|
||||||
- npx vite build --mode core
|
- npx vite build editor --mode core
|
||||||
|
|
||||||
build:proprietary:
|
build:proprietary:
|
||||||
desc: "Build for proprietary mode"
|
desc: "Build for proprietary mode"
|
||||||
deps: [prepare]
|
deps: [prepare]
|
||||||
cmds:
|
cmds:
|
||||||
- npx vite build --mode proprietary
|
- npx vite build editor --mode proprietary
|
||||||
|
|
||||||
build:saas:
|
build:saas:
|
||||||
desc: "Build for SaaS mode"
|
desc: "Build for SaaS mode"
|
||||||
@@ -135,7 +140,7 @@ tasks:
|
|||||||
- task: prepare
|
- task: prepare
|
||||||
vars: { MODE: saas }
|
vars: { MODE: saas }
|
||||||
cmds:
|
cmds:
|
||||||
- npx vite build --mode saas
|
- npx vite build editor --mode saas
|
||||||
|
|
||||||
build:desktop:
|
build:desktop:
|
||||||
desc: "Build for desktop mode"
|
desc: "Build for desktop mode"
|
||||||
@@ -143,13 +148,13 @@ tasks:
|
|||||||
- task: prepare
|
- task: prepare
|
||||||
vars: { MODE: desktop }
|
vars: { MODE: desktop }
|
||||||
cmds:
|
cmds:
|
||||||
- npx vite build --mode desktop
|
- npx vite build editor --mode desktop
|
||||||
|
|
||||||
build:prototypes:
|
build:prototypes:
|
||||||
desc: "Build for prototypes mode"
|
desc: "Build for prototypes mode"
|
||||||
deps: [prepare]
|
deps: [prepare]
|
||||||
cmds:
|
cmds:
|
||||||
- npx vite build --mode prototypes
|
- npx vite build editor --mode prototypes
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Code quality
|
# Code quality
|
||||||
@@ -160,7 +165,7 @@ tasks:
|
|||||||
deps: [install]
|
deps: [install]
|
||||||
cmds:
|
cmds:
|
||||||
- npx eslint --max-warnings=0
|
- npx eslint --max-warnings=0
|
||||||
- npx dpdm src --circular --no-warning --no-tree --exit-code circular:1
|
- npx dpdm editor/src --circular --no-warning --no-tree --exit-code circular:1
|
||||||
|
|
||||||
lint:fix:
|
lint:fix:
|
||||||
desc: "Auto-fix lint issues"
|
desc: "Auto-fix lint issues"
|
||||||
@@ -195,13 +200,13 @@ tasks:
|
|||||||
desc: "Typecheck core build variant"
|
desc: "Typecheck core build variant"
|
||||||
deps: [prepare]
|
deps: [prepare]
|
||||||
cmds:
|
cmds:
|
||||||
- npx tsc --noEmit --project src/core/tsconfig.json
|
- npx tsc --noEmit --project editor/src/core/tsconfig.json
|
||||||
|
|
||||||
typecheck:proprietary:
|
typecheck:proprietary:
|
||||||
desc: "Typecheck proprietary build variant"
|
desc: "Typecheck proprietary build variant"
|
||||||
deps: [prepare]
|
deps: [prepare]
|
||||||
cmds:
|
cmds:
|
||||||
- npx tsc --noEmit --project src/proprietary/tsconfig.json
|
- npx tsc --noEmit --project editor/src/proprietary/tsconfig.json
|
||||||
|
|
||||||
typecheck:saas:
|
typecheck:saas:
|
||||||
desc: "Typecheck SaaS build variant"
|
desc: "Typecheck SaaS build variant"
|
||||||
@@ -209,7 +214,7 @@ tasks:
|
|||||||
- task: prepare
|
- task: prepare
|
||||||
vars: { MODE: saas }
|
vars: { MODE: saas }
|
||||||
cmds:
|
cmds:
|
||||||
- npx tsc --noEmit --project src/saas/tsconfig.json
|
- npx tsc --noEmit --project editor/src/saas/tsconfig.json
|
||||||
|
|
||||||
typecheck:desktop:
|
typecheck:desktop:
|
||||||
desc: "Typecheck desktop build variant"
|
desc: "Typecheck desktop build variant"
|
||||||
@@ -217,19 +222,19 @@ tasks:
|
|||||||
- task: prepare
|
- task: prepare
|
||||||
vars: { MODE: desktop }
|
vars: { MODE: desktop }
|
||||||
cmds:
|
cmds:
|
||||||
- npx tsc --noEmit --project src/desktop/tsconfig.json
|
- npx tsc --noEmit --project editor/src/desktop/tsconfig.json
|
||||||
|
|
||||||
typecheck:scripts:
|
typecheck:scripts:
|
||||||
desc: "Typecheck scripts"
|
desc: "Typecheck scripts"
|
||||||
deps: [prepare]
|
deps: [prepare]
|
||||||
cmds:
|
cmds:
|
||||||
- npx tsc --noEmit --project scripts/tsconfig.json
|
- npx tsc --noEmit --project editor/scripts/tsconfig.json
|
||||||
|
|
||||||
typecheck:prototypes:
|
typecheck:prototypes:
|
||||||
desc: "Typecheck prototypes build variant"
|
desc: "Typecheck prototypes build variant"
|
||||||
deps: [prepare]
|
deps: [prepare]
|
||||||
cmds:
|
cmds:
|
||||||
- npx tsc --noEmit --project src/prototypes/tsconfig.json
|
- npx tsc --noEmit --project editor/src/prototypes/tsconfig.json
|
||||||
|
|
||||||
typecheck:all:
|
typecheck:all:
|
||||||
desc: "Typecheck all build variants"
|
desc: "Typecheck all build variants"
|
||||||
@@ -270,19 +275,19 @@ tasks:
|
|||||||
desc: "Run tests"
|
desc: "Run tests"
|
||||||
deps: [install]
|
deps: [install]
|
||||||
cmds:
|
cmds:
|
||||||
- npx vitest run
|
- npx vitest run --root editor
|
||||||
|
|
||||||
test:watch:
|
test:watch:
|
||||||
desc: "Run tests in watch mode"
|
desc: "Run tests in watch mode"
|
||||||
deps: [install]
|
deps: [install]
|
||||||
cmds:
|
cmds:
|
||||||
- npx vitest --watch
|
- npx vitest --watch --root editor
|
||||||
|
|
||||||
test:coverage:
|
test:coverage:
|
||||||
desc: "Run tests with coverage"
|
desc: "Run tests with coverage"
|
||||||
deps: [install]
|
deps: [install]
|
||||||
cmds:
|
cmds:
|
||||||
- npx vitest --coverage
|
- npx vitest --coverage --root editor
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Code Generation
|
# Code Generation
|
||||||
@@ -292,4 +297,4 @@ tasks:
|
|||||||
desc: "Generate frontend license report"
|
desc: "Generate frontend license report"
|
||||||
deps: [install]
|
deps: [install]
|
||||||
cmds:
|
cmds:
|
||||||
- node scripts/generate-licenses.js
|
- node editor/scripts/generate-licenses.js
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ When adding tools, follow this systematic approach using the established pattern
|
|||||||
|
|
||||||
Create these files in the correct directories:
|
Create these files in the correct directories:
|
||||||
```
|
```
|
||||||
frontend/src/hooks/tools/[toolName]/
|
frontend/editor/src/hooks/tools/[toolName]/
|
||||||
├── use[ToolName]Parameters.ts # Parameter definitions and validation
|
├── use[ToolName]Parameters.ts # Parameter definitions and validation
|
||||||
└── use[ToolName]Operation.ts # Tool operation logic using useToolOperation
|
└── use[ToolName]Operation.ts # Tool operation logic using useToolOperation
|
||||||
|
|
||||||
frontend/src/components/tools/[toolName]/
|
frontend/editor/src/components/tools/[toolName]/
|
||||||
└── [ToolName]Settings.tsx # Settings UI component (if needed)
|
└── [ToolName]Settings.tsx # Settings UI component (if needed)
|
||||||
|
|
||||||
frontend/src/tools/
|
frontend/editor/src/tools/
|
||||||
└── [ToolName].tsx # Main tool component
|
└── [ToolName].tsx # Main tool component
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ export default [ToolName] as ToolComponent;
|
|||||||
## 3. Register Tool in System
|
## 3. Register Tool in System
|
||||||
Update these files to register your new tool:
|
Update these files to register your new tool:
|
||||||
|
|
||||||
**Tool Registry** (`frontend/src/data/useTranslatedToolRegistry.tsx`):
|
**Tool Registry** (`frontend/editor/src/data/useTranslatedToolRegistry.tsx`):
|
||||||
1. Add imports at the top:
|
1. Add imports at the top:
|
||||||
```typescript
|
```typescript
|
||||||
import [ToolName] from "../tools/[ToolName]";
|
import [ToolName] from "../tools/[ToolName]";
|
||||||
@@ -155,7 +155,7 @@ import [ToolName]Settings from "../components/tools/[toolName]/[ToolName]Setting
|
|||||||
## 4. Add Tooltips (Optional but Recommended)
|
## 4. Add Tooltips (Optional but Recommended)
|
||||||
Create user-friendly tooltips to help non-technical users understand your tool. **Use simple, clear language - avoid technical jargon:**
|
Create user-friendly tooltips to help non-technical users understand your tool. **Use simple, clear language - avoid technical jargon:**
|
||||||
|
|
||||||
**Tooltip Hook** (`frontend/src/components/tooltips/use[ToolName]Tips.ts`):
|
**Tooltip Hook** (`frontend/editor/src/components/tooltips/use[ToolName]Tips.ts`):
|
||||||
```typescript
|
```typescript
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { TooltipContent } from '../../types/tips';
|
import { TooltipContent } from '../../types/tips';
|
||||||
@@ -202,7 +202,7 @@ const [ToolName] = (props: BaseToolProps) => {
|
|||||||
## 5. Add Translations
|
## 5. Add Translations
|
||||||
Update translation files. **Important: Only update `en-GB` files** - other languages are handled separately.
|
Update translation files. **Important: Only update `en-GB` files** - other languages are handled separately.
|
||||||
|
|
||||||
**File to update:** `frontend/public/locales/en-GB/translation.toml`
|
**File to update:** `frontend/editor/public/locales/en-GB/translation.toml`
|
||||||
|
|
||||||
**Required Translation Keys**:
|
**Required Translation Keys**:
|
||||||
```toml
|
```toml
|
||||||
|
|||||||
@@ -139,9 +139,9 @@ The project structure is defined in `engine/pyproject.toml`. Any new dependencie
|
|||||||
|
|
||||||
#### Environment Variables
|
#### Environment Variables
|
||||||
- All `VITE_*` variables must be declared in the appropriate committed env file:
|
- All `VITE_*` variables must be declared in the appropriate committed env file:
|
||||||
- `frontend/.env` — core, proprietary, and shared vars
|
- `frontend/editor/.env` — core, proprietary, and shared vars
|
||||||
- `frontend/.env.saas` — SaaS-only vars (layered on top of `.env` in SaaS mode)
|
- `frontend/editor/.env.saas` — SaaS-only vars (layered on top of `.env` in SaaS mode)
|
||||||
- `frontend/.env.desktop` — desktop (Tauri)-only vars (layered on top of `.env` in desktop mode)
|
- `frontend/editor/.env.desktop` — desktop (Tauri)-only vars (layered on top of `.env` in desktop mode)
|
||||||
- These files are committed to Git and must not contain private keys
|
- These files are committed to Git and must not contain private keys
|
||||||
- Local overrides (API keys, machine-specific settings) go in uncommitted sibling `.env.local` / `.env.saas.local` / `.env.desktop.local` files — Vite automatically layers them on top
|
- Local overrides (API keys, machine-specific settings) go in uncommitted sibling `.env.local` / `.env.saas.local` / `.env.desktop.local` files — Vite automatically layers them on top
|
||||||
- Never use `|| 'hardcoded-fallback'` inline — put defaults in the committed env files
|
- Never use `|| 'hardcoded-fallback'` inline — put defaults in the committed env files
|
||||||
@@ -152,7 +152,7 @@ The project structure is defined in `engine/pyproject.toml`. Any new dependencie
|
|||||||
#### Import Paths - CRITICAL
|
#### Import Paths - CRITICAL
|
||||||
**ALWAYS use `@app/*` for imports.** Do not use `@core/*` or `@proprietary/*` unless explicitly wrapping/extending a lower layer implementation.
|
**ALWAYS use `@app/*` for imports.** Do not use `@core/*` or `@proprietary/*` unless explicitly wrapping/extending a lower layer implementation.
|
||||||
|
|
||||||
For a broader explanation of the frontend layering and override architecture, see [frontend/DeveloperGuide.md](frontend/DeveloperGuide.md).
|
For a broader explanation of the frontend layering and override architecture, see [frontend/editor/DeveloperGuide.md](frontend/editor/DeveloperGuide.md).
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// ✅ CORRECT - Use @app/* for all imports
|
// ✅ CORRECT - Use @app/* for all imports
|
||||||
@@ -243,7 +243,7 @@ Frontend designed for **stateful document processing**:
|
|||||||
- No file reloading between tools - performance critical for large PDFs (up to 100GB+)
|
- No file reloading between tools - performance critical for large PDFs (up to 100GB+)
|
||||||
|
|
||||||
#### FileContext - Central State Management
|
#### FileContext - Central State Management
|
||||||
**Location**: `frontend/src/core/contexts/FileContext.tsx`
|
**Location**: `frontend/editor/src/core/contexts/FileContext.tsx`
|
||||||
- **Active files**: Currently loaded PDFs and their variants
|
- **Active files**: Currently loaded PDFs and their variants
|
||||||
- **Tool navigation**: Current mode (viewer/pageEditor/fileEditor/toolName)
|
- **Tool navigation**: Current mode (viewer/pageEditor/fileEditor/toolName)
|
||||||
- **Memory management**: PDF document cleanup, blob URL lifecycle, Web Worker management
|
- **Memory management**: PDF document cleanup, blob URL lifecycle, Web Worker management
|
||||||
@@ -268,7 +268,7 @@ Without cleanup: browser crashes with memory leaks.
|
|||||||
|
|
||||||
**Architecture**: Modular hook-based system with clear separation of concerns:
|
**Architecture**: Modular hook-based system with clear separation of concerns:
|
||||||
|
|
||||||
- **useToolOperation** (`frontend/src/core/hooks/tools/shared/useToolOperation.ts`): Main orchestrator hook
|
- **useToolOperation** (`frontend/editor/src/core/hooks/tools/shared/useToolOperation.ts`): Main orchestrator hook
|
||||||
- Coordinates all tool operations with consistent interface
|
- Coordinates all tool operations with consistent interface
|
||||||
- Integrates with FileContext for operation tracking
|
- Integrates with FileContext for operation tracking
|
||||||
- Handles validation, error handling, and UI state management
|
- Handles validation, error handling, and UI state management
|
||||||
@@ -356,7 +356,7 @@ return useToolOperation({
|
|||||||
### Frontend Directory Structure
|
### Frontend Directory Structure
|
||||||
The frontend is organized with a clear separation of concerns:
|
The frontend is organized with a clear separation of concerns:
|
||||||
|
|
||||||
- **`frontend/src/core/`**: Main application code (shared, production-ready components)
|
- **`frontend/editor/src/core/`**: Main application code (shared, production-ready components)
|
||||||
- **`core/components/`**: React components organized by feature
|
- **`core/components/`**: React components organized by feature
|
||||||
- `core/components/tools/`: Individual PDF tool implementations
|
- `core/components/tools/`: Individual PDF tool implementations
|
||||||
- `core/components/viewer/`: PDF viewer components
|
- `core/components/viewer/`: PDF viewer components
|
||||||
@@ -374,17 +374,17 @@ The frontend is organized with a clear separation of concerns:
|
|||||||
- **`core/data/`**: Static data (tool taxonomy, etc.)
|
- **`core/data/`**: Static data (tool taxonomy, etc.)
|
||||||
- **`core/services/`**: Business logic services (PDF processing, storage, etc.)
|
- **`core/services/`**: Business logic services (PDF processing, storage, etc.)
|
||||||
|
|
||||||
- **`frontend/src/desktop/`**: Desktop-specific (Tauri) code
|
- **`frontend/editor/src/desktop/`**: Desktop-specific (Tauri) code
|
||||||
- **`frontend/src/proprietary/`**: Proprietary/licensed features
|
- **`frontend/editor/src/proprietary/`**: Proprietary/licensed features
|
||||||
- **`frontend/src-tauri/`**: Tauri (Rust) native desktop application code
|
- **`frontend/editor/src-tauri/`**: Tauri (Rust) native desktop application code
|
||||||
- **`frontend/public/`**: Static assets served directly
|
- **`frontend/editor/public/`**: Static assets served directly
|
||||||
- `public/locales/`: Translation JSON files
|
- `public/locales/`: Translation JSON files
|
||||||
|
|
||||||
### Component Architecture
|
### Component Architecture
|
||||||
- **Static Assets**: CSS, JS, and resources in `src/main/resources/static/` (legacy) + `frontend/public/` (modern)
|
- **Static Assets**: CSS, JS, and resources in `src/main/resources/static/` (legacy) + `frontend/editor/public/` (modern)
|
||||||
- **Internationalization**:
|
- **Internationalization**:
|
||||||
- Backend: `messages_*.properties` files
|
- Backend: `messages_*.properties` files
|
||||||
- Frontend: JSON files in `frontend/public/locales/` (converted from .properties)
|
- Frontend: JSON files in `frontend/editor/public/locales/` (converted from .properties)
|
||||||
- Conversion Script: `scripts/convert_properties_to_json.py`
|
- Conversion Script: `scripts/convert_properties_to_json.py`
|
||||||
|
|
||||||
### Configuration Modes
|
### Configuration Modes
|
||||||
@@ -409,7 +409,7 @@ The frontend is organized with a clear separation of concerns:
|
|||||||
4. **Code Style**: Spotless enforces Google Java Format automatically (`task backend:format`)
|
4. **Code Style**: Spotless enforces Google Java Format automatically (`task backend:format`)
|
||||||
5. **Translations**:
|
5. **Translations**:
|
||||||
- Backend: Use helper scripts in `/scripts` for multi-language updates
|
- Backend: Use helper scripts in `/scripts` for multi-language updates
|
||||||
- Frontend: Update JSON files in `frontend/public/locales/` or use conversion script
|
- Frontend: Update JSON files in `frontend/editor/public/locales/` or use conversion script
|
||||||
6. **Documentation**: API docs auto-generated and available at `/swagger-ui/index.html`
|
6. **Documentation**: API docs auto-generated and available at `/swagger-ui/index.html`
|
||||||
|
|
||||||
## Frontend Architecture Status
|
## Frontend Architecture Status
|
||||||
@@ -427,7 +427,7 @@ The frontend is organized with a clear separation of concerns:
|
|||||||
## Translation Rules
|
## Translation Rules
|
||||||
|
|
||||||
- **CRITICAL**: Always update translations in `en-GB` only, never `en-US`
|
- **CRITICAL**: Always update translations in `en-GB` only, never `en-US`
|
||||||
- Translation files are located in `frontend/public/locales/`
|
- Translation files are located in `frontend/editor/public/locales/`
|
||||||
|
|
||||||
## Important Notes
|
## Important Notes
|
||||||
|
|
||||||
|
|||||||
@@ -128,24 +128,26 @@ See [the frontend README](frontend/README.md#tauri) for detailed build instructi
|
|||||||
Stirling-PDF/
|
Stirling-PDF/
|
||||||
├── .github/ # GitHub-specific files (workflows, issue templates)
|
├── .github/ # GitHub-specific files (workflows, issue templates)
|
||||||
├── configs/ # Configuration files used by stirling at runtime (generated at runtime)
|
├── configs/ # Configuration files used by stirling at runtime (generated at runtime)
|
||||||
├── frontend/ # React SPA frontend (Stirling 2.0)
|
├── frontend/ # Frontend workspace (Stirling 2.0)
|
||||||
│ ├── src/
|
│ ├── editor/ # PDF editor app (the original React SPA)
|
||||||
│ │ ├── components/ # React components
|
│ │ ├── src/
|
||||||
│ │ ├── tools/ # Tool-specific React components
|
│ │ │ ├── components/ # React components
|
||||||
│ │ ├── hooks/ # Custom React hooks
|
│ │ │ ├── tools/ # Tool-specific React components
|
||||||
│ │ ├── services/ # API and utility services
|
│ │ │ ├── hooks/ # Custom React hooks
|
||||||
│ │ ├── types/ # TypeScript type definitions
|
│ │ │ ├── services/ # API and utility services
|
||||||
│ │ └── utils/ # Utility functions
|
│ │ │ ├── types/ # TypeScript type definitions
|
||||||
│ ├── src-tauri/ # Tauri desktop app configuration
|
│ │ │ └── utils/ # Utility functions
|
||||||
│ │ ├── src/ # Rust backend code
|
│ │ ├── src-tauri/ # Tauri desktop app configuration
|
||||||
│ │ ├── libs/ # JAR files (generated by build scripts)
|
│ │ │ ├── src/ # Rust backend code
|
||||||
│ │ ├── runtime/ # Bundled JRE (generated by build scripts)
|
│ │ │ ├── libs/ # JAR files (generated by build scripts)
|
||||||
│ │ ├── Cargo.toml # Rust dependencies
|
│ │ │ ├── runtime/ # Bundled JRE (generated by build scripts)
|
||||||
│ │ └── tauri.conf.json # Tauri configuration
|
│ │ │ ├── Cargo.toml # Rust dependencies
|
||||||
│ ├── public/
|
│ │ │ └── tauri.conf.json # Tauri configuration
|
||||||
│ │ └── locales/ # Internationalization files (JSON)
|
│ │ ├── public/
|
||||||
│ ├── package.json # Frontend dependencies
|
│ │ │ └── locales/ # Internationalization files (JSON)
|
||||||
│ └── vite.config.ts # Vite configuration
|
│ │ └── vite.config.ts # Vite configuration
|
||||||
|
│ ├── package.json # Shared workspace dependencies
|
||||||
|
│ └── eslint.config.mjs # Shared lint config
|
||||||
├── customFiles/ # Custom static files and templates (generated at runtime used to replace existing files)
|
├── customFiles/ # Custom static files and templates (generated at runtime used to replace existing files)
|
||||||
├── docs/ # Documentation files
|
├── docs/ # Documentation files
|
||||||
├── exampleYmlFiles/ # Example YAML configuration files
|
├── exampleYmlFiles/ # Example YAML configuration files
|
||||||
@@ -445,7 +447,7 @@ For Stirling 2.0, new features are built as React components:
|
|||||||
|
|
||||||
1. **Create the React Component:**
|
1. **Create the React Component:**
|
||||||
```typescript
|
```typescript
|
||||||
// frontend/src/tools/NewTool.tsx
|
// frontend/editor/src/tools/NewTool.tsx
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { Button, FileInput, Container } from '@mantine/core';
|
import { Button, FileInput, Container } from '@mantine/core';
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ If you're using Tauri's built-in updater feature:
|
|||||||
|
|
||||||
## Configuration Files
|
## Configuration Files
|
||||||
|
|
||||||
### 1. Tauri Configuration (frontend/src-tauri/tauri.conf.json)
|
### 1. Tauri Configuration (frontend/editor/src-tauri/tauri.conf.json)
|
||||||
|
|
||||||
The Windows signing configuration is already set up:
|
The Windows signing configuration is already set up:
|
||||||
|
|
||||||
|
|||||||
@@ -176,6 +176,9 @@ springBoot {
|
|||||||
// Frontend build tasks - only enabled with -PbuildWithFrontend=true
|
// Frontend build tasks - only enabled with -PbuildWithFrontend=true
|
||||||
def buildWithFrontend = project.hasProperty('buildWithFrontend') && project.property('buildWithFrontend') == 'true'
|
def buildWithFrontend = project.hasProperty('buildWithFrontend') && project.property('buildWithFrontend') == 'true'
|
||||||
def buildPrototypes = project.hasProperty('prototypesMode') && project.property('prototypesMode') == 'true'
|
def buildPrototypes = project.hasProperty('prototypesMode') && project.property('prototypesMode') == 'true'
|
||||||
|
// Workspace root holds package.json and node_modules (shared across editor /
|
||||||
|
// future portal). Editor-specific paths (src, public, dist, tauri) live one
|
||||||
|
// level deeper under frontend/editor/.
|
||||||
|
|
||||||
// Vite mode: -PprototypesMode > -PfrontendMode > enableSaas > disableAdditional > proprietary.
|
// Vite mode: -PprototypesMode > -PfrontendMode > enableSaas > disableAdditional > proprietary.
|
||||||
def frontendModeOverride = project.findProperty('frontendMode')?.toString()?.toLowerCase()
|
def frontendModeOverride = project.findProperty('frontendMode')?.toString()?.toLowerCase()
|
||||||
@@ -194,7 +197,8 @@ if (buildPrototypes) {
|
|||||||
def frontendBuildTask = "frontend:build:${frontendMode}"
|
def frontendBuildTask = "frontend:build:${frontendMode}"
|
||||||
|
|
||||||
def frontendDir = file('../../frontend')
|
def frontendDir = file('../../frontend')
|
||||||
def frontendDistDir = file('../../frontend/dist')
|
def frontendEditorDir = file('../../frontend/editor')
|
||||||
|
def frontendDistDir = file('../../frontend/editor/dist')
|
||||||
def resourcesStaticDir = file('src/main/resources/static')
|
def resourcesStaticDir = file('src/main/resources/static')
|
||||||
def generatedFrontendPaths = [
|
def generatedFrontendPaths = [
|
||||||
'assets',
|
'assets',
|
||||||
@@ -262,8 +266,8 @@ tasks.register('npmBuild', Exec) {
|
|||||||
description = 'Build frontend application'
|
description = 'Build frontend application'
|
||||||
workingDir file('../..')
|
workingDir file('../..')
|
||||||
commandLine = ['task', frontendBuildTask]
|
commandLine = ['task', frontendBuildTask]
|
||||||
inputs.dir(new File(frontendDir, 'src'))
|
inputs.dir(new File(frontendEditorDir, 'src'))
|
||||||
inputs.dir(new File(frontendDir, 'public'))
|
inputs.dir(new File(frontendEditorDir, 'public'))
|
||||||
inputs.file(new File(frontendDir, 'package.json'))
|
inputs.file(new File(frontendDir, 'package.json'))
|
||||||
outputs.dir(frontendDistDir)
|
outputs.dir(frontendDistDir)
|
||||||
|
|
||||||
|
|||||||
@@ -86,9 +86,9 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def appVersionStr = project.version.toString()
|
def appVersionStr = project.version.toString()
|
||||||
def tauriConfigPath = layout.projectDirectory.file('frontend/src-tauri/tauri.conf.json').asFile.path
|
def tauriConfigPath = layout.projectDirectory.file('frontend/editor/src-tauri/tauri.conf.json').asFile.path
|
||||||
def sim1Path = layout.projectDirectory.file('frontend/src/core/testing/serverExperienceSimulations.ts').asFile.path
|
def sim1Path = layout.projectDirectory.file('frontend/editor/src/core/testing/serverExperienceSimulations.ts').asFile.path
|
||||||
def sim2Path = layout.projectDirectory.file('frontend/src/proprietary/testing/serverExperienceSimulations.ts').asFile.path
|
def sim2Path = layout.projectDirectory.file('frontend/editor/src/proprietary/testing/serverExperienceSimulations.ts').asFile.path
|
||||||
def aurDesktopPkgbuildPath = layout.projectDirectory.file('.github/aur/stirling-pdf-desktop/PKGBUILD').asFile.path
|
def aurDesktopPkgbuildPath = layout.projectDirectory.file('.github/aur/stirling-pdf-desktop/PKGBUILD').asFile.path
|
||||||
def aurServerPkgbuildPath = layout.projectDirectory.file('.github/aur/stirling-pdf-server-bin/PKGBUILD').asFile.path
|
def aurServerPkgbuildPath = layout.projectDirectory.file('.github/aur/stirling-pdf-server-bin/PKGBUILD').asFile.path
|
||||||
|
|
||||||
|
|||||||
@@ -12,12 +12,12 @@ Fork Stirling-PDF and create a new branch out of `main`.
|
|||||||
|
|
||||||
### Add Language Directory and Translation File
|
### Add Language Directory and Translation File
|
||||||
|
|
||||||
1. Create a new language directory in `frontend/public/locales/`
|
1. Create a new language directory in `frontend/editor/public/locales/`
|
||||||
- Use hyphenated format: `pl-PL` (not underscore)
|
- Use hyphenated format: `pl-PL` (not underscore)
|
||||||
|
|
||||||
2. Copy the reference translation file:
|
2. Copy the reference translation file:
|
||||||
- Source: `frontend/public/locales/en-GB/translation.toml`
|
- Source: `frontend/editor/public/locales/en-GB/translation.toml`
|
||||||
- Destination: `frontend/public/locales/pl-PL/translation.toml`
|
- Destination: `frontend/editor/public/locales/pl-PL/translation.toml`
|
||||||
|
|
||||||
3. Translate all entries in the TOML file
|
3. Translate all entries in the TOML file
|
||||||
- Keep the TOML structure intact
|
- Keep the TOML structure intact
|
||||||
@@ -49,7 +49,7 @@ ignore = [
|
|||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> If you add any new translation tags, they must first be added to the `en-GB/translation.toml` file. This ensures consistency across all language files.
|
> If you add any new translation tags, they must first be added to the `en-GB/translation.toml` file. This ensures consistency across all language files.
|
||||||
|
|
||||||
- New translation tags **must be added** to `frontend/public/locales/en-GB/translation.toml` to maintain a reference for other languages.
|
- New translation tags **must be added** to `frontend/editor/public/locales/en-GB/translation.toml` to maintain a reference for other languages.
|
||||||
- After adding the new tags to `en-GB/translation.toml`, add and translate them in the respective language file (e.g., `pl-PL/translation.toml`).
|
- After adding the new tags to `en-GB/translation.toml`, add and translate them in the respective language file (e.g., `pl-PL/translation.toml`).
|
||||||
- Use the scripts in `scripts/translations/` to validate and manage translations (see `scripts/translations/README.md`)
|
- Use the scripts in `scripts/translations/` to validate and manage translations (see `scripts/translations/README.md`)
|
||||||
|
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ RUN npm ci
|
|||||||
# Copy source code
|
# Copy source code
|
||||||
COPY frontend .
|
COPY frontend .
|
||||||
|
|
||||||
# Build the application
|
# Build the application (vite root is editor/, output lands in editor/dist/)
|
||||||
RUN npx vite build
|
RUN npx vite --root editor build
|
||||||
|
|
||||||
# Production stage
|
# Production stage
|
||||||
FROM nginx:alpine@sha256:b0f7830b6bfaa1258f45d94c240ab668ced1b3651c8a222aefe6683447c7bf55
|
FROM nginx:alpine@sha256:b0f7830b6bfaa1258f45d94c240ab668ced1b3651c8a222aefe6683447c7bf55
|
||||||
|
|
||||||
# Copy built files from build stage
|
# Copy built files from build stage
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
COPY --from=build /app/editor/dist /usr/share/nginx/html
|
||||||
|
|
||||||
# Copy nginx configuration and entrypoint
|
# Copy nginx configuration and entrypoint
|
||||||
COPY docker/frontend/nginx.conf /etc/nginx/nginx.conf
|
COPY docker/frontend/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|||||||
@@ -12,15 +12,23 @@
|
|||||||
/build
|
/build
|
||||||
/dist
|
/dist
|
||||||
|
|
||||||
|
/editor/build
|
||||||
|
/editor/dist
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.env.local
|
.env.local
|
||||||
.env.*.local
|
.env.*.local
|
||||||
|
/editor/.env.local
|
||||||
|
/editor/.env.*.local
|
||||||
|
|
||||||
# Root .gitignore ignores all .env* - whitelist our committed ones here
|
# Root .gitignore ignores all .env* - whitelist our committed ones here
|
||||||
!.env
|
!.env
|
||||||
!.env.desktop
|
!.env.desktop
|
||||||
!.env.saas
|
!.env.saas
|
||||||
|
!/editor/.env
|
||||||
|
!/editor/.env.desktop
|
||||||
|
!/editor/.env.saas
|
||||||
|
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
@@ -30,5 +38,5 @@ playwright-report
|
|||||||
test-results
|
test-results
|
||||||
|
|
||||||
# auto-generated files
|
# auto-generated files
|
||||||
/src/assets/material-symbols-icons.json
|
/editor/src/assets/material-symbols-icons.json
|
||||||
/src/assets/material-symbols-icons.d.ts
|
/editor/src/assets/material-symbols-icons.d.ts
|
||||||
|
|||||||
@@ -1,15 +1,21 @@
|
|||||||
dist/
|
dist/
|
||||||
|
dist-portal/
|
||||||
|
editor/dist/
|
||||||
# Tauri/Cargo build output (binary assets named *.js etc. confuse Prettier)
|
# Tauri/Cargo build output (binary assets named *.js etc. confuse Prettier)
|
||||||
src-tauri/target/
|
editor/src-tauri/target/
|
||||||
|
editor/src-tauri/gen/
|
||||||
node_modules/
|
node_modules/
|
||||||
src-tauri/target/
|
editor/public/vendor/
|
||||||
src-tauri/gen/
|
editor/public/pdfjs*/
|
||||||
public/vendor/
|
editor/public/js/thirdParty/
|
||||||
public/pdfjs*/
|
editor/public/css/cookieconsent.css
|
||||||
public/js/thirdParty/
|
# Build / test artifacts that may exist locally even though they're gitignored
|
||||||
public/css/cookieconsent.css
|
storybook-static/
|
||||||
src-tauri/target/
|
playwright-report/
|
||||||
|
editor/playwright-report/
|
||||||
|
test-results/
|
||||||
|
editor/test-results/
|
||||||
*.min.*
|
*.min.*
|
||||||
*.md
|
*.md
|
||||||
*.wxs
|
*.wxs
|
||||||
src/output.css
|
editor/src/output.css
|
||||||
|
|||||||
@@ -13,9 +13,18 @@ All frontend commands are run from the repository root using [Task](https://task
|
|||||||
|
|
||||||
For desktop app development, see the [Tauri](#tauri) section below.
|
For desktop app development, see the [Tauri](#tauri) section below.
|
||||||
|
|
||||||
|
## Layout
|
||||||
|
|
||||||
|
`frontend/` is a workspace containing one or more apps. Today it holds the
|
||||||
|
PDF editor under `frontend/editor/`; new apps (the developer portal, etc.)
|
||||||
|
will sit alongside it as siblings. Shared tooling — `package.json`, `node_modules`,
|
||||||
|
`.storybook/`, ESLint, Prettier — lives at `frontend/` so every app installs
|
||||||
|
once and lints with the same config.
|
||||||
|
|
||||||
## Environment Variables
|
## Environment Variables
|
||||||
|
|
||||||
Environment variables live in committed `.env` files at the frontend root:
|
The editor's environment variables live in committed `.env` files at
|
||||||
|
`frontend/editor/`:
|
||||||
|
|
||||||
- `.env` — used by all builds (core, proprietary, and as the base for desktop/SaaS)
|
- `.env` — used by all builds (core, proprietary, and as the base for desktop/SaaS)
|
||||||
- `.env.desktop` — additional vars loaded in desktop (Tauri) mode
|
- `.env.desktop` — additional vars loaded in desktop (Tauri) mode
|
||||||
@@ -23,7 +32,7 @@ Environment variables live in committed `.env` files at the frontend root:
|
|||||||
|
|
||||||
These files contain non-secret defaults and are checked into Git, so most dev work needs no further setup.
|
These files contain non-secret defaults and are checked into Git, so most dev work needs no further setup.
|
||||||
|
|
||||||
To override values locally (API keys, machine-specific settings), create an uncommitted sibling `.env.local` / `.env.desktop.local` / `.env.saas.local`. Vite automatically layers these on top of the committed files.
|
To override values locally (API keys, machine-specific settings), create an uncommitted sibling `editor/.env.local` / `editor/.env.desktop.local` / `editor/.env.saas.local`. Vite automatically layers these on top of the committed files.
|
||||||
|
|
||||||
## Docker Setup
|
## Docker Setup
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 717 KiB After Width: | Height: | Size: 717 KiB |
|
Before Width: | Height: | Size: 211 KiB After Width: | Height: | Size: 211 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 229 KiB After Width: | Height: | Size: 229 KiB |
|
Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 426 B |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 406 KiB After Width: | Height: | Size: 406 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 100 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |