@needle-tools/gltf-build-pipeline 1.6.0-alpha.5 → 1.6.0-alpha.6

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/CHANGELOG.md CHANGED
@@ -4,6 +4,9 @@ All notable changes to this package will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.6.0-alpha.6] - 2023-05-30
8
+ - fix: npx cli command return wrong error due to `packGLTF` not returning a booelan
9
+
7
10
  ## [1.6.0-alpha.5] - 2023-05-28
8
11
  - fix: determine build pipeline version
9
12
  - change: throw error and exit process if packing or transform fails
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/gltf-build-pipeline",
3
- "version": "1.6.0-alpha.5",
3
+ "version": "1.6.0-alpha.6",
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",
@@ -51,7 +51,8 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "^18.7.23",
54
- "npm-watch": "^0.11.0",
54
+ "nodemon": "^3.1.2",
55
+ "npm-watch": "^0.13.0",
55
56
  "typescript": "^4.9.5"
56
57
  },
57
58
  "author": {
@@ -87,7 +87,7 @@ Compress a single glTF file. The input file is compressed and written to the out
87
87
  logger: logger,
88
88
  file_stats: file_stats,
89
89
  });
90
- if (!res) {
90
+ if (res === false) {
91
91
  process.exit(ERROR_CODES.PACKING_FAILED);
92
92
  }
93
93
  });
@@ -155,12 +155,12 @@ Each version will be compressed and written to the output directory.
155
155
  };
156
156
  for (const res of progressive_results) {
157
157
  logger.info("> Compress " + res);
158
- if (!await packGLTF(res, res, opts)) {
158
+ if (await packGLTF(res, res, opts) === false) {
159
159
  process.exit(ERROR_CODES.PACKING_FAILED);
160
160
  }
161
161
  }
162
162
  logger.info("> Compress " + file);
163
- if (!await packGLTF(file, file, opts)) {
163
+ if (await packGLTF(file, file, opts) === false) {
164
164
  process.exit(ERROR_CODES.PACKING_FAILED);
165
165
  }
166
166
  });
@@ -22,7 +22,7 @@ export async function packGLTF(inputFile, outputFile, options) {
22
22
  return;
23
23
  }
24
24
  if (debug && inputFile.includes(".debug.")) {
25
- return;
25
+ return true;
26
26
  }
27
27
  // check if it's in the cache.
28
28
  // We only need to check mesh LOD files because image LODs are cache via our toktx transform
@@ -36,12 +36,12 @@ export async function packGLTF(inputFile, outputFile, options) {
36
36
  if (cached) {
37
37
  logger.info(`→ Loaded compressed file from cache: \"${path.basename(inputFile)}\"`);
38
38
  writeFileSync(inputFile, cached);
39
- return;
39
+ return true;
40
40
  }
41
41
  }
42
42
  if (packedFiles) {
43
43
  if (packedFiles.has(inputFile))
44
- return;
44
+ return true;
45
45
  packedFiles.add(inputFile);
46
46
  }
47
47
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/gltf-build-pipeline",
3
- "version": "1.6.0-alpha.5",
3
+ "version": "1.6.0-alpha.6",
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",
@@ -51,7 +51,8 @@
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "^18.7.23",
54
- "npm-watch": "^0.11.0",
54
+ "nodemon": "^3.1.2",
55
+ "npm-watch": "^0.13.0",
55
56
  "typescript": "^4.9.5"
56
57
  },
57
58
  "author": {
@@ -63,4 +64,4 @@
63
64
  "type": "git",
64
65
  "url": "git+https://github.com/needle-tools/needle-gltf-extensions.git"
65
66
  }
66
- }
67
+ }