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

generator-ce

v0.4.0

Published

generator for FE supporting Polymer

Downloads

15

Readme

generator-ce

只需以下前置依赖,就能搭建起支持Polymer的前端开发调试环境

sudo npm install -g yo
sudo npm install -g generator-ce

工程

一个工程对应一个git仓库

创建

从零开始新建一个项目工程

sudo yo ce prjName [--tnpm]
cd prjName

git init
git add .
git commit -m 'init'
git remote add origin git地址
git push -u origin master

运行以上命令后,当前目录下会新建一个prjName子目录并已完成初始化本地依赖与环境

维护

接手项目进行维护,从git上clone一个已有的项目工程

正式开发之前,需初始化本地依赖与环境

git clone git地址

cd prjName

git checkout -b git分支名

执行:

sudo yo ce:env [--tnpm]

如果全局依赖安装失败,请执行:

sudo npm install -g gulp express bower

npm install

从bower安装新组件

yo ce:dep [module1] [module2] ...

通过输入待安装组件的名称(空格分隔)来调用bower进行安装并记录于bower.json中

不输入任何组件名称,则会询问是否要重新安装已有组件

安装完成后会执行一段逻辑将依赖写入/bower_components/elements.html

开始工作

调试

sudo gulp clam

打包

gulp [--publish]

业务

一次业务需求的开发,往往由一组相关的页面组成,为这一组页面生成专门子目录并进行初始化

进入工程根目录或项下任意路径,执行:

yo ce:biz bizName

页面

yo ce:htm pageName [--polymer]

polymer选项生成带有Polymer Assets的HTML文件

组件

业务组件

为满足业务具体需求而开发的业务组件,根据通用程度还可分为业务间组件业务内组件

创建命令如下:

yo ce:ele element-name

业务间组件业务内组件不同之处在于,所存放的目录位置不同,相应执行上述命令的目录位置也随之不同。 若在不符合创建组件的目录下执行命令,则会提示错误并退出。

业务间组件

业务间组件需要被工程中的多个业务共享使用,因此存放于src/elements目录下。

可在工程根目录或src/elements目录下,执行命令创建业务间组件。

业务内组件

业务内组件仅在单一业务内使用,因此存放于src/*/elements目录下。

可在src/*/elements目录下,执行命令创建业务间组件。

通用组件

core-*paper-*同级的组件,与具体业务无关

每个组件需建立一个git仓库,开发完成之后通过bower安装使用。 将被安装到src/bower_components目录下。

创建

yo ce:seed element-name

开发调试

python -m SimpleHTTPServer