@lijinmei-810/dev-inspector-vite 0.1.0 → 0.1.2

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 +89 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,89 @@
1
+ # @lijinmei-810/dev-inspector-vite
2
+
3
+ > Vite development server plugin for `@lijinmei-810/dev-inspector`.
4
+
5
+ This package provides local-only Vite middleware endpoints used by the Dev Inspector React panel.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm i @lijinmei-810/dev-inspector
11
+ npm i -D @lijinmei-810/dev-inspector-vite
12
+ ```
13
+
14
+ ## Setup
15
+
16
+ ```ts
17
+ // vite.config.ts
18
+ import { defineConfig } from 'vite';
19
+ import react from '@vitejs/plugin-react';
20
+ import { createDevInspectorServerPlugin } from '@lijinmei-810/dev-inspector-vite';
21
+
22
+ export default defineConfig({
23
+ plugins: [
24
+ react(),
25
+ createDevInspectorServerPlugin({
26
+ projectRoot: process.cwd(),
27
+ }),
28
+ ],
29
+ });
30
+ ```
31
+
32
+ Then mount the React panel:
33
+
34
+ ```tsx
35
+ // src/main.tsx
36
+ import { mountDevInspector } from '@lijinmei-810/dev-inspector';
37
+ import '@lijinmei-810/dev-inspector/style.css';
38
+
39
+ if (import.meta.env.DEV) {
40
+ mountDevInspector();
41
+ }
42
+ ```
43
+
44
+ ## Export
45
+
46
+ ```ts
47
+ import { createDevInspectorServerPlugin } from '@lijinmei-810/dev-inspector-vite';
48
+ ```
49
+
50
+ ## Options
51
+
52
+ ```ts
53
+ createDevInspectorServerPlugin({
54
+ projectRoot: process.cwd(),
55
+ cssFile: 'src/styles/index.css',
56
+ styleInboxJsonFile: 'docs/style-inbox.json',
57
+ styleInboxMarkdownFile: 'docs/STYLE_INBOX.md',
58
+ commitTargetFile: 'src/styles/dev-overrides.css',
59
+ });
60
+ ```
61
+
62
+ Only `projectRoot` is required. Other options are optional and have defaults.
63
+
64
+ ## Endpoints
65
+
66
+ The plugin registers development-only endpoints:
67
+
68
+ - `/__dev/apply-css`
69
+ - `/__dev/submit-style-intent`
70
+ - `/__dev/style-intents`
71
+ - `/__dev/style-intents/delete`
72
+ - `/__dev/handoff`
73
+ - `/__dev/reveal`
74
+
75
+ ## AI Install Prompt
76
+
77
+ Paste this into an AI coding assistant:
78
+
79
+ ```txt
80
+ Please integrate Dev Inspector into this Vite + React project.
81
+
82
+ Use these exact packages:
83
+ - Runtime panel: @lijinmei-810/dev-inspector
84
+ - Vite server plugin: @lijinmei-810/dev-inspector-vite
85
+
86
+ Do not search for or install vite-plugin-dev-inspector or @lijinmei-810/dev-inspector-vite-plugin.
87
+ Only enable Dev Inspector in development mode.
88
+ Do not change business logic.
89
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lijinmei-810/dev-inspector-vite",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Dev Inspector 配套 Vite 插件:提供 CSS 落盘、style-intent 收集、handoff 打包等服务端 hook",
5
5
  "license": "MIT",
6
6
  "type": "module",