@animus-ui/next-plugin 0.1.8 → 0.1.11
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.cjs +74 -1566
- package/dist/index.mjs +57 -1549
- package/dist/loader.cjs +16 -13
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.mjs +9 -6
- package/dist/plugin.d.ts +16 -3
- package/dist/plugin.d.ts.map +1 -1
- package/dist/turbopack-config.d.ts +9 -9
- package/dist/turbopack-config.d.ts.map +1 -1
- package/dist/turbopack-loader.cjs +11 -11
- package/dist/turbopack-loader.d.ts.map +1 -1
- package/dist/turbopack-loader.mjs +9 -5
- package/dist/types.d.ts +14 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/with-animus.d.ts.map +1 -1
- package/package.json +5 -2
- package/dist/extraction-session.d.ts +0 -367
- package/dist/extraction-session.d.ts.map +0 -1
- package/dist/resolve-packages.d.ts +0 -8
- package/dist/resolve-packages.d.ts.map +0 -1
- package/dist/session-paths-CZoi19NW.cjs +0 -229
- package/dist/session-paths-DfYIPDcM.mjs +0 -107
- package/dist/session-paths.d.ts +0 -107
- package/dist/session-paths.d.ts.map +0 -1
- package/dist/singleton-372wiSRr.mjs +0 -202
- package/dist/singleton-D4vhawsW.cjs +0 -339
- package/dist/singleton.d.ts +0 -78
- package/dist/singleton.d.ts.map +0 -1
- package/dist/timing.d.ts +0 -7
- package/dist/timing.d.ts.map +0 -1
- package/dist/turbopack-orchestrator.d.ts +0 -34
- package/dist/turbopack-orchestrator.d.ts.map +0 -1
- /package/dist/{loader-core-C40WbC6s.cjs → loader-core-D2rh--tX.cjs} +0 -0
- /package/dist/{loader-core-D6Tm_b8F.mjs → loader-core-DwiidYBi.mjs} +0 -0
package/dist/loader.cjs
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
const
|
|
2
|
-
const require_singleton = require("./singleton-D4vhawsW.cjs");
|
|
3
|
-
const require_loader_core = require("./loader-core-C40WbC6s.cjs");
|
|
1
|
+
const require_loader_core = require("./loader-core-D2rh--tX.cjs");
|
|
4
2
|
require("./turbopack-loader.cjs");
|
|
5
3
|
let _animus_ui_extract_pipeline = require("@animus-ui/extract/pipeline");
|
|
4
|
+
let _animus_ui_extract_session = require("@animus-ui/extract/session");
|
|
6
5
|
let fs = require("fs");
|
|
7
6
|
let path = require("path");
|
|
8
7
|
//#region src/loader.ts
|
|
9
|
-
/** Session dirs whose epoch artifact has been SEEN on disk
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
/** Session dirs whose epoch artifact has been SEEN on disk. A sibling
|
|
9
|
+
* session's reconciliation may delete the artifact, but the owning
|
|
10
|
+
* session self-heals it on its next publish, so a positive existsSync
|
|
11
|
+
* stays a sound basis for registering the dependency: a module built
|
|
12
|
+
* during the missing window records a missing-file witness that the
|
|
13
|
+
* recreation then invalidates (over-invalidation, never under).
|
|
14
|
+
* Negatives always re-probe. */
|
|
12
15
|
const epochSeenForSessionDir = /* @__PURE__ */ new Set();
|
|
13
16
|
/**
|
|
14
17
|
* Webpack loader for Animus source transformation.
|
|
@@ -27,32 +30,32 @@ const epochSeenForSessionDir = /* @__PURE__ */ new Set();
|
|
|
27
30
|
*/
|
|
28
31
|
function animusLoader(source) {
|
|
29
32
|
if (this.mode !== "production" && typeof this.addDependency === "function") {
|
|
30
|
-
const sessionDir =
|
|
33
|
+
const sessionDir = (0, _animus_ui_extract_session.getSessionArtifactDir)();
|
|
31
34
|
if (sessionDir) {
|
|
32
|
-
const epochPath =
|
|
35
|
+
const epochPath = (0, _animus_ui_extract_session.replacementEpochPath)(sessionDir);
|
|
33
36
|
if (epochSeenForSessionDir.has(sessionDir) || (0, fs.existsSync)(epochPath)) {
|
|
34
37
|
epochSeenForSessionDir.add(sessionDir);
|
|
35
38
|
this.addDependency(epochPath);
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
|
-
let manifestJson =
|
|
42
|
+
let manifestJson = (0, _animus_ui_extract_session.getManifestJson)();
|
|
40
43
|
if (!manifestJson) return source;
|
|
41
44
|
const filename = (0, path.relative)(this.rootContext, this.resourcePath);
|
|
42
|
-
const analyzedHash =
|
|
45
|
+
const analyzedHash = (0, _animus_ui_extract_session.getAnalyzedHashes)()?.get(filename);
|
|
43
46
|
if (analyzedHash !== void 0) {
|
|
44
47
|
const sourceHash = (0, _animus_ui_extract_pipeline.contentHash)(source);
|
|
45
48
|
if (sourceHash !== analyzedHash) {
|
|
46
|
-
const refreshedHash =
|
|
49
|
+
const refreshedHash = (0, _animus_ui_extract_session.getAnalyzedHashes)()?.get(filename);
|
|
47
50
|
if (refreshedHash === void 0 || sourceHash !== refreshedHash) throw new Error(`ANIMUS_ANALYSIS_CATCHING_UP: ${filename} changed after the current analysis; retrying on the next watch turn`);
|
|
48
|
-
manifestJson =
|
|
51
|
+
manifestJson = (0, _animus_ui_extract_session.getManifestJson)() ?? manifestJson;
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
54
|
return require_loader_core.transformWithManifest({
|
|
52
55
|
source,
|
|
53
56
|
filename,
|
|
54
57
|
manifestJson,
|
|
55
|
-
engineApi:
|
|
58
|
+
engineApi: _animus_ui_extract_session.engineApi,
|
|
56
59
|
opts: this.getOptions?.() ?? {}
|
|
57
60
|
});
|
|
58
61
|
}
|
package/dist/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAWzD,KAAK,aAAa,GAAG;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,mBAAmB,CAAC;IACtC;uDACmD;IACnD,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,uEAAuE;IACvE,IAAI,CAAC,EAAE,aAAa,GAAG,YAAY,GAAG,MAAM,CAAC;CAC9C,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,MAAM,GACb,MAAM,CAmDR"}
|
package/dist/loader.mjs
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as getManifestJson, i as getAnalyzedHashes, n as engineApi, s as getSessionArtifactDir } from "./singleton-372wiSRr.mjs";
|
|
3
|
-
import { t as transformWithManifest } from "./loader-core-D6Tm_b8F.mjs";
|
|
1
|
+
import { t as transformWithManifest } from "./loader-core-DwiidYBi.mjs";
|
|
4
2
|
import { contentHash } from "@animus-ui/extract/pipeline";
|
|
3
|
+
import { engineApi, getAnalyzedHashes, getManifestJson, getSessionArtifactDir, replacementEpochPath } from "@animus-ui/extract/session";
|
|
5
4
|
import { existsSync } from "fs";
|
|
6
5
|
import { relative } from "path";
|
|
7
6
|
//#region src/loader.ts
|
|
8
|
-
/** Session dirs whose epoch artifact has been SEEN on disk
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
/** Session dirs whose epoch artifact has been SEEN on disk. A sibling
|
|
8
|
+
* session's reconciliation may delete the artifact, but the owning
|
|
9
|
+
* session self-heals it on its next publish, so a positive existsSync
|
|
10
|
+
* stays a sound basis for registering the dependency: a module built
|
|
11
|
+
* during the missing window records a missing-file witness that the
|
|
12
|
+
* recreation then invalidates (over-invalidation, never under).
|
|
13
|
+
* Negatives always re-probe. */
|
|
11
14
|
const epochSeenForSessionDir = /* @__PURE__ */ new Set();
|
|
12
15
|
/**
|
|
13
16
|
* Webpack loader for Animus source transformation.
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AnimusNextOptions } from './types';
|
|
2
|
-
export { ANIMUS_CSS_MODULE_ID } from '
|
|
2
|
+
export { ANIMUS_CSS_MODULE_ID } from '@animus-ui/extract/session';
|
|
3
3
|
type WebpackSource = {
|
|
4
4
|
source(): string | Buffer;
|
|
5
5
|
size(): number;
|
|
@@ -138,9 +138,22 @@ export declare class AnimusWebpackPlugin {
|
|
|
138
138
|
* session-scoped alias/stub paths from it (design D2). */
|
|
139
139
|
get sessionId(): string;
|
|
140
140
|
/** Set the project root at CONFIG time (with-animus) — the ONE root all
|
|
141
|
-
* session-path derivations use. The compiler hooks
|
|
142
|
-
* compiler.context
|
|
141
|
+
* session-path derivations use. The compiler hooks ADOPT
|
|
142
|
+
* compiler.context only when no root was published (bare-apply
|
|
143
|
+
* harnesses); they never overwrite this. */
|
|
143
144
|
setRootDir(rootDir: string): void;
|
|
145
|
+
/** One warning per plugin instance for a context/root mismatch. */
|
|
146
|
+
private warnedRootDivergence;
|
|
147
|
+
/** The run/watchRun taps' root handling: adopt compiler.context when no
|
|
148
|
+
* config-time root exists; otherwise KEEP the configured root — every
|
|
149
|
+
* frozen config-time derivation (stub path, css alias target,
|
|
150
|
+
* virtual:animus/system-props target, watch-ignore) came from it, and a
|
|
151
|
+
* silent overwrite re-keys sessionDir so the pipeline publishes
|
|
152
|
+
* artifacts where none of those consumers look. A disagreement is
|
|
153
|
+
* surfaced loudly instead (with-animus derives the root from Next's own
|
|
154
|
+
* `dir`, which equals compiler.context in real Next runs — a mismatch
|
|
155
|
+
* means a custom-webpack setup wired the plugin differently). */
|
|
156
|
+
private adoptCompilerContext;
|
|
144
157
|
/** This session's artifact directory, derived from the one root. */
|
|
145
158
|
get sessionDir(): string;
|
|
146
159
|
/** Expose options for the loader */
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[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AG,IAAI,CAEhC;IAED,mEAAmE;IACnE,OAAO,CAAC,oBAAoB,CAAS;IAErC;;;;;;;;sEAQkE;IAClE,OAAO,CAAC,oBAAoB;IAqB5B,oEAAoE;IACpE,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,oCAAoC;IACpC,UAAU,IAAI,iBAAiB,CAE9B;IAED;mFAC+E;IAC/E,sBAAsB,IAAI,MAAM,EAAE,CAIjC;IAED;mFAC+E;IAC/E,wBAAwB,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAI9C;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TURBOPACK_SYSTEM_PROPS_ID } from '@animus-ui/extract/session';
|
|
1
2
|
import type { AnimusNextOptions } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* Turbopack config fragment generation (spec: next-turbopack-integration).
|
|
@@ -15,15 +16,14 @@ export interface TurbopackConfigFragment {
|
|
|
15
16
|
rules: Record<string, TurbopackRule>;
|
|
16
17
|
resolveAlias: Record<string, string>;
|
|
17
18
|
}
|
|
18
|
-
/** The single glob the Animus loader registers under
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export declare const TURBOPACK_SYSTEM_PROPS_ID = "virtual:animus/system-props";
|
|
19
|
+
/** The single glob the Animus loader registers under — derived from the
|
|
20
|
+
* ONE shared engine extension set (also the unplugin transform gate's
|
|
21
|
+
* source), so the two bundler families cannot drift. `.mjs` is in that
|
|
22
|
+
* set for webpack parity: an external package without `src/` is ingested
|
|
23
|
+
* via its resolved dist entry (often `dist/index.mjs`) and must still
|
|
24
|
+
* reach the loader — manifest lookup remains the file-level gate. */
|
|
25
|
+
export declare const ANIMUS_TURBOPACK_RULE_GLOB: string;
|
|
26
|
+
export { TURBOPACK_SYSTEM_PROPS_ID };
|
|
27
27
|
/**
|
|
28
28
|
* Resolve whether Turbopack wiring is active for this process. Default is
|
|
29
29
|
* `'auto'`: active exactly when the TURBOPACK environment variable is set
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turbopack-config.d.ts","sourceRoot":"","sources":["../src/turbopack-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"turbopack-config.d.ts","sourceRoot":"","sources":["../src/turbopack-config.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,yBAAyB,EAC1B,MAAM,4BAA4B,CAAC;AAKpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;GAIG;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC;AAElD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CACtE;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACrC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED;;;;;sEAKsE;AACtE,eAAO,MAAM,0BAA0B,QAAiD,CAAC;AAEzF,OAAO,EAAE,yBAAyB,EAAE,CAAC;AAErC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,iBAAiB,EAC1B,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,OAAO,CAMT;AAQD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,qBAAqB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,uBAAuB,CA0C1B;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAMpE"}
|
|
@@ -24,9 +24,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
enumerable: true
|
|
25
25
|
}) : target, mod));
|
|
26
26
|
//#endregion
|
|
27
|
-
const
|
|
28
|
-
const require_loader_core = require("./loader-core-C40WbC6s.cjs");
|
|
27
|
+
const require_loader_core = require("./loader-core-D2rh--tX.cjs");
|
|
29
28
|
let _animus_ui_extract_pipeline = require("@animus-ui/extract/pipeline");
|
|
29
|
+
let _animus_ui_extract_session = require("@animus-ui/extract/session");
|
|
30
30
|
let fs = require("fs");
|
|
31
31
|
fs = __toESM(fs);
|
|
32
32
|
let path = require("path");
|
|
@@ -91,7 +91,7 @@ const SEQLOCK_RETRIES = 5;
|
|
|
91
91
|
* Hydration replays the committed analysis inputs once per commit content.
|
|
92
92
|
*/
|
|
93
93
|
function hydrateSession(sessionDir, sessionId) {
|
|
94
|
-
const commitPath =
|
|
94
|
+
const commitPath = (0, _animus_ui_extract_session.analysisCommitPath)(sessionDir);
|
|
95
95
|
for (let attempt = 0; attempt < SEQLOCK_RETRIES; attempt++) {
|
|
96
96
|
const c0raw = readFileOrNull(commitPath);
|
|
97
97
|
if (c0raw === null) return { kind: "absent" };
|
|
@@ -114,15 +114,15 @@ function hydrateSession(sessionDir, sessionId) {
|
|
|
114
114
|
commitRaw: c0raw
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
|
-
const manifestRaw = readFileOrNull(
|
|
118
|
-
const inputsRaw = readFileOrNull(
|
|
117
|
+
const manifestRaw = readFileOrNull((0, _animus_ui_extract_session.manifestPath)(sessionDir));
|
|
118
|
+
const inputsRaw = readFileOrNull((0, _animus_ui_extract_session.analysisInputsPath)(sessionDir));
|
|
119
119
|
if (manifestRaw === null || inputsRaw === null) continue;
|
|
120
120
|
if ((0, _animus_ui_extract_pipeline.contentHash)(manifestRaw) !== c0.manifestHash || (0, _animus_ui_extract_pipeline.contentHash)(inputsRaw) !== c0.inputsHash) continue;
|
|
121
121
|
if (readFileOrNull(commitPath) !== c0raw) continue;
|
|
122
122
|
let inputs;
|
|
123
123
|
let fileHashes;
|
|
124
124
|
try {
|
|
125
|
-
const envelopeSession =
|
|
125
|
+
const envelopeSession = (0, _animus_ui_extract_session.readJsonEnvelope)(manifestRaw)?.sessionId;
|
|
126
126
|
if (envelopeSession !== void 0 && envelopeSession !== sessionId) return {
|
|
127
127
|
kind: "foreign",
|
|
128
128
|
artifactSessionId: String(envelopeSession)
|
|
@@ -149,7 +149,7 @@ function hydrateSession(sessionDir, sessionId) {
|
|
|
149
149
|
return { kind: "torn" };
|
|
150
150
|
}
|
|
151
151
|
function readStatus(sessionDir) {
|
|
152
|
-
const raw = readFileOrNull(
|
|
152
|
+
const raw = readFileOrNull((0, _animus_ui_extract_session.analysisStatusPath)(sessionDir));
|
|
153
153
|
if (raw === null) return null;
|
|
154
154
|
try {
|
|
155
155
|
return JSON.parse(raw);
|
|
@@ -189,11 +189,11 @@ async function runLoader(ctx, source) {
|
|
|
189
189
|
const opts = ctx.getOptions?.() ?? {};
|
|
190
190
|
const rootDir = opts.rootDir ?? ctx.rootContext;
|
|
191
191
|
const sessionId = opts.sessionId;
|
|
192
|
-
const sessionDir = opts.sessionDir ?? (sessionId !== void 0 ?
|
|
192
|
+
const sessionDir = opts.sessionDir ?? (sessionId !== void 0 ? (0, _animus_ui_extract_session.sessionArtifactDir)(rootDir, sessionId) : void 0);
|
|
193
193
|
if (sessionId === void 0 || sessionDir === void 0) return source;
|
|
194
|
-
const commitPath =
|
|
195
|
-
const statusPath =
|
|
196
|
-
const epochPath =
|
|
194
|
+
const commitPath = (0, _animus_ui_extract_session.analysisCommitPath)(sessionDir);
|
|
195
|
+
const statusPath = (0, _animus_ui_extract_session.analysisStatusPath)(sessionDir);
|
|
196
|
+
const epochPath = (0, _animus_ui_extract_session.replacementEpochPath)(sessionDir);
|
|
197
197
|
if (typeof ctx.addDependency === "function" && (epochSeenPaths.has(epochPath) || fsImpl.existsSync(epochPath))) {
|
|
198
198
|
epochSeenPaths.add(epochPath);
|
|
199
199
|
ctx.addDependency(epochPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turbopack-loader.d.ts","sourceRoot":"","sources":["../src/turbopack-loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"turbopack-loader.d.ts","sourceRoot":"","sources":["../src/turbopack-loader.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,MAAM,MAAM,IAAI,CAAC;AAK7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAOzD;;;8DAG8D;AAC9D,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,KAAK,cAAc,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;AAEpE,KAAK,aAAa,GAAG;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,sBAAsB,CAAC;IACzC;;oDAEgD;IAChD,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC;iEAC6D;IAC7D,KAAK,CAAC,EAAE,MAAM,cAAc,CAAC;CAC9B,CAAC;AAgDF,KAAK,QAAQ,GAAG,IAAI,CAAC,OAAO,MAAM,EAAE,cAAc,GAAG,YAAY,CAAC,CAAC;AAGnE,8DAA8D;AAC9D,wBAAgB,8BAA8B,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI,CAExE;AAMD,+DAA+D;AAC/D,wBAAgB,mCAAmC,IAAI,IAAI,CAK1D;AAkKD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAC3C,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,MAAM,GACb,IAAI,CAcN"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as transformWithManifest } from "./loader-core-DwiidYBi.mjs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
3
|
import { buildAnalyzeProjectArgs, contentHash, createV2EngineApi } from "@animus-ui/extract/pipeline";
|
|
4
|
+
import { analysisCommitPath, analysisInputsPath, analysisStatusPath, manifestPath, readJsonEnvelope, replacementEpochPath, sessionArtifactDir } from "@animus-ui/extract/session";
|
|
4
5
|
import * as nodeFs from "fs";
|
|
5
6
|
import { relative } from "path";
|
|
7
|
+
//#region \0rolldown/runtime.js
|
|
8
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
9
|
+
//#endregion
|
|
6
10
|
//#region src/turbopack-loader.ts
|
|
7
11
|
let engine = null;
|
|
8
12
|
let sentSources = null;
|
|
@@ -14,7 +18,7 @@ let hydratedManifestJson = null;
|
|
|
14
18
|
/** Committed per-file analyzed content hashes (from the inputs). */
|
|
15
19
|
let hydratedFileHashes = null;
|
|
16
20
|
const engineModuleId = "@animus-ui/extract";
|
|
17
|
-
const engineApi = createV2EngineApi({
|
|
21
|
+
const engineApi$1 = createV2EngineApi({
|
|
18
22
|
label: "animus-next-turbopack",
|
|
19
23
|
isV2: () => true,
|
|
20
24
|
loadNativeEngine: () => __require(engineModuleId),
|
|
@@ -106,7 +110,7 @@ function hydrateSession(sessionDir, sessionId) {
|
|
|
106
110
|
} catch {
|
|
107
111
|
return { kind: "torn" };
|
|
108
112
|
}
|
|
109
|
-
const { analyzeProject } = engineApi();
|
|
113
|
+
const { analyzeProject } = engineApi$1();
|
|
110
114
|
hydratedManifestJson = analyzeProject(...buildAnalyzeProjectArgs(inputs));
|
|
111
115
|
hydratedFileHashes = fileHashes;
|
|
112
116
|
hydratedKey = key;
|
|
@@ -187,7 +191,7 @@ async function runLoader(ctx, source) {
|
|
|
187
191
|
source,
|
|
188
192
|
filename,
|
|
189
193
|
manifestJson,
|
|
190
|
-
engineApi,
|
|
194
|
+
engineApi: engineApi$1,
|
|
191
195
|
opts
|
|
192
196
|
});
|
|
193
197
|
const outcome = hydrateSession(sessionDir, sessionId);
|
package/dist/types.d.ts
CHANGED
|
@@ -2,7 +2,11 @@ import type { StaticCssConfig } from '@animus-ui/extract/pipeline';
|
|
|
2
2
|
export interface AnimusNextOptions {
|
|
3
3
|
/** Path to a module exporting a SystemInstance from `@animus-ui/system`. */
|
|
4
4
|
system: string;
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Exclusion patterns (substrings, or globs when `*`/`?` present). When
|
|
7
|
+
* set, REPLACES the replaceable defaults (`dist`, `.test.`, `.spec.`);
|
|
8
|
+
* `node_modules`, `.next`, and `.animus` are always excluded.
|
|
9
|
+
*/
|
|
6
10
|
exclude?: string[];
|
|
7
11
|
/**
|
|
8
12
|
* File extensions to scan for component definitions and JSX usages.
|
|
@@ -47,9 +51,17 @@ export interface AnimusNextOptions {
|
|
|
47
51
|
* Control CSS minification of the emitted stylesheet.
|
|
48
52
|
* - `true`: always minify (dev + prod)
|
|
49
53
|
* - `false`: never minify (autoprefixing still applies)
|
|
50
|
-
* - `undefined` (default): minify in production (`
|
|
54
|
+
* - `undefined` (default): minify in production (per `mode`, else
|
|
55
|
+
* `NODE_ENV === 'production'`)
|
|
51
56
|
*/
|
|
52
57
|
minify?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Explicit dev/prod emission mode. Wins over the environment signal.
|
|
60
|
+
* When absent, the documented default applies: `NODE_ENV === 'production'`
|
|
61
|
+
* decides the minify default, and the compiler's dev flag decides the
|
|
62
|
+
* dev-diagnostics define.
|
|
63
|
+
*/
|
|
64
|
+
mode?: 'development' | 'production';
|
|
53
65
|
/**
|
|
54
66
|
* Extraction engine selection. `'v2'` is the only engine and the default,
|
|
55
67
|
* propagated to every compiler instance (including non-owning ones). The v1
|
package/dist/types.d.ts.map
CHANGED
|
@@ -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
|
|
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;;;;OAIG;IACH,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;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,aAAa,GAAG,YAAY,CAAC;IACpC;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC;IACd;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,CAAA;KAAE,CAAC;IAC7C;;;OAGG;IACH,kBAAkB,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IACtD;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-animus.d.ts","sourceRoot":"","sources":["../src/with-animus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"with-animus.d.ts","sourceRoot":"","sources":["../src/with-animus.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAKjD,KAAK,aAAa,GAAG;IACnB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAChC,CAAC;IACF,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,KAAK,CAAC;YACZ,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC;YAC5C,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC;YAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,GAAG,CAAC,EAAE,KAAK,CAAC;gBAAE,MAAM,EAAE,MAAM,CAAC;gBAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;aAAE,CAAC,CAAC;SACpE,CAAC,CAAC;KACJ,CAAC;CACH,CAAC;AAEF,KAAK,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,CAoP9D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@animus-ui/next-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
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.
|
|
43
|
+
"@animus-ui/extract": "0.1.11"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@mdx-js/mdx": "^3.0.0",
|
|
@@ -51,5 +51,8 @@
|
|
|
51
51
|
"@mdx-js/mdx": {
|
|
52
52
|
"optional": true
|
|
53
53
|
}
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=22.12.0"
|
|
54
57
|
}
|
|
55
58
|
}
|