@platformatic/vite 3.14.0 → 3.15.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/config.d.ts CHANGED
@@ -214,6 +214,7 @@ export interface PlatformaticViteConfig {
214
214
  rejectUnauthorized?: boolean;
215
215
  };
216
216
  };
217
+ reuseTcpPorts?: boolean;
217
218
  startTimeout?: number;
218
219
  restartOnError?: boolean | number;
219
220
  exitOnUnhandledErrors?: boolean;
package/lib/capability.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  importFile,
10
10
  resolvePackage
11
11
  } from '@platformatic/basic'
12
- import { ensureLoggableError, features } from '@platformatic/foundation'
12
+ import { ensureLoggableError } from '@platformatic/foundation'
13
13
  import { NodeCapability } from '@platformatic/node'
14
14
  import fastify from 'fastify'
15
15
  import { existsSync } from 'node:fs'
@@ -54,6 +54,8 @@ export class ViteCapability extends BaseCapability {
54
54
  }
55
55
 
56
56
  async start ({ listen }) {
57
+ await super._start({ listen })
58
+
57
59
  // Make this idempotent
58
60
  if (this.url) {
59
61
  return this.url
@@ -236,10 +238,6 @@ export class ViteCapability extends BaseCapability {
236
238
  const serverOptions = this.serverConfig
237
239
  const listenOptions = { host: serverOptions?.hostname || '127.0.0.1', port: serverOptions?.port || 0 }
238
240
 
239
- if (this.isProduction && features.node.reusePort) {
240
- listenOptions.reusePort = true
241
- }
242
-
243
241
  await this.#app.listen(listenOptions)
244
242
  this.url = getServerUrl(this.#app.server)
245
243
  return this.url
@@ -302,6 +300,8 @@ export class ViteSSRCapability extends NodeCapability {
302
300
  return this.url
303
301
  }
304
302
 
303
+ await super._start({ listen })
304
+
305
305
  const config = this.config
306
306
  const command = config.application.commands[this.isProduction ? 'production' : 'development']
307
307
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/vite",
3
- "version": "3.14.0",
3
+ "version": "3.15.0",
4
4
  "description": "Platformatic Vite Capability",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -18,9 +18,9 @@
18
18
  "@fastify/static": "^8.0.0",
19
19
  "fastify": "^5.0.0",
20
20
  "semver": "^7.6.3",
21
- "@platformatic/basic": "3.14.0",
22
- "@platformatic/foundation": "3.14.0",
23
- "@platformatic/node": "3.14.0"
21
+ "@platformatic/basic": "3.15.0",
22
+ "@platformatic/foundation": "3.15.0",
23
+ "@platformatic/node": "3.15.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "cleaner-spec-reporter": "^0.5.0",
@@ -32,8 +32,8 @@
32
32
  "typescript": "^5.5.4",
33
33
  "vite": "^7.1.4",
34
34
  "ws": "^8.18.0",
35
- "@platformatic/gateway": "3.14.0",
36
- "@platformatic/service": "3.14.0"
35
+ "@platformatic/gateway": "3.15.0",
36
+ "@platformatic/service": "3.15.0"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=22.19.0"
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/vite/3.14.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/vite/3.15.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Vite Config",
5
5
  "type": "object",
@@ -426,6 +426,10 @@
426
426
  "useHttp": {
427
427
  "type": "boolean"
428
428
  },
429
+ "reuseTcpPorts": {
430
+ "type": "boolean",
431
+ "default": true
432
+ },
429
433
  "workers": {
430
434
  "anyOf": [
431
435
  {
@@ -992,6 +996,10 @@
992
996
  },
993
997
  "additionalProperties": false
994
998
  },
999
+ "reuseTcpPorts": {
1000
+ "type": "boolean",
1001
+ "default": true
1002
+ },
995
1003
  "startTimeout": {
996
1004
  "default": 30000,
997
1005
  "type": "number",