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

ngfis-command-install

v0.2.7

Published

a component installer for ngfis

Downloads

3

Readme

ngfisbower生态模块安装插件

NPM Version

为何不直接用bower

当前社区的模块质量良莠不齐,很多类库都不符合bower.json-spec,的规范,仓库里面经常有很多源码垃圾文件,甚至很多模块安装之后不可用或者根本安装不上。

@fouber 也曾多次提到「模块生态及版本管理是一个细思恐极的问题」, 所以scrat选择的方案是**「自建高质量的小范围生态」**。 对于社区的模块, 采用travis同步方式, 参见transform.js

不过作为angular的拥护者, 丢弃bower总是觉得可惜, 同时发现angular的周边模块质量相对好一点。

于是经过多次的反复纠结,于是编写了该组件,可以较完美的满足我的需求。

安装说明

需配置fis使用,可以参见ngfis项目。

npm install ngfis-command-install --save

使用说明

  • ngfis install
  • ngfis install bootstrap zepto
  • ngfis install angular-mocks --save-dev

支持的参数:

参数 | 描述 ------------ | ------------- -d, --directory [path] | 类库安装目录, 默认为component_modulesfis-conf配置项:settings.command.install.directory -c, --clean | 清除bower的cache缓存 --dev | 安装devDependencies开发模块 --no-save | 不保存到bower.json (跟bower不同,默认会保存) --save-dev | 保存到bower.jsondevDependencies属性

原理说明

配置说明

对项目的bower.json增加以下属性的支持:

属性 | 类型 | 描述 ------------ | ------------- | ------------- ignoreDependencies | Array | 忽略的依赖,如需要去掉bootstrap默认依赖的jquery overrides | Object | key为类库名称, value为配置项, 包括mapping, main, exports

  • overrides.mapping | Array | 支持字符串grunt.file的glob配置格式
  • overrides.main | Array/String | 覆盖原main属性,如bootstrap只需要第一个css
  • overrides.componentMain | String | 当main为数组的时候,需指定一个文件为主文件(release分析别名时用)
  • overrides.exports | String | ngfis自动包裹define时用到

配置的优先级: 项目bower.json配置 > 插件内置bower-meta.js > 模块本身的bower.json配置

目前内置的mapping很简单, 试过zepto ui-router angular angular-bootstrap bootstrap等几个类库都可以支持。 如有其他需求, 可以提issue, 我会内置进去。

示例

{
  "name": "ngfis-showcase",
  "private": true,
  "dependencies": {
    "angular": "~1.3.7",
    "angular-touch": "~1.3.7",
    "bootstrap": "~3.3.1",
    "zepto": "~1.1.6",
    "ui-router": "~0.2.13",
    "angular-resource": "~1.3.8",
    "angular-route": "~1.3.8",
    "angular-bootstrap": "~0.12.0"
  },
  "devDependencies": {
    "angular-mocks": "~1.3.7"
  },
  "ignoreDependencies": [
    "jquery"
  ],
  "overrides": {
    "bootstrap": {
      "main": "css/bootstrap.css",
      "mapping": [{
        "cwd": "dist",
        "src": [
        "css/**.css",
        "!js/bootstrap.js",
        "fonts/**",
        "!**/*.min.*",
        "!**/*theme.*"
        ]
      }]
    }
  },
  "resolutions": {
    "angular": "1.3.8"
  }
}

运行效果: snapshot