3.4.4 • Published 2 years ago

@billogram/billo-scripts-frontend v3.4.4

Weekly downloads
52
License
MIT
Repository
-
Last release
2 years ago

@billogram/billo-scripts-frontend

Scripts for building and maintaining TypeScript-based frontend libraries

Install

yarn add @billogram/billo-scripts-frontend

Usage

Add the following scripts to package.json if you are using the Rollup toolchain.

{
  "scripts": {
    "build": "billo-scripts-frontend build",
    "test": "billo-scripts-frontend test",
    "css:lint": "billo-scripts-frontend css-lint",
    "ts:check": "billo-scripts-frontend ts-check",
    "ts:compile": "billo-scripts-frontend ts-compile",
    "ts:lint": "billo-scripts-frontend ts-lint",
    "ts:test": "billo-scripts-frontend ts-test",
    "ts:watch": "billo-scripts-frontend ts-watch-babel"
  }
}

Add the following scripts to package.json if you are using the Babel toolchain.

{
  "scripts": {
    "build": "billo-scripts-frontend build-babel",
    "test": "billo-scripts-frontend test",
    "css:lint": "billo-scripts-frontend css-lint",
    "ts:check": "billo-scripts-frontend ts-check",
    "ts:compile": "billo-scripts-frontend ts-compile-babel",
    "ts:lint": "billo-scripts-frontend ts-lint",
    "ts:test": "billo-scripts-frontend ts-test",
    "ts:watch": "billo-scripts-frontend ts-watch-babel"
  }
}

It is possible to skip hooks for sequence tasks by passing --skip-pre-script, --skip-script, and --skip-post-script, which is the same as --skip-pre-script=<task-name>, --skip-script=<task-name>, and --skip-post-script=<task-name>.

Configuration files

Add the following scripts to package.json if you are using the webpack toolchain.

{
  "scripts": {
    "build": "billo-scripts-frontend build-webpack",
    "test": "billo-scripts-frontend test",
    "css:lint": "billo-scripts-frontend css-lint",
    "ts:check": "billo-scripts-frontend ts-check",
    "ts:compile": "billo-scripts-frontend ts-compile-webpack",
    "ts:lint": "billo-scripts-frontend ts-lint",
    "ts:test": "billo-scripts-frontend ts-test",
    "ts:watch": "billo-scripts-frontend ts-watch-babel"
  }
}

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

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

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

{
  "extends": "@billogram/typescript-config-frontend",
  "compilerOptions": {
    "outDir": "./dist",
    "rootDir": "./src"
  }
}

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

{
  "extends": "@billogram/typescript-config-frontend",
  "compilerOptions": {
    "declaration": true,
    "declarationMap": false,
    "emitDeclarationOnly": true,
    "noEmit": false,
    "outDir": "./dist",
    "rootDir": "./src"
  },
  "exclude": [
    "src/*.test.*"
  ],
  "include": [
    "src/**/*"
  ]
}

Add a tslint.eslint.json file in the same folder as package.json.

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "allowJs": true
  },
  "exclude": [
    "node_modules"
  ],
  "include": [
    "**/*"
  ]
}

Tasks

Sequence tasks

These tasks will be run in silent mode, which means the output for each individual task will be minimal. It is possible to exclude a task from a sequence by adding --no-<task-name> after the sequence task name, for example billo-scripts-frontend test --no-css-lint.

build

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

  • empty-dist
  • ts-declarations
  • ts-compile for development env
  • filter-dist

build-babel

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

  • empty-dist
  • build-babel-declarations-and-compile
  • filter-dist

build-babel-declarations-and-compile

Generate type declaration and compile with Babel.

  • ts-declarations
  • ts-compile-babel for development env

build-webpack

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

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

test

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

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

build-style

Run all necessary tasks to "build" a style project.

test-style

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

  • css-lint

Simple tasks

empty-dist

Empty the dist folder.

example

Start a webpack dev server.

filter-dist

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

css-lint

Lint SCSS source files using stylelint.

ts-check

Type-check TypeScript.

ts-compile

Compile TypeScript to JavaScript and bundle using Rollup; put the output in the dist folder.

ts-compile-babel

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

ts-compile-webpack

Compile TypeScript to JavaScript and bundle using webpack; 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

3.4.4

2 years ago

3.4.3

2 years ago

3.4.2

2 years ago

3.4.1

2 years ago

3.4.0

3 years ago

3.3.4

3 years ago

3.3.3

3 years ago

3.3.2

3 years ago

3.3.1

3 years ago

3.3.0

3 years ago

3.2.1

3 years ago

3.2.0

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.4.3

5 years ago

2.4.2

5 years ago

2.4.1

5 years ago

2.4.0

5 years ago

2.3.15

5 years ago

2.3.14

5 years ago

2.3.13

5 years ago

2.3.12

5 years ago

2.3.11

5 years ago

2.3.10

5 years ago

2.3.9

5 years ago

2.3.8

5 years ago

2.3.7

5 years ago

2.3.6

5 years ago

2.3.5

5 years ago

2.3.4

5 years ago

2.3.3

5 years ago

2.3.2

5 years ago

2.3.1

5 years ago

2.3.0

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.10

5 years ago

2.1.9

5 years ago

2.1.8

5 years ago

2.1.7

5 years ago

2.1.6

5 years ago

2.1.5

5 years ago

2.1.4

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago