@playcanvas/splat-transform 2.0.0 → 2.0.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/dist/index.mjs CHANGED
@@ -167,37 +167,19 @@ class LoggerCore {
167
167
  return verbosityRank[this.verbosity] >= verbosityRank[messageMinVerbosity[level]];
168
168
  }
169
169
  /**
170
- * Gate events by the current verbosity, then hand survivors to the
171
- * renderer. Renderers see only visible events and never need to know
172
- * about verbosity themselves.
170
+ * Hand the event to the renderer. Lifecycle events (`scopeStart`,
171
+ * `scopeEnd`, `barStart`, `barTick`, `barEnd`) and `output` are always
172
+ * forwarded; presentation policy (e.g. hiding successful `scopeEnd`
173
+ * footers at non-`verbose` verbosity) lives in the renderer so
174
+ * embedders consuming the event stream see a complete, faithful
175
+ * record of scope and bar lifecycles. `message` is assumed already
176
+ * gated at the façade via {@link LoggerCore.isLevelVisible} (so
177
+ * callers can skip formatting args for filtered levels); anything
178
+ * that reaches here is passed through.
173
179
  *
174
- * - `output` is always shown (it's the pipeable channel).
175
- * - `message` is assumed already gated at the façade via
176
- * {@link LoggerCore.isLevelVisible} (so callers can skip formatting
177
- * args for filtered levels); anything that reaches here is passed
178
- * through.
179
- * - `scopeEnd` footers are noisy on the success path, so success-ends
180
- * are gated one rank higher than their matching start: visible only
181
- * at `verbose`, while `scopeStart` shows at `normal`. Failed ends
182
- * stay at the `normal` gate so the "failed in Xs" cascade from
183
- * `logger.error` / `unwindAll(true)` survives whenever scope
184
- * output is visible at all.
185
- * - All other scope/bar events (`scopeStart`, `barStart`, `barTick`,
186
- * `barEnd`) are gated at `normal`.
187
- *
188
- * @param event - The candidate event.
180
+ * @param event - The event to deliver.
189
181
  */
190
182
  emit(event) {
191
- if (event.kind !== 'output' && event.kind !== 'message') {
192
- const rank = verbosityRank[this.verbosity];
193
- if (event.kind === 'scopeEnd' && !event.failed) {
194
- if (rank < verbosityRank.verbose)
195
- return;
196
- }
197
- else if (rank < verbosityRank.normal) {
198
- return;
199
- }
200
- }
201
183
  this.renderer.handle(event);
202
184
  }
203
185
  /**
@@ -474,7 +456,10 @@ const logger = {
474
456
  },
475
457
  /**
476
458
  * Replace the active renderer. Embedders install their own renderer here
477
- * to consume `LogEvent`s; the default renderer is a no-op.
459
+ * to consume `LogEvent`s; the default renderer is a no-op. Renderers
460
+ * receive every scope/bar lifecycle event regardless of verbosity, so
461
+ * progress UIs can rely on `scopeStart`/`scopeEnd` and `barStart`/`barEnd`
462
+ * to manage their state.
478
463
  * @param r - The renderer to install.
479
464
  */
480
465
  setRenderer(r) {
@@ -983,20 +968,27 @@ const indent = (depth) => ' '.repeat(Math.max(0, depth));
983
968
  const BAR_WIDTH = 20;
984
969
  /**
985
970
  * Default human-readable text renderer. Emits one event per line - no
986
- * carriage-return rewriting, no TTY detection, no buffering. Scope starts
987
- * always emit a header line; successful `scopeEnd` footers are filtered
988
- * out at `normal` verbosity by `LoggerCore` (kept at `verbose`, and always
989
- * shown when `failed`), so default-mode runs see headers without timing
990
- * footers and `--verbose` adds the matching `done in ...` lines. Bars
991
- * render as `[#### ...... ] duration`, with `#` appended incrementally on
992
- * each `barTick` and the remainder padded with `.` on `barEnd`. `output`
971
+ * carriage-return rewriting, no TTY detection, no buffering. Bars render
972
+ * as `[#### ...... ] duration`, with `#` appended incrementally on each
973
+ * `barTick` and the remainder padded with `.` on `barEnd`. `output`
993
974
  * events are treated as line-oriented: their text is written to the
994
975
  * pipeable sink with a trailing `\n` appended (callers should not include
995
976
  * one themselves).
996
977
  *
997
- * Verbosity filtering is handled centrally by `LoggerCore` - this renderer
998
- * receives only events that have already passed the visibility gate, so it
999
- * is pure presentation.
978
+ * Verbosity is consulted directly from the shared {@link logger} on each
979
+ * event, so this renderer alone decides what to display - the core
980
+ * delivers every scope/bar lifecycle event so embedders consuming the
981
+ * event stream see a faithful record. The display rules are:
982
+ *
983
+ * - `quiet` - suppresses every scope/bar lifecycle line (start, tick,
984
+ * end - including failed ends). Errors, warnings and `output` still
985
+ * show.
986
+ * - `normal` (default) - shows scope/bar headers and bar progress;
987
+ * shows failed `scopeEnd` / `barEnd` footers (the "failed in ..."
988
+ * cascade from `logger.error` / `unwindAll(true)`); hides successful
989
+ * `scopeEnd` footers.
990
+ * - `verbose` - shows everything, including successful `scopeEnd`
991
+ * footers ("done in ...").
1000
992
  *
1001
993
  * Sinks are injected (no `process` reference here) so the renderer works in
1002
994
  * both Node CLI and browser/bundle contexts: the CLI passes
@@ -1019,9 +1011,14 @@ class TextRenderer {
1019
1011
  this.output = options.output ?? options.write;
1020
1012
  this.getMemoryUsage = options.getMemoryUsage;
1021
1013
  }
1014
+ rank() {
1015
+ return verbosityRank[logger.getVerbosity()];
1016
+ }
1022
1017
  handle(event) {
1023
1018
  switch (event.kind) {
1024
1019
  case 'scopeStart': {
1020
+ if (this.rank() < verbosityRank.normal)
1021
+ return;
1025
1022
  this.commitDirty();
1026
1023
  const numbered = event.index !== undefined && event.total !== undefined ?
1027
1024
  `[${event.index}/${event.total}] ` : '';
@@ -1029,12 +1026,22 @@ class TextRenderer {
1029
1026
  return;
1030
1027
  }
1031
1028
  case 'scopeEnd': {
1029
+ const rank = this.rank();
1030
+ if (event.failed) {
1031
+ if (rank < verbosityRank.normal)
1032
+ return;
1033
+ }
1034
+ else if (rank < verbosityRank.verbose) {
1035
+ return;
1036
+ }
1032
1037
  this.commitDirty();
1033
1038
  const verb = event.failed ? 'failed in' : 'done in';
1034
1039
  this.write(`${indent(event.depth + 1)}${verb} ${fmtTime(event.durationMs)}${this.memSuffix()}\n`);
1035
1040
  return;
1036
1041
  }
1037
1042
  case 'barStart': {
1043
+ if (this.rank() < verbosityRank.normal)
1044
+ return;
1038
1045
  this.commitDirty();
1039
1046
  this.write(`${indent(event.depth)}\u25b8 ${event.name} [`);
1040
1047
  this.lineDirty = true;
@@ -1044,6 +1051,8 @@ class TextRenderer {
1044
1051
  case 'barTick': {
1045
1052
  if (!this.lineDirty)
1046
1053
  return;
1054
+ if (this.rank() < verbosityRank.normal)
1055
+ return;
1047
1056
  const target = event.total <= 0 ? 0 :
1048
1057
  Math.min(BAR_WIDTH, Math.floor((event.current / event.total) * BAR_WIDTH));
1049
1058
  if (target > this.barFilled) {
@@ -1053,6 +1062,8 @@ class TextRenderer {
1053
1062
  return;
1054
1063
  }
1055
1064
  case 'barEnd': {
1065
+ if (this.rank() < verbosityRank.normal)
1066
+ return;
1056
1067
  const suffix = event.failed ?
1057
1068
  `] (failed) ${fmtTime(event.durationMs)}` :
1058
1069
  `] ${fmtTime(event.durationMs)}`;
@@ -6245,7 +6256,14 @@ class CompressedChunk {
6245
6256
  }
6246
6257
  }
6247
6258
 
6248
- var version = "2.0.0";
6259
+ /**
6260
+ * The splat-transform version (semver MAJOR.MINOR.PATCH).
6261
+ */
6262
+ const version = '2.0.1';
6263
+ /**
6264
+ * The splat-transform revision (short Git hash of HEAD at build time).
6265
+ */
6266
+ const revision = '129f87d';
6249
6267
 
6250
6268
  const generatedByString = `Generated by splat-transform ${version}`;
6251
6269
  const chunkProps = [
@@ -14256,5 +14274,5 @@ const processDataTable = async (dataTable, processActions, options) => {
14256
14274
  return result;
14257
14275
  };
14258
14276
 
14259
- export { BufferedReadStream, Column, DataTable, MemoryFileSystem, MemoryReadFileSystem, ReadStream, TextRenderer, Transform, UrlReadFileSystem, WebPCodec, ZipFileSystem, ZipReadFileSystem, carve, combine, computeSummary, convertToSpace, fillExterior, fillFloor, filterCluster, filterFloaters, findClusterVoxelFlood, fmtBytes, fmtCount, fmtDistance, fmtTime, getInputFormat, getOutputFormat, getSHBands, logger, processDataTable, readFile, readKsplat, readLcc, readMjs, readPly, readSog, readSplat, readSpz, simplifyGaussians, sortByVisibility, sortMortonOrder, voxelizeToBuffer, writeCompressedPly, writeCsv, writeFile, writeGlb, writeHtml, writeLod, writePly, writeSog, writeVoxel };
14277
+ export { BufferedReadStream, Column, DataTable, MemoryFileSystem, MemoryReadFileSystem, ReadStream, TextRenderer, Transform, UrlReadFileSystem, WebPCodec, ZipFileSystem, ZipReadFileSystem, carve, combine, computeSummary, convertToSpace, fillExterior, fillFloor, filterCluster, filterFloaters, findClusterVoxelFlood, fmtBytes, fmtCount, fmtDistance, fmtTime, getInputFormat, getOutputFormat, getSHBands, logger, processDataTable, readFile, readKsplat, readLcc, readMjs, readPly, readSog, readSplat, readSpz, revision, simplifyGaussians, sortByVisibility, sortMortonOrder, version, voxelizeToBuffer, writeCompressedPly, writeCsv, writeFile, writeGlb, writeHtml, writeLod, writePly, writeSog, writeVoxel };
14260
14278
  //# sourceMappingURL=index.mjs.map