fimo-vite 2.10.4 → 2.11.0-staging.2
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/dist/plugins/translations.js +11 -0
- package/package.json +6 -6
|
@@ -201,6 +201,14 @@ export default function translationsPlugin() {
|
|
|
201
201
|
devServer = server;
|
|
202
202
|
closed = false;
|
|
203
203
|
server.watcher.add([resolveFimoConfigPath(rootDir), join(rootDir, '.env'), join(rootDir, '.env.local')]);
|
|
204
|
+
// A page that loaded the old labels before listening for updates missed
|
|
205
|
+
// the broadcast, so it asks for the current labels once it listens.
|
|
206
|
+
server.ws.on('fimo:labels-sync', (data, client) => {
|
|
207
|
+
const payload = labelUpdatePayload(bundle);
|
|
208
|
+
if (!hasSignature(data, payload.signature)) {
|
|
209
|
+
client.send('fimo:labels-updated', payload);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
204
212
|
void refreshLabels(true).catch(() => undefined);
|
|
205
213
|
startFallbackPolling();
|
|
206
214
|
void connectEvents();
|
|
@@ -419,6 +427,9 @@ function labelUpdatePayload(bundle) {
|
|
|
419
427
|
signature: labelSignature(bundle),
|
|
420
428
|
};
|
|
421
429
|
}
|
|
430
|
+
function hasSignature(data, signature) {
|
|
431
|
+
return typeof data === 'object' && data !== null && 'signature' in data && data.signature === signature;
|
|
432
|
+
}
|
|
422
433
|
/**
|
|
423
434
|
* Reads every configured locale dictionary from the tenant API.
|
|
424
435
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fimo-vite",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0-staging.2",
|
|
4
4
|
"description": "Framework-neutral Fimo Vite plugin. Pairs with the fimo package at the same version.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/",
|
|
@@ -27,20 +27,20 @@
|
|
|
27
27
|
"test:watch": "vitest"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@rollup/pluginutils": "^5.1
|
|
30
|
+
"@rollup/pluginutils": "^5.5.1",
|
|
31
31
|
"oxc-parser": "^0.118.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@fimo/tsconfig": "2.
|
|
34
|
+
"@fimo/tsconfig": "2.11.0-staging.2",
|
|
35
35
|
"@types/node": "22.18.6",
|
|
36
|
-
"fimo": "2.
|
|
36
|
+
"fimo": "2.11.0-staging.2",
|
|
37
37
|
"typescript": "7.0.2",
|
|
38
38
|
"vite": "8.3.5",
|
|
39
|
-
"vite7": "npm:vite@^7.
|
|
39
|
+
"vite7": "npm:vite@^7.3.7",
|
|
40
40
|
"vitest": "5.0.5"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"fimo": "
|
|
43
|
+
"fimo": "2.11.0-staging.2",
|
|
44
44
|
"vite": "^7.0.0 || ^8.0.0"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|