Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deps, a few majors #60967

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions Herebyfile.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// @ts-check
import { CancelToken } from "@esfx/canceltoken";
import assert from "assert";
import chalk from "chalk";
import chokidar from "chokidar";
import esbuild from "esbuild";
import { EventEmitter } from "events";
import fs from "fs";
import { glob } from "glob";
import { task } from "hereby";
import path from "path";
import pc from "picocolors";

import { localizationDirectories } from "./scripts/build/localization.mjs";
import cmdLineOptions from "./scripts/build/options.mjs";
Expand Down Expand Up @@ -399,7 +399,7 @@ function entrypointBuildTask(options) {
// allowing them to operate as regular tasks, while creating unresolved promises
// in the background that keep the process running after all tasks have exited.
if (!printedWatchWarning) {
console.error(chalk.yellowBright("Warning: watch mode is incomplete and may not work as expected. Use at your own risk."));
console.error(pc.yellowBright("Warning: watch mode is incomplete and may not work as expected. Use at your own risk."));
printedWatchWarning = true;
}

Expand Down Expand Up @@ -707,7 +707,7 @@ export const runTestsAndWatch = task({
dependencies: [watchTests],
run: async () => {
if (!cmdLineOptions.tests && !cmdLineOptions.failed) {
console.log(chalk.redBright(`You must specifiy either --tests/-t or --failed to use 'runtests-watch'.`));
console.log(pc.redBright(`You must specifiy either --tests/-t or --failed to use 'runtests-watch'.`));
return;
}

Expand All @@ -719,9 +719,8 @@ export const runTestsAndWatch = task({

const testsChangedDebouncer = new Debouncer(1_000, endRunTests);
const testCaseWatcher = chokidar.watch([
"tests/cases/**/*.*",
"tests/lib/**/*.*",
"tests/projects/**/*.*",
"tests/cases",
"tests/lib",
], {
ignorePermissionErrors: true,
alwaysStat: true,
Expand All @@ -746,7 +745,7 @@ export const runTestsAndWatch = task({
running = false;
}
if (watching) {
console.log(chalk.yellowBright(`[watch] test run complete, waiting for changes...`));
console.log(pc.yellowBright(`[watch] test run complete, waiting for changes...`));
await promise;
}
}
Expand All @@ -756,7 +755,7 @@ export const runTestsAndWatch = task({
}

/**
* @param {'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir'} eventName
* @param {'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir' | 'all' | 'ready' | 'raw' | 'error'} eventName
* @param {string} path
* @param {fs.Stats | undefined} stats
*/
Expand All @@ -783,9 +782,9 @@ export const runTestsAndWatch = task({
*/
function beginRunTests(path) {
if (testsChangedDebouncer.empty) {
console.log(chalk.yellowBright(`[watch] tests changed due to '${path}', restarting...`));
console.log(pc.yellowBright(`[watch] tests changed due to '${path}', restarting...`));
if (running) {
console.log(chalk.yellowBright("[watch] aborting in-progress test run..."));
console.log(pc.yellowBright("[watch] aborting in-progress test run..."));
}
testsChangedCancelSource.cancel();
testsChangedCancelSource = CancelToken.source();
Expand All @@ -803,7 +802,7 @@ export const runTestsAndWatch = task({
function endWatchMode() {
if (watching) {
watching = false;
console.log(chalk.yellowBright("[watch] exiting watch mode..."));
console.log(pc.yellowBright("[watch] exiting watch mode..."));
testsChangedCancelSource.cancel();
testCaseWatcher.close();
watchTestsEmitter.off("rebuild", onRebuild);
Expand Down
Loading
Loading