@tradie/component-scripts
An opinionated set of scripts for creating and maintaining react components.
Last updated 2 years ago by jameslnewell .
MIT · Original npm · Tarball · package.json
$ cnpm install @tradie/component-scripts 
SYNC missed versions from official npm registry.

@tradie/component-scripts

An opinionated set of scripts for creating and maintaining react components.

Feel like you spend more time setting up and updating the tools to build, test and maintain your component? @tradie/react-component-scripts lets you focus on writing code and spend less time setting up and updating the tools to build, test and maintain your component. It provides you with a way to keep tooling consistent across multiple components with minimal effort.

Usage

Create a new folder for your project:

mkdir my-package && cd my-package

Create the files for your project:

npx --package @tradie/react-component-scripts tradie create

Files

  coverage/
  example/
  dist/
  src/
  test/
  .flowconfig
  .gitignore
  package.json

coverage/

This folder contains the coverage report generated by tradie test --coverage. This folder should be added to your .gitignore file. This folder is removed by tradie clean.

example/

This folder contains scripts that demonstrate the functionality of your package. These scripts can be run using the tradie example <module> command.

dist/

This folder contains the transpiled sources generated by tradie build. This folder should be added to your .gitignore file. This folder is removed by tradie clean.

src/

This folder contains the source code and the unit tests for your package.

test/

This folder contains other tests e.g. integration etc

.flowconfig

This file contains your config for flowtype. Typings are optional.

.gitignore

This file excludes files from your version control system. It should at least exclude the generated files and folders. For example:

dist
coverage
node_modules

package.json

This is your package manifest. You should specify your package's main script and which files will should be included in the package.

{
  "main": "dist/cjs/index.js",
  "jsnext:main": "dist/esm/index.js",
  "files": ["dist", ".flowconfig"]
}

Commands

tradie clean

Remove generated files and folders.

tradie clean

tradie lint

Lint sources, tests and examples.

tradie lint [--watch]

This command doesn't enforce any stylistic rules. Use prettier instead.

tradie build

Transpile sources and export their types.

tradie build [--watch]

tradie test

Run tests.

tradie test [--watch] [--coverage]

tradie example

Run examples.

tradie example [module]

FAQ*

*Questions that I think will be frequently asked.

Can I use the latest language features?

Yes. The following Babel presets and plugins are configured:

  • babel-preset-env
  • babel-preset-react
  • babel-plugin-transform-class-properties
  • babel-plugin-transform-object-rest-spread
  • babel-plugin-transform-dynamic-import-node

Can I use types?

Yes! Create a .flowconfig and add // @flow comments to the top of your files. Type information will be exported to ./dist.

You should ignore the ./dist directory. For example:

.flowconfig:

[ignore]
<PROJECT_ROOT>/dist

Current Tags

  • 1.0.0-alpha.0a88ad7c                                ...           latest (2 years ago)
  • 1.0.0-alpha.27c7c657                                ...           next (2 years ago)

2 Versions

  • 1.0.0-alpha.27c7c657                                ...           2 years ago
  • 1.0.0-alpha.0a88ad7c                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (22)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |