@tenphi/tasty 0.0.0-snapshot.fa23a44 → 0.0.0-snapshot.fa7ba65
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/README.md +452 -365
- package/dist/babel-types-Dc5zghyE.d.ts +18 -0
- package/dist/chunks/async-storage-f9j9JRtq.js +37 -0
- package/dist/chunks/async-storage-f9j9JRtq.js.map +1 -0
- package/dist/chunks/build-config--0qoqt_P.js +60 -0
- package/dist/chunks/build-config--0qoqt_P.js.map +1 -0
- package/dist/{collector-DrgDE7QB.js → chunks/collector-zp5BrLF0.js} +79 -99
- package/dist/chunks/collector-zp5BrLF0.js.map +1 -0
- package/dist/chunks/config-engine-BaLq8HrX.js +272 -0
- package/dist/chunks/config-engine-BaLq8HrX.js.map +1 -0
- package/dist/chunks/config-file-DlZXJMj8.js +25 -0
- package/dist/chunks/config-file-DlZXJMj8.js.map +1 -0
- package/dist/chunks/css-definitions-CfXZ3tU9.js +910 -0
- package/dist/chunks/css-definitions-CfXZ3tU9.js.map +1 -0
- package/dist/chunks/css-resources-P7IBUUZs.js +142 -0
- package/dist/chunks/css-resources-P7IBUUZs.js.map +1 -0
- package/dist/chunks/debug--OC-WA-Q.js +502 -0
- package/dist/chunks/debug--OC-WA-Q.js.map +1 -0
- package/dist/chunks/dsl-CsFl9LGn.js +1458 -0
- package/dist/chunks/dsl-CsFl9LGn.js.map +1 -0
- package/dist/chunks/hydration-TRcz5vnk.js +41 -0
- package/dist/chunks/hydration-TRcz5vnk.js.map +1 -0
- package/dist/chunks/react-runtime-DnZ6M1Iv.js +691 -0
- package/dist/chunks/react-runtime-DnZ6M1Iv.js.map +1 -0
- package/dist/chunks/runtime-engine-J9X_h-Pw.js +2435 -0
- package/dist/chunks/runtime-engine-J9X_h-Pw.js.map +1 -0
- package/dist/chunks/runtime-state-o_v3Bj7b.js +152 -0
- package/dist/chunks/runtime-state-o_v3Bj7b.js.map +1 -0
- package/dist/{merge-styles-BUQsEpbv.js → chunks/shared-utils-y-HjvPN4.js} +60 -55
- package/dist/chunks/shared-utils-y-HjvPN4.js.map +1 -0
- package/dist/chunks/style-engine-D6lC3O3G.js +5626 -0
- package/dist/chunks/style-engine-D6lC3O3G.js.map +1 -0
- package/dist/{css-writer-D--REwtp.js → chunks/zero-engine-BnjoV04F.js} +104 -123
- package/dist/chunks/zero-engine-BnjoV04F.js.map +1 -0
- package/dist/collector-D2OT6I2G.d.ts +164 -0
- package/dist/config-C4ftFxgI.d.ts +1367 -0
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +9 -6
- package/dist/hydrate-CRyjjAyl.d.ts +22 -0
- package/dist/index-DxQNRj50.d.ts +1964 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +11 -732
- package/dist/{merge-styles-CtDJMhpJ.d.ts → merge-styles-D39qBtox.d.ts} +2 -3
- package/dist/ssr/astro-client.d.ts +1 -1
- package/dist/ssr/astro-client.js +1 -14
- package/dist/ssr/astro-client.js.map +1 -1
- package/dist/ssr/astro-middleware-extract-static.d.ts +10 -0
- package/dist/ssr/astro-middleware-extract-static.js +9 -0
- package/dist/ssr/astro-middleware-extract-static.js.map +1 -0
- package/dist/ssr/astro-middleware-extract.d.ts +10 -0
- package/dist/ssr/astro-middleware-extract.js +9 -0
- package/dist/ssr/astro-middleware-extract.js.map +1 -0
- package/dist/ssr/astro-middleware-static.d.ts +17 -0
- package/dist/ssr/astro-middleware-static.js +7 -0
- package/dist/ssr/astro-middleware-static.js.map +1 -0
- package/dist/ssr/astro-middleware.d.ts +11 -8
- package/dist/ssr/astro-middleware.js +2 -14
- package/dist/ssr/astro-middleware.js.map +1 -1
- package/dist/ssr/astro.d.ts +33 -14
- package/dist/ssr/astro.js +163 -91
- package/dist/ssr/astro.js.map +1 -1
- package/dist/ssr/client.d.ts +2 -0
- package/dist/ssr/client.js +2 -0
- package/dist/ssr/index.d.ts +5 -32
- package/dist/ssr/index.js +6 -6
- package/dist/ssr/index.js.map +1 -1
- package/dist/ssr/next-config.d.ts +64 -0
- package/dist/ssr/next-config.js +123 -0
- package/dist/ssr/next-config.js.map +1 -0
- package/dist/ssr/next.d.ts +9 -9
- package/dist/ssr/next.js +29 -44
- package/dist/ssr/next.js.map +1 -1
- package/dist/static/index.d.ts +8 -9
- package/dist/static/index.js +4 -22
- package/dist/static/index.js.map +1 -1
- package/dist/static/inject.d.ts +1 -2
- package/dist/static/inject.js.map +1 -1
- package/dist/{index-dUtwpOux.d.ts → types-CYQIhUg1.d.ts} +691 -388
- package/dist/zero/babel.d.ts +12 -20
- package/dist/zero/babel.js +101 -152
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/index.d.ts +76 -7
- package/dist/zero/index.js +25 -2
- package/dist/zero/index.js.map +1 -0
- package/dist/zero/next.d.ts +4 -5
- package/dist/zero/next.js +3 -38
- package/dist/zero/next.js.map +1 -1
- package/docs/README.md +20 -9
- package/docs/adoption.md +69 -36
- package/docs/ai-agents.md +259 -0
- package/docs/comparison.md +77 -47
- package/docs/configuration.md +648 -85
- package/docs/debug.md +28 -15
- package/docs/design-system.md +166 -33
- package/docs/dsl.md +739 -196
- package/docs/getting-started.md +130 -50
- package/docs/injector.md +160 -69
- package/docs/llms.txt +31 -0
- package/docs/methodology.md +106 -49
- package/docs/migration-v3.md +285 -0
- package/docs/pipeline.md +142 -47
- package/docs/plugins.md +333 -0
- package/docs/react-api.md +236 -47
- package/docs/runtime-benchmarks.md +388 -0
- package/docs/ssr.md +310 -116
- package/docs/styles.md +234 -49
- package/docs/tasty-static.md +298 -130
- package/harness/dev.harnesspm/rules/usage.md +12 -0
- package/harness/dev.harnesspm/scripts/render.mjs +441 -0
- package/harness/dev.harnesspm/scripts/styles.mjs +412 -0
- package/harness/plugin.json +20 -0
- package/package.json +153 -45
- package/tasty.config.ts +7 -0
- package/dist/async-storage-B7_o6FKt.js +0 -44
- package/dist/async-storage-B7_o6FKt.js.map +0 -1
- package/dist/collector-DrgDE7QB.js.map +0 -1
- package/dist/collector-LuU1vZ68.d.ts +0 -98
- package/dist/config-_aQ_PZ-P.js +0 -10131
- package/dist/config-_aQ_PZ-P.js.map +0 -1
- package/dist/config-vuCRkBWX.d.ts +0 -884
- package/dist/context-CkSg-kDT.js +0 -24
- package/dist/context-CkSg-kDT.js.map +0 -1
- package/dist/core-BqO8pplb.js +0 -1592
- package/dist/core-BqO8pplb.js.map +0 -1
- package/dist/css-writer-D--REwtp.js.map +0 -1
- package/dist/format-global-rules-Dbc_1tc3.js +0 -22
- package/dist/format-global-rules-Dbc_1tc3.js.map +0 -1
- package/dist/format-rules-xwteB7a1.js +0 -143
- package/dist/format-rules-xwteB7a1.js.map +0 -1
- package/dist/hydrate-BvPT4ndL.js +0 -45
- package/dist/hydrate-BvPT4ndL.js.map +0 -1
- package/dist/index-ZRxZWzlj.d.ts +0 -1602
- package/dist/index.js.map +0 -1
- package/dist/keyframes-ClPFWy33.js +0 -587
- package/dist/keyframes-ClPFWy33.js.map +0 -1
- package/dist/merge-styles-BUQsEpbv.js.map +0 -1
- package/dist/resolve-recipes-C0-AMzCz.js +0 -144
- package/dist/resolve-recipes-C0-AMzCz.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenphi/tasty",
|
|
3
|
-
"version": "0.0.0-snapshot.
|
|
3
|
+
"version": "0.0.0-snapshot.fa7ba65",
|
|
4
4
|
"description": "A design-system-integrated styling system and DSL for concise, state-aware UI styling",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"import": "./dist/zero/index.js",
|
|
33
33
|
"default": "./dist/zero/index.js"
|
|
34
34
|
},
|
|
35
|
-
"./next": {
|
|
35
|
+
"./zero/next": {
|
|
36
36
|
"types": "./dist/zero/next.d.ts",
|
|
37
37
|
"import": "./dist/zero/next.js",
|
|
38
38
|
"default": "./dist/zero/next.js"
|
|
@@ -52,28 +52,63 @@
|
|
|
52
52
|
"import": "./dist/ssr/next.js",
|
|
53
53
|
"default": "./dist/ssr/next.js"
|
|
54
54
|
},
|
|
55
|
+
"./ssr/next-config": {
|
|
56
|
+
"types": "./dist/ssr/next-config.d.ts",
|
|
57
|
+
"import": "./dist/ssr/next-config.js",
|
|
58
|
+
"default": "./dist/ssr/next-config.js"
|
|
59
|
+
},
|
|
55
60
|
"./ssr/astro": {
|
|
56
61
|
"types": "./dist/ssr/astro.d.ts",
|
|
57
62
|
"import": "./dist/ssr/astro.js",
|
|
58
63
|
"default": "./dist/ssr/astro.js"
|
|
59
64
|
},
|
|
65
|
+
"./ssr/client": {
|
|
66
|
+
"types": "./dist/ssr/client.d.ts",
|
|
67
|
+
"import": "./dist/ssr/client.js",
|
|
68
|
+
"default": "./dist/ssr/client.js"
|
|
69
|
+
},
|
|
60
70
|
"./ssr/astro-client": {
|
|
61
71
|
"types": "./dist/ssr/astro-client.d.ts",
|
|
62
72
|
"import": "./dist/ssr/astro-client.js",
|
|
63
73
|
"default": "./dist/ssr/astro-client.js"
|
|
64
74
|
},
|
|
75
|
+
"./ssr/astro-middleware": {
|
|
76
|
+
"types": "./dist/ssr/astro-middleware.d.ts",
|
|
77
|
+
"import": "./dist/ssr/astro-middleware.js",
|
|
78
|
+
"default": "./dist/ssr/astro-middleware.js"
|
|
79
|
+
},
|
|
80
|
+
"./ssr/astro-middleware-static": {
|
|
81
|
+
"types": "./dist/ssr/astro-middleware-static.d.ts",
|
|
82
|
+
"import": "./dist/ssr/astro-middleware-static.js",
|
|
83
|
+
"default": "./dist/ssr/astro-middleware-static.js"
|
|
84
|
+
},
|
|
85
|
+
"./ssr/astro-middleware-extract": {
|
|
86
|
+
"types": "./dist/ssr/astro-middleware-extract.d.ts",
|
|
87
|
+
"import": "./dist/ssr/astro-middleware-extract.js",
|
|
88
|
+
"default": "./dist/ssr/astro-middleware-extract.js"
|
|
89
|
+
},
|
|
90
|
+
"./ssr/astro-middleware-extract-static": {
|
|
91
|
+
"types": "./dist/ssr/astro-middleware-extract-static.d.ts",
|
|
92
|
+
"import": "./dist/ssr/astro-middleware-extract-static.js",
|
|
93
|
+
"default": "./dist/ssr/astro-middleware-extract-static.js"
|
|
94
|
+
},
|
|
65
95
|
"./tasty.config": "./tasty.config.ts"
|
|
66
96
|
},
|
|
67
97
|
"files": [
|
|
68
98
|
"dist",
|
|
69
99
|
"docs",
|
|
100
|
+
"harness",
|
|
70
101
|
"tasty.config.ts"
|
|
71
102
|
],
|
|
72
103
|
"sideEffects": [
|
|
73
104
|
"./dist/ssr/index.js",
|
|
74
105
|
"./dist/ssr/next.js",
|
|
75
106
|
"./dist/ssr/astro.js",
|
|
76
|
-
"./dist/ssr/astro-client.js"
|
|
107
|
+
"./dist/ssr/astro-client.js",
|
|
108
|
+
"./dist/ssr/astro-middleware.js",
|
|
109
|
+
"./dist/ssr/astro-middleware-static.js",
|
|
110
|
+
"./dist/ssr/astro-middleware-extract.js",
|
|
111
|
+
"./dist/ssr/astro-middleware-extract-static.js"
|
|
77
112
|
],
|
|
78
113
|
"engines": {
|
|
79
114
|
"node": ">=20"
|
|
@@ -81,19 +116,34 @@
|
|
|
81
116
|
"scripts": {
|
|
82
117
|
"build": "tsdown",
|
|
83
118
|
"test": "vitest run",
|
|
119
|
+
"test:node": "vitest run --project node",
|
|
120
|
+
"test:browser": "vitest run --project browser",
|
|
121
|
+
"test:setup": "playwright install chromium",
|
|
84
122
|
"test:watch": "vitest",
|
|
85
123
|
"test:coverage": "vitest run --coverage",
|
|
86
124
|
"typecheck": "tsc --noEmit",
|
|
87
|
-
"lint": "eslint src",
|
|
88
|
-
"lint:fix": "eslint src --fix",
|
|
89
|
-
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
90
|
-
"format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
|
|
125
|
+
"lint": "eslint src harness",
|
|
126
|
+
"lint:fix": "eslint src harness --fix",
|
|
127
|
+
"format": "prettier --write \"src/**/*.{ts,tsx}\" \"harness/**/*.mjs\"",
|
|
128
|
+
"format:check": "prettier --check \"src/**/*.{ts,tsx}\" \"harness/**/*.mjs\"",
|
|
91
129
|
"size": "size-limit",
|
|
92
|
-
"bench": "vitest bench",
|
|
130
|
+
"bench": "vitest bench --project \"node (bench)\"",
|
|
131
|
+
"bench:browser": "vitest bench --project \"browser (chromium) (bench)\"",
|
|
132
|
+
"bench:overhead": "vitest bench --config vitest.production-browser-bench.config.ts src/tasty-overhead.bench.tsx",
|
|
133
|
+
"bench:injection": "vitest bench --config vitest.production-browser-bench.config.ts src/tasty-injection.bench.ts",
|
|
134
|
+
"bench:interaction": "vitest bench --config vitest.production-browser-bench.config.ts src/tasty-interaction.bench.tsx",
|
|
135
|
+
"bench:tree": "vitest bench --config vitest.production-browser-bench.config.ts src/tasty-tree.bench.tsx",
|
|
136
|
+
"bench:cold-start": "node scripts/cold-start/index.mjs",
|
|
93
137
|
"prepublishOnly": "pnpm run build",
|
|
94
138
|
"changeset": "changeset",
|
|
95
139
|
"version": "changeset version",
|
|
96
140
|
"release": "changeset publish",
|
|
141
|
+
"knip": "knip",
|
|
142
|
+
"check:harness": "harnesspm check",
|
|
143
|
+
"check:build": "node scripts/check-built-entries.mjs",
|
|
144
|
+
"check:react-compat": "node scripts/check-react-compat.mjs",
|
|
145
|
+
"check:babel-compat": "node scripts/check-babel-compat.mjs",
|
|
146
|
+
"check:test-only": "node scripts/check-test-only-code.mjs",
|
|
97
147
|
"hygiene": "pnpm lint && pnpm format:check && pnpm typecheck",
|
|
98
148
|
"hygiene:fix": "pnpm lint:fix && pnpm format && pnpm typecheck"
|
|
99
149
|
},
|
|
@@ -119,10 +169,11 @@
|
|
|
119
169
|
},
|
|
120
170
|
"homepage": "https://github.com/tenphi/tasty#readme",
|
|
121
171
|
"peerDependencies": {
|
|
122
|
-
"@babel/core": "^7.24.0",
|
|
123
|
-
"@babel/helper-plugin-utils": "^7.24.0",
|
|
124
|
-
"@babel/types": "^7.24.0",
|
|
172
|
+
"@babel/core": "^7.24.0 || ^8.0.0",
|
|
173
|
+
"@babel/helper-plugin-utils": "^7.24.0 || ^8.0.0",
|
|
174
|
+
"@babel/types": "^7.24.0 || ^8.0.0",
|
|
125
175
|
"jiti": "^2.6.1",
|
|
176
|
+
"next": ">=14.0.0",
|
|
126
177
|
"react": "^18.0.0 || ^19.0.0"
|
|
127
178
|
},
|
|
128
179
|
"peerDependenciesMeta": {
|
|
@@ -140,61 +191,92 @@
|
|
|
140
191
|
},
|
|
141
192
|
"jiti": {
|
|
142
193
|
"optional": true
|
|
194
|
+
},
|
|
195
|
+
"next": {
|
|
196
|
+
"optional": true
|
|
143
197
|
}
|
|
144
198
|
},
|
|
145
199
|
"dependencies": {
|
|
146
200
|
"csstype": "^3.1.0"
|
|
147
201
|
},
|
|
148
202
|
"devDependencies": {
|
|
149
|
-
"@
|
|
150
|
-
"@
|
|
151
|
-
"@
|
|
203
|
+
"@astrojs/react": "^7.0.1",
|
|
204
|
+
"@babel/core": "^8.0.6",
|
|
205
|
+
"@babel/helper-plugin-utils": "^8.0.1",
|
|
206
|
+
"@babel/types": "^8.0.6",
|
|
207
|
+
"@changesets/changelog-github": "^1.0.1",
|
|
208
|
+
"@changesets/cli": "^3.0.3",
|
|
152
209
|
"@eslint/js": "^10.0.1",
|
|
153
|
-
"@size-limit/esbuild": "^
|
|
154
|
-
"@size-limit/file": "^
|
|
155
|
-
"@
|
|
156
|
-
"@
|
|
157
|
-
"@
|
|
158
|
-
"@
|
|
159
|
-
"@types/node": "^
|
|
160
|
-
"@types/react": "^19.
|
|
161
|
-
"@
|
|
162
|
-
"
|
|
210
|
+
"@size-limit/esbuild": "^14.1.0",
|
|
211
|
+
"@size-limit/file": "^14.1.0",
|
|
212
|
+
"@tenphi/eslint-plugin-tasty": "^1.21.1",
|
|
213
|
+
"@tenphi/harnesspm": "^0.13.2",
|
|
214
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
215
|
+
"@testing-library/react": "^16.3.3",
|
|
216
|
+
"@types/node": "^24.19.1",
|
|
217
|
+
"@types/react": "^19.3.0",
|
|
218
|
+
"@types/react-dom": "^19.3.0",
|
|
219
|
+
"@vitest/browser-playwright": "^5.0.3",
|
|
220
|
+
"astro": "^7.3.6",
|
|
221
|
+
"esbuild": "^0.28.2",
|
|
222
|
+
"eslint": "^10.12.0",
|
|
163
223
|
"eslint-config-prettier": "^10.1.8",
|
|
164
|
-
"
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
224
|
+
"jiti": "^2.7.0",
|
|
225
|
+
"knip": "^6.40.0",
|
|
226
|
+
"next": "^16.4.0",
|
|
227
|
+
"playwright": "^1.63.0",
|
|
228
|
+
"prettier": "^3.9.9",
|
|
229
|
+
"react": "^19.3.0",
|
|
230
|
+
"react-dom": "^19.3.0",
|
|
231
|
+
"size-limit": "^14.1.0",
|
|
232
|
+
"tsdown": "^0.23.0",
|
|
233
|
+
"typescript": "^6.0.3",
|
|
234
|
+
"typescript-eslint": "^8.71.1",
|
|
235
|
+
"vitest": "^5.0.3"
|
|
173
236
|
},
|
|
174
|
-
"
|
|
175
|
-
"onlyBuiltDependencies": [
|
|
176
|
-
"esbuild"
|
|
177
|
-
]
|
|
178
|
-
},
|
|
179
|
-
"packageManager": "pnpm@10.32.1",
|
|
237
|
+
"packageManager": "pnpm@11.27.1",
|
|
180
238
|
"size-limit": [
|
|
181
239
|
{
|
|
182
240
|
"name": "main (import *)",
|
|
183
241
|
"path": "dist/index.js",
|
|
184
242
|
"import": "*",
|
|
185
|
-
"limit": "
|
|
243
|
+
"limit": "62.08 kB"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"name": "main (tasty)",
|
|
247
|
+
"path": "dist/index.js",
|
|
248
|
+
"import": "{ tasty }",
|
|
249
|
+
"limit": "54.99 kB"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"name": "main (StyleParser)",
|
|
253
|
+
"path": "dist/index.js",
|
|
254
|
+
"import": "{ StyleParser }",
|
|
255
|
+
"limit": "8 kB"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"name": "main (parseColor)",
|
|
259
|
+
"path": "dist/index.js",
|
|
260
|
+
"import": "{ parseColor }",
|
|
261
|
+
"limit": "8.67 kB"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"name": "main (useRawCSS)",
|
|
265
|
+
"path": "dist/index.js",
|
|
266
|
+
"import": "{ useRawCSS }",
|
|
267
|
+
"limit": "33.63 kB"
|
|
186
268
|
},
|
|
187
269
|
{
|
|
188
270
|
"name": "core (import *)",
|
|
189
271
|
"path": "dist/core/index.js",
|
|
190
272
|
"import": "*",
|
|
191
|
-
"limit": "
|
|
273
|
+
"limit": "57.38 kB"
|
|
192
274
|
},
|
|
193
275
|
{
|
|
194
276
|
"name": "static",
|
|
195
277
|
"path": "dist/static/index.js",
|
|
196
278
|
"import": "*",
|
|
197
|
-
"limit": "
|
|
279
|
+
"limit": "1.08 kB"
|
|
198
280
|
},
|
|
199
281
|
{
|
|
200
282
|
"name": "zero",
|
|
@@ -205,7 +287,7 @@
|
|
|
205
287
|
"path",
|
|
206
288
|
"crypto"
|
|
207
289
|
],
|
|
208
|
-
"limit": "
|
|
290
|
+
"limit": "41.3 kB"
|
|
209
291
|
},
|
|
210
292
|
{
|
|
211
293
|
"name": "babel-plugin",
|
|
@@ -214,9 +296,35 @@
|
|
|
214
296
|
"ignore": [
|
|
215
297
|
"fs",
|
|
216
298
|
"path",
|
|
217
|
-
"crypto"
|
|
299
|
+
"crypto",
|
|
300
|
+
"node:module",
|
|
301
|
+
"node:path"
|
|
302
|
+
],
|
|
303
|
+
"limit": "45.95 kB"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"name": "astro client",
|
|
307
|
+
"path": "dist/ssr/astro-client.js",
|
|
308
|
+
"import": "*",
|
|
309
|
+
"limit": "0.5 kB"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"name": "ssr client",
|
|
313
|
+
"path": "dist/ssr/client.js",
|
|
314
|
+
"import": "{ hydrateTastyClasses }",
|
|
315
|
+
"limit": "0.5 kB"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"name": "Next.js config",
|
|
319
|
+
"path": "dist/ssr/next-config.js",
|
|
320
|
+
"import": "{ withTastyNext }",
|
|
321
|
+
"ignore": [
|
|
322
|
+
"node:crypto",
|
|
323
|
+
"node:fs",
|
|
324
|
+
"node:module",
|
|
325
|
+
"node:path"
|
|
218
326
|
],
|
|
219
|
-
"limit": "
|
|
327
|
+
"limit": "41.48 kB"
|
|
220
328
|
}
|
|
221
329
|
]
|
|
222
330
|
}
|
package/tasty.config.ts
CHANGED
|
@@ -3,6 +3,7 @@ export default {
|
|
|
3
3
|
'#white',
|
|
4
4
|
'#black',
|
|
5
5
|
'#current',
|
|
6
|
+
'#clear',
|
|
6
7
|
'$gap',
|
|
7
8
|
'$radius',
|
|
8
9
|
'$border-width',
|
|
@@ -10,5 +11,11 @@ export default {
|
|
|
10
11
|
'$transition',
|
|
11
12
|
'$sharp-radius',
|
|
12
13
|
'$bold-font-weight',
|
|
14
|
+
'$icon-size',
|
|
13
15
|
],
|
|
16
|
+
styles: ['viewTransitionName'],
|
|
17
|
+
// This repo imports its own API relatively, so the plugin's default
|
|
18
|
+
// `@tenphi/tasty` import tracking never matches. List the local entry points so
|
|
19
|
+
// `tasty({ styles })` call sites are actually linted.
|
|
20
|
+
importSources: ['@tenphi/tasty', './tasty', '../tasty', './src/tasty'],
|
|
14
21
|
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
-
//#region src/ssr/async-storage.ts
|
|
3
|
-
/**
|
|
4
|
-
* AsyncLocalStorage integration for SSR collector discovery.
|
|
5
|
-
*
|
|
6
|
-
* Used by Astro middleware and generic framework integrations where
|
|
7
|
-
* the library cannot wrap the React tree with a context provider.
|
|
8
|
-
* The middleware calls runWithCollector() around the render, and
|
|
9
|
-
* useStyles() calls getSSRCollector() to find it.
|
|
10
|
-
*
|
|
11
|
-
* Uses globalThis to ensure the AsyncLocalStorage instance is shared
|
|
12
|
-
* across module instances — frameworks like Astro may load middleware
|
|
13
|
-
* and page components from separate module graphs.
|
|
14
|
-
*
|
|
15
|
-
* This module imports from 'node:async_hooks' — it must be excluded
|
|
16
|
-
* from client bundles via the build configuration.
|
|
17
|
-
*/
|
|
18
|
-
const ALS_KEY = "__tasty_ssr_als__";
|
|
19
|
-
function getSharedStorage() {
|
|
20
|
-
const g = globalThis;
|
|
21
|
-
if (!g[ALS_KEY]) g[ALS_KEY] = new AsyncLocalStorage();
|
|
22
|
-
return g[ALS_KEY];
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Run a function with a ServerStyleCollector bound to the current
|
|
26
|
-
* async context. All useStyles() calls within `fn` (and any async
|
|
27
|
-
* continuations) will find this collector via getSSRCollector().
|
|
28
|
-
*/
|
|
29
|
-
function runWithCollector(collector, fn) {
|
|
30
|
-
return getSharedStorage().run(collector, fn);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Retrieve the ServerStyleCollector bound to the current async context.
|
|
34
|
-
* Returns null when called outside of runWithCollector() or on the client.
|
|
35
|
-
*/
|
|
36
|
-
function getSSRCollector() {
|
|
37
|
-
const storage = getSharedStorage();
|
|
38
|
-
if (typeof storage?.getStore !== "function") return null;
|
|
39
|
-
return storage.getStore() ?? null;
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
export { runWithCollector as n, getSSRCollector as t };
|
|
43
|
-
|
|
44
|
-
//# sourceMappingURL=async-storage-B7_o6FKt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"async-storage-B7_o6FKt.js","names":[],"sources":["../src/ssr/async-storage.ts"],"sourcesContent":["/**\n * AsyncLocalStorage integration for SSR collector discovery.\n *\n * Used by Astro middleware and generic framework integrations where\n * the library cannot wrap the React tree with a context provider.\n * The middleware calls runWithCollector() around the render, and\n * useStyles() calls getSSRCollector() to find it.\n *\n * Uses globalThis to ensure the AsyncLocalStorage instance is shared\n * across module instances — frameworks like Astro may load middleware\n * and page components from separate module graphs.\n *\n * This module imports from 'node:async_hooks' — it must be excluded\n * from client bundles via the build configuration.\n */\n\nimport { AsyncLocalStorage } from 'node:async_hooks';\n\nimport type { ServerStyleCollector } from './collector';\n\nconst ALS_KEY = '__tasty_ssr_als__';\n\nfunction getSharedStorage(): AsyncLocalStorage<ServerStyleCollector> {\n const g = globalThis as Record<string, unknown>;\n if (!g[ALS_KEY]) {\n g[ALS_KEY] = new AsyncLocalStorage<ServerStyleCollector>();\n }\n return g[ALS_KEY] as AsyncLocalStorage<ServerStyleCollector>;\n}\n\n/**\n * Run a function with a ServerStyleCollector bound to the current\n * async context. All useStyles() calls within `fn` (and any async\n * continuations) will find this collector via getSSRCollector().\n */\nexport function runWithCollector<T>(\n collector: ServerStyleCollector,\n fn: () => T,\n): T {\n return getSharedStorage().run(collector, fn);\n}\n\n/**\n * Retrieve the ServerStyleCollector bound to the current async context.\n * Returns null when called outside of runWithCollector() or on the client.\n */\nexport function getSSRCollector(): ServerStyleCollector | null {\n const storage = getSharedStorage();\n if (typeof storage?.getStore !== 'function') return null;\n return storage.getStore() ?? null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoBA,MAAM,UAAU;AAEhB,SAAS,mBAA4D;CACnE,MAAM,IAAI;AACV,KAAI,CAAC,EAAE,SACL,GAAE,WAAW,IAAI,mBAAyC;AAE5D,QAAO,EAAE;;;;;;;AAQX,SAAgB,iBACd,WACA,IACG;AACH,QAAO,kBAAkB,CAAC,IAAI,WAAW,GAAG;;;;;;AAO9C,SAAgB,kBAA+C;CAC7D,MAAM,UAAU,kBAAkB;AAClC,KAAI,OAAO,SAAS,aAAa,WAAY,QAAO;AACpD,QAAO,QAAQ,UAAU,IAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collector-DrgDE7QB.js","names":[],"sources":["../src/ssr/collector.ts"],"sourcesContent":["/**\n * ServerStyleCollector — server-safe style collector for SSR.\n *\n * Accumulates CSS rules and cache metadata during server rendering.\n * This is the server-side counterpart to StyleInjector: it allocates\n * hash-based class names (`t${hash}`), formats CSS rules into text,\n * and tracks rendered class names for lightweight client transfer.\n *\n * One instance is created per HTTP request. Concurrent requests\n * each get their own collector (via AsyncLocalStorage or React context).\n */\n\nimport {\n getEffectiveProperties,\n getGlobalStyles,\n getGlobalCounterStyle,\n getGlobalFontFace,\n getGlobalConfigTokens,\n} from '../config';\nimport { formatCounterStyleRule } from '../counter-style';\nimport { fontFaceContentHash, formatFontFaceRule } from '../font-face';\nimport { renderStyles } from '../pipeline';\nimport type { StyleResult } from '../pipeline';\nimport { hashString } from '../utils/hash';\nimport { formatPropertyCSS } from './format-property';\nimport { formatGlobalRules } from './format-global-rules';\nimport { formatRules } from './format-rules';\n\nfunction generateClassName(cacheKey: string): string {\n return `t${hashString(cacheKey)}`;\n}\n\nexport class ServerStyleCollector {\n private chunks = new Map<string, string>();\n private cacheKeyToClassName = new Map<string, string>();\n private flushedKeys = new Set<string>();\n private propertyRules = new Map<string, string>();\n private flushedPropertyKeys = new Set<string>();\n private keyframeRules = new Map<string, string>();\n private flushedKeyframeKeys = new Set<string>();\n private globalStyles = new Map<string, string>();\n private flushedGlobalKeys = new Set<string>();\n private rawCSS = new Map<string, string>();\n private flushedRawKeys = new Set<string>();\n private fontFaceRules = new Map<string, string>();\n private flushedFontFaceKeys = new Set<string>();\n private counterStyleRules = new Map<string, string>();\n private flushedCounterStyleKeys = new Set<string>();\n private keyframesCounter = 0;\n private counterStyleCounter = 0;\n private internalsCollected = false;\n\n /**\n * Collect internal @property rules and :root token defaults.\n * Mirrors markStylesGenerated() from the client-side injector.\n * Called automatically on first chunk collection; idempotent.\n *\n * Internals are always emitted here — the RSC path deliberately\n * defers to SSR so that tokens appear exactly once per page in\n * <style data-tasty-ssr> (avoiding duplication of large token sets).\n */\n collectInternals(): void {\n if (this.internalsCollected) return;\n this.internalsCollected = true;\n\n for (const [token, definition] of Object.entries(\n getEffectiveProperties(),\n )) {\n const css = formatPropertyCSS(token, definition);\n if (css) {\n this.collectProperty(`__prop:${token}`, css);\n }\n }\n\n const tokenStyles = getGlobalConfigTokens();\n if (tokenStyles && Object.keys(tokenStyles).length > 0) {\n const tokenRules = renderStyles(tokenStyles, ':root') as StyleResult[];\n if (tokenRules.length > 0) {\n const css = formatGlobalRules(tokenRules);\n if (css) {\n this.collectGlobalStyles('__global:tokens', css);\n }\n }\n }\n\n const globalFF = getGlobalFontFace();\n if (globalFF) {\n for (const [family, input] of Object.entries(globalFF)) {\n const descriptors = Array.isArray(input) ? input : [input];\n for (const desc of descriptors) {\n const hash = fontFaceContentHash(family, desc);\n const css = formatFontFaceRule(family, desc);\n this.collectFontFace(hash, css);\n }\n }\n }\n\n const globalCS = getGlobalCounterStyle();\n if (globalCS) {\n for (const [name, descriptors] of Object.entries(globalCS)) {\n const css = formatCounterStyleRule(name, descriptors);\n this.collectCounterStyle(name, css);\n }\n }\n\n const globalStyles = getGlobalStyles();\n if (globalStyles) {\n for (const [selector, styles] of Object.entries(globalStyles)) {\n if (Object.keys(styles).length > 0) {\n const rules = renderStyles(styles, selector) as StyleResult[];\n if (rules.length > 0) {\n const css = formatGlobalRules(rules);\n if (css) {\n this.collectGlobalStyles(`__global:styles:${selector}`, css);\n }\n }\n }\n }\n }\n }\n\n /**\n * Allocate a className for a cache key, server-side.\n * Mirrors StyleInjector.allocateClassName but without DOM access.\n */\n allocateClassName(cacheKey: string): {\n className: string;\n isNewAllocation: boolean;\n } {\n const existing = this.cacheKeyToClassName.get(cacheKey);\n if (existing) {\n return { className: existing, isNewAllocation: false };\n }\n\n const className = generateClassName(cacheKey);\n this.cacheKeyToClassName.set(cacheKey, className);\n\n return { className, isNewAllocation: true };\n }\n\n /**\n * Record CSS rules for a chunk.\n * Called by useStyles during server render.\n */\n collectChunk(\n cacheKey: string,\n className: string,\n rules: StyleResult[],\n ): void {\n if (this.chunks.has(cacheKey)) return;\n const css = formatRules(rules, className);\n if (css) {\n this.chunks.set(cacheKey, css);\n }\n }\n\n /**\n * Record a @property rule. Deduplicated by name.\n */\n collectProperty(name: string, css: string): void {\n if (!this.propertyRules.has(name)) {\n this.propertyRules.set(name, css);\n }\n }\n\n /**\n * Record a @keyframes rule. Deduplicated by name.\n */\n collectKeyframes(name: string, css: string): void {\n if (!this.keyframeRules.has(name)) {\n this.keyframeRules.set(name, css);\n }\n }\n\n /**\n * Allocate a keyframe name for SSR. Uses provided name or generates one.\n */\n allocateKeyframeName(providedName?: string): string {\n return providedName ?? `k${this.keyframesCounter++}`;\n }\n\n /**\n * Record a @font-face rule. Deduplicated by key (content hash).\n */\n collectFontFace(key: string, css: string): void {\n if (!this.fontFaceRules.has(key)) {\n this.fontFaceRules.set(key, css);\n }\n }\n\n /**\n * Record a @counter-style rule. Deduplicated by name.\n */\n collectCounterStyle(name: string, css: string): void {\n if (!this.counterStyleRules.has(name)) {\n this.counterStyleRules.set(name, css);\n }\n }\n\n /**\n * Allocate a counter-style name for SSR. Uses provided name or generates one.\n */\n allocateCounterStyleName(providedName?: string): string {\n return providedName ?? `cs${this.counterStyleCounter++}`;\n }\n\n /**\n * Record global styles (from useGlobalStyles). Deduplicated by key.\n */\n collectGlobalStyles(key: string, css: string): void {\n if (!this.globalStyles.has(key)) {\n this.globalStyles.set(key, css);\n }\n }\n\n /**\n * Record raw CSS text (from useRawCSS). Deduplicated by key.\n */\n collectRawCSS(key: string, css: string): void {\n if (!this.rawCSS.has(key)) {\n this.rawCSS.set(key, css);\n }\n }\n\n /**\n * Extract all CSS collected so far as a single string.\n * Includes @property and @keyframes rules.\n * Used for non-streaming SSR (renderToString).\n */\n getCSS(): string {\n const parts: string[] = [];\n\n for (const css of this.propertyRules.values()) {\n parts.push(css);\n }\n\n for (const css of this.fontFaceRules.values()) {\n parts.push(css);\n }\n\n for (const css of this.counterStyleRules.values()) {\n parts.push(css);\n }\n\n for (const css of this.rawCSS.values()) {\n parts.push(css);\n }\n\n for (const css of this.globalStyles.values()) {\n parts.push(css);\n }\n\n for (const css of this.chunks.values()) {\n parts.push(css);\n }\n\n for (const css of this.keyframeRules.values()) {\n parts.push(css);\n }\n\n return parts.join('\\n');\n }\n\n /**\n * Flush only newly collected CSS since the last flush.\n * Used for streaming SSR (renderToPipeableStream + useServerInsertedHTML).\n */\n flushCSS(): string {\n const parts: string[] = [];\n\n for (const [name, css] of this.propertyRules) {\n if (!this.flushedPropertyKeys.has(name)) {\n parts.push(css);\n this.flushedPropertyKeys.add(name);\n }\n }\n\n for (const [key, css] of this.fontFaceRules) {\n if (!this.flushedFontFaceKeys.has(key)) {\n parts.push(css);\n this.flushedFontFaceKeys.add(key);\n }\n }\n\n for (const [key, css] of this.counterStyleRules) {\n if (!this.flushedCounterStyleKeys.has(key)) {\n parts.push(css);\n this.flushedCounterStyleKeys.add(key);\n }\n }\n\n for (const [key, css] of this.rawCSS) {\n if (!this.flushedRawKeys.has(key)) {\n parts.push(css);\n this.flushedRawKeys.add(key);\n }\n }\n\n for (const [key, css] of this.globalStyles) {\n if (!this.flushedGlobalKeys.has(key)) {\n parts.push(css);\n this.flushedGlobalKeys.add(key);\n }\n }\n\n for (const [key, css] of this.chunks) {\n if (!this.flushedKeys.has(key)) {\n parts.push(css);\n this.flushedKeys.add(key);\n }\n }\n\n for (const [name, css] of this.keyframeRules) {\n if (!this.flushedKeyframeKeys.has(name)) {\n parts.push(css);\n this.flushedKeyframeKeys.add(name);\n }\n }\n\n return parts.join('\\n');\n }\n\n private flushedClassNames = new Set<string>();\n\n /**\n * Return class names rendered since the last call (for streaming).\n * Used to emit lightweight class-list scripts for client hydration.\n */\n getRenderedClassNames(): string[] {\n const names: string[] = [];\n for (const className of this.cacheKeyToClassName.values()) {\n if (!this.flushedClass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KAAK,kBAAkB,IAAI,UAAU,EAAE;AAC1C,QAAK,kBAAkB,IAAI,UAAU;AACrC,SAAM,KAAK,UAAU;;AAGzB,SAAO"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { n as StyleResult } from "./index-dUtwpOux.js";
|
|
2
|
-
|
|
3
|
-
//#region src/ssr/collector.d.ts
|
|
4
|
-
declare class ServerStyleCollector {
|
|
5
|
-
private chunks;
|
|
6
|
-
private cacheKeyToClassName;
|
|
7
|
-
private flushedKeys;
|
|
8
|
-
private propertyRules;
|
|
9
|
-
private flushedPropertyKeys;
|
|
10
|
-
private keyframeRules;
|
|
11
|
-
private flushedKeyframeKeys;
|
|
12
|
-
private globalStyles;
|
|
13
|
-
private flushedGlobalKeys;
|
|
14
|
-
private rawCSS;
|
|
15
|
-
private flushedRawKeys;
|
|
16
|
-
private fontFaceRules;
|
|
17
|
-
private flushedFontFaceKeys;
|
|
18
|
-
private counterStyleRules;
|
|
19
|
-
private flushedCounterStyleKeys;
|
|
20
|
-
private keyframesCounter;
|
|
21
|
-
private counterStyleCounter;
|
|
22
|
-
private internalsCollected;
|
|
23
|
-
/**
|
|
24
|
-
* Collect internal @property rules and :root token defaults.
|
|
25
|
-
* Mirrors markStylesGenerated() from the client-side injector.
|
|
26
|
-
* Called automatically on first chunk collection; idempotent.
|
|
27
|
-
*
|
|
28
|
-
* Internals are always emitted here — the RSC path deliberately
|
|
29
|
-
* defers to SSR so that tokens appear exactly once per page in
|
|
30
|
-
* <style data-tasty-ssr> (avoiding duplication of large token sets).
|
|
31
|
-
*/
|
|
32
|
-
collectInternals(): void;
|
|
33
|
-
/**
|
|
34
|
-
* Allocate a className for a cache key, server-side.
|
|
35
|
-
* Mirrors StyleInjector.allocateClassName but without DOM access.
|
|
36
|
-
*/
|
|
37
|
-
allocateClassName(cacheKey: string): {
|
|
38
|
-
className: string;
|
|
39
|
-
isNewAllocation: boolean;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Record CSS rules for a chunk.
|
|
43
|
-
* Called by useStyles during server render.
|
|
44
|
-
*/
|
|
45
|
-
collectChunk(cacheKey: string, className: string, rules: StyleResult[]): void;
|
|
46
|
-
/**
|
|
47
|
-
* Record a @property rule. Deduplicated by name.
|
|
48
|
-
*/
|
|
49
|
-
collectProperty(name: string, css: string): void;
|
|
50
|
-
/**
|
|
51
|
-
* Record a @keyframes rule. Deduplicated by name.
|
|
52
|
-
*/
|
|
53
|
-
collectKeyframes(name: string, css: string): void;
|
|
54
|
-
/**
|
|
55
|
-
* Allocate a keyframe name for SSR. Uses provided name or generates one.
|
|
56
|
-
*/
|
|
57
|
-
allocateKeyframeName(providedName?: string): string;
|
|
58
|
-
/**
|
|
59
|
-
* Record a @font-face rule. Deduplicated by key (content hash).
|
|
60
|
-
*/
|
|
61
|
-
collectFontFace(key: string, css: string): void;
|
|
62
|
-
/**
|
|
63
|
-
* Record a @counter-style rule. Deduplicated by name.
|
|
64
|
-
*/
|
|
65
|
-
collectCounterStyle(name: string, css: string): void;
|
|
66
|
-
/**
|
|
67
|
-
* Allocate a counter-style name for SSR. Uses provided name or generates one.
|
|
68
|
-
*/
|
|
69
|
-
allocateCounterStyleName(providedName?: string): string;
|
|
70
|
-
/**
|
|
71
|
-
* Record global styles (from useGlobalStyles). Deduplicated by key.
|
|
72
|
-
*/
|
|
73
|
-
collectGlobalStyles(key: string, css: string): void;
|
|
74
|
-
/**
|
|
75
|
-
* Record raw CSS text (from useRawCSS). Deduplicated by key.
|
|
76
|
-
*/
|
|
77
|
-
collectRawCSS(key: string, css: string): void;
|
|
78
|
-
/**
|
|
79
|
-
* Extract all CSS collected so far as a single string.
|
|
80
|
-
* Includes @property and @keyframes rules.
|
|
81
|
-
* Used for non-streaming SSR (renderToString).
|
|
82
|
-
*/
|
|
83
|
-
getCSS(): string;
|
|
84
|
-
/**
|
|
85
|
-
* Flush only newly collected CSS since the last flush.
|
|
86
|
-
* Used for streaming SSR (renderToPipeableStream + useServerInsertedHTML).
|
|
87
|
-
*/
|
|
88
|
-
flushCSS(): string;
|
|
89
|
-
private flushedClassNames;
|
|
90
|
-
/**
|
|
91
|
-
* Return class names rendered since the last call (for streaming).
|
|
92
|
-
* Used to emit lightweight class-list scripts for client hydration.
|
|
93
|
-
*/
|
|
94
|
-
getRenderedClassNames(): string[];
|
|
95
|
-
}
|
|
96
|
-
//#endregion
|
|
97
|
-
export { ServerStyleCollector as t };
|
|
98
|
-
//# sourceMappingURL=collector-LuU1vZ68.d.ts.map
|