Skip to content

Commit

Permalink
Refactor package using TypeScript and arg (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey authored Apr 25, 2020
1 parent e8a8014 commit b294c6c
Show file tree
Hide file tree
Showing 16 changed files with 1,821 additions and 488 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
__test__/
dist/
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
language: node_js

node_js:
- 8
- 7
- 6
- 10
sudo: false # allows for faster builds
- stable
36 changes: 21 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ You can match as many glob patterns as you like, just put the command you want t

## Options

### Verbose (`-v`, `--verbose`)

Enable if you want verbose logging from `onchange` (useful for debugging). For example:

```sh
onchange -v 'app/**/*.js' 'test/**/*.js' -- npm test
```

### Add (`-a`, `--add`)

To execute the command for all initially added paths:
Expand All @@ -53,20 +45,26 @@ onchange -i '**/*.js' -- npm start

### Exclude (`-e`, `--exclude`)

To exclude matches (`**/node_modules/**` is excluded by default, use `--no-exclude` to disable):
To exclude matches:

```sh
onchange '**/*.ts' -e 'dist/**/*.js' -- tslint
```

**P.S.** When you exclude something, it overrides the default, so if you want to keep `**/node_modules/**` excluded, then you need to add it to the command explicitly.
### No Exclude (`--no-exclude`)

`**/node_modules/**` and `**/.git/**` are excluded by default, use `--no-exclude` to disable:

```sh
onchange 'node_modules/**' --no-exclude -- tslint
```

### Exclude Path (`--exclude-path`)

Excludes all paths in a file following the [`.gitignore`](https://git-scm.com/docs/gitignore) specification.

```sh
onchange '**/*' --exclude-path .gitignore -- prettier
onchange '**' --exclude-path .gitignore -- prettier
```

### Kill (`-k`, `--kill`)
Expand All @@ -77,7 +75,7 @@ To kill current and pending processes between changes:
onchange -k '**/*.js' -- npm test
```

### Jobs (`-j`, `--jobs`)
### Jobs (`-j <n>`, `--jobs <n>`)

Set the maximum concurrent processes to run (default is `1`):

Expand Down Expand Up @@ -125,7 +123,15 @@ By default, onchange watches for all events from [chokidar](https://github.com/p
this option to watch only for events you need:

```sh
onchange -f 'add change' '**/*.js' -- npm start
onchange -f add -f change '**/*.js' -- npm start
```

### Verbose (`-v`, `--verbose`)

Enable if you want verbose logging from `onchange` (useful for debugging). For example:

```sh
onchange -v 'app/**/*.js' 'test/**/*.js' -- npm test
```

## TypeScript
Expand All @@ -134,8 +140,8 @@ Includes [types](index.d.ts) for TypeScript users.

## Related

* [cli-error-notifier](https://github.com/micromata/cli-error-notifier) - Send native desktop notifications if a command exits with an exit code other than `0`.
- [cli-error-notifier](https://github.com/micromata/cli-error-notifier) - Send native desktop notifications if a command exits with an exit code other than `0`.

## License

MIT
MIT
95 changes: 0 additions & 95 deletions cli.js

This file was deleted.

3 changes: 0 additions & 3 deletions echo.js

This file was deleted.

25 changes: 0 additions & 25 deletions index.d.ts

This file was deleted.

Loading

0 comments on commit b294c6c

Please sign in to comment.