@animus-ui/extract 0.1.17 → 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.
- package/README.md +2 -2
- package/crates/extract-v2/animus-extract-v2.darwin-arm64.node +0 -0
- package/crates/extract-v2/animus-extract-v2.linux-arm64-gnu.node +0 -0
- package/crates/extract-v2/animus-extract-v2.linux-x64-gnu.node +0 -0
- package/crates/extract-v2/index.d.ts +5 -0
- package/dist/index.cjs +6 -2
- package/dist/index.mjs +2 -2
- package/dist/pipeline/asset-placeholders.d.ts +19 -0
- package/dist/pipeline/asset-placeholders.d.ts.map +1 -1
- package/dist/pipeline/engine-retirement.d.ts.map +1 -1
- package/dist/pipeline/index.d.ts +3 -3
- package/dist/pipeline/index.d.ts.map +1 -1
- package/dist/pipeline/manifest-diagnostics.d.ts +32 -1
- package/dist/pipeline/manifest-diagnostics.d.ts.map +1 -1
- package/dist/pipeline/manifest-schema.d.ts +5 -2
- package/dist/pipeline/manifest-schema.d.ts.map +1 -1
- package/dist/pipeline/property-diagnostics.d.ts +17 -0
- package/dist/pipeline/property-diagnostics.d.ts.map +1 -0
- package/dist/pipeline/property-registrations.d.ts +23 -0
- package/dist/pipeline/property-registrations.d.ts.map +1 -0
- package/dist/pipeline/run-analysis.d.ts +2 -0
- package/dist/pipeline/run-analysis.d.ts.map +1 -1
- package/dist/pipeline/system-config.d.ts +6 -0
- package/dist/pipeline/system-config.d.ts.map +1 -1
- package/dist/{pipeline-D7TdVERQ.mjs → pipeline-BuiItKT-.mjs} +393 -31
- package/dist/{pipeline-OMz1HGqU.cjs → pipeline-CD2qmEEn.cjs} +420 -34
- package/dist/session/extraction-session.d.ts +3 -5
- package/dist/session/extraction-session.d.ts.map +1 -1
- package/dist/session/timing.d.ts.map +1 -1
- package/dist/session.cjs +20 -20
- package/dist/session.mjs +20 -20
- package/index-v2.js +1 -1
- package/package.json +4 -4
- package/dist/pipeline/timing-waterfall.d.ts +0 -6
- 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-
|
|
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`);
|
|
@@ -611,9 +607,6 @@ var ExtractionSession = class {
|
|
|
611
607
|
options;
|
|
612
608
|
staticCssJson;
|
|
613
609
|
system = null;
|
|
614
|
-
/** Vocabulary witness diagnostics from the sealed system's registration
|
|
615
|
-
* record, awaiting the shared surfacing pass. */
|
|
616
|
-
systemVocabularyDiagnostics = [];
|
|
617
610
|
/** Configured external files that could not be read. Incremental passes
|
|
618
611
|
* re-collect nothing, so they replay these instead of passing strict. */
|
|
619
612
|
ingestionFailureDiagnostics = [];
|
|
@@ -1013,7 +1006,6 @@ var ExtractionSession = class {
|
|
|
1013
1006
|
rootDir,
|
|
1014
1007
|
prefix: this.options.prefix
|
|
1015
1008
|
});
|
|
1016
|
-
this.systemVocabularyDiagnostics = require_pipeline.vocabularyWitnessDiagnostics(this.system.vocabularyWitnessesJson);
|
|
1017
1009
|
this.assetCopyCache.clear();
|
|
1018
1010
|
this.assetDependencyPaths.clear();
|
|
1019
1011
|
this.assetDependencyKeys.clear();
|
|
@@ -1184,7 +1176,6 @@ var ExtractionSession = class {
|
|
|
1184
1176
|
externalFileOwners: this.externalFileOwners,
|
|
1185
1177
|
externalSourceEntries: this.externalSourceEntries,
|
|
1186
1178
|
externalPackageDirs: this.externalPackageDirs,
|
|
1187
|
-
systemVocabularyDiagnostics: this.systemVocabularyDiagnostics,
|
|
1188
1179
|
ingestionFailureDiagnostics: this.ingestionFailureDiagnostics
|
|
1189
1180
|
};
|
|
1190
1181
|
}
|
|
@@ -1356,8 +1347,9 @@ var ExtractionSession = class {
|
|
|
1356
1347
|
const result = require_pipeline.runProjectAnalysis(engineApi, {
|
|
1357
1348
|
...analysisOptions,
|
|
1358
1349
|
warn: (message) => this.warn(message),
|
|
1350
|
+
info: (message) => this.log(message),
|
|
1359
1351
|
strict: this.options.strict,
|
|
1360
|
-
extraDiagnostics:
|
|
1352
|
+
extraDiagnostics: this.ingestionFailureDiagnostics
|
|
1361
1353
|
});
|
|
1362
1354
|
require_pipeline.assertNoErrorDiagnostics(result.manifest?.diagnostics);
|
|
1363
1355
|
require_pipeline.enforceExternalTokenContracts({
|
|
@@ -1378,12 +1370,14 @@ var ExtractionSession = class {
|
|
|
1378
1370
|
bt.analysis = (bt.jsonSerialize ?? 0) + (bt.rustExtract ?? 0) + (bt.jsonParse ?? 0);
|
|
1379
1371
|
if (manifest?.report) this.log(`Extracted ${manifest.report.components_extracted ?? "?"}/${manifest.report.components_total ?? "?"} components (${bt.analysis}ms)`);
|
|
1380
1372
|
}
|
|
1381
|
-
const
|
|
1373
|
+
const sheets = this.substituteAssetReferences({
|
|
1374
|
+
variableCss: system.variableCss,
|
|
1375
|
+
globalCss: result.globalCss,
|
|
1376
|
+
componentCss: result.componentCss
|
|
1377
|
+
}, !devMode || this.staleAssetPruning === "every-cycle");
|
|
1382
1378
|
const { declaration, variables, body } = require_pipeline.assembleStylesheet({
|
|
1383
1379
|
layers: this.options.layers,
|
|
1384
|
-
|
|
1385
|
-
globalCss,
|
|
1386
|
-
componentCss: result.componentCss,
|
|
1380
|
+
...sheets,
|
|
1387
1381
|
split: true
|
|
1388
1382
|
});
|
|
1389
1383
|
if (this.lcssTargets === null) this.lcssTargets = require_pipeline.resolveLightningTargets(this.options.targets, this.rootDir);
|
|
@@ -1396,6 +1390,11 @@ var ExtractionSession = class {
|
|
|
1396
1390
|
warnFn: (msg) => this.warn(msg)
|
|
1397
1391
|
})
|
|
1398
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
|
+
});
|
|
1399
1398
|
setSharedCss(fullCss);
|
|
1400
1399
|
const systemPropsContent = require_pipeline.buildSystemPropsModule({
|
|
1401
1400
|
systemPropMapJson: JSON.stringify(manifest?.system_prop_map ?? {}),
|
|
@@ -1686,10 +1685,11 @@ var ExtractionSession = class {
|
|
|
1686
1685
|
(0, fs.renameSync)(tmpPath, (0, path.join)(dir, name));
|
|
1687
1686
|
this.onArtifactWrite?.(name, content);
|
|
1688
1687
|
}
|
|
1689
|
-
/** Copy each asset() specifier's bytes into `assets/`
|
|
1690
|
-
* content-hashed name and substitute a url relative to
|
|
1691
|
-
|
|
1692
|
-
|
|
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);
|
|
1693
1693
|
const assetsDir = (0, path.join)(this.sessionDir, SESSION_ASSETS_DIR);
|
|
1694
1694
|
const expected = /* @__PURE__ */ new Set();
|
|
1695
1695
|
this.assetDependencyPaths.clear();
|
|
@@ -1734,7 +1734,7 @@ var ExtractionSession = class {
|
|
|
1734
1734
|
});
|
|
1735
1735
|
}
|
|
1736
1736
|
if (pruneSuperseded) pruneStaleAssets(assetsDir, expected);
|
|
1737
|
-
return require_pipeline.
|
|
1737
|
+
return require_pipeline.substituteSheetAssets(sheets, urlBySpecifier);
|
|
1738
1738
|
}
|
|
1739
1739
|
trackAssetDependency(path$8) {
|
|
1740
1740
|
this.assetDependencyPaths.add(path$8);
|
package/dist/session.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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`);
|
|
@@ -610,9 +606,6 @@ var ExtractionSession = class {
|
|
|
610
606
|
options;
|
|
611
607
|
staticCssJson;
|
|
612
608
|
system = null;
|
|
613
|
-
/** Vocabulary witness diagnostics from the sealed system's registration
|
|
614
|
-
* record, awaiting the shared surfacing pass. */
|
|
615
|
-
systemVocabularyDiagnostics = [];
|
|
616
609
|
/** Configured external files that could not be read. Incremental passes
|
|
617
610
|
* re-collect nothing, so they replay these instead of passing strict. */
|
|
618
611
|
ingestionFailureDiagnostics = [];
|
|
@@ -1012,7 +1005,6 @@ var ExtractionSession = class {
|
|
|
1012
1005
|
rootDir,
|
|
1013
1006
|
prefix: this.options.prefix
|
|
1014
1007
|
});
|
|
1015
|
-
this.systemVocabularyDiagnostics = vocabularyWitnessDiagnostics(this.system.vocabularyWitnessesJson);
|
|
1016
1008
|
this.assetCopyCache.clear();
|
|
1017
1009
|
this.assetDependencyPaths.clear();
|
|
1018
1010
|
this.assetDependencyKeys.clear();
|
|
@@ -1183,7 +1175,6 @@ var ExtractionSession = class {
|
|
|
1183
1175
|
externalFileOwners: this.externalFileOwners,
|
|
1184
1176
|
externalSourceEntries: this.externalSourceEntries,
|
|
1185
1177
|
externalPackageDirs: this.externalPackageDirs,
|
|
1186
|
-
systemVocabularyDiagnostics: this.systemVocabularyDiagnostics,
|
|
1187
1178
|
ingestionFailureDiagnostics: this.ingestionFailureDiagnostics
|
|
1188
1179
|
};
|
|
1189
1180
|
}
|
|
@@ -1355,8 +1346,9 @@ var ExtractionSession = class {
|
|
|
1355
1346
|
const result = runProjectAnalysis(engineApi, {
|
|
1356
1347
|
...analysisOptions,
|
|
1357
1348
|
warn: (message) => this.warn(message),
|
|
1349
|
+
info: (message) => this.log(message),
|
|
1358
1350
|
strict: this.options.strict,
|
|
1359
|
-
extraDiagnostics:
|
|
1351
|
+
extraDiagnostics: this.ingestionFailureDiagnostics
|
|
1360
1352
|
});
|
|
1361
1353
|
assertNoErrorDiagnostics(result.manifest?.diagnostics);
|
|
1362
1354
|
enforceExternalTokenContracts({
|
|
@@ -1377,12 +1369,14 @@ var ExtractionSession = class {
|
|
|
1377
1369
|
bt.analysis = (bt.jsonSerialize ?? 0) + (bt.rustExtract ?? 0) + (bt.jsonParse ?? 0);
|
|
1378
1370
|
if (manifest?.report) this.log(`Extracted ${manifest.report.components_extracted ?? "?"}/${manifest.report.components_total ?? "?"} components (${bt.analysis}ms)`);
|
|
1379
1371
|
}
|
|
1380
|
-
const
|
|
1372
|
+
const sheets = this.substituteAssetReferences({
|
|
1373
|
+
variableCss: system.variableCss,
|
|
1374
|
+
globalCss: result.globalCss,
|
|
1375
|
+
componentCss: result.componentCss
|
|
1376
|
+
}, !devMode || this.staleAssetPruning === "every-cycle");
|
|
1381
1377
|
const { declaration, variables, body } = assembleStylesheet({
|
|
1382
1378
|
layers: this.options.layers,
|
|
1383
|
-
|
|
1384
|
-
globalCss,
|
|
1385
|
-
componentCss: result.componentCss,
|
|
1379
|
+
...sheets,
|
|
1386
1380
|
split: true
|
|
1387
1381
|
});
|
|
1388
1382
|
if (this.lcssTargets === null) this.lcssTargets = resolveLightningTargets(this.options.targets, this.rootDir);
|
|
@@ -1395,6 +1389,11 @@ var ExtractionSession = class {
|
|
|
1395
1389
|
warnFn: (msg) => this.warn(msg)
|
|
1396
1390
|
})
|
|
1397
1391
|
].filter(Boolean).join("\n");
|
|
1392
|
+
reportSurvivingAssetPlaceholders(fullCss, {
|
|
1393
|
+
strict: this.options.strict,
|
|
1394
|
+
warn: (message) => this.warn(message),
|
|
1395
|
+
prefix: `[${this.driverLabel}]`
|
|
1396
|
+
});
|
|
1398
1397
|
setSharedCss(fullCss);
|
|
1399
1398
|
const systemPropsContent = buildSystemPropsModule({
|
|
1400
1399
|
systemPropMapJson: JSON.stringify(manifest?.system_prop_map ?? {}),
|
|
@@ -1685,10 +1684,11 @@ var ExtractionSession = class {
|
|
|
1685
1684
|
renameSync(tmpPath, join(dir, name));
|
|
1686
1685
|
this.onArtifactWrite?.(name, content);
|
|
1687
1686
|
}
|
|
1688
|
-
/** Copy each asset() specifier's bytes into `assets/`
|
|
1689
|
-
* content-hashed name and substitute a url relative to
|
|
1690
|
-
|
|
1691
|
-
|
|
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);
|
|
1692
1692
|
const assetsDir = join(this.sessionDir, SESSION_ASSETS_DIR);
|
|
1693
1693
|
const expected = /* @__PURE__ */ new Set();
|
|
1694
1694
|
this.assetDependencyPaths.clear();
|
|
@@ -1733,7 +1733,7 @@ var ExtractionSession = class {
|
|
|
1733
1733
|
});
|
|
1734
1734
|
}
|
|
1735
1735
|
if (pruneSuperseded) pruneStaleAssets(assetsDir, expected);
|
|
1736
|
-
return
|
|
1736
|
+
return substituteSheetAssets(sheets, urlBySpecifier);
|
|
1737
1737
|
}
|
|
1738
1738
|
trackAssetDependency(path) {
|
|
1739
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
|
|
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.
|
|
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.
|
|
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.
|
|
64
|
-
"@animus-ui/system": "0.1.
|
|
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"}
|