@csszyx/unplugin 0.6.2 → 0.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.
@@ -1,4 +1,4 @@
1
- import { w as webpackPlugin } from './unplugin-DUbr5w-N.cjs';
1
+ import { w as webpackPlugin } from './shared/unplugin.DUbr5w-N.cjs';
2
2
  import '@csszyx/types';
3
3
  import 'esbuild';
4
4
  import 'rollup';
@@ -7,4 +7,4 @@ import 'vite';
7
7
 
8
8
 
9
9
 
10
- export { webpackPlugin as default };
10
+ export = webpackPlugin;
@@ -1,4 +1,4 @@
1
- import { w as webpackPlugin } from './unplugin-DUbr5w-N.js';
1
+ import { w as webpackPlugin } from './shared/unplugin.DUbr5w-N.mjs';
2
2
  import '@csszyx/types';
3
3
  import 'esbuild';
4
4
  import 'rollup';
@@ -0,0 +1,16 @@
1
+ import { w as webpackPlugin } from './shared/unplugin.DCv0RtVZ.mjs';
2
+ import 'node:fs';
3
+ import 'node:path';
4
+ import '@csszyx/compiler';
5
+ import '@csszyx/core';
6
+ import '@csszyx/svelte-adapter';
7
+ import '@csszyx/vue-adapter';
8
+ import 'unplugin';
9
+ import './css-mangler.mjs';
10
+ import 'postcss';
11
+ import 'postcss-selector-parser';
12
+ import 'node:crypto';
13
+
14
+
15
+
16
+ export { webpackPlugin as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/unplugin",
3
- "version": "0.6.2",
3
+ "version": "0.8.0",
4
4
  "description": "Vite and Webpack integration for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
@@ -25,29 +25,49 @@
25
25
  "type": "module",
26
26
  "exports": {
27
27
  ".": {
28
- "types": "./dist/index.d.ts",
29
- "import": "./dist/index.js",
30
- "require": "./dist/index.cjs"
28
+ "import": {
29
+ "types": "./dist/index.d.mts",
30
+ "default": "./dist/index.mjs"
31
+ },
32
+ "require": {
33
+ "types": "./dist/index.d.cts",
34
+ "default": "./dist/index.cjs"
35
+ }
31
36
  },
32
37
  "./vite": {
33
- "types": "./dist/vite.d.ts",
34
- "import": "./dist/vite.js",
35
- "require": "./dist/vite.cjs"
38
+ "import": {
39
+ "types": "./dist/vite.d.mts",
40
+ "default": "./dist/vite.mjs"
41
+ },
42
+ "require": {
43
+ "types": "./dist/vite.d.cts",
44
+ "default": "./dist/vite.cjs"
45
+ }
36
46
  },
37
47
  "./webpack": {
38
- "types": "./dist/webpack.d.ts",
39
- "import": "./dist/webpack.js",
40
- "require": "./dist/webpack.cjs"
48
+ "import": {
49
+ "types": "./dist/webpack.d.mts",
50
+ "default": "./dist/webpack.mjs"
51
+ },
52
+ "require": {
53
+ "types": "./dist/webpack.d.cts",
54
+ "default": "./dist/webpack.cjs"
55
+ }
41
56
  },
42
57
  "./css-mangler": {
43
- "types": "./dist/css-mangler.d.ts",
44
- "import": "./dist/css-mangler.js",
45
- "require": "./dist/css-mangler.cjs"
58
+ "import": {
59
+ "types": "./dist/css-mangler.d.mts",
60
+ "default": "./dist/css-mangler.mjs"
61
+ },
62
+ "require": {
63
+ "types": "./dist/css-mangler.d.cts",
64
+ "default": "./dist/css-mangler.cjs"
65
+ }
46
66
  }
47
67
  },
48
68
  "main": "dist/index.cjs",
49
- "module": "dist/index.js",
50
- "types": "dist/index.d.ts",
69
+ "module": "dist/index.mjs",
70
+ "types": "dist/index.d.mts",
51
71
  "files": [
52
72
  "dist"
53
73
  ],
@@ -55,25 +75,29 @@
55
75
  "postcss": "^8.4.35",
56
76
  "postcss-selector-parser": "^6.0.15",
57
77
  "unplugin": "^1.10.1",
58
- "@csszyx/core": "0.6.2",
59
- "@csszyx/compiler": "0.6.2",
60
- "@csszyx/svelte-adapter": "0.6.2",
61
- "@csszyx/types": "0.6.2",
62
- "@csszyx/vue-adapter": "0.6.2"
78
+ "@csszyx/compiler": "0.8.0",
79
+ "@csszyx/core": "0.8.0",
80
+ "@csszyx/svelte-adapter": "0.8.0",
81
+ "@csszyx/vue-adapter": "0.8.0",
82
+ "@csszyx/types": "0.8.0"
63
83
  },
64
84
  "devDependencies": {
65
85
  "@types/node": "^20.11.0",
66
86
  "esbuild": "^0.27.2",
67
87
  "rollup": "^4.56.0",
68
- "tsup": "^8.0.2",
69
- "typescript": "^5.4.5",
70
- "vite": "^7.3.1",
71
- "vitest": "^1.2.0",
72
- "webpack": "^5.104.1"
88
+ "typescript": "^6.0.3",
89
+ "vite": "^8.0.13",
90
+ "vitest": "^4.1.6",
91
+ "webpack": "^5.104.1",
92
+ "unbuild": "^3.6.1"
93
+ },
94
+ "sideEffects": false,
95
+ "engines": {
96
+ "node": ">=22.12.0"
73
97
  },
