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

feat: Add cozy-dataproxy lib #2603

Merged
merged 14 commits into from
Nov 6, 2024
Merged

feat: Add cozy-dataproxy lib #2603

merged 14 commits into from
Nov 6, 2024

Conversation

Ldoppea
Copy link
Member

@Ldoppea Ldoppea commented Nov 4, 2024

This PR adds a new library for handling Dataproxy features that need to be shared between cozy-web-data-proxy and cozy-flagship-app

For now it exposes the SearchEngine that is responsible to index a local PouchDB and to do searches on it


TODO:

@Ldoppea Ldoppea force-pushed the feat/dataproxy_lib branch 2 times, most recently from f7853a1 to 5d2145e Compare November 5, 2024 14:03
Copy link
Contributor

@paultranvan paultranvan left a comment

Choose a reason for hiding this comment

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

We first need to merge cozy/cozy-client#1553 and upgrade cozy-client, but it looks good! 👏

packages/cozy-dataproxy/tsconfig.json Outdated Show resolved Hide resolved
@Ldoppea Ldoppea force-pushed the feat/dataproxy_lib branch from 5d2145e to d673d74 Compare November 5, 2024 16:24
Ldoppea added a commit to cozy/cozy-web-data-proxy that referenced this pull request Nov 5, 2024
In cozy/cozy-libs#2603 we introduced a new cozy-dataproxy library where
the SearchEngine has been moved

This commit is responsible to remove all Search related code from this
project and instead call the new cozy-dataproxy library's API

Related PR: cozy/cozy-libs#2603
@Ldoppea Ldoppea marked this pull request as ready for review November 5, 2024 18:37
@Ldoppea Ldoppea requested a review from acezard as a code owner November 5, 2024 18:37
Ldoppea added a commit to cozy/cozy-home that referenced this pull request Nov 5, 2024
In cozy/cozy-libs#2603 we renamed some of the API's attributes for
better readability

This commit adapt to those changes and handle retrocompatibility until
the change is deployed in cozy-web-data-proxy

Related PR: cozy/cozy-libs#2603
Related PR: cozy/cozy-web-data-proxy#10
This library is meant to be used by DataProxy apps like
[cozy-web-data-proxy](https://github.com/cozy/cozy-web-data-proxy) or
[cozy-flagship-app](https://github.com/cozy/cozy-flagship-app)

Its goal is to mutualize data manipulation features like Search
indexing
This commit is just a RAW copy of the SearchEngine code from
cozy/cozy-web-data-proxy project

Copied from
cozy/cozy-web-data-proxy@d68e340
This configuration did produce typing errors when overriding
cozy-client's types using a local d.ts file

With it, `@typescript-eslint` would not understand cozy-client's module
augmentation and see many untyped methods when using cozy-client's
methods
@Ldoppea Ldoppea force-pushed the feat/dataproxy_lib branch 2 times, most recently from 8c88bbe to d434275 Compare November 6, 2024 15:16
We want to upgrade Typescript environment in order to support latest
features needed for the cozy-dataproxy code. This code has been copied
from the cozy-web-data-proxy project that is based on TS `5.5.2`

Instead of adapting the code for the older TS `4.9.5` we prefer to
upgrade TS to `5.5.2`

`@typescript-eslint` plugins have been upgraded to `6.21.0` but we may
want to upgrade them to `7+` later as it is the version we use in
cozy-web-data-proxy, but for now `6.21.0` is enough with only a few
breaking changes (see changes in `eslint-config-cozy-app/react.js`)
We did not find how to supports paths aliases in a workspace so let's
use relative paths
For now test coverage is blocking the first release, so we want to
remove it until we find time to improve coverage
Previous naming was confusing so we want to improve it

Renaming should be done also on cozy-home project that already use the
API's old naming (currently in internal beta so we don't need to worry
too much about retro-compatibility)
`cozy-pouch-link` has been upgraded to `50.3.1` in order to retrieve
`startReplicationWithDebounce()` method implementation

`cozy-client` has been upgraded to `50.3.1` in order to retrieve some
typing fixes

Related PR: cozy/cozy-client#1553
Related PR: cozy/cozy-client#1556
@Ldoppea Ldoppea force-pushed the feat/dataproxy_lib branch from d434275 to 1e0b7e5 Compare November 6, 2024 16:27
@Ldoppea Ldoppea merged commit 67f5241 into master Nov 6, 2024
2 checks passed
@Ldoppea Ldoppea deleted the feat/dataproxy_lib branch November 6, 2024 16:36
Ldoppea added a commit to cozy/cozy-home that referenced this pull request Nov 6, 2024
In cozy/cozy-libs#2603 we renamed some of the API's attributes for
better readability

This commit adapt to those changes and handle retrocompatibility until
the change is deployed in cozy-web-data-proxy

Related PR: cozy/cozy-libs#2603
Related PR: cozy/cozy-web-data-proxy#10
Ldoppea added a commit to cozy/cozy-web-data-proxy that referenced this pull request Nov 6, 2024
In cozy/cozy-libs#2603 we introduced a new cozy-dataproxy library where
the SearchEngine has been moved

This commit is responsible to install the new library, the code
migration will be done in the following commit

Related PR: cozy/cozy-libs#2603
Ldoppea added a commit to cozy/cozy-web-data-proxy that referenced this pull request Nov 6, 2024
In cozy/cozy-libs#2603 we introduced a new cozy-dataproxy library where
the SearchEngine has been moved

This commit is responsible to remove all Search related code from this
project and instead call the new cozy-dataproxy library's API

Related PR: cozy/cozy-libs#2603
Ldoppea added a commit to cozy/cozy-web-data-proxy that referenced this pull request Nov 6, 2024
In cozy/cozy-libs#2603 we introduced a new cozy-dataproxy library where
the SearchEngine has been moved

This commit is responsible to remove all Search related code from this
project and instead call the new cozy-dataproxy library's API

Related PR: cozy/cozy-libs#2603
Ldoppea added a commit to cozy/cozy-web-data-proxy that referenced this pull request Nov 6, 2024
In cozy/cozy-libs#2603 we introduced a new cozy-dataproxy library where
the SearchEngine has been moved

This commit is responsible to install the new library, the code
migration will be done in the following commit

Related PR: cozy/cozy-libs#2603
Ldoppea added a commit to cozy/cozy-web-data-proxy that referenced this pull request Nov 6, 2024
In cozy/cozy-libs#2603 we introduced a new cozy-dataproxy library where
the SearchEngine has been moved

This commit is responsible to remove all Search related code from this
project and instead call the new cozy-dataproxy library's API

Related PR: cozy/cozy-libs#2603
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.

2 participants