|
30 | 30 | - [IPFS Tutorials at ProtoSchool](#ipfs-tutorials-at-protoschool)
|
31 | 31 | - [Documentation](#documentation)
|
32 | 32 | - [Contributing](#contributing)
|
| 33 | + - [Guidelines](#guidelines) |
| 34 | + - [Steps to follow after adding a new example](#steps-to-follow-after-adding-a-new-example) |
33 | 35 | - [Want to hack on IPFS?](#want-to-hack-on-ipfs)
|
34 | 36 |
|
35 | 37 | ## About The Project
|
@@ -60,11 +62,11 @@ Make sure you have installed all of the following prerequisites on your developm
|
60 | 62 | ```
|
61 | 63 | 2. Install NPM packages
|
62 | 64 | ```sh
|
63 |
| - npm run init |
| 65 | + yarn install |
64 | 66 | ```
|
65 | 67 | 3. Run all the examples
|
66 | 68 | ```sh
|
67 |
| - npm run test:examples |
| 69 | + yarn run test |
68 | 70 | ```
|
69 | 71 |
|
70 | 72 | ## Structure
|
@@ -96,6 +98,60 @@ Contributions are what make the open source community such an amazing place to b
|
96 | 98 | 4. Push to the Branch (`git push origin feature/amazing-feature`)
|
97 | 99 | 5. Open a Pull Request
|
98 | 100 |
|
| 101 | +### Guidelines |
| 102 | + |
| 103 | +- Follow the [example-template](`https://github.com/ipfs-examples/example-template`) |
| 104 | + - 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 |
| 105 | + |
| 106 | +- Examples must: |
| 107 | + - Live inside the `/examples/` folder |
| 108 | + - Have tests and should make use of `test-util-ipfs-example` library |
| 109 | + - If possible use `playwright` as test framework |
| 110 | + - Implement the following scripts: |
| 111 | + - `clean`: used to clean all the unnecessary code (e.g.: files generated by bundlers and package managers) |
| 112 | + - `build`: used to build the example |
| 113 | + - `start`: used to start the example |
| 114 | + - `test`: used to test the example |
| 115 | + |
| 116 | +- README must have (see example inside `example-template`): |
| 117 | + - Link to `Codesandbox.com` for one-click running demonstration |
| 118 | + - References for documentation/tutorials used to build the example |
| 119 | + - _Optional:_ Screenshots, gifs, etc... under `img/` folder |
| 120 | + |
| 121 | +- Update the CI to run the tests of the new example as standalone |
| 122 | + - Edit `github/workflows/ci.yml` |
| 123 | + - Add the test name to `project` under `matrix` |
| 124 | + |
| 125 | +- Extend the `test-util-ipfs-example` library if needed to reuse code in other examples |
| 126 | + |
| 127 | +### Steps to follow after adding a new example |
| 128 | + |
| 129 | +- Update `js-ipfs` CI to run the test script of the example |
| 130 | + - Edit the `.travis.yml`, search for the test examples section and add the following: |
| 131 | + |
| 132 | +```yml |
| 133 | +- stage: test |
| 134 | + name: examples - {TODO_EXAMPLE NAME} |
| 135 | + script: |
| 136 | + - npm run test:external -- -- -- https://github.com/ipfs-examples/{TODO_GIT_URL}.git |
| 137 | +``` |
| 138 | +
|
| 139 | +- 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 |
| 140 | + |
| 141 | +- Turn off issue/wikis/projects/discussions |
| 142 | + |
| 143 | +<p align="center"> |
| 144 | + <img src="./img/repo_details.png" width="300" alt="Repo Details"> |
| 145 | +</p> |
| 146 | + |
| 147 | +- Disable Releases/Environments/Packages |
| 148 | + |
| 149 | +<p align="center"> |
| 150 | + <img src="./img/repo_settings.png" width="500" alt="Repo Settings"> |
| 151 | +</p> |
| 152 | + |
| 153 | +- Follow the instruction inside the README |
| 154 | + |
99 | 155 | ## Want to hack on IPFS?
|
100 | 156 |
|
101 | 157 | [](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
|
|
0 commit comments