Skip to content

Commit fa1afd9

Browse files
committed
upgrade @meshery/schemas to v1.0.1 with v1beta1/v1beta2 constructs and cloudApi RTK client
- Update @meshery/schemas from ^0.9.0 to ^1.0.1 in devDependencies and peerDependencies - Fix breaking schema property casing: environmentPayload → EnvironmentPayload, workspacePayload → WorkspacePayload, OrganizationID → organization_id - Re-export cloudApi and mesheryApi RTK Query clients from @meshery/schemas - Re-export cloudBaseApi, mesheryBaseApi, and API constants from @meshery/schemas/api - Re-export new v1beta2 OpenAPI schemas (Component, Connection, Design, Invitation, Relationship) and v1beta1/v1beta2 type namespaces - Update moduleResolution to "bundler" to support @meshery/schemas subpath exports - Fix xstate deep imports (AnyActorSystem) to use public ActorSystem type Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
1 parent f1ab58a commit fa1afd9

File tree

8 files changed

+76
-22
lines changed

8 files changed

+76
-22
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@eslint/compat": "^2.0.3",
4848
"@eslint/eslintrc": "^3.3.5",
4949
"@eslint/js": "^9.0.0",
50-
"@meshery/schemas": "^0.9.0",
50+
"@meshery/schemas": "^1.0.1",
5151
"@mui/icons-material": "^7.3.9",
5252
"@reduxjs/toolkit": "^2.11.2",
5353
"@testing-library/dom": "^10.0.0",
@@ -88,7 +88,7 @@
8888
"xstate": "^5.28.0"
8989
},
9090
"peerDependencies": {
91-
"@meshery/schemas": "^0.8.124",
91+
"@meshery/schemas": "^1.0.1",
9292
"@xstate/react": "^5.0.3",
9393
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
9494
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",

src/actors/utils.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
// disbale stict no any for now for full file
22
/* eslint-disable @typescript-eslint/no-explicit-any */
33

4-
import { AnyActorRef, AnyEventObject, assign, enqueueActions, sendTo } from 'xstate';
5-
import { AnyActorSystem } from 'xstate/dist/declarations/src/system';
4+
import {
5+
ActorSystem,
6+
AnyActorRef,
7+
AnyEventObject,
8+
assign,
9+
enqueueActions,
10+
sendTo
11+
} from 'xstate';
12+
13+
type AnyActorSystem = ActorSystem<any>;
614
import { workerEvents } from './worker/events';
715

816
// Type used for context validation in reply() function

src/actors/worker/fromWorkerfiedActor.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import {
22
ActorLogic,
3+
ActorSystem,
34
AnyEventObject,
45
AnyMachineSnapshot,
56
EventObject,
67
NonReducibleUnknown,
78
StateValue,
89
matchesState
910
} from 'xstate';
10-
import { AnyActorSystem } from 'xstate/dist/declarations/src/system';
11+
12+
type AnyActorSystem = ActorSystem<any>;
1113
import { STATE_SNAPSHOT_EVENT, WORKER_EVENTS, workerCommands } from './events';
1214

1315
const instanceStates = /* #__PURE__ */ new WeakMap();

src/schemas/createAndEditEnvironment/schema.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ const createAndEditEnvironmentSchema = {
77
required: ['name'],
88
properties: {
99
description: {
10-
description: environmentSchema.environmentPayload.properties.description.description,
10+
description: environmentSchema.EnvironmentPayload.properties.description.description,
1111
format: 'textarea',
1212
title: 'Description',
13-
type: environmentSchema.environmentPayload.properties.description.type,
13+
type: environmentSchema.EnvironmentPayload.properties.description.type,
1414
'x-rjsf-grid-area': '12'
1515
},
1616
name: {
17-
description: environmentSchema.environmentPayload.properties.name.description,
17+
description: environmentSchema.EnvironmentPayload.properties.name.description,
1818
title: 'Name',
19-
type: environmentSchema.environmentPayload.properties.name.type,
19+
type: environmentSchema.EnvironmentPayload.properties.name.type,
2020
'x-rjsf-grid-area': '12'
2121
},
2222
organization: {
23-
type: environmentSchema.environmentPayload.properties.OrganizationID.type,
23+
type: environmentSchema.EnvironmentPayload.properties.organization_id.type,
2424
title: 'Organization',
25-
description: environmentSchema.environmentPayload.properties.OrganizationID.description,
25+
description: environmentSchema.EnvironmentPayload.properties.organization_id.description,
2626
enum: [],
2727
enumNames: [],
2828
'x-rjsf-grid-area': '12'

src/schemas/createAndEditWorkspace/schema.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ const workspaceSchema = (WorkspaceDefinitionV1Beta1OpenApiSchema as any).compone
88
const createAndEditWorkspace = {
99
properties: {
1010
description: {
11-
description: workspaceSchema.workspacePayload.properties.description.description,
11+
description: workspaceSchema.WorkspacePayload.properties.description.description,
1212
format: 'textarea',
1313
title: 'Description',
14-
type: workspaceSchema.workspacePayload.properties.description.type,
14+
type: workspaceSchema.WorkspacePayload.properties.description.type,
1515
'x-rjsf-grid-area': '12'
1616
},
1717
name: {
18-
description: workspaceSchema.workspacePayload.properties.name.description,
18+
description: workspaceSchema.WorkspacePayload.properties.name.description,
1919
title: 'Name',
20-
type: workspaceSchema.workspacePayload.properties.name.type,
20+
type: workspaceSchema.WorkspacePayload.properties.name.type,
2121
'x-rjsf-grid-area': '12'
2222
},
2323
organization: {
24-
type: workspaceSchema.workspacePayload.properties.organization_id.type,
25-
description: workspaceSchema.workspacePayload.properties.organization_id.description,
24+
type: workspaceSchema.WorkspacePayload.properties.organization_id.type,
25+
description: workspaceSchema.WorkspacePayload.properties.organization_id.description,
2626
title: 'Organization',
2727
enum: [],
2828
enumNames: [],

src/schemas/index.tsx

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,50 @@ import prometheusCredentialUiSchema from './prometheusCredential/uiSchema';
3131
import grafanaCredentialSchema from './grafanaCredential/schema';
3232
import grafanaCredentialSUiSchema from './grafanaCredential/uiSchema';
3333

34+
// Re-export @meshery/schemas v1beta1 OpenAPI schemas
35+
export {
36+
BadgeSchema,
37+
CategoryDefinitionV1Beta1OpenApiSchema,
38+
ComponentDefinitionV1Beta1OpenApiSchema,
39+
DesignDefinitionV1Beta1OpenApiSchema,
40+
EnvironmentDefinitionV1Beta1OpenApiSchema,
41+
InvitationSchema,
42+
ModelDefinitionV1Beta1OpenApiSchema,
43+
SubCategoryDefinitionV1Beta1OpenApiSchema,
44+
WorkspaceDefinitionV1Beta1OpenApiSchema
45+
} from '@meshery/schemas';
46+
47+
// Re-export @meshery/schemas v1beta2 OpenAPI schemas
48+
export {
49+
ComponentDefinitionV1Beta2OpenApiSchema,
50+
ConnectionDefinitionV1Beta2OpenApiSchema,
51+
DesignDefinitionV1Beta2OpenApiSchema,
52+
InvitationDefinitionV1Beta2OpenApiSchema,
53+
RelationshipDefinitionV1Beta2OpenApiSchema
54+
} from '@meshery/schemas';
55+
56+
// Re-export @meshery/schemas v1alpha3 OpenAPI schemas
57+
export { RelationshipDefinitionV1Alpha3OpenApiSchema } from '@meshery/schemas';
58+
59+
// Re-export @meshery/schemas type namespaces
60+
export type { v1alpha1, v1alpha2, v1beta1, v1beta2 } from '@meshery/schemas';
61+
62+
// Re-export @meshery/schemas RTK Query clients (cloudApi)
63+
export { cloudApi } from '@meshery/schemas/cloudApi';
64+
65+
// Re-export @meshery/schemas RTK Query clients (mesheryApi)
66+
export { mesheryApi } from '@meshery/schemas/mesheryApi';
67+
68+
// Re-export @meshery/schemas API base utilities
69+
export {
70+
cloudBaseApi,
71+
CURRENT_ORG_KEY,
72+
DEFAULT_DESIGN_VERSION,
73+
mesheryBaseApi,
74+
MESHERY_PROD_URL,
75+
SUPPORTED_SOCIAL_ACCOUNTS
76+
} from '@meshery/schemas/api';
77+
3478
export {
3579
createAndEditEnvironmentSchema,
3680
createAndEditEnvironmentUiSchema,

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"declaration": true,
1010
"sourceMap": true,
11-
"moduleResolution": "Node",
11+
"moduleResolution": "bundler",
1212
"ignoreDeprecations": "5.0",
1313
"experimentalDecorators": true,
1414
"skipLibCheck": true,

0 commit comments

Comments
 (0)