@galacean/cli 0.0.1-alpha.1-alpha.1-alpha.1 → 0.0.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.bundle.cjs +321 -139
- 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 = {};
|
|
@@ -63760,6 +63874,15 @@ async function buildProject(options) {
|
|
|
63760
63874
|
const buildOpts = {
|
|
63761
63875
|
...defaultOptions2,
|
|
63762
63876
|
defaultSceneId,
|
|
63877
|
+
debug: {
|
|
63878
|
+
eventDebugger: false,
|
|
63879
|
+
autoResize: true,
|
|
63880
|
+
stats: false,
|
|
63881
|
+
godMode: false,
|
|
63882
|
+
orbitControl: false,
|
|
63883
|
+
loadingUI: false,
|
|
63884
|
+
hotReload: false
|
|
63885
|
+
},
|
|
63763
63886
|
assetOptions: { ...defaultOptions2.assetOptions, uploadCDN: false }
|
|
63764
63887
|
};
|
|
63765
63888
|
const upload = cliUploadFactory();
|
|
@@ -79164,6 +79287,8 @@ async function createSingleGeometry(item, ctx) {
|
|
|
79164
79287
|
} catch (error48) {
|
|
79165
79288
|
await rollbackAndThrow(entityFacade, assetFacade, entityId, createdMaterialId, "\u6750\u8D28\u521B\u5EFA\u5931\u8D25", error48);
|
|
79166
79289
|
}
|
|
79290
|
+
} else {
|
|
79291
|
+
materialId = "0000200";
|
|
79167
79292
|
}
|
|
79168
79293
|
if (materialId) {
|
|
79169
79294
|
componentProps.material = { refId: materialId };
|
|
@@ -96856,13 +96981,17 @@ export default class extends StateMachineScript {
|
|
|
96856
96981
|
id: "1000000",
|
|
96857
96982
|
name: "Camera",
|
|
96858
96983
|
isActive: true,
|
|
96984
|
+
layer: 1,
|
|
96859
96985
|
parent: null,
|
|
96860
96986
|
children: [],
|
|
96861
96987
|
isClone: false,
|
|
96862
96988
|
transform: {
|
|
96989
|
+
id: "t-camera",
|
|
96990
|
+
class: "Transform",
|
|
96863
96991
|
props: {
|
|
96864
|
-
|
|
96865
|
-
|
|
96992
|
+
enabled: true,
|
|
96993
|
+
position: { x: 0, y: 5, z: 10 },
|
|
96994
|
+
rotation: { x: -26, y: 0, z: 0 },
|
|
96866
96995
|
scale: { x: 1, y: 1, z: 1 }
|
|
96867
96996
|
}
|
|
96868
96997
|
},
|
|
@@ -96871,10 +97000,19 @@ export default class extends StateMachineScript {
|
|
|
96871
97000
|
id: "1000100",
|
|
96872
97001
|
class: "Camera",
|
|
96873
97002
|
props: {
|
|
97003
|
+
enabled: true,
|
|
96874
97004
|
isOrthographic: false,
|
|
96875
97005
|
nearClipPlane: 0.1,
|
|
96876
97006
|
farClipPlane: 100,
|
|
96877
|
-
|
|
97007
|
+
fieldOfView: 60,
|
|
97008
|
+
orthographicSize: 10,
|
|
97009
|
+
priority: 0,
|
|
97010
|
+
enableFrustumCulling: true,
|
|
97011
|
+
clearFlags: 7,
|
|
97012
|
+
cullingMask: 4294967295,
|
|
97013
|
+
msaaSamples: 4,
|
|
97014
|
+
enableHDR: true,
|
|
97015
|
+
enablePostProcess: true
|
|
96878
97016
|
},
|
|
96879
97017
|
methods: {}
|
|
96880
97018
|
}
|
|
@@ -96884,13 +97022,17 @@ export default class extends StateMachineScript {
|
|
|
96884
97022
|
id: "1000001",
|
|
96885
97023
|
name: "DirectLight",
|
|
96886
97024
|
isActive: true,
|
|
97025
|
+
layer: 1,
|
|
96887
97026
|
parent: null,
|
|
96888
97027
|
children: [],
|
|
96889
97028
|
isClone: false,
|
|
96890
97029
|
transform: {
|
|
97030
|
+
id: "t-light",
|
|
97031
|
+
class: "Transform",
|
|
96891
97032
|
props: {
|
|
96892
|
-
|
|
96893
|
-
|
|
97033
|
+
enabled: true,
|
|
97034
|
+
position: { x: 0, y: 0, z: 0 },
|
|
97035
|
+
rotation: { x: -20, y: -66, z: 0 },
|
|
96894
97036
|
scale: { x: 1, y: 1, z: 1 }
|
|
96895
97037
|
}
|
|
96896
97038
|
},
|
|
@@ -96900,8 +97042,13 @@ export default class extends StateMachineScript {
|
|
|
96900
97042
|
class: "DirectLight",
|
|
96901
97043
|
props: {
|
|
96902
97044
|
enabled: true,
|
|
96903
|
-
|
|
96904
|
-
|
|
97045
|
+
color: { r: 1, g: 1, b: 1, a: 1 },
|
|
97046
|
+
cullingMask: 4294967295,
|
|
97047
|
+
shadowType: 3,
|
|
97048
|
+
shadowBias: 1,
|
|
97049
|
+
shadowNormalBias: 1,
|
|
97050
|
+
shadowNearPlaneOffset: 0.1,
|
|
97051
|
+
shadowStrength: 1
|
|
96905
97052
|
},
|
|
96906
97053
|
methods: {}
|
|
96907
97054
|
}
|
|
@@ -96909,10 +97056,43 @@ export default class extends StateMachineScript {
|
|
|
96909
97056
|
}
|
|
96910
97057
|
],
|
|
96911
97058
|
scene: {
|
|
96912
|
-
|
|
96913
|
-
|
|
96914
|
-
|
|
96915
|
-
|
|
97059
|
+
autoBake: true,
|
|
97060
|
+
background: {
|
|
97061
|
+
mode: 1,
|
|
97062
|
+
color: { r: 0.05087608817155679, g: 0.05087608817155679, b: 0.05087608817155679, a: 1 },
|
|
97063
|
+
texture: null,
|
|
97064
|
+
textureFillMode: 1,
|
|
97065
|
+
skyMaterial: { refId: "0000201" },
|
|
97066
|
+
skyMesh: { refId: "0000101" }
|
|
97067
|
+
},
|
|
97068
|
+
ambient: {
|
|
97069
|
+
ambientLight: { refId: "9be0d037-5df4-4850-9fdd-86638467dc72" },
|
|
97070
|
+
customAmbientLight: null,
|
|
97071
|
+
diffuseMode: 1,
|
|
97072
|
+
diffuseSolidColor: { r: 0.03696758874771872, g: 0.0421494543549785, b: 0.05455383078270364, a: 1 },
|
|
97073
|
+
diffuseIntensity: 1,
|
|
97074
|
+
specularMode: "Sky",
|
|
97075
|
+
customSpecularTexture: null,
|
|
97076
|
+
bakerResolution: 128,
|
|
97077
|
+
specularIntensity: 1
|
|
97078
|
+
},
|
|
97079
|
+
shadow: {
|
|
97080
|
+
castShadows: true,
|
|
97081
|
+
enableTransparentShadow: false,
|
|
97082
|
+
shadowResolution: 2,
|
|
97083
|
+
shadowDistance: 30,
|
|
97084
|
+
shadowCascades: 1,
|
|
97085
|
+
shadowTwoCascadeSplits: 0.3333333333333333,
|
|
97086
|
+
shadowFourCascadeSplits: { x: 0.06666666666666667, y: 0.2, z: 0.4666666666666667 },
|
|
97087
|
+
shadowFadeBorder: 0.1
|
|
97088
|
+
},
|
|
97089
|
+
fog: {
|
|
97090
|
+
fogMode: 0,
|
|
97091
|
+
fogStart: 0,
|
|
97092
|
+
fogEnd: 300,
|
|
97093
|
+
fogDensity: 0.01,
|
|
97094
|
+
fogColor: { r: 0.21404114048223255, g: 0.21404114048223255, b: 0.21404114048223255, a: 1 }
|
|
97095
|
+
}
|
|
96916
97096
|
}
|
|
96917
97097
|
},
|
|
96918
97098
|
Material: {
|
|
@@ -111408,7 +111588,7 @@ var init_src4 = __esm({
|
|
|
111408
111588
|
});
|
|
111409
111589
|
|
|
111410
111590
|
// src/cli.ts
|
|
111411
|
-
var
|
|
111591
|
+
var import_node_os3 = __toESM(require("node:os"));
|
|
111412
111592
|
var import_node_path18 = __toESM(require("node:path"));
|
|
111413
111593
|
var import_node_process2 = __toESM(require("node:process"));
|
|
111414
111594
|
|
|
@@ -112768,7 +112948,7 @@ function parseJsonObjectOrThrow(input, context) {
|
|
|
112768
112948
|
}
|
|
112769
112949
|
return value;
|
|
112770
112950
|
}
|
|
112771
|
-
function
|
|
112951
|
+
function parseManifest2(raw, manifestPath) {
|
|
112772
112952
|
let parsed;
|
|
112773
112953
|
try {
|
|
112774
112954
|
parsed = JSON.parse(decodeUtf8(raw));
|
|
@@ -113107,7 +113287,7 @@ async function pushProject(opts) {
|
|
|
113107
113287
|
throwIfAborted(signal);
|
|
113108
113288
|
const manifestPath = import_node_path7.default.resolve(projectDir, ".galacean/manifest.json");
|
|
113109
113289
|
const manifestRaw = await fs6.readFile(manifestPath);
|
|
113110
|
-
const manifest =
|
|
113290
|
+
const manifest = parseManifest2(manifestRaw, manifestPath);
|
|
113111
113291
|
const projectConfig = await readProjectConfig2(fs6, projectDir);
|
|
113112
113292
|
const resolvedProjectSceneId = resolveProjectSceneId(projectConfig, manifest);
|
|
113113
113293
|
const pushed = [];
|
|
@@ -113631,7 +113811,7 @@ async function pushProject(opts) {
|
|
|
113631
113811
|
var import_node_path10 = __toESM(require("node:path"));
|
|
113632
113812
|
|
|
113633
113813
|
// ../../node_modules/chokidar/esm/index.js
|
|
113634
|
-
var
|
|
113814
|
+
var import_fs5 = require("fs");
|
|
113635
113815
|
var import_promises6 = require("fs/promises");
|
|
113636
113816
|
var import_events = require("events");
|
|
113637
113817
|
var sysPath2 = __toESM(require("path"), 1);
|
|
@@ -113856,7 +114036,7 @@ function readdirp(root, options = {}) {
|
|
|
113856
114036
|
}
|
|
113857
114037
|
|
|
113858
114038
|
// ../../node_modules/chokidar/esm/handler.js
|
|
113859
|
-
var
|
|
114039
|
+
var import_fs4 = require("fs");
|
|
113860
114040
|
var import_promises5 = require("fs/promises");
|
|
113861
114041
|
var sysPath = __toESM(require("path"), 1);
|
|
113862
114042
|
var import_os = require("os");
|
|
@@ -114194,7 +114374,7 @@ function createFsWatchInstance(path16, options, listener, errHandler, emitRaw) {
|
|
|
114194
114374
|
}
|
|
114195
114375
|
};
|
|
114196
114376
|
try {
|
|
114197
|
-
return (0,
|
|
114377
|
+
return (0, import_fs4.watch)(path16, {
|
|
114198
114378
|
persistent: options.persistent
|
|
114199
114379
|
}, handleEvent);
|
|
114200
114380
|
} catch (error48) {
|
|
@@ -114277,7 +114457,7 @@ var setFsWatchFileListener = (path16, fullPath, options, handlers) => {
|
|
|
114277
114457
|
let cont = FsWatchFileInstances.get(fullPath);
|
|
114278
114458
|
const copts = cont && cont.options;
|
|
114279
114459
|
if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) {
|
|
114280
|
-
(0,
|
|
114460
|
+
(0, import_fs4.unwatchFile)(fullPath);
|
|
114281
114461
|
cont = void 0;
|
|
114282
114462
|
}
|
|
114283
114463
|
if (cont) {
|
|
@@ -114288,7 +114468,7 @@ var setFsWatchFileListener = (path16, fullPath, options, handlers) => {
|
|
|
114288
114468
|
listeners: listener,
|
|
114289
114469
|
rawEmitters: rawEmitter,
|
|
114290
114470
|
options,
|
|
114291
|
-
watcher: (0,
|
|
114471
|
+
watcher: (0, import_fs4.watchFile)(fullPath, options, (curr, prev) => {
|
|
114292
114472
|
foreach(cont.rawEmitters, (rawEmitter2) => {
|
|
114293
114473
|
rawEmitter2(EV.CHANGE, fullPath, { curr, prev });
|
|
114294
114474
|
});
|
|
@@ -114305,7 +114485,7 @@ var setFsWatchFileListener = (path16, fullPath, options, handlers) => {
|
|
|
114305
114485
|
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
114306
114486
|
if (isEmptySet(cont.listeners)) {
|
|
114307
114487
|
FsWatchFileInstances.delete(fullPath);
|
|
114308
|
-
(0,
|
|
114488
|
+
(0, import_fs4.unwatchFile)(fullPath);
|
|
114309
114489
|
cont.options = cont.watcher = void 0;
|
|
114310
114490
|
Object.freeze(cont);
|
|
114311
114491
|
}
|
|
@@ -115148,7 +115328,7 @@ var FSWatcher = class extends import_events.EventEmitter {
|
|
|
115148
115328
|
const now = /* @__PURE__ */ new Date();
|
|
115149
115329
|
const writes = this._pendingWrites;
|
|
115150
115330
|
function awaitWriteFinishFn(prevStat) {
|
|
115151
|
-
(0,
|
|
115331
|
+
(0, import_fs5.stat)(fullPath, (err, curStat) => {
|
|
115152
115332
|
if (err || !writes.has(path16)) {
|
|
115153
115333
|
if (err && err.code !== "ENOENT")
|
|
115154
115334
|
awfEmit(err);
|
|
@@ -116045,6 +116225,7 @@ function registerBuildCommand(program3) {
|
|
|
116045
116225
|
|
|
116046
116226
|
// src/commands/create.ts
|
|
116047
116227
|
var import_promises13 = require("node:fs/promises");
|
|
116228
|
+
var import_node_os2 = __toESM(require("node:os"));
|
|
116048
116229
|
var import_node_path16 = __toESM(require("node:path"));
|
|
116049
116230
|
init_src();
|
|
116050
116231
|
init_hash();
|
|
@@ -116067,8 +116248,8 @@ function buildDefaultScene3D() {
|
|
|
116067
116248
|
class: "Transform",
|
|
116068
116249
|
props: {
|
|
116069
116250
|
enabled: true,
|
|
116070
|
-
position: { x: 0, y: 5, z:
|
|
116071
|
-
rotation: { x:
|
|
116251
|
+
position: { x: 0, y: 5, z: 10 },
|
|
116252
|
+
rotation: { x: -26, y: 0, z: 0 },
|
|
116072
116253
|
scale: { x: 1, y: 1, z: 1 }
|
|
116073
116254
|
}
|
|
116074
116255
|
},
|
|
@@ -116108,7 +116289,7 @@ function buildDefaultScene3D() {
|
|
|
116108
116289
|
props: {
|
|
116109
116290
|
enabled: true,
|
|
116110
116291
|
position: { x: 0, y: 0, z: 0 },
|
|
116111
|
-
rotation: { x:
|
|
116292
|
+
rotation: { x: -20, y: -66, z: 0 },
|
|
116112
116293
|
scale: { x: 1, y: 1, z: 1 }
|
|
116113
116294
|
}
|
|
116114
116295
|
},
|
|
@@ -116266,7 +116447,8 @@ function buildDefaultScene(platform) {
|
|
|
116266
116447
|
}
|
|
116267
116448
|
async function createProject(opts) {
|
|
116268
116449
|
const { name, platform = "3d", engineVersion = "1.6.0", force = false } = opts;
|
|
116269
|
-
const
|
|
116450
|
+
const slug = slugify(name);
|
|
116451
|
+
const outputDir = opts.outputDir ? import_node_path16.default.join(opts.outputDir, slug) : import_node_path16.default.join(import_node_os2.default.homedir(), ".galacean", "workspace", slug);
|
|
116270
116452
|
const absDir = import_node_path16.default.resolve(outputDir);
|
|
116271
116453
|
await (0, import_promises13.mkdir)(absDir, { recursive: true });
|
|
116272
116454
|
if (!force) {
|
|
@@ -116412,7 +116594,7 @@ function readCliVersionFromPackageJson() {
|
|
|
116412
116594
|
const parsed = JSON.parse(raw);
|
|
116413
116595
|
return typeof parsed.version === "string" && parsed.version.length > 0 ? parsed.version : "0.0.0";
|
|
116414
116596
|
}
|
|
116415
|
-
var CLI_VERSION = "0.0.1-alpha.
|
|
116597
|
+
var CLI_VERSION = "0.0.1-alpha.2".length > 0 ? "0.0.1-alpha.2" : readCliVersionFromPackageJson();
|
|
116416
116598
|
|
|
116417
116599
|
// src/push-output.ts
|
|
116418
116600
|
function printPushResult(result, options = {}) {
|
|
@@ -116464,7 +116646,7 @@ program2.command("init <projectId>").description("Initialize a project locally")
|
|
|
116464
116646
|
const globals = program2.optsWithGlobals();
|
|
116465
116647
|
const serverUrl = await getServerUrl(globals);
|
|
116466
116648
|
const token = getToken(globals);
|
|
116467
|
-
const outputDir = cmdOpts.output ?? cmdOpts.outputDir ?? import_node_path18.default.resolve(globals._config?.projectsDir ?? import_node_path18.default.join(
|
|
116649
|
+
const outputDir = cmdOpts.output ?? cmdOpts.outputDir ?? import_node_path18.default.resolve(globals._config?.projectsDir ?? import_node_path18.default.join(import_node_os3.default.homedir(), ".galacean/workspace"), projectId);
|
|
116468
116650
|
await initProject({
|
|
116469
116651
|
projectId,
|
|
116470
116652
|
outputDir,
|