@logux/server 0.16.0 → 0.16.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.
@@ -846,10 +846,6 @@ export class BaseServer {
846
846
  meta = { ...meta, ...diff }
847
847
  }
848
848
 
849
- if (this.isUseless(action, meta)) {
850
- this.emitter.emit('report', 'useless', { action, meta })
851
- }
852
-
853
849
  await this.sendAction(action, meta)
854
850
  this.runProcessor(action, meta, processor, start)
855
851
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logux/server",
3
- "version": "0.16.0",
3
+ "version": "0.16.2",
4
4
  "description": "Build own Logux server",
5
5
  "keywords": [
6
6
  "collaborative",
@@ -24,10 +24,10 @@
24
24
  "./package.json": "./package.json"
25
25
  },
26
26
  "dependencies": {
27
- "@logux/actions": "^0.7.2",
28
- "@logux/core": "^0.11.6",
27
+ "@logux/actions": "^0.7.3",
28
+ "@logux/core": "^0.11.7",
29
29
  "cookie": "^2.0.1",
30
- "fastq": "^1.20.1",
30
+ "fastq": "^1.20.3",
31
31
  "nanoevents": "^10.0.0",
32
32
  "nanoid": "^6.0.1",
33
33
  "ws": "^8.21.3"
@@ -5,16 +5,11 @@ import type {
5
5
  Criteria,
6
6
  LogPage,
7
7
  LogStore,
8
- Meta
8
+ Meta,
9
+ GetOptions,
10
+ LastSynced
9
11
  } from '@logux/core'
10
12
 
11
- /**
12
- * Logux declares these two, but does not export them, so they are taken
13
- * from the methods not to repeat the definition here.
14
- */
15
- type GetOptions = NonNullable<Parameters<LogStore['get']>[0]>
16
- type LastSynced = Awaited<ReturnType<LogStore['getLastSynced']>>
17
-
18
13
  /**
19
14
  * Rows of the query. `pg` and PGlite keep them in the result object,
20
15
  * `postgres` returns them as an array.
@@ -107,9 +102,7 @@ export interface PostgresStoreOptions<Packers = Record<string, never>> {
107
102
  */
108
103
  export class PostgresStore<
109
104
  Packers extends ActionPackerMap<Packers> = Record<string, never>
110
- >
111
- implements LogStore
112
- {
105
+ > implements LogStore {
113
106
  constructor(
114
107
  db: PostgresDriver | PostgresQuery,
115
108
  opts?: PostgresStoreOptions<Packers>
package/server/index.js CHANGED
@@ -87,9 +87,20 @@ export class Server extends BaseServer {
87
87
  process.exit(0)
88
88
  }
89
89
  process.on('SIGINT', onExit)
90
+ // Docker, Kubernetes and PaaS stop the process with SIGTERM.
91
+ process.on('SIGTERM', onExit)
92
+
93
+ // Ctrl+C to `pnpm run --parallel` go only to group.
94
+ if (this.env === 'development') {
95
+ process.stdin.on('end', onExit)
96
+ process.stdin.resume()
97
+ }
90
98
 
91
99
  this.unbind.push(() => {
92
100
  process.removeListener('SIGINT', onExit)
101
+ process.removeListener('SIGTERM', onExit)
102
+ process.stdin.removeListener('end', onExit)
103
+ process.stdin.pause()
93
104
  })
94
105
  }
95
106
 
package/vite.config.ts CHANGED
@@ -4,15 +4,15 @@ export default defineConfig({
4
4
  test: {
5
5
  coverage: {
6
6
  exclude: [
7
- 'node_modules',
7
+ '**/node_modules/**',
8
8
  'server/index.js',
9
- 'test/*',
9
+ 'test/**',
10
10
  '**/*.d.ts',
11
11
  '**/*.test.ts',
12
- '*/errors.ts',
13
- '*/types.ts',
12
+ '**/errors.ts',
13
+ '**/types.ts',
14
14
  '*.config.*',
15
- 'human-formatter'
15
+ 'human-formatter/**'
16
16
  ],
17
17
  provider: 'v8',
18
18
  thresholds: {
@@ -20,6 +20,6 @@ export default defineConfig({
20
20
  }
21
21
  },
22
22
  environment: 'node',
23
- exclude: ['node_modules', 'test/servers']
23
+ exclude: ['**/node_modules/**', 'test/servers/**']
24
24
  }
25
25
  })