@animus-ui/extract 0.1.18 → 0.1.19

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.
Files changed (35) hide show
  1. package/README.md +2 -2
  2. package/crates/extract-v2/animus-extract-v2.darwin-arm64.node +0 -0
  3. package/crates/extract-v2/animus-extract-v2.linux-arm64-gnu.node +0 -0
  4. package/crates/extract-v2/animus-extract-v2.linux-x64-gnu.node +0 -0
  5. package/crates/extract-v2/index.d.ts +5 -0
  6. package/dist/index.cjs +4 -2
  7. package/dist/index.mjs +2 -2
  8. package/dist/pipeline/asset-placeholders.d.ts +19 -0
  9. package/dist/pipeline/asset-placeholders.d.ts.map +1 -1
  10. package/dist/pipeline/engine-retirement.d.ts.map +1 -1
  11. package/dist/pipeline/index.d.ts +2 -2
  12. package/dist/pipeline/index.d.ts.map +1 -1
  13. package/dist/pipeline/manifest-diagnostics.d.ts +26 -1
  14. package/dist/pipeline/manifest-diagnostics.d.ts.map +1 -1
  15. package/dist/pipeline/manifest-schema.d.ts +5 -2
  16. package/dist/pipeline/manifest-schema.d.ts.map +1 -1
  17. package/dist/pipeline/property-diagnostics.d.ts +17 -0
  18. package/dist/pipeline/property-diagnostics.d.ts.map +1 -0
  19. package/dist/pipeline/property-registrations.d.ts +7 -0
  20. package/dist/pipeline/property-registrations.d.ts.map +1 -1
  21. package/dist/pipeline/run-analysis.d.ts +2 -0
  22. package/dist/pipeline/run-analysis.d.ts.map +1 -1
  23. package/dist/pipeline/system-config.d.ts +3 -0
  24. package/dist/pipeline/system-config.d.ts.map +1 -1
  25. package/dist/{pipeline-Dr-I4Xhl.mjs → pipeline-BuiItKT-.mjs} +369 -111
  26. package/dist/{pipeline-OKnmnyFu.cjs → pipeline-CD2qmEEn.cjs} +384 -114
  27. package/dist/session/extraction-session.d.ts +3 -2
  28. package/dist/session/extraction-session.d.ts.map +1 -1
  29. package/dist/session/timing.d.ts.map +1 -1
  30. package/dist/session.cjs +19 -14
  31. package/dist/session.mjs +19 -14
  32. package/index-v2.js +1 -1
  33. package/package.json +4 -4
  34. package/dist/pipeline/timing-waterfall.d.ts +0 -6
  35. package/dist/pipeline/timing-waterfall.d.ts.map +0 -1
package/dist/session.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_pipeline = require("./pipeline-OKnmnyFu.cjs");
2
+ const require_pipeline = require("./pipeline-CD2qmEEn.cjs");
3
3
  let crypto = require("crypto");
4
4
  let fs = require("fs");
5
5
  let path = require("path");
@@ -518,10 +518,6 @@ function logBuildTimings(bt, rustTiming, log, verbose) {
518
518
  ]) {
519
519
  const sms = bt[sk] ?? 0;
520
520
  log(` ${pad(sl, 15)}${String(sms).padStart(5)}ms`);
521
- if (sk === "rustExtract" && rustTiming) for (const line of require_pipeline.formatRustTimingWaterfall(rustTiming, {
522
- indent: " ",
523
- labelWidth: 13
524
- })) log(line);
525
521
  }
526
522
  }
527
523
  log(` total ${String(bt.total).padStart(5)}ms`);
