@quonfig/cli 0.0.38 → 0.0.39

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/README.md CHANGED
@@ -14,7 +14,7 @@ $ npm install -g @quonfig/cli
14
14
  $ qfg COMMAND
15
15
  running command...
16
16
  $ qfg (--version)
17
- @quonfig/cli/0.0.38 linux-x64 node-v24.4.1
17
+ @quonfig/cli/0.0.39 linux-x64 node-v24.4.1
18
18
  $ qfg --help [COMMAND]
19
19
  USAGE
20
20
  $ qfg COMMAND
@@ -99,7 +99,7 @@ EXAMPLES
99
99
  $ qfg activity restore my.flag --yes
100
100
  ```
101
101
 
102
- _See code: [src/commands/activity.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/activity.ts)_
102
+ _See code: [src/commands/activity.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/activity.ts)_
103
103
 
104
104
  ## `qfg activity deleted`
105
105
 
@@ -128,7 +128,7 @@ EXAMPLES
128
128
  $ qfg activity deleted --json
129
129
  ```
130
130
 
131
- _See code: [src/commands/activity/deleted.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/activity/deleted.ts)_
131
+ _See code: [src/commands/activity/deleted.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/activity/deleted.ts)_
132
132
 
133
133
  ## `qfg activity feed`
134
134
 
@@ -163,7 +163,7 @@ EXAMPLES
163
163
  $ qfg activity feed --json
164
164
  ```
165
165
 
166
- _See code: [src/commands/activity/feed.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/activity/feed.ts)_
166
+ _See code: [src/commands/activity/feed.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/activity/feed.ts)_
167
167
 
168
168
  ## `qfg activity history [NAME]`
169
169
 
@@ -197,7 +197,7 @@ EXAMPLES
197
197
  $ qfg activity history request.timeout --json
198
198
  ```
199
199
 
200
- _See code: [src/commands/activity/history.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/activity/history.ts)_
200
+ _See code: [src/commands/activity/history.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/activity/history.ts)_
201
201
 
202
202
  ## `qfg activity restore [NAME]`
203
203
 
@@ -236,7 +236,7 @@ EXAMPLES
236
236
  $ qfg activity restore request.timeout --type config --yes
237
237
  ```
238
238
 
239
- _See code: [src/commands/activity/restore.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/activity/restore.ts)_
239
+ _See code: [src/commands/activity/restore.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/activity/restore.ts)_
240
240
 
241
241
  ## `qfg audit-log [NAME]`
242
242
 
@@ -264,7 +264,7 @@ EXAMPLES
264
264
  $ qfg audit-log my.flag
265
265
  ```
266
266
 
267
- _See code: [src/commands/audit-log.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/audit-log.ts)_
267
+ _See code: [src/commands/audit-log.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/audit-log.ts)_
268
268
 
269
269
  ## `qfg config-schema`
270
270
 
@@ -293,7 +293,7 @@ EXAMPLES
293
293
  $ qfg config-schema --json-schema # full JSON Schema document (copy into your editor)
294
294
  ```
295
295
 
296
- _See code: [src/commands/config-schema.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/config-schema.ts)_
296
+ _See code: [src/commands/config-schema.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/config-schema.ts)_
297
297
 
298
298
  ## `qfg create NAME`
299
299
 
@@ -378,7 +378,7 @@ EXAMPLES
378
378
  $ qfg set-rollout my.new.flag --environment production --true-percent 20
379
379
  ```
380
380
 
381
- _See code: [src/commands/create.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/create.ts)_
381
+ _See code: [src/commands/create.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/create.ts)_
382
382
 
383
383
  ## `qfg delete NAME`
384
384
 
@@ -424,7 +424,7 @@ EXAMPLES
424
424
  $ qfg delete my.config --yes
425
425
  ```
426
426
 
427
- _See code: [src/commands/delete.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/delete.ts)_
427
+ _See code: [src/commands/delete.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/delete.ts)_
428
428
 
429
429
  ## `qfg flag info [NAME]`
430
430
 
@@ -627,7 +627,7 @@ EXAMPLES
627
627
  $ qfg generate --targets node-ts -o ./dist # combine with targets
628
628
  ```
629
629
 
630
- _See code: [src/commands/generate.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/generate.ts)_
630
+ _See code: [src/commands/generate.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/generate.ts)_
631
631
 
632
632
  ## `qfg generate-new-hex-key`
633
633
 
