• This repository has been archived on 27/Mar/2020
  • Stars
    star
    475
  • Rank 89,218 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ”ด Functional task runner for Node.js

start

โš ๏ธ Project has been transferred to NexTools metarepo

linux windows coverage

logo

  • functional โ€“ in all senses
  • fast โ€“ parallelism and concurrency
  • shareable โ€“ presets as published packages
  • 4th line to align with logo on the right

TOC

Example

.
โ”œโ”€โ”€ packages/
โ”‚   โ”œโ”€โ”€ foo/
โ”‚   โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ index.ts
โ”‚   โ”‚   โ”œโ”€โ”€ test/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ index.ts
โ”‚   โ”‚   โ””โ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ bar/
โ”‚       โ”œโ”€โ”€ src/
โ”‚       โ”‚   โ””โ”€โ”€ index.ts
โ”‚       โ”œโ”€โ”€ test/
โ”‚       โ”‚   โ””โ”€โ”€ index.ts
โ”‚       โ””โ”€โ”€ package.json
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ tasks.ts
$ yarn add --dev --ignore-workspace-root-check \
  @babel/core \
  @babel/register \
  @babel/preset-env \
  @babel/preset-typescript \
  @start/cli \
  @start/reporter-verbose \
  @start/plugin-sequence \
  @start/plugin-parallel \
  @start/plugin-xargs \
  @start/plugin-find \
  @start/plugin-find-git-staged \
  @start/plugin-remove \
  @start/plugin-read \
  @start/plugin-rename \
  @start/plugin-write \
  @start/plugin-lib-babel \
  @start/plugin-lib-typescript-generate \
  @start/plugin-lib-eslint \
  @start/plugin-lib-istanbul \
  @start/plugin-lib-tape \
  @start/plugin-lib-codecov
// package.json

{
  "private": true,
  "description": "Start example",
  "workspaces": [
    "packages/*"
  ],
  "devDependencies": {},
  "start": {
    // tasks file, default to `./tasks`
    "file": "./tasks"
    "require": [
      [
        "@babel/register",
        {
          "extensions": [
            ".ts",
            ".js"
          ]
        }
      ]
    ],
    "reporter": "@start/reporter-verbose"
  },
  "babel": {
    "presets": [
      [
        "@babel/preset-env",
        {
          "targets": {
            "node": "current"
          }
        }
      ],
      // Babel 7
      "@babel/preset-typescript"
    ]
  }
}
// tasks.ts

// write tasks file once, publish it and then reuse or even extend
// in all projects using `start.preset` option in `package.json`,
// something like `my-start-preset` package with everything included

import sequence from '@start/plugin-sequence'
import parallel from '@start/plugin-parallel'
import xargs from '@start/plugin-xargs'
import find from '@start/plugin-find'
import findGitStaged from '@start/plugin-find-git-staged'
import remove from '@start/plugin-remove'
import read from '@start/plugin-read'
import rename from '@start/plugin-rename'
import write from '@start/plugin-write'
import babel from '@start/plugin-lib-babel'
import typescriptGenerate from '@start/plugin-lib-typescript-generate'
import eslint from '@start/plugin-lib-eslint'
import {
  istanbulInstrument,
  istanbulReport,
  istanbulThresholds
} from '@start/plugin-lib-istanbul'
import tape from '@start/plugin-lib-tape'
import codecov from '@start/plugin-lib-codecov'

const babelConfig = {
  babelrc: false,
  presets: [
    [
      '@babel/preset-env',
      {
        targets: {
          node: 6
        },
        modules: false
      }
    ],
    '@babel/preset-typescript'
  ]
}

// each named export is a "task"
export const build = (packageName: string) =>
  sequence(
    find(`packages/${packageName}/src/**/*.ts`),
    read,
    babel(babelConfig),
    rename((file) => file.replace(/\.ts$/, '.js')),
    write(`packages/${packageName}/build/`)
  )

export const dts = (packageName: string) =>
  sequence(
    find(`packages/${packageName}/src/index.ts`),
    typescriptGenerate(`packages/${packageName}/build/`)
  )

export const pack = (packageName: string) =>
  sequence(
    find(`packages/${packageName}/build/`),
    remove,
    // child-processes
    parallel(['build', 'dts'])(packageName)
  )

// child processes
export const packs = xargs('pack')

