@animus-ui/vite-plugin 0.1.0-next.44 → 0.1.0-next.45
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.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +6 -3
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -37,12 +37,14 @@ export interface AnimusExtractOptions {
|
|
|
37
37
|
prefix?: string;
|
|
38
38
|
/**
|
|
39
39
|
* Full `@layer` declaration order. Must include all 7 Animus layers
|
|
40
|
-
*
|
|
41
|
-
*
|
|
40
|
+
* as a subsequence in their required order. Consumer layers may be
|
|
41
|
+
* interleaved around them. Names are emitted as-is.
|
|
42
42
|
*
|
|
43
|
-
*
|
|
43
|
+
* When `prefix` is set, use prefixed Animus names:
|
|
44
|
+
* `['reset', 'acme.global', 'acme.base', 'acme.variants', ..., 'overrides']`
|
|
44
45
|
*
|
|
45
|
-
*
|
|
46
|
+
* Without prefix:
|
|
47
|
+
* `['reset', 'global', 'base', 'variants', ..., 'overrides']`
|
|
46
48
|
*/
|
|
47
49
|
layers?: string[];
|
|
48
50
|
}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAU,MAAM,EAAE,MAAM,MAAM,CAAC;AAI3C,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,qGAAqG;IACrG,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AA6ID,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CA8hCnE;AAED,eAAe,aAAa,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { existsSync, readFileSync, readdirSync, statSync, unlinkSync, writeFileS
|
|
|
5
5
|
import { tmpdir } from "os";
|
|
6
6
|
import { dirname, extname, join, relative, resolve } from "path";
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
8
|
-
import { applyPrefix, applyUnitFallback, assembleStylesheet, detectRuntime, execSubprocess, extractSystemFilePackages, validateLayerOrder } from "@animus-ui/extract/pipeline";
|
|
8
|
+
import { applyPrefix, applyUnitFallback, assembleStylesheet, detectRuntime, execSubprocess, extractSystemFilePackages, prefixLayerName, validateLayerOrder } from "@animus-ui/extract/pipeline";
|
|
9
9
|
import browserslist from "browserslist";
|
|
10
10
|
import { browserslistToTargets, transform } from "lightningcss";
|
|
11
11
|
//#region \0rolldown/runtime.js
|
|
@@ -203,7 +203,7 @@ function animusExtract(options) {
|
|
|
203
203
|
});
|
|
204
204
|
const gsResult = JSON.parse(readFileSync(gsOut, "utf-8"));
|
|
205
205
|
const parts = Object.values(gsResult).filter(Boolean);
|
|
206
|
-
if (parts.length > 0) globalCss = `@layer global {\n${parts.join("\n\n")}\n}`;
|
|
206
|
+
if (parts.length > 0) globalCss = `@layer ${prefixLayerName("global", options.prefix)} {\n${parts.join("\n\n")}\n}`;
|
|
207
207
|
try {
|
|
208
208
|
unlinkSync(gsThemeFile);
|
|
209
209
|
unlinkSync(gsOut);
|
|
@@ -298,7 +298,7 @@ function animusExtract(options) {
|
|
|
298
298
|
lcssTargets = resolveLightningTargets(options.targets, rootDir);
|
|
299
299
|
log(`Lightning CSS targets resolved (${Object.keys(lcssTargets).length} browsers)`);
|
|
300
300
|
if (options.layers) {
|
|
301
|
-
validateLayerOrder(options.layers);
|
|
301
|
+
validateLayerOrder(options.layers, options.prefix);
|
|
302
302
|
log(`Custom layers: [${options.layers.join(", ")}]`);
|
|
303
303
|
}
|
|
304
304
|
if (options.prefix) log(`Namespace prefix: "${options.prefix}"`);
|
|
@@ -407,6 +407,7 @@ function animusExtract(options) {
|
|
|
407
407
|
if (!isProd && storedSheets) {
|
|
408
408
|
const staticSize = assembleStylesheet({
|
|
409
409
|
layers: options.layers,
|
|
410
|
+
prefix: options.prefix,
|
|
410
411
|
variableCss,
|
|
411
412
|
globalCss
|
|
412
413
|
}).length;
|
|
@@ -433,6 +434,7 @@ function animusExtract(options) {
|
|
|
433
434
|
if (id === RESOLVED_CSS_ID) {
|
|
434
435
|
if (!isProd && storedSheets) return postProcessCss(assembleStylesheet({
|
|
435
436
|
layers: options.layers,
|
|
437
|
+
prefix: options.prefix,
|
|
436
438
|
variableCss,
|
|
437
439
|
globalCss
|
|
438
440
|
}), {
|
|
@@ -441,6 +443,7 @@ function animusExtract(options) {
|
|
|
441
443
|
});
|
|
442
444
|
return postProcessCss(assembleStylesheet({
|
|
443
445
|
layers: options.layers,
|
|
446
|
+
prefix: options.prefix,
|
|
444
447
|
variableCss,
|
|
445
448
|
globalCss,
|
|
446
449
|
componentCss: resolvedComponentCss
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@animus-ui/vite-plugin",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.45",
|
|
4
4
|
"description": "Animus static CSS extraction Vite plugin",
|
|
5
5
|
"author": "codecaaron <airrobb@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"vite": ">=5.0.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@animus-ui/extract": "0.1.0-next.
|
|
41
|
-
"@animus-ui/system": "0.1.0-next.
|
|
40
|
+
"@animus-ui/extract": "0.1.0-next.45",
|
|
41
|
+
"@animus-ui/system": "0.1.0-next.45",
|
|
42
42
|
"browserslist": "^4.24.0",
|
|
43
43
|
"lightningcss": "^1.29.0"
|
|
44
44
|
}
|