74
98
  "scripts": {
75
- "build": "tsup src/index.ts src/vite.ts src/webpack.ts src/css-mangler.ts --format esm,cjs --dts --clean",
76
- "dev": "tsup src/index.ts src/vite.ts src/webpack.ts src/css-mangler.ts --format esm --dts --watch",
99
+ "build": "unbuild",
100
+ "dev": "unbuild --stub",
77
101
  "lint": "eslint src",
78
102
  "test": "vitest run",
79
103
  "test:watch": "vitest"
@@ -1,14 +0,0 @@
1
- import {
2
- createPostCSSPlugin,
3
- escapeCSSClassName,
4
- mangleCSS,
5
- mangleCSSSync,
6
- unescapeTailwindClass
7
- } from "./chunk-4M7CPGP7.js";
8
- export {
9
- createPostCSSPlugin,
10
- escapeCSSClassName,
11
- mangleCSS,
12
- mangleCSSSync,
13
- unescapeTailwindClass
14
- };
package/dist/index.d.ts DELETED
@@ -1,58 +0,0 @@
1
- export { CSSManglerOptions, CSSManglerResult, MangleMap, createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.js';
2
- export { u as default, e as esbuildPlugin, m as mangleCodeClassesSync, r as rollupPlugin, u as unplugin, v as vitePlugin, w as webpackPlugin } from './unplugin-DUbr5w-N.js';
3
- import 'postcss';
4
- import '@csszyx/types';
5
- import 'esbuild';
6
- import 'rollup';
7
- import 'unplugin';
8
- import 'vite';
9
-
10
- /**
11
- * Theme Scanner — parses Tailwind v4 @theme blocks from CSS files.
12
- *
13
- * Extracts custom design tokens and categorizes them by type so the
14
- * type writer can generate accurate TypeScript augmentation.
15
- *
16
- * Supports:
17
- * - Multiple @theme blocks per file
18
- * - @theme inline { } syntax (inline keyword ignored)
19
- * - @theme inside @layer (two-pass strip)
20
- * - --color-brand-50 shade suffixes (deduped to 'brand')
21
- * - Multi-file merge via mergeThemes()
22
- */
23
- /** Extracted and categorized custom tokens from @theme blocks. */
24
- interface ParsedTheme {
25
- /** Custom color names (from --color-*): e.g. ['brand', 'brand-dark'] */
26
- colors: string[];
27
- /** Custom spacing tokens (from --spacing-*): e.g. ['xl', '2xs'] */
28
- spacings: string[];
29
- /** Custom font families (from --font-*): e.g. ['display', 'body'] */
30
- fonts: string[];
31
- /** Custom border radii (from --radius-*): e.g. ['button'] */
32
- radii: string[];
33
- /** Custom shadows (from --shadow-*): e.g. ['card'] */
34
- shadows: string[];
35
- }
36
- /**
37
- * Parse all @theme blocks in a CSS file and extract design tokens.
38
- *
39
- * @param cssContent - Raw CSS file content
40
- * @returns Categorized design tokens
41
- */
42
- declare function parseThemeBlocks(cssContent: string): ParsedTheme;
43
- /**
44
- * Merge multiple ParsedTheme objects into one, deduplicating tokens.
45
- *
46
- * @param themes - Array of parsed themes to merge
47
- * @returns Merged theme with unique tokens per category
48
- */
49
- declare function mergeThemes(themes: ParsedTheme[]): ParsedTheme;
50
- /**
51
- * Check if a ParsedTheme has any tokens.
52
- *
53
- * @param theme - Parsed theme to check
54
- * @returns True if at least one category has tokens
55
- */
56
- declare function hasTokens(theme: ParsedTheme): boolean;
57
-
58
- export { type ParsedTheme, hasTokens, mergeThemes, parseThemeBlocks };
package/dist/index.js DELETED
@@ -1,35 +0,0 @@
1
- import {
2
- esbuildPlugin,
3
- hasTokens,
4
- mangleCodeClassesSync,
5
- mergeThemes,
6
- parseThemeBlocks,
7
- rollupPlugin,
8
- unplugin,
9
- vitePlugin,
10
- webpackPlugin
11
- } from "./chunk-JGJOUK2R.js";
12
- import {
13
- createPostCSSPlugin,
14
- escapeCSSClassName,
15
- mangleCSS,
16
- mangleCSSSync,
17
- unescapeTailwindClass
18
- } from "./chunk-4M7CPGP7.js";
19
- export {
20
- createPostCSSPlugin,
21
- unplugin as default,
22
- esbuildPlugin,
23
- escapeCSSClassName,
24
- hasTokens,
25
- mangleCSS,
26
- mangleCSSSync,
27
- mangleCodeClassesSync,
28
- mergeThemes,
29
- parseThemeBlocks,
30
- rollupPlugin,
31
- unescapeTailwindClass,
32
- unplugin,
33
- vitePlugin,
34
- webpackPlugin
35
- };
package/dist/vite.js DELETED
@@ -1,10 +0,0 @@
1
- import {
2
- vitePlugin
3
- } from "./chunk-JGJOUK2R.js";
4
- import "./chunk-4M7CPGP7.js";
5
-
6
- // src/vite.ts
7
- var vite_default = vitePlugin;
8
- export {
9
- vite_default as default
10
- };
package/dist/webpack.js DELETED
@@ -1,10 +0,0 @@
1
- import {
2
- webpackPlugin
3
- } from "./chunk-JGJOUK2R.js";
4
- import "./chunk-4M7CPGP7.js";
5
-
6
- // src/webpack.ts
7
- var webpack_default = webpackPlugin;
8
- export {
9
- webpack_default as default
10
- };