@csszyx/core 0.9.0 → 0.9.1
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/native/index.d.ts +32 -2
- package/native/index.js +2 -2
- package/package.json +10 -10
- package/pkg/csszyx_core_bg.wasm +0 -0
- package/pkg-node/csszyx_core_bg.wasm +0 -0
package/native/index.d.ts
CHANGED
|
@@ -17,6 +17,21 @@ export interface NativeTransformFile {
|
|
|
17
17
|
source: string;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
/** Options passed to the native transform. */
|
|
21
|
+
export interface NativeTransformOptions {
|
|
22
|
+
/** Whether dynamic CSS custom properties should use tiered short names. */
|
|
23
|
+
mangleVars?: boolean;
|
|
24
|
+
/** Maximum cascade depth for component-tier CSS variable hoisting. */
|
|
25
|
+
mangleVarHoistMaxDepth?: number;
|
|
26
|
+
/** Exact app-owned global custom-property aliases for static sz values. */
|
|
27
|
+
globalVarAliases?: Array<{
|
|
28
|
+
/** Original custom-property name, including `--`. */
|
|
29
|
+
original: string;
|
|
30
|
+
/** Alias custom-property name, including `--`. */
|
|
31
|
+
alias: string;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
|
|
20
35
|
/** Native transform output shape returned per source file. */
|
|
21
36
|
export interface NativeTransformResult {
|
|
22
37
|
/** Rewritten source code. */
|
|
@@ -40,6 +55,13 @@ export interface NativeTransformResult {
|
|
|
40
55
|
/** Source path associated with the token. */
|
|
41
56
|
path: string;
|
|
42
57
|
}>;
|
|
58
|
+
/** CSS custom property mangle metadata. */
|
|
59
|
+
cssVariableMap: Array<{
|
|
60
|
+
/** Original csszyx-generated custom property name. */
|
|
61
|
+
original: string;
|
|
62
|
+
/** Mangled custom property name. */
|
|
63
|
+
mangled: string;
|
|
64
|
+
}>;
|
|
43
65
|
/** Native transform metadata used by unplugin and benchmarks. */
|
|
44
66
|
metadata: {
|
|
45
67
|
/** Whether source code changed. */
|
|
@@ -97,9 +119,13 @@ export interface NativeBinding {
|
|
|
97
119
|
* Transforms source files with the native Rust core.
|
|
98
120
|
*
|
|
99
121
|
* @param files Source files to transform.
|
|
122
|
+
* @param options Native transform options.
|
|
100
123
|
* @returns Native transform results in input order.
|
|
101
124
|
*/
|
|
102
|
-
transformBatch(
|
|
125
|
+
transformBatch(
|
|
126
|
+
files: NativeTransformFile[],
|
|
127
|
+
options?: NativeTransformOptions,
|
|
128
|
+
): NativeTransformResult[];
|
|
103
129
|
}
|
|
104
130
|
|
|
105
131
|
/**
|
|
@@ -123,6 +149,10 @@ export function loadNativeBinding(
|
|
|
123
149
|
* Transforms a batch of files with the native Rust core.
|
|
124
150
|
*
|
|
125
151
|
* @param files Source files to transform.
|
|
152
|
+
* @param options Native transform options.
|
|
126
153
|
* @returns Native transform results in input order.
|
|
127
154
|
*/
|
|
128
|
-
export function transformBatch(
|
|
155
|
+
export function transformBatch(
|
|
156
|
+
files: NativeTransformFile[],
|
|
157
|
+
options?: NativeTransformOptions,
|
|
158
|
+
): NativeTransformResult[];
|
package/native/index.js
CHANGED
|
@@ -60,9 +60,9 @@ export function loadNativeBinding(packageName = getNativePackageName()) {
|
|
|
60
60
|
return binding;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
export function transformBatch(_files) {
|
|
63
|
+
export function transformBatch(_files, options) {
|
|
64
64
|
const binding = loadNativeBinding();
|
|
65
|
-
return binding.transformBatch(_files);
|
|
65
|
+
return binding.transformBatch(_files, options);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
function isModuleNotFoundForPackage(err, packageName) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@csszyx/core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "WASM core for csszyx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"csszyx",
|
|
@@ -46,21 +46,21 @@
|
|
|
46
46
|
"vitest": "^4.1.6"
|
|
47
47
|
},
|
|
48
48
|
"optionalDependencies": {
|
|
49
|
-
"@csszyx/core-darwin-arm64": "0.9.
|
|
50
|
-
"@csszyx/core-darwin-x64": "0.9.
|
|
51
|
-
"@csszyx/core-linux-
|
|
52
|
-
"@csszyx/core-linux-arm64-
|
|
53
|
-
"@csszyx/core-linux-x64-
|
|
54
|
-
"@csszyx/core-win32-arm64-msvc": "0.9.
|
|
55
|
-
"@csszyx/core-linux-
|
|
56
|
-
"@csszyx/core-win32-x64-msvc": "0.9.
|
|
49
|
+
"@csszyx/core-darwin-arm64": "0.9.1",
|
|
50
|
+
"@csszyx/core-darwin-x64": "0.9.1",
|
|
51
|
+
"@csszyx/core-linux-arm64-gnu": "0.9.1",
|
|
52
|
+
"@csszyx/core-linux-arm64-musl": "0.9.1",
|
|
53
|
+
"@csszyx/core-linux-x64-gnu": "0.9.1",
|
|
54
|
+
"@csszyx/core-win32-arm64-msvc": "0.9.1",
|
|
55
|
+
"@csszyx/core-linux-x64-musl": "0.9.1",
|
|
56
|
+
"@csszyx/core-win32-x64-msvc": "0.9.1"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "node scripts/preflight.mjs && wasm-pack build --mode no-install --target bundler --out-dir pkg && wasm-pack build --mode no-install --target nodejs --out-dir pkg-node && rm -f pkg/.gitignore pkg-node/.gitignore && node scripts/run-wasm-opt.mjs",
|
|
60
60
|
"test": "vitest run",
|
|
61
61
|
"test:watch": "vitest",
|
|
62
62
|
"native:check": "node scripts/check-native.mjs",
|
|
63
|
-
"native:build": "node scripts/build-native.mjs --release",
|
|
63
|
+
"native:build": "node scripts/build-native.mjs --release --native-engine",
|
|
64
64
|
"native:engine:smoke": "node scripts/smoke-native-engine.mjs",
|
|
65
65
|
"native:packages": "node scripts/validate-native-packages.mjs",
|
|
66
66
|
"native:unavailable:smoke": "node scripts/smoke-native-unavailable.mjs",
|
package/pkg/csszyx_core_bg.wasm
CHANGED
|
Binary file
|
|
Binary file
|