@alloy-js/json 0.7.0 → 0.9.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/temp/api.json CHANGED
@@ -282,7 +282,7 @@
282
282
  {
283
283
  "kind": "Function",
284
284
  "canonicalReference": "@alloy-js/json!JsonArray:function(1)",
285
- "docComment": "/**\n * Create a JSON Array. You can provide children, or else pass a JS value that will be serialized to JSON.\n *\n * @see\n *\n * {@link @alloy-js/core#(MemberScopeContext:variable)}\n */\n",
285
+ "docComment": "/**\n * Create a JSON Array. You can provide children, or else pass a JS value that\n * will be serialized to JSON.\n *\n * @see\n *\n * {@link @alloy-js/core#(MemberScopeContext:variable)}\n */\n",
286
286
  "excerptTokens": [
287
287
  {
288
288
  "kind": "Content",
@@ -329,7 +329,7 @@
329
329
  {
330
330
  "kind": "Function",
331
331
  "canonicalReference": "@alloy-js/json!JsonArrayElement:function(1)",
332
- "docComment": "/**\n * Create a JSON Array element. This component should be used inside of a {@link JsonArray} component. Can either be provided `children`, or a JS value which will be serialized to JSON.\n *\n * @see\n *\n * {@link @alloy-js/core#(MemberDeclarationContext:variable)}\n */\n",
332
+ "docComment": "/**\n * Create a JSON Array element. This component should be used inside of a\n * {@link JsonArray} component. Can either be provided `children`, or a JS\n * value which will be serialized to JSON.\n *\n * @see\n *\n * {@link @alloy-js/core#(MemberDeclarationContext:variable)}\n */\n",
333
333
  "excerptTokens": [
334
334
  {
335
335
  "kind": "Content",
@@ -458,7 +458,7 @@
458
458
  {
459
459
  "kind": "Interface",
460
460
  "canonicalReference": "@alloy-js/json!JsonArrayElementPropsWithJsValue:interface",
461
- "docComment": "/**\n * Create a JSON Array element by providing a JS value that will be serialized to JSON.\n */\n",
461
+ "docComment": "/**\n * Create a JSON Array element by providing a JS value that will be serialized\n * to JSON.\n */\n",
462
462
  "excerptTokens": [
463
463
  {
464
464
  "kind": "Content",
@@ -554,7 +554,7 @@
554
554
  {
555
555
  "kind": "PropertySignature",
556
556
  "canonicalReference": "@alloy-js/json!JsonArrayPropsBase#refkey:member",
557
- "docComment": "/**\n * The refkey for the JSON array. When provided, this value can be referenced elsewhere via this refkey.\n */\n",
557
+ "docComment": "/**\n * The refkey or array of refkeys for the JSON array. When provided, this\n * value can be referenced elsewhere via this refkey.\n */\n",
558
558
  "excerptTokens": [
559
559
  {
560
560
  "kind": "Content",
@@ -567,26 +567,7 @@
567
567
  },
568
568
  {
569
569
  "kind": "Content",
570
- "text": ";"
571
- }
572
- ],
573
- "isReadonly": false,
574
- "isOptional": true,
575
- "releaseTag": "Public",
576
- "name": "refkey",
577
- "propertyTypeTokenRange": {
578
- "startIndex": 1,
579
- "endIndex": 2
580
- }
581
- },
582
- {
583
- "kind": "PropertySignature",
584
- "canonicalReference": "@alloy-js/json!JsonArrayPropsBase#refkeys:member",
585
- "docComment": "/**\n * The refkeys for the JSON array. When provided, this array can be referenced elsewhere via any of these refkeys.\n */\n",
586
- "excerptTokens": [
587
- {
588
- "kind": "Content",
589
- "text": "refkeys?: "
570
+ "text": " | "
590
571
  },
591
572
  {
592
573
  "kind": "Reference",
@@ -605,10 +586,10 @@
605
586
  "isReadonly": false,
606
587
  "isOptional": true,
607
588
  "releaseTag": "Public",
608
- "name": "refkeys",
589
+ "name": "refkey",
609
590
  "propertyTypeTokenRange": {
610
591
  "startIndex": 1,
611
- "endIndex": 3
592
+ "endIndex": 5
612
593
  }
613
594
  }
614
595
  ],
@@ -617,7 +598,7 @@
617
598
  {
618
599
  "kind": "Interface",
619
600
  "canonicalReference": "@alloy-js/json!JsonArrayPropsWithChildren:interface",
620
- "docComment": "/**\n * Create a JSON Array by providing the children. To create an array element, see {@link JsonArrayElement}.\n */\n",
601
+ "docComment": "/**\n * Create a JSON Array by providing the children. To create an array element,\n * see {@link JsonArrayElement}.\n */\n",
621
602
  "excerptTokens": [
622
603
  {
623
604
  "kind": "Content",
@@ -641,7 +622,7 @@
641
622
  {
642
623
  "kind": "PropertySignature",
643
624
  "canonicalReference": "@alloy-js/json!JsonArrayPropsWithChildren#children:member",
644
- "docComment": "/**\n * The contents of the JSON Array. Likely to contain {@link JsonArrayElement} components.\n */\n",
625
+ "docComment": "/**\n * The contents of the JSON Array. Likely to contain {@link JsonArrayElement}\n * components.\n */\n",
645
626
  "excerptTokens": [
646
627
  {
647
628
  "kind": "Content",
@@ -836,7 +817,7 @@
836
817
  {
837
818
  "kind": "Variable",
838
819
  "canonicalReference": "@alloy-js/json!JsonFileContext:var",
839
- "docComment": "/**\n * Provides information about the current JSON source file. This context is used to allow references between JSON files.\n */\n",
820
+ "docComment": "/**\n * Provides information about the current JSON source file. This context is used\n * to allow references between JSON files.\n */\n",
840
821
  "excerptTokens": [
841
822
  {
842
823
  "kind": "Content",
@@ -873,7 +854,7 @@
873
854
  {
874
855
  "kind": "Function",
875
856
  "canonicalReference": "@alloy-js/json!JsonObject:function(1)",
876
- "docComment": "/**\n * Create a JSON Object. An object can be created by providing a JS object value which will be serialized to JSON. Else, you can provide children that comprise the object's JSON representation.\n *\n * @see\n *\n * {@link @alloy-js/core#MemberScopeContext}\n */\n",
857
+ "docComment": "/**\n * Create a JSON Object. An object can be created by providing a JS object\n * value which will be serialized to JSON. Else, you can provide children that\n * comprise the object's JSON representation.\n *\n * @see\n *\n * {@link @alloy-js/core#MemberScopeContext}\n */\n",
877
858
  "excerptTokens": [
878
859
  {
879
860
  "kind": "Content",
@@ -920,7 +901,7 @@
920
901
  {
921
902
  "kind": "Function",
922
903
  "canonicalReference": "@alloy-js/json!JsonObjectProperty:function(1)",
923
- "docComment": "/**\n * Create a JSON object property. A property can be created by providing a JS property value or children that defines the value.\n *\n * @see\n *\n * {@link @alloy-js/core#(MemberDeclarationContext:variable)}\n */\n",
904
+ "docComment": "/**\n * Create a JSON object property. A property can be created by providing a JS\n * property value or children that defines the value.\n *\n * @see\n *\n * {@link @alloy-js/core#(MemberDeclarationContext:variable)}\n */\n",
924
905
  "excerptTokens": [
925
906
  {
926
907
  "kind": "Content",
@@ -1018,7 +999,7 @@
1018
999
  {
1019
1000
  "kind": "PropertySignature",
1020
1001
  "canonicalReference": "@alloy-js/json!JsonObjectPropsBase#refkey:member",
1021
- "docComment": "/**\n * The refkey for the JSON object. When provided, this value can be referenced elsewhere via this refkey.\n */\n",
1002
+ "docComment": "/**\n * The refkey or array of refkeys for the JSON object. When provided, this\n * value can be referenced elsewhere via this refkey.\n */\n",
1022
1003
  "excerptTokens": [
1023
1004
  {
1024
1005
  "kind": "Content",
@@ -1031,26 +1012,7 @@
1031
1012
  },
1032
1013
  {
1033
1014
  "kind": "Content",
1034
- "text": ";"
1035
- }
1036
- ],
1037
- "isReadonly": false,
1038
- "isOptional": true,
1039
- "releaseTag": "Public",
1040
- "name": "refkey",
1041
- "propertyTypeTokenRange": {
1042
- "startIndex": 1,
1043
- "endIndex": 2
1044
- }
1045
- },
1046
- {
1047
- "kind": "PropertySignature",
1048
- "canonicalReference": "@alloy-js/json!JsonObjectPropsBase#refkeys:member",
1049
- "docComment": "/**\n * The refkeys for the JSON object. When provided, this value can be referenced elsewhere via any of these refkeys.\n */\n",
1050
- "excerptTokens": [
1051
- {
1052
- "kind": "Content",
1053
- "text": "refkeys?: "
1015
+ "text": " | "
1054
1016
  },
1055
1017
  {
1056
1018
  "kind": "Reference",
@@ -1069,10 +1031,10 @@
1069
1031
  "isReadonly": false,
1070
1032
  "isOptional": true,
1071
1033
  "releaseTag": "Public",
1072
- "name": "refkeys",
1034
+ "name": "refkey",
1073
1035
  "propertyTypeTokenRange": {
1074
1036
  "startIndex": 1,
1075
- "endIndex": 3
1037
+ "endIndex": 5
1076
1038
  }
1077
1039
  },
1078
1040
  {
@@ -1108,7 +1070,7 @@
1108
1070
  {
1109
1071
  "kind": "Interface",
1110
1072
  "canonicalReference": "@alloy-js/json!JsonObjectPropsWithChildren:interface",
1111
- "docComment": "/**\n * Create a JSON object by providing children that define the object's contents. The children should use the {@link JsonObjectProperty} component to define individual object properties.\n */\n",
1073
+ "docComment": "/**\n * Create a JSON object by providing children that define the object's contents.\n * The children should use the {@link JsonObjectProperty} component to define\n * individual object properties.\n */\n",
1112
1074
  "excerptTokens": [
1113
1075
  {
1114
1076
  "kind": "Content",
@@ -1132,7 +1094,7 @@
1132
1094
  {
1133
1095
  "kind": "PropertySignature",
1134
1096
  "canonicalReference": "@alloy-js/json!JsonObjectPropsWithChildren#children:member",
1135
- "docComment": "/**\n * The contents of the JSON object. Likely to contain {@link JsonObjectProperty} components.\n */\n",
1097
+ "docComment": "/**\n * The contents of the JSON object. Likely to contain\n * {@link JsonObjectProperty} components.\n */\n",
1136
1098
  "excerptTokens": [
1137
1099
  {
1138
1100
  "kind": "Content",
@@ -1192,7 +1154,7 @@
1192
1154
  {
1193
1155
  "kind": "PropertySignature",
1194
1156
  "canonicalReference": "@alloy-js/json!JsonObjectPropsWithJsValue#jsValue:member",
1195
- "docComment": "/**\n * The JS value to serialize to JSON. This can be an array of key-value pairs, a map, or a vanilla JS object.\n */\n",
1157
+ "docComment": "/**\n * The JS value to serialize to JSON. This can be an array of key-value pairs,\n * a map, or a vanilla JS object.\n */\n",
1196
1158
  "excerptTokens": [
1197
1159
  {
1198
1160
  "kind": "Content",
@@ -1245,7 +1207,7 @@
1245
1207
  {
1246
1208
  "kind": "Interface",
1247
1209
  "canonicalReference": "@alloy-js/json!JsonOutputSymbol:interface",
1248
- "docComment": "/**\n * JsonOutputSymbol is created for JSON Values with a refkey. For JSON objects and arrays, the symbol will have the `StaticMemberContainer` flag. For JSON values that are members of an object or an array, the symbol will have the `StaticMember` flag.\n */\n",
1210
+ "docComment": "/**\n * JsonOutputSymbol is created for JSON Values with a refkey. For JSON objects\n * and arrays, the symbol will have the `StaticMemberContainer` flag. For JSON\n * values that are members of an object or an array, the symbol will have the\n * `StaticMember` flag.\n */\n",
1249
1211
  "excerptTokens": [
1250
1212
  {
1251
1213
  "kind": "Content",
@@ -1413,7 +1375,7 @@
1413
1375
  {
1414
1376
  "kind": "Function",
1415
1377
  "canonicalReference": "@alloy-js/json!JsonValue:function(1)",
1416
- "docComment": "/**\n * Create a JSON value from a JS value. When the provided JS value is an object, the {@link JsonObject} component will be used. When the provided JS value is an array, the {@link JsonArray} component will be used. Otherwise, the JS value will be serialized to a string, number, boolean, or null as appropriate.\n */\n",
1378
+ "docComment": "/**\n * Create a JSON value from a JS value. When the provided JS value is an object,\n * the {@link JsonObject} component will be used. When the provided JS value is\n * an array, the {@link JsonArray} component will be used. Otherwise, the JS\n * value will be serialized to a string, number, boolean, or null as\n * appropriate.\n */\n",
1417
1379
  "excerptTokens": [
1418
1380
  {
1419
1381
  "kind": "Content",
@@ -1506,7 +1468,7 @@
1506
1468
  {
1507
1469
  "kind": "PropertySignature",
1508
1470
  "canonicalReference": "@alloy-js/json!JsonValueProps#refkey:member",
1509
- "docComment": "/**\n * The refkey for the JSON value. When provided, this value can be referenced elsewhere via this refkey.\n */\n",
1471
+ "docComment": "/**\n * The refkey or array of refkeys for the JSON value. When provided, this\n * value can be referenced elsewhere via this refkey.\n */\n",
1510
1472
  "excerptTokens": [
1511
1473
  {
1512
1474
  "kind": "Content",
@@ -1519,26 +1481,7 @@
1519
1481
  },
1520
1482
  {
1521
1483
  "kind": "Content",
1522
- "text": ";"
1523
- }
1524
- ],
1525
- "isReadonly": false,
1526
- "isOptional": true,
1527
- "releaseTag": "Public",
1528
- "name": "refkey",
1529
- "propertyTypeTokenRange": {
1530
- "startIndex": 1,
1531
- "endIndex": 2
1532
- }
1533
- },
1534
- {
1535
- "kind": "PropertySignature",
1536
- "canonicalReference": "@alloy-js/json!JsonValueProps#refkeys:member",
1537
- "docComment": "/**\n * The refkeys for the JSON value. When provided, these values can be referenced elsewhere via any of these refkeys.\n */\n",
1538
- "excerptTokens": [
1539
- {
1540
- "kind": "Content",
1541
- "text": "refkeys?: "
1484
+ "text": " | "
1542
1485
  },
1543
1486
  {
1544
1487
  "kind": "Reference",
@@ -1557,10 +1500,10 @@
1557
1500
  "isReadonly": false,
1558
1501
  "isOptional": true,
1559
1502
  "releaseTag": "Public",
1560
- "name": "refkeys",
1503
+ "name": "refkey",
1561
1504
  "propertyTypeTokenRange": {
1562
1505
  "startIndex": 1,
1563
- "endIndex": 3
1506
+ "endIndex": 5
1564
1507
  }
1565
1508
  }
1566
1509
  ],
@@ -1605,7 +1548,7 @@
1605
1548
  {
1606
1549
  "kind": "Interface",
1607
1550
  "canonicalReference": "@alloy-js/json!ObjectPropertyPropsWithChildren:interface",
1608
- "docComment": "/**\n * Create a JSON object property with a name and children. The children become the value of the property.\n */\n",
1551
+ "docComment": "/**\n * Create a JSON object property with a name and children. The children become\n * the value of the property.\n */\n",
1609
1552
  "excerptTokens": [
1610
1553
  {
1611
1554
  "kind": "Content",
@@ -1678,7 +1621,7 @@
1678
1621
  {
1679
1622
  "kind": "Interface",
1680
1623
  "canonicalReference": "@alloy-js/json!ObjectPropertyPropsWithJsValue:interface",
1681
- "docComment": "/**\n * Create a JSON object property with a name and a JS value. The JS value is serialized to JSON for the property\n */\n",
1624
+ "docComment": "/**\n * Create a JSON object property with a name and a JS value. The JS value is\n * serialized to JSON for the property\n */\n",
1682
1625
  "excerptTokens": [
1683
1626
  {
1684
1627
  "kind": "Content",
@@ -1796,7 +1739,7 @@
1796
1739
  {
1797
1740
  "kind": "Function",
1798
1741
  "canonicalReference": "@alloy-js/json!Reference:function(1)",
1799
- "docComment": "/**\n * Emit a reference to a JSON value by its refkey.\n *\n * @remarks\n *\n * Note that when you place a refkey in a template, the refkey will be converted into a reference automatically. Using this component directly is generally not required or recommended.\n */\n",
1742
+ "docComment": "/**\n * Emit a reference to a JSON value by its refkey.\n *\n * @remarks\n *\n *\n *\n * Note that when you place a refkey in a template, the refkey will be converted\n * into a reference automatically. Using this component directly is generally\n * not required or recommended.\n */\n",
1800
1743
  "excerptTokens": [
1801
1744
  {
1802
1745
  "kind": "Content",
@@ -1893,7 +1836,7 @@
1893
1836
  {
1894
1837
  "kind": "Function",
1895
1838
  "canonicalReference": "@alloy-js/json!SourceFile:function(1)",
1896
- "docComment": "/**\n * Creates a JSON source file which defines a JSON value.\n *\n * @see\n *\n * {@link (JsonFileContext:variable)}\n *\n * @see\n *\n * {@link @alloy-js/core#(MemberDeclarationContext:variable)}\n *\n * @see\n *\n * {@link @alloy-js/core#(SourceFileContext:variable)}\n */\n",
1839
+ "docComment": "/**\n * Creates a JSON source file which defines a JSON value.\n *\n * @see\n *\n * {@link (JsonFileContext:variable)}\n *\n * @see\n *\n * {@link @alloy-js/core#(MemberDeclarationContext:variable)}\n *\n * @see\n *\n * {@link @alloy-js/core#(SourceFileContext:variable)}\n *\n */\n",
1897
1840
  "excerptTokens": [
1898
1841
  {
1899
1842
  "kind": "Content",
package/vitest.config.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { babel } from "@rollup/plugin-babel";
1
+ import alloyPlugin from "@alloy-js/rollup-plugin";
2
2
  import { defineConfig } from "vitest/config";
3
3
 
4
4
  export default defineConfig({
@@ -6,13 +6,5 @@ export default defineConfig({
6
6
  jsx: "preserve",
7
7
  sourcemap: "both",
8
8
  },
9
- plugins: [
10
- babel({
11
- inputSourceMap: true as any,
12
- sourceMaps: "both",
13
- babelHelpers: "bundled",
14
- extensions: [".ts", ".tsx"],
15
- presets: ["@babel/preset-typescript", ["@alloy-js/babel-preset"]],
16
- }),
17
- ],
9
+ plugins: [alloyPlugin()],
18
10
  });