@tenphi/tasty 0.0.0-snapshot.f6f4ef7 → 0.0.0-snapshot.f8d65c2
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 +196 -140
- package/dist/{ssr/async-storage.js → async-storage-DKK-wTD4.js} +17 -8
- package/dist/async-storage-DKK-wTD4.js.map +1 -0
- package/dist/babel-CRNENCeS.d.ts +83 -0
- package/dist/collector-0YO-P1vW.d.ts +145 -0
- package/dist/{ssr/collector.js → collector-C6CzXyp6.js} +124 -47
- package/dist/collector-C6CzXyp6.js.map +1 -0
- package/dist/config-CE_Y8Z8_.js +12363 -0
- package/dist/config-CE_Y8Z8_.js.map +1 -0
- package/dist/config-CG9Aa2SQ.d.ts +1328 -0
- package/dist/context-CA8YKeMn.js +24 -0
- package/dist/context-CA8YKeMn.js.map +1 -0
- package/dist/core/index.d.ts +5 -34
- package/dist/core/index.js +6 -27
- package/dist/core-DGijQRzL.js +1628 -0
- package/dist/core-DGijQRzL.js.map +1 -0
- package/dist/{zero/extractor.js → css-writer-WkeVxwW6.js} +149 -26
- package/dist/css-writer-WkeVxwW6.js.map +1 -0
- package/dist/{ssr/format-global-rules.js → format-global-rules-DklyaXv-.js} +3 -3
- package/dist/format-global-rules-DklyaXv-.js.map +1 -0
- package/dist/{ssr/format-rules.js → format-rules-CkM_6e2u.js} +60 -3
- package/dist/format-rules-CkM_6e2u.js.map +1 -0
- package/dist/hydrate-C8NL-JAC.js +37 -0
- package/dist/hydrate-C8NL-JAC.js.map +1 -0
- package/dist/index-BmogEzTo.d.ts +1575 -0
- package/dist/index-DTIDwdUV.d.ts +1933 -0
- package/dist/index.d.ts +5 -51
- package/dist/index.js +921 -35
- package/dist/index.js.map +1 -0
- package/dist/keyframes-DFt5ewaz.js +535 -0
- package/dist/keyframes-DFt5ewaz.js.map +1 -0
- package/dist/{utils/merge-styles.d.ts → merge-styles-BcLl1u_d.d.ts} +3 -3
- package/dist/{utils/merge-styles.js → merge-styles-DGKWAJ4H.js} +4 -6
- package/dist/merge-styles-DGKWAJ4H.js.map +1 -0
- package/dist/{utils/resolve-recipes.js → resolve-recipes-UQ2um5Au.js} +5 -8
- package/dist/resolve-recipes-UQ2um5Au.js.map +1 -0
- package/dist/ssr/astro-client.d.ts +1 -0
- package/dist/ssr/astro-client.js +19 -0
- package/dist/ssr/astro-client.js.map +1 -0
- package/dist/ssr/astro-middleware-static.d.ts +16 -0
- package/dist/ssr/astro-middleware-static.js +18 -0
- package/dist/ssr/astro-middleware-static.js.map +1 -0
- package/dist/ssr/astro-middleware.d.ts +17 -0
- package/dist/ssr/astro-middleware.js +19 -0
- package/dist/ssr/astro-middleware.js.map +1 -0
- package/dist/ssr/astro.d.ts +74 -10
- package/dist/ssr/astro.js +124 -32
- package/dist/ssr/astro.js.map +1 -1
- package/dist/ssr/index.d.ts +37 -5
- package/dist/ssr/index.js +7 -9
- package/dist/ssr/index.js.map +1 -1
- package/dist/ssr/next.d.ts +6 -6
- package/dist/ssr/next.js +19 -16
- package/dist/ssr/next.js.map +1 -1
- package/dist/static/index.d.ts +91 -5
- package/dist/static/index.js +49 -4
- package/dist/static/index.js.map +1 -0
- package/dist/static/inject.d.ts +5 -0
- package/dist/static/inject.js +17 -0
- package/dist/static/inject.js.map +1 -0
- package/dist/zero/babel.d.ts +2 -167
- package/dist/zero/babel.js +161 -57
- package/dist/zero/babel.js.map +1 -1
- package/dist/zero/index.d.ts +81 -3
- package/dist/zero/index.js +2 -4
- package/dist/zero/next.d.ts +13 -1
- package/dist/zero/next.js +6 -5
- package/dist/zero/next.js.map +1 -1
- package/docs/README.md +20 -12
- package/docs/adoption.md +59 -32
- package/docs/ai-agents.md +224 -0
- package/docs/comparison.md +76 -48
- package/docs/configuration.md +566 -69
- package/docs/debug.md +22 -18
- package/docs/design-system.md +63 -32
- package/docs/dsl.md +527 -179
- package/docs/getting-started.md +62 -41
- package/docs/injector.md +157 -51
- package/docs/methodology.md +116 -35
- package/docs/migration-v3.md +285 -0
- package/docs/pipeline.md +741 -0
- package/docs/plugins.md +353 -0
- package/docs/react-api.md +681 -0
- package/docs/runtime-benchmarks.md +178 -0
- package/docs/ssr.md +197 -130
- package/docs/styles.md +82 -16
- package/docs/tasty-static.md +219 -70
- package/package.json +59 -21
- package/tasty.config.ts +6 -0
- package/dist/_virtual/_rolldown/runtime.js +0 -8
- package/dist/chunks/cacheKey.js +0 -78
- package/dist/chunks/cacheKey.js.map +0 -1
- package/dist/chunks/definitions.d.ts +0 -37
- package/dist/chunks/definitions.js +0 -259
- package/dist/chunks/definitions.js.map +0 -1
- package/dist/chunks/renderChunk.js +0 -60
- package/dist/chunks/renderChunk.js.map +0 -1
- package/dist/config.d.ts +0 -366
- package/dist/config.js +0 -504
- package/dist/config.js.map +0 -1
- package/dist/counter-style/index.js +0 -51
- package/dist/counter-style/index.js.map +0 -1
- package/dist/debug.d.ts +0 -89
- package/dist/debug.js +0 -454
- package/dist/debug.js.map +0 -1
- package/dist/font-face/index.js +0 -63
- package/dist/font-face/index.js.map +0 -1
- package/dist/hooks/resolve-ssr-collector.js +0 -15
- package/dist/hooks/resolve-ssr-collector.js.map +0 -1
- package/dist/hooks/useCounterStyle.d.ts +0 -50
- package/dist/hooks/useCounterStyle.js +0 -47
- package/dist/hooks/useCounterStyle.js.map +0 -1
- package/dist/hooks/useFontFace.d.ts +0 -43
- package/dist/hooks/useFontFace.js +0 -71
- package/dist/hooks/useFontFace.js.map +0 -1
- package/dist/hooks/useGlobalStyles.d.ts +0 -30
- package/dist/hooks/useGlobalStyles.js +0 -79
- package/dist/hooks/useGlobalStyles.js.map +0 -1
- package/dist/hooks/useKeyframes.d.ts +0 -56
- package/dist/hooks/useKeyframes.js +0 -65
- package/dist/hooks/useKeyframes.js.map +0 -1
- package/dist/hooks/useProperty.d.ts +0 -79
- package/dist/hooks/useProperty.js +0 -110
- package/dist/hooks/useProperty.js.map +0 -1
- package/dist/hooks/useRawCSS.d.ts +0 -53
- package/dist/hooks/useRawCSS.js +0 -36
- package/dist/hooks/useRawCSS.js.map +0 -1
- package/dist/hooks/useStyles.d.ts +0 -45
- package/dist/hooks/useStyles.js +0 -238
- package/dist/hooks/useStyles.js.map +0 -1
- package/dist/injector/index.d.ts +0 -183
- package/dist/injector/index.js +0 -180
- package/dist/injector/index.js.map +0 -1
- package/dist/injector/injector.d.ts +0 -166
- package/dist/injector/injector.js +0 -465
- package/dist/injector/injector.js.map +0 -1
- package/dist/injector/sheet-manager.d.ts +0 -136
- package/dist/injector/sheet-manager.js +0 -734
- package/dist/injector/sheet-manager.js.map +0 -1
- package/dist/injector/types.d.ts +0 -204
- package/dist/keyframes/index.js +0 -206
- package/dist/keyframes/index.js.map +0 -1
- package/dist/parser/classify.js +0 -320
- package/dist/parser/classify.js.map +0 -1
- package/dist/parser/const.js +0 -49
- package/dist/parser/const.js.map +0 -1
- package/dist/parser/lru.js +0 -109
- package/dist/parser/lru.js.map +0 -1
- package/dist/parser/parser.d.ts +0 -25
- package/dist/parser/parser.js +0 -116
- package/dist/parser/parser.js.map +0 -1
- package/dist/parser/tokenizer.js +0 -69
- package/dist/parser/tokenizer.js.map +0 -1
- package/dist/parser/types.d.ts +0 -51
- package/dist/parser/types.js +0 -46
- package/dist/parser/types.js.map +0 -1
- package/dist/pipeline/conditions.d.ts +0 -134
- package/dist/pipeline/conditions.js +0 -406
- package/dist/pipeline/conditions.js.map +0 -1
- package/dist/pipeline/exclusive.js +0 -231
- package/dist/pipeline/exclusive.js.map +0 -1
- package/dist/pipeline/index.d.ts +0 -55
- package/dist/pipeline/index.js +0 -709
- package/dist/pipeline/index.js.map +0 -1
- package/dist/pipeline/materialize.js +0 -1104
- package/dist/pipeline/materialize.js.map +0 -1
- package/dist/pipeline/parseStateKey.d.ts +0 -15
- package/dist/pipeline/parseStateKey.js +0 -447
- package/dist/pipeline/parseStateKey.js.map +0 -1
- package/dist/pipeline/simplify.js +0 -516
- package/dist/pipeline/simplify.js.map +0 -1
- package/dist/pipeline/warnings.js +0 -18
- package/dist/pipeline/warnings.js.map +0 -1
- package/dist/plugins/okhsl-plugin.d.ts +0 -35
- package/dist/plugins/okhsl-plugin.js +0 -98
- package/dist/plugins/okhsl-plugin.js.map +0 -1
- package/dist/plugins/types.d.ts +0 -76
- package/dist/properties/index.js +0 -223
- package/dist/properties/index.js.map +0 -1
- package/dist/properties/property-type-resolver.d.ts +0 -24
- package/dist/properties/property-type-resolver.js +0 -91
- package/dist/properties/property-type-resolver.js.map +0 -1
- package/dist/ssr/async-storage.d.ts +0 -17
- package/dist/ssr/async-storage.js.map +0 -1
- package/dist/ssr/collect-auto-properties.js +0 -40
- package/dist/ssr/collect-auto-properties.js.map +0 -1
- package/dist/ssr/collector.d.ts +0 -102
- package/dist/ssr/collector.js.map +0 -1
- package/dist/ssr/context.d.ts +0 -8
- package/dist/ssr/context.js +0 -14
- package/dist/ssr/context.js.map +0 -1
- package/dist/ssr/format-global-rules.js.map +0 -1
- package/dist/ssr/format-keyframes.js +0 -70
- package/dist/ssr/format-keyframes.js.map +0 -1
- package/dist/ssr/format-property.js +0 -50
- package/dist/ssr/format-property.js.map +0 -1
- package/dist/ssr/format-rules.js.map +0 -1
- package/dist/ssr/hydrate.d.ts +0 -22
- package/dist/ssr/hydrate.js +0 -50
- package/dist/ssr/hydrate.js.map +0 -1
- package/dist/ssr/ssr-collector-ref.js +0 -12
- package/dist/ssr/ssr-collector-ref.js.map +0 -1
- package/dist/states/index.d.ts +0 -49
- package/dist/states/index.js +0 -171
- package/dist/states/index.js.map +0 -1
- package/dist/static/tastyStatic.d.ts +0 -46
- package/dist/static/tastyStatic.js +0 -31
- package/dist/static/tastyStatic.js.map +0 -1
- package/dist/static/types.d.ts +0 -49
- package/dist/static/types.js +0 -24
- package/dist/static/types.js.map +0 -1
- package/dist/styles/align.d.ts +0 -15
- package/dist/styles/align.js +0 -14
- package/dist/styles/align.js.map +0 -1
- package/dist/styles/border.d.ts +0 -25
- package/dist/styles/border.js +0 -114
- package/dist/styles/border.js.map +0 -1
- package/dist/styles/color.d.ts +0 -14
- package/dist/styles/color.js +0 -27
- package/dist/styles/color.js.map +0 -1
- package/dist/styles/createStyle.js +0 -80
- package/dist/styles/createStyle.js.map +0 -1
- package/dist/styles/dimension.js +0 -97
- package/dist/styles/dimension.js.map +0 -1
- package/dist/styles/display.d.ts +0 -37
- package/dist/styles/display.js +0 -67
- package/dist/styles/display.js.map +0 -1
- package/dist/styles/fade.d.ts +0 -15
- package/dist/styles/fade.js +0 -58
- package/dist/styles/fade.js.map +0 -1
- package/dist/styles/fill.d.ts +0 -42
- package/dist/styles/fill.js +0 -52
- package/dist/styles/fill.js.map +0 -1
- package/dist/styles/flow.d.ts +0 -16
- package/dist/styles/flow.js +0 -12
- package/dist/styles/flow.js.map +0 -1
- package/dist/styles/gap.d.ts +0 -31
- package/dist/styles/gap.js +0 -37
- package/dist/styles/gap.js.map +0 -1
- package/dist/styles/height.d.ts +0 -17
- package/dist/styles/height.js +0 -20
- package/dist/styles/height.js.map +0 -1
- package/dist/styles/index.d.ts +0 -2
- package/dist/styles/index.js +0 -9
- package/dist/styles/index.js.map +0 -1
- package/dist/styles/inset.d.ts +0 -52
- package/dist/styles/inset.js +0 -150
- package/dist/styles/inset.js.map +0 -1
- package/dist/styles/justify.d.ts +0 -15
- package/dist/styles/justify.js +0 -14
- package/dist/styles/justify.js.map +0 -1
- package/dist/styles/list.d.ts +0 -16
- package/dist/styles/list.js +0 -98
- package/dist/styles/list.js.map +0 -1
- package/dist/styles/margin.d.ts +0 -24
- package/dist/styles/margin.js +0 -104
- package/dist/styles/margin.js.map +0 -1
- package/dist/styles/outline.d.ts +0 -29
- package/dist/styles/outline.js +0 -65
- package/dist/styles/outline.js.map +0 -1
- package/dist/styles/padding.d.ts +0 -24
- package/dist/styles/padding.js +0 -104
- package/dist/styles/padding.js.map +0 -1
- package/dist/styles/predefined.d.ts +0 -71
- package/dist/styles/predefined.js +0 -238
- package/dist/styles/predefined.js.map +0 -1
- package/dist/styles/preset.d.ts +0 -52
- package/dist/styles/preset.js +0 -127
- package/dist/styles/preset.js.map +0 -1
- package/dist/styles/radius.d.ts +0 -14
- package/dist/styles/radius.js +0 -51
- package/dist/styles/radius.js.map +0 -1
- package/dist/styles/scrollbar.d.ts +0 -25
- package/dist/styles/scrollbar.js +0 -48
- package/dist/styles/scrollbar.js.map +0 -1
- package/dist/styles/shadow.d.ts +0 -14
- package/dist/styles/shadow.js +0 -24
- package/dist/styles/shadow.js.map +0 -1
- package/dist/styles/transition.d.ts +0 -14
- package/dist/styles/transition.js +0 -158
- package/dist/styles/transition.js.map +0 -1
- package/dist/styles/types.d.ts +0 -547
- package/dist/styles/width.d.ts +0 -17
- package/dist/styles/width.js +0 -20
- package/dist/styles/width.js.map +0 -1
- package/dist/tasty.d.ts +0 -119
- package/dist/tasty.js +0 -232
- package/dist/tasty.js.map +0 -1
- package/dist/types.d.ts +0 -184
- package/dist/utils/cache-wrapper.js +0 -22
- package/dist/utils/cache-wrapper.js.map +0 -1
- package/dist/utils/case-converter.js +0 -8
- package/dist/utils/case-converter.js.map +0 -1
- package/dist/utils/color-math.d.ts +0 -46
- package/dist/utils/color-math.js +0 -749
- package/dist/utils/color-math.js.map +0 -1
- package/dist/utils/color-space.d.ts +0 -5
- package/dist/utils/color-space.js +0 -229
- package/dist/utils/color-space.js.map +0 -1
- package/dist/utils/colors.d.ts +0 -5
- package/dist/utils/colors.js +0 -11
- package/dist/utils/colors.js.map +0 -1
- package/dist/utils/css-types.d.ts +0 -7
- package/dist/utils/dotize.d.ts +0 -26
- package/dist/utils/dotize.js +0 -122
- package/dist/utils/dotize.js.map +0 -1
- package/dist/utils/filter-base-props.d.ts +0 -15
- package/dist/utils/filter-base-props.js +0 -45
- package/dist/utils/filter-base-props.js.map +0 -1
- package/dist/utils/get-display-name.d.ts +0 -7
- package/dist/utils/get-display-name.js +0 -10
- package/dist/utils/get-display-name.js.map +0 -1
- package/dist/utils/has-keys.js +0 -13
- package/dist/utils/has-keys.js.map +0 -1
- package/dist/utils/is-dev-env.js +0 -19
- package/dist/utils/is-dev-env.js.map +0 -1
- package/dist/utils/is-valid-element-type.js +0 -15
- package/dist/utils/is-valid-element-type.js.map +0 -1
- package/dist/utils/merge-styles.js.map +0 -1
- package/dist/utils/mod-attrs.d.ts +0 -8
- package/dist/utils/mod-attrs.js +0 -21
- package/dist/utils/mod-attrs.js.map +0 -1
- package/dist/utils/process-tokens.d.ts +0 -21
- package/dist/utils/process-tokens.js +0 -91
- package/dist/utils/process-tokens.js.map +0 -1
- package/dist/utils/resolve-recipes.d.ts +0 -17
- package/dist/utils/resolve-recipes.js.map +0 -1
- package/dist/utils/selector-transform.js +0 -32
- package/dist/utils/selector-transform.js.map +0 -1
- package/dist/utils/string.js +0 -8
- package/dist/utils/string.js.map +0 -1
- package/dist/utils/styles.d.ts +0 -99
- package/dist/utils/styles.js +0 -221
- package/dist/utils/styles.js.map +0 -1
- package/dist/utils/typography.d.ts +0 -47
- package/dist/utils/typography.js +0 -51
- package/dist/utils/typography.js.map +0 -1
- package/dist/utils/warnings.d.ts +0 -16
- package/dist/utils/warnings.js +0 -16
- package/dist/utils/warnings.js.map +0 -1
- package/dist/zero/css-writer.d.ts +0 -45
- package/dist/zero/css-writer.js +0 -74
- package/dist/zero/css-writer.js.map +0 -1
- package/dist/zero/extractor.d.ts +0 -24
- package/dist/zero/extractor.js.map +0 -1
- package/docs/PIPELINE.md +0 -519
- package/docs/runtime.md +0 -485
package/docs/tasty-static.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Build-Time Extraction (`tastyStatic`)
|
|
2
2
|
|
|
3
|
-
`tastyStatic` is
|
|
3
|
+
`tastyStatic` is Tasty's framework-agnostic build-time utility for extracting CSS before rendering. It produces no client styling runtime in file mode, but it is not the only way to achieve zero-runtime delivery: server-only `tasty()` also ships no Tasty runtime to the browser while retaining the full React component API. Astro's `tastyIntegration({ islands: false })` is the clearest example; the same architecture applies to server-only Next.js RSC.
|
|
4
|
+
|
|
5
|
+
Choose `tastyStatic` specifically when styles must be generated during the build, when the consumer is not React, or when you want static class-name objects instead of components. For the broader docs map, see the [Docs Hub](README.md).
|
|
4
6
|
|
|
5
7
|
---
|
|
6
8
|
|
|
@@ -8,19 +10,19 @@
|
|
|
8
10
|
|
|
9
11
|
- **Static site generation (SSG)** — Pre-render all styles at build time
|
|
10
12
|
- **No-JavaScript websites** — CSS works without any JS runtime
|
|
11
|
-
- **Performance-critical pages** —
|
|
13
|
+
- **Performance-critical pages** — CSS extracted before the application renders
|
|
12
14
|
- **Landing pages** — Minimal bundle size with pre-generated CSS
|
|
13
15
|
|
|
14
16
|
## Requirements
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
Build-time extraction is part of the main `@tenphi/tasty` package but requires additional peer dependencies depending on your setup:
|
|
17
19
|
|
|
18
|
-
| Dependency
|
|
19
|
-
|
|
20
|
-
| `@babel/core`
|
|
21
|
-
| `@babel/helper-plugin-utils` | >= 7.24 | Babel plugin
|
|
22
|
-
| `@babel/types`
|
|
23
|
-
| `jiti`
|
|
20
|
+
| Dependency | Version | Required for |
|
|
21
|
+
| ---------------------------- | ------- | -------------------------------------------------------------------------- |
|
|
22
|
+
| `@babel/core` | >= 7.24 | Babel plugin (`@tenphi/tasty/babel-plugin`) |
|
|
23
|
+
| `@babel/helper-plugin-utils` | >= 7.24 | Babel plugin |
|
|
24
|
+
| `@babel/types` | >= 7.24 | Babel plugin |
|
|
25
|
+
| `jiti` | >= 2.6 | Next.js wrapper (`@tenphi/tasty/zero/next`) when using `configFile` option |
|
|
24
26
|
|
|
25
27
|
All of these are declared as optional peer dependencies of `@tenphi/tasty`. Install only what your setup requires:
|
|
26
28
|
|
|
@@ -107,11 +109,11 @@ tastyStatic('body', {
|
|
|
107
109
|
|
|
108
110
|
## StaticStyle Object
|
|
109
111
|
|
|
110
|
-
| Property
|
|
111
|
-
|
|
112
|
-
| `className`
|
|
113
|
-
| `styles`
|
|
114
|
-
| `toString()` | `() => string` | Returns `className` for string coercion
|
|
112
|
+
| Property | Type | Description |
|
|
113
|
+
| ------------ | -------------- | ------------------------------------------ |
|
|
114
|
+
| `className` | `string` | Space-separated class names for use in JSX |
|
|
115
|
+
| `styles` | `Styles` | The original (or merged) styles object |
|
|
116
|
+
| `toString()` | `() => string` | Returns `className` for string coercion |
|
|
115
117
|
|
|
116
118
|
---
|
|
117
119
|
|
|
@@ -123,48 +125,83 @@ tastyStatic('body', {
|
|
|
123
125
|
// babel.config.js
|
|
124
126
|
module.exports = {
|
|
125
127
|
plugins: [
|
|
126
|
-
[
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
[
|
|
129
|
+
'@tenphi/tasty/babel-plugin',
|
|
130
|
+
{
|
|
131
|
+
output: 'public/tasty.css',
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
],
|
|
130
135
|
};
|
|
131
136
|
```
|
|
132
137
|
|
|
133
|
-
These examples use `data-schema="dark"` as the root-state convention. If your app already uses a different root attribute such as `data-theme`, keep the same alias pattern and swap the attribute name consistently in your
|
|
138
|
+
These examples use `data-schema="dark"` as the root-state convention. If your app already uses a different root attribute such as `data-theme`, keep the same alias pattern and swap the attribute name consistently in your build-time config.
|
|
134
139
|
|
|
135
140
|
### With Configuration
|
|
136
141
|
|
|
137
142
|
```javascript
|
|
138
143
|
module.exports = {
|
|
139
144
|
plugins: [
|
|
140
|
-
[
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
[
|
|
146
|
+
'@tenphi/tasty/babel-plugin',
|
|
147
|
+
{
|
|
148
|
+
output: 'public/tasty.css',
|
|
149
|
+
config: {
|
|
150
|
+
states: {
|
|
151
|
+
'@mobile': '@media(w < 768px)',
|
|
152
|
+
'@tablet': '@media(w < 1024px)',
|
|
153
|
+
'@dark': '@root(schema=dark)',
|
|
154
|
+
},
|
|
155
|
+
devMode: true,
|
|
147
156
|
},
|
|
148
|
-
devMode: true,
|
|
149
157
|
},
|
|
150
|
-
|
|
151
|
-
]
|
|
158
|
+
],
|
|
159
|
+
],
|
|
152
160
|
};
|
|
153
161
|
```
|
|
154
162
|
|
|
155
163
|
### Plugin Options
|
|
156
164
|
|
|
157
|
-
| Option
|
|
158
|
-
|
|
159
|
-
| `output`
|
|
160
|
-
| `
|
|
161
|
-
| `
|
|
162
|
-
| `
|
|
163
|
-
| `
|
|
164
|
-
| `
|
|
165
|
-
| `config.
|
|
166
|
-
| `config.
|
|
167
|
-
| `config.
|
|
165
|
+
| Option | Type | Default | Description |
|
|
166
|
+
| -------------------------- | ------------------------------------------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
167
|
+
| `output` | `string` | `'tasty.css'` | Path for generated CSS file |
|
|
168
|
+
| `mode` | `'file' \| 'inject'` | `'file'` | `'file'` writes CSS to disk; `'inject'` embeds CSS inline in JS (see [Inject Mode](#inject-mode)) |
|
|
169
|
+
| `configFile` | `string` | — | Absolute path to a TS/JS module that default-exports a `TastyZeroConfig` object. JSON-serializable alternative to `config` — required for Turbopack. |
|
|
170
|
+
| `config` | `TastyZeroConfig \| () => TastyZeroConfig` | `{}` | Inline config object or factory function. Takes precedence over `configFile`. |
|
|
171
|
+
| `configDeps` | `string[]` | `[]` | Absolute file paths that affect config (for cache invalidation) |
|
|
172
|
+
| `injectImport` | `boolean` | `true` | Replace `@tenphi/tasty/static` imports with an import of the generated CSS file. Set to `false` to manage CSS imports manually. |
|
|
173
|
+
| `config.states` | `Record<string, string>` | `{}` | Predefined state aliases (e.g. `{ '@mobile': '@media(w < 768px)' }`) |
|
|
174
|
+
| `config.devMode` | `boolean` | `false` | Add source comments to CSS |
|
|
175
|
+
| `config.tokens` | `ConfigTokens` | — | Design tokens injected as CSS custom properties on `:root`. Values are parsed through the Tasty DSL. Supports state maps for responsive/themed tokens. |
|
|
176
|
+
| `config.replaceTokens` | `Record<string, string \| number>` | — | Parse-time token substitution. Keys use `$name` for custom properties and `#name` for color tokens. |
|
|
177
|
+
| `config.recipes` | `Record<string, RecipeStyles>` | `{}` | Predefined style recipes |
|
|
178
|
+
| `config.keyframes` | `Record<string, KeyframesSteps>` | — | Global `@keyframes` definitions available to all `tastyStatic` calls |
|
|
179
|
+
| `config.fontFaces` | `Record<string, FontFaceInput>` | — | Global `@font-face` definitions |
|
|
180
|
+
| `config.counterStyles` | `Record<string, CounterStyleDescriptors>` | — | Global `@counter-style` definitions |
|
|
181
|
+
| `config.units` | `Record<string, string \| UnitHandler>` | — | Custom units for the style parser (merged with built-ins). E.g. `{ em: 'em', vw: 'vw' }` |
|
|
182
|
+
| `config.functions` | `Record<string, FunctionDefinition \| Function>` | — | Custom functions (merged). Bare keys → parse functions; `$$name` keys → declarative CSS `@function` definitions |
|
|
183
|
+
| `config.polyfills` | `{ functions?: boolean }` | `{}` | Opt-in polyfills. `functions: true` inlines `@function` calls into plain CSS at build time |
|
|
184
|
+
| `config.plugins` | `TastyPlugin[]` | — | Plugins that extend tasty with custom functions, units, states, and handlers |
|
|
185
|
+
| `config.handlers` | `Record<string, StyleHandlerDefinition>` | — | Custom style handlers that transform style properties into CSS declarations |
|
|
186
|
+
| `config.presets` | `Record<string, TypographyPreset>` | — | Typography presets — shorthand for `generateTypographyTokens()`. Generated tokens merge under explicit `tokens`. |
|
|
187
|
+
| `config.globalStyles` | `Record<string, Styles>` | — | Global Tasty styles keyed by CSS selector. Supports the full style syntax. |
|
|
188
|
+
| `config.autoPropertyTypes` | `boolean` | `true` | Automatically infer and register CSS `@property` declarations from values |
|
|
189
|
+
| `config.parserCacheSize` | `number` | `1000` | Parser LRU cache size. Larger values improve performance for builds with many unique style values |
|
|
190
|
+
| `config.namePrefix` | `string` | `'ts'` | Prefix prepended to every generated identifier. Defaults to `'ts'` so static classes never collide with runtime (`'t'`) classes. See [Configuration: Name prefix](configuration.md#name-prefix). |
|
|
191
|
+
|
|
192
|
+
### Coexisting with `tasty()`
|
|
193
|
+
|
|
194
|
+
When a page mixes `tastyStatic` with `tasty`, both must use **different** `namePrefix` values. The defaults handle this automatically (`'t'` for React rendering, `'ts'` for build-time extraction). If you customize one, customize the other:
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
// tasty-zero.config.ts (Babel plugin)
|
|
198
|
+
export default { namePrefix: 'mbs' };
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
```ts
|
|
202
|
+
// app entry (`tasty()` configure)
|
|
203
|
+
configure({ namePrefix: 'mb' });
|
|
204
|
+
```
|
|
168
205
|
|
|
169
206
|
---
|
|
170
207
|
|
|
@@ -176,16 +213,24 @@ Recipes work with `tastyStatic` the same way as with runtime `tasty`:
|
|
|
176
213
|
// babel.config.js
|
|
177
214
|
module.exports = {
|
|
178
215
|
plugins: [
|
|
179
|
-
[
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
216
|
+
[
|
|
217
|
+
'@tenphi/tasty/babel-plugin',
|
|
218
|
+
{
|
|
219
|
+
output: 'public/tasty.css',
|
|
220
|
+
config: {
|
|
221
|
+
recipes: {
|
|
222
|
+
card: {
|
|
223
|
+
padding: '4x',
|
|
224
|
+
fill: '#surface',
|
|
225
|
+
radius: '1r',
|
|
226
|
+
border: true,
|
|
227
|
+
},
|
|
228
|
+
elevated: { shadow: '2x 2x 4x #shadow' },
|
|
229
|
+
},
|
|
185
230
|
},
|
|
186
231
|
},
|
|
187
|
-
|
|
188
|
-
]
|
|
232
|
+
],
|
|
233
|
+
],
|
|
189
234
|
};
|
|
190
235
|
```
|
|
191
236
|
|
|
@@ -197,7 +242,7 @@ const card = tastyStatic({
|
|
|
197
242
|
color: '#text',
|
|
198
243
|
});
|
|
199
244
|
|
|
200
|
-
<div className={card}>Styled card</div
|
|
245
|
+
<div className={card}>Styled card</div>;
|
|
201
246
|
```
|
|
202
247
|
|
|
203
248
|
---
|
|
@@ -208,7 +253,7 @@ The `withTastyZero` wrapper configures both **webpack** and **Turbopack** automa
|
|
|
208
253
|
|
|
209
254
|
```typescript
|
|
210
255
|
// next.config.ts
|
|
211
|
-
import { withTastyZero } from '@tenphi/tasty/next';
|
|
256
|
+
import { withTastyZero } from '@tenphi/tasty/zero/next';
|
|
212
257
|
|
|
213
258
|
export default withTastyZero({
|
|
214
259
|
output: 'public/tasty.css',
|
|
@@ -221,13 +266,14 @@ export default withTastyZero({
|
|
|
221
266
|
|
|
222
267
|
### `withTastyZero` Options
|
|
223
268
|
|
|
224
|
-
| Option
|
|
225
|
-
|
|
226
|
-
| `output`
|
|
227
|
-
| `
|
|
228
|
-
| `
|
|
229
|
-
| `
|
|
230
|
-
| `
|
|
269
|
+
| Option | Type | Default | Description |
|
|
270
|
+
| ------------ | -------------------- | -------------------- | ------------------------------------------------------------------------------------------------------- |
|
|
271
|
+
| `output` | `string` | `'public/tasty.css'` | Output path for CSS relative to project root |
|
|
272
|
+
| `mode` | `'file' \| 'inject'` | `'file'` | `'file'` writes CSS to disk; `'inject'` embeds CSS inline in JS |
|
|
273
|
+
| `enabled` | `boolean` | `true` | Enable/disable the plugin |
|
|
274
|
+
| `configFile` | `string` | — | Path to a TS/JS module that default-exports `TastyZeroConfig`. Recommended for Turbopack compatibility. |
|
|
275
|
+
| `config` | `TastyZeroConfig` | — | Inline config object. For static configs that don't change during dev. |
|
|
276
|
+
| `configDeps` | `string[]` | `[]` | Extra files the config depends on (for cache invalidation) |
|
|
231
277
|
|
|
232
278
|
### Turbopack Support
|
|
233
279
|
|
|
@@ -265,12 +311,15 @@ export default defineConfig({
|
|
|
265
311
|
react({
|
|
266
312
|
babel: {
|
|
267
313
|
plugins: [
|
|
268
|
-
[
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
314
|
+
[
|
|
315
|
+
'@tenphi/tasty/babel-plugin',
|
|
316
|
+
{
|
|
317
|
+
output: 'public/tasty.css',
|
|
318
|
+
config: {
|
|
319
|
+
states: { '@mobile': '@media(w < 768px)' },
|
|
320
|
+
},
|
|
272
321
|
},
|
|
273
|
-
|
|
322
|
+
],
|
|
274
323
|
],
|
|
275
324
|
},
|
|
276
325
|
}),
|
|
@@ -304,7 +353,9 @@ export const Button = () => <button className={button}>Click</button>;
|
|
|
304
353
|
const button = {
|
|
305
354
|
className: 'ts3f2a1b ts8c4d2e',
|
|
306
355
|
styles: { padding: '2x 4x', fill: '#purple', color: '#white' },
|
|
307
|
-
toString() {
|
|
356
|
+
toString() {
|
|
357
|
+
return this.className;
|
|
358
|
+
},
|
|
308
359
|
};
|
|
309
360
|
|
|
310
361
|
export const Button = () => <button className={button}>Click</button>;
|
|
@@ -333,6 +384,101 @@ export const Button = () => <button className={button}>Click</button>;
|
|
|
333
384
|
|
|
334
385
|
---
|
|
335
386
|
|
|
387
|
+
## Inject Mode
|
|
388
|
+
|
|
389
|
+
By default the Babel plugin writes CSS to a file (`mode: 'file'`). **Inject mode** (`mode: 'inject'`) embeds CSS inline in your JavaScript and injects it at runtime via a tiny injector. No CSS file is produced.
|
|
390
|
+
|
|
391
|
+
This is ideal for **reusable components**, **extensions**, and **libraries** where consumers shouldn't need to manage an external CSS file.
|
|
392
|
+
|
|
393
|
+
### How It Works
|
|
394
|
+
|
|
395
|
+
1. The Babel plugin extracts CSS at build time (same pipeline as file mode).
|
|
396
|
+
2. Instead of writing to a `.css` file, the CSS is embedded as string literals in the JS output.
|
|
397
|
+
3. The `@tenphi/tasty/static` import is rewritten to `@tenphi/tasty/static/inject`.
|
|
398
|
+
4. Each `tastyStatic` call becomes a self-contained expression that injects its CSS and evaluates to a `StaticStyle` object.
|
|
399
|
+
|
|
400
|
+
### Configuration
|
|
401
|
+
|
|
402
|
+
```javascript
|
|
403
|
+
// babel.config.js
|
|
404
|
+
module.exports = {
|
|
405
|
+
plugins: [
|
|
406
|
+
[
|
|
407
|
+
'@tenphi/tasty/babel-plugin',
|
|
408
|
+
{
|
|
409
|
+
mode: 'inject',
|
|
410
|
+
config: {
|
|
411
|
+
states: { '@mobile': '@media(w < 768px)' },
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
],
|
|
415
|
+
],
|
|
416
|
+
};
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
With Next.js:
|
|
420
|
+
|
|
421
|
+
```typescript
|
|
422
|
+
// next.config.ts
|
|
423
|
+
import { withTastyZero } from '@tenphi/tasty/zero/next';
|
|
424
|
+
|
|
425
|
+
export default withTastyZero({
|
|
426
|
+
mode: 'inject',
|
|
427
|
+
configFile: './app/tasty-zero.config.ts',
|
|
428
|
+
})({
|
|
429
|
+
reactStrictMode: true,
|
|
430
|
+
});
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
When `mode` is `'inject'`, the `output` and `injectImport` options are ignored.
|
|
434
|
+
|
|
435
|
+
### Build Transformation (inject mode)
|
|
436
|
+
|
|
437
|
+
**Before:**
|
|
438
|
+
|
|
439
|
+
```tsx
|
|
440
|
+
import { tastyStatic } from '@tenphi/tasty/static';
|
|
441
|
+
|
|
442
|
+
const button = tastyStatic({
|
|
443
|
+
padding: '2x 4x',
|
|
444
|
+
fill: '#purple',
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
tastyStatic('.heading', { preset: 'h1' });
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
**After:**
|
|
451
|
+
|
|
452
|
+
```tsx
|
|
453
|
+
import { injectCSS as _$i } from '@tenphi/tasty/static/inject';
|
|
454
|
+
|
|
455
|
+
const button =
|
|
456
|
+
(_$i(
|
|
457
|
+
'ts3f2a1b ts8c4d2e',
|
|
458
|
+
'.ts3f2a1b.ts3f2a1b{padding:16px 32px}\n.ts8c4d2e.ts8c4d2e{background:#9370db}',
|
|
459
|
+
),
|
|
460
|
+
{
|
|
461
|
+
className: 'ts3f2a1b ts8c4d2e',
|
|
462
|
+
styles: { padding: '2x 4x', fill: '#purple' },
|
|
463
|
+
toString() {
|
|
464
|
+
return this.className;
|
|
465
|
+
},
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
_$i('.heading', '.heading{font-size:2.5rem;font-weight:700;line-height:1.2}');
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
### Dev Mode / HMR
|
|
472
|
+
|
|
473
|
+
Class names are content-hashed (`ts` + MD5). When styles change, a new hash produces a new `_$i` call that injects fresh CSS. The injector deduplicates by id, so unchanged styles are skipped. Old CSS stays in the DOM but is harmless since no elements reference those class names.
|
|
474
|
+
|
|
475
|
+
### Limitations (inject mode)
|
|
476
|
+
|
|
477
|
+
- **Client-side only** — Styles are injected via the DOM, so they are not available during SSR. For server-rendered apps, use `mode: 'file'` or React `tasty()`.
|
|
478
|
+
- **Larger JS bundle** — CSS is embedded in JavaScript, increasing bundle size. Best suited for components and extensions, not full-app styling.
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
336
482
|
## Style Extension
|
|
337
483
|
|
|
338
484
|
```tsx
|
|
@@ -397,13 +543,15 @@ For dynamic styling needs, combine with regular CSS or CSS variables:
|
|
|
397
543
|
```tsx
|
|
398
544
|
const card = tastyStatic({
|
|
399
545
|
padding: '4x',
|
|
400
|
-
fill: '
|
|
546
|
+
fill: '($card-bg, #white)',
|
|
401
547
|
});
|
|
402
548
|
|
|
403
549
|
<div
|
|
404
550
|
className={card}
|
|
405
|
-
style={{
|
|
406
|
-
|
|
551
|
+
style={{
|
|
552
|
+
'--card-bg': isActive ? 'var(--purple-color)' : 'var(--white-color)',
|
|
553
|
+
}}
|
|
554
|
+
/>;
|
|
407
555
|
```
|
|
408
556
|
|
|
409
557
|
---
|
|
@@ -420,14 +568,15 @@ const card = tastyStatic({
|
|
|
420
568
|
## Common Issues
|
|
421
569
|
|
|
422
570
|
- No CSS file is generated: make sure the Babel plugin actually runs for files importing `@tenphi/tasty/static`, and verify the `output` path is writable.
|
|
423
|
-
- Styles stay dynamic by mistake: `tastyStatic()` only supports build-time-known values. Move
|
|
571
|
+
- Styles stay dynamic by mistake: `tastyStatic()` only supports build-time-known values. Move dynamic values to CSS variables or switch that component to React `tasty()`.
|
|
424
572
|
- Turbopack config behaves inconsistently: prefer `configFile` over inline functions so the setup stays JSON-serializable.
|
|
425
573
|
|
|
426
574
|
---
|
|
427
575
|
|
|
428
576
|
## Related
|
|
429
577
|
|
|
430
|
-
- [Docs Hub](README.md) — Choose the right guide by task or
|
|
578
|
+
- [Docs Hub](README.md) — Choose the right guide by task or CSS delivery model
|
|
431
579
|
- [Style DSL](dsl.md) — State maps, tokens, units, extending semantics (shared by runtime and static)
|
|
432
|
-
- [
|
|
580
|
+
- [React API](react-api.md) — Client or server rendering with `tasty()`: component props, variants, sub-elements, and style functions
|
|
433
581
|
- [Configuration](configuration.md) — Global configuration: tokens, recipes, custom units, and style handlers
|
|
582
|
+
- [Plugins & Extension Points](plugins.md) — Which extension points work at build time (`functions`, `units`, `states`, `handlers`, `recipes`) and which do not (`propHandlers` — `tastyStatic()` takes styles objects, not props)
|
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.f8d65c2",
|
|
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",
|
|
@@ -17,6 +17,11 @@
|
|
|
17
17
|
"import": "./dist/static/index.js",
|
|
18
18
|
"default": "./dist/static/index.js"
|
|
19
19
|
},
|
|
20
|
+
"./static/inject": {
|
|
21
|
+
"types": "./dist/static/inject.d.ts",
|
|
22
|
+
"import": "./dist/static/inject.js",
|
|
23
|
+
"default": "./dist/static/inject.js"
|
|
24
|
+
},
|
|
20
25
|
"./babel-plugin": {
|
|
21
26
|
"types": "./dist/zero/babel.d.ts",
|
|
22
27
|
"import": "./dist/zero/babel.js",
|
|
@@ -27,7 +32,7 @@
|
|
|
27
32
|
"import": "./dist/zero/index.js",
|
|
28
33
|
"default": "./dist/zero/index.js"
|
|
29
34
|
},
|
|
30
|
-
"./next": {
|
|
35
|
+
"./zero/next": {
|
|
31
36
|
"types": "./dist/zero/next.d.ts",
|
|
32
37
|
"import": "./dist/zero/next.js",
|
|
33
38
|
"default": "./dist/zero/next.js"
|
|
@@ -52,6 +57,21 @@
|
|
|
52
57
|
"import": "./dist/ssr/astro.js",
|
|
53
58
|
"default": "./dist/ssr/astro.js"
|
|
54
59
|
},
|
|
60
|
+
"./ssr/astro-client": {
|
|
61
|
+
"types": "./dist/ssr/astro-client.d.ts",
|
|
62
|
+
"import": "./dist/ssr/astro-client.js",
|
|
63
|
+
"default": "./dist/ssr/astro-client.js"
|
|
64
|
+
},
|
|
65
|
+
"./ssr/astro-middleware": {
|
|
66
|
+
"types": "./dist/ssr/astro-middleware.d.ts",
|
|
67
|
+
"import": "./dist/ssr/astro-middleware.js",
|
|
68
|
+
"default": "./dist/ssr/astro-middleware.js"
|
|
69
|
+
},
|
|
70
|
+
"./ssr/astro-middleware-static": {
|
|
71
|
+
"types": "./dist/ssr/astro-middleware-static.d.ts",
|
|
72
|
+
"import": "./dist/ssr/astro-middleware-static.js",
|
|
73
|
+
"default": "./dist/ssr/astro-middleware-static.js"
|
|
74
|
+
},
|
|
55
75
|
"./tasty.config": "./tasty.config.ts"
|
|
56
76
|
},
|
|
57
77
|
"files": [
|
|
@@ -62,7 +82,10 @@
|
|
|
62
82
|
"sideEffects": [
|
|
63
83
|
"./dist/ssr/index.js",
|
|
64
84
|
"./dist/ssr/next.js",
|
|
65
|
-
"./dist/ssr/astro.js"
|
|
85
|
+
"./dist/ssr/astro.js",
|
|
86
|
+
"./dist/ssr/astro-client.js",
|
|
87
|
+
"./dist/ssr/astro-middleware.js",
|
|
88
|
+
"./dist/ssr/astro-middleware-static.js"
|
|
66
89
|
],
|
|
67
90
|
"engines": {
|
|
68
91
|
"node": ">=20"
|
|
@@ -70,6 +93,9 @@
|
|
|
70
93
|
"scripts": {
|
|
71
94
|
"build": "tsdown",
|
|
72
95
|
"test": "vitest run",
|
|
96
|
+
"test:node": "vitest run --project node",
|
|
97
|
+
"test:browser": "vitest run --project browser",
|
|
98
|
+
"test:setup": "playwright install chromium",
|
|
73
99
|
"test:watch": "vitest",
|
|
74
100
|
"test:coverage": "vitest run --coverage",
|
|
75
101
|
"typecheck": "tsc --noEmit",
|
|
@@ -78,11 +104,16 @@
|
|
|
78
104
|
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
79
105
|
"format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
|
|
80
106
|
"size": "size-limit",
|
|
81
|
-
"bench": "vitest bench",
|
|
107
|
+
"bench": "vitest bench --project node",
|
|
108
|
+
"bench:browser": "vitest bench --project browser",
|
|
109
|
+
"bench:overhead": "vitest bench --config vitest.production-browser-bench.config.ts src/tasty-overhead.bench.tsx",
|
|
110
|
+
"bench:injection": "vitest bench --config vitest.production-browser-bench.config.ts src/tasty-injection.bench.ts",
|
|
82
111
|
"prepublishOnly": "pnpm run build",
|
|
83
112
|
"changeset": "changeset",
|
|
84
113
|
"version": "changeset version",
|
|
85
114
|
"release": "changeset publish",
|
|
115
|
+
"knip": "knip",
|
|
116
|
+
"check:test-only": "node scripts/check-test-only-code.mjs",
|
|
86
117
|
"hygiene": "pnpm lint && pnpm format:check && pnpm typecheck",
|
|
87
118
|
"hygiene:fix": "pnpm lint:fix && pnpm format && pnpm typecheck"
|
|
88
119
|
},
|
|
@@ -112,6 +143,7 @@
|
|
|
112
143
|
"@babel/helper-plugin-utils": "^7.24.0",
|
|
113
144
|
"@babel/types": "^7.24.0",
|
|
114
145
|
"jiti": "^2.6.1",
|
|
146
|
+
"next": ">=14.0.0",
|
|
115
147
|
"react": "^18.0.0 || ^19.0.0"
|
|
116
148
|
},
|
|
117
149
|
"peerDependenciesMeta": {
|
|
@@ -129,6 +161,9 @@
|
|
|
129
161
|
},
|
|
130
162
|
"jiti": {
|
|
131
163
|
"optional": true
|
|
164
|
+
},
|
|
165
|
+
"next": {
|
|
166
|
+
"optional": true
|
|
132
167
|
}
|
|
133
168
|
},
|
|
134
169
|
"dependencies": {
|
|
@@ -136,53 +171,56 @@
|
|
|
136
171
|
},
|
|
137
172
|
"devDependencies": {
|
|
138
173
|
"@babel/core": "^7.24.0",
|
|
139
|
-
"@
|
|
174
|
+
"@babel/helper-plugin-utils": "^7.24.0",
|
|
175
|
+
"@babel/types": "^7.24.0",
|
|
176
|
+
"@changesets/changelog-github": "^0.7.0",
|
|
140
177
|
"@changesets/cli": "^2.29.8",
|
|
141
178
|
"@eslint/js": "^10.0.1",
|
|
142
179
|
"@size-limit/esbuild": "^12.0.0",
|
|
143
180
|
"@size-limit/file": "^12.0.0",
|
|
181
|
+
"@tenphi/eslint-plugin-tasty": "^0.11.3",
|
|
144
182
|
"@testing-library/jest-dom": "^6.9.1",
|
|
145
183
|
"@testing-library/react": "^16.3.2",
|
|
146
184
|
"@types/babel__core": "^7.20.5",
|
|
147
185
|
"@types/babel__helper-plugin-utils": "^7.10.3",
|
|
148
186
|
"@types/node": "^25.3.2",
|
|
149
187
|
"@types/react": "^19.0.0",
|
|
150
|
-
"@
|
|
188
|
+
"@types/react-dom": "^19.0.0",
|
|
189
|
+
"@vitest/browser-playwright": "^4.1.10",
|
|
151
190
|
"eslint": "^10.0.0",
|
|
152
191
|
"eslint-config-prettier": "^10.1.8",
|
|
153
|
-
"
|
|
192
|
+
"jiti": "^2.6.1",
|
|
193
|
+
"knip": "^5.61.3",
|
|
194
|
+
"next": "^16.0.0",
|
|
195
|
+
"playwright": "^1.62.1",
|
|
154
196
|
"prettier": "^3.8.1",
|
|
155
197
|
"react": "^19.0.0",
|
|
198
|
+
"react-dom": "^19.0.0",
|
|
156
199
|
"size-limit": "^12.0.0",
|
|
157
|
-
"tsdown": "^0.
|
|
158
|
-
"typescript": "^
|
|
200
|
+
"tsdown": "^0.22.0",
|
|
201
|
+
"typescript": "^6.0.2",
|
|
159
202
|
"typescript-eslint": "^8.56.0",
|
|
160
|
-
"vitest": "^4.
|
|
161
|
-
},
|
|
162
|
-
"pnpm": {
|
|
163
|
-
"onlyBuiltDependencies": [
|
|
164
|
-
"esbuild"
|
|
165
|
-
]
|
|
203
|
+
"vitest": "^4.1.10"
|
|
166
204
|
},
|
|
167
|
-
"packageManager": "pnpm@
|
|
205
|
+
"packageManager": "pnpm@11.24.0",
|
|
168
206
|
"size-limit": [
|
|
169
207
|
{
|
|
170
208
|
"name": "main (import *)",
|
|
171
209
|
"path": "dist/index.js",
|
|
172
210
|
"import": "*",
|
|
173
|
-
"limit": "
|
|
211
|
+
"limit": "56.9 kB"
|
|
174
212
|
},
|
|
175
213
|
{
|
|
176
214
|
"name": "core (import *)",
|
|
177
215
|
"path": "dist/core/index.js",
|
|
178
216
|
"import": "*",
|
|
179
|
-
"limit": "
|
|
217
|
+
"limit": "53.9 kB"
|
|
180
218
|
},
|
|
181
219
|
{
|
|
182
220
|
"name": "static",
|
|
183
221
|
"path": "dist/static/index.js",
|
|
184
222
|
"import": "*",
|
|
185
|
-
"limit": "
|
|
223
|
+
"limit": "16.8 kB"
|
|
186
224
|
},
|
|
187
225
|
{
|
|
188
226
|
"name": "zero",
|
|
@@ -193,7 +231,7 @@
|
|
|
193
231
|
"path",
|
|
194
232
|
"crypto"
|
|
195
233
|
],
|
|
196
|
-
"limit": "
|
|
234
|
+
"limit": "31.25 kB"
|
|
197
235
|
},
|
|
198
236
|
{
|
|
199
237
|
"name": "babel-plugin",
|
|
@@ -204,7 +242,7 @@
|
|
|
204
242
|
"path",
|
|
205
243
|
"crypto"
|
|
206
244
|
],
|
|
207
|
-
"limit": "
|
|
245
|
+
"limit": "49.35 kB"
|
|
208
246
|
}
|
|
209
247
|
]
|
|
210
248
|
}
|
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',
|
|
@@ -11,4 +12,9 @@ export default {
|
|
|
11
12
|
'$sharp-radius',
|
|
12
13
|
'$bold-font-weight',
|
|
13
14
|
],
|
|
15
|
+
styles: ['viewTransitionName'],
|
|
16
|
+
// This repo imports its own API relatively, so the plugin's default
|
|
17
|
+
// `@tenphi/tasty` import tracking never matches. List the local entry points so
|
|
18
|
+
// `tasty({ styles })` call sites are actually linted.
|
|
19
|
+
importSources: ['@tenphi/tasty', './tasty', '../tasty', './src/tasty'],
|
|
14
20
|
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
|
|
3
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
4
|
-
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
export { __require };
|