@animus-ui/vite-plugin 0.1.2 → 0.1.3
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 +8 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/index.cjs +19 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-start.d.ts","sourceRoot":"","sources":["../src/build-start.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,aAAa,EAClB,gBAAgB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAC9D,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"build-start.d.ts","sourceRoot":"","sources":["../src/build-start.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,aAAa,EAClB,gBAAgB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAC9D,OAAO,CAAC,IAAI,CAAC,CAsNf"}
|
package/dist/context.d.ts
CHANGED
|
@@ -166,6 +166,14 @@ export declare class PluginContext {
|
|
|
166
166
|
* which is exactly the reach this path wants. It stays the seam here.
|
|
167
167
|
*/
|
|
168
168
|
invalidateExtractedModules(): void;
|
|
169
|
+
/**
|
|
170
|
+
* The buildStart gate over include resolution
|
|
171
|
+
* (external-package-file-discovery: silence is never an outcome). An
|
|
172
|
+
* unresolvable `.includes()` specifier warns in non-strict mode and FAILS
|
|
173
|
+
* the build under `strict: true`, naming every offending specifier —
|
|
174
|
+
* a typo'd include must not ship a build missing its component CSS.
|
|
175
|
+
*/
|
|
176
|
+
enforceIncludeResolution(): void;
|
|
169
177
|
runSelfVerify(): void;
|
|
170
178
|
}
|
|
171
179
|
//# sourceMappingURL=context.d.ts.map
|
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":"AAoBA,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,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,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAUvD;AAED;;;;;;;GAOG;AACH,wBAAgB,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AAI,CAiEpB;CACF"}
|
package/dist/index.cjs
CHANGED
|
@@ -106,6 +106,7 @@ async function runBuildStart(ctx, resolveSpecifier) {
|
|
|
106
106
|
});
|
|
107
107
|
ctx.packageMap = collected.packageMap;
|
|
108
108
|
ctx.externalPackageOutcomes = collected.outcomes;
|
|
109
|
+
ctx.enforceIncludeResolution();
|
|
109
110
|
for (const [specifier, srcEntry] of collected.sourceEntries) ctx.externalSourceEntries.set(specifier, srcEntry);
|
|
110
111
|
for (const entry of collected.entries) {
|
|
111
112
|
const hash = !ctx.isProd ? (0, _animus_ui_extract_pipeline.contentHash)(entry.source) : void 0;
|
|
@@ -120,6 +121,7 @@ async function runBuildStart(ctx, resolveSpecifier) {
|
|
|
120
121
|
});
|
|
121
122
|
}
|
|
122
123
|
ctx.externalPackageDirs = collected.packageDirs;
|
|
124
|
+
ctx.registerSystemWatchPaths();
|
|
123
125
|
const packageFileCount = fileEntries.length - localFileCount;
|
|
124
126
|
ctx.log(`Discovered ${fileEntries.length} files (${packageFileCount} from packages) (${Math.round(performance.now() - t0)}ms)`);
|
|
125
127
|
t0 = performance.now();
|
|
@@ -550,8 +552,9 @@ var PluginContext = class {
|
|
|
550
552
|
*/
|
|
551
553
|
registerSystemWatchPaths() {
|
|
552
554
|
const watcher = this.devServer?.watcher;
|
|
553
|
-
if (!watcher
|
|
554
|
-
watcher.add(this.systemDependencyPaths);
|
|
555
|
+
if (!watcher) return;
|
|
556
|
+
if (this.systemDependencyPaths.length > 0) watcher.add(this.systemDependencyPaths);
|
|
557
|
+
if (this.externalPackageDirs.length > 0) watcher.add(this.externalPackageDirs);
|
|
555
558
|
}
|
|
556
559
|
/**
|
|
557
560
|
* Invalidate the component CSS and system-props virtual modules, then
|
|
@@ -577,10 +580,24 @@ var PluginContext = class {
|
|
|
577
580
|
this.devServer?.hot?.send({ type: "full-reload" });
|
|
578
581
|
}, 100);
|
|
579
582
|
}
|
|
583
|
+
/**
|
|
584
|
+
* The buildStart gate over include resolution
|
|
585
|
+
* (external-package-file-discovery: silence is never an outcome). An
|
|
586
|
+
* unresolvable `.includes()` specifier warns in non-strict mode and FAILS
|
|
587
|
+
* the build under `strict: true`, naming every offending specifier —
|
|
588
|
+
* a typo'd include must not ship a build missing its component CSS.
|
|
589
|
+
*/
|
|
590
|
+
enforceIncludeResolution() {
|
|
591
|
+
const message = (0, _animus_ui_extract_pipeline.unresolvableIncludesMessage)(this.externalPackageOutcomes);
|
|
592
|
+
if (message === null) return;
|
|
593
|
+
if (this.options.strict) throw new Error(message);
|
|
594
|
+
this.warn(message);
|
|
595
|
+
}
|
|
580
596
|
runSelfVerify() {
|
|
581
597
|
const failures = [];
|
|
582
598
|
if (Object.keys(this.storedManifest?.components ?? {}).length === 0) failures.push("No component CSS produced — check the system file and its includes list");
|
|
583
599
|
for (const { specifier, outcome } of this.externalPackageOutcomes) if (outcome === "empty") failures.push(`include '${specifier}' resolved but discovered no component sources`);
|
|
600
|
+
else if (outcome === "unresolvable") failures.push(`include '${specifier}' could not be resolved`);
|
|
584
601
|
if (!this.system.variableCss.includes(":root")) failures.push("No :root variable block found in variable CSS");
|
|
585
602
|
if (`${this.system.variableCss}\n${this.globalCss}\n${this.resolvedComponentCss}`.includes("__TRANSFORM__")) failures.push("Unresolved __TRANSFORM__ placeholders found in CSS output");
|
|
586
603
|
if (this.storedManifest && this.resolvedComponentCss.length > 0) {
|
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.3",
|
|
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.3",
|
|
43
43
|
"browserslist": "^4.24.0",
|
|
44
44
|
"lightningcss": "^1.29.0"
|
|
45
45
|
},
|