@animus-ui/extract 0.1.1-beta.2 → 0.1.2
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 +12 -11
- 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 +22 -0
- package/dist/analyze-project-args.d.ts +50 -0
- package/dist/analyze-project-args.d.ts.map +1 -0
- package/dist/content-hash.d.ts +7 -0
- package/dist/content-hash.d.ts.map +1 -0
- package/dist/discover-files.d.ts +10 -0
- package/dist/discover-files.d.ts.map +1 -0
- package/dist/discover-packages.d.ts +94 -2
- package/dist/discover-packages.d.ts.map +1 -1
- package/dist/dynamic-prop-config.d.ts +23 -0
- package/dist/dynamic-prop-config.d.ts.map +1 -0
- package/dist/engine-adapter.d.ts +95 -0
- package/dist/engine-adapter.d.ts.map +1 -0
- package/dist/engine-retirement.d.ts +22 -0
- package/dist/engine-retirement.d.ts.map +1 -0
- package/dist/index.cjs +927 -179
- package/dist/index.d.ts +26 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +888 -177
- package/dist/manifest-diagnostics.d.ts +17 -0
- package/dist/manifest-diagnostics.d.ts.map +1 -0
- package/dist/path-aliases.d.ts +34 -0
- package/dist/path-aliases.d.ts.map +1 -0
- package/dist/post-process-css.d.ts +17 -0
- package/dist/post-process-css.d.ts.map +1 -0
- package/dist/run-analysis.d.ts +67 -0
- package/dist/run-analysis.d.ts.map +1 -0
- package/dist/static-css.d.ts +25 -0
- package/dist/static-css.d.ts.map +1 -0
- package/dist/system-config.d.ts +44 -0
- package/dist/system-config.d.ts.map +1 -0
- package/dist/system-props-module.d.ts +18 -0
- package/dist/system-props-module.d.ts.map +1 -0
- package/dist/timing-waterfall.d.ts +17 -0
- package/dist/timing-waterfall.d.ts.map +1 -0
- package/dist/tsconfig-paths.d.ts +8 -0
- package/dist/tsconfig-paths.d.ts.map +1 -0
- package/dist/watch-keys.d.ts +12 -0
- package/dist/watch-keys.d.ts.map +1 -0
- package/index-v2.js +6 -5
- package/package.json +14 -35
- package/animus-extract.darwin-arm64.node +0 -0
- package/animus-extract.linux-arm64-gnu.node +0 -0
- package/animus-extract.linux-x64-gnu.node +0 -0
- package/crates/extract-v2/index.js +0 -594
- package/dist/resolve-global-styles.d.ts +0 -25
- package/dist/resolve-global-styles.d.ts.map +0 -1
- package/dist/resolve-transforms.d.ts +0 -9
- package/dist/resolve-transforms.d.ts.map +0 -1
- package/index.d.ts +0 -65
- package/index.js +0 -594
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type ManifestDiagnostic = {
|
|
2
|
+
file: string;
|
|
3
|
+
component: string;
|
|
4
|
+
kind: string;
|
|
5
|
+
message: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Surface extraction-manifest diagnostics through a plugin's warn channel.
|
|
9
|
+
*
|
|
10
|
+
* Single authoritative copy for both extraction plugins. Surfaces `bail`
|
|
11
|
+
* (component not extracted), `skip` (component skipped), and `warn` kinds;
|
|
12
|
+
* unknown kinds stay silent.
|
|
13
|
+
*/
|
|
14
|
+
export declare function surfaceManifestDiagnostics(manifest: {
|
|
15
|
+
diagnostics?: ManifestDiagnostic[];
|
|
16
|
+
}, warn: (message: string) => void): void;
|
|
17
|
+
//# sourceMappingURL=manifest-diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-diagnostics.d.ts","sourceRoot":"","sources":["../pipeline/manifest-diagnostics.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE;IAAE,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAA;CAAE,EAChD,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAC9B,IAAI,CAYN"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path-alias normalization for the Rust-facing `pathAliasesJson` contract.
|
|
3
|
+
*
|
|
4
|
+
* This is the single authoritative encoder of the wire format
|
|
5
|
+
* `{ aliases: [{ pattern, replacement, type }] }` consumed by
|
|
6
|
+
* `analyzeProject` — both the Vite and Next.js plugins must build their
|
|
7
|
+
* alias JSON through here (same convention as buildAnalyzeProjectArgs).
|
|
8
|
+
* Each plugin only flattens its bundler's alias config into pairs.
|
|
9
|
+
*/
|
|
10
|
+
export interface PathAliasEntry {
|
|
11
|
+
pattern: string;
|
|
12
|
+
replacement: string;
|
|
13
|
+
type: 'prefix' | 'exact';
|
|
14
|
+
}
|
|
15
|
+
export interface PathAliasPair {
|
|
16
|
+
pattern: string;
|
|
17
|
+
target: string;
|
|
18
|
+
/**
|
|
19
|
+
* Force a classification instead of sniffing the target for a file
|
|
20
|
+
* extension. Vite's array-form aliases are always prefix matches.
|
|
21
|
+
*/
|
|
22
|
+
kind?: 'prefix' | 'exact';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Normalize alias pairs: strip a `rootDir` prefix from targets, classify
|
|
26
|
+
* exact (file) vs prefix (directory) matches, force trailing slashes on
|
|
27
|
+
* prefix entries, and sort longest pattern first for correct matching
|
|
28
|
+
* priority. Returns null when no entries survive.
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildPathAliasesJson(pairs: PathAliasPair[], rootDir: string): {
|
|
31
|
+
json: string;
|
|
32
|
+
count: number;
|
|
33
|
+
} | null;
|
|
34
|
+
//# sourceMappingURL=path-aliases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-aliases.d.ts","sourceRoot":"","sources":["../pipeline/path-aliases.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,aAAa,EAAE,EACtB,OAAO,EAAE,MAAM,GACd;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAyBxC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { browserslistToTargets } from 'lightningcss';
|
|
2
|
+
export type LightningTargets = ReturnType<typeof browserslistToTargets>;
|
|
3
|
+
/**
|
|
4
|
+
* Resolve browser targets for Lightning CSS.
|
|
5
|
+
* Priority: explicit config → project browserslist → 'defaults' fallback.
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveLightningTargets(explicitTargets: string | string[] | undefined, rootDir: string): LightningTargets;
|
|
8
|
+
/**
|
|
9
|
+
* Post-process CSS with Lightning CSS: autoprefixing + optional minification.
|
|
10
|
+
* On failure, returns the original CSS and logs a warning.
|
|
11
|
+
*/
|
|
12
|
+
export declare function postProcessCss(css: string, opts: {
|
|
13
|
+
minify: boolean;
|
|
14
|
+
targets: LightningTargets;
|
|
15
|
+
warnFn?: (msg: string) => void;
|
|
16
|
+
}): string;
|
|
17
|
+
//# sourceMappingURL=post-process-css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-process-css.d.ts","sourceRoot":"","sources":["../pipeline/post-process-css.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,qBAAqB,EAEtB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAExE;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,EAC9C,OAAO,EAAE,MAAM,GACd,gBAAgB,CAmBlB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IACJ,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,GACA,MAAM,CAmBR"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { AnalyzeProjectInputs } from './analyze-project-args';
|
|
2
|
+
import type { SystemConfig } from './system-config';
|
|
3
|
+
/**
|
|
4
|
+
* Per-bundler emitter identity: where the runtime import comes from and
|
|
5
|
+
* which module ids the Rust emitter injects into transformed sources.
|
|
6
|
+
* Vite uses virtual module ids; Next uses on-disk `.animus/` paths.
|
|
7
|
+
*/
|
|
8
|
+
export interface EmitterConfig {
|
|
9
|
+
runtimeImport: string;
|
|
10
|
+
cssModuleId: string;
|
|
11
|
+
systemPropsModuleId?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ProjectAnalysisResult {
|
|
14
|
+
manifest: any;
|
|
15
|
+
manifestJson: string;
|
|
16
|
+
/** `manifest.sheets.global` — Rust-resolved global CSS. */
|
|
17
|
+
globalCss: string;
|
|
18
|
+
/** `manifest.css` with the shared unit fallback applied. */
|
|
19
|
+
componentCss: string;
|
|
20
|
+
/** The exact analyze-time inputs (already-serialized filesJson included) —
|
|
21
|
+
* reusable for persistence without re-serializing the source corpus. */
|
|
22
|
+
inputs: AnalyzeProjectInputs;
|
|
23
|
+
/** Sub-phase durations (ms) for verbose timing displays. */
|
|
24
|
+
timings: {
|
|
25
|
+
serializeMs: number;
|
|
26
|
+
extractMs: number;
|
|
27
|
+
parseMs: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface AnalysisOptions {
|
|
31
|
+
fileEntries: Array<{
|
|
32
|
+
path: string;
|
|
33
|
+
source: string;
|
|
34
|
+
hash?: string;
|
|
35
|
+
}>;
|
|
36
|
+
packageMap: Record<string, string>;
|
|
37
|
+
system: SystemConfig;
|
|
38
|
+
emitter: EmitterConfig;
|
|
39
|
+
pathAliasesJson: string | null;
|
|
40
|
+
/** Serialized staticCss forced-emission declarations, or null. */
|
|
41
|
+
staticCssJson?: string | null;
|
|
42
|
+
devMode: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Build the named `analyzeProject` input set from analysis options. Also
|
|
46
|
+
* the persistence shape for `.animus/analysis-inputs.json` — an isolated
|
|
47
|
+
* process can replay the analysis from exactly this object
|
|
48
|
+
* (spec: next-turbopack-integration).
|
|
49
|
+
*/
|
|
50
|
+
export declare function buildAnalysisInputs(opts: AnalysisOptions): AnalyzeProjectInputs;
|
|
51
|
+
/**
|
|
52
|
+
* The one analysis invocation both plugins share: build the emitter
|
|
53
|
+
* config, serialize inputs, call the NAPI `analyzeProject`, parse the
|
|
54
|
+
* manifest, surface its diagnostics, and resolve the CSS outputs.
|
|
55
|
+
*
|
|
56
|
+
* Error handling stays at the call site (strict-mode throw vs warn).
|
|
57
|
+
*/
|
|
58
|
+
export declare function runProjectAnalysis(engineApi: () => any, opts: AnalysisOptions & {
|
|
59
|
+
warn: (message: string) => void;
|
|
60
|
+
}): ProjectAnalysisResult;
|
|
61
|
+
/**
|
|
62
|
+
* Clear the engine's per-file analysis cache so stale results from a prior
|
|
63
|
+
* build never bleed into a fresh run. Tolerates engines without the
|
|
64
|
+
* capability (older builds) — the probe is benign.
|
|
65
|
+
*/
|
|
66
|
+
export declare function clearEngineCache(engineApi: () => any): void;
|
|
67
|
+
//# sourceMappingURL=run-analysis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-analysis.d.ts","sourceRoot":"","sources":["../pipeline/run-analysis.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,qBAAqB;IAEpC,QAAQ,EAAE,GAAG,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB;6EACyE;IACzE,MAAM,EAAE,oBAAoB,CAAC;IAC7B,4DAA4D;IAC5D,OAAO,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACtE;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC;IACvB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,eAAe,GACpB,oBAAoB,CAwBtB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAEhC,SAAS,EAAE,MAAM,GAAG,EACpB,IAAI,EAAE,eAAe,GAAG;IAAE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAC1D,qBAAqB,CA0BvB;AAED;;;;GAIG;AAEH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,GAAG,IAAI,CAQ3D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Forced-emission declarations (spec: static-emission-overrides) — the
|
|
3
|
+
* `staticCss` plugin option. Declares emission the JSX scanner may never
|
|
4
|
+
* observe (CMS/config-driven variants, spread-hidden props, dynamically
|
|
5
|
+
* selected components); the engine applies it as synthetic usage through
|
|
6
|
+
* the ordinary ledger.
|
|
7
|
+
*/
|
|
8
|
+
export interface StaticCssComponentOverride {
|
|
9
|
+
/** `'*'` = every option of every declared variant prop; or per-prop
|
|
10
|
+
* `'*'` / explicit option lists. */
|
|
11
|
+
variants?: '*' | Record<string, '*' | string[]>;
|
|
12
|
+
/** `'*'` = every declared state; or an explicit list. */
|
|
13
|
+
states?: '*' | string[];
|
|
14
|
+
/** Custom props whose dynamic slot must be emitted without detected
|
|
15
|
+
* dynamic usage. */
|
|
16
|
+
dynamicProps?: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface StaticCssConfig {
|
|
19
|
+
components?: Record<string, StaticCssComponentOverride>;
|
|
20
|
+
/** System prop → value list (strings, numbers, or responsive objects). */
|
|
21
|
+
systemProps?: Record<string, Array<string | number | Record<string, string | number>>>;
|
|
22
|
+
}
|
|
23
|
+
/** Serialize a staticCss option for the engine; null when absent/empty. */
|
|
24
|
+
export declare function serializeStaticCss(config: StaticCssConfig | undefined): string | null;
|
|
25
|
+
//# sourceMappingURL=static-css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static-css.d.ts","sourceRoot":"","sources":["../pipeline/static-css.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,0BAA0B;IACzC;yCACqC;IACrC,QAAQ,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,EAAE,CAAC,CAAC;IAChD,yDAAyD;IACzD,MAAM,CAAC,EAAE,GAAG,GAAG,MAAM,EAAE,CAAC;IACxB;yBACqB;IACrB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;IACxD,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAClB,MAAM,EACN,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,CACzD,CAAC;CACH;AAkBD,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,GAAG,SAAS,GAClC,MAAM,GAAG,IAAI,CAIf"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The system-derived configuration bundle every extraction run needs —
|
|
3
|
+
* the deserialized result of the NAPI `loadSystemModule()` call, with the
|
|
4
|
+
* optional variable-prefix transformation already applied. Field names
|
|
5
|
+
* mirror `AnalyzeProjectInputs` so the bundle feeds `runProjectAnalysis`
|
|
6
|
+
* without renaming.
|
|
7
|
+
*/
|
|
8
|
+
export interface SystemConfig {
|
|
9
|
+
propConfigJson: string;
|
|
10
|
+
groupRegistryJson: string;
|
|
11
|
+
scalesJson: string;
|
|
12
|
+
variableMapJson: string;
|
|
13
|
+
variableCss: string;
|
|
14
|
+
contextualVarsJson: string | null;
|
|
15
|
+
selectorAliasesJson: string | null;
|
|
16
|
+
/** Condition alias map JSON (modern-css-surface inc 03), mirroring
|
|
17
|
+
* `selectorAliasesJson` — `null` when the system registers none.
|
|
18
|
+
* Optional so the plugins' pre-load `emptySystemConfig()` default need not
|
|
19
|
+
* restate it; `loadSystemConfig` always populates it after a real load. */
|
|
20
|
+
conditionAliasesJson?: string | null;
|
|
21
|
+
globalStyleBlocksJson: string | null;
|
|
22
|
+
keyframesJson: string | null;
|
|
23
|
+
/** Canonical absolute paths of every module the loader evaluated for this
|
|
24
|
+
* system (sorted; entry included, runtime stubs excluded). Plugins use it
|
|
25
|
+
* as the geological-reset membership set. Optional so pre-load
|
|
26
|
+
* `emptySystemConfig()` defaults need not restate it. */
|
|
27
|
+
dependencies?: string[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Load a SystemInstance via the engine's `loadSystemModule` and normalize
|
|
31
|
+
* it into a SystemConfig. When `prefix` is set, CSS variable names in the
|
|
32
|
+
* variable map/css (and theme + contextual vars when affected) are
|
|
33
|
+
* namespaced via the shared `applyPrefix`.
|
|
34
|
+
*
|
|
35
|
+
* Error handling stays at the call site — the Vite plugin warns (or throws
|
|
36
|
+
* in strict mode) and keeps its previous config, the Next plugin lets the
|
|
37
|
+
* failure propagate.
|
|
38
|
+
*/
|
|
39
|
+
export declare function loadSystemConfig(engineApi: () => any, opts: {
|
|
40
|
+
systemPath: string;
|
|
41
|
+
rootDir: string;
|
|
42
|
+
prefix?: string;
|
|
43
|
+
}): SystemConfig;
|
|
44
|
+
//# sourceMappingURL=system-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-config.d.ts","sourceRoot":"","sources":["../pipeline/system-config.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC;;;gFAG4E;IAC5E,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;8DAG0D;IAC1D,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAE9B,SAAS,EAAE,MAAM,GAAG,EACpB,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7D,YAAY,CAsCd"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DynamicPropMeta } from './dynamic-prop-config';
|
|
2
|
+
/**
|
|
3
|
+
* Build the source of the runtime system-props module — served as
|
|
4
|
+
* `virtual:animus/system-props` by the Vite plugin and written to
|
|
5
|
+
* `.animus/system-props.js` by the Next plugin. One generator so the two
|
|
6
|
+
* runtimes can never drift.
|
|
7
|
+
*
|
|
8
|
+
* Runtime transform functions for dynamic props are not yet supported
|
|
9
|
+
* (transforms are resolved at extraction time via boa_engine in Rust), so
|
|
10
|
+
* `transforms` defaults to an empty object literal.
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildSystemPropsModule(opts: {
|
|
13
|
+
systemPropMapJson: string;
|
|
14
|
+
groupRegistryJson: string;
|
|
15
|
+
dynamicProps: Record<string, DynamicPropMeta>;
|
|
16
|
+
transformsSource?: string;
|
|
17
|
+
}): string;
|
|
18
|
+
//# sourceMappingURL=system-props-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-props-module.d.ts","sourceRoot":"","sources":["../pipeline/system-props-module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,MAAM,CAQT"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rust-side timing phases as reported in `manifest.timing`, in waterfall
|
|
3
|
+
* order, with their display labels. Mirrors the timing struct in the
|
|
4
|
+
* extract-v2 crate — a renamed or added Rust phase is updated here once,
|
|
5
|
+
* not per plugin.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RUST_TIMING_PHASES: ReadonlyArray<readonly [key: string, label: string]>;
|
|
8
|
+
/**
|
|
9
|
+
* Format the Rust timing waterfall as log lines. `indent` and `labelWidth`
|
|
10
|
+
* let each plugin keep its established column layout; the phase table and
|
|
11
|
+
* the `(N files, M cached)` suffix are shared.
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatRustTimingWaterfall(timing: Record<string, number>, opts: {
|
|
14
|
+
indent: string;
|
|
15
|
+
labelWidth: number;
|
|
16
|
+
}): string[];
|
|
17
|
+
//# sourceMappingURL=timing-waterfall.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timing-waterfall.d.ts","sourceRoot":"","sources":["../pipeline/timing-waterfall.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,aAAa,CAC5C,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAatC,CAAC;AAEF;;;;GAIG;AACH,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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PathAliasPair } from './path-aliases';
|
|
2
|
+
/**
|
|
3
|
+
* Read the project's tsconfig path aliases as pairs consumable by
|
|
4
|
+
* `buildPathAliasesJson`. Returns an empty array when no readable tsconfig
|
|
5
|
+
* (or no usable `paths`) exists.
|
|
6
|
+
*/
|
|
7
|
+
export declare function readTsconfigAliasPairs(rootDir: string): PathAliasPair[];
|
|
8
|
+
//# sourceMappingURL=tsconfig-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsconfig-paths.d.ts","sourceRoot":"","sources":["../pipeline/tsconfig-paths.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAmKpD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,EAAE,CAiDvE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Membership keys for a filesystem path in the system-dependency watch set.
|
|
3
|
+
*
|
|
4
|
+
* The loader reports symlink-resolved canonical paths; watcher events carry
|
|
5
|
+
* lexical absolute paths that may traverse symlinks (bun workspace links) and
|
|
6
|
+
* — for deletions — may no longer exist, so `realpathSync` on the event path
|
|
7
|
+
* alone cannot produce the canonical form. Both insertion and lookup go
|
|
8
|
+
* through this one normalizer: the lexical form plus a canonical form
|
|
9
|
+
* reconstructed through the nearest existing ancestor.
|
|
10
|
+
*/
|
|
11
|
+
export declare function toWatchKeys(input: string): string[];
|
|
12
|
+
//# sourceMappingURL=watch-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-keys.d.ts","sourceRoot":"","sources":["../pipeline/watch-keys.ts"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAInD"}
|
package/index-v2.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* v2 engine loader
|
|
3
|
-
*
|
|
2
|
+
* v2 engine loader — the package's only engine and its root entry
|
|
3
|
+
* (retire-extract-v1; the transitional `./engine-v2` alias was removed
|
|
4
|
+
* once no consumers remained).
|
|
4
5
|
*
|
|
5
6
|
* Fail-loud contract: a missing binary must produce an actionable
|
|
6
|
-
* error, never a silent fallback
|
|
7
|
+
* error, never a silent fallback
|
|
7
8
|
* (extraction-diagnostics §V2 boundary error reporting).
|
|
8
9
|
*/
|
|
9
10
|
const { existsSync } = require('fs');
|
|
@@ -24,8 +25,8 @@ function loadNative() {
|
|
|
24
25
|
`@animus-ui/extract engine v2: native binary not found for ${platform}-${arch} ` +
|
|
25
26
|
`(looked for ${candidates.join(', ')} under crates/extract-v2/). ` +
|
|
26
27
|
`Published releases ship this binary for darwin-arm64, linux-x64-gnu and ` +
|
|
27
|
-
`linux-arm64-gnu — reinstall the package
|
|
28
|
-
`
|
|
28
|
+
`linux-arm64-gnu — reinstall the package to restore it (v2 is the only ` +
|
|
29
|
+
`engine; the v1 escape hatch was retired, openspec: retire-extract-v1). ` +
|
|
29
30
|
`In the animus workspace, build it with: vp run build:extract-v2.`
|
|
30
31
|
);
|
|
31
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@animus-ui/extract",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Animus static CSS extraction pipeline (Rust/NAPI)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"animus",
|
|
@@ -21,51 +21,43 @@
|
|
|
21
21
|
"directory": "packages/extract"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
|
-
"index.js",
|
|
25
|
-
"index.d.ts",
|
|
26
|
-
"*.node",
|
|
27
24
|
"dist",
|
|
28
25
|
"index-v2.js",
|
|
29
26
|
"index-v2.d.ts",
|
|
30
27
|
"crates/extract-v2/*.node",
|
|
31
28
|
"crates/extract-v2/index.d.ts"
|
|
32
29
|
],
|
|
33
|
-
"main": "index.js",
|
|
34
|
-
"types": "index.d.ts",
|
|
30
|
+
"main": "index-v2.js",
|
|
31
|
+
"types": "index-v2.d.ts",
|
|
35
32
|
"exports": {
|
|
36
33
|
".": {
|
|
37
|
-
"import": "./index.js",
|
|
38
|
-
"require": "./index.js",
|
|
39
|
-
"default": "./index.js"
|
|
34
|
+
"import": "./index-v2.js",
|
|
35
|
+
"require": "./index-v2.js",
|
|
36
|
+
"default": "./index-v2.js"
|
|
40
37
|
},
|
|
41
38
|
"./pipeline": {
|
|
42
39
|
"types": "./dist/index.d.ts",
|
|
43
40
|
"default": "./dist/index.cjs"
|
|
44
|
-
},
|
|
45
|
-
"./engine-v2": {
|
|
46
|
-
"import": "./index-v2.js",
|
|
47
|
-
"require": "./index-v2.js",
|
|
48
|
-
"default": "./index-v2.js"
|
|
49
41
|
}
|
|
50
42
|
},
|
|
51
43
|
"publishConfig": {
|
|
52
44
|
"access": "public"
|
|
53
45
|
},
|
|
54
46
|
"scripts": {
|
|
55
|
-
"build": "
|
|
56
|
-
"build:
|
|
57
|
-
"
|
|
58
|
-
"build:debug": "napi build --platform",
|
|
59
|
-
"compile": "tsgo -p tsconfig.build.json --noEmit",
|
|
47
|
+
"build": "bun run build:v2 && bun run build:ts",
|
|
48
|
+
"build:ts": "tsdown && tsc -p tsconfig.build.json",
|
|
49
|
+
"compile": "tsc -p tsconfig.build.json --noEmit",
|
|
60
50
|
"build:v2": "cd crates/extract-v2 && bunx napi build --platform --release",
|
|
61
51
|
"build:v2:debug": "cd crates/extract-v2 && bunx napi build --platform"
|
|
62
52
|
},
|
|
63
53
|
"dependencies": {
|
|
64
|
-
"@animus-ui/properties": "0.1.
|
|
54
|
+
"@animus-ui/properties": "0.1.2",
|
|
55
|
+
"browserslist": "^4.24.0",
|
|
56
|
+
"lightningcss": "^1.29.0"
|
|
65
57
|
},
|
|
66
58
|
"devDependencies": {
|
|
67
|
-
"@animus-ui/system": "
|
|
68
|
-
"@mdx-js/mdx": "
|
|
59
|
+
"@animus-ui/system": "0.1.2",
|
|
60
|
+
"@mdx-js/mdx": "3.1.1",
|
|
69
61
|
"@napi-rs/cli": "^3.7.3"
|
|
70
62
|
},
|
|
71
63
|
"peerDependencies": {
|
|
@@ -75,18 +67,5 @@
|
|
|
75
67
|
"@mdx-js/mdx": {
|
|
76
68
|
"optional": true
|
|
77
69
|
}
|
|
78
|
-
},
|
|
79
|
-
"optionalDependencies": {
|
|
80
|
-
"@animus-ui/extract-darwin-arm64": "0.1.1-beta.2",
|
|
81
|
-
"@animus-ui/extract-linux-arm64-gnu": "0.1.1-beta.2",
|
|
82
|
-
"@animus-ui/extract-linux-x64-gnu": "0.1.1-beta.2"
|
|
83
|
-
},
|
|
84
|
-
"napi": {
|
|
85
|
-
"binaryName": "animus-extract",
|
|
86
|
-
"targets": [
|
|
87
|
-
"aarch64-apple-darwin",
|
|
88
|
-
"x86_64-unknown-linux-gnu",
|
|
89
|
-
"aarch64-unknown-linux-gnu"
|
|
90
|
-
]
|
|
91
70
|
}
|
|
92
71
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|