@needle-tools/needle-component-compiler 1.6.0 → 1.6.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 +1 -1
- package/package.json +1 -1
- package/src/component-compiler.js +3 -4
- package/src/component-compiler.ts +3 -3
- package/src/test.ts +1 -0
- package/src/component.cs +0 -1
package/Changelog.md
CHANGED
|
@@ -4,7 +4,7 @@ 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.6.
|
|
7
|
+
## [1.6.1] - 2022-07-10
|
|
8
8
|
- add using ``types.json`` json file that will be generated from Unity
|
|
9
9
|
- change ``@type`` annotiation to only work without braces to be consistent
|
|
10
10
|
|
package/package.json
CHANGED
|
@@ -12,8 +12,8 @@ var exportNextClassCommand = "@generate-component";
|
|
|
12
12
|
var dontExportNextClassCommand = "@dont-generate-component";
|
|
13
13
|
// add above field to add [SerializeField] attribute
|
|
14
14
|
var serializeCommand = "@serializeField";
|
|
15
|
-
// https://regex101.com/r/ltpcKT/
|
|
16
|
-
var typePattern = new RegExp("@type ?(
|
|
15
|
+
// https://regex101.com/r/ltpcKT/2
|
|
16
|
+
var typePattern = new RegExp("@type ?(?<type>.+)");
|
|
17
17
|
var ifdefPattern = new RegExp("@ifdef ?(?<ifdef>.+)");
|
|
18
18
|
var CODEGEN_MARKER_START = "// NEEDLE_CODEGEN_START";
|
|
19
19
|
var CODEGEN_MARKER_END = "// NEEDLE_CODEGEN_END";
|
|
@@ -156,7 +156,7 @@ function run(program, outputDir, sourceFile) {
|
|
|
156
156
|
// so we remove them
|
|
157
157
|
var type = typeMatch.groups["type"];
|
|
158
158
|
type = type.replace(/\(/, "").replace(/\)/, "");
|
|
159
|
-
console.log("
|
|
159
|
+
console.log("Found type: ", type);
|
|
160
160
|
lastTypeFound = type;
|
|
161
161
|
}
|
|
162
162
|
var ifdefMatch = ifdefPattern.exec(comment);
|
|
@@ -321,7 +321,6 @@ function run(program, outputDir, sourceFile) {
|
|
|
321
321
|
return true;
|
|
322
322
|
if (text === "Behaviour")
|
|
323
323
|
return true;
|
|
324
|
-
console.log(text);
|
|
325
324
|
var known = tryGetKnownType(text);
|
|
326
325
|
if (known)
|
|
327
326
|
return known;
|
|
@@ -11,8 +11,8 @@ const exportNextClassCommand = "@generate-component";
|
|
|
11
11
|
const dontExportNextClassCommand = "@dont-generate-component";
|
|
12
12
|
// add above field to add [SerializeField] attribute
|
|
13
13
|
const serializeCommand = "@serializeField";
|
|
14
|
-
// https://regex101.com/r/ltpcKT/
|
|
15
|
-
const typePattern = new RegExp("@type ?(
|
|
14
|
+
// https://regex101.com/r/ltpcKT/2
|
|
15
|
+
const typePattern = new RegExp("@type ?(?<type>.+)");
|
|
16
16
|
const ifdefPattern = new RegExp("@ifdef ?(?<ifdef>.+)")
|
|
17
17
|
|
|
18
18
|
const CODEGEN_MARKER_START = "// NEEDLE_CODEGEN_START";
|
|
@@ -181,7 +181,7 @@ export function run(program: ts.Program, outputDir: string, sourceFile: ts.Sourc
|
|
|
181
181
|
// so we remove them
|
|
182
182
|
let type = typeMatch.groups["type"];
|
|
183
183
|
type = type.replace(/\(/, "").replace(/\)/, "");
|
|
184
|
-
console.log("
|
|
184
|
+
console.log("Found type: ", type);
|
|
185
185
|
lastTypeFound = type;
|
|
186
186
|
}
|
|
187
187
|
|
package/src/test.ts
CHANGED
package/src/component.cs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
public class MyClass : MonoBehaviour {
|