@@ -650,7 +650,7 @@ EXAMPLES
650
650
  $ qfg generate-new-hex-key
651
651
  ```
652
652
 
653
- _See code: [src/commands/generate-new-hex-key.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/generate-new-hex-key.ts)_
653
+ _See code: [src/commands/generate-new-hex-key.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/generate-new-hex-key.ts)_
654
654
 
655
655
  ## `qfg get [NAME]`
656
656
 
@@ -682,7 +682,7 @@ EXAMPLES
682
682
  $ qfg get my.config.name --environment=production
683
683
  ```
684
684
 
685
- _See code: [src/commands/get.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/get.ts)_
685
+ _See code: [src/commands/get.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/get.ts)_
686
686
 
687
687
  ## `qfg history NAME`
688
688
 
@@ -708,7 +708,7 @@ EXAMPLES
708
708
  $ qfg history my.flag
709
709
  ```
710
710
 
711
- _See code: [src/commands/history.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/history.ts)_
711
+ _See code: [src/commands/history.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/history.ts)_
712
712
 
713
713
  ## `qfg info [NAME]`
714
714
 
@@ -756,7 +756,7 @@ EXAMPLES
756
756
  $ qfg info my.config.name --exclude-evaluations # skip 24h stats
757
757
  ```
758
758
 
759
- _See code: [src/commands/info.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/info.ts)_
759
+ _See code: [src/commands/info.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/info.ts)_
760
760
 
761
761
  ## `qfg init [DIRECTORY]`
762
762
 
@@ -796,7 +796,7 @@ EXAMPLES
796
796
  $ qfg init --dry-run
797
797
  ```
798
798
 
799
- _See code: [src/commands/init.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/init.ts)_
799
+ _See code: [src/commands/init.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/init.ts)_
800
800
 
801
801
  ## `qfg interactive`
802
802
 
@@ -826,7 +826,7 @@ EXAMPLES
826
826
  $ qfg
827
827
  ```
828
828
 
829
- _See code: [src/commands/interactive.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/interactive.ts)_
829
+ _See code: [src/commands/interactive.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/interactive.ts)_
830
830
 
831
831
  ## `qfg list`
832
832
 
@@ -866,7 +866,7 @@ EXAMPLES
866
866
  $ qfg list --feature-flags
867
867
  ```
868
868
 
869
- _See code: [src/commands/list.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/list.ts)_
869
+ _See code: [src/commands/list.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/list.ts)_
870
870
 
871
871
  ## `qfg log`
872
872
 
@@ -891,7 +891,7 @@ EXAMPLES
891
891
  $ qfg log --limit 5
892
892
  ```
893
893
 
894
- _See code: [src/commands/log.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/log.ts)_
894
+ _See code: [src/commands/log.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/log.ts)_
895
895
 
896
896
  ## `qfg log-level NAME`
897
897
 
@@ -956,7 +956,7 @@ EXAMPLES
956
956
  $ qfg log-level log-level.my-app --target=Chatty --value=INFO --environment=production
957
957
  ```
958
958
 
959
- _See code: [src/commands/log-level.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/log-level.ts)_
959
+ _See code: [src/commands/log-level.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/log-level.ts)_
960
960
 
961
961
  ## `qfg login`
962
962
 
@@ -981,7 +981,7 @@ EXAMPLES
981
981
  $ qfg login --profile myprofile
982
982
  ```
983
983
 
984
- _See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/login.ts)_
984
+ _See code: [src/commands/login.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/login.ts)_
985
985
 
986
986
  ## `qfg logout`
987
987
 
@@ -1004,7 +1004,7 @@ EXAMPLES
1004
1004
  $ qfg logout
1005
1005
  ```
1006
1006
 
1007
- _See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/logout.ts)_
1007
+ _See code: [src/commands/logout.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/logout.ts)_
1008
1008
 
1009
1009
  ## `qfg migrate`
1010
1010
 
@@ -1058,7 +1058,7 @@ EXAMPLES
1058
1058
  $ qfg migrate --from launch --api-key $LAUNCH_API_KEY --dir ./quonfig-repo --staging
1059
1059
  ```
1060
1060
 
1061
- _See code: [src/commands/migrate.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/migrate.ts)_
1061
+ _See code: [src/commands/migrate.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/migrate.ts)_
1062
1062
 
1063
1063
  ## `qfg migrate doctor`
1064
1064
 
@@ -1096,7 +1096,7 @@ EXAMPLES
1096
1096
  $ qfg migrate doctor --json
