Skip to main content

Module new_app

Module new_app 

Source
Expand description

whisker new <name> — scaffold a new Whisker app crate.

Creates a directory matching the supplied crate name with the minimum-viable Whisker app skeleton: a single-crate workspace Cargo.toml, a tiny src/lib.rs with #[whisker::main], the whisker.rs Config probe, a .gitignore, and a README.md. The result compiles standalone — the user runs whisker run --target host (or --target ios / android if their machine passes whisker doctor) and sees an interactive counter.

§Why a single-crate workspace?

whisker run walks up from the crate’s Cargo.toml looking for a [workspace] table — it uses the workspace root for Lynx cache paths, the rustc-shim cache dir, etc. A standalone app crate needs to advertise itself as both [package] and [workspace] so the single directory satisfies both lookups; otherwise whisker run errors out with “no [workspace] Cargo.toml at or above …”.

§Naming

  • Crate name (the <name> arg): kebab-case, must be a valid cargo package name. Example: my-app, awesome-thing.
  • Display name (derived from crate name): title-cased, spaces between words. Example: My App, Awesome Thing. Override with --display-name.
  • Bundle ID (derived from crate name): rs.example.<ns> where <ns> is _-joined snake_case. Override with --bundle-id.

Structs§

NewAppArgs
whisker new CLI arguments.

Functions§

run