• This repository has been archived on 27/Mar/2020
  • Stars
    star
    475
  • Rank 92,465 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 9 years ago
  • Updated over 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

Plugins

Misc

FS

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,023
star
2

foxr

🦊 Node.js API to control Firefox
TypeScript
798
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

makethen

✨ Promisify Node.js-style callbacks with native Promise
TypeScript
4
star
29

codecov-node-lite

💯 LCOV uploader for codecov.io service
TypeScript
4
star
30

spyfn

👀 Spy function
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