-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix!: cleanup and re-organize npm library #389
Merged
beawar
merged 29 commits into
devel
from
SHELL-157-cleanup-and-reorganize-types-api-extractor
Apr 15, 2024
Merged
fix!: cleanup and re-organize npm library #389
beawar
merged 29 commits into
devel
from
SHELL-157-cleanup-and-reorganize-types-api-extractor
Apr 15, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Refs: SHELL-157
Refs: SHELL-157
Refs: SHELL-157
…rary Refs: SHELL-157
style: update imports refactor: remove unused code Refs: SHELL-157
Refs: SHELL-157
Replace enums with consts Add missing exports Deprecate consts that are not part of shell Refs: SHELL-157
Refs: SHELL-157
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…ings Refs: SHELL-157
Refs: SHELL-157
Refs: SHELL-157
Refs: SHELL-157
Analysis Details4 IssuesCoverage and DuplicationsProject ID: carbonio-shell-ui |
Refs: SHELL-157
…d-reorganize-types-api-extractor
Analysis Details4 IssuesCoverage and DuplicationsProject ID: carbonio-shell-ui |
1 similar comment
Analysis Details4 IssuesCoverage and DuplicationsProject ID: carbonio-shell-ui |
CataldoMazzilli
previously approved these changes
Apr 12, 2024
nubsthead
previously approved these changes
Apr 15, 2024
…d-reorganize-types-api-extractor
beawar
requested review from
nubsthead,
CataldoMazzilli and
a team
and removed request for
AliceTincani and
MatteoPerdon
April 15, 2024 12:35
Analysis Details4 IssuesCoverage and DuplicationsProject ID: carbonio-shell-ui |
CataldoMazzilli
approved these changes
Apr 15, 2024
nubsthead
approved these changes
Apr 15, 2024
Analysis Details4 IssuesCoverage and DuplicationsProject ID: carbonio-shell-ui |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal of this PR is to align the types of the npm package with the objects injected at runtime.
To do so, all the runtime objects are exported in a specific entry point for the library (
src/lib.ts
) and the declarations of the types are created by typescript itself, removing the need to keeping them updated manually.The match between the library objects and the runtime ones is double checked by making the runtime injection satisfies the type of the library itself. In this way, a compilation error will occur if there is a difference between the two.
This is a first step to remove the need of mocking the shell entirely when testing the modules. There are still some open points which are preventing this:
Breaking changes
Even if most of the changes represents a refactor, and should be compatible with the previous version, there are some points that will break projects.
AppSetters type is no longer exported
Replace it with the construct
typeof <function>
types folder is no longer in the library
If you have some import from subpath of the shell module, remove it and use the root import only. E.g.
Declarations of inexisting code are removed
Inside manually created types, there were some declarations of some objects, fields or functions which did not exist in the source code. These declarations are now no longer there. Their usage will now cause a compilation error, preventing unwanted bugs on runtime.
Refactor JSNS enum to an object and improve network types
Soap types have been a little improved, and the type of the _jsns field has been further restricted to always match the Namespace type. Since generic strings can no longer be assigned to this field, the object JSNS, which was previously wrongly exported as an enum inside declarations, is now available as an object and can be used to value the field.
Other changes
BREAKING-CHANGE: Replace entirely the declarations of the library. See #389 for the list of changes.
Refs: SHELL-157