mix flick. install
(flick v0.1.1)
Copy Markdown
Installs flick into a Phoenix project.
What it does
- Vendors
flick.min.js.gz(pre-minified, pre-compressed) toassets/vendor/flick.min.js.gzandpriv/static/assets/js/flick.min.js.gz. - Patches the root layout to add a
<script>tag beforeapp.js. - Generates a
WebSockbehaviour module skeleton. - Generates an upgrade controller.
- Patches
router.exwith agetroute for the WebSocket path. - Appends a starter hook to
assets/js/app.js.
Plug.Static serves .gz files automatically when gzip: true is set
(the Phoenix default). No esbuild or runtime minification step required.
Steps 3–6 are skipped when --no-boilerplate is passed.
All steps are idempotent — re-running is safe.
Usage
mix flick.install
mix flick.install --module TickerSocket --path /ws/ticker
mix flick.install --channels
mix flick.install --channels --no-boilerplate
mix flick.install --layout lib/my_app_web/components/layouts/root.html.heex
mix flick.install --no-boilerplate
mix flick.install --yesOptions
--module- WebSock module name suffix appended to the<AppWeb>namespace. Defaults toMySocket. Produces<AppWeb>.MySocketand<AppWeb>.MySocketController.--path- WebSocket URL path used in the router and JS hook. Defaults to/ws.--layout- path to the root layout file. Defaults tolib/<app>_web/components/layouts/root.html.heex.--skip-layout- skip the root layout patch.--channels- also vendorflick-channel.min.js.gzfor projects usingFlick.Socket.Serializerwith Phoenix Channels. Can be combined with--no-boilerplateto add Channels support to an existing installation without re-running the boilerplate generator.--no-boilerplate- only vendor the JS files and patch the layout; skip steps 3–6.--yes- apply all changes without prompting for confirmation.