2.0.1 • Published 5 years ago

@coderesque/resque-scripts-frontend v2.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

@coderesque/resque-scripts-frontend

Scripts for building and maintaining TypeScript-based React libraries

Install

yarn add --exact @coderesque/resque-scripts-frontend

Usage

Add the following scripts to package.json.

{
  "scripts": {
    "prebuild": "resque-scripts-frontend test",
    "build": "resque-scripts-frontend build",
    "test": "resque-scripts-frontend test",
    "css:lint": "resque-scripts-frontend css-lint",
    "ts:check": "resque-scripts-frontend ts-check",
    "ts:lint": "resque-scripts-frontend ts-lint",
    "ts:test": "resque-scripts-frontend ts-test",
  }
}

Add a babel.config.json file in the same folder as package.json.

/* eslint-env node */
module.exports = require('@coderesque/babel-config-frontend');

Add a tsconfig.json file in the same folder as package.json.

{
  "extends": "@coderesque/typescript-config-frontend",
  "compilerOptions": {
    "outDir": "./dist",
    "rootDir": "./src"
  }
}
> resque-scripts-frontend

Tasks

Sequence tasks

These tasks will be run in silent mode, which means the output for each individual task will be minimal.

build

Run all necessary tasks to generate a fresh build in the dist folder.

  • empty-dist
  • ts-compile for development env
  • ts-compile for production env
  • ts-declarations
  • generate-license
  • filter-dist

test

Run all necessary tasks to test the quality of the project.

  • ts-check
  • ts-lint
  • ts-test
  • css-lint

Simple tasks

empty-dist (alias: clean)

Empty the dist folder.

filter-dist

Remove unwanted test and source map files from the dist folder.

generate-license

Generate a project license in the dist folder.

css-lint

Lint SCSS source files using stylelint.

ts-check

Type-check TypeScript.

ts-compile

Compile TypeScript to JavaScript and put the output in the dist folder.

ts-declarations

Generate TypeScript declarations.

ts-lint

Lint source files using ESLint.

ts-test

Run tests using Jest.

Note

This library is being published with our use cases in mind and is not necessarily meant to be consumed by the broader public. We probably won't take your feature requests unless they align with our own needs.

License

MIT