@@ -1351,6 +1347,7 @@ var ExtractionSession = class {
1351
1347
  const result = require_pipeline.runProjectAnalysis(engineApi, {
1352
1348
  ...analysisOptions,
1353
1349
  warn: (message) => this.warn(message),
1350
+ info: (message) => this.log(message),
1354
1351
  strict: this.options.strict,
1355
1352
  extraDiagnostics: this.ingestionFailureDiagnostics
1356
1353
  });
@@ -1373,12 +1370,14 @@ var ExtractionSession = class {
1373
1370
  bt.analysis = (bt.jsonSerialize ?? 0) + (bt.rustExtract ?? 0) + (bt.jsonParse ?? 0);
1374
1371
  if (manifest?.report) this.log(`Extracted ${manifest.report.components_extracted ?? "?"}/${manifest.report.components_total ?? "?"} components (${bt.analysis}ms)`);
1375
1372
  }
1376
- const globalCss = this.substituteAssetReferences(result.globalCss, !devMode || this.staleAssetPruning === "every-cycle");
1373
+ const sheets = this.substituteAssetReferences({
1374
+ variableCss: system.variableCss,
1375
+ globalCss: result.globalCss,
1376
+ componentCss: result.componentCss
1377
+ }, !devMode || this.staleAssetPruning === "every-cycle");
1377
1378
  const { declaration, variables, body } = require_pipeline.assembleStylesheet({
1378
1379
  layers: this.options.layers,
1379
- variableCss: system.variableCss,
1380
- globalCss,
1381
- componentCss: result.componentCss,
1380
+ ...sheets,
1382
1381
  split: true
1383
1382
  });
1384
1383
  if (this.lcssTargets === null) this.lcssTargets = require_pipeline.resolveLightningTargets(this.options.targets, this.rootDir);
@@ -1391,6 +1390,11 @@ var ExtractionSession = class {
1391
1390
  warnFn: (msg) => this.warn(msg)
1392
1391
  })
1393
1392
  ].filter(Boolean).join("\n");
1393
+ require_pipeline.reportSurvivingAssetPlaceholders(fullCss, {
1394
+ strict: this.options.strict,
1395
+ warn: (message) => this.warn(message),
1396
+ prefix: `[${this.driverLabel}]`
1397
+ });
1394
1398
  setSharedCss(fullCss);
1395
1399
  const systemPropsContent = require_pipeline.buildSystemPropsModule({
1396
1400
  systemPropMapJson: JSON.stringify(manifest?.system_prop_map ?? {}),
@@ -1681,10 +1685,11 @@ var ExtractionSession = class {
1681
1685
  (0, fs.renameSync)(tmpPath, (0, path.join)(dir, name));
1682
1686
  this.onArtifactWrite?.(name, content);
1683
1687
  }
1684
- /** Copy each asset() specifier's bytes into `assets/` under a
1685
- * content-hashed name and substitute a url relative to styles.css. */
1686
- substituteAssetReferences(globalCss, pruneSuperseded) {
1687
- const specifiers = require_pipeline.findAssetSpecifiers(globalCss);
1688
+ /** Copy each asset() specifier's bytes, from every sheet, into `assets/`
1689
+ * under a content-hashed name and substitute a url relative to
1690
+ * styles.css. */
1691
+ substituteAssetReferences(sheets, pruneSuperseded) {
1692
+ const specifiers = require_pipeline.findSheetAssetSpecifiers(sheets);
1688
1693
  const assetsDir = (0, path.join)(this.sessionDir, SESSION_ASSETS_DIR);
1689
1694
  const expected = /* @__PURE__ */ new Set();
1690
1695
  this.assetDependencyPaths.clear();
@@ -1729,7 +1734,7 @@ var ExtractionSession = class {
1729
1734
  });
1730
1735
  }
1731
1736
  if (pruneSuperseded) pruneStaleAssets(assetsDir, expected);
1732
- return require_pipeline.substituteAssetPlaceholders(globalCss, urlBySpecifier);
1737
+ return require_pipeline.substituteSheetAssets(sheets, urlBySpecifier);
1733
1738
  }
1734
1739
  trackAssetDependency(path$8) {
1735
1740
  this.assetDependencyPaths.add(path$8);
package/dist/session.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as resolveLightningTargets, B as extractSystemFilePackages, Dt as __require, E as unreadableSourceDiagnostic, F as findAssetSpecifiers, G as staleDistIncludesMessage, H as firstOwners, I as substituteAssetPlaceholders, J as createSourceIdentity, K as unresolvableIncludesMessage, L as createSourceCorpus, M as enforceExternalTokenContracts, N as resolveAssetFile, Q as discoverFiles, R as collectExternalPackageSources, U as isExcludedPackageRelativePath, V as findPackageRoot, X as sharesVolumeRoot, Y as isPathWithinRoot, _ as clearEngineCache, _t as DEFAULT_EXTENSIONS, a as assertNoErrorDiagnostics, c as buildSystemPropsModule, ct as resolveVerbosity, d as loadSystemConfig, dt as createV2EngineApi, ht as projectExternalFileOwners, i as snapshotFilePlans, k as postProcessCss, ot as createExcludeMatcher, p as serializeStaticCss, q as walkPackageSources, r as hashReplacementPlans, s as formatRustTimingWaterfall, st as resolveMode, t as toWatchKeys, v as runProjectAnalysis, wt as assembleStylesheet, xt as contentHash, z as excludeCollectedPackages } from "./pipeline-Dr-I4Xhl.mjs";
1
+ import { B as collectExternalPackageSources, Ct as contentHash, Et as assembleStylesheet, F as findSheetAssetSpecifiers, G as isExcludedPackageRelativePath, H as extractSystemFilePackages, I as reportSurvivingAssetPlaceholders, J as unresolvableIncludesMessage, M as resolveAssetFile, O as postProcessCss, Q as sharesVolumeRoot, R as substituteSheetAssets, T as unreadableSourceDiagnostic, U as findPackageRoot, V as excludeCollectedPackages, W as firstOwners, X as createSourceIdentity, Y as walkPackageSources, Z as isPathWithinRoot, _ as runProjectAnalysis, _t as projectExternalFileOwners, a as assertNoErrorDiagnostics, ct as createExcludeMatcher, et as discoverFiles, f as serializeStaticCss, g as clearEngineCache, i as snapshotFilePlans, j as enforceExternalTokenContracts, k as resolveLightningTargets, kt as __require, lt as resolveMode, pt as createV2EngineApi, q as staleDistIncludesMessage, r as hashReplacementPlans, s as buildSystemPropsModule, t as toWatchKeys, u as loadSystemConfig, ut as resolveVerbosity, yt as DEFAULT_EXTENSIONS, z as createSourceCorpus } from "./pipeline-BuiItKT-.mjs";
2
2
  import { randomUUID } from "crypto";
3
3
  import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, watch, writeFileSync } from "fs";
