-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: Enable docs and types in cozy-pouch-link using Typedoc and TSC #1500
Merged
Ldoppea
merged 42 commits into
feat/meta_offline
from
feat/enable_type_generation_pouch
Jul 26, 2024
Merged
feat: Enable docs and types in cozy-pouch-link using Typedoc and TSC #1500
Ldoppea
merged 42 commits into
feat/meta_offline
from
feat/enable_type_generation_pouch
Jul 26, 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
Via OCR, the value comes from a text field, and it can have values like "fra," "bob," "aa," etc. These changes prevent any bad UI/UX behavior.
To use the enabled option, the definition is passed in the form of a general function. I've adapted the typing to this practice. This allows me to display the warning also for definition passed with a function
Add tax_certificate qualification for initial requirement in Mes Papiers
The resetQuery method can be used to reset a query in the cache to its initial state based on its id. The query will refetch after. This can be useful after a mutation without response. Because you know that some of the data in a query is no longer fresh, you can choose to update them before fetchPolicy expires.
When cozy-client receives a request, it re-evaluates the other requests in memory to ensure that they are up to date with the added or updated documents. However, this re-evaluation did not work for requests retrieving the contents of a Nextcloud folder. Unlike `io.cozy.files` which has a `dir_id`, we use the folder path to retrieve its contents. File paths include their names, which stops a direct match with the query selector based on the path to the parent folder. For example, the file path `/folder1/file1.txt` would not directly match a query looking for all files in `/folder1`. To resolve this problem, this commit adds a `parentPath` property to files, corresponding to the path of their parent folder. This attribute allows the path comparison to correctly identify files located in the same parent folder, even if their names vary. So, after moving files, we can query the contents of the destination folder. Files that have been moved are automatically removed from the query in the source folder, ensuring consistency in the interface and the data displayed.
This change allow to manage logic around moves from Cozy, Nextcloud and between them. BREAKING CHANGE : You should pass object directly not only props Before: `move(client, "fileId1234", { folderId: "folderId1234" }, true)` After: ``` move( client, { _id: "fileId1234", _type: "io.cozy.files" }, { _id: "folderId1234", _type: "io.cozy.files", type: "directory" }, { force: true } ) ```
Added `createArchiveLinkByIds` method and depreciated `getArchiveLinkByIds` method. The name is more accurate and it allows us to refine the selection by giving the pages we want for each file.
The partialFilter values are static. As this does not change, we decided to integrate them into the index naming. Before this change, the index was not recalculated when a value changed. So the query always returned the same result.
When CouchDB creates an index with a partialFilter, it adds explicit operators when they are implicit, typically the $and and $eq operators. This causes a mismatch when comparing the partialFilter from the request definition with the partialFilter from the index. To address this, we added a step to make the operators in the partialFilter from the request definition explicit. This makes it possible to migrate indexes after they have been renamed rather than re-creating them, which has a non-negligible cost.
When calling `yarn types` all cozy-client's types are generated inside of the `cozy-client/types` folder However, there is no mechanism to remove types when their corresponding class is deleted To fix this, we want to clean the types folder before regenerating types so we ensure no fantom type would persist
paultranvan
approved these changes
Jul 17, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Ldoppea
force-pushed
the
feat/enable_type_generation_pouch
branch
from
July 17, 2024 06:55
a8ce717
to
0c3b7f3
Compare
We will start to use PouchLink in cozy-flagship-app (that uses typescript) and so we want to enable typing for this project This commit adds types generation using TSC and fixes all TSC errors
With current implementation the documentation would be generated using `jsdoc2md` This package generates doc for both public and private classes Also it does not handle correctly typescript notations (i.e. imports) Like for `cozy-client` we now want to generate `cozy-pouch-link` documentation using Typedoc
When calling `yarn docs` all API documentation is generated inside of the `docs/api` folder However, there is no mechanism to remove documentations when their corresponding code is deleted To fix this, we want to clean the `docs/api` folder before regenerating documentation so we ensure no fantom doc would persist
Ldoppea
force-pushed
the
feat/enable_type_generation_pouch
branch
from
July 17, 2024 07:22
3642a16
to
f5d019b
Compare
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.
We will start to use PouchLink in cozy-flagship-app (that uses typescript) and so we want to enable typing for this project