@configdirector/cli 0.0.0-stage → 0.1.0-beta.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/package.json CHANGED
@@ -1,6 +1,59 @@
1
1
  {
2
2
  "name": "@configdirector/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0-beta.1",
4
+ "description": "Command line tool for ConfigDirector, the managed configuration and feature flag service.",
5
+ "license": "MIT",
6
+ "author": "ConfigDirector",
7
+ "keywords": [
8
+ "configdirector",
9
+ "cli",
10
+ "config",
11
+ "remote config",
12
+ "feature flag"
13
+ ],
14
+ "homepage": "https://www.configdirector.com",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/ConfigDirector/cli.git"
18
+ },
19
+ "type": "module",
20
+ "bin": {
21
+ "configdirector": "./dist/configdirector.mjs"
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "schema"
26
+ ],
27
+ "engines": {
28
+ "node": ">=20"
29
+ },
30
+ "packageManager": "yarn@4.13.0",
31
+ "scripts": {
32
+ "typecheck": "tsc --noEmit",
33
+ "lint": "eslint .",
34
+ "format": "prettier --write .",
35
+ "test": "vitest",
36
+ "ci:test": "vitest run",
37
+ "build": "tsdown",
38
+ "pack:tarball": "yarn pack --out package.tgz",
39
+ "ci:test:packed-tarball": "vitest run --config vitest.packed-tarball.config.ts",
40
+ "release": "yarn typecheck && yarn lint && yarn ci:test && yarn build && yarn pack:tarball && yarn ci:test:packed-tarball && npm publish package.tgz --access public --tag beta"
41
+ },
42
+ "dependencies": {
43
+ "commander": "^14.0.3",
44
+ "ignore": "^7.0.12",
45
+ "picomatch": "^4.0.7",
46
+ "valibot": "^1.4.2"
47
+ },
48
+ "devDependencies": {
49
+ "@types/node": "^20.19.43",
50
+ "@types/picomatch": "^4.0.3",
51
+ "ajv": "^8.20.0",
52
+ "eslint": "^9.39.1",
53
+ "prettier": "3.9.9",
54
+ "tsdown": "^0.21.10",
55
+ "typescript": "~5.9.3",
56
+ "typescript-eslint": "~8.58.1",
57
+ "vitest": "4.1.8"
58
+ }
6
59
  }
