ReviewOS

also looking at this

stacks/ts-css

chore(deps): update actions/cache action to v6

#29
Open renovate[bot] wants to merge renovate/actions-cache-6.x into main
9 files +68 -9
packages/toolkit/src/engine/parser.tsmodified+14-0
Changes to packages/toolkit/src/engine/parser.ts
@@ -2267,6 +2267,14 @@ function extractCodeStringCandidates(content: string, bracketConfig?: BracketSyn
22672267 // payloads as code strings creates phantom utility classes and can make
22682268 // a classless fragment emit an entire preflight stylesheet.
22692269 if (markupAttribute) {
2270 // The one thing a prop value is allowed to name is an icon. A
2271 // component takes its glyph as an attribute (`<EmptyState icon="i-...">`),
2272 // and a rule that exists nowhere else on the page was never generated:
2273 // the icon rendered as an empty box. An icon token cannot be a CSRF
2274 // token, URL or v-html payload, and the generator only emits it when the
2275 // icon exists, so reading it creates no phantom rule.
2276 for (const token of literal.match(ICON_TOKEN) ?? [])
2277 tokens.add(token)
22702278 i = j
22712279 continue
22722280 }
@@ -2337,6 +2345,12 @@ function regexLiteralEnd(content: string, start: number): number {
23372345 return -1
23382346}
23392347
2348/**
2349 * `i-<collection>-<name>`, however it is spelled inside a markup attribute:
2350 * bare (`icon="i-lucide-x"`) or quoted inside a binding (`:icon="'i-lucide-x'"`).
2351 */
2352const ICON_TOKEN = /(?<![\w-])i-[a-z0-9]+(?:-[a-z0-9]+)+(?![\w-])/gi
2353
23402354function isMarkupAttributeString(content: string, quoteIndex: number): boolean {
23412355 const tagStart = content.lastIndexOf('<', quoteIndex)
23422356 const tagEnd = content.lastIndexOf('>', quoteIndex)