https://github.com/cryptiklemur/reprod
Quickly and easily create reproduction examples of bugs in third party code.
https://github.com/cryptiklemur/reprod
reproduction
Last synced: about 1 year ago
JSON representation
Quickly and easily create reproduction examples of bugs in third party code.
- Host: GitHub
- URL: https://github.com/cryptiklemur/reprod
- Owner: cryptiklemur
- License: mit
- Created: 2020-02-18T21:11:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-21T17:03:49.000Z (over 6 years ago)
- Last Synced: 2025-02-01T15:45:10.868Z (over 1 year ago)
- Topics: reproduction
- Language: TypeScript
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
reprod
=====
Quickly create reproduction examples of third party code
[](https://oclif.io)
[](https://npmjs.org/package/reprod)
[](https://npmjs.org/package/reprod)
[](https://github.com/aequasi/reprod/blob/master/package.json)
# Usage
```sh-session
$ npm i -g reprod
$ reprod -n zeit/swr@0.1.16
✔ Preparing Dependencies
✔ Creating Files
Finished creating reproduction!
$ cd swr-repro-
...
```
# Library Owner Usage
Create a `.reprod.js` file in the root directory of the project.
Build it to match the code below:
```typescript jsx
interface File {
path: string;
content?: string;
url?: string;
localUrl?: string;
permissions?: number;
}
interface Config {
package: {
[key: string]: any;
};
files: File[];
}
type ConfigFn = (config: {version: string; repo: string}) => Config;
```
```javascript
const pkg = require('./package.json');
module.exports = ({version, repo}) => {
return {
package: { // This whole object gets thrown into a `package.json` file
dependencies: {
[pkg.name]: version,
// Any other dependencies here
}
},
files: [
{
path: 'index.ts',
content: `import Library from '${pkg.name}';
Library.doSomethingAwesomeThatBreaks();
`
}
]
}
}
```
You can test this by running `reprod` in the library directory.
Check out [this library's `.reprod.js`](https://github.com/aequasi/reprod/blob/master/.reprod.js) for an example.