├── CNAME ├── _config.yml ├── zh.md ├── LICENSE └── README.md /CNAME: -------------------------------------------------------------------------------- 1 | minimum-reproduction.wtf -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate -------------------------------------------------------------------------------- /zh.md: -------------------------------------------------------------------------------- 1 | # 什么是 TMD 最小复现 2 | 3 | 最小复现仓库是一个公开共享的 Git 仓库(不公开私有业务逻辑),显示您遇到的问题,并且安装尽可能少的依赖项。它还具有有关如何重现你遇到错误的步骤。它最容易添加到 README 文件中,但老实说你可以在任何地方添加它,甚至是文本文件。 4 | 5 | ## 不公开业务逻辑 6 | 7 | 听起来很简单,对吧?如果错误有关业务逻辑中的特定步骤,请以不明确展示当前工作内容的方式复制业务逻辑。 8 | 9 | ## 显示你遇到的问题 10 | 11 | 这还需要解释?这就是为什么首先应该创建最小复现的原因,因为你有一个希望被人调查的错误。 12 | 13 | ## 尽可能安装最少的依赖项 14 | 15 | 如果复现不需要一个依赖,移除它。数据库通常很容易在最小复现中删除。说真的,你越少让别人启动数据库,其他人就越容易运行它。如果你最终遇到与数据库相关的问题或多个服务器之间的问题,添加 `docker-compose.yml` 文件来协调连接会有很大帮助。 16 | 17 | ## 复现步骤 18 | 19 | 有关如何复现错误的一组清晰、明了的步骤。如果你需要,你也可以将设置和复制步骤分开。下面是一个例子: 20 | 21 | ``` 22 | # 设置 23 | 1) npm install 24 | 25 | # 复现 26 | 27 | 1) npm run start:dev 28 | 2) 打开新的终端 29 | 3) curl http://localhost:3000/users 30 | 4) 查看错误 31 | ``` 32 | 33 | ## 好,我已明白它是什么,我还需要什么? 34 | 35 | 一般来说,满足上述条件就足够了。这有助于那些调试错误并提供巨大支持的人。 36 | 37 | ## 为什么我被要求这样做呢? 38 | 39 | 提供最小复现有几个原因: 40 | 41 | 1. 它使调试错误*更加*容易。查看 1 个目录中的 2 个文件相比于 5 个目录中的 20 个文件要需要更少的深入和理解。 42 | 2. 在创建最小复现的同时,有一半的可能你将自己发现问题所在,并成长为开发人员和知识共享者。 43 | 44 | - [查看 StackOverflow 对最小重现的定义](https://stackoverflow.com/help/minimal-reproducible-example) 45 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Jay McDoniel 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # wtf-is-a-minimum-reproduction 2 | 3 | A minimum reproduction repository is a git repository that can be shared publicly (doesn't expose private business logic), shows the problem you're running into, and has the fewest dependencies installed possible. It also has the steps in place for how to replicate the error you're running into. This is easiest to add to the README, but honestly you can add it wherever, a text file even. 4 | 5 | ## Doesn't Expose Business Logic 6 | 7 | Sounds pretty simple, right? If your error resolves around a specific step in business logic, replicate the business logic in a way that doesn't make it evident what you're working on. 8 | 9 | ## Shows The Problem You're Running Into 10 | 11 | Does this need explanation? This is why the minimum reproduction should be created in the first place, cause you have an error you want someone to look into. 12 | 13 | ## Has The Fewest Dependencies Installed Possible 14 | 15 | If the reproduction doesn't need it, get rid of it. Databases are often easy to remove in minimum reproduction. Seriously, the less you make others spin up databases the easier it is to work it. If you end up having a database related issue or an issue between multiple servers, adding a `docker-compose.yml` file to orchestrate the connections helps out tremendously. 16 | 17 | ## Steps To Replicate 18 | 19 | A set of clear, defined steps on how to replicate the error. You can separate the setup and reproduction steps as well if you'd like. An example would be something like 20 | 21 | ``` 22 | # Setup 23 | 24 | 1) npm install 25 | 26 | # Reproduction 27 | 28 | 1) npm run start:dev 29 | 2) open new terminal 30 | 3) curl http://localhost:3000/users 31 | 4) see the error 32 | ``` 33 | 34 | ## Okay I Understand What It Is, What Else Do I Need? 35 | 36 | Generally speaking, if you meet the above, it's good to go. This helps out those who debug errors and provide support immensely. 37 | 38 | ## So why am I being asked for this? 39 | 40 | There's a few reasons to provide a minimum reproduction: 41 | 42 | 1. it makes debugging where the error _could_ be so much easier. Instead of looking across 20 files and 5 directories, it's now 2 files in 1 directory. Much less to dig through and understand 43 | 2. half the time while creating the minimum reproduction, you'll find what the problem was yourself and grow as a developer and as a knowledge sharer. 44 | 45 | * [Check out StackOverflow's defintion of a minimum reproduciton](https://stackoverflow.com/help/minimal-reproducible-example) 46 | 47 | ## Other Languages 48 | 49 | - [简体中文](./zh.md) 50 | --------------------------------------------------------------------------------