0.0.11 • Published 4 months ago

@doubleshot/runner v0.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

@doubleshot/runner

Description

Runner is a concurrently wrapper that helps you execute commands in parallel.

Warning: this project is in early stage, do not use in production environment

Features

  • 🛤️ Parallel commands, powered by concurrently.
  • 🌈 Nice command line colors.
  • 🔪 kill others when exiting.
  • 🚗 Driven by configuration file.
  • 📦 Support electron packaging.
  • 💡 Support stand-alone use.

Install

npm i @doubleshot/runner -D
# Or Yarn
yarn add @doubleshot/runner -D
# Or PNPM
pnpm add @doubleshot/runner -D

Note: You may need to add -W flag to install it in a monorepo workspace.

Usage

Runner must be driven by a configuration file, configuration file like dsr.config.ts ('.js' | '.cjs' | '.mjs') is also available:

import { defineConfig } from '@doubleshot/runner'

export default defineConfig({
  run: [
    {
      name: 'renderer',
      cwd: 'packages/frontend',
      commands: {
        dev: 'npm run dev',
        build: 'npm run build'
      }
    },
    {
      name: 'electron',
      cwd: 'packages/backend',
      commands: {
        dev: 'npm run dev',
        build: 
          // multi-line command is also available
          `
            npm run build &&
            echo 'build finished'
          `
      }
    }
  ]
})

You can configure items that need to be executed in parallel under the run field, and under the commands field, commands with the same name will be executed together. For example: npx dsr dev.

With the above configuration, it will execute npm run dev in both packages/frontend and packages/backend directories.You have to implement the above commands yourself, Runner is just a parallel executor.

You can find more configurations through the type definition file.

License

MIT License © 2022 Archer Gu

0.0.11

4 months ago

0.0.10

6 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.7

11 months ago

0.0.6

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.1

2 years ago

0.1.0-beta.0

2 years ago

0.1.0-alpha.3

2 years ago

0.1.0-alpha.2

2 years ago

0.1.0-alpha.0

2 years ago