# polymerx-cli

> Unlock the power of Polymer 3, Web Components and modern web tools.

Latest version **0.4.2** (published 2018-12-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install polymerx-cli
pnpm add polymerx-cli
yarn add polymerx-cli
bun add polymerx-cli
```

Provides the command `polymerx`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.2 |
| Published | 2018-12-24 |
| First published | 2018-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0 && <9 \|\| >=10.0.0 |
| Dependencies | 36 |
| Unpacked size | 63.2 KB |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 31 |
| Author | LasaleFamine |
| Maintainers | lasalefamine |
| Keywords | polymer-cli, cli, polymerx-cli, polymerx, polymer3, polymer, webpack3-polymer, polymer-webpack, polymer-postcss, polymer-service-workers, workbox, polymer-workbox |

## Links

- npm: https://www.npmjs.com/package/polymerx-cli
- Repository: https://github.com/PolymerX/polymerx-cli
- Issues: https://github.com/PolymerX/polymerx-cli/issues
- npm.io page: https://npm.io/package/polymerx-cli

## Dependencies (36)

- [ora](https://npm.io/package/ora.md) 3.0.0
- [pify](https://npm.io/package/pify.md) 4.0.1
- [chalk](https://npm.io/package/chalk.md) 2.4.1
- [execa](https://npm.io/package/execa.md) 1.0.0
- [which](https://npm.io/package/which.md) 1.3.1
- [yargs](https://npm.io/package/yargs.md) 12.0.5
- [gittar](https://npm.io/package/gittar.md) 0.1.1
- [webpack](https://npm.io/package/webpack.md) 4.28.2
- [get-port](https://npm.io/package/get-port.md) 4.1.0
- [inquirer](https://npm.io/package/inquirer.md) 6.2.1
- [cli-table](https://npm.io/package/cli-table.md) 0.3.1
- [ejs-loader](https://npm.io/package/ejs-loader.md) 0.3.1
- [raw-loader](https://npm.io/package/raw-loader.md) 1.0.0
- [@babel/core](https://npm.io/package/@babel/core.md) 7.2.2
- [devcert-san](https://npm.io/package/devcert-san.md) 0.3.3
- [phunctional](https://npm.io/package/phunctional.md) 0.2.1
- [babel-loader](https://npm.io/package/babel-loader.md) 8.0.4
- [console-clear](https://npm.io/package/console-clear.md) 1.1.1
- [webpack-merge](https://npm.io/package/webpack-merge.md) 4.1.5
- [git-user-local](https://npm.io/package/git-user-local.md) 0.2.0
- [postcss-loader](https://npm.io/package/postcss-loader.md) 3.0.0
- [@babel/register](https://npm.io/package/@babel/register.md) 7.0.0
- [replace-in-file](https://npm.io/package/replace-in-file.md) 3.4.2
- [update-notifier](https://npm.io/package/update-notifier.md) 2.5.0
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) 7.2.3
- [find-node-modules](https://npm.io/package/find-node-modules.md) 1.0.4
- [webpack-dev-server](https://npm.io/package/webpack-dev-server.md) 3.1.14
- [copy-webpack-plugin](https://npm.io/package/copy-webpack-plugin.md) 4.6.0
- [html-webpack-plugin](https://npm.io/package/html-webpack-plugin.md) 3.2.0
- [clean-webpack-plugin](https://npm.io/package/clean-webpack-plugin.md) 1.0.0
- [workbox-webpack-plugin](https://npm.io/package/workbox-webpack-plugin.md) 3.6.3
- [validate-npm-package-name](https://npm.io/package/validate-npm-package-name.md) 3.0.0
- [script-ext-html-webpack-plugin](https://npm.io/package/script-ext-html-webpack-plugin.md) 2.1.3
- [html-webpack-exclude-assets-plugin](https://npm.io/package/html-webpack-exclude-assets-plugin.md) 0.0.7
- [@babel/plugin-syntax-dynamic-import](https://npm.io/package/@babel/plugin-syntax-dynamic-import.md) 7.2.0
- [@babel/plugin-syntax-object-rest-spread](https://npm.io/package/@babel/plugin-syntax-object-rest-spread.md) 7.2.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.4.2 (latest) — 2018-12-24
- 0.4.1 — 2018-11-04
- 0.4.0 — 2018-10-14
- 0.3.4 — 2018-09-28
- 0.3.3 — 2018-08-19
- 0.3.2 — 2018-07-28
- 0.3.1 — 2018-07-22
- 0.3.0 — 2018-07-15
- 0.2.2 — 2018-05-06
- 0.2.1 — 2018-04-27
- 0.2.0 — 2018-04-22
- 0.1.0 — 2018-04-21
- 0.0.3 — 2018-03-11
- 0.0.2 — 2018-03-01
- 0.0.1 — 2018-03-01

## README

# PolymerX CLI

[![Greenkeeper badge](https://badges.greenkeeper.io/PolymerX/polymerx-cli.svg)](https://greenkeeper.io/)

[![npm](https://img.shields.io/npm/v/polymerx-cli.svg?style=flat-square)](https://github.com/PolymerX/polymerx-cli)

[![Build Status](https://travis-ci.org/PolymerX/polymerx-cli.svg?branch=master)](https://travis-ci.org/PolymerX/polymerx-cli) [![Build status](https://ci.appveyor.com/api/projects/status/wkxltr345600y1ih?svg=true)](https://ci.appveyor.com/project/LasaleFamine/polymerx-cli)
 [![codecov](https://codecov.io/gh/PolymerX/polymerx-cli/badge.svg?branch=master)](https://codecov.io/gh/PolymerX/polymerx-cli?branch=master)
[![GitHub issues](https://img.shields.io/github/issues/PolymerX/polymerx-cli.svg?style=flat-square)](https://github.com/PolymerX/polymerx-cli/issues)
[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg?style=flat-square)](https://github.com/sindresorhus/xo)
[![PolymerX CLI](https://img.shields.io/badge/polymerX-CLI-blue.svg?style=flat-square)](https://github.com/PolymerX/polymerx-cli)

> Unlock the power of Polymer 3, Web Components and modern web tools.

## Features

* Generate a Polymer Skeleton for your next project in 30 seconds.
* Build using **Webpack 4** under the hood producing Service Worker with WorkboxJs.
* Develop with ease with `hot-reload` and error layer enabled.
* Support for PostCSS (with personal configuration) when getting CSS from external files.
* `https` certificate generation on the fly for development.
* **No magic, just using the tools.**

More to come...

## Install

> NOTE: Node.js >= 8.x required.

```bash
$ yarn global add polymerx-cli
```

Or with NPM

```bash
$ npm install -g polymerx-cli
```

## Templates

Official templates are available at https://github.com/Polymerx-skeleton-templates


## Usage

```bash
$ polymerx create <template-name> <project-name>
```

> IMPORTANT: currently supported only `default` as template.

Example:
```bash
$ polymerx create default my-awesome-project
```

## CLI commands

### ⚙️ polymerx create

```
$ polymerx create --help

  --version   Show version number                                      [boolean]
  --cwd       A directory to use instead of $PWD.                                [default: "."]
  --name      The application's name
  --author    Author of the app                                                  [default: null]
  --force     Force option to create the directory for the new app               [default: false]
  --yarn      Use 'yarn' instead of 'npm'                              [boolean] [default: false]
  --git       Initialize version control using git                     [boolean] [default: false]
  --https     Use HTTPS?                                               [boolean] [default: false]
  --install   Install dependencies                                     [boolean] [default: true]
```

> NOTE: the required data will be asked if not specified.

### 🕶 polymerx watch

Easy development with `hot-reload` and "friendly" error layers.

##### IMPORTANT: `postcss` configuration file must be present.

```
$ polymerx watch --help

  --cwd           A directory to use instead of $PWD.              [string]   [default: .]
  --src           Entry file (index.js)                            [string]   [default: "src"]
  --config, -c    Path to custom polymerx.config.js.           [string]   [default: null]
  --port, -p      Port to start a server on                        [string]   [default: "8080"]
  --host,         Hostname to start a server on                    [string]   [default: "0.0.0.0"]
```

> NOTE: You can run the dev server on a different port using `PORT=8091 polymerx watch`

### 📦 polymerx build

Create a production build with (or without) Service Workers.
##### IMPORTANT: `postcss` configuration file must be present.

```
$ polymerx build --help

  --cwd             A directory to use instead of $PWD.          [string]   [default: .]
  --src             Entry file (index.js).                       [string]   [default: "src"]
  --dest            Directory root for output.                   [string]   [default: "dist"]
  --config, -c      Path to custom polymerx.config.js.           [string]   [default: null]
  --workers, -w     Add a service worker to application.         [boolean]  [default: true]
  --clean           Clear output directory before building.      [boolean]  [default: true]
```

## Custom Configuration

### Webpack
For customizing your `webpack` configuration create a `polymerx.config.js` what will exports a function like this:

```js
/**
 * Function that mutates original webpack config.
 * Supports asynchronous changes when promise is returned.
 *
 * @param {object} config - original webpack config.
 * @param {object} env - options passed to CLI.
 * @param {WebpackConfigHelpers} helpers - object with useful helpers when working with config.
 **/
export default function (config, env, helpers) {
  /** you can change config here **/
}
```
Since we are using the [WebpackConfigHelpers](https://github.com/developit/preact-cli/blob/master/docs/webpack-helpers.md) by `preact-cli` you can checkout also their [awesome Wiki](https://github.com/developit/preact-cli/wiki/Config-Recipes)
to get more info about the helper.

## About this tool

This CLI is heavily inspired by the awesome [`preact-cli`](https://github.com/developit/preact-cli) and aims to became a stable tool for developing Polymer 3 PWA easily and with modern web tools.


## License

MIT © [LasaleFamine](https://github.com/PolymerX)

---
_Source: https://npm.io/package/polymerx-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
