@master/css-binding-wasm-compiler 0.0.0-site.1793661807.g69c9aebcf628 → 2.0.0

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.
@@ -23,7 +23,11 @@ export function compareProjectSnapshots(request: any): any;
23
23
 
24
24
  export function compileCSSDirectives(source: string, options: any): any;
25
25
 
26
- export function compileCSSStylesheetGraph(request: any): any;
26
+ /**
27
+ * JSON in and out, like the native binding, so both share the compiler's reuse of
28
+ * identical requests.
29
+ */
30
+ export function compileCSSStylesheetGraph(request_json: string): string;
27
31
 
28
32
  export function compileDefaultPresetManifest(request: any): any;
29
33
 
@@ -61,7 +65,7 @@ export interface InitOutput {
61
65
  readonly bindingInfo: () => [number, number, number];
62
66
  readonly compareProjectSnapshots: (a: any) => [number, number, number];
63
67
  readonly compileCSSDirectives: (a: number, b: number, c: any) => [number, number, number];
64
- readonly compileCSSStylesheetGraph: (a: any) => [number, number, number];
68
+ readonly compileCSSStylesheetGraph: (a: number, b: number) => [number, number, number, number];
65
69
  readonly compileDefaultPresetManifest: (a: any) => [number, number, number];
66
70
  readonly compileManifestInput: (a: any, b: any) => [number, number, number];
67
71
  readonly compileNativeCSS: (a: number, b: number, c: any) => [number, number, number];
@@ -88,8 +92,8 @@ export interface InitOutput {
88
92
  readonly __externref_table_alloc: () => number;
89
93
  readonly __wbindgen_externrefs: WebAssembly.Table;
90
94
  readonly __externref_table_dealloc: (a: number) => void;
91
- readonly __externref_drop_slice: (a: number, b: number) => void;
92
95
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
96
+ readonly __externref_drop_slice: (a: number, b: number) => void;
93
97
  readonly __wbindgen_start: () => void;
94
98
  }
95
99
 
@@ -156,15 +156,30 @@ export function compileCSSDirectives(source, options) {
156
156
  }
157
157
 
158
158
  /**
159
- * @param {any} request
160
- * @returns {any}
159
+ * JSON in and out, like the native binding, so both share the compiler's reuse of
160
+ * identical requests.
161
+ * @param {string} request_json
162
+ * @returns {string}
161
163
  */
162
- export function compileCSSStylesheetGraph(request) {
163
- const ret = wasm.compileCSSStylesheetGraph(request);
164
- if (ret[2]) {
165
- throw takeFromExternrefTable0(ret[1]);
164
+ export function compileCSSStylesheetGraph(request_json) {
165
+ let deferred3_0;
166
+ let deferred3_1;
167
+ try {
168
+ const ptr0 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
169
+ const len0 = WASM_VECTOR_LEN;
170
+ const ret = wasm.compileCSSStylesheetGraph(ptr0, len0);
171
+ var ptr2 = ret[0];
172
+ var len2 = ret[1];
173
+ if (ret[3]) {
174
+ ptr2 = 0; len2 = 0;
175
+ throw takeFromExternrefTable0(ret[2]);
176
+ }
177
+ deferred3_0 = ptr2;
178
+ deferred3_1 = len2;
179
+ return getStringFromWasm0(ptr2, len2);
180
+ } finally {
181
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
166
182
  }
167
- return takeFromExternrefTable0(ret[0]);
168
183
  }
169
184
 
170
185
  /**
@@ -7,7 +7,7 @@ export const analyzeStandaloneDirectives: (a: number, b: number) => [number, num
7
7
  export const bindingInfo: () => [number, number, number];
8
8
  export const compareProjectSnapshots: (a: any) => [number, number, number];
9
9
  export const compileCSSDirectives: (a: number, b: number, c: any) => [number, number, number];
10
- export const compileCSSStylesheetGraph: (a: any) => [number, number, number];
10
+ export const compileCSSStylesheetGraph: (a: number, b: number) => [number, number, number, number];
11
11
  export const compileDefaultPresetManifest: (a: any) => [number, number, number];
12
12
  export const compileManifestInput: (a: any, b: any) => [number, number, number];
13
13
  export const compileNativeCSS: (a: number, b: number, c: any) => [number, number, number];
@@ -34,6 +34,6 @@ export const __wbindgen_exn_store: (a: number) => void;
34
34
  export const __externref_table_alloc: () => number;
35
35
  export const __wbindgen_externrefs: WebAssembly.Table;
36
36
  export const __externref_table_dealloc: (a: number) => void;
37
- export const __externref_drop_slice: (a: number, b: number) => void;
38
37
  export const __wbindgen_free: (a: number, b: number, c: number) => void;
38
+ export const __externref_drop_slice: (a: number, b: number) => void;
39
39
  export const __wbindgen_start: () => void;
@@ -127,13 +127,31 @@ function compileCSSDirectives(source, options) {
127
127
  return takeFromExternrefTable0(ret[0]);
128
128
  }
129
129
  /**
130
- * @param {any} request
131
- * @returns {any}
130
+ * JSON in and out, like the native binding, so both share the compiler's reuse of
131
+ * identical requests.
132
+ * @param {string} request_json
133
+ * @returns {string}
132
134
  */
133
- function compileCSSStylesheetGraph(request) {
134
- const ret = wasm.compileCSSStylesheetGraph(request);
135
- if (ret[2]) throw takeFromExternrefTable0(ret[1]);
136
- return takeFromExternrefTable0(ret[0]);
135
+ function compileCSSStylesheetGraph(request_json) {
136
+ let deferred3_0;
137
+ let deferred3_1;
138
+ try {
139
+ const ptr0 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
140
+ const len0 = WASM_VECTOR_LEN;
141
+ const ret = wasm.compileCSSStylesheetGraph(ptr0, len0);
142
+ var ptr2 = ret[0];
143
+ var len2 = ret[1];
144
+ if (ret[3]) {
145
+ ptr2 = 0;
146
+ len2 = 0;
147
+ throw takeFromExternrefTable0(ret[2]);
148
+ }
149
+ deferred3_0 = ptr2;
150
+ deferred3_1 = len2;
151
+ return getStringFromWasm0(ptr2, len2);
152
+ } finally {
153
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
154
+ }
137
155
  }
138
156
  /**
139
157
  * @param {any} request
package/dist/index.js CHANGED
@@ -72,7 +72,7 @@ async function createCompilerWasmSession(options = {}) {
72
72
  resolveCSSStylesheetGraph: (request) => module.resolveCSSStylesheetGraph(request),
73
73
  prepareCSSStylesheetBundle: (request) => module.prepareCSSStylesheetBundle(request),
74
74
  renderCSSStylesheetBundle: (request) => module.renderCSSStylesheetBundle(request),
75
- compileCSSStylesheetGraph: (request) => module.compileCSSStylesheetGraph(request)
75
+ compileCSSStylesheetGraph: (request) => JSON.parse(module.compileCSSStylesheetGraph(JSON.stringify(request)))
76
76
  };
77
77
  }
78
78
  async function createCompilerRenderSession(manifestJSON, emittedGlobalsJSON, options = {}) {
package/package.json CHANGED
@@ -4,8 +4,21 @@
4
4
  "engines": {
5
5
  "node": "^24"
6
6
  },
7
+ "scripts": {
8
+ "build": "bun --bun tsdown --config ../../shared/tsdown-package.config.ts",
9
+ "build:artifacts": "cargo xtask build-wasm compiler",
10
+ "dev": "bun --bun tsdown --config ../../shared/tsdown-package.config.ts --watch",
11
+ "test": "bun --bun vitest run",
12
+ "type-check": "bun --bun tsc -b tsconfig.typecheck.json",
13
+ "lint": "bun --bun eslint"
14
+ },
7
15
  "license": "MIT",
8
16
  "description": "Internal Master CSS compiler Wasm binding provider.",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/master-co/css.git",
20
+ "directory": "packages/binding-wasm-compiler"
21
+ },
9
22
  "sideEffects": false,
10
23
  "types": "./dist/provider.d.ts",
11
24
  "exports": {
@@ -27,8 +40,8 @@
27
40
  "provenance": true
28
41
  },
29
42
  "dependencies": {
30
- "@master/css-schema": "0.0.0-site.1793661807.g69c9aebcf628"
43
+ "@master/css-schema": "2.0.0"
31
44
  },
32
- "version": "0.0.0-site.1793661807.g69c9aebcf628",
33
- "gitHead": "69c9aebcf628eb529001b9fa1b3536306f1b139e"
45
+ "version": "2.0.0",
46
+ "gitHead": "6bf9adc4432b67e62613caea59d3b554711b4d54"
34
47
  }