1.0.0 • Published 3 years ago

hero-themes-cli-test v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
3 years ago

GitHub version

Hero Themes Cli

Instalation

$ npm install -g hero-theme-cli

To run hero commands in the theme folder, go to the theme folder and run: (it's necessary to compile ES6 js files)

$ npm init

$ npm install --save-dev hero-themes-cli
or
$ npm install --save-dev @babel/core @babel/plugin-transform-runtime @babel/preset-env @babel/runtime

Commands

The general command like "hero login", "hero whoami", "hero token" can be used from anyplace in your command line. Theme commands like "hero t:use", "hero t:s", etc should be used inside a theme folder.

CommandAliasDescriptionorgs
loginLogin with your Edools credentials
tokenIt shows your token
whoamiDisplay the current logged in user
theme:deployt:deployDeploy your theme.
theme:deploycit:deployciDeploy your theme in a ci environemnt.--env, --themeID, --token
theme:listt:lList all themes of your workspace.
theme:uset:useSelect a theme to work.
theme:copyt:cDuplicate a theme of your workspace.
theme:publisht:pSet the published theme of the logged school.
theme:downloadt:dDownload a file or download all files by giving empty file arg.
theme:uploadt:uUpload a file or uploads all files by giving empty file arg.
theme:servet:sCreate a local server which observes for changes in your local files and upload it to your enviroment url.--root jsBuildRootFile

How it works?

Authentication

The authentication is made by the service /services/netrc and the authentication tokens are stored in the standart file ~/.netrc.

Browsersync

It creates a proxy that rewrites the server endpoints with the local endpoints

Development

Run the commands

$ npm install
// It keeps listening for typescript changes and compile
$ npm run watch
// Add and link the local cli folder to the global scope of node
$ npm link

After this you can run a hero command from anywhere in the terminal

$ hero ...

CI Integration

add these commands to your build

$ npm install -g hero-themes-cli
$ hero t:deployci --env=<staging | production> --themeID=<theme id here> --token=<your token here>

Roadmap

  • create the command theme:init