@galacean/cli 0.0.1-alpha.1-alpha.1-alpha.1 → 0.0.1-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.bundle.cjs +256 -130
- package/package.json +1 -1
package/dist/cli.bundle.cjs
CHANGED
|
@@ -3587,7 +3587,7 @@ var init_asset_path = __esm({
|
|
|
3587
3587
|
}
|
|
3588
3588
|
});
|
|
3589
3589
|
|
|
3590
|
-
// ../storage/src/
|
|
3590
|
+
// ../storage/src/sync/integrity-validator.ts
|
|
3591
3591
|
function isKnownAssetType(value) {
|
|
3592
3592
|
return typeof value === "string" && KNOWN_ASSET_TYPES.has(value);
|
|
3593
3593
|
}
|
|
@@ -3597,86 +3597,87 @@ function safeParseJsonObject(input) {
|
|
|
3597
3597
|
if (value && typeof value === "object" && !Array.isArray(value))
|
|
3598
3598
|
return value;
|
|
3599
3599
|
} catch (error48) {
|
|
3600
|
-
console.warn("[
|
|
3600
|
+
console.warn("[integrity-validator] Failed to parse asset meta:", error48);
|
|
3601
3601
|
}
|
|
3602
3602
|
return {};
|
|
3603
3603
|
}
|
|
3604
|
-
function
|
|
3604
|
+
function normalizeAssetType(kind, meta3) {
|
|
3605
|
+
if (kind === "folder")
|
|
3606
|
+
return "Folder";
|
|
3607
|
+
if (!isKnownAssetType(meta3.type) || meta3.type === "Folder")
|
|
3608
|
+
return "Unknown";
|
|
3609
|
+
return meta3.type;
|
|
3610
|
+
}
|
|
3611
|
+
function validateRemoteAssets(assets) {
|
|
3605
3612
|
const byUuid = /* @__PURE__ */ new Map();
|
|
3606
|
-
for (const
|
|
3607
|
-
|
|
3608
|
-
|
|
3613
|
+
for (const asset2 of assets) {
|
|
3614
|
+
const kind = asset2.type === 1 ? "folder" : "file";
|
|
3615
|
+
const meta3 = safeParseJsonObject(asset2.meta);
|
|
3616
|
+
byUuid.set(asset2.uuid, {
|
|
3617
|
+
asset: asset2,
|
|
3618
|
+
kind,
|
|
3619
|
+
assetType: normalizeAssetType(kind, meta3),
|
|
3620
|
+
meta: meta3
|
|
3621
|
+
});
|
|
3622
|
+
}
|
|
3609
3623
|
const visiting = /* @__PURE__ */ new Set();
|
|
3610
|
-
const
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
if (cached2)
|
|
3615
|
-
return cached2.isFolder ? cached2.folderChain : [];
|
|
3616
|
-
const asset2 = byUuid.get(uuid3);
|
|
3617
|
-
if (!asset2)
|
|
3618
|
-
return [];
|
|
3624
|
+
const visited = /* @__PURE__ */ new Set();
|
|
3625
|
+
function visit(uuid3) {
|
|
3626
|
+
if (visited.has(uuid3))
|
|
3627
|
+
return;
|
|
3619
3628
|
if (visiting.has(uuid3)) {
|
|
3620
3629
|
throw new Error(`Asset parentId cycle detected at '${uuid3}'`);
|
|
3621
3630
|
}
|
|
3631
|
+
const current = byUuid.get(uuid3);
|
|
3632
|
+
if (!current)
|
|
3633
|
+
return;
|
|
3622
3634
|
visiting.add(uuid3);
|
|
3623
|
-
const
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
let parentChain = [];
|
|
3629
|
-
if (asset2.parentId) {
|
|
3630
|
-
if (!byUuid.has(asset2.parentId)) {
|
|
3631
|
-
throw new Error(`Asset '${uuid3}' has unknown parentId '${asset2.parentId}' \u2014 data integrity violation`);
|
|
3635
|
+
const parentId = current.asset.parentId;
|
|
3636
|
+
if (parentId) {
|
|
3637
|
+
const parent = byUuid.get(parentId);
|
|
3638
|
+
if (!parent) {
|
|
3639
|
+
throw new Error(`Asset '${uuid3}' has unknown parentId '${parentId}' \u2014 data integrity violation`);
|
|
3632
3640
|
}
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
let localPath;
|
|
3638
|
-
if (isFolder) {
|
|
3639
|
-
localPath = subdir ? [subdir, ...folderChain].join("/") : folderChain.join("/");
|
|
3640
|
-
} else {
|
|
3641
|
-
const fileName = getLocalFileName(asset2.name, metaType);
|
|
3642
|
-
const dirParts = subdir ? [subdir, ...parentChain] : [...parentChain];
|
|
3643
|
-
localPath = [...dirParts, fileName].join("/");
|
|
3644
|
-
}
|
|
3645
|
-
const existingAssetId = localPathToAssetId.get(localPath);
|
|
3646
|
-
if (existingAssetId && existingAssetId !== asset2.uuid) {
|
|
3647
|
-
throw new Error(`Duplicate local path '${localPath}' for assets '${existingAssetId}' and '${asset2.uuid}'`);
|
|
3641
|
+
if (parent.kind !== "folder") {
|
|
3642
|
+
throw new Error(`Asset '${uuid3}' parentId '${parentId}' must reference a folder`);
|
|
3643
|
+
}
|
|
3644
|
+
visit(parentId);
|
|
3648
3645
|
}
|
|
3646
|
+
visiting.delete(uuid3);
|
|
3647
|
+
visited.add(uuid3);
|
|
3648
|
+
}
|
|
3649
|
+
for (const asset2 of assets) {
|
|
3650
|
+
visit(asset2.uuid);
|
|
3651
|
+
}
|
|
3652
|
+
return byUuid;
|
|
3653
|
+
}
|
|
3654
|
+
function createLocalPathRegistry() {
|
|
3655
|
+
return {
|
|
3656
|
+
exact: /* @__PURE__ */ new Map(),
|
|
3657
|
+
caseFold: /* @__PURE__ */ new Map()
|
|
3658
|
+
};
|
|
3659
|
+
}
|
|
3660
|
+
function registerLocalPathOrThrow(registry2, assetId, localPath, caseFold = true) {
|
|
3661
|
+
const existingAssetId = registry2.exact.get(localPath);
|
|
3662
|
+
if (existingAssetId && existingAssetId !== assetId) {
|
|
3663
|
+
throw new Error(`Duplicate local path '${localPath}' for assets '${existingAssetId}' and '${assetId}'`);
|
|
3664
|
+
}
|
|
3665
|
+
if (caseFold) {
|
|
3649
3666
|
const caseFoldLocalPath = localPath.toLowerCase();
|
|
3650
|
-
const caseFoldExisting =
|
|
3651
|
-
if (caseFoldExisting && caseFoldExisting.assetId !==
|
|
3667
|
+
const caseFoldExisting = registry2.caseFold.get(caseFoldLocalPath);
|
|
3668
|
+
if (caseFoldExisting && caseFoldExisting.assetId !== assetId && caseFoldExisting.localPath !== localPath) {
|
|
3652
3669
|
throw new Error(
|
|
3653
|
-
`Case-only local path collision '${caseFoldExisting.localPath}' vs '${localPath}' for assets '${caseFoldExisting.assetId}' and '${
|
|
3670
|
+
`Case-only local path collision '${caseFoldExisting.localPath}' vs '${localPath}' for assets '${caseFoldExisting.assetId}' and '${assetId}'`
|
|
3654
3671
|
);
|
|
3655
3672
|
}
|
|
3656
|
-
|
|
3657
|
-
caseFoldLocalPathToAsset.set(caseFoldLocalPath, { assetId: asset2.uuid, localPath });
|
|
3658
|
-
resolved.set(uuid3, {
|
|
3659
|
-
assetId: asset2.uuid,
|
|
3660
|
-
serverId: asset2.id,
|
|
3661
|
-
localPath,
|
|
3662
|
-
metaType,
|
|
3663
|
-
isFolder,
|
|
3664
|
-
folderChain,
|
|
3665
|
-
meta: meta3,
|
|
3666
|
-
url: asset2.url ?? ""
|
|
3667
|
-
});
|
|
3668
|
-
visiting.delete(uuid3);
|
|
3669
|
-
return folderChain;
|
|
3673
|
+
registry2.caseFold.set(caseFoldLocalPath, { assetId, localPath });
|
|
3670
3674
|
}
|
|
3671
|
-
|
|
3672
|
-
resolve4(a.uuid);
|
|
3673
|
-
return resolved;
|
|
3675
|
+
registry2.exact.set(localPath, assetId);
|
|
3674
3676
|
}
|
|
3675
3677
|
var KNOWN_ASSET_TYPES;
|
|
3676
|
-
var
|
|
3677
|
-
"../storage/src/
|
|
3678
|
+
var init_integrity_validator = __esm({
|
|
3679
|
+
"../storage/src/sync/integrity-validator.ts"() {
|
|
3678
3680
|
"use strict";
|
|
3679
|
-
init_asset_path();
|
|
3680
3681
|
KNOWN_ASSET_TYPES = /* @__PURE__ */ new Set([
|
|
3681
3682
|
"Folder",
|
|
3682
3683
|
"Material",
|
|
@@ -3711,6 +3712,60 @@ var init_path_tree = __esm({
|
|
|
3711
3712
|
}
|
|
3712
3713
|
});
|
|
3713
3714
|
|
|
3715
|
+
// ../storage/src/path-tree.ts
|
|
3716
|
+
function buildLocalPathMap(assets) {
|
|
3717
|
+
const validatedByUuid = validateRemoteAssets(assets);
|
|
3718
|
+
const resolved = /* @__PURE__ */ new Map();
|
|
3719
|
+
const localPathRegistry = createLocalPathRegistry();
|
|
3720
|
+
function resolve4(uuid3) {
|
|
3721
|
+
const cached2 = resolved.get(uuid3);
|
|
3722
|
+
if (cached2)
|
|
3723
|
+
return cached2.isFolder ? cached2.folderChain : [];
|
|
3724
|
+
const validated = validatedByUuid.get(uuid3);
|
|
3725
|
+
if (!validated)
|
|
3726
|
+
return [];
|
|
3727
|
+
const { asset: asset2, assetType: metaType, kind, meta: meta3 } = validated;
|
|
3728
|
+
const isFolder = kind === "folder";
|
|
3729
|
+
assertValidAssetName(asset2.name);
|
|
3730
|
+
let parentChain = [];
|
|
3731
|
+
if (asset2.parentId) {
|
|
3732
|
+
parentChain = resolve4(asset2.parentId);
|
|
3733
|
+
}
|
|
3734
|
+
const folderChain = isFolder ? [...parentChain, asset2.name] : parentChain;
|
|
3735
|
+
const subdir = getAssetSubdirectory(metaType);
|
|
3736
|
+
let localPath;
|
|
3737
|
+
if (isFolder) {
|
|
3738
|
+
localPath = subdir ? [subdir, ...folderChain].join("/") : folderChain.join("/");
|
|
3739
|
+
} else {
|
|
3740
|
+
const fileName = getLocalFileName(asset2.name, metaType);
|
|
3741
|
+
const dirParts = subdir ? [subdir, ...parentChain] : [...parentChain];
|
|
3742
|
+
localPath = [...dirParts, fileName].join("/");
|
|
3743
|
+
}
|
|
3744
|
+
registerLocalPathOrThrow(localPathRegistry, asset2.uuid, localPath);
|
|
3745
|
+
resolved.set(uuid3, {
|
|
3746
|
+
assetId: asset2.uuid,
|
|
3747
|
+
serverId: asset2.id,
|
|
3748
|
+
localPath,
|
|
3749
|
+
metaType,
|
|
3750
|
+
isFolder,
|
|
3751
|
+
folderChain,
|
|
3752
|
+
meta: meta3,
|
|
3753
|
+
url: asset2.url ?? ""
|
|
3754
|
+
});
|
|
3755
|
+
return folderChain;
|
|
3756
|
+
}
|
|
3757
|
+
for (const a of assets)
|
|
3758
|
+
resolve4(a.uuid);
|
|
3759
|
+
return resolved;
|
|
3760
|
+
}
|
|
3761
|
+
var init_path_tree = __esm({
|
|
3762
|
+
"../storage/src/path-tree.ts"() {
|
|
3763
|
+
"use strict";
|
|
3764
|
+
init_asset_path();
|
|
3765
|
+
init_integrity_validator();
|
|
3766
|
+
}
|
|
3767
|
+
});
|
|
3768
|
+
|
|
3714
3769
|
// ../storage/src/manifest.ts
|
|
3715
3770
|
function generateManifest(pathMap, contentHashes) {
|
|
3716
3771
|
const entries = {};
|
|
@@ -3812,19 +3867,41 @@ var init_http = __esm({
|
|
|
3812
3867
|
}
|
|
3813
3868
|
});
|
|
3814
3869
|
|
|
3815
|
-
// ../storage/src/
|
|
3816
|
-
|
|
3817
|
-
"
|
|
3870
|
+
// ../storage/src/sync/project-codec.ts
|
|
3871
|
+
function assetNameFromPath(localPath, type) {
|
|
3872
|
+
const parts = localPath.split("/");
|
|
3873
|
+
const fileName = parts[parts.length - 1];
|
|
3874
|
+
const ext = TYPE_EXTENSION[type];
|
|
3875
|
+
if (ext && fileName.endsWith(ext)) {
|
|
3876
|
+
return fileName.slice(0, -ext.length);
|
|
3877
|
+
}
|
|
3878
|
+
return fileName;
|
|
3879
|
+
}
|
|
3880
|
+
function findParentAssetId(localPath, entries) {
|
|
3881
|
+
const parts = localPath.split("/");
|
|
3882
|
+
if (parts.length <= 2)
|
|
3883
|
+
return null;
|
|
3884
|
+
const parentPath = parts.slice(0, -1).join("/");
|
|
3885
|
+
for (const [assetId, entry] of Object.entries(entries)) {
|
|
3886
|
+
if (entry.path === parentPath && entry.type === "Folder") {
|
|
3887
|
+
return assetId;
|
|
3888
|
+
}
|
|
3889
|
+
}
|
|
3890
|
+
return null;
|
|
3891
|
+
}
|
|
3892
|
+
var init_project_codec = __esm({
|
|
3893
|
+
"../storage/src/sync/project-codec.ts"() {
|
|
3818
3894
|
"use strict";
|
|
3819
|
-
init_types();
|
|
3820
3895
|
init_asset_path();
|
|
3896
|
+
}
|
|
3897
|
+
});
|
|
3898
|
+
|
|
3899
|
+
// ../storage/src/sync/desired-snapshot.ts
|
|
3900
|
+
var init_desired_snapshot = __esm({
|
|
3901
|
+
"../storage/src/sync/desired-snapshot.ts"() {
|
|
3902
|
+
"use strict";
|
|
3821
3903
|
init_path_tree();
|
|
3822
|
-
|
|
3823
|
-
init_meta_file();
|
|
3824
|
-
init_fs();
|
|
3825
|
-
init_project_writer();
|
|
3826
|
-
init_interface();
|
|
3827
|
-
init_http();
|
|
3904
|
+
init_project_codec();
|
|
3828
3905
|
}
|
|
3829
3906
|
});
|
|
3830
3907
|
|
|
@@ -3843,6 +3920,83 @@ var init_hash = __esm({
|
|
|
3843
3920
|
}
|
|
3844
3921
|
});
|
|
3845
3922
|
|
|
3923
|
+
// ../storage/src/sync/executors/strong-fs-executor.ts
|
|
3924
|
+
var init_strong_fs_executor = __esm({
|
|
3925
|
+
"../storage/src/sync/executors/strong-fs-executor.ts"() {
|
|
3926
|
+
"use strict";
|
|
3927
|
+
init_fs();
|
|
3928
|
+
init_hash();
|
|
3929
|
+
init_project_codec();
|
|
3930
|
+
}
|
|
3931
|
+
});
|
|
3932
|
+
|
|
3933
|
+
// ../storage/src/sync/executors/weak-fs-executor.ts
|
|
3934
|
+
var init_weak_fs_executor = __esm({
|
|
3935
|
+
"../storage/src/sync/executors/weak-fs-executor.ts"() {
|
|
3936
|
+
"use strict";
|
|
3937
|
+
init_fs();
|
|
3938
|
+
init_hash();
|
|
3939
|
+
init_project_codec();
|
|
3940
|
+
}
|
|
3941
|
+
});
|
|
3942
|
+
|
|
3943
|
+
// ../storage/src/sync/mime-resolver.ts
|
|
3944
|
+
var init_mime_resolver = __esm({
|
|
3945
|
+
"../storage/src/sync/mime-resolver.ts"() {
|
|
3946
|
+
"use strict";
|
|
3947
|
+
}
|
|
3948
|
+
});
|
|
3949
|
+
|
|
3950
|
+
// ../storage/src/sync/planner.ts
|
|
3951
|
+
var init_planner = __esm({
|
|
3952
|
+
"../storage/src/sync/planner.ts"() {
|
|
3953
|
+
"use strict";
|
|
3954
|
+
}
|
|
3955
|
+
});
|
|
3956
|
+
|
|
3957
|
+
// ../storage/src/sync/snapshot-loader.ts
|
|
3958
|
+
var init_snapshot_loader = __esm({
|
|
3959
|
+
"../storage/src/sync/snapshot-loader.ts"() {
|
|
3960
|
+
"use strict";
|
|
3961
|
+
init_meta_file();
|
|
3962
|
+
init_project_codec();
|
|
3963
|
+
}
|
|
3964
|
+
});
|
|
3965
|
+
|
|
3966
|
+
// ../storage/src/sync-adapter.ts
|
|
3967
|
+
var init_sync_adapter = __esm({
|
|
3968
|
+
"../storage/src/sync-adapter.ts"() {
|
|
3969
|
+
"use strict";
|
|
3970
|
+
init_fs();
|
|
3971
|
+
init_meta_file();
|
|
3972
|
+
init_desired_snapshot();
|
|
3973
|
+
init_strong_fs_executor();
|
|
3974
|
+
init_weak_fs_executor();
|
|
3975
|
+
init_mime_resolver();
|
|
3976
|
+
init_planner();
|
|
3977
|
+
init_project_codec();
|
|
3978
|
+
init_snapshot_loader();
|
|
3979
|
+
init_project_codec();
|
|
3980
|
+
}
|
|
3981
|
+
});
|
|
3982
|
+
|
|
3983
|
+
// ../storage/src/index.ts
|
|
3984
|
+
var init_src = __esm({
|
|
3985
|
+
"../storage/src/index.ts"() {
|
|
3986
|
+
"use strict";
|
|
3987
|
+
init_types();
|
|
3988
|
+
init_asset_path();
|
|
3989
|
+
init_path_tree();
|
|
3990
|
+
init_manifest();
|
|
3991
|
+
init_meta_file();
|
|
3992
|
+
init_fs();
|
|
3993
|
+
init_project_writer();
|
|
3994
|
+
init_interface();
|
|
3995
|
+
init_http();
|
|
3996
|
+
init_sync_adapter();
|
|
3997
|
+
}
|
|
3998
|
+
});
|
|
3999
|
+
|
|
3846
4000
|
// src/local-project.ts
|
|
3847
4001
|
async function readJsonFile(filePath, label) {
|
|
3848
4002
|
let raw;
|
|
@@ -62812,46 +62966,6 @@ var init_cli_color_dilate = __esm({
|
|
|
62812
62966
|
}
|
|
62813
62967
|
});
|
|
62814
62968
|
|
|
62815
|
-
// ../storage/src/sync-adapter.ts
|
|
62816
|
-
function assetNameFromPath(localPath, type) {
|
|
62817
|
-
const parts = localPath.split("/");
|
|
62818
|
-
const fileName = parts[parts.length - 1];
|
|
62819
|
-
const ext = TYPE_EXTENSION[type];
|
|
62820
|
-
if (ext && fileName.endsWith(ext)) {
|
|
62821
|
-
return fileName.slice(0, -ext.length);
|
|
62822
|
-
}
|
|
62823
|
-
return fileName;
|
|
62824
|
-
}
|
|
62825
|
-
function findParentAssetId(localPath, entries) {
|
|
62826
|
-
const parts = localPath.split("/");
|
|
62827
|
-
if (parts.length <= 2)
|
|
62828
|
-
return null;
|
|
62829
|
-
const parentPath = parts.slice(0, -1).join("/");
|
|
62830
|
-
for (const [assetId, entry] of Object.entries(entries)) {
|
|
62831
|
-
if (entry.path === parentPath && entry.type === "Folder") {
|
|
62832
|
-
return assetId;
|
|
62833
|
-
}
|
|
62834
|
-
}
|
|
62835
|
-
return null;
|
|
62836
|
-
}
|
|
62837
|
-
var EXTENSION_TO_TYPE;
|
|
62838
|
-
var init_sync_adapter = __esm({
|
|
62839
|
-
"../storage/src/sync-adapter.ts"() {
|
|
62840
|
-
"use strict";
|
|
62841
|
-
init_fs();
|
|
62842
|
-
init_hash();
|
|
62843
|
-
init_path_tree();
|
|
62844
|
-
init_manifest();
|
|
62845
|
-
init_meta_file();
|
|
62846
|
-
init_asset_path();
|
|
62847
|
-
EXTENSION_TO_TYPE = /* @__PURE__ */ new Map();
|
|
62848
|
-
for (const [type, ext] of Object.entries(TYPE_EXTENSION)) {
|
|
62849
|
-
if (ext)
|
|
62850
|
-
EXTENSION_TO_TYPE.set(ext, type);
|
|
62851
|
-
}
|
|
62852
|
-
}
|
|
62853
|
-
});
|
|
62854
|
-
|
|
62855
62969
|
// src/domain-bridge/scene-parser.ts
|
|
62856
62970
|
function extractMaterialProps(matData) {
|
|
62857
62971
|
const props = {};
|
|
@@ -111543,19 +111657,31 @@ var HttpSyncApiClient = class {
|
|
|
111543
111657
|
}
|
|
111544
111658
|
const data = json2.data;
|
|
111545
111659
|
if (typeof data.content === "string") {
|
|
111546
|
-
|
|
111660
|
+
const raw = data.content;
|
|
111661
|
+
if (raw === "") {
|
|
111547
111662
|
;
|
|
111548
|
-
data.content =
|
|
111549
|
-
}
|
|
111550
|
-
|
|
111663
|
+
data.content = {};
|
|
111664
|
+
} else {
|
|
111665
|
+
try {
|
|
111666
|
+
;
|
|
111667
|
+
data.content = JSON.parse(raw);
|
|
111668
|
+
} catch {
|
|
111669
|
+
throw new Error("Invalid response: invalid content field");
|
|
111670
|
+
}
|
|
111551
111671
|
}
|
|
111552
111672
|
}
|
|
111553
111673
|
if (typeof data.setting === "string") {
|
|
111554
|
-
|
|
111674
|
+
const raw = data.setting;
|
|
111675
|
+
if (raw === "") {
|
|
111555
111676
|
;
|
|
111556
|
-
data.setting =
|
|
111557
|
-
}
|
|
111558
|
-
|
|
111677
|
+
data.setting = {};
|
|
111678
|
+
} else {
|
|
111679
|
+
try {
|
|
111680
|
+
;
|
|
111681
|
+
data.setting = JSON.parse(raw);
|
|
111682
|
+
} catch {
|
|
111683
|
+
throw new Error("Invalid response: invalid setting field");
|
|
111684
|
+
}
|
|
111559
111685
|
}
|
|
111560
111686
|
}
|
|
111561
111687
|
if (typeof data.dependencies === "string") {
|
|
@@ -112768,7 +112894,7 @@ function parseJsonObjectOrThrow(input, context) {
|
|
|
112768
112894
|
}
|
|
112769
112895
|
return value;
|
|
112770
112896
|
}
|
|
112771
|
-
function
|
|
112897
|
+
function parseManifest2(raw, manifestPath) {
|
|
112772
112898
|
let parsed;
|
|
112773
112899
|
try {
|
|
112774
112900
|
parsed = JSON.parse(decodeUtf8(raw));
|
|
@@ -113107,7 +113233,7 @@ async function pushProject(opts) {
|
|
|
113107
113233
|
throwIfAborted(signal);
|
|
113108
113234
|
const manifestPath = import_node_path7.default.resolve(projectDir, ".galacean/manifest.json");
|
|
113109
113235
|
const manifestRaw = await fs6.readFile(manifestPath);
|
|
113110
|
-
const manifest =
|
|
113236
|
+
const manifest = parseManifest2(manifestRaw, manifestPath);
|
|
113111
113237
|
const projectConfig = await readProjectConfig2(fs6, projectDir);
|
|
113112
113238
|
const resolvedProjectSceneId = resolveProjectSceneId(projectConfig, manifest);
|
|
113113
113239
|
const pushed = [];
|
|
@@ -113631,7 +113757,7 @@ async function pushProject(opts) {
|
|
|
113631
113757
|
var import_node_path10 = __toESM(require("node:path"));
|
|
113632
113758
|
|
|
113633
113759
|
// ../../node_modules/chokidar/esm/index.js
|
|
113634
|
-
var
|
|
113760
|
+
var import_fs5 = require("fs");
|
|
113635
113761
|
var import_promises6 = require("fs/promises");
|
|
113636
113762
|
var import_events = require("events");
|
|
113637
113763
|
var sysPath2 = __toESM(require("path"), 1);
|
|
@@ -113856,7 +113982,7 @@ function readdirp(root, options = {}) {
|
|
|
113856
113982
|
}
|
|
113857
113983
|
|
|
113858
113984
|
// ../../node_modules/chokidar/esm/handler.js
|
|
113859
|
-
var
|
|
113985
|
+
var import_fs4 = require("fs");
|
|
113860
113986
|
var import_promises5 = require("fs/promises");
|
|
113861
113987
|
var sysPath = __toESM(require("path"), 1);
|
|
113862
113988
|
var import_os = require("os");
|
|
@@ -114194,7 +114320,7 @@ function createFsWatchInstance(path16, options, listener, errHandler, emitRaw) {
|
|
|
114194
114320
|
}
|
|
114195
114321
|
};
|
|
114196
114322
|
try {
|
|
114197
|
-
return (0,
|
|
114323
|
+
return (0, import_fs4.watch)(path16, {
|
|
114198
114324
|
persistent: options.persistent
|
|
114199
114325
|
}, handleEvent);
|
|
114200
114326
|
} catch (error48) {
|
|
@@ -114277,7 +114403,7 @@ var setFsWatchFileListener = (path16, fullPath, options, handlers) => {
|
|
|
114277
114403
|
let cont = FsWatchFileInstances.get(fullPath);
|
|
114278
114404
|
const copts = cont && cont.options;
|
|
114279
114405
|
if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
|
|
114280
|
-
(0,
|
|
114406
|
+
(0, import_fs4.unwatchFile)(fullPath);
|
|
114281
114407
|
cont = void 0;
|
|
114282
114408
|
}
|
|
114283
114409
|
if (cont) {
|
|
@@ -114288,7 +114414,7 @@ var setFsWatchFileListener = (path16, fullPath, options, handlers) => {
|
|
|
114288
114414
|
listeners: listener,
|
|
114289
114415
|
rawEmitters: rawEmitter,
|
|
114290
114416
|
options,
|
|
114291
|
-
watcher: (0,
|
|
114417
|
+
watcher: (0, import_fs4.watchFile)(fullPath, options, (curr, prev) => {
|
|
114292
114418
|
foreach(cont.rawEmitters, (rawEmitter2) => {
|
|
114293
114419
|
rawEmitter2(EV.CHANGE, fullPath, { curr, prev });
|
|
114294
114420
|
});
|
|
@@ -114305,7 +114431,7 @@ var setFsWatchFileListener = (path16, fullPath, options, handlers) => {
|
|
|
114305
114431
|
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
114306
114432
|
if (isEmptySet(cont.listeners)) {
|
|
114307
114433
|
FsWatchFileInstances.delete(fullPath);
|
|
114308
|
-
(0,
|
|
114434
|
+
(0, import_fs4.unwatchFile)(fullPath);
|
|
114309
114435
|
cont.options = cont.watcher = void 0;
|
|
114310
114436
|
Object.freeze(cont);
|
|
114311
114437
|
}
|
|
@@ -115148,7 +115274,7 @@ var FSWatcher = class extends import_events.EventEmitter {
|
|
|
115148
115274
|
const now = /* @__PURE__ */ new Date();
|
|
115149
115275
|
const writes = this._pendingWrites;
|
|
115150
115276
|
function awaitWriteFinishFn(prevStat) {
|
|
115151
|
-
(0,
|
|
115277
|
+
(0, import_fs5.stat)(fullPath, (err, curStat) => {
|
|
115152
115278
|
if (err || !writes.has(path16)) {
|
|
115153
115279
|
if (err && err.code !== "ENOENT")
|
|
115154
115280
|
awfEmit(err);
|
|
@@ -116412,7 +116538,7 @@ function readCliVersionFromPackageJson() {
|
|
|
116412
116538
|
const parsed = JSON.parse(raw);
|
|
116413
116539
|
return typeof parsed.version === "string" && parsed.version.length > 0 ? parsed.version : "0.0.0";
|
|
116414
116540
|
}
|
|
116415
|
-
var CLI_VERSION = "0.0.1-alpha.
|
|
116541
|
+
var CLI_VERSION = "0.0.1-alpha.3".length > 0 ? "0.0.1-alpha.3" : readCliVersionFromPackageJson();
|
|
116416
116542
|
|
|
116417
116543
|
// src/push-output.ts
|
|
116418
116544
|
function printPushResult(result, options = {}) {
|