@galacean/cli 2.0.0-alpha.12 → 2.0.0-alpha.14
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/cli.bundle.cjs +134 -135
- package/dist/viewport-client/_static/Accordion-3d330bc6.js +1 -0
- package/dist/viewport-client/_static/{AmbientLightAsset-f70b95f1.js → AmbientLightAsset-bdbc4e1d.js} +2 -2
- package/dist/viewport-client/_static/AnimationClipAsset-9167378a.js +1 -0
- package/dist/viewport-client/_static/AnimatorControllerAsset-21dc6332.js +1 -0
- package/dist/viewport-client/_static/AnimatorStore-18d3c551.js +1 -0
- package/dist/viewport-client/_static/{AssetViewer-bc198e16.js → AssetViewer-64cd01fa.js} +1 -1
- package/dist/viewport-client/_static/AudioAsset-0c828c80.js +1 -0
- package/dist/viewport-client/_static/AudioComponent-fbff3825.js +1 -0
- package/dist/viewport-client/_static/{Callout-cb4a55ff.js → Callout-ba7e2adf.js} +1 -1
- package/dist/viewport-client/_static/CameraComponent-74975570.js +1 -0
- package/dist/viewport-client/_static/{Component-f923abb1.js → Component-ed7aa0ab.js} +1 -1
- package/dist/viewport-client/_static/DirectLight-b884e7db.js +1 -0
- package/dist/viewport-client/_static/FontAsset-d1ced18d.js +5 -0
- package/dist/viewport-client/_static/FormItemArray-6d69acd4.js +6 -0
- package/dist/viewport-client/_static/{GlTFAsset-9c68f862.js → GlTFAsset-2723b84a.js} +9 -9
- package/dist/viewport-client/_static/IconEdit-ab77303f.js +6 -0
- package/dist/viewport-client/_static/{IconPointFilled-a304fd34.js → IconPointFilled-811fc660.js} +1 -1
- package/dist/viewport-client/_static/LightBaseComponent-12dc27d1.js +1 -0
- package/dist/viewport-client/_static/LottieAnimationComponent-c48c5eb5.js +1 -0
- package/dist/viewport-client/_static/LottieAsset-3692580d.js +6 -0
- package/dist/viewport-client/_static/MarkdownAsset-bcb90be4.js +1 -0
- package/dist/viewport-client/_static/MaterialAsset-6ef9b4ed.js +1 -0
- package/dist/viewport-client/_static/MaterialInspector-e8242674.js +1 -0
- package/dist/viewport-client/_static/Menu-0b8da92f.js +17 -0
- package/dist/viewport-client/_static/MeshAsset-ca9305e5.js +1 -0
- package/dist/viewport-client/_static/MeshRendererBaseComponent-9efd3943.js +1 -0
- package/dist/viewport-client/_static/MeshRendererComponent-c9a03641.js +1 -0
- package/dist/viewport-client/_static/{MeshThumbnail-49273f71.js → MeshThumbnail-ab28b3b8.js} +1 -1
- package/dist/viewport-client/_static/ParticleRendererComponent-96947c1d.js +26 -0
- package/dist/viewport-client/_static/PhysicsMaterialAsset-4a1e5ea3.js +1 -0
- package/dist/viewport-client/_static/PhysicsStore-33cac578.js +1 -0
- package/dist/viewport-client/_static/PointLight-fd514526.js +1 -0
- package/dist/viewport-client/_static/PostProcessComponent-d0ea27a4.js +6 -0
- package/dist/viewport-client/_static/PrefabAsset-9179b95c.js +1 -0
- package/dist/viewport-client/_static/PrimitiveMesh-0572a073.js +1 -0
- package/dist/viewport-client/_static/ProxyConfigs-3a5fd860.js +1 -0
- package/dist/viewport-client/_static/{ReferencedMaterial-a87818f3.js → ReferencedMaterial-5773c9d2.js} +1 -1
- package/dist/viewport-client/_static/RenderTargetAsset-ab6e06d2.js +1 -0
- package/dist/viewport-client/_static/SceneAsset-385fa837.js +1 -0
- package/dist/viewport-client/_static/{ShaderAsset-cb3ff628.js → ShaderAsset-f4514b03.js} +6 -6
- package/dist/viewport-client/_static/ShaderChunkAsset-34116f2c.js +5 -0
- package/dist/viewport-client/_static/{ShaderUIScriptAsset-d13fa4e2.js → ShaderUIScriptAsset-fc503291.js} +5 -5
- package/dist/viewport-client/_static/SkinnedMeshRendererComponent-494ad439.js +1 -0
- package/dist/viewport-client/_static/SpineAnimationComponent-3918d7b5.js +1 -0
- package/dist/viewport-client/_static/SpineSkeletonDataAsset-27244892.js +1 -0
- package/dist/viewport-client/_static/SpotLight-f9972dc0.js +1 -0
- package/dist/viewport-client/_static/SpriteAsset-558ffca8.js +6 -0
- package/dist/viewport-client/_static/SpriteAtlasAsset-cdc34386.js +1 -0
- package/dist/viewport-client/_static/SpriteBaseComponent-3edafa31.js +1 -0
- package/dist/viewport-client/_static/SpriteMaskComponent-de2e5231.js +1 -0
- package/dist/viewport-client/_static/SpriteRendererComponent-e999e735.js +1 -0
- package/dist/viewport-client/_static/{TextBaseComponent-69233798.js → TextBaseComponent-ce1402c3.js} +2 -2
- package/dist/viewport-client/_static/TextRendererComponent-f7c0deae.js +1 -0
- package/dist/viewport-client/_static/TextureAsset-39fb07fe.js +36 -0
- package/dist/viewport-client/_static/Tooltip-82063435.js +1 -0
- package/dist/viewport-client/_static/TrailRendererComponent-37f5c981.js +1 -0
- package/dist/viewport-client/_static/TransformBaseComponent-713d57e9.js +1 -0
- package/dist/viewport-client/_static/TransformComponent-40a57948.js +1 -0
- package/dist/viewport-client/_static/XRReferenceImageAsset-2f6ff226.js +1 -0
- package/dist/viewport-client/_static/audio-7120ec91.js +1 -0
- package/dist/viewport-client/_static/glTFIO-79bbca27.js +1 -0
- package/dist/viewport-client/_static/index-483b5738.js +1 -0
- package/dist/viewport-client/_static/{index-98982ce2.js → index-74130ff3.js} +1 -1
- package/dist/viewport-client/_static/index-78269e76.js +1 -0
- package/dist/viewport-client/_static/index-7834b582.js +1 -0
- package/dist/viewport-client/_static/{index-237c84cd.js → index-7917f782.js} +3 -3
- package/dist/viewport-client/_static/index-7acd49d2.js +1 -0
- package/dist/viewport-client/_static/index-9d3917da.js +1 -0
- package/dist/viewport-client/_static/index-a9b2675e.js +1 -0
- package/dist/viewport-client/_static/index-aec7e708.js +11487 -0
- package/dist/viewport-client/_static/index-b5582401.js +1 -0
- package/dist/viewport-client/_static/{index-e46ec5b1.js → index-bfe6f30e.js} +7 -7
- package/dist/viewport-client/_static/index-c63c9606.js +2 -0
- package/dist/viewport-client/_static/index-cd1fee9d.js +1 -0
- package/dist/viewport-client/_static/index-e73ceaed.js +1 -0
- package/dist/viewport-client/_static/index-e8a45e82.js +1 -0
- package/dist/viewport-client/_static/index-f2cb64af.js +1 -0
- package/dist/viewport-client/_static/index-fbe040bf.js +31 -0
- package/dist/viewport-client/_static/ktx2-encoder-53b21bdc.js +1 -0
- package/dist/viewport-client/_static/{module-5c85b07e.js → module-220b3921.js} +1 -1
- package/dist/viewport-client/_static/{module-6406b050.js → module-8816772d.js} +1 -1
- package/dist/viewport-client/_static/{module-107b7430.js → module-ffeaf99f.js} +1 -1
- package/dist/viewport-client/_static/postmen-2f47f6bb.js +1 -0
- package/dist/viewport-client/index.html +2 -2
- package/package.json +1 -1
- package/dist/viewport-client/_static/Accordion-4897319b.js +0 -6
- package/dist/viewport-client/_static/AnimationClipAsset-01f3deb6.js +0 -1
- package/dist/viewport-client/_static/AnimatorControllerAsset-b7424e9c.js +0 -1
- package/dist/viewport-client/_static/AnimatorStore-fd98c00e.js +0 -1
- package/dist/viewport-client/_static/AssetPreviewer-24e31d97.js +0 -6
- package/dist/viewport-client/_static/AudioAsset-eae03324.js +0 -1
- package/dist/viewport-client/_static/AudioComponent-44070c2c.js +0 -1
- package/dist/viewport-client/_static/CameraComponent-907ac745.js +0 -1
- package/dist/viewport-client/_static/CanvasRenderer-9dd98cb3.js +0 -1
- package/dist/viewport-client/_static/DirectLight-58f5fe9e.js +0 -1
- package/dist/viewport-client/_static/FontAsset-abfb9a8a.js +0 -5
- package/dist/viewport-client/_static/FormItemArray-66be8701.js +0 -1
- package/dist/viewport-client/_static/IconPlayerPlayFilled-b058c98f.js +0 -6
- package/dist/viewport-client/_static/InstanceEditorAsset-a70e73fe.js +0 -1
- package/dist/viewport-client/_static/LightBaseComponent-fbc3ae49.js +0 -1
- package/dist/viewport-client/_static/LottieAnimationComponent-1c3e02a5.js +0 -1
- package/dist/viewport-client/_static/LottieAsset-377c1419.js +0 -1
- package/dist/viewport-client/_static/MarkdownAsset-7ea387a9.js +0 -1
- package/dist/viewport-client/_static/MaterialAsset-74a15124.js +0 -1
- package/dist/viewport-client/_static/MaterialInspector-aec1248b.js +0 -1
- package/dist/viewport-client/_static/Menu-cd3be298.js +0 -17
- package/dist/viewport-client/_static/MeshAsset-73e2cc8e.js +0 -1
- package/dist/viewport-client/_static/MeshRendererBaseComponent-3a0e09ed.js +0 -1
- package/dist/viewport-client/_static/MeshRendererComponent-5385d30f.js +0 -1
- package/dist/viewport-client/_static/ParticleRendererComponent-5a7b57d9.js +0 -21
- package/dist/viewport-client/_static/PhysicsMaterialAsset-a5ac9f82.js +0 -1
- package/dist/viewport-client/_static/PhysicsStore-0729e76d.js +0 -1
- package/dist/viewport-client/_static/PointLight-0e1d1546.js +0 -1
- package/dist/viewport-client/_static/PostProcessComponent-8276d33c.js +0 -1
- package/dist/viewport-client/_static/PrefabAsset-1a7edfbd.js +0 -1
- package/dist/viewport-client/_static/PrimitiveMesh-3ce6fa2f.js +0 -1
- package/dist/viewport-client/_static/ProxyConfigs-4de3304c.js +0 -1
- package/dist/viewport-client/_static/RenderTargetAsset-33c0d9e7.js +0 -1
- package/dist/viewport-client/_static/SceneAsset-8917c210.js +0 -1
- package/dist/viewport-client/_static/ShaderChunkAsset-83f923f4.js +0 -5
- package/dist/viewport-client/_static/SkinnedMeshRendererComponent-2a8323bf.js +0 -1
- package/dist/viewport-client/_static/SpineAnimationComponent-e733d50f.js +0 -1
- package/dist/viewport-client/_static/SpineSkeletonDataAsset-b64a3ee3.js +0 -1
- package/dist/viewport-client/_static/SpotLight-ca6c0c3b.js +0 -1
- package/dist/viewport-client/_static/SpriteAsset-9a31ec24.js +0 -1
- package/dist/viewport-client/_static/SpriteAtlasAsset-a862db46.js +0 -1
- package/dist/viewport-client/_static/SpriteBaseComponent-f6f1731f.js +0 -1
- package/dist/viewport-client/_static/SpriteMaskComponent-778be04f.js +0 -1
- package/dist/viewport-client/_static/SpriteRendererComponent-2b4d153b.js +0 -1
- package/dist/viewport-client/_static/TextRendererComponent-130b4e99.js +0 -1
- package/dist/viewport-client/_static/TextureAsset-28fedf2a.js +0 -36
- package/dist/viewport-client/_static/ThumbnailMixin-35997457.js +0 -1
- package/dist/viewport-client/_static/ThumbnailRegistry-495c18c9.js +0 -1
- package/dist/viewport-client/_static/Tooltip-33f770ba.js +0 -1
- package/dist/viewport-client/_static/TrailRendererComponent-148550b5.js +0 -1
- package/dist/viewport-client/_static/TransformBaseComponent-02318c5a.js +0 -1
- package/dist/viewport-client/_static/TransformComponent-96106065.js +0 -1
- package/dist/viewport-client/_static/ViewerManager-202b570a.js +0 -1
- package/dist/viewport-client/_static/XRReferenceImageAsset-6a6adb3b.js +0 -1
- package/dist/viewport-client/_static/audio-244358e2.js +0 -1
- package/dist/viewport-client/_static/glTFIO-45ff9a17.js +0 -1
- package/dist/viewport-client/_static/index-0a8702e2.js +0 -11217
- package/dist/viewport-client/_static/index-37c74ae9.js +0 -26
- package/dist/viewport-client/_static/index-4cca0201.js +0 -1
- package/dist/viewport-client/_static/index-59732f86.js +0 -1
- package/dist/viewport-client/_static/index-6c8198f6.js +0 -2
- package/dist/viewport-client/_static/index-6f827618.js +0 -1
- package/dist/viewport-client/_static/index-803ca489.js +0 -1
- package/dist/viewport-client/_static/index-85a6cf6a.js +0 -1
- package/dist/viewport-client/_static/index-b3d51f87.js +0 -1
- package/dist/viewport-client/_static/index-be6bc38a.js +0 -177
- package/dist/viewport-client/_static/index-c403cbcd.js +0 -1
- package/dist/viewport-client/_static/index-e73966ae.js +0 -1
- package/dist/viewport-client/_static/index-e95b4498.js +0 -1
- package/dist/viewport-client/_static/index-f5a67a46.js +0 -1
- package/dist/viewport-client/_static/ktx-parse.modern-6c9f771f.js +0 -1
- package/dist/viewport-client/_static/ktx2-encoder-1e63c1eb.js +0 -1
- package/dist/viewport-client/_static/postmen-45d4c238.js +0 -1
- package/dist/viewport-client/_static/utilities-e09052e3.js +0 -11
package/dist/cli.bundle.cjs
CHANGED
|
@@ -6656,9 +6656,9 @@ var init_handler = __esm({
|
|
|
6656
6656
|
if (this.fsw.closed) {
|
|
6657
6657
|
return;
|
|
6658
6658
|
}
|
|
6659
|
-
const
|
|
6659
|
+
const dirname6 = sysPath.dirname(file2);
|
|
6660
6660
|
const basename4 = sysPath.basename(file2);
|
|
6661
|
-
const parent2 = this.fsw._getWatchedDir(
|
|
6661
|
+
const parent2 = this.fsw._getWatchedDir(dirname6);
|
|
6662
6662
|
let prevStats = stats;
|
|
6663
6663
|
if (parent2.has(basename4))
|
|
6664
6664
|
return;
|
|
@@ -6685,7 +6685,7 @@ var init_handler = __esm({
|
|
|
6685
6685
|
prevStats = newStats2;
|
|
6686
6686
|
}
|
|
6687
6687
|
} catch (error49) {
|
|
6688
|
-
this.fsw._remove(
|
|
6688
|
+
this.fsw._remove(dirname6, basename4);
|
|
6689
6689
|
}
|
|
6690
6690
|
} else if (parent2.has(basename4)) {
|
|
6691
6691
|
const at2 = newStats.atimeMs;
|
|
@@ -61986,10 +61986,10 @@ var init_VirtualFileSystem = __esm({
|
|
|
61986
61986
|
throw new Error(`Path ${normalized} already exists and is not a folder`);
|
|
61987
61987
|
}
|
|
61988
61988
|
const name16 = basename3(normalized);
|
|
61989
|
-
const
|
|
61989
|
+
const dirname6 = dirname3(normalized);
|
|
61990
61990
|
let parent2;
|
|
61991
|
-
if (
|
|
61992
|
-
parent2 = this.ensureFolderExist(
|
|
61991
|
+
if (dirname6 && dirname6 !== "/" && dirname6 !== normalized) {
|
|
61992
|
+
parent2 = this.ensureFolderExist(dirname6);
|
|
61993
61993
|
}
|
|
61994
61994
|
const id = v4_default();
|
|
61995
61995
|
const type = "Folder";
|
|
@@ -62033,8 +62033,8 @@ var init_VirtualFileSystem = __esm({
|
|
|
62033
62033
|
}
|
|
62034
62034
|
writeFile(path23, type, content) {
|
|
62035
62035
|
const name16 = basename3(path23);
|
|
62036
|
-
const
|
|
62037
|
-
const parent2 = this.ensureFolderExist(
|
|
62036
|
+
const dirname6 = dirname3(path23);
|
|
62037
|
+
const parent2 = this.ensureFolderExist(dirname6);
|
|
62038
62038
|
const existingFile = this.filePathMap.get(path23);
|
|
62039
62039
|
if (existingFile) {
|
|
62040
62040
|
this.fileMap.delete(existingFile.id);
|
|
@@ -62070,8 +62070,8 @@ var init_VirtualFileSystem = __esm({
|
|
|
62070
62070
|
throw new Error(`File with id ${id} not found`);
|
|
62071
62071
|
}
|
|
62072
62072
|
const oldPath = vfile.path;
|
|
62073
|
-
const
|
|
62074
|
-
const newPath =
|
|
62073
|
+
const dirname6 = dirname3(oldPath);
|
|
62074
|
+
const newPath = dirname6 === "/" ? `/${newName}` : `${dirname6}/${newName}`;
|
|
62075
62075
|
this.filePathMap.delete(oldPath);
|
|
62076
62076
|
vfile.name = newName;
|
|
62077
62077
|
vfile.path = newPath;
|
|
@@ -73540,7 +73540,7 @@ var init_Package = __esm({
|
|
|
73540
73540
|
"/project.json",
|
|
73541
73541
|
"project",
|
|
73542
73542
|
JSON.stringify({
|
|
73543
|
-
url: "/project.json",
|
|
73543
|
+
url: "/public/project.json",
|
|
73544
73544
|
runtimeOptions: this._buildOptions.runtimeOptions
|
|
73545
73545
|
})
|
|
73546
73546
|
);
|
|
@@ -75006,9 +75006,6 @@ var init_VanillaPackage = __esm({
|
|
|
75006
75006
|
});
|
|
75007
75007
|
|
|
75008
75008
|
// src/cli-vanilla-package.ts
|
|
75009
|
-
function loadTemplate(filename) {
|
|
75010
|
-
return (0, import_node_fs.readFileSync)((0, import_node_path10.join)(builderDir, "templates", "web", filename), "utf-8");
|
|
75011
|
-
}
|
|
75012
75009
|
function cliUploadFactory() {
|
|
75013
75010
|
async function upload(name16, _blob) {
|
|
75014
75011
|
return { url: name16 };
|
|
@@ -75016,27 +75013,28 @@ function cliUploadFactory() {
|
|
|
75016
75013
|
upload.download = true;
|
|
75017
75014
|
return upload;
|
|
75018
75015
|
}
|
|
75019
|
-
var
|
|
75016
|
+
var import_index_ts, import_index_ts2, import_package_json, import_index_html, import_main_js, import_tsconfig_json, import_vite_config_ts, CLIVanillaPackage;
|
|
75020
75017
|
var init_cli_vanilla_package = __esm({
|
|
75021
75018
|
"src/cli-vanilla-package.ts"() {
|
|
75022
75019
|
"use strict";
|
|
75023
75020
|
init_VanillaPackage();
|
|
75024
|
-
|
|
75025
|
-
|
|
75026
|
-
|
|
75027
|
-
|
|
75028
|
-
|
|
75029
|
-
|
|
75021
|
+
import_index_ts = __toESM(require_index_ts());
|
|
75022
|
+
import_index_ts2 = __toESM(require_index_ts2());
|
|
75023
|
+
import_package_json = __toESM(require_package_json());
|
|
75024
|
+
import_index_html = __toESM(require_index_html());
|
|
75025
|
+
import_main_js = __toESM(require_main_js());
|
|
75026
|
+
import_tsconfig_json = __toESM(require_tsconfig_json());
|
|
75027
|
+
import_vite_config_ts = __toESM(require_vite_config_ts());
|
|
75030
75028
|
CLIVanillaPackage = class extends VanillaPackage {
|
|
75031
75029
|
async _loadTemplate() {
|
|
75032
75030
|
return {
|
|
75033
|
-
entry:
|
|
75034
|
-
scriptEntry:
|
|
75035
|
-
packageJson:
|
|
75036
|
-
html:
|
|
75037
|
-
main:
|
|
75038
|
-
tsconfig:
|
|
75039
|
-
viteConfig:
|
|
75031
|
+
entry: import_index_ts.default,
|
|
75032
|
+
scriptEntry: import_index_ts2.default,
|
|
75033
|
+
packageJson: import_package_json.default,
|
|
75034
|
+
html: import_index_html.default,
|
|
75035
|
+
main: import_main_js.default,
|
|
75036
|
+
tsconfig: import_tsconfig_json.default,
|
|
75037
|
+
viteConfig: import_vite_config_ts.default
|
|
75040
75038
|
};
|
|
75041
75039
|
}
|
|
75042
75040
|
async _writeFiles(project2, cacheMap, download = false) {
|
|
@@ -92280,12 +92278,12 @@ async function getCliGlTFIO() {
|
|
|
92280
92278
|
return _cachedGlTFIO;
|
|
92281
92279
|
}
|
|
92282
92280
|
function normalizePathForComparison(filePath) {
|
|
92283
|
-
const normalized =
|
|
92281
|
+
const normalized = import_node_path10.default.resolve(filePath);
|
|
92284
92282
|
return process.platform === "linux" ? normalized : normalized.toLowerCase();
|
|
92285
92283
|
}
|
|
92286
92284
|
function isSameOrNestedPath(targetPath, basePath2) {
|
|
92287
|
-
const relative5 =
|
|
92288
|
-
return relative5 === "" || !relative5.startsWith("..") && !
|
|
92285
|
+
const relative5 = import_node_path10.default.relative(basePath2, targetPath);
|
|
92286
|
+
return relative5 === "" || !relative5.startsWith("..") && !import_node_path10.default.isAbsolute(relative5);
|
|
92289
92287
|
}
|
|
92290
92288
|
function assertSafeBuildOutputDir(projectDir, outputDir) {
|
|
92291
92289
|
const normalizedProjectDir = normalizePathForComparison(projectDir);
|
|
@@ -92296,7 +92294,7 @@ function assertSafeBuildOutputDir(projectDir, outputDir) {
|
|
|
92296
92294
|
);
|
|
92297
92295
|
}
|
|
92298
92296
|
for (const managedPath of MANAGED_PROJECT_PATHS) {
|
|
92299
|
-
const normalizedManagedPath = normalizePathForComparison(
|
|
92297
|
+
const normalizedManagedPath = normalizePathForComparison(import_node_path10.default.join(projectDir, managedPath));
|
|
92300
92298
|
const overlapsManagedPath = managedPath === "project.galacean" ? normalizedOutputDir === normalizedManagedPath : isSameOrNestedPath(normalizedOutputDir, normalizedManagedPath);
|
|
92301
92299
|
if (overlapsManagedPath) {
|
|
92302
92300
|
throw new Error(
|
|
@@ -92306,8 +92304,8 @@ function assertSafeBuildOutputDir(projectDir, outputDir) {
|
|
|
92306
92304
|
}
|
|
92307
92305
|
}
|
|
92308
92306
|
async function buildProject(options) {
|
|
92309
|
-
const projectDir =
|
|
92310
|
-
const outputDir =
|
|
92307
|
+
const projectDir = import_node_path10.default.resolve(options.projectDir);
|
|
92308
|
+
const outputDir = import_node_path10.default.resolve(options.output);
|
|
92311
92309
|
assertSafeBuildOutputDir(projectDir, outputDir);
|
|
92312
92310
|
console.log("Reading project...");
|
|
92313
92311
|
const { state, ctx } = await loadDomainState(projectDir);
|
|
@@ -92369,10 +92367,10 @@ function buildProjectAssets(manifest, projectDir) {
|
|
|
92369
92367
|
if (inlineMeta && typeof inlineMeta === "object") {
|
|
92370
92368
|
meta4 = inlineMeta;
|
|
92371
92369
|
} else {
|
|
92372
|
-
const metaPath =
|
|
92370
|
+
const metaPath = import_node_path10.default.join(projectDir, metaFilePath(entry.path));
|
|
92373
92371
|
let metaText;
|
|
92374
92372
|
try {
|
|
92375
|
-
metaText =
|
|
92373
|
+
metaText = import_node_fs.default.readFileSync(metaPath, "utf-8");
|
|
92376
92374
|
} catch (e6) {
|
|
92377
92375
|
console.warn(`[buildProjectAssets] Failed to read meta file: ${metaPath}`, e6);
|
|
92378
92376
|
skippedAssets.push({
|
|
@@ -92404,8 +92402,8 @@ function buildProjectAssets(manifest, projectDir) {
|
|
|
92404
92402
|
parentId = folderPathToId.get(parts.slice(0, -1).join("/")) ?? null;
|
|
92405
92403
|
}
|
|
92406
92404
|
const isFolder = entry.type === "Folder";
|
|
92407
|
-
const filePath =
|
|
92408
|
-
const fileUrl = !isFolder &&
|
|
92405
|
+
const filePath = import_node_path10.default.join(projectDir, entry.path);
|
|
92406
|
+
const fileUrl = !isFolder && import_node_fs.default.existsSync(filePath) ? `file://${filePath}` : (
|
|
92409
92407
|
// Non-http URLs are treated as local/non-materialized inputs and will be validated later in compile.
|
|
92410
92408
|
!isFolder && isHttpUrl(entry.url) ? entry.url : isFolder ? "" : `file://${filePath}`
|
|
92411
92409
|
);
|
|
@@ -92715,9 +92713,9 @@ async function writeOutputToDisk(vfs, outputDir) {
|
|
|
92715
92713
|
const content = vfile.content;
|
|
92716
92714
|
if (content == null)
|
|
92717
92715
|
continue;
|
|
92718
|
-
const outputPath =
|
|
92716
|
+
const outputPath = import_node_path10.default.join(outputDir, vfsPath);
|
|
92719
92717
|
writes.push(
|
|
92720
|
-
import_promises10.default.mkdir(
|
|
92718
|
+
import_promises10.default.mkdir(import_node_path10.default.dirname(outputPath), { recursive: true }).then(async () => {
|
|
92721
92719
|
if (content instanceof Blob) {
|
|
92722
92720
|
await import_promises10.default.writeFile(outputPath, Buffer.from(await content.arrayBuffer()));
|
|
92723
92721
|
} else {
|
|
@@ -92728,13 +92726,13 @@ async function writeOutputToDisk(vfs, outputDir) {
|
|
|
92728
92726
|
}
|
|
92729
92727
|
await Promise.all(writes);
|
|
92730
92728
|
}
|
|
92731
|
-
var import_promises10,
|
|
92729
|
+
var import_promises10, import_node_fs, import_node_path10, import_node_crypto4, import_meshoptimizer2, _cachedGlTFIO;
|
|
92732
92730
|
var init_cli_builder = __esm({
|
|
92733
92731
|
"src/cli-builder.ts"() {
|
|
92734
92732
|
"use strict";
|
|
92735
92733
|
import_promises10 = __toESM(require("node:fs/promises"));
|
|
92736
|
-
|
|
92737
|
-
|
|
92734
|
+
import_node_fs = __toESM(require("node:fs"));
|
|
92735
|
+
import_node_path10 = __toESM(require("node:path"));
|
|
92738
92736
|
import_node_crypto4 = require("node:crypto");
|
|
92739
92737
|
init_src();
|
|
92740
92738
|
import_meshoptimizer2 = __toESM(require_meshoptimizer());
|
|
@@ -338301,7 +338299,7 @@ var require_BufferList = __commonJS({
|
|
|
338301
338299
|
this.head = this.tail = null;
|
|
338302
338300
|
this.length = 0;
|
|
338303
338301
|
};
|
|
338304
|
-
BufferList.prototype.join = function
|
|
338302
|
+
BufferList.prototype.join = function join6(s5) {
|
|
338305
338303
|
if (this.length === 0)
|
|
338306
338304
|
return "";
|
|
338307
338305
|
var p6 = this.head;
|
|
@@ -351203,7 +351201,7 @@ __export(chat_headless_exports, {
|
|
|
351203
351201
|
createHeadlessSession: () => createHeadlessSession
|
|
351204
351202
|
});
|
|
351205
351203
|
async function createHeadlessSession(projectDir) {
|
|
351206
|
-
const absDir =
|
|
351204
|
+
const absDir = import_node_path12.default.resolve(projectDir);
|
|
351207
351205
|
const { state, ctx } = await loadDomainState(absDir);
|
|
351208
351206
|
const root3 = new HeadlessRoot(ctx.remoteProjectId, {
|
|
351209
351207
|
name: ctx.config.name,
|
|
@@ -351226,11 +351224,11 @@ async function createHeadlessSession(projectDir) {
|
|
|
351226
351224
|
}
|
|
351227
351225
|
};
|
|
351228
351226
|
}
|
|
351229
|
-
var
|
|
351227
|
+
var import_node_path12;
|
|
351230
351228
|
var init_chat_headless = __esm({
|
|
351231
351229
|
"src/commands/chat-headless.ts"() {
|
|
351232
351230
|
"use strict";
|
|
351233
|
-
|
|
351231
|
+
import_node_path12 = __toESM(require("node:path"));
|
|
351234
351232
|
init_domain_bridge();
|
|
351235
351233
|
init_src12();
|
|
351236
351234
|
init_headless();
|
|
@@ -353834,7 +353832,7 @@ async function maybeAutoPush(opts, cmd, saved) {
|
|
|
353834
353832
|
const shouldPush = opts.push ?? envAutoPush ?? globals._config?.autoPush === "true";
|
|
353835
353833
|
if (!shouldPush)
|
|
353836
353834
|
return;
|
|
353837
|
-
await autoPushProject(
|
|
353835
|
+
await autoPushProject(import_node_path15.default.resolve(opts.project), globals);
|
|
353838
353836
|
}
|
|
353839
353837
|
async function autoPushProject(projectDir, globals) {
|
|
353840
353838
|
const { config: config2 } = globals._config ? { config: globals._config } : await loadConfig();
|
|
@@ -353846,7 +353844,7 @@ async function autoPushProject(projectDir, globals) {
|
|
|
353846
353844
|
}
|
|
353847
353845
|
try {
|
|
353848
353846
|
const result2 = await pushProject({
|
|
353849
|
-
projectDir:
|
|
353847
|
+
projectDir: import_node_path15.default.resolve(projectDir),
|
|
353850
353848
|
apiClient: new HttpSyncApiClient(serverUrl, token),
|
|
353851
353849
|
fs: new NodeFs(),
|
|
353852
353850
|
serverUrl,
|
|
@@ -353857,11 +353855,11 @@ async function autoPushProject(projectDir, globals) {
|
|
|
353857
353855
|
console.error("[auto-push] failed:", error49 instanceof Error ? error49.message : error49);
|
|
353858
353856
|
}
|
|
353859
353857
|
}
|
|
353860
|
-
var
|
|
353858
|
+
var import_node_path15;
|
|
353861
353859
|
var init_auto_push = __esm({
|
|
353862
353860
|
"src/commands/auto-push.ts"() {
|
|
353863
353861
|
"use strict";
|
|
353864
|
-
|
|
353862
|
+
import_node_path15 = __toESM(require("node:path"));
|
|
353865
353863
|
init_node_fs();
|
|
353866
353864
|
init_push();
|
|
353867
353865
|
init_api_client();
|
|
@@ -353891,7 +353889,7 @@ function isIgnoredLocalEntryName2(name16) {
|
|
|
353891
353889
|
return false;
|
|
353892
353890
|
}
|
|
353893
353891
|
function isAbsolutePathLike2(input) {
|
|
353894
|
-
return
|
|
353892
|
+
return import_node_path18.default.posix.isAbsolute(input) || import_node_path18.default.win32.isAbsolute(input);
|
|
353895
353893
|
}
|
|
353896
353894
|
function normalizeRelativePath2(input) {
|
|
353897
353895
|
return input.replaceAll("\\", "/").replace(/^\/+/, "");
|
|
@@ -353911,12 +353909,12 @@ function defaultCreateWatcher2(watchDir) {
|
|
|
353911
353909
|
atomic: true
|
|
353912
353910
|
});
|
|
353913
353911
|
}
|
|
353914
|
-
var
|
|
353912
|
+
var import_node_path18, DEFAULT_DEBOUNCE_MS2, FileWatcher2;
|
|
353915
353913
|
var init_file_watcher = __esm({
|
|
353916
353914
|
"../cli-viewport/src/server/file-watcher.ts"() {
|
|
353917
353915
|
"use strict";
|
|
353918
353916
|
init_esm2();
|
|
353919
|
-
|
|
353917
|
+
import_node_path18 = __toESM(require("node:path"));
|
|
353920
353918
|
DEFAULT_DEBOUNCE_MS2 = 500;
|
|
353921
353919
|
FileWatcher2 = class {
|
|
353922
353920
|
constructor(opts) {
|
|
@@ -353947,7 +353945,7 @@ var init_file_watcher = __esm({
|
|
|
353947
353945
|
});
|
|
353948
353946
|
this.watcher = this.createWatcher(this.opts.watchDir);
|
|
353949
353947
|
this.watcher.on("all", (_eventType, filePath) => {
|
|
353950
|
-
const rel =
|
|
353948
|
+
const rel = import_node_path18.default.relative(this.opts.watchDir, filePath);
|
|
353951
353949
|
this._onRawEvent(rel);
|
|
353952
353950
|
});
|
|
353953
353951
|
this.watcher.on("ready", () => {
|
|
@@ -353988,7 +353986,7 @@ var init_file_watcher = __esm({
|
|
|
353988
353986
|
const normalized = normalizeRelativePath2(relativePath2);
|
|
353989
353987
|
if (!normalized)
|
|
353990
353988
|
return;
|
|
353991
|
-
const parsed =
|
|
353989
|
+
const parsed = import_node_path18.default.posix.normalize(normalized);
|
|
353992
353990
|
if (parsed.startsWith("../") || parsed === "..")
|
|
353993
353991
|
return;
|
|
353994
353992
|
if (this.ignore(parsed))
|
|
@@ -354018,16 +354016,16 @@ var init_file_watcher = __esm({
|
|
|
354018
354016
|
|
|
354019
354017
|
// ../cli-viewport/src/server/read-manifest.ts
|
|
354020
354018
|
async function readManifest3(projectDir) {
|
|
354021
|
-
const filePath =
|
|
354019
|
+
const filePath = import_node_path19.default.resolve(projectDir, ".galacean/manifest.json");
|
|
354022
354020
|
const raw = await (0, import_promises14.readFile)(filePath, "utf-8");
|
|
354023
354021
|
return JSON.parse(raw);
|
|
354024
354022
|
}
|
|
354025
|
-
var import_promises14,
|
|
354023
|
+
var import_promises14, import_node_path19;
|
|
354026
354024
|
var init_read_manifest = __esm({
|
|
354027
354025
|
"../cli-viewport/src/server/read-manifest.ts"() {
|
|
354028
354026
|
"use strict";
|
|
354029
354027
|
import_promises14 = require("node:fs/promises");
|
|
354030
|
-
|
|
354028
|
+
import_node_path19 = __toESM(require("node:path"));
|
|
354031
354029
|
}
|
|
354032
354030
|
});
|
|
354033
354031
|
|
|
@@ -354259,7 +354257,8 @@ function resolveViewportChangesFromManifest(manifest, changedPaths) {
|
|
|
354259
354257
|
}
|
|
354260
354258
|
async function resolveViewportChanges(options) {
|
|
354261
354259
|
const manifest = await readManifest3(options.projectDir);
|
|
354262
|
-
|
|
354260
|
+
const changes = resolveViewportChangesFromManifest(manifest, options.changedPaths);
|
|
354261
|
+
return changes;
|
|
354263
354262
|
}
|
|
354264
354263
|
var META_SUFFIX;
|
|
354265
354264
|
var init_resolveViewportChanges = __esm({
|
|
@@ -354275,7 +354274,7 @@ async function startViewportServer(options) {
|
|
|
354275
354274
|
let port = options.port ?? 4310;
|
|
354276
354275
|
const projectId = options.projectId ?? "local";
|
|
354277
354276
|
const eventClients = /* @__PURE__ */ new Set();
|
|
354278
|
-
const watcher = new FileWatcher2({ watchDir:
|
|
354277
|
+
const watcher = new FileWatcher2({ watchDir: import_node_path20.default.resolve(options.projectDir, "assets") });
|
|
354279
354278
|
const suppressedWatcherPaths = /* @__PURE__ */ new Map();
|
|
354280
354279
|
watcher.onChange((paths) => {
|
|
354281
354280
|
const filteredPaths = filterSuppressedWatcherPaths(paths);
|
|
@@ -354372,9 +354371,9 @@ async function startViewportServer(options) {
|
|
|
354372
354371
|
}
|
|
354373
354372
|
if (req.method === "GET" && url2.pathname.startsWith("/assets/")) {
|
|
354374
354373
|
const relativePath2 = decodeURIComponent(url2.pathname.slice("/assets/".length));
|
|
354375
|
-
const filePath =
|
|
354376
|
-
const projectRoot =
|
|
354377
|
-
if (!filePath.startsWith(projectRoot +
|
|
354374
|
+
const filePath = import_node_path20.default.resolve(options.projectDir, relativePath2);
|
|
354375
|
+
const projectRoot = import_node_path20.default.resolve(options.projectDir);
|
|
354376
|
+
if (!filePath.startsWith(projectRoot + import_node_path20.default.sep) && filePath !== projectRoot) {
|
|
354378
354377
|
res.writeHead(403, { "content-type": "text/plain; charset=utf-8" });
|
|
354379
354378
|
res.end("Forbidden: path outside project directory");
|
|
354380
354379
|
return;
|
|
@@ -354391,8 +354390,8 @@ async function startViewportServer(options) {
|
|
|
354391
354390
|
}
|
|
354392
354391
|
if (req.method === "GET" && options.clientDir) {
|
|
354393
354392
|
const filePath = url2.pathname === "/" ? "/index.html" : url2.pathname;
|
|
354394
|
-
const resolved =
|
|
354395
|
-
if (resolved.startsWith(
|
|
354393
|
+
const resolved = import_node_path20.default.resolve(options.clientDir, filePath.slice(1));
|
|
354394
|
+
if (resolved.startsWith(import_node_path20.default.resolve(options.clientDir))) {
|
|
354396
354395
|
try {
|
|
354397
354396
|
const content = await (0, import_promises15.readFile)(resolved);
|
|
354398
354397
|
res.writeHead(200, { "content-type": resolveStaticContentType(resolved) });
|
|
@@ -354404,7 +354403,7 @@ async function startViewportServer(options) {
|
|
|
354404
354403
|
}
|
|
354405
354404
|
if (req.method === "GET" && options.clientDir) {
|
|
354406
354405
|
try {
|
|
354407
|
-
const content = await (0, import_promises15.readFile)(
|
|
354406
|
+
const content = await (0, import_promises15.readFile)(import_node_path20.default.join(options.clientDir, "index.html"));
|
|
354408
354407
|
res.writeHead(200, { "content-type": "text/html; charset=utf-8" });
|
|
354409
354408
|
res.end(content);
|
|
354410
354409
|
return;
|
|
@@ -354450,15 +354449,15 @@ async function writeProjectAsset(options) {
|
|
|
354450
354449
|
if (!entry?.path) {
|
|
354451
354450
|
throw new Error(`asset entry not found for serverId=${options.assetServerId}`);
|
|
354452
354451
|
}
|
|
354453
|
-
const projectRoot =
|
|
354454
|
-
const mainPath =
|
|
354455
|
-
if (!mainPath.startsWith(projectRoot +
|
|
354452
|
+
const projectRoot = import_node_path20.default.resolve(options.projectDir);
|
|
354453
|
+
const mainPath = import_node_path20.default.resolve(projectRoot, entry.path);
|
|
354454
|
+
if (!mainPath.startsWith(projectRoot + import_node_path20.default.sep) && mainPath !== projectRoot) {
|
|
354456
354455
|
throw new Error("asset path outside project directory");
|
|
354457
354456
|
}
|
|
354458
|
-
const watchRoot =
|
|
354457
|
+
const watchRoot = import_node_path20.default.resolve(projectRoot, "assets");
|
|
354459
354458
|
const suppressedWatcherPaths = /* @__PURE__ */ new Set();
|
|
354460
354459
|
const registerSuppressedPath = (filePath) => {
|
|
354461
|
-
const relativePath2 =
|
|
354460
|
+
const relativePath2 = import_node_path20.default.relative(watchRoot, filePath).replaceAll("\\", "/");
|
|
354462
354461
|
if (relativePath2 && !relativePath2.startsWith("../")) {
|
|
354463
354462
|
suppressedWatcherPaths.add(relativePath2);
|
|
354464
354463
|
}
|
|
@@ -354485,7 +354484,7 @@ async function writeProjectAsset(options) {
|
|
|
354485
354484
|
};
|
|
354486
354485
|
}
|
|
354487
354486
|
function resolveStaticContentType(filePath) {
|
|
354488
|
-
const ext =
|
|
354487
|
+
const ext = import_node_path20.default.extname(filePath).toLowerCase();
|
|
354489
354488
|
switch (ext) {
|
|
354490
354489
|
case ".html":
|
|
354491
354490
|
return "text/html; charset=utf-8";
|
|
@@ -354513,7 +354512,7 @@ function resolveAssetContentType(filePath) {
|
|
|
354513
354512
|
if (normalizedFilePath.endsWith(".meta.json") || normalizedFilePath.endsWith(".json") || normalizedFilePath.endsWith(".scene") || normalizedFilePath.endsWith(".mat")) {
|
|
354514
354513
|
return "application/json; charset=utf-8";
|
|
354515
354514
|
}
|
|
354516
|
-
switch (
|
|
354515
|
+
switch (import_node_path20.default.extname(normalizedFilePath)) {
|
|
354517
354516
|
case ".js":
|
|
354518
354517
|
case ".mjs":
|
|
354519
354518
|
case ".ts":
|
|
@@ -354568,12 +354567,12 @@ async function listenWithPortFallback(server, preferredPort) {
|
|
|
354568
354567
|
}
|
|
354569
354568
|
throw new Error(`No available port found (tried ${preferredPort}\u2013${preferredPort + MAX_PORT_ATTEMPTS - 1})`);
|
|
354570
354569
|
}
|
|
354571
|
-
var import_node_http,
|
|
354570
|
+
var import_node_http, import_node_path20, import_promises15, MAX_PORT_ATTEMPTS;
|
|
354572
354571
|
var init_runtime_server = __esm({
|
|
354573
354572
|
"../cli-viewport/src/server/runtime-server.ts"() {
|
|
354574
354573
|
"use strict";
|
|
354575
354574
|
import_node_http = __toESM(require("node:http"));
|
|
354576
|
-
|
|
354575
|
+
import_node_path20 = __toESM(require("node:path"));
|
|
354577
354576
|
import_promises15 = require("node:fs/promises");
|
|
354578
354577
|
init_file_watcher();
|
|
354579
354578
|
init_read_manifest();
|
|
@@ -378300,7 +378299,7 @@ var init_iteratee = __esm({
|
|
|
378300
378299
|
});
|
|
378301
378300
|
|
|
378302
378301
|
// ../../node_modules/lodash-es/join.js
|
|
378303
|
-
function
|
|
378302
|
+
function join5(array2, separator) {
|
|
378304
378303
|
return array2 == null ? "" : nativeJoin.call(array2, separator);
|
|
378305
378304
|
}
|
|
378306
378305
|
var arrayProto2, nativeJoin, join_default;
|
|
@@ -378308,7 +378307,7 @@ var init_join = __esm({
|
|
|
378308
378307
|
"../../node_modules/lodash-es/join.js"() {
|
|
378309
378308
|
arrayProto2 = Array.prototype;
|
|
378310
378309
|
nativeJoin = arrayProto2.join;
|
|
378311
|
-
join_default =
|
|
378310
|
+
join_default = join5;
|
|
378312
378311
|
}
|
|
378313
378312
|
});
|
|
378314
378313
|
|
|
@@ -423170,14 +423169,14 @@ var init_account = __esm({
|
|
|
423170
423169
|
});
|
|
423171
423170
|
|
|
423172
423171
|
// ../service/src/ai.ts
|
|
423173
|
-
var import_crypto2,
|
|
423172
|
+
var import_crypto2, import_meta, createSSEConnection, maya, AIAPI, ai;
|
|
423174
423173
|
var init_ai = __esm({
|
|
423175
423174
|
"../service/src/ai.ts"() {
|
|
423176
423175
|
"use strict";
|
|
423177
423176
|
init_esm_node();
|
|
423178
423177
|
import_crypto2 = require("crypto");
|
|
423179
423178
|
init_src11();
|
|
423180
|
-
|
|
423179
|
+
import_meta = {};
|
|
423181
423180
|
createSSEConnection = (url2, callbacks) => {
|
|
423182
423181
|
const sse = new EventSource(url2, { withCredentials: true });
|
|
423183
423182
|
let connected = false;
|
|
@@ -423303,7 +423302,7 @@ var init_ai = __esm({
|
|
|
423303
423302
|
});
|
|
423304
423303
|
}
|
|
423305
423304
|
async uploadImage(blob) {
|
|
423306
|
-
const env =
|
|
423305
|
+
const env = import_meta.env;
|
|
423307
423306
|
const publicKey = env.VITE_PUBLIC_KEY;
|
|
423308
423307
|
const form = new FormData();
|
|
423309
423308
|
const message = "upload";
|
|
@@ -516183,7 +516182,7 @@ var init_KTX2Cache = __esm({
|
|
|
516183
516182
|
});
|
|
516184
516183
|
|
|
516185
516184
|
// ../../plugins/main/src/assets/texture/ktx2-encoder.ts
|
|
516186
|
-
var import_js_md54,
|
|
516185
|
+
var import_js_md54, import_meta2, log7, KTX2Encoder, ktx2Encoder;
|
|
516187
516186
|
var init_ktx2_encoder = __esm({
|
|
516188
516187
|
"../../plugins/main/src/assets/texture/ktx2-encoder.ts"() {
|
|
516189
516188
|
"use strict";
|
|
@@ -516191,14 +516190,14 @@ var init_ktx2_encoder = __esm({
|
|
|
516191
516190
|
init_KTX2Cache();
|
|
516192
516191
|
init_src11();
|
|
516193
516192
|
init_src4();
|
|
516194
|
-
|
|
516193
|
+
import_meta2 = {};
|
|
516195
516194
|
log7 = logger("ktx2");
|
|
516196
516195
|
KTX2Encoder = class {
|
|
516197
516196
|
encoderWorkerPool;
|
|
516198
516197
|
initPromise;
|
|
516199
516198
|
constructor() {
|
|
516200
516199
|
this.encoderWorkerPool = new WorkerPool(4, () => {
|
|
516201
|
-
return new Worker(new URL("./ktx2-worker.ts",
|
|
516200
|
+
return new Worker(new URL("./ktx2-worker.ts", import_meta2.url), { type: "module" });
|
|
516202
516201
|
});
|
|
516203
516202
|
this.initPromise = this.encoderWorkerPool.prepareWorker();
|
|
516204
516203
|
}
|
|
@@ -528794,7 +528793,7 @@ var require_main34 = __commonJS({
|
|
|
528794
528793
|
_proto.get = function get5(path23) {
|
|
528795
528794
|
return this.cache.assets[this.pathPrefix + path23];
|
|
528796
528795
|
};
|
|
528797
|
-
_proto.require = function
|
|
528796
|
+
_proto.require = function require2(path23) {
|
|
528798
528797
|
path23 = this.pathPrefix + path23;
|
|
528799
528798
|
var asset3 = this.cache.assets[path23];
|
|
528800
528799
|
if (asset3)
|
|
@@ -568630,7 +568629,7 @@ async function startClientHost(options) {
|
|
|
568630
568629
|
const host = options.host ?? "127.0.0.1";
|
|
568631
568630
|
const port = options.clientPort ?? 4312;
|
|
568632
568631
|
const workspaceRoot = await findWorkspaceRoot();
|
|
568633
|
-
const configPath =
|
|
568632
|
+
const configPath = import_node_path21.default.join(workspaceRoot, "packages/cli-viewport/vite.config.ts");
|
|
568634
568633
|
const viteBin = await resolveViteBin(workspaceRoot);
|
|
568635
568634
|
await (0, import_promises16.access)(configPath);
|
|
568636
568635
|
const child = (0, import_node_child_process2.spawn)(
|
|
@@ -568674,13 +568673,13 @@ async function findWorkspaceRoot() {
|
|
|
568674
568673
|
for (const startDir of startDirs) {
|
|
568675
568674
|
let current = startDir;
|
|
568676
568675
|
while (true) {
|
|
568677
|
-
const marker16 =
|
|
568676
|
+
const marker16 = import_node_path21.default.join(current, "pnpm-workspace.yaml");
|
|
568678
568677
|
try {
|
|
568679
568678
|
await (0, import_promises16.access)(marker16);
|
|
568680
|
-
await (0, import_promises16.access)(
|
|
568679
|
+
await (0, import_promises16.access)(import_node_path21.default.join(current, "packages/cli-viewport/vite.config.ts"));
|
|
568681
568680
|
return current;
|
|
568682
568681
|
} catch {
|
|
568683
|
-
const parent2 =
|
|
568682
|
+
const parent2 = import_node_path21.default.dirname(current);
|
|
568684
568683
|
if (parent2 === current)
|
|
568685
568684
|
break;
|
|
568686
568685
|
current = parent2;
|
|
@@ -568692,13 +568691,13 @@ async function findWorkspaceRoot() {
|
|
|
568692
568691
|
);
|
|
568693
568692
|
}
|
|
568694
568693
|
async function resolveViteBin(workspaceRoot) {
|
|
568695
|
-
const vitePackageJson =
|
|
568694
|
+
const vitePackageJson = import_node_path21.default.join(workspaceRoot, "node_modules/vite/package.json");
|
|
568696
568695
|
const raw = await (0, import_promises16.readFile)(vitePackageJson, "utf-8");
|
|
568697
568696
|
const pkg = JSON.parse(raw);
|
|
568698
568697
|
const relativeBin = typeof pkg.bin === "string" ? pkg.bin : pkg.bin?.vite;
|
|
568699
568698
|
if (!relativeBin)
|
|
568700
568699
|
throw new Error("Unable to resolve Vite CLI entry");
|
|
568701
|
-
return
|
|
568700
|
+
return import_node_path21.default.join(import_node_path21.default.dirname(vitePackageJson), relativeBin);
|
|
568702
568701
|
}
|
|
568703
568702
|
async function waitForReady(options) {
|
|
568704
568703
|
const startedAt = Date.now();
|
|
@@ -568741,18 +568740,18 @@ function buildClientWarmupUrls(options) {
|
|
|
568741
568740
|
"/ViewportRuntime.ts"
|
|
568742
568741
|
];
|
|
568743
568742
|
const fsEntries = [
|
|
568744
|
-
|
|
568745
|
-
|
|
568743
|
+
import_node_path21.default.join(options.workspaceRoot, "packages/model/src/runtime-bootstrap.ts"),
|
|
568744
|
+
import_node_path21.default.join(options.workspaceRoot, "packages/model/src/runtime-browser.ts")
|
|
568746
568745
|
];
|
|
568747
568746
|
const selectiveEntries = options.plan ? resolveWarmupEntryPathsForPlan(options.plan) : [];
|
|
568748
568747
|
return unique([
|
|
568749
568748
|
...runtimeRootEntries.map((entry) => `${baseUrl}${entry}`),
|
|
568750
568749
|
...fsEntries.map((entry) => `${baseUrl}/@fs/${normalizeFsPath(entry)}`),
|
|
568751
|
-
...selectiveEntries.map((entry) => `${baseUrl}/@fs/${normalizeFsPath(
|
|
568750
|
+
...selectiveEntries.map((entry) => `${baseUrl}/@fs/${normalizeFsPath(import_node_path21.default.join(options.workspaceRoot, entry))}`)
|
|
568752
568751
|
]);
|
|
568753
568752
|
}
|
|
568754
568753
|
function normalizeFsPath(value) {
|
|
568755
|
-
const normalized = value.split(
|
|
568754
|
+
const normalized = value.split(import_node_path21.default.sep).join("/");
|
|
568756
568755
|
return normalized.startsWith("/") ? normalized.slice(1) : normalized;
|
|
568757
568756
|
}
|
|
568758
568757
|
function resolveWarmupEntryPathsForPlan(plan) {
|
|
@@ -568793,12 +568792,12 @@ async function stopChild(child) {
|
|
|
568793
568792
|
}, 2e3).unref();
|
|
568794
568793
|
});
|
|
568795
568794
|
}
|
|
568796
|
-
var import_promises16,
|
|
568795
|
+
var import_promises16, import_node_path21, import_node_process2, import_node_child_process2, CLIENT_WARMUP_TIMEOUT_MS, PROJECT_QUERY_TIMEOUT_MS;
|
|
568797
568796
|
var init_client_host = __esm({
|
|
568798
568797
|
"../cli-viewport/src/server/client-host.ts"() {
|
|
568799
568798
|
"use strict";
|
|
568800
568799
|
import_promises16 = require("node:fs/promises");
|
|
568801
|
-
|
|
568800
|
+
import_node_path21 = __toESM(require("node:path"));
|
|
568802
568801
|
import_node_process2 = __toESM(require("node:process"));
|
|
568803
568802
|
import_node_child_process2 = require("node:child_process");
|
|
568804
568803
|
init_runtime_project_context();
|
|
@@ -568837,7 +568836,7 @@ var init_src20 = __esm({
|
|
|
568837
568836
|
|
|
568838
568837
|
// src/cli.ts
|
|
568839
568838
|
var import_node_os2 = __toESM(require("node:os"));
|
|
568840
|
-
var
|
|
568839
|
+
var import_node_path23 = __toESM(require("node:path"));
|
|
568841
568840
|
var import_node_process3 = __toESM(require("node:process"));
|
|
568842
568841
|
|
|
568843
568842
|
// node_modules/commander/esm.mjs
|
|
@@ -570078,7 +570077,7 @@ function registerAssetTree(parent2) {
|
|
|
570078
570077
|
}
|
|
570079
570078
|
|
|
570080
570079
|
// src/commands/build.ts
|
|
570081
|
-
var
|
|
570080
|
+
var import_node_path11 = __toESM(require("node:path"));
|
|
570082
570081
|
function parseKtx2Quality(raw) {
|
|
570083
570082
|
if (raw == null)
|
|
570084
570083
|
return void 0;
|
|
@@ -570099,8 +570098,8 @@ function registerBuildCommand(program3) {
|
|
|
570099
570098
|
try {
|
|
570100
570099
|
const { buildProject: buildProject2 } = await Promise.resolve().then(() => (init_cli_builder(), cli_builder_exports));
|
|
570101
570100
|
await buildProject2({
|
|
570102
|
-
projectDir:
|
|
570103
|
-
output:
|
|
570101
|
+
projectDir: import_node_path11.default.resolve(dir),
|
|
570102
|
+
output: import_node_path11.default.resolve(cmdOpts.output),
|
|
570104
570103
|
ktx2: cmdOpts.ktx2 ?? false,
|
|
570105
570104
|
ktx2Mode: cmdOpts.ktx2Mode,
|
|
570106
570105
|
ktx2Quality,
|
|
@@ -577921,7 +577920,7 @@ var uiMessagesSchema = lazyValidator(
|
|
|
577921
577920
|
|
|
577922
577921
|
// src/commands/chat.ts
|
|
577923
577922
|
var import_promises11 = require("node:fs/promises");
|
|
577924
|
-
var
|
|
577923
|
+
var import_node_path13 = require("node:path");
|
|
577925
577924
|
init_constants();
|
|
577926
577925
|
var AGENT_NAME = "editorAgent";
|
|
577927
577926
|
var EXTRA_CONTEXT = { selectedEntityIds: "", selectedAssetIds: "", userLanguage: "zh" };
|
|
@@ -577962,7 +577961,7 @@ function classifyChatError(error49, loopExceeded) {
|
|
|
577962
577961
|
return "MODEL_FAIL";
|
|
577963
577962
|
}
|
|
577964
577963
|
async function writeResultJson(resultJsonPath, result2) {
|
|
577965
|
-
await (0, import_promises11.mkdir)((0,
|
|
577964
|
+
await (0, import_promises11.mkdir)((0, import_node_path13.dirname)(resultJsonPath), { recursive: true });
|
|
577966
577965
|
await (0, import_promises11.writeFile)(resultJsonPath, JSON.stringify(result2, null, 2));
|
|
577967
577966
|
}
|
|
577968
577967
|
async function createThread(serverUrl, token, projectId) {
|
|
@@ -578262,7 +578261,7 @@ function registerChatCommand(program3) {
|
|
|
578262
578261
|
|
|
578263
578262
|
// src/commands/create.ts
|
|
578264
578263
|
var import_promises12 = require("node:fs/promises");
|
|
578265
|
-
var
|
|
578264
|
+
var import_node_path14 = __toESM(require("node:path"));
|
|
578266
578265
|
init_manifest();
|
|
578267
578266
|
init_meta_file();
|
|
578268
578267
|
init_path_tree();
|
|
@@ -578942,14 +578941,14 @@ function buildDefaultScene(platform2) {
|
|
|
578942
578941
|
async function createProject(opts) {
|
|
578943
578942
|
const { name: name16, platform: platform2 = "3d", engineVersion = "2.0.0-alpha.25", force = false } = opts;
|
|
578944
578943
|
const outputDir = opts.outputDir ?? `./${slugify2(name16)}`;
|
|
578945
|
-
const absDir =
|
|
578944
|
+
const absDir = import_node_path14.default.resolve(outputDir);
|
|
578946
578945
|
await (0, import_promises12.mkdir)(absDir, { recursive: true });
|
|
578947
578946
|
if (!force) {
|
|
578948
578947
|
await assertNodeDirectoryEmpty(absDir);
|
|
578949
578948
|
} else {
|
|
578950
578949
|
await resetNodeManagedProjectPaths(absDir);
|
|
578951
578950
|
}
|
|
578952
|
-
await (0, import_promises12.mkdir)(
|
|
578951
|
+
await (0, import_promises12.mkdir)(import_node_path14.default.join(absDir, ".galacean/cache"), { recursive: true });
|
|
578953
578952
|
const sceneJson = JSON.stringify(buildDefaultScene(platform2), null, 2);
|
|
578954
578953
|
const sceneAsset = {
|
|
578955
578954
|
id: `local-${DEFAULT_SCENE_ID}`,
|
|
@@ -578965,22 +578964,22 @@ async function createProject(opts) {
|
|
|
578965
578964
|
const contentHashes = /* @__PURE__ */ new Map();
|
|
578966
578965
|
for (const [, entry] of pathMap) {
|
|
578967
578966
|
if (entry.isFolder) {
|
|
578968
|
-
await (0, import_promises12.mkdir)(
|
|
578967
|
+
await (0, import_promises12.mkdir)(import_node_path14.default.join(absDir, entry.localPath), { recursive: true });
|
|
578969
578968
|
}
|
|
578970
578969
|
}
|
|
578971
578970
|
const sceneEntry = pathMap.get(DEFAULT_SCENE_ID);
|
|
578972
|
-
await (0, import_promises12.writeFile)(
|
|
578971
|
+
await (0, import_promises12.writeFile)(import_node_path14.default.join(absDir, sceneEntry.localPath), sceneJson);
|
|
578973
578972
|
contentHashes.set(DEFAULT_SCENE_ID, md5Text(sceneJson));
|
|
578974
578973
|
for (const [, entry] of pathMap) {
|
|
578975
578974
|
const meta4 = generateMetaFile(entry);
|
|
578976
|
-
const metaPath =
|
|
578977
|
-
await (0, import_promises12.mkdir)(
|
|
578975
|
+
const metaPath = import_node_path14.default.join(absDir, metaFilePath(entry.localPath));
|
|
578976
|
+
await (0, import_promises12.mkdir)(import_node_path14.default.dirname(metaPath), { recursive: true });
|
|
578978
578977
|
await (0, import_promises12.writeFile)(metaPath, JSON.stringify(meta4, null, 2));
|
|
578979
578978
|
}
|
|
578980
578979
|
const manifest = generateManifest(pathMap, contentHashes);
|
|
578981
|
-
await (0, import_promises12.writeFile)(
|
|
578980
|
+
await (0, import_promises12.writeFile)(import_node_path14.default.join(absDir, ".galacean/manifest.json"), JSON.stringify(manifest, null, 2));
|
|
578982
578981
|
const projectConfig = { name: name16, platform: platform2, engineVersion, sceneId: DEFAULT_SCENE_ID };
|
|
578983
|
-
await (0, import_promises12.writeFile)(
|
|
578982
|
+
await (0, import_promises12.writeFile)(import_node_path14.default.join(absDir, "project.galacean"), JSON.stringify(projectConfig, null, 2));
|
|
578984
578983
|
return { outputDir };
|
|
578985
578984
|
}
|
|
578986
578985
|
function registerCreateCommand(program3) {
|
|
@@ -578992,12 +578991,12 @@ function registerCreateCommand(program3) {
|
|
|
578992
578991
|
engineVersion: options.engineVersion,
|
|
578993
578992
|
force: options.force
|
|
578994
578993
|
});
|
|
578995
|
-
console.log(`Project created at: ${
|
|
578994
|
+
console.log(`Project created at: ${import_node_path14.default.resolve(outputDir)}`);
|
|
578996
578995
|
});
|
|
578997
578996
|
}
|
|
578998
578997
|
|
|
578999
578998
|
// src/commands/invoke.ts
|
|
579000
|
-
var
|
|
578999
|
+
var import_node_path16 = __toESM(require("node:path"));
|
|
579001
579000
|
|
|
579002
579001
|
// src/commands/headless-tool-support.ts
|
|
579003
579002
|
var UNSUPPORTED_HEADLESS_TOOL_IDS = /* @__PURE__ */ new Set();
|
|
@@ -579050,7 +579049,7 @@ async function invokeTool(options) {
|
|
|
579050
579049
|
}
|
|
579051
579050
|
}
|
|
579052
579051
|
const { createHeadlessSession: createHeadlessSession2 } = await Promise.resolve().then(() => (init_chat_headless(), chat_headless_exports));
|
|
579053
|
-
const projectDir =
|
|
579052
|
+
const projectDir = import_node_path16.default.resolve(options.projectDir);
|
|
579054
579053
|
const session = await createHeadlessSession2(projectDir);
|
|
579055
579054
|
const result2 = await session.invoke(options.toolId, params, { undoLabel: `invoke:${options.toolId}` });
|
|
579056
579055
|
const saved = !options.dryRun && session.isDirty();
|
|
@@ -579063,7 +579062,7 @@ function registerInvokeCommand(program3) {
|
|
|
579063
579062
|
program3.command("invoke [toolId] [params]").description("Invoke a single editor-api tool").option("-p, --project <dir>", "project directory", ".").option("--list", "list all available tools").option("--schema <toolId>", "show tool input schema").option("--push", "auto-push to server after saving").option("--dry-run", "show what would change without saving").action(async (toolId, paramsStr, opts, cmd) => {
|
|
579064
579063
|
try {
|
|
579065
579064
|
const result2 = await invokeTool({
|
|
579066
|
-
projectDir:
|
|
579065
|
+
projectDir: import_node_path16.default.resolve(opts.project),
|
|
579067
579066
|
toolId,
|
|
579068
579067
|
params: paramsStr,
|
|
579069
579068
|
list: opts.list,
|
|
@@ -579085,7 +579084,7 @@ function registerInvokeCommand(program3) {
|
|
|
579085
579084
|
|
|
579086
579085
|
// src/commands/exec.ts
|
|
579087
579086
|
var import_promises13 = require("node:fs/promises");
|
|
579088
|
-
var
|
|
579087
|
+
var import_node_path17 = __toESM(require("node:path"));
|
|
579089
579088
|
async function readAllStdin() {
|
|
579090
579089
|
const chunks = [];
|
|
579091
579090
|
for await (const chunk2 of process.stdin) {
|
|
@@ -579122,7 +579121,7 @@ async function executeProjectCode(options) {
|
|
|
579122
579121
|
}
|
|
579123
579122
|
async function resolveExecuteCode(filePath, inlineCode) {
|
|
579124
579123
|
if (filePath) {
|
|
579125
|
-
return (0, import_promises13.readFile)(
|
|
579124
|
+
return (0, import_promises13.readFile)(import_node_path17.default.resolve(filePath), "utf-8");
|
|
579126
579125
|
}
|
|
579127
579126
|
if (inlineCode) {
|
|
579128
579127
|
return inlineCode;
|
|
@@ -579139,7 +579138,7 @@ function registerExecCommand(program3) {
|
|
|
579139
579138
|
try {
|
|
579140
579139
|
const code = await resolveExecuteCode(opts.file, inlineCode);
|
|
579141
579140
|
const result2 = await executeProjectCode({
|
|
579142
|
-
projectDir:
|
|
579141
|
+
projectDir: import_node_path17.default.resolve(opts.project),
|
|
579143
579142
|
code,
|
|
579144
579143
|
dryRun: opts.dryRun,
|
|
579145
579144
|
saveOnError: opts.saveOnError
|
|
@@ -579165,13 +579164,13 @@ function registerExecCommand(program3) {
|
|
|
579165
579164
|
}
|
|
579166
579165
|
|
|
579167
579166
|
// src/commands/viewport.ts
|
|
579168
|
-
var
|
|
579167
|
+
var import_node_path22 = __toESM(require("node:path"));
|
|
579169
579168
|
var import_promises17 = require("node:fs/promises");
|
|
579170
579169
|
init_src20();
|
|
579171
579170
|
init_local_project();
|
|
579172
579171
|
function registerViewportCommand(parent2) {
|
|
579173
579172
|
parent2.command("viewport [projectDir]").description("Start local viewport with hot reload").option("--port <port>", "server port", "4310").option("--dev", "use Vite dev server (requires monorepo checkout)").option("--client-port <port>", "client host port (dev mode only)", "4312").option("--no-open", "do not open browser automatically").action(async (projectDir, cmdOpts) => {
|
|
579174
|
-
const dir =
|
|
579173
|
+
const dir = import_node_path22.default.resolve(projectDir ?? process.cwd());
|
|
579175
579174
|
await (0, import_promises17.access)(dir);
|
|
579176
579175
|
const projectId = await resolveLocalProjectId(dir);
|
|
579177
579176
|
const port = Number(cmdOpts?.port ?? 4310);
|
|
@@ -579234,22 +579233,22 @@ function registerViewportCommand(parent2) {
|
|
|
579234
579233
|
}
|
|
579235
579234
|
async function resolveClientDir() {
|
|
579236
579235
|
const candidates = [
|
|
579237
|
-
|
|
579236
|
+
import_node_path22.default.resolve(__dirname, "viewport-client"),
|
|
579238
579237
|
// CLI dist/viewport-client/
|
|
579239
|
-
|
|
579238
|
+
import_node_path22.default.resolve(__dirname, "../viewport-client")
|
|
579240
579239
|
// fallback
|
|
579241
579240
|
];
|
|
579242
579241
|
let current = process.cwd();
|
|
579243
579242
|
while (true) {
|
|
579244
|
-
candidates.push(
|
|
579245
|
-
const parent2 =
|
|
579243
|
+
candidates.push(import_node_path22.default.join(current, "packages/cli-viewport/dist/client"));
|
|
579244
|
+
const parent2 = import_node_path22.default.dirname(current);
|
|
579246
579245
|
if (parent2 === current)
|
|
579247
579246
|
break;
|
|
579248
579247
|
current = parent2;
|
|
579249
579248
|
}
|
|
579250
579249
|
for (const candidate of candidates) {
|
|
579251
579250
|
try {
|
|
579252
|
-
await (0, import_promises17.access)(
|
|
579251
|
+
await (0, import_promises17.access)(import_node_path22.default.join(candidate, "index.html"));
|
|
579253
579252
|
return candidate;
|
|
579254
579253
|
} catch {
|
|
579255
579254
|
}
|
|
@@ -579260,14 +579259,14 @@ async function resolveClientDir() {
|
|
|
579260
579259
|
}
|
|
579261
579260
|
|
|
579262
579261
|
// src/cli-version.ts
|
|
579263
|
-
var
|
|
579264
|
-
var
|
|
579262
|
+
var import_node_fs4 = require("node:fs");
|
|
579263
|
+
var import_meta3 = {};
|
|
579265
579264
|
function readCliVersionFromPackageJson() {
|
|
579266
|
-
const raw = (0,
|
|
579265
|
+
const raw = (0, import_node_fs4.readFileSync)(new URL("../package.json", import_meta3.url), "utf-8");
|
|
579267
579266
|
const parsed = JSON.parse(raw);
|
|
579268
579267
|
return typeof parsed.version === "string" && parsed.version.length > 0 ? parsed.version : "0.0.0";
|
|
579269
579268
|
}
|
|
579270
|
-
var CLI_VERSION = "2.0.0-alpha.
|
|
579269
|
+
var CLI_VERSION = "2.0.0-alpha.14".length > 0 ? "2.0.0-alpha.14" : readCliVersionFromPackageJson();
|
|
579271
579270
|
|
|
579272
579271
|
// src/cli.ts
|
|
579273
579272
|
init_config();
|
|
@@ -579297,7 +579296,7 @@ program2.command("init <projectId>").description("Initialize a project from remo
|
|
|
579297
579296
|
const globals = program2.optsWithGlobals();
|
|
579298
579297
|
const serverUrl = await resolveServerUrl(globals, { required: true });
|
|
579299
579298
|
const token = getToken2(globals);
|
|
579300
|
-
const outputDir = cmdOpts.output ?? cmdOpts.outputDir ??
|
|
579299
|
+
const outputDir = cmdOpts.output ?? cmdOpts.outputDir ?? import_node_path23.default.resolve(globals._config?.projectsDir ?? import_node_path23.default.join(import_node_os2.default.homedir(), ".galacean/workspace"), projectId);
|
|
579301
579300
|
await initProject({
|
|
579302
579301
|
projectId,
|
|
579303
579302
|
outputDir,
|
|
@@ -579313,7 +579312,7 @@ program2.command("pull [projectDir]").description("Pull remote changes to local"
|
|
|
579313
579312
|
const serverUrl = await resolveServerUrl(globals, { projectDir: dir, required: true });
|
|
579314
579313
|
const token = getToken2(globals);
|
|
579315
579314
|
const result2 = await pullProject({
|
|
579316
|
-
projectDir:
|
|
579315
|
+
projectDir: import_node_path23.default.resolve(dir),
|
|
579317
579316
|
apiClient: new HttpSyncApiClient(serverUrl, token),
|
|
579318
579317
|
fs: new NodeFs()
|
|
579319
579318
|
});
|
|
@@ -579349,7 +579348,7 @@ program2.command("push [projectDir]").description("Push local changes to remote"
|
|
|
579349
579348
|
const serverUrl = await resolveServerUrl(globals, { projectDir: dir, required: true });
|
|
579350
579349
|
const token = getToken2(globals);
|
|
579351
579350
|
const result2 = await pushProject({
|
|
579352
|
-
projectDir:
|
|
579351
|
+
projectDir: import_node_path23.default.resolve(dir),
|
|
579353
579352
|
apiClient: new HttpSyncApiClient(serverUrl, token),
|
|
579354
579353
|
fs: new NodeFs(),
|
|
579355
579354
|
serverUrl,
|
|
@@ -579363,7 +579362,7 @@ program2.command("watch [projectDir]").description("Watch local changes and auto
|
|
|
579363
579362
|
const globals = program2.optsWithGlobals();
|
|
579364
579363
|
const serverUrl = await resolveServerUrl(globals, { projectDir: dir, required: true });
|
|
579365
579364
|
const token = getToken2(globals);
|
|
579366
|
-
const absProjectDir =
|
|
579365
|
+
const absProjectDir = import_node_path23.default.resolve(dir);
|
|
579367
579366
|
const handle2 = watchProject({
|
|
579368
579367
|
projectDir: absProjectDir,
|
|
579369
579368
|
apiClient: new HttpSyncApiClient(serverUrl, token),
|
|
@@ -579377,7 +579376,7 @@ program2.command("watch [projectDir]").description("Watch local changes and auto
|
|
|
579377
579376
|
console.error(err);
|
|
579378
579377
|
}
|
|
579379
579378
|
});
|
|
579380
|
-
console.log(`Watching ${
|
|
579379
|
+
console.log(`Watching ${import_node_path23.default.join(absProjectDir, "assets")} for changes...`);
|
|
579381
579380
|
console.log("Press Ctrl+C to stop");
|
|
579382
579381
|
await new Promise((resolve5) => {
|
|
579383
579382
|
const shutdown = () => {
|