@slyte/cli

1.1.0 • Public • Published

Slyte CLI - a command line tool, used to create, build and manage an application in Lyte.

Installation

npm install -g @slyte/cli@<<version>>

Usage

Create a new project

lyte new my-app

This command will create a new directory called my-app with default lyte files and folders such as routes,components,build.js(build configuration file) and package.json(contains all the lyte dependencies)

Build - Compiles all the files and places them into the output folder

lyte build <<options>>

Options:

--production(string) - In production, js files (routes, models, components etc) will be concatenated and minified as per configurations provided by the user in configuration files provided inside build folder.

--development(string) - In development, js files will be only concatenated as per configurations provided by user in json file under build folder.

    Note : Default value is development.

--watch(string) - Watches the files for changes and automatically builds the application.

    Note : Default value is false.

Building of application is based on the procedures mentioned in build.js(build/build.js in the application directory, a procedure file for building application). where you can also write your own build procedures.

Run the development server

lyte serve

This will launch a development server and serves the built app at http://localhost:3000/ by default.Port can be changed using

lyte serve --port <<port_no>>

Generate - Will create required files with basic syntax.

lyte generate <<route|component|helper|mixin|connector|serializer|schema>> <<name>> 

For route generation, two optional parameters are possible lyte generate route << name >> << path >> , if not specified path will be generated based on the route name. While route generation, router.js will be updated.

lyte generate route <<route_name>> <<route_path>> 
lyte generate route blog /blog
lyte generate route blog.list /list //Will create a sub route inside blog route.
lyte generate route blog.view view/:blogId //A dynamic route 
lyte gnereate route blog.reviewed /blog?review=true //Default query param is passed. 

Specifying folders :

We can specify the folder using -d options, this is available for the all the modules except route.

lyte generate component <<component_name>>
lyte generate component blogger-comp -d blogFolder //We can also specify the folder.
lyte generate schema bloglist -d blogFolder //Which will create bloglist schema inside blogFolder.

Note : Component name should be hyphenated. It should not contain capital letters and special character except hyphen. Similarly Helper names should not be hyphenated.

Destroy - Will delete the files and folders created using lyte generate command.

lyte destroy <<route|component|helper|mixin>> <<name>>

If you have created a component inside a folder, it is mandated to specify the same during destroy as well for example:

lyte destroy component blogger-comp -d blogFolder

/@slyte/cli/

    Package Sidebar

    Install

    npm i @slyte/cli

    Weekly Downloads

    6

    Version

    1.1.0

    License

    ISC

    Unpacked Size

    1.88 MB

    Total Files

    95

    Last publish

    Collaborators

    • lyte-team