babylonjs-editor-cli 5.0.1 → 5.3.0
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/build/index.node.js +100 -18
- package/build/package.json +4 -2
- package/build/src/export.mjs +3 -0
- package/build/src/export.mjs.map +1 -1
- package/build/src/index.mjs +10 -0
- package/build/src/index.mjs.map +1 -1
- package/build/src/pack/assets/assets.mjs +11 -2
- package/build/src/pack/assets/assets.mjs.map +1 -1
- package/build/src/pack/assets/ktx.mjs +4 -4
- package/build/src/pack/assets/ktx.mjs.map +1 -1
- package/build/src/pack/assets/particle-system.mjs +2 -2
- package/build/src/pack/assets/particle-system.mjs.map +1 -1
- package/build/src/pack/assets/process.mjs +5 -2
- package/build/src/pack/assets/process.mjs.map +1 -1
- package/build/src/pack/assets/texture.mjs +6 -5
- package/build/src/pack/assets/texture.mjs.map +1 -1
- package/build/src/pack/geometry.mjs +1 -1
- package/build/src/pack/geometry.mjs.map +1 -1
- package/build/src/pack/pack.mjs +52 -17
- package/build/src/pack/pack.mjs.map +1 -1
- package/build/src/pack/scene.mjs +167 -61
- package/build/src/pack/scene.mjs.map +1 -1
- package/build/src/pack/scripts.mjs +115 -0
- package/build/src/pack/scripts.mjs.map +1 -0
- package/build/src/s3/s3.mjs +141 -0
- package/build/src/s3/s3.mjs.map +1 -0
- package/build/src/tools/cancel.mjs +10 -0
- package/build/src/tools/cancel.mjs.map +1 -0
- package/build/src/tools/fs.mjs +21 -0
- package/build/src/tools/fs.mjs.map +1 -1
- package/build/src/tools/ktx.mjs +1 -1
- package/build/src/tools/ktx.mjs.map +1 -1
- package/build/src/tools/worker.mjs +7 -3
- package/build/src/tools/worker.mjs.map +1 -1
- package/declaration/src/export.d.mts +4 -1
- package/declaration/src/pack/assets/assets.d.mts +2 -1
- package/declaration/src/pack/assets/ktx.d.mts +1 -0
- package/declaration/src/pack/assets/texture.d.mts +2 -1
- package/declaration/src/pack/pack.d.mts +9 -0
- package/declaration/src/pack/scripts.d.mts +1 -0
- package/declaration/src/s3/s3.d.mts +11 -0
- package/declaration/src/tools/cancel.d.mts +5 -0
- package/declaration/src/tools/fs.d.mts +7 -0
- package/declaration/src/tools/worker.d.mts +3 -2
- package/package.json +4 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.mjs","sourceRoot":"","sources":["../../../src/tools/cancel.mts"],"names":[],"mappings":"AAAA,MAAM,OAAO,iBAAiB;IACrB,WAAW,GAAY,KAAK,CAAC;IAE9B,MAAM;QACZ,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IACzB,CAAC;IAED,IAAW,UAAU;QACpB,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;CACD"}
|
package/build/src/tools/fs.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import fs from "fs-extra";
|
|
1
3
|
import { glob } from "glob";
|
|
2
4
|
export async function normalizedGlob(...args) {
|
|
3
5
|
const result = await glob(...args);
|
|
@@ -6,4 +8,23 @@ export async function normalizedGlob(...args) {
|
|
|
6
8
|
});
|
|
7
9
|
return result;
|
|
8
10
|
}
|
|
11
|
+
export function getProjectDir(projectDir) {
|
|
12
|
+
const cwd = process.cwd();
|
|
13
|
+
if (projectDir !== cwd) {
|
|
14
|
+
projectDir = resolve(cwd, projectDir);
|
|
15
|
+
}
|
|
16
|
+
projectDir = projectDir.replace(/\\/g, "/");
|
|
17
|
+
return projectDir;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Tries to read a directory and returns its content if the directory exists.
|
|
21
|
+
* If not, returns an empty array.
|
|
22
|
+
* @param path defines the absolute path to read directory.
|
|
23
|
+
*/
|
|
24
|
+
export async function tryReadDir(path) {
|
|
25
|
+
if (await fs.pathExists(path)) {
|
|
26
|
+
return fs.readdir(path);
|
|
27
|
+
}
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
9
30
|
//# sourceMappingURL=fs.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.mjs","sourceRoot":"","sources":["../../../src/tools/fs.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAG,IAA6B;IACpE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAEnC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAU,EAAE,KAAa,EAAE,EAAE;QAC5C,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,OAAO,MAAkB,CAAC;AAC3B,CAAC"}
|
|
1
|
+
{"version":3,"file":"fs.mjs","sourceRoot":"","sources":["../../../src/tools/fs.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAG,IAA6B;IACpE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAEnC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAU,EAAE,KAAa,EAAE,EAAE;QAC5C,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,OAAO,MAAkB,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,UAAkB;IAC/C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAE1B,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;QACxB,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IACvC,CAAC;IAED,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAE5C,OAAO,UAAU,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAY;IAC5C,IAAI,MAAM,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,EAAE,CAAC;AACX,CAAC"}
|
package/build/src/tools/ktx.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import os from "node:os";
|
|
2
|
-
import { normalizedGlob } from "./fs.mjs";
|
|
3
2
|
import { join } from "node:path/posix";
|
|
3
|
+
import { normalizedGlob } from "./fs.mjs";
|
|
4
4
|
export let pvrTexToolAbsolutePath;
|
|
5
5
|
export function setPVRTexToolAbsolutePath(absolutePath) {
|
|
6
6
|
pvrTexToolAbsolutePath = absolutePath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ktx.mjs","sourceRoot":"","sources":["../../../src/tools/ktx.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ktx.mjs","sourceRoot":"","sources":["../../../src/tools/ktx.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,CAAC,IAAI,sBAA0C,CAAC;AAEtD,MAAM,UAAU,yBAAyB,CAAC,YAAoB;IAC7D,sBAAsB,GAAG,YAAY,CAAC;AACvC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACrC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QAC/B,OAAO,CAAC,sBAAsB,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAE/B,IAAI,mBAAmB,GAAkB,IAAI,CAAC;IAC9C,QAAQ,QAAQ,EAAE,CAAC;QAClB,KAAK,QAAQ;YACZ,mBAAmB,GAAG,4BAA4B,CAAC;YACnD,MAAM;QACP,KAAK,OAAO;YACX,mBAAmB,GAAG,8BAA8B,CAAC;YACrD,MAAM;QACP;YACC,MAAM;IACR,CAAC;IAED,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,EAAE;QACnE,KAAK,EAAE,IAAI;KACX,CAAC,CAAC;IAEH,QAAQ,QAAQ,EAAE,CAAC;QAClB,KAAK,QAAQ;YACZ,OAAO,CAAC,sBAAsB,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QAC9F,KAAK,OAAO;YACX,OAAO,CAAC,sBAAsB,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,kCAAkC,CAAC,CAAC,CAAC,CAAC;IAC5G,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC"}
|
|
@@ -4,12 +4,12 @@ import { Worker } from "node:worker_threads";
|
|
|
4
4
|
* Creates a new worker and returns its reference.
|
|
5
5
|
* @param path defines the relative path to the worker entry point relative to THIS file.
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export let loadWorker = (path, workerData) => {
|
|
8
8
|
path = join(import.meta.dirname.replace(/\\/g, "/"), path);
|
|
9
9
|
return new Worker(path, {
|
|
10
10
|
workerData,
|
|
11
11
|
});
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
13
|
/**
|
|
14
14
|
* Creates a new worker and returns the result computed by the worker.
|
|
15
15
|
* Posts the given message data to the worker and waits until the worker posts a message back.
|
|
@@ -18,7 +18,7 @@ export function loadWorker(path, workerData) {
|
|
|
18
18
|
* @param transfer defines the optional transferable objects to pass to the worker.
|
|
19
19
|
* @returns a promise that resolves with the data posted by the worker.
|
|
20
20
|
*/
|
|
21
|
-
export async
|
|
21
|
+
export let executeSimpleWorker = async (pathOrWorker, data) => {
|
|
22
22
|
const worker = loadWorker(pathOrWorker, data);
|
|
23
23
|
return new Promise((resolve) => {
|
|
24
24
|
worker.on("message", (result) => {
|
|
@@ -31,5 +31,9 @@ export async function executeSimpleWorker(pathOrWorker, data) {
|
|
|
31
31
|
resolve(result);
|
|
32
32
|
});
|
|
33
33
|
});
|
|
34
|
+
};
|
|
35
|
+
export function overrideWorkerMethods(newLoadWorker, newExecuteSimpleWorker) {
|
|
36
|
+
loadWorker = newLoadWorker;
|
|
37
|
+
executeSimpleWorker = newExecuteSimpleWorker;
|
|
34
38
|
}
|
|
35
39
|
//# sourceMappingURL=worker.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.mjs","sourceRoot":"","sources":["../../../src/tools/worker.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C;;;GAGG;AACH,MAAM,
|
|
1
|
+
{"version":3,"file":"worker.mjs","sourceRoot":"","sources":["../../../src/tools/worker.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,C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|
2
|
+
export { s3, IS3Options } from "./s3/s3.mjs";
|
|
3
|
+
export { overrideWorkerMethods } from "./tools/worker.mjs";
|
|
4
|
+
export { CancellationToken } from "./tools/cancel.mjs";
|
|
@@ -20,6 +20,7 @@ export declare function setCompressedTexturesCliPath(absolutePath: string): void
|
|
|
20
20
|
export declare function getCompressedTextureFilename(path: string, format: KTXToolsType): string;
|
|
21
21
|
export type CompressFileToKtxOptions = {
|
|
22
22
|
format: KTXToolsType;
|
|
23
|
+
compressedTexturesEnabled: boolean;
|
|
23
24
|
force?: boolean;
|
|
24
25
|
exportedAssets?: string[];
|
|
25
26
|
destinationFolder?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { IProcessAssetFileOptions } from "./process.mjs";
|
|
1
2
|
export declare function getExtractedTextureOutputPath(publicDir: string): string;
|
|
2
|
-
export interface IComputeExportedTextureOptions {
|
|
3
|
+
export interface IComputeExportedTextureOptions extends IProcessAssetFileOptions {
|
|
3
4
|
force: boolean;
|
|
4
5
|
exportedAssets: string[];
|
|
5
6
|
compressedTexturesEnabled: boolean;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import { CancellationToken } from "../tools/cancel.mjs";
|
|
2
|
+
export type PackStepType = "assets" | "scenes" | "scripts" | "upload";
|
|
3
|
+
export interface IPackStepDetails {
|
|
4
|
+
message?: string;
|
|
5
|
+
success?: boolean;
|
|
6
|
+
}
|
|
1
7
|
export interface IPackOptions {
|
|
2
8
|
optimize: boolean;
|
|
3
9
|
pvrTexToolAbsolutePath?: string;
|
|
10
|
+
cancellationToken?: CancellationToken;
|
|
11
|
+
onProgress?: (progress: number) => void;
|
|
12
|
+
onStepChanged?: (step: PackStepType, detail?: IPackStepDetails) => void;
|
|
4
13
|
}
|
|
5
14
|
export declare function pack(projectDir: string, options: IPackOptions): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createScriptsFile(projectDir: string): Promise<void>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IPackOptions } from "../pack/pack.mjs";
|
|
2
|
+
export interface IS3Options extends Partial<IPackOptions> {
|
|
3
|
+
noPack?: boolean;
|
|
4
|
+
maxConnections?: number;
|
|
5
|
+
region?: string;
|
|
6
|
+
endpoint?: string;
|
|
7
|
+
accessKeyId?: string;
|
|
8
|
+
secretAccessKey?: string;
|
|
9
|
+
rootKey?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function s3(projectDir: string, options: IS3Options): Promise<void>;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import { glob } from "glob";
|
|
2
2
|
export declare function normalizedGlob(...args: Parameters<typeof glob>): Promise<string[]>;
|
|
3
|
+
export declare function getProjectDir(projectDir: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* Tries to read a directory and returns its content if the directory exists.
|
|
6
|
+
* If not, returns an empty array.
|
|
7
|
+
* @param path defines the absolute path to read directory.
|
|
8
|
+
*/
|
|
9
|
+
export declare function tryReadDir(path: string): Promise<string[]>;
|
|
@@ -3,7 +3,7 @@ import { Worker } from "node:worker_threads";
|
|
|
3
3
|
* Creates a new worker and returns its reference.
|
|
4
4
|
* @param path defines the relative path to the worker entry point relative to THIS file.
|
|
5
5
|
*/
|
|
6
|
-
export declare
|
|
6
|
+
export declare let loadWorker: (path: string, workerData?: WorkerMessageData) => Worker;
|
|
7
7
|
export type WorkerMessageData = {
|
|
8
8
|
id?: string;
|
|
9
9
|
} & Record<string, any>;
|
|
@@ -15,4 +15,5 @@ export type WorkerMessageData = {
|
|
|
15
15
|
* @param transfer defines the optional transferable objects to pass to the worker.
|
|
16
16
|
* @returns a promise that resolves with the data posted by the worker.
|
|
17
17
|
*/
|
|
18
|
-
export declare
|
|
18
|
+
export declare let executeSimpleWorker: <T>(pathOrWorker: string, data: WorkerMessageData) => Promise<T>;
|
|
19
|
+
export declare function overrideWorkerMethods(newLoadWorker: any, newExecuteSimpleWorker: any): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babylonjs-editor-cli",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "Babylon.js Editor CLI is a command line interface to help you package your scenes made using the Babylon.js Editor",
|
|
5
5
|
"productName": "Babylon.js Editor CLI",
|
|
6
6
|
"scripts": {
|
|
@@ -21,14 +21,16 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {},
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"@aws-sdk/client-s3": "3.975.0",
|
|
24
25
|
"chalk": "5.6.2",
|
|
25
26
|
"cli-spinners": "3.4.0",
|
|
26
27
|
"commander": "14.0.2",
|
|
27
28
|
"dotenv": "17.2.3",
|
|
28
29
|
"fs-extra": "11.2.0",
|
|
29
30
|
"glob": "11.1.0",
|
|
30
|
-
"
|
|
31
|
+
"md5": "2.3.0",
|
|
31
32
|
"ora": "9.1.0",
|
|
33
|
+
"pngjs": "7.0.0",
|
|
32
34
|
"sharp": "0.34.3"
|
|
33
35
|
}
|
|
34
36
|
}
|