Does the four things that stand between adding the dependency and typing in an editor.
mix coelho.installWhich are: the browser packages Coelho's hook imports, the hook itself in
assets/js/app.js, the stylesheet in assets/css/app.css, and the
attachments migration. Every one of them is small and none of them is
guessable, which is a poor trade for the first ten minutes of trying a
library.
It changes nothing it does not have to. Run it twice and the second run reports that everything is already there.
What it touches
assets/package.json— the packagescoelho.jsimports, taken from Coelho's ownpeerDependenciesso the list cannot drift from what the hook actually needs. Installed withnpm, after askingassets/js/app.js— the import, andCoelhoadded to the LiveSocket'shooks. Only when the file's shape is recognised; otherwise the two lines are printed for you to placeassets/css/app.css— the stylesheet, imported after the last@importalready there, because CSS refuses one that follows a rulepriv/repo/migrations—mix coelho.gen.migration, which is the only part an application without attachments does not need
Options
--dry-run— say what would change and change nothing--yes— do not ask before runningnpm install--no-npm— print the command instead of running it--no-migration— skip the attachments table
Summary
Functions
The browser packages the hook imports, as {name, requirement} pairs.