@@ -0,0 +1,410 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "configdirector scan and validate --json output",
4
+ "description": "The code references `configdirector scan --json` found in a repository, and the findings `configdirector validate --json` adds.",
5
+ "type": "object",
6
+ "required": ["project", "filesScanned", "references", "dynamicReferences"],
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "project": {
10
+ "description": "The slug of the project the scan ran for.",
11
+ "type": "string"
12
+ },
13
+ "filesScanned": {
14
+ "description": "How many source files were read. 0 means nothing in the scanned location could be scanned.",
15
+ "type": "integer",
16
+ "minimum": 0
17
+ },
18
+ "references": {
19
+ "description": "Places where the code reads a config key: SDK calls, and the project's keys quoted elsewhere in the code.",
20
+ "type": "array",
21
+ "items": {
22
+ "oneOf": [
23
+ {
24
+ "$ref": "#/$defs/directReference"
25
+ },
26
+ {
27
+ "$ref": "#/$defs/indirectReference"
28
+ }
29
+ ]
30
+ }
31
+ },
32
+ "dynamicReferences": {
33
+ "description": "SDK calls whose key is neither a string literal nor a constant the scan could resolve, so the key they read is not known.",
34
+ "type": "array",
35
+ "items": {
36
+ "$ref": "#/$defs/dynamicReference"
37
+ }
38
+ },
39
+ "findings": {
40
+ "description": "Only in `configdirector validate --json` output: the problems the check found in direct references, empty when it found none.",
41
+ "type": "array",
42
+ "items": {
43
+ "oneOf": [
44
+ {
45
+ "$ref": "#/$defs/unknownKeyFinding"
46
+ },
47
+ {
48
+ "$ref": "#/$defs/deprecatedKeyFinding"
49
+ },
50
+ {
51
+ "$ref": "#/$defs/typeMismatchFinding"
52
+ },
53
+ {
54
+ "$ref": "#/$defs/availabilityMismatchFinding"
55
+ },
56
+ {
57
+ "$ref": "#/$defs/enumValueNotAllowedFinding"
58
+ }
59
+ ]
60
+ }
61
+ }
62
+ },
63
+ "$defs": {
64
+ "file": {
65
+ "description": "The file's path from the directory the scan ran in.",
66
+ "type": "string"
67
+ },
68
+ "line": {
69
+ "description": "The line of the key in the file, starting at 1.",
70
+ "type": "integer",
71
+ "minimum": 1
72
+ },
73
+ "sdk": {
74
+ "description": "The ConfigDirector SDK or OpenFeature provider family the call belongs to.",
75
+ "enum": [
76
+ "js-client",
77
+ "js-server",
78
+ "react",
79
+ "react-native",
80
+ "vue",
81
+ "nuxt-client",
82
+ "nuxt-server",
83
+ "nextjs-client",
84
+ "nextjs-server",
85
+ "openfeature-web",
86
+ "openfeature-node",
87
+ "flutter",
88
+ "openfeature-flutter",
89
+ "swift",
90
+ "openfeature-swift",
91
+ "android",
92
+ "openfeature-android",
93
+ "python",
94
+ "openfeature-python",
95
+ "java",
96
+ "openfeature-java",
97
+ "dotnet",
98
+ "openfeature-dotnet",
99
+ "go",
100
+ "openfeature-go"
101
+ ]
102
+ },
103
+ "call": {
104
+ "description": "The SDK method, function or annotation that names the key.",
105
+ "type": "string"
106
+ },
107
+ "test": {
108
+ "description": "Whether the call sets a value on an SDK test client rather than reading a config.",
109
+ "type": "boolean"
110
+ },
111
+ "getterType": {
112
+ "description": "The type the method reads the config as, when its name fixes it, such as getBoolean. number means integer or float.",
113
+ "enum": ["boolean", "string", "integer", "float", "number", "json"]
114
+ },
115
+ "directReference": {
116
+ "type": "object",
117
+ "required": ["key", "file", "line", "kind", "sdk", "call", "test"],
118
+ "additionalProperties": false,
119
+ "properties": {
120
+ "key": {
121
+ "description": "The config key: the string literal in the call, or the string the constant passed to the call holds.",
122
+ "type": "string"
123
+ },
124
+ "file": {
125
+ "$ref": "#/$defs/file"
126
+ },
127
+ "line": {
128
+ "$ref": "#/$defs/line"
129
+ },
130
+ "kind": {
131
+ "description": "The key is a string literal in an SDK call, or a constant the scan resolved.",
132
+ "const": "direct"
133
+ },
134
+ "sdk": {
135
+ "$ref": "#/$defs/sdk"
136
+ },
137
+ "call": {
138
+ "$ref": "#/$defs/call"
139
+ },
140
+ "argument": {
141
+ "description": "The key argument as written in the code, present when the scan resolved it from a constant or property rather than reading a string literal.",
142
+ "type": "string"
143
+ },
144
+ "default": {
145
+ "$ref": "#/$defs/inCodeDefaultValue"
146
+ },
147
+ "getterType": {
148
+ "$ref": "#/$defs/getterType"
149
+ },
150
+ "test": {
151
+ "$ref": "#/$defs/test"
152
+ }
153
+ }
154
+ },
155
+ "indirectReference": {
156
+ "type": "object",
157
+ "required": ["key", "file", "line", "kind", "test"],
158
+ "additionalProperties": false,
159
+ "properties": {
160
+ "key": {
161
+ "description": "The project's current or deprecated key, as quoted in the code.",
162
+ "type": "string"
163
+ },
164
+ "file": {
165
+ "$ref": "#/$defs/file"
166
+ },
167
+ "line": {
168
+ "$ref": "#/$defs/line"
169
+ },
170
+ "kind": {
171
+ "description": "The key is quoted outside an SDK call, such as in a wrapper function, a key list or a test fixture.",
172
+ "const": "indirect"
173
+ },
174
+ "test": {
175
+ "description": "Whether the file is in a test directory or has a test name.",
176
+ "type": "boolean"
177
+ }
178
+ }
179
+ },
180
+ "inCodeDefaultValue": {
181
+ "description": "The in-code default value the call passes, when it is a literal. A json value is the literal as written in the code.",
182
+ "oneOf": [
183
+ {
184
+ "type": "object",
185
+ "required": ["type", "value"],
186
+ "additionalProperties": false,
187
+ "properties": {
188
+ "type": {
189
+ "const": "boolean"
190
+ },
191
+ "value": {
192
+ "type": "boolean"
193
+ }
194
+ }
195
+ },
196
+ {
197
+ "type": "object",
198
+ "required": ["type", "value"],
199
+ "additionalProperties": false,
200
+ "properties": {
201
+ "type": {
202
+ "const": "integer"
203
+ },
204
+ "value": {
205
+ "type": "integer"
206
+ }
207
+ }
208
+ },
209
+ {
210
+ "type": "object",
211
+ "required": ["type", "value"],
212
+ "additionalProperties": false,
213
+ "properties": {
214
+ "type": {
215
+ "const": "float"
216
+ },
217
+ "value": {
218
+ "type": "number"
219
+ }
220
+ }
221
+ },
222
+ {
223
+ "type": "object",
224
+ "required": ["type", "value"],
225
+ "additionalProperties": false,
226
+ "properties": {
227
+ "type": {
228
+ "enum": ["string", "json"]
229
+ },
230
+ "value": {
231
+ "type": "string"
232
+ }
233
+ }
234
+ }
235
+ ]
236
+ },
237
+ "dynamicReference": {
238
+ "type": "object",
239
+ "required": ["file", "line", "sdk", "call", "argument"],
240
+ "additionalProperties": false,
241
+ "properties": {
242
+ "file": {
243
+ "$ref": "#/$defs/file"
244
+ },
245
+ "line": {
246
+ "$ref": "#/$defs/line"
247
+ },
248
+ "sdk": {
249
+ "$ref": "#/$defs/sdk"
250
+ },
251
+ "call": {
252
+ "$ref": "#/$defs/call"
253
+ },
254
+ "argument": {
255
+ "description": "The key argument as written in the code.",
256
+ "type": "string"
257
+ }
258
+ }
259
+ },
260
+ "findingKey": {
261
+ "description": "The config key the direct reference reads.",
262
+ "type": "string"
263
+ },
264
+ "sdkType": {
265
+ "description": "Whether an SDK runs in clients, such as browsers and mobile apps, or on servers.",
266
+ "enum": ["client", "server"]
267
+ },
268
+ "unknownKeyFinding": {
269
+ "type": "object",
270
+ "required": ["kind", "key", "file", "line"],
271
+ "additionalProperties": false,
272
+ "properties": {
273
+ "kind": {
274
+ "description": "No config in the project has this key as its current or a deprecated key. Archived configs are not listed, so their keys are unknown too.",
275
+ "const": "unknown-key"
276
+ },
277
+ "key": {
278
+ "$ref": "#/$defs/findingKey"
279
+ },
280
+ "file": {
281
+ "$ref": "#/$defs/file"
282
+ },
283
+ "line": {
284
+ "$ref": "#/$defs/line"
285
+ }
286
+ }
287
+ },
288
+ "deprecatedKeyFinding": {
289
+ "type": "object",
290
+ "required": ["kind", "key", "file", "line", "currentKey"],
291
+ "additionalProperties": false,
292
+ "properties": {
293
+ "kind": {
294
+ "description": "The key is a deprecated key of a renamed config.",
295
+ "const": "deprecated-key"
296
+ },
297
+ "key": {
298
+ "$ref": "#/$defs/findingKey"
299
+ },
300
+ "file": {
301
+ "$ref": "#/$defs/file"
302
+ },
303
+ "line": {
304
+ "$ref": "#/$defs/line"
305
+ },
306
+ "currentKey": {
307
+ "description": "The renamed config's current key.",
308
+ "type": "string"
309
+ }
310
+ }
311
+ },
312
+ "typeMismatchFinding": {
313
+ "type": "object",
314
+ "required": ["kind", "key", "file", "line", "configType", "servedAs"],
315
+ "additionalProperties": false,
316
+ "properties": {
317
+ "kind": {
318
+ "description": "The in-code default value or the typed getter reads the config as a type the SDKs do not serve it as.",
319
+ "const": "type-mismatch"
320
+ },
321
+ "key": {
322
+ "$ref": "#/$defs/findingKey"
323
+ },
324
+ "file": {
325
+ "$ref": "#/$defs/file"
326
+ },
327
+ "line": {
328
+ "$ref": "#/$defs/line"
329
+ },
330
+ "configType": {
331
+ "description": "The config's type, such as boolean, enum or timespan.",
332
+ "type": "string"
333
+ },
334
+ "servedAs": {
335
+ "description": "The type the SDKs are served the config as, which the check compared against: a timespan is served as a float and a URL as a string, and an enum's values as strings or numbers.",
336
+ "enum": ["boolean", "string", "integer", "float", "json", "string-enum", "number-enum"]
337
+ },
338
+ "default": {
339
+ "$ref": "#/$defs/inCodeDefaultValue"
340
+ },
341
+ "getterType": {
342
+ "$ref": "#/$defs/getterType"
343
+ }
344
+ }
345
+ },
346
+ "availabilityMismatchFinding": {
347
+ "type": "object",
348
+ "required": ["kind", "key", "file", "line", "sdk", "sdkType", "configAvailableTo"],
349
+ "additionalProperties": false,
350
+ "properties": {
351
+ "kind": {
352
+ "description": "A client SDK reads a server-only config, or a server SDK reads a client-only config.",
353
+ "const": "availability-mismatch"
354
+ },
355
+ "key": {
356
+ "$ref": "#/$defs/findingKey"
357
+ },
358
+ "file": {
359
+ "$ref": "#/$defs/file"
360
+ },
361
+ "line": {
362
+ "$ref": "#/$defs/line"
363
+ },
364
+ "sdk": {
365
+ "$ref": "#/$defs/sdk"
366
+ },
367
+ "sdkType": {
368
+ "$ref": "#/$defs/sdkType"
369
+ },
370
+ "configAvailableTo": {
371
+ "description": "The kinds of SDK the config is served to.",
372
+ "type": "array",
373
+ "items": {
374
+ "$ref": "#/$defs/sdkType"
375
+ }
376
+ }
377
+ }
378
+ },
379
+ "enumValueNotAllowedFinding": {
380
+ "type": "object",
381
+ "required": ["kind", "key", "file", "line", "default", "allowedValues"],
382
+ "additionalProperties": false,
383
+ "properties": {
384
+ "kind": {
385
+ "description": "The in-code default value is not one of the enum config's allowed values.",
386
+ "const": "enum-value-not-allowed"
387
+ },
388
+ "key": {
389
+ "$ref": "#/$defs/findingKey"
390
+ },
391
+ "file": {
392
+ "$ref": "#/$defs/file"
393
+ },
394
+ "line": {
395
+ "$ref": "#/$defs/line"
396
+ },
397
+ "default": {
398
+ "$ref": "#/$defs/inCodeDefaultValue"
399
+ },
400
+ "allowedValues": {
401
+ "description": "The enum config's allowed values, as ConfigDirector stores them.",
402
+ "type": "array",
403
+ "items": {
404
+ "type": "string"
405
+ }
406
+ }
407
+ }
408
+ }
409
+ }
410
+ }