npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

polymerx-cli

v0.4.2

Published

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

Downloads

4

Readme

PolymerX CLI

Greenkeeper badge

npm

Build Status Build status codecov GitHub issues XO code style 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.

$ yarn global add polymerx-cli

Or with NPM

$ npm install -g polymerx-cli

Templates

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

Usage

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

IMPORTANT: currently supported only default as template.

Example:

$ 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:

/**
 * 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 by preact-cli you can checkout also their awesome Wiki to get more info about the helper.

About this tool

This CLI is heavily inspired by the awesome preact-cli and aims to became a stable tool for developing Polymer 3 PWA easily and with modern web tools.

License

MIT © LasaleFamine