|
103 | 103 | bamlRustPackage = cliPkgs.bamlRustPackage; |
104 | 104 | }; |
105 | 105 |
|
| 106 | + # wasm-bindgen-cli pinned to match Cargo.lock (nixpkgs has 0.2.100, we need 0.2.105) |
| 107 | + wasm-bindgen-cli = import ./nix/lib/wasm-bindgen-cli.nix { inherit pkgs; }; |
| 108 | + |
106 | 109 | wasmPkgs = import ./nix/packages/baml-wasm.nix { |
107 | 110 | inherit |
108 | 111 | crane |
109 | 112 | pkgs |
110 | 113 | toolchain |
111 | 114 | src |
112 | 115 | version |
| 116 | + wasm-bindgen-cli |
| 117 | + ; |
| 118 | + }; |
| 119 | + |
| 120 | + # --- Shared pnpm workspace source + deps (used by JS/TS packages) --- |
| 121 | + |
| 122 | + pnpmSrc = pkgs.lib.cleanSourceWith { |
| 123 | + src = ./.; |
| 124 | + filter = |
| 125 | + path: type: |
| 126 | + let |
| 127 | + baseName = baseNameOf path; |
| 128 | + in |
| 129 | + baseName != "node_modules" |
| 130 | + && baseName != "result" |
| 131 | + && baseName != ".jj" |
| 132 | + && baseName != ".git" |
| 133 | + && baseName != ".claude" |
| 134 | + && !pkgs.lib.hasInfix "/target/" path |
| 135 | + && !pkgs.lib.hasSuffix ".so" baseName |
| 136 | + && !pkgs.lib.hasSuffix ".node" baseName |
| 137 | + && !pkgs.lib.hasSuffix ".vsix" baseName; |
| 138 | + }; |
| 139 | + |
| 140 | + # Single pnpm dependency fetch shared by all JS/TS packages |
| 141 | + pnpmDeps = pkgs.pnpm_9.fetchDeps { |
| 142 | + pname = "baml-workspace"; |
| 143 | + inherit version; |
| 144 | + src = pnpmSrc; |
| 145 | + hash = "sha256-PjYsVup7GLEHMvUN47OYcurkAYR0xUQPAr1NNyX+oe8="; |
| 146 | + fetcherVersion = 2; |
| 147 | + }; |
| 148 | + |
| 149 | + codemirrorLangBaml = import ./nix/packages/codemirror-lang-baml.nix { |
| 150 | + inherit pkgs pkgs-unstable version pnpmDeps; |
| 151 | + src = pnpmSrc; |
| 152 | + }; |
| 153 | + |
| 154 | + fiddleFrontend = import ./nix/packages/fiddle-frontend.nix { |
| 155 | + inherit |
| 156 | + pkgs |
| 157 | + pkgs-unstable |
| 158 | + version |
| 159 | + pnpmDeps |
113 | 160 | ; |
| 161 | + src = pnpmSrc; |
| 162 | + baml-schema-wasm = wasmPkgs.baml-schema-wasm; |
| 163 | + codemirror-lang-baml = codemirrorLangBaml; |
| 164 | + }; |
| 165 | + |
| 166 | + bamlVsix = import ./nix/packages/baml-vsix.nix { |
| 167 | + inherit |
| 168 | + pkgs |
| 169 | + pkgs-unstable |
| 170 | + version |
| 171 | + pnpmDeps |
| 172 | + ; |
| 173 | + src = pnpmSrc; |
| 174 | + baml-schema-wasm = wasmPkgs.baml-schema-wasm; |
| 175 | + baml-cli = cliPkgs.release; |
| 176 | + codemirror-lang-baml = codemirrorLangBaml; |
114 | 177 | }; |
115 | 178 |
|
116 | 179 | in |
|
189 | 252 |
|
190 | 253 | # WASM package |
191 | 254 | baml-schema-wasm = wasmPkgs.baml-schema-wasm; |
| 255 | + |
| 256 | + # Frontend / extension packages |
| 257 | + codemirror-lang-baml = codemirrorLangBaml; |
| 258 | + fiddle-frontend = fiddleFrontend; |
| 259 | + baml-vsix = bamlVsix; |
192 | 260 | }; |
193 | 261 |
|
194 | 262 | # --- Checks (intermediates exposed for Cachix caching) --- |
|
0 commit comments