@animus-ui/vite-plugin 0.1.0-next.44 → 0.1.0-next.48

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 CHANGED
@@ -29,20 +29,11 @@ export interface AnimusExtractOptions {
29
29
  */
30
30
  minify?: boolean;
31
31
  /**
32
- * Namespace prefix for CSS variables and class names.
33
- * When set, all generated CSS variables become `--{prefix}-{name}`
34
- * and class names become `{prefix}-{Component}-{hash}`.
35
- * Defaults to no prefix.
36
- */
37
- prefix?: string;
38
- /**
39
- * Full `@layer` declaration order. Must include all 7 Animus layers
40
- * (global, base, variants, states, system, custom) as a subsequence
41
- * in their required order. Consumer layers may be interleaved around them.
42
- *
43
- * Example: `['reset', 'global', 'base', 'variants', 'states', 'system', 'custom', 'overrides']`
32
+ * Full `@layer` declaration order. Must include all 7 Animus `anm-*` layers
33
+ * as a subsequence in their required order. Consumer layers may be
34
+ * interleaved around them. Names are emitted as-is.
44
35
  *
45
- * When omitted, defaults to the 7 Animus layers.
36
+ * Example: `['reset', 'anm-global', 'anm-base', ..., 'anm-custom', 'overrides']`
46
37
  */
47
38
  layers?: string[];
48
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA6BA,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;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AA6ID,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CA0hCnE;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA4BA,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;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AA6ID,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAwgCnE;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 { applyUnitFallback, assembleStylesheet, detectRuntime, execSubprocess, extractSystemFilePackages, 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
@@ -168,13 +168,6 @@ function animusExtract(options) {
168
168
  variableMapJson = parsed.serialized.variableMapJson;
169
169
  variableCss = parsed.serialized.variableCss;
170
170
  contextualVarsJson = parsed.serialized.contextualVarsJson;
171
- if (options.prefix) {
172
- const prefixed = applyPrefix(options.prefix, variableMapJson, variableCss, themeJson, contextualVarsJson);
173
- variableMapJson = prefixed.variableMapJson;
174
- variableCss = prefixed.variableCss;
175
- if (prefixed.themeJson) themeJson = prefixed.themeJson;
176
- if (prefixed.contextualVarsJson) contextualVarsJson = prefixed.contextualVarsJson;
177
- }
178
171
  } else throw new Error("[animus-extract] Theme must be built with createTheme().build(). No .serialize() method found on tokens export.");
179
172
  if (parsed.globalStyleBlocks) {
180
173
  if (Object.keys(parsed.globalStyleBlocks).length > 0) try {
@@ -203,7 +196,7 @@ function animusExtract(options) {
203
196
  });
204
197
  const gsResult = JSON.parse(readFileSync(gsOut, "utf-8"));
205
198
  const parts = Object.values(gsResult).filter(Boolean);
206
- if (parts.length > 0) globalCss = `@layer global {\n${parts.join("\n\n")}\n}`;
199
+ if (parts.length > 0) globalCss = `@layer anm-global {\n${parts.join("\n\n")}\n}`;
207
200
  try {
208
201
  unlinkSync(gsThemeFile);
209
202
  unlinkSync(gsOut);
@@ -238,7 +231,7 @@ function animusExtract(options) {
238
231
  runtime_import: "@animus-ui/system",
239
232
  css_module_id: "virtual:animus/styles.css"
240
233
  });
241
- const manifestJson = analyzeProject(JSON.stringify(fileEntries), themeJson, variableMapJson, contextualVarsJson || null, configJson, groupRegistryJson, JSON.stringify(packageMap), !isProd, options.prefix || null, emitterConfig, selectorAliasesJson, selectorOrderJson);
234
+ const manifestJson = analyzeProject(JSON.stringify(fileEntries), themeJson, variableMapJson, contextualVarsJson || null, configJson, groupRegistryJson, JSON.stringify(packageMap), !isProd, emitterConfig, selectorAliasesJson, selectorOrderJson);
242
235
  storedManifest = JSON.parse(manifestJson);
243
236
  storedManifestJson = manifestJson;
244
237
  storedSystemPropMapJson = JSON.stringify(storedManifest?.system_prop_map ?? {});
@@ -297,15 +290,14 @@ function animusExtract(options) {
297
290
  logger = config.logger;
298
291
  lcssTargets = resolveLightningTargets(options.targets, rootDir);
299
292
  log(`Lightning CSS targets resolved (${Object.keys(lcssTargets).length} browsers)`);
300
- if (options.layers) {
301
- validateLayerOrder(options.layers);
302
- log(`Custom layers: [${options.layers.join(", ")}]`);
303
- }
304
- if (options.prefix) log(`Namespace prefix: "${options.prefix}"`);
305
293
  },
306
294
  async buildStart() {
307
295
  let t0 = performance.now();
308
296
  loadSystem();
297
+ if (options.layers) {
298
+ validateLayerOrder(options.layers);
299
+ log(`Custom layers: [${options.layers.join(", ")}]`);
300
+ }
309
301
  if (verbose) {
310
302
  const propCount = Object.keys(JSON.parse(configJson)).length;
311
303
  const groupCount = Object.keys(JSON.parse(groupRegistryJson)).length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@animus-ui/vite-plugin",
3
- "version": "0.1.0-next.44",
3
+ "version": "0.1.0-next.48",
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.44",
41
- "@animus-ui/system": "0.1.0-next.44",
40
+ "@animus-ui/extract": "0.1.0-next.48",
41
+ "@animus-ui/system": "0.1.0-next.48",
42
42
  "browserslist": "^4.24.0",
43
43
  "lightningcss": "^1.29.0"
44
44
  }