cells-cli v1.4.5
CELLS (cells-cli)
cells-cli is the command line tool that provides you with common tasks and commands for working in a cells project.
Installation
To install the application just run:
npm -g install cells-cli
Once installed, cells
command will be available to you.
Usage
The first time you execute cells
will result in a menu like this:
? What's up!? (Use arrow keys)
❯ environment:setup (Checks the SSH and registry configurations)
Get help
Exit
Select the only option in the menu. This command will check whether your development environment is correctly configured or not (if this is the case, it will guide you to configure it correctly).
Once you have finished, execute cells
again. Now you should see something like this:
? What's up!? (Use arrow keys)
❯ environment:setup (Checks the SSH and registry configurations)
app:create [install command] (Context creation flow)
component:create [install command] (Context creation flow)
cordova-plugin:create [install command] (Context creation flow)
workspace:create [install command] (Context creation flow)
Get help
Exit
Any command with a [install command]
next to its name is currently not installed in your machine. By selecting it, cells will install the packages needed to execute the command and the updated menu will be shown.
cells is a context-dependant tool. This means that when you type cells
in the terminal, a list of the operations that may be executed in the current folder will be shown.
For example, after installing app:create
and executing cells
in an empty folder, you will see:
? What's up!?
❯ environment:setup (Checks the SSH and registry configurations)
app:create (Create a Cells app)
component:create [install command] (Context creation flow)
cordova-plugin:create [install command] (Context creation flow)
workspace:create [install command] (Environment download for project cells)
Get help
Exit
where you can select one of the available operations.
If cells is executed in a component folder, you will be able to select component-related commands:
? What's up!? (You are inside a component) (Use arrow keys)
❯ component:serve (Serve your components)
component:validate (Cells components validation flow)
component:version (Versioning process for components)
More commands
Get help
Exit
By selecting More commands, the tool will present a list of sub-commands (if any) available in the context. In the example you can see the individual steps of the component:validate
command:
? What's up!? (You are inside a component) More commands
? So you want more!!, What's up!? (Use arrow keys)
❯ component::lint (Cells components linter)
component::unit-tests (Cells component unit tests execution and coverage analysis)
component::demo-tests (Cells component demo testing)
component::check-theme (Check if your component is using a theme)
component::check-version (Checks the version against the last tag)
Get help
Exit
Finally, you can execute any command just by typing it after cells
, like in:
cells component::lint
In this case the command will execute no matter the current context.
This may result in unexpected behaviors, and it is not the recommended way of use.
Contexts
As of now cells
understands several contexts:
- component: any folder containing a Polymer web-component
- app: a folder containing a Polymer application, like the ones created with the
cells app:create
command - cordova-app: a Cordova application
- cordova-plugin: a Cordova plugin
- workspace: a folder containing a Cells workspace, as generated by the
cells workspace:create
command - no context is (as you may have guessed) any folder that has no other context
Help
To get more detailed help, just select the surprisingly named Get help option. It will show something like this:
? What's up!? (You are inside a component) Get help
Name: cells-cli 0.7.0 (piscosour 1.0.0) - cli tools for your cells components
Usage: cells-serve [Command] [Options...]
All commands:
environment:setup ( Checks the SSH and registry configurations )
app:create ( Context creation flow )
app:clean ( Clean the distribution of a Cells application )
app:dist ( Make the distribution of a Cells application )
app:serve-app ( Serve the distribution of a Cells application )
app:check-mocks ( Check composer mocks )
app:cordova-deploy ( Deploy the distribution in the folder ./www of a Cordova App )
component:create ( Context creation flow )
component:validate ( Cells components validation flow )
component::lint ( Cells components linter ) - Step
component::unit-tests ( Cells component unit tests execution and coverage analysis ) - Step
component::demo-tests ( Cells component demo testing ) - Step
component::check-version ( Checks the version against the last tag ) - Step
component::check-theme ( Check if your component is using a theme ) - Step
component:version ( Versioning process for components )
cordova-app:restore ( Restore your application from package.json configuration )
cordova-app:package ( Command to package platforms )
cordova-app:save ( Save the current state of cordova application in package.json )
cordova-app:state ( Command to help you manage the state of your Cordova Project )
cordova-plugin:create ( Context creation flow )
workspace:create ( Workspace creation for Cells projects )
workspace:kpis ( Show workspace kpis )
Options:
--junitReport [ -u] : write junit report at the end
--help [ -h] : shows detailed info of a command: cells-serve -h <command>
--all [ -a] : list all commands availables (context:flow[:step])
--version [ -v] : show version
--list ( all,recipes,flows,steps,contexts ) [ -la -lr -lst -lsh -lt] : list piscosour elements
--output ( verbose,debug,silly ) [ -ov -od -os] : set output level : "cells-serve -ov" -> set to verbose
--initStep [ -i] : from step : cells-serve -i <stepname>
--endStep [ -e] : to step : cells-serve -e <stepname>
--paramsFile [ -p] : json file with a set of parameters
--writeCache [ -w] : writes global config cache
--showContext [ -c] : shows the pisco context of this directory
Available commands
- environment:setup
- workspace:create
- workspace:kpis
- app:create
- app:clean
- app:dist
- app:serve-app
- app:check-mocks
- app:cordova-deploy
- component:create
- component:serve
- component:validate
- component::lint
- component::unit-tests
- component::demo-tests
- component::check-version
- component::check-theme
- component:version
- cordova-app:restore
- cordova-app:package
- cordova-app:save
- cordova-app:state
- cordova-plugin:create
environment:setup
$ cells environment:setup
Checks whether your environment is configured or not. This includes:
- having an SSH key to access to Cells Bitbucket repositories
- having npm configured to access to Cells Artifactory registry
- having bower configured to access to Cells Artifactory registry
If any of these configurations is missing, this command will guide you in the process.
Context: no context
workspace:create
$ cells workspace:create
Creates a workspace in which it will download the Cells components and apps so you can easily start working.
WARNING: This process will pull all the repos from the Cells projects in the selected folder removing any uncommitted code if there is any local repository in that folder.
When the command finishes, you will have the following folder structure:
base_folder/
apps/
bower.json
components/
tools/
Parameters:
- root: the directory in which to download the repos, cells will create it if necessary
Context: no context
workspace:kpis
$ cells workspace:kpis
Shows a table with workspace KPI's
Sample output:
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ CELLS KPI's │
├────────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────┤
│ Number of Apps │ Reusage average │
│ (Number of Apps for KPIs) │ (Average number of times that components are used) │
├────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────┤
│ │ │
│ 3 │ 3.6 │
│ │ │
├────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────┤
│ # Cellsjs.com page active users (last month) │ # Cells-cli downloads (last month) │
│ (Number of active users (M)) │ (Number of downloads of cells-cli (M)) │
├────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────┤
│ │ │
│ 286 │ 526 │
│ │ │
├────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────┤
│ Usage coefficient │ # Cells components in apps │
│ (Coefficient of component usage into apps) │ (Number of Cells components in apps) │
├────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────┤
│ │ │
│ 6.48% │ 347 │
│ │ │
├────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────┤
│ # Countries │ Number of developers │
│ (Number of countries working with Cells (M)) │ (Number of developers working in cells (M)) │
├────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────┤
│ │ │
│ 4 │ 125 │
│ │ │
├────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────┤
│ # Component Families │ # Twitter followers │
│ (Number of Cells component families) │ (Twitter followers @cellsjs (M)) │
├────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────┤
│ │ │
│ 13 │ 71 │
│ │ │
├────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────┤
│ # Guides & Resources active users (last month) │ IntraApp usage coefficient │
│ (Number of active users (M)) │ (Coefficient of component usage into Glomo.gb intra-app ) │
├────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────┤
│ │ │
│ 187 │ 65.15% │
│ │ │
├────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────┤
│ Component usage ranking │ # Tweets │
│ (Ranking of the 3 most used components) │ (Number of tweets of @cellsjs (M)) │
├────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────┤
│ cells-i18n-behavior: 179 │ │
│ buzz-ui-atom-icon: 73 │ 21 │
│ atom-icon: 71 │ │
└────────────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────┘
app:create
$ cells app:create
Creates the scaffolding of a Cells application using the Yeoman generator generator-cells-starter-kit.
The newly created application will have the following structure:
project_name/
.bowerrc
.editorconfig
.eslintignore
.eslintrc.json.gitattributes
.gitignore
.piscosour
README.md
app/
bower.json
browserslist
mocks/
Parameters:
- appName: the name of the app to create
Context: no context
app:clean
$ cells app:clean
Cleans the distribution and temporal folders:
- .tmp
- dist
- app/locales
- app/composerMocks
- app/index.html
- components/components.html
- app/styles/*.css
- app/scripts/app-config.js
- app/scripts/app-dist.js
Context: app
app:dist
$ cells app:dist
Generates a distribution of the application.
Parameters:
- type: vulcanize/novulcanize
- environment: configuration file according environment type; this configuration must exists in the path ''./app/config/{environment}.json'
Context: app
app:serve-app
$ cells app:serve-app
Opens a server for a distribution type, with mocks/no mocks, and with a environment configuration.
Parameters:
type: is the distribution type. Three possible values:
- novulcanize: Generate a distribution no vulcanized in a new folder 'dist'.
- vulcanize: Generate a distribution vulcanized in a new folder 'dist'.
- default: Just generate temporal files likes css based in scss files.
environment: is the configuration according environment type. This configuration must exists in the path
./app/config/{environment}.json
mocks: ask for open a server just for mocks. Values:
- mocks: open the mocks server.
- nomocks: Doesn't open the mocks server.
WARNING: This command will start a server using the port 80, so you may need to enter your admin password.
Context: app
app:check-mocks
$ cells app:check-mocks
Checks the correction of the composer mocks for the application. These mocks can be found in the path project_name/app/composerMocksTpl/
.
Context: app
app:cordova-deploy
$ cells app:cordova-deploy
Generates a distribution of the application and deploys it in one of its related cordova projects.
Parameters:
- type: vulcanize / novulcanize
- environment: environment configuration for the distribution
- startPoint: start point of the app
- cordovaApp: the Cordova app to deploy the distribution to
Context: app
component:create
$ cells component:create
Creates the scaffolding of a Cells component from scratch using the Yeoman generator generator-cells.
The component will have the following structure:
component-name/
.editorconfig
.gitignore
README.md
bower.json
demo/
index.html
locales/
test/
component-name.html
component-name.js
component-name.scss
Parameters:
- componentName: must contain a hyphen
The generator will ask you for the following:
_-----_
| | ╭──────────────────────────╮
|--(o)--| │ Out of the box I include │
`---------´ │ Cells's seed-element. │
( _´U`_ ) ╰──────────────────────────╯
/___A___\ /
| ~ |
__'.___.'__
´ ` |° ´ Y `
? Is your component going to use i18n? Yes
? Would you use a theme? Yes
? What's your component's theme? (Use arrow keys)
❯ theme-base
cells-composer-ui-theme
cc-ui-theme
glomo-ui-theme
Other...
Context: no context
component:serve
$ cells component:serve
This command serves your component locally, lints your javascript code and builds a polymer style component from your .scss files. It also watches for changes in your code to lint and build again when detected.
Context: component
component:validate
$ cells component:validate
Validation flow to check the quality of your component. It executes sequentially the commands component::lint
, component::unit-tests
, component::demo-tests
, component::check-version
and component::check-theme
.
Context: component
component::lint
$ cells component::lint
Runs a lint validation on the source code of the component. It uses ESLint as linter, applying a set of rules you can find in this .eslintrc.json file.
Context: component
component::unit-tests
$ cells component::unit-tests
Runs web-component-tester unit tests in the component. If all the tests pass, then it executes a code coverage analysis based on istanbul.
Sample output:
chrome 50 Beginning tests via http://localhost:2000/components/atom-button/generated-index.html?cli_browser_id=0
chrome 50 ✓ test/basic-test.html » <atom-button> » Should be in the document
chrome 50 ✓ test/basic-test.html » <atom-button> » Button have 2 nodes by default
chrome 50 Tests passed
Test run ended with great success
chrome 50 (2/0/0)
-----------------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
-----------------|----------|----------|----------|----------|----------------|
atom-button/ | 100 | 100 | 100 | 100 | |
atom-button.js | 100 | 100 | 100 | 100 | |
-----------------|----------|----------|----------|----------|----------------|
All files | 100 | 100 | 100 | 100 | |
-----------------|----------|----------|----------|----------|----------------|
=============================== Coverage summary ===============================
Statements : 100% ( 1/1 )
Branches : 100% ( 0/0 )
Functions : 100% ( 0/0 )
Lines : 100% ( 1/1 )
================================================================================
You can find two other reports (a JSON and an HTML one) in the folder coverage-reports
.
Context: component
component::demo-tests
$ cells component::demo-tests
Runs a validation on the demo of the component. This validation consists of two tests:
there is a index.html web page containing an instance of the
iron-component-page
element.there is a demo/index.html web page containing an instance of the component being tested.
This validation is only executed when the target component is not a behavior.*
Sample output:
atom-button
/index.html
✓ WebComponentsReady should be launched (3097ms)
✓ iron-component-page should be instantiated (50ms)
/demo/index.html
✓ WebComponentsReady should be launched (3083ms)
✓ atom-button should be instantiated (57ms)
4 passing (10s)
Context: component
component::check-version
$ cells component::check-version
Checks the component version in bower.json and the last git tag of the repo, to ensure they match.
Context: component
component::check-theme
$ cells component::check-theme
Checks that all variables and mixins used in the component styles file exist in any of the themes it may be using.
Context: component
component:version
$ cells component:version
Versioning process for a component. Updates the bower.json file with the version received and executes the following commands:
$ git add bower.json
$ git commit -m 'chore(): version'
$ git tag -a version -m annotation
Parameters:
- version: the version number to set
- annotation: the annotation for the tag
Context: component
cordova-app:restore
$ cells cordova-app:restore
Restores the application (installs cordova platforms and plugins) from the configuration stored in the package.json of the app. This configuration may be generated by using cells cordova-app:save
.
WARNING: it is recommended to completely remove the platforms/
and plugins/
folders before executing this command.
Context: cordova-app
cordova-app:package
$ cells cordova-app:package
Builds and packages the application for the selected platforms.
Parameters:
- platform: select the platform to package from a list
? Select the platforms to package:
❯◉ Android
◉ iOS
Context: cordova-app
cordova-app:save
$ cells cordova-app:save
Saves the current application configuration (platforms and plugins) to the package.json file. Later you will be able to restore the application from this configuration by using cells cordova-app:restore
.
Context: cordova-app
cordova-app:state
$ cells cordova-app:state
Checks the current state of your cordova app (plugins versions) and asks you whether you want to update to the latest versions or not.
Context: cordova-app
cordova-plugin:create
$ cells cordova-plugin:create
Creates the scaffolding of a Cordova plugin from scratch using the Yeoman generator generator-cells-cordova-plugin.
The generator will ask you for the following params:
? What is your plugins's name ?
? Select your platforms
❯◉ android
◉ ios
◉ windows
? write the method that you want to expose separated with commas)
? write the default configuration that you want to expose separated with commas)
? write the post messages that you want to expose separated with commas)
? Do you want to create a Polymer cover with this plugin? (Y/n)
? Do you want to create a CordovaProject with this plugin? (Y/n)
Context: no context
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago