babylonjs-editor-cli 5.0.0 → 5.0.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.
Files changed (53) hide show
  1. package/.env +5 -0
  2. package/build/index.node.js +85 -18
  3. package/build/package.json +4 -2
  4. package/build/src/export.mjs +2 -0
  5. package/build/src/export.mjs.map +1 -1
  6. package/build/src/index.mjs +10 -0
  7. package/build/src/index.mjs.map +1 -1
  8. package/build/src/pack/assets/assets.mjs.map +1 -1
  9. package/build/src/pack/assets/process.mjs +3 -0
  10. package/build/src/pack/assets/process.mjs.map +1 -1
  11. package/build/src/pack/assets/texture.mjs +3 -0
  12. package/build/src/pack/assets/texture.mjs.map +1 -1
  13. package/build/src/pack/geometry.mjs +1 -1
  14. package/build/src/pack/geometry.mjs.map +1 -1
  15. package/build/src/pack/pack.mjs +21 -9
  16. package/build/src/pack/pack.mjs.map +1 -1
  17. package/build/src/s3/s3.mjs +132 -0
  18. package/build/src/s3/s3.mjs.map +1 -0
  19. package/build/src/tools/fs.mjs +9 -0
  20. package/build/src/tools/fs.mjs.map +1 -1
  21. package/build/src/tools/ktx.mjs +3 -1
  22. package/build/src/tools/ktx.mjs.map +1 -1
  23. package/build/src/tools/worker.mjs +7 -3
  24. package/build/src/tools/worker.mjs.map +1 -1
  25. package/declaration/src/export.d.mts +3 -1
  26. package/declaration/src/pack/assets/assets.d.mts +2 -0
  27. package/declaration/src/pack/assets/texture.d.mts +2 -1
  28. package/declaration/src/pack/pack.d.mts +6 -0
  29. package/declaration/src/s3/s3.d.mts +11 -0
  30. package/declaration/src/tools/fs.d.mts +1 -0
  31. package/declaration/src/tools/worker.d.mts +3 -2
  32. package/package.json +4 -2
  33. package/esbuild.mjs +0 -57
  34. package/src/export.mts +0 -1
  35. package/src/index.mts +0 -28
  36. package/src/pack/assets/assets.mts +0 -46
  37. package/src/pack/assets/ktx.mts +0 -158
  38. package/src/pack/assets/material.mts +0 -86
  39. package/src/pack/assets/particle-system.mts +0 -109
  40. package/src/pack/assets/process.mts +0 -102
  41. package/src/pack/assets/texture.mts +0 -91
  42. package/src/pack/geometry.mts +0 -38
  43. package/src/pack/pack.mts +0 -159
  44. package/src/pack/scene.mts +0 -346
  45. package/src/tools/extract.mts +0 -74
  46. package/src/tools/fs.mts +0 -11
  47. package/src/tools/ktx.mts +0 -44
  48. package/src/tools/process.mts +0 -21
  49. package/src/tools/scalar.mts +0 -28
  50. package/src/tools/scene.mts +0 -90
  51. package/src/tools/worker.mts +0 -39
  52. package/src/tools/workers/md5.mts +0 -13
  53. package/tsconfig.json +0 -21
@@ -1,28 +0,0 @@
1
- /**
2
- * Returns the power of two sizes until the given limit.
3
- * @param limit The limit size.
4
- * @param from The starting size. Default is 1.
5
- * @returns An array of power of two sizes.
6
- */
7
- export function getPowerOfTwoSizesUntil(limit: number = 4096, from?: number): number[] {
8
- let size = from ?? 1;
9
-
10
- const result: number[] = [];
11
-
12
- while (size <= limit) {
13
- result.push(size);
14
- size <<= 1;
15
- }
16
-
17
- return result;
18
- }
19
-
20
- export function getPowerOfTwoUntil(limit: number): number {
21
- let size = 1;
22
-
23
- while (size <= limit) {
24
- size <<= 1;
25
- }
26
-
27
- return size >> 1;
28
- }
@@ -1,90 +0,0 @@
1
- import { join } from "node:path/posix";
2
- import { readdir } from "node:fs/promises";
3
-
4
- import fs from "fs-extra";
5
-
6
- export async function ensureSceneDirectories(scenePath: string) {
7
- await Promise.all([
8
- fs.ensureDir(join(scenePath, "nodes")),
9
- fs.ensureDir(join(scenePath, "meshes")),
10
- fs.ensureDir(join(scenePath, "lods")),
11
- fs.ensureDir(join(scenePath, "lights")),
12
- fs.ensureDir(join(scenePath, "cameras")),
13
- fs.ensureDir(join(scenePath, "geometries")),
14
- fs.ensureDir(join(scenePath, "skeletons")),
15
- fs.ensureDir(join(scenePath, "shadowGenerators")),
16
- fs.ensureDir(join(scenePath, "sceneLinks")),
17
- fs.ensureDir(join(scenePath, "gui")),
18
- fs.ensureDir(join(scenePath, "sounds")),
19
- fs.ensureDir(join(scenePath, "particleSystems")),
20
- fs.ensureDir(join(scenePath, "morphTargetManagers")),
21
- fs.ensureDir(join(scenePath, "morphTargets")),
22
- fs.ensureDir(join(scenePath, "animationGroups")),
23
- fs.ensureDir(join(scenePath, "sprite-maps")),
24
- fs.ensureDir(join(scenePath, "sprite-managers")),
25
- fs.ensureDir(join(scenePath, "nodeParticleSystemSets")),
26
- ]);
27
- }
28
-
29
- export async function readSceneDirectories(scenePath: string) {
30
- const [
31
- nodesFiles,
32
- meshesFiles,
33
- lodsFiles,
34
- lightsFiles,
35
- cameraFiles,
36
- skeletonFiles,
37
- shadowGeneratorFiles,
38
- sceneLinkFiles,
39
- guiFiles,
40
- soundFiles,
41
- particleSystemFiles,
42
- morphTargetManagerFiles,
43
- morphTargetFiles,
44
- animationGroupFiles,
45
- spriteMapFiles,
46
- spriteManagerFiles,
47
- geometryFiles,
48
- nodeParticleSystemSetFiles,
49
- ] = await Promise.all([
50
- readdir(join(scenePath, "nodes")),
51
- readdir(join(scenePath, "meshes")),
52
- readdir(join(scenePath, "lods")),
53
- readdir(join(scenePath, "lights")),
54
- readdir(join(scenePath, "cameras")),
55
- readdir(join(scenePath, "skeletons")),
56
- readdir(join(scenePath, "shadowGenerators")),
57
- readdir(join(scenePath, "sceneLinks")),
58
- readdir(join(scenePath, "gui")),
59
- readdir(join(scenePath, "sounds")),
60
- readdir(join(scenePath, "particleSystems")),
61
- readdir(join(scenePath, "morphTargetManagers")),
62
- readdir(join(scenePath, "morphTargets")),
63
- readdir(join(scenePath, "animationGroups")),
64
- readdir(join(scenePath, "sprite-maps")),
65
- readdir(join(scenePath, "sprite-managers")),
66
- readdir(join(scenePath, "geometries")),
67
- readdir(join(scenePath, "nodeParticleSystemSets")),
68
- ]);
69
-
70
- return {
71
- nodesFiles,
72
- meshesFiles,
73
- lodsFiles,
74
- lightsFiles,
75
- cameraFiles,
76
- skeletonFiles,
77
- shadowGeneratorFiles,
78
- sceneLinkFiles,
79
- guiFiles,
80
- soundFiles,
81
- particleSystemFiles,
82
- morphTargetManagerFiles,
83
- morphTargetFiles,
84
- animationGroupFiles,
85
- spriteMapFiles,
86
- spriteManagerFiles,
87
- geometryFiles,
88
- nodeParticleSystemSetFiles,
89
- };
90
- }
@@ -1,39 +0,0 @@
1
- import { join } from "node:path/posix";
2
- import { Worker } from "node:worker_threads";
3
-
4
- /**
5
- * Creates a new worker and returns its reference.
6
- * @param path defines the relative path to the worker entry point relative to THIS file.
7
- */
8
- export function loadWorker(path: string, workerData: WorkerMessageData) {
9
- path = join(import.meta.dirname.replace(/\\/g, "/"), path);
10
- return new Worker(path, {
11
- workerData,
12
- });
13
- }
14
-
15
- export type WorkerMessageData = { id?: string } & Record<string, any>;
16
-
17
- /**
18
- * Creates a new worker and returns the result computed by the worker.
19
- * Posts the given message data to the worker and waits until the worker posts a message back.
20
- * @param path defines the relative path to the worker according to THIS file. Typically "workers/myWorker.js".
21
- * @param data defines the data object posted to the worker once it has been initialized.
22
- * @param transfer defines the optional transferable objects to pass to the worker.
23
- * @returns a promise that resolves with the data posted by the worker.
24
- */
25
- export async function executeSimpleWorker<T>(pathOrWorker: string, data: WorkerMessageData) {
26
- const worker = loadWorker(pathOrWorker, data);
27
-
28
- return new Promise<T>((resolve) => {
29
- worker.on("message", (result) => {
30
- if (data.id && result.id !== data.id) {
31
- return;
32
- } else if (!data.id) {
33
- worker.terminate();
34
- }
35
-
36
- resolve(result);
37
- });
38
- });
39
- }
@@ -1,13 +0,0 @@
1
- import { workerData, parentPort } from "node:worker_threads";
2
-
3
- import md5 from "md5";
4
- import fs from "fs-extra";
5
-
6
- let content = workerData;
7
-
8
- if (typeof workerData === "string") {
9
- content = await fs.readFile(workerData);
10
- }
11
-
12
- const hash = md5(content);
13
- parentPort?.postMessage(hash);
package/tsconfig.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "module": "ESNext",
5
- "moduleResolution": "node",
6
- "sourceMap": true,
7
- "declaration": true,
8
- "outDir": "./build",
9
- "declarationDir": "./declaration",
10
- "strictNullChecks": true,
11
- "noUnusedLocals": true,
12
- "noUnusedParameters": true,
13
- "allowSyntheticDefaultImports": true,
14
- "resolveJsonModule": true,
15
- "esModuleInterop": true,
16
- "downlevelIteration": true,
17
- "experimentalDecorators": true,
18
- "skipLibCheck": true
19
- },
20
- "exclude": ["node_modules", "build", "declaration", "vitest.config.ts"]
21
- }