faustwave 0.98.4 → 0.98.6

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,56 +1,56 @@
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 --help`
28
- lists them and every option. `--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
- ## Publish on faustwave.io
32
-
33
- ```
34
- faustwave login sign in (a code to confirm in the browser; an account is made there)
35
- faustwave me ask "A tremolo of mine." once: ask to publish — the admin answers
36
- faustwave push tremolo.wclap.tar.gz upload it: a draft, seen by you only
37
- faustwave app describe tremolo "…" its words, and its picture: faustwave app cover tremolo cover.png
38
- faustwave submit tremolo ready — reviewed, then in the catalog
39
- ```
40
-
41
- `faustwave me` says how each release stands. `build plugin --sources` puts the patch into the package: its page says "with sources".
42
-
43
- ## Always current
44
-
45
- When there is a newer faustwave, it asks once whether it shall update by itself from now on (`faustwave update --auto on|off` changes the answer); otherwise it says so after a command and `faustwave update` installs it. New commands come the
46
- same way.
47
-
48
- ## Built on
49
-
50
- [@faustwave/faustwasm-webclap](https://www.npmjs.com/package/@faustwave/faustwasm-webclap) (a Faust patch as a WCLAP)
51
- and [@grame/faustwasm](https://www.npmjs.com/package/@grame/faustwasm) (Faust's compiler, LGPL — its own package, never
52
- in this one's bundle).
53
-
54
- ## Licence
55
-
56
- 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 --help`
28
+ lists them and every option. `--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
+ ## Publish on faustwave.io
32
+
33
+ ```
34
+ faustwave login sign in (a code to confirm in the browser; an account is made there)
35
+ faustwave me ask "A tremolo of mine." once: ask to publish — the admin answers
36
+ faustwave push tremolo.wclap.tar.gz upload it: a draft, seen by you only
37
+ faustwave app describe tremolo "…" its words, and its picture: faustwave app cover tremolo cover.png
38
+ faustwave submit tremolo ready — reviewed, then in the catalog
39
+ ```
40
+
41
+ `faustwave me` says how each release stands. `build plugin --sources` puts the patch into the package: its page says "with sources".
42
+
43
+ ## Always current
44
+
45
+ When there is a newer faustwave, it asks once whether it shall update by itself from now on (`faustwave update --auto on|off` changes the answer); otherwise it says so after a command and `faustwave update` installs it. New commands come the
46
+ same way.
47
+
48
+ ## Built on
49
+
50
+ [@faustwave/faustwasm-webclap](https://www.npmjs.com/package/@faustwave/faustwasm-webclap) (a Faust patch as a WCLAP)
51
+ and [@grame/faustwasm](https://www.npmjs.com/package/@grame/faustwasm) (Faust's compiler, LGPL — its own package, never
52
+ in this one's bundle).
53
+
54
+ ## Licence
55
+
56
+ MIT.
@@ -8909,10 +8909,13 @@ async function convert(args) {
8909
8909
  throw new Error(`${path6.basename(presetsFile)}: ${e instanceof Error ? e.message : String(e)}`);
8910
8910
  }
8911
8911
  const info = pluginInfo(source, { fallbackName: path6.basename(file2).replace(/\.dsp$/i, ""), name: o.name, id: o.id, version: o.version, presets, density: o.density });
8912
+ console.warn = () => {
8913
+ };
8912
8914
  const built = await wclap.compilePlugin(faustwasm, compiler, adapter, source, info, { args: FAUST_ARGS }).catch((e) => {
8913
8915
  const said = e instanceof Error ? e.message : String(e);
8914
8916
  if (/no such sound was given/.test(said)) throw new Error("The patch plays soundfiles \u2014 faustwave build plugin loads none: a patch that makes its sounds itself builds.");
8915
8917
  if (/^preset "/.test(said)) throw new Error(`${path6.basename(presetsFile)}: ${said}`);
8918
+ if (/^the patch/.test(said)) throw new Error(`T${said.slice(1)}`);
8916
8919
  throw new Error(`The patch does not compile: ${said}`);
8917
8920
  });
8918
8921
  const notices = new Uint8Array(fs5.readFileSync(path6.join(wclapDist, "THIRD-PARTY-NOTICES.md")));
@@ -9166,7 +9169,7 @@ var init_update = __esm({
9166
9169
  "src/update.ts"() {
9167
9170
  "use strict";
9168
9171
  init_pipe();
9169
- VERSION2 = false ? null : "0.98.4";
9172
+ VERSION2 = false ? null : "0.98.6";
9170
9173
  NAME = "faustwave";
9171
9174
  DAY = 24 * 60 * 60 * 1e3;
9172
9175
  file = () => path7.join(userData(), "cli-update.json");
@@ -9175,6 +9178,7 @@ var init_update = __esm({
9175
9178
 
9176
9179
  // src/cli.ts
9177
9180
  import fs7 from "node:fs";
9181
+ import { Worker, isMainThread } from "node:worker_threads";
9178
9182
 
9179
9183
  // src/mcp.ts
9180
9184
  import fs2 from "node:fs";
@@ -31414,7 +31418,7 @@ init_pipe();
31414
31418
  // package.json
31415
31419
  var package_default = {
31416
31420
  name: "faustwave",
31417
- version: "0.98.4",
31421
+ version: "0.98.6",
31418
31422
  description: "The FaustWave CLI \u2014 a Faust patch as a WebCLAP plugin with its page, from a terminal or a script.",
31419
31423
  keywords: [
31420
31424
  "faust",
@@ -31452,7 +31456,7 @@ var package_default = {
31452
31456
  prepublishOnly: "npm run build:npm"
31453
31457
  },
31454
31458
  dependencies: {
31455
- "@faustwave/faustwasm-webclap": "^0.2.0",
31459
+ "@faustwave/faustwasm-webclap": "^0.2.2",
31456
31460
  "@grame/faustwasm": "0.21.1"
31457
31461
  },
31458
31462
  devDependencies: {
@@ -31615,7 +31619,7 @@ The admin:
31615
31619
  yank <slug> <version> withdraw a published release
31616
31620
  releases <slug> any app's releases
31617
31621
  app visibility <slug> <draft | unlisted | public>`;
31618
- var VERSION3 = false ? null : "0.98.4";
31622
+ var VERSION3 = false ? null : "0.98.6";
31619
31623
  var usage = (admin) => `faustwave \u2014 build WebCLAP plugins from Faust patches and publish them on faustwave.io
31620
31624
 
31621
31625
  faustwave <command> [options]
@@ -31638,6 +31642,7 @@ var run = async (action, input = {}) => {
31638
31642
  return typeof r === "string" ? r : JSON.stringify(r);
31639
31643
  };
31640
31644
  var inputOf = (arg) => arg === void 0 ? {} : JSON.parse(fs7.existsSync(arg) ? fs7.readFileSync(arg, "utf8") : arg);
31645
+ var BUILD_STACK_MB = 256;
31641
31646
  var [command, ...rest] = process.argv.slice(2);
31642
31647
  var HELP = ["help", "--help", "-h"];
31643
31648
  var pluginHelp = HELP.includes(command) && rest[0] === "build" || command === "build" && rest.some((a) => HELP.includes(a)) || command === "build" && rest.length === 1 && rest[0] === "plugin";
@@ -31673,6 +31678,15 @@ try {
31673
31678
  await new Promise(() => {
31674
31679
  });
31675
31680
  }
31681
+ } else if (command === "build" && rest[0] === "plugin" && isMainThread && !process.versions.electron) {
31682
+ const code = await new Promise(
31683
+ (resolve, reject) => new Worker(new URL(import.meta.url), { argv: process.argv.slice(2), resourceLimits: { stackSizeMb: BUILD_STACK_MB } }).once("error", reject).once("exit", resolve)
31684
+ );
31685
+ if (code) {
31686
+ process.stdout.write("", () => process.exit(code));
31687
+ await new Promise(() => {
31688
+ });
31689
+ }
31676
31690
  } else if (command === "build" && rest[0] === "plugin") process.stdout.write(`${await (await Promise.resolve().then(() => (init_convert(), convert_exports))).convert(rest.slice(1))}
31677
31691
  `);
31678
31692
  else if (command === "build") throw new Error("faustwave build plugin <patch.dsp> \u2014 a plugin is what it builds.");
@@ -31690,7 +31704,7 @@ try {
31690
31704
  `);
31691
31705
  process.exit(2);
31692
31706
  }
31693
- if (command !== "mcp" && command !== "update") await (await Promise.resolve().then(() => (init_update(), update_exports))).hint();
31707
+ if (command !== "mcp" && command !== "update" && isMainThread) await (await Promise.resolve().then(() => (init_update(), update_exports))).hint();
31694
31708
  if (command !== "mcp" && !endsByItself) done();
31695
31709
  } catch (err) {
31696
31710
  process.stderr.write(`${err instanceof Error ? err.message : String(err)}
package/package.json CHANGED
@@ -1,57 +1,57 @@
1
- {
2
- "name": "faustwave",
3
- "version": "0.98.4",
4
- "description": "The FaustWave CLI — a Faust patch as a WebCLAP plugin with its page, from a terminal or a script.",
5
- "keywords": [
6
- "faust",
7
- "webclap",
8
- "wclap",
9
- "clap",
10
- "audio",
11
- "plugin",
12
- "dsp",
13
- "webassembly",
14
- "cli"
15
- ],
16
- "homepage": "https://faustwave.io/cli",
17
- "author": "Mani Weber",
18
- "license": "MIT",
19
- "type": "module",
20
- "bin": {
21
- "faustwave": "dist/npm/faustwave.mjs"
22
- },
23
- "files": [
24
- "dist/npm",
25
- "README.md",
26
- "LICENSE"
27
- ],
28
- "engines": {
29
- "node": ">=22"
30
- },
31
- "publishConfig": {
32
- "access": "public"
33
- },
34
- "scripts": {
35
- "check": "tsc --noEmit -p tsconfig.json",
36
- "build": "esbuild src/cli.ts --bundle --platform=node --format=esm --target=node22 --outfile=dist/faustwave.mjs --external:@faustwave/faustwasm-webclap --external:@grame/faustwasm --banner:js=\"import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);\" --log-level=warning",
37
- "build:npm": "node scripts/build-npm.mjs",
38
- "prepublishOnly": "npm run build:npm"
39
- },
40
- "dependencies": {
41
- "@faustwave/faustwasm-webclap": "^0.2.0",
42
- "@grame/faustwasm": "0.21.1"
43
- },
44
- "devDependencies": {
45
- "@crafics/faustwave-plugin-page": "*",
46
- "@crafics/faustwave-workflow": "*",
47
- "@modelcontextprotocol/client": "^2.4.0",
48
- "@modelcontextprotocol/server": "^2.4.0",
49
- "esbuild": "^0.28.2"
50
- },
51
- "exports": {
52
- ".": "./src/cli.ts",
53
- "./pipe": "./src/pipe.ts",
54
- "./package.json": "./package.json",
55
- "./protocol": "./src/protocol.ts"
56
- }
57
- }
1
+ {
2
+ "name": "faustwave",
3
+ "version": "0.98.6",
4
+ "description": "The FaustWave CLI — a Faust patch as a WebCLAP plugin with its page, from a terminal or a script.",
5
+ "keywords": [
6
+ "faust",
7
+ "webclap",
8
+ "wclap",
9
+ "clap",
10
+ "audio",
11
+ "plugin",
12
+ "dsp",
13
+ "webassembly",
14
+ "cli"
15
+ ],
16
+ "homepage": "https://faustwave.io/cli",
17
+ "author": "Mani Weber",
18
+ "license": "MIT",
19
+ "type": "module",
20
+ "bin": {
21
+ "faustwave": "dist/npm/faustwave.mjs"
22
+ },
23
+ "files": [
24
+ "dist/npm",
25
+ "README.md",
26
+ "LICENSE"
27
+ ],
28
+ "engines": {
29
+ "node": ">=22"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "scripts": {
35
+ "check": "tsc --noEmit -p tsconfig.json",
36
+ "build": "esbuild src/cli.ts --bundle --platform=node --format=esm --target=node22 --outfile=dist/faustwave.mjs --external:@faustwave/faustwasm-webclap --external:@grame/faustwasm --banner:js=\"import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);\" --log-level=warning",
37
+ "build:npm": "node scripts/build-npm.mjs",
38
+ "prepublishOnly": "npm run build:npm"
39
+ },
40
+ "dependencies": {
41
+ "@faustwave/faustwasm-webclap": "^0.2.2",
42
+ "@grame/faustwasm": "0.21.1"
43
+ },
44
+ "devDependencies": {
45
+ "@crafics/faustwave-plugin-page": "*",
46
+ "@crafics/faustwave-workflow": "*",
47
+ "@modelcontextprotocol/client": "^2.4.0",
48
+ "@modelcontextprotocol/server": "^2.4.0",
49
+ "esbuild": "^0.28.2"
50
+ },
51
+ "exports": {
52
+ ".": "./src/cli.ts",
53
+ "./pipe": "./src/pipe.ts",
54
+ "./package.json": "./package.json",
55
+ "./protocol": "./src/protocol.ts"
56
+ }
57
+ }