@pandacss/compiler-wasm 2.0.0-beta.14 → 2.0.0-beta.16

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/dist/index.d.ts CHANGED
@@ -30,7 +30,6 @@ interface TokenDictionaryInput {
30
30
  vars: Record<string, string>;
31
31
  }
32
32
  type JsxFramework = 'react' | 'solid' | 'preact' | 'vue' | 'qwik' | (string & {});
33
- type CssSyntax = 'template-literal' | 'object-literal';
34
33
  interface MatchersInput {
35
34
  css?: MatcherInput;
36
35
  recipe?: MatcherInput;
@@ -41,8 +40,6 @@ interface MatchersInput {
41
40
  jsxFramework?: JsxFramework;
42
41
  /** Defaults to `["styled"]` when omitted. */
43
42
  jsxFactories?: string[];
44
- /** CSS authoring syntax preference. Omit for object-literal mode. */
45
- syntax?: CssSyntax;
46
43
  /** Enable `token('…')` folding by passing a resolved dictionary. */
47
44
  tokenDictionary?: TokenDictionaryInput;
48
45
  }
@@ -74,6 +71,7 @@ declare class WasmCompiler {
74
71
  refreshFile(path: string): boolean;
75
72
  refreshFileSource(path: string, source: string): boolean;
76
73
  removeFile(path: string): boolean;
74
+ affectedFiles(): string[];
77
75
  clear(): void;
78
76
  scan(options?: ScanOptions): string[];
79
77
  realpath(path: string): string;
package/dist/index.js CHANGED
@@ -47,12 +47,19 @@ var BrowserDriver = class extends BaseDriver {
47
47
  return NO_CHANGE;
48
48
  }
49
49
  applyChange(change) {
50
+ const changed = this.trackSourceChange(change, this.#applySourceChange(change));
51
+ const refreshed = this.refreshAffectedFiles();
52
+ return changed || refreshed;
53
+ }
54
+ #applySourceChange(change) {
50
55
  if (change.kind === "unlink") {
51
56
  this.compiler.fs.removeFile?.(change.path);
52
57
  return this.compiler.removeFile(change.path);
53
58
  }
54
59
  if (change.content == null) return false;
55
60
  this.compiler.fs.addFile?.(change.path, change.content);
61
+ if (this.compiler.refreshFileSource(change.path, change.content)) return true;
62
+ if (!this.isSourceFile(change.path)) return false;
56
63
  this.compiler.parseFileSource(change.path, change.content);
57
64
  return true;
58
65
  }
package/dist/web.d.ts CHANGED
@@ -30,7 +30,6 @@ interface TokenDictionaryInput {
30
30
  vars: Record<string, string>;
31
31
  }
32
32
  type JsxFramework = 'react' | 'solid' | 'preact' | 'vue' | 'qwik' | (string & {});
33
- type CssSyntax = 'template-literal' | 'object-literal';
34
33
  interface MatchersInput {
35
34
  css?: MatcherInput;
36
35
  recipe?: MatcherInput;
@@ -41,8 +40,6 @@ interface MatchersInput {
41
40
  jsxFramework?: JsxFramework;
42
41
  /** Defaults to `["styled"]` when omitted. */
43
42
  jsxFactories?: string[];
44
- /** CSS authoring syntax preference. Omit for object-literal mode. */
45
- syntax?: CssSyntax;
46
43
  /** Enable `token('…')` folding by passing a resolved dictionary. */
47
44
  tokenDictionary?: TokenDictionaryInput;
48
45
  }
@@ -74,6 +71,7 @@ declare class WasmCompiler {
74
71
  refreshFile(path: string): boolean;
75
72
  refreshFileSource(path: string, source: string): boolean;
76
73
  removeFile(path: string): boolean;
74
+ affectedFiles(): string[];
77
75
  clear(): void;
78
76
  scan(options?: ScanOptions): string[];
79
77
  realpath(path: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/compiler-wasm",
3
- "version": "2.0.0-beta.14",
3
+ "version": "2.0.0-beta.16",
4
4
  "description": "WebAssembly binding for the Panda compiler engine (browser/playground target)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -38,11 +38,11 @@
38
38
  "pkg-web"
39
39
  ],
40
40
  "dependencies": {
41
- "@pandacss/compiler-shared": "2.0.0-beta.14",
42
- "@pandacss/types": "2.0.0-beta.14"
41
+ "@pandacss/compiler-shared": "2.0.0-beta.16",
42
+ "@pandacss/types": "2.0.0-beta.16"
43
43
  },
44
44
  "devDependencies": {
45
- "@pandacss/config": "2.0.0-beta.14"
45
+ "@pandacss/config": "2.0.0-beta.16"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=22"
@@ -19,6 +19,11 @@ export class WasmCompiler {
19
19
  private constructor();
20
20
  free(): void;
21
21
  [Symbol.dispose](): void;
22
+ /**
23
+ * Files whose folded imports changed since the last call. Clears on read.
24
+ * Re-parse each via `refreshFile`, then call again until empty.
25
+ */
26
+ affectedFiles(): string[];
22
27
  /**
23
28
  * Hydrate an external build info into this project (additive), optionally
24
29
  * restricted to imported modules (tree-shaking). Returns `false` on a
@@ -214,8 +219,8 @@ export class WasmCompiler {
214
219
  */
215
220
  parseFileSource(path: string, source: string): any;
216
221
  /**
217
- * Read + parse source paths returned from `scan()`. Returns one report per
218
- * successfully parsed path.
222
+ * Read + parse source paths from `scan()`. One report per requested path;
223
+ * a read miss keeps last-good state and reports a warning diagnostic.
219
224
  *
220
225
  * # Errors
221
226
  * Returns a JS error when `paths` is malformed or serializing the report fails.
@@ -31,6 +31,24 @@ class WasmCompiler {
31
31
  const ptr = this.__destroy_into_raw();
32
32
  wasm.__wbg_wasmcompiler_free(ptr, 0);
33
33
  }
34
+ /**
35
+ * Files whose folded imports changed since the last call. Clears on read.
36
+ * Re-parse each via `refreshFile`, then call again until empty.
37
+ * @returns {string[]}
38
+ */
39
+ affectedFiles() {
40
+ try {
41
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
42
+ wasm.wasmcompiler_affectedFiles(retptr, this.__wbg_ptr);
43
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
44
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
45
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
46
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
47
+ return v1;
48
+ } finally {
49
+ wasm.__wbindgen_add_to_stack_pointer(16);
50
+ }
51
+ }
34
52
  /**
35
53
  * Hydrate an external build info into this project (additive), optionally
36
54
  * restricted to imported modules (tree-shaking). Returns `false` on a
@@ -698,8 +716,8 @@ class WasmCompiler {
698
716
  }
699
717
  }
700
718
  /**
701
- * Read + parse source paths returned from `scan()`. Returns one report per
702
- * successfully parsed path.
719
+ * Read + parse source paths from `scan()`. One report per requested path;
720
+ * a read miss keeps last-good state and reports a warning diagnostic.
703
721
  *
704
722
  * # Errors
705
723
  * Returns a JS error when `paths` is malformed or serializing the report fails.
@@ -1703,8 +1721,8 @@ function __wbg_get_imports() {
1703
1721
  return addHeapObject(ret);
1704
1722
  },
1705
1723
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1706
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [String], shim_idx: 14, ret: Externref, inner_ret: Some(Externref) }, mutable: false }) -> Externref`.
1707
- const ret = makeClosure(arg0, arg1, __wasm_bindgen_func_elem_507);
1724
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [String], shim_idx: 13, ret: Externref, inner_ret: Some(Externref) }, mutable: false }) -> Externref`.
1725
+ const ret = makeClosure(arg0, arg1, __wasm_bindgen_func_elem_517);
1708
1726
  return addHeapObject(ret);
1709
1727
  },
1710
1728
  __wbindgen_cast_0000000000000002: function(arg0) {
@@ -1741,10 +1759,10 @@ function __wbg_get_imports() {
1741
1759
  };
1742
1760
  }
1743
1761
 
1744
- function __wasm_bindgen_func_elem_507(arg0, arg1, arg2) {
1762
+ function __wasm_bindgen_func_elem_517(arg0, arg1, arg2) {
1745
1763
  const ptr0 = passStringToWasm0(arg2, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1746
1764
  const len0 = WASM_VECTOR_LEN;
1747
- const ret = wasm.__wasm_bindgen_func_elem_507(arg0, arg1, ptr0, len0);
1765
+ const ret = wasm.__wasm_bindgen_func_elem_517(arg0, arg1, ptr0, len0);
1748
1766
  return takeObject(ret);
1749
1767
  }
1750
1768
 
@@ -1854,6 +1872,16 @@ function dropObject(idx) {
1854
1872
  heap_next = idx;
1855
1873
  }
1856
1874
 
1875
+ function getArrayJsValueFromWasm0(ptr, len) {
1876
+ ptr = ptr >>> 0;
1877
+ const mem = getDataViewMemory0();
1878
+ const result = [];
1879
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
1880
+ result.push(takeObject(mem.getUint32(i, true)));
1881
+ }
1882
+ return result;
1883
+ }
1884
+
1857
1885
  function getArrayU8FromWasm0(ptr, len) {
1858
1886
  ptr = ptr >>> 0;
1859
1887
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
Binary file
@@ -4,6 +4,7 @@ export const memory: WebAssembly.Memory;
4
4
  export const __wbg_wasmcompiler_free: (a: number, b: number) => void;
5
5
  export const __wbg_wasmextractor_free: (a: number, b: number) => void;
6
6
  export const __wbg_wasmfilesystem_free: (a: number, b: number) => void;
7
+ export const wasmcompiler_affectedFiles: (a: number, b: number) => void;
7
8
  export const wasmcompiler_applyBuildInfo: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
8
9
  export const wasmcompiler_atoms: (a: number, b: number) => void;
9
10
  export const wasmcompiler_buildInfoSchemaVersion: (a: number) => number;
@@ -70,7 +71,7 @@ export const wasmfilesystem_new: () => number;
70
71
  export const wasmfilesystem_readFile: (a: number, b: number, c: number, d: number) => void;
71
72
  export const wasmfilesystem_removeFile: (a: number, b: number, c: number) => number;
72
73
  export const installPanicHook: () => void;
73
- export const __wasm_bindgen_func_elem_507: (a: number, b: number, c: number, d: number) => number;
74
+ export const __wasm_bindgen_func_elem_517: (a: number, b: number, c: number, d: number) => number;
74
75
  export const __wbindgen_export: (a: number, b: number) => number;
75
76
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
76
77
  export const __wbindgen_export3: (a: number) => void;
@@ -19,6 +19,11 @@ export class WasmCompiler {
19
19
  private constructor();
20
20
  free(): void;
21
21
  [Symbol.dispose](): void;
22
+ /**
23
+ * Files whose folded imports changed since the last call. Clears on read.
24
+ * Re-parse each via `refreshFile`, then call again until empty.
25
+ */
26
+ affectedFiles(): string[];
22
27
  /**
23
28
  * Hydrate an external build info into this project (additive), optionally
24
29
  * restricted to imported modules (tree-shaking). Returns `false` on a
@@ -214,8 +219,8 @@ export class WasmCompiler {
214
219
  */
215
220
  parseFileSource(path: string, source: string): any;
216
221
  /**
217
- * Read + parse source paths returned from `scan()`. Returns one report per
218
- * successfully parsed path.
222
+ * Read + parse source paths from `scan()`. One report per requested path;
223
+ * a read miss keeps last-good state and reports a warning diagnostic.
219
224
  *
220
225
  * # Errors
221
226
  * Returns a JS error when `paths` is malformed or serializing the report fails.
@@ -433,6 +438,7 @@ export interface InitOutput {
433
438
  readonly __wbg_wasmcompiler_free: (a: number, b: number) => void;
434
439
  readonly __wbg_wasmextractor_free: (a: number, b: number) => void;
435
440
  readonly __wbg_wasmfilesystem_free: (a: number, b: number) => void;
441
+ readonly wasmcompiler_affectedFiles: (a: number, b: number) => void;
436
442
  readonly wasmcompiler_applyBuildInfo: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
437
443
  readonly wasmcompiler_atoms: (a: number, b: number) => void;
438
444
  readonly wasmcompiler_buildInfoSchemaVersion: (a: number) => number;
@@ -499,7 +505,7 @@ export interface InitOutput {
499
505
  readonly wasmfilesystem_readFile: (a: number, b: number, c: number, d: number) => void;
500
506
  readonly wasmfilesystem_removeFile: (a: number, b: number, c: number) => number;
501
507
  readonly installPanicHook: () => void;
502
- readonly __wasm_bindgen_func_elem_507: (a: number, b: number, c: number, d: number) => number;
508
+ readonly __wasm_bindgen_func_elem_517: (a: number, b: number, c: number, d: number) => number;
503
509
  readonly __wbindgen_export: (a: number, b: number) => number;
504
510
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
505
511
  readonly __wbindgen_export3: (a: number) => void;
@@ -31,6 +31,24 @@ export class WasmCompiler {
31
31
  const ptr = this.__destroy_into_raw();
32
32
  wasm.__wbg_wasmcompiler_free(ptr, 0);
33
33
  }
34
+ /**
35
+ * Files whose folded imports changed since the last call. Clears on read.
36
+ * Re-parse each via `refreshFile`, then call again until empty.
37
+ * @returns {string[]}
38
+ */
39
+ affectedFiles() {
40
+ try {
41
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
42
+ wasm.wasmcompiler_affectedFiles(retptr, this.__wbg_ptr);
43
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
44
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
45
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
46
+ wasm.__wbindgen_export4(r0, r1 * 4, 4);
47
+ return v1;
48
+ } finally {
49
+ wasm.__wbindgen_add_to_stack_pointer(16);
50
+ }
51
+ }
34
52
  /**
35
53
  * Hydrate an external build info into this project (additive), optionally
36
54
  * restricted to imported modules (tree-shaking). Returns `false` on a
@@ -698,8 +716,8 @@ export class WasmCompiler {
698
716
  }
699
717
  }
700
718
  /**
701
- * Read + parse source paths returned from `scan()`. Returns one report per
702
- * successfully parsed path.
719
+ * Read + parse source paths from `scan()`. One report per requested path;
720
+ * a read miss keeps last-good state and reports a warning diagnostic.
703
721
  *
704
722
  * # Errors
705
723
  * Returns a JS error when `paths` is malformed or serializing the report fails.
@@ -1699,8 +1717,8 @@ function __wbg_get_imports() {
1699
1717
  return addHeapObject(ret);
1700
1718
  },
1701
1719
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1702
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [String], shim_idx: 14, ret: Externref, inner_ret: Some(Externref) }, mutable: false }) -> Externref`.
1703
- const ret = makeClosure(arg0, arg1, __wasm_bindgen_func_elem_507);
1720
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [String], shim_idx: 13, ret: Externref, inner_ret: Some(Externref) }, mutable: false }) -> Externref`.
1721
+ const ret = makeClosure(arg0, arg1, __wasm_bindgen_func_elem_517);
1704
1722
  return addHeapObject(ret);
1705
1723
  },
1706
1724
  __wbindgen_cast_0000000000000002: function(arg0) {
@@ -1737,10 +1755,10 @@ function __wbg_get_imports() {
1737
1755
  };
1738
1756
  }
1739
1757
 
1740
- function __wasm_bindgen_func_elem_507(arg0, arg1, arg2) {
1758
+ function __wasm_bindgen_func_elem_517(arg0, arg1, arg2) {
1741
1759
  const ptr0 = passStringToWasm0(arg2, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1742
1760
  const len0 = WASM_VECTOR_LEN;
1743
- const ret = wasm.__wasm_bindgen_func_elem_507(arg0, arg1, ptr0, len0);
1761
+ const ret = wasm.__wasm_bindgen_func_elem_517(arg0, arg1, ptr0, len0);
1744
1762
  return takeObject(ret);
1745
1763
  }
1746
1764
 
@@ -1850,6 +1868,16 @@ function dropObject(idx) {
1850
1868
  heap_next = idx;
1851
1869
  }
1852
1870
 
1871
+ function getArrayJsValueFromWasm0(ptr, len) {
1872
+ ptr = ptr >>> 0;
1873
+ const mem = getDataViewMemory0();
1874
+ const result = [];
1875
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
1876
+ result.push(takeObject(mem.getUint32(i, true)));
1877
+ }
1878
+ return result;
1879
+ }
1880
+
1853
1881
  function getArrayU8FromWasm0(ptr, len) {
1854
1882
  ptr = ptr >>> 0;
1855
1883
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
Binary file
@@ -4,6 +4,7 @@ export const memory: WebAssembly.Memory;
4
4
  export const __wbg_wasmcompiler_free: (a: number, b: number) => void;
5
5
  export const __wbg_wasmextractor_free: (a: number, b: number) => void;
6
6
  export const __wbg_wasmfilesystem_free: (a: number, b: number) => void;
7
+ export const wasmcompiler_affectedFiles: (a: number, b: number) => void;
7
8
  export const wasmcompiler_applyBuildInfo: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
8
9
  export const wasmcompiler_atoms: (a: number, b: number) => void;
9
10
  export const wasmcompiler_buildInfoSchemaVersion: (a: number) => number;
@@ -70,7 +71,7 @@ export const wasmfilesystem_new: () => number;
70
71
  export const wasmfilesystem_readFile: (a: number, b: number, c: number, d: number) => void;
71
72
  export const wasmfilesystem_removeFile: (a: number, b: number, c: number) => number;
72
73
  export const installPanicHook: () => void;
73
- export const __wasm_bindgen_func_elem_507: (a: number, b: number, c: number, d: number) => number;
74
+ export const __wasm_bindgen_func_elem_517: (a: number, b: number, c: number, d: number) => number;
74
75
  export const __wbindgen_export: (a: number, b: number) => number;
75
76
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
76
77
  export const __wbindgen_export3: (a: number) => void;