4
4
  import { basename, extname, join, relative, resolve } from "path";
@@ -517,10 +517,6 @@ function logBuildTimings(bt, rustTiming, log, verbose) {
517
517
  ]) {
518
518
  const sms = bt[sk] ?? 0;
519
519
  log(` ${pad(sl, 15)}${String(sms).padStart(5)}ms`);
520
- if (sk === "rustExtract" && rustTiming) for (const line of formatRustTimingWaterfall(rustTiming, {
521
- indent: " ",
522
- labelWidth: 13
523
- })) log(line);
524
520
  }
525
521
  }
526
522
  log(` total ${String(bt.total).padStart(5)}ms`);
@@ -1350,6 +1346,7 @@ var ExtractionSession = class {
1350
1346
  const result = runProjectAnalysis(engineApi, {
1351
1347
  ...analysisOptions,
1352
1348
  warn: (message) => this.warn(message),
1349
+ info: (message) => this.log(message),
1353
1350
  strict: this.options.strict,
1354
1351
  extraDiagnostics: this.ingestionFailureDiagnostics
1355
1352
  });
@@ -1372,12 +1369,14 @@ var ExtractionSession = class {
1372
1369
  bt.analysis = (bt.jsonSerialize ?? 0) + (bt.rustExtract ?? 0) + (bt.jsonParse ?? 0);
1373
1370
  if (manifest?.report) this.log(`Extracted ${manifest.report.components_extracted ?? "?"}/${manifest.report.components_total ?? "?"} components (${bt.analysis}ms)`);
1374
1371
  }
1375
- const globalCss = this.substituteAssetReferences(result.globalCss, !devMode || this.staleAssetPruning === "every-cycle");
1372
+ const sheets = this.substituteAssetReferences({
1373
+ variableCss: system.variableCss,
1374
+ globalCss: result.globalCss,
1375
+ componentCss: result.componentCss
1376
+ }, !devMode || this.staleAssetPruning === "every-cycle");
1376
1377
  const { declaration, variables, body } = assembleStylesheet({
1377
1378
  layers: this.options.layers,
1378
- variableCss: system.variableCss,
1379
- globalCss,
1380
- componentCss: result.componentCss,
1379
+ ...sheets,
1381
1380
  split: true
1382
1381
  });
1383
1382
  if (this.lcssTargets === null) this.lcssTargets = resolveLightningTargets(this.options.targets, this.rootDir);
@@ -1390,6 +1389,11 @@ var ExtractionSession = class {
1390
1389
  warnFn: (msg) => this.warn(msg)
1391
1390
  })
