@abco20/btxml-checker 0.1.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/package.json ADDED
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "@abco20/btxml-checker",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/abco20/btxml-checker.git",
9
+ "directory": "packages/btxml"
10
+ },
11
+ "homepage": "https://github.com/abco20/btxml-checker#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/abco20/btxml-checker/issues"
14
+ },
15
+ "keywords": [
16
+ "behaviortree",
17
+ "behaviortree.cpp",
18
+ "btcpp",
19
+ "groot",
20
+ "xml",
21
+ "formatter",
22
+ "linter",
23
+ "vscode"
24
+ ],
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "engines": {
29
+ "node": ">=20"
30
+ },
31
+ "scripts": {
32
+ "build": "tsup && node ../../scripts/copy-schemas.mjs --target schemas && node ../../scripts/copy-lsp-runtime.mjs --target dist"
33
+ },
34
+ "bin": {
35
+ "btxmlc": "./dist/cli.js"
36
+ },
37
+ "exports": {
38
+ ".": {
39
+ "types": "./dist/index.d.ts",
40
+ "import": "./dist/index.js"
41
+ },
42
+ "./editor": {
43
+ "types": "./dist/editor.d.ts",
44
+ "import": "./dist/editor.js"
45
+ },
46
+ "./editor/node": {
47
+ "types": "./dist/editor-node.d.ts",
48
+ "import": "./dist/editor-node.js"
49
+ },
50
+ "./semantic": {
51
+ "types": "./dist/semantic.d.ts",
52
+ "import": "./dist/semantic.js"
53
+ },
54
+ "./syntax": {
55
+ "types": "./dist/syntax.d.ts",
56
+ "import": "./dist/syntax.js"
57
+ },
58
+ "./model": {
59
+ "types": "./dist/model.d.ts",
60
+ "import": "./dist/model.js"
61
+ },
62
+ "./config": {
63
+ "types": "./dist/config.d.ts",
64
+ "import": "./dist/config.js"
65
+ },
66
+ "./rules": {
67
+ "types": "./dist/rules.d.ts",
68
+ "import": "./dist/rules.js"
69
+ },
70
+ "./schemas/btxml.config.schema.json": "./schemas/btxml.config.schema.json",
71
+ "./schemas/btxml.nodes.schema.json": "./schemas/btxml.nodes.schema.json"
72
+ },
73
+ "files": ["dist/**", "schemas/**", "README.md", "LICENSE", "THIRD_PARTY_NOTICES.md"],
74
+ "dependencies": {
75
+ "ajv": "^8.0.0",
76
+ "ignore": "^7.0.5",
77
+ "jsonc-parser": "^3.3.1",
78
+ "picocolors": "^1.1.1",
79
+ "yargs": "^18.0.0",
80
+ "zod": "^4.0.0"
81
+ },
82
+ "devDependencies": {
83
+ "@btxml/analyzer": "workspace:*",
84
+ "@btxml/config": "workspace:*",
85
+ "@btxml/core": "workspace:*",
86
+ "@btxml/foundation": "workspace:*",
87
+ "@btxml/language-service": "workspace:*",
88
+ "@btxml/model": "workspace:*",
89
+ "@btxml/project": "workspace:*",
90
+ "@btxml/semantic": "workspace:*",
91
+ "@btxml/syntax": "workspace:*"
92
+ }
93
+ }
@@ -0,0 +1,441 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "BTXMLConfig",
4
+ "description": "Configuration schema for btxml projects.",
5
+ "type": "object",
6
+ "properties": {
7
+ "$schema": {
8
+ "type": "string"
9
+ },
10
+ "files": {
11
+ "type": "object",
12
+ "properties": {
13
+ "followSymlinks": {
14
+ "type": "boolean"
15
+ },
16
+ "ignore": {
17
+ "type": "array",
18
+ "items": {
19
+ "type": "string"
20
+ }
21
+ },
22
+ "include": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "string"
26
+ }
27
+ },
28
+ "maxSize": {
29
+ "type": "integer",
30
+ "maximum": 9007199254740991,
31
+ "exclusiveMinimum": 0
32
+ },
33
+ "useGitignore": {
34
+ "type": "boolean"
35
+ }
36
+ },
37
+ "additionalProperties": false
38
+ },
39
+ "formatter": {
40
+ "type": "object",
41
+ "properties": {
42
+ "blankLineBetweenBehaviorTrees": {
43
+ "type": "boolean"
44
+ },
45
+ "indentWidth": {
46
+ "type": "integer",
47
+ "minimum": 1,
48
+ "maximum": 8
49
+ },
50
+ "lineEnding": {
51
+ "type": "string",
52
+ "enum": ["lf", "crlf", "auto"]
53
+ },
54
+ "xmlDeclaration": {
55
+ "type": "string",
56
+ "enum": ["always", "never", "preserve"]
57
+ }
58
+ },
59
+ "additionalProperties": false
60
+ },
61
+ "linter": {
62
+ "type": "object",
63
+ "properties": {
64
+ "baseline": {
65
+ "type": "string"
66
+ },
67
+ "enabled": {
68
+ "type": "boolean"
69
+ },
70
+ "rules": {
71
+ "type": "object",
72
+ "propertyNames": {
73
+ "enum": [
74
+ "include/no-cycle",
75
+ "include/no-depth-exceeded",
76
+ "include/no-missing-file",
77
+ "include/no-missing-ros-package",
78
+ "include/no-outside-root",
79
+ "include/no-too-many-files",
80
+ "include/no-unresolved-variable",
81
+ "include/report-external-used",
82
+ "include/require-path",
83
+ "include/require-ros-package-resolver",
84
+ "model/no-blackboard-type-mismatch",
85
+ "model/no-childless-control-shape-mismatch",
86
+ "model/no-conflicting-definition",
87
+ "model/no-duplicate-port-name",
88
+ "model/no-leaf-block-shape",
89
+ "model/no-unknown-node",
90
+ "model/no-unknown-port",
91
+ "model/require-output-port-remap",
92
+ "model/require-port",
93
+ "model/require-port-name",
94
+ "model/valid-child-count",
95
+ "model/valid-port-default-value",
96
+ "model/valid-port-name",
97
+ "model/valid-port-value",
98
+ "script/no-unknown-variable",
99
+ "script/valid-assignment",
100
+ "script/valid-expression-type",
101
+ "script/valid-result-type",
102
+ "script/valid-syntax",
103
+ "suppression/no-unused",
104
+ "suppression/require-reason",
105
+ "tree/no-ambiguous-subtree",
106
+ "tree/no-duplicate-id",
107
+ "tree/no-duplicate-id-in-file",
108
+ "tree/no-duplicate-node-model-id",
109
+ "tree/no-unknown-main-tree",
110
+ "tree/no-unknown-subtree",
111
+ "tree/require-id",
112
+ "xml/no-unknown-top-level-element",
113
+ "xml/require-btcpp-format",
114
+ "xml/valid-root"
115
+ ]
116
+ },
117
+ "additionalProperties": {
118
+ "anyOf": [
119
+ {
120
+ "type": "string",
121
+ "enum": ["off", "info", "warn", "error"]
122
+ },
123
+ {
124
+ "type": "array",
125
+ "items": [
126
+ {
127
+ "type": "string",
128
+ "enum": ["off", "info", "warn", "error"]
129
+ },
130
+ {
131
+ "type": "object",
132
+ "propertyNames": {
133
+ "type": "string"
134
+ },
135
+ "additionalProperties": {}
136
+ }
137
+ ],
138
+ "additionalItems": false,
139
+ "minItems": 2,
140
+ "maxItems": 2
141
+ }
142
+ ]
143
+ }
144
+ },
145
+ "suppressions": {
146
+ "type": "object",
147
+ "properties": {
148
+ "inline": {
149
+ "type": "string",
150
+ "enum": ["allow", "deny"]
151
+ }
152
+ },
153
+ "additionalProperties": false
154
+ }
155
+ },
156
+ "additionalProperties": false
157
+ },
158
+ "models": {
159
+ "type": "object",
160
+ "properties": {
161
+ "definitions": {
162
+ "type": "array",
163
+ "items": {
164
+ "type": "string"
165
+ }
166
+ },
167
+ "augmentations": {
168
+ "type": "array",
169
+ "items": {
170
+ "type": "string"
171
+ }
172
+ },
173
+ "builtins": {
174
+ "type": "array",
175
+ "items": {
176
+ "type": "string",
177
+ "enum": ["btcpp-v4", "btcpp-v4.6.2", "btcpp-v4.8.2", "btcpp-v4.9.0"]
178
+ }
179
+ },
180
+ "files": {
181
+ "type": "array",
182
+ "items": {
183
+ "type": "string"
184
+ }
185
+ },
186
+ "inline": {
187
+ "type": "object",
188
+ "propertyNames": {
189
+ "type": "string"
190
+ },
191
+ "additionalProperties": {
192
+ "type": "object",
193
+ "properties": {
194
+ "description": {
195
+ "type": "string"
196
+ },
197
+ "kind": {
198
+ "type": "string",
199
+ "enum": ["Action", "Condition", "Control", "Decorator", "SubTree"]
200
+ },
201
+ "ports": {
202
+ "type": "object",
203
+ "propertyNames": {
204
+ "type": "string"
205
+ },
206
+ "additionalProperties": {
207
+ "type": "object",
208
+ "properties": {
209
+ "description": {
210
+ "type": "string"
211
+ },
212
+ "type": {
213
+ "type": "string"
214
+ },
215
+ "enum": {
216
+ "type": "array",
217
+ "items": {
218
+ "type": "string"
219
+ }
220
+ },
221
+ "required": {
222
+ "type": "boolean"
223
+ },
224
+ "default": {
225
+ "type": "string"
226
+ },
227
+ "direction": {
228
+ "type": "string",
229
+ "enum": ["input", "output", "inout"]
230
+ }
231
+ },
232
+ "additionalProperties": false
233
+ }
234
+ }
235
+ },
236
+ "required": ["kind"],
237
+ "additionalProperties": false
238
+ }
239
+ }
240
+ },
241
+ "additionalProperties": false
242
+ },
243
+ "overrides": {
244
+ "type": "array",
245
+ "items": {
246
+ "type": "object",
247
+ "properties": {
248
+ "files": {
249
+ "type": "array",
250
+ "items": {
251
+ "type": "string"
252
+ }
253
+ },
254
+ "formatter": {
255
+ "type": "object",
256
+ "properties": {
257
+ "blankLineBetweenBehaviorTrees": {
258
+ "type": "boolean"
259
+ },
260
+ "indentWidth": {
261
+ "type": "integer",
262
+ "minimum": 1,
263
+ "maximum": 8
264
+ },
265
+ "lineEnding": {
266
+ "type": "string",
267
+ "enum": ["lf", "crlf", "auto"]
268
+ },
269
+ "xmlDeclaration": {
270
+ "type": "string",
271
+ "enum": ["always", "never", "preserve"]
272
+ }
273
+ },
274
+ "additionalProperties": false
275
+ },
276
+ "linter": {
277
+ "type": "object",
278
+ "properties": {
279
+ "rules": {
280
+ "type": "object",
281
+ "propertyNames": {
282
+ "enum": [
283
+ "include/no-cycle",
284
+ "include/no-depth-exceeded",
285
+ "include/no-missing-file",
286
+ "include/no-missing-ros-package",
287
+ "include/no-outside-root",
288
+ "include/no-too-many-files",
289
+ "include/no-unresolved-variable",
290
+ "include/report-external-used",
291
+ "include/require-path",
292
+ "include/require-ros-package-resolver",
293
+ "model/no-blackboard-type-mismatch",
294
+ "model/no-childless-control-shape-mismatch",
295
+ "model/no-conflicting-definition",
296
+ "model/no-duplicate-port-name",
297
+ "model/no-leaf-block-shape",
298
+ "model/no-unknown-node",
299
+ "model/no-unknown-port",
300
+ "model/require-output-port-remap",
301
+ "model/require-port",
302
+ "model/require-port-name",
303
+ "model/valid-child-count",
304
+ "model/valid-port-default-value",
305
+ "model/valid-port-name",
306
+ "model/valid-port-value",
307
+ "script/no-unknown-variable",
308
+ "script/valid-assignment",
309
+ "script/valid-expression-type",
310
+ "script/valid-result-type",
311
+ "script/valid-syntax",
312
+ "suppression/no-unused",
313
+ "suppression/require-reason",
314
+ "tree/no-ambiguous-subtree",
315
+ "tree/no-duplicate-id",
316
+ "tree/no-duplicate-id-in-file",
317
+ "tree/no-duplicate-node-model-id",
318
+ "tree/no-unknown-main-tree",
319
+ "tree/no-unknown-subtree",
320
+ "tree/require-id",
321
+ "xml/no-unknown-top-level-element",
322
+ "xml/require-btcpp-format",
323
+ "xml/valid-root"
324
+ ]
325
+ },
326
+ "additionalProperties": {
327
+ "anyOf": [
328
+ {
329
+ "type": "string",
330
+ "enum": ["off", "info", "warn", "error"]
331
+ },
332
+ {
333
+ "type": "array",
334
+ "items": [
335
+ {
336
+ "type": "string",
337
+ "enum": ["off", "info", "warn", "error"]
338
+ },
339
+ {
340
+ "type": "object",
341
+ "propertyNames": {
342
+ "type": "string"
343
+ },
344
+ "additionalProperties": {}
345
+ }
346
+ ],
347
+ "additionalItems": false,
348
+ "minItems": 2,
349
+ "maxItems": 2
350
+ }
351
+ ]
352
+ }
353
+ },
354
+ "suppressions": {
355
+ "type": "object",
356
+ "properties": {
357
+ "inline": {
358
+ "type": "string",
359
+ "enum": ["allow", "deny"]
360
+ }
361
+ },
362
+ "additionalProperties": false
363
+ }
364
+ },
365
+ "additionalProperties": false
366
+ }
367
+ },
368
+ "required": ["files"],
369
+ "additionalProperties": false
370
+ }
371
+ },
372
+ "resolver": {
373
+ "type": "object",
374
+ "properties": {
375
+ "behaviorTreeIds": {
376
+ "type": "string",
377
+ "enum": ["workspace-unique", "file-local-first", "allow-ambiguous"]
378
+ },
379
+ "entrypoints": {
380
+ "type": "array",
381
+ "items": {
382
+ "type": "string"
383
+ }
384
+ },
385
+ "includes": {
386
+ "type": "object",
387
+ "properties": {
388
+ "allowOutsideRoot": {
389
+ "type": "boolean"
390
+ },
391
+ "elements": {
392
+ "type": "array",
393
+ "items": {
394
+ "type": "object",
395
+ "properties": {
396
+ "attribute": {
397
+ "type": "string"
398
+ },
399
+ "base": {
400
+ "type": "string",
401
+ "enum": ["file", "project-root"]
402
+ },
403
+ "name": {
404
+ "type": "string"
405
+ }
406
+ },
407
+ "required": ["name", "attribute"],
408
+ "additionalProperties": false
409
+ }
410
+ },
411
+ "maxDepth": {
412
+ "type": "integer",
413
+ "minimum": 1,
414
+ "maximum": 9007199254740991
415
+ },
416
+ "maxFiles": {
417
+ "type": "integer",
418
+ "minimum": 1,
419
+ "maximum": 9007199254740991
420
+ },
421
+ "variables": {
422
+ "type": "object",
423
+ "propertyNames": {
424
+ "type": "string"
425
+ },
426
+ "additionalProperties": {
427
+ "type": "string"
428
+ }
429
+ }
430
+ },
431
+ "additionalProperties": false
432
+ }
433
+ },
434
+ "additionalProperties": false
435
+ },
436
+ "strict": {
437
+ "type": "boolean"
438
+ }
439
+ },
440
+ "additionalProperties": false
441
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "BtxmlNodes",
4
+ "description": "Node definition schema for btxml projects.",
5
+ "type": "object",
6
+ "properties": {
7
+ "nodes": {
8
+ "type": "object",
9
+ "propertyNames": {
10
+ "type": "string"
11
+ },
12
+ "additionalProperties": {
13
+ "type": "object",
14
+ "properties": {
15
+ "description": {
16
+ "type": "string"
17
+ },
18
+ "kind": {
19
+ "type": "string",
20
+ "enum": ["Action", "Condition", "Control", "Decorator", "SubTree"]
21
+ },
22
+ "ports": {
23
+ "type": "object",
24
+ "propertyNames": {
25
+ "type": "string"
26
+ },
27
+ "additionalProperties": {
28
+ "type": "object",
29
+ "properties": {
30
+ "description": {
31
+ "type": "string"
32
+ },
33
+ "type": {
34
+ "type": "string"
35
+ },
36
+ "enum": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "string"
40
+ }
41
+ },
42
+ "required": {
43
+ "type": "boolean"
44
+ },
45
+ "default": {
46
+ "type": "string"
47
+ },
48
+ "direction": {
49
+ "type": "string",
50
+ "enum": ["input", "output", "inout"]
51
+ }
52
+ },
53
+ "additionalProperties": false
54
+ }
55
+ }
56
+ },
57
+ "required": ["kind"],
58
+ "additionalProperties": false
59
+ }
60
+ }
61
+ },
62
+ "required": ["nodes"],
63
+ "additionalProperties": false
64
+ }