gulp-mu-gulp-api 0.3.10 → 0.3.12
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/README.md +76 -2
- package/package.json +1 -1
- package/src/index.mjs +895 -771
package/README.md
CHANGED
|
@@ -37,6 +37,19 @@ The module is deliberately **dependency-free** and knows nothing about µGulp™
|
|
|
37
37
|
npm install gulp-mu-gulp-api
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
+
### 0.3.12
|
|
41
|
+
|
|
42
|
+
- **Added** `RegisterDashboardFont({ id, file, family?, usage? })` — registers a workspace font for µGulp dashboard **task icons** and/or **run-log** typography. `usage`: `'task-icons'` (default), `'log'`, or `'all'`. Call at gulpfile load time; the scan worker forwards the registry to the engine.
|
|
43
|
+
- **Added** `GetRegisteredDashboardFonts()` / `ClearRegisteredDashboardFonts()` — snapshot / test helpers.
|
|
44
|
+
- Pair with gulpfile metadata `µIcon` (glyph) and optional `µIconFont = '<id>'`, or declarative `export const µDashboardFonts = […]`. Config/setting `dashboardFonts` is an alternative when not using the API.
|
|
45
|
+
- Outside µGulp the helpers are no-ops (fonts are a dashboard/host concern).
|
|
46
|
+
|
|
47
|
+
### 0.3.11
|
|
48
|
+
|
|
49
|
+
- **Added** `ShowModalMessage({ variant?, title?, message?, buttons?, presentation? })` — blocking modal (info/warning/error) in the µGulp dashboard glass panel, or native VS Code/Cursor dialogs when `presentation` is `ide`/`auto` (host setting `microgulp.modalPresentation`).
|
|
50
|
+
- **Added** `ShowConfirmMessage({ title?, message?, variant?, style?, presentation? })` — Yes/No or OK/Cancel confirmation; resolves with `{ button: 'yes'|'no'|'ok'|'cancel'|… }`.
|
|
51
|
+
- Outside µGulp both helpers fall back to readline prompts (TTY) or the primary/default button (CI).
|
|
52
|
+
|
|
40
53
|
### 0.3.10
|
|
41
54
|
|
|
42
55
|
- **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`.
|
|
@@ -83,7 +96,7 @@ npm install gulp-mu-gulp-api
|
|
|
83
96
|
## Usage
|
|
84
97
|
|
|
85
98
|
```javascript
|
|
86
|
-
import { ReportProgress, CreateProgress, PlaySignal, PlaySound, StopSound, Speak, RequestTextInput, RequestColorInput, RequestFontInput, RequestSelectInput, RequestMultiSelectInput, RequestForm, IsMicroGulp, IsµGulp, InstallStringExtensions } from 'gulp-mu-gulp-api';
|
|
99
|
+
import { ReportProgress, CreateProgress, PlaySignal, PlaySound, StopSound, Speak, RequestTextInput, RequestColorInput, RequestFontInput, RequestSelectInput, RequestMultiSelectInput, RequestForm, RegisterDashboardFont, IsMicroGulp, IsµGulp, InstallStringExtensions } from 'gulp-mu-gulp-api';
|
|
87
100
|
|
|
88
101
|
// Enables "phrase<context=\"…\"/>".i18xRegister()/.i18xTrans() on strings.
|
|
89
102
|
InstallStringExtensions();
|
|
@@ -155,8 +168,13 @@ let values = await RequestForm({
|
|
|
155
168
|
| `PlaySignal(signal?)` | Preset acoustic signal: `'success'` \| `'error'` \| `'attention'` (default) |
|
|
156
169
|
| `PlaySound(sample, options?)` | Named sample from the dashboard sound atlas; `options.loop` repeats until `StopSound` |
|
|
157
170
|
| `StopSound(sample)` | Stops a looping sample started with `PlaySound(sample, { loop: true })` |
|
|
171
|
+
| `RegisterDashboardFont(spec)` | Registers a workspace font for dashboard task icons / run-log (`id`, `file`, optional `family` / `usage`: `task-icons`\|`log`\|`all`) |
|
|
172
|
+
| `GetRegisteredDashboardFonts()` | Snapshot of fonts registered in this process (scan worker / tests) |
|
|
173
|
+
| `ClearRegisteredDashboardFonts()` | Clears the in-process registry (tests) |
|
|
158
174
|
| `Speak(text, options?)` | Speech output in the dashboard; `options`: `{ rate?, pitch?, volume? }` per-call overrides |
|
|
159
175
|
| `RequestForm(form)` | Request a complete form; resolves with `{ fieldId: value, … }` |
|
|
176
|
+
| `ShowModalMessage(spec)` | Blocking modal (`info`/`warning`/`error`); `presentation`: `webview` \| `ide` \| `auto` |
|
|
177
|
+
| `ShowConfirmMessage(spec)` | Yes/No or OK/Cancel (`style`); resolves with `{ button }` |
|
|
160
178
|
| `RequestTextInput(options)` | Single text field (with `validate` rules) |
|
|
161
179
|
| `RequestColorInput(options)` | Color picker, returns `#rrggbb` |
|
|
162
180
|
| `RequestFontInput(options)` | Font selection (`options`: font list) |
|
|
@@ -186,6 +204,25 @@ MAKE_BUILDS.µDisplayName = 'Make Build V<version/><context="µDisplayName"/>'.i
|
|
|
186
204
|
// => "Make Build V1.13" in the dashboard (translatable per language)
|
|
187
205
|
```
|
|
188
206
|
|
|
207
|
+
### Dashboard fonts (task icons & run log)
|
|
208
|
+
|
|
209
|
+
Project fonts are independent of the dashboard skin. Register them at gulpfile load time:
|
|
210
|
+
|
|
211
|
+
```javascript
|
|
212
|
+
import { RegisterDashboardFont } from 'gulp-mu-gulp-api';
|
|
213
|
+
|
|
214
|
+
RegisterDashboardFont({
|
|
215
|
+
id: 'ProjectIcons',
|
|
216
|
+
file: 'assets/task-icons.woff2', // relative to the gulpfile directory
|
|
217
|
+
usage: 'task-icons', // or 'log' / 'all'
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
BUILD.µIcon = '\uE101';
|
|
221
|
+
BUILD.µIconFont = 'ProjectIcons'; // optional when only one task-icons font is registered
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Alternatively export `µDashboardFonts` from the gulpfile, or set `dashboardFonts` in `microgulp.config.json` / the `microgulp.dashboardFonts` extension setting. Files must stay under the workspace (`woff2` / `woff` / `ttf` / `otf`). The first `task-icons` font becomes the default for glyph `µIcon` entries; `usage: 'log'` restyles the run-sector log.
|
|
225
|
+
|
|
189
226
|
### Field types (for `RequestForm`)
|
|
190
227
|
|
|
191
228
|
A field descriptor is `{ id, type, label, default?, options?, validate?, min?, max?, step?, rows?, placeholder? }`.
|
|
@@ -273,6 +310,19 @@ Das Modul ist bewusst **abhängigkeitsfrei** und kennt keine µGulp™-Interna:
|
|
|
273
310
|
npm install gulp-mu-gulp-api
|
|
274
311
|
```
|
|
275
312
|
|
|
313
|
+
### 0.3.12
|
|
314
|
+
|
|
315
|
+
- **Neu** `RegisterDashboardFont({ id, file, family?, usage? })` — registriert einen Workspace-Font für **Task-Icons** und/oder die **Run-Log**-Typografie im µGulp-Dashboard. `usage`: `'task-icons'` (Default), `'log'` oder `'all'`. Aufruf beim Laden des Gulpfiles; der Scan-Worker reicht die Registry an die Engine weiter.
|
|
316
|
+
- **Neu** `GetRegisteredDashboardFonts()` / `ClearRegisteredDashboardFonts()` — Snapshot- bzw. Test-Helfer.
|
|
317
|
+
- Zusammen mit Metadaten `µIcon` (Glyph) und optional `µIconFont = '<id>'`, oder deklarativ `export const µDashboardFonts = […]`. Alternative: `dashboardFonts` in Config/Setting.
|
|
318
|
+
- Außerhalb von µGulp sind die Helfer No-ops (Fonts sind Sache von Dashboard/Host).
|
|
319
|
+
|
|
320
|
+
### 0.3.11
|
|
321
|
+
|
|
322
|
+
- **Neu** `ShowModalMessage({ variant?, title?, message?, buttons?, presentation? })` — blockierendes Modal (info/warning/error) als Dashboard-Glaspanel oder natives VS-Code-/Cursor-Dialogfenster bei `presentation` `ide`/`auto` (Host-Setting `microgulp.modalPresentation`).
|
|
323
|
+
- **Neu** `ShowConfirmMessage({ title?, message?, variant?, style?, presentation? })` — Ja/Nein- oder OK/Abbrechen-Bestätigung; Ergebnis `{ button: 'yes'|'no'|'ok'|'cancel'|… }`.
|
|
324
|
+
- Außerhalb von µGulp Fallback auf readline (TTY) oder den Primary-/Default-Button (CI).
|
|
325
|
+
|
|
276
326
|
### 0.3.10
|
|
277
327
|
|
|
278
328
|
- **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`.
|
|
@@ -319,7 +369,7 @@ npm install gulp-mu-gulp-api
|
|
|
319
369
|
## Verwendung
|
|
320
370
|
|
|
321
371
|
```javascript
|
|
322
|
-
import { ReportProgress, CreateProgress, PlaySignal, PlaySound, StopSound, Speak, RequestTextInput, RequestColorInput, RequestFontInput, RequestSelectInput, RequestMultiSelectInput, RequestForm, IsMicroGulp, IsµGulp, InstallStringExtensions } from 'gulp-mu-gulp-api';
|
|
372
|
+
import { ReportProgress, CreateProgress, PlaySignal, PlaySound, StopSound, Speak, RequestTextInput, RequestColorInput, RequestFontInput, RequestSelectInput, RequestMultiSelectInput, RequestForm, RegisterDashboardFont, IsMicroGulp, IsµGulp, InstallStringExtensions } from 'gulp-mu-gulp-api';
|
|
323
373
|
|
|
324
374
|
// Enables "phrase<context=\"…\"/>".i18xRegister()/.i18xTrans() on strings.
|
|
325
375
|
InstallStringExtensions();
|
|
@@ -391,8 +441,13 @@ let values = await RequestForm({
|
|
|
391
441
|
| `PlaySignal(signal?)` | Vorgabe-Signal: `'success'` \| `'error'` \| `'attention'` (Default) |
|
|
392
442
|
| `PlaySound(sample, options?)` | Benanntes Sample aus dem Sound-Atlas; `options.loop` wiederholt bis `StopSound` |
|
|
393
443
|
| `StopSound(sample)` | Stoppt eine Schleife von `PlaySound(sample, { loop: true })` |
|
|
444
|
+
| `RegisterDashboardFont(spec)` | Registriert einen Workspace-Font für Dashboard-Task-Icons / Run-Log (`id`, `file`, optional `family` / `usage`: `task-icons`\|`log`\|`all`) |
|
|
445
|
+
| `GetRegisteredDashboardFonts()` | Snapshot der in diesem Prozess registrierten Fonts (Scan-Worker / Tests) |
|
|
446
|
+
| `ClearRegisteredDashboardFonts()` | Leert die In-Process-Registry (Tests) |
|
|
394
447
|
| `Speak(text, options?)` | Sprachausgabe im Dashboard; `options`: `{ rate?, pitch?, volume? }` je Aufruf |
|
|
395
448
|
| `RequestForm(form)` | Komplettes Formular anfordern; löst mit `{ fieldId: value, … }` auf |
|
|
449
|
+
| `ShowModalMessage(spec)` | Blockierendes Modal (`info`/`warning`/`error`); `presentation`: `webview` \| `ide` \| `auto` |
|
|
450
|
+
| `ShowConfirmMessage(spec)` | Ja/Nein oder OK/Abbrechen (`style`); löst mit `{ button }` auf |
|
|
396
451
|
| `RequestTextInput(options)` | Einzelnes Textfeld (mit `validate`-Regeln) |
|
|
397
452
|
| `RequestColorInput(options)` | Farbwähler, Rückgabe `#rrggbb` |
|
|
398
453
|
| `RequestFontInput(options)` | Schriftart-Auswahl (`options`: Font-Liste) |
|
|
@@ -422,6 +477,25 @@ MAKE_BUILDS.µDisplayName = 'Make Build V<version/><context="µDisplayName"/>'.i
|
|
|
422
477
|
// => „Make Build V1.13“ im Dashboard (pro Sprache übersetzbar)
|
|
423
478
|
```
|
|
424
479
|
|
|
480
|
+
### Dashboard-Fonts (Task-Icons & Run-Log)
|
|
481
|
+
|
|
482
|
+
Projekt-Fonts sind unabhängig vom Dashboard-Skin. Beim Laden des Gulpfiles registrieren:
|
|
483
|
+
|
|
484
|
+
```javascript
|
|
485
|
+
import { RegisterDashboardFont } from 'gulp-mu-gulp-api';
|
|
486
|
+
|
|
487
|
+
RegisterDashboardFont({
|
|
488
|
+
id: 'ProjectIcons',
|
|
489
|
+
file: 'assets/task-icons.woff2', // relativ zum Gulpfile-Ordner
|
|
490
|
+
usage: 'task-icons', // oder 'log' / 'all'
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
BUILD.µIcon = '\uE101';
|
|
494
|
+
BUILD.µIconFont = 'ProjectIcons'; // optional, wenn nur ein task-icons-Font registriert ist
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
Alternativ `µDashboardFonts` aus dem Gulpfile exportieren oder `dashboardFonts` in `microgulp.config.json` / Setting `microgulp.dashboardFonts`. Dateien müssen unter dem Workspace liegen (`woff2` / `woff` / `ttf` / `otf`). Der erste `task-icons`-Font ist Default für Glyph-`µIcon`; `usage: 'log'` setzt die Run-Log-Schrift.
|
|
498
|
+
|
|
425
499
|
### Feldtypen (für `RequestForm`)
|
|
426
500
|
|
|
427
501
|
Ein Feld-Deskriptor ist `{ id, type, label, default?, options?, validate?, min?, max?, step?, rows?, placeholder? }`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gulp-mu-gulp-api",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
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",
|