@needle-tools/gltf-build-pipeline 2.4.0-alpha.2 → 2.4.0-alpha.3
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 +3 -0
- package/dist/cli/index.js +8 -4
- package/dist/utils/fileutils.js +3 -0
- package/package.json +1 -1
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
|
+
## [2.4.0-alpha.3] - 2023-08-11
|
|
8
|
+
- fix: issue where files would not correctly be overriden in subdirectories when no output directory was specified
|
|
9
|
+
|
|
7
10
|
## [2.4.0-alpha.2] - 2023-06-29
|
|
8
11
|
- fix: prevent joining/flattening of progressive assets
|
|
9
12
|
|
package/dist/cli/index.js
CHANGED
|
@@ -91,15 +91,19 @@ Each version will be compressed and written to the output directory.
|
|
|
91
91
|
config.usecase = options.usecase.toString();
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
let output = args.output?.toString() || input;
|
|
95
94
|
const inputIsDirectory = isDirectory(input);
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
let output = args.output?.toString();
|
|
96
|
+
// If the input path is a filepath and no specific output is defined we set output to the input file
|
|
97
|
+
if (!inputIsDirectory && !output) {
|
|
98
|
+
output = input;
|
|
99
|
+
}
|
|
100
|
+
const outputIsDirectory = output && isDirectory(output);
|
|
101
|
+
if (inputIsDirectory && output && !outputIsDirectory) {
|
|
98
102
|
logger.error("When <input> is a directory then <output> must also be a directory");
|
|
99
103
|
process.exit(ERROR_CODES.INVALID_ARGS);
|
|
100
104
|
}
|
|
101
105
|
// Handle the output bath being relative to the input path
|
|
102
|
-
if (path.isAbsolute(output) === false) {
|
|
106
|
+
if (output && path.isAbsolute(output) === false) {
|
|
103
107
|
const base = ensureIsDirectory(input);
|
|
104
108
|
output = resolve(base, output);
|
|
105
109
|
}
|
package/dist/utils/fileutils.js
CHANGED
|
@@ -153,6 +153,9 @@ export function replaceExtension(filepath, newExtension) {
|
|
|
153
153
|
return parts.join(".") + "." + newExtension;
|
|
154
154
|
}
|
|
155
155
|
export function isDirectory(path) {
|
|
156
|
+
if (!path) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
156
159
|
if (existsSync(path)) {
|
|
157
160
|
return statSync(path).isDirectory();
|
|
158
161
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/gltf-build-pipeline",
|
|
3
|
-
"version": "2.4.0-alpha.
|
|
3
|
+
"version": "2.4.0-alpha.3",
|
|
4
4
|
"description": "Pipeline and tools for optimizing gltf files using gltf-transform and compression settings within glTF extensions",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|