@galacean/cli 2.0.0-alpha.12 → 2.0.0-alpha.15
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 +154 -140
- package/dist/viewport-client/_static/Accordion-930aedee.js +1 -0
- package/dist/viewport-client/_static/{AmbientLightAsset-f70b95f1.js → AmbientLightAsset-f9c1eb91.js} +2 -2
- package/dist/viewport-client/_static/AnimationClipAsset-61699477.js +1 -0
- package/dist/viewport-client/_static/AnimatorControllerAsset-1c05f4db.js +1 -0
- package/dist/viewport-client/_static/AnimatorStore-6a3679e5.js +1 -0
- package/dist/viewport-client/_static/{AssetViewer-bc198e16.js → AssetViewer-0ce46fa1.js} +1 -1
- package/dist/viewport-client/_static/AudioAsset-5127eeec.js +1 -0
- package/dist/viewport-client/_static/AudioComponent-18a3e59f.js +1 -0
- package/dist/viewport-client/_static/{Callout-cb4a55ff.js → Callout-b6ac1af7.js} +1 -1
- package/dist/viewport-client/_static/CameraComponent-0a115258.js +1 -0
- package/dist/viewport-client/_static/{Component-f923abb1.js → Component-746be670.js} +1 -1
- package/dist/viewport-client/_static/DirectLight-4c53e9f6.js +1 -0
- package/dist/viewport-client/_static/FontAsset-a3a92f7d.js +5 -0
- package/dist/viewport-client/_static/FormItemArray-a2f72cf1.js +6 -0
- package/dist/viewport-client/_static/{GlTFAsset-9c68f862.js → GlTFAsset-5f37feef.js} +9 -9
- package/dist/viewport-client/_static/IconEdit-2c768a0a.js +6 -0
- package/dist/viewport-client/_static/{IconPointFilled-a304fd34.js → IconPointFilled-209638e2.js} +1 -1
- package/dist/viewport-client/_static/LightBaseComponent-51d498ea.js +1 -0
- package/dist/viewport-client/_static/LottieAnimationComponent-bff0244b.js +1 -0
- package/dist/viewport-client/_static/LottieAsset-9d3ef507.js +6 -0
- package/dist/viewport-client/_static/MarkdownAsset-a17933fb.js +1 -0
- package/dist/viewport-client/_static/MaterialAsset-3b56ac00.js +1 -0
- package/dist/viewport-client/_static/MaterialInspector-a36197f2.js +1 -0
- package/dist/viewport-client/_static/Menu-0a7dbec0.js +17 -0
- package/dist/viewport-client/_static/MeshAsset-2cf47eb2.js +1 -0
- package/dist/viewport-client/_static/MeshRendererBaseComponent-4a3af376.js +1 -0
- package/dist/viewport-client/_static/MeshRendererComponent-ac4c3954.js +1 -0
- package/dist/viewport-client/_static/{MeshThumbnail-49273f71.js → MeshThumbnail-25cd4a13.js} +1 -1
- package/dist/viewport-client/_static/ParticleRendererComponent-0a470dee.js +26 -0
- package/dist/viewport-client/_static/PhysicsMaterialAsset-d87d35aa.js +1 -0
- package/dist/viewport-client/_static/PhysicsStore-c283b2be.js +1 -0
- package/dist/viewport-client/_static/PointLight-b7de209f.js +1 -0
- package/dist/viewport-client/_static/PostProcessComponent-d4c9ef58.js +6 -0
- package/dist/viewport-client/_static/PrefabAsset-d0c0cd25.js +1 -0
- package/dist/viewport-client/_static/PrimitiveMesh-35092ad0.js +1 -0
- package/dist/viewport-client/_static/ProxyConfigs-ad92ebc7.js +1 -0
- package/dist/viewport-client/_static/{ReferencedMaterial-a87818f3.js → ReferencedMaterial-800a1955.js} +1 -1
- package/dist/viewport-client/_static/RenderTargetAsset-a003f9f5.js +1 -0
- package/dist/viewport-client/_static/SceneAsset-87f2ea92.js +1 -0
- package/dist/viewport-client/_static/{ShaderAsset-cb3ff628.js → ShaderAsset-98ce1f70.js} +6 -6
- package/dist/viewport-client/_static/ShaderChunkAsset-e9072307.js +5 -0
- package/dist/viewport-client/_static/{ShaderUIScriptAsset-d13fa4e2.js → ShaderUIScriptAsset-ac824e68.js} +5 -5
- package/dist/viewport-client/_static/SkinnedMeshRendererComponent-5f34bf46.js +1 -0
- package/dist/viewport-client/_static/SpineAnimationComponent-7c5db747.js +1 -0
- package/dist/viewport-client/_static/SpineSkeletonDataAsset-5b202ba0.js +1 -0
- package/dist/viewport-client/_static/SpotLight-2b4e593e.js +1 -0
- package/dist/viewport-client/_static/SpriteAsset-4e895da5.js +6 -0
- package/dist/viewport-client/_static/SpriteAtlasAsset-c2894c12.js +1 -0
- package/dist/viewport-client/_static/SpriteBaseComponent-a75e84c1.js +1 -0
- package/dist/viewport-client/_static/SpriteMaskComponent-a31f3384.js +1 -0
- package/dist/viewport-client/_static/SpriteRendererComponent-c2123918.js +1 -0
- package/dist/viewport-client/_static/{TextBaseComponent-69233798.js → TextBaseComponent-95846acf.js} +2 -2
- package/dist/viewport-client/_static/TextRendererComponent-429cf17b.js +1 -0
- package/dist/viewport-client/_static/TextureAsset-93475ade.js +36 -0
- package/dist/viewport-client/_static/Tooltip-dfde37c6.js +1 -0
- package/dist/viewport-client/_static/TrailRendererComponent-112b1618.js +1 -0
- package/dist/viewport-client/_static/TransformBaseComponent-a8050787.js +1 -0
- package/dist/viewport-client/_static/TransformComponent-c95e25c2.js +1 -0
- package/dist/viewport-client/_static/XRReferenceImageAsset-dbf129aa.js +1 -0
- package/dist/viewport-client/_static/audio-10589bb4.js +1 -0
- package/dist/viewport-client/_static/glTFIO-79bbca27.js +1 -0
- package/dist/viewport-client/_static/index-010da0b3.js +1 -0
- package/dist/viewport-client/_static/index-07bbf729.js +31 -0
- package/dist/viewport-client/_static/index-1e23212d.js +11487 -0
- package/dist/viewport-client/_static/index-2cdbb69f.js +1 -0
- package/dist/viewport-client/_static/index-31b7a6d3.js +1 -0
- package/dist/viewport-client/_static/index-3439012b.js +1 -0
- package/dist/viewport-client/_static/index-48760ac4.js +2 -0
- package/dist/viewport-client/_static/index-65a103b6.js +1 -0
- package/dist/viewport-client/_static/{index-e46ec5b1.js → index-77b1de5c.js} +7 -7
- package/dist/viewport-client/_static/index-92830754.js +1 -0
- package/dist/viewport-client/_static/{index-237c84cd.js → index-93eab932.js} +3 -3
- package/dist/viewport-client/_static/index-b259cf2e.js +1 -0
- package/dist/viewport-client/_static/{index-98982ce2.js → index-b2e1cba4.js} +1 -1
- package/dist/viewport-client/_static/index-b7bf2586.js +1 -0
- package/dist/viewport-client/_static/index-c20fc198.js +1 -0
- package/dist/viewport-client/_static/index-dc62ba4b.js +1 -0
- package/dist/viewport-client/_static/index-ea9ea505.js +1 -0
- package/dist/viewport-client/_static/ktx2-encoder-075abd75.js +1 -0
- package/dist/viewport-client/_static/{module-6406b050.js → module-251ecc50.js} +1 -1
- package/dist/viewport-client/_static/{module-107b7430.js → module-498119f3.js} +1 -1
- package/dist/viewport-client/_static/{module-5c85b07e.js → module-c6e2d190.js} +1 -1
- package/dist/viewport-client/_static/postmen-9e1e15bd.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
|
|
|
@@ -354275,7 +354273,7 @@ async function startViewportServer(options) {
|
|
|
354275
354273
|
let port = options.port ?? 4310;
|
|
354276
354274
|
const projectId = options.projectId ?? "local";
|
|
354277
354275
|
const eventClients = /* @__PURE__ */ new Set();
|
|
354278
|
-
const watcher = new FileWatcher2({ watchDir:
|
|
354276
|
+
const watcher = new FileWatcher2({ watchDir: import_node_path20.default.resolve(options.projectDir, "assets") });
|
|
354279
354277
|
const suppressedWatcherPaths = /* @__PURE__ */ new Map();
|
|
354280
354278
|
watcher.onChange((paths) => {
|
|
354281
354279
|
const filteredPaths = filterSuppressedWatcherPaths(paths);
|
|
@@ -354372,9 +354370,9 @@ async function startViewportServer(options) {
|
|
|
354372
354370
|
}
|
|
354373
354371
|
if (req.method === "GET" && url2.pathname.startsWith("/assets/")) {
|
|
354374
354372
|
const relativePath2 = decodeURIComponent(url2.pathname.slice("/assets/".length));
|
|
354375
|
-
const filePath =
|
|
354376
|
-
const projectRoot =
|
|
354377
|
-
if (!filePath.startsWith(projectRoot +
|
|
354373
|
+
const filePath = import_node_path20.default.resolve(options.projectDir, relativePath2);
|
|
354374
|
+
const projectRoot = import_node_path20.default.resolve(options.projectDir);
|
|
354375
|
+
if (!filePath.startsWith(projectRoot + import_node_path20.default.sep) && filePath !== projectRoot) {
|
|
354378
354376
|
res.writeHead(403, { "content-type": "text/plain; charset=utf-8" });
|
|
354379
354377
|
res.end("Forbidden: path outside project directory");
|
|
354380
354378
|
return;
|
|
@@ -354391,8 +354389,8 @@ async function startViewportServer(options) {
|
|
|
354391
354389
|
}
|
|
354392
354390
|
if (req.method === "GET" && options.clientDir) {
|
|
354393
354391
|
const filePath = url2.pathname === "/" ? "/index.html" : url2.pathname;
|
|
354394
|
-
const resolved =
|
|
354395
|
-
if (resolved.startsWith(
|
|
354392
|
+
const resolved = import_node_path20.default.resolve(options.clientDir, filePath.slice(1));
|
|
354393
|
+
if (resolved.startsWith(import_node_path20.default.resolve(options.clientDir))) {
|
|
354396
354394
|
try {
|
|
354397
354395
|
const content = await (0, import_promises15.readFile)(resolved);
|
|
354398
354396
|
res.writeHead(200, { "content-type": resolveStaticContentType(resolved) });
|
|
@@ -354404,7 +354402,7 @@ async function startViewportServer(options) {
|
|
|
354404
354402
|
}
|
|
354405
354403
|
if (req.method === "GET" && options.clientDir) {
|
|
354406
354404
|
try {
|
|
354407
|
-
const content = await (0, import_promises15.readFile)(
|
|
354405
|
+
const content = await (0, import_promises15.readFile)(import_node_path20.default.join(options.clientDir, "index.html"));
|
|
354408
354406
|
res.writeHead(200, { "content-type": "text/html; charset=utf-8" });
|
|
354409
354407
|
res.end(content);
|
|
354410
354408
|
return;
|
|
@@ -354450,15 +354448,15 @@ async function writeProjectAsset(options) {
|
|
|
354450
354448
|
if (!entry?.path) {
|
|
354451
354449
|
throw new Error(`asset entry not found for serverId=${options.assetServerId}`);
|
|
354452
354450
|
}
|
|
354453
|
-
const projectRoot =
|
|
354454
|
-
const mainPath =
|
|
354455
|
-
if (!mainPath.startsWith(projectRoot +
|
|
354451
|
+
const projectRoot = import_node_path20.default.resolve(options.projectDir);
|
|
354452
|
+
const mainPath = import_node_path20.default.resolve(projectRoot, entry.path);
|
|
354453
|
+
if (!mainPath.startsWith(projectRoot + import_node_path20.default.sep) && mainPath !== projectRoot) {
|
|
354456
354454
|
throw new Error("asset path outside project directory");
|
|
354457
354455
|
}
|
|
354458
|
-
const watchRoot =
|
|
354456
|
+
const watchRoot = import_node_path20.default.resolve(projectRoot, "assets");
|
|
354459
354457
|
const suppressedWatcherPaths = /* @__PURE__ */ new Set();
|
|
354460
354458
|
const registerSuppressedPath = (filePath) => {
|
|
354461
|
-
const relativePath2 =
|
|
354459
|
+
const relativePath2 = import_node_path20.default.relative(watchRoot, filePath).replaceAll("\\", "/");
|
|
354462
354460
|
if (relativePath2 && !relativePath2.startsWith("../")) {
|
|
354463
354461
|
suppressedWatcherPaths.add(relativePath2);
|
|
354464
354462
|
}
|
|
@@ -354485,7 +354483,7 @@ async function writeProjectAsset(options) {
|
|
|
354485
354483
|
};
|
|
354486
354484
|
}
|
|
354487
354485
|
function resolveStaticContentType(filePath) {
|
|
354488
|
-
const ext =
|
|
354486
|
+
const ext = import_node_path20.default.extname(filePath).toLowerCase();
|
|
354489
354487
|
switch (ext) {
|
|
354490
354488
|
case ".html":
|
|
354491
354489
|
return "text/html; charset=utf-8";
|
|
@@ -354513,7 +354511,7 @@ function resolveAssetContentType(filePath) {
|
|
|
354513
354511
|
if (normalizedFilePath.endsWith(".meta.json") || normalizedFilePath.endsWith(".json") || normalizedFilePath.endsWith(".scene") || normalizedFilePath.endsWith(".mat")) {
|
|
354514
354512
|
return "application/json; charset=utf-8";
|
|
354515
354513
|
}
|
|
354516
|
-
switch (
|
|
354514
|
+
switch (import_node_path20.default.extname(normalizedFilePath)) {
|
|
354517
354515
|
case ".js":
|
|
354518
354516
|
case ".mjs":
|
|
354519
354517
|
case ".ts":
|
|
@@ -354568,12 +354566,12 @@ async function listenWithPortFallback(server, preferredPort) {
|
|
|
354568
354566
|
}
|
|
354569
354567
|
throw new Error(`No available port found (tried ${preferredPort}\u2013${preferredPort + MAX_PORT_ATTEMPTS - 1})`);
|
|
354570
354568
|
}
|
|
354571
|
-
var import_node_http,
|
|
354569
|
+
var import_node_http, import_node_path20, import_promises15, MAX_PORT_ATTEMPTS;
|
|
354572
354570
|
var init_runtime_server = __esm({
|
|
354573
354571
|
"../cli-viewport/src/server/runtime-server.ts"() {
|
|
354574
354572
|
"use strict";
|
|
354575
354573
|
import_node_http = __toESM(require("node:http"));
|
|
354576
|
-
|
|
354574
|
+
import_node_path20 = __toESM(require("node:path"));
|
|
354577
354575
|
import_promises15 = require("node:fs/promises");
|
|
354578
354576
|
init_file_watcher();
|
|
354579
354577
|
init_read_manifest();
|
|
@@ -362912,12 +362910,19 @@ var init_AssetManager = __esm({
|
|
|
362912
362910
|
// 本地临时引用
|
|
362913
362911
|
meta: params ?? {}
|
|
362914
362912
|
});
|
|
362915
|
-
|
|
362913
|
+
let asset3 = this.assets[mainId];
|
|
362916
362914
|
if (!asset3) {
|
|
362917
|
-
const
|
|
362918
|
-
|
|
362919
|
-
|
|
362920
|
-
|
|
362915
|
+
const assetState = this.root.domainStore.state.assets[mainId];
|
|
362916
|
+
if (assetState) {
|
|
362917
|
+
this.createEditorAssetFromState(mainId, assetState);
|
|
362918
|
+
asset3 = this.assets[mainId];
|
|
362919
|
+
}
|
|
362920
|
+
if (!asset3) {
|
|
362921
|
+
const error49 = new Error(`EditorAsset not found after createAssetByAdd: ${mainId}`);
|
|
362922
|
+
this.root.assetFacade.markAssetError(mainId, error49.message);
|
|
362923
|
+
this.root.assetUIStore.isUploading = false;
|
|
362924
|
+
throw error49;
|
|
362925
|
+
}
|
|
362921
362926
|
}
|
|
362922
362927
|
await this.completeCreateAssetByAddUpload({
|
|
362923
362928
|
assetId: mainId,
|
|
@@ -378300,7 +378305,7 @@ var init_iteratee = __esm({
|
|
|
378300
378305
|
});
|
|
378301
378306
|
|
|
378302
378307
|
// ../../node_modules/lodash-es/join.js
|
|
378303
|
-
function
|
|
378308
|
+
function join5(array2, separator) {
|
|
378304
378309
|
return array2 == null ? "" : nativeJoin.call(array2, separator);
|
|
378305
378310
|
}
|
|
378306
378311
|
var arrayProto2, nativeJoin, join_default;
|
|
@@ -378308,7 +378313,7 @@ var init_join = __esm({
|
|
|
378308
378313
|
"../../node_modules/lodash-es/join.js"() {
|
|
378309
378314
|
arrayProto2 = Array.prototype;
|
|
378310
378315
|
nativeJoin = arrayProto2.join;
|
|
378311
|
-
join_default =
|
|
378316
|
+
join_default = join5;
|
|
378312
378317
|
}
|
|
378313
378318
|
});
|
|
378314
378319
|
|
|
@@ -423170,14 +423175,14 @@ var init_account = __esm({
|
|
|
423170
423175
|
});
|
|
423171
423176
|
|
|
423172
423177
|
// ../service/src/ai.ts
|
|
423173
|
-
var import_crypto2,
|
|
423178
|
+
var import_crypto2, import_meta, createSSEConnection, maya, AIAPI, ai;
|
|
423174
423179
|
var init_ai = __esm({
|
|
423175
423180
|
"../service/src/ai.ts"() {
|
|
423176
423181
|
"use strict";
|
|
423177
423182
|
init_esm_node();
|
|
423178
423183
|
import_crypto2 = require("crypto");
|
|
423179
423184
|
init_src11();
|
|
423180
|
-
|
|
423185
|
+
import_meta = {};
|
|
423181
423186
|
createSSEConnection = (url2, callbacks) => {
|
|
423182
423187
|
const sse = new EventSource(url2, { withCredentials: true });
|
|
423183
423188
|
let connected = false;
|
|
@@ -423303,7 +423308,7 @@ var init_ai = __esm({
|
|
|
423303
423308
|
});
|
|
423304
423309
|
}
|
|
423305
423310
|
async uploadImage(blob) {
|
|
423306
|
-
const env =
|
|
423311
|
+
const env = import_meta.env;
|
|
423307
423312
|
const publicKey = env.VITE_PUBLIC_KEY;
|
|
423308
423313
|
const form = new FormData();
|
|
423309
423314
|
const message = "upload";
|
|
@@ -513225,6 +513230,9 @@ var init_UIProjection = __esm({
|
|
|
513225
513230
|
for (const [id, asset3] of Object.entries(state.assets)) {
|
|
513226
513231
|
const readModel = this.createAssetReadModel(id, asset3);
|
|
513227
513232
|
this.readModelStore.setAsset(id, readModel);
|
|
513233
|
+
if (this.assetStore && !this.assetStore.assets[id]) {
|
|
513234
|
+
this.assetStore.createEditorAssetFromState?.(id, asset3);
|
|
513235
|
+
}
|
|
513228
513236
|
if (asset3.parentFolderId) {
|
|
513229
513237
|
const children = folderChildrenMap.get(asset3.parentFolderId) ?? [];
|
|
513230
513238
|
children.push(id);
|
|
@@ -516183,7 +516191,7 @@ var init_KTX2Cache = __esm({
|
|
|
516183
516191
|
});
|
|
516184
516192
|
|
|
516185
516193
|
// ../../plugins/main/src/assets/texture/ktx2-encoder.ts
|
|
516186
|
-
var import_js_md54,
|
|
516194
|
+
var import_js_md54, import_meta2, log7, KTX2Encoder, ktx2Encoder;
|
|
516187
516195
|
var init_ktx2_encoder = __esm({
|
|
516188
516196
|
"../../plugins/main/src/assets/texture/ktx2-encoder.ts"() {
|
|
516189
516197
|
"use strict";
|
|
@@ -516191,14 +516199,14 @@ var init_ktx2_encoder = __esm({
|
|
|
516191
516199
|
init_KTX2Cache();
|
|
516192
516200
|
init_src11();
|
|
516193
516201
|
init_src4();
|
|
516194
|
-
|
|
516202
|
+
import_meta2 = {};
|
|
516195
516203
|
log7 = logger("ktx2");
|
|
516196
516204
|
KTX2Encoder = class {
|
|
516197
516205
|
encoderWorkerPool;
|
|
516198
516206
|
initPromise;
|
|
516199
516207
|
constructor() {
|
|
516200
516208
|
this.encoderWorkerPool = new WorkerPool(4, () => {
|
|
516201
|
-
return new Worker(new URL("./ktx2-worker.ts",
|
|
516209
|
+
return new Worker(new URL("./ktx2-worker.ts", import_meta2.url), { type: "module" });
|
|
516202
516210
|
});
|
|
516203
516211
|
this.initPromise = this.encoderWorkerPool.prepareWorker();
|
|
516204
516212
|
}
|
|
@@ -528794,7 +528802,7 @@ var require_main34 = __commonJS({
|
|
|
528794
528802
|
_proto.get = function get5(path23) {
|
|
528795
528803
|
return this.cache.assets[this.pathPrefix + path23];
|
|
528796
528804
|
};
|
|
528797
|
-
_proto.require = function
|
|
528805
|
+
_proto.require = function require2(path23) {
|
|
528798
528806
|
path23 = this.pathPrefix + path23;
|
|
528799
528807
|
var asset3 = this.cache.assets[path23];
|
|
528800
528808
|
if (asset3)
|
|
@@ -568492,7 +568500,13 @@ function createRuntimeBootstrapPlan({
|
|
|
568492
568500
|
componentTypes,
|
|
568493
568501
|
unknownAssetTypes,
|
|
568494
568502
|
unknownComponentTypes,
|
|
568495
|
-
|
|
568503
|
+
// Always include runtime-created asset modules that aren't present in the initial
|
|
568504
|
+
// project but may be dynamically created later (e.g. AmbientLight is created
|
|
568505
|
+
// by EditorScene.bake() when a scene re-initializes).
|
|
568506
|
+
assetModuleKeys: unique([
|
|
568507
|
+
...assetTypes.map((type) => ASSET_MODULE_KEYS_BY_TYPE[type]).filter(Boolean),
|
|
568508
|
+
"ambient-light"
|
|
568509
|
+
]).sort(),
|
|
568496
568510
|
componentModuleKeys: unique(
|
|
568497
568511
|
componentTypes.map((type) => COMPONENT_MODULE_KEYS_BY_TYPE[type]).filter(Boolean)
|
|
568498
568512
|
).sort(),
|
|
@@ -568630,7 +568644,7 @@ async function startClientHost(options) {
|
|
|
568630
568644
|
const host = options.host ?? "127.0.0.1";
|
|
568631
568645
|
const port = options.clientPort ?? 4312;
|
|
568632
568646
|
const workspaceRoot = await findWorkspaceRoot();
|
|
568633
|
-
const configPath =
|
|
568647
|
+
const configPath = import_node_path21.default.join(workspaceRoot, "packages/cli-viewport/vite.config.ts");
|
|
568634
568648
|
const viteBin = await resolveViteBin(workspaceRoot);
|
|
568635
568649
|
await (0, import_promises16.access)(configPath);
|
|
568636
568650
|
const child = (0, import_node_child_process2.spawn)(
|
|
@@ -568674,13 +568688,13 @@ async function findWorkspaceRoot() {
|
|
|
568674
568688
|
for (const startDir of startDirs) {
|
|
568675
568689
|
let current = startDir;
|
|
568676
568690
|
while (true) {
|
|
568677
|
-
const marker16 =
|
|
568691
|
+
const marker16 = import_node_path21.default.join(current, "pnpm-workspace.yaml");
|
|
568678
568692
|
try {
|
|
568679
568693
|
await (0, import_promises16.access)(marker16);
|
|
568680
|
-
await (0, import_promises16.access)(
|
|
568694
|
+
await (0, import_promises16.access)(import_node_path21.default.join(current, "packages/cli-viewport/vite.config.ts"));
|
|
568681
568695
|
return current;
|
|
568682
568696
|
} catch {
|
|
568683
|
-
const parent2 =
|
|
568697
|
+
const parent2 = import_node_path21.default.dirname(current);
|
|
568684
568698
|
if (parent2 === current)
|
|
568685
568699
|
break;
|
|
568686
568700
|
current = parent2;
|
|
@@ -568692,13 +568706,13 @@ async function findWorkspaceRoot() {
|
|
|
568692
568706
|
);
|
|
568693
568707
|
}
|
|
568694
568708
|
async function resolveViteBin(workspaceRoot) {
|
|
568695
|
-
const vitePackageJson =
|
|
568709
|
+
const vitePackageJson = import_node_path21.default.join(workspaceRoot, "node_modules/vite/package.json");
|
|
568696
568710
|
const raw = await (0, import_promises16.readFile)(vitePackageJson, "utf-8");
|
|
568697
568711
|
const pkg = JSON.parse(raw);
|
|
568698
568712
|
const relativeBin = typeof pkg.bin === "string" ? pkg.bin : pkg.bin?.vite;
|
|
568699
568713
|
if (!relativeBin)
|
|
568700
568714
|
throw new Error("Unable to resolve Vite CLI entry");
|
|
568701
|
-
return
|
|
568715
|
+
return import_node_path21.default.join(import_node_path21.default.dirname(vitePackageJson), relativeBin);
|
|
568702
568716
|
}
|
|
568703
568717
|
async function waitForReady(options) {
|
|
568704
568718
|
const startedAt = Date.now();
|
|
@@ -568741,18 +568755,18 @@ function buildClientWarmupUrls(options) {
|
|
|
568741
568755
|
"/ViewportRuntime.ts"
|
|
568742
568756
|
];
|
|
568743
568757
|
const fsEntries = [
|
|
568744
|
-
|
|
568745
|
-
|
|
568758
|
+
import_node_path21.default.join(options.workspaceRoot, "packages/model/src/runtime-bootstrap.ts"),
|
|
568759
|
+
import_node_path21.default.join(options.workspaceRoot, "packages/model/src/runtime-browser.ts")
|
|
568746
568760
|
];
|
|
568747
568761
|
const selectiveEntries = options.plan ? resolveWarmupEntryPathsForPlan(options.plan) : [];
|
|
568748
568762
|
return unique([
|
|
568749
568763
|
...runtimeRootEntries.map((entry) => `${baseUrl}${entry}`),
|
|
568750
568764
|
...fsEntries.map((entry) => `${baseUrl}/@fs/${normalizeFsPath(entry)}`),
|
|
568751
|
-
...selectiveEntries.map((entry) => `${baseUrl}/@fs/${normalizeFsPath(
|
|
568765
|
+
...selectiveEntries.map((entry) => `${baseUrl}/@fs/${normalizeFsPath(import_node_path21.default.join(options.workspaceRoot, entry))}`)
|
|
568752
568766
|
]);
|
|
568753
568767
|
}
|
|
568754
568768
|
function normalizeFsPath(value) {
|
|
568755
|
-
const normalized = value.split(
|
|
568769
|
+
const normalized = value.split(import_node_path21.default.sep).join("/");
|
|
568756
568770
|
return normalized.startsWith("/") ? normalized.slice(1) : normalized;
|
|
568757
568771
|
}
|
|
568758
568772
|
function resolveWarmupEntryPathsForPlan(plan) {
|
|
@@ -568793,12 +568807,12 @@ async function stopChild(child) {
|
|
|
568793
568807
|
}, 2e3).unref();
|
|
568794
568808
|
});
|
|
568795
568809
|
}
|
|
568796
|
-
var import_promises16,
|
|
568810
|
+
var import_promises16, import_node_path21, import_node_process2, import_node_child_process2, CLIENT_WARMUP_TIMEOUT_MS, PROJECT_QUERY_TIMEOUT_MS;
|
|
568797
568811
|
var init_client_host = __esm({
|
|
568798
568812
|
"../cli-viewport/src/server/client-host.ts"() {
|
|
568799
568813
|
"use strict";
|
|
568800
568814
|
import_promises16 = require("node:fs/promises");
|
|
568801
|
-
|
|
568815
|
+
import_node_path21 = __toESM(require("node:path"));
|
|
568802
568816
|
import_node_process2 = __toESM(require("node:process"));
|
|
568803
568817
|
import_node_child_process2 = require("node:child_process");
|
|
568804
568818
|
init_runtime_project_context();
|
|
@@ -568837,7 +568851,7 @@ var init_src20 = __esm({
|
|
|
568837
568851
|
|
|
568838
568852
|
// src/cli.ts
|
|
568839
568853
|
var import_node_os2 = __toESM(require("node:os"));
|
|
568840
|
-
var
|
|
568854
|
+
var import_node_path23 = __toESM(require("node:path"));
|
|
568841
568855
|
var import_node_process3 = __toESM(require("node:process"));
|
|
568842
568856
|
|
|
568843
568857
|
// node_modules/commander/esm.mjs
|
|
@@ -570078,7 +570092,7 @@ function registerAssetTree(parent2) {
|
|
|
570078
570092
|
}
|
|
570079
570093
|
|
|
570080
570094
|
// src/commands/build.ts
|
|
570081
|
-
var
|
|
570095
|
+
var import_node_path11 = __toESM(require("node:path"));
|
|
570082
570096
|
function parseKtx2Quality(raw) {
|
|
570083
570097
|
if (raw == null)
|
|
570084
570098
|
return void 0;
|
|
@@ -570099,8 +570113,8 @@ function registerBuildCommand(program3) {
|
|
|
570099
570113
|
try {
|
|
570100
570114
|
const { buildProject: buildProject2 } = await Promise.resolve().then(() => (init_cli_builder(), cli_builder_exports));
|
|
570101
570115
|
await buildProject2({
|
|
570102
|
-
projectDir:
|
|
570103
|
-
output:
|
|
570116
|
+
projectDir: import_node_path11.default.resolve(dir),
|
|
570117
|
+
output: import_node_path11.default.resolve(cmdOpts.output),
|
|
570104
570118
|
ktx2: cmdOpts.ktx2 ?? false,
|
|
570105
570119
|
ktx2Mode: cmdOpts.ktx2Mode,
|
|
570106
570120
|
ktx2Quality,
|
|
@@ -577921,7 +577935,7 @@ var uiMessagesSchema = lazyValidator(
|
|
|
577921
577935
|
|
|
577922
577936
|
// src/commands/chat.ts
|
|
577923
577937
|
var import_promises11 = require("node:fs/promises");
|
|
577924
|
-
var
|
|
577938
|
+
var import_node_path13 = require("node:path");
|
|
577925
577939
|
init_constants();
|
|
577926
577940
|
var AGENT_NAME = "editorAgent";
|
|
577927
577941
|
var EXTRA_CONTEXT = { selectedEntityIds: "", selectedAssetIds: "", userLanguage: "zh" };
|
|
@@ -577962,7 +577976,7 @@ function classifyChatError(error49, loopExceeded) {
|
|
|
577962
577976
|
return "MODEL_FAIL";
|
|
577963
577977
|
}
|
|
577964
577978
|
async function writeResultJson(resultJsonPath, result2) {
|
|
577965
|
-
await (0, import_promises11.mkdir)((0,
|
|
577979
|
+
await (0, import_promises11.mkdir)((0, import_node_path13.dirname)(resultJsonPath), { recursive: true });
|
|
577966
577980
|
await (0, import_promises11.writeFile)(resultJsonPath, JSON.stringify(result2, null, 2));
|
|
577967
577981
|
}
|
|
577968
577982
|
async function createThread(serverUrl, token, projectId) {
|
|
@@ -578262,7 +578276,7 @@ function registerChatCommand(program3) {
|
|
|
578262
578276
|
|
|
578263
578277
|
// src/commands/create.ts
|
|
578264
578278
|
var import_promises12 = require("node:fs/promises");
|
|
578265
|
-
var
|
|
578279
|
+
var import_node_path14 = __toESM(require("node:path"));
|
|
578266
578280
|
init_manifest();
|
|
578267
578281
|
init_meta_file();
|
|
578268
578282
|
init_path_tree();
|
|
@@ -578942,14 +578956,14 @@ function buildDefaultScene(platform2) {
|
|
|
578942
578956
|
async function createProject(opts) {
|
|
578943
578957
|
const { name: name16, platform: platform2 = "3d", engineVersion = "2.0.0-alpha.25", force = false } = opts;
|
|
578944
578958
|
const outputDir = opts.outputDir ?? `./${slugify2(name16)}`;
|
|
578945
|
-
const absDir =
|
|
578959
|
+
const absDir = import_node_path14.default.resolve(outputDir);
|
|
578946
578960
|
await (0, import_promises12.mkdir)(absDir, { recursive: true });
|
|
578947
578961
|
if (!force) {
|
|
578948
578962
|
await assertNodeDirectoryEmpty(absDir);
|
|
578949
578963
|
} else {
|
|
578950
578964
|
await resetNodeManagedProjectPaths(absDir);
|
|
578951
578965
|
}
|
|
578952
|
-
await (0, import_promises12.mkdir)(
|
|
578966
|
+
await (0, import_promises12.mkdir)(import_node_path14.default.join(absDir, ".galacean/cache"), { recursive: true });
|
|
578953
578967
|
const sceneJson = JSON.stringify(buildDefaultScene(platform2), null, 2);
|
|
578954
578968
|
const sceneAsset = {
|
|
578955
578969
|
id: `local-${DEFAULT_SCENE_ID}`,
|
|
@@ -578965,22 +578979,22 @@ async function createProject(opts) {
|
|
|
578965
578979
|
const contentHashes = /* @__PURE__ */ new Map();
|
|
578966
578980
|
for (const [, entry] of pathMap) {
|
|
578967
578981
|
if (entry.isFolder) {
|
|
578968
|
-
await (0, import_promises12.mkdir)(
|
|
578982
|
+
await (0, import_promises12.mkdir)(import_node_path14.default.join(absDir, entry.localPath), { recursive: true });
|
|
578969
578983
|
}
|
|
578970
578984
|
}
|
|
578971
578985
|
const sceneEntry = pathMap.get(DEFAULT_SCENE_ID);
|
|
578972
|
-
await (0, import_promises12.writeFile)(
|
|
578986
|
+
await (0, import_promises12.writeFile)(import_node_path14.default.join(absDir, sceneEntry.localPath), sceneJson);
|
|
578973
578987
|
contentHashes.set(DEFAULT_SCENE_ID, md5Text(sceneJson));
|
|
578974
578988
|
for (const [, entry] of pathMap) {
|
|
578975
578989
|
const meta4 = generateMetaFile(entry);
|
|
578976
|
-
const metaPath =
|
|
578977
|
-
await (0, import_promises12.mkdir)(
|
|
578990
|
+
const metaPath = import_node_path14.default.join(absDir, metaFilePath(entry.localPath));
|
|
578991
|
+
await (0, import_promises12.mkdir)(import_node_path14.default.dirname(metaPath), { recursive: true });
|
|
578978
578992
|
await (0, import_promises12.writeFile)(metaPath, JSON.stringify(meta4, null, 2));
|
|
578979
578993
|
}
|
|
578980
578994
|
const manifest = generateManifest(pathMap, contentHashes);
|
|
578981
|
-
await (0, import_promises12.writeFile)(
|
|
578995
|
+
await (0, import_promises12.writeFile)(import_node_path14.default.join(absDir, ".galacean/manifest.json"), JSON.stringify(manifest, null, 2));
|
|
578982
578996
|
const projectConfig = { name: name16, platform: platform2, engineVersion, sceneId: DEFAULT_SCENE_ID };
|
|
578983
|
-
await (0, import_promises12.writeFile)(
|
|
578997
|
+
await (0, import_promises12.writeFile)(import_node_path14.default.join(absDir, "project.galacean"), JSON.stringify(projectConfig, null, 2));
|
|
578984
578998
|
return { outputDir };
|
|
578985
578999
|
}
|
|
578986
579000
|
function registerCreateCommand(program3) {
|
|
@@ -578992,12 +579006,12 @@ function registerCreateCommand(program3) {
|
|
|
578992
579006
|
engineVersion: options.engineVersion,
|
|
578993
579007
|
force: options.force
|
|
578994
579008
|
});
|
|
578995
|
-
console.log(`Project created at: ${
|
|
579009
|
+
console.log(`Project created at: ${import_node_path14.default.resolve(outputDir)}`);
|
|
578996
579010
|
});
|
|
578997
579011
|
}
|
|
578998
579012
|
|
|
578999
579013
|
// src/commands/invoke.ts
|
|
579000
|
-
var
|
|
579014
|
+
var import_node_path16 = __toESM(require("node:path"));
|
|
579001
579015
|
|
|
579002
579016
|
// src/commands/headless-tool-support.ts
|
|
579003
579017
|
var UNSUPPORTED_HEADLESS_TOOL_IDS = /* @__PURE__ */ new Set();
|
|
@@ -579050,7 +579064,7 @@ async function invokeTool(options) {
|
|
|
579050
579064
|
}
|
|
579051
579065
|
}
|
|
579052
579066
|
const { createHeadlessSession: createHeadlessSession2 } = await Promise.resolve().then(() => (init_chat_headless(), chat_headless_exports));
|
|
579053
|
-
const projectDir =
|
|
579067
|
+
const projectDir = import_node_path16.default.resolve(options.projectDir);
|
|
579054
579068
|
const session = await createHeadlessSession2(projectDir);
|
|
579055
579069
|
const result2 = await session.invoke(options.toolId, params, { undoLabel: `invoke:${options.toolId}` });
|
|
579056
579070
|
const saved = !options.dryRun && session.isDirty();
|
|
@@ -579063,7 +579077,7 @@ function registerInvokeCommand(program3) {
|
|
|
579063
579077
|
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
579078
|
try {
|
|
579065
579079
|
const result2 = await invokeTool({
|
|
579066
|
-
projectDir:
|
|
579080
|
+
projectDir: import_node_path16.default.resolve(opts.project),
|
|
579067
579081
|
toolId,
|
|
579068
579082
|
params: paramsStr,
|
|
579069
579083
|
list: opts.list,
|
|
@@ -579085,7 +579099,7 @@ function registerInvokeCommand(program3) {
|
|
|
579085
579099
|
|
|
579086
579100
|
// src/commands/exec.ts
|
|
579087
579101
|
var import_promises13 = require("node:fs/promises");
|
|
579088
|
-
var
|
|
579102
|
+
var import_node_path17 = __toESM(require("node:path"));
|
|
579089
579103
|
async function readAllStdin() {
|
|
579090
579104
|
const chunks = [];
|
|
579091
579105
|
for await (const chunk2 of process.stdin) {
|
|
@@ -579122,7 +579136,7 @@ async function executeProjectCode(options) {
|
|
|
579122
579136
|
}
|
|
579123
579137
|
async function resolveExecuteCode(filePath, inlineCode) {
|
|
579124
579138
|
if (filePath) {
|
|
579125
|
-
return (0, import_promises13.readFile)(
|
|
579139
|
+
return (0, import_promises13.readFile)(import_node_path17.default.resolve(filePath), "utf-8");
|
|
579126
579140
|
}
|
|
579127
579141
|
if (inlineCode) {
|
|
579128
579142
|
return inlineCode;
|
|
@@ -579139,7 +579153,7 @@ function registerExecCommand(program3) {
|
|
|
579139
579153
|
try {
|
|
579140
579154
|
const code = await resolveExecuteCode(opts.file, inlineCode);
|
|
579141
579155
|
const result2 = await executeProjectCode({
|
|
579142
|
-
projectDir:
|
|
579156
|
+
projectDir: import_node_path17.default.resolve(opts.project),
|
|
579143
579157
|
code,
|
|
579144
579158
|
dryRun: opts.dryRun,
|
|
579145
579159
|
saveOnError: opts.saveOnError
|
|
@@ -579165,13 +579179,13 @@ function registerExecCommand(program3) {
|
|
|
579165
579179
|
}
|
|
579166
579180
|
|
|
579167
579181
|
// src/commands/viewport.ts
|
|
579168
|
-
var
|
|
579182
|
+
var import_node_path22 = __toESM(require("node:path"));
|
|
579169
579183
|
var import_promises17 = require("node:fs/promises");
|
|
579170
579184
|
init_src20();
|
|
579171
579185
|
init_local_project();
|
|
579172
579186
|
function registerViewportCommand(parent2) {
|
|
579173
579187
|
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 =
|
|
579188
|
+
const dir = import_node_path22.default.resolve(projectDir ?? process.cwd());
|
|
579175
579189
|
await (0, import_promises17.access)(dir);
|
|
579176
579190
|
const projectId = await resolveLocalProjectId(dir);
|
|
579177
579191
|
const port = Number(cmdOpts?.port ?? 4310);
|
|
@@ -579234,22 +579248,22 @@ function registerViewportCommand(parent2) {
|
|
|
579234
579248
|
}
|
|
579235
579249
|
async function resolveClientDir() {
|
|
579236
579250
|
const candidates = [
|
|
579237
|
-
|
|
579251
|
+
import_node_path22.default.resolve(__dirname, "viewport-client"),
|
|
579238
579252
|
// CLI dist/viewport-client/
|
|
579239
|
-
|
|
579253
|
+
import_node_path22.default.resolve(__dirname, "../viewport-client")
|
|
579240
579254
|
// fallback
|
|
579241
579255
|
];
|
|
579242
579256
|
let current = process.cwd();
|
|
579243
579257
|
while (true) {
|
|
579244
|
-
candidates.push(
|
|
579245
|
-
const parent2 =
|
|
579258
|
+
candidates.push(import_node_path22.default.join(current, "packages/cli-viewport/dist/client"));
|
|
579259
|
+
const parent2 = import_node_path22.default.dirname(current);
|
|
579246
579260
|
if (parent2 === current)
|
|
579247
579261
|
break;
|
|
579248
579262
|
current = parent2;
|
|
579249
579263
|
}
|
|
579250
579264
|
for (const candidate of candidates) {
|
|
579251
579265
|
try {
|
|
579252
|
-
await (0, import_promises17.access)(
|
|
579266
|
+
await (0, import_promises17.access)(import_node_path22.default.join(candidate, "index.html"));
|
|
579253
579267
|
return candidate;
|
|
579254
579268
|
} catch {
|
|
579255
579269
|
}
|
|
@@ -579260,14 +579274,14 @@ async function resolveClientDir() {
|
|
|
579260
579274
|
}
|
|
579261
579275
|
|
|
579262
579276
|
// src/cli-version.ts
|
|
579263
|
-
var
|
|
579264
|
-
var
|
|
579277
|
+
var import_node_fs4 = require("node:fs");
|
|
579278
|
+
var import_meta3 = {};
|
|
579265
579279
|
function readCliVersionFromPackageJson() {
|
|
579266
|
-
const raw = (0,
|
|
579280
|
+
const raw = (0, import_node_fs4.readFileSync)(new URL("../package.json", import_meta3.url), "utf-8");
|
|
579267
579281
|
const parsed = JSON.parse(raw);
|
|
579268
579282
|
return typeof parsed.version === "string" && parsed.version.length > 0 ? parsed.version : "0.0.0";
|
|
579269
579283
|
}
|
|
579270
|
-
var CLI_VERSION = "2.0.0-alpha.
|
|
579284
|
+
var CLI_VERSION = "2.0.0-alpha.15".length > 0 ? "2.0.0-alpha.15" : readCliVersionFromPackageJson();
|
|
579271
579285
|
|
|
579272
579286
|
// src/cli.ts
|
|
579273
579287
|
init_config();
|
|
@@ -579297,7 +579311,7 @@ program2.command("init <projectId>").description("Initialize a project from remo
|
|
|
579297
579311
|
const globals = program2.optsWithGlobals();
|
|
579298
579312
|
const serverUrl = await resolveServerUrl(globals, { required: true });
|
|
579299
579313
|
const token = getToken2(globals);
|
|
579300
|
-
const outputDir = cmdOpts.output ?? cmdOpts.outputDir ??
|
|
579314
|
+
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
579315
|
await initProject({
|
|
579302
579316
|
projectId,
|
|
579303
579317
|
outputDir,
|
|
@@ -579313,7 +579327,7 @@ program2.command("pull [projectDir]").description("Pull remote changes to local"
|
|
|
579313
579327
|
const serverUrl = await resolveServerUrl(globals, { projectDir: dir, required: true });
|
|
579314
579328
|
const token = getToken2(globals);
|
|
579315
579329
|
const result2 = await pullProject({
|
|
579316
|
-
projectDir:
|
|
579330
|
+
projectDir: import_node_path23.default.resolve(dir),
|
|
579317
579331
|
apiClient: new HttpSyncApiClient(serverUrl, token),
|
|
579318
579332
|
fs: new NodeFs()
|
|
579319
579333
|
});
|
|
@@ -579349,7 +579363,7 @@ program2.command("push [projectDir]").description("Push local changes to remote"
|
|
|
579349
579363
|
const serverUrl = await resolveServerUrl(globals, { projectDir: dir, required: true });
|
|
579350
579364
|
const token = getToken2(globals);
|
|
579351
579365
|
const result2 = await pushProject({
|
|
579352
|
-
projectDir:
|
|
579366
|
+
projectDir: import_node_path23.default.resolve(dir),
|
|
579353
579367
|
apiClient: new HttpSyncApiClient(serverUrl, token),
|
|
579354
579368
|
fs: new NodeFs(),
|
|
579355
579369
|
serverUrl,
|
|
@@ -579363,7 +579377,7 @@ program2.command("watch [projectDir]").description("Watch local changes and auto
|
|
|
579363
579377
|
const globals = program2.optsWithGlobals();
|
|
579364
579378
|
const serverUrl = await resolveServerUrl(globals, { projectDir: dir, required: true });
|
|
579365
579379
|
const token = getToken2(globals);
|
|
579366
|
-
const absProjectDir =
|
|
579380
|
+
const absProjectDir = import_node_path23.default.resolve(dir);
|
|
579367
579381
|
const handle2 = watchProject({
|
|
579368
579382
|
projectDir: absProjectDir,
|
|
579369
579383
|
apiClient: new HttpSyncApiClient(serverUrl, token),
|
|
@@ -579377,7 +579391,7 @@ program2.command("watch [projectDir]").description("Watch local changes and auto
|
|
|
579377
579391
|
console.error(err);
|
|
579378
579392
|
}
|
|
579379
579393
|
});
|
|
579380
|
-
console.log(`Watching ${
|
|
579394
|
+
console.log(`Watching ${import_node_path23.default.join(absProjectDir, "assets")} for changes...`);
|
|
579381
579395
|
console.log("Press Ctrl+C to stop");
|
|
579382
579396
|
await new Promise((resolve5) => {
|
|
579383
579397
|
const shutdown = () => {
|