@tenphi/tasty 0.0.0-snapshot.bae20d4 → 0.0.0-snapshot.bbd36bd
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 +309 -293
- package/dist/astro-CeYENy2x.js +301 -0
- package/dist/astro-CeYENy2x.js.map +1 -0
- 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-DWCsafYw.d.ts +83 -0
- package/dist/collector-B3OsM252.js +327 -0
- package/dist/collector-B3OsM252.js.map +1 -0
- package/dist/collector-BTVXj2hS.d.ts +163 -0
- package/dist/config-B3gPdCqd.js +12421 -0
- package/dist/config-B3gPdCqd.js.map +1 -0
- package/dist/config-LfIDmVHx.d.ts +1363 -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-DGm0CFHP.js +1732 -0
- package/dist/core-DGm0CFHP.js.map +1 -0
- package/dist/css-resources-Cyl_axbI.js +149 -0
- package/dist/css-resources-Cyl_axbI.js.map +1 -0
- package/dist/{zero/extractor.js → css-writer-Bgowobbx.js} +188 -13
- package/dist/css-writer-Bgowobbx.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-XRw9u7d4.js} +41 -7
- package/dist/format-rules-XRw9u7d4.js.map +1 -0
- package/dist/hydrate-CNOmZprz.js +37 -0
- package/dist/hydrate-CNOmZprz.js.map +1 -0
- package/dist/index-Bm9ltvdH.d.ts +1933 -0
- package/dist/index-BmogEzTo.d.ts +1575 -0
- package/dist/index.d.ts +5 -49
- package/dist/index.js +921 -33
- package/dist/index.js.map +1 -0
- package/dist/keyframes-DE-OE76F.js +535 -0
- package/dist/keyframes-DE-OE76F.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-DuoZEsm9.js} +4 -6
- package/dist/merge-styles-DuoZEsm9.js.map +1 -0
- package/dist/{utils/resolve-recipes.js → resolve-recipes-H9NqOQuP.js} +5 -8
- package/dist/resolve-recipes-H9NqOQuP.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-extract-static.d.ts +11 -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 +11 -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 +18 -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 +19 -0
- package/dist/ssr/astro-middleware.js +19 -0
- package/dist/ssr/astro-middleware.js.map +1 -0
- package/dist/ssr/astro.d.ts +117 -11
- package/dist/ssr/astro.js +2 -65
- 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-config.d.ts +66 -0
- package/dist/ssr/next-config.js +115 -0
- package/dist/ssr/next-config.js.map +1 -0
- package/dist/ssr/next.d.ts +14 -7
- package/dist/ssr/next.js +40 -20
- package/dist/ssr/next.js.map +1 -1
- package/dist/ssr-collector-ref-COs_ioWl.js +29 -0
- package/dist/ssr-collector-ref-COs_ioWl.js.map +1 -0
- 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 -155
- package/dist/zero/babel.js +183 -51
- 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 +39 -0
- package/docs/adoption.md +72 -35
- package/docs/ai-agents.md +224 -0
- package/docs/comparison.md +88 -53
- package/docs/configuration.md +623 -63
- package/docs/debug.md +172 -342
- package/docs/design-system.md +83 -29
- package/docs/dsl.md +614 -133
- package/docs/getting-started.md +80 -43
- package/docs/injector.md +159 -53
- package/docs/methodology.md +178 -31
- 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 +351 -0
- package/docs/ssr.md +356 -128
- package/docs/styles.md +103 -32
- package/docs/tasty-static.md +227 -65
- package/package.json +83 -22
- 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 -323
- package/dist/config.js +0 -465
- package/dist/config.js.map +0 -1
- package/dist/debug.d.ts +0 -204
- package/dist/debug.js +0 -733
- package/dist/debug.js.map +0 -1
- package/dist/hooks/useGlobalStyles.d.ts +0 -30
- package/dist/hooks/useGlobalStyles.js +0 -83
- package/dist/hooks/useGlobalStyles.js.map +0 -1
- package/dist/hooks/useKeyframes.d.ts +0 -56
- package/dist/hooks/useKeyframes.js +0 -69
- package/dist/hooks/useKeyframes.js.map +0 -1
- package/dist/hooks/useProperty.d.ts +0 -79
- package/dist/hooks/useProperty.js +0 -114
- package/dist/hooks/useProperty.js.map +0 -1
- package/dist/hooks/useRawCSS.d.ts +0 -53
- package/dist/hooks/useRawCSS.js +0 -40
- package/dist/hooks/useRawCSS.js.map +0 -1
- package/dist/hooks/useStyles.d.ts +0 -45
- package/dist/hooks/useStyles.js +0 -249
- package/dist/hooks/useStyles.js.map +0 -1
- package/dist/injector/index.d.ts +0 -165
- package/dist/injector/index.js +0 -162
- package/dist/injector/index.js.map +0 -1
- package/dist/injector/injector.d.ts +0 -148
- package/dist/injector/injector.js +0 -430
- package/dist/injector/injector.js.map +0 -1
- package/dist/injector/sheet-manager.d.ts +0 -136
- package/dist/injector/sheet-manager.js +0 -729
- package/dist/injector/sheet-manager.js.map +0 -1
- package/dist/injector/types.d.ts +0 -144
- 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 -33
- 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 -53
- package/dist/pipeline/index.js +0 -670
- package/dist/pipeline/index.js.map +0 -1
- package/dist/pipeline/materialize.js +0 -1105
- 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/astro.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 -85
- package/dist/ssr/collector.js +0 -183
- 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 -169
- 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 -47
- package/dist/styles/preset.js +0 -126
- 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 -508
- 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 -981
- package/dist/tasty.js +0 -219
- 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 -45
- 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 -228
- 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 -101
- package/dist/utils/styles.js +0 -223
- package/dist/utils/styles.js.map +0 -1
- package/dist/utils/typography.d.ts +0 -47
- package/dist/utils/typography.js +0 -43
- 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 -291
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,44 +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
|
|
|
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.
|
|
139
|
+
|
|
133
140
|
### With Configuration
|
|
134
141
|
|
|
135
142
|
```javascript
|
|
136
143
|
module.exports = {
|
|
137
144
|
plugins: [
|
|
138
|
-
[
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
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,
|
|
145
156
|
},
|
|
146
|
-
devMode: true,
|
|
147
157
|
},
|
|
148
|
-
|
|
149
|
-
]
|
|
158
|
+
],
|
|
159
|
+
],
|
|
150
160
|
};
|
|
151
161
|
```
|
|
152
162
|
|
|
153
163
|
### Plugin Options
|
|
154
164
|
|
|
155
|
-
| Option
|
|
156
|
-
|
|
157
|
-
| `output`
|
|
158
|
-
| `
|
|
159
|
-
| `
|
|
160
|
-
| `
|
|
161
|
-
| `
|
|
162
|
-
| `
|
|
163
|
-
| `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
|
+
```
|
|
164
205
|
|
|
165
206
|
---
|
|
166
207
|
|
|
@@ -172,16 +213,24 @@ Recipes work with `tastyStatic` the same way as with runtime `tasty`:
|
|
|
172
213
|
// babel.config.js
|
|
173
214
|
module.exports = {
|
|
174
215
|
plugins: [
|
|
175
|
-
[
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
+
},
|
|
181
230
|
},
|
|
182
231
|
},
|
|
183
|
-
|
|
184
|
-
]
|
|
232
|
+
],
|
|
233
|
+
],
|
|
185
234
|
};
|
|
186
235
|
```
|
|
187
236
|
|
|
@@ -193,7 +242,7 @@ const card = tastyStatic({
|
|
|
193
242
|
color: '#text',
|
|
194
243
|
});
|
|
195
244
|
|
|
196
|
-
<div className={card}>Styled card</div
|
|
245
|
+
<div className={card}>Styled card</div>;
|
|
197
246
|
```
|
|
198
247
|
|
|
199
248
|
---
|
|
@@ -204,7 +253,7 @@ The `withTastyZero` wrapper configures both **webpack** and **Turbopack** automa
|
|
|
204
253
|
|
|
205
254
|
```typescript
|
|
206
255
|
// next.config.ts
|
|
207
|
-
import { withTastyZero } from '@tenphi/tasty/next';
|
|
256
|
+
import { withTastyZero } from '@tenphi/tasty/zero/next';
|
|
208
257
|
|
|
209
258
|
export default withTastyZero({
|
|
210
259
|
output: 'public/tasty.css',
|
|
@@ -217,13 +266,14 @@ export default withTastyZero({
|
|
|
217
266
|
|
|
218
267
|
### `withTastyZero` Options
|
|
219
268
|
|
|
220
|
-
| Option
|
|
221
|
-
|
|
222
|
-
| `output`
|
|
223
|
-
| `
|
|
224
|
-
| `
|
|
225
|
-
| `
|
|
226
|
-
| `
|
|
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) |
|
|
227
277
|
|
|
228
278
|
### Turbopack Support
|
|
229
279
|
|
|
@@ -261,12 +311,15 @@ export default defineConfig({
|
|
|
261
311
|
react({
|
|
262
312
|
babel: {
|
|
263
313
|
plugins: [
|
|
264
|
-
[
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
314
|
+
[
|
|
315
|
+
'@tenphi/tasty/babel-plugin',
|
|
316
|
+
{
|
|
317
|
+
output: 'public/tasty.css',
|
|
318
|
+
config: {
|
|
319
|
+
states: { '@mobile': '@media(w < 768px)' },
|
|
320
|
+
},
|
|
268
321
|
},
|
|
269
|
-
|
|
322
|
+
],
|
|
270
323
|
],
|
|
271
324
|
},
|
|
272
325
|
}),
|
|
@@ -300,7 +353,9 @@ export const Button = () => <button className={button}>Click</button>;
|
|
|
300
353
|
const button = {
|
|
301
354
|
className: 'ts3f2a1b ts8c4d2e',
|
|
302
355
|
styles: { padding: '2x 4x', fill: '#purple', color: '#white' },
|
|
303
|
-
toString() {
|
|
356
|
+
toString() {
|
|
357
|
+
return this.className;
|
|
358
|
+
},
|
|
304
359
|
};
|
|
305
360
|
|
|
306
361
|
export const Button = () => <button className={button}>Click</button>;
|
|
@@ -329,6 +384,101 @@ export const Button = () => <button className={button}>Click</button>;
|
|
|
329
384
|
|
|
330
385
|
---
|
|
331
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
|
+
|
|
332
482
|
## Style Extension
|
|
333
483
|
|
|
334
484
|
```tsx
|
|
@@ -393,13 +543,15 @@ For dynamic styling needs, combine with regular CSS or CSS variables:
|
|
|
393
543
|
```tsx
|
|
394
544
|
const card = tastyStatic({
|
|
395
545
|
padding: '4x',
|
|
396
|
-
fill: '
|
|
546
|
+
fill: '($card-bg, #white)',
|
|
397
547
|
});
|
|
398
548
|
|
|
399
549
|
<div
|
|
400
550
|
className={card}
|
|
401
|
-
style={{
|
|
402
|
-
|
|
551
|
+
style={{
|
|
552
|
+
'--card-bg': isActive ? 'var(--purple-color)' : 'var(--white-color)',
|
|
553
|
+
}}
|
|
554
|
+
/>;
|
|
403
555
|
```
|
|
404
556
|
|
|
405
557
|
---
|
|
@@ -413,8 +565,18 @@ const card = tastyStatic({
|
|
|
413
565
|
|
|
414
566
|
---
|
|
415
567
|
|
|
568
|
+
## Common Issues
|
|
569
|
+
|
|
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.
|
|
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()`.
|
|
572
|
+
- Turbopack config behaves inconsistently: prefer `configFile` over inline functions so the setup stays JSON-serializable.
|
|
573
|
+
|
|
574
|
+
---
|
|
575
|
+
|
|
416
576
|
## Related
|
|
417
577
|
|
|
578
|
+
- [Docs Hub](README.md) — Choose the right guide by task or CSS delivery model
|
|
418
579
|
- [Style DSL](dsl.md) — State maps, tokens, units, extending semantics (shared by runtime and static)
|
|
419
|
-
- [
|
|
580
|
+
- [React API](react-api.md) — Client or server rendering with `tasty()`: component props, variants, sub-elements, and style functions
|
|
420
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.bbd36bd",
|
|
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"
|
|
@@ -47,11 +52,41 @@
|
|
|
47
52
|
"import": "./dist/ssr/next.js",
|
|
48
53
|
"default": "./dist/ssr/next.js"
|
|
49
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
|
+
},
|
|
50
60
|
"./ssr/astro": {
|
|
51
61
|
"types": "./dist/ssr/astro.d.ts",
|
|
52
62
|
"import": "./dist/ssr/astro.js",
|
|
53
63
|
"default": "./dist/ssr/astro.js"
|
|
54
64
|
},
|
|
65
|
+
"./ssr/astro-client": {
|
|
66
|
+
"types": "./dist/ssr/astro-client.d.ts",
|
|
67
|
+
"import": "./dist/ssr/astro-client.js",
|
|
68
|
+
"default": "./dist/ssr/astro-client.js"
|
|
69
|
+
},
|
|
70
|
+
"./ssr/astro-middleware": {
|
|
71
|
+
"types": "./dist/ssr/astro-middleware.d.ts",
|
|
72
|
+
"import": "./dist/ssr/astro-middleware.js",
|
|
73
|
+
"default": "./dist/ssr/astro-middleware.js"
|
|
74
|
+
},
|
|
75
|
+
"./ssr/astro-middleware-static": {
|
|
76
|
+
"types": "./dist/ssr/astro-middleware-static.d.ts",
|
|
77
|
+
"import": "./dist/ssr/astro-middleware-static.js",
|
|
78
|
+
"default": "./dist/ssr/astro-middleware-static.js"
|
|
79
|
+
},
|
|
80
|
+
"./ssr/astro-middleware-extract": {
|
|
81
|
+
"types": "./dist/ssr/astro-middleware-extract.d.ts",
|
|
82
|
+
"import": "./dist/ssr/astro-middleware-extract.js",
|
|
83
|
+
"default": "./dist/ssr/astro-middleware-extract.js"
|
|
84
|
+
},
|
|
85
|
+
"./ssr/astro-middleware-extract-static": {
|
|
86
|
+
"types": "./dist/ssr/astro-middleware-extract-static.d.ts",
|
|
87
|
+
"import": "./dist/ssr/astro-middleware-extract-static.js",
|
|
88
|
+
"default": "./dist/ssr/astro-middleware-extract-static.js"
|
|
89
|
+
},
|
|
55
90
|
"./tasty.config": "./tasty.config.ts"
|
|
56
91
|
},
|
|
57
92
|
"files": [
|
|
@@ -62,7 +97,12 @@
|
|
|
62
97
|
"sideEffects": [
|
|
63
98
|
"./dist/ssr/index.js",
|
|
64
99
|
"./dist/ssr/next.js",
|
|
65
|
-
"./dist/ssr/astro.js"
|
|
100
|
+
"./dist/ssr/astro.js",
|
|
101
|
+
"./dist/ssr/astro-client.js",
|
|
102
|
+
"./dist/ssr/astro-middleware.js",
|
|
103
|
+
"./dist/ssr/astro-middleware-static.js",
|
|
104
|
+
"./dist/ssr/astro-middleware-extract.js",
|
|
105
|
+
"./dist/ssr/astro-middleware-extract-static.js"
|
|
66
106
|
],
|
|
67
107
|
"engines": {
|
|
68
108
|
"node": ">=20"
|
|
@@ -70,6 +110,9 @@
|
|
|
70
110
|
"scripts": {
|
|
71
111
|
"build": "tsdown",
|
|
72
112
|
"test": "vitest run",
|
|
113
|
+
"test:node": "vitest run --project node",
|
|
114
|
+
"test:browser": "vitest run --project browser",
|
|
115
|
+
"test:setup": "playwright install chromium",
|
|
73
116
|
"test:watch": "vitest",
|
|
74
117
|
"test:coverage": "vitest run --coverage",
|
|
75
118
|
"typecheck": "tsc --noEmit",
|
|
@@ -78,10 +121,18 @@
|
|
|
78
121
|
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
79
122
|
"format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
|
|
80
123
|
"size": "size-limit",
|
|
124
|
+
"bench": "vitest bench --project node",
|
|
125
|
+
"bench:browser": "vitest bench --project browser",
|
|
126
|
+
"bench:overhead": "vitest bench --config vitest.production-browser-bench.config.ts src/tasty-overhead.bench.tsx",
|
|
127
|
+
"bench:injection": "vitest bench --config vitest.production-browser-bench.config.ts src/tasty-injection.bench.ts",
|
|
128
|
+
"bench:interaction": "vitest bench --config vitest.production-browser-bench.config.ts src/tasty-interaction.bench.tsx",
|
|
129
|
+
"bench:cold-start": "node scripts/cold-start/index.mjs",
|
|
81
130
|
"prepublishOnly": "pnpm run build",
|
|
82
131
|
"changeset": "changeset",
|
|
83
132
|
"version": "changeset version",
|
|
84
133
|
"release": "changeset publish",
|
|
134
|
+
"knip": "knip",
|
|
135
|
+
"check:test-only": "node scripts/check-test-only-code.mjs",
|
|
85
136
|
"hygiene": "pnpm lint && pnpm format:check && pnpm typecheck",
|
|
86
137
|
"hygiene:fix": "pnpm lint:fix && pnpm format && pnpm typecheck"
|
|
87
138
|
},
|
|
@@ -111,6 +162,7 @@
|
|
|
111
162
|
"@babel/helper-plugin-utils": "^7.24.0",
|
|
112
163
|
"@babel/types": "^7.24.0",
|
|
113
164
|
"jiti": "^2.6.1",
|
|
165
|
+
"next": ">=14.0.0",
|
|
114
166
|
"react": "^18.0.0 || ^19.0.0"
|
|
115
167
|
},
|
|
116
168
|
"peerDependenciesMeta": {
|
|
@@ -128,60 +180,69 @@
|
|
|
128
180
|
},
|
|
129
181
|
"jiti": {
|
|
130
182
|
"optional": true
|
|
183
|
+
},
|
|
184
|
+
"next": {
|
|
185
|
+
"optional": true
|
|
131
186
|
}
|
|
132
187
|
},
|
|
133
188
|
"dependencies": {
|
|
134
189
|
"csstype": "^3.1.0"
|
|
135
190
|
},
|
|
136
191
|
"devDependencies": {
|
|
192
|
+
"@astrojs/react": "^4.4.2",
|
|
137
193
|
"@babel/core": "^7.24.0",
|
|
138
|
-
"@
|
|
194
|
+
"@babel/helper-plugin-utils": "^7.24.0",
|
|
195
|
+
"@babel/types": "^7.24.0",
|
|
196
|
+
"@changesets/changelog-github": "^0.7.0",
|
|
139
197
|
"@changesets/cli": "^2.29.8",
|
|
140
198
|
"@eslint/js": "^10.0.1",
|
|
141
199
|
"@size-limit/esbuild": "^12.0.0",
|
|
142
200
|
"@size-limit/file": "^12.0.0",
|
|
201
|
+
"@tenphi/eslint-plugin-tasty": "^1.0.5",
|
|
143
202
|
"@testing-library/jest-dom": "^6.9.1",
|
|
144
203
|
"@testing-library/react": "^16.3.2",
|
|
145
204
|
"@types/babel__core": "^7.20.5",
|
|
146
205
|
"@types/babel__helper-plugin-utils": "^7.10.3",
|
|
147
|
-
"@types/node": "^
|
|
206
|
+
"@types/node": "^26.4.0",
|
|
148
207
|
"@types/react": "^19.0.0",
|
|
149
|
-
"@
|
|
208
|
+
"@types/react-dom": "^19.0.0",
|
|
209
|
+
"@vitest/browser-playwright": "^4.1.10",
|
|
210
|
+
"astro": "^5.18.2",
|
|
211
|
+
"esbuild": "^0.27.7",
|
|
150
212
|
"eslint": "^10.0.0",
|
|
151
213
|
"eslint-config-prettier": "^10.1.8",
|
|
152
|
-
"
|
|
153
|
-
"
|
|
214
|
+
"jiti": "^2.6.1",
|
|
215
|
+
"knip": "^5.61.3",
|
|
216
|
+
"next": "^16.0.0",
|
|
217
|
+
"playwright": "^1.62.1",
|
|
218
|
+
"prettier": "^3.9.6",
|
|
154
219
|
"react": "^19.0.0",
|
|
220
|
+
"react-dom": "^19.0.0",
|
|
155
221
|
"size-limit": "^12.0.0",
|
|
156
|
-
"tsdown": "^0.
|
|
157
|
-
"typescript": "^
|
|
222
|
+
"tsdown": "^0.22.0",
|
|
223
|
+
"typescript": "^6.0.2",
|
|
158
224
|
"typescript-eslint": "^8.56.0",
|
|
159
|
-
"vitest": "^4.
|
|
160
|
-
},
|
|
161
|
-
"pnpm": {
|
|
162
|
-
"onlyBuiltDependencies": [
|
|
163
|
-
"esbuild"
|
|
164
|
-
]
|
|
225
|
+
"vitest": "^4.1.10"
|
|
165
226
|
},
|
|
166
|
-
"packageManager": "pnpm@
|
|
227
|
+
"packageManager": "pnpm@11.24.0",
|
|
167
228
|
"size-limit": [
|
|
168
229
|
{
|
|
169
230
|
"name": "main (import *)",
|
|
170
231
|
"path": "dist/index.js",
|
|
171
232
|
"import": "*",
|
|
172
|
-
"limit": "
|
|
233
|
+
"limit": "57.5 kB"
|
|
173
234
|
},
|
|
174
235
|
{
|
|
175
236
|
"name": "core (import *)",
|
|
176
237
|
"path": "dist/core/index.js",
|
|
177
238
|
"import": "*",
|
|
178
|
-
"limit": "
|
|
239
|
+
"limit": "54.5 kB"
|
|
179
240
|
},
|
|
180
241
|
{
|
|
181
242
|
"name": "static",
|
|
182
243
|
"path": "dist/static/index.js",
|
|
183
244
|
"import": "*",
|
|
184
|
-
"limit": "
|
|
245
|
+
"limit": "16.8 kB"
|
|
185
246
|
},
|
|
186
247
|
{
|
|
187
248
|
"name": "zero",
|
|
@@ -192,7 +253,7 @@
|
|
|
192
253
|
"path",
|
|
193
254
|
"crypto"
|
|
194
255
|
],
|
|
195
|
-
"limit": "
|
|
256
|
+
"limit": "31.25 kB"
|
|
196
257
|
},
|
|
197
258
|
{
|
|
198
259
|
"name": "babel-plugin",
|
|
@@ -203,7 +264,7 @@
|
|
|
203
264
|
"path",
|
|
204
265
|
"crypto"
|
|
205
266
|
],
|
|
206
|
-
"limit": "
|
|
267
|
+
"limit": "49.6 kB"
|
|
207
268
|
}
|
|
208
269
|
]
|
|
209
270
|
}
|
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
|
};
|