1097
1097
  ```
1098
1098
 
1099
- _See code: [src/commands/migrate/doctor.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/migrate/doctor.ts)_
1099
+ _See code: [src/commands/migrate/doctor.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/migrate/doctor.ts)_
1100
1100
 
1101
1101
  ## `qfg migrate my-code`
1102
1102
 
@@ -1128,7 +1128,7 @@ EXAMPLES
1128
1128
  $ qfg migrate my-code --dry-run
1129
1129
  ```
1130
1130
 
1131
- _See code: [src/commands/migrate/my-code.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/migrate/my-code.ts)_
1131
+ _See code: [src/commands/migrate/my-code.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/migrate/my-code.ts)_
1132
1132
 
1133
1133
  ## `qfg migrate status`
1134
1134
 
@@ -1159,7 +1159,7 @@ EXAMPLES
1159
1159
  $ qfg migrate status --json
1160
1160
  ```
1161
1161
 
1162
- _See code: [src/commands/migrate/status.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/migrate/status.ts)_
1162
+ _See code: [src/commands/migrate/status.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/migrate/status.ts)_
1163
1163
 
1164
1164
  ## `qfg override [NAME] [VALUE]`
1165
1165
 
@@ -1214,7 +1214,7 @@ EXAMPLES
1214
1214
  $ qfg override my.flag true --env=staging
1215
1215
  ```
1216
1216
 
1217
- _See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/override.ts)_
1217
+ _See code: [src/commands/override.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/override.ts)_
1218
1218
 
1219
1219
  ## `qfg pull`
1220
1220
 
@@ -1261,7 +1261,7 @@ EXAMPLES
1261
1261
  $ qfg pull # uses QUONFIG_DIR env var
1262
1262
  ```
1263
1263
 
1264
- _See code: [src/commands/pull.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/pull.ts)_
1264
+ _See code: [src/commands/pull.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/pull.ts)_
1265
1265
 
1266
1266
  ## `qfg push`
1267
1267
 
@@ -1309,7 +1309,7 @@ EXAMPLES
1309
1309
  $ qfg push --dir ./our-config --yes
1310
1310
  ```
1311
1311
 
1312
- _See code: [src/commands/push.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/push.ts)_
1312
+ _See code: [src/commands/push.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/push.ts)_
1313
1313
 
1314
1314
  ## `qfg schema NAME`
1315
1315
 
@@ -1347,7 +1347,7 @@ EXAMPLES
1347
1347
  $ qfg schema my-schema --set-json-schema=@schemas/my-schema.json --protected
1348
1348
  ```
1349
1349
 
1350
- _See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/schema.ts)_
1350
+ _See code: [src/commands/schema.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/schema.ts)_
1351
1351
 
1352
1352
  ## `qfg sdk-key`
1353
1353
 
@@ -1374,7 +1374,7 @@ EXAMPLES
1374
1374
  $ qfg sdk-key revoke <key-id>
1375
1375
  ```
1376
1376
 
1377
- _See code: [src/commands/sdk-key.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/sdk-key.ts)_
1377
+ _See code: [src/commands/sdk-key.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/sdk-key.ts)_
1378
1378
 
1379
1379
  ## `qfg sdk-key create`
1380
1380
 
@@ -1406,7 +1406,7 @@ EXAMPLES
1406
1406
  $ qfg sdk-key create --environment staging --type browser
1407
1407
  ```
1408
1408
 
1409
- _See code: [src/commands/sdk-key/create.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/sdk-key/create.ts)_
1409
+ _See code: [src/commands/sdk-key/create.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/sdk-key/create.ts)_
1410
1410
 
1411
1411
  ## `qfg sdk-key list`
1412
1412
 
@@ -1435,7 +1435,7 @@ EXAMPLES
1435
1435
  $ qfg sdk-key list --environment production
1436
1436
  ```
1437
1437
 
1438
- _See code: [src/commands/sdk-key/list.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/sdk-key/list.ts)_
1438
+ _See code: [src/commands/sdk-key/list.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/sdk-key/list.ts)_
1439
1439
 
1440
1440
  ## `qfg sdk-key revoke KEYID`
1441
1441
 
@@ -1462,7 +1462,7 @@ EXAMPLES
1462
1462
  $ qfg sdk-key revoke a1b2c3d4-e5f6-7890-abcd-ef1234567890
1463
1463
  ```
1464
1464
 
1465
- _See code: [src/commands/sdk-key/revoke.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/sdk-key/revoke.ts)_
1465
+ _See code: [src/commands/sdk-key/revoke.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/sdk-key/revoke.ts)_
1466
1466
 
1467
1467
  ## `qfg set-default [NAME]`
1468
1468
 
@@ -1533,7 +1533,7 @@ EXAMPLES
1533
1533
  $ qfg pull && qfg config-schema
1534
1534
  ```
1535
1535
 
1536
- _See code: [src/commands/set-default.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/set-default.ts)_
1536
+ _See code: [src/commands/set-default.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/set-default.ts)_
1537
1537
 
1538
1538
  ## `qfg set-rollout [NAME]`
1539
1539
 
@@ -1610,7 +1610,7 @@ EXAMPLES
1610
1610
  $ qfg set-rollout my.variant.flag --environment production --weights "a:33,b:33,c:34" --hash-by user.id
1611
1611
  ```
1612
1612
 
1613
- _See code: [src/commands/set-rollout.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/set-rollout.ts)_
1613
+ _See code: [src/commands/set-rollout.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/set-rollout.ts)_
1614
1614
 
1615
1615
  ## `qfg sync`
1616
1616
 
@@ -1642,7 +1642,7 @@ EXAMPLES
1642
1642
  $ qfg sync --watch --dir ./our-config --interval 30
1643
1643
  ```
1644
1644
 
1645
- _See code: [src/commands/sync.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/sync.ts)_
1645
+ _See code: [src/commands/sync.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/sync.ts)_
1646
1646
 
1647
1647
  ## `qfg toggle [NAME]`
1648
1648
 
@@ -1744,7 +1744,7 @@ EXAMPLES
1744
1744
  $ qfg verify --json
1745
1745
  ```
1746
1746
 
1747
- _See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/verify.ts)_
1747
+ _See code: [src/commands/verify.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/verify.ts)_
1748
1748
 
1749
1749
  ## `qfg whoami`
1750
1750
 
@@ -1767,7 +1767,7 @@ EXAMPLES
1767
1767
  $ qfg whoami
1768
1768
  ```
1769
1769
 
1770
- _See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/whoami.ts)_
1770
+ _See code: [src/commands/whoami.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/whoami.ts)_
1771
1771
 
1772
1772
  ## `qfg workspace`
1773
1773
 
@@ -1790,7 +1790,7 @@ EXAMPLES
1790
1790
  $ qfg workspace
1791
1791
  ```
1792
1792
 
1793
- _See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/workspace.ts)_
1793
+ _See code: [src/commands/workspace.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/workspace.ts)_
1794
1794
 
1795
1795
  ## `qfg workspace bootstrap`
1796
1796
 
@@ -1823,7 +1823,7 @@ EXAMPLES
1823
1823
  $ qfg workspace bootstrap --dir ./our-config --skip-validate
1824
1824
  ```
1825
1825
 
1826
- _See code: [src/commands/workspace/bootstrap.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/workspace/bootstrap.ts)_
1826
+ _See code: [src/commands/workspace/bootstrap.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/workspace/bootstrap.ts)_
1827
1827
 
1828
1828
  ## `qfg workspace create SLUG`
1829
1829
 
@@ -1857,7 +1857,7 @@ EXAMPLES
1857
1857
  $ qfg workspace create my-team --org 11111111-1111-1111-1111-111111111111
1858
1858
  ```
1859
1859
 
1860
- _See code: [src/commands/workspace/create.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/workspace/create.ts)_
1860
+ _See code: [src/commands/workspace/create.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/workspace/create.ts)_
1861
1861
 
1862
1862
  ## `qfg workspace switch [SLUG]`
1863
1863
 
@@ -1885,7 +1885,7 @@ EXAMPLES
1885
1885
  $ qfg workspace switch acme/production
1886
1886
  ```
1887
1887
 