export const dev = (packageName: string) =>
  watch(`packages/${packageName}/**/*.ts`)(
    build(packageName)
  )

export const lint = () =>
  sequence(
    findGitStaged(['packages/*/{src,test}/**/*.ts']),
    read,
    eslint()
  )

export const lintAll = () =>
  sequence(
    find(['packages/*/{src,test}/**/*.ts']),
    read,
    eslint()
  )

export const test = () =>
  sequence(
    find('coverage/'),
    remove,
    find('packages/*/src/**/*.ts'),
    istanbulInstrument({ esModules: true, extensions: ['.ts'] }),
    find('packages/*/test/**/*.ts'),
    tape(),
    istanbulReport(['lcovonly', 'html', 'text-summary']),
    istanbulThresholds({ functions: 100 })
  )

export const ci = () =>
  sequence(
    // nested task
    lintAll(),
    // nested task
    test(),
    find('coverage/lcov.info'),
    read,
    codecov
  )
$ yarn start
# or
$ npx start

One of the following task names is required:
* build
* dts
* pack
* packs
* dev
* lint
* lintAll
* test
* ci
$ yarn start build foo
$ yarn start dts foo
$ yarn start pack foo
$ yarn start packs foo bar
$ yarn start dev bar
$ yarn start lint
$ yarn start lintAll
$ yarn start test
$ yarn start ci

How to

Recipes

  • Node.js TypeScript library preset โ€“ @deepsweet/start-preset-node-ts-lib
  • Node.js TypeScript libraries monorepo โ€“ Start project builds itself from sources using sources, see tasks/index.ts
  • React / React Native (higher-order) components monorepo โ€“ hocs
  • React app โ€“ to be added

Packages

Core

  • โฌ›๏ธ cli โ€“ CLI entry point
  • โš™๏ธ plugin โ€“ plugin creator
  • ๐Ÿ“ƒ reporter-verbose โ€“ verbose reporter

Plugins

Misc

  • โฉ plugin-sequence โ€“ run plugins in sequence
  • ๐Ÿ”€ plugin-parallel โ€“ run tasks as parallel child processes with same agruments
  • ๐Ÿ”‚ plugin-xargs โ€“ run task as parallel child process for each argument
  • ๐Ÿฃ plugin-spawn โ€“ spawn new child process
  • ๐Ÿ‘” plugin-env โ€“ set environment variable using process.env
  • ๐Ÿ”Œ plugin-input-files โ€“ inject arguments as files into Start flow files
  • ๐Ÿ”Œ plugin-output-files โ€“ to be added

FS

  • ๐Ÿ” plugin-find โ€“ find files using glob patterns
  • ๐Ÿ” plugin-find-git-staged โ€“ find Git staged files and filter them using glob patterns
  • ๐Ÿ“– plugin-read โ€“ read files content
  • ๐Ÿ”  plugin-rename โ€“ rename files
  • โŒ plugin-remove โ€“ remove files or directories
  • ๐Ÿ‘ฏ plugin-copy โ€“ copy files to relative destination using streams and keeping folders structure
  • โœ๏ธ plugin-write โ€“ write files with source maps to relative destination keeping folders structure
  • โœ๏ธ plugin-overwrite โ€“ overwrite files
  • ๐Ÿ‘€ plugin-watch โ€“ watch for new or changed files matched by glob patterns
  • ๐Ÿ—œ plugin-unpack โ€“ unpack .tar/.tar.bz2/.tar.gz/.zip archives

Build and bundle

Tests

Lint, check and fix

CI and publish

Tasks

Coming soon.

Roadmap

  • stabilize and publish 0.1.0 of everything
  • documentation
  • more tests
  • migrate the rest of important plugins

Copyright

All the packages in this repository are released under the terms of the MIT License.

The font used in logo is supernova fat.

More Repositories

1

hocs

๐Ÿฑ Higher-Order Components for React
JavaScript
2,011
star
2

foxr

๐ŸฆŠ Node.js API to control Firefox
TypeScript
797
star
3

chromium-headless-remote

๐Ÿณ Dockerized Chromium in headless remote debugging mode
Makefile
125
star
4

isparta-loader

๐Ÿ’ฏ isparta instrumenter loader for webpack
JavaScript
117
star
5

microjungle

๐Ÿญ HTML templating with JS. The Right Way.
JavaScript
91
star
6

