This commit updates the TSDoc comments in the following files to French,
as per your request:
- src/lib/legal/dole.ts
- src/lib/legal/legi.ts
- src/lib/legal/jorf.ts
The TSDoc comments were previously in English and have been re-generated
based on the Légifrance XML DTDs/XSDs, with descriptions now in French
to improve code understanding for French-speaking developers.
This commit adds TSDoc comments to the TypeScript interfaces in:
- src/lib/legal/dole.ts
- src/lib/legal/legi.ts
- src/lib/legal/jorf.ts
The TSDoc comments are generated based on the information found in the
Légifrance XML DTDs (and XSDs) provided in the archive
DTD_LEGIFRANCE_20181017.7z.
These comments improve code understanding by explaining the meaning
of each interface and property, mapping them to their corresponding
XML elements and attributes as defined in the DTDs/XSDs.
I've moved git-related helper files from `src/lib/server/gitify/` to `src/lib/server/nodegit/` as `isomorphic-git` has been fully replaced by `nodegit`.
- I moved contexts.ts, generators.ts, references.ts, repositories.ts, and texts_trees.ts.
- I updated all relevant import paths across the codebase to point to the new location under `nodegit`.
- I removed the now-empty `src/lib/server/gitify/` directory.
I've completed the replacement of `isomorphic-git` with `nodegit` in the `src/lib/server/gitify/` directory.
Changes include:
- Updated `src/lib/server/gitify/contexts.ts` to use a plain object for tree entries instead of `isomorphic-git.TreeEntry`.
- Replaced all `isomorphic-git` function calls (`init`, `writeTree`, `writeCommit`, `writeRef`, `branch`) in `src/lib/server/gitify/generators.ts` with their `nodegit` equivalents.
I've replaced all usages of the `isomorphic-git` library with equivalent functionality from `nodegit`.
Changes include:
- Updated `src/lib/server/gitify/repositories.ts` to use `nodegit` for writing blobs.
- Updated `src/scripts/export_consolidated_text_to_git.ts` and `src/scripts/export_consolidated_texts_to_git.ts` to use `nodegit` for fetching the HEAD commit OID.
- Removed `isomorphic-git` from `devDependencies` in `package.json`.
I modified the four import scripts (`import_dole.ts`, `import_jorf.ts`, `import_kali.ts`, `import_legi.ts`) to conditionally update data in the PostgreSQL database.
Previously, these scripts used `INSERT ... ON CONFLICT ... DO UPDATE` for all data, which resulted in database write operations even if the incoming data was identical to the existing data.
The changes implement the following logic for each relevant table/entity within the scripts:
1. The `DO UPDATE SET` clause now uses the `EXCLUDED` keyword to refer to the values proposed for insertion.
2. A `WHERE` clause has been added to the `DO UPDATE SET` statement. This `WHERE` clause uses `IS DISTINCT FROM` to compare the current row's values with the `EXCLUDED` values (i.e., the new data).
3. The `UPDATE` is only performed if one or more of the compared fields are actually different. If the new data is identical to the existing data, the update is skipped.
This optimization significantly reduces unnecessary database write operations, especially when the input data has few or no changes compared to what's already in the database.
Minor corrections were also made to ensure `versionsRemainingElis.delete(eli)` is used consistently with `eli` as the conflict key in `import_jorf.ts` and `import_legi.ts`.