Skip to content

bent10/doogu

Repository files navigation

doogu

Zero-config CLI tool that helps us develop modern JS and TS packages with ease.

Table of contents

Install

npm i -D doogu

Required Node.js >=12.

Usage

Run doogu --help for available commands.

doogu build [--types]

Performs doogu build [patterns] [options] command on top of esbuild.

# Bundles "src/**\/index.[jt]s(x)?" into "dist" directory
doogu build

# Bundles "src/**\/index.[jt]s(x)?" and "*.d.ts" files
doogu build --types

# Produces "assets/**\/*.js" and "*.d.ts" files
doogu build "src/**\/*.ts" --outdir=assets --no-bundle --types

# Allow JSX syntax in .js files
doogu build src/component.js --loader:.js=jsx

# Substitute the identifier RELEASE for the literal true
doogu build example.js --outfile=output.js --define:RELEASE=true

Run doogu build --help for available options.

Parameters

Name Type Description
patterns string | readonly string[] File paths or globs to build.
OptionalArgs OptionalArgs Options to pass to esbuild.

doogu lint [--types]

Performs doogu lint [patterns] [options] command on top of eslint.

# Lint .js, .jsx, .ts, .tsx files in the "src" and "test" directory
doogu lint

# Run types checking as well
doogu lint --types

# Custom input files and options
doogu lint app --ext=".ts,.tsx" --cache --cache-location=".cache/.eslintcache"

Run doogu lint --help for available options.

Parameters

Name Type Description
patterns string | readonly string[] File paths or globs to build.
OptionalArgs OptionalArgs Options to pass to eslint.

doogu watch [--command]

Performs doogu watch [patterns] [options] command.

# Automatically rebuild when "src/**\/*" files are changed
doogu watch

# Rebuild when .ts and .scss files are changed
doogu watch "src/**\/*.{ts,scss}"

# Run custom command when input files are changed
doogu watch "src/**\/*.ts" --command="doogu lint"

Run doogu watch --help for available options

Parameters

Name Type Description
patterns string | readonly string[] File paths or globs to build.
OptionalArgs OptionalArgs Options to pass to the watcher.

Contributing

We 💛  issues.

When committing, please conform to the semantic-release commit standards. Please install commitizen and the adapter globally, if you have not already.

npm i -g commitizen cz-conventional-changelog

Now you can use git cz or just cz instead of git commit when committing. You can also use git-cz, which is an alias for cz.

git add . && git cz

Thank you

A project by Stilearning © 2022.