VS Code extension
The Graft extension adds editor support for .graft seeds (and Graftfile), the declarative recipes behind graft sapling grow.
- Syntax highlighting. graft keywords are colored, and the bash inside
run: |/script: |blocks is highlighted as shell. - Completion + hover. Type a field and get the declarative keys (
node,ruby,brew,xcode-first-launch, …) with docs on what each compiles to. - Snippets.
graft,graft-rn,graft-iosscaffold a recipe. - Commands.
Graft: Render compiled provisioning script(an eye icon in the editor title bar) andGraft: Build image from this recipe. Both shell out to thegraftCLI on your PATH. - File icon.
.graftfiles get the Graft mark in icon themes that support language icons (e.g. Seti, the default). - JSON schema. Bundled at
schemas/graft.schema.json.
Install
Section titled “Install”From the Extensions view (Shift+Cmd+X), search Graft and click Install, or:
code --install-extension arborist-sh.graftfileBuild from source: open editors/vscode in VS Code and press F5 for an Extension Development Host, or package a .vsix yourself:
cd editors/vscodenpx @vscode/vsce packagecode --install-extension dotgraft-0.1.0.vsixWhat the commands run
Section titled “What the commands run”Both commands save the active .graft file and run a command in a terminal named graft. Make sure graft (or a symlink to your dev build) is on the PATH the integrated terminal uses.
Today the extension sends:
graft image render -f "<file>"graft image build -f "<file>"There is no build step for the extension itself; it is plain JS plus declarative contributions.