gulp-mu-gulp-api 0.3.8 → 0.3.10

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.
Files changed (3) hide show
  1. package/README.md +16 -0
  2. package/package.json +1 -1
  3. package/src/index.mjs +18 -4
package/README.md CHANGED
@@ -12,6 +12,9 @@
12
12
  </a>
13
13
  </p>
14
14
 
15
+ <p align="center"><strong>Rock your Gulp!</strong><br/>
16
+ µGulp™, the interactive near-zero-latency task orchestrator with rich visuals, webview controls, and audio feedback.</p>
17
+
15
18
  Public task API of the **µGulp™** orchestrator — progress reporting, i18x console output and interactive dashboard inputs from within gulp tasks.
16
19
 
17
20
  [![npm version](https://img.shields.io/npm/v/gulp-mu-gulp-api.svg)](https://www.npmjs.com/package/gulp-mu-gulp-api) · [µGulp™ on GitHub](https://github.com/mamekudz/microGulp) · [source tree](https://github.com/mamekudz/microGulp/tree/main/gulp-mu-gulp-api)
@@ -22,6 +25,8 @@ Public task API of the **µGulp™** orchestrator — progress reporting, i18x c
22
25
 
23
26
  # English
24
27
 
28
+ **Rock your Gulp!** — µGulp™, the interactive near-zero-latency task orchestrator with rich visuals, webview controls, and audio feedback.
29
+
25
30
  **gulp-mu-gulp-api** gives gulp tasks (and any npm package inside the task stream) access to the extended µGulp™ dashboard features: progress bars, validated text inputs, color and font pickers, single and multi selections, sliders and complete forms.
26
31
 
27
32
  The module is deliberately **dependency-free** and knows nothing about µGulp™ internals: when the task runs under µGulp™, it talks directly to the engine over the worker process IPC channel. When the gulpfile runs through the classic gulp CLI, every function degrades gracefully — progress renders on the terminal, inputs are asked via readline (TTY) or answered with the declared defaults (CI/non-TTY). Tasks stay fully runnable without µGulp™.
@@ -32,6 +37,10 @@ The module is deliberately **dependency-free** and knows nothing about µGulp™
32
37
  npm install gulp-mu-gulp-api
33
38
  ```
34
39
 
40
+ ### 0.3.10
41
+
42
+ - **Fixed** `IsMicroGulp()` / `IsµGulp()` — returns `true` only when `MICROGULP=1` **and** `typeof process.send === 'function'`. Child processes that inherit `MICROGULP` without an IPC channel (nested gulp runs, test subprocesses) no longer crash on `process.send`.
43
+
35
44
  ### 0.3.8
36
45
 
37
46
  - **Added** structured log elements rendered directly in the run log (JSON payloads, Content-Security-Policy safe, no plugin/iframe needed): `LogCallout()` (info/success/warning/error box), `LogKeyValue()` (metrics/summary list), `LogBadges()` (status chips), `LogCode()` (monospace code block) and `LogChart()` (inline-SVG bar chart).
@@ -249,6 +258,9 @@ $env:NPM_OTP="123456"; npm run publish:api
249
258
 
250
259
  # Deutsch
251
260
 
261
+ <p align="center"><strong>Rock your Gulp!</strong><br/>
262
+ µGulp™ — der interaktive Task-Orchestrator mit nahezu null Latenz, stylischer Dashboard-Ausgabe, Webview-Steuerung und akustischem Feedback.</p>
263
+
252
264
  **gulp-mu-gulp-api** ist die öffentliche Task-API des **µGulp™**-Orchestrators. Gulp-Tasks (und beliebige npm-Pakete innerhalb des Task-Streams) erhalten damit Zugriff auf die erweiterten µGulp™-Dashboard-Funktionen: Fortschrittsanzeige, i18x-Konsolenausgabe, Texteingaben mit Validierung, Farb- und Schriftart-Auswahl, Einzel- und Mehrfachauswahl, Slider und komplette Formulare.
253
265
 
254
266
  [![npm version](https://img.shields.io/npm/v/gulp-mu-gulp-api.svg)](https://www.npmjs.com/package/gulp-mu-gulp-api) · [µGulp™ auf GitHub](https://github.com/mamekudz/microGulp)
@@ -261,6 +273,10 @@ Das Modul ist bewusst **abhängigkeitsfrei** und kennt keine µGulp™-Interna:
261
273
  npm install gulp-mu-gulp-api
262
274
  ```
263
275
 
276
+ ### 0.3.10
277
+
278
+ - **Fixed** `IsMicroGulp()` / `IsµGulp()` — returns `true` only when `MICROGULP=1` **and** `typeof process.send === 'function'`. Child processes that inherit `MICROGULP` without an IPC channel (nested gulp runs, test subprocesses) no longer crash on `process.send`.
279
+
264
280
  ### 0.3.8
265
281
 
266
282
  - **Neu** strukturierte Log-Elemente, die direkt im Run-Log gerendert werden (JSON-Payloads, Content-Security-Policy-sicher, ohne Plugin/iframe): `LogCallout()` (Info/Success/Warning/Error-Box), `LogKeyValue()` (Metriken/Zusammenfassung), `LogBadges()` (Status-Chips), `LogCode()` (Monospace-Codeblock) und `LogChart()` (Inline-SVG-Balkendiagramm).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gulp-mu-gulp-api",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "Public task API for the µGulp orchestrator: progress reporting, sound signals, speech output, localized console output (i18x) and interactive UI inputs (text, password, number, textarea, color, font, select, radio, multi-select checkbox, range slider, date/time, file) from within gulp tasks — with graceful CLI fallbacks when running without µGulp.",
5
5
  "type": "module",
6
6
  "main": "src/index.mjs",
package/src/index.mjs CHANGED
@@ -44,10 +44,11 @@ const pendingUiRequests = new Map();
44
44
  * attached dashboard (progress and inputs are rendered in the webview)
45
45
  */
46
46
  export function IsMicroGulp() {
47
- // The worker pool sets MICROGULP=1 for every forked task process. Relying
48
- // only on process.send was too strict — some hosts still stream stdout
49
- // correctly while structured IPC must be attempted separately.
50
- return process.env.MICROGULP === '1';
47
+ // The worker pool sets MICROGULP=1 for every forked task process and
48
+ // connects an IPC channel (process.send). Child processes spawned from
49
+ // within a task inherit the env flag but not IPC — they must not be
50
+ // treated as dashboard workers.
51
+ return process.env.MICROGULP === '1' && typeof process.send === 'function';
51
52
  }
52
53
 
53
54
  /** Brand-aligned alias for {@link IsMicroGulp}. */
@@ -717,9 +718,22 @@ function _AsciiChart(_payload) {
717
718
  return lines;
718
719
  }
719
720
 
721
+ /**
722
+ * Asks µGulp to re-evaluate dynamic task metadata (µEnabled predicates,
723
+ * disabled tooltips) and refresh the dashboard task list. Call after
724
+ * changing module-level state that drives enable/disable rules.
725
+ * No-op outside a µGulp worker.
726
+ */
727
+ export function NotifyTasksChanged() {
728
+ if (typeof process.send === 'function') {
729
+ process.send({ type: 'refresh-tasks' });
730
+ }
731
+ }
732
+
720
733
  export default {
721
734
  IsMicroGulp,
722
735
  IsµGulp,
736
+ NotifyTasksChanged,
723
737
  ReportProgress,
724
738
  CreateProgress,
725
739
  PlaySignal,