@pikacss/vite-plugin-pikacss 0.0.37 → 0.0.38

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 CHANGED
@@ -1 +1,182 @@
1
1
  # @pikacss/vite-plugin-pikacss
2
+
3
+ ⚠️ **Deprecated**: This package is deprecated. Please use `@pikacss/unplugin-pikacss/vite` instead.
4
+
5
+ ## Migration
6
+
7
+ This package now re-exports from `@pikacss/unplugin-pikacss/vite`. Please update your dependencies:
8
+
9
+ ```bash
10
+ pnpm add -D @pikacss/unplugin-pikacss
11
+ ```
12
+
13
+ Update your imports:
14
+
15
+ ```diff
16
+ - import PikaCSSPlugin from '@pikacss/vite-plugin-pikacss'
17
+ + import PikaCSSPlugin from '@pikacss/unplugin-pikacss/vite'
18
+ ```
19
+
20
+ ## Installation (Legacy)
21
+
22
+ ```bash
23
+ pnpm add -D @pikacss/vite-plugin-pikacss
24
+ ```
25
+
26
+ ## Quick Start
27
+
28
+ **vite.config.ts**:
29
+ ```typescript
30
+ import { defineConfig } from 'vite'
31
+ import PikaCSSPlugin from '@pikacss/vite-plugin-pikacss'
32
+
33
+ export default defineConfig({
34
+ plugins: [
35
+ PikaCSSPlugin({
36
+ // options
37
+ })
38
+ ]
39
+ })
40
+ ```
41
+
42
+ ## Features
43
+
44
+ This package re-exports all features from `@pikacss/unplugin-pikacss/vite`:
45
+
46
+ - ⚡ Fast Hot Module Replacement (HMR)
47
+ - 🎯 Automatic TypeScript type generation
48
+ - 🔄 Watch mode with instant updates
49
+ - 📦 Optimized production builds
50
+ - 🔧 Full PikaCSS configuration support
51
+ - 🎨 Virtual CSS module (`pika.css`)
52
+
53
+ ## Recommendation
54
+
55
+ For new projects, we strongly recommend using `@pikacss/unplugin-pikacss/vite` directly. This package is maintained for backward compatibility only.
56
+
57
+ ## Usage
58
+
59
+ ### Basic Setup
60
+
61
+ ```typescript
62
+ // vite.config.ts
63
+ import { defineConfig } from 'vite'
64
+ import PikaCSSPlugin from '@pikacss/vite-plugin-pikacss'
65
+
66
+ export default defineConfig({
67
+ plugins: [
68
+ PikaCSSPlugin()
69
+ ]
70
+ })
71
+ ```
72
+
73
+ ### With Configuration
74
+
75
+ ```typescript
76
+ // vite.config.ts
77
+ import { defineConfig } from 'vite'
78
+ import PikaCSSPlugin from '@pikacss/vite-plugin-pikacss'
79
+
80
+ export default defineConfig({
81
+ plugins: [
82
+ PikaCSSPlugin({
83
+ // File patterns to transform
84
+ target: ['**/*.vue', '**/*.tsx', '**/*.jsx'],
85
+
86
+ // PikaCSS config file path
87
+ config: './pika.config.ts',
88
+
89
+ // Custom function name
90
+ fnName: 'pika',
91
+
92
+ // Transform format
93
+ transformedFormat: 'string',
94
+
95
+ // TypeScript codegen
96
+ tsCodegen: true,
97
+
98
+ // Dev CSS output path
99
+ devCss: 'pika.dev.css'
100
+ })
101
+ ]
102
+ })
103
+ ```
104
+
105
+ ### Using in Your Code
106
+
107
+ ```typescript
108
+ // In your Vue/React/etc. files
109
+ const styles = pika({
110
+ display: 'flex',
111
+ alignItems: 'center',
112
+ gap: '1rem',
113
+ padding: '2rem'
114
+ })
115
+ ```
116
+
117
+ ## Options
118
+
119
+ See `@pikacss/unplugin-pikacss` documentation for all available options:
120
+
121
+ ```typescript
122
+ interface PluginOptions {
123
+ /**
124
+ * File scanning configuration.
125
+ */
126
+ scan?: {
127
+ include?: string | string[]
128
+ exclude?: string | string[]
129
+ }
130
+
131
+ /**
132
+ * Engine configuration or config file path.
133
+ */
134
+ config?: EngineConfig | string
135
+
136
+ /**
137
+ * Auto-create config file if missing.
138
+ * @default true
139
+ */
140
+ autoCreateConfig?: boolean
141
+
142
+ /**
143
+ * PikaCSS function name.
144
+ * @default 'pika'
145
+ */
146
+ fnName?: string
147
+
148
+ /**
149
+ * Output format for class names.
150
+ * @default 'string'
151
+ */
152
+ transformedFormat?: 'string' | 'array' | 'inline'
153
+
154
+ /**
155
+ * TypeScript code generation.
156
+ * @default true
157
+ */
158
+ tsCodegen?: boolean | string
159
+
160
+ /**
161
+ * CSS code generation.
162
+ * @default true
163
+ */
164
+ cssCodegen?: boolean | string
165
+ }
166
+ ```
167
+
168
+ ## HMR Support
169
+
170
+ Full HMR support is provided:
171
+
172
+ - **Style changes**: Updates immediately without page reload
173
+ - **Config changes**: Automatically reloads when `pika.config.ts` changes
174
+ - **Type generation**: Updates TypeScript types in real-time
175
+
176
+ ## Documentation
177
+
178
+ For complete documentation, visit: [PikaCSS Documentation](https://pikacss.dev)
179
+
180
+ ## License
181
+
182
+ MIT © DevilTea
package/dist/index.cjs CHANGED
@@ -25,8 +25,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  }) : target, mod));
26
26
 
