@animus-ui/vite-plugin 0.1.0-next.38 → 0.1.0-next.39

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 +44 -0
  2. package/package.json +15 -4
package/README.md ADDED
@@ -0,0 +1,44 @@
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: [
21
+ react(),
22
+ animusExtract({ system: './src/ds.ts' }),
23
+ ],
24
+ });
25
+ ```
26
+
27
+ 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.
28
+
29
+ ## What It Does
30
+
31
+ 1. **Build time**: Analyzes all files importing from `@animus-ui/system`, extracts static styles into CSS with `@layer` ordering
32
+ 2. **Dev server**: Runs extraction on startup, holds results in memory, serves CSS via virtual module
33
+ 3. **Transforms**: Resolves `__TRANSFORM__` placeholders using your system's named transform functions
34
+ 4. **Global styles**: Emits global styles (reset, base) from your exported `createGlobalStyles()` configuration
35
+
36
+ ## Important
37
+
38
+ - Do **not** add React resolve aliases to `vite.config.ts` — they break the extraction transform pipeline
39
+ - After system config changes, restart the dev server (the subprocess runs at `buildStart`)
40
+ - Run `bun run clean:light` if styles seem stale (clears `.vite` cache)
41
+
42
+ ## License
43
+
44
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@animus-ui/vite-plugin",
3
- "version": "0.1.0-next.38",
3
+ "version": "0.1.0-next.39",
4
4
  "description": "Animus static CSS extraction Vite plugin",
5
5
  "author": "codecaaron <airrobb@gmail.com>",
6
6
  "license": "MIT",
@@ -13,10 +13,21 @@
13
13
  "publishConfig": {
14
14
  "access": "public"
15
15
  },
16
+ "homepage": "https://github.com/codecaaron/animus/tree/main/packages/vite-plugin#readme",
16
17
  "repository": {
17
18
  "type": "git",
18
- "url": "git+https://github.com/codecaaron/animus"
19
+ "url": "git+https://github.com/codecaaron/animus",
20
+ "directory": "packages/vite-plugin"
19
21
  },
22
+ "keywords": [
23
+ "vite",
24
+ "vite-plugin",
25
+ "css",
26
+ "css-in-js",
27
+ "zero-runtime",
28
+ "styled",
29
+ "animus"
30
+ ],
20
31
  "scripts": {
21
32
  "build": "bun run build:ts",
22
33
  "build:ts": "tsdown && tsc -p tsconfig.build.json",
@@ -26,8 +37,8 @@
26
37
  "vite": ">=5.0.0"
27
38
  },
28
39
  "dependencies": {
29
- "@animus-ui/extract": "0.1.0-next.38",
30
- "@animus-ui/system": "0.1.0-next.38",
40
+ "@animus-ui/extract": "0.1.0-next.39",
41
+ "@animus-ui/system": "0.1.0-next.39",
31
42
  "browserslist": "^4.24.0",
32
43
  "lightningcss": "^1.29.0"
33
44
  }