refactor(js): extract import/export module from app.js monofile (§3.1)
Third slice of the app.js split. Moves the encrypted export container, CSV/JSON import parsing (parseCSV, findColumn, parseEntriesFromCSV, parseEntriesFromJSON), and the doImport/doExport/doExportCSV flows to js/app.import.js. encryptImportEntry moves here too (also called by app.sync.js — resolved via shared global scope at call time). - Byte-for-byte identical to the extracted block; no duplicate const; no top-level import ref left in app.js. - Load order: BEFORE app.js (pure declarations, no top-level side effects), alongside app.crypto.js. Full order: argon2 → crypto → import → app → sync. - index.html + BuildAssets whitelist + harness APP_PARTS updated. - Safety net: the 14 CSV tests exercise parseCSV/parseEntriesFromCSV from the extracted file and stay green (42/42). app.js: 11936 → 10253 lines (crypto + sync + import now separate, ~1700 lines moved into 3 modules). NOTE: assets.res not regenerated here (needs brcc32/Delphi) — run BuildAssets before the next Delphi build to embed js/app.import.js. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+5
-1
@@ -228,8 +228,12 @@ réécriture des call-sites, risque quasi nul vs conversion en modules ES).
|
||||
identique, 42 tests verts, pas de `const` dupliqué. Chargé AVANT app.js.
|
||||
- ✅ `js/app.sync.js` extrait (WebDAV, snapshot, merge `applyRemoteSnapshot`)
|
||||
— byte-for-byte identique, couvert par les tests merge, chargé APRÈS app.js
|
||||
(effet de bord top-level `Bridge.onWebdavResult`). Pattern + règles d'ordre
|
||||
(effet de bord top-level `Bridge.onWebdavResult`).
|
||||
- ✅ `js/app.import.js` extrait (export container + parsing CSV/JSON +
|
||||
`doImport`/`doExport`) — byte-for-byte identique, couvert par les 14 tests
|
||||
CSV, chargé AVANT app.js (pures déclarations). Pattern + règles d'ordre
|
||||
documentés dans CLAUDE.md « Découpage frontend ».
|
||||
- `app.js` : 11 936 → **10 253 lignes** (crypto + sync + import sortis).
|
||||
- Reste à extraire (grosses sections cohésives) : slideover, settings,
|
||||
quicksearch, autofill, auto-backup…
|
||||
- ✅ `node --check` en pré-étape de `BuildAssets.ps1` : **déjà fait** (cf. §3.2).
|
||||
|
||||
Reference in New Issue
Block a user