Skip to content

IPFS plugin separation of concerns#930

Merged
dOrgJelli merged 30 commits intoprealpha-devfrom
pileks-ipfs-plugin-separation-of-concerns
Jun 27, 2022
Merged

IPFS plugin separation of concerns#930
dOrgJelli merged 30 commits intoprealpha-devfrom
pileks-ipfs-plugin-separation-of-concerns

Conversation

@pileks
Copy link
Copy Markdown
Contributor

@pileks pileks commented Jun 18, 2022

Partially closes #622 and #714 (IPFS part)

After discussion with @nerfZael the following was done:

Introduced an interface for IPFS-like plugins
Extracted uri-resolver interface implementation from IPFS plugin into its own ipfs-uri-resolver-plugin-js plugin
ipfs-plugin-js now contains only basic IPFS-related functions, with the ipfs-uri-resolver-plugin-js depending on the ipfs-plugin-js.

Introduced a new build command for interfaces that follow the @web3api/*-interface pattern and added it to the main build command - same as #912

Possible circular dependency noticed:
Interfaces require CLI to be built, which results in a CLI -> Plugins -> Interfaces -> CLI circular dependency. Advice on how to proceed is very much appreciated.

Remaining work:

  • Add tests for ipfs-uri-resolver-plugin-js
  • Add tests for ipfs-plugin-js <- I noticed these were missing

@dOrgJelli We commented on moving the resolver plugins into a separate folder - I would like to do this once we finish up the separation of concerns work so that we move all 3 resolver plugins as part of a single PR. Hope that's okay.

Advice/feedback would be much appreciated!

@pileks pileks changed the title Pileks ipfs plugin separation of concerns IPFS plugin separation of concerns Jun 19, 2022
@pileks pileks marked this pull request as ready for review June 21, 2022 09:42
@pileks pileks requested a review from cbrzn June 21, 2022 09:42
@pileks pileks self-assigned this Jun 21, 2022
Comment thread packages/core-interfaces/ipfs/package.json Outdated
Comment thread packages/js/plugins/ipfs/package.json
Comment thread packages/core-interfaces/ipfs/.gitignore Outdated
Comment thread packages/core-interfaces/ipfs/polywrap.yaml Outdated
Comment thread packages/js/plugins/uri-resolvers/ipfs-resolver/src/index.ts Outdated
Comment thread packages/js/plugins/uri-resolvers/ipfs-resolver/src/index.ts Outdated
Comment thread packages/js/plugins/ipfs/src/index.ts Outdated
Comment thread packages/js/plugins/uri-resolvers/ipfs-resolver/src/__tests__/e2e.spec.ts Outdated
Comment thread packages/js/plugins/ipfs/src/__tests__/e2e.spec.ts Outdated
@pileks pileks requested a review from nerfZael June 23, 2022 07:31
Comment thread packages/js/client/src/__tests__/core/plugin-wrapper.spec.ts
Copy link
Copy Markdown
Contributor

@cbrzn cbrzn left a comment

Choose a reason for hiding this comment

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

Awesome stuff ser 🔥

Feel free to ignore my code styles suggestions :-D

schema: ./src/schema.graphql
import_redirects:
- uri: "ens/uri-resolver.core.polywrap.eth"
schema: ../../../../core-interfaces/uri-resolver/src/query.graphql
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.

Let's remove the query word and rename the file to schema.graphql

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.

This is referenced in multiple PRs right now - If it's okay with you, I'd do this as part of an end-of-PRs "cleanup PR" which would redo some of the folder structure, and change naming. We should also think about building the interface rather than referencing directly from src - something I've done in the FS MR (#912) and this one for their respective interfaces.

Comment thread packages/js/plugins/uri-resolvers/ipfs-resolver/src/index.ts Outdated
Comment thread packages/js/plugins/uri-resolvers/ipfs-resolver/src/index.ts Outdated
nerfZael
nerfZael previously approved these changes Jun 23, 2022
Comment thread packages/core-interfaces/ipfs/.gitignore Outdated
@dOrgJelli dOrgJelli merged commit d501be0 into prealpha-dev Jun 27, 2022
@dOrgJelli dOrgJelli deleted the pileks-ipfs-plugin-separation-of-concerns branch April 10, 2023 16:53
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