@galacean/cli 2.0.0-alpha.3 → 2.0.0-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.
@@ -62546,11 +62546,18 @@ var init_Package = __esm({
62546
62546
  * 因为 registerClass 的唯一消费者是引擎的反序列化器。
62547
62547
  */
62548
62548
  _generateTemplate(projectFile, originalVirtualFileMap, features, download, debug) {
62549
- const scriptFileIds = new Set(projectFile.files.filter((f) => f.type === "script").map((f) => f.id));
62549
+ const scriptFileIds = /* @__PURE__ */ new Set();
62550
+ for (const f of projectFile.files) {
62551
+ if (f.type === "script") {
62552
+ scriptFileIds.add(f.id);
62553
+ if (f.virtualPath)
62554
+ scriptFileIds.add(f.virtualPath);
62555
+ }
62556
+ }
62550
62557
  const referencedScriptIds = collectReferencedScriptIds(scriptFileIds, originalVirtualFileMap);
62551
62558
  const scripts = [];
62552
62559
  for (const file2 of projectFile.files) {
62553
- if (file2.type === "script" && referencedScriptIds.has(file2.id)) {
62560
+ if (file2.type === "script" && (referencedScriptIds.has(file2.id) || referencedScriptIds.has(file2.virtualPath))) {
62554
62561
  scripts.push(file2);
62555
62562
  }
62556
62563
  }
@@ -79651,7 +79658,7 @@ function serializeSceneEntity(entity) {
79651
79658
  rotation: entity.transform.rotation,
79652
79659
  scale: entity.transform.scale
79653
79660
  };
79654
- const serializedComponents = Object.entries(entity.components).filter(([, c]) => c.type !== "UITransform").map(([id, c]) => {
79661
+ const serializedComponents = Object.entries(entity.components).filter(([, c]) => c.type !== "UITransform" && c.type !== "Transform").map(([id, c]) => {
79655
79662
  const props = { ...c.props };
79656
79663
  const methods = {};
79657
79664
  if (SET_MATERIAL_COMPONENT_TYPES.has(c.type) && props.material) {
@@ -80968,8 +80975,6 @@ async function cliCompile(vfs, config2, options) {
80968
80975
  if (vfile.meta?.params) {
80969
80976
  pf.params = vfile.meta.params;
80970
80977
  }
80971
- if (pf.type === "script")
80972
- continue;
80973
80978
  projectFiles.push(pf);
80974
80979
  }
80975
80980
  const sceneFiles = files.filter((f) => f.meta?.type === "Scene");
@@ -157271,7 +157276,7 @@ function readCliVersionFromPackageJson() {
157271
157276
  const parsed = JSON.parse(raw);
157272
157277
  return typeof parsed.version === "string" && parsed.version.length > 0 ? parsed.version : "0.0.0";
157273
157278
  }
157274
- var CLI_VERSION = "2.0.0-alpha.3".length > 0 ? "2.0.0-alpha.3" : readCliVersionFromPackageJson();
157279
+ var CLI_VERSION = "2.0.0-alpha.4".length > 0 ? "2.0.0-alpha.4" : readCliVersionFromPackageJson();
157275
157280
 
157276
157281
  // src/cli.ts
157277
157282
  init_config();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/cli",
3
- "version": "2.0.0-alpha.3",
3
+ "version": "2.0.0-alpha.4",
4
4
  "main": "dist/cli.bundle.cjs",
5
5
  "bin": {
6
6
  "galacean": "bin/galacean.js"