@animus-ui/vite-plugin 0.1.20 → 0.1.21
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/build-start.d.ts.map +1 -1
- package/dist/context.d.ts +10 -2
- package/dist/context.d.ts.map +1 -1
- package/dist/index.cjs +50 -25
- package/dist/rediscovery.d.ts.map +1 -1
- package/dist/virtual-modules.d.ts +4 -1
- package/dist/virtual-modules.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-start.d.ts","sourceRoot":"","sources":["../src/build-start.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-start.d.ts","sourceRoot":"","sources":["../src/build-start.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/C;;;GAGG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,aAAa,EAClB,gBAAgB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,EAC/D,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,MAAM,GAC3D,OAAO,CAAC,IAAI,CAAC,CAoOf"}
|
package/dist/context.d.ts
CHANGED
|
@@ -86,11 +86,15 @@ export declare class PluginContext {
|
|
|
86
86
|
assetPassComplete: boolean;
|
|
87
87
|
externalPackageDirs: string[];
|
|
88
88
|
externalDirOwners: Record<string, string>;
|
|
89
|
+
/** specifier → whether its redirected source entry has side effects, from
|
|
90
|
+
* the owning package's `sideEffects`; absent leaves Vite's default. */
|
|
91
|
+
externalSourceSideEffects: Map<string, boolean>;
|
|
89
92
|
externalFileOwners: Record<string, string>;
|
|
90
93
|
externalSourceEntries: Map<string, string>;
|
|
91
94
|
externalPackageOutcomes: ExternalPackageOutcome[];
|
|
92
|
-
/** Configured files buildStart could not read.
|
|
93
|
-
* files themselves, so they replay these
|
|
95
|
+
/** Configured files buildStart or a late rediscovery could not read.
|
|
96
|
+
* Later analyses read no files themselves, so they replay these until the
|
|
97
|
+
* file is read into the cache or deleted. */
|
|
94
98
|
ingestionFailureDiagnostics: ManifestDiagnostic[];
|
|
95
99
|
devServer: any;
|
|
96
100
|
resolvedSystemPath: string | null;
|
|
@@ -113,6 +117,10 @@ export declare class PluginContext {
|
|
|
113
117
|
/** Load the system into `this.system`. On failure the previous config is
|
|
114
118
|
* kept; strict mode throws instead. */
|
|
115
119
|
loadSystem(): void;
|
|
120
|
+
/** The read failures still standing: a file stops counting once the cache
|
|
121
|
+
* holds a read of it or it is gone, as in the shared session, so it stops
|
|
122
|
+
* warning and stops holding pruning off. */
|
|
123
|
+
private unsettledIngestionFailures;
|
|
116
124
|
/** Runs project analysis and updates every manifest-derived state. Returns
|
|
117
125
|
* false when nothing published, and the caller must roll its cache back.
|
|
118
126
|
* While a source is skipped or unreadable, its renders are unseen, so
|
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":"AAuCA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAItD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,KAAK,EAEV,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,cAAc,EAEd,eAAe,EACf,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,YAAY,EAEb,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAoBnC;yEACyE;AACzE,wBAAgB,oBAAoB,CAAC,CAAC,EACp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package/dist/index.cjs
CHANGED
|
@@ -51,7 +51,7 @@ async function runBuildStart(ctx, resolveSpecifier, emitAsset) {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
const localFileCount = rawEntries.length;
|
|
54
|
-
const packageSpecifiers = (0, _animus_ui_extract_pipeline.extractSystemFilePackages)(ctx.resolvedSystemPath);
|
|
54
|
+
const packageSpecifiers = (0, _animus_ui_extract_pipeline.extractSystemFilePackages)(ctx.resolvedSystemPath, (0, _animus_ui_extract_pipeline.engineImportParser)(ctx.engineApi()));
|
|
55
55
|
ctx.externalSourceEntries.clear();
|
|
56
56
|
const collected = await (0, _animus_ui_extract_pipeline.collectExternalPackageSources)({
|
|
57
57
|
specifiers: packageSpecifiers,
|
|
@@ -64,12 +64,14 @@ async function runBuildStart(ctx, resolveSpecifier, emitAsset) {
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
ctx.ingestionFailureDiagnostics = ingestionFailures;
|
|
67
|
+
(0, _animus_ui_extract_pipeline.surfaceManifestDiagnostics)({ diagnostics: (0, _animus_ui_extract_pipeline.noKitFilesDiagnostics)(collected.outcomes) }, (message) => ctx.warn(message));
|
|
67
68
|
ctx.packageMap = collected.packageMap;
|
|
68
69
|
ctx.externalPackageOutcomes = collected.outcomes;
|
|
69
70
|
ctx.externalDirOwners = (0, _animus_ui_extract_pipeline.firstOwners)(collected.dirOwnerSets);
|
|
70
71
|
ctx.externalFileOwners = collected.fileOwners;
|
|
71
72
|
ctx.enforceIncludeResolution();
|
|
72
73
|
for (const [specifier, srcEntry] of collected.sourceEntries) ctx.externalSourceEntries.set(specifier, srcEntry);
|
|
74
|
+
ctx.externalSourceSideEffects = collected.sourceEntrySideEffects;
|
|
73
75
|
for (const entry of collected.entries) {
|
|
74
76
|
const hash = !ctx.isProd ? (0, _animus_ui_extract_pipeline.contentHash)(entry.source) : void 0;
|
|
75
77
|
rawEntries.push({
|
|
@@ -468,11 +470,15 @@ var PluginContext = class {
|
|
|
468
470
|
assetPassComplete = false;
|
|
469
471
|
externalPackageDirs = [];
|
|
470
472
|
externalDirOwners = {};
|
|
473
|
+
/** specifier → whether its redirected source entry has side effects, from
|
|
474
|
+
* the owning package's `sideEffects`; absent leaves Vite's default. */
|
|
475
|
+
externalSourceSideEffects = /* @__PURE__ */ new Map();
|
|
471
476
|
externalFileOwners = {};
|
|
472
477
|
externalSourceEntries = /* @__PURE__ */ new Map();
|
|
473
478
|
externalPackageOutcomes = [];
|
|
474
|
-
/** Configured files buildStart could not read.
|
|
475
|
-
* files themselves, so they replay these
|
|
479
|
+
/** Configured files buildStart or a late rediscovery could not read.
|
|
480
|
+
* Later analyses read no files themselves, so they replay these until the
|
|
481
|
+
* file is read into the cache or deleted. */
|
|
476
482
|
ingestionFailureDiagnostics = [];
|
|
477
483
|
devServer;
|
|
478
484
|
resolvedSystemPath = null;
|
|
@@ -551,7 +557,13 @@ var PluginContext = class {
|
|
|
551
557
|
prefix: this.options.prefix,
|
|
552
558
|
prefixContextualVars: this.options.prefixContextualVars
|
|
553
559
|
});
|
|
554
|
-
const
|
|
560
|
+
const appManifest = (0, path.join)((0, _animus_ui_extract_pipeline.findPackageRoot)(this.resolvedSystemPath), "package.json");
|
|
561
|
+
const manifests = /* @__PURE__ */ new Set();
|
|
562
|
+
for (const dep of this.system.dependencies ?? []) {
|
|
563
|
+
const manifest = (0, path.join)((0, _animus_ui_extract_pipeline.findPackageRoot)(dep), "package.json");
|
|
564
|
+
if (manifest !== appManifest && (0, fs.existsSync)(manifest)) manifests.add(manifest);
|
|
565
|
+
}
|
|
566
|
+
const deps = [...this.system.dependencies ?? [], ...manifests];
|
|
555
567
|
const keys = /* @__PURE__ */ new Set();
|
|
556
568
|
for (const key of (0, _animus_ui_extract_pipeline.toWatchKeys)(this.resolvedSystemPath)) keys.add(key);
|
|
557
569
|
for (const dep of deps) for (const key of (0, _animus_ui_extract_pipeline.toWatchKeys)(dep)) keys.add(key);
|
|
@@ -563,11 +575,26 @@ var PluginContext = class {
|
|
|
563
575
|
console.warn(`[animus-extract] Failed to load system from ${this.resolvedSystemPath}:`, e);
|
|
564
576
|
}
|
|
565
577
|
}
|
|
578
|
+
/** The read failures still standing: a file stops counting once the cache
|
|
579
|
+
* holds a read of it or it is gone, as in the shared session, so it stops
|
|
580
|
+
* warning and stops holding pruning off. */
|
|
581
|
+
unsettledIngestionFailures() {
|
|
582
|
+
return this.ingestionFailureDiagnostics.filter(({ file }) => {
|
|
583
|
+
if (this.fileCache.has(file)) return false;
|
|
584
|
+
try {
|
|
585
|
+
(0, fs.statSync)((0, path.resolve)(this.rootDir, file));
|
|
586
|
+
return true;
|
|
587
|
+
} catch (err) {
|
|
588
|
+
return !(0, _animus_ui_extract_pipeline.isDeletedSource)(err);
|
|
589
|
+
}
|
|
590
|
+
});
|
|
591
|
+
}
|
|
566
592
|
/** Runs project analysis and updates every manifest-derived state. Returns
|
|
567
593
|
* false when nothing published, and the caller must roll its cache back.
|
|
568
594
|
* While a source is skipped or unreadable, its renders are unseen, so
|
|
569
595
|
* nothing is pruned. */
|
|
570
596
|
runAnalysis(fileEntries, skippedOriginals = []) {
|
|
597
|
+
const ingestionFailures = this.unsettledIngestionFailures();
|
|
571
598
|
let result;
|
|
572
599
|
try {
|
|
573
600
|
result = (0, _animus_ui_extract_pipeline.runProjectAnalysis)(this.engineApi, {
|
|
@@ -583,14 +610,14 @@ var PluginContext = class {
|
|
|
583
610
|
externalDirs: this.externalPackageDirs.map((dir) => (0, path.relative)(this.rootDir, dir)),
|
|
584
611
|
devMode: !this.emissionProd,
|
|
585
612
|
analysisContext: {
|
|
586
|
-
skippedSources: [...skippedOriginals, ...
|
|
613
|
+
skippedSources: [...skippedOriginals, ...ingestionFailures.map((d) => d.file)].map((file) => (0, path.isAbsolute)(file) ? (0, path.relative)(this.rootDir, file) : file),
|
|
587
614
|
unbundledComputedImports: true,
|
|
588
615
|
packageDirs: this.externalPackageDirs.map((dir) => (0, path.relative)(this.rootDir, dir))
|
|
589
616
|
},
|
|
590
617
|
warn: (m) => this.warn(m),
|
|
591
618
|
info: (m) => this.log(m),
|
|
592
619
|
strict: this.options.strict,
|
|
593
|
-
extraDiagnostics:
|
|
620
|
+
extraDiagnostics: ingestionFailures
|
|
594
621
|
});
|
|
595
622
|
} catch (e) {
|
|
596
623
|
if (this.options.strict) throw new Error(`[animus-extract] analyzeProject failed: ${e}`, { cause: e });
|
|
@@ -607,6 +634,7 @@ var PluginContext = class {
|
|
|
607
634
|
});
|
|
608
635
|
this.storedManifest = result.manifest;
|
|
609
636
|
this.storedManifestJson = result.manifestJson;
|
|
637
|
+
this.ingestionFailureDiagnostics = ingestionFailures;
|
|
610
638
|
this.storedSystemPropMapJson = JSON.stringify(result.manifest.system_prop_map);
|
|
611
639
|
this.storedDynamicPropsJson = JSON.stringify(result.manifest.dynamic_props);
|
|
612
640
|
this.storedAdmittedTransformsJson = JSON.stringify(result.manifest.admitted_transforms);
|
|
@@ -863,7 +891,8 @@ var PluginContext = class {
|
|
|
863
891
|
globalCss: this.globalCss,
|
|
864
892
|
componentCss: this.resolvedComponentCss,
|
|
865
893
|
layers: this.options.layers,
|
|
866
|
-
externalOutcomes: this.externalPackageOutcomes
|
|
894
|
+
externalOutcomes: this.externalPackageOutcomes,
|
|
895
|
+
variableMapJson: this.system.variableMapJson
|
|
867
896
|
});
|
|
868
897
|
for (const message of failures) {
|
|
869
898
|
const line = `[animus:verify] ${message}`;
|
|
@@ -916,15 +945,16 @@ async function reconcileSourceCorpus(ctx) {
|
|
|
916
945
|
for (let iteration = 0; iteration < 3; iteration++) {
|
|
917
946
|
if (unresolvedDropFiles(ctx).size === 0) {
|
|
918
947
|
warnedVerdicts.get(ctx)?.clear();
|
|
919
|
-
warnedUnreadable.get(ctx)?.clear();
|
|
920
948
|
return reanalyzed;
|
|
921
949
|
}
|
|
922
950
|
const drops = unresolvedParentDrops(ctx);
|
|
923
951
|
const dropKey = drops.map((d) => `${d.file}\0${d.component}\0${d.parent}`).sort().join("\n");
|
|
924
952
|
const memo = barrenWalkMemos.get(ctx);
|
|
925
953
|
if (memo && memo.dropKey === dropKey && memo.cacheGeneration === ctx.fileCacheGeneration) return reanalyzed;
|
|
954
|
+
const recordedFailures = ctx.ingestionFailureDiagnostics.length;
|
|
926
955
|
const folded = foldUndiscoveredFiles(ctx);
|
|
927
|
-
|
|
956
|
+
const newlyUnreadable = ctx.ingestionFailureDiagnostics.length > recordedFailures;
|
|
957
|
+
if (folded.length === 0 && !newlyUnreadable) {
|
|
928
958
|
barrenWalkMemos.set(ctx, {
|
|
929
959
|
dropKey,
|
|
930
960
|
cacheGeneration: ctx.fileCacheGeneration
|
|
@@ -933,7 +963,7 @@ async function reconcileSourceCorpus(ctx) {
|
|
|
933
963
|
return reanalyzed;
|
|
934
964
|
}
|
|
935
965
|
barrenWalkMemos.delete(ctx);
|
|
936
|
-
ctx.log(`rediscovery: folded ${folded.length} on-disk file(s) after unresolved-parent drop`);
|
|
966
|
+
if (folded.length > 0) ctx.log(`rediscovery: folded ${folded.length} on-disk file(s) after unresolved-parent drop`);
|
|
937
967
|
reanalyzed = true;
|
|
938
968
|
let published = false;
|
|
939
969
|
let held = false;
|
|
@@ -952,7 +982,8 @@ async function reconcileSourceCorpus(ctx) {
|
|
|
952
982
|
return reanalyzed;
|
|
953
983
|
}
|
|
954
984
|
/** Returns the cache keys this fold added: a failed analysis must restore
|
|
955
|
-
* the cache, or the content-hash gate suppresses the retry forever.
|
|
985
|
+
* the cache, or the content-hash gate suppresses the retry forever. A file
|
|
986
|
+
* it cannot read joins the context's ingestion failures instead. */
|
|
956
987
|
function foldUndiscoveredFiles(ctx) {
|
|
957
988
|
const excludeMatcher = ctx.excludeMatcher;
|
|
958
989
|
const filePaths = (0, _animus_ui_extract_pipeline.discoverFiles)(ctx.rootDir, ctx.rootDir, excludeMatcher, ctx.extensionsSet);
|
|
@@ -966,16 +997,7 @@ function foldUndiscoveredFiles(ctx) {
|
|
|
966
997
|
try {
|
|
967
998
|
source = (0, fs.readFileSync)(filePath, "utf-8");
|
|
968
999
|
} catch (err) {
|
|
969
|
-
|
|
970
|
-
if (!warned) {
|
|
971
|
-
warned = /* @__PURE__ */ new Set();
|
|
972
|
-
warnedUnreadable.set(ctx, warned);
|
|
973
|
-
}
|
|
974
|
-
if (!(0, _animus_ui_extract_pipeline.isDeletedSource)(err) && !warned.has(relPath)) {
|
|
975
|
-
warned.add(relPath);
|
|
976
|
-
const diagnostic = (0, _animus_ui_extract_pipeline.unreadableSourceDiagnostic)(relPath, err);
|
|
977
|
-
ctx.warn(`${diagnostic.code} ${diagnostic.message}`);
|
|
978
|
-
}
|
|
1000
|
+
if (!(0, _animus_ui_extract_pipeline.isDeletedSource)(err) && !ctx.ingestionFailureDiagnostics.some((d) => d.file === relPath)) ctx.ingestionFailureDiagnostics.push((0, _animus_ui_extract_pipeline.unreadableSourceDiagnostic)(relPath, err));
|
|
979
1001
|
continue;
|
|
980
1002
|
}
|
|
981
1003
|
pending.push([relPath, {
|
|
@@ -995,9 +1017,6 @@ const barrenWalkMemos = /* @__PURE__ */ new WeakMap();
|
|
|
995
1017
|
/** Per-context (file, parent, condition) verdicts already warned — each
|
|
996
1018
|
* condition warns once; cleared when the drops disappear. */
|
|
997
1019
|
const warnedVerdicts = /* @__PURE__ */ new WeakMap();
|
|
998
|
-
/** Late files already reported unreadable, until the drops resolve: the
|
|
999
|
-
* bounded retries walk them again. */
|
|
1000
|
-
const warnedUnreadable = /* @__PURE__ */ new WeakMap();
|
|
1001
1020
|
const PARENT_PROBE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
1002
1021
|
".tsx",
|
|
1003
1022
|
".ts",
|
|
@@ -1413,7 +1432,13 @@ function resolveVirtualId(ctx, id) {
|
|
|
1413
1432
|
if (id === VIRTUAL_BRIDGE_ID) return RESOLVED_BRIDGE_ID;
|
|
1414
1433
|
if (id === VIRTUAL_SYSTEM_PROPS_ID) return RESOLVED_SYSTEM_PROPS_ID;
|
|
1415
1434
|
const srcEntry = ctx.externalSourceEntries.get(id);
|
|
1416
|
-
if (srcEntry)
|
|
1435
|
+
if (srcEntry) {
|
|
1436
|
+
const moduleSideEffects = ctx.externalSourceSideEffects.get(id);
|
|
1437
|
+
return moduleSideEffects === void 0 ? srcEntry : {
|
|
1438
|
+
id: srcEntry,
|
|
1439
|
+
moduleSideEffects
|
|
1440
|
+
};
|
|
1441
|
+
}
|
|
1417
1442
|
return null;
|
|
1418
1443
|
}
|
|
1419
1444
|
function loadVirtualModule(ctx, id) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rediscovery.d.ts","sourceRoot":"","sources":["../src/rediscovery.ts"],"names":[],"mappings":"AAaA,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,
|
|
1
|
+
{"version":3,"file":"rediscovery.d.ts","sourceRoot":"","sources":["../src/rediscovery.ts"],"names":[],"mappings":"AAaA,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,CAgFlB"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { PluginContext } from './context';
|
|
2
|
-
export declare function resolveVirtualId(ctx: PluginContext, id: string): string |
|
|
2
|
+
export declare function resolveVirtualId(ctx: PluginContext, id: string): string | {
|
|
3
|
+
id: string;
|
|
4
|
+
moduleSideEffects: boolean;
|
|
5
|
+
} | null;
|
|
3
6
|
export declare function loadVirtualModule(ctx: PluginContext, id: string): string | null;
|
|
4
7
|
//# sourceMappingURL=virtual-modules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-modules.d.ts","sourceRoot":"","sources":["../src/virtual-modules.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAa/C,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,aAAa,EAClB,EAAE,EAAE,MAAM,GACT,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"virtual-modules.d.ts","sourceRoot":"","sources":["../src/virtual-modules.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAa/C,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,aAAa,EAClB,EAAE,EAAE,MAAM,GACT,MAAM,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAmB5D;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,aAAa,EAClB,EAAE,EAAE,MAAM,GACT,MAAM,GAAG,IAAI,CA+Gf"}
|
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.21",
|
|
4
4
|
"description": "Animus static CSS extraction Vite plugin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"animus",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"compile": "tsc --noEmit"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@animus-ui/extract": "0.1.
|
|
42
|
+
"@animus-ui/extract": "0.1.21",
|
|
43
43
|
"browserslist": "^4.28.8",
|
|
44
44
|
"lightningcss": "^1.33.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@animus-ui/assertions": "0.1.
|
|
47
|
+
"@animus-ui/assertions": "0.1.21"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@mdx-js/mdx": "^3.0.0",
|