@needle-tools/needle-component-compiler 3.0.13 → 3.0.15

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/Changelog.md CHANGED
@@ -4,6 +4,15 @@ All notable changes to this package will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [3.0.15] - 2026-03-23
8
+ ### Fixed
9
+ - Fix non-void method stubs producing uncompilable C# (`CS0161: not all code paths return a value`) by emitting `{ return default; }` instead of `{}`
10
+
11
+ ## [3.0.14] - 2026-03-23
12
+ ### Fixed
13
+ - Fix `@type` override on array fields producing double array suffix (e.g. `Type[][]` instead of `Type[]`)
14
+ - Map `Euler` to `UnityEngine.Vector3` in C# output
15
+
7
16
  ## [3.0.12] - 2026-03-23
8
17
  ### Fixed
9
18
  - Fix nullable array types (`Texture[] | null`, `Array<Texture> | null`, `Array<Texture | null>`) not emitting as arrays in C# and Blender output
@@ -263,8 +263,8 @@ var CSharpWriter = /** @class */ (function (_super) {
263
263
  assignment = " = ".concat(initialValue);
264
264
  }
265
265
  }
266
- // Array suffix
267
- if (isArray)
266
+ // Array suffix (skip when @type override is present — it defines the exact type)
267
+ if (isArray && !typeOverride)
268
268
  csharpType += "[]";
269
269
  // Editor type wrapping
270
270
  var needsEditorWrap = isEditorType(csharpType.split("[")[0].split("<")[0]);
@@ -342,7 +342,8 @@ var CSharpWriter = /** @class */ (function (_super) {
342
342
  var csReturnType = returnTypeOverride !== null && returnTypeOverride !== void 0 ? returnTypeOverride : (returnType ? ((_b = this.resolveKnownCSharpTypeName(returnType)) !== null && _b !== void 0 ? _b : "void") : "void");
343
343
  if (contextMenu)
344
344
  this.writer.writeLine("[UnityEngine.ContextMenu(\"".concat(contextMenu, "\")]"));
345
- this.writer.writeLine("public ".concat(csReturnType, " ").concat(methodName, "(").concat(paramList, ") {}"));
345
+ var body = csReturnType !== "void" ? "{ return default; }" : "{}";
346
+ this.writer.writeLine("public ".concat(csReturnType, " ").concat(methodName, "(").concat(paramList, ") ").concat(body));
346
347
  };
347
348
  CSharpWriter.prototype.writeNewTypeExpression = function (typeName, args) {
348
349
  // no-op for C# output
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/needle-component-compiler",
3
- "version": "3.0.13",
3
+ "version": "3.0.15",
4
4
  "description": "Compile Editor components for Needle Engine for C# and Blender",
5
5
  "main": "dist/index.js",
6
6
  "bin": "dist/cli.js",