@animus-ui/extract 0.1.9 → 0.1.12
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 +48 -1
- 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 +17 -98
- package/dist/index.cjs +78 -2101
- package/dist/index.mjs +2 -2026
- package/dist/{analyze-project-args.d.ts → pipeline/analyze-project-args.d.ts} +0 -12
- package/dist/pipeline/analyze-project-args.d.ts.map +1 -0
- package/dist/pipeline/assemble-stylesheet.d.ts +23 -0
- package/dist/pipeline/assemble-stylesheet.d.ts.map +1 -0
- package/dist/pipeline/asset-placeholders.d.ts +4 -0
- package/dist/pipeline/asset-placeholders.d.ts.map +1 -0
- package/dist/pipeline/content-hash.d.ts +2 -0
- package/dist/pipeline/content-hash.d.ts.map +1 -0
- package/dist/pipeline/core-options.d.ts +96 -0
- package/dist/pipeline/core-options.d.ts.map +1 -0
- package/dist/pipeline/correlate-external-tokens.d.ts +38 -0
- package/dist/pipeline/correlate-external-tokens.d.ts.map +1 -0
- package/dist/pipeline/discover-files.d.ts +4 -0
- package/dist/pipeline/discover-files.d.ts.map +1 -0
- package/dist/pipeline/discover-packages.d.ts +55 -0
- package/dist/pipeline/discover-packages.d.ts.map +1 -0
- package/dist/pipeline/dynamic-prop-config.d.ts +22 -0
- package/dist/pipeline/dynamic-prop-config.d.ts.map +1 -0
- package/dist/pipeline/engine-adapter.d.ts +63 -0
- package/dist/pipeline/engine-adapter.d.ts.map +1 -0
- package/dist/pipeline/engine-retirement.d.ts +3 -0
- package/dist/pipeline/engine-retirement.d.ts.map +1 -0
- package/dist/pipeline/error-diagnostics.d.ts +8 -0
- package/dist/pipeline/error-diagnostics.d.ts.map +1 -0
- package/dist/{index.d.ts → pipeline/index.d.ts} +16 -6
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/internal-wire.d.ts +2 -0
- package/dist/pipeline/internal-wire.d.ts.map +1 -0
- package/dist/pipeline/manifest-diagnostics.d.ts +57 -0
- package/dist/pipeline/manifest-diagnostics.d.ts.map +1 -0
- package/dist/pipeline/manifest-schema.d.ts +117 -0
- package/dist/pipeline/manifest-schema.d.ts.map +1 -0
- package/dist/pipeline/mdx-preprocessor.d.ts +25 -0
- package/dist/pipeline/mdx-preprocessor.d.ts.map +1 -0
- package/dist/pipeline/path-aliases.d.ts +15 -0
- package/dist/pipeline/path-aliases.d.ts.map +1 -0
- package/dist/{post-process-css.d.ts → pipeline/post-process-css.d.ts} +0 -8
- package/dist/pipeline/post-process-css.d.ts.map +1 -0
- package/dist/pipeline/prefix.d.ts +8 -0
- package/dist/pipeline/prefix.d.ts.map +1 -0
- package/dist/pipeline/replacement-plans.d.ts +22 -0
- package/dist/pipeline/replacement-plans.d.ts.map +1 -0
- package/dist/pipeline/resolve-asset.d.ts +11 -0
- package/dist/pipeline/resolve-asset.d.ts.map +1 -0
- package/dist/pipeline/run-analysis.d.ts +62 -0
- package/dist/pipeline/run-analysis.d.ts.map +1 -0
- package/dist/pipeline/source-corpus.d.ts +25 -0
- package/dist/pipeline/source-corpus.d.ts.map +1 -0
- package/dist/pipeline/source-identity.d.ts +63 -0
- package/dist/pipeline/source-identity.d.ts.map +1 -0
- package/dist/pipeline/source-ingestion.d.ts +168 -0
- package/dist/pipeline/source-ingestion.d.ts.map +1 -0
- package/dist/pipeline/static-css.d.ts +16 -0
- package/dist/pipeline/static-css.d.ts.map +1 -0
- package/dist/pipeline/structural-self-check.d.ts +12 -0
- package/dist/pipeline/structural-self-check.d.ts.map +1 -0
- package/dist/pipeline/svelte-source-adapter.d.ts +81 -0
- package/dist/pipeline/svelte-source-adapter.d.ts.map +1 -0
- package/dist/pipeline/system-config.d.ts +40 -0
- package/dist/pipeline/system-config.d.ts.map +1 -0
- package/dist/pipeline/system-props-module.d.ts +8 -0
- package/dist/pipeline/system-props-module.d.ts.map +1 -0
- package/dist/pipeline/timing-waterfall.d.ts +6 -0
- package/dist/pipeline/timing-waterfall.d.ts.map +1 -0
- package/dist/pipeline/tsconfig-paths.d.ts +7 -0
- package/dist/pipeline/tsconfig-paths.d.ts.map +1 -0
- package/dist/pipeline/unit-fallback.d.ts +2 -0
- package/dist/pipeline/unit-fallback.d.ts.map +1 -0
- package/dist/pipeline/utils.d.ts +3 -0
- package/dist/pipeline/utils.d.ts.map +1 -0
- package/dist/pipeline/watch-keys.d.ts +2 -0
- package/dist/pipeline/watch-keys.d.ts.map +1 -0
- package/dist/pipeline-DeEENy5C.mjs +2905 -0
- package/dist/pipeline-x1yBZ2UP.cjs +3386 -0
- package/dist/session/extraction-session.d.ts +240 -0
- package/dist/session/extraction-session.d.ts.map +1 -0
- package/dist/session/index.d.ts +10 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/published-set.d.ts +52 -0
- package/dist/session/published-set.d.ts.map +1 -0
- package/dist/session/resolve-packages.d.ts +7 -0
- package/dist/session/resolve-packages.d.ts.map +1 -0
- package/dist/session/session-paths.d.ts +97 -0
- package/dist/session/session-paths.d.ts.map +1 -0
- package/dist/session/singleton.d.ts +85 -0
- package/dist/session/singleton.d.ts.map +1 -0
- package/dist/session/timing.d.ts +2 -0
- package/dist/session/timing.d.ts.map +1 -0
- package/dist/session/turbopack-orchestrator.d.ts +27 -0
- package/dist/session/turbopack-orchestrator.d.ts.map +1 -0
- package/dist/session.cjs +1999 -0
- package/dist/session.mjs +1955 -0
- package/index-v2.js +0 -9
- package/package.json +22 -9
- package/dist/analyze-project-args.d.ts.map +0 -1
- package/dist/assemble-stylesheet.d.ts +0 -58
- package/dist/assemble-stylesheet.d.ts.map +0 -1
- package/dist/asset-placeholders.d.ts +0 -29
- package/dist/asset-placeholders.d.ts.map +0 -1
- package/dist/content-hash.d.ts +0 -9
- package/dist/content-hash.d.ts.map +0 -1
- package/dist/correlate-external-tokens.d.ts +0 -46
- package/dist/correlate-external-tokens.d.ts.map +0 -1
- package/dist/discover-files.d.ts +0 -10
- package/dist/discover-files.d.ts.map +0 -1
- package/dist/discover-packages.d.ts +0 -192
- package/dist/discover-packages.d.ts.map +0 -1
- package/dist/dynamic-prop-config.d.ts +0 -37
- package/dist/dynamic-prop-config.d.ts.map +0 -1
- package/dist/engine-adapter.d.ts +0 -97
- package/dist/engine-adapter.d.ts.map +0 -1
- package/dist/engine-retirement.d.ts +0 -22
- package/dist/engine-retirement.d.ts.map +0 -1
- package/dist/error-diagnostics.d.ts +0 -32
- package/dist/error-diagnostics.d.ts.map +0 -1
- package/dist/external-keyframes.d.ts +0 -23
- package/dist/external-keyframes.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/manifest-diagnostics.d.ts +0 -62
- package/dist/manifest-diagnostics.d.ts.map +0 -1
- package/dist/mdx-preprocessor.d.ts +0 -39
- package/dist/mdx-preprocessor.d.ts.map +0 -1
- package/dist/path-aliases.d.ts +0 -34
- package/dist/path-aliases.d.ts.map +0 -1
- package/dist/post-process-css.d.ts.map +0 -1
- package/dist/prefix.d.ts +0 -15
- package/dist/prefix.d.ts.map +0 -1
- package/dist/replacement-plans.d.ts +0 -46
- package/dist/replacement-plans.d.ts.map +0 -1
- package/dist/resolve-asset.d.ts +0 -14
- package/dist/resolve-asset.d.ts.map +0 -1
- package/dist/run-analysis.d.ts +0 -74
- package/dist/run-analysis.d.ts.map +0 -1
- package/dist/source-identity.d.ts +0 -93
- package/dist/source-identity.d.ts.map +0 -1
- package/dist/static-css.d.ts +0 -25
- package/dist/static-css.d.ts.map +0 -1
- package/dist/system-config.d.ts +0 -57
- package/dist/system-config.d.ts.map +0 -1
- package/dist/system-props-module.d.ts +0 -22
- package/dist/system-props-module.d.ts.map +0 -1
- package/dist/timing-waterfall.d.ts +0 -17
- package/dist/timing-waterfall.d.ts.map +0 -1
- package/dist/tsconfig-paths.d.ts +0 -8
- package/dist/tsconfig-paths.d.ts.map +0 -1
- package/dist/unit-fallback.d.ts +0 -7
- package/dist/unit-fallback.d.ts.map +0 -1
- package/dist/utils.d.ts +0 -3
- package/dist/utils.d.ts.map +0 -1
- package/dist/watch-keys.d.ts +0 -12
- package/dist/watch-keys.d.ts.map +0 -1
package/index-v2.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/**
|
|
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).
|
|
5
|
-
*
|
|
6
|
-
* Fail-loud contract: a missing binary must produce an actionable
|
|
7
|
-
* error, never a silent fallback
|
|
8
|
-
* (extraction-diagnostics §V2 boundary error reporting).
|
|
9
|
-
*/
|
|
10
1
|
const { existsSync } = require('fs');
|
|
11
2
|
const { join } = require('path');
|
|
12
3
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@animus-ui/extract",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "Animus static CSS extraction pipeline (Rust/NAPI)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"animus",
|
|
@@ -36,8 +36,12 @@
|
|
|
36
36
|
"default": "./index-v2.js"
|
|
37
37
|
},
|
|
38
38
|
"./pipeline": {
|
|
39
|
-
"types": "./dist/index.d.ts",
|
|
39
|
+
"types": "./dist/pipeline/index.d.ts",
|
|
40
40
|
"default": "./dist/index.cjs"
|
|
41
|
+
},
|
|
42
|
+
"./session": {
|
|
43
|
+
"types": "./dist/session/index.d.ts",
|
|
44
|
+
"default": "./dist/session.cjs"
|
|
41
45
|
}
|
|
42
46
|
},
|
|
43
47
|
"publishConfig": {
|
|
@@ -46,26 +50,35 @@
|
|
|
46
50
|
"scripts": {
|
|
47
51
|
"build": "bun run build:v2 && bun run build:ts",
|
|
48
52
|
"build:ts": "tsdown && tsc -p tsconfig.build.json",
|
|
49
|
-
"compile": "tsc -p tsconfig.build.json --noEmit",
|
|
53
|
+
"compile": "tsc -p tsconfig.build.json --noEmit && tsc -p tsconfig.json",
|
|
50
54
|
"build:v2": "cd crates/extract-v2 && bunx napi build --platform --release",
|
|
51
55
|
"build:v2:debug": "cd crates/extract-v2 && bunx napi build --platform"
|
|
52
56
|
},
|
|
53
57
|
"dependencies": {
|
|
54
|
-
"@animus-ui/properties": "0.1.
|
|
55
|
-
"browserslist": "^4.
|
|
56
|
-
"lightningcss": "^1.
|
|
58
|
+
"@animus-ui/properties": "0.1.12",
|
|
59
|
+
"browserslist": "^4.28.8",
|
|
60
|
+
"lightningcss": "^1.33.0"
|
|
57
61
|
},
|
|
58
62
|
"devDependencies": {
|
|
59
|
-
"@animus-ui/
|
|
63
|
+
"@animus-ui/assertions": "0.1.12",
|
|
64
|
+
"@animus-ui/system": "0.1.12",
|
|
60
65
|
"@mdx-js/mdx": "3.1.1",
|
|
61
|
-
"@napi-rs/cli": "^3.
|
|
66
|
+
"@napi-rs/cli": "^3.9.0",
|
|
67
|
+
"svelte": "5.57.0"
|
|
62
68
|
},
|
|
63
69
|
"peerDependencies": {
|
|
64
|
-
"@mdx-js/mdx": "^3.0.0"
|
|
70
|
+
"@mdx-js/mdx": "^3.0.0",
|
|
71
|
+
"svelte": "^5.0.0"
|
|
65
72
|
},
|
|
66
73
|
"peerDependenciesMeta": {
|
|
67
74
|
"@mdx-js/mdx": {
|
|
68
75
|
"optional": true
|
|
76
|
+
},
|
|
77
|
+
"svelte": {
|
|
78
|
+
"optional": true
|
|
69
79
|
}
|
|
80
|
+
},
|
|
81
|
+
"engines": {
|
|
82
|
+
"node": ">=22.12.0"
|
|
70
83
|
}
|
|
71
84
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analyze-project-args.d.ts","sourceRoot":"","sources":["../pipeline/analyze-project-args.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,gBAAgB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oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;kDAC8C;IAC9C,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,gBAAgB;AAChB,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,oBAAoB,GAC3B,kBAAkB,CAqBpB"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The 7 Animus cascade layers. Always prefixed with `anm-` to avoid
|
|
3
|
-
* collision with other frameworks' layer names (e.g., Tailwind's `base`).
|
|
4
|
-
*/
|
|
5
|
-
export declare const ANIMUS_LAYERS: readonly ['anm-global', 'anm-base', 'anm-variants', 'anm-compounds', 'anm-states', 'anm-system', 'anm-custom'];
|
|
6
|
-
/**
|
|
7
|
-
* Validate that a consumer `layers` array contains all 7 Animus layers
|
|
8
|
-
* in the correct relative order. Consumer layers may be interleaved.
|
|
9
|
-
*
|
|
10
|
-
* @throws Error with descriptive message on violation
|
|
11
|
-
*/
|
|
12
|
-
export declare function validateLayerOrder(layers: string[]): void;
|
|
13
|
-
/**
|
|
14
|
-
* Strip a leading `@layer ...;` declaration line from CSS if present.
|
|
15
|
-
* The Rust crate embeds this in prod-mode output; we strip it so the
|
|
16
|
-
* shared assembler controls placement.
|
|
17
|
-
*/
|
|
18
|
-
export declare function stripLeadingLayerDeclaration(css: string): string;
|
|
19
|
-
export interface AssembleStylesheetParts {
|
|
20
|
-
declaration: string;
|
|
21
|
-
variables: string;
|
|
22
|
-
body: string;
|
|
23
|
-
}
|
|
24
|
-
export interface AssembleStylesheetOptions {
|
|
25
|
-
/**
|
|
26
|
-
* Custom layer order. Must contain all 7 Animus `anm-*` layers as a subsequence.
|
|
27
|
-
* Example: `['reset', 'anm-global', 'anm-base', ..., 'anm-custom', 'overrides']`
|
|
28
|
-
* Names are emitted as-is — this is the actual `@layer` declaration.
|
|
29
|
-
*/
|
|
30
|
-
layers?: string[];
|
|
31
|
-
/** Variable CSS: `:root { --color-*: ... }` + color mode selectors */
|
|
32
|
-
variableCss?: string;
|
|
33
|
-
/** Global CSS: `@layer anm-global { reset + global styles }` */
|
|
34
|
-
globalCss?: string;
|
|
35
|
-
/** Component CSS from the Rust crate (may contain embedded @layer declaration) */
|
|
36
|
-
componentCss?: string;
|
|
37
|
-
/** When true, return structured `{ declaration, variables, body }` instead of a single string. */
|
|
38
|
-
split?: boolean;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Assemble the final stylesheet in canonical order:
|
|
42
|
-
*
|
|
43
|
-
* 1. `@layer` declaration (cascade ordering)
|
|
44
|
-
* 2. Emitted variables (`:root`, color mode selectors)
|
|
45
|
-
* 3. `@layer anm-global { ... }` (reset + global styles)
|
|
46
|
-
* 4. `@layer anm-base/variants/compounds/states/system/custom { ... }` (components)
|
|
47
|
-
*
|
|
48
|
-
* This is the single source of truth for stylesheet assembly.
|
|
49
|
-
* Both Vite and Next.js plugins must use this function.
|
|
50
|
-
*/
|
|
51
|
-
export declare function assembleStylesheet(options: AssembleStylesheetOptions & {
|
|
52
|
-
split: true;
|
|
53
|
-
}): AssembleStylesheetParts;
|
|
54
|
-
export declare function assembleStylesheet(options: AssembleStylesheetOptions & {
|
|
55
|
-
split?: false;
|
|
56
|
-
}): string;
|
|
57
|
-
export declare function assembleStylesheet(options: AssembleStylesheetOptions): string | AssembleStylesheetParts;
|
|
58
|
-
//# sourceMappingURL=assemble-stylesheet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assemble-stylesheet.d.ts","sourceRoot":"","sources":["../pipeline/assemble-stylesheet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,aAAa,YACxB,YAAY,EACZ,UAAU,EACV,cAAc,EACd,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,YAAY,CACJ,CAAC;AAiBX;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CA2BzD;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGhE;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kGAAkG;IAClG,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,yBAAyB,GAAG;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,GACnD,uBAAuB,CAAC;AAC3B,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,yBAAyB,GAAG;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GACrD,MAAM,CAAC;AACV,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,yBAAyB,GACjC,MAAM,GAAG,uBAAuB,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Host-side handling of `asset()` placeholders (global-styles-system):
|
|
3
|
-
* `animus-asset:<specifier>` markers ride through the sandbox and the
|
|
4
|
-
* emitter byte-exact; each HOST plugin substitutes them with its bundler's
|
|
5
|
-
* resolved asset URL after extraction. This module owns the shared scanning
|
|
6
|
-
* and replacement mechanics — resolution and strict gating stay at the
|
|
7
|
-
* plugin call sites.
|
|
8
|
-
*/
|
|
9
|
-
/** Mirrors the producer-side constant in `@animus-ui/system`'s `asset.ts`
|
|
10
|
-
* (extract must not take a runtime dependency on system); the pairing is
|
|
11
|
-
* pinned by a contract test in `tests/asset-placeholders.test.ts`. */
|
|
12
|
-
export declare const ASSET_PLACEHOLDER_PREFIX = "animus-asset:";
|
|
13
|
-
/** Unique asset specifiers referenced by placeholders, in appearance order. */
|
|
14
|
-
export declare function findAssetSpecifiers(css: string): string[];
|
|
15
|
-
/**
|
|
16
|
-
* Replace each specifier's placeholder with its substitution. Specifiers
|
|
17
|
-
* absent from the map keep their placeholder — the caller decides whether
|
|
18
|
-
* that is a strict failure or a warn-and-emit-literally. A substitution may
|
|
19
|
-
* itself be a bundler marker (e.g. Vite's `__VITE_ASSET__<ref>__`) that the
|
|
20
|
-
* host's own asset pipeline resolves to a hashed file name later.
|
|
21
|
-
*
|
|
22
|
-
* Each replacement is anchored to a following delimiter (quote, `)`,
|
|
23
|
-
* whitespace, or end of input) so a specifier that textually prefixes a
|
|
24
|
-
* longer one can never clobber the longer placeholder; longest-first
|
|
25
|
-
* ordering additionally lets the longer of two mapped specifiers claim its
|
|
26
|
-
* occurrences before the shorter runs.
|
|
27
|
-
*/
|
|
28
|
-
export declare function substituteAssetPlaceholders(css: string, urlBySpecifier: ReadonlyMap<string, string>): string;
|
|
29
|
-
//# sourceMappingURL=asset-placeholders.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asset-placeholders.d.ts","sourceRoot":"","sources":["../pipeline/asset-placeholders.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;uEAEuE;AACvE,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AAkBxD,+EAA+E;AAC/E,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAkBzD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1C,MAAM,CAgBR"}
|
package/dist/content-hash.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MD5 content hash used for file-change detection (HMR diffing) by both
|
|
3
|
-
* extraction plugins, and for content-addressing copied asset bytes. The
|
|
4
|
-
* algorithm/encoding is a cross-plugin contract: cache keys written by one
|
|
5
|
-
* build path must compare equal in the next. Accepts a Buffer directly so
|
|
6
|
-
* binary sources hash without an intermediate string copy.
|
|
7
|
-
*/
|
|
8
|
-
export declare function contentHash(source: string | Buffer): string;
|
|
9
|
-
//# sourceMappingURL=content-hash.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-hash.d.ts","sourceRoot":"","sources":["../pipeline/content-hash.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAE3D"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { ManifestDiagnostic } from './manifest-diagnostics';
|
|
2
|
-
/**
|
|
3
|
-
* Index the loader-captured theme manifests by owning specifier. Module paths
|
|
4
|
-
* are canonical absolute paths (symlinks resolved), so each package dir is
|
|
5
|
-
* realpath'd before prefix-matching; a module outside every known package dir
|
|
6
|
-
* (typically the consumer's own theme) contributes nothing.
|
|
7
|
-
*/
|
|
8
|
-
export declare function buildSourceTokenIndex(opts: {
|
|
9
|
-
sourceThemeManifestsJson: string | null | undefined;
|
|
10
|
-
/** Absolute package dir → owning specifier (collection `dirOwners`). */
|
|
11
|
-
dirOwners: Record<string, string>;
|
|
12
|
-
}): Map<string, Set<string>>;
|
|
13
|
-
/**
|
|
14
|
-
* The correlation join. Returns one teaching-error message per distinct
|
|
15
|
-
* (component, token, specifier) whose file belongs to a discovered source AND
|
|
16
|
-
* whose token that source's manifest defines. The messages follow the
|
|
17
|
-
* standard severity routing at the CALLER (throw under `strict`, warn
|
|
18
|
-
* otherwise) — this join never reports on its own.
|
|
19
|
-
*/
|
|
20
|
-
export declare function correlateExternalTokenDiagnostics(opts: {
|
|
21
|
-
diagnostics: ManifestDiagnostic[] | undefined;
|
|
22
|
-
/** rootDir-relative file path → owning specifier (collection `fileOwners`). */
|
|
23
|
-
fileOwners: Record<string, string>;
|
|
24
|
-
/** specifier → token paths the source itself defines. */
|
|
25
|
-
sourceTokens: Map<string, Set<string>>;
|
|
26
|
-
}): string[];
|
|
27
|
-
/**
|
|
28
|
-
* The complete cross-source token-contract gate both plugins share
|
|
29
|
-
* (extraction-diagnostics): index the loader-captured source manifests,
|
|
30
|
-
* join them against the engine's candidates, and route the resulting
|
|
31
|
-
* teaching errors — throw under `strict`, warn otherwise. One entry point
|
|
32
|
-
* so the two hosts cannot drift on wiring or severity semantics.
|
|
33
|
-
*/
|
|
34
|
-
export declare function enforceExternalTokenContracts(opts: {
|
|
35
|
-
diagnostics: ManifestDiagnostic[] | undefined;
|
|
36
|
-
/** rootDir-relative file path → owning specifier (collection `fileOwners`). */
|
|
37
|
-
fileOwners: Record<string, string>;
|
|
38
|
-
/** Absolute package dir → owning specifier (collection `dirOwners`). */
|
|
39
|
-
dirOwners: Record<string, string>;
|
|
40
|
-
sourceThemeManifestsJson: string | null | undefined;
|
|
41
|
-
strict: boolean | undefined;
|
|
42
|
-
/** Host log prefix, e.g. `[animus-extract]`. */
|
|
43
|
-
prefix: string;
|
|
44
|
-
warn: (message: string) => void;
|
|
45
|
-
}): void;
|
|
46
|
-
//# sourceMappingURL=correlate-external-tokens.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"correlate-external-tokens.d.ts","sourceRoot":"","sources":["../pipeline/correlate-external-tokens.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAejE;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,wBAAwB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACpD,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CA+D3B;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,IAAI,EAAE;IACtD,WAAW,EAAE,kBAAkB,EAAE,GAAG,SAAS,CAAC;IAC9C,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,yDAAyD;IACzD,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;CACxC,GAAG,MAAM,EAAE,CAyBX;AAWD;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAClD,WAAW,EAAE,kBAAkB,EAAE,GAAG,SAAS,CAAC;IAC9C,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,wBAAwB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACpD,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,GAAG,IAAI,CAwBP"}
|
package/dist/discover-files.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recursively discover source files under `dir`, skipping any path that
|
|
3
|
-
* contains one of `excludePatterns` (matched as substrings of both the full
|
|
4
|
-
* and root-relative path) and keeping files whose extension is in
|
|
5
|
-
* `extensionsSet`.
|
|
6
|
-
*
|
|
7
|
-
* Single authoritative copy for both extraction plugins.
|
|
8
|
-
*/
|
|
9
|
-
export declare function discoverFiles(dir: string, rootDir: string, excludePatterns: string[], extensionsSet: ReadonlySet<string>): string[];
|
|
10
|
-
//# sourceMappingURL=discover-files.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discover-files.d.ts","sourceRoot":"","sources":["../pipeline/discover-files.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,MAAM,EAAE,EACzB,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,GACjC,MAAM,EAAE,CAoCV"}
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Walk up from a resolved package entry file to the nearest directory
|
|
3
|
-
* containing a package.json (the package root). Stops at the filesystem
|
|
4
|
-
* root and returns it if no package.json is found on the way up.
|
|
5
|
-
*/
|
|
6
|
-
export declare function findPackageRoot(absEntryPath: string): string;
|
|
7
|
-
/**
|
|
8
|
-
* Exclusion fragments for discovery inside an external package's src/,
|
|
9
|
-
* matched against paths RELATIVE TO the src dir. Per spec
|
|
10
|
-
* external-package-file-discovery, the filters apply "within the package" —
|
|
11
|
-
* an npm-installed package whose own location is under node_modules (or a
|
|
12
|
-
* repo path containing 'dist') must still have its sources discovered.
|
|
13
|
-
*/
|
|
14
|
-
export declare const PACKAGE_SRC_EXCLUDES: string[];
|
|
15
|
-
/** True when a PACKAGE-RELATIVE path matches a package-source exclusion
|
|
16
|
-
* fragment (the "within the package" filter — see PACKAGE_SRC_EXCLUDES). */
|
|
17
|
-
export declare function isExcludedPackageRelativePath(rel: string): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* THE package-source walk (guardrail G1 — one policy): shared discovery with
|
|
20
|
-
* no consumer patterns, then exclusion by package-relative path so fragments
|
|
21
|
-
* in the package's own location can't blank out its sources. Used by the
|
|
22
|
-
* collector, hosts' dirty-root rewalks, and watch-path classification alike.
|
|
23
|
-
*/
|
|
24
|
-
export declare function walkPackageSources(packageDir: string, extensionsSet: ReadonlySet<string>): string[];
|
|
25
|
-
/**
|
|
26
|
-
* What one declared include specifier produced, so callers can tell a package
|
|
27
|
-
* that contributed sources apart from one that silently contributed nothing.
|
|
28
|
-
* Collection itself never warns — reporting is the caller's policy.
|
|
29
|
-
*/
|
|
30
|
-
export interface ExternalPackageOutcome {
|
|
31
|
-
/** The declared specifier, exactly as it appeared in the system file. */
|
|
32
|
-
specifier: string;
|
|
33
|
-
/**
|
|
34
|
-
* - `resolved` — resolved to a package and accounted for at least one source
|
|
35
|
-
* - `unresolvable` — specifier could not be resolved (skipped, per spec)
|
|
36
|
-
* - `empty` — resolved to a package root but accounted for no sources
|
|
37
|
-
* - `stale-dist` — resolved with a walked src/ tree whose newest source file
|
|
38
|
-
* is newer than the resolved dist entry file (first-class-extension D13:
|
|
39
|
-
* a merge would consume registry content the sources no longer match)
|
|
40
|
-
*/
|
|
41
|
-
outcome: 'resolved' | 'unresolvable' | 'empty' | 'stale-dist';
|
|
42
|
-
/**
|
|
43
|
-
* Source files this specifier accounted for in the analysis set: files it
|
|
44
|
-
* contributed, plus files a previous specifier or the caller's own file set
|
|
45
|
-
* already supplied (those are in the set, just not attributable to this
|
|
46
|
-
* collection pass). Files skipped by `preprocessFile` or unreadable ones are
|
|
47
|
-
* NOT counted — they never reach the analysis set.
|
|
48
|
-
*/
|
|
49
|
-
fileCount: number;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Resolve an absolute-path specifier (a relative `includes` entry already
|
|
53
|
-
* resolved against the system file) without a bundler: the path itself when it
|
|
54
|
-
* is a file, otherwise the extension and directory-index candidates built from
|
|
55
|
-
* the caller's extension set. Used only as a fallback — a bundler resolver that
|
|
56
|
-
* answers first still wins, since it also knows aliases and `.js`→`.ts` mapping.
|
|
57
|
-
*/
|
|
58
|
-
export declare function resolveAbsolutePathSpecifier(absSpecifier: string, extensionsSet: ReadonlySet<string>): string | null;
|
|
59
|
-
export interface CollectedExternalPackages {
|
|
60
|
-
/** New file entries (rootDir-relative, preprocessed) for the analysis set. */
|
|
61
|
-
entries: Array<{
|
|
62
|
-
path: string;
|
|
63
|
-
source: string;
|
|
64
|
-
}>;
|
|
65
|
-
/** specifier → rootDir-relative module-resolution entry (src/index.ts when present). */
|
|
66
|
-
packageMap: Record<string, string>;
|
|
67
|
-
/** specifier → absolute src/index.ts path, only for packages with one. */
|
|
68
|
-
sourceEntries: Map<string, string>;
|
|
69
|
-
/** specifier → absolute entry to scan for branded `Keyframes` collections —
|
|
70
|
-
* one per admitted specifier, whatever the package's shape: the redirected
|
|
71
|
-
* source entry when src/ serves it, the resolved (dist) entry otherwise.
|
|
72
|
-
* Keyed separately from `sourceEntries` because that map doubles as the
|
|
73
|
-
* hosts' module-resolution redirect and stays src-only by contract. */
|
|
74
|
-
keyframesScanEntries: Map<string, string>;
|
|
75
|
-
/** Absolute directories for bundler loader allowlisting (src/ or dist entry dir). */
|
|
76
|
-
packageDirs: string[];
|
|
77
|
-
/** Absolute package dir → EVERY declared specifier that claimed it, in
|
|
78
|
-
* declaration order (set-valued ownership — openspec:
|
|
79
|
-
* external-source-watch-ingestion, design D2). The first-wins
|
|
80
|
-
* single-value view correlation consumers key on derives via
|
|
81
|
-
* `firstOwners`. */
|
|
82
|
-
dirOwnerSets: Record<string, string[]>;
|
|
83
|
-
/** Absolute package dir → the EXACT extension list its collection walk
|
|
84
|
-
* used (dist-only dirs widen with the entry's own extension, e.g.
|
|
85
|
-
* `.mjs`). Hosts that rewalk or re-classify paths under a dir must use
|
|
86
|
-
* this same list — recomputing from the project default silently drops
|
|
87
|
-
* every file the widened walk admitted. */
|
|
88
|
-
dirExtensions: Record<string, string[]>;
|
|
89
|
-
/** rootDir-relative file path → owning specifier, for files THIS collection
|
|
90
|
-
* pushed (first-contributing specifier wins; files the caller's own set
|
|
91
|
-
* already supplied stay unattributed — they are consumer-owned). */
|
|
92
|
-
fileOwners: Record<string, string>;
|
|
93
|
-
/** One record per declared specifier, in declaration order. */
|
|
94
|
-
outcomes: ExternalPackageOutcome[];
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Shared external-package source collection (spec:
|
|
98
|
-
* external-package-file-discovery), consumed by both extraction plugins.
|
|
99
|
-
* For each specifier: resolve to an absolute entry (null/throw → silently
|
|
100
|
-
* skip; an absolute-path specifier falls back to a filesystem probe), walk up
|
|
101
|
-
* to the package root, then either discover sources under src/ (redirecting
|
|
102
|
-
* module resolution to src/index.ts when present) or fall back to ingesting
|
|
103
|
-
* the resolved entry file itself.
|
|
104
|
-
*
|
|
105
|
-
* The only bundler-specific seams are callbacks: specifier resolution,
|
|
106
|
-
* dedup against already-ingested files, per-file preprocessing (MDX), and
|
|
107
|
-
* the unreadable-file warning. Hashing and caching stay in the plugins —
|
|
108
|
-
* their cache policies legitimately differ.
|
|
109
|
-
*
|
|
110
|
-
* Alongside the aggregates, one `ExternalPackageOutcome` per declared
|
|
111
|
-
* specifier records what that specifier produced. Collection never reports on
|
|
112
|
-
* them — any warning or gate is the caller's policy.
|
|
113
|
-
*/
|
|
114
|
-
export declare function collectExternalPackageSources(opts: {
|
|
115
|
-
specifiers: string[];
|
|
116
|
-
/** Resolve a specifier to an absolute entry path; null (or a throw) skips it. */
|
|
117
|
-
resolveSpecifier: (specifier: string) => string | null | Promise<string | null>;
|
|
118
|
-
rootDir: string;
|
|
119
|
-
extensionsSet: ReadonlySet<string>;
|
|
120
|
-
/** Does the caller's file set already contain this rootDir-relative path? */
|
|
121
|
-
hasEntry: (relPath: string) => boolean;
|
|
122
|
-
/**
|
|
123
|
-
* Preprocess a discovered source (e.g. MDX→tsx with a path rewrite).
|
|
124
|
-
* Return null to skip the file; return the input unchanged to pass through.
|
|
125
|
-
*/
|
|
126
|
-
preprocessFile: (source: string, relPath: string, absPath: string) => Promise<{
|
|
127
|
-
source: string;
|
|
128
|
-
relPath: string;
|
|
129
|
-
} | null>;
|
|
130
|
-
/** Called when a discovered file cannot be read; the file is skipped. */
|
|
131
|
-
onUnreadable: (relPath: string, error: unknown) => void;
|
|
132
|
-
/**
|
|
133
|
-
* Called once per specifier immediately after its package dir is derived
|
|
134
|
-
* and BEFORE that package's sources are walked (openspec:
|
|
135
|
-
* external-source-watch-ingestion, design D4 — a host can open its
|
|
136
|
-
* watcher with no blind gap between scan and watch).
|
|
137
|
-
*/
|
|
138
|
-
onPackageResolved?: (specifier: string, packageDir: string) => void;
|
|
139
|
-
}): Promise<CollectedExternalPackages>;
|
|
140
|
-
/** First-declared specifier per package dir — the single-value ownership
|
|
141
|
-
* view correlation consumers key on, derived from `dirOwnerSets`. */
|
|
142
|
-
export declare function firstOwners(dirOwnerSets: Record<string, string[]>): Record<string, string>;
|
|
143
|
-
/**
|
|
144
|
-
* Excise a set of rejected specifiers from a collection result ATOMICALLY
|
|
145
|
-
* (openspec: external-source-watch-ingestion, design D5): the returned copy
|
|
146
|
-
* carries no entries, package-map targets, source entries, package dirs, or
|
|
147
|
-
* ownership for the rejected packages — a package dir is removed only when
|
|
148
|
-
* EVERY specifier that claimed it is rejected (a dir-level rejection, such
|
|
149
|
-
* as the cross-volume gate, always rejects them together). Outcome records
|
|
150
|
-
* are reporting inputs, not membership, and pass through untouched.
|
|
151
|
-
*/
|
|
152
|
-
export declare function excludeCollectedPackages(collected: CollectedExternalPackages, rejectedSpecifiers: ReadonlySet<string>, rootDir: string): CollectedExternalPackages;
|
|
153
|
-
/**
|
|
154
|
-
* Extract external DS package names from inheritance declarations in the
|
|
155
|
-
* system file.
|
|
156
|
-
*
|
|
157
|
-
* Supports four forms:
|
|
158
|
-
* - Primary: `createSystem(...).extend(identifier)` chain calls
|
|
159
|
-
* (repeatable, mixable with `.from()` links; each call
|
|
160
|
-
* contributes one source; a library-bundle identifier
|
|
161
|
-
* traces its base import)
|
|
162
|
-
* - Deprecated chain: `createSystem(...).from(identifier)` chain calls
|
|
163
|
-
* - Deprecated alias: `createSystem({ includes: [identifier, ...] })`
|
|
164
|
-
* - Legacy: `.includes([identifier, ...])` chain method (RC
|
|
165
|
-
* migration fallback)
|
|
166
|
-
*
|
|
167
|
-
* For each identifier found, traces back to its import declaration and returns
|
|
168
|
-
* the import specifier: a bare specifier normalized to its package name, a
|
|
169
|
-
* relative specifier resolved against the system file's directory into an
|
|
170
|
-
* absolute path (so a sibling package referenced by path contributes discovery
|
|
171
|
-
* too). Only packages explicitly declared through one of these forms are
|
|
172
|
-
* treated as external DS dependencies.
|
|
173
|
-
*
|
|
174
|
-
* Falls back to empty array if no declaration is found.
|
|
175
|
-
*/
|
|
176
|
-
/**
|
|
177
|
-
* The message for the strict/warn gate over unresolvable includes, or null
|
|
178
|
-
* when every declared specifier resolved (external-package-file-discovery:
|
|
179
|
-
* silence is never an outcome — non-strict consumers warn with this line,
|
|
180
|
-
* strict consumers throw it).
|
|
181
|
-
*/
|
|
182
|
-
export declare function unresolvableIncludesMessage(outcomes: ExternalPackageOutcome[]): string | null;
|
|
183
|
-
/**
|
|
184
|
-
* The message for the strict/warn gate over stale dist entries
|
|
185
|
-
* (first-class-extension D13), or null when no declared specifier is stale.
|
|
186
|
-
* A stale dist silently skews merged registry content while discovery
|
|
187
|
-
* compiles the fresh sources, so it surfaces like an unresolvable specifier:
|
|
188
|
-
* non-strict consumers warn with this line, strict consumers throw it.
|
|
189
|
-
*/
|
|
190
|
-
export declare function staleDistIncludesMessage(outcomes: ExternalPackageOutcome[]): string | null;
|
|
191
|
-
export declare function extractSystemFilePackages(systemFilePath: string): string[];
|
|
192
|
-
//# sourceMappingURL=discover-packages.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discover-packages.d.ts","sourceRoot":"","sources":["../pipeline/discover-packages.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAS5D;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,UAKhC,CAAC;AAEF;6EAC6E;AAC7E,wBAAgB,6BAA6B,CAAC,GA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;GAKG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,sBAAsB,EAAE,GACjC,MAAM,GAAG,IAAI,CAMf;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,sBAAsB,EAAE,GACjC,MAAM,GAAG,IAAI,CAMf;AAED,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,EAAE,CAoN1E"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Manifest `dynamic_props` → runtime `dynamicPropConfig` mapping.
|
|
3
|
-
*
|
|
4
|
-
* Single authoritative copy for both extraction plugins: the emitted
|
|
5
|
-
* `dynamicPropConfig` object in each plugin's system-props module is
|
|
6
|
-
* `JSON.stringify(buildDynamicPropConfig(...))`, so field order and the
|
|
7
|
-
* omission rules (no `property` when absent, no `properties` when empty, no
|
|
8
|
-
* `transformName` when absent, no `scaleValues` when empty) are part of the
|
|
9
|
-
* emitted-bundle contract. Field order matches the per-component
|
|
10
|
-
* `customDynamicConfig` the Rust assembler emits.
|
|
11
|
-
*
|
|
12
|
-
* The v2 manifest is the only producer, and it serializes `DynamicPropMeta`
|
|
13
|
-
* with `serde(rename_all = "camelCase")` — so camelCase is the only spelling
|
|
14
|
-
* this reader accepts, and the throw below is what a rename on the Rust side
|
|
15
|
-
* runs into.
|
|
16
|
-
*/
|
|
17
|
-
export interface DynamicPropMeta {
|
|
18
|
-
varName: string;
|
|
19
|
-
slotClass: string;
|
|
20
|
-
property?: string | null;
|
|
21
|
-
properties?: readonly string[] | null;
|
|
22
|
-
transformName?: string | null;
|
|
23
|
-
/** Carried by the manifest for the per-component config; the shared module
|
|
24
|
-
* resolves transforms through the `transforms` registry, so it is dropped. */
|
|
25
|
-
transformFnSource?: string | null;
|
|
26
|
-
scaleValues?: Record<string, string> | null;
|
|
27
|
-
}
|
|
28
|
-
export interface DynamicPropConfigEntry {
|
|
29
|
-
varName: string;
|
|
30
|
-
slotClass: string;
|
|
31
|
-
property?: string;
|
|
32
|
-
properties?: readonly string[];
|
|
33
|
-
transformName?: string;
|
|
34
|
-
scaleValues?: Record<string, string>;
|
|
35
|
-
}
|
|
36
|
-
export declare function buildDynamicPropConfig(dynamicProps: Record<string, DynamicPropMeta>): Record<string, DynamicPropConfigEntry>;
|
|
37
|
-
//# sourceMappingURL=dynamic-prop-config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-prop-config.d.ts","sourceRoot":"","sources":["../pipeline/dynamic-prop-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;mFAC+E;IAC/E,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CAC7C;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAC5C,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CA4BxC"}
|
package/dist/engine-adapter.d.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The v2 `ExtractEngine` adapter, hoisted to one authoritative copy.
|
|
3
|
-
*
|
|
4
|
-
* Both extraction plugins (next-plugin, vite-plugin) drive the stateful v2
|
|
5
|
-
* `ExtractEngine` through the engine-agnostic surface the v1 native module
|
|
6
|
-
* already exposes (loadSystemModule / analyzeProject / transformFile /
|
|
7
|
-
* clearAnalysisCache). This factory builds that surface once; the plugins
|
|
8
|
-
* differ only in (a) how the engine option is resolved, (b) how the native
|
|
9
|
-
* module is loaded, and (c) where the per-run state lives — so those are the
|
|
10
|
-
* injected dependencies.
|
|
11
|
-
*
|
|
12
|
-
* State storage is the pivotal difference: next-plugin must survive the
|
|
13
|
-
* ESM/CJS double-load (the plugin loads as ESM via next.config, the webpack
|
|
14
|
-
* loader via CJS require), so it backs the store with globalThis; vite-plugin
|
|
15
|
-
* keeps per-plugin-instance state in closure variables. The one-shot drift
|
|
16
|
-
* flag lives in the store too, so next's warning stays one-shot across the
|
|
17
|
-
* double-load.
|
|
18
|
-
*
|
|
19
|
-
* Loading semantics (lazy CJS require, fail-loud, no silent fallback to the
|
|
20
|
-
* other engine) live at the call site via `loadNativeEngine`; this module
|
|
21
|
-
* never imports the native binding, and never imports from either plugin,
|
|
22
|
-
* webpack, or vite (dependency direction: plugins -> extract).
|
|
23
|
-
*/
|
|
24
|
-
/** The stateful v2 engine handle produced by `new native.ExtractEngine(...)`. */
|
|
25
|
-
export interface V2ExtractEngine {
|
|
26
|
-
analyze(filesJson: string): string;
|
|
27
|
-
transformFile(path: string): string;
|
|
28
|
-
clearCache(): void;
|
|
29
|
-
}
|
|
30
|
-
/** Per-file transform result, as both plugins consume it. */
|
|
31
|
-
export interface TransformFileResult {
|
|
32
|
-
code: string;
|
|
33
|
-
hasComponents: boolean;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* The engine-agnostic API surface. The v1 leg is the raw native module (which
|
|
37
|
-
* already exposes these methods); the v2 leg is the adapter this factory
|
|
38
|
-
* builds. The positional `analyzeProject` tuple mirrors the NAPI contract in
|
|
39
|
-
* `analyze-project-args.ts`.
|
|
40
|
-
*/
|
|
41
|
-
export interface EngineApi {
|
|
42
|
-
loadSystemModule: (...args: unknown[]) => any;
|
|
43
|
-
/** Keyframes-only scan of an external package entry. */
|
|
44
|
-
scanKeyframesExports: (entryPath: string, rootDir: string) => string | null;
|
|
45
|
-
analyzeProject: (filesJson: string, scalesJson: string, variableMapJson: string, contextualVarsJson: string | null, propConfigJson: string, groupRegistryJson: string, packageResolutionJson: string, devMode: boolean, emitterConfigJson: string | null, selectorAliasesJson: string | null, selectorOrderJson: string | null, globalStyleBlocksJson: string | null, pathAliasesJson: string | null, keyframesJson: string | null, staticCssJson: string | null, conditionAliasesJson: string | null, externalDirsJson: string | null, transformSourcesJson: string | null) => string;
|
|
46
|
-
transformFile: (source: string, path: string, manifest: string) => TransformFileResult;
|
|
47
|
-
clearAnalysisCache: () => void;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Storage for the per-run engine instance, the analyze-time sources (drift
|
|
51
|
-
* detection), and the one-shot drift flag. next backs this with globalThis;
|
|
52
|
-
* vite with closure variables.
|
|
53
|
-
*/
|
|
54
|
-
export interface V2EngineStateStore {
|
|
55
|
-
getEngine(): V2ExtractEngine | null;
|
|
56
|
-
setEngine(engine: V2ExtractEngine | null): void;
|
|
57
|
-
getSentSources(): Map<string, string> | null;
|
|
58
|
-
setSentSources(sources: Map<string, string> | null): void;
|
|
59
|
-
getDriftWarned(): boolean;
|
|
60
|
-
setDriftWarned(value: boolean): void;
|
|
61
|
-
}
|
|
62
|
-
/** The native engine module. Its own generated `.d.ts` is authoritative. */
|
|
63
|
-
type NativeEngineModule = any;
|
|
64
|
-
export interface V2EngineAdapterDeps {
|
|
65
|
-
/** Log label for the drift warning and the fail-loud transform error
|
|
66
|
-
* (e.g. 'animus-next', 'animus-extract'). */
|
|
67
|
-
label: string;
|
|
68
|
-
/** Whether v2 is selected. When false, `engineApi()` returns the raw native
|
|
69
|
-
* module unchanged (the v1 leg). next reads the shared engine choice from
|
|
70
|
-
* globalThis; vite the per-plugin resolved option. */
|
|
71
|
-
isV2(): boolean;
|
|
72
|
-
/** Require the native engine module. Loading semantics — lazy CJS require,
|
|
73
|
-
* fail-loud, no silent fallback — live here. */
|
|
74
|
-
loadNativeEngine(): NativeEngineModule;
|
|
75
|
-
/** Per-run state storage (globalThis for next, closure for vite). */
|
|
76
|
-
store: V2EngineStateStore;
|
|
77
|
-
/** When true, `transformFile` passes paths absent from the last `analyze()`
|
|
78
|
-
* set through unchanged (v1 parity: the webpack loader hands the adapter
|
|
79
|
-
* files outside the analysis universe — generated `.animus/*` modules,
|
|
80
|
-
* workspace-resolved library dist; vite pre-filters them, so it leaves this
|
|
81
|
-
* off). */
|
|
82
|
-
passThroughUnknownPaths?: boolean;
|
|
83
|
-
/** Optional pre-analyze re-hydration of empty sources. vite's HMR sends
|
|
84
|
-
* empty sources for unchanged files and v2 has no Rust-side cache, so vite
|
|
85
|
-
* refills them from its own file cache before analyze; next always sends
|
|
86
|
-
* full sources. Identity when omitted. */
|
|
87
|
-
rehydrateFilesJson?(filesJsonRaw: string): string;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Build the engine-agnostic `engineApi()` both plugins call. Returns a function
|
|
91
|
-
* (invoked per call site) so `isV2()` and `loadNativeEngine()` re-evaluate each
|
|
92
|
-
* time — next reads its engine choice and native module dynamically from
|
|
93
|
-
* globalThis.
|
|
94
|
-
*/
|
|
95
|
-
export declare function createV2EngineApi(deps: V2EngineAdapterDeps): () => EngineApi;
|
|
96
|
-
export {};
|
|
97
|
-
//# sourceMappingURL=engine-adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"engine-adapter.d.ts","sourceRoot":"","sources":["../pipeline/engine-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;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,MAAM,KACb,mBAAmB,CAAC;IACzB,kBAAkB,EAAE,MAAM,IAAI,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,IAAI,eAAe,GAAG,IAAI,CAAC;IACpC,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,GAAG,IAAI,CAAC;IAChD,cAAc,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAC7C,cAAc,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1D,cAAc,IAAI,OAAO,CAAC;IAC1B,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CACtC;AAED,4EAA4E;AAE5E,KAAK,kBAAkB,GAAG,GAAG,CAAC;AA4B9B,MAAM,WAAW,mBAAmB;IAClC;kDAC8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd;;2DAEuD;IACvD,IAAI,IAAI,OAAO,CAAC;IAChB;qDACiD;IACjD,gBAAgB,IAAI,kBAAkB,CAAC;IACvC,qEAAqE;IACrE,KAAK,EAAE,kBAAkB,CAAC;IAC1B;;;;gBAIY;IACZ,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;+CAG2C;IAC3C,kBAAkB,CAAC,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;CACnD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,SAAS,CAwH5E"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Loud rejection of the retired v1 extraction engine (openspec:
|
|
3
|
-
* retire-extract-v1).
|
|
4
|
-
*
|
|
5
|
-
* v2 is the only engine. Selecting v1 — via a plugin `engine: 'v1'` option or
|
|
6
|
-
* the `ANIMUS_ENGINE=v1` fixture env override — is a build-stopping error, never
|
|
7
|
-
* a silent upgrade to v2 (design D1: a silent flip would let a pinned consumer's
|
|
8
|
-
* build change engines without notice). Both extraction plugins call this before
|
|
9
|
-
* any engine selection so the rejection is uniform and the message is defined
|
|
10
|
-
* once.
|
|
11
|
-
*/
|
|
12
|
-
/** The one canonical retirement message, shared verbatim by both plugins and
|
|
13
|
-
* the env path (tasks.md cross-cutting: define once, reuse). */
|
|
14
|
-
export declare const RETIRED_ENGINE_MESSAGE: string;
|
|
15
|
-
/**
|
|
16
|
-
* Throw the canonical retirement error when v1 is selected through either
|
|
17
|
-
* surface. Accepts the raw engine option as a string because the option type no
|
|
18
|
-
* longer admits `'v1'` — callers cast it so a stale `'v1'` config still fails
|
|
19
|
-
* loud at runtime instead of being silently coerced.
|
|
20
|
-
*/
|
|
21
|
-
export declare function assertNoRetiredEngineSelection(engineOption: string | undefined): void;
|
|
22
|
-
//# sourceMappingURL=engine-retirement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"engine-retirement.d.ts","sourceRoot":"","sources":["../pipeline/engine-retirement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;iEACiE;AACjE,eAAO,MAAM,sBAAsB,QAEyC,CAAC;AAE7E;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,IAAI,CAIN"}
|