@needle-tools/needle-component-compiler 3.0.8 → 3.0.10

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.
@@ -128,12 +128,20 @@ var CSharpWriter = /** @class */ (function (_super) {
128
128
  return _this;
129
129
  }
130
130
  CSharpWriter.prototype.resolveCSharpTypeName = function (typescriptTypeName) {
131
- var _a, _b, _c, _d, _e, _f;
131
+ var _a, _b, _c, _d, _e;
132
132
  if (!typescriptTypeName)
133
133
  return undefined;
134
134
  // Strip THREE. prefix for lookup fallback
135
135
  var stripped = typescriptTypeName.startsWith("THREE.") ? typescriptTypeName.substring(6) : typescriptTypeName;
136
- return (_f = (_d = (_b = (_a = TYPE_MAP[typescriptTypeName]) !== null && _a !== void 0 ? _a : TYPE_MAP[stripped]) !== null && _b !== void 0 ? _b : (_c = this.externalTypes) === null || _c === void 0 ? void 0 : _c[typescriptTypeName]) !== null && _d !== void 0 ? _d : (_e = this.externalTypes) === null || _e === void 0 ? void 0 : _e[stripped]) !== null && _f !== void 0 ? _f : typescriptTypeName;
136
+ // Check built-in TYPE_MAP first (TS→C# mapping)
137
+ var builtIn = (_a = TYPE_MAP[typescriptTypeName]) !== null && _a !== void 0 ? _a : TYPE_MAP[stripped];
138
+ if (builtIn)
139
+ return builtIn;
140
+ // If the name is already a known C# type (e.g. "float"), return it as-is
141
+ // to prevent external types from overriding it (e.g. "float" → "System.Single")
142
+ if (KNOWN_CSHARP_TYPES.has(typescriptTypeName))
143
+ return typescriptTypeName;
144
+ return (_e = (_c = (_b = this.externalTypes) === null || _b === void 0 ? void 0 : _b[typescriptTypeName]) !== null && _c !== void 0 ? _c : (_d = this.externalTypes) === null || _d === void 0 ? void 0 : _d[stripped]) !== null && _e !== void 0 ? _e : typescriptTypeName;
137
145
  };
138
146
  /** Tries to resolve a C# type name; returns undefined if the type is not known.
139
147
  * Checks TYPE_MAP keys/values and the enum registry. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/needle-component-compiler",
3
- "version": "3.0.8",
3
+ "version": "3.0.10",
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",