@needle-tools/gltf-build-pipeline 2.1.0-alpha.1 → 2.1.0-alpha.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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/gltf-build-pipeline",
3
- "version": "2.1.0-alpha.1",
3
+ "version": "2.1.0-alpha.2",
4
4
  "description": "Pipeline and tools for optimizing gltf files using gltf-transform and compression settings within glTF extensions",
5
5
  "main": "index.mjs",
6
6
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  import { Logger } from "@donmccurdy/caporal";
2
- import { Document } from "@gltf-transform/core";
2
+ import { Document, Logger as _Logger } from "@gltf-transform/core";
3
3
  import { Config } from "../config/index.js";
4
4
  export type Stats = {
5
5
  startTime: number;
@@ -8,7 +8,7 @@ export type Stats = {
8
8
  totalFileSizeInMB: number;
9
9
  totalFileSizeInMBBefore: number;
10
10
  };
11
- export declare function printStats(stats: Stats, logger: Logger, config: Config): void;
11
+ export declare function printStats(stats: Stats, logger: Logger | _Logger, config: Config): void;
12
12
  export type FileStats = {
13
13
  filename: string;
14
14
  /** Size in bytes */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/gltf-build-pipeline",
3
- "version": "2.1.0-alpha.1",
3
+ "version": "2.1.0-alpha.2",
4
4
  "description": "Pipeline and tools for optimizing gltf files using gltf-transform and compression settings within glTF extensions",
5
5
  "main": "index.mjs",
6
6
  "type": "module",
@@ -1,6 +1,7 @@
1
1
  import commandLineArgs from "command-line-args";
2
2
  import { foreachGLTF } from './fileutils.mjs';
3
3
  import { getVersion, limitCacheSize, getConfig, packGLTF, printStats } from '../dist/src/index.js';
4
+ import { Logger, Verbosity } from "@gltf-transform/core";
4
5
 
5
6
  console.log(`[Needle Build Pipeline] pack glTF — version ${getVersion()}`)
6
7
 
@@ -85,6 +86,9 @@ async function packFile(file) {
85
86
 
86
87
  const inputArgs = args.slice(2);
87
88
  let failed = false;
89
+ const config = getConfig();
90
+ const logger = new Logger(Verbosity.INFO);
91
+
88
92
  foreachGLTF(inputArgs, async (file) => {
89
93
  const res = await packFile(file);
90
94
  if (!res) failed = true;
@@ -92,7 +96,7 @@ foreachGLTF(inputArgs, async (file) => {
92
96
  if (allowCaching) {
93
97
  limitCacheSize();
94
98
  }
95
- printStats(stats);
99
+ printStats(stats, logger, config);
96
100
  if (failed) {
97
101
  process.exit(1);
98
102
  }