Skip to content

[CB] Bump NPM dependencies#3628

Merged
Wroud merged 13 commits intodevelfrom
5764-cb-bump-npm-dependencies
Aug 7, 2025
Merged

[CB] Bump NPM dependencies#3628
Wroud merged 13 commits intodevelfrom
5764-cb-bump-npm-dependencies

Conversation

@sergeyteleshev
Copy link
Copy Markdown
Contributor

@sergeyteleshev sergeyteleshev commented Aug 4, 2025

Removed zod translation packages, cause zod 4 supports it now - https://zod.dev/error-customization#internationalization.
Also, they added z.stringbool(), so I replaced our solution with theirs - https://zod.dev/v4?id=stringbool

closes https://github.com/dbeaver/pro/issues/5764

@sergeyteleshev sergeyteleshev self-assigned this Aug 4, 2025
@sergeyteleshev sergeyteleshev force-pushed the 5764-cb-bump-npm-dependencies branch from d88a5a5 to 2be2da5 Compare August 4, 2025 19:47
Copy link
Copy Markdown
Contributor

@SychevAndrey SychevAndrey left a comment

Choose a reason for hiding this comment

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

Some changes look unrelated to lib updates and/or change app's logic

}

return this.administrationItemService.canDeActivate(screen, toScreen, this.isConfigurationMode, screen.item !== toScreen?.item);
return await this.administrationItemService.canDeActivate(screen, toScreen, this.isConfigurationMode, screen.item !== toScreen?.item);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why do we need return await here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Cause linter says async function should have await
If I remove async, TypeScript says: "You return Promise", but the function has no async
So this is the compromise where ESLint and TypeScript are fine with the code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As I can see that function returns boolen | Promise<boolean>, not only Promise<boolean>
It's better to fix return type

switch (value) {
case 'DEFAULT':
return 'DEFAULT';
case 'COMBINE':
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i'm not sure why we adding this in update lib ticket

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree. Why did we make these changes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2025-08-05 at 14 26 13

I changed the order of the functions. It should remain the same behavior

availableDrivers: schema.array(schema.string()),
requiredNetworkHandlersIds: schema.array(schema.string()),
connectionId: schema.string().or(schema.undefined()),
connectionId: schema.string().or(schema.null()),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what was the cause of this changes?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same question

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Previously, this code led to this interface:
connectionId: schema.string().or(schema.undefined()) -> {connectionId: string | undefined }

Now it leads to this interface:
connectionId: schema.string().or(schema.undefined()) -> {connectionId?: string }

We need this interface not to be optional according to the code

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Screenshot 2025-08-05 at 9 49 49 PM

connectionId: schema.string().or(schema.null()) -> {connectionId: string | null }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Screenshot 2025-08-05 at 9 52 10 PM

here i've reverted to .or(schema.undefined()) and removed .required()

"@testing-library/jest-dom": "^6",
"@testing-library/react": "^16",
"@types/node": "^22",
"@types/node": "^24",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please keep the ^22 version for node; it's our current minimal supported node version

stringedBoolean() {
return z.union([z.enum(['false', '0']).transform(() => false), z.boolean(), z.string(), z.number()]).pipe(z.coerce.boolean());
},
locales: new Map<string, any>([]),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

locales should be private, you can move it to module scope:

const locales = new Map<string, any>([]);

export const schemaExtra = {

switch (value) {
case 'DEFAULT':
return 'DEFAULT';
case 'COMBINE':
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree. Why did we make these changes?

availableDrivers: schema.array(schema.string()),
requiredNetworkHandlersIds: schema.array(schema.string()),
connectionId: schema.string().or(schema.undefined()),
connectionId: schema.string().or(schema.null()),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same question

availableDrivers: schema.array(schema.string()),
requiredNetworkHandlersIds: schema.array(schema.string()),
connectionId: schema.string().or(schema.undefined()),
connectionId: schema.string().or(schema.null()),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Screenshot 2025-08-05 at 9 49 49 PM

connectionId: schema.string().or(schema.null()) -> {connectionId: string | null }

availableDrivers: schema.array(schema.string()),
requiredNetworkHandlersIds: schema.array(schema.string()),
connectionId: schema.string().or(schema.undefined()),
connectionId: schema.string().or(schema.null()),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Screenshot 2025-08-05 at 9 52 10 PM

here i've reverted to .or(schema.undefined()) and removed .required()

Wroud
Wroud previously approved these changes Aug 5, 2025
SychevAndrey
SychevAndrey previously approved these changes Aug 6, 2025
@Wroud Wroud merged commit 900be41 into devel Aug 7, 2025
9 of 10 checks passed
@Wroud Wroud deleted the 5764-cb-bump-npm-dependencies branch August 7, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants