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 ruleconfig/config.exs— checked, never edited: esbuild resolvescoelho.js's bare imports fromdeps/coelho/, which never reachesassets/node_moduleson its own. When no profile'sNODE_PATHcovers it, the task prints the path to addpriv/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 installing the browser packages--no-npm— print the command instead of running it--no-migration— skip the attachments table
Summary
Functions
The install command for this application, and the manager it names.
The browser packages the hook imports, as {name, requirement} pairs.
Functions
The install command for this application, and the manager it names.
Read off the lockfile: assets/ first, since that is where a Phoenix
application keeps its browser packages, then the project root for one that
keeps them there. npm when nothing says otherwise, which is what a
freshly generated application has.
The browser packages the hook imports, as {name, requirement} pairs.