faustwave 0.95.2 → 0.97.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.
package/README.md CHANGED
@@ -1,44 +1,44 @@
1
- # faustwave
2
-
3
- The FaustWave CLI — a [Faust](https://faust.grame.fr) patch as a [WebCLAP](https://github.com/WebCLAP) plugin, from a
4
- terminal or a script. One WebAssembly module that plays in the browser and, through a WebCLAP bridge, in a DAW.
5
-
6
- **Try it in the browser first: [faustwave.io/webclap](https://faustwave.io/webclap)** · More: [faustwave.io/cli](https://faustwave.io/cli)
7
-
8
- ## Install
9
-
10
- ```
11
- npm install --global faustwave
12
- ```
13
-
14
- Node.js 22 or newer. `faustwave` alone lists what it can do.
15
-
16
- ## A patch, a plugin
17
-
18
- ```
19
- faustwave plugin tremolo.dsp
20
- → Tremolo.wclap.tar.gz module.wasm, its page, LICENSE, THIRD-PARTY-NOTICES.md
21
-
22
- faustwave plugin tremolo.dsp --name "Tremolo" --version 1.0.0 --out plugins/
23
- ```
24
-
25
- - **Presets:** a `tremolo.presets.json` beside the patch goes into the plugin (found and loaded through CLAP).
26
- - **Its page:** every plugin carries a page that draws its controls. Tags in a control's label lay them out —
27
- `[device:big]`, `[device:fader]`, `[device:col:1]` … `[device:monitor:<name>]` on a bargraph; `faustwave plugin`
28
- alone lists them. `--theme` picks its colours, `--css <file>` adds your own.
29
- - It compiles as faustwasm does and plays sample for sample as the patch plays there.
30
-
31
- ## Always current
32
-
33
- When there is a newer faustwave, it says so after a command; `faustwave update` installs it. New commands come the
34
- same way.
35
-
36
- ## Built on
37
-
38
- [@faustwave/faustwasm-webclap](https://www.npmjs.com/package/@faustwave/faustwasm-webclap) (a Faust patch as a WCLAP)
39
- and [@grame/faustwasm](https://www.npmjs.com/package/@grame/faustwasm) (Faust's compiler, LGPL — its own package, never
40
- in this one's bundle).
41
-
42
- ## Licence
43
-
44
- MIT.
1
+ # faustwave
2
+
3
+ The FaustWave CLI — a [Faust](https://faust.grame.fr) patch as a [WebCLAP](https://github.com/WebCLAP) plugin, from a
4
+ terminal or a script. One WebAssembly module that plays in the browser and, through a WebCLAP bridge, in a DAW.
5
+
6
+ **Try it in the browser first: [faustwave.io/webclap](https://faustwave.io/webclap)** · More: [faustwave.io/cli](https://faustwave.io/cli)
7
+
8
+ ## Install
9
+
10
+ ```
11
+ npm install --global faustwave
12
+ ```
13
+
14
+ Node.js 22 or newer. `faustwave` alone lists what it can do.
15
+
16
+ ## A patch, a plugin
17
+
18
+ ```
19
+ faustwave build plugin tremolo.dsp
20
+ → Tremolo.wclap.tar.gz module.wasm, its page, LICENSE, THIRD-PARTY-NOTICES.md
21
+
22
+ faustwave build plugin tremolo.dsp --name "Tremolo" --version 1.0.0 --out plugins/
23
+ ```
24
+
25
+ - **Presets:** a `tremolo.presets.json` beside the patch goes into the plugin (found and loaded through CLAP).
26
+ - **Its page:** every plugin carries a page that draws its controls. Tags in a control's label lay them out —
27
+ `[device:big]`, `[device:fader]`, `[device:col:1]` … `[device:monitor:<name>]` on a bargraph; `faustwave build plugin`
28
+ alone lists them. `--theme` picks its colours, `--css <file>` adds your own.
29
+ - It compiles as faustwasm does and plays sample for sample as the patch plays there.
30
+
31
+ ## Always current
32
+
33
+ When there is a newer faustwave, it says so after a command; `faustwave update` installs it. New commands come the
34
+ same way.
35
+
36
+ ## Built on
37
+
38
+ [@faustwave/faustwasm-webclap](https://www.npmjs.com/package/@faustwave/faustwasm-webclap) (a Faust patch as a WCLAP)
39
+ and [@grame/faustwasm](https://www.npmjs.com/package/@grame/faustwasm) (Faust's compiler, LGPL — its own package, never
40
+ in this one's bundle).
41
+
42
+ ## Licence
43
+
44
+ MIT.
@@ -8554,33 +8554,108 @@ function deviceMeta(...trees) {
8554
8554
  function laysOut(meta2) {
8555
8555
  return meta2.big.size > 0 || meta2.cols.size > 0 || meta2.monitors.length > 0;
8556
8556
  }
8557
- var isBargraph;
8557
+ function merged(trees) {
8558
+ const merge2 = (into, items) => {
8559
+ for (const it of items) {
8560
+ const same = isGroup(it) ? into.find((x) => isGroup(x) && x.type === it.type && x.label === it.label) : void 0;
8561
+ if (same) merge2(same.items = [...same.items ?? []], it.items ?? []);
8562
+ else into.push(isGroup(it) ? { ...it, items: merge2([], it.items ?? []) } : it);
8563
+ }
8564
+ return into;
8565
+ };
8566
+ return trees.reduce((all, t) => merge2(all, t), []);
8567
+ }
8568
+ function deviceLayout(trees, meta2) {
8569
+ const monitorOf = new Map(meta2.monitors.flatMap((m) => m.addresses.map((a) => [a, m])));
8570
+ const isBig = (it) => !!it.address && meta2.big.has(it.address);
8571
+ const sectionsOf = (items, path8) => {
8572
+ const own2 = (items ?? []).filter((it) => !isGroup(it));
8573
+ const monitors = [...new Set(own2.flatMap((it) => it.address && monitorOf.get(it.address) || []))];
8574
+ const controls = own2.filter((it) => !(it.address && monitorOf.has(it.address)));
8575
+ const name = path8.join(" / ");
8576
+ const out = [];
8577
+ if (controls.some(isBig)) out.push({ kind: "section", name, items: controls.filter(isBig), big: true });
8578
+ const rest2 = controls.filter((it) => !isBig(it));
8579
+ if (rest2.length || monitors.length) out.push({ kind: "section", name, items: rest2, big: false, ...monitors.length ? { monitors } : {} });
8580
+ for (const it of items ?? []) if (isGroup(it)) out.push(...sectionsOf(it.items, [...path8, groupName(it.label)]));
8581
+ return out;
8582
+ };
8583
+ const rows = [];
8584
+ let loose = [];
8585
+ const flush = () => {
8586
+ if (loose.length) rows.push({ name: "", places: loose });
8587
+ loose = [];
8588
+ };
8589
+ for (const top of merged(trees)) {
8590
+ const items = isGroup(top) ? top.items ?? [] : [top];
8591
+ loose.push(...sectionsOf(items.filter((it) => !isGroup(it)), []));
8592
+ for (const g of items.filter(isGroup)) {
8593
+ const name = groupName(g.label);
8594
+ if ((g.items ?? []).some(isGroup)) {
8595
+ flush();
8596
+ rows.push({ name, places: sectionsOf(g.items, []) });
8597
+ } else loose.push(...sectionsOf(g.items, [name]));
8598
+ }
8599
+ flush();
8600
+ }
8601
+ const controlsWidth = (p) => p.items.reduce((n, it) => n + cellsOf(it, meta2), 0);
8602
+ const widthOf = (p) => Math.max(p.monitors?.length ? MONITOR_CELLS : PLACE_CELLS, controlsWidth(p));
8603
+ const laid = rows.filter((r) => r.places.length).map((r) => ({ name: r.name, places: r.places.map((place) => ({ place, cells: widthOf(place) })) }));
8604
+ const cells = Math.max(0, ...laid.map((r) => r.places.reduce((n, c) => n + c.cells, 0)));
8605
+ for (const r of laid) {
8606
+ const used = r.places.reduce((n, c) => n + c.cells, 0);
8607
+ const wide = r.places.find((c) => c.place.monitors?.length);
8608
+ if (wide && used < cells) wide.cells += cells - used;
8609
+ }
8610
+ return { rows: laid, cells };
8611
+ }
8612
+ function deviceSize(layout, meta2, dense = false) {
8613
+ const m = DEVICE_METRICS[dense ? "dense" : "normal"];
8614
+ const width = layout.cells * m.cell;
8615
+ const tall = (p) => (p.items.length ? p.items.some((it) => it.address && meta2.big.has(it.address)) ? m.bigRow : m.row : 0) + (p.monitors?.length ? m.screen : 0);
8616
+ const rowHeight = (r) => m.title + 2 * m.pad + m.gap + Math.max(...r.places.map((c) => tall(c.place)));
8617
+ return { width: Math.ceil(width), height: Math.ceil(layout.rows.reduce((h, r) => h + rowHeight(r), 0)) };
8618
+ }
8619
+ var isGroup, isBargraph, groupName, radioOptions, cellsOf, PLACE_CELLS, MONITOR_CELLS, DEVICE_METRICS;
8558
8620
  var init_device = __esm({
8559
8621
  "../faustwave-svelte/src/faust/device.ts"() {
8560
8622
  "use strict";
8623
+ isGroup = (it) => it.type === "vgroup" || it.type === "hgroup" || it.type === "tgroup";
8561
8624
  isBargraph = (it) => it.type === "hbargraph" || it.type === "vbargraph";
8625
+ groupName = (label) => (label ?? "").replace(/\[[^\]]*\]/g, "").trim();
8626
+ radioOptions = (it) => {
8627
+ const style = (it.meta ?? []).find((m2) => typeof m2.style === "string")?.style ?? "";
8628
+ const m = /^\s*radio\s*\{(.*)\}\s*$/.exec(style);
8629
+ return m ? m[1].split(";").filter((s) => s.trim()).length : 0;
8630
+ };
8631
+ cellsOf = (it, meta2) => it.address && meta2.big.has(it.address) ? 1.5 : Math.max(1, radioOptions(it));
8632
+ PLACE_CELLS = 2;
8633
+ MONITOR_CELLS = 4;
8634
+ DEVICE_METRICS = {
8635
+ normal: { cell: 64, row: 96, bigRow: 120, title: 22, pad: 8, gap: 8, screen: 64 },
8636
+ dense: { cell: 52, row: 78, bigRow: 98, title: 18, pad: 6, gap: 6, screen: 48 }
8637
+ };
8562
8638
  }
8563
8639
  });
8564
8640
 
8565
8641
  // ../plugin-page/src/index.ts
8566
- function pageSizeOf(description, trees) {
8567
- return sizeOfControls(controlsUi(trees, description));
8642
+ function pageSizeOf(description, trees, density = "", presets = false) {
8643
+ return sizeOfControls(controlsUi(trees, description), density === "compact", presets);
8568
8644
  }
8569
- function sizeOfControls(ui) {
8645
+ function sizeOfControls(ui, dense = false, presets = false) {
8646
+ const bar = presets ? PRESET_BAR : 0;
8570
8647
  let n = 0;
8571
8648
  const count = (items) => {
8572
8649
  for (const it of items) "items" in it && Array.isArray(it.items) ? count(it.items) : n++;
8573
8650
  };
8574
8651
  count(ui);
8575
8652
  const meta2 = deviceMeta(ui);
8576
- const tags = deviceTags(ui);
8577
8653
  const clamp = (v, lo, hi) => Math.round(Math.min(hi, Math.max(lo, v)));
8578
8654
  if (laysOut(meta2)) {
8579
- const cols = Math.max(1, tags.cols.length);
8580
- const rows = Math.ceil(n / (cols * 4));
8581
- return { width: clamp(cols * 300 + 40, 360, 1100), height: clamp(80 + rows * 100 + (tags.big ? 110 : 0) + (tags.monitors.length ? 110 : 0), 200, 800) };
8655
+ const size = deviceSize(deviceLayout([ui], meta2), meta2, dense);
8656
+ return { width: clamp(size.width + 24, 360, 1400), height: clamp(size.height + 24 + bar, 200, 900) };
8582
8657
  }
8583
- return { width: clamp(Math.min(n, 8) * 84 + 64, 360, 960), height: clamp(80 + Math.ceil(n / 8) * 110, 200, 800) };
8658
+ return { width: clamp(Math.min(n, 8) * 84 + 64, 360, 960), height: clamp(80 + Math.ceil(n / 8) * 110 + bar, 200, 800) };
8584
8659
  }
8585
8660
  function pluginInfo(source, o) {
8586
8661
  const name = o.name || declaredOf(source, "name") || o.fallbackName;
@@ -8594,7 +8669,7 @@ function pluginInfo(source, o) {
8594
8669
  version: o.version || declaredOf(source, "version") || `${now.getFullYear()}.${now.getMonth() + 1}.${now.getDate()}`,
8595
8670
  ...o.presets?.length ? { presets: o.presets } : {},
8596
8671
  // (it has a page: the host shows it at its controls' size, the plugin talks to it — clap.gui, clap.webview/3)
8597
- ui: pageSizeOf
8672
+ ui: (description, trees) => pageSizeOf(description, trees, o.density, !!o.presets?.length)
8598
8673
  };
8599
8674
  }
8600
8675
  function licenceOf(source, name) {
@@ -8617,7 +8692,11 @@ function pluginFiles(page, p) {
8617
8692
  const enc = new TextEncoder();
8618
8693
  const files = new Map(page);
8619
8694
  files.set("plugin.json", enc.encode(JSON.stringify(p.description)));
8620
- files.set("page.json", enc.encode(JSON.stringify({ ui: p.ui, look: p.look ?? "", css: p.css ?? "", size: sizeOfControls(p.ui) })));
8695
+ const sources = [...p.sources ?? []].map(([name, bytes]) => {
8696
+ files.set(`src/${name}`, bytes);
8697
+ return `src/${name}`;
8698
+ });
8699
+ files.set("page.json", enc.encode(JSON.stringify({ ui: p.ui, look: p.look ?? "", css: p.css ?? "", density: p.density ?? "", presets: (p.presets ?? []).map((x) => x.name), sources, size: sizeOfControls(p.ui, p.density === "compact", !!p.presets?.length) })));
8621
8700
  files.set("THIRD-PARTY-NOTICES.md", p.notices);
8622
8701
  return files;
8623
8702
  }
@@ -8625,12 +8704,13 @@ function deviceTags(ui) {
8625
8704
  const meta2 = deviceMeta(ui);
8626
8705
  return { big: meta2.big.size, cols: [...new Set(meta2.cols.values())].sort(), monitors: meta2.monitors.map((m) => m.name), faders: meta2.faders.size };
8627
8706
  }
8628
- var FAUST_ARGS, idPart, declaredOf, packageFileName;
8707
+ var FAUST_ARGS, PRESET_BAR, idPart, declaredOf, packageFileName;
8629
8708
  var init_src2 = __esm({
8630
8709
  "../plugin-page/src/index.ts"() {
8631
8710
  "use strict";
8632
8711
  init_device();
8633
8712
  FAUST_ARGS = "-ftz 2 -double";
8713
+ PRESET_BAR = 36;
8634
8714
  idPart = (name) => name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "patch";
8635
8715
  declaredOf = (source, key) => new RegExp(`^\\s*declare\\s+${key}\\s+"((?:[^"\\\\]|\\\\.)*)"\\s*;`, "m").exec(source)?.[1].trim() || null;
8636
8716
  packageFileName = (name) => `${idPart(name)}.wclap.tar.gz`;
@@ -8650,20 +8730,23 @@ import { fileURLToPath as fileURLToPath2, pathToFileURL } from "node:url";
8650
8730
  import { gzipSync } from "node:zlib";
8651
8731
  function convertArgs(args) {
8652
8732
  const opts = {};
8733
+ let sources = false;
8653
8734
  const files = [];
8654
8735
  for (let i = 0; i < args.length; i++) {
8655
8736
  if (args[i] === "--page") throw new Error("--page is gone: a plugin's page is 2D (its controls) \u2014 leave it out; --theme and --css shape it.");
8656
- const m = /^--(name|id|version|out|look|theme|css)$/.exec(args[i]);
8657
- if (m) {
8737
+ const m = /^--(name|id|version|out|look|theme|css|density)$/.exec(args[i]);
8738
+ if (args[i] === "--sources") sources = true;
8739
+ else if (m) {
8658
8740
  if (args[i + 1] === void 0) throw new Error(USAGE);
8659
8741
  opts[m[1]] = args[++i];
8660
8742
  } else if (args[i].startsWith("-")) throw new Error(`${args[i]}: no such option \u2014 ${USAGE}`);
8661
8743
  else files.push(args[i]);
8662
8744
  }
8663
8745
  if (files.length !== 1) throw new Error(USAGE);
8746
+ if (opts.density !== void 0 && opts.density !== "compact") throw new Error(`--density ${opts.density}: only compact \u2014 ${USAGE}`);
8664
8747
  if (opts.theme !== void 0) opts.look = opts.theme;
8665
8748
  delete opts.theme;
8666
- return { file: files[0], ...opts };
8749
+ return { file: files[0], ...opts, ...sources ? { sources } : {} };
8667
8750
  }
8668
8751
  async function convert(args) {
8669
8752
  const o = convertArgs(args);
@@ -8676,7 +8759,7 @@ async function convert(args) {
8676
8759
  fwDir = path6.dirname(req.resolve("@grame/faustwasm/package.json"));
8677
8760
  wclapDist = path6.dirname(req.resolve("@faustwave/faustwasm-webclap"));
8678
8761
  } catch {
8679
- throw new Error("faustwave convert needs @faustwave/faustwasm-webclap and @grame/faustwasm installed beside the CLI.");
8762
+ throw new Error("faustwave build plugin needs @faustwave/faustwasm-webclap and @grame/faustwasm installed beside the CLI.");
8680
8763
  }
8681
8764
  let pageList;
8682
8765
  if (true) pageList = fileURLToPath2(new URL("./page/files.json", import.meta.url));
@@ -8684,7 +8767,7 @@ async function convert(args) {
8684
8767
  try {
8685
8768
  pageList = req.resolve("@crafics/faustwave-plugin-page/page/files.json");
8686
8769
  } catch {
8687
- throw new Error("faustwave convert needs the plugin page built: npm run build -w @crafics/faustwave-plugin-page");
8770
+ throw new Error("faustwave build plugin needs the plugin page built: npm run build -w @crafics/faustwave-plugin-page");
8688
8771
  }
8689
8772
  const pageDir = path6.dirname(pageList);
8690
8773
  const page = new Map(JSON.parse(fs5.readFileSync(pageList, "utf8")).map((f) => [f, new Uint8Array(fs5.readFileSync(path6.join(pageDir, f)))]));
@@ -8703,7 +8786,7 @@ async function convert(args) {
8703
8786
  } catch (e) {
8704
8787
  throw new Error(`${path6.basename(presetsFile)}: ${e instanceof Error ? e.message : String(e)}`);
8705
8788
  }
8706
- const info = pluginInfo(source, { fallbackName: path6.basename(file).replace(/\.dsp$/i, ""), name: o.name, id: o.id, version: o.version, presets });
8789
+ const info = pluginInfo(source, { fallbackName: path6.basename(file).replace(/\.dsp$/i, ""), name: o.name, id: o.id, version: o.version, presets, density: o.density });
8707
8790
  const built = await wclap.compilePlugin(faustwasm, compiler, adapter, source, info, { args: FAUST_ARGS }).catch((e) => {
8708
8791
  const said = e instanceof Error ? e.message : String(e);
8709
8792
  if (/no such sound was given/.test(said)) throw new Error("The patch plays soundfiles \u2014 build it in the IDE (project.build, starter wclap): it loads them.");
@@ -8712,7 +8795,8 @@ async function convert(args) {
8712
8795
  });
8713
8796
  const notices = new Uint8Array(fs5.readFileSync(path6.join(wclapDist, "THIRD-PARTY-NOTICES.md")));
8714
8797
  const ui = controlsUi([built.faust.ui, built.effect.ui], built.description);
8715
- const files = wclap.pluginPackage(built.module, licenceOf(source, info.name), pluginFiles(page, { description: built.description, ui, look: o.look, css, notices }));
8798
+ const sources = o.sources ? new Map([[path6.basename(file), new Uint8Array(fs5.readFileSync(file))], ...fs5.existsSync(presetsFile) ? [[path6.basename(presetsFile), new Uint8Array(fs5.readFileSync(presetsFile))]] : []]) : void 0;
8799
+ const files = wclap.pluginPackage(built.module, licenceOf(source, info.name), pluginFiles(page, { description: built.description, ui, look: o.look, css, density: o.density, presets, notices, sources }));
8716
8800
  const out = path6.resolve(o.out ?? path6.dirname(file));
8717
8801
  fs5.mkdirSync(out, { recursive: true });
8718
8802
  const to = path6.join(out, packageFileName(info.name));
@@ -8723,7 +8807,7 @@ async function convert(args) {
8723
8807
  const tags = deviceTags(ui);
8724
8808
  const laid = tags.big || tags.cols.length || tags.monitors.length ? `laid out by its tags: ${[tags.big && `${tags.big} big`, tags.cols.length && `column ${tags.cols.join(", ")}`, tags.monitors.length && `monitor ${tags.monitors.join(", ")}`].filter(Boolean).join("; ")}` : "no [device:*] tags \u2014 as Faust groups the controls";
8725
8809
  const withPresets = presets.length ? `, ${presets.length} preset${presets.length === 1 ? "" : "s"}` : "";
8726
- return `${to}: "${info.name}" (${info.id}) ${info.version}, ${what}${withPresets}, with its page (${built.info.ui ? `${built.info.ui.width} \xD7 ${built.info.ui.height}, ` : ""}${laid}), ${(archive.length / 1024).toFixed(0)} KB; ${tail}.
8810
+ return `${to}: "${info.name}" (${info.id}) ${info.version}, ${what}${withPresets}, ${sources ? "with its sources, " : ""}with its page (${built.info.ui ? `${built.info.ui.width} \xD7 ${built.info.ui.height}, ` : ""}${laid}), ${(archive.length / 1024).toFixed(0)} KB; ${tail}.
8727
8811
  Import it into a WebCLAP host (openDAW: Load Plugin \u2192 from disk)` + (true ? "." : ` \u2014 or publish it on the Hub as version ${info.version}: faustwave workflow run publish-plugin <inputs>.`);
8728
8812
  }
8729
8813
  var USAGE;
@@ -8732,12 +8816,14 @@ var init_convert = __esm({
8732
8816
  "use strict";
8733
8817
  init_src2();
8734
8818
  USAGE = [
8735
- "usage: faustwave plugin <patch.dsp> [--theme studio|amber] [--css <file>] [--name <name>] [--id <id>] [--version <x.y.z>] [--out <folder>]",
8819
+ "usage: faustwave build plugin <patch.dsp> [--sources] [--theme studio|amber] [--density compact] [--css <file>] [--name <name>] [--id <id>] [--version <x.y.z>] [--out <folder>]",
8820
+ " --sources the patch (and its presets file) packed with it, under src/ \u2014 who has the plugin can read and rebuild it",
8736
8821
  " --theme its page's colours (default: FaustWave's); --css a file of your own over them",
8822
+ " --density compact: smaller knobs, tighter panels (as a host's own devices sit)",
8737
8823
  " --version the plugin's version (else the patch's declare version, else the day)",
8738
- " its page lays the controls out by [device:*] tags in their labels: big (a big knob along the bottom), fader,",
8739
- " col:1 | col:2 | col:3 (a column; a group goes where its first one says), monitor:<name> on bargraphs (a line drawn",
8740
- " of them) \u2014 none: as Faust groups them"
8824
+ " its page lays the controls out by [device:*] tags in their labels: big (a big knob \u2014 the macros), fader,",
8825
+ " monitor:<name> on bargraphs (a line drawn of them, under their group's controls); its rows are the patch's groups",
8826
+ " (v:Synth/h:sound/h:osc A/\u2026 \u2014 a group of groups a row, its groups the sections) \u2014 no tags: as Faust groups them"
8741
8827
  ].join("\n");
8742
8828
  }
8743
8829
  });
@@ -8805,7 +8891,7 @@ var init_update = __esm({
8805
8891
  "src/update.ts"() {
8806
8892
  "use strict";
8807
8893
  init_pipe();
8808
- VERSION2 = false ? null : "0.95.2";
8894
+ VERSION2 = false ? null : "0.97.0";
8809
8895
  NAME = "faustwave";
8810
8896
  DAY = 24 * 60 * 60 * 1e3;
8811
8897
  }
@@ -11789,13 +11875,13 @@ function handleIntersectionResults(result, left, right) {
11789
11875
  result.issues.push(keyIssues.get(k));
11790
11876
  }
11791
11877
  }
11792
- const merged = mergeValues(left.value, right.value);
11793
- if (!merged.valid) {
11878
+ const merged2 = mergeValues(left.value, right.value);
11879
+ if (!merged2.valid) {
11794
11880
  if (aborted(result))
11795
11881
  return result;
11796
- throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
11882
+ throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged2.mergeErrorPath)}`);
11797
11883
  }
11798
- result.value = merged.data;
11884
+ result.value = merged2.data;
11799
11885
  return result;
11800
11886
  }
11801
11887
  var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
@@ -13528,8 +13614,8 @@ function foldObjects(members2) {
13528
13614
  if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part)))
13529
13615
  parts.push(part);
13530
13616
  }
13531
- const merged = parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts };
13532
- assignProp(properties, key, merged);
13617
+ const merged2 = parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts };
13618
+ assignProp(properties, key, merged2);
13533
13619
  }
13534
13620
  for (const key of object2.required ?? [])
13535
13621
  required2.add(key);
@@ -18927,14 +19013,14 @@ function attachCacheHintFallback(result, hint2) {
18927
19013
  ...result,
18928
19014
  [RESULT_CACHE_HINT_FALLBACK]: hint2
18929
19015
  };
18930
- const merged = {};
19016
+ const merged2 = {};
18931
19017
  const ttlMs = attached.ttlMs ?? hint2.ttlMs;
18932
- if (ttlMs !== void 0) merged.ttlMs = ttlMs;
19018
+ if (ttlMs !== void 0) merged2.ttlMs = ttlMs;
18933
19019
  const cacheScope = attached.cacheScope ?? hint2.cacheScope;
18934
- if (cacheScope !== void 0) merged.cacheScope = cacheScope;
19020
+ if (cacheScope !== void 0) merged2.cacheScope = cacheScope;
18935
19021
  return {
18936
19022
  ...result,
18937
- [RESULT_CACHE_HINT_FALLBACK]: merged
19023
+ [RESULT_CACHE_HINT_FALLBACK]: merged2
18938
19024
  };
18939
19025
  }
18940
19026
  function cacheHintFallbackOf(result) {
@@ -31052,7 +31138,7 @@ init_pipe();
31052
31138
  // package.json
31053
31139
  var package_default = {
31054
31140
  name: "faustwave",
31055
- version: "0.95.2",
31141
+ version: "0.97.0",
31056
31142
  description: "The FaustWave CLI \u2014 a Faust patch as a WebCLAP plugin with its page, from a terminal or a script.",
31057
31143
  keywords: [
31058
31144
  "faust",
@@ -31090,7 +31176,7 @@ var package_default = {
31090
31176
  prepublishOnly: "npm run build:npm"
31091
31177
  },
31092
31178
  dependencies: {
31093
- "@faustwave/faustwasm-webclap": "^0.1.1",
31179
+ "@faustwave/faustwasm-webclap": "^0.2.0",
31094
31180
  "@grame/faustwasm": "0.21.1"
31095
31181
  },
31096
31182
  devDependencies: {
@@ -31263,10 +31349,11 @@ ${STUDIO ? USAGE_STUDIO : ""}
31263
31349
  update the newest faustwave (the npm package: npm i -g faustwave@latest)
31264
31350
 
31265
31351
  ${STUDIO ? "No IDE needed:" : "Plugins:"}
31266
- plugin <patch.dsp> [--theme studio|amber] [--css <file>] [--name <name>] [--id <id>] [--version <x.y.z>] [--out <folder>]
31352
+ build plugin <patch.dsp> [--sources] [--theme studio|amber] [--density compact] [--css <file>] [--name <name>] [--id <id>] [--version <x.y.z>] [--out <folder>]
31267
31353
  a Faust patch as a WebCLAP plugin with its page: <Name>.wclap.tar.gz, compiled as the IDE
31268
31354
  compiles; its presets from <patch>.presets.json beside it, when there is one; its
31269
- controls laid out by [device:*] tags (faustwave plugin alone says them)
31355
+ controls laid out by [device:*] tags (faustwave build plugin alone says them); --sources packs
31356
+ the patch with it
31270
31357
  ${HUB2 ? USAGE_HUB : ""}`;
31271
31358
  var HUB_COMMANDS = ["login", "logout", "app", "item", "purchases", "refund", "reconcile", "push", "submit", "review", "publish", "yank", "releases"];
31272
31359
  var run = async (action, input = {}) => {
@@ -31303,8 +31390,10 @@ try {
31303
31390
  await new Promise(() => {
31304
31391
  });
31305
31392
  }
31306
- } else if (command === "plugin" || command === "convert") process.stdout.write(`${await (await Promise.resolve().then(() => (init_convert(), convert_exports))).convert(rest)}
31393
+ } else if (command === "build" && rest[0] === "plugin") process.stdout.write(`${await (await Promise.resolve().then(() => (init_convert(), convert_exports))).convert(rest.slice(1))}
31307
31394
  `);
31395
+ else if (command === "build") throw new Error("faustwave build plugin <patch.dsp> \u2014 a plugin is what it builds.");
31396
+ else if (command === "plugin" || command === "convert") throw new Error(`faustwave ${command} is now: faustwave build plugin ${rest.join(" ")}`.trim());
31308
31397
  else if (command === "quit") process.stdout.write(`${await ask({ op: "quit" })}
31309
31398
  `);
31310
31399
  else if (HUB_COMMANDS.includes(command)) process.stdout.write(`${await (await Promise.resolve().then(() => (init_hub(), hub_exports))).hubCommand(command, rest)}