Skip to content

Commit 9c426b7

Browse files
Remove hacks introduced yesterday to remove generated TODOs (#1102)
* Remove hacks introduced yesterday to remove TODO. The types were on the 'target' property - just not when the target property is a number. Modified removal of 'target' to be more targeted.
1 parent 804f194 commit 9c426b7

File tree

3 files changed

+93
-21
lines changed

3 files changed

+93
-21
lines changed

packages/lit-dev-api/api-data/lit-2/pages.json

Lines changed: 86 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6400,7 +6400,11 @@
64006400
],
64016401
"type": {
64026402
"type": "typeOperator",
6403-
"operator": "unique"
6403+
"operator": "unique",
6404+
"target": {
6405+
"type": "intrinsic",
6406+
"name": "symbol"
6407+
}
64046408
},
64056409
"kindString": "Variable",
64066410
"entrypointSources": [
@@ -6424,7 +6428,8 @@
64246428
"content": [
64256429
{
64266430
"tag": "@link",
6427-
"text": "Rendering Lit HTML Templates"
6431+
"text": "Rendering Lit HTML Templates",
6432+
"target": "https://lit.dev/docs/libraries/standalone-templates/#rendering-lit-html-templates|"
64286433
}
64296434
]
64306435
}
@@ -15099,7 +15104,8 @@
1509915104
"content": [
1510015105
{
1510115106
"tag": "@link",
15102-
"text": "styleMap code samples on Lit.dev"
15107+
"text": "styleMap code samples on Lit.dev",
15108+
"target": "https://lit.dev/docs/templates/directives/#stylemap"
1510315109
}
1510415110
]
1510515111
}
@@ -18415,7 +18421,14 @@
1841518421
"name": "strings",
1841618422
"type": {
1841718423
"type": "typeOperator",
18418-
"operator": "readonly"
18424+
"operator": "readonly",
18425+
"target": {
18426+
"type": "array",
18427+
"elementType": {
18428+
"type": "intrinsic",
18429+
"name": "string"
18430+
}
18431+
}
1841918432
},
1842018433
"kindString": "Parameter"
1842118434
},
@@ -18601,7 +18614,14 @@
1860118614
],
1860218615
"type": {
1860318616
"type": "typeOperator",
18604-
"operator": "readonly"
18617+
"operator": "readonly",
18618+
"target": {
18619+
"type": "array",
18620+
"elementType": {
18621+
"type": "intrinsic",
18622+
"name": "string"
18623+
}
18624+
}
1860518625
},
1860618626
"kindString": "Property",
1860718627
"entrypointSources": [
@@ -18803,7 +18823,14 @@
1880318823
"name": "strings",
1880418824
"type": {
1880518825
"type": "typeOperator",
18806-
"operator": "readonly"
18826+
"operator": "readonly",
18827+
"target": {
18828+
"type": "array",
18829+
"elementType": {
18830+
"type": "intrinsic",
18831+
"name": "string"
18832+
}
18833+
}
1880718834
},
1880818835
"kindString": "Parameter"
1880918836
},
@@ -19025,7 +19052,14 @@
1902519052
],
1902619053
"type": {
1902719054
"type": "typeOperator",
19028-
"operator": "readonly"
19055+
"operator": "readonly",
19056+
"target": {
19057+
"type": "array",
19058+
"elementType": {
19059+
"type": "intrinsic",
19060+
"name": "string"
19061+
}
19062+
}
1902919063
},
1903019064
"inheritedFrom": {
1903119065
"type": "reference",
@@ -20316,7 +20350,14 @@
2031620350
"name": "strings",
2031720351
"type": {
2031820352
"type": "typeOperator",
20319-
"operator": "readonly"
20353+
"operator": "readonly",
20354+
"target": {
20355+
"type": "array",
20356+
"elementType": {
20357+
"type": "intrinsic",
20358+
"name": "string"
20359+
}
20360+
}
2032020361
},
2032120362
"kindString": "Parameter"
2032220363
},
@@ -20538,7 +20579,14 @@
2053820579
],
2053920580
"type": {
2054020581
"type": "typeOperator",
20541-
"operator": "readonly"
20582+
"operator": "readonly",
20583+
"target": {
20584+
"type": "array",
20585+
"elementType": {
20586+
"type": "intrinsic",
20587+
"name": "string"
20588+
}
20589+
}
2054220590
},
2054320591
"inheritedFrom": {
2054420592
"type": "reference",
@@ -20933,7 +20981,14 @@
2093320981
"name": "strings",
2093420982
"type": {
2093520983
"type": "typeOperator",
20936-
"operator": "readonly"
20984+
"operator": "readonly",
20985+
"target": {
20986+
"type": "array",
20987+
"elementType": {
20988+
"type": "intrinsic",
20989+
"name": "string"
20990+
}
20991+
}
2093720992
},
2093820993
"kindString": "Parameter"
2093920994
},
@@ -21155,7 +21210,14 @@
2115521210
],
2115621211
"type": {
2115721212
"type": "typeOperator",
21158-
"operator": "readonly"
21213+
"operator": "readonly",
21214+
"target": {
21215+
"type": "array",
21216+
"elementType": {
21217+
"type": "intrinsic",
21218+
"name": "string"
21219+
}
21220+
}
2115921221
},
2116021222
"inheritedFrom": {
2116121223
"type": "reference",
@@ -21358,7 +21420,14 @@
2135821420
],
2135921421
"type": {
2136021422
"type": "typeOperator",
21361-
"operator": "readonly"
21423+
"operator": "readonly",
21424+
"target": {
21425+
"type": "array",
21426+
"elementType": {
21427+
"type": "intrinsic",
21428+
"name": "string"
21429+
}
21430+
}
2136221431
},
2136321432
"kindString": "Property",
2136421433
"entrypointSources": [
@@ -22789,7 +22858,11 @@
2278922858
],
2279022859
"type": {
2279122860
"type": "typeOperator",
22792-
"operator": "unique"
22861+
"operator": "unique",
22862+
"target": {
22863+
"type": "intrinsic",
22864+
"name": "symbol"
22865+
}
2279322866
},
2279422867
"kindString": "Variable",
2279522868
"entrypointSources": [

packages/lit-dev-content/site/_includes/api.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
{%- elif t.operator == 'keyof' -%}
6262
keyof {{ type(t.target) }}
6363

64-
{%- elif t.type == "typeOperator" and t.operator == "unique" -%}
64+
{%- elif t.operator == 'unique' and t.target.name == 'symbol' -%}
6565
symbol
6666

6767
{%- elif t.type == 'conditional' -%}
@@ -143,10 +143,6 @@
143143
{%- elif t.name and t.name !== '__type' -%}
144144
{{- t.name -}}
145145

146-
{%- elif page.url.includes("api/custom-directives") -%}
147-
<!-- TODO(https://github.com/lit/lit.dev/issues/1099) -->
148-
ReadonlyArray&lt;string>
149-
150146
{%- else -%}
151147
<span class="error-fallback-todo">TODO</span>
152148
{# {{ t | dump }} #}

packages/lit-dev-tools-cjs/src/api-docs/transformer.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,12 @@ export class ApiDocsTransformer {
496496
// We don't render JSDoc tags directly, the ones we care about are
497497
// already extracted into e.g. "parameters".
498498
key === 'tags' ||
499-
// The "target" key is unstable causing our "Check API data is in
500-
// sync" approach to fail. We also do not use this key.
501-
key === 'target' ||
499+
// The "target" key is unstable when referring to a number `id`,
500+
// causing our "Check API data is in sync" approach to fail. If not a
501+
// number, this key can also represent a concrete type. Keep `target`
502+
// if it contains a `type` key.
503+
(key === 'target' && typeof val === 'number') ||
504+
(key === 'target' && typeof val === 'object' && !('type' in val)) ||
502505
// We do not use the 'variant' or 'refersToTypeParameter' field.
503506
key === 'variant' ||
504507
key === 'refersToTypeParameter' ||

0 commit comments

Comments
 (0)