@pikacss/vite-plugin-pikacss 0.0.39 → 0.0.40

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/README.md +70 -137
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,181 +1,114 @@
1
1
  # @pikacss/vite-plugin-pikacss
2
2
 
3
- ⚠️ **Deprecated**: This package is deprecated. Please use `@pikacss/unplugin-pikacss/vite` instead.
3
+ ⚠️ **DEPRECATED - Use @pikacss/unplugin-pikacss/vite instead**
4
4
 
5
- ## Migration
5
+ This package is now a compatibility wrapper. The package has been consolidated into `@pikacss/unplugin-pikacss` to support multiple bundlers from a unified codebase.
6
6
 
7
- This package now re-exports from `@pikacss/unplugin-pikacss/vite`. Please update your dependencies:
7
+ ## Migration Guide
8
8
 
9
- ```bash
10
- pnpm add -D @pikacss/unplugin-pikacss
11
- ```
9
+ ### Why This Change?
12
10
 
13
- Update your imports:
14
-
15
- ```diff
16
- - import PikaCSSPlugin from '@pikacss/vite-plugin-pikacss'
17
- + import PikaCSSPlugin from '@pikacss/unplugin-pikacss/vite'
18
- ```
11
+ PikaCSS now uses [unplugin](https://github.com/unjs/unplugin) to provide universal bundler support. This means you get the same plugin for Vite, Webpack, Rspack, Esbuild, Rollup, Farm, and Rolldown from a single package.
19
12
 
20
- ## Installation (Legacy)
13
+ ### Step 1: Update Dependencies
21
14
 
22
15
  ```bash
23
- pnpm add -D @pikacss/vite-plugin-pikacss
24
- ```
16
+ # Remove the old package
17
+ pnpm remove @pikacss/vite-plugin-pikacss
25
18
 
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
- })
19
+ # Install the new package
20
+ pnpm add -D @pikacss/unplugin-pikacss
40
21
  ```
41
22
 
42
- ## Features
23
+ ### Step 2: Update Import Path
43
24
 
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.
25
+ ```diff
26
+ - import pikacss from '@pikacss/vite-plugin-pikacss'
27
+ + import pikacss from '@pikacss/unplugin-pikacss/vite'
28
+ ```
56
29
 
57
- ## Usage
30
+ That's it! All options remain identical - no breaking changes to the API.
58
31
 
59
- ### Basic Setup
32
+ ### Complete Before/After Example
60
33
 
34
+ **Before (deprecated):**
61
35
  ```typescript
62
36
  // vite.config.ts
37
+ import pikacss from '@pikacss/vite-plugin-pikacss'
63
38
  import { defineConfig } from 'vite'
64
- import PikaCSSPlugin from '@pikacss/vite-plugin-pikacss'
65
39
 
66
40
  export default defineConfig({
67
- plugins: [
68
- PikaCSSPlugin()
69
- ]
41
+ plugins: [
42
+ pikacss({
43
+ scan: {
44
+ include: ['src/**/*.{ts,tsx,vue}']
45
+ }
46
+ })
47
+ ]
70
48
  })
71
49
  ```
72
50
 
73
- ### With Configuration
74
-
51
+ **After (current):**
75
52
  ```typescript
76
53
  // vite.config.ts
54
+ import pikacss from '@pikacss/unplugin-pikacss/vite'
77
55
  import { defineConfig } from 'vite'
78
- import PikaCSSPlugin from '@pikacss/vite-plugin-pikacss'
79
56
 
80
57
  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
- ]
58
+ plugins: [
59
+ pikacss({
60
+ scan: {
61
+ include: ['src/**/*.{ts,tsx,vue}']
62
+ }
63
+ })
64
+ ]
102
65
  })
103
66
  ```
104
67
 
105
- ### Using in Your Code
68
+ ## Deprecation Timeline
106
69
 
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
- ```
70
+ - **Current version (0.0.39)**: Package maintained as compatibility wrapper
71
+ - **Future versions**: Package will continue to work but will not receive new features
72
+ - **Recommendation**: Migrate to `@pikacss/unplugin-pikacss/vite` for all new and existing projects
116
73
 
117
- ## Options
74
+ ## Documentation
118
75
 
119
- See `@pikacss/unplugin-pikacss` documentation for all available options:
76
+ For complete documentation, visit:
77
+ - [Vite Integration Guide](https://pikacss.github.io/pikacss/integrations/vite.html)
78
+ - [PikaCSS Documentation](https://pikacss.github.io/pikacss/)
120
79
 
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
- ```
80
+ ## Legacy Usage (Not Recommended)
167
81
 
168
- ## HMR Support
82
+ This package still works as a wrapper. If you cannot migrate immediately:
169
83
 
170
- Full HMR support is provided:
84
+ ```bash
85
+ pnpm add -D @pikacss/vite-plugin-pikacss
86
+ ```
171
87
 
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
88
+ ```typescript
89
+ // vite.config.ts
90
+ import pikacss from '@pikacss/vite-plugin-pikacss'
91
+ import { defineConfig } from 'vite'
175
92
 
176
- ## Documentation
93
+ export default defineConfig({
94
+ plugins: [
95
+ pikacss({
96
+ scan: {
97
+ include: ['**/*.{js,ts,jsx,tsx,vue}'],
98
+ exclude: ['node_modules/**', 'dist/**']
99
+ },
100
+ config: './pika.config.ts',
101
+ autoCreateConfig: true,
102
+ fnName: 'pika',
103
+ transformedFormat: 'string',
104
+ tsCodegen: true,
105
+ cssCodegen: true
106
+ })
107
+ ]
108
+ })
109
+ ```
177
110
 
178
- For complete documentation, visit: [PikaCSS Documentation](https://pikacss.github.io/pikacss/)
111
+ All options are re-exported from `@pikacss/unplugin-pikacss/vite`. See the [unplugin documentation](https://github.com/pikacss/pikacss/tree/main/packages/unplugin) for complete API reference.
179
112
 
180
113
  ## License
181
114
 
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@pikacss/vite-plugin-pikacss",
3
3
  "type": "module",
4
- "version": "0.0.39",
4
+ "version": "0.0.40",
5
5
  "author": "DevilTea <ch19980814@gmail.com>",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/pikacss/pikacss.git",
9
+ "url": "https://github.com/pikacss/pikacss.github.io.git",
10
10
  "directory": "packages/vite"
11
11
  },
12
12
  "bugs": {
13
- "url": "https://github.com/pikacss/pikacss/issues"
13
+ "url": "https://github.com/pikacss/pikacss.github.io/issues"
14
14
  },
15
15
  "keywords": [
16
16
  "pikacss",
@@ -44,7 +44,7 @@
44
44
  "vite": "^5.0.0 || ^6.0.0"
45
45
  },
46
46
  "dependencies": {
47
- "@pikacss/unplugin-pikacss": "0.0.39"
47
+ "@pikacss/unplugin-pikacss": "0.0.40"
48
48
  },
49
49
  "devDependencies": {
50
50
  "vite": "^7.3.0"