@platformatic/next 2.30.1 → 2.31.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
@@ -93,6 +93,9 @@ export interface PlatformaticNextJsStackable {
93
93
  production?: string;
94
94
  };
95
95
  };
96
+ next?: {
97
+ trailingSlash?: boolean;
98
+ };
96
99
  cache?: {
97
100
  adapter: "redis" | "valkey";
98
101
  url: string;
package/lib/loader.js CHANGED
@@ -56,6 +56,8 @@ function createEvaluatorWrapperFunction (original) {
56
56
  ? fileURLToPath(new URL(`./caching/${config.cache.adapter}.js`, import.meta.url)).replaceAll(sep, '/')
57
57
  : undefined
58
58
 
59
+ const trailingSlash = config?.next?.trailingSlash
60
+
59
61
  return functionDeclaration(
60
62
  null,
61
63
  [restElement(identifier('args'))],
@@ -76,6 +78,13 @@ function createEvaluatorWrapperFunction (original) {
76
78
  }
77
79
  `)
78
80
  : undefined,
81
+ trailingSlash
82
+ ? parseSingleExpression(`
83
+ if (typeof ${originalId}.trailingSlash === 'undefined') {
84
+ ${originalId}.trailingSlash = true
85
+ }
86
+ `)
87
+ : undefined,
79
88
  parseSingleExpression(`globalThis[Symbol.for('plt.children.itc')]?.notify('config', ${originalId})`),
80
89
  parseSingleExpression(`process.emit('plt:next:config', ${originalId})`),
81
90
  returnStatement(identifier(originalId))
package/lib/schema.js CHANGED
@@ -34,6 +34,18 @@ export const cache = {
34
34
  additionalProperties: false
35
35
  }
36
36
 
37
+ const next = {
38
+ type: 'object',
39
+ properties: {
40
+ trailingSlash: {
41
+ type: 'boolean',
42
+ default: false
43
+ }
44
+ },
45
+ default: {},
46
+ additionalProperties: false
47
+ }
48
+
37
49
  export const schema = {
38
50
  $id: `https://schemas.platformatic.dev/@platformatic/next/${packageJson.version}.json`,
39
51
  $schema: 'http://json-schema.org/draft-07/schema#',
@@ -47,6 +59,7 @@ export const schema = {
47
59
  server: utilsSchemaComponents.server,
48
60
  watch: schemaComponents.watch,
49
61
  application: schemaComponents.application,
62
+ next,
50
63
  cache
51
64
  },
52
65
  additionalProperties: false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/next",
3
- "version": "2.30.1",
3
+ "version": "2.31.0",
4
4
  "description": "Platformatic Next.js Stackable",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -23,9 +23,9 @@
23
23
  "iovalkey": "^0.2.1",
24
24
  "msgpackr": "^1.11.2",
25
25
  "semver": "^7.6.3",
26
- "@platformatic/basic": "2.30.1",
27
- "@platformatic/config": "2.30.1",
28
- "@platformatic/utils": "2.30.1"
26
+ "@platformatic/basic": "2.31.0",
27
+ "@platformatic/config": "2.31.0",
28
+ "@platformatic/utils": "2.31.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@fastify/reply-from": "^11.0.0",
@@ -41,8 +41,8 @@
41
41
  "react-dom": "^18.3.1",
42
42
  "typescript": "^5.5.4",
43
43
  "ws": "^8.18.0",
44
- "@platformatic/service": "2.30.1",
45
- "@platformatic/composer": "2.30.1"
44
+ "@platformatic/composer": "2.31.0",
45
+ "@platformatic/service": "2.31.0"
46
46
  },
47
47
  "scripts": {
48
48
  "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/next/2.30.1.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/next/2.31.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Next.js Stackable",
5
5
  "type": "object",
@@ -297,6 +297,17 @@
297
297
  "additionalProperties": false,
298
298
  "default": {}
299
299
  },
300
+ "next": {
301
+ "type": "object",
302
+ "properties": {
303
+ "trailingSlash": {
304
+ "type": "boolean",
305
+ "default": false
306
+ }
307
+ },
308
+ "default": {},
309
+ "additionalProperties": false
310
+ },
300
311
  "cache": {
301
312
  "type": "object",
302
313
  "properties": {