gulp-mu-gulp-api 0.4.0 → 0.4.2

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 CHANGED
@@ -1,14 +1,14 @@
1
1
  # gulp-mu-gulp-api
2
2
 
3
3
  <p align="center">
4
- <a href="https://github.com/mamekudz/microGulp">
5
- <img src="https://raw.githubusercontent.com/mamekudz/microGulp/main/media/logo_readme.png" alt="µGulp logo" width="180">
4
+ <a href="https://microgulp.dev">
5
+ <img src="https://microgulp.dev/assets/media/logo_readme.png" alt="µGulp logo" width="180">
6
6
  </a>
7
7
  </p>
8
8
 
9
9
  <p align="center">
10
- <a href="https://github.com/mamekudz/microGulp">
11
- <img src="https://raw.githubusercontent.com/mamekudz/microGulp/main/media/microgulp-ready.png" alt="µGulp ready" width="150">
10
+ <a href="https://microgulp.dev">
11
+ <img src="https://microgulp.dev/assets/media/microgulp-ready.png" alt="µGulp ready" width="150">
12
12
  </a>
13
13
  </p>
14
14
 
@@ -17,7 +17,7 @@
17
17
 
18
18
  Public task API of the **µGulp™** orchestrator — progress reporting, i18x console output and interactive dashboard inputs from within gulp tasks.
