yowtf 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +227 -1477
- package/dist/{chunk-2PCP3AKH.js → chunk-R4XNB67V.js} +67 -2
- package/dist/chunk-R4XNB67V.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +29 -2
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-2PCP3AKH.js.map +0 -1
|
@@ -5620,9 +5620,69 @@ ${scopeLine}`, {
|
|
|
5620
5620
|
}
|
|
5621
5621
|
};
|
|
5622
5622
|
|
|
5623
|
+
// src/cli/animation.ts
|
|
5624
|
+
import { Chalk as Chalk2 } from "chalk";
|
|
5625
|
+
var BOOT_SEQUENCE_HEADER = "YOWTF // INITIALIZING";
|
|
5626
|
+
var BOOT_SEQUENCE_STEPS = [
|
|
5627
|
+
"> loading diagnostic engine...",
|
|
5628
|
+
"> preparing collectors...",
|
|
5629
|
+
"> preparing detection rules...",
|
|
5630
|
+
"> preparing reporting pipeline...",
|
|
5631
|
+
"> ready."
|
|
5632
|
+
];
|
|
5633
|
+
var BOOT_SEQUENCE_TAGLINE = "Yo, WTF is happening?";
|
|
5634
|
+
function isAnimationEligible(options = {}) {
|
|
5635
|
+
if (options.json || options.quiet) {
|
|
5636
|
+
return false;
|
|
5637
|
+
}
|
|
5638
|
+
const stream = options.stream ?? process.stdout;
|
|
5639
|
+
const isTTY = options.isTTY ?? Boolean(stream.isTTY);
|
|
5640
|
+
return isTTY;
|
|
5641
|
+
}
|
|
5642
|
+
async function playBootAnimation(options = {}) {
|
|
5643
|
+
if (!isAnimationEligible(options)) {
|
|
5644
|
+
return;
|
|
5645
|
+
}
|
|
5646
|
+
const stream = options.stream ?? process.stdout;
|
|
5647
|
+
const useColor = options.color !== false;
|
|
5648
|
+
const c = new Chalk2({ level: useColor ? 2 : 0 });
|
|
5649
|
+
const delayMs = options.stepDelayMs ?? 50;
|
|
5650
|
+
const sleep = (ms) => ms > 0 ? new Promise((resolve) => setTimeout(resolve, ms)) : Promise.resolve();
|
|
5651
|
+
try {
|
|
5652
|
+
stream.write(`${c.cyan.bold(BOOT_SEQUENCE_HEADER)}
|
|
5653
|
+
|
|
5654
|
+
`);
|
|
5655
|
+
for (const step of BOOT_SEQUENCE_STEPS) {
|
|
5656
|
+
if (delayMs > 0) {
|
|
5657
|
+
await sleep(delayMs);
|
|
5658
|
+
}
|
|
5659
|
+
if (step === "> ready.") {
|
|
5660
|
+
stream.write(`${c.green(step)}
|
|
5661
|
+
`);
|
|
5662
|
+
} else {
|
|
5663
|
+
stream.write(`${c.dim(step)}
|
|
5664
|
+
`);
|
|
5665
|
+
}
|
|
5666
|
+
}
|
|
5667
|
+
if (delayMs > 0) {
|
|
5668
|
+
await sleep(delayMs);
|
|
5669
|
+
}
|
|
5670
|
+
stream.write(`
|
|
5671
|
+
${c.bold(BOOT_SEQUENCE_TAGLINE)}
|
|
5672
|
+
|
|
5673
|
+
`);
|
|
5674
|
+
} catch {
|
|
5675
|
+
}
|
|
5676
|
+
}
|
|
5677
|
+
|
|
5623
5678
|
// src/cli/dispatch.ts
|
|
5624
5679
|
async function dispatchCommand(commandName, options, commandSpecificOptions = {}) {
|
|
5625
5680
|
const targetPath = resolveAndValidatePath(options.path);
|
|
5681
|
+
await playBootAnimation({
|
|
5682
|
+
json: Boolean(options.json),
|
|
5683
|
+
quiet: Boolean(options.quiet),
|
|
5684
|
+
color: options.color !== false
|
|
5685
|
+
});
|
|
5626
5686
|
const context = {
|
|
5627
5687
|
command: commandName,
|
|
5628
5688
|
targetPath,
|
|
@@ -5806,7 +5866,7 @@ function registerAllCommands(program) {
|
|
|
5806
5866
|
var APP_NAME = "yowtf";
|
|
5807
5867
|
var APP_FULL_NAME = "Your Operating Workstation Trouble Finder";
|
|
5808
5868
|
var APP_TAGLINE = "Yo, WTF is happening?";
|
|
5809
|
-
var APP_VERSION = "0.1.
|
|
5869
|
+
var APP_VERSION = "0.1.1";
|
|
5810
5870
|
function createProgram() {
|
|
5811
5871
|
const program = new Command();
|
|
5812
5872
|
program.name(APP_NAME).description(`${APP_FULL_NAME} \u2014 ${APP_TAGLINE}`).version(APP_VERSION, "-V, --version", "output the version number").helpOption("-h, --help", "display help for command").exitOverride();
|
|
@@ -5964,6 +6024,11 @@ export {
|
|
|
5964
6024
|
executeCommand,
|
|
5965
6025
|
JsonReporter,
|
|
5966
6026
|
TerminalReporter,
|
|
6027
|
+
BOOT_SEQUENCE_HEADER,
|
|
6028
|
+
BOOT_SEQUENCE_STEPS,
|
|
6029
|
+
BOOT_SEQUENCE_TAGLINE,
|
|
6030
|
+
isAnimationEligible,
|
|
6031
|
+
playBootAnimation,
|
|
5967
6032
|
dispatchCommand,
|
|
5968
6033
|
registerGlobalOptions,
|
|
5969
6034
|
APP_NAME,
|
|
@@ -5973,4 +6038,4 @@ export {
|
|
|
5973
6038
|
createProgram,
|
|
5974
6039
|
runCli
|
|
5975
6040
|
};
|
|
5976
|
-
//# sourceMappingURL=chunk-
|
|
6041
|
+
//# sourceMappingURL=chunk-R4XNB67V.js.map
|