1888
- _See code: [src/commands/workspace/switch.ts](https://github.com/quonfig/cli/blob/v0.0.38/src/commands/workspace/switch.ts)_
1888
+ _See code: [src/commands/workspace/switch.ts](https://github.com/quonfig/cli/blob/v0.0.39/src/commands/workspace/switch.ts)_
1889
1889
  <!-- commandsstop -->
1890
1890
 
1891
1891
  ## Local Development
@@ -6,7 +6,11 @@ function mapGitValue(gitValue) {
6
6
  case 'bool': {
7
7
  return { value: { bool: value } };
8
8
  }
9
- case 'int': {
9
+ case 'int':
10
+ case 'duration': {
11
+ return { value: { int: value } };
12
+ }
13
+ case 'double': {
10
14
  return { value: { int: value } };
11
15
  }
12
16
  case 'json': {
@@ -20,11 +24,18 @@ function mapGitValue(gitValue) {
20
24
  case 'log_level': {
21
25
  return { value: { logLevel: value } };
22
26
  }
27
+ case 'string': {
28
+ return typeof value === 'string' ? { value: { string: value } } : null;
29
+ }
23
30
  case 'string_list': {
24
31
  return { value: { string: JSON.stringify(value) } };
25
32
  }
33
+ // weighted_values is expanded by buildRows (one rule -> N row values).
34
+ // provided lookups are runtime-only; codegen has no static value to type.
35
+ // Anything else we don't recognize is dropped rather than corrupting
36
+ // downstream code that assumes value.string is a string.
26
37
  default: {
27
- return { value: { string: value } };
38
+ return null;
28
39
  }
29
40
  }
30
41
  }
@@ -33,9 +44,23 @@ function buildRows(gitConfig) {
33
44
  ...(gitConfig.default?.rules ?? []),
34
45
  ...(gitConfig.environments ?? []).flatMap((env) => env.rules),
35
46
  ];
36
- return allRules.map((rule) => ({
37
- values: [mapGitValue(rule.value)],
38
- }));
47
+ return allRules.flatMap((rule) => {
48
+ if (rule.value?.type === 'weighted_values') {
49
+ const wrapper = rule.value.value;
50
+ const variants = wrapper?.weightedValues ?? [];
51
+ const values = [];
52
+ for (const entry of variants) {
53
+ if (!entry?.value)
54
+ continue;
55
+ const mapped = mapGitValue(entry.value);
56
+ if (mapped)
57
+ values.push(mapped);
58
+ }
59
+ return values.length > 0 ? [{ values }] : [];
60
+ }
61
+ const mapped = mapGitValue(rule.value);
62
+ return mapped ? [{ values: [mapped] }] : [];
63
+ });
39
64
  }
40
65
  function mapConfigType(gitType) {
41
66
  return gitType === 'feature_flag' ? 'FEATURE_FLAG' : 'CONFIG';
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  // eg "Hello {{name}}!" -> z.object({ name: z.string() })
4
4
  export class MustacheExtractor {
5
5
  static extractSchema(template, log) {
6
- if (!template) {
6
+ if (typeof template !== 'string' || template.length === 0) {
7
7
  return z.object({});
8
8
  }
9
9
  const nodes = this.parseMustacheTemplate(template, log);
@@ -87,8 +87,10 @@ export class SchemaExtractor {
87
87
  */
88
88
  getAllStringsAtLocation(config, location) {
89
89
  if (location.length === 0) {
90
- // For empty location, just get direct string values
91
- return config.rows.flatMap((row) => row.values.flatMap((valueObj) => (valueObj.value.string ? [valueObj.value.string] : [])));
90
+ // For empty location, just get direct string values. Defensive type
91
+ // check: a malformed reader could put a non-string here, and downstream
92
+ // mustache extraction calls .match() on whatever lands in this list.
93
+ return config.rows.flatMap((row) => row.values.flatMap((valueObj) => (typeof valueObj.value.string === 'string' ? [valueObj.value.string] : [])));
92
94
  }
93
95
  // For JSON values, we need to traverse the object
94
96
  return config.rows.flatMap((row) => row.values.flatMap((valueObj) => {
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.0.38";
1
+ declare const _default: "0.0.39";
2
2
  export default _default;
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // AUTO-GENERATED from package.json by scripts/generate-version.mjs — do not edit.
2
- export default '0.0.38';
2
+ export default '0.0.39';
@@ -3489,5 +3489,5 @@
3489
3489
  ]
3490
3490
  }
3491
3491
  },
3492
- "version": "0.0.38"
3492
+ "version": "0.0.39"
3493
3493
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "packageManager": "yarn@4.11.0+sha512.4e54aeace9141df2f0177c266b05ec50dc044638157dae128c471ba65994ac802122d7ab35bcd9e81641228b7dcf24867d28e750e0bcae8a05277d600008ad54",
3
3
  "name": "@quonfig/cli",
4
- "version": "0.0.38",
4
+ "version": "0.0.39",
5
5
  "bugs": {
6
6
  "url": "https://github.com/quonfig/cli/issues"
7
7
  },