@styleframe/core 3.5.0 → 3.6.1
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/CHANGELOG.md +24 -0
- package/dist/{styleframe.d.ts → index.d.cts} +19 -0
- package/dist/index.d.mts +665 -0
- package/dist/index.d.ts +665 -0
- package/dist/styleframe.js +815 -988
- package/dist/styleframe.umd.cjs +1 -1
- package/package.json +16 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @styleframe/core
|
|
2
2
|
|
|
3
|
+
## 3.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#238](https://github.com/styleframe-dev/styleframe/pull/238) [`4ace91d`](https://github.com/styleframe-dev/styleframe/commit/4ace91d5e15020c29d585848ee66f6250946b2d1) Thanks [@alexgrozav](https://github.com/alexgrozav)! - Bundle type declarations on build. The shared Vite config now enables `vite-plugin-dts`'s `bundleTypes`, so each package ships a single rolled-up `.d.ts` per entry (via `@microsoft/api-extractor`) instead of a tree of per-file declarations. `@microsoft/api-extractor` is now a peer dependency of `@styleframe/config-vite`.
|
|
8
|
+
|
|
9
|
+
## 3.6.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#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.
|
|
14
|
+
- **Core**: `Root._usage` gains `recipes` and `recipeUtilities` fields. Recipe utility class names are tracked per-recipe in `recipeUtilities` and promoted to `utilities` via `registerRecipeUtilities()`.
|
|
15
|
+
- **Scanner**: New `scanImports()` and `scanFileImports()` methods use importree v2's `parseImports()` to detect which recipes are imported from `virtual:styleframe`.
|
|
16
|
+
- **Transpiler**: TS and DTS consumers filter recipes by `_usage.recipes` — only emitting used recipes when the set is populated.
|
|
17
|
+
- **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.
|
|
18
|
+
|
|
19
|
+
- [#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.
|
|
20
|
+
|
|
21
|
+
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.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#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.
|
|
26
|
+
|
|
3
27
|
## 3.5.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
|
@@ -467,6 +467,14 @@ export declare type Reference<Name extends string = string> = {
|
|
|
467
467
|
|
|
468
468
|
export declare type RefFunction = (variable: string, fallback?: string) => Reference;
|
|
469
469
|
|
|
470
|
+
/**
|
|
471
|
+
* Promotes recipe utility class names from `_usage.recipeUtilities` into `_usage.utilities`.
|
|
472
|
+
*
|
|
473
|
+
* When called without `recipeNames`, promotes all recipes (backward-compatible default).
|
|
474
|
+
* When called with a set of recipe names, only promotes matching entries.
|
|
475
|
+
*/
|
|
476
|
+
export declare function registerRecipeUtilities(root: Root, recipeNames?: Set<string>): void;
|
|
477
|
+
|
|
470
478
|
export declare function rfdc<T = any>(opts?: RfdcOptions): CloneFunction<T>;
|
|
471
479
|
|
|
472
480
|
declare interface RfdcOptions {
|
|
@@ -490,6 +498,8 @@ export declare type Root = {
|
|
|
490
498
|
_usage: {
|
|
491
499
|
variables: Set<string>;
|
|
492
500
|
utilities: Set<string>;
|
|
501
|
+
recipes: Set<string>;
|
|
502
|
+
recipeUtilities: Map<string, Set<string>>;
|
|
493
503
|
};
|
|
494
504
|
};
|
|
495
505
|
|
|
@@ -510,6 +520,15 @@ export declare type Selector = {
|
|
|
510
520
|
_exportName?: string;
|
|
511
521
|
};
|
|
512
522
|
|
|
523
|
+
export declare type ShorteningMap = {
|
|
524
|
+
/** Property name shortening: e.g. "margin-top" -> "mt" */
|
|
525
|
+
p: Record<string, string>;
|
|
526
|
+
/** Value shortening: e.g. "primary" -> "p" */
|
|
527
|
+
v: Record<string, string>;
|
|
528
|
+
/** Modifier shortening: e.g. "hover" -> "h" */
|
|
529
|
+
m: Record<string, string>;
|
|
530
|
+
};
|
|
531
|
+
|
|
513
532
|
export declare interface Styleframe {
|
|
514
533
|
id: string;
|
|
515
534
|
root: Root;
|