@animus-ui/vite-plugin 0.1.8 → 0.1.9
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/context.d.ts.map +1 -1
- package/dist/hmr.d.ts.map +1 -1
- package/dist/index.cjs +36 -16
- package/dist/rediscovery.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAElB,YAAY,EAEb,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAiBD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,EACpD,WAAW,CAAC,EAAE,MAAM,GACnB,KAAK,CAAC;IAAE,IAAI,EAAE,MA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ED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmr.d.ts","sourceRoot":"","sources":["../src/hmr.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,MAAM,CAAC;AAEd;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,aAAa,EAClB,WAAW,EAAE,cAAc,EAC3B,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,gBAAgB,GACzD,OAAO,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"hmr.d.ts","sourceRoot":"","sources":["../src/hmr.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,MAAM,CAAC;AAEd;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,aAAa,EAClB,WAAW,EAAE,cAAc,EAC3B,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,gBAAgB,GACzD,OAAO,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC,CA8EzC"}
|
package/dist/index.cjs
CHANGED
|
@@ -598,8 +598,9 @@ var PluginContext = class {
|
|
|
598
598
|
* equal-content retries"). Strict mode still throws.
|
|
599
599
|
*/
|
|
600
600
|
runAnalysis(fileEntries) {
|
|
601
|
+
let result;
|
|
601
602
|
try {
|
|
602
|
-
|
|
603
|
+
result = (0, _animus_ui_extract_pipeline.runProjectAnalysis)(this.engineApi, {
|
|
603
604
|
fileEntries,
|
|
604
605
|
packageMap: this.packageMap,
|
|
605
606
|
system: this.system,
|
|
@@ -615,19 +616,20 @@ var PluginContext = class {
|
|
|
615
616
|
strict: this.options.strict,
|
|
616
617
|
extraDiagnostics: this.externalKeyframesDiagnostics
|
|
617
618
|
});
|
|
618
|
-
this.storedManifest = result.manifest;
|
|
619
|
-
this.storedManifestJson = result.manifestJson;
|
|
620
|
-
this.storedSystemPropMapJson = JSON.stringify(result.manifest?.system_prop_map ?? {});
|
|
621
|
-
this.storedDynamicPropsJson = JSON.stringify(result.manifest?.dynamic_props ?? {});
|
|
622
|
-
this.reverseProvenance = result.manifest?.reverse_provenance ?? {};
|
|
623
|
-
this.storedSheets = result.manifest?.sheets ?? null;
|
|
624
|
-
this.globalCss = result.globalCss;
|
|
625
|
-
this.resolvedComponentCss = result.componentCss;
|
|
626
619
|
} catch (e) {
|
|
627
620
|
if (this.options.strict) throw new Error(`[animus-extract] analyzeProject failed: ${e}`, { cause: e });
|
|
628
621
|
console.warn("[animus-extract] analyzeProject failed:", e);
|
|
629
622
|
return false;
|
|
630
623
|
}
|
|
624
|
+
(0, _animus_ui_extract_pipeline.assertNoErrorDiagnostics)(result.manifest?.diagnostics);
|
|
625
|
+
this.storedManifest = result.manifest;
|
|
626
|
+
this.storedManifestJson = result.manifestJson;
|
|
627
|
+
this.storedSystemPropMapJson = JSON.stringify(result.manifest?.system_prop_map ?? {});
|
|
628
|
+
this.storedDynamicPropsJson = JSON.stringify(result.manifest?.dynamic_props ?? {});
|
|
629
|
+
this.reverseProvenance = result.manifest?.reverse_provenance ?? {};
|
|
630
|
+
this.storedSheets = result.manifest?.sheets ?? null;
|
|
631
|
+
this.globalCss = result.globalCss;
|
|
632
|
+
this.resolvedComponentCss = result.componentCss;
|
|
631
633
|
this.systemPropsModuleMemo = generateSystemPropsModule(this);
|
|
632
634
|
this.applyAssetSubstitutions();
|
|
633
635
|
this.enforceExternalTokenContracts();
|
|
@@ -953,7 +955,7 @@ function stabilizeSourceUniverse(ctx) {
|
|
|
953
955
|
const memo = barrenWalkMemos.get(ctx);
|
|
954
956
|
if (memo && memo.dropKey === dropKey && memo.cacheSize === ctx.fileCache.size) return reanalyzed;
|
|
955
957
|
const folded = foldUndiscoveredFiles(ctx);
|
|
956
|
-
if (folded === 0) {
|
|
958
|
+
if (folded.length === 0) {
|
|
957
959
|
barrenWalkMemos.set(ctx, {
|
|
958
960
|
dropKey,
|
|
959
961
|
cacheSize: ctx.fileCache.size
|
|
@@ -962,9 +964,15 @@ function stabilizeSourceUniverse(ctx) {
|
|
|
962
964
|
return reanalyzed;
|
|
963
965
|
}
|
|
964
966
|
barrenWalkMemos.delete(ctx);
|
|
965
|
-
ctx.log(`rediscovery: folded ${folded} on-disk file(s) after unresolved-parent drop`);
|
|
967
|
+
ctx.log(`rediscovery: folded ${folded.length} on-disk file(s) after unresolved-parent drop`);
|
|
966
968
|
reanalyzed = true;
|
|
967
|
-
|
|
969
|
+
let published = false;
|
|
970
|
+
try {
|
|
971
|
+
published = ctx.runAnalysis(buildFileEntriesFromCache(ctx.fileCache)) !== false;
|
|
972
|
+
} finally {
|
|
973
|
+
if (!published) for (const key of folded) ctx.fileCache.delete(key);
|
|
974
|
+
}
|
|
975
|
+
if (!published) return reanalyzed;
|
|
968
976
|
}
|
|
969
977
|
if (unresolvedDropFiles(ctx).size > 0) ctx.warn("source-universe rediscovery did not stabilize after bounded retries");
|
|
970
978
|
return reanalyzed;
|
|
@@ -974,10 +982,14 @@ function stabilizeSourceUniverse(ctx) {
|
|
|
974
982
|
* folds every eligible file `fileCache` does not hold. Returns the fold
|
|
975
983
|
* count.
|
|
976
984
|
*/
|
|
985
|
+
/** Returns the cache keys this fold ADDED, so a failed analysis can roll
|
|
986
|
+
* them back — `runAnalysis` requires callers that advanced the file cache to
|
|
987
|
+
* restore it, or the content-hash gate suppresses the equal-content retry
|
|
988
|
+
* forever. */
|
|
977
989
|
function foldUndiscoveredFiles(ctx) {
|
|
978
990
|
const excludePatterns = ctx.options.exclude ?? DEFAULT_EXCLUDE;
|
|
979
991
|
const filePaths = (0, _animus_ui_extract_pipeline.discoverFiles)(ctx.rootDir, ctx.rootDir, excludePatterns, ctx.extensionsSet);
|
|
980
|
-
|
|
992
|
+
const folded = [];
|
|
981
993
|
for (const filePath of filePaths) {
|
|
982
994
|
if ((0, path.extname)(filePath) === ".mdx") continue;
|
|
983
995
|
const relPath = (0, path.relative)(ctx.rootDir, filePath);
|
|
@@ -992,7 +1004,7 @@ function foldUndiscoveredFiles(ctx) {
|
|
|
992
1004
|
hash: (0, _animus_ui_extract_pipeline.contentHash)(source),
|
|
993
1005
|
source
|
|
994
1006
|
});
|
|
995
|
-
folded
|
|
1007
|
+
folded.push(relPath);
|
|
996
1008
|
}
|
|
997
1009
|
return folded;
|
|
998
1010
|
}
|
|
@@ -1215,7 +1227,10 @@ async function handleHotUpdate(ctx, environment, { type, file, timestamp, module
|
|
|
1215
1227
|
if (ownsEvent) ctx.hotUpdateEvents.record(file, timestamp, await analyzeChangedFile(ctx, file, absFile, read));
|
|
1216
1228
|
const result = ctx.hotUpdateEvents.resultOf(file, timestamp);
|
|
1217
1229
|
if (result.kind === "ignored") return;
|
|
1218
|
-
if (result.kind === "unchanged")
|
|
1230
|
+
if (result.kind === "unchanged") {
|
|
1231
|
+
if (type === "create") return;
|
|
1232
|
+
return [];
|
|
1233
|
+
}
|
|
1219
1234
|
return invalidateStaleModules(ctx, environment, modules, result);
|
|
1220
1235
|
}
|
|
1221
1236
|
/**
|
|
@@ -1349,7 +1364,12 @@ async function analyzeChangedFile(ctx, file, absFile, read) {
|
|
|
1349
1364
|
restoreEntry();
|
|
1350
1365
|
return { kind: "ignored" };
|
|
1351
1366
|
}
|
|
1352
|
-
|
|
1367
|
+
try {
|
|
1368
|
+
stabilizeSourceUniverse(ctx);
|
|
1369
|
+
} catch (e) {
|
|
1370
|
+
restoreEntry();
|
|
1371
|
+
throw e;
|
|
1372
|
+
}
|
|
1353
1373
|
const systemPropsChanged = systemPropsModuleSource(ctx) !== systemPropsBefore;
|
|
1354
1374
|
const analysisMs = Math.round(performance.now() - analysisStart);
|
|
1355
1375
|
const staleDefinitionFiles = (0, _animus_ui_extract_pipeline.diffFilePlans)(prevPlans, (0, _animus_ui_extract_pipeline.snapshotFilePlans)(ctx.storedManifest)).filter((defFile) => (0, path.resolve)(ctx.rootDir, defFile) !== absFile);
|
|
@@ -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,
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@animus-ui/vite-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Animus static CSS extraction Vite plugin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"animus",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"compile": "tsc --noEmit"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@animus-ui/extract": "0.1.
|
|
42
|
+
"@animus-ui/extract": "0.1.9",
|
|
43
43
|
"browserslist": "^4.24.0",
|
|
44
44
|
"lightningcss": "^1.29.0"
|
|
45
45
|
},
|