Skip to content

Commit c5f04fe

Browse files
tenphiCopilot
andauthored
feat(parser): new style parser (#681)
Co-authored-by: Copilot <[email protected]>
1 parent ea616ae commit c5f04fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1395
-475
lines changed

.changeset/olive-ants-remember.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cube-dev/ui-kit": minor
3+
---
4+
5+
A brand new style parser that supports all kinds of css syntax and nested custom tasty syntax.

.cursor/rules/parser.mdc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
description: If the task requires information about how styles are parsed in `tasty`.
3+
globs:
4+
alwaysApply: false
5+
---
6+
The specification of the style parser is described in [parser.md](mdc:src/parser/parser.md)
7+
This part of the styles handling only covers the parsing of string values. Though, boolean and number styles can be converted to string.
8+
Style-2-state mapping and responsive values are handled separately in [styles.ts](mdc:src/tasty/utils/styles.ts) and [responsive.ts](mdc:src/tasty/utils/responsive.ts)

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@v2
41+
uses: actions/checkout@v4
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v1
45+
uses: github/codeql-action/init@v3
4646
with:
4747
languages: ${{ matrix.language }}
4848
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +53,7 @@ jobs:
5353
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5454
# If this step fails, then you should remove it and run the build manually (see below)
5555
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v1
56+
uses: github/codeql-action/autobuild@v3
5757

5858
# ℹ️ Command-line programs to run using the OS shell.
5959
# 📚 https://git.io/JvXDl
@@ -67,4 +67,4 @@ jobs:
6767
# make release
6868

6969
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v1
70+
uses: github/codeql-action/analyze@v3

.github/workflows/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ jobs:
2121
outputs:
2222
published: ${{ steps.changesets.outputs.published }}
2323
steps:
24-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v4
2525

2626
- name: Install pnpm
2727
uses: pnpm/action-setup@v4
2828
with:
29-
version: 9.12.2
29+
version: 10.14.0
3030

3131
- name: Setup Node.js
32-
uses: actions/setup-node@v3
32+
uses: actions/setup-node@v4
3333
with:
3434
node-version-file: '.nvmrc'
3535
cache: 'pnpm'
@@ -59,16 +59,16 @@ jobs:
5959
NODE_OPTIONS: --max-old-space-size=4096
6060
CHROMATIC_RETRIES: 5
6161
steps:
62-
- uses: actions/checkout@v2
62+
- uses: actions/checkout@v4
6363
with:
6464
fetch-depth: 0
6565

6666
- name: Install pnpm
6767
uses: pnpm/action-setup@v4
6868
with:
69-
version: 9.12.2
69+
version: 10.14.0
7070

71-
- uses: actions/cache@v3
71+
- uses: actions/cache@v4
7272
name: Download storybook cache
7373
with:
7474
path: |
@@ -77,7 +77,7 @@ jobs:
7777
restore-keys: |
7878
${{ runner.os }}-storybook
7979
80-
- uses: actions/setup-node@v3
80+
- uses: actions/setup-node@v4
8181
with:
8282
node-version-file: '.nvmrc'
8383
cache: 'pnpm'

.github/workflows/pull-request.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ jobs:
2525
name: Canary package in NPM
2626
url: https://www.npmjs.com/package/@cube-dev/ui-kit/v/${{ steps.publish.outputs.version }}
2727
steps:
28-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
2929

3030
- name: Install pnpm
3131
uses: pnpm/action-setup@v4
3232
with:
33-
version: 9.12.2
33+
version: 10.14.0
3434

35-
- uses: actions/setup-node@v3
35+
- uses: actions/setup-node@v4
3636
with:
3737
node-version-file: '.nvmrc'
3838
cache: 'pnpm'
@@ -79,21 +79,21 @@ jobs:
7979
name: 'Tests & lint'
8080
runs-on: ubuntu-latest
8181
steps:
82-
- uses: actions/checkout@v2
82+
- uses: actions/checkout@v4
8383

8484
- name: Install pnpm
8585
uses: pnpm/action-setup@v4
8686
with:
87-
version: 9.12.2
87+
version: 10.14.0
8888

89-
- uses: actions/cache@v3
89+
- uses: actions/cache@v4
9090
name: Download eslint cache
9191
with:
9292
path: |
9393
**/.eslintcache
9494
key: ${{ runner.os }}-eslint
9595

96-
- uses: actions/setup-node@v3
96+
- uses: actions/setup-node@v4
9797
with:
9898
node-version-file: '.nvmrc'
9999
cache: 'pnpm'
@@ -105,7 +105,7 @@ jobs:
105105
run: pnpm lint
106106

107107
- name: Run the tests
108-
run: pnpm test -- --no-cache
108+
run: pnpm test:no-cache
109109

110110
deploy-chromatic:
111111
name: 'Prepare Storybook for review & tests'
@@ -117,16 +117,16 @@ jobs:
117117
CHROMATIC_RETRIES: 5
118118
LOG_LEVEL: 'error'
119119
steps:
120-
- uses: actions/checkout@v2
120+
- uses: actions/checkout@v4
121121
with:
122122
fetch-depth: 0
123123

124124
- name: Install pnpm
125125
uses: pnpm/action-setup@v4
126126
with:
127-
version: 9.12.2
127+
version: 10.14.0
128128

129-
- uses: actions/cache@v3
129+
- uses: actions/cache@v4
130130
name: Download storybook cache
131131
with:
132132
path: |
@@ -135,7 +135,7 @@ jobs:
135135
restore-keys: |
136136
${{ runner.os }}-storybook
137137
138-
- uses: actions/setup-node@v3
138+
- uses: actions/setup-node@v4
139139
with:
140140
node-version-file: '.nvmrc'
141141
cache: 'pnpm'

.github/workflows/size-limit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ jobs:
2323
REPORT_FOLDER: './size-limit-report'
2424
NODE_OPTIONS: --max-old-space-size=4096
2525
steps:
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2727

2828
- name: Install pnpm
2929
uses: pnpm/action-setup@v4
3030
with:
31-
version: 9.12.2
31+
version: 10.14.0
3232

33-
- uses: actions/setup-node@v3
33+
- uses: actions/setup-node@v4
3434
with:
3535
node-version-file: '.nvmrc'
3636
cache: 'pnpm'

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.19.1
1+
20.19.2

.size-limit.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ module.exports = [
2020
}),
2121
);
2222
},
23-
limit: '281kB',
23+
limit: '282kB',
2424
},
2525
{
2626
name: 'Tree shaking (just a Button)',
2727
path: './dist/es/index.js',
2828
webpack: true,
2929
import: '{ Button }',
30-
limit: '23 kB',
30+
limit: '24 kB',
3131
},
3232
{
3333
name: 'Tree shaking (just an Icon)',
3434
path: './dist/es/index.js',
3535
webpack: true,
3636
import: '{ AiIcon }',
37-
limit: '12 kB',
37+
limit: '13 kB',
3838
},
3939
];

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"module": "dist/es/index.js",
1111
"types": "dist/types/index.d.ts",
1212
"sideEffects": false,
13-
"packageManager": "pnpm@9.12.2",
13+
"packageManager": "pnpm@10.14.0",
1414
"exports": {
1515
".": {
1616
"import": "./dist/es/index.js",
@@ -28,6 +28,7 @@
2828
"build:esm": "tsc -p tsconfig.es.json",
2929
"watch": "pnpm build:esm --watch",
3030
"test": "jest",
31+
"test:no-cache": "jest --no-cache",
3132
"test-cover": "jest --coverage",
3233
"test-watch": "jest --watch",
3334
"prettier": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\"",
@@ -102,6 +103,7 @@
102103
},
103104
"devDependencies": {
104105
"@actions/core": "^1.11.1",
106+
"@eslint/js": "^9.25.1",
105107
"@actions/exec": "^1.1.1",
106108
"@actions/github": "^6.0.0",
107109
"@changesets/changelog-github": "^0.4.4",
@@ -182,7 +184,7 @@
182184
],
183185
"license": "MIT",
184186
"engines": {
185-
"node": ">=18.19.1",
186-
"pnpm": "^9.0.0"
187+
"node": ">=20.19.2",
188+
"pnpm": "^10.0.0"
187189
}
188190
}

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)