@animus-ui/extract 0.1.0-next.v7 → 0.1.1-beta.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 +35 -0
- 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/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 +104 -0
- package/crates/extract-v2/index.js +594 -0
- package/dist/assemble-stylesheet.d.ts +58 -0
- package/dist/assemble-stylesheet.d.ts.map +1 -0
- package/dist/discover-packages.d.ts +15 -0
- package/dist/discover-packages.d.ts.map +1 -0
- package/dist/index.cjs +393 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +379 -0
- package/dist/mdx-preprocessor.d.ts +39 -0
- package/dist/mdx-preprocessor.d.ts.map +1 -0
- package/dist/prefix.d.ts +15 -0
- package/dist/prefix.d.ts.map +1 -0
- package/dist/resolve-global-styles.d.ts +25 -0
- package/dist/resolve-global-styles.d.ts.map +1 -0
- package/dist/resolve-transforms.d.ts +9 -0
- package/dist/resolve-transforms.d.ts.map +1 -0
- package/dist/unit-fallback.d.ts +7 -0
- package/dist/unit-fallback.d.ts.map +1 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -0
- package/index-v2.d.ts +33 -0
- package/index-v2.js +33 -0
- package/index.d.ts +22 -2
- package/index.js +26 -14
- package/package.json +71 -20
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @animus-ui/extract
|
|
2
|
+
|
|
3
|
+
Rust/NAPI static CSS extraction pipeline for Animus. Analyzes TypeScript source files using OXC, resolves builder chains against serialized system config, and emits layered CSS.
|
|
4
|
+
|
|
5
|
+
This package is consumed by [`@animus-ui/vite-plugin`](../vite-plugin) and [`@animus-ui/next-plugin`](../next-plugin). You typically don't install it directly — the bundler plugins depend on it.
|
|
6
|
+
|
|
7
|
+
## Platforms
|
|
8
|
+
|
|
9
|
+
Pre-built binaries for:
|
|
10
|
+
|
|
11
|
+
- `darwin-arm64` (macOS Apple Silicon)
|
|
12
|
+
- `linux-x64-gnu` (Linux x64)
|
|
13
|
+
- `linux-arm64-gnu` (Linux ARM64)
|
|
14
|
+
|
|
15
|
+
## API
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { analyzeProject } from '@animus-ui/extract';
|
|
19
|
+
|
|
20
|
+
const manifest = analyzeProject(
|
|
21
|
+
fileEntriesJson,
|
|
22
|
+
scalesJson,
|
|
23
|
+
variableMapJson,
|
|
24
|
+
contextualVarsJson,
|
|
25
|
+
propConfig,
|
|
26
|
+
groupRegistry,
|
|
27
|
+
packageResolutionJson,
|
|
28
|
+
devMode,
|
|
29
|
+
prefix
|
|
30
|
+
);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
MIT
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/* auto-generated by NAPI-RS */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export declare class ExtractEngine {
|
|
4
|
+
constructor(options?: EngineOptions | undefined | null)
|
|
5
|
+
/**
|
|
6
|
+
* Parse-once fact extraction over the file set; facts and sources are
|
|
7
|
+
* RETAINED on the handle for subsequent per-file calls. Returns the
|
|
8
|
+
* fact manifest (files + parseCount) as JSON.
|
|
9
|
+
*/
|
|
10
|
+
analyze(fileEntriesJson: string): string
|
|
11
|
+
/** Reset all retained build state. */
|
|
12
|
+
clearCache(): void
|
|
13
|
+
get parseCount(): number
|
|
14
|
+
/**
|
|
15
|
+
* Per-file transformation from retained source + facts (no-config
|
|
16
|
+
* subset: variants/compounds/states; system/custom payloads need the
|
|
17
|
+
* row-07 config inputs and FAIL LOUD). Returns {code, hasComponents}
|
|
18
|
+
* JSON. Import decisions come from surviving chain/payload metadata;
|
|
19
|
+
* consumed-import stripping and directive handling are the ported v1
|
|
20
|
+
* semantics.
|
|
21
|
+
*/
|
|
22
|
+
transformFile(path: string): string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Chain discovery over a file set: parse once per file (parallel), walk
|
|
27
|
+
* every stored AST, return owned facts. The v2 spine's first real surface;
|
|
28
|
+
* consumed by the parity comparison tooling.
|
|
29
|
+
*/
|
|
30
|
+
export declare function discoverChains(fileEntriesJson: string): string
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Engine options (row 07 Task 07.3 — replaces the RF-53 hardcodes).
|
|
34
|
+
* All fields optional; absent = v1 defaults.
|
|
35
|
+
*/
|
|
36
|
+
export interface EngineOptions {
|
|
37
|
+
/** Class-identity prefix (v1 default "animus"). */
|
|
38
|
+
prefix?: string
|
|
39
|
+
/** Runtime import source (v1 default "@animus-ui/system"). */
|
|
40
|
+
runtimeImport?: string
|
|
41
|
+
/** CSS virtual module id (v1 default "virtual:animus/styles.css"). */
|
|
42
|
+
cssModuleId?: string
|
|
43
|
+
/**
|
|
44
|
+
* System-props virtual module id (v1 EmitterConfig default
|
|
45
|
+
* "virtual:animus/system-props").
|
|
46
|
+
*/
|
|
47
|
+
systemPropsModuleId?: string
|
|
48
|
+
/** Flat theme scales JSON (v1 analyzeProject `theme_json`). */
|
|
49
|
+
themeJson?: string
|
|
50
|
+
/** Token-alias variable map JSON (v1 `variable_map_json`). */
|
|
51
|
+
variableMapJson?: string
|
|
52
|
+
/** Contextual vars JSON (v1 `contextual_vars_json`). */
|
|
53
|
+
contextualVarsJson?: string
|
|
54
|
+
/** Prop config map JSON (v1 `config_json`). */
|
|
55
|
+
configJson?: string
|
|
56
|
+
/** Group registry JSON (v1 `group_registry_json`). */
|
|
57
|
+
groupRegistryJson?: string
|
|
58
|
+
/** Selector aliases JSON (v1 `selector_aliases_json`). */
|
|
59
|
+
selectorAliasesJson?: string
|
|
60
|
+
/** Global style blocks JSON (v1 `global_style_blocks_json`). */
|
|
61
|
+
globalStyleBlocksJson?: string
|
|
62
|
+
/**
|
|
63
|
+
* Keyframes blocks JSON (v1 `keyframes_blocks_json` — feeds BOTH the
|
|
64
|
+
* global sheet and the static keyframes registry, v1 Phase 2a).
|
|
65
|
+
*/
|
|
66
|
+
keyframesJson?: string
|
|
67
|
+
/** Package resolution JSON (v1 `package_resolution_json`). */
|
|
68
|
+
packageResolutionJson?: string
|
|
69
|
+
/** Path aliases JSON (`{aliases: [...]}` wrapper, v1 shape). */
|
|
70
|
+
pathAliasesJson?: string
|
|
71
|
+
/** v1 `dev_mode`: retain all components (skip reconciliation pruning). */
|
|
72
|
+
devMode?: boolean
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Build/probe identity: proves the v2 binary loads and its oxc linkage
|
|
77
|
+
* parses. Consumed by the dual-build verification and the parity harness
|
|
78
|
+
* engine registry.
|
|
79
|
+
*/
|
|
80
|
+
export declare function engineVersion(): string
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Full per-file fact extraction (increment 11): chains + eagerly evaluated
|
|
84
|
+
* stages + statics + raw usage facts + compose families — one parse per
|
|
85
|
+
* file. The store (and every AST) is dropped when this call returns; the
|
|
86
|
+
* D4-relevant invariant is that no program() read happens after
|
|
87
|
+
* cross-file facts resolve.
|
|
88
|
+
*/
|
|
89
|
+
export declare function extractFacts(fileEntriesJson: string): string
|
|
90
|
+
|
|
91
|
+
export declare function loadSystemModule(systemPath: string, rootDir: string, exportName?: string | undefined | null): NapiSystemConfig
|
|
92
|
+
|
|
93
|
+
export interface NapiSystemConfig {
|
|
94
|
+
propConfig: string
|
|
95
|
+
groupRegistry: string
|
|
96
|
+
scalesJson: string
|
|
97
|
+
variableMapJson: string
|
|
98
|
+
variableCss: string
|
|
99
|
+
contextualVarsJson: string
|
|
100
|
+
selectorAliases?: string
|
|
101
|
+
selectorOrder?: string
|
|
102
|
+
globalStyleBlocks?: string
|
|
103
|
+
keyframesBlocks?: string
|
|
104
|
+
}
|