@pollon/cli v0.0.1-a
Pollon CLI
Development tools for Pollon
The Pollon CLI creates, manages and builds your Pollon applications. It is still in the early stages of development but its core functionalities are functional.
Note for early adopters
As the time of writing the Pollon JS is not yet published on NPM and we plan to do it ASAP. Until then you can clone all the pollon-js related repositories and publish them in a private NPM registry like Verdaccio
All the relevant packages are:
- Light DOM. A lightweight utility to work with the DOM;
- Message Broker. A message broker implementation for the Pollon framework;
- State Machine. An event based finite state machine implementation for the Pollon framework;
- Juice DSL.An Handy DSL that helps to decouple the user interaction from the business logic in a frontend application;
- Pollon. The actual framework;
- Juice plugin. Custom Juice behaviours for the Pollon framework;
- HTTP plugin. A tiny wrapper around the fetch API;
- Systemjs plugin. SystemJS module loader for the Pollon framework;
Knockout plugin. A plugin that enables Knockoutjs as a template engine. A Vue plugin is in the making;
Getting Started
Installation
To get started locally, we need to clone the repo and npm link
it to make it work globally on your machine.
As the Pollon CLI become more stable, it will be available via npm for you to install. For now, follow these instructions:
- Clone this repository to your local computer using
git
. - Make sure that you have Node and NPM installed on your machine. See instructions here.
- Make sure that you have
@babel/cli
installed globally. See instructions here - Run
sudo npm link
(no arguments) from the root of your clone of this application to install it globally.
Help me!
The Pollon CLI is in the early stages of development, but still, it comes with a built-in command helper. As you would expect, you can inspect all the CLI commands just by typing:
pollon help
Create a new Application
You can create a new application using the Pollon CLI via this command:
pollon app:new <application-name>
Answer to some questions regarding the application you are going to create and you are good to go. What happens under the hood is as follow:
- A folder named after your application is created;
- All the application's NPM dependencies are installed;
- The application is built by the CLI against all the configurations given;
Create a module
You can create a new module using the Pollon CLI via this command:
pollon module:new <module-name>
Answer to some questions regarding the module you are going to create and you are good to go. What happens under the hood is as follow:
- A folder named after your module is created;
- The pollon.json file is being updated accordingly;
- The application is built by the CLI against all the configurations given;
Run the application
After you created your application, you can cd
into the application folder and run it.
The Pollon CLI doesn't ship with an http server on its own, so you need to use something like http-server to serve your newly created application.
Development and deploy
Whenever you make update to your Pollon application you need to rebuild it in order to see those update. You can do it using the Pollon CLI via this command:
pollon app:build
inside the application folder.
If you are in heavy development mode, you can automate this process by setting up a watcher on the app/**
folder.
pollon app:build --watch
Note: this command may need to be run with sudo privileges in order to increase the system limit for number of file watchers. Even if it is not advisable to run CLI commands as root, you should be fine in a development environment.