@player-tools/cli 0.8.0 → 0.8.1--canary.169.3663
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/dist/commands/json/validate.js +0 -1
- package/dist/utils/diag-renderer.js +10 -3
- package/oclif.manifest.json +81 -81
- package/package.json +7 -7
|
@@ -58,7 +58,6 @@ class Validate extends base_command_1.BaseCommand {
|
|
|
58
58
|
},
|
|
59
59
|
run: async () => {
|
|
60
60
|
const contents = await fs_1.promises.readFile(f, "utf-8");
|
|
61
|
-
const lsp = await this.createLanguageService(exp);
|
|
62
61
|
const validations = (await lsp.validateTextDocument(vscode_languageserver_textdocument_1.TextDocument.create(`file://${f}`, "json", 1, contents))) ?? [];
|
|
63
62
|
return validations;
|
|
64
63
|
},
|
|
@@ -59,9 +59,16 @@ function getSummary({ errors, warnings, skipped, fileCount, duration, }) {
|
|
|
59
59
|
}
|
|
60
60
|
/** Format a diag for printing on the console */
|
|
61
61
|
function formatDiagnostic(diag, longestLine, fName) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
let type;
|
|
63
|
+
if (diag.severity === vscode_languageserver_types_1.DiagnosticSeverity.Error) {
|
|
64
|
+
type = chalk_1.default.red(`${log_symbols_1.default.error} `);
|
|
65
|
+
}
|
|
66
|
+
else if (diag.severity === vscode_languageserver_types_1.DiagnosticSeverity.Warning) {
|
|
67
|
+
type = chalk_1.default.yellow(`${log_symbols_1.default.warning} `);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
type = chalk_1.default.blue(`${log_symbols_1.default.info} `);
|
|
71
|
+
}
|
|
65
72
|
const msg = chalk_1.default.bold(diag.message);
|
|
66
73
|
const range = getLineRange(diag.range);
|
|
67
74
|
return [
|
package/oclif.manifest.json
CHANGED
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"check.js"
|
|
56
56
|
]
|
|
57
57
|
},
|
|
58
|
-
"
|
|
58
|
+
"dsl:compile": {
|
|
59
59
|
"aliases": [],
|
|
60
60
|
"args": {},
|
|
61
|
-
"description": "
|
|
61
|
+
"description": "Compile Player DSL files into JSON",
|
|
62
62
|
"flags": {
|
|
63
63
|
"config": {
|
|
64
64
|
"char": "c",
|
|
@@ -70,9 +70,8 @@
|
|
|
70
70
|
},
|
|
71
71
|
"input": {
|
|
72
72
|
"char": "i",
|
|
73
|
-
"description": "An input directory to
|
|
73
|
+
"description": "An input directory to compile.\nAny jsx/ts/tsx files will be loaded via babel-require automatically.",
|
|
74
74
|
"name": "input",
|
|
75
|
-
"default": "./src",
|
|
76
75
|
"hasDynamicHelp": false,
|
|
77
76
|
"multiple": false,
|
|
78
77
|
"type": "option"
|
|
@@ -81,29 +80,39 @@
|
|
|
81
80
|
"char": "o",
|
|
82
81
|
"description": "Output directory to write results to.",
|
|
83
82
|
"name": "output",
|
|
84
|
-
"default": "./dist",
|
|
85
83
|
"hasDynamicHelp": false,
|
|
86
84
|
"multiple": false,
|
|
87
85
|
"type": "option"
|
|
88
86
|
},
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
87
|
+
"skip-validation": {
|
|
88
|
+
"description": "Option to skip validating the generated JSON",
|
|
89
|
+
"name": "skip-validation",
|
|
90
|
+
"allowNo": false,
|
|
91
|
+
"type": "boolean"
|
|
92
|
+
},
|
|
93
|
+
"exp": {
|
|
94
|
+
"description": "Use experimental language features",
|
|
95
|
+
"name": "exp",
|
|
96
|
+
"allowNo": false,
|
|
97
|
+
"type": "boolean"
|
|
98
|
+
},
|
|
99
|
+
"severity": {
|
|
100
|
+
"char": "s",
|
|
101
|
+
"description": "The severity of the validation",
|
|
102
|
+
"name": "severity",
|
|
103
|
+
"default": "error",
|
|
94
104
|
"hasDynamicHelp": false,
|
|
95
|
-
"helpValue": "(plugin|types)",
|
|
96
105
|
"multiple": false,
|
|
97
106
|
"options": [
|
|
98
|
-
"
|
|
99
|
-
"
|
|
107
|
+
"error",
|
|
108
|
+
"warn"
|
|
100
109
|
],
|
|
101
110
|
"type": "option"
|
|
102
111
|
}
|
|
103
112
|
},
|
|
104
113
|
"hasDynamicHelp": false,
|
|
105
114
|
"hiddenAliases": [],
|
|
106
|
-
"id": "
|
|
115
|
+
"id": "dsl:compile",
|
|
107
116
|
"pluginAlias": "@player-tools/cli",
|
|
108
117
|
"pluginName": "@player-tools/cli",
|
|
109
118
|
"pluginType": "core",
|
|
@@ -115,14 +124,14 @@
|
|
|
115
124
|
"relativePath": [
|
|
116
125
|
"dist",
|
|
117
126
|
"commands",
|
|
118
|
-
"
|
|
127
|
+
"dsl",
|
|
119
128
|
"compile.js"
|
|
120
129
|
]
|
|
121
130
|
},
|
|
122
|
-
"
|
|
131
|
+
"dsl:validate": {
|
|
123
132
|
"aliases": [],
|
|
124
133
|
"args": {},
|
|
125
|
-
"description": "
|
|
134
|
+
"description": "Validate TSX files before they get compiled",
|
|
126
135
|
"flags": {
|
|
127
136
|
"config": {
|
|
128
137
|
"char": "c",
|
|
@@ -132,39 +141,31 @@
|
|
|
132
141
|
"multiple": false,
|
|
133
142
|
"type": "option"
|
|
134
143
|
},
|
|
135
|
-
"
|
|
136
|
-
"char": "
|
|
137
|
-
"description": "
|
|
138
|
-
"name": "
|
|
139
|
-
"default": "./dist",
|
|
140
|
-
"hasDynamicHelp": false,
|
|
141
|
-
"multiple": false,
|
|
142
|
-
"type": "option"
|
|
143
|
-
},
|
|
144
|
-
"output": {
|
|
145
|
-
"char": "o",
|
|
146
|
-
"description": "Output directory to write results to.",
|
|
147
|
-
"name": "output",
|
|
144
|
+
"files": {
|
|
145
|
+
"char": "f",
|
|
146
|
+
"description": "A list of files or globs to validate",
|
|
147
|
+
"name": "files",
|
|
148
148
|
"hasDynamicHelp": false,
|
|
149
|
-
"multiple":
|
|
149
|
+
"multiple": true,
|
|
150
150
|
"type": "option"
|
|
151
151
|
},
|
|
152
|
-
"
|
|
153
|
-
"char": "
|
|
154
|
-
"description": "
|
|
155
|
-
"name": "
|
|
152
|
+
"severity": {
|
|
153
|
+
"char": "s",
|
|
154
|
+
"description": "Setting the validation severity to 'warn' will change the validation step into a warning-only, not halting the process with code 1. That exposes an intermediate option between the default behaviour, where it will fail on errors, and skipping validation.",
|
|
155
|
+
"name": "severity",
|
|
156
|
+
"default": "error",
|
|
156
157
|
"hasDynamicHelp": false,
|
|
157
|
-
"helpValue": "(TypeScript)",
|
|
158
158
|
"multiple": false,
|
|
159
159
|
"options": [
|
|
160
|
-
"
|
|
160
|
+
"error",
|
|
161
|
+
"warn"
|
|
161
162
|
],
|
|
162
163
|
"type": "option"
|
|
163
164
|
}
|
|
164
165
|
},
|
|
165
166
|
"hasDynamicHelp": false,
|
|
166
167
|
"hiddenAliases": [],
|
|
167
|
-
"id": "
|
|
168
|
+
"id": "dsl:validate",
|
|
168
169
|
"pluginAlias": "@player-tools/cli",
|
|
169
170
|
"pluginName": "@player-tools/cli",
|
|
170
171
|
"pluginType": "core",
|
|
@@ -176,14 +177,14 @@
|
|
|
176
177
|
"relativePath": [
|
|
177
178
|
"dist",
|
|
178
179
|
"commands",
|
|
179
|
-
"
|
|
180
|
-
"
|
|
180
|
+
"dsl",
|
|
181
|
+
"validate.js"
|
|
181
182
|
]
|
|
182
183
|
},
|
|
183
|
-
"
|
|
184
|
+
"xlr:compile": {
|
|
184
185
|
"aliases": [],
|
|
185
186
|
"args": {},
|
|
186
|
-
"description": "
|
|
187
|
+
"description": "Compiles typescript files to XLRs format",
|
|
187
188
|
"flags": {
|
|
188
189
|
"config": {
|
|
189
190
|
"char": "c",
|
|
@@ -195,8 +196,9 @@
|
|
|
195
196
|
},
|
|
196
197
|
"input": {
|
|
197
198
|
"char": "i",
|
|
198
|
-
"description": "An input directory to
|
|
199
|
+
"description": "An input directory to search for types to export",
|
|
199
200
|
"name": "input",
|
|
201
|
+
"default": "./src",
|
|
200
202
|
"hasDynamicHelp": false,
|
|
201
203
|
"multiple": false,
|
|
202
204
|
"type": "option"
|
|
@@ -205,39 +207,29 @@
|
|
|
205
207
|
"char": "o",
|
|
206
208
|
"description": "Output directory to write results to.",
|
|
207
209
|
"name": "output",
|
|
210
|
+
"default": "./dist",
|
|
208
211
|
"hasDynamicHelp": false,
|
|
209
212
|
"multiple": false,
|
|
210
213
|
"type": "option"
|
|
211
214
|
},
|
|
212
|
-
"
|
|
213
|
-
"
|
|
214
|
-
"
|
|
215
|
-
"
|
|
216
|
-
"
|
|
217
|
-
},
|
|
218
|
-
"exp": {
|
|
219
|
-
"description": "Use experimental language features",
|
|
220
|
-
"name": "exp",
|
|
221
|
-
"allowNo": false,
|
|
222
|
-
"type": "boolean"
|
|
223
|
-
},
|
|
224
|
-
"severity": {
|
|
225
|
-
"char": "s",
|
|
226
|
-
"description": "The severity of the validation",
|
|
227
|
-
"name": "severity",
|
|
228
|
-
"default": "error",
|
|
215
|
+
"mode": {
|
|
216
|
+
"char": "m",
|
|
217
|
+
"description": "Search strategy for types to export: plugin (default, looks for exported EnchancedPlayerPlugin classes) or type (all exported types)",
|
|
218
|
+
"name": "mode",
|
|
219
|
+
"default": "plugin",
|
|
229
220
|
"hasDynamicHelp": false,
|
|
221
|
+
"helpValue": "(plugin|types)",
|
|
230
222
|
"multiple": false,
|
|
231
223
|
"options": [
|
|
232
|
-
"
|
|
233
|
-
"
|
|
224
|
+
"plugin",
|
|
225
|
+
"types"
|
|
234
226
|
],
|
|
235
227
|
"type": "option"
|
|
236
228
|
}
|
|
237
229
|
},
|
|
238
230
|
"hasDynamicHelp": false,
|
|
239
231
|
"hiddenAliases": [],
|
|
240
|
-
"id": "
|
|
232
|
+
"id": "xlr:compile",
|
|
241
233
|
"pluginAlias": "@player-tools/cli",
|
|
242
234
|
"pluginName": "@player-tools/cli",
|
|
243
235
|
"pluginType": "core",
|
|
@@ -249,14 +241,14 @@
|
|
|
249
241
|
"relativePath": [
|
|
250
242
|
"dist",
|
|
251
243
|
"commands",
|
|
252
|
-
"
|
|
244
|
+
"xlr",
|
|
253
245
|
"compile.js"
|
|
254
246
|
]
|
|
255
247
|
},
|
|
256
|
-
"
|
|
248
|
+
"xlr:convert": {
|
|
257
249
|
"aliases": [],
|
|
258
250
|
"args": {},
|
|
259
|
-
"description": "
|
|
251
|
+
"description": "Exports XLRs files to a specific language",
|
|
260
252
|
"flags": {
|
|
261
253
|
"config": {
|
|
262
254
|
"char": "c",
|
|
@@ -266,31 +258,39 @@
|
|
|
266
258
|
"multiple": false,
|
|
267
259
|
"type": "option"
|
|
268
260
|
},
|
|
269
|
-
"
|
|
270
|
-
"char": "
|
|
271
|
-
"description": "
|
|
272
|
-
"name": "
|
|
261
|
+
"input": {
|
|
262
|
+
"char": "i",
|
|
263
|
+
"description": "An input directory to search for types to export",
|
|
264
|
+
"name": "input",
|
|
265
|
+
"default": "./dist",
|
|
273
266
|
"hasDynamicHelp": false,
|
|
274
|
-
"multiple":
|
|
267
|
+
"multiple": false,
|
|
275
268
|
"type": "option"
|
|
276
269
|
},
|
|
277
|
-
"
|
|
278
|
-
"char": "
|
|
279
|
-
"description": "
|
|
280
|
-
"name": "
|
|
281
|
-
"
|
|
270
|
+
"output": {
|
|
271
|
+
"char": "o",
|
|
272
|
+
"description": "Output directory to write results to.",
|
|
273
|
+
"name": "output",
|
|
274
|
+
"hasDynamicHelp": false,
|
|
275
|
+
"multiple": false,
|
|
276
|
+
"type": "option"
|
|
277
|
+
},
|
|
278
|
+
"lang": {
|
|
279
|
+
"char": "l",
|
|
280
|
+
"description": "Search strategy for types to export: plugin (default, looks for exported EnchancedPlayerPlugin classes) or type (all exported types)",
|
|
281
|
+
"name": "lang",
|
|
282
282
|
"hasDynamicHelp": false,
|
|
283
|
+
"helpValue": "(TypeScript)",
|
|
283
284
|
"multiple": false,
|
|
284
285
|
"options": [
|
|
285
|
-
"
|
|
286
|
-
"warn"
|
|
286
|
+
"TypeScript"
|
|
287
287
|
],
|
|
288
288
|
"type": "option"
|
|
289
289
|
}
|
|
290
290
|
},
|
|
291
291
|
"hasDynamicHelp": false,
|
|
292
292
|
"hiddenAliases": [],
|
|
293
|
-
"id": "
|
|
293
|
+
"id": "xlr:convert",
|
|
294
294
|
"pluginAlias": "@player-tools/cli",
|
|
295
295
|
"pluginName": "@player-tools/cli",
|
|
296
296
|
"pluginType": "core",
|
|
@@ -302,8 +302,8 @@
|
|
|
302
302
|
"relativePath": [
|
|
303
303
|
"dist",
|
|
304
304
|
"commands",
|
|
305
|
-
"
|
|
306
|
-
"
|
|
305
|
+
"xlr",
|
|
306
|
+
"convert.js"
|
|
307
307
|
]
|
|
308
308
|
},
|
|
309
309
|
"json:validate": {
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"oclif.manifest.json"
|
|
7
7
|
],
|
|
8
8
|
"name": "@player-tools/cli",
|
|
9
|
-
"version": "0.8.
|
|
9
|
+
"version": "0.8.1--canary.169.3663",
|
|
10
10
|
"main": "./dist/index.js",
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"oclif": {
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"player": "bin/run"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@player-tools/dsl": "0.8.
|
|
26
|
-
"@player-tools/json-language-service": "0.8.
|
|
27
|
-
"@player-tools/xlr": "0.8.
|
|
28
|
-
"@player-tools/xlr-converters": "0.8.
|
|
29
|
-
"@player-tools/xlr-sdk": "0.8.
|
|
30
|
-
"@player-tools/xlr-utils": "0.8.
|
|
25
|
+
"@player-tools/dsl": "0.8.1--canary.169.3663",
|
|
26
|
+
"@player-tools/json-language-service": "0.8.1--canary.169.3663",
|
|
27
|
+
"@player-tools/xlr": "0.8.1--canary.169.3663",
|
|
28
|
+
"@player-tools/xlr-converters": "0.8.1--canary.169.3663",
|
|
29
|
+
"@player-tools/xlr-sdk": "0.8.1--canary.169.3663",
|
|
30
|
+
"@player-tools/xlr-utils": "0.8.1--canary.169.3663",
|
|
31
31
|
"@babel/plugin-transform-react-jsx-source": "^7.23.3",
|
|
32
32
|
"@babel/preset-env": "^7.23.3",
|
|
33
33
|
"@babel/preset-react": "^7.23.3",
|