Skip to content

benspaulding/nova-procfile

Repository files navigation

Procfile extension for Nova

A Nova extension with support for Procfiles.

The Procfile is mostly known for its use by Heroku and Foreman. However, it is supported by a number of other services and utilities, and is extremely handy for development.

Features

Syntax Highlighting

Within Procfiles the names of valid process definitions are highlighted. The process values are also highlighted as shell commands.

Symbol Navigation

You have probably never seen a long Procfile, but just in case you do, this extension has you covered! You can navigate through the processes with the symbol navigator or the command palette.

Release Notes

See the changelog.

Todo

There are still a few things I plan to do.

  • Add diagnostics to warn if a process name is not unique.
  • Add formatting capabilities.
  • Add automatic tasks for running Procfiles.

Procfile example

As an example of how handy a Procfile can be, with this .env file:

DJANGO_SETTINGS_MODULE=my_site.settings.local
WEB_HOST=0.0.0.0:8000
BROWSERSYNC_PORT=9000

… and this Procfile:

# Run the Django Web app.
django: django-admin runserver "$WEB_HOST"

# Monitor and rebuild all static/front-end assets.
assets: npm run watch

# Run Browser Sync proxied to the Django Web app.
djsync: browser-sync start --proxy="$WEB_HOST" --port="$BROWSERSYNC_PORT"

… you can run honcho start and have it all up and running!

Procfile runners: Foreman & Clones

The most used and robust are:

Others include:

  • node-foreman (Node) — n.b. How on earth is this not named “Noreman”? I insist on referring to it as such!
  • Shoreman (Shell)
  • forego (Go)

There is no published standard for Procfile syntax, but Foreman can be used as the reference implementation. Though the various runners recognize different things as comments, process, or errors, Foreman’s syntax is recognized by this extension.

Procfile Foreman Honcho Goreman Noreman Shoreman forego
n0:·…
n1:…
n-4:·…
# n3:·… # # # # #
#n4:·… # # # # #
n5·:… # #
·n6:·… # #
n·7:·… # # ✓ / ✗
n8·:·… # #
n9·… # # #
legend
valid process
ignored / comment #
error / hang