@needle-tools/needle-component-compiler 3.0.19-next.e2b9a6e → 3.0.20
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 +5 -0
- package/dist/Compiler.js +4 -1
- package/package.json +1 -1
package/Changelog.md
CHANGED
|
@@ -4,6 +4,11 @@ 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.20] - 2026-05-05
|
|
8
|
+
### Changed
|
|
9
|
+
- Fields without `@serializable()` decorator (or `//@serializable` / `//@serializeField` comment directive) are no longer emitted in C# or Blender output. This prevents unresolvable types (e.g. `article: Article | undefined = undefined`) from producing compile errors in generated stubs.
|
|
10
|
+
- Blender: component reference types now emit concrete type names (e.g. `Camera`, `Rigidbody`, `AudioSource`) instead of generic `comp`. Added support for: Animation, Animator, Camera, Light, Rigidbody, Renderer, Canvas, VideoPlayer, AudioSource, SphereCollider, MeshCollider, BoxCollider, PlayableDirector, DragControls, Button, Text.
|
|
11
|
+
|
|
7
12
|
## [3.0.19] - 2026-04-28
|
|
8
13
|
### Fixed
|
|
9
14
|
- C#: skip `= undefined` initializers — `undefined` is not valid in C#
|
package/dist/Compiler.js
CHANGED
|
@@ -151,7 +151,10 @@ var Compiler = /** @class */ (function () {
|
|
|
151
151
|
// If the property has a @serializable() decorator, ensure it's in the comments
|
|
152
152
|
// so the writer emits private/protected fields with [SerializeField]
|
|
153
153
|
var hasSerialized = this.hasSerializableDecorator(node);
|
|
154
|
-
|
|
154
|
+
var hasSerializedComment = comments.some(function (c) { return c.startsWith("@serializable") || c.startsWith("@serializeField"); });
|
|
155
|
+
if (!hasSerialized && !hasSerializedComment)
|
|
156
|
+
return; // only emit fields marked with @serializable() or //@serializable or //@serializeField
|
|
157
|
+
if (!comments.some(function (c) { return c.startsWith("@serializable"); })) {
|
|
155
158
|
comments.push("@serializable");
|
|
156
159
|
}
|
|
157
160
|
var flags = [];
|
package/package.json
CHANGED