@playcanvas/attribute-parser 1.6.1 → 1.7.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/LICENSE.md +19 -0
- package/dist/index.js +445 -0
- package/dist/libs.d.ts +50978 -0
- package/package.json +50 -10
- package/types/index.d.ts +55 -0
- package/types/parsers/attribute-parser.d.ts +55 -0
- package/types/parsers/parsing-error.d.ts +6 -0
- package/types/parsers/script-parser.d.ts +124 -0
- package/types/utils/attribute-utils.d.ts +5 -0
- package/{src/utils/generic-utils.js → types/utils/generic-utils.d.ts} +1 -10
- package/types/utils/tag-utils.d.ts +16 -0
- package/types/utils/ts-utils.d.ts +103 -0
- package/.github/workflows/ci.yml +0 -49
- package/eslint.config.mjs +0 -35
- package/renovate.json +0 -25
- package/src/index.js +0 -273
- package/src/parsers/attribute-parser.js +0 -197
- package/src/parsers/parsing-error.js +0 -14
- package/src/parsers/script-parser.js +0 -432
- package/src/utils/attribute-utils.js +0 -53
- package/src/utils/tag-utils.js +0 -73
- package/src/utils/ts-utils.js +0 -634
- package/test/fixtures/asset.invalid.js +0 -27
- package/test/fixtures/asset.invalid.ts +0 -24
- package/test/fixtures/asset.valid.js +0 -26
- package/test/fixtures/asset.valid.ts +0 -21
- package/test/fixtures/checkbox.valid.js +0 -23
- package/test/fixtures/color.valid.js +0 -23
- package/test/fixtures/conditional.valid.js +0 -22
- package/test/fixtures/curve.invalid.js +0 -29
- package/test/fixtures/curve.valid.js +0 -49
- package/test/fixtures/empty.valid.js +0 -0
- package/test/fixtures/entity.valid.js +0 -23
- package/test/fixtures/enum.valid.js +0 -66
- package/test/fixtures/enum.valid.ts +0 -50
- package/test/fixtures/example.dep.js +0 -9
- package/test/fixtures/export.import.js +0 -8
- package/test/fixtures/export.valid.js +0 -26
- package/test/fixtures/inherit.valid.js +0 -45
- package/test/fixtures/intellisense.valid.js +0 -40
- package/test/fixtures/json.invalid.js +0 -23
- package/test/fixtures/json.valid.js +0 -115
- package/test/fixtures/json.valid.ts +0 -81
- package/test/fixtures/misc.invalid.js +0 -24
- package/test/fixtures/misc.valid.js +0 -51
- package/test/fixtures/numeric.invalid.js +0 -38
- package/test/fixtures/numeric.valid.js +0 -63
- package/test/fixtures/playcanvas.d.ts +0 -47963
- package/test/fixtures/program.invalid.js +0 -12
- package/test/fixtures/program.valid.js +0 -27
- package/test/fixtures/text.valid.js +0 -31
- package/test/fixtures/vector.invalid.js +0 -14
- package/test/fixtures/vector.valid.js +0 -24
- package/test/tests/invalid/asset.test.js +0 -47
- package/test/tests/invalid/curve.test.js +0 -23
- package/test/tests/invalid/json.test.js +0 -27
- package/test/tests/invalid/misc.test.js +0 -41
- package/test/tests/invalid/numeric.test.js +0 -55
- package/test/tests/invalid/program.test.js +0 -17
- package/test/tests/invalid/vector.test.js +0 -28
- package/test/tests/valid/asset.test.js +0 -59
- package/test/tests/valid/checkbox.test.js +0 -57
- package/test/tests/valid/color.test.js +0 -49
- package/test/tests/valid/conditional.test.js +0 -45
- package/test/tests/valid/curve.test.js +0 -76
- package/test/tests/valid/empty.test.js +0 -17
- package/test/tests/valid/entity.test.js +0 -49
- package/test/tests/valid/enum.test.js +0 -79
- package/test/tests/valid/export.test.js +0 -67
- package/test/tests/valid/inherit.test.js +0 -110
- package/test/tests/valid/intellisense.test.js +0 -39
- package/test/tests/valid/json.test.js +0 -315
- package/test/tests/valid/misc.test.js +0 -54
- package/test/tests/valid/numeric.test.js +0 -103
- package/test/tests/valid/program.test.js +0 -23
- package/test/tests/valid/text.test.js +0 -58
- package/test/tests/valid/vector.test.js +0 -53
- package/test/utils.js +0 -54
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Script, GraphNode } from 'playcanvas';
|
|
2
|
-
|
|
3
|
-
class Vec3 {}
|
|
4
|
-
|
|
5
|
-
class Example extends Script {
|
|
6
|
-
/**
|
|
7
|
-
* @attribute
|
|
8
|
-
*/
|
|
9
|
-
e = new GraphNode();
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @attribute
|
|
13
|
-
*/
|
|
14
|
-
f = new Vec3(); // Vec3 is not from playcanvas. It's type cannot be inferred
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @attribute
|
|
18
|
-
* @type {number[]}
|
|
19
|
-
* @size a
|
|
20
|
-
*/
|
|
21
|
-
g;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { Example };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Script } from 'playcanvas';
|
|
2
|
-
|
|
3
|
-
class Example extends Script {
|
|
4
|
-
/**
|
|
5
|
-
* This is a description of the attribute. It can be multi-sentence.
|
|
6
|
-
*
|
|
7
|
-
* And multi-line too
|
|
8
|
-
*
|
|
9
|
-
* @attribute
|
|
10
|
-
* @type {number}
|
|
11
|
-
* @title A number
|
|
12
|
-
*/
|
|
13
|
-
a;
|
|
14
|
-
|
|
15
|
-
_b = 10;
|
|
16
|
-
|
|
17
|
-
_d = 10;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @attribute
|
|
21
|
-
* @type {number}
|
|
22
|
-
*/
|
|
23
|
-
set b(v) {
|
|
24
|
-
this._b = v;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
get b() {
|
|
28
|
-
return this._b;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @type {number}
|
|
33
|
-
*/
|
|
34
|
-
c;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Reverse order gett/setter accessor
|
|
38
|
-
* @attribute
|
|
39
|
-
* @type {number}
|
|
40
|
-
*/
|
|
41
|
-
get d() {
|
|
42
|
-
return this._d;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// eslint-disable-next-line grouped-accessor-pairs
|
|
46
|
-
set d(v) {
|
|
47
|
-
this._d = v;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export { Example };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Script } from 'playcanvas';
|
|
2
|
-
|
|
3
|
-
class Example extends Script {
|
|
4
|
-
/**
|
|
5
|
-
* @attribute
|
|
6
|
-
* @range ['a', 'b']
|
|
7
|
-
*/
|
|
8
|
-
a = 0;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @attribute
|
|
12
|
-
* @step 0.1
|
|
13
|
-
*/
|
|
14
|
-
b;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @attribute
|
|
18
|
-
* @precision 2
|
|
19
|
-
*/
|
|
20
|
-
c;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @attribute
|
|
24
|
-
* @type {number}
|
|
25
|
-
* @step a
|
|
26
|
-
* @precision b
|
|
27
|
-
*/
|
|
28
|
-
d;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @attribute
|
|
32
|
-
* @type {number}
|
|
33
|
-
* @step
|
|
34
|
-
*/
|
|
35
|
-
e;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export { Example };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Script } from 'playcanvas';
|
|
2
|
-
|
|
3
|
-
class Example extends Script {
|
|
4
|
-
/**
|
|
5
|
-
* @attribute
|
|
6
|
-
* @type {number}
|
|
7
|
-
*/
|
|
8
|
-
a;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @attribute
|
|
12
|
-
*/
|
|
13
|
-
b = 1;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @attribute
|
|
17
|
-
* @type {number}
|
|
18
|
-
* @precision 2
|
|
19
|
-
* @step 0.01
|
|
20
|
-
*/
|
|
21
|
-
c;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @attribute
|
|
25
|
-
* @type {number}
|
|
26
|
-
* @range [0, 1]
|
|
27
|
-
* @precision 2
|
|
28
|
-
* @step 0.01
|
|
29
|
-
*/
|
|
30
|
-
d;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @attribute
|
|
34
|
-
* @type {number[]}
|
|
35
|
-
* @size 2
|
|
36
|
-
*/
|
|
37
|
-
e;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* @attribute
|
|
41
|
-
* @type {number}
|
|
42
|
-
* @range [ - 0xFF, 0o0 ]
|
|
43
|
-
* @precision 0b10
|
|
44
|
-
* @step 1e-2
|
|
45
|
-
*/
|
|
46
|
-
f;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @attribute
|
|
50
|
-
* @type {number}
|
|
51
|
-
* @range [1]
|
|
52
|
-
*/
|
|
53
|
-
g;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* @attribute
|
|
57
|
-
* @type {number}
|
|
58
|
-
* @range []
|
|
59
|
-
*/
|
|
60
|
-
h;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export { Example };
|