reprod
Quickly create reproduction examples of third party code
Last updated 3 months ago by aequasi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install reprod 
SYNC missed versions from official npm registry.

reprod

Quickly create reproduction examples of third party code

oclif Version Downloads/week License

Usage

$ npm i -g reprod
$ reprod -n zeit/swr@0.1.16

  ✔ Preparing Dependencies
  ✔ Creating Files

Finished creating reproduction!

$ cd swr-repro-<tab>
...

Library Owner Usage

Create a .reprod.js file in the root directory of the project.

Build it to match the code below:

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;
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 for an example.

Current Tags

  • 0.1.4                                ...           latest (3 months ago)

5 Versions

  • 0.1.4                                ...           3 months ago
  • 0.1.3                                ...           3 months ago
  • 0.1.2                                ...           3 months ago
  • 0.1.1                                ...           3 months ago
  • 0.1.0                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (12)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |