@animus-ui/next-plugin 0.1.3 → 0.1.5
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 +2 -2
- package/dist/extraction-session.d.ts +37 -0
- package/dist/extraction-session.d.ts.map +1 -1
- package/dist/index.cjs +148 -4
- package/dist/index.mjs +149 -5
- package/dist/plugin.d.ts.map +1 -1
- package/dist/with-animus.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -60,9 +60,9 @@ it in a server-only module and inline it as the first child of `<head>`.
|
|
|
60
60
|
// appearance-bootstrap.ts — server-only; never import from a client component
|
|
61
61
|
import { createAppearanceBootstrap } from '@animus-ui/system/bootstrap';
|
|
62
62
|
|
|
63
|
-
import {
|
|
63
|
+
import { theme } from './src/ds';
|
|
64
64
|
|
|
65
|
-
export const appearanceBootstrap = createAppearanceBootstrap(
|
|
65
|
+
export const appearanceBootstrap = createAppearanceBootstrap(theme);
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
```tsx
|
|
@@ -31,6 +31,10 @@ export declare class ExtractionSession {
|
|
|
31
31
|
rootDir: string | null;
|
|
32
32
|
/** Serialized path aliases, harvested by the adapter from bundler config. */
|
|
33
33
|
pathAliasesJson: string | null;
|
|
34
|
+
private assetCopyCache;
|
|
35
|
+
/** Physical asset files registered with the host watcher. */
|
|
36
|
+
assetDependencyPaths: Set<string>;
|
|
37
|
+
private assetDependencyKeys;
|
|
34
38
|
/** When set (Turbopack orchestration), every analysis also persists
|
|
35
39
|
* `.animus/analysis-inputs.json` so isolated loader workers can hydrate.
|
|
36
40
|
* Webpack mode leaves this off — its loader shares the process. */
|
|
@@ -42,6 +46,10 @@ export declare class ExtractionSession {
|
|
|
42
46
|
systemPropsModuleId: string | null;
|
|
43
47
|
/** Absolute directory prefixes for external DS packages (loader allowlisting). */
|
|
44
48
|
externalPackageDirs: string[];
|
|
49
|
+
/** Absolute package dir → owning specifier (cross-source correlation). */
|
|
50
|
+
private externalDirOwners;
|
|
51
|
+
/** rootDir-relative external file → owning specifier (correlation join). */
|
|
52
|
+
private externalFileOwners;
|
|
45
53
|
/** External package specifier → absolute source entry path. */
|
|
46
54
|
externalSourceEntries: Map<string, string>;
|
|
47
55
|
private readonly options;
|
|
@@ -134,5 +142,34 @@ export declare class ExtractionSession {
|
|
|
134
142
|
* pid — Next dev evaluates the config in more than one process, and two
|
|
135
143
|
* sessions writing the same artifact must not race on one tmp path. */
|
|
136
144
|
private writeAnimusFile;
|
|
145
|
+
/**
|
|
146
|
+
* asset() placeholder substitution (global-styles-system): resolve each
|
|
147
|
+
* referenced specifier through Node resolution, copy the bytes into
|
|
148
|
+
* `.animus/assets/` under a content-hashed name, and substitute a
|
|
149
|
+
* RELATIVE url. `.animus/styles.css` is processed by Next's own CSS
|
|
150
|
+
* pipeline (webpack and Turbopack alike), which applies its native asset
|
|
151
|
+
* handling — publicPath and output hashing — to relative url()
|
|
152
|
+
* references. Unsubstitutable specifiers warn and emit literally in
|
|
153
|
+
* non-strict mode, fail the build under `strict: true`.
|
|
154
|
+
*/
|
|
155
|
+
private substituteAssetReferences;
|
|
156
|
+
private trackAssetDependency;
|
|
157
|
+
/**
|
|
158
|
+
* Resolve an asset specifier to an absolute file via the shared pipeline
|
|
159
|
+
* resolver (host aliases → Node resolution → package root), with one
|
|
160
|
+
* session-local last resort: an already-discovered source entry's package
|
|
161
|
+
* root (dist-less workspace kits the shared resolver cannot see).
|
|
162
|
+
*/
|
|
163
|
+
private resolveAssetSpecifier;
|
|
137
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* Sync `.animus/assets/` to the current build's content-hashed file set:
|
|
167
|
+
* anything else in the directory is a superseded revision (the copies are
|
|
168
|
+
* content-addressed and never overwritten) or the leftover of an asset()
|
|
169
|
+
* reference that no longer exists. Failures are tolerated per entry — Next
|
|
170
|
+
* dev evaluates the config in more than one process, and a concurrent
|
|
171
|
+
* session may have removed (or be about to rewrite) the same file; every
|
|
172
|
+
* pass rewrites whatever of its own set is missing, so races self-heal.
|
|
173
|
+
*/
|
|
174
|
+
export declare function pruneStaleAssets(assetsDir: string, expected: ReadonlySet<string>): void;
|
|
138
175
|
//# sourceMappingURL=extraction-session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extraction-session.d.ts","sourceRoot":"","sources":["../src/extraction-session.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extraction-session.d.ts","sourceRoot":"","sources":["../src/extraction-session.ts"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAOjD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AAczD,qEAAqE;AACrE,MAAM,WAAW,YAAY;IAC3B,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACpC;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,iBAAiB;IAC5B,kDAAkD;IAClD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC9B,6EAA6E;IAC7E,eAAe,EAAE,MAAM,GAAG,IAAI,CAAQ;IAItC,OAAO,CAAC,cAAc,CASlB;IACJ,6DAA6D;IAC7D,oBAAoB,cAAqB;IACzC,OAAO,CAAC,mBAAmB,CAAqB;IAChD;;wEAEoE;IACpE,qBAAqB,UAAS;IAC9B;;;2EAGuE;IACvE,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE1C,kFAAkF;IAClF,mBAAmB,EAAE,MAAM,EAAE,CAAM;IACnC,0EAA0E;IAC1E,OAAO,CAAC,iBAAiB,CAA8B;IACvD,4EAA4E;IAC5E,OAAO,CAAC,kBAAkB,CAA8B;IACxD,+DAA+D;IAC/D,qBAAqB,sBAA6B;IAElD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,QA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AgB,CAC9B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,GAC5B,IAAI,CAgBN"}
|
package/dist/index.cjs
CHANGED
|
@@ -124,6 +124,10 @@ var ExtractionSession = class {
|
|
|
124
124
|
rootDir = null;
|
|
125
125
|
/** Serialized path aliases, harvested by the adapter from bundler config. */
|
|
126
126
|
pathAliasesJson = null;
|
|
127
|
+
assetCopyCache = /* @__PURE__ */ new Map();
|
|
128
|
+
/** Physical asset files registered with the host watcher. */
|
|
129
|
+
assetDependencyPaths = /* @__PURE__ */ new Set();
|
|
130
|
+
assetDependencyKeys = /* @__PURE__ */ new Set();
|
|
127
131
|
/** When set (Turbopack orchestration), every analysis also persists
|
|
128
132
|
* `.animus/analysis-inputs.json` so isolated loader workers can hydrate.
|
|
129
133
|
* Webpack mode leaves this off — its loader shares the process. */
|
|
@@ -135,6 +139,10 @@ var ExtractionSession = class {
|
|
|
135
139
|
systemPropsModuleId = null;
|
|
136
140
|
/** Absolute directory prefixes for external DS packages (loader allowlisting). */
|
|
137
141
|
externalPackageDirs = [];
|
|
142
|
+
/** Absolute package dir → owning specifier (cross-source correlation). */
|
|
143
|
+
externalDirOwners = {};
|
|
144
|
+
/** rootDir-relative external file → owning specifier (correlation join). */
|
|
145
|
+
externalFileOwners = {};
|
|
138
146
|
/** External package specifier → absolute source entry path. */
|
|
139
147
|
externalSourceEntries = /* @__PURE__ */ new Map();
|
|
140
148
|
options;
|
|
@@ -190,6 +198,7 @@ var ExtractionSession = class {
|
|
|
190
198
|
async handleWatchUpdate(changes) {
|
|
191
199
|
if (!this.system) return;
|
|
192
200
|
const rootDir = this.rootDir;
|
|
201
|
+
let assetChanged = false;
|
|
193
202
|
try {
|
|
194
203
|
let systemHit;
|
|
195
204
|
if (!changes.modifiedFiles && !changes.removedFiles) for (const [dep, hash] of this.systemDependencyHashes) {
|
|
@@ -211,6 +220,10 @@ var ExtractionSession = class {
|
|
|
211
220
|
await promise;
|
|
212
221
|
return;
|
|
213
222
|
}
|
|
223
|
+
if ([...changes.modifiedFiles ?? [], ...changes.removedFiles ?? []].some((path$3) => (0, _animus_ui_extract_pipeline.toWatchKeys)(path$3).some((key) => this.assetDependencyKeys.has(key)))) {
|
|
224
|
+
this.assetCopyCache.clear();
|
|
225
|
+
assetChanged = true;
|
|
226
|
+
}
|
|
214
227
|
} catch (err) {
|
|
215
228
|
this.warn(`HMR geological-reset check failed: ${String(err)}`);
|
|
216
229
|
}
|
|
@@ -256,7 +269,7 @@ var ExtractionSession = class {
|
|
|
256
269
|
});
|
|
257
270
|
}
|
|
258
271
|
}
|
|
259
|
-
if (changedPaths.length > 0 || removedAny) {
|
|
272
|
+
if (changedPaths.length > 0 || removedAny || assetChanged) {
|
|
260
273
|
const fileEntries = this.buildFileEntriesFromCache();
|
|
261
274
|
require_singleton.resetAnalysisPromise();
|
|
262
275
|
const promise = this.runIncrementalPipeline(fileEntries);
|
|
@@ -304,6 +317,9 @@ var ExtractionSession = class {
|
|
|
304
317
|
rootDir,
|
|
305
318
|
prefix: this.options.prefix
|
|
306
319
|
});
|
|
320
|
+
this.assetCopyCache.clear();
|
|
321
|
+
this.assetDependencyPaths.clear();
|
|
322
|
+
this.assetDependencyKeys.clear();
|
|
307
323
|
{
|
|
308
324
|
const deps = this.system.dependencies ?? [];
|
|
309
325
|
const keys = /* @__PURE__ */ new Set();
|
|
@@ -379,8 +395,15 @@ var ExtractionSession = class {
|
|
|
379
395
|
if (this.options.strict) throw new Error(unresolvableMessage);
|
|
380
396
|
this.warn(unresolvableMessage);
|
|
381
397
|
}
|
|
398
|
+
const staleDistMessage = (0, _animus_ui_extract_pipeline.staleDistIncludesMessage)(collected.outcomes);
|
|
399
|
+
if (staleDistMessage !== null) {
|
|
400
|
+
if (this.options.strict) throw new Error(staleDistMessage);
|
|
401
|
+
this.warn(staleDistMessage);
|
|
402
|
+
}
|
|
382
403
|
const packageMap = collected.packageMap;
|
|
383
404
|
this.lastPackageMap = packageMap;
|
|
405
|
+
this.externalDirOwners = collected.dirOwners;
|
|
406
|
+
this.externalFileOwners = collected.fileOwners;
|
|
384
407
|
this.externalSourceEntries = collected.sourceEntries;
|
|
385
408
|
for (const entry of collected.entries) {
|
|
386
409
|
const hash = (0, _animus_ui_extract_pipeline.contentHash)(entry.source);
|
|
@@ -419,8 +442,8 @@ var ExtractionSession = class {
|
|
|
419
442
|
*/
|
|
420
443
|
buildFileEntriesFromCache() {
|
|
421
444
|
const entries = [];
|
|
422
|
-
for (const [path$
|
|
423
|
-
path: path$
|
|
445
|
+
for (const [path$4, { hash, source }] of this.fileCache) entries.push({
|
|
446
|
+
path: path$4,
|
|
424
447
|
source,
|
|
425
448
|
hash
|
|
426
449
|
});
|
|
@@ -466,9 +489,19 @@ var ExtractionSession = class {
|
|
|
466
489
|
},
|
|
467
490
|
pathAliasesJson: this.pathAliasesJson,
|
|
468
491
|
staticCssJson: this.staticCssJson,
|
|
492
|
+
externalDirs: this.externalPackageDirs.map((dir) => (0, path.relative)(this.rootDir, dir)),
|
|
469
493
|
devMode,
|
|
470
494
|
warn: (message) => this.warn(message)
|
|
471
495
|
});
|
|
496
|
+
(0, _animus_ui_extract_pipeline.enforceExternalTokenContracts)({
|
|
497
|
+
diagnostics: result.manifest?.diagnostics,
|
|
498
|
+
fileOwners: this.externalFileOwners,
|
|
499
|
+
dirOwners: this.externalDirOwners,
|
|
500
|
+
sourceThemeManifestsJson: system.sourceThemeManifestsJson,
|
|
501
|
+
strict: this.options.strict,
|
|
502
|
+
prefix: "[animus-next]",
|
|
503
|
+
warn: (message) => this.warn(message)
|
|
504
|
+
});
|
|
472
505
|
bt.jsonSerialize = result.timings.serializeMs;
|
|
473
506
|
bt.rustExtract = result.timings.extractMs;
|
|
474
507
|
bt.jsonParse = result.timings.parseMs;
|
|
@@ -477,10 +510,11 @@ var ExtractionSession = class {
|
|
|
477
510
|
bt.analysis = (bt.jsonSerialize ?? 0) + (bt.rustExtract ?? 0) + (bt.jsonParse ?? 0);
|
|
478
511
|
if (manifest?.report) this.log(`Extracted ${manifest.report.components_extracted ?? "?"}/${manifest.report.components_total ?? "?"} components (${bt.analysis}ms)`);
|
|
479
512
|
}
|
|
513
|
+
const globalCss = this.substituteAssetReferences(result.globalCss, devMode);
|
|
480
514
|
const { declaration, variables, body } = (0, _animus_ui_extract_pipeline.assembleStylesheet)({
|
|
481
515
|
layers: this.options.layers,
|
|
482
516
|
variableCss: system.variableCss,
|
|
483
|
-
globalCss
|
|
517
|
+
globalCss,
|
|
484
518
|
componentCss: result.componentCss,
|
|
485
519
|
split: true
|
|
486
520
|
});
|
|
@@ -556,7 +590,113 @@ var ExtractionSession = class {
|
|
|
556
590
|
(0, fs.writeFileSync)(tmpPath, content);
|
|
557
591
|
(0, fs.renameSync)(tmpPath, (0, path.join)(dir, name));
|
|
558
592
|
}
|
|
593
|
+
/**
|
|
594
|
+
* asset() placeholder substitution (global-styles-system): resolve each
|
|
595
|
+
* referenced specifier through Node resolution, copy the bytes into
|
|
596
|
+
* `.animus/assets/` under a content-hashed name, and substitute a
|
|
597
|
+
* RELATIVE url. `.animus/styles.css` is processed by Next's own CSS
|
|
598
|
+
* pipeline (webpack and Turbopack alike), which applies its native asset
|
|
599
|
+
* handling — publicPath and output hashing — to relative url()
|
|
600
|
+
* references. Unsubstitutable specifiers warn and emit literally in
|
|
601
|
+
* non-strict mode, fail the build under `strict: true`.
|
|
602
|
+
*/
|
|
603
|
+
substituteAssetReferences(globalCss, devMode) {
|
|
604
|
+
const specifiers = (0, _animus_ui_extract_pipeline.findAssetSpecifiers)(globalCss);
|
|
605
|
+
const assetsDir = (0, path.join)(this.rootDir, ".animus", "assets");
|
|
606
|
+
const expected = /* @__PURE__ */ new Set();
|
|
607
|
+
this.assetDependencyPaths.clear();
|
|
608
|
+
this.assetDependencyKeys.clear();
|
|
609
|
+
const urlBySpecifier = /* @__PURE__ */ new Map();
|
|
610
|
+
for (const specifier of specifiers) {
|
|
611
|
+
const cached = this.assetCopyCache.get(specifier);
|
|
612
|
+
if (cached && (0, fs.existsSync)((0, path.join)(assetsDir, cached.fileName))) try {
|
|
613
|
+
const current = (0, fs.statSync)(cached.sourcePath);
|
|
614
|
+
if (current.mtimeMs === cached.mtimeMs && current.size === cached.size) {
|
|
615
|
+
this.trackAssetDependency(cached.sourcePath);
|
|
616
|
+
expected.add(cached.fileName);
|
|
617
|
+
urlBySpecifier.set(specifier, cached.url);
|
|
618
|
+
continue;
|
|
619
|
+
}
|
|
620
|
+
} catch {}
|
|
621
|
+
const resolvedPath = this.resolveAssetSpecifier(specifier);
|
|
622
|
+
if (!resolvedPath) {
|
|
623
|
+
const message = `unresolvable asset() specifier: ${specifier}`;
|
|
624
|
+
if (this.options.strict) throw new Error(`[animus-next] ${message}`);
|
|
625
|
+
this.warn(message);
|
|
626
|
+
urlBySpecifier.set(specifier, specifier);
|
|
627
|
+
continue;
|
|
628
|
+
}
|
|
629
|
+
const bytes = (0, fs.readFileSync)(resolvedPath);
|
|
630
|
+
const sourceStat = (0, fs.statSync)(resolvedPath);
|
|
631
|
+
this.trackAssetDependency(resolvedPath);
|
|
632
|
+
const ext = (0, path.extname)(resolvedPath);
|
|
633
|
+
const fileName = `${(0, path.basename)(resolvedPath, ext)}.${(0, _animus_ui_extract_pipeline.contentHash)(bytes).slice(0, 8)}${ext}`;
|
|
634
|
+
expected.add(fileName);
|
|
635
|
+
if (!(0, fs.existsSync)(assetsDir)) (0, fs.mkdirSync)(assetsDir, { recursive: true });
|
|
636
|
+
const assetPath = (0, path.join)(assetsDir, fileName);
|
|
637
|
+
if (!(0, fs.existsSync)(assetPath)) (0, fs.writeFileSync)(assetPath, bytes);
|
|
638
|
+
const url = `./assets/${fileName}`;
|
|
639
|
+
urlBySpecifier.set(specifier, url);
|
|
640
|
+
this.assetCopyCache.set(specifier, {
|
|
641
|
+
sourcePath: resolvedPath,
|
|
642
|
+
mtimeMs: sourceStat.mtimeMs,
|
|
643
|
+
size: sourceStat.size,
|
|
644
|
+
fileName,
|
|
645
|
+
url
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
if (!devMode) pruneStaleAssets(assetsDir, expected);
|
|
649
|
+
return (0, _animus_ui_extract_pipeline.substituteAssetPlaceholders)(globalCss, urlBySpecifier);
|
|
650
|
+
}
|
|
651
|
+
trackAssetDependency(path$5) {
|
|
652
|
+
this.assetDependencyPaths.add(path$5);
|
|
653
|
+
for (const key of (0, _animus_ui_extract_pipeline.toWatchKeys)(path$5)) this.assetDependencyKeys.add(key);
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Resolve an asset specifier to an absolute file via the shared pipeline
|
|
657
|
+
* resolver (host aliases → Node resolution → package root), with one
|
|
658
|
+
* session-local last resort: an already-discovered source entry's package
|
|
659
|
+
* root (dist-less workspace kits the shared resolver cannot see).
|
|
660
|
+
*/
|
|
661
|
+
resolveAssetSpecifier(specifier) {
|
|
662
|
+
const resolved = (0, _animus_ui_extract_pipeline.resolveAssetFile)(specifier, this.rootDir, this.pathAliasesJson);
|
|
663
|
+
if (resolved) return resolved;
|
|
664
|
+
const segments = specifier.split("/");
|
|
665
|
+
const packageName = specifier.startsWith("@") ? segments.slice(0, 2).join("/") : segments[0];
|
|
666
|
+
const subpath = specifier.slice(packageName.length + 1);
|
|
667
|
+
if (!subpath) return null;
|
|
668
|
+
const sourceEntry = this.externalSourceEntries.get(packageName) ?? [...this.externalSourceEntries].find(([declared]) => declared === packageName || declared.startsWith(`${packageName}/`))?.[1];
|
|
669
|
+
if (sourceEntry) {
|
|
670
|
+
const candidate = (0, path.join)((0, _animus_ui_extract_pipeline.findPackageRoot)(sourceEntry), subpath);
|
|
671
|
+
if ((0, fs.existsSync)(candidate)) return candidate;
|
|
672
|
+
}
|
|
673
|
+
return null;
|
|
674
|
+
}
|
|
559
675
|
};
|
|
676
|
+
/**
|
|
677
|
+
* Sync `.animus/assets/` to the current build's content-hashed file set:
|
|
678
|
+
* anything else in the directory is a superseded revision (the copies are
|
|
679
|
+
* content-addressed and never overwritten) or the leftover of an asset()
|
|
680
|
+
* reference that no longer exists. Failures are tolerated per entry — Next
|
|
681
|
+
* dev evaluates the config in more than one process, and a concurrent
|
|
682
|
+
* session may have removed (or be about to rewrite) the same file; every
|
|
683
|
+
* pass rewrites whatever of its own set is missing, so races self-heal.
|
|
684
|
+
*/
|
|
685
|
+
function pruneStaleAssets(assetsDir, expected) {
|
|
686
|
+
if (!(0, fs.existsSync)(assetsDir)) return;
|
|
687
|
+
let entries;
|
|
688
|
+
try {
|
|
689
|
+
entries = (0, fs.readdirSync)(assetsDir);
|
|
690
|
+
} catch {
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
for (const entry of entries) {
|
|
694
|
+
if (expected.has(entry)) continue;
|
|
695
|
+
try {
|
|
696
|
+
(0, fs.unlinkSync)((0, path.join)(assetsDir, entry));
|
|
697
|
+
} catch {}
|
|
698
|
+
}
|
|
699
|
+
}
|
|
560
700
|
//#endregion
|
|
561
701
|
//#region src/plugin.ts
|
|
562
702
|
const PLUGIN_NAME = "AnimusWebpackPlugin";
|
|
@@ -605,6 +745,8 @@ var AnimusWebpackPlugin = class {
|
|
|
605
745
|
const registerSystemDependencies = () => {
|
|
606
746
|
for (const dep of this.session.systemDependencyPaths) if ((0, fs.existsSync)(dep)) compilation.fileDependencies.add(dep);
|
|
607
747
|
else compilation.missingDependencies.add(dep);
|
|
748
|
+
for (const dep of this.session.assetDependencyPaths) if ((0, fs.existsSync)(dep)) compilation.fileDependencies.add(dep);
|
|
749
|
+
else compilation.missingDependencies.add(dep);
|
|
608
750
|
};
|
|
609
751
|
registerSystemDependencies();
|
|
610
752
|
const stage = compiler.webpack?.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL ?? -2e3;
|
|
@@ -900,6 +1042,8 @@ function withAnimus(options) {
|
|
|
900
1042
|
const isExternalPackageFile = (filePath) => plugin.getExternalPackageDirs().some((dir) => filePath.startsWith(dir + path.sep) || filePath === dir);
|
|
901
1043
|
config.plugins = config.plugins || [];
|
|
902
1044
|
config.plugins.push(plugin);
|
|
1045
|
+
const { DefinePlugin } = context.webpack ?? {};
|
|
1046
|
+
if (typeof DefinePlugin === "function") config.plugins.push(new DefinePlugin({ __ANIMUS_DEV__: JSON.stringify(context.dev === true) }));
|
|
903
1047
|
config.resolve = config.resolve || {};
|
|
904
1048
|
config.resolve.alias = config.resolve.alias || {};
|
|
905
1049
|
config.resolve.alias[ANIMUS_CSS_MODULE_ID] = (0, path.join)(rootDir, ".animus", "styles.css");
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __require } from "./chunk-y_GBKt04.mjs";
|
|
2
2
|
import { a as getSharedExternalDirs, c as setAnalysisPromise, d as setSharedEngine, f as setSharedExternalDirs, i as getSharedCss, l as setManifestJson, m as setSharedSystemProps, n as getAnalysisPromise, o as getSharedExternalEntries, p as setSharedExternalEntries, s as resetAnalysisPromise, t as engineApi, u as setSharedCss } from "./singleton-BKALu7Mk.mjs";
|
|
3
|
-
import { DEFAULT_EXTENSIONS, assembleStylesheet, assertNoRetiredEngineSelection, buildPathAliasesJson, buildSystemPropsModule, clearEngineCache, collectExternalPackageSources, contentHash, discoverFiles, extractSystemFilePackages, formatRustTimingWaterfall, loadSystemConfig, postProcessCss, preprocessMdx, readTsconfigAliasPairs, resolveLightningTargets, runProjectAnalysis, serializeStaticCss, toWatchKeys, unresolvableIncludesMessage } from "@animus-ui/extract/pipeline";
|
|
4
|
-
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync, watch, writeFileSync } from "fs";
|
|
5
|
-
import { dirname, extname, join, relative, resolve, sep } from "path";
|
|
3
|
+
import { DEFAULT_EXTENSIONS, assembleStylesheet, assertNoRetiredEngineSelection, buildPathAliasesJson, buildSystemPropsModule, clearEngineCache, collectExternalPackageSources, contentHash, discoverFiles, enforceExternalTokenContracts, extractSystemFilePackages, findAssetSpecifiers, findPackageRoot, formatRustTimingWaterfall, loadSystemConfig, postProcessCss, preprocessMdx, readTsconfigAliasPairs, resolveAssetFile, resolveLightningTargets, runProjectAnalysis, serializeStaticCss, staleDistIncludesMessage, substituteAssetPlaceholders, toWatchKeys, unresolvableIncludesMessage } from "@animus-ui/extract/pipeline";
|
|
4
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync, unlinkSync, watch, writeFileSync } from "fs";
|
|
5
|
+
import { basename, dirname, extname, join, relative, resolve, sep } from "path";
|
|
6
6
|
import { fileURLToPath } from "url";
|
|
7
7
|
//#region src/resolve-packages.ts
|
|
8
8
|
/**
|
|
@@ -124,6 +124,10 @@ var ExtractionSession = class {
|
|
|
124
124
|
rootDir = null;
|
|
125
125
|
/** Serialized path aliases, harvested by the adapter from bundler config. */
|
|
126
126
|
pathAliasesJson = null;
|
|
127
|
+
assetCopyCache = /* @__PURE__ */ new Map();
|
|
128
|
+
/** Physical asset files registered with the host watcher. */
|
|
129
|
+
assetDependencyPaths = /* @__PURE__ */ new Set();
|
|
130
|
+
assetDependencyKeys = /* @__PURE__ */ new Set();
|
|
127
131
|
/** When set (Turbopack orchestration), every analysis also persists
|
|
128
132
|
* `.animus/analysis-inputs.json` so isolated loader workers can hydrate.
|
|
129
133
|
* Webpack mode leaves this off — its loader shares the process. */
|
|
@@ -135,6 +139,10 @@ var ExtractionSession = class {
|
|
|
135
139
|
systemPropsModuleId = null;
|
|
136
140
|
/** Absolute directory prefixes for external DS packages (loader allowlisting). */
|
|
137
141
|
externalPackageDirs = [];
|
|
142
|
+
/** Absolute package dir → owning specifier (cross-source correlation). */
|
|
143
|
+
externalDirOwners = {};
|
|
144
|
+
/** rootDir-relative external file → owning specifier (correlation join). */
|
|
145
|
+
externalFileOwners = {};
|
|
138
146
|
/** External package specifier → absolute source entry path. */
|
|
139
147
|
externalSourceEntries = /* @__PURE__ */ new Map();
|
|
140
148
|
options;
|
|
@@ -190,6 +198,7 @@ var ExtractionSession = class {
|
|
|
190
198
|
async handleWatchUpdate(changes) {
|
|
191
199
|
if (!this.system) return;
|
|
192
200
|
const rootDir = this.rootDir;
|
|
201
|
+
let assetChanged = false;
|
|
193
202
|
try {
|
|
194
203
|
let systemHit;
|
|
195
204
|
if (!changes.modifiedFiles && !changes.removedFiles) for (const [dep, hash] of this.systemDependencyHashes) {
|
|
@@ -211,6 +220,10 @@ var ExtractionSession = class {
|
|
|
211
220
|
await promise;
|
|
212
221
|
return;
|
|
213
222
|
}
|
|
223
|
+
if ([...changes.modifiedFiles ?? [], ...changes.removedFiles ?? []].some((path) => toWatchKeys(path).some((key) => this.assetDependencyKeys.has(key)))) {
|
|
224
|
+
this.assetCopyCache.clear();
|
|
225
|
+
assetChanged = true;
|
|
226
|
+
}
|
|
214
227
|
} catch (err) {
|
|
215
228
|
this.warn(`HMR geological-reset check failed: ${String(err)}`);
|
|
216
229
|
}
|
|
@@ -256,7 +269,7 @@ var ExtractionSession = class {
|
|
|
256
269
|
});
|
|
257
270
|
}
|
|
258
271
|
}
|
|
259
|
-
if (changedPaths.length > 0 || removedAny) {
|
|
272
|
+
if (changedPaths.length > 0 || removedAny || assetChanged) {
|
|
260
273
|
const fileEntries = this.buildFileEntriesFromCache();
|
|
261
274
|
resetAnalysisPromise();
|
|
262
275
|
const promise = this.runIncrementalPipeline(fileEntries);
|
|
@@ -304,6 +317,9 @@ var ExtractionSession = class {
|
|
|
304
317
|
rootDir,
|
|
305
318
|
prefix: this.options.prefix
|
|
306
319
|
});
|
|
320
|
+
this.assetCopyCache.clear();
|
|
321
|
+
this.assetDependencyPaths.clear();
|
|
322
|
+
this.assetDependencyKeys.clear();
|
|
307
323
|
{
|
|
308
324
|
const deps = this.system.dependencies ?? [];
|
|
309
325
|
const keys = /* @__PURE__ */ new Set();
|
|
@@ -379,8 +395,15 @@ var ExtractionSession = class {
|
|
|
379
395
|
if (this.options.strict) throw new Error(unresolvableMessage);
|
|
380
396
|
this.warn(unresolvableMessage);
|
|
381
397
|
}
|
|
398
|
+
const staleDistMessage = staleDistIncludesMessage(collected.outcomes);
|
|
399
|
+
if (staleDistMessage !== null) {
|
|
400
|
+
if (this.options.strict) throw new Error(staleDistMessage);
|
|
401
|
+
this.warn(staleDistMessage);
|
|
402
|
+
}
|
|
382
403
|
const packageMap = collected.packageMap;
|
|
383
404
|
this.lastPackageMap = packageMap;
|
|
405
|
+
this.externalDirOwners = collected.dirOwners;
|
|
406
|
+
this.externalFileOwners = collected.fileOwners;
|
|
384
407
|
this.externalSourceEntries = collected.sourceEntries;
|
|
385
408
|
for (const entry of collected.entries) {
|
|
386
409
|
const hash = contentHash(entry.source);
|
|
@@ -466,9 +489,19 @@ var ExtractionSession = class {
|
|
|
466
489
|
},
|
|
467
490
|
pathAliasesJson: this.pathAliasesJson,
|
|
468
491
|
staticCssJson: this.staticCssJson,
|
|
492
|
+
externalDirs: this.externalPackageDirs.map((dir) => relative(this.rootDir, dir)),
|
|
469
493
|
devMode,
|
|
470
494
|
warn: (message) => this.warn(message)
|
|
471
495
|
});
|
|
496
|
+
enforceExternalTokenContracts({
|
|
497
|
+
diagnostics: result.manifest?.diagnostics,
|
|
498
|
+
fileOwners: this.externalFileOwners,
|
|
499
|
+
dirOwners: this.externalDirOwners,
|
|
500
|
+
sourceThemeManifestsJson: system.sourceThemeManifestsJson,
|
|
501
|
+
strict: this.options.strict,
|
|
502
|
+
prefix: "[animus-next]",
|
|
503
|
+
warn: (message) => this.warn(message)
|
|
504
|
+
});
|
|
472
505
|
bt.jsonSerialize = result.timings.serializeMs;
|
|
473
506
|
bt.rustExtract = result.timings.extractMs;
|
|
474
507
|
bt.jsonParse = result.timings.parseMs;
|
|
@@ -477,10 +510,11 @@ var ExtractionSession = class {
|
|
|
477
510
|
bt.analysis = (bt.jsonSerialize ?? 0) + (bt.rustExtract ?? 0) + (bt.jsonParse ?? 0);
|
|
478
511
|
if (manifest?.report) this.log(`Extracted ${manifest.report.components_extracted ?? "?"}/${manifest.report.components_total ?? "?"} components (${bt.analysis}ms)`);
|
|
479
512
|
}
|
|
513
|
+
const globalCss = this.substituteAssetReferences(result.globalCss, devMode);
|
|
480
514
|
const { declaration, variables, body } = assembleStylesheet({
|
|
481
515
|
layers: this.options.layers,
|
|
482
516
|
variableCss: system.variableCss,
|
|
483
|
-
globalCss
|
|
517
|
+
globalCss,
|
|
484
518
|
componentCss: result.componentCss,
|
|
485
519
|
split: true
|
|
486
520
|
});
|
|
@@ -556,7 +590,113 @@ var ExtractionSession = class {
|
|
|
556
590
|
writeFileSync(tmpPath, content);
|
|
557
591
|
renameSync(tmpPath, join(dir, name));
|
|
558
592
|
}
|
|
593
|
+
/**
|
|
594
|
+
* asset() placeholder substitution (global-styles-system): resolve each
|
|
595
|
+
* referenced specifier through Node resolution, copy the bytes into
|
|
596
|
+
* `.animus/assets/` under a content-hashed name, and substitute a
|
|
597
|
+
* RELATIVE url. `.animus/styles.css` is processed by Next's own CSS
|
|
598
|
+
* pipeline (webpack and Turbopack alike), which applies its native asset
|
|
599
|
+
* handling — publicPath and output hashing — to relative url()
|
|
600
|
+
* references. Unsubstitutable specifiers warn and emit literally in
|
|
601
|
+
* non-strict mode, fail the build under `strict: true`.
|
|
602
|
+
*/
|
|
603
|
+
substituteAssetReferences(globalCss, devMode) {
|
|
604
|
+
const specifiers = findAssetSpecifiers(globalCss);
|
|
605
|
+
const assetsDir = join(this.rootDir, ".animus", "assets");
|
|
606
|
+
const expected = /* @__PURE__ */ new Set();
|
|
607
|
+
this.assetDependencyPaths.clear();
|
|
608
|
+
this.assetDependencyKeys.clear();
|
|
609
|
+
const urlBySpecifier = /* @__PURE__ */ new Map();
|
|
610
|
+
for (const specifier of specifiers) {
|
|
611
|
+
const cached = this.assetCopyCache.get(specifier);
|
|
612
|
+
if (cached && existsSync(join(assetsDir, cached.fileName))) try {
|
|
613
|
+
const current = statSync(cached.sourcePath);
|
|
614
|
+
if (current.mtimeMs === cached.mtimeMs && current.size === cached.size) {
|
|
615
|
+
this.trackAssetDependency(cached.sourcePath);
|
|
616
|
+
expected.add(cached.fileName);
|
|
617
|
+
urlBySpecifier.set(specifier, cached.url);
|
|
618
|
+
continue;
|
|
619
|
+
}
|
|
620
|
+
} catch {}
|
|
621
|
+
const resolvedPath = this.resolveAssetSpecifier(specifier);
|
|
622
|
+
if (!resolvedPath) {
|
|
623
|
+
const message = `unresolvable asset() specifier: ${specifier}`;
|
|
624
|
+
if (this.options.strict) throw new Error(`[animus-next] ${message}`);
|
|
625
|
+
this.warn(message);
|
|
626
|
+
urlBySpecifier.set(specifier, specifier);
|
|
627
|
+
continue;
|
|
628
|
+
}
|
|
629
|
+
const bytes = readFileSync(resolvedPath);
|
|
630
|
+
const sourceStat = statSync(resolvedPath);
|
|
631
|
+
this.trackAssetDependency(resolvedPath);
|
|
632
|
+
const ext = extname(resolvedPath);
|
|
633
|
+
const fileName = `${basename(resolvedPath, ext)}.${contentHash(bytes).slice(0, 8)}${ext}`;
|
|
634
|
+
expected.add(fileName);
|
|
635
|
+
if (!existsSync(assetsDir)) mkdirSync(assetsDir, { recursive: true });
|
|
636
|
+
const assetPath = join(assetsDir, fileName);
|
|
637
|
+
if (!existsSync(assetPath)) writeFileSync(assetPath, bytes);
|
|
638
|
+
const url = `./assets/${fileName}`;
|
|
639
|
+
urlBySpecifier.set(specifier, url);
|
|
640
|
+
this.assetCopyCache.set(specifier, {
|
|
641
|
+
sourcePath: resolvedPath,
|
|
642
|
+
mtimeMs: sourceStat.mtimeMs,
|
|
643
|
+
size: sourceStat.size,
|
|
644
|
+
fileName,
|
|
645
|
+
url
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
if (!devMode) pruneStaleAssets(assetsDir, expected);
|
|
649
|
+
return substituteAssetPlaceholders(globalCss, urlBySpecifier);
|
|
650
|
+
}
|
|
651
|
+
trackAssetDependency(path) {
|
|
652
|
+
this.assetDependencyPaths.add(path);
|
|
653
|
+
for (const key of toWatchKeys(path)) this.assetDependencyKeys.add(key);
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Resolve an asset specifier to an absolute file via the shared pipeline
|
|
657
|
+
* resolver (host aliases → Node resolution → package root), with one
|
|
658
|
+
* session-local last resort: an already-discovered source entry's package
|
|
659
|
+
* root (dist-less workspace kits the shared resolver cannot see).
|
|
660
|
+
*/
|
|
661
|
+
resolveAssetSpecifier(specifier) {
|
|
662
|
+
const resolved = resolveAssetFile(specifier, this.rootDir, this.pathAliasesJson);
|
|
663
|
+
if (resolved) return resolved;
|
|
664
|
+
const segments = specifier.split("/");
|
|
665
|
+
const packageName = specifier.startsWith("@") ? segments.slice(0, 2).join("/") : segments[0];
|
|
666
|
+
const subpath = specifier.slice(packageName.length + 1);
|
|
667
|
+
if (!subpath) return null;
|
|
668
|
+
const sourceEntry = this.externalSourceEntries.get(packageName) ?? [...this.externalSourceEntries].find(([declared]) => declared === packageName || declared.startsWith(`${packageName}/`))?.[1];
|
|
669
|
+
if (sourceEntry) {
|
|
670
|
+
const candidate = join(findPackageRoot(sourceEntry), subpath);
|
|
671
|
+
if (existsSync(candidate)) return candidate;
|
|
672
|
+
}
|
|
673
|
+
return null;
|
|
674
|
+
}
|
|
559
675
|
};
|
|
676
|
+
/**
|
|
677
|
+
* Sync `.animus/assets/` to the current build's content-hashed file set:
|
|
678
|
+
* anything else in the directory is a superseded revision (the copies are
|
|
679
|
+
* content-addressed and never overwritten) or the leftover of an asset()
|
|
680
|
+
* reference that no longer exists. Failures are tolerated per entry — Next
|
|
681
|
+
* dev evaluates the config in more than one process, and a concurrent
|
|
682
|
+
* session may have removed (or be about to rewrite) the same file; every
|
|
683
|
+
* pass rewrites whatever of its own set is missing, so races self-heal.
|
|
684
|
+
*/
|
|
685
|
+
function pruneStaleAssets(assetsDir, expected) {
|
|
686
|
+
if (!existsSync(assetsDir)) return;
|
|
687
|
+
let entries;
|
|
688
|
+
try {
|
|
689
|
+
entries = readdirSync(assetsDir);
|
|
690
|
+
} catch {
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
for (const entry of entries) {
|
|
694
|
+
if (expected.has(entry)) continue;
|
|
695
|
+
try {
|
|
696
|
+
unlinkSync(join(assetsDir, entry));
|
|
697
|
+
} catch {}
|
|
698
|
+
}
|
|
699
|
+
}
|
|
560
700
|
//#endregion
|
|
561
701
|
//#region src/plugin.ts
|
|
562
702
|
const PLUGIN_NAME = "AnimusWebpackPlugin";
|
|
@@ -605,6 +745,8 @@ var AnimusWebpackPlugin = class {
|
|
|
605
745
|
const registerSystemDependencies = () => {
|
|
606
746
|
for (const dep of this.session.systemDependencyPaths) if (existsSync(dep)) compilation.fileDependencies.add(dep);
|
|
607
747
|
else compilation.missingDependencies.add(dep);
|
|
748
|
+
for (const dep of this.session.assetDependencyPaths) if (existsSync(dep)) compilation.fileDependencies.add(dep);
|
|
749
|
+
else compilation.missingDependencies.add(dep);
|
|
608
750
|
};
|
|
609
751
|
registerSystemDependencies();
|
|
610
752
|
const stage = compiler.webpack?.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL ?? -2e3;
|
|
@@ -900,6 +1042,8 @@ function withAnimus(options) {
|
|
|
900
1042
|
const isExternalPackageFile = (filePath) => plugin.getExternalPackageDirs().some((dir) => filePath.startsWith(dir + sep) || filePath === dir);
|
|
901
1043
|
config.plugins = config.plugins || [];
|
|
902
1044
|
config.plugins.push(plugin);
|
|
1045
|
+
const { DefinePlugin } = context.webpack ?? {};
|
|
1046
|
+
if (typeof DefinePlugin === "function") config.plugins.push(new DefinePlugin({ __ANIMUS_DEV__: JSON.stringify(context.dev === true) }));
|
|
903
1047
|
config.resolve = config.resolve || {};
|
|
904
1048
|
config.resolve.alias = config.resolve.alias || {};
|
|
905
1049
|
config.resolve.alias[ANIMUS_CSS_MODULE_ID] = join(rootDir, ".animus", "styles.css");
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC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E,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,CAiN9D"}
|
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.5",
|
|
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.5"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@mdx-js/mdx": "^3.0.0",
|