1392
1391
  ].filter(Boolean).join("\n");
1392
+ reportSurvivingAssetPlaceholders(fullCss, {
1393
+ strict: this.options.strict,
1394
+ warn: (message) => this.warn(message),
1395
+ prefix: `[${this.driverLabel}]`
1396
+ });
1393
1397
  setSharedCss(fullCss);
1394
1398
  const systemPropsContent = buildSystemPropsModule({
1395
1399
  systemPropMapJson: JSON.stringify(manifest?.system_prop_map ?? {}),
@@ -1680,10 +1684,11 @@ var ExtractionSession = class {
1680
1684
  renameSync(tmpPath, join(dir, name));
1681
1685
  this.onArtifactWrite?.(name, content);
1682
1686
  }
1683
- /** Copy each asset() specifier's bytes into `assets/` under a
1684
- * content-hashed name and substitute a url relative to styles.css. */
1685
- substituteAssetReferences(globalCss, pruneSuperseded) {
1686
- const specifiers = findAssetSpecifiers(globalCss);
1687
+ /** Copy each asset() specifier's bytes, from every sheet, into `assets/`
1688
+ * under a content-hashed name and substitute a url relative to
1689
+ * styles.css. */
1690
+ substituteAssetReferences(sheets, pruneSuperseded) {
1691
+ const specifiers = findSheetAssetSpecifiers(sheets);
1687
1692
  const assetsDir = join(this.sessionDir, SESSION_ASSETS_DIR);
1688
1693
  const expected = /* @__PURE__ */ new Set();
1689
1694
  this.assetDependencyPaths.clear();
@@ -1728,7 +1733,7 @@ var ExtractionSession = class {
1728
1733
  });
1729
1734
  }
1730
1735
  if (pruneSuperseded) pruneStaleAssets(assetsDir, expected);
1731
- return substituteAssetPlaceholders(globalCss, urlBySpecifier);
1736
+ return substituteSheetAssets(sheets, urlBySpecifier);
1732
1737
  }
1733
1738
  trackAssetDependency(path) {
1734
1739
  this.assetDependencyPaths.add(path);
package/index-v2.js CHANGED
@@ -17,7 +17,7 @@ function loadNative() {
17
17
  `(looked for ${candidates.join(', ')} under crates/extract-v2/). ` +
18
18
  `Published releases ship this binary for darwin-arm64, linux-x64-gnu and ` +
19
19
  `linux-arm64-gnu — reinstall the package to restore it (v2 is the only ` +
20
- `engine; the v1 escape hatch was retired, openspec: retire-extract-v1). ` +
20
+ `engine, so there is no other engine to fall back to). ` +
21
21
  `In the animus workspace, build it with: vp run build:extract-v2.`
22
22
  );
23
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@animus-ui/extract",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "Animus static CSS extraction pipeline (Rust/NAPI)",
5
5
  "keywords": [
6
6
  "animus",
@@ -55,13 +55,13 @@
55
55
  "build:v2:debug": "cd crates/extract-v2 && bunx napi build --platform --no-js"
56
56
  },
57
57
  "dependencies": {
58
- "@animus-ui/properties": "0.1.18",
58
+ "@animus-ui/properties": "0.1.19",
59
59
  "browserslist": "^4.28.8",
60
60
  "lightningcss": "^1.33.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@animus-ui/assertions": "0.1.18",
64
- "@animus-ui/system": "0.1.18",
63
+ "@animus-ui/assertions": "0.1.19",
64
+ "@animus-ui/system": "0.1.19",
65
65
  "@mdx-js/mdx": "3.1.1",
66
66
  "@napi-rs/cli": "^3.10.5",
67
67
  "svelte": "5.57.0"
@@ -1,6 +0,0 @@
1
- export declare const RUST_TIMING_PHASES: ReadonlyArray<readonly [key: string, label: string]>;
2
- export declare function formatRustTimingWaterfall(timing: Record<string, number>, opts: {
3
- indent: string;
4
- labelWidth: number;
5
- }): string[];
6
- //# sourceMappingURL=timing-waterfall.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"timing-waterfall.d.ts","sourceRoot":"","sources":["../../pipeline/timing-waterfall.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,EAAE,aAAa,CAC5C,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAatC,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAC3C,MAAM,EAAE,CAcV"}