@galacean/cli 0.0.1-alpha.2 → 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 +38 -94
- package/package.json +1 -1
package/dist/cli.bundle.cjs
CHANGED
|
@@ -63874,15 +63874,6 @@ async function buildProject(options) {
|
|
|
63874
63874
|
const buildOpts = {
|
|
63875
63875
|
...defaultOptions2,
|
|
63876
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
|
-
},
|
|
63886
63877
|
assetOptions: { ...defaultOptions2.assetOptions, uploadCDN: false }
|
|
63887
63878
|
};
|
|
63888
63879
|
const upload = cliUploadFactory();
|
|
@@ -79287,8 +79278,6 @@ async function createSingleGeometry(item, ctx) {
|
|
|
79287
79278
|
} catch (error48) {
|
|
79288
79279
|
await rollbackAndThrow(entityFacade, assetFacade, entityId, createdMaterialId, "\u6750\u8D28\u521B\u5EFA\u5931\u8D25", error48);
|
|
79289
79280
|
}
|
|
79290
|
-
} else {
|
|
79291
|
-
materialId = "0000200";
|
|
79292
79281
|
}
|
|
79293
79282
|
if (materialId) {
|
|
79294
79283
|
componentProps.material = { refId: materialId };
|
|
@@ -96981,17 +96970,13 @@ export default class extends StateMachineScript {
|
|
|
96981
96970
|
id: "1000000",
|
|
96982
96971
|
name: "Camera",
|
|
96983
96972
|
isActive: true,
|
|
96984
|
-
layer: 1,
|
|
96985
96973
|
parent: null,
|
|
96986
96974
|
children: [],
|
|
96987
96975
|
isClone: false,
|
|
96988
96976
|
transform: {
|
|
96989
|
-
id: "t-camera",
|
|
96990
|
-
class: "Transform",
|
|
96991
96977
|
props: {
|
|
96992
|
-
|
|
96993
|
-
|
|
96994
|
-
rotation: { x: -26, y: 0, z: 0 },
|
|
96978
|
+
position: { x: 0, y: 0, z: 10 },
|
|
96979
|
+
rotation: { x: 0, y: 0, z: 0 },
|
|
96995
96980
|
scale: { x: 1, y: 1, z: 1 }
|
|
96996
96981
|
}
|
|
96997
96982
|
},
|
|
@@ -97000,19 +96985,10 @@ export default class extends StateMachineScript {
|
|
|
97000
96985
|
id: "1000100",
|
|
97001
96986
|
class: "Camera",
|
|
97002
96987
|
props: {
|
|
97003
|
-
enabled: true,
|
|
97004
96988
|
isOrthographic: false,
|
|
97005
96989
|
nearClipPlane: 0.1,
|
|
97006
96990
|
farClipPlane: 100,
|
|
97007
|
-
|
|
97008
|
-
orthographicSize: 10,
|
|
97009
|
-
priority: 0,
|
|
97010
|
-
enableFrustumCulling: true,
|
|
97011
|
-
clearFlags: 7,
|
|
97012
|
-
cullingMask: 4294967295,
|
|
97013
|
-
msaaSamples: 4,
|
|
97014
|
-
enableHDR: true,
|
|
97015
|
-
enablePostProcess: true
|
|
96991
|
+
viewport: { x: 0, y: 0, z: 1, w: 1 }
|
|
97016
96992
|
},
|
|
97017
96993
|
methods: {}
|
|
97018
96994
|
}
|
|
@@ -97022,17 +96998,13 @@ export default class extends StateMachineScript {
|
|
|
97022
96998
|
id: "1000001",
|
|
97023
96999
|
name: "DirectLight",
|
|
97024
97000
|
isActive: true,
|
|
97025
|
-
layer: 1,
|
|
97026
97001
|
parent: null,
|
|
97027
97002
|
children: [],
|
|
97028
97003
|
isClone: false,
|
|
97029
97004
|
transform: {
|
|
97030
|
-
id: "t-light",
|
|
97031
|
-
class: "Transform",
|
|
97032
97005
|
props: {
|
|
97033
|
-
|
|
97034
|
-
|
|
97035
|
-
rotation: { x: -20, y: -66, z: 0 },
|
|
97006
|
+
position: { x: 0, y: 3, z: 0 },
|
|
97007
|
+
rotation: { x: -45, y: -45, z: 0 },
|
|
97036
97008
|
scale: { x: 1, y: 1, z: 1 }
|
|
97037
97009
|
}
|
|
97038
97010
|
},
|
|
@@ -97042,13 +97014,8 @@ export default class extends StateMachineScript {
|
|
|
97042
97014
|
class: "DirectLight",
|
|
97043
97015
|
props: {
|
|
97044
97016
|
enabled: true,
|
|
97045
|
-
|
|
97046
|
-
|
|
97047
|
-
shadowType: 3,
|
|
97048
|
-
shadowBias: 1,
|
|
97049
|
-
shadowNormalBias: 1,
|
|
97050
|
-
shadowNearPlaneOffset: 0.1,
|
|
97051
|
-
shadowStrength: 1
|
|
97017
|
+
intensity: 0.6,
|
|
97018
|
+
color: { r: 1, g: 1, b: 1, a: 1 }
|
|
97052
97019
|
},
|
|
97053
97020
|
methods: {}
|
|
97054
97021
|
}
|
|
@@ -97056,43 +97023,10 @@ export default class extends StateMachineScript {
|
|
|
97056
97023
|
}
|
|
97057
97024
|
],
|
|
97058
97025
|
scene: {
|
|
97059
|
-
|
|
97060
|
-
|
|
97061
|
-
|
|
97062
|
-
|
|
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
|
-
}
|
|
97026
|
+
background: { mode: 0, color: { r: 0.0157, g: 0.0157, b: 0.0157, a: 1 } },
|
|
97027
|
+
ambient: {},
|
|
97028
|
+
shadow: {},
|
|
97029
|
+
fog: {}
|
|
97096
97030
|
}
|
|
97097
97031
|
},
|
|
97098
97032
|
Material: {
|
|
@@ -111588,7 +111522,7 @@ var init_src4 = __esm({
|
|
|
111588
111522
|
});
|
|
111589
111523
|
|
|
111590
111524
|
// src/cli.ts
|
|
111591
|
-
var
|
|
111525
|
+
var import_node_os2 = __toESM(require("node:os"));
|
|
111592
111526
|
var import_node_path18 = __toESM(require("node:path"));
|
|
111593
111527
|
var import_node_process2 = __toESM(require("node:process"));
|
|
111594
111528
|
|
|
@@ -111723,19 +111657,31 @@ var HttpSyncApiClient = class {
|
|
|
111723
111657
|
}
|
|
111724
111658
|
const data = json2.data;
|
|
111725
111659
|
if (typeof data.content === "string") {
|
|
111726
|
-
|
|
111660
|
+
const raw = data.content;
|
|
111661
|
+
if (raw === "") {
|
|
111727
111662
|
;
|
|
111728
|
-
data.content =
|
|
111729
|
-
}
|
|
111730
|
-
|
|
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
|
+
}
|
|
111731
111671
|
}
|
|
111732
111672
|
}
|
|
111733
111673
|
if (typeof data.setting === "string") {
|
|
111734
|
-
|
|
111674
|
+
const raw = data.setting;
|
|
111675
|
+
if (raw === "") {
|
|
111735
111676
|
;
|
|
111736
|
-
data.setting =
|
|
111737
|
-
}
|
|
111738
|
-
|
|
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
|
+
}
|
|
111739
111685
|
}
|
|
111740
111686
|
}
|
|
111741
111687
|
if (typeof data.dependencies === "string") {
|
|
@@ -116225,7 +116171,6 @@ function registerBuildCommand(program3) {
|
|
|
116225
116171
|
|
|
116226
116172
|
// src/commands/create.ts
|
|
116227
116173
|
var import_promises13 = require("node:fs/promises");
|
|
116228
|
-
var import_node_os2 = __toESM(require("node:os"));
|
|
116229
116174
|
var import_node_path16 = __toESM(require("node:path"));
|
|
116230
116175
|
init_src();
|
|
116231
116176
|
init_hash();
|
|
@@ -116248,8 +116193,8 @@ function buildDefaultScene3D() {
|
|
|
116248
116193
|
class: "Transform",
|
|
116249
116194
|
props: {
|
|
116250
116195
|
enabled: true,
|
|
116251
|
-
position: { x: 0, y: 5, z: 10 },
|
|
116252
|
-
rotation: { x:
|
|
116196
|
+
position: { x: 0, y: 5, z: -10 },
|
|
116197
|
+
rotation: { x: 0, y: 0, z: 0 },
|
|
116253
116198
|
scale: { x: 1, y: 1, z: 1 }
|
|
116254
116199
|
}
|
|
116255
116200
|
},
|
|
@@ -116289,7 +116234,7 @@ function buildDefaultScene3D() {
|
|
|
116289
116234
|
props: {
|
|
116290
116235
|
enabled: true,
|
|
116291
116236
|
position: { x: 0, y: 0, z: 0 },
|
|
116292
|
-
rotation: { x:
|
|
116237
|
+
rotation: { x: 50, y: -30, z: 0 },
|
|
116293
116238
|
scale: { x: 1, y: 1, z: 1 }
|
|
116294
116239
|
}
|
|
116295
116240
|
},
|
|
@@ -116447,8 +116392,7 @@ function buildDefaultScene(platform) {
|
|
|
116447
116392
|
}
|
|
116448
116393
|
async function createProject(opts) {
|
|
116449
116394
|
const { name, platform = "3d", engineVersion = "1.6.0", force = false } = opts;
|
|
116450
|
-
const
|
|
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);
|
|
116395
|
+
const outputDir = opts.outputDir ?? `./${slugify(name)}`;
|
|
116452
116396
|
const absDir = import_node_path16.default.resolve(outputDir);
|
|
116453
116397
|
await (0, import_promises13.mkdir)(absDir, { recursive: true });
|
|
116454
116398
|
if (!force) {
|
|
@@ -116594,7 +116538,7 @@ function readCliVersionFromPackageJson() {
|
|
|
116594
116538
|
const parsed = JSON.parse(raw);
|
|
116595
116539
|
return typeof parsed.version === "string" && parsed.version.length > 0 ? parsed.version : "0.0.0";
|
|
116596
116540
|
}
|
|
116597
|
-
var CLI_VERSION = "0.0.1-alpha.
|
|
116541
|
+
var CLI_VERSION = "0.0.1-alpha.3".length > 0 ? "0.0.1-alpha.3" : readCliVersionFromPackageJson();
|
|
116598
116542
|
|
|
116599
116543
|
// src/push-output.ts
|
|
116600
116544
|
function printPushResult(result, options = {}) {
|
|
@@ -116646,7 +116590,7 @@ program2.command("init <projectId>").description("Initialize a project locally")
|
|
|
116646
116590
|
const globals = program2.optsWithGlobals();
|
|
116647
116591
|
const serverUrl = await getServerUrl(globals);
|
|
116648
116592
|
const token = getToken(globals);
|
|
116649
|
-
const outputDir = cmdOpts.output ?? cmdOpts.outputDir ?? import_node_path18.default.resolve(globals._config?.projectsDir ?? import_node_path18.default.join(
|
|
116593
|
+
const outputDir = cmdOpts.output ?? cmdOpts.outputDir ?? import_node_path18.default.resolve(globals._config?.projectsDir ?? import_node_path18.default.join(import_node_os2.default.homedir(), ".galacean/workspace"), projectId);
|
|
116650
116594
|
await initProject({
|
|
116651
116595
|
projectId,
|
|
116652
116596
|
outputDir,
|