@animus-ui/next-plugin 0.1.6 → 0.1.8

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.
@@ -7,9 +7,12 @@ import type { ExtractionSession } from './extraction-session';
7
7
  * filesystem watcher — the bundler only ever sees the `.animus/` disk
8
8
  * artifacts.
9
9
  */
10
- /** Run the full pipeline with the Turbopack emitter identity: hydration
11
- * artifacts persisted, and the virtual system-props id (Turbopack rejects
12
- * the webpack path's absolute-path imports). */
10
+ /** Run the full pipeline with the Turbopack emitter identity: the virtual
11
+ * system-props id (Turbopack rejects the webpack path's absolute-path
12
+ * imports). Turbopack orchestration persists the analysis-inputs
13
+ * hydration corpus — its isolated loader workers replay it (spec:
14
+ * next-turbopack-integration, "Manifest disk artifact"; webpack mode
15
+ * skips the corpus). */
13
16
  export declare function runTurbopackPipeline(session: ExtractionSession): Promise<void>;
14
17
  /**
15
18
  * Start the dev watcher: fs.watch per eligible top-level directory (plus a
@@ -1 +1 @@
1
- {"version":3,"file":"turbopack-orchestrator.d.ts","sourceRoot":"","sources":["../src/turbopack-orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,EAAE,MAAM,IAAI,CAAC;AAK9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;;;;GAMG;AAEH;;iDAEiD;AACjD,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAIf;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,MAAM,EACf,UAAU,SAAK,EAGf,OAAO,GAAE,OAAO,KAAa,GAC5B;IAAE,KAAK,IAAI,IAAI,CAAA;CAAE,GAAG,IAAI,CA0G1B"}
1
+ {"version":3,"file":"turbopack-orchestrator.d.ts","sourceRoot":"","sources":["../src/turbopack-orchestrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,EAAE,MAAM,IAAI,CAAC;AAK9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D;;;;;;GAMG;AAEH;;;;;yBAKyB;AACzB,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAIf;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,MAAM,EACf,UAAU,SAAK,EAGf,OAAO,GAAE,OAAO,KAAa,GAC5B;IAAE,KAAK,IAAI,IAAI,CAAA;CAAE,GAAG,IAAI,CAiS1B"}
package/dist/types.d.ts CHANGED
@@ -85,6 +85,13 @@ export interface AnimusNextOptions {
85
85
  unstable_turbopack?: {
86
86
  mode?: 'off' | 'auto' | 'on';
87
87
  };
88
+ /**
89
+ * @internal Absolute path of the loader module registered in the webpack
90
+ * rule when it is not this package's own dist/src loader (test harnesses
91
+ * wrapping the real loader in a require-able shim). Feeds the needBuild
92
+ * loader-chain predicate; `withAnimus` never sets it.
93
+ */
94
+ loaderPath?: string;
88
95
  /**
89
96
  * Full `@layer` declaration order. Must include all 7 Animus `anm-*`
90
97
  * layers (`anm-global`, `anm-base`, `anm-variants`, `anm-compounds`,
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;;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K,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC1C,OAAO,CAAC,EAAE,CACR,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,aAAa,CAAC;CACpB,CAAC;AAKF;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,iBAAiB,GACzB,CAAC,UAAU,EAAE,UAAU,KAAK,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAgN9D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@animus-ui/next-plugin",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Animus static CSS extraction for Next.js (webpack)",
5
5
  "keywords": [
6
6
  "animus",
@@ -40,7 +40,7 @@
40
40
  "compile": "tsc --noEmit"
41
41
  },
42
42
  "dependencies": {
43
- "@animus-ui/extract": "0.1.6"
43
+ "@animus-ui/extract": "0.1.8"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@mdx-js/mdx": "^3.0.0",
@@ -1,5 +0,0 @@
1
- import { createRequire } from "node:module";
2
- //#region \0rolldown/runtime.js
3
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
4
- //#endregion
5
- export { __require as t };
@@ -1,108 +0,0 @@
1
- import { t as __require } from "./chunk-y_GBKt04.mjs";
2
- import { createV2EngineApi } from "@animus-ui/extract/pipeline";
3
- //#region src/singleton.ts
4
- /**
5
- * Module-scope singleton for sharing analysis state between the webpack plugin and loader.
6
- *
7
- * Uses globalThis to survive the ESM/CJS module boundary: the plugin is loaded via ESM
8
- * (next.config.ts import) while the loader is loaded by webpack via require(). Without
9
- * globalThis, each module system gets its own singleton instance.
10
- */
11
- const MANIFEST_KEY = "__animus_manifest_json__";
12
- const PROMISE_KEY = "__animus_analysis_promise__";
13
- const SHARED_CSS_KEY = "__animus_shared_css__";
14
- const SHARED_SYSTEM_PROPS_KEY = "__animus_shared_system_props__";
15
- const SHARED_EXTERNAL_DIRS_KEY = "__animus_external_pkg_dirs__";
16
- const SHARED_EXTERNAL_ENTRIES_KEY = "__animus_external_source_entries__";
17
- function getManifestJson() {
18
- return globalThis[MANIFEST_KEY];
19
- }
20
- function setManifestJson(json) {
21
- globalThis[MANIFEST_KEY] = json;
22
- }
23
- function getAnalysisPromise() {
24
- return globalThis[PROMISE_KEY];
25
- }
26
- function setAnalysisPromise(promise) {
27
- globalThis[PROMISE_KEY] = promise;
28
- }
29
- function resetAnalysisPromise() {
30
- globalThis[PROMISE_KEY] = null;
31
- }
32
- function getSharedCss() {
33
- return globalThis[SHARED_CSS_KEY] || "";
34
- }
35
- function setSharedCss(css) {
36
- globalThis[SHARED_CSS_KEY] = css;
37
- }
38
- function setSharedSystemProps(content) {
39
- globalThis[SHARED_SYSTEM_PROPS_KEY] = content;
40
- }
41
- function getSharedExternalDirs() {
42
- return globalThis[SHARED_EXTERNAL_DIRS_KEY] || [];
43
- }
44
- function setSharedExternalDirs(dirs) {
45
- globalThis[SHARED_EXTERNAL_DIRS_KEY] = dirs;
46
- }
47
- function getSharedExternalEntries() {
48
- return globalThis[SHARED_EXTERNAL_ENTRIES_KEY] || /* @__PURE__ */ new Map();
49
- }
50
- function setSharedExternalEntries(entries) {
51
- globalThis[SHARED_EXTERNAL_ENTRIES_KEY] = entries;
52
- }
53
- const ENGINE_KEY = "__animus_engine__";
54
- /** Engine selection travels through the singleton so non-owning compiler
55
- * instances and the webpack loader honor the same choice as the owner. */
56
- function setSharedEngine(engine) {
57
- globalThis[ENGINE_KEY] = engine;
58
- }
59
- function getSharedEngine() {
60
- return globalThis[ENGINE_KEY] || "v2";
61
- }
62
- /** Single engine choke-point for every native extraction call. Return type
63
- * mirrors the untyped `require` the call sites previously used — the NAPI
64
- * module's own .d.ts is the authoritative surface. */
65
- function requireEngine() {
66
- return __require("@animus-ui/extract");
67
- }
68
- const V2_ENGINE_KEY = "__animus_v2_engine__";
69
- /**
70
- * Engine-agnostic API over both engines (extract-v2-spine row 13). The
71
- * v2 leg adapts the v1 function surface onto a stateful ExtractEngine
72
- * (hoisted to `createV2EngineApi` in @animus-ui/extract/pipeline — the
73
- * single authoritative copy shared with vite-plugin). The engine INSTANCE,
74
- * its analyze-time sources, and the one-shot drift flag all live on
75
- * globalThis for the same reason the manifest does — the ESM plugin and the
76
- * CJS webpack loader must see one engine (and one drift warning) across the
77
- * double-load. (The next-plugin is already process-singleton by design:
78
- * manifest, css, and system props share the same globalThis keys.)
79
- * loadSystemModule is exported by both bindings from one engine-neutral
80
- * Rust crate, so the default path no longer loads the v1 binary.
81
- */
82
- const V2_SENT_SOURCES_KEY = "__animus_v2_sent_sources__";
83
- const V2_DRIFT_WARNED_KEY = "__animus_v2_drift_warned__";
84
- const v2EngineApi = createV2EngineApi({
85
- label: "animus-next",
86
- isV2: () => getSharedEngine() === "v2",
87
- loadNativeEngine: requireEngine,
88
- passThroughUnknownPaths: true,
89
- store: {
90
- getEngine: () => globalThis[V2_ENGINE_KEY],
91
- setEngine: (engine) => {
92
- globalThis[V2_ENGINE_KEY] = engine;
93
- },
94
- getSentSources: () => globalThis[V2_SENT_SOURCES_KEY] ?? null,
95
- setSentSources: (sources) => {
96
- globalThis[V2_SENT_SOURCES_KEY] = sources;
97
- },
98
- getDriftWarned: () => Boolean(globalThis[V2_DRIFT_WARNED_KEY]),
99
- setDriftWarned: (value) => {
100
- globalThis[V2_DRIFT_WARNED_KEY] = value;
101
- }
102
- }
103
- });
104
- function engineApi() {
105
- return v2EngineApi();
106
- }
107
- //#endregion
108
- export { getSharedExternalDirs as a, setAnalysisPromise as c, setSharedEngine as d, setSharedExternalDirs as f, getSharedCss as i, setManifestJson as l, setSharedSystemProps as m, getAnalysisPromise as n, getSharedExternalEntries as o, setSharedExternalEntries as p, getManifestJson as r, resetAnalysisPromise as s, engineApi as t, setSharedCss as u };