@l10nmonster/server 3.1.1 → 3.1.3

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
@@ -1,3 +1,17 @@
1
+ ## @l10nmonster/server [3.1.3](https://github.com/l10nmonster/l10nmonster/compare/@l10nmonster/server@3.1.2...@l10nmonster/server@3.1.3) (2026-01-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * kitchen sink properly re-export default export for l10nmonster/server ([#55](https://github.com/l10nmonster/l10nmonster/issues/55)) ([a20613d](https://github.com/l10nmonster/l10nmonster/commit/a20613db06d55a076115faa4bfcd2818efad61f5))
7
+
8
+ ## @l10nmonster/server [3.1.2](https://public-github/l10nmonster/l10nmonster/compare/@l10nmonster/server@3.1.1...@l10nmonster/server@3.1.2) (2026-01-03)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **server:** Serve should return a promise ([d688831](https://public-github/l10nmonster/l10nmonster/commit/d68883125b84266af89f6b8b93ee022706bb37e3))
14
+
1
15
  ## @l10nmonster/server [3.1.1](https://public-github/l10nmonster/l10nmonster/compare/@l10nmonster/server@3.1.0...@l10nmonster/server@3.1.1) (2025-12-23)
2
16
 
3
17
 
package/index.js CHANGED
@@ -146,22 +146,27 @@ const ServeAction = {
146
146
  consoleLog``;
147
147
  });
148
148
 
149
- // Handle server binding errors
150
- server.on('error', (error) => {
151
- if (error.code === 'EADDRINUSE') {
152
- const addressStr = host ? `${host}:${port}` : `port ${port}`;
153
- throw new Error(`Failed to bind server: Address ${addressStr} is already in use`);
154
- } else if (error.code === 'EACCES') {
155
- const addressStr = host ? `${host}:${port}` : `port ${port}`;
156
- throw new Error(`Failed to bind server: Permission denied for ${addressStr}`);
157
- } else if (error.code === 'EADDRNOTAVAIL') {
158
- throw new Error(`Failed to bind server: Address ${host} is not available on this system`);
159
- } else {
160
- throw new Error(`Failed to bind server: ${error.message}`);
161
- }
162
- });
149
+ // Return a Promise that only resolves when the server closes
150
+ // This prevents MonsterManager from shutting down the DAL while the server is running
151
+ return new Promise((resolve, reject) => {
152
+ server.on('error', (error) => {
153
+ if (error.code === 'EADDRINUSE') {
154
+ const addressStr = host ? `${host}:${port}` : `port ${port}`;
155
+ reject(new Error(`Failed to bind server: Address ${addressStr} is already in use`));
156
+ } else if (error.code === 'EACCES') {
157
+ const addressStr = host ? `${host}:${port}` : `port ${port}`;
158
+ reject(new Error(`Failed to bind server: Permission denied for ${addressStr}`));
159
+ } else if (error.code === 'EADDRNOTAVAIL') {
160
+ reject(new Error(`Failed to bind server: Address ${host} is not available on this system`));
161
+ } else {
162
+ reject(new Error(`Failed to bind server: ${error.message}`));
163
+ }
164
+ });
163
165
 
164
- return server;
166
+ server.on('close', () => {
167
+ resolve();
168
+ });
169
+ });
165
170
  }
166
171
  };
167
172
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@l10nmonster/server",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "description": "L10n Monster Manager",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/routes/sources.js CHANGED
@@ -5,8 +5,8 @@ export function setupChannelRoutes(router, mm) {
5
5
  const { channelId } = req.params;
6
6
  logInfo`/channel/${channelId}`;
7
7
  try {
8
- const { ts, store } = await mm.rm.getChannelMeta(channelId);
9
- const projects = await mm.rm.getActiveContentStats(channelId);
8
+ const { ts, store } = (await mm.rm.getChannelMeta(channelId)) ?? {};
9
+ const projects = ts ? await mm.rm.getActiveContentStats(channelId) : [];
10
10
  logVerbose`Returned active content stats for ${projects.length} projects`;
11
11
  res.json({ ts, store, projects });
12
12
  } catch (error) {