@platformatic/vite 2.22.0 → 2.24.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.
Files changed (3) hide show
  1. package/index.js +10 -1
  2. package/package.json +8 -8
  3. package/schema.json +1 -1
package/index.js CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  } from '@platformatic/basic'
14
14
  import { ConfigManager } from '@platformatic/config'
15
15
  import { NodeStackable } from '@platformatic/node'
16
+ import { features } from '@platformatic/utils'
16
17
  import fastify from 'fastify'
17
18
  import { existsSync } from 'node:fs'
18
19
  import { readFile, writeFile } from 'node:fs/promises'
@@ -53,6 +54,8 @@ export class ViteStackable extends BaseStackable {
53
54
  } else {
54
55
  await this.#startDevelopment(listen)
55
56
  }
57
+
58
+ this._collectMetrics()
56
59
  }
57
60
 
58
61
  async stop () {
@@ -218,7 +221,13 @@ export class ViteStackable extends BaseStackable {
218
221
 
219
222
  if (this.#app && listen) {
220
223
  const serverOptions = this.serverConfig
221
- await this.#app.listen({ host: serverOptions?.hostname || '127.0.0.1', port: serverOptions?.port || 0 })
224
+ const listenOptions = { host: serverOptions?.hostname || '127.0.0.1', port: serverOptions?.port || 0 }
225
+
226
+ if (this.isProduction && features.node.reusePort) {
227
+ listenOptions.reusePort = true
228
+ }
229
+
230
+ await this.#app.listen(listenOptions)
222
231
  this.url = getServerUrl(this.#app.server)
223
232
  return this.url
224
233
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/vite",
3
- "version": "2.22.0",
3
+ "version": "2.24.0",
4
4
  "description": "Platformatic Vite Stackable",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -18,24 +18,24 @@
18
18
  "@fastify/static": "^8.0.0",
19
19
  "fastify": "^5.0.0",
20
20
  "semver": "^7.6.3",
21
- "@platformatic/basic": "2.22.0",
22
- "@platformatic/node": "2.22.0",
23
- "@platformatic/utils": "2.22.0",
24
- "@platformatic/config": "2.22.0"
21
+ "@platformatic/basic": "2.24.0",
22
+ "@platformatic/config": "2.24.0",
23
+ "@platformatic/node": "2.24.0",
24
+ "@platformatic/utils": "2.24.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@fastify/vite": "^7.0.1",
28
28
  "borp": "^0.19.0",
29
29
  "eslint": "9",
30
30
  "json-schema-to-typescript": "^15.0.1",
31
- "neostandard": "^0.11.1",
31
+ "neostandard": "^0.12.0",
32
32
  "react": "^18.3.1",
33
33
  "react-dom": "^18.3.1",
34
34
  "typescript": "^5.5.4",
35
35
  "vite": "^5.4.0",
36
36
  "ws": "^8.18.0",
37
- "@platformatic/service": "2.22.0",
38
- "@platformatic/composer": "2.22.0"
37
+ "@platformatic/composer": "2.24.0",
38
+ "@platformatic/service": "2.24.0"
39
39
  },
40
40
  "scripts": {
41
41
  "test": "npm run lint && borp --concurrency=1 --no-timeout",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/vite/2.22.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/vite/2.24.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Vite Stackable",
5
5
  "type": "object",