turbowatch
Advanced tools
Comparing version 2.15.1 to 2.16.0
"use strict"; | ||
// cspell:words nothrow | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createSpawn = void 0; | ||
const Logger_1 = require("./Logger"); | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const randomcolor_1 = __importDefault(require("randomcolor")); | ||
const throttle_debounce_1 = require("throttle-debounce"); | ||
@@ -38,2 +43,3 @@ const zx_1 = require("zx"); | ||
}); | ||
const colorText = chalk_1.default.hex((0, randomcolor_1.default)({ luminosity: 'dark' })); | ||
return async (pieces, ...args) => { | ||
@@ -51,3 +57,3 @@ zx_1.$.cwd = cwd; | ||
} | ||
const message = prefixLines(chunk.toString().trimEnd(), taskId + ' > '); | ||
const message = prefixLines(chunk.toString().trimEnd(), colorText(taskId) + ' > '); | ||
if (throttleOutput === null || throttleOutput === void 0 ? void 0 : throttleOutput.delay) { | ||
@@ -69,3 +75,3 @@ stdoutBuffer.push(message); | ||
} | ||
const message = prefixLines(chunk.toString().trimEnd(), taskId + ' > '); | ||
const message = prefixLines(chunk.toString().trimEnd(), colorText(taskId) + ' > '); | ||
if (throttleOutput === null || throttleOutput === void 0 ? void 0 : throttleOutput.delay) { | ||
@@ -72,0 +78,0 @@ stderrBuffer.push(message); |
@@ -11,2 +11,3 @@ { | ||
"dependencies": { | ||
"chalk": "^4.1.2", | ||
"chokidar": "^3.5.3", | ||
@@ -17,2 +18,3 @@ "glob": "^9.3.0", | ||
"p-retry": "^4.6.2", | ||
"randomcolor": "^0.6.2", | ||
"roarr": "^7.14.6", | ||
@@ -68,3 +70,3 @@ "semver": "^7.3.8", | ||
"types": "./dist/index.d.ts", | ||
"version": "2.15.1" | ||
"version": "2.16.0" | ||
} |
@@ -175,2 +175,13 @@ # Turbowatch 🏎 | ||
## Persistent tasks | ||
Your setup may include tasks that are not designed to exit, e.g. `next dev` (starts Next.js in development mode). | ||
It is important that these tasks are marked as `persistent` to distinguish them from tasks that run to completion as that changes how Turbowatch treats them. | ||
||Persistent|Non-Persistent| | ||
|---|---|---| | ||
|Wait for `initialRun` to complete before starting to watch files|❌|✅| | ||
|Ignore `FileChangeEvent` if `{ interruptible: false }`|✅|❌| | ||
## Expressions | ||
@@ -177,0 +188,0 @@ |
@@ -5,2 +5,4 @@ // cspell:words nothrow | ||
import { type Throttle } from './types'; | ||
import chalk from 'chalk'; | ||
import randomColor from 'randomcolor'; | ||
import { throttle } from 'throttle-debounce'; | ||
@@ -63,2 +65,4 @@ import { $ } from 'zx'; | ||
const colorText = chalk.hex(randomColor({ luminosity: 'dark' })); | ||
return async (pieces: TemplateStringsArray, ...args: any[]) => { | ||
@@ -79,3 +83,6 @@ $.cwd = cwd; | ||
const message = prefixLines(chunk.toString().trimEnd(), taskId + ' > '); | ||
const message = prefixLines( | ||
chunk.toString().trimEnd(), | ||
colorText(taskId) + ' > ', | ||
); | ||
@@ -100,3 +107,6 @@ if (throttleOutput?.delay) { | ||
const message = prefixLines(chunk.toString().trimEnd(), taskId + ' > '); | ||
const message = prefixLines( | ||
chunk.toString().trimEnd(), | ||
colorText(taskId) + ' > ', | ||
); | ||
@@ -103,0 +113,0 @@ if (throttleOutput?.delay) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
197859
3203
701
13
+ Addedchalk@^4.1.2
+ Addedrandomcolor@^0.6.2
+ Addedchalk@4.1.2(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedrandomcolor@0.6.2(transitive)
+ Addedsupports-color@7.2.0(transitive)