@needle-tools/needle-component-compiler 1.10.0 → 1.10.1

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,8 +4,9 @@ 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
- ## [1.10.0] - 2023-08-02
7
+ ## [1.10.1] - 2023-08-02
8
8
  - Add: use `@tooltip` to emit a UnityEngine.Tooltip
9
+ - Update Readme
9
10
 
10
11
  ## [1.9.4] - 2023-05-24
11
12
  - Change: `Object3D` now emits `GameObject` field instead of `Transform`
package/Readme.md CHANGED
@@ -13,4 +13,6 @@ Please run ``npm install`` first before using.
13
13
  - ``@serializeField`` field decorator, similar to ``[SerializeField]`` in Unity
14
14
  - ``@nonSerialized`` field or method decorator to skip generating c# code for a field or a method, similar to ``[NonSerialized]`` in Unity
15
15
  - ``@type MyNamespace.MyType`` decorator for fields or classes, specifiy C# type of field or class
16
- - ``@ifdef MY_IFDEF`` field decorator only at the moment
16
+ - ``@ifdef MY_IFDEF`` field decorator only at the moment
17
+ - ``@tooltip My Text`` field decorator, generates a Unity `[Tooltip("My Text")]`
18
+ - ``@contextmenu MethodName`` method decorator, generates a `[ContextMenu("MethodName")]`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/needle-component-compiler",
3
- "version": "1.10.0",
3
+ "version": "1.10.1",
4
4
  "description": "Compile mock unity components from typescript",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -192,7 +192,7 @@ function run(program, outputDir, sourceFile) {
192
192
  console.log(comment);
193
193
  if (context) {
194
194
  // https://regex101.com/r/ud4oev/1
195
- var emitContextMenu = comment.match("(\/{2,}|\/\*) {0,}@contextmenu {0,}(?<text>[a-zA-Z 0-9]+)?");
195
+ var emitContextMenu = comment.match("(\/{2,}|\/\*) {0,}@contextmenu {1,}(?<text>[a-zA-Z 0-9]+)?");
196
196
  if (emitContextMenu) {
197
197
  context.emitMethodContextMenu = (_b = (_a = emitContextMenu.groups) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : null;
198
198
  }
@@ -230,7 +230,7 @@ export function run(program: ts.Program, outputDir: string | null, sourceFile: t
230
230
  console.log(comment);
231
231
  if (context) {
232
232
  // https://regex101.com/r/ud4oev/1
233
- const emitContextMenu = comment.match("(\/{2,}|\/\*) {0,}@contextmenu {0,}(?<text>[a-zA-Z 0-9]+)?");
233
+ const emitContextMenu = comment.match("(\/{2,}|\/\*) {0,}@contextmenu {1,}(?<text>[a-zA-Z 0-9]+)?");
234
234
  if (emitContextMenu) {
235
235
  context.emitMethodContextMenu = emitContextMenu.groups?.text ?? null;
236
236
  }