@animus-ui/vite-plugin 0.1.9 → 0.1.12

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/dist/index.d.ts CHANGED
@@ -2,116 +2,70 @@ import type { StaticCssConfig } from '@animus-ui/extract/pipeline';
2
2
  import type { Plugin } from 'vite';
3
3
  export { discoverFiles } from '@animus-ui/extract/pipeline';
4
4
  export interface AnimusExtractOptions {
5
+ /** Path to a module exporting a SystemInstance from `@animus-ui/system`. */
6
+ system: string;
5
7
  /**
6
- * Path to a module exporting a SystemInstance from `@animus-ui/system`.
7
- * The module is loaded via Rust NAPI (OXC + rquickjs) at build start.
8
- * It provides prop config, group registry, theme tokens, selector aliases,
9
- * and global styles — everything the extraction pipeline needs.
8
+ * Module specifier for extracted runtime factories, default
9
+ * `@animus-ui/system`. An override must supply every terminal used.
10
+ */
11
+ runtimeImport?: string;
12
+ /**
13
+ * Substrings, or globs when `*`/`?` present. Replaces the defaults `dist`,
14
+ * `.test.`, `.spec.`; `node_modules`, `.next`, `.animus` always apply.
10
15
  */
11
- system: string;
12
- /** Glob patterns to exclude. */
13
16
  exclude?: string[];
14
17
  /**
15
- * File extensions to scan for component definitions and JSX usages.
16
- * Replaces the default list entirely (not additive). Include `.mdx` to
17
- * extract components rendered from MDX files — `@mdx-js/mdx` must be
18
- * installed as a peer for MDX files to be preprocessed; otherwise the
19
- * plugin warns once at buildStart and skips them.
20
- *
21
- * @default ['.ts', '.tsx', '.js', '.jsx', '.mdx']
18
+ * Replaces the default extension list entirely. `.mdx` needs the
19
+ * `@mdx-js/mdx` peer, or those files warn once and are skipped.
22
20
  */
23
21
  extensions?: string[];
24
- /** When true, extraction failures throw instead of warning. Use in CI to enforce full extraction. */
22
+ /** Extraction failures throw instead of warning. */
25
23
  strict?: boolean;
26
24
  /**
27
- * When true, run structural self-verification at the end of `buildStart`:
28
- * component CSS non-empty, assembled layer ordering correct, `:root` block
29
- * present in variable CSS, no unresolved `__TRANSFORM__` placeholders. Prefix
30
- * output with `[animus:verify]`. Failures throw when `strict: true`,
31
- * otherwise warn.
25
+ * Run a structural self-check at the end of `buildStart`; failures throw
26
+ * under `strict`, otherwise warn.
32
27
  */
33
28
  verify?: boolean;
34
- /** Enable verbose logging. Also activatable via ANIMUS_DEBUG=1 env var. */
29
+ /** Verbose logging; also enabled by `ANIMUS_DEBUG=1`. */
35
30
  verbose?: boolean;
36
31
  /**
37
- * Browser targets for CSS autoprefixing and syntax lowering.
38
- * Accepts a browserslist query string or array of queries.
39
- * Falls back to project's browserslist config, then to `defaults`.
32
+ * Browserslist queries for autoprefixing and syntax lowering; falls back
33
+ * to the project's browserslist config, then to `defaults`.
40
34
  */
41
35
  targets?: string | string[];
42
- /**
43
- * Control CSS minification.
44
- * - `true`: always minify (dev + prod)
45
- * - `false`: never minify (autoprefixing still applies)
46
- * - `undefined` (default): minify in prod only
47
- */
36
+ /** Absent minifies in production only; `false` still autoprefixes. */
48
37
  minify?: boolean;
49
38
  /**
50
- * Namespace prefix for CSS variables and class names, applied to the
51
- * variable map/css (and theme + contextual vars) at system load.
39
+ * Emission mode. Wins over the Vite command signal, which otherwise
40
+ * selects production for `build` and development elsewhere.
52
41
  */
42
+ mode?: 'development' | 'production';
43
+ /** Namespace prefix for CSS variables and class names. */
53
44
  prefix?: string;
54
45
  /**
55
- * Forced-emission declarations for usage the scanner cannot observe
56
- * (CMS-driven variants, spread-hidden props, dynamically selected
57
- * components). Declared variants/states/system-prop values and custom
58
- * dynamic slots are emitted as if used; entries are labeled as forced
59
- * in the extraction report. Empty/absent is a no-op.
46
+ * Forced-emission declarations for usage the scanner cannot observe;
47
+ * declared variants, states and prop values are emitted as if used.
60
48
  */
61
49
  staticCss?: StaticCssConfig;
62
50
  /**
63
- * Full `@layer` declaration order. Must include all 7 Animus `anm-*` layers
64
- * as a subsequence in their required order. Consumer layers may be
65
- * interleaved around them. Names are emitted as-is.
66
- *
67
- * Example: `['reset', 'anm-global', 'anm-base', ..., 'anm-custom', 'overrides']`
51
+ * Full `@layer` declaration order; must contain every `anm-*` layer as a
52
+ * subsequence in its required order. Consumer layers may interleave.
68
53
  */
69
54
  layers?: string[];
70
55
  /**
71
- * Extraction engine selection. `'v2'` is the only engine and the default.
72
- * The v1 engine was retired (openspec: retire-extract-v1); configuring
73
- * `engine: 'v1'` (or setting `ANIMUS_ENGINE=v1`) throws — the selection is
74
- * never silently upgraded.
75
- *
76
- * @default 'v2'
56
+ * `'v2'` is the only engine. `engine: 'v1'` or `ANIMUS_ENGINE=v1` throws
57
+ * rather than being silently upgraded.
77
58
  */
78
59
  engine?: 'v2';
79
60
  /**
80
- * Pre-generated appearance bootstrap artifact — DELIVERY ONLY.
81
- *
82
- * When set, the plugin injects `code` verbatim as an inline
83
- * `<script data-animus-bootstrap>` at the start of `<head>` in built HTML
84
- * (in dev, Vite's own client script precedes it); always ahead of every
85
- * stylesheet reference. When absent — or when `code` is empty — no
86
- * bootstrap script is emitted and the built HTML is unchanged.
87
- *
88
- * The plugin performs NO generation and interprets NO appearance semantics:
89
- * produce the artifact in your Vite config with `createAppearanceBootstrap`
90
- * from `@animus-ui/system/bootstrap` (a build-time-only subpath) and pass the
91
- * result through. The shape is declared structurally here so the plugin never
92
- * imports the generator.
93
- *
94
- * `cspHash` is carried for the application's own `script-src` policy — the
95
- * plugin does not read it. Serve it single-quoted, exactly as returned.
96
- *
97
- * @example
98
- * ```ts
99
- * import { createAppearanceBootstrap } from '@animus-ui/system/bootstrap';
100
- * import { theme } from './src/ds';
101
- *
102
- * animusExtract({ system: './src/ds.ts', appearanceBootstrap: createAppearanceBootstrap(theme) })
103
- * ```
61
+ * Delivery only: `code` is injected verbatim as an inline
62
+ * `<script data-animus-bootstrap>`; `cspHash` is for the host's own policy.
104
63
  */
105
64
  appearanceBootstrap?: {
106
65
  code: string;
107
66
  cspHash: string;
108
67
  };
109
68
  }
