@platformatic/next 3.65.0 → 3.67.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
@@ -137,6 +137,7 @@ export interface PlatformaticNextJsConfig {
137
137
  options?: {
138
138
  [k: string]: unknown;
139
139
  };
140
+ build?: boolean;
140
141
  }
141
142
  | (
142
143
  | string
@@ -145,6 +146,7 @@ export interface PlatformaticNextJsConfig {
145
146
  options?: {
146
147
  [k: string]: unknown;
147
148
  };
149
+ build?: boolean;
148
150
  }
149
151
  )[];
150
152
  basePath?: string;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { kMetadata } from '@platformatic/foundation'
2
- import { getBasePath, getConfig, getLogger, getNextVersion, getNotifyConfig } from '@platformatic/globals'
2
+ import { getBasePath, getConfig, getLogger, getNextVersion, getNotifyConfig, isBuilding } from '@platformatic/globals'
3
3
  import { resolve as resolvePath } from 'node:path'
4
4
  import { getCacheHandlerPath, NextCapability } from './lib/capability.js'
5
5
  import { loadConfiguration } from './lib/config.js'
@@ -82,6 +82,11 @@ export async function enhanceNextConfig (nextConfig, ...args) {
82
82
  modifications.push(['trailingSlash', 'enabled'])
83
83
  }
84
84
 
85
+ if (typeof nextConfig.deploymentId === 'undefined' && process.env.PLT_DEPLOYMENT_ID && isBuilding({ throwOnMissing: false }) === true) {
86
+ nextConfig.deploymentId = process.env.PLT_DEPLOYMENT_ID
87
+ modifications.push(['deploymentId', 'PLT_DEPLOYMENT_ID'])
88
+ }
89
+
85
90
  if (modifications.length > 0) {
86
91
  nextConfig.env ??= {}
87
92
  nextConfig.env.PLT_NEXT_MODIFICATIONS = JSON.stringify(Object.fromEntries(modifications))
@@ -52,7 +52,12 @@ export function ensureRedis () {
52
52
 
53
53
  export function ensureMsgpackr () {
54
54
  if (!msgpackr) {
55
- msgpackr = require('msgpackr')
55
+ const { Packr } = require('msgpackr')
56
+ // A fresh Packr instance (unlike msgpackr's default pack/unpack singleton, which hardcodes
57
+ // useRecords: false) uses the record extension for plain objects, which keeps them
58
+ // distinguishable on the wire from Map instances, preserving Map identity round-trip.
59
+ // moreTypes additionally preserves Set/RegExp/Error, should they ever appear in cache data.
60
+ msgpackr = new Packr({ moreTypes: true })
56
61
  }
57
62
  }
58
63
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/next",
3
- "version": "3.65.0",
3
+ "version": "3.67.0",
4
4
  "description": "Platformatic Next.js Capability",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -25,9 +25,9 @@
25
25
  "light-my-request": "^6.0.0",
26
26
  "msgpackr": "^1.11.2",
27
27
  "semver": "^7.6.3",
28
- "@platformatic/basic": "3.65.0",
29
- "@platformatic/foundation": "3.65.0",
30
- "@platformatic/globals": "3.65.0"
28
+ "@platformatic/basic": "3.67.0",
29
+ "@platformatic/globals": "3.67.0",
30
+ "@platformatic/foundation": "3.67.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@fastify/reply-from": "^12.0.0",
@@ -42,10 +42,10 @@
42
42
  "json-schema-to-typescript": "^15.0.1",
43
43
  "neostandard": "^0.12.0",
44
44
  "next": "^16.1.0",
45
- "typescript": "^5.9.3",
45
+ "typescript": "~6.0.3",
46
46
  "ws": "^8.18.0",
47
- "@platformatic/gateway": "3.65.0",
48
- "@platformatic/service": "3.65.0"
47
+ "@platformatic/gateway": "3.67.0",
48
+ "@platformatic/service": "3.67.0"
49
49
  },
50
50
  "engines": {
51
51
  "node": ">=22.19.0"
@@ -60,6 +60,7 @@
60
60
  "gen-schema": "node lib/schema.js > schema.json",
61
61
  "gen-types": "json2ts > config.d.ts < schema.json",
62
62
  "build": "npm run gen-schema && npm run gen-types",
63
- "lint": "eslint"
63
+ "lint": "eslint",
64
+ "lint:fix": "eslint --fix"
64
65
  }
65
66
  }
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/next/3.65.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/next/3.67.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Next.js Config",
5
5
  "type": "object",
@@ -447,6 +447,10 @@
447
447
  "options": {
448
448
  "type": "object",
449
449
  "additionalProperties": true
450
+ },
451
+ "build": {
452
+ "type": "boolean",
453
+ "default": false
450
454
  }
451
455
  }
452
456
  },
@@ -472,6 +476,10 @@
472
476
  "options": {
473
477
  "type": "object",
474
478
  "additionalProperties": true
479
+ },
480
+ "build": {
481
+ "type": "boolean",
482
+ "default": false
475
483
  }
476
484
  }
477
485
  }