Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the IPFS Examples Project (
https://github.com/libp2p/js-libp2p-examples
) - Create your Feature Branch (
git checkout -b feature/amazing-feature
) - Commit your Changes (
git commit -a -m 'feat: add some amazing feature'
) - Push to the Branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Decide on a pithy folder name for your example, it should start with
js-libp2p-example-
and ideally be one or two words that describe what it's about - e.g.js-libp2p-example-transfer-files
- Create a folder in this repo under
examples
, eg../examples/js-libp2p-example-transfer-files
- Add the files and tests that make up the example
- Add the folder name to the
project-list
lists in theexamples
andpush-changes
jobs in this repositories./github/ci.yml
- Create a PR to https://github.com/libp2p/github-mgmt similar to libp2p/github-mgmt#22 to facilitate the addition of your project as an isolated repo.
- Live inside the
/examples/
folder - Have tests and should make use of
test-ipfs-example
library - Implement the following scripts:
clean
: used to clean all the unnecessary code (e.g.: files generated by bundlers and package managers)build
: used to build the examplestart
: used to start the exampletest
: used to test the example- The
README.md
must have (see example insideexample-template
):- Link to
Codesandbox.com
for one-click running demonstration - References for documentation/tutorials used to build the example
- Optional: Screenshots, gifs, etc... under
img/
folder
- Link to
- Update the CI to run the tests of the new example as standalone
- Edit
github/workflows/ci.yml
- Add the test name to
project
undermatrix
- Edit
Open a PR to the libp2p/js-libp2p project that edits the .github/workflows/examples.yml
in order to make sure a libp2p release does not break your new example.
Search .github/workflows/test.yml
for the test-examples
section and add a block at the end of the example
matrix key similar to:
- name: my super fun new example
repo: https://github.com/libp2p/js-libp2p-my-super-fun-new-example.git
deps: libp2p@$PWD/packages/libp2p/dist
The value of the deps
key will vary depending on which modules from Helia your example uses. Above we override the helia
module, but your example may different deps.
Please see the existing setup in .github/workflows/test.yml
for how to ensure you are overriding the correct modules.