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

Examples repo/infra setup #29

Closed
achingbrain opened this issue Jan 31, 2023 · 4 comments
Closed

Examples repo/infra setup #29

achingbrain opened this issue Jan 31, 2023 · 4 comments
Milestone

Comments

@achingbrain
Copy link
Member

js-ipfs has a comprehensive example suite at https://github.com/ipfs-examples/js-ipfs-examples - it would be amazing for helia to have something similar.

The example suite is a monorepo with all examples in the examples directory. Each example is a self-contained module that showcases one feature of js-ipfs or how to integrate it with a build tool, and they all contain tests to prevent regressions.

Each example is copied into it's own repo in the ipfs-examples org by the fork & go github action to aid discoverability yet make the maintenance of these examples manageable.

Syncing changes

Changes to the monorepo are pulled into the split-out repos, any changes that have been made to the split-out repos are discarded. This is done by a sync job copied from the fork & go template.

An improvement for helia would be to switch this around and have the monorepo push changes out to the split-out repos, the reason being the sync job runs on a timer and GitHub disables the timer if no changes are observed for a month or so, which means a maintainer has to manually go through and re-enable the timer for every split-out repo periodically - see ipfs-examples/js-ipfs-examples#44

Where to start

Create a repo in the ipfs-examples org called helia-examples.

Start with just one example, perhaps bundling with esbuild (easy since aegir already builds helia with esbuild for browser tests so there shouldn't be any extra config required) - port the example, the docs and the tests.

The sync job should be run from the helia-examples repo instead of from the split-out repos.

Prequisites

After #17 is merged helia should be installable with npm i helia@next. An automated PR will also be created that sets up a gated release of v1 of helia - when that is merged dependabot should take care of upgrading all the example deps.

@tinytb tinytb added this to the v1 milestone Feb 3, 2023
achingbrain added a commit to ipfs-examples/example-fork-go-template that referenced this issue Feb 3, 2023
The timer that pull updates run on expires every month or so.

Instead switch to using push updates from the master repo.

Refs ipfs/helia#29
achingbrain added a commit to ipfs-examples/example-fork-go-template that referenced this issue Feb 3, 2023
The timer that pull updates run on expires every month or so.

Instead switch to using push updates from the master repo.

Also default to Helia and not js-ipfs.

Refs ipfs/helia#29
@achingbrain
Copy link
Member Author

achingbrain commented Feb 3, 2023

This is taking shape over at https://github.com/ipfs-examples/helia-examples

So far there are examples for:

  • helia-101
  • bundling with webpack
  • Use from CJS modules 🆕

There are instructions on how to add new examples in the readme.

It's set up to push any changes from the monorepo to the individual example repos, they just need to be create from the example template and given the same name as their folder under examples in the helia-examples monorepo.

There are plenty of other js-ipfs examples that need porting:

  • Frontend frameworks (create-react-app, vue, angular)
  • Bundlers/frameworks (esbuild, nextjs, lit, vite)
  • Functionality (transfer files, pubsub, ipns, dht, etc)

These can largely be ported from the existing js-ipfs examples.

@BigLep
Copy link
Contributor

BigLep commented Feb 20, 2023

@achingbrain : this is great. I would like to make it clearer that this is an issue where someone can pick off examples to learn the ball forward and move us forward.

Thoughts on how to achieve this:

  1. Maybe we close this issue? We could rename this isuee to "Setup examples template/infra". It seems like we have that.
  • The one area I'm wondering about is testing. Is there a way to automatically have Helia run against all tests unless someone explicitly opts out? (I want to minimize the effort for getting tests to run.).
  • Lets also make sure helia-examples reports on the test coverage and the test results with a badge.
  1. Have a specific checklist of open issues to port. That way folks can see how many are done and how many remain. Ideally put these in priority order. That should either be at the top of this issue (or in the new issue)

@BigLep BigLep changed the title Examples Examples repo/infra setup Mar 8, 2023
@BigLep
Copy link
Contributor

BigLep commented Mar 8, 2023

@achingbrain : please list what's remaining for closing this issue out.

For tracking the porting of examples over, I created #43

@achingbrain
Copy link
Member Author

Nothing I think, #43 covers it.

achingbrain added a commit that referenced this issue Jan 8, 2024
Bumps [aegir](https://github.com/ipfs/aegir) from 39.0.13 to 40.0.11.
- [Release notes](https://github.com/ipfs/aegir/releases)
- [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md)
- [Commits](ipfs/aegir@v39.0.13...v40.0.11)

---
updated-dependencies:
- dependency-name: aegir
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: achingbrain <alex@achingbrain.net>
achingbrain pushed a commit that referenced this issue Jan 8, 2024
## @helia/dag-cbor-v1.0.0 (2023-08-27)

### Features

* initial commit ([ed4c319](ipfs/helia-dag-cbor@ed4c319))

### Dependencies

* **dev:** bump aegir from 39.0.13 to 40.0.11 ([#29](ipfs/helia-dag-cbor#29)) ([973bb5b](ipfs/helia-dag-cbor@973bb5b))
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

No branches or pull requests

3 participants