baggage-loader

[MAINTAINER NEEDED] ๐Ÿ‘œ Webpack loader to automatically require any resources related to the required one
JavaScript
88
star
7

autopolyfiller-loader

๐Ÿญ Autopolyfiller loader for webpack
JavaScript
69
star
8

valya

โœ”๏ธ Higher-Order Component for validation in React
JavaScript
63
star
9

Monokai-Soda-iTerm

๐ŸŒˆ Sublime Text 2 Soda Dark based theme for iTerm/iTerm2
47
star
10

mustache-loader

Mustache loader for webpack
JavaScript
39
star
11

mnth

๐Ÿ“† Calendar month as 2d array of Dates
TypeScript
38
star
12

babel-istanbul-loader

๐Ÿ’ฏ babel-istanbul instrumenter loader for webpack
JavaScript
25
star
13

poncho

Client-side JS code coverage using PhantomJS, Mocha and Blanket
JavaScript
23
star
14

typeon

โœ”๏ธ Typed JSON parse and stringify for TypeScript
TypeScript
22
star
15

jquery-pointerevents

Basic polyfill for Pointer Events W3C Specification
JavaScript
20
star
16

firefox-headless-remote

๐Ÿณ Dockerized Firefox in headless Marionette mode
JavaScript
16
star
17

markdown-highlight-loader

๐Ÿญ Markdown (marked + highlight.js) loader for webpack
JavaScript
11
star
18

babel-register-ts

๐Ÿ”ง @babel/register wrapper with additional .ts and .tsx extensions
JavaScript
10
star
19

mocku

๐Ÿ•ถ๏ธ ESM mocking library
TypeScript
9
star
20

nbx

โ–ถ๏ธ Execute package binaries
Shell
8
star
21

react-attrs-filter

Filter React props
JavaScript
8
star
22

copie

๐Ÿ‘ฏโ€โ™€๏ธ Copy a file
TypeScript
7
star
23

1pwd

๐Ÿ”‘ 1Password CLI wrapper
TypeScript
6
star
24

ungoogled-chromium-headless-remote

๐Ÿณ Dockerized Ungoogled Chromium in headless remote debugging mode
Dockerfile
6
star
25

auto

TypeScript
4
star
26

ekst

๐Ÿ”ก Append, prepend, replace or remove basename extensions
TypeScript
4
star
27

dleet

๐Ÿ”ฅ Delete directories and files
TypeScript
4
star
28

spyfn

๐Ÿ‘€ Spy function
TypeScript
4
star
29

makethen

โœจ Promisify Node.js-style callbacks with native Promise
TypeScript
4
star
30

codecov-node-lite

๐Ÿ’ฏ LCOV uploader for codecov.io service
TypeScript
4
star
31

flows

ใ€ฐ A proof of concept of alternative Flow Library Definitions manager
JavaScript
4
star
32

eslint-config-tough

[ DEPRECATED ]
JavaScript
4
star
33

itc

iTunes ITC files parser and covers extractor
JavaScript
3
star
34

dba

Don't Be an Asshole
JavaScript
3
star
35

bsc

๐Ÿ” Binary search with comparator
TypeScript
3
star
36

lessbuildify

Browserify plugin for compiling Less to the external file
JavaScript
3
star
37

yocto

chainable all the default DOM Element methods and properties
JavaScript
3
star
38

_

โš™๏ธ Personal configs, presets, etc
TypeScript
3
star
39

move-path

โžก๏ธ Move path to destination folder
TypeScript
3
star
40

get-local-ip

Get a local IP address from a specified network range
JavaScript
2
star
41

karma-saucelabs-browsers

Autoprefixer-like browsers matching for Karma + SauceLabs
JavaScript
2
star
42

grunt-freeport

๐Ÿ†“ Grunt task to get a free port number on localhost from specified range
JavaScript
2
star
43

txt

๐Ÿšง my WIP dreams
TypeScript
1
star
44

jquery-pointerpressrelease

Additional 'pointerpress' and 'pointerrelease' events on top of jquery-pointerevents
JavaScript
1
star
45

deepsweet

1
star
46

deepsweet.github.io

๐ŸŒ
HTML
1
star
47

chrome.theoldreader.notifier

Displays the number of unread RSS items of The Old Reader
JavaScript
1
star