styleframe 3.6.0 → 3.8.0

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.
Files changed (2) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/package.json +13 -16
package/CHANGELOG.md CHANGED
@@ -1,5 +1,87 @@
1
1
  # styleframe
2
2
 
3
+ ## 3.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#234](https://github.com/styleframe-dev/styleframe/pull/234) [`c7ff8c8`](https://github.com/styleframe-dev/styleframe/commit/c7ff8c89776b2e117b0f45f3e1f8ca6695f24a29) Thanks [@alexgrozav](https://github.com/alexgrozav)! - Add recipe-level tree-shaking. Unused recipes and their utility classes are excluded from the CSS and TypeScript consumer module during production builds.
8
+ - **Core**: `Root._usage` gains `recipes` and `recipeUtilities` fields. Recipe utility class names are tracked per-recipe in `recipeUtilities` and promoted to `utilities` via `registerRecipeUtilities()`.
9
+ - **Scanner**: New `scanImports()` and `scanFileImports()` methods use importree v2's `parseImports()` to detect which recipes are imported from `virtual:styleframe`.
10
+ - **Transpiler**: TS and DTS consumers filter recipes by `_usage.recipes` — only emitting used recipes when the set is populated.
11
+ - **Plugin**: Recipe scanning integrated into the build flow after content scanning. Defaults to tree-shaking ON for builds, OFF for dev. Safety: namespace/dynamic imports include all recipes with a warning. `recipes.include` option provides an escape hatch for force-including recipes.
12
+
13
+ - [#228](https://github.com/styleframe-dev/styleframe/pull/228) [`770ecca`](https://github.com/styleframe-dev/styleframe/commit/770ecca2dbf3cb4afa7406e310ba74b0dfcfdad7) Thanks [@alexgrozav](https://github.com/alexgrozav)! - Add dynamic utility creation for unmatched CSS properties.
14
+
15
+ Automatically creates utility factories on-the-fly for unmatched class names that correspond to known CSS properties. Enables fallback support for arbitrary CSS values without pre-registration (e.g., `_display:flex`, `_background:[red]`). Includes comprehensive test coverage for dynamic factory creation, deduplication, and modifier preservation.
16
+
17
+ - [#226](https://github.com/styleframe-dev/styleframe/pull/226) [`dc99d46`](https://github.com/styleframe-dev/styleframe/commit/dc99d4699046f5e5f3dcac965648fd50b0339412) Thanks [@alexgrozav](https://github.com/alexgrozav)! - Add build-time utility class name shortening for production builds.
18
+
19
+ Generates shortening maps at transpile time with collision-safe abbreviation and built-in defaults for common CSS properties. Hashes long arbitrary values for stable compact names. Supports underscore-as-space in arbitrary values (`_padding:[10px_20px]`). Exposes `minify` plugin option with user-overridable defaults.
20
+
21
+ - [#224](https://github.com/styleframe-dev/styleframe/pull/224) [`6941920`](https://github.com/styleframe-dev/styleframe/commit/6941920a50e560e4686aebd154bb6aea4c59c258) Thanks [@alexgrozav](https://github.com/alexgrozav)! - Export named Props types from `virtual:styleframe` for each recipe (e.g. `import { button, type ButtonProps } from 'virtual:styleframe'`).
22
+
23
+ ### Patch Changes
24
+
25
+ - [#222](https://github.com/styleframe-dev/styleframe/pull/222) [`80f84dd`](https://github.com/styleframe-dev/styleframe/commit/80f84dd9c32ec3361c69b30f5a9c725b2e1b8fc2) Thanks [@alexgrozav](https://github.com/alexgrozav)! - Fix `chat-message` recipe `side="end"` alignment.
26
+
27
+ The `side="end"` variant now correctly packs the avatar and content group to the right side of the container. Three issues were resolved:
28
+ - Root recipe: `justify-content` was `flex-end` which, combined with `flex-direction: row-reverse`, pushed items to the left. Changed to `flex-start`.
29
+ - Content recipe: added `side` variant with `alignSelf: flex-end` so the bubble right-aligns within its column stack.
30
+ - Actions recipe: added `side` variant with `justifyContent: flex-end` so action buttons align under the bubble.
31
+
32
+ - [#235](https://github.com/styleframe-dev/styleframe/pull/235) [`6acd766`](https://github.com/styleframe-dev/styleframe/commit/6acd766eefc82139d8cd98dfb9b553449945d704) Thanks [@alexgrozav](https://github.com/alexgrozav)! - Generate DTS output as two files that describe the virtual modules in two complementary forms. The transpiler's `dts` mode now emits:
33
+ - `styleframe.d.ts` — top-level exports describing the `virtual:styleframe` module
34
+ - `shims.d.ts` — self-contained ambient declarations: a `declare module "virtual:styleframe"` carrying the full typed exports, plus the `virtual:styleframe.css` string shim
35
+
36
+ Non-Vue consumers resolve both virtual modules from `shims.d.ts` alone (picked up via the `.styleframe/**/*.d.ts` include) with **zero `paths` configuration**. Vue consumers additionally map `virtual:styleframe` to `styleframe.d.ts` via a `compilerOptions.paths` entry, because `vue-tsc` won't resolve a bare-specifier ambient module imported inside a `.vue` SFC. `styleframe init` detects plain Vue projects (a `vue` dependency without `nuxt`) and writes that `paths` entry only for them, merging into any existing `paths`; non-Vue projects just get the includes. Nuxt is excluded because its module already injects the mapping via `prepare:types`, and writing `paths` into an `extends`-based Nuxt root tsconfig would replace (not merge) Nuxt's inherited aliases.
37
+
38
+ The Nuxt module registers the same `virtual:styleframe` path mapping into Nuxt's generated types via the `prepare:types` hook, so imports type-check without manual tsconfig changes. It also fixes the module's `configKey`/`name`, which were leftover `unpluginStarter` placeholders that caused `styleframe: {}` options in `nuxt.config` to be ignored.
39
+
40
+ - [#232](https://github.com/styleframe-dev/styleframe/pull/232) [`83d39dd`](https://github.com/styleframe-dev/styleframe/commit/83d39ddaf1739a22d2cc8b4a6a509fa490e30fee) Thanks [@alexgrozav](https://github.com/alexgrozav)! - Update importree from v1 to v2. Adapt dependency graph merging to the new `ImportEdge[]` type in `graph` and `reverseGraph`.
41
+
42
+ - [#233](https://github.com/styleframe-dev/styleframe/pull/233) [`0ef38e6`](https://github.com/styleframe-dev/styleframe/commit/0ef38e69ca941cefab31463c23980f52cae1541f) Thanks [@alexgrozav](https://github.com/alexgrozav)! - Migrate from Vite 7 to Vite 8 with native Rolldown integration. Replace esbuild transforms with Oxc in the plugin, rename `rollupOptions` to `rolldownOptions`, upgrade `vite-plugin-dts` v4 to v5 (`rollupTypes` → `bundleTypes`), and bump vitest from v3 to v4.
43
+
44
+ - Updated dependencies [[`c0cfbdc`](https://github.com/styleframe-dev/styleframe/commit/c0cfbdc65ddca0b5ea4a420902be2a23580b392f), [`19e9866`](https://github.com/styleframe-dev/styleframe/commit/19e986618c669546972924840189fc5f16f1a1cd), [`c7ff8c8`](https://github.com/styleframe-dev/styleframe/commit/c7ff8c89776b2e117b0f45f3e1f8ca6695f24a29), [`6acd766`](https://github.com/styleframe-dev/styleframe/commit/6acd766eefc82139d8cd98dfb9b553449945d704), [`83d39dd`](https://github.com/styleframe-dev/styleframe/commit/83d39ddaf1739a22d2cc8b4a6a509fa490e30fee), [`dc99d46`](https://github.com/styleframe-dev/styleframe/commit/dc99d4699046f5e5f3dcac965648fd50b0339412), [`6941920`](https://github.com/styleframe-dev/styleframe/commit/6941920a50e560e4686aebd154bb6aea4c59c258), [`0ef38e6`](https://github.com/styleframe-dev/styleframe/commit/0ef38e69ca941cefab31463c23980f52cae1541f)]:
45
+ - @styleframe/cli@4.1.0
46
+ - @styleframe/core@3.6.0
47
+ - @styleframe/transpiler@3.4.0
48
+ - @styleframe/plugin@3.4.0
49
+ - @styleframe/loader@3.0.2
50
+
51
+ ## 3.7.0
52
+
53
+ ### Minor Changes
54
+
55
+ - [#221](https://github.com/styleframe-dev/styleframe/pull/221) [`6d406c2`](https://github.com/styleframe-dev/styleframe/commit/6d406c289b39c666a3fb7468aa3ec08f5a6d316b) Thanks [@alexgrozav](https://github.com/alexgrozav)! - Add `treeshake` option to remove unused variables from CSS output.
56
+
57
+ `root._usage` now tracks both `variables` and `utilities` referenced during config execution and scanner registration. The transpiler's new `treeshake: true` option filters `root.variables` and theme variables down to only those present in `_usage.variables`. The plugin enables treeshaking by default when generating global CSS.
58
+
59
+ - [#215](https://github.com/styleframe-dev/styleframe/pull/215) [`43f8f4f`](https://github.com/styleframe-dev/styleframe/commit/43f8f4f322d120def777262277aa40c5d84736a8) Thanks [@alexgrozav](https://github.com/alexgrozav)! - Unify fluid and fixed font sizes under `useFontSizeDesignTokens`. Tuple `[min, max]` and object `{ min, max }` values are now treated as **absolute pixel ranges** and routed through `useFluidClamp`; plain `TokenValue` values stay static. The same call accepts mixed fluid + fixed entries.
60
+
61
+ ```ts
62
+ useFontSizeDesignTokens(s, {
63
+ default: "@font-size.md",
64
+ md: [16, 18], // fluid
65
+ sm: "0.8rem", // fixed
66
+ lg: { min: 18, max: 24 }, // fluid (object form)
67
+ });
68
+ ```
69
+
70
+ Breaking changes:
71
+ - `useFluidFontSizeDesignTokens` is removed. Pass ranges directly to `useFontSizeDesignTokens` instead.
72
+ - `useDesignTokensPreset`'s `fluidFontSize.values` config now expects the unified `FontSizeValue` (`TokenValue | RangeInput<TokenValue>`) per key. Existing `[min, max]` / `{ min, max }` shapes still work but are interpreted as **absolute pixels**, not multipliers of a base.
73
+ - When `fluidFontSize` is enabled and the user passes their own `fontSize` config, those values now win over the fluid defaults instead of being silently dropped.
74
+ - `fontSizeValues` is renamed to `fontSizeStaticValues`. The pixel base used by the default fluid scale is emitted as configurable CSS variables (`--font-size--min: 16;` / `--font-size--max: 18;`); each fluid `font-size.*` `calc()` references them via `var()`, so the base can be retargeted by overriding those custom properties.
75
+
76
+ Internal: `createUseVariable` gains a `fluid?: boolean` opt-in flag plus a `breakpoint` options-bag arg on the returned composable, so any composable can adopt range-aware values with a single line.
77
+
78
+ ### Patch Changes
79
+
80
+ - Updated dependencies [[`6d406c2`](https://github.com/styleframe-dev/styleframe/commit/6d406c289b39c666a3fb7468aa3ec08f5a6d316b)]:
81
+ - @styleframe/core@3.5.0
82
+ - @styleframe/transpiler@3.3.0
83
+ - @styleframe/plugin@3.3.0
84
+
3
85
  ## 3.6.0
4
86
 
5
87
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "styleframe",
3
- "version": "3.6.0",
3
+ "version": "3.8.0",
4
4
  "bin": {
5
5
  "styleframe": "./dist/cli.js"
6
6
  },
@@ -84,28 +84,28 @@
84
84
  "access": "public"
85
85
  },
86
86
  "dependencies": {
87
- "@styleframe/cli": "^4.0.0",
87
+ "@styleframe/cli": "^4.1.0",
88
88
  "@styleframe/license": "^2.0.2"
89
89
  },
90
90
  "peerDependencies": {
91
- "@styleframe/plugin": "^3.2.0",
92
- "@styleframe/core": "^3.4.0",
93
- "@styleframe/loader": "^3.0.1",
94
- "@styleframe/transpiler": "^3.2.0"
91
+ "@styleframe/plugin": "^3.4.0",
92
+ "@styleframe/core": "^3.6.0",
93
+ "@styleframe/loader": "^3.0.2",
94
+ "@styleframe/transpiler": "^3.4.0"
95
95
  },
96
96
  "devDependencies": {
97
97
  "@styleframe/config-typescript": "^3.0.0",
98
- "@styleframe/cli": "^4.0.0",
99
- "@styleframe/plugin": "^3.2.0",
100
- "@styleframe/core": "^3.4.0",
101
- "@styleframe/loader": "^3.0.1",
102
- "@styleframe/transpiler": "^3.2.0",
98
+ "@styleframe/cli": "^4.1.0",
99
+ "@styleframe/plugin": "^3.4.0",
100
+ "@styleframe/core": "^3.6.0",
101
+ "@styleframe/loader": "^3.0.2",
102
+ "@styleframe/transpiler": "^3.4.0",
103
103
  "@types/node": "^22.15.17",
104
- "@vitest/coverage-v8": "^3.2.4",
104
+ "@vitest/coverage-v8": "^4.1.7",
105
105
  "bumpp": "^10.1.0",
106
106
  "tsdown": "^0.11.9",
107
107
  "typescript": "^5.8.3",
108
- "vitest": "^3.1.3"
108
+ "vitest": "^4.1.7"
109
109
  },
110
110
  "homepage": "https://github.com/styleframe-dev/styleframe#readme",
111
111
  "bugs": {
@@ -116,9 +116,6 @@
116
116
  "url": "git+https://github.com/styleframe-dev/styleframe.git"
117
117
  },
118
118
  "author": "Alex Grozav <alex@styleframe.dev>",
119
- "overrides": {
120
- "vite": "npm:rolldown-vite@latest"
121
- },
122
119
  "scripts": {
123
120
  "build": "tsdown",
124
121
  "dev": "tsdown --watch",