Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(studio): declare Big Shoulders Display's bare style imports, and let a raced Studio save carry its revision

Maurice269fce03315e
diff --git a/client/src/vite-env.d.ts b/client/src/vite-env.d.ts
index f77306978..7712e2d3e 100644
--- a/client/src/vite-env.d.ts
+++ b/client/src/vite-env.d.ts
@@ -3,3 +3,13 @@
/** The version this bundle was built as (client/package.json), set by `define` in vite.config.js. */
declare const __TREK_UI_VERSION__: string;
+
+/**
+ * Big Shoulders Display's weights, imported for their stylesheets alone
+ * (components/Studio/bookFontFaces.ts). Its package maps `./*` to `./*.css`
+ * and has no `./*.css` entry, so the import names `100` rather than
+ * `100.css`, and vite/client's `*.css` declaration does not cover a bare
+ * name. Declared for this one package only, so a mistyped import of any
+ * other module still fails the check.
+ */
+declare module '@fontsource/big-shoulders-display/*';
diff --git a/server/tests/unit/nest/journey-book.service.test.ts b/server/tests/unit/nest/journey-book.service.test.ts
index 6bd509cf2..0fa5d3f1d 100644
--- a/server/tests/unit/nest/journey-book.service.test.ts
+++ b/server/tests/unit/nest/journey-book.service.test.ts
@@ -561,9 +561,11 @@ describe('editBook', () => {
const journey = createJourney(testDb, user.id);
await books.saveBook(journey.id, user.id, { title: 'T', document: doc('one') });
+ // The Studio stamps its revision on every save, as the tool's write does, so the race is about the version alone.
+ const fromStudio = { ...doc('studio'), schemaRev: BOOK_SCHEMA_REV };
const [tool, studio] = await Promise.all([
catchDomainError(() => books.editBook(journey.id, user.id, edited('tool'), { expectedVersion: 1 })),
- books.saveBook(journey.id, user.id, { title: 'T', document: doc('studio'), baseVersion: 1 }),
+ books.saveBook(journey.id, user.id, { title: 'T', document: fromStudio, baseVersion: 1 }),
]);
const toolLost = tool instanceof DomainError && tool.getStatus() === 409;