27
27
  //#endregion
28
- let __pikacss_unplugin_pikacss_vite = require("@pikacss/unplugin-pikacss/vite");
29
- __pikacss_unplugin_pikacss_vite = __toESM(__pikacss_unplugin_pikacss_vite);
28
+ let _pikacss_unplugin_pikacss_vite = require("@pikacss/unplugin-pikacss/vite");
29
+ _pikacss_unplugin_pikacss_vite = __toESM(_pikacss_unplugin_pikacss_vite);
30
30
 
31
31
  //#region src/index.ts
32
32
  /**
@@ -38,13 +38,13 @@ __pikacss_unplugin_pikacss_vite = __toESM(__pikacss_unplugin_pikacss_vite);
38
38
  * + import PikaCSSPlugin from '@pikacss/unplugin-pikacss/vite'
39
39
  * ```
40
40
  */
41
- var src_default = __pikacss_unplugin_pikacss_vite.default;
41
+ var src_default = _pikacss_unplugin_pikacss_vite.default;
42
42
 
43
43
  //#endregion
44
44
  module.exports = src_default;
45
- Object.keys(__pikacss_unplugin_pikacss_vite).forEach(function (k) {
45
+ Object.keys(_pikacss_unplugin_pikacss_vite).forEach(function (k) {
46
46
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
47
47
  enumerable: true,
48
- get: function () { return __pikacss_unplugin_pikacss_vite[k]; }
48
+ get: function () { return _pikacss_unplugin_pikacss_vite[k]; }
49
49
  });
50
50
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pikacss/vite-plugin-pikacss",
3
3
  "type": "module",
4
- "version": "0.0.37",
4
+ "version": "0.0.38",
5
5
  "author": "DevilTea <ch19980814@gmail.com>",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -44,10 +44,10 @@
44
44
  "vite": "^5.0.0 || ^6.0.0"
45
45
  },
46
46
  "dependencies": {
47
- "@pikacss/unplugin-pikacss": "0.0.37"
47
+ "@pikacss/unplugin-pikacss": "0.0.38"
48
48
  },
49
49
  "devDependencies": {
50
- "vite": "^6.3.5"
50
+ "vite": "^7.3.0"
51
51
  },
52
52
  "scripts": {
53
53
  "build": "tsdown && pnpm exec publint",