@galacean/cli 0.0.1-alpha.2 → 0.0.1-alpha.4

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.
Files changed (2) hide show
  1. package/dist/cli.bundle.cjs +40 -94
  2. package/package.json +1 -1
@@ -3745,6 +3745,7 @@ function buildLocalPathMap(assets) {
3745
3745
  resolved.set(uuid3, {
3746
3746
  assetId: asset2.uuid,
3747
3747
  serverId: asset2.id,
3748
+ name: asset2.name,
3748
3749
  localPath,
3749
3750
  metaType,
3750
3751
  isFolder,
@@ -3772,6 +3773,7 @@ function generateManifest(pathMap, contentHashes) {
3772
3773
  for (const [assetId, entry] of pathMap) {
3773
3774
  entries[assetId] = {
3774
3775
  assetId,
3776
+ name: entry.name,
3775
3777
  path: entry.localPath,
3776
3778
  type: entry.metaType,
3777
3779
  contentHash: contentHashes.get(assetId) ?? "",
@@ -63874,15 +63876,6 @@ async function buildProject(options) {
63874
63876
  const buildOpts = {
63875
63877
  ...defaultOptions2,
63876
63878
  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
63879
  assetOptions: { ...defaultOptions2.assetOptions, uploadCDN: false }
63887
63880
  };
63888
63881
  const upload = cliUploadFactory();
@@ -79287,8 +79280,6 @@ async function createSingleGeometry(item, ctx) {
79287
79280
  } catch (error48) {
79288
79281
  await rollbackAndThrow(entityFacade, assetFacade, entityId, createdMaterialId, "\u6750\u8D28\u521B\u5EFA\u5931\u8D25", error48);
79289
79282
  }
79290
- } else {
79291
- materialId = "0000200";
79292
79283
  }
79293
79284
  if (materialId) {
79294
79285
  componentProps.material = { refId: materialId };
@@ -96981,17 +96972,13 @@ export default class extends StateMachineScript {
96981
96972
  id: "1000000",
96982
96973
  name: "Camera",
96983
96974
  isActive: true,
96984
- layer: 1,
96985
96975
  parent: null,
96986
96976
  children: [],
96987
96977
  isClone: false,
96988
96978
  transform: {
96989
- id: "t-camera",
96990
- class: "Transform",
96991
96979
  props: {
96992
- enabled: true,
96993
- position: { x: 0, y: 5, z: 10 },
96994
- rotation: { x: -26, y: 0, z: 0 },
96980
+ position: { x: 0, y: 0, z: 10 },
96981
+ rotation: { x: 0, y: 0, z: 0 },
96995
96982
  scale: { x: 1, y: 1, z: 1 }
96996
96983
  }
96997
96984
  },
@@ -97000,19 +96987,10 @@ export default class extends StateMachineScript {
97000
96987
  id: "1000100",
97001
96988
  class: "Camera",
97002
96989
  props: {
97003
- enabled: true,
97004
96990
  isOrthographic: false,
97005
96991
  nearClipPlane: 0.1,
97006
96992
  farClipPlane: 100,
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
96993
+ viewport: { x: 0, y: 0, z: 1, w: 1 }
97016
96994
  },
97017
96995
  methods: {}
97018
96996
  }
@@ -97022,17 +97000,13 @@ export default class extends StateMachineScript {
97022
97000
  id: "1000001",
97023
97001
  name: "DirectLight",
97024
97002
  isActive: true,
97025
- layer: 1,
97026
97003
  parent: null,
97027
97004
  children: [],
97028
97005
  isClone: false,
97029
97006
  transform: {
97030
- id: "t-light",
97031
- class: "Transform",
97032
97007
  props: {
97033
- enabled: true,
97034
- position: { x: 0, y: 0, z: 0 },
97035
- rotation: { x: -20, y: -66, z: 0 },
97008
+ position: { x: 0, y: 3, z: 0 },
97009
+ rotation: { x: -45, y: -45, z: 0 },
97036
97010
  scale: { x: 1, y: 1, z: 1 }
97037
97011
  }
97038
97012
  },
@@ -97042,13 +97016,8 @@ export default class extends StateMachineScript {
97042
97016
  class: "DirectLight",
97043
97017
  props: {
97044
97018
  enabled: true,
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
97019
+ intensity: 0.6,
97020
+ color: { r: 1, g: 1, b: 1, a: 1 }
97052
97021
  },
97053
97022
  methods: {}
97054
97023
  }
@@ -97056,43 +97025,10 @@ export default class extends StateMachineScript {
97056
97025
  }
97057
97026
  ],
97058
97027
  scene: {
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
- }
97028
+ background: { mode: 0, color: { r: 0.0157, g: 0.0157, b: 0.0157, a: 1 } },
97029
+ ambient: {},
97030
+ shadow: {},
97031
+ fog: {}
97096
97032
  }
97097
97033
  },
97098
97034
  Material: {
@@ -111588,7 +111524,7 @@ var init_src4 = __esm({
111588
111524
  });
111589
111525
 
111590
111526
  // src/cli.ts
111591
- var import_node_os3 = __toESM(require("node:os"));
111527
+ var import_node_os2 = __toESM(require("node:os"));
111592
111528
  var import_node_path18 = __toESM(require("node:path"));
111593
111529
  var import_node_process2 = __toESM(require("node:process"));
111594
111530
 
@@ -111723,19 +111659,31 @@ var HttpSyncApiClient = class {
111723
111659
  }
111724
111660
  const data = json2.data;
111725
111661
  if (typeof data.content === "string") {
111726
- try {
111662
+ const raw = data.content;
111663
+ if (raw === "") {
111727
111664
  ;
111728
- data.content = JSON.parse(data.content);
111729
- } catch {
111730
- throw new Error("Invalid response: invalid content field");
111665
+ data.content = {};
111666
+ } else {
111667
+ try {
111668
+ ;
111669
+ data.content = JSON.parse(raw);
111670
+ } catch {
111671
+ throw new Error("Invalid response: invalid content field");
111672
+ }
111731
111673
  }
111732
111674
  }
111733
111675
  if (typeof data.setting === "string") {
111734
- try {
111676
+ const raw = data.setting;
111677
+ if (raw === "") {
111735
111678
  ;
111736
- data.setting = JSON.parse(data.setting);
111737
- } catch {
111738
- throw new Error("Invalid response: invalid setting field");
111679
+ data.setting = {};
111680
+ } else {
111681
+ try {
111682
+ ;
111683
+ data.setting = JSON.parse(raw);
111684
+ } catch {
111685
+ throw new Error("Invalid response: invalid setting field");
111686
+ }
111739
111687
  }
111740
111688
  }
111741
111689
  if (typeof data.dependencies === "string") {
@@ -116225,7 +116173,6 @@ function registerBuildCommand(program3) {
116225
116173
 
116226
116174
  // src/commands/create.ts
116227
116175
  var import_promises13 = require("node:fs/promises");
116228
- var import_node_os2 = __toESM(require("node:os"));
116229
116176
  var import_node_path16 = __toESM(require("node:path"));
116230
116177
  init_src();
116231
116178
  init_hash();
@@ -116248,8 +116195,8 @@ function buildDefaultScene3D() {
116248
116195
  class: "Transform",
116249
116196
  props: {
116250
116197
  enabled: true,
116251
- position: { x: 0, y: 5, z: 10 },
116252
- rotation: { x: -26, y: 0, z: 0 },
116198
+ position: { x: 0, y: 5, z: -10 },
116199
+ rotation: { x: 0, y: 0, z: 0 },
116253
116200
  scale: { x: 1, y: 1, z: 1 }
116254
116201
  }
116255
116202
  },
@@ -116289,7 +116236,7 @@ function buildDefaultScene3D() {
116289
116236
  props: {
116290
116237
  enabled: true,
116291
116238
  position: { x: 0, y: 0, z: 0 },
116292
- rotation: { x: -20, y: -66, z: 0 },
116239
+ rotation: { x: 50, y: -30, z: 0 },
116293
116240
  scale: { x: 1, y: 1, z: 1 }
116294
116241
  }
116295
116242
  },
@@ -116447,8 +116394,7 @@ function buildDefaultScene(platform) {
116447
116394
  }
116448
116395
  async function createProject(opts) {
116449
116396
  const { name, platform = "3d", engineVersion = "1.6.0", force = false } = opts;
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);
116397
+ const outputDir = opts.outputDir ?? `./${slugify(name)}`;
116452
116398
  const absDir = import_node_path16.default.resolve(outputDir);
116453
116399
  await (0, import_promises13.mkdir)(absDir, { recursive: true });
116454
116400
  if (!force) {
@@ -116594,7 +116540,7 @@ function readCliVersionFromPackageJson() {
116594
116540
  const parsed = JSON.parse(raw);
116595
116541
  return typeof parsed.version === "string" && parsed.version.length > 0 ? parsed.version : "0.0.0";
116596
116542
  }
116597
- var CLI_VERSION = "0.0.1-alpha.2".length > 0 ? "0.0.1-alpha.2" : readCliVersionFromPackageJson();
116543
+ var CLI_VERSION = "0.0.1-alpha.4".length > 0 ? "0.0.1-alpha.4" : readCliVersionFromPackageJson();
116598
116544
 
116599
116545
  // src/push-output.ts
116600
116546
  function printPushResult(result, options = {}) {
@@ -116646,7 +116592,7 @@ program2.command("init <projectId>").description("Initialize a project locally")
116646
116592
  const globals = program2.optsWithGlobals();
116647
116593
  const serverUrl = await getServerUrl(globals);
116648
116594
  const token = getToken(globals);
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);
116595
+ 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
116596
  await initProject({
116651
116597
  projectId,
116652
116598
  outputDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/cli",
3
- "version": "0.0.1-alpha.2",
3
+ "version": "0.0.1-alpha.4",
4
4
  "main": "dist/cli.bundle.cjs",
5
5
  "bin": {
6
6
  "galacean": "bin/galacean.js"