@autobusal/providers 1.3.8 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,41 @@ All notable changes to `@autobusal/providers` are documented here. This project
4
4
  adheres to [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
5
5
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.4.0] - 2026-07-30
8
+
9
+ ### Added
10
+
11
+ - **Cache-busting on language file requests (`Setup/languages.ts`).** A
12
+ production report showed the admin panel still displaying raw i18n keys
13
+ after obtapi's translation JSON was fixed and confirmed correct
14
+ server-side - even after multiple manual hard-reloads. `Cache-Control:
15
+ no-cache` on obtapi's side only asks caches to revalidate before reuse,
16
+ which was not reliable enough against whatever was actually caching
17
+ (browser and/or an intermediate proxy) in the real deployment. The
18
+ `loadPath` now appends `?v={{VITE_BUILD_ID}}`, a fresh value baked in at
19
+ build time by the consuming app's `vite.config.ts` `define` - every
20
+ rebuild produces a URL nothing in the chain has ever cached, independent
21
+ of whether that cache actually honors Cache-Control. Falls back to a
22
+ fixed `'dev'` string if the consumer hasn't defined `VITE_BUILD_ID` yet
23
+ (no worse than before). **Requires consuming apps to add a
24
+ `VITE_BUILD_ID` define to `vite.config.ts`** (done for magus and
25
+ alvavel alongside this release) for the cache-busting to take effect -
26
+ without it, this version behaves identically to 1.3.9.
27
+ - Companion fix in obtapi: `public/.htaccess` strengthened from
28
+ `Cache-Control: no-cache` to `no-store, no-cache, must-revalidate,
29
+ max-age=0` plus `Pragma`/`Expires`, so language JSON is never stored by
30
+ a compliant cache at all, not just revalidated.
31
+
32
+ ## [1.3.9] - 2026-07-30
33
+
34
+ ### Fixed
35
+
36
+ - `Errors/Message.tsx`: the crash/404 page's logo `alt` text was hardcoded to
37
+ `"Home"` in every locale, bypassing the `@lang/errors` translation
38
+ dictionary used for the rest of the page. Now reads `translations.home`.
39
+ Requires consuming apps' `src/lang/errors.ts` to define a `home` key per
40
+ locale (added to magus and alvavel alongside this release).
41
+
7
42
  ## [1.3.8] - 2026-07-29
8
43
 
9
44
  ### Added
@@ -40,7 +40,7 @@ const Message = ({ type }: Props): JSX.Element => {
40
40
  }
41
41
  } }
42
42
  >
43
- <img src={ `${ data.url }/logo-${ theme }.svg` } alt="Home" />
43
+ <img src={ `${ data.url }/logo-${ theme }.svg` } alt={ translations.home } />
44
44
  </Logo>
45
45
 
46
46
  <Description>
@@ -6,6 +6,18 @@ export const getLanguage = (defaultLanguage: string): string => (
6
6
  localStorage.getItem('language') ?? defaultLanguage
7
7
  );
8
8
 
9
+ // Cache-busting query param for the language files. `Cache-Control: no-cache`
10
+ // on the obtapi side only asks caches to revalidate before reuse - in
11
+ // practice that was not enough (some browser/proxy along the way kept
12
+ // serving a stale translation file across manual hard-reloads after a
13
+ // deploy). VITE_BUILD_ID is a fresh value baked in at build time by each
14
+ // consuming app's vite.config.ts (`define`), so every rebuild produces a
15
+ // URL that has never been requested before - nothing anywhere in the chain
16
+ // can have a stale cache entry for it, independent of whether that cache
17
+ // respects Cache-Control at all. Falls back to a fixed string for any
18
+ // consumer that hasn't set VITE_BUILD_ID yet (no worse than before).
19
+ const buildId = import.meta.env.VITE_BUILD_ID ?? 'dev';
20
+
9
21
  const languages = (type: string, defaultLanguage: string): void => {
10
22
  if (i18next.isInitialized) {
11
23
  return;
@@ -22,7 +34,7 @@ const languages = (type: string, defaultLanguage: string): void => {
22
34
  fallbackLng: defaultLanguage,
23
35
  debug: import.meta.env.DEV,
24
36
  backend: {
25
- loadPath: `${ import.meta.env.VITE_API_OBT }/languages/{{lng}}/{{ns}}.json`
37
+ loadPath: `${ import.meta.env.VITE_API_OBT }/languages/{{lng}}/{{ns}}.json?v=${ buildId }`
26
38
  },
27
39
  ns: type
28
40
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/providers",
3
- "version": "1.3.8",
3
+ "version": "1.4.0",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"