logto-io / js

🤓 Logto JS SDKs.
https://docs.logto.io/quick-starts/
MIT License
68 stars 40 forks source link

fix: remove import from dev dependency #776

Closed vstremnitzer closed 3 months ago

vstremnitzer commented 3 months ago

Summary

DevDependency not available in angular app

DevDependency import from vitest introduced in PR https://github.com/logto-io/js/pull/760

This causes build problems in angular app as test runner is still jest

Testing

Executed all unit tests

Checklist

charIeszhao commented 3 months ago

Sorry I don't quite get the connection between your PR description and file changes.

How does the type change Nullable -> Optional solve your dev dependency issue?

vstremnitzer commented 3 months ago

Hi @charIeszhao native optional instead of Nullable seemed to bring the same value to the object for me. To me it seemed adding Nullable was a mistake here as it is not used in a testclass. Sorry if I am wrong.

To the dependency problem.

import { type Nullable } from 'vitest';

vitest is configured as devdependency in logtojs.

Vitest is not available in node_modules in default angular app as Jest runner is the default there.

https://github.com/angular/angular-cli/issues/25217

KR

charIeszhao commented 3 months ago

@vstremnitzer I just pushed a new update as it seems to be caused by a wrong import source of the type Nullable. So instead of changing it to Optional, we import it from @silverhand/essentials, which is included in the dependencies.

Can you please verify if this update works for you. Seems everything is working properly on my side.