@animus-ui/vite-plugin 0.1.0-next.v7 → 0.1.1-beta.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.
- package/README.md +41 -0
- package/dist/analyze-project-args.d.ts +2 -0
- package/dist/analyze-project-args.d.ts.map +1 -0
- package/dist/index.cjs +872 -0
- package/dist/index.d.ts +53 -43
- package/dist/index.d.ts.map +1 -1
- package/dist/manifest-diagnostics.d.ts +10 -0
- package/dist/manifest-diagnostics.d.ts.map +1 -0
- package/package.json +39 -15
- package/dist/config-serializer.d.ts +0 -25
- package/dist/config-serializer.d.ts.map +0 -1
- package/dist/index.mjs +0 -818
- package/dist/resolve-global-styles.d.ts +0 -13
- package/dist/resolve-global-styles.d.ts.map +0 -1
- package/dist/resolve-transforms.d.ts +0 -14
- package/dist/resolve-transforms.d.ts.map +0 -1
- package/dist/theme-evaluator.d.ts +0 -32
- package/dist/theme-evaluator.d.ts.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# @animus-ui/vite-plugin
|
|
2
|
+
|
|
3
|
+
Static CSS extraction plugin for Vite. Transforms `@animus-ui/system` builder chains into static CSS at build time — zero runtime style injection.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @animus-ui/vite-plugin @animus-ui/system
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
// vite.config.ts
|
|
15
|
+
import react from '@vitejs/plugin-react';
|
|
16
|
+
import { animusExtract } from '@animus-ui/vite-plugin';
|
|
17
|
+
import { defineConfig } from 'vite';
|
|
18
|
+
|
|
19
|
+
export default defineConfig({
|
|
20
|
+
plugins: [react(), animusExtract({ system: './src/ds.ts' })],
|
|
21
|
+
});
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The `system` option points to the file that exports your built system instance. The plugin loads this file in a subprocess to serialize the prop config and theme data for the Rust extraction pipeline.
|
|
25
|
+
|
|
26
|
+
## What It Does
|
|
27
|
+
|
|
28
|
+
1. **Build time**: Analyzes all files importing from `@animus-ui/system`, extracts static styles into CSS with `@layer` ordering
|
|
29
|
+
2. **Dev server**: Runs extraction on startup, holds results in memory, serves CSS via virtual module
|
|
30
|
+
3. **Transforms**: Resolves `__TRANSFORM__` placeholders using your system's named transform functions
|
|
31
|
+
4. **Global styles**: Emits global styles (reset, base) from your exported `createGlobalStyles()` configuration
|
|
32
|
+
|
|
33
|
+
## Important
|
|
34
|
+
|
|
35
|
+
- Do **not** add React resolve aliases to `vite.config.ts` — they break the extraction transform pipeline
|
|
36
|
+
- After system config changes, restart the dev server (the subprocess runs at `buildStart`)
|
|
37
|
+
- Run `bun run clean:light` if styles seem stale (clears `.vite` cache)
|
|
38
|
+
|
|
39
|
+
## License
|
|
40
|
+
|
|
41
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze-project-args.d.ts","sourceRoot":"","sources":["../src/analyze-project-args.ts"],"names":[],"mappings":""}
|