ReviewOS

also looking at this

stacks/ts-css

chore(deps): update actions/checkout action to v7

#34
Open renovate[bot] wants to merge renovate/actions-checkout-7.x into main
11 files +74 -15
.github/workflows/buddy-bot.ymlmodified+4-4
Changes to .github/workflows/buddy-bot.yml
@@ -119,7 +119,7 @@ jobs:
119119 if: ${{ needs.determine-jobs.outputs.run_check == 'true' || needs.determine-jobs.outputs.run_update == 'true' || needs.determine-jobs.outputs.run_dashboard == 'true' }}
120120 steps:
121121 - name: Checkout repository
122 uses: actions/checkout@v6
122 uses: actions/checkout@v7
123123 with:
124124 token: ${{ secrets.GITHUB_TOKEN }}
125125 fetch-depth: 0 # Fetch full history for rebasing
@@ -156,7 +156,7 @@ jobs:
156156
157157 steps:
158158 - name: Checkout repository
159 uses: actions/checkout@v6
159 uses: actions/checkout@v7
160160 with:
161161 token: ${{ secrets.GITHUB_TOKEN }}
162162 fetch-depth: 0
@@ -237,7 +237,7 @@ jobs:
237237
238238 steps:
239239 - name: Checkout repository
240 uses: actions/checkout@v6
240 uses: actions/checkout@v7
241241 with:
242242 token: ${{ secrets.GITHUB_TOKEN }}
243243 fetch-depth: 0
@@ -346,7 +346,7 @@ jobs:
346346
347347 steps:
348348 - name: Checkout repository
349 uses: actions/checkout@v6
349 uses: actions/checkout@v7
350350 with:
351351 token: ${{ secrets.GITHUB_TOKEN }}
352352
.github/workflows/ci.ymlmodified+4-4
Changes to .github/workflows/ci.yml
@@ -18,7 +18,7 @@ jobs:
1818 runs-on: ubuntu-latest
1919
2020 steps:
21 - uses: actions/checkout@v6
21 - uses: actions/checkout@v7
2222
2323 - name: Install Bun
2424 uses: oven-sh/setup-bun@v2
@@ -41,7 +41,7 @@ jobs:
4141 runs-on: ubuntu-latest
4242
4343 steps:
44 - uses: actions/checkout@v6
44 - uses: actions/checkout@v7
4545
4646 - name: Install Bun
4747 uses: oven-sh/setup-bun@v2
@@ -64,7 +64,7 @@ jobs:
6464 runs-on: ubuntu-latest
6565
6666 steps:
67 - uses: actions/checkout@v6
67 - uses: actions/checkout@v7
6868
6969 - name: Install Bun
7070 uses: oven-sh/setup-bun@v2
@@ -88,7 +88,7 @@ jobs:
8888 runs-on: ubuntu-latest
8989
9090 steps:
91 - uses: actions/checkout@v6
91 - uses: actions/checkout@v7
9292 with:
9393 fetch-depth: 0
9494
.github/workflows/release.ymlmodified+1-1
Changes to .github/workflows/release.yml
@@ -15,7 +15,7 @@ jobs:
1515
1616 steps:
1717 - name: Checkout
18 uses: actions/checkout@v6
18 uses: actions/checkout@v7
1919 with:
2020 fetch-depth: 0
2121
CHANGELOG.mdmodified+14-0
Changes to CHANGELOG.md
@@ -1,3 +1,17 @@
1[Compare changes](https://github.com/stacksjs/ts-css/compare/v0.3.19...v0.3.20)
2
3## 🐛 Bug Fixes
4
5- **engine**: read an icon class named by any markup attribute, not only class ([617955b](https://github.com/stacksjs/ts-css/commit/617955b)) _(by Chris Breuer <chrisbreuer93@gmail.com>)_
6
7## 🔧 Chores
8
9- release v0.3.20 ([6920a97](https://github.com/stacksjs/ts-css/commit/6920a97)) _(by Chris Breuer <chrisbreuer93@gmail.com>)_
10
11## Contributors
12
13- _Chris Breuer <chrisbreuer93@gmail.com>_
14
115[Compare changes](https://github.com/stacksjs/ts-css/compare/v0.3.18...v0.3.19)
216
317## 🐛 Bug Fixes
bun.lockmodified+2-2
Changes to bun.lock
@@ -11,7 +11,7 @@
1111 },
1212 "packages/toolkit": {
1313 "name": "@stacksjs/ts-css",
14 "version": "0.3.19",
14 "version": "0.3.20",
1515 "bin": {
1616 "ts-css": "./dist/bin/cli.js",
1717 "cssx": "./dist/bin/cssx.js",
@@ -34,7 +34,7 @@
3434 },
3535 "packages/vscode": {
3636 "name": "@ts-css/vscode",
37 "version": "0.3.19",
37 "version": "0.3.20",
3838 },
3939 },
4040 "overrides": {
package.jsonmodified+1-1
Changes to package.json
@@ -2,7 +2,7 @@
22 "name": "@ts-css/core",
33 "type": "module",
44 "sideEffects": false,
5 "version": "0.3.19",
5 "version": "0.3.20",
66 "description": "A blazingly fast utility-first CSS engine with a StyleX-style typed API. Tailwind-compatible utilities, zero runtime.",
77 "author": "Chris Breuer <chris@stacksjs.org>",
88 "license": "MIT",
packages/toolkit/package.jsonmodified+1-1
Changes to packages/toolkit/package.json
@@ -1,7 +1,7 @@
11{
22 "name": "@stacksjs/ts-css",
33 "type": "module",
4 "version": "0.3.19",
4 "version": "0.3.20",
55 "description": "Pure-TypeScript CSS toolkit and utility-first CSS engine for Bun/Node — parser, walker, generator, selector engine, minifier, and a Tailwind-compatible utility engine. Zero runtime deps.",
66 "author": "Chris Breuer <chris@stacksjs.org>",
77 "license": "MIT",
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)
packages/toolkit/test/engine/code-strings.test.tsmodified+31-0
Changes to packages/toolkit/test/engine/code-strings.test.ts
@@ -246,3 +246,34 @@ describe('code-string extraction past comments and regexes', () => {
246246 expect(classes.has('gap-3')).toBe(true)
247247 })
248248})
249
250describe('icons named by a component prop', () => {
251 it('takes an icon class out of any attribute, not only class', () => {
252 const classes = extractClasses(`<MoreMenu icon="i-hugeicons-settings-02"><EmptyState icon="i-hugeicons-note-01" text="Nothing"/></MoreMenu>`)
253
254 expect(classes.has('i-hugeicons-settings-02')).toBe(true)
255 expect(classes.has('i-hugeicons-note-01')).toBe(true)
256 })
257
258 it('takes one quoted inside a binding', () => {
259 const classes = extractClasses(`<Row :icon="done ? 'i-hugeicons-tick-02' : 'i-hugeicons-circle'" />`)
260
261 expect(classes.has('i-hugeicons-tick-02')).toBe(true)
262 expect(classes.has('i-hugeicons-circle')).toBe(true)
263 })
264
265 it('still ignores every other attribute value', () => {
266 const classes = extractClasses(`<a href="/p/ab-cd-ef" data-token="abc-123-xyz" title="bg-red-500 shadow-lg">x</a>`)
267
268 expect(classes.has('ab-cd-ef')).toBe(false)
269 expect(classes.has('abc-123-xyz')).toBe(false)
270 expect(classes.has('bg-red-500')).toBe(false)
271 })
272
273 it('does not take a word that merely contains i-', () => {
274 const classes = extractClasses(`<a title="semi-colon wi-fi pi-day">x</a>`)
275
276 expect(classes.has('i-colon')).toBe(false)
277 expect(classes.has('fi')).toBe(false)
278 })
279})
packages/vscode/package.jsonmodified+1-1
Changes to packages/vscode/package.json
@@ -1,6 +1,6 @@
11{
22 "name": "@ts-css/vscode",
3 "version": "0.3.19",
3 "version": "0.3.20",
44 "description": "VS Code extension for ts-css (placeholder package)",
55 "license": "MIT",
66 "repository": {
pantry.lockmodified+1-1
Changes to pantry.lock
@@ -21,7 +21,7 @@
2121 },
2222 "packages/vscode": {
2323 "name": "crosswind-vscode",
24 "version": "0.3.19"
24 "version": "0.3.20"
2525 }
2626 },
2727 "packages": {