@animus-ui/extract 0.1.20 → 0.1.22
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/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 +7 -0
- package/dist/index.cjs +3 -1
- package/dist/index.mjs +2 -2
- package/dist/pipeline/assemble-stylesheet.d.ts +5 -0
- package/dist/pipeline/assemble-stylesheet.d.ts.map +1 -1
- package/dist/pipeline/core-options.d.ts +2 -0
- package/dist/pipeline/core-options.d.ts.map +1 -1
- package/dist/pipeline/discover-packages.d.ts +15 -1
- package/dist/pipeline/discover-packages.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 +18 -2
- package/dist/pipeline/manifest-diagnostics.d.ts.map +1 -1
- package/dist/pipeline/manifest-schema.d.ts +6 -0
- package/dist/pipeline/manifest-schema.d.ts.map +1 -1
- package/dist/pipeline/post-process-css.d.ts.map +1 -1
- package/dist/pipeline/property-diagnostics.d.ts +5 -4
- package/dist/pipeline/property-diagnostics.d.ts.map +1 -1
- package/dist/pipeline/property-names.d.ts +4 -14
- package/dist/pipeline/property-names.d.ts.map +1 -1
- package/dist/pipeline/property-registrations.d.ts +5 -4
- package/dist/pipeline/property-registrations.d.ts.map +1 -1
- package/dist/pipeline/structural-self-check.d.ts +3 -0
- package/dist/pipeline/structural-self-check.d.ts.map +1 -1
- package/dist/pipeline/tsconfig-paths.d.ts +14 -0
- package/dist/pipeline/tsconfig-paths.d.ts.map +1 -1
- package/dist/{pipeline-6wmD00rr.mjs → pipeline-BXY7Pf_D.mjs} +846 -528
- package/dist/{pipeline-A54wEQEg.cjs → pipeline-D7B1z0-1.cjs} +875 -527
- package/dist/session/extraction-session.d.ts +5 -0
- package/dist/session/extraction-session.d.ts.map +1 -1
- package/dist/session/index.d.ts +1 -1
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/resolve-packages.d.ts.map +1 -1
- package/dist/session/singleton.d.ts +5 -1
- package/dist/session/singleton.d.ts.map +1 -1
- package/dist/session.cjs +90 -3
- package/dist/session.mjs +91 -5
- package/package.json +4 -4
|
@@ -42,6 +42,9 @@ export declare class ExtractionSession {
|
|
|
42
42
|
private externalFileOwners;
|
|
43
43
|
/** External package specifier → absolute source entry path. */
|
|
44
44
|
externalSourceEntries: Map<string, string>;
|
|
45
|
+
/** Specifier → its source entry's side effects, from the owning package's
|
|
46
|
+
* `sideEffects`; absent leaves the bundler's own classification. */
|
|
47
|
+
externalSourceSideEffects: Map<string, boolean>;
|
|
45
48
|
/** SourceId authority for this generation — roots realpath'd once per
|
|
46
49
|
* pipeline; aliases recorded while files exist so deletions resolve. */
|
|
47
50
|
private sourceIdentity;
|
|
@@ -143,6 +146,8 @@ export declare class ExtractionSession {
|
|
|
143
146
|
/** Component count of the last published analysis, null before the first —
|
|
144
147
|
* read by drivers instead of re-parsing the manifest JSON every cycle. */
|
|
145
148
|
lastComponentCount: number | null;
|
|
149
|
+
/** The loaded theme's token → variable map; null before the system loads. */
|
|
150
|
+
get variableMapJson(): string | null;
|
|
146
151
|
/** When superseded asset copies leave `assets/`: `'full-pipeline'` suits a
|
|
147
152
|
* driver serving the dir in place, `'every-cycle'` one republishing it. */
|
|
148
153
|
staleAssetPruning: 'full-pipeline' | 'every-cycle';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extraction-session.d.ts","sourceRoot":"","sources":["../../session/extraction-session.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extraction-session.d.ts","sourceRoot":"","sources":["../../session/extraction-session.ts"],"names":[],"mappings":"AA8GA,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;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uB;IAoB/B;4EACwE;IACxE,OAAO,CAAC,cAAc,CAAuD;IAE7E;;;6EAGyE;IACzE,OAAO,CAAC,sBAAsB;IAqD9B;;;uEAGmE;IACnE,OAAO,CAAC,mBAAmB;IAa3B;0DACsD;IACtD,OAAO,CAAC,cAAc;IAetB;gFAC4E;IAC5E,OAAO,CAAC,kBAAkB;IAQ1B;+DAC2D;IAC3D,OAAO,CAAC,sBAAsB;IAqD9B;gFAC4E;IAC5E,OAAO,CAAC,oBAAoB;IAU5B;;sBAEkB;IAClB,OAAO,CAAC,yBAAyB;IAwEjC,OAAO,CAAC,oBAAoB;IAK5B;iEAC6D;IAC7D,OAAO,CAAC,qBAAqB;CA0B9B;AAED;uEACuE;AACvE,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,GAC5B,IAAI,CAgBN"}
|
package/dist/session/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ export { analysisCommitPath, analysisInputsPath, analysisStatusPath, ANIMUS_ARTI
|
|
|
6
6
|
export type { AnalysisCommit, AnalysisStatus, SessionEnvelope, } from './session-paths';
|
|
7
7
|
export { runSessionPipeline, startTurbopackWatcher, } from './turbopack-orchestrator';
|
|
8
8
|
export type { TurbopackWatcherHandle, TurbopackWatchOutcome, } from './turbopack-orchestrator';
|
|
9
|
-
export { engineApi, getAnalysisStartedPromise, getAnalyzedHashes, getManifestJson, getReplacementEpoch, getSessionArtifactDir, getSharedCss, getSharedExternalDirs, getSharedExternalEntries, getSharedSystemProps, resetAnalysisStartedPromise, setAnalysisStartedPromise, setSharedEngine, } from './singleton';
|
|
9
|
+
export { engineApi, getAnalysisStartedPromise, getAnalyzedHashes, getManifestJson, getReplacementEpoch, getSessionArtifactDir, getSharedCss, getSharedExternalDirs, getSharedExternalEntries, getSharedExternalSideEffects, getSharedSystemProps, resetAnalysisStartedPromise, setAnalysisStartedPromise, setSharedEngine, } from './singleton';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../session/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,YAAY,EACV,WAAW,EACX,cAAc,EACd,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAAiB,EACjB,8BAA8B,EAC9B,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,SAAS,EACT,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,2BAA2B,EAC3B,yBAAyB,EACzB,eAAe,GAChB,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../session/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,YAAY,EACV,WAAW,EACX,cAAc,EACd,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,iBAAiB,EACjB,8BAA8B,EAC9B,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,qBAAqB,EACrB,eAAe,EACf,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,SAAS,EACT,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,wBAAwB,EACxB,4BAA4B,EAC5B,oBAAoB,EACpB,2BAA2B,EAC3B,yBAAyB,EACzB,eAAe,GAChB,MAAM,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-packages.d.ts","sourceRoot":"","sources":["../../session/resolve-packages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve-packages.d.ts","sourceRoot":"","sources":["../../session/resolve-packages.ts"],"names":[],"mappings":"AAQA;2DAC2D;AAC3D,MAAM,WAAW,kBAAkB;IACjC,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B;AAuFD,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EAAE,GACd,kBAAkB,CAsDpB"}
|
|
@@ -15,6 +15,10 @@ export declare function getSharedExternalDirs(): string[];
|
|
|
15
15
|
export declare function setSharedExternalDirs(dirs: string[]): void;
|
|
16
16
|
export declare function getSharedExternalEntries(): Map<string, string>;
|
|
17
17
|
export declare function setSharedExternalEntries(entries: Map<string, string>): void;
|
|
18
|
+
/** Specifier → its source entry's side effects, published with the shared
|
|
19
|
+
* entries; absent leaves the bundler's own classification. */
|
|
20
|
+
export declare function getSharedExternalSideEffects(): Map<string, boolean>;
|
|
21
|
+
export declare function setSharedExternalSideEffects(sideEffects: Map<string, boolean>): void;
|
|
18
22
|
/** Structural view of the target session, declared here rather than imported
|
|
19
23
|
* so the singleton never depends on the session module it serves. */
|
|
20
24
|
export interface WatchBatchTarget {
|
|
@@ -81,5 +85,5 @@ export declare function engineApi(): any;
|
|
|
81
85
|
* Every globalThis key this module owns except the engine-api override, which
|
|
82
86
|
* a per-test reset must not clear. Test harnesses clear exactly this list.
|
|
83
87
|
*/
|
|
84
|
-
export declare const SINGLETON_GLOBAL_KEYS: readonly ["__animus_manifest_json__", "__animus_analysis_started__", "__animus_shared_css__", "__animus_shared_system_props__", "__animus_external_pkg_dirs__", "__animus_external_source_entries__", "__animus_analyzed_hashes__", "__animus_replacement_epoch__", "__animus_watch_transaction__", "__animus_process_session_id__", "__animus_session_artifact_dir__", "__animus_owning_watch_session__", "__animus_exclusive_session_owner__", "__animus_engine__", "__animus_v2_engine__", "__animus_v2_sent_sources__", "__animus_v2_drift_warned__"];
|
|
88
|
+
export declare const SINGLETON_GLOBAL_KEYS: readonly ["__animus_manifest_json__", "__animus_analysis_started__", "__animus_shared_css__", "__animus_shared_system_props__", "__animus_external_pkg_dirs__", "__animus_external_source_entries__", "__animus_external_side_effects__", "__animus_analyzed_hashes__", "__animus_replacement_epoch__", "__animus_watch_transaction__", "__animus_process_session_id__", "__animus_session_artifact_dir__", "__animus_owning_watch_session__", "__animus_exclusive_session_owner__", "__animus_engine__", "__animus_v2_engine__", "__animus_v2_sent_sources__", "__animus_v2_drift_warned__"];
|
|
85
89
|
//# sourceMappingURL=singleton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../session/singleton.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../session/singleton.ts"],"names":[],"mappings":"AAoEA,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAE/C;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAElD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAEhE;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAEtE;AAED,wBAAgB,2BAA2B,IAAI,IAAI,CAElD;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE1D;AAED,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAE1D;AA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,GAAG,IAAI,CAEnD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEvD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAE1D;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,CAE3E;AAED,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC;AAEhC;uDACuD;AACvD,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAE1D;AAED,wBAAgB,eAAe,IAAI,YAAY,CAI9C;AAED;oEACoE;AAEpE,wBAAgB,aAAa,IAAI,GAAG,CAGnC;AA6BD;;;GAGG;AAEH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAElE;AAGD,wBAAgB,SAAS,IAAI,GAAG,CAG/B;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,+jBAmBxB,CAAC"}
|
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-D7B1z0-1.cjs");
|
|
3
3
|
let crypto = require("crypto");
|
|
4
4
|
let fs = require("fs");
|
|
5
5
|
let path = require("path");
|
|
@@ -258,6 +258,68 @@ function collectSessionAssets(sessionDir) {
|
|
|
258
258
|
}
|
|
259
259
|
//#endregion
|
|
260
260
|
//#region session/resolve-packages.ts
|
|
261
|
+
/** An exports target under the `import` condition, then `default`, as the
|
|
262
|
+
* system loader reads it; an array offers its targets in order. */
|
|
263
|
+
function importTarget(value) {
|
|
264
|
+
if (require_pipeline.isJsonString(value)) return value;
|
|
265
|
+
if (Array.isArray(value)) {
|
|
266
|
+
for (const entry of value) {
|
|
267
|
+
const target = importTarget(entry);
|
|
268
|
+
if (target !== null) return target;
|
|
269
|
+
}
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
if (!require_pipeline.isJsonBlock(value)) return null;
|
|
273
|
+
return importTarget(value.import) ?? importTarget(value.default);
|
|
274
|
+
}
|
|
275
|
+
/** The exports entry for `subpath`: an exact key answers alone; otherwise
|
|
276
|
+
* the pattern with the longest prefix, then the longest suffix, wins. */
|
|
277
|
+
function exportsTarget(exports, subpath) {
|
|
278
|
+
const map = require_pipeline.isJsonBlock(exports) && Object.keys(exports).some((k) => k.startsWith(".")) ? exports : { ".": exports };
|
|
279
|
+
if (subpath in map) return importTarget(map[subpath]);
|
|
280
|
+
let best = null;
|
|
281
|
+
for (const [pattern, value] of Object.entries(map)) {
|
|
282
|
+
const star = pattern.indexOf("*");
|
|
283
|
+
if (star === -1 || pattern.indexOf("*", star + 1) !== -1) continue;
|
|
284
|
+
const prefix = pattern.slice(0, star);
|
|
285
|
+
const suffix = pattern.slice(star + 1);
|
|
286
|
+
if (!subpath.startsWith(prefix) || !subpath.endsWith(suffix) || subpath.length < prefix.length + suffix.length) continue;
|
|
287
|
+
if (!best || prefix.length > best.prefix.length || prefix.length === best.prefix.length && suffix.length > best.suffix.length) best = {
|
|
288
|
+
prefix,
|
|
289
|
+
suffix,
|
|
290
|
+
value
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
if (!best) return null;
|
|
294
|
+
const matched = subpath.slice(best.prefix.length, subpath.length - best.suffix.length);
|
|
295
|
+
return importTarget(best.value)?.replaceAll("*", matched) ?? null;
|
|
296
|
+
}
|
|
297
|
+
/** The entry an ES import of `name` resolves to through the package's
|
|
298
|
+
* `exports`, under the `import` condition, then `default`: what the Vite
|
|
299
|
+
* host and the system loader resolve. Null without an `exports` field, or
|
|
300
|
+
* when no target exists. */
|
|
301
|
+
function resolveImportEntry(rootDir, name) {
|
|
302
|
+
const packageName = name.split("/").slice(0, name.startsWith("@") ? 2 : 1).join("/");
|
|
303
|
+
const subpath = `.${name.slice(packageName.length)}`;
|
|
304
|
+
for (let dir = rootDir;; dir = (0, path.dirname)(dir)) {
|
|
305
|
+
const manifest = (0, path.join)(dir, "node_modules", packageName, "package.json");
|
|
306
|
+
if ((0, fs.existsSync)(manifest)) {
|
|
307
|
+
let exports;
|
|
308
|
+
try {
|
|
309
|
+
const parsed = require_pipeline.parseInternalWire((0, fs.readFileSync)(manifest, "utf-8"), `${manifest} (a package manifest)`);
|
|
310
|
+
exports = require_pipeline.isJsonBlock(parsed) ? parsed.exports : void 0;
|
|
311
|
+
} catch {
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
if (exports === void 0 || exports === null) return null;
|
|
315
|
+
const target = exportsTarget(exports, subpath);
|
|
316
|
+
if (target === null) return null;
|
|
317
|
+
const entryPath = (0, path.resolve)((0, path.dirname)(manifest), target);
|
|
318
|
+
return (0, fs.existsSync)(entryPath) ? (0, fs.realpathSync)(entryPath) : null;
|
|
319
|
+
}
|
|
320
|
+
if (dir === (0, path.dirname)(dir)) return null;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
261
323
|
function resolvePackagesByName(rootDir, names) {
|
|
262
324
|
if (names.length === 0) return {};
|
|
263
325
|
const nameSet = new Set(names);
|
|
@@ -285,6 +347,11 @@ function resolvePackagesByName(rootDir, names) {
|
|
|
285
347
|
} catch {}
|
|
286
348
|
for (const name of nameSet) {
|
|
287
349
|
if (resolved.has(name)) continue;
|
|
350
|
+
const importEntry = resolveImportEntry(rootDir, name);
|
|
351
|
+
if (importEntry !== null) {
|
|
352
|
+
packageMap[name] = (0, path.relative)(rootDir, importEntry);
|
|
353
|
+
continue;
|
|
354
|
+
}
|
|
288
355
|
try {
|
|
289
356
|
const entryPath = require.resolve(name, { paths: [rootDir] });
|
|
290
357
|
packageMap[name] = (0, path.relative)(rootDir, entryPath);
|
|
@@ -304,6 +371,7 @@ const SHARED_CSS_KEY = "__animus_shared_css__";
|
|
|
304
371
|
const SHARED_SYSTEM_PROPS_KEY = "__animus_shared_system_props__";
|
|
305
372
|
const SHARED_EXTERNAL_DIRS_KEY = "__animus_external_pkg_dirs__";
|
|
306
373
|
const SHARED_EXTERNAL_ENTRIES_KEY = "__animus_external_source_entries__";
|
|
374
|
+
const SHARED_EXTERNAL_SIDE_EFFECTS_KEY = "__animus_external_side_effects__";
|
|
307
375
|
const ANALYZED_HASHES_KEY = "__animus_analyzed_hashes__";
|
|
308
376
|
const REPLACEMENT_EPOCH_KEY = "__animus_replacement_epoch__";
|
|
309
377
|
const WATCH_TRANSACTION_KEY = "__animus_watch_transaction__";
|
|
@@ -369,6 +437,14 @@ function getSharedExternalEntries() {
|
|
|
369
437
|
function setSharedExternalEntries(entries) {
|
|
370
438
|
singletonStore[SHARED_EXTERNAL_ENTRIES_KEY] = entries;
|
|
371
439
|
}
|
|
440
|
+
/** Specifier → its source entry's side effects, published with the shared
|
|
441
|
+
* entries; absent leaves the bundler's own classification. */
|
|
442
|
+
function getSharedExternalSideEffects() {
|
|
443
|
+
return singletonStore[SHARED_EXTERNAL_SIDE_EFFECTS_KEY] || /* @__PURE__ */ new Map();
|
|
444
|
+
}
|
|
445
|
+
function setSharedExternalSideEffects(sideEffects) {
|
|
446
|
+
singletonStore[SHARED_EXTERNAL_SIDE_EFFECTS_KEY] = sideEffects;
|
|
447
|
+
}
|
|
372
448
|
function globalSlot(key) {
|
|
373
449
|
return {
|
|
374
450
|
get: () => singletonStore[key] ?? null,
|
|
@@ -577,6 +653,9 @@ var ExtractionSession = class {
|
|
|
577
653
|
externalFileOwners = {};
|
|
578
654
|
/** External package specifier → absolute source entry path. */
|
|
579
655
|
externalSourceEntries = /* @__PURE__ */ new Map();
|
|
656
|
+
/** Specifier → its source entry's side effects, from the owning package's
|
|
657
|
+
* `sideEffects`; absent leaves the bundler's own classification. */
|
|
658
|
+
externalSourceSideEffects = /* @__PURE__ */ new Map();
|
|
580
659
|
/** SourceId authority for this generation — roots realpath'd once per
|
|
581
660
|
* pipeline; aliases recorded while files exist so deletions resolve. */
|
|
582
661
|
sourceIdentity = null;
|
|
@@ -705,6 +784,10 @@ var ExtractionSession = class {
|
|
|
705
784
|
/** Component count of the last published analysis, null before the first —
|
|
706
785
|
* read by drivers instead of re-parsing the manifest JSON every cycle. */
|
|
707
786
|
lastComponentCount = null;
|
|
787
|
+
/** The loaded theme's token → variable map; null before the system loads. */
|
|
788
|
+
get variableMapJson() {
|
|
789
|
+
return this.system?.variableMapJson ?? null;
|
|
790
|
+
}
|
|
708
791
|
/** When superseded asset copies leave `assets/`: `'full-pipeline'` suits a
|
|
709
792
|
* driver serving the dir in place, `'every-cycle'` one republishing it. */
|
|
710
793
|
staleAssetPruning = "full-pipeline";
|
|
@@ -1063,7 +1146,7 @@ var ExtractionSession = class {
|
|
|
1063
1146
|
}
|
|
1064
1147
|
bt.fileRead = this.elapsed(t);
|
|
1065
1148
|
t = this.now();
|
|
1066
|
-
const packageNames = require_pipeline.extractSystemFilePackages(resolvedSystemPath);
|
|
1149
|
+
const packageNames = require_pipeline.extractSystemFilePackages(resolvedSystemPath, require_pipeline.engineImportParser(engineApi()));
|
|
1067
1150
|
const preResolved = resolvePackagesByName(rootDir, packageNames);
|
|
1068
1151
|
const rawExternalFiles = /* @__PURE__ */ new Map();
|
|
1069
1152
|
const collected = await require_pipeline.collectExternalPackageSources({
|
|
@@ -1090,7 +1173,7 @@ var ExtractionSession = class {
|
|
|
1090
1173
|
});
|
|
1091
1174
|
this.lastExternalOutcomes = collected.outcomes;
|
|
1092
1175
|
this.ingestionFailureDiagnostics = ingestionFailures;
|
|
1093
|
-
|
|
1176
|
+
require_pipeline.surfaceManifestDiagnostics({ diagnostics: require_pipeline.noKitFilesDiagnostics(collected.outcomes) }, (message) => this.warn(message));
|
|
1094
1177
|
const unresolvableMessage = require_pipeline.unresolvableIncludesMessage(collected.outcomes);
|
|
1095
1178
|
if (unresolvableMessage !== null) {
|
|
1096
1179
|
if (this.options.strict) throw new Error(unresolvableMessage);
|
|
@@ -1149,6 +1232,7 @@ var ExtractionSession = class {
|
|
|
1149
1232
|
this.externalDirOwners = require_pipeline.firstOwners(admitted.dirOwnerSets);
|
|
1150
1233
|
this.externalFileOwners = admitted.fileOwners;
|
|
1151
1234
|
this.externalSourceEntries = admitted.sourceEntries;
|
|
1235
|
+
this.externalSourceSideEffects = admitted.sourceEntrySideEffects;
|
|
1152
1236
|
for (const entry of admitted.entries) {
|
|
1153
1237
|
const hash = require_pipeline.contentHash(entry.source);
|
|
1154
1238
|
rawEntries.push({
|
|
@@ -1177,6 +1261,7 @@ var ExtractionSession = class {
|
|
|
1177
1261
|
this.publishSourceIngestion(accepted);
|
|
1178
1262
|
setSharedExternalDirs(admitted.packageDirs);
|
|
1179
1263
|
setSharedExternalEntries(admitted.sourceEntries);
|
|
1264
|
+
setSharedExternalSideEffects(admitted.sourceEntrySideEffects);
|
|
1180
1265
|
this.onExternalRootsCommitted?.(this.externalWatchRoots);
|
|
1181
1266
|
setOwningWatchSession(this);
|
|
1182
1267
|
} catch (err) {
|
|
@@ -1197,6 +1282,7 @@ var ExtractionSession = class {
|
|
|
1197
1282
|
externalDirOwners: this.externalDirOwners,
|
|
1198
1283
|
externalFileOwners: this.externalFileOwners,
|
|
1199
1284
|
externalSourceEntries: this.externalSourceEntries,
|
|
1285
|
+
externalSourceSideEffects: this.externalSourceSideEffects,
|
|
1200
1286
|
externalPackageDirs: this.externalPackageDirs,
|
|
1201
1287
|
ingestionFailureDiagnostics: this.ingestionFailureDiagnostics
|
|
1202
1288
|
};
|
|
@@ -2047,6 +2133,7 @@ exports.getSessionArtifactDir = getSessionArtifactDir;
|
|
|
2047
2133
|
exports.getSharedCss = getSharedCss;
|
|
2048
2134
|
exports.getSharedExternalDirs = getSharedExternalDirs;
|
|
2049
2135
|
exports.getSharedExternalEntries = getSharedExternalEntries;
|
|
2136
|
+
exports.getSharedExternalSideEffects = getSharedExternalSideEffects;
|
|
2050
2137
|
exports.getSharedSystemProps = getSharedSystemProps;
|
|
2051
2138
|
exports.holdDirectoryClaim = holdDirectoryClaim;
|
|
2052
2139
|
exports.isLockHolderAlive = isLockHolderAlive;
|
package/dist/session.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as createSourceCorpus, At as contentHash, B as unresolvableIncludesMessage, Ct as noKitFilesDiagnostics, D as reportSurvivingAssetPlaceholders, E as generatedModuleCode, Et as unreadableSourceDiagnostic, F as findPackageRoot, G as createSourceIdentity, H as isJsonBlock, I as firstOwners, It as __require, K as isPathWithinRoot, L as isExcludedPackageRelativePath, M as engineImportParser, N as excludeCollectedPackages, Nt as assembleStylesheet, P as extractSystemFilePackages, S as resolveAssetFile, T as findSheetAssetSpecifiers, U as isJsonString, V as walkPackageSources, Y as discoverFiles, a as assertNoErrorDiagnostics, at as resolveVerbosity, ct as createV2EngineApi, d as serializeStaticCss, ft as projectExternalFileOwners, g as runProjectAnalysis, h as clearEngineCache, i as snapshotFilePlans, it as resolveMode, j as collectExternalPackageSources, k as substituteSheetAssets, kt as parseInternalWire, l as loadSystemConfig, mt as DEFAULT_EXTENSIONS, o as buildSystemPropsModule, q as sharesVolumeRoot, r as hashReplacementPlans, rt as createExcludeMatcher, t as toWatchKeys, v as postProcessCss, wt as surfaceManifestDiagnostics, x as enforceExternalTokenContracts, xt as isDeletedSource, y as resolveLightningTargets, z as staleDistIncludesMessage } from "./pipeline-BXY7Pf_D.mjs";
|
|
2
2
|
import { randomUUID } from "crypto";
|
|
3
3
|
import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, watch, writeFileSync } from "fs";
|
|
4
|
-
import { basename, extname, isAbsolute, join, relative, resolve } from "path";
|
|
4
|
+
import { basename, dirname, extname, isAbsolute, join, relative, resolve } from "path";
|
|
5
5
|
//#region session/session-paths.ts
|
|
6
6
|
/**
|
|
7
7
|
* Session artifact names, path derivations, and artifact shapes. Imports no
|
|
@@ -257,6 +257,68 @@ function collectSessionAssets(sessionDir) {
|
|
|
257
257
|
}
|
|
258
258
|
//#endregion
|
|
259
259
|
//#region session/resolve-packages.ts
|
|
260
|
+
/** An exports target under the `import` condition, then `default`, as the
|
|
261
|
+
* system loader reads it; an array offers its targets in order. */
|
|
262
|
+
function importTarget(value) {
|
|
263
|
+
if (isJsonString(value)) return value;
|
|
264
|
+
if (Array.isArray(value)) {
|
|
265
|
+
for (const entry of value) {
|
|
266
|
+
const target = importTarget(entry);
|
|
267
|
+
if (target !== null) return target;
|
|
268
|
+
}
|
|
269
|
+
return null;
|
|
270
|
+
}
|
|
271
|
+
if (!isJsonBlock(value)) return null;
|
|
272
|
+
return importTarget(value.import) ?? importTarget(value.default);
|
|
273
|
+
}
|
|
274
|
+
/** The exports entry for `subpath`: an exact key answers alone; otherwise
|
|
275
|
+
* the pattern with the longest prefix, then the longest suffix, wins. */
|
|
276
|
+
function exportsTarget(exports, subpath) {
|
|
277
|
+
const map = isJsonBlock(exports) && Object.keys(exports).some((k) => k.startsWith(".")) ? exports : { ".": exports };
|
|
278
|
+
if (subpath in map) return importTarget(map[subpath]);
|
|
279
|
+
let best = null;
|
|
280
|
+
for (const [pattern, value] of Object.entries(map)) {
|
|
281
|
+
const star = pattern.indexOf("*");
|
|
282
|
+
if (star === -1 || pattern.indexOf("*", star + 1) !== -1) continue;
|
|
283
|
+
const prefix = pattern.slice(0, star);
|
|
284
|
+
const suffix = pattern.slice(star + 1);
|
|
285
|
+
if (!subpath.startsWith(prefix) || !subpath.endsWith(suffix) || subpath.length < prefix.length + suffix.length) continue;
|
|
286
|
+
if (!best || prefix.length > best.prefix.length || prefix.length === best.prefix.length && suffix.length > best.suffix.length) best = {
|
|
287
|
+
prefix,
|
|
288
|
+
suffix,
|
|
289
|
+
value
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
if (!best) return null;
|
|
293
|
+
const matched = subpath.slice(best.prefix.length, subpath.length - best.suffix.length);
|
|
294
|
+
return importTarget(best.value)?.replaceAll("*", matched) ?? null;
|
|
295
|
+
}
|
|
296
|
+
/** The entry an ES import of `name` resolves to through the package's
|
|
297
|
+
* `exports`, under the `import` condition, then `default`: what the Vite
|
|
298
|
+
* host and the system loader resolve. Null without an `exports` field, or
|
|
299
|
+
* when no target exists. */
|
|
300
|
+
function resolveImportEntry(rootDir, name) {
|
|
301
|
+
const packageName = name.split("/").slice(0, name.startsWith("@") ? 2 : 1).join("/");
|
|
302
|
+
const subpath = `.${name.slice(packageName.length)}`;
|
|
303
|
+
for (let dir = rootDir;; dir = dirname(dir)) {
|
|
304
|
+
const manifest = join(dir, "node_modules", packageName, "package.json");
|
|
305
|
+
if (existsSync(manifest)) {
|
|
306
|
+
let exports;
|
|
307
|
+
try {
|
|
308
|
+
const parsed = parseInternalWire(readFileSync(manifest, "utf-8"), `${manifest} (a package manifest)`);
|
|
309
|
+
exports = isJsonBlock(parsed) ? parsed.exports : void 0;
|
|
310
|
+
} catch {
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
if (exports === void 0 || exports === null) return null;
|
|
314
|
+
const target = exportsTarget(exports, subpath);
|
|
315
|
+
if (target === null) return null;
|
|
316
|
+
const entryPath = resolve(dirname(manifest), target);
|
|
317
|
+
return existsSync(entryPath) ? realpathSync(entryPath) : null;
|
|
318
|
+
}
|
|
319
|
+
if (dir === dirname(dir)) return null;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
260
322
|
function resolvePackagesByName(rootDir, names) {
|
|
261
323
|
if (names.length === 0) return {};
|
|
262
324
|
const nameSet = new Set(names);
|
|
@@ -284,6 +346,11 @@ function resolvePackagesByName(rootDir, names) {
|
|
|
284
346
|
} catch {}
|
|
285
347
|
for (const name of nameSet) {
|
|
286
348
|
if (resolved.has(name)) continue;
|
|
349
|
+
const importEntry = resolveImportEntry(rootDir, name);
|
|
350
|
+
if (importEntry !== null) {
|
|
351
|
+
packageMap[name] = relative(rootDir, importEntry);
|
|
352
|
+
continue;
|
|
353
|
+
}
|
|
287
354
|
try {
|
|
288
355
|
const entryPath = __require.resolve(name, { paths: [rootDir] });
|
|
289
356
|
packageMap[name] = relative(rootDir, entryPath);
|
|
@@ -303,6 +370,7 @@ const SHARED_CSS_KEY = "__animus_shared_css__";
|
|
|
303
370
|
const SHARED_SYSTEM_PROPS_KEY = "__animus_shared_system_props__";
|
|
304
371
|
const SHARED_EXTERNAL_DIRS_KEY = "__animus_external_pkg_dirs__";
|
|
305
372
|
const SHARED_EXTERNAL_ENTRIES_KEY = "__animus_external_source_entries__";
|
|
373
|
+
const SHARED_EXTERNAL_SIDE_EFFECTS_KEY = "__animus_external_side_effects__";
|
|
306
374
|
const ANALYZED_HASHES_KEY = "__animus_analyzed_hashes__";
|
|
307
375
|
const REPLACEMENT_EPOCH_KEY = "__animus_replacement_epoch__";
|
|
308
376
|
const WATCH_TRANSACTION_KEY = "__animus_watch_transaction__";
|
|
@@ -368,6 +436,14 @@ function getSharedExternalEntries() {
|
|
|
368
436
|
function setSharedExternalEntries(entries) {
|
|
369
437
|
singletonStore[SHARED_EXTERNAL_ENTRIES_KEY] = entries;
|
|
370
438
|
}
|
|
439
|
+
/** Specifier → its source entry's side effects, published with the shared
|
|
440
|
+
* entries; absent leaves the bundler's own classification. */
|
|
441
|
+
function getSharedExternalSideEffects() {
|
|
442
|
+
return singletonStore[SHARED_EXTERNAL_SIDE_EFFECTS_KEY] || /* @__PURE__ */ new Map();
|
|
443
|
+
}
|
|
444
|
+
function setSharedExternalSideEffects(sideEffects) {
|
|
445
|
+
singletonStore[SHARED_EXTERNAL_SIDE_EFFECTS_KEY] = sideEffects;
|
|
446
|
+
}
|
|
371
447
|
function globalSlot(key) {
|
|
372
448
|
return {
|
|
373
449
|
get: () => singletonStore[key] ?? null,
|
|
@@ -576,6 +652,9 @@ var ExtractionSession = class {
|
|
|
576
652
|
externalFileOwners = {};
|
|
577
653
|
/** External package specifier → absolute source entry path. */
|
|
578
654
|
externalSourceEntries = /* @__PURE__ */ new Map();
|
|
655
|
+
/** Specifier → its source entry's side effects, from the owning package's
|
|
656
|
+
* `sideEffects`; absent leaves the bundler's own classification. */
|
|
657
|
+
externalSourceSideEffects = /* @__PURE__ */ new Map();
|
|
579
658
|
/** SourceId authority for this generation — roots realpath'd once per
|
|
580
659
|
* pipeline; aliases recorded while files exist so deletions resolve. */
|
|
581
660
|
sourceIdentity = null;
|
|
@@ -704,6 +783,10 @@ var ExtractionSession = class {
|
|
|
704
783
|
/** Component count of the last published analysis, null before the first —
|
|
705
784
|
* read by drivers instead of re-parsing the manifest JSON every cycle. */
|
|
706
785
|
lastComponentCount = null;
|
|
786
|
+
/** The loaded theme's token → variable map; null before the system loads. */
|
|
787
|
+
get variableMapJson() {
|
|
788
|
+
return this.system?.variableMapJson ?? null;
|
|
789
|
+
}
|
|
707
790
|
/** When superseded asset copies leave `assets/`: `'full-pipeline'` suits a
|
|
708
791
|
* driver serving the dir in place, `'every-cycle'` one republishing it. */
|
|
709
792
|
staleAssetPruning = "full-pipeline";
|
|
@@ -1062,7 +1145,7 @@ var ExtractionSession = class {
|
|
|
1062
1145
|
}
|
|
1063
1146
|
bt.fileRead = this.elapsed(t);
|
|
1064
1147
|
t = this.now();
|
|
1065
|
-
const packageNames = extractSystemFilePackages(resolvedSystemPath);
|
|
1148
|
+
const packageNames = extractSystemFilePackages(resolvedSystemPath, engineImportParser(engineApi()));
|
|
1066
1149
|
const preResolved = resolvePackagesByName(rootDir, packageNames);
|
|
1067
1150
|
const rawExternalFiles = /* @__PURE__ */ new Map();
|
|
1068
1151
|
const collected = await collectExternalPackageSources({
|
|
@@ -1089,7 +1172,7 @@ var ExtractionSession = class {
|
|
|
1089
1172
|
});
|
|
1090
1173
|
this.lastExternalOutcomes = collected.outcomes;
|
|
1091
1174
|
this.ingestionFailureDiagnostics = ingestionFailures;
|
|
1092
|
-
|
|
1175
|
+
surfaceManifestDiagnostics({ diagnostics: noKitFilesDiagnostics(collected.outcomes) }, (message) => this.warn(message));
|
|
1093
1176
|
const unresolvableMessage = unresolvableIncludesMessage(collected.outcomes);
|
|
1094
1177
|
if (unresolvableMessage !== null) {
|
|
1095
1178
|
if (this.options.strict) throw new Error(unresolvableMessage);
|
|
@@ -1148,6 +1231,7 @@ var ExtractionSession = class {
|
|
|
1148
1231
|
this.externalDirOwners = firstOwners(admitted.dirOwnerSets);
|
|
1149
1232
|
this.externalFileOwners = admitted.fileOwners;
|
|
1150
1233
|
this.externalSourceEntries = admitted.sourceEntries;
|
|
1234
|
+
this.externalSourceSideEffects = admitted.sourceEntrySideEffects;
|
|
1151
1235
|
for (const entry of admitted.entries) {
|
|
1152
1236
|
const hash = contentHash(entry.source);
|
|
1153
1237
|
rawEntries.push({
|
|
@@ -1176,6 +1260,7 @@ var ExtractionSession = class {
|
|
|
1176
1260
|
this.publishSourceIngestion(accepted);
|
|
1177
1261
|
setSharedExternalDirs(admitted.packageDirs);
|
|
1178
1262
|
setSharedExternalEntries(admitted.sourceEntries);
|
|
1263
|
+
setSharedExternalSideEffects(admitted.sourceEntrySideEffects);
|
|
1179
1264
|
this.onExternalRootsCommitted?.(this.externalWatchRoots);
|
|
1180
1265
|
setOwningWatchSession(this);
|
|
1181
1266
|
} catch (err) {
|
|
@@ -1196,6 +1281,7 @@ var ExtractionSession = class {
|
|
|
1196
1281
|
externalDirOwners: this.externalDirOwners,
|
|
1197
1282
|
externalFileOwners: this.externalFileOwners,
|
|
1198
1283
|
externalSourceEntries: this.externalSourceEntries,
|
|
1284
|
+
externalSourceSideEffects: this.externalSourceSideEffects,
|
|
1199
1285
|
externalPackageDirs: this.externalPackageDirs,
|
|
1200
1286
|
ingestionFailureDiagnostics: this.ingestionFailureDiagnostics
|
|
1201
1287
|
};
|
|
@@ -2019,4 +2105,4 @@ function startTurbopackWatcher(session, rootDir, options = {}) {
|
|
|
2019
2105
|
};
|
|
2020
2106
|
}
|
|
2021
2107
|
//#endregion
|
|
2022
|
-
export { ANIMUS_ARTIFACT_DIR, ANIMUS_CSS_MODULE_ID, CLI_COMMIT_ARTIFACT, CLI_LOCK_ARTIFACT, CLI_LOCK_HEARTBEAT_INTERVAL_MS, CLI_LOCK_STALE_AFTER_MS, ExtractionSession, MANIFEST_ARTIFACT, SESSION_ASSETS_DIR, STYLES_ARTIFACT, SYSTEM_PROPS_ARTIFACT, TURBOPACK_SYSTEM_PROPS_ID, analysisCommitPath, analysisInputsPath, analysisStatusPath, checkLockLiveness, collectSessionAssets, decodeCommitRecord, engineApi, getAnalysisStartedPromise, getAnalyzedHashes, getManifestJson, getReplacementEpoch, getSessionArtifactDir, getSharedCss, getSharedExternalDirs, getSharedExternalEntries, getSharedSystemProps, holdDirectoryClaim, isLockHolderAlive, lockRecordBytes, manifestPath, pruneStaleAssets, readCliLockRecord, readJsonEnvelope, replacementEpochPath, resetAnalysisStartedPromise, runSessionPipeline, sessionArtifactDir, setAnalysisStartedPromise, setSharedEngine, startTurbopackWatcher, stylesPath, systemPropsPath, verifyCommitRecord };
|
|
2108
|
+
export { ANIMUS_ARTIFACT_DIR, ANIMUS_CSS_MODULE_ID, CLI_COMMIT_ARTIFACT, CLI_LOCK_ARTIFACT, CLI_LOCK_HEARTBEAT_INTERVAL_MS, CLI_LOCK_STALE_AFTER_MS, ExtractionSession, MANIFEST_ARTIFACT, SESSION_ASSETS_DIR, STYLES_ARTIFACT, SYSTEM_PROPS_ARTIFACT, TURBOPACK_SYSTEM_PROPS_ID, analysisCommitPath, analysisInputsPath, analysisStatusPath, checkLockLiveness, collectSessionAssets, decodeCommitRecord, engineApi, getAnalysisStartedPromise, getAnalyzedHashes, getManifestJson, getReplacementEpoch, getSessionArtifactDir, getSharedCss, getSharedExternalDirs, getSharedExternalEntries, getSharedExternalSideEffects, getSharedSystemProps, holdDirectoryClaim, isLockHolderAlive, lockRecordBytes, manifestPath, pruneStaleAssets, readCliLockRecord, readJsonEnvelope, replacementEpochPath, resetAnalysisStartedPromise, runSessionPipeline, sessionArtifactDir, setAnalysisStartedPromise, setSharedEngine, startTurbopackWatcher, stylesPath, systemPropsPath, verifyCommitRecord };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@animus-ui/extract",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
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.22",
|
|
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.22",
|
|
64
|
+
"@animus-ui/system": "0.1.22",
|
|
65
65
|
"@mdx-js/mdx": "3.1.1",
|
|
66
66
|
"@napi-rs/cli": "^3.10.5",
|
|
67
67
|
"svelte": "5.57.0"
|