@needle-tools/needle-component-compiler 1.4.0 → 1.5.0

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,7 +4,10 @@ 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.3.0] - 2022-07-06
7
+ ## [1.5.0] - 2022-07-07
8
+ - change ``@type`` annotation to work with and without braces (e.g. ``@type My.Type`` or ``@type (My.Type)``)
9
+
10
+ ## [1.4.0] - 2022-07-06
8
11
  - add CODEGEN_START and END sections to allow adding code before or after a generated componnet
9
12
  - add ``@ifdef`` to ifdef fields
10
13
 
package/Readme.md CHANGED
@@ -11,4 +11,5 @@ Please run ``npm install`` first before using.
11
11
  - ``@dont-generate-component`` add before class to skip generating a component
12
12
  - ``@generate-component`` to enforce generating a component (not required)
13
13
  - ``@serializeField`` field decorator, similar to ``[SerializeField]``
14
- - ``@type(MyNamespace.MyType)`` decorator for fields or classes, specifiy C# type of field or class
14
+ - ``@type MyNamespace.MyType`` decorator for fields or classes, specifiy C# type of field or class
15
+ - ``@ifdef MY_IFDEF`` field decorator only at the moment
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/needle-component-compiler",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Compile mock unity components from typescript",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,7 +11,7 @@ var exportNextClassCommand = "@generate-component";
11
11
  var dontExportNextClassCommand = "@dont-generate-component";
12
12
  // add above field to add [SerializeField] attribute
13
13
  var serializeCommand = "@serializeField";
14
- var typePattern = new RegExp("@type ?\((?<type>.+)\)");
14
+ var typePattern = new RegExp("@type ?\(?(?<type>[\w\.]+)\)?");
15
15
  var ifdefPattern = new RegExp("@ifdef ?(?<ifdef>.+)");
16
16
  var CODEGEN_MARKER_START = "// NEEDLE_CODEGEN_START";
17
17
  var CODEGEN_MARKER_END = "// NEEDLE_CODEGEN_END";
@@ -12,7 +12,8 @@ const exportNextClassCommand = "@generate-component";
12
12
  const dontExportNextClassCommand = "@dont-generate-component";
13
13
  // add above field to add [SerializeField] attribute
14
14
  const serializeCommand = "@serializeField";
15
- const typePattern = new RegExp("@type ?\((?<type>.+)\)");
15
+ // https://regex101.com/r/ltpcKT/1
16
+ const typePattern = new RegExp("@type ?\(?(?<type>[\w\.]+)\)?");
16
17
  const ifdefPattern = new RegExp("@ifdef ?(?<ifdef>.+)")
17
18
 
18
19
  const CODEGEN_MARKER_START = "// NEEDLE_CODEGEN_START";