gulp-mu-gulp-api 0.3.5 → 0.3.8

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
@@ -32,6 +32,25 @@ The module is deliberately **dependency-free** and knows nothing about µGulp™
32
32
  npm install gulp-mu-gulp-api
33
33
  ```
34
34
 
35
+ ### 0.3.8
36
+
37
+ - **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).
38
+ - Each new helper degrades to a readable stdout fallback when running outside µGulp (bracketed callout, aligned key/value lines, bracketed badges, verbatim code, ASCII bar chart).
39
+
40
+ ### 0.3.7
41
+
42
+ - **Added** engine date/time placeholders: `weekofyear`, `dayofyear`, `utcweekofyear`, `utcdayofyear`, `timezoneoffset`, `timezoneshort`, `timezoneplace`.
43
+ - **Added** `TimeZoneOffset()` — JavaScript-compatible offset in minutes (same sign as `Date.getTimezoneOffset()`).
44
+ - **Added** hyphenation API: `WordHyphenation()`, `Hyphenation()`, `LoadHyphenData()`, `InstallHyphenPrototypes()` with µLib (`WordHyphenation`/`Hyphenation`) and i18xe-sync (`wordHyphenation`/`hyphenation`) aliases; without `<lid>.hyphen.json` data the methods no-op.
45
+ - **Added** i18xe-sync lowercase format aliases: `Number.prototype.format()` / `.formatTimestamp()` / `.formatTicks()`, `Date.prototype.format()`.
46
+ - **Changed** `Translate(text, values?, timeZone?)` and `.i18xTrans(values?, timeZone?)` accept an optional IANA timezone override.
47
+
48
+ ### 0.3.6
49
+
50
+ - **Added** full eval-free i18x engine (`i18x-engine.mjs`): `FormatValue()`/`Translate()` now honor the complete i18x notation — `if`/`ifnot`/`ifin` conditions, nested formats, `expression="…"`, enumerations, digit fill/padding, date/time parts and roman numerals.
51
+ - **Added** µLib-compatible `Number.prototype.Format()`, `Number.prototype.FormatTimestamp()`, `Number.prototype.FormatTicks()`, `Date.prototype.Format()` and `String.prototype.Format()` (installed automatically on import; see `InstallFormatPrototypes()`).
52
+ - **Changed** `FormatValue(value, format, lid?, timeZone?)` gained the optional `timeZone` argument; date/time formats interpret the value as Unix milliseconds.
53
+
35
54
  ### 0.3.5
36
55
 
37
56
  - **Added** `PlaySound(sample, { loop? })` and `StopSound(sample)` — play named samples from the dashboard µAU sound atlas; `loop: true` repeats until `StopSound`.
@@ -113,9 +132,12 @@ let values = await RequestForm({
113
132
  | Function | Purpose |
114
133
  | :--- | :--- |
115
134
  | `IsMicroGulp()` / `IsµGulp()` | `true` when the task runs under µGulp™ with an attached dashboard |
116
- | `InstallStringExtensions()` | Installs µLib-compatible `String.prototype.i18xTrans()`/`i18xRegister()` (auto-run on import) |
135
+ | `InstallStringExtensions()` | Installs µLib-compatible `String.prototype.i18xTrans()`/`i18xRegister()` and the Format prototypes (auto-run on import) |
136
+ | `InstallFormatPrototypes()` | Installs `Number`/`Date`/`String.prototype.Format()` (auto-run on import) |
117
137
  | `Log(text, values?)` / `Warn` / `LogError` | Localized `console.*` via i18x (`<context="task log"/>` etc.) — preferred for task log output |
118
138
  | `Translate(text, values?)` | Low-level: returns the translated string without logging (rarely needed directly) |
139
+ | `FormatValue(value, format, lid?, timeZone?)` | Formats a number/date with a named i18x format (`int`, `floatFix2`, `byteSize`, `stdDateTime`, …) |
140
+ | `(1536).Format('byteSize')` | Prototype sugar for `FormatValue`; `.FormatTimestamp()`/`.FormatTicks()` on numbers, `.Format()` on dates |
119
141
  | `"phrase".i18xTrans(values?)` | Prototype sugar for `Translate` — same result, ergonomic in expressions |
120
142
  | `"phrase".i18xRegister()` | Registers metadata text (returns the source phrase unchanged as the i18x key) |
121
143
  | `GetLid()` / `SetLid(lid?)` | Active language id; `SetLid` clears to automatic when omitted |
@@ -198,19 +220,30 @@ MIT — © 2026 Meinolf Amekudzi
198
220
 
199
221
  ### Publishing (maintainers)
200
222
 
201
- From the µGulp repo root (requires `npm login` and 2FA OTP when enabled):
223
+ npm accounts with 2FA reject `npm publish` with `EOTP` when `~/.npmrc` holds a
224
+ web-login session token (`npm login --auth-type=web`). The reliable fix is a
225
+ **Granular Access Token** with **Bypass 2FA** and **write** access to this package:
226
+
227
+ 1. npmjs.com → Access Tokens → Generate → Granular
228
+ 2. Permissions: **Read and write**, Packages: `gulp-mu-gulp-api` (or All packages)
229
+ 3. Enable **Bypass 2FA**, copy the token, then:
202
230
 
203
231
  ```powershell
204
- # PowerShell
205
- $env:NPM_OTP="123456"
206
- npm run publish:api
232
+ npm config set //registry.npmjs.org/:_authToken <TOKEN>
207
233
  ```
208
234
 
209
- ```bash
210
- NPM_OTP=123456 npm run publish:api
235
+ After that, publish without any OTP:
236
+
237
+ ```powershell
238
+ npm run publish:api
211
239
  ```
212
240
 
213
- Bump `gulp-mu-gulp-api/package.json` before publishing. The task runs the module tests first.
241
+ Bump `gulp-mu-gulp-api/package.json` before publishing. The task runs the module
242
+ tests first. As a one-off, a 2FA code still works via `NPM_OTP`:
243
+
244
+ ```powershell
245
+ $env:NPM_OTP="123456"; npm run publish:api
246
+ ```
214
247
 
215
248
  ---
216
249
 
@@ -228,6 +261,25 @@ Das Modul ist bewusst **abhängigkeitsfrei** und kennt keine µGulp™-Interna:
228
261
  npm install gulp-mu-gulp-api
229
262
  ```
230
263
 
264
+ ### 0.3.8
265
+
266
+ - **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).
267
+ - Jeder neue Helfer fällt außerhalb von µGulp auf eine lesbare stdout-Ausgabe zurück (Callout in Klammern, ausgerichtete Key/Value-Zeilen, Badges in Klammern, Code wortgetreu, ASCII-Balkendiagramm).
268
+
269
+ ### 0.3.7
270
+
271
+ - **Neu** Engine-Datum/Zeit-Platzhalter: `weekofyear`, `dayofyear`, `utcweekofyear`, `utcdayofyear`, `timezoneoffset`, `timezoneshort`, `timezoneplace`.
272
+ - **Neu** `TimeZoneOffset()` — JavaScript-kompatibler Offset in Minuten (gleiches Vorzeichen wie `Date.getTimezoneOffset()`).
273
+ - **Neu** Silbentrennungs-API: `WordHyphenation()`, `Hyphenation()`, `LoadHyphenData()`, `InstallHyphenPrototypes()` mit µLib- (`WordHyphenation`/`Hyphenation`) und i18xe-sync-Aliasen (`wordHyphenation`/`hyphenation`); ohne `<lid>.hyphen.json`-Daten No-op.
274
+ - **Neu** i18xe-sync-Lowercase-Format-Aliase: `Number.prototype.format()` / `.formatTimestamp()` / `.formatTicks()`, `Date.prototype.format()`.
275
+ - **Geändert** `Translate(text, values?, timeZone?)` und `.i18xTrans(values?, timeZone?)` akzeptieren optional eine IANA-Zeitzone.
276
+
277
+ ### 0.3.6
278
+
279
+ - **Neu** vollständige eval-freie i18x-Engine (`i18x-engine.mjs`): `FormatValue()`/`Translate()` beherrschen jetzt die komplette i18x-Notation — `if`/`ifnot`/`ifin`-Bedingungen, verschachtelte Formate, `expression="…"`, Enumerationen, Ziffern-Fill/Padding, Datum/Zeit-Teile und römische Zahlen.
280
+ - **Neu** µLib-kompatible `Number.prototype.Format()`, `Number.prototype.FormatTimestamp()`, `Number.prototype.FormatTicks()`, `Date.prototype.Format()` und `String.prototype.Format()` (werden beim Import automatisch installiert; siehe `InstallFormatPrototypes()`).
281
+ - **Geändert** `FormatValue(value, format, lid?, timeZone?)` um das optionale `timeZone`-Argument erweitert; Datum/Zeit-Formate interpretieren den Wert als Unix-Millisekunden.
282
+
231
283
  ### 0.3.5
232
284
 
233
285
  - **Neu** `PlaySound(sample, { loop? })` und `StopSound(sample)` — benannte Samples aus dem Dashboard-µAU-Sound-Atlas; `loop: true` wiederholt bis `StopSound`.
@@ -309,7 +361,10 @@ let values = await RequestForm({
309
361
  | Funktion | Zweck |
310
362
  | :--- | :--- |
311
363
  | `IsMicroGulp()` / `IsµGulp()` | `true`, wenn der Task unter µGulp™ mit angebundenem Dashboard läuft |
312
- | `InstallStringExtensions()` | Installiert µLib-kompatible `String.prototype.i18xTrans()`/`i18xRegister()` (läuft beim Import automatisch) |
364
+ | `InstallStringExtensions()` | Installiert µLib-kompatible `String.prototype.i18xTrans()`/`i18xRegister()` und die Format-Prototypes (läuft beim Import automatisch) |
365
+ | `InstallFormatPrototypes()` | Installiert `Number`/`Date`/`String.prototype.Format()` (läuft beim Import automatisch) |
366
+ | `FormatValue(value, format, lid?, timeZone?)` | Formatiert Zahl/Datum mit einem benannten i18x-Format (`int`, `floatFix2`, `byteSize`, `stdDateTime`, …) |
367
+ | `(1536).Format('byteSize')` | Prototype-Kurzform für `FormatValue`; `.FormatTimestamp()`/`.FormatTicks()` an Zahlen, `.Format()` an Dates |
313
368
  | `Log(text, values?)` / `Warn` / `LogError` | Lokalisierte `console.*`-Ausgabe über i18x — bevorzugt für Task-Logs |
314
369
  | `Translate(text, values?)` | Low-Level: übersetzter String ohne Log (selten direkt nötig) |
315
370
  | `"phrase".i18xTrans(values?)` | Prototype-Kurzform für `Translate` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gulp-mu-gulp-api",
3
- "version": "0.3.5",
3
+ "version": "0.3.8",
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",