Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(shared, dal, application-generic, api, web, dashboard): Remove json-schema-to-ts dependency and use JsonSchemaDto everywhere #6921

Merged
merged 7 commits into from
Nov 11, 2024

Conversation

rifont
Copy link
Collaborator

@rifont rifont commented Nov 11, 2024

What changed? Why was the change needed?

  • Remove json-schema-to-ts dependency and use @novu/shared's JsonSchemaDto everywhere

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

type?: JSONSchemaTypeName | JSONSchemaTypeName[] | undefined;
enum?: JSONSchemaType[] | undefined;
const?: JSONSchemaType | undefined;
export type JSONSchemaDto = Readonly<{
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are for compatibility with json-schema-to-ts's declaration of Json Schema 7 typings.

@rifont rifont changed the title refactor(shared, dal, api, web, dashboard): Remove json-schema-to-ts dependency and use JsonSchemaDto everywhere refactor(shared, dal, application-generic, api, web, dashboard): Remove json-schema-to-ts dependency and use JsonSchemaDto everywhere Nov 11, 2024
Copy link

pkg-pr-new bot commented Nov 11, 2024

Open in Stackblitz

@novu/client

pnpm add https://pkg.pr.new/novuhq/novu/@novu/client@6921

@novu/framework

pnpm add https://pkg.pr.new/novuhq/novu/@novu/framework@6921

@novu/js

pnpm add https://pkg.pr.new/novuhq/novu/@novu/js@6921

@novu/headless

pnpm add https://pkg.pr.new/novuhq/novu/@novu/headless@6921

@novu/nest

pnpm add https://pkg.pr.new/novuhq/novu/@novu/nest@6921

@novu/nextjs

pnpm add https://pkg.pr.new/novuhq/novu/@novu/nextjs@6921

@novu/node

pnpm add https://pkg.pr.new/novuhq/novu/@novu/node@6921

@novu/notification-center

pnpm add https://pkg.pr.new/novuhq/novu/@novu/notification-center@6921

novu

pnpm add https://pkg.pr.new/novuhq/novu@6921

@novu/providers

pnpm add https://pkg.pr.new/novuhq/novu/@novu/providers@6921

@novu/react

pnpm add https://pkg.pr.new/novuhq/novu/@novu/react@6921

@novu/react-native

pnpm add https://pkg.pr.new/novuhq/novu/@novu/react-native@6921

@novu/shared

pnpm add https://pkg.pr.new/novuhq/novu/@novu/shared@6921

@novu/stateless

pnpm add https://pkg.pr.new/novuhq/novu/@novu/stateless@6921

commit: 5ce1f4f

Copy link

netlify bot commented Nov 11, 2024

Deploy Preview for novu-stg-vite-dashboard-poc ready!

Name Link
🔨 Latest commit 5ce1f4f
🔍 Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/67320e881613400008fb39eb
😎 Deploy Preview https://deploy-preview-6921--novu-stg-vite-dashboard-poc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -1,7 +1,7 @@
import type { JSONSchema, FromSchema as JsonSchemaInfer } from 'json-schema-to-ts';
import zod from 'zod';

export type JsonSchema = JSONSchema;
export type JsonSchema = Exclude<JSONSchema, boolean>;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSON schema used in Framework is a root-level JSON schema, which can't be a boolean. For completeness, the boolean value in the library package is present to allow for additionalProperties: JSONSchema | boolean, which is a valid JSON schema polymorphism.

Comment on lines -41 to -43
"@types/bluebird": "^3.5.24",
"@types/jest": "29.5.2",
"json-schema-to-ts": "^3.0.0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹

Copy link
Contributor

@SokratisVidros SokratisVidros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹

@rifont rifont merged commit 8a3d7c1 into next Nov 11, 2024
40 checks passed
@rifont rifont deleted the jsonschema-dto-everywhere branch November 11, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants