Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

fix: add guidelines and instructions #40

Merged
merged 3 commits into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 58 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
- [IPFS Tutorials at ProtoSchool](#ipfs-tutorials-at-protoschool)
- [Documentation](#documentation)
- [Contributing](#contributing)
- [Guidelines](#guidelines)
- [Steps to follow after adding a new example](#steps-to-follow-after-adding-a-new-example)
- [Want to hack on IPFS?](#want-to-hack-on-ipfs)

## About The Project
Expand Down Expand Up @@ -60,11 +62,11 @@ Make sure you have installed all of the following prerequisites on your developm
```
2. Install NPM packages
```sh
npm run init
yarn install
```
3. Run all the examples
```sh
npm run test:examples
yarn run test
```

## Structure
Expand Down Expand Up @@ -96,6 +98,60 @@ Contributions are what make the open source community such an amazing place to b
4. Push to the Branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

### Guidelines

- Follow the [example-template](`https://github.com/ipfs-examples/example-template`)
- This repository serves as template to create new examples to guarantee consistency between examples. It contains all the necessary files to create a new example

- Examples must:
- Live inside the `/examples/` folder
- Have tests and should make use of `test-util-ipfs-example` library
- If possible use `playwright` as test framework
- 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 example
- `start`: used to start the example
- `test`: used to test the example

- README must have (see example inside `example-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

- Update the CI to run the tests of the new example as standalone
- Edit `github/workflows/ci.yml`
- Add the test name to `project` under `matrix`

- Extend the `test-util-ipfs-example` library if needed to reuse code in other examples

### Steps to follow after adding a new example

- Update `js-ipfs` CI to run the test script of the example
- Edit the `.travis.yml`, search for the test examples section and add the following:

```yml
- stage: test
name: examples - {TODO_EXAMPLE NAME}
script:
- npm run test:external -- -- -- https://github.com/ipfs-examples/{TODO_GIT_URL}.git
```

- Create a new repository based on (https://github.com/ipfs-examples/example-fork-go-template) following the name: `js-ipfs-{EXAMPLE_NAME}` with a description

- Turn off issue/wikis/projects/discussions

<p align="center">
<img src="./img/repo_details.png" width="300" alt="Repo Details">
</p>

- Disable Releases/Environments/Packages

<p align="center">
<img src="./img/repo_settings.png" width="500" alt="Repo Settings">
</p>

- Follow the instruction inside the README

## Want to hack on IPFS?

[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
Expand Down
4 changes: 2 additions & 2 deletions examples/browser-angular/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
</a>
</p>

<h3 align="center"><b>IPFS React App</b></h3>
<h3 align="center"><b>IPFS Angular App</b></h3>

<p align="center">
<b><i>Using js-ipfs in a `create-react-app`</i></b>
<b><i>Using js-ipfs with `Angular`</i></b>
<br />
<br />
<img src="https://raw.githubusercontent.com/jlord/forkngo/gh-pages/badges/cobalt.png" width="200">
Expand Down
Binary file added img/repo_details.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/repo_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.