1.0.6 • Published 3 years ago

@herospark/hero-themes-cli v1.0.6

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

GitHub version

Hero Themes Cli

Usage

Instalation

$ npm install -g @herospark/hero-themes-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 @herospark/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.--root jsBuildRootFile, --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

CI Integration

add these commands to your build

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

Development

Local 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 ...

Deploy

Code merged into main branch will trigger package publication in NPM using Github Actions Workflow. Publishing will only occur when version at package.json changes.

Roadmap

  • create the command theme:init