From 7d3d60f2ba4520ea4200fb9b12ca64f253a137b0 Mon Sep 17 00:00:00 2001 From: Eric Mc Sween <5454374+emcsween@users.noreply.github.com> Date: Fri, 28 Aug 2026 08:21:17 -0400 Subject: [PATCH] Merge pull request #36920 from overleaf/em-shared-frontend-backend Move shared bibtex model classes to services/web/shared GitOrigin-RevId: ef768d4f7bcf7b9c4b41844450b0256ecb46fdae --- services/web/frontend/js/features/bibtex/bibtex-parser.ts | 4 ++-- .../js/features/bibtex/{citation-key.mts => citation-key.ts} | 2 +- .../frontend/js/features/bibtex/positioned-bibtex-entry.ts | 2 +- .../js/features => shared}/bibtex/bibtex-entry-schema.mts | 0 .../{frontend/js/features => shared}/bibtex/bibtex-entry.mts | 0 .../js/features => shared}/bibtex/bibtex-field-value.mts | 0 .../{frontend/js/features => shared}/bibtex/bibtex-name.mts | 0 .../{frontend/js/features => shared}/bibtex/bibtex-purify.mts | 0 .../{frontend/js/features => shared}/bibtex/entry-types.mts | 0 .../js/features => shared}/bibtex/latex-to-unicode.mts | 0 services/web/test/frontend/bootstrap.js | 1 + services/web/tsconfig.backend.json | 1 + services/web/tsconfig.json | 2 ++ 13 files changed, 8 insertions(+), 4 deletions(-) rename services/web/frontend/js/features/bibtex/{citation-key.mts => citation-key.ts} (97%) rename services/web/{frontend/js/features => shared}/bibtex/bibtex-entry-schema.mts (100%) rename services/web/{frontend/js/features => shared}/bibtex/bibtex-entry.mts (100%) rename services/web/{frontend/js/features => shared}/bibtex/bibtex-field-value.mts (100%) rename services/web/{frontend/js/features => shared}/bibtex/bibtex-name.mts (100%) rename services/web/{frontend/js/features => shared}/bibtex/bibtex-purify.mts (100%) rename services/web/{frontend/js/features => shared}/bibtex/entry-types.mts (100%) rename services/web/{frontend/js/features => shared}/bibtex/latex-to-unicode.mts (100%) diff --git a/services/web/frontend/js/features/bibtex/bibtex-parser.ts b/services/web/frontend/js/features/bibtex/bibtex-parser.ts index 93b4aa3a62..f4235c9e99 100644 --- a/services/web/frontend/js/features/bibtex/bibtex-parser.ts +++ b/services/web/frontend/js/features/bibtex/bibtex-parser.ts @@ -11,9 +11,9 @@ import { StringName, } from '@/features/source-editor/lezer-bibtex/bibtex.terms.mjs' import { parser as lezerParser } from '@/features/source-editor/lezer-bibtex/bibtex.mjs' -import { BibtexEntry } from './bibtex-entry.mts' +import { BibtexEntry } from '@shared/bibtex/bibtex-entry.mts' import { PositionedBibtexEntry } from './positioned-bibtex-entry' -import { BibtexFieldValue } from './bibtex-field-value.mts' +import { BibtexFieldValue } from '@shared/bibtex/bibtex-field-value.mts' type GetText = (from: number, to: number) => string diff --git a/services/web/frontend/js/features/bibtex/citation-key.mts b/services/web/frontend/js/features/bibtex/citation-key.ts similarity index 97% rename from services/web/frontend/js/features/bibtex/citation-key.mts rename to services/web/frontend/js/features/bibtex/citation-key.ts index f13128f7d0..7aca7a8738 100644 --- a/services/web/frontend/js/features/bibtex/citation-key.mts +++ b/services/web/frontend/js/features/bibtex/citation-key.ts @@ -1,4 +1,4 @@ -import { BibtexNameList } from './bibtex-name.mts' +import { BibtexNameList } from '@shared/bibtex/bibtex-name.mts' const YEAR_REGEX = /^\d{4}$/ diff --git a/services/web/frontend/js/features/bibtex/positioned-bibtex-entry.ts b/services/web/frontend/js/features/bibtex/positioned-bibtex-entry.ts index 56343a3be6..cdbf0c2717 100644 --- a/services/web/frontend/js/features/bibtex/positioned-bibtex-entry.ts +++ b/services/web/frontend/js/features/bibtex/positioned-bibtex-entry.ts @@ -1,5 +1,5 @@ import { ProjectionItem } from '@/features/source-editor/utils/tree-operations/projection' -import { BibtexEntry } from './bibtex-entry.mts' +import { BibtexEntry } from '@shared/bibtex/bibtex-entry.mts' /** * A BibtexEntry placed in a CodeMirror document. The `entry` reference is diff --git a/services/web/frontend/js/features/bibtex/bibtex-entry-schema.mts b/services/web/shared/bibtex/bibtex-entry-schema.mts similarity index 100% rename from services/web/frontend/js/features/bibtex/bibtex-entry-schema.mts rename to services/web/shared/bibtex/bibtex-entry-schema.mts diff --git a/services/web/frontend/js/features/bibtex/bibtex-entry.mts b/services/web/shared/bibtex/bibtex-entry.mts similarity index 100% rename from services/web/frontend/js/features/bibtex/bibtex-entry.mts rename to services/web/shared/bibtex/bibtex-entry.mts diff --git a/services/web/frontend/js/features/bibtex/bibtex-field-value.mts b/services/web/shared/bibtex/bibtex-field-value.mts similarity index 100% rename from services/web/frontend/js/features/bibtex/bibtex-field-value.mts rename to services/web/shared/bibtex/bibtex-field-value.mts diff --git a/services/web/frontend/js/features/bibtex/bibtex-name.mts b/services/web/shared/bibtex/bibtex-name.mts similarity index 100% rename from services/web/frontend/js/features/bibtex/bibtex-name.mts rename to services/web/shared/bibtex/bibtex-name.mts diff --git a/services/web/frontend/js/features/bibtex/bibtex-purify.mts b/services/web/shared/bibtex/bibtex-purify.mts similarity index 100% rename from services/web/frontend/js/features/bibtex/bibtex-purify.mts rename to services/web/shared/bibtex/bibtex-purify.mts diff --git a/services/web/frontend/js/features/bibtex/entry-types.mts b/services/web/shared/bibtex/entry-types.mts similarity index 100% rename from services/web/frontend/js/features/bibtex/entry-types.mts rename to services/web/shared/bibtex/entry-types.mts diff --git a/services/web/frontend/js/features/bibtex/latex-to-unicode.mts b/services/web/shared/bibtex/latex-to-unicode.mts similarity index 100% rename from services/web/frontend/js/features/bibtex/latex-to-unicode.mts rename to services/web/shared/bibtex/latex-to-unicode.mts diff --git a/services/web/test/frontend/bootstrap.js b/services/web/test/frontend/bootstrap.js index b2abdb8767..19ac311aef 100644 --- a/services/web/test/frontend/bootstrap.js +++ b/services/web/test/frontend/bootstrap.js @@ -7,6 +7,7 @@ require('@babel/register')({ { alias: { '^@/(.+)': './frontend/js/\\1', + '^@shared/(.+)': './shared/\\1', '^@modules/(.+)': './modules/\\1', }, }, diff --git a/services/web/tsconfig.backend.json b/services/web/tsconfig.backend.json index 2207ee3d38..1334c98103 100644 --- a/services/web/tsconfig.backend.json +++ b/services/web/tsconfig.backend.json @@ -10,6 +10,7 @@ "modules/*/test/acceptance/**/*", "modules/*/test/unit/**/*", "scripts/**/*", + "shared/**/*", "test/acceptance/**/*", "test/unit/**/*", "types/backend/**/*" diff --git a/services/web/tsconfig.json b/services/web/tsconfig.json index 9c552a397a..c84ea8395a 100644 --- a/services/web/tsconfig.json +++ b/services/web/tsconfig.json @@ -18,6 +18,7 @@ "baseUrl": ".", "paths": { "@/*": ["./frontend/js/*"], + "@shared/*": ["./shared/*"], "@modules/*": ["./modules/*"], "@overleaf/o-error": ["../../libraries/o-error"], "@overleaf/ranges-tracker": ["../../libraries/ranges-tracker"], @@ -41,6 +42,7 @@ }, "include": [ "frontend/js/**/*.*", + "shared/**/*.*", "modules/**/frontend/js/**/*.*", "modules/*/shared/**/*.*", "test/frontend/**/*.*",