Scaffolding with create-soundor-app
A reference of the soundor-create-plugin skill.
soundor-create-plugin reads this reference when a task needs it. Source on GitHub
create-soundor-app is the official way to start a project. It:
- asks for the project name (or takes it as the argument);
- asks which runtimes to target: VST3 (preselected), Web, or both;
- detects the package manager it was started with (npm or pnpm), or asks;
- resolves a dependency tree it was tested with (falling back to older compatible releases when the newest are not yet installable under the package manager's policy) and writes the lockfile;
- copies the template, installs with the lockfile, and runs
soundor gen, which creates the Rust crate inlib/.
Direct Soundor dependencies are pinned exactly in package.json. Keep them
that way, and upgrade them together (the CLI, @soundor/config and
@soundor/react share a release; the runtimes and the VST3 host have their
own versions).
Commands
npm create soundor-app@latest my-plugin # npm
pnpm create soundor-app@latest my-plugin # pnpm@latest takes the current release. Name an exact version
(create-soundor-app@0.21.1) to reproduce a project, or when documentation
you follow was written for that version.
The directory must not exist. . scaffolds into the current directory, and
after a confirmation removes everything in it except package-manager
configuration: never use it where the user has files.
Answering the prompts without a terminal
The runtime question is always asked; there are no flags for it. An agent
whose commands run without a terminal sees the prompt and then nothing
happens, so either ask the user to run the command in their terminal, or
answer it through a pseudo-terminal. On Linux and macOS, script provides
one; the keys below select VST3 and Web (Down, Space, Enter):
(sleep 10; printf '\033[B'; sleep 1; printf ' '; sleep 1; printf '\r'; sleep 600) \
| npm_config_yes=true script -qfec "npm create soundor-app@latest my-plugin" /dev/nullnpm_config_yes=trueanswers npm's own "Ok to proceed?" for downloading the scaffolder.- For VST3 only, send just
\r(Enter keeps the preselection). - On macOS,
scripttakes different options:script -q /dev/null npm create soundor-app@latest my-plugin. - The trailing
sleepkeeps input open while dependencies install; the command ends when the scaffolder prints its next steps.
Check the result rather than the exit code: package.json should list
@soundor/vst3-runtime, @soundor/web-runtime, or both, and lib/ should
exist.
Adding the other runtime later
Install the runtime package at the version the project's other Soundor
packages were released with, add its factory to runtimes in
soundor.config.ts, and add the scripts:
npm install @soundor/web-runtime@<version>import { vst3Runtime } from '@soundor/vst3-runtime';
import { webRuntime } from '@soundor/web-runtime';
// in defineSoundorConfig({ ... })
runtimes: [vst3Runtime(), webRuntime()],"build:vst3": "soundor build vst3",
"build:web": "soundor build web",
"dev:web": "soundor dev web"Adding the VST3 runtime also needs @soundor/vst3-host as a dev dependency.
Run npm run gen and npm run doctor afterwards.
When it fails
- Dependency resolution failed: usually a release not yet installable under the package manager's minimum release age, or a network problem. Report the error; do not loosen the user's policy without asking.
soundor genfailed: runnpx soundor genin the project to see the config error.doctorreports a missing tool: install it with the user's agreement (Rust from rustup, the wasm target withrustup target add), then runnpm run doctoragain.