@platformatic/react-router 3.46.0 → 3.48.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
@@ -7,6 +7,7 @@
7
7
 
8
8
  export interface PlatformaticReactRouterConfig {
9
9
  $schema?: string;
10
+ module?: string;
10
11
  logger?: {
11
12
  level?: (
12
13
  | ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent")
package/index.d.ts ADDED
@@ -0,0 +1,37 @@
1
+ import { BaseCapability, BaseContext, BaseOptions } from '@platformatic/basic'
2
+ import { Configuration, ConfigurationOptions } from '@platformatic/foundation'
3
+ import { JSONSchemaType } from 'ajv'
4
+ import type { PlatformaticReactRouterConfig } from './config.d.ts'
5
+
6
+ export type { PlatformaticReactRouterConfig } from './config.d.ts'
7
+
8
+ export interface ReactRouterContext extends BaseContext {}
9
+
10
+ export type ReactRouterConfiguration = Configuration<PlatformaticReactRouterConfig>
11
+
12
+ export declare function transform (config: ReactRouterConfiguration): Promise<ReactRouterConfiguration>
13
+
14
+ export declare function loadConfiguration (
15
+ root: string | PlatformaticReactRouterConfig,
16
+ source?: string | PlatformaticReactRouterConfig,
17
+ context?: ConfigurationOptions
18
+ ): Promise<ReactRouterConfiguration>
19
+
20
+ export declare function create (
21
+ configOrRoot: string | PlatformaticReactRouterConfig,
22
+ sourceOrConfig?: string | PlatformaticReactRouterConfig,
23
+ context?: ConfigurationOptions
24
+ ): Promise<ReactRouterCapability>
25
+
26
+ export declare class ReactRouterCapability extends BaseCapability<
27
+ PlatformaticReactRouterConfig,
28
+ BaseOptions<ReactRouterContext>
29
+ > {
30
+ constructor (root: string, config: PlatformaticReactRouterConfig, context?: object)
31
+ }
32
+
33
+ export declare const packageJson: Record<string, unknown>
34
+ export declare const schema: JSONSchemaType<PlatformaticReactRouterConfig>
35
+ export declare const schemaComponents: { reactRouter: JSONSchemaType<object> }
36
+ export declare const version: string
37
+ export declare const supportedVersions: string
package/lib/capability.js CHANGED
@@ -18,7 +18,7 @@ import { createRequestHandler } from 'react-router'
18
18
  import { satisfies } from 'semver'
19
19
  import { packageJson } from './schema.js'
20
20
 
21
- const supportedVersions = '^7.0.0'
21
+ export const supportedVersions = '^7.0.0'
22
22
 
23
23
  export class ReactRouterCapability extends ViteCapability {
24
24
  #app
@@ -219,7 +219,9 @@ export class ReactRouterCapability extends ViteCapability {
219
219
  let ended = false
220
220
 
221
221
  req.raw.on('aborted', () => ac.abort())
222
- req.raw.on('end', () => { ended = true })
222
+ req.raw.on('end', () => {
223
+ ended = true
224
+ })
223
225
  req.raw.on('close', () => {
224
226
  if (!ended) {
225
227
  ac.abort()
package/lib/schema.js CHANGED
@@ -30,6 +30,9 @@ export const schema = {
30
30
  $schema: {
31
31
  type: 'string'
32
32
  },
33
+ module: {
34
+ type: 'string'
35
+ },
33
36
  logger: utilsSchemaComponents.logger,
34
37
  server: utilsSchemaComponents.server,
35
38
  watch: basicSchemaComponents.watch,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/react-router",
3
- "version": "3.46.0",
3
+ "version": "3.48.0",
4
4
  "description": "Platformatic React Router 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.7.0",
20
20
  "semver": "^7.6.3",
21
- "@platformatic/basic": "3.46.0",
22
- "@platformatic/foundation": "3.46.0",
23
- "@platformatic/vite": "3.46.0"
21
+ "@platformatic/foundation": "3.48.0",
22
+ "@platformatic/vite": "3.48.0",
23
+ "@platformatic/basic": "3.48.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@react-router/dev": "^7.10.0",
@@ -32,6 +32,7 @@
32
32
  "fastify": "^5.7.0",
33
33
  "isbot": "^5.1.17",
34
34
  "json-schema-to-typescript": "^15.0.1",
35
+ "tstyche": "^6.2.0",
35
36
  "neostandard": "^0.12.0",
36
37
  "react": "^19.1.0",
37
38
  "react-dom": "^19.1.0",
@@ -40,14 +41,15 @@
40
41
  "typescript": "^5.5.4",
41
42
  "vite": "^7.1.7",
42
43
  "ws": "^8.18.0",
43
- "@platformatic/gateway": "3.46.0",
44
- "@platformatic/service": "3.46.0"
44
+ "@platformatic/gateway": "3.48.0",
45
+ "@platformatic/service": "3.48.0"
45
46
  },
46
47
  "engines": {
47
48
  "node": ">=22.19.0"
48
49
  },
49
50
  "scripts": {
50
- "test": "node --test --test-reporter=cleaner-spec-reporter --test-concurrency=1 --test-timeout=2000000 test/*.test.js test/**/*.test.js",
51
+ "test": "npm run test:types && node --test --test-reporter=cleaner-spec-reporter --test-concurrency=1 --test-timeout=2000000 test/*.test.js test/**/*.test.js",
52
+ "test:types": "tstyche",
51
53
  "gen-schema": "node lib/schema.js > schema.json",
52
54
  "gen-types": "json2ts > config.d.ts < schema.json",
53
55
  "build": "npm run gen-schema && npm run gen-types",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/react-router/3.46.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/react-router/3.48.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic React Router Config",
5
5
  "type": "object",
@@ -7,6 +7,9 @@
7
7
  "$schema": {
8
8
  "type": "string"
9
9
  },
10
+ "module": {
11
+ "type": "string"
12
+ },
10
13
  "logger": {
11
14
  "type": "object",
12
15
  "properties": {