110
- /**
111
- * Vite adapter for the extraction pipeline. State and pipeline operations
112
- * live in PluginContext; hook bodies live in their own modules — this
113
- * factory only validates options and wires Vite hooks to those functions.
114
- */
115
69
  export declare function animusExtract(options: AnimusExtractOptions): Plugin;
116
70
  export default animusExtract;
117
71
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,qGAAqG;IACrG,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC;IACd;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,mBAAmB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACzD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CA0EnE;eAEc,aAAa"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,oDAAoD;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yDAAyD;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,sEAAsE;IACtE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,GAAG,YAAY,CAAC;IACpC,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC;IACd;;;OAGG;IACH,mBAAmB,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACzD;AAMD,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAsFnE;eAEc,aAAa"}
@@ -1,15 +1,7 @@
1
1
  import type { PluginContext } from './context';
2
2
  /**
3
- * Evict every module node the dev server holds for each file — every
4
- * environment graph (client, ssr, and any custom environment), by-file node
5
- * sets (covers query-suffixed variants), plus the absolute-path id lookup.
6
- * Falls back to the mixed compat graph for hosts without environment
7
- * graphs. Returns the number of nodes invalidated.
8
- *
9
- * Completeness here is load-bearing: the file-plan diff is the ONLY
10
- * invalidation candidate source, so a node shape this enumeration misses
11
- * stays stale for the life of the server (openspec: dev-transform-coherence,
12
- * "Client and SSR nodes are both evicted").
3
+ * Completeness is load-bearing: the file-plan diff is the only invalidation
4
+ * candidate source, so a node shape missed here stays stale for the session.
13
5
  */
14
6
  export declare function invalidateFileModules(ctx: PluginContext, relPaths: string[]): number;
15
7
  //# sourceMappingURL=module-invalidation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"module-invalidation.d.ts","sourceRoot":"","sources":["../src/module-invalidation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,MAAM,EAAE,GACjB,MAAM,CAmCR"}
1
+ {"version":3,"file":"module-invalidation.d.ts","sourceRoot":"","sources":["../src/module-invalidation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,MAAM,EAAE,GACjB,MAAM,CAmCR"}
@@ -1,40 +1,18 @@
1
1
  import type { PluginContext } from './context';
2
2
  interface UnresolvedParentDrop {
3
- /** rootDir-relative consumer file the diagnostic names. */
4
3
  file: string;
5
- /** The dropped child component binding. */
6
4
  component: string;
7
- /** The parent binding as written in the consumer. */
5
+ /** The parent binding as written in the consumer, not a resolved path. */
8
6
  parent: string;
9
7
  }
10
- /** The current manifest's unresolved-parent drops, parsed from diagnostics
11
- * (shared Rust-mirror matcher — the regex lives in manifest-diagnostics). */
8
+ /** The current manifest's unresolved-parent drops, parsed from diagnostics. */
12
9
  export declare function unresolvedParentDrops(ctx: PluginContext): UnresolvedParentDrop[];
13
- /** Files carrying an unresolved-parent drop in the CURRENT manifest —
14
- * derived once per manifest publication, then a set lookup. */
10
+ /** Files carrying an unresolved-parent drop in the current manifest. */
15
11
  export declare function unresolvedDropFiles(ctx: PluginContext): ReadonlySet<string>;
16
12
  /**
17
- * Reconcile the discoverable on-disk source universe before an
18
- * unresolved-parent result is acted on (openspec: dev-transform-coherence,
19
- * "Source-universe reconciliation precedes unresolved-parent fallbacks").
20
- *
21
- * Drop-triggered: runs only when the current manifest reports `chain
22
- * dropped: could not resolve parent component`. One discovery walk (the
23
- * same walk and policy the server start uses) folds every eligible on-disk
24
- * file the cache does not know, then one re-analysis resolves the whole
25
- * extension graph — dependency depth never requires iteration depth, so the
26
- * loop re-enters only when a re-analysis leaves NEW drops and the previous
27
- * walk actually folded something (a changed discovery domain). The
28
- * iteration cap is containment, not semantics.
29
- *
30
- * Synchronous by design — it runs inside the sync `transform` hook. `.mdx`
31
- * sources need async preprocessing and are not folded here (they ingest on
32
- * their first watcher edit).
33
- *
34
- * Returns whether any re-analysis ran (callers diff plans across the WHOLE
35
- * transaction, so a fold-and-reanalyze is invisible to them beyond the
36
- * final manifest).
13
+ * Folds undiscovered on-disk files when the manifest reports an unresolved
14
+ * parent, then re-analyzes; the iteration cap is containment, not semantics.
37
15
  */
38
- export declare function stabilizeSourceUniverse(ctx: PluginContext): boolean;
16
+ export declare function reconcileSourceCorpus(ctx: PluginContext): Promise<boolean>;
39
17
  export {};
40
18
  //# sourceMappingURL=rediscovery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rediscovery.d.ts","sourceRoot":"","sources":["../src/rediscovery.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,UAAU,oBAAoB;IAC5B,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;8EAC8E;AAC9E,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,aAAa,GACjB,oBAAoB,EAAE,CAcxB;AASD;gEACgE;AAChE,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,WAAW,CAAC,MAAM,CAAC,CAc3E;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CA2EnE"}
1
+ {"version":3,"file":"rediscovery.d.ts","sourceRoot":"","sources":["../src/rediscovery.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/C,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,+EAA+E;AAC/E,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,aAAa,GACjB,oBAAoB,EAAE,CAWxB;AAOD,wEAAwE;AACxE,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,WAAW,CAAC,MAAM,CAAC,CAa3E;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,OAAO,CAAC,CAqElB"}
@@ -1,12 +1,9 @@
1
1
  /**
2
- * Coalesces bursts of system-dependency events into single geological
3
- * resets: a quiescence window before starting, at most one reset in
4
- * flight, and exactly one follow-up when requests arrive mid-reset. A
5
- * package build regenerating its dist fires one reset, not one per file.
6
- *
7
- * Timer functions are injected seams — `vi.mock` on node builtins silently
8
- * no-ops under vite-plus-test, so tests drive a manual scheduler instead.
2
+ * Timer functions are injected seams: `vi.mock` on node builtins silently
3
+ * no-ops under vite-plus-test, so tests drive a manual scheduler.
9
4
  */
5
+ type ResetTimerHandle = ReturnType<typeof setTimeout> | number;
6
+ type ResetErrorHandler = <Thrown>(error: Thrown) => void;
10
7
  export declare class ResetCoalescer {
11
8
  private readonly run;
12
9
  private readonly onError;
@@ -16,8 +13,9 @@ export declare class ResetCoalescer {
16
13
  private timer;
17
14
  private running;
18
15
  private dirty;
19
- constructor(run: () => void, onError: (err: unknown) => void, quietMs?: number, schedule?: (fn: () => void, ms: number) => unknown, cancel?: (timer: unknown) => void);
16
+ constructor(run: () => void | Promise<void>, onError: ResetErrorHandler, quietMs?: number, schedule?: (fn: () => void, ms: number) => ResetTimerHandle, cancel?: (timer: ResetTimerHandle) => void);
20
17
  /** Ask for a reset; bursts within the quiescence window collapse. */
21
18
  request(): void;
22
19
  }
20
+ export {};
23
21
  //# sourceMappingURL=reset-coalescer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reset-coalescer.d.ts","sourceRoot":"","sources":["../src/reset-coalescer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,qBAAa,cAAc;IAMvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAKpB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAIzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAhBzB,OAAO,CAAC,KAAK,CAAiB;IAC9B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,KAAK,CAAS;IAEtB,YACmB,GAAG,EAAE,MAAM,IAAI,EAKf,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,EAC/B,OAAO,SAAK,EACZ,QAAQ,GAAE,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,KAAK,OAGpC,EACN,MAAM,GAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IACS,EACpD;IAEJ,qEAAqE;IACrE,OAAO,IAAI,IAAI,CAqBd;CACF"}
1
+ {"version":3,"file":"reset-coalescer.d.ts","sourceRoot":"","sources":["../src/reset-coalescer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,MAAM,CAAC;AAE/D,KAAK,iBAAiB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAEzD,qBAAa,cAAc;IAMvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAGpB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAIzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAdzB,OAAO,CAAC,KAAK,CAAiC;IAC9C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,KAAK,CAAS;IAEtB,YACmB,GAAG,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAG/B,OAAO,EAAE,iBAAiB,EAC1B,OAAO,SAAK,EACZ,QAAQ,GAAE,CACzB,EAAE,EAAE,MAAM,IAAI,EACd,EAAE,EAAE,MAAM,KACP,gBAAiD,EACrC,MAAM,GAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IACjC,EACnB;IAEJ,qEAAqE;IACrE,OAAO,IAAI,IAAI,CAsBd;CACF"}
@@ -1,25 +1,11 @@
1
1
  import type { PluginContext } from './context';
2
2
  /**
3
- * The dev-mode bridge prepend, shared with the hot-update gate so both
4
- * compute byte-identical served output. The import goes AFTER the directive
5
- * prologue the engine hoists to byte 0 — prepending above it would demote
6
- * 'use client'/'use strict' to an ordinary expression statement, silently
7
- * un-marking client modules on exactly the RSC-capable hosts this delivery
8
- * path serves.
3
+ * The import goes after the directive prologue: above it, 'use client'
4
+ * becomes an ordinary expression and the module loses its client marking.
9
5
  */
10
6
  export declare function applyDevBridgeImport(code: string): string;
11
- /**
12
- * transform: replace builder chains with `createComponent()` calls using
13
- * the pre-built manifest; detect files created after buildStart and fold
14
- * them into the analysis.
15
- *
16
- * The HMR bridge is NOT injected here — `transformIndexHtml` delivers it as a
17
- * `<script type="module">` per served document (openspec:
18
- * dev-stylesheet-management, "HMR bridge auto-injected in dev mode"; "Transform
19
- * emitter unchanged" forbids the emitter importing it).
20
- */
21
- export declare function transformSource(ctx: PluginContext, code: string, id: string): {
7
+ export declare function transformSource(ctx: PluginContext, code: string, id: string): Promise<{
22
8
  code: string;
23
9
  map: null;
24
- } | null;
10
+ } | null>;
25
11
  //# sourceMappingURL=transform.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKzD;AAiCD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACT;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,IAAI,CAAA;CAAE,GAAG,IAAI,CA4LpC"}
1
+ {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKzD;AA4BD,wBAAsB,eAAe,CACnC,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACT,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,IAAI,CAAA;CAAE,GAAG,IAAI,CAAC,CA2J7C"}
@@ -1,7 +1,4 @@
1
1
  import type { PluginContext } from './context';
2
- /** resolveId: map virtual ids and redirect external DS package imports. */
3
2
  export declare function resolveVirtualId(ctx: PluginContext, id: string): string | null;
4
- /** load: serve the virtual stylesheet, components CSS, HMR bridge, and
5
- * system-props modules from manifest-derived state. */
6
3
  export declare function loadVirtualModule(ctx: PluginContext, id: string): string | null;
7
4
  //# sourceMappingURL=virtual-modules.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-modules.d.ts","sourceRoot":"","sources":["../src/virtual-modules.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,aAAa,EAClB,EAAE,EAAE,MAAM,GACT,MAAM,GAAG,IAAI,CAYf;AAED;wDACwD;AACxD,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,aAAa,EAClB,EAAE,EAAE,MAAM,GACT,MAAM,GAAG,IAAI,CA8Gf"}
1
+ {"version":3,"file":"virtual-modules.d.ts","sourceRoot":"","sources":["../src/virtual-modules.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAa/C,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,aAAa,EAClB,EAAE,EAAE,MAAM,GACT,MAAM,GAAG,IAAI,CAYf;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,aAAa,EAClB,EAAE,EAAE,MAAM,GACT,MAAM,GAAG,IAAI,CAoGf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@animus-ui/vite-plugin",
3
- "version": "0.1.9",
3
+ "version": "0.1.12",
4
4
  "description": "Animus static CSS extraction Vite plugin",
5
5
  "keywords": [
6
6
  "animus",
@@ -39,9 +39,12 @@
39
39
  "compile": "tsc --noEmit"
40
40
  },
41
41
  "dependencies": {
42
- "@animus-ui/extract": "0.1.9",
43
- "browserslist": "^4.24.0",
44
- "lightningcss": "^1.29.0"
42
+ "@animus-ui/extract": "0.1.12",
43
+ "browserslist": "^4.28.8",
44
+ "lightningcss": "^1.33.0"
45
+ },
46
+ "devDependencies": {
47
+ "@animus-ui/assertions": "0.1.12"
45
48
  },
46
49
  "peerDependencies": {
47
50
  "@mdx-js/mdx": "^3.0.0",
@@ -51,5 +54,8 @@
51
54
  "@mdx-js/mdx": {
52
55
  "optional": true
53
56
  }
57
+ },
58
+ "engines": {
59
+ "node": ">=22.12.0"
54
60
  }
55
61
  }