19
19
 
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)
20
+ [![npm version](https://img.shields.io/npm/v/gulp-mu-gulp-api.svg)](https://www.npmjs.com/package/gulp-mu-gulp-api) · [µGulp™](https://microgulp.dev) · [Support](mailto:support@microgulp.dev)
21
21
 
22
22
  [English](#english) · [Deutsch](#deutsch)
23
23
 
@@ -37,6 +37,15 @@ 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.4.2
41
+
42
+ - **Updated** homepage, support and README images to the public site [microgulp.dev](https://microgulp.dev) and [support@microgulp.dev](mailto:support@microgulp.dev). The source repository is private.
43
+
44
+ ### 0.4.1
45
+
46
+ - **Fixed** a placeholder with an unknown named format rendered as an empty string instead of its value — gulp lifecycle lines lost their duration (`Finished 'task' after`). The raw value is kept when the format is missing.
47
+ - **Fixed** `SetLid()` kept the dictionary of the previous language cached, so a language switch inside a running worker could still translate with stale texts.
48
+
40
49
  ### 0.4.0
41
50
 
42
51
  - **Added** `GetParameters()` / `GetParameter(id, fallback)` — values for the inputs a task declared with `µParameters`. µGulp asks for them once before the task body runs and passes them in as `MICROGULP_PARAMS` (JSON) plus one flat `MICROGULP_PARAM_<ID>` per parameter.
@@ -212,7 +221,7 @@ DEPLOY.µParameters = [
212
221
  ];
213
222
  ```
214
223
 
215
- The declaration uses the same field types as `RequestForm` plus the `boolean` shorthand (a single checkbox). `id` must be env-var safe. Values arrive as `MICROGULP_PARAMS` (JSON) and `MICROGULP_PARAM_<ID>`, so shell steps in the task can read them as well — and running the gulpfile through the plain gulp CLI works by setting those variables yourself:
224
+ The declaration uses the same field types as `RequestForm` plus the `boolean` slide switch. `id` must be env-var safe. Values arrive as `MICROGULP_PARAMS` (JSON) and `MICROGULP_PARAM_<ID>`, so shell steps in the task can read them as well — and running the gulpfile through the plain gulp CLI works by setting those variables yourself:
216
225
 
217
226
  ```bash
218
227
  MICROGULP_PARAM_TARGET=staging npx gulp DEPLOY
@@ -337,7 +346,7 @@ $env:NPM_OTP="123456"; npm run publish:api
337
346
 
338
347
  **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.
339
348
 
340
- [![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)
349
+ [![npm version](https://img.shields.io/npm/v/gulp-mu-gulp-api.svg)](https://www.npmjs.com/package/gulp-mu-gulp-api) · [µGulp™](https://microgulp.dev) · [Support](mailto:support@microgulp.dev)
341
350
 
342
351
  Das Modul ist bewusst **abhängigkeitsfrei** und kennt keine µGulp™-Interna: Läuft der Task unter µGulp™, spricht es direkt über den IPC-Kanal des Worker-Prozesses mit der Engine. Läuft das Gulpfile klassisch über die gulp-CLI, degradieren alle Funktionen sauber — Fortschritt landet auf dem Terminal, Eingaben werden per readline abgefragt (TTY) oder mit den deklarierten Default-Werten beantwortet (CI/non-TTY). Tasks bleiben ohne µGulp™ voll lauffähig.
343
352
 
@@ -347,6 +356,15 @@ Das Modul ist bewusst **abhängigkeitsfrei** und kennt keine µGulp™-Interna:
347
356
  npm install gulp-mu-gulp-api
348
357
  ```
349
358
 
359
+ ### 0.4.2
360
+
361
+ - **Aktualisiert** Homepage, Support und README-Bilder auf die öffentliche Seite [microgulp.dev](https://microgulp.dev) und [support@microgulp.dev](mailto:support@microgulp.dev). Das Quellrepository ist privat.
362
+
363
+ ### 0.4.1
364
+
365
+ - **Behoben** Ein Platzhalter mit unbekanntem benanntem Format wurde als leerer Text gerendert statt mit seinem Wert — den Gulp-Lifecycle-Zeilen fehlte dadurch die Dauer (`Finished 'task' after`). Fehlt das Format, bleibt der Rohwert erhalten.
366
+ - **Behoben** `SetLid()` behielt das Wörterbuch der vorherigen Sprache im Cache; ein Sprachwechsel im laufenden Worker konnte weiter mit veralteten Texten übersetzen.
367
+
350
368
  ### 0.4.0
351
369
 
352
370
  - **Neu** `GetParameters()` / `GetParameter(id, fallback)` — Werte für die Eingaben, die ein Task per `µParameters` deklariert hat. µGulp fragt sie einmal vor dem Task-Rumpf ab und übergibt sie als `MICROGULP_PARAMS` (JSON) plus je Parameter ein flaches `MICROGULP_PARAM_<ID>`.
@@ -522,7 +540,7 @@ DEPLOY.µParameters = [
522
540
  ];
523
541
  ```
524
542
 
525
- Die Deklaration nutzt die Feldtypen von `RequestForm` plus die Kurzform `boolean` (eine einzelne Checkbox). `id` muss als Umgebungsvariablenname taugen. Die Werte kommen als `MICROGULP_PARAMS` (JSON) und `MICROGULP_PARAM_<ID>` an — auch Shell-Schritte im Task können sie lesen, und unter der reinen gulp-CLI setzt man sie einfach selbst:
543
+ Die Deklaration nutzt die Feldtypen von `RequestForm` plus die Kurzform `boolean` (Schiebeschalter). `id` muss als Umgebungsvariablenname taugen. Die Werte kommen als `MICROGULP_PARAMS` (JSON) und `MICROGULP_PARAM_<ID>` an — auch Shell-Schritte im Task können sie lesen, und unter der reinen gulp-CLI setzt man sie einfach selbst:
526
544
 
527
545
  ```bash
528
546
  MICROGULP_PARAM_TARGET=staging npx gulp DEPLOY
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gulp-mu-gulp-api",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Public task API for the µGulp orchestrator: progress reporting, declared task parameters, 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",
@@ -34,14 +34,11 @@
34
34
  "task-api"
35
35
  ],
36
36
  "license": "MIT",
37
- "repository": {
38
- "type": "git",
39
- "url": "git+https://github.com/mamekudz/microGulp.git",
40
- "directory": "gulp-mu-gulp-api"
41
- },
42
- "homepage": "https://github.com/mamekudz/microGulp/tree/main/gulp-mu-gulp-api#readme",
37
+ "author": "Meinolf Amekudzi <support@microgulp.dev>",
38
+ "homepage": "https://microgulp.dev",
43
39
  "bugs": {
44
- "url": "https://github.com/mamekudz/microGulp/issues"
40
+ "url": "https://microgulp.dev",
41
+ "email": "support@microgulp.dev"
45
42
  },
46
43
  "publishConfig": {
47
44
  "access": "public"
@@ -627,7 +627,10 @@ export function Trans(_text, _placeholders, _ctx) {
627
627
  let subContext = localFormats ? { ...ctx, formats: { ...(ctx.formats ?? {}), ...localFormats } } : ctx;
628
628
  value = FormatValue(Number(value) || 0, attrValue, subContext);
629
629
  } else {
630
- value = '';
630
+ // Missing named format must not swallow the placeholder (e.g.
631
+ // gulp lifecycle "after <duration format="progressDuration"/>"
632
+ // would otherwise render as "Finished 'task' after ").
633
+ value = value === undefined || value === null ? '' : String(value);
631
634
  }
632
635
  } else if (attrKey === 'enumeration') {
633
636
  let options = attrValue.split('|');
package/src/i18x.mjs CHANGED
@@ -195,8 +195,10 @@ export function GetLid() {
195
195
  */
196
196
  export function SetLid(_lid) {
197
197
  activeLid = _lid ? _BestAvailableLid(_lid, _AvailableLids()) : null;
198
+ dictionaryCache.clear();
198
199
  formatDefinitionCache.clear();
199
200
  formatRegistryCache.clear();
201
+ availableLids = null;
200
202
  }
201
203
 
202
204
  /** Loads and caches `<dir>/<lid>.json`; a missing/broken file yields source text. */
package/src/index.mjs CHANGED
@@ -386,9 +386,11 @@ export function Speak(_text, _options) {
386
386
  * { value, label?, checked?, disabled? }.
387
387
  *
388
388
  * Validation rules: { required?, minLength?, pattern?, minSelected? } —
389
- * checks run asynchronously in the webview before submission.
389
+ * checks run in the webview; required / minSelected also keep the submit
390
+ * button disabled until the form is valid. Multi-select `required` means
391
+ * at least one option.
390
392
  *
391
- * @param {object} _form { title, fields: [...] }
393
+ * @param {object} _form { title?, submitLabel?, fields: [...] }
392
394
  * @returns {Promise<object>} map fieldId -> value
393
395
  */
394
396
  export